diff --git a/assets/DailyMotion-D6Fm3btq.js b/assets/DailyMotion-LcyIyxiV.js similarity index 97% rename from assets/DailyMotion-D6Fm3btq.js rename to assets/DailyMotion-LcyIyxiV.js index bf3f8152d..22f63b239 100644 --- a/assets/DailyMotion-D6Fm3btq.js +++ b/assets/DailyMotion-LcyIyxiV.js @@ -1 +1 @@ -import{g as P,r as v,u as D,p as O}from"./index-C25XRLXR.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-C00J3dbo.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-DBfk6UAn.js b/assets/Facebook-CEQRJtOO.js similarity index 98% rename from assets/Facebook-DBfk6UAn.js rename to assets/Facebook-CEQRJtOO.js index 42562d571..09618b3a4 100644 --- a/assets/Facebook-DBfk6UAn.js +++ b/assets/Facebook-CEQRJtOO.js @@ -1 +1 @@ -import{g as _,r as g,u as P,p as m}from"./index-C25XRLXR.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-C00J3dbo.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-DHva2v9W.js b/assets/FilePlayer-DvQ-UKAf.js similarity index 99% rename from assets/FilePlayer-DHva2v9W.js rename to assets/FilePlayer-DvQ-UKAf.js index ade8e1753..346afd719 100644 --- a/assets/FilePlayer-DHva2v9W.js +++ b/assets/FilePlayer-DvQ-UKAf.js @@ -1 +1 @@ -import{g as b,r as _,u as O,p as A}from"./index-C25XRLXR.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-C00J3dbo.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-BxuUjAjC.js b/assets/Kaltura-B-5UXQjQ.js similarity index 97% rename from assets/Kaltura-BxuUjAjC.js rename to assets/Kaltura-B-5UXQjQ.js index 3b973c650..f48270d74 100644 --- a/assets/Kaltura-BxuUjAjC.js +++ b/assets/Kaltura-B-5UXQjQ.js @@ -1 +1 @@ -import{g as y,r as f,u as _,p as m}from"./index-C25XRLXR.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-C00J3dbo.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-BSAT7qfZ.js b/assets/Mixcloud-Dmu-zW6D.js similarity index 97% rename from assets/Mixcloud-BSAT7qfZ.js rename to assets/Mixcloud-Dmu-zW6D.js index 326535df3..d74874ff6 100644 --- a/assets/Mixcloud-BSAT7qfZ.js +++ b/assets/Mixcloud-Dmu-zW6D.js @@ -1 +1 @@ -import{g as _,r as f,u as m,p as g}from"./index-C25XRLXR.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-C00J3dbo.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-73v6q4C9.js b/assets/Mux-D9G8DHjb.js similarity index 98% rename from assets/Mux-73v6q4C9.js rename to assets/Mux-D9G8DHjb.js index f9cd17522..ec2fa9502 100644 --- a/assets/Mux-73v6q4C9.js +++ b/assets/Mux-D9G8DHjb.js @@ -1 +1 @@ -import{g as P,_ as E,r as g,p as _}from"./index-C25XRLXR.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-C00J3dbo.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-CBYRu9Ir.js b/assets/Preview-Bd7ZaSyq.js similarity index 97% rename from assets/Preview-CBYRu9Ir.js rename to assets/Preview-Bd7ZaSyq.js index 87c6636a0..4e11e4110 100644 --- a/assets/Preview-CBYRu9Ir.js +++ b/assets/Preview-Bd7ZaSyq.js @@ -1 +1 @@ -import{g as y,r as v}from"./index-C25XRLXR.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-C00J3dbo.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-vnpoNRig.js b/assets/SoundCloud-DS8KXVAo.js similarity index 97% rename from assets/SoundCloud-vnpoNRig.js rename to assets/SoundCloud-DS8KXVAo.js index b67a83fa7..098f59918 100644 --- a/assets/SoundCloud-vnpoNRig.js +++ b/assets/SoundCloud-DS8KXVAo.js @@ -1 +1 @@ -import{g as P,r as g,u as b,p as v}from"./index-C25XRLXR.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-C00J3dbo.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-BVMLG62i.js b/assets/Streamable-DWbRU8FY.js similarity index 97% rename from assets/Streamable-BVMLG62i.js rename to assets/Streamable-DWbRU8FY.js index 05cd03cb1..c1dbd0835 100644 --- a/assets/Streamable-BVMLG62i.js +++ b/assets/Streamable-DWbRU8FY.js @@ -1 +1 @@ -import{g as m,r as f,u as _,p as b}from"./index-C25XRLXR.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-C00J3dbo.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-ClbRcSjm.js b/assets/Twitch-DDWkSoF2.js similarity index 97% rename from assets/Twitch-ClbRcSjm.js rename to assets/Twitch-DDWkSoF2.js index e168a6f19..f224f4212 100644 --- a/assets/Twitch-ClbRcSjm.js +++ b/assets/Twitch-DDWkSoF2.js @@ -1 +1 @@ -import{g as w,r as D,u as C,p as N}from"./index-C25XRLXR.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-C00J3dbo.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-B9AJa_UB.js b/assets/Vidyard-DD9iuBbH.js similarity index 97% rename from assets/Vidyard-B9AJa_UB.js rename to assets/Vidyard-DD9iuBbH.js index 0ba39c82a..e6b99c6f1 100644 --- a/assets/Vidyard-B9AJa_UB.js +++ b/assets/Vidyard-DD9iuBbH.js @@ -1 +1 @@ -import{g as m,r as v,u as b,p as O}from"./index-C25XRLXR.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-C00J3dbo.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-BEBB_kk3.js b/assets/Vimeo-nVpRmTEP.js similarity index 98% rename from assets/Vimeo-BEBB_kk3.js rename to assets/Vimeo-nVpRmTEP.js index bcba62f3a..ffd4f0371 100644 --- a/assets/Vimeo-BEBB_kk3.js +++ b/assets/Vimeo-nVpRmTEP.js @@ -1 +1 @@ -import{g as d,r as f,u as m,p as _}from"./index-C25XRLXR.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-C00J3dbo.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-CtIm8wZy.js b/assets/Wistia-BHULf2Bi.js similarity index 98% rename from assets/Wistia-CtIm8wZy.js rename to assets/Wistia-BHULf2Bi.js index 00012cb7f..8c0e433af 100644 --- a/assets/Wistia-CtIm8wZy.js +++ b/assets/Wistia-BHULf2Bi.js @@ -1 +1 @@ -import{g,r as m,u as v,p as w}from"./index-C25XRLXR.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-C00J3dbo.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-CSvCyxF6.js b/assets/YouTube-Cwa38Ls5.js similarity index 98% rename from assets/YouTube-CSvCyxF6.js rename to assets/YouTube-Cwa38Ls5.js index 4803c845c..f81ee3ec1 100644 --- a/assets/YouTube-CSvCyxF6.js +++ b/assets/YouTube-Cwa38Ls5.js @@ -1 +1 @@ -import{g as U,r as I,u as L,p as M}from"./index-C25XRLXR.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-C00J3dbo.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-C25XRLXR.js b/assets/index-C00J3dbo.js similarity index 99% rename from assets/index-C25XRLXR.js rename to assets/index-C00J3dbo.js index e532d90ed..95a119022 100644 --- a/assets/index-C25XRLXR.js +++ b/assets/index-C00J3dbo.js @@ -449,7 +449,7 @@ use chrome, FireFox or Internet Explorer 11`)}var a=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(_){if(_.cancelToken&&_.cancelToken.throwIfRequested(),_.signal&&_.signal.aborted)throw new CanceledError(null,_)}function dispatchRequest(_){return throwIfCancellationRequested(_),_.headers=AxiosHeaders.from(_.headers),_.data=transformData.call(_,_.transformRequest),["post","put","patch"].indexOf(_.method)!==-1&&_.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(_.adapter||defaults$1.adapter)(_).then(function(j){return throwIfCancellationRequested(_),j.data=transformData.call(_,_.transformResponse,j),j.headers=AxiosHeaders.from(j.headers),j},function(j){return isCancel(j)||(throwIfCancellationRequested(_),j&&j.response&&(j.response.data=transformData.call(_,_.transformResponse,j.response),j.response.headers=AxiosHeaders.from(j.response.headers))),Promise.reject(j)})}const VERSION$2="1.7.2",validators$1={};["object","boolean","number","function","string","symbol"].forEach((_,a)=>{validators$1[_]=function(j){return typeof j===_||"a"+(a<1?"n ":" ")+_}});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(a===!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"))),a?a(tt,rt,nt):!0}};function assertOptions(_,a,$){if(typeof _!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const j=Object.keys(_);let et=j.length;for(;et-- >0;){const tt=j[et],rt=a[tt];if(rt){const nt=_[tt],it=nt===void 0||rt(nt,tt,_);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(a){this.defaults=a,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(a,$){try{return await this._request(a,$)}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(a,$){typeof a=="string"?($=$||{},$.url=a):$=a||{},$=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$C.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$C.merge(tt.common,tt[$.method]);tt&&utils$C.forEach(["delete","get","head","post","put","patch","common"],mt=>{delete tt[mt]}),$.headers=AxiosHeaders.concat(rt,tt);const nt=[];let it=!0;this.interceptors.request.forEach(function(xt){typeof xt.runWhen=="function"&&xt.runWhen($)===!1||(it=it&&xt.synchronous,nt.unshift(xt.fulfilled,xt.rejected))});const at=[];this.interceptors.response.forEach(function(xt){at.push(xt.fulfilled,xt.rejected)});let st,ot=0,ut;if(!it){const mt=[dispatchRequest.bind(this),void 0];for(mt.unshift.apply(mt,nt),mt.push.apply(mt,at),ut=mt.length,st=Promise.resolve($);ot{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},a(function(tt,rt,nt){j.reason||(j.reason=new CanceledError(tt,rt,nt),$(j.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const $=this._listeners.indexOf(a);$!==-1&&this._listeners.splice($,1)}static source(){let a;return{token:new CancelToken(function(et){a=et}),cancel:a}}}function spread(_){return function($){return _.apply(null,$)}}function isAxiosError(_){return utils$C.isObject(_)&&_.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(_){const a=new Axios(_),$=bind$2(Axios.prototype.request,a);return utils$C.extend($,Axios.prototype,a,{allOwnKeys:!0}),utils$C.extend($,a,null,{allOwnKeys:!0}),$.create=function(et){return createInstance(mergeConfig(_,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(a)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=_=>formDataToJSON(utils$C.isHTMLForm(_)?new FormData(_):_);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;var MatrixMessageType;(function(_){_.TEXT="m.text"})(MatrixMessageType||(MatrixMessageType={}));class MatrixMessage{constructor(a,$,j,et){Yr(this,"type");Yr(this,"sender");Yr(this,"content");Yr(this,"timestamp");this.type=a,this.sender=$,this.content=j,this.timestamp=et}static from(a){if(isTextMessageEvent(a))return new MatrixMessage(a.content.msgtype,a.sender,a.content.body,a.origin_server_ts)}}const isCreateEvent=_=>_.type==="m.room.create"&&_.content instanceof Object&&"creator"in _.content,isJoinEvent=_=>_.type==="m.room.member"&&_.content instanceof Object&&"membership"in _.content&&_.content.membership==="join",isMessageEvent=_=>_.type==="m.room.message",isTextMessageEvent=_=>isMessageEvent(_)&&_.content instanceof Object&&"msgtype"in _.content&&_.content.msgtype===MatrixMessageType.TEXT;var MatrixRoomStatus;(function(_){_[_.UNKNOWN=0]="UNKNOWN",_[_.JOINED=1]="JOINED",_[_.INVITED=2]="INVITED",_[_.LEFT=3]="LEFT"})(MatrixRoomStatus||(MatrixRoomStatus={}));class MatrixRoom{constructor(a,$=MatrixRoomStatus.UNKNOWN,j=[],et=[]){Yr(this,"id");Yr(this,"status");Yr(this,"members");Yr(this,"messages");this.id=a,this.status=$,this.members=j,this.messages=et}static fromSync(a){if(!a)return[];function $(j,et){return Object.entries(j).map(([tt,rt])=>et(tt,rt))}return[...$(a.join??{},MatrixRoom.fromJoined),...$(a.invite??{},MatrixRoom.fromInvited),...$(a.leave??{},MatrixRoom.fromLeft)]}static from(a,$){return typeof a=="string"?new MatrixRoom(a,$||MatrixRoomStatus.UNKNOWN):$!==void 0?new MatrixRoom(a.id,$,a.members,a.messages):a}static merge(a,$){return!$||$.id!==a.id?MatrixRoom.from(a):new MatrixRoom(a.id,a.status,[...$.members,...a.members].filter((j,et,tt)=>tt.indexOf(j)===et),[...$.messages,...a.messages])}static fromJoined(a,$){const j=[...$.state.events,...$.timeline.events],et=MatrixRoom.getMembersFromEvents(j),tt=MatrixRoom.getMessagesFromEvents(j);return new MatrixRoom(a,MatrixRoomStatus.JOINED,et,tt)}static fromInvited(a,$){const j=MatrixRoom.getMembersFromEvents($.invite_state.events);return new MatrixRoom(a,MatrixRoomStatus.INVITED,j)}static fromLeft(a,$){const j=[...$.state.events,...$.timeline.events],et=MatrixRoom.getMembersFromEvents(j),tt=MatrixRoom.getMessagesFromEvents(j);return new MatrixRoom(a,MatrixRoomStatus.LEFT,et,tt)}static getMembersFromEvents(a){return MatrixRoom.getUniqueEvents(a.filter($=>isCreateEvent($)||isJoinEvent($))).map($=>$.sender).filter(($,j,et)=>et.indexOf($)===j)}static getMessagesFromEvents(a){return MatrixRoom.getUniqueEvents(a.filter(isMessageEvent)).map($=>MatrixMessage.from($)).filter(Boolean)}static getUniqueEvents(a){const $={},j=[];return a.forEach((et,tt)=>{const rt=et.event_id;(rt===void 0||!(rt in $))&&(rt!==void 0&&($[rt]=tt),j.push(et))}),j}}const PRESERVED_FIELDS=["syncToken","rooms"];class MatrixClientStore{constructor(a){Yr(this,"storage");Yr(this,"state",{isRunning:!1,userId:void 0,deviceId:void 0,txnNo:0,accessToken:void 0,syncToken:void 0,pollingTimeout:void 0,pollingRetries:0,rooms:{}});Yr(this,"onStateChangedListeners",new Map);Yr(this,"waitReadyPromise");this.storage=a,this.waitReadyPromise=new Promise(async($,j)=>{try{await this.initFromStorage(),$()}catch(et){j(et)}})}get(a){return this.state[a]}getRoom(a){const $=MatrixRoom.from(a,MatrixRoomStatus.UNKNOWN);return this.state.rooms[$.id]||$}async update(a){await this.waitReady();const $=Object.assign({},this.state);this.setState(a),this.updateStorage(a),this.notifyListeners($,this.state,a)}onStateChanged(a,...$){$.length>0?$.forEach(j=>{this.onStateChangedListeners.set(j,a)}):this.onStateChangedListeners.set("all",a)}async waitReady(){return this.waitReadyPromise}async initFromStorage(){const a=await this.storage.get(StorageKey.MATRIX_PRESERVED_STATE);this.setState(a)}prepareData(a){const j=["rooms"].some(et=>a[et]!==void 0)?JSON.parse(JSON.stringify(a)):a;return Object.values(j.rooms||{}).forEach(et=>{et.messages=[]}),j}updateStorage(a){if(Object.entries(a).filter(([j,et])=>PRESERVED_FIELDS.includes(j)&&!!et).length>0){const j={};PRESERVED_FIELDS.forEach(et=>{j[et]=this.state[et]}),this.storage.set(StorageKey.MATRIX_PRESERVED_STATE,this.prepareData(j))}}setState(a){this.state={isRunning:a.isRunning||this.state.isRunning,userId:a.userId||this.state.userId,deviceId:a.deviceId||this.state.deviceId,txnNo:a.txnNo||this.state.txnNo,accessToken:a.accessToken||this.state.accessToken,syncToken:a.syncToken||this.state.syncToken,pollingTimeout:a.pollingTimeout||this.state.pollingTimeout,pollingRetries:a.pollingRetries||this.state.pollingRetries,rooms:this.mergeRooms(this.state.rooms,a.rooms)}}mergeRooms(a,$){if(!$)return a;const j=Array.isArray($)?$:Object.values($),et=Object.assign({},a);return j.forEach(tt=>{et[tt.id]=MatrixRoom.merge(tt,a[tt.id])}),et}notifyListeners(a,$,j){const et=this.onStateChangedListeners.get("all");et&&et(a,$,j),keys(j).filter(tt=>j[tt]!==void 0).forEach(tt=>{const rt=this.onStateChangedListeners.get(tt);rt&&rt(a,$,j)})}}const logger$6=new Logger("MatrixHttpClient"),CLIENT_API_R0="/_matrix/client/r0";class MatrixHttpClient{constructor(a){Yr(this,"baseUrl");Yr(this,"cancelTokenSource");this.baseUrl=a,this.cancelTokenSource=axios.CancelToken.source()}async get(a,$,j){return this.send("GET",a,j,$)}async post(a,$,j,et){return this.send("POST",a,j,et,$)}async put(a,$,j,et){return this.send("PUT",a,j,et,$)}async cancelAllRequests(){return this.cancelTokenSource.cancel("Manually cancelled")}async send(a,$,j,et,tt){const rt=j?this.getHeaders(j):void 0,nt=et?this.getParams(et):void 0;let it;try{it=await axios.request({method:a,url:$,baseURL:this.apiUrl(CLIENT_API_R0),headers:rt,data:tt,params:nt,cancelToken:this.cancelTokenSource.token})}catch(at){const st=at;throw logger$6.error("send",st.code,st.message,st.response.data),at.response.data}return it.data}getHeaders(a){const $={},j=[];if(a.accessToken&&j.push(["Authorization",`Bearer ${a.accessToken}`]),j.length!==0){for(const[et,tt]of j)$[et]=tt;return $}}getParams(a){if(!a)return;const $=Object.assign(a,{});return keys($).forEach(j=>$[j]===void 0&&delete $[j]),$}apiUrl(...a){const $=this.baseUrl.endsWith("/")?this.baseUrl.substr(0,this.baseUrl.length-1):this.baseUrl,j=a.map(et=>et.startsWith("/")?et.substr(1):et);return[$,...j].join("/")}}class MatrixRoomService{constructor(a){Yr(this,"httpClient");this.httpClient=a}async createRoom(a,$={}){return this.httpClient.post("/createRoom",$,{accessToken:a})}async inviteToRoom(a,$,j){return j.status!==MatrixRoomStatus.JOINED&&j.status!==MatrixRoomStatus.UNKNOWN?Promise.reject(`User is not a member of room ${j.id}.`):this.httpClient.post(`/rooms/${encodeURIComponent(j.id)}/invite`,{user_id:$},{accessToken:a})}async joinRoom(a,$){return $.status===MatrixRoomStatus.JOINED?Promise.resolve({room_id:$.id}):this.httpClient.post(`/rooms/${encodeURIComponent($.id)}/join`,{},{accessToken:a})}async getJoinedRooms(a){return this.httpClient.get("/joined_rooms",void 0,{accessToken:a})}}class MatrixUserService{constructor(a){Yr(this,"httpClient");this.httpClient=a}async login(a,$,j){return this.httpClient.post("/login",{type:"m.login.password",identifier:{type:"m.id.user",user:a},password:$,device_id:j})}}class MatrixEventService{constructor(a){Yr(this,"httpClient");Yr(this,"cachedPromises",new Map);this.httpClient=a}async sync(a,$){return this.withCache("sync",()=>this.httpClient.get("/sync",{timeout:$?$.pollingTimeout:void 0,since:$?$.syncToken:void 0},{accessToken:a}))}async sendMessage(a,$,j,et){return new Promise((tt,rt)=>this.scheduleEvent({accessToken:a,roomId:$,type:"m.room.message",content:j,txnId:et,onSuccess:tt,onError:rt}))}scheduleEvent(a){this.sendEvent(a)}async sendEvent(a){const{roomId:$,type:j,txnId:et,content:tt,accessToken:rt}=a;try{const nt=await this.httpClient.put(`/rooms/${encodeURIComponent($)}/send/${j}/${encodeURIComponent(et)}`,tt,{accessToken:rt});a.onSuccess(nt)}catch(nt){a.onError(nt)}}withCache(a,$){let j=this.cachedPromises.get(a);return j||(j=$().finally(()=>{this.cachedPromises.delete(a)}),this.cachedPromises.set(a,j)),j}}class EventEmitter{constructor(){Yr(this,"events",{})}on(a,$){return typeof this.events[a]!="object"&&(this.events[a]=[]),this.events[a].push($),()=>this.removeListener(a,$)}removeListener(a,$){if(typeof this.events[a]!="object")return;if(!$){this.events[a]=[];return}const j=this.events[a].indexOf($);j>-1&&this.events[a].splice(j,1)}removeAllListeners(){Object.keys(this.events).forEach(a=>this.events[a].splice(0,this.events[a].length))}emit(a,...$){typeof this.events[a]=="object"&&[...this.events[a]].forEach(j=>j.apply(this,$))}once(a,$){const j=this.on(a,(...et)=>{j(),$.apply(this,et)});return j}}var MatrixClientEventType;(function(_){_.INVITE="invite",_.MESSAGE="message"})(MatrixClientEventType||(MatrixClientEventType={}));class MatrixClientEventEmitter extends EventEmitter{constructor(){super(...arguments);Yr(this,"eventEmitProviders",new Map([[MatrixClientEventType.INVITE,()=>[this.isInvite,this.emitInvite.bind(this)]],[MatrixClientEventType.MESSAGE,()=>[this.isMessage,this.emitMessage.bind(this)]]]))}onStateChanged($,j,et){for(const tt of keys(MatrixClientEventType))this.emitIfEvent(MatrixClientEventType[tt],et)}emitIfEvent($,j){const et=this.eventEmitProviders.get($);if(et){const[tt,rt]=et();tt(j)&&rt($,j)}}emitClientEvent($,j,et){this.emit($,{type:$,content:j,timestamp:et})}isInvite($){return $.rooms?$.rooms.some(j=>j.status===MatrixRoomStatus.INVITED):!1}emitInvite($,j){j.rooms.filter(et=>et.status===MatrixRoomStatus.INVITED).map(et=>[et.id,et.members]).forEach(([et,tt])=>{this.emitClientEvent($,{roomId:et,members:tt})})}isMessage($){return $.rooms?$.rooms.some(j=>j.messages.length>0):!1}emitMessage($,j){j.rooms.filter(et=>et.messages.length>0).map(et=>et.messages.map(tt=>[et.id,tt,tt.timestamp])).reduce((et,tt)=>et.concat(tt),[]).forEach(([et,tt,rt])=>{this.emitClientEvent($,{roomId:et,message:tt},rt)})}}const logger$5=new Logger("MatrixClient"),IMMEDIATE_POLLING_RETRIES=3,RETRY_INTERVAL=5e3;class MatrixClient{constructor(a,$,j,et,tt,rt){Yr(this,"store");Yr(this,"eventEmitter");Yr(this,"userService");Yr(this,"roomService");Yr(this,"eventService");Yr(this,"httpClient");Yr(this,"isActive",!0);Yr(this,"_isReady",new ExposedPromise);this.store=a,this.eventEmitter=$,this.userService=j,this.roomService=et,this.eventService=tt,this.httpClient=rt,this.store.onStateChanged((nt,it,at)=>{this.eventEmitter.onStateChanged(nt,it,at)},"rooms")}static create(a){const $=new MatrixClientStore(a.storage),j=new MatrixClientEventEmitter,et=new MatrixHttpClient(a.baseUrl),tt=new MatrixUserService(et),rt=new MatrixRoomService(et),nt=new MatrixEventService(et);return new MatrixClient($,j,tt,rt,nt,et)}get joinedRooms(){return new Promise(async a=>{await this.isConnected(),a(Object.values(this.store.get("rooms")).filter($=>$.status===MatrixRoomStatus.JOINED))})}get invitedRooms(){return new Promise(async a=>{await this.isConnected(),a(Object.values(this.store.get("rooms")).filter($=>$.status===MatrixRoomStatus.INVITED))})}get leftRooms(){return new Promise(async a=>{await this.isConnected(),a(Object.values(this.store.get("rooms")).filter($=>$.status===MatrixRoomStatus.LEFT))})}async start(a){const $=await this.userService.login(a.id,a.password,a.deviceId);await this.store.update({accessToken:$.access_token});const j=new Promise(async(et,tt)=>{await this.poll(0,async rt=>{this.store.get("isRunning")||et(),await this.store.update({isRunning:!0,syncToken:rt.next_batch,pollingTimeout:3e4,pollingRetries:0,rooms:MatrixRoom.fromSync(rt.rooms)})},async rt=>{this.store.get("isRunning")||tt(rt),await this.store.update({isRunning:!1,pollingRetries:this.store.get("pollingRetries")+1})})});return j.then(()=>{this._isReady.resolve()}).catch(console.error),j}async isConnected(){return this._isReady.promise}async stop(){return logger$5.log("MATRIX CLIENT STOPPED"),this.isActive=!1,this._isReady=new ExposedPromise,this.httpClient.cancelAllRequests()}subscribe(a,$){this.eventEmitter.on(a,$)}unsubscribe(a,$){$&&this.eventEmitter.removeListener(a,$)}unsubscribeAll(a){this.eventEmitter.removeListener(a)}async getRoomById(a){return await this.isConnected(),this.store.getRoom(a)}async createTrustedPrivateRoom(...a){return await this.isConnected(),this.requiresAuthorization("createRoom",async $=>(await this.roomService.createRoom($,{room_version:"5",invite:a,preset:"public_chat",is_direct:!0})).room_id)}async inviteToRooms(a,...$){await this.isConnected(),await this.requiresAuthorization("invite",j=>Promise.all($.map(et=>{const tt=this.store.getRoom(et);this.roomService.inviteToRoom(j,a,tt).catch(rt=>logger$5.warn("inviteToRooms",rt))})))}async joinRooms(...a){await this.isConnected(),await this.requiresAuthorization("join",$=>Promise.all(a.map(j=>{const et=this.store.getRoom(j);return this.roomService.joinRoom($,et)})))}async sendTextMessage(a,$){await this.isConnected(),await this.requiresAuthorization("send",async j=>{const et=await this.createTxnId();return this.eventService.sendMessage(j,a,{msgtype:"m.text",body:$},et)})}async poll(a,$,j){const et=this.store,tt=this.sync.bind(this),rt=async(nt,it)=>{let at=0;try{const st=await tt();$(st)}catch(st){j(st),at=et.get("pollingRetries"),this.isActive&&logger$5.log(`Retry syncing... ${at} retries so far`)}finally{this.isActive?setTimeout(async()=>{await rt(nt,it)},at>IMMEDIATE_POLLING_RETRIES?RETRY_INTERVAL+a:a):it(new Error("Syncing stopped manually."))}};return new Promise(rt)}async sync(){return this.requiresAuthorization("sync",async a=>this.eventService.sync(a,{pollingTimeout:this.store.get("pollingTimeout"),syncToken:this.store.get("syncToken")}))}async requiresAuthorization(a,$){const j=this.store.get("accessToken");return j?$(j):Promise.reject(`${a} requires authorization but no access token has been provided.`)}async createTxnId(){const a=new Date().getTime(),$=this.store.get("txnNo");return await this.store.update({txnNo:$+1}),`m${a}.${$}`}}const logger$4=new Logger("P2PCommunicationClient"),RESPONSE_WAIT_TIME_MS=1e3,REGIONS_AND_SERVERS={[Regions.EUROPE_WEST]:["beacon-node-1.diamond.papers.tech","beacon-node-1.sky.papers.tech","beacon-node-2.sky.papers.tech","beacon-node-1.hope.papers.tech","beacon-node-1.hope-2.papers.tech","beacon-node-1.hope-3.papers.tech","beacon-node-1.hope-4.papers.tech","beacon-node-1.hope-5.papers.tech"],[Regions.NORTH_AMERICA_EAST]:["beacon-node-1.beacon-server-1.papers.tech"],[Regions.NORTH_AMERICA_WEST]:["beacon-node-1.beacon-server-2.papers.tech"],[Regions.ASIA_EAST]:["beacon-node-1.beacon-server-3.papers.tech"],[Regions.AUSTRALIA]:["beacon-node-1.beacon-server-4.papers.tech"]},sleep$2=_=>new Promise(a=>setTimeout(a,_));class P2PCommunicationClient extends CommunicationClient{constructor($,j,et,tt,rt,nt,it){super(j);Yr(this,"name");Yr(this,"replicationCount");Yr(this,"storage");Yr(this,"iconUrl");Yr(this,"appUrl");Yr(this,"client",new ExposedPromise);Yr(this,"initialEvent");Yr(this,"initialListener");Yr(this,"selectedRegion");Yr(this,"ENABLED_RELAY_SERVERS");Yr(this,"relayServer");Yr(this,"activeListeners",new Map);Yr(this,"ignoredRooms",[]);Yr(this,"loginCounter",0);this.name=$,this.replicationCount=et,this.storage=tt,this.iconUrl=nt,this.appUrl=it,logger$4.log("constructor","P2PCommunicationClient created"),this.ENABLED_RELAY_SERVERS=REGIONS_AND_SERVERS,rt&&(this.ENABLED_RELAY_SERVERS={...REGIONS_AND_SERVERS,...rt})}async getPairingRequestInfo(){const $=new P2PPairingRequest(await generateGUID(),this.name,await this.getPublicKey(),BEACON_VERSION,(await this.getRelayServer()).server);return this.iconUrl&&($.icon=this.iconUrl),this.appUrl&&($.appUrl=this.appUrl),$}async getPairingResponseInfo($){const j=new P2PPairingResponse($.id,this.name,await this.getPublicKey(),$.version,(await this.getRelayServer()).server);return this.iconUrl&&(j.icon=this.iconUrl),this.appUrl&&(j.appUrl=this.appUrl),j}async findBestRegionAndGetServer(){var at;if(this.selectedRegion)return(at=this.relayServer)==null?void 0:at.promiseResult;const $=Object.keys(this.ENABLED_RELAY_SERVERS),j=[],et=new ExposedPromise;let tt=0;const rt=new ExposedPromise;$.forEach(st=>{const ot=this.ENABLED_RELAY_SERVERS[st]??[];if(ot.length===0)return;tt+=2;const ut=(xt=!0)=>{const Ct=Date.now();Promise.race([this.getBeaconInfo(mt),rt.promise]).then(Pt=>{typeof Pt!="boolean"&&(j.push({time:Date.now()-Ct,server:mt,region:st,result:Pt}),j.length>=tt&&et.resolve(void 0),xt||ut(!0))})},dt=Math.floor(Math.random()*ot.length),mt=ot[dt];ut(!1)}),await Promise.race([et.promise,sleep$2(RESPONSE_WAIT_TIME_MS)]);let nt=0;for(;j.length<=0;){if(nt>=100)throw new Error("No server responded.");await sleep$2(50),nt++}rt.resolve(!0);const it=j.reduce((st,ot)=>st.time0){const et=await this.getBeaconInfo($);return this.relayServer.resolve({server:$,timestamp:et.timestamp,localTimestamp:new Date().getTime()}),{server:$,timestamp:et.timestamp}}const j=await this.findBestRegionAndGetServer();if(!j)throw new Error("No servers found");return this.storage.set(StorageKey.MATRIX_SELECTED_NODE,j.server).catch(et=>logger$4.log(et)),this.relayServer.resolve({server:j.server,timestamp:j.timestamp,localTimestamp:new Date().getTime()}),{server:j.server,timestamp:j.timestamp}}async getBeaconInfo($){return axios.get(`https://${$}/_synapse/client/beacon/info`).then(j=>({region:j.data.region,known_servers:j.data.known_servers,timestamp:Math.floor(j.data.timestamp)}))}async tryJoinRooms($,j=1){try{await(await this.client.promise).joinRooms($)}catch(et){j<=10&&et.errcode==="M_FORBIDDEN"?(logger$4.log("Retrying to join...",et),setTimeout(async()=>{await this.tryJoinRooms($,j+1)},200)):logger$4.log(`Failed to join after ${j} tries.`,et)}}async start(){logger$4.log("start","starting client"),logger$4.log("start","connecting to server");const $=await this.getRelayServer(),j=MatrixClient.create({baseUrl:`https://${$.server}`,storage:this.storage});if(this.initialListener=async at=>{this.initialEvent&&this.initialEvent.timestamp&&at&&at.timestamp?this.initialEvent.timestamp{let st;at.content.members.length===1&&(st=at.content.members[0]),await this.tryJoinRooms(at.content.roomId),st&&(await this.updateRelayServer(st),await this.updatePeerRoom(st,at.content.roomId))}),!$.timestamp)throw new Error("No timestamp received from relay server");const et=Math.floor($.timestamp),tt=`login:${Math.floor(et/(5*60))}`;logger$4.log("start",`login ${tt}, ${await this.getPublicKeyHash()} on ${$.server}`);const rt=blake2b$1.hash(encode_1(tt),32),nt=this.keyPair.secretKey??this.keyPair.privateKey,it=ed25519.sign(nt,rt);try{await j.start({id:await this.getPublicKeyHash(),password:`ed:${toHex$1(it)}:${await this.getPublicKey()}`,deviceId:toHex$1(this.keyPair.publicKey)})}catch{if(logger$4.error("start","Could not log in, retrying"),await this.reset(),!this.selectedRegion)throw new Error("No region selected.");if(this.loginCounter<=(this.ENABLED_RELAY_SERVERS[this.selectedRegion]??[]).length){this.loginCounter++,this.start();return}else throw logger$4.error("start","Tried to log in to every known beacon node, but no login was successful."),new Error("Could not connect to any beacon nodes. Try again later.")}logger$4.log("start","login successful, client is ready"),this.client.resolve(j)}async stop(){logger$4.log("stop","stopping client"),this.client.isResolved()&&await(await this.client.promise).stop().catch($=>logger$4.error($)),await this.reset()}async reset(){logger$4.log("reset","resetting connection"),await this.storage.delete(StorageKey.MATRIX_PEER_ROOM_IDS).catch($=>logger$4.log($)),await this.storage.delete(StorageKey.MATRIX_PRESERVED_STATE).catch($=>logger$4.log($)),await this.storage.delete(StorageKey.MATRIX_SELECTED_NODE).catch($=>logger$4.log($)),this.relayServer=void 0,this.client=new ExposedPromise,this.initialEvent=void 0,this.initialListener=void 0}async listenForEncryptedMessage($,j){if(this.activeListeners.has($))return;logger$4.log("listenForEncryptedMessage",`start listening for encrypted messages from publicKey ${$}`);const et=await this.createCryptoBoxServer($,this.keyPair),tt=async it=>{if(this.isTextMessage(it.content)&&await this.isSender(it,$)){let at;await this.updateRelayServer(it.content.message.sender),await this.updatePeerRoom(it.content.message.sender,it.content.roomId);try{at=Buffer$g.from(it.content.message.content,"hex")}catch{}if(at&&at.length>=secretbox_NONCEBYTES+secretbox_MACBYTES)try{const st=await decryptCryptoboxPayload(at,et.receive);logger$4.log("listenForEncryptedMessage",`received a message from ${$}`,st),j(st)}catch{}}};this.activeListeners.set($,tt),(await this.client.promise).subscribe(MatrixClientEventType.MESSAGE,tt);const rt=this.initialEvent;rt&&rt.timestamp&&new Date().getTime()-rt.timestamp<5*60*1e3?(logger$4.log("listenForEncryptedMessage","Handling previous event"),await tt(rt)):logger$4.log("listenForEncryptedMessage","No previous event found");const nt=this.initialListener;nt&&(await this.client.promise).unsubscribe(MatrixClientEventType.MESSAGE,nt),this.initialListener=void 0,this.initialEvent=void 0}async unsubscribeFromEncryptedMessage($){const j=this.activeListeners.get($);j&&((await this.client.promise).unsubscribe(MatrixClientEventType.MESSAGE,j),this.activeListeners.delete($))}async unsubscribeFromEncryptedMessages(){(await this.client.promise).unsubscribeAll(MatrixClientEventType.MESSAGE),this.activeListeners.clear()}async sendMessage($,j){const et=await this.createCryptoBoxClient(j.publicKey,this.keyPair),tt=await getHexHash(Buffer$g.from(j.publicKey,"hex")),rt=recipientString(tt,j.relayServer),nt=await this.getRelevantRoom(rt),it=await encryptCryptoboxPayload($,et.send);logger$4.log("sendMessage","sending encrypted message",j.publicKey,nt,$),(await this.client.promise).sendTextMessage(nt,it).catch(async at=>{if(at.errcode==="M_FORBIDDEN"){logger$4.log("sendMessage","M_FORBIDDEN",nt,at),await this.deleteRoomIdFromRooms(nt);const st=await this.getRelevantRoom(rt);logger$4.log("sendMessage","Old room deleted, new room created",st),(await this.client.promise).sendTextMessage(st,it).catch(async ot=>{logger$4.log("sendMessage","inner error",st,ot)})}else logger$4.log("sendMessage","unexpected error",at)})}async updatePeerRoom($,j){logger$4.log("updatePeerRoom",$,j);const et=$.split(":");if(et.length<2||!et[0].startsWith("@"))throw new Error("Invalid sender");const tt=await this.storage.get(StorageKey.MATRIX_PEER_ROOM_IDS),rt=tt[$];rt===j&&logger$4.debug("updatePeerRoom","rooms are the same, not updating"),logger$4.debug("updatePeerRoom","current room",rt,"new room",j),rt&&rt[1]&&(logger$4.log("updatePeerRoom",`adding room "${rt[1]}" to ignored array`),this.ignoredRooms.push(rt[1])),tt[$]=j,await this.storage.set(StorageKey.MATRIX_PEER_ROOM_IDS,tt)}async deleteRoomIdFromRooms($){const j=await this.storage.get(StorageKey.MATRIX_PEER_ROOM_IDS),et=Object.entries(j).filter(tt=>tt[1]!==$).reduce((tt,rt)=>({...tt,[rt[0]]:rt[1]}),{});await this.storage.set(StorageKey.MATRIX_PEER_ROOM_IDS,et),this.ignoredRooms.push($)}async listenForChannelOpening($){logger$4.debug("listenForChannelOpening"),(await this.client.promise).subscribe(MatrixClientEventType.MESSAGE,async j=>{if(this.isTextMessage(j.content)&&await this.isChannelOpenMessage(j.content)){logger$4.log("listenForChannelOpening","channel opening received, trying to decrypt",JSON.stringify(j)),await this.updateRelayServer(j.content.message.sender),await this.updatePeerRoom(j.content.message.sender,j.content.roomId);const et=j.content.message.content.split(":"),tt=Buffer$g.from(et[et.length-1],"hex");if(tt.length>=secretbox_NONCEBYTES+secretbox_MACBYTES)try{const rt=JSON.parse(await openCryptobox(tt,this.keyPair.publicKey,this.keyPair.secretKey));logger$4.log("listenForChannelOpening","channel opening received and decrypted",JSON.stringify(rt)),$({...rt,senderId:await getSenderId(rt.publicKey)})}catch{}}})}async waitForJoin($,j=0){const et=await(await this.client.promise).getRoomById($);if(logger$4.log("waitForJoin",`Currently ${et.members.length} members, we need at least 2`),!(et.members.length>=2)){if(j<=200)return logger$4.log(`Waiting for join... Try: ${j}`),new Promise(tt=>{setTimeout(()=>{tt(this.waitForJoin($,j+1))},100*(j>50?10:1))});throw new Error(`No one joined after ${j} tries.`)}}async sendPairingResponse($){logger$4.log("sendPairingResponse");const j=await getHexHash(Buffer$g.from($.publicKey,"hex")),et=recipientString(j,$.relayServer),tt=await(await this.client.promise).createTrustedPrivateRoom(et);logger$4.debug("sendPairingResponse",`Connecting to room "${tt}"`),await this.updatePeerRoom(et,tt),await this.waitForJoin(tt),logger$4.debug("sendPairingResponse","Successfully joined room.");const rt=typeof $.version>"u"?await this.getPublicKey():JSON.stringify(await this.getPairingResponseInfo($));logger$4.debug("sendPairingResponse","Sending pairing response",rt);const nt=await this.encryptMessageAsymmetric($.publicKey,rt),it=["@channel-open",et,nt].join(":");(await this.client.promise).sendTextMessage(tt,it).catch(async at=>{if(at.errcode==="M_FORBIDDEN"){logger$4.log("sendPairingResponse","M_FORBIDDEN",tt,at),await this.deleteRoomIdFromRooms(tt);const st=await this.getRelevantRoom(et);logger$4.log("sendPairingResponse","Old room deleted, new room created",st),(await this.client.promise).sendTextMessage(st,it).catch(async ot=>{logger$4.log("sendPairingResponse","inner error",st,ot)})}else logger$4.log("sendPairingResponse","unexpected error",at)})}isTextMessage($){return $.message.type===MatrixMessageType.TEXT}async updateRelayServer($){logger$4.log("updateRelayServer",$);const j=$.split(":");if(j.length<2||!j[0].startsWith("@"))throw new Error("Invalid sender");const et=j.shift(),tt=j.join(":"),rt=localStorage.getItem("beacon:communication-peers-dapp")?new PeerManager(this.storage,StorageKey.TRANSPORT_P2P_PEERS_DAPP):new PeerManager(this.storage,StorageKey.TRANSPORT_P2P_PEERS_WALLET),it=(await rt.getPeers()).map(async at=>{`@${await getHexHash(Buffer$g.from(at.publicKey,"hex"))}`===et&&at.relayServer!==tt&&(at.relayServer=tt,await rt.addPeer(at))});await Promise.all(it)}async isChannelOpenMessage($){return $.message.content.startsWith(`@channel-open:@${await getHexHash(Buffer$g.from(await this.getPublicKey(),"hex"))}`)}async isSender($,j){return $.content.message.sender.startsWith(`@${await getHexHash(Buffer$g.from(j,"hex"))}`)}async getRelevantRoom($){const j=await this.storage.get(StorageKey.MATRIX_PEER_ROOM_IDS);let et=j[$];if(!et){logger$4.log("getRelevantRoom",`No room found for peer ${$}, checking joined ones.`);const tt=await this.getRelevantJoinedRoom($);et=tt.id,j[$]=tt.id,await this.storage.set(StorageKey.MATRIX_PEER_ROOM_IDS,j)}return logger$4.log("getRelevantRoom",`Using room ${et}`),et}async getRelevantJoinedRoom($){const j=await(await this.client.promise).joinedRooms;logger$4.log("checking joined rooms",j,$);const et=j.filter(rt=>!this.ignoredRooms.some(nt=>rt.id===nt)).filter(rt=>rt.members.some(nt=>nt===$));let tt;if(et.length===0||this.ignoredRooms.length>0){logger$4.log("getRelevantJoinedRoom","no relevant rooms found, creating new one");const rt=await(await this.client.promise).createTrustedPrivateRoom($);tt=await(await this.client.promise).getRoomById(rt),logger$4.log("getRelevantJoinedRoom",`waiting for other party to join room: ${tt.id}`),await this.waitForJoin(rt),logger$4.log("getRelevantJoinedRoom",`new room created and peer invited: ${tt.id}`)}else tt=et[0],logger$4.log("getRelevantJoinedRoom",`channel already open, reusing room ${tt.id}`);return tt}}const logger$3=new Logger("P2PTransport");class P2PTransport extends Transport$2{constructor($,j,et,tt,rt,nt,it){super($,new P2PCommunicationClient($,j,1,et,tt,nt,it),new PeerManager(et,rt));Yr(this,"type",TransportType.P2P)}static async isAvailable(){return Promise.resolve(!0)}async connect(){if(this._isConnected!==TransportStatus.NOT_CONNECTED)return;logger$3.log("connect"),this._isConnected=TransportStatus.CONNECTING,await this.client.start();const $=await this.getPeers();if($.length>0){logger$3.log("connect",`connecting to ${$.length} peers`);const j=$.map(async et=>this.listen(et.publicKey));Promise.all(j).catch(et=>logger$3.error("connect",et))}return await this.startOpenChannelListener(),super.connect()}async disconnect(){return await this.client.stop(),super.disconnect()}async startOpenChannelListener(){}async getPairingRequestInfo(){return this.client.getPairingRequestInfo()}async listen($){await this.client.listenForEncryptedMessage($,j=>{const et={origin:Origin.P2P,id:$};this.notifyListeners(j,et).catch(tt=>{throw tt})}).catch(j=>{throw j})}}class WalletP2PTransport extends P2PTransport{constructor(a,$,j,et,tt,rt){super(a,$,j,et,StorageKey.TRANSPORT_P2P_PEERS_WALLET,tt,rt)}async addPeer(a,$=!0){await super.addPeer(a),$&&await this.client.sendPairingResponse(a)}}const logger$2=new Logger("IncomingRequestInterceptor");class IncomingRequestInterceptor{static async intercept(a){logger$2.log("INTERCEPTING REQUEST",a.message),a.message.version==="2"?IncomingRequestInterceptor.handleV2Message(a):a.message.version==="3"&&IncomingRequestInterceptor.handleV3Message(a)}static async getAppMetadata(a,$){const j=await a.getAppMetadata($);if(!j)throw new Error("AppMetadata not found");return j}static async handleV2Message(a){const{message:$,connectionInfo:j,appMetadataManager:et,interceptorCallback:tt}=a;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(a){const{message:$,connectionInfo:j,appMetadataManager:et,interceptorCallback:tt}=a,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(_){throw new Error("Function not implemented.")}const logger$1=new Logger("OutgoingResponseInterceptor");class OutgoingResponseInterceptor{static async intercept(a){a.request.version==="2"?OutgoingResponseInterceptor.handleV2Message(a):a.request.version==="3"&&OutgoingResponseInterceptor.handleV3Message(a)}static async handleV3Message(a){const{message:$,appMetadataManager:j,interceptorCallback:et}=a,rt=$.message;logger$1.log("LOGGING OUTGOING V3",rt,j),et($)}static async handleV2Message(a){const{senderId:$,request:j,message:et,ownAppMetadata:tt,permissionManager:rt,appMetadataManager:nt,interceptorCallback:it}=a;switch(et.type){case BeaconMessageType.Error:{const at={type:et.type,version:"2",senderId:$,id:et.id,errorType:et.errorType};if(et.errorType===BeaconErrorType.TRANSACTION_INVALID_ERROR&&et.errorData){const st=et.errorData;Array.isArray(st)&&st.every(ot=>!!ot.kind&&!!ot.id)?at.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(at);break}case BeaconMessageType.Acknowledge:{const at={type:et.type,version:"2",senderId:$,id:et.id};it(at);break}case BeaconMessageType.PermissionResponse:{const at={senderId:$,version:"2",appMetadata:tt,...et};if(!at.address&&!at.publicKey)throw new Error("Address or PublicKey must be defined");const st=at.publicKey,ot=at.address??await getAddressFromPublicKey(st);if(!isValidAddress(ot))throw new Error(`Invalid address: "${ot}"`);if(et.walletType==="abstracted_account"&&ot.substring(0,3)!==CONTRACT_PREFIX)throw new Error(`Invalid abstracted account address "${ot}", it should be a ${CONTRACT_PREFIX} address`);const ut=await nt.getAppMetadata(j.senderId);if(!ut)throw new Error("AppMetadata not found");const dt={accountIdentifier:await getAccountIdentifier(ot,at.network),senderId:j.senderId,appMetadata:ut,website:"",address:ot,publicKey:st,network:at.network,scopes:at.scopes,connectedAt:new Date().getTime()};rt.addPermission(dt).catch(console.error),it(at);break}case BeaconMessageType.OperationResponse:{const at={senderId:$,version:"2",...et};it(at)}break;case BeaconMessageType.SignPayloadResponse:{const at={senderId:$,version:"2",...et};it(at)}break;case BeaconMessageType.BroadcastResponse:{const at={senderId:$,version:"2",...et};it(at)}break;case BeaconMessageType.ProofOfEventChallengeResponse:{const at={senderId:$,version:"2",...et};it(at)}break;case BeaconMessageType.SimulatedProofOfEventChallengeResponse:{const at={senderId:$,version:"2",...et};it(at)}break;default:logger$1.log("intercept","Message not handled"),assertNever()}}}function assertNever(_){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 at=await this.storage.get(StorageKey.PUSH_TOKENS),st=at.find(dt=>dt.publicKey===tt&&dt.backendUrl===et);if(st)return st;const ot=(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:ot.accessToken,managementToken:ot.managementToken};return at.push(ut),await this.storage.set(StorageKey.PUSH_TOKENS,at),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(_){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(_)}function ownKeys$5(_,a){var $=Object.keys(_);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(_);a&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(_,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$4(_){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(_,j)&&($[j]=_[j])}return $}function _objectWithoutPropertiesLoose$2(_,a){if(_==null)return{};var $={},j=Object.keys(_),et,tt;for(tt=0;tt=0)&&($[et]=_[et]);return $}var DEFAULT_TIMEOUT=5e3;function persistReducer(_,a){var $=_.version!==void 0?_.version:DEFAULT_VERSION;_.debug;var j=_.stateReconciler===void 0?autoMergeLevel1:_.stateReconciler,et=_.getStoredState||getStoredState,tt=_.timeout!==void 0?_.timeout:DEFAULT_TIMEOUT,rt=null,nt=!1,it=!0,at=function(ot){return ot._persist.rehydrated&&rt&&!it&&rt.update(ot),ot};return function(st,ot){var ut=st||{},dt=ut._persist,mt=_objectWithoutProperties$1(ut,["_persist"]),xt=mt;if(ot.type===PERSIST){var Ct=!1,Pt=function(It,Dt){Ct||(ot.rehydrate(_.key,It,Dt),Ct=!0)};if(tt&&setTimeout(function(){!Ct&&Pt(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(_.key,'"')))},tt),it=!1,rt||(rt=createPersistoid(_)),dt)return _objectSpread$3({},a(xt,ot),{_persist:dt});if(typeof ot.rehydrate!="function"||typeof ot.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 ot.register(_.key),et(_).then(function(Bt){var It=_.migrate||function(Dt,Ft){return Promise.resolve(Dt)};It(Bt,$).then(function(Dt){Pt(Dt)},function(Dt){Pt(void 0,Dt)})},function(Bt){Pt(void 0,Bt)}),_objectSpread$3({},a(xt,ot),{_persist:{version:$,rehydrated:!1}})}else{if(ot.type===PURGE)return nt=!0,ot.result(purgeStoredState(_)),_objectSpread$3({},a(xt,ot),{_persist:dt});if(ot.type===FLUSH)return ot.result(rt&&rt.flush()),_objectSpread$3({},a(xt,ot),{_persist:dt});if(ot.type===PAUSE)it=!0;else if(ot.type===REHYDRATE){if(nt)return _objectSpread$3({},xt,{_persist:_objectSpread$3({},dt,{rehydrated:!0})});if(ot.key===_.key){var Tt=a(xt,ot),Mt=ot.payload,Lt=j!==!1&&Mt!==void 0?j(Mt,st,Tt,_):Tt,Nt=_objectSpread$3({},Lt,{_persist:_objectSpread$3({},dt,{rehydrated:!0})});return at(Nt)}}}if(!dt)return a(st,ot);var zt=a(xt,ot);return zt===xt?st:at(_objectSpread$3({},zt,{_persist:dt}))}}function formatProdErrorMessage$1(_){return`Minified Redux error #${_}; visit https://redux.js.org/Errors?code=${_} 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$2(_){if(typeof _!="object"||_===null)return!1;let a=_;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(_)===a||Object.getPrototypeOf(_)===null}function createStore(_,a,$){if(typeof _!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof a=="function"&&typeof $=="function"||typeof $=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof a=="function"&&typeof $>"u"&&($=a,a=void 0),typeof $<"u"){if(typeof $!="function")throw new Error(formatProdErrorMessage$1(1));return $(createStore)(_,a)}let j=_,et=a,tt=new Map,rt=tt,nt=0,it=!1;function at(){rt===tt&&(rt=new Map,tt.forEach((Ct,Pt)=>{rt.set(Pt,Ct)}))}function st(){if(it)throw new Error(formatProdErrorMessage$1(3));return et}function ot(Ct){if(typeof Ct!="function")throw new Error(formatProdErrorMessage$1(4));if(it)throw new Error(formatProdErrorMessage$1(5));let Pt=!0;at();const Tt=nt++;return rt.set(Tt,Ct),function(){if(Pt){if(it)throw new Error(formatProdErrorMessage$1(6));Pt=!1,at(),rt.delete(Tt),tt=null}}}function ut(Ct){if(!isPlainObject$2(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(Tt=>{Tt()}),Ct}function dt(Ct){if(typeof Ct!="function")throw new Error(formatProdErrorMessage$1(10));j=Ct,ut({type:actionTypes_default.REPLACE})}function mt(){const Ct=ot;return{subscribe(Pt){if(typeof Pt!="object"||Pt===null)throw new Error(formatProdErrorMessage$1(11));function Tt(){const Lt=Pt;Lt.next&&Lt.next(st())}return Tt(),{unsubscribe:Ct(Tt)}},[symbol_observable_default](){return this}}}return ut({type:actionTypes_default.INIT}),{dispatch:ut,subscribe:ot,getState:st,replaceReducer:dt,[symbol_observable_default]:mt}}function assertReducerShape(_){Object.keys(_).forEach(a=>{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(_){const a=Object.keys(_),$={};for(let tt=0;tt"u")throw nt&&nt.type,new Error(formatProdErrorMessage$1(14));at[ot]=mt,it=it||mt!==dt}return it=it||j.length!==Object.keys(rt).length,it?at:rt}}function compose(..._){return _.length===0?a=>a:_.length===1?_[0]:_.reduce((a,$)=>(...j)=>a($(...j)))}function applyMiddleware(..._){return a=>($,j)=>{const et=a($,j);let tt=()=>{throw new Error(formatProdErrorMessage$1(15))};const rt={getState:et.getState,dispatch:(it,...at)=>tt(it,...at)},nt=_.map(it=>it(rt));return tt=compose(...nt)(et.dispatch),{...et,dispatch:tt}}}function isAction(_){return isPlainObject$2(_)&&"type"in _&&typeof _.type=="string"}function _toConsumableArray(_){return _arrayWithoutHoles(_)||_iterableToArray(_)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(_){if(Symbol.iterator in Object(_)||Object.prototype.toString.call(_)==="[object Arguments]")return Array.from(_)}function _arrayWithoutHoles(_){if(Array.isArray(_)){for(var a=0,$=new Array(_.length);a<_.length;a++)$[a]=_[a];return $}}function ownKeys$3(_,a){var $=Object.keys(_);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(_);a&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(_,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$2(_){for(var a=1;a0&&arguments[0]!==void 0?arguments[0]:initialState$b,$=arguments.length>1?arguments[1]:void 0;switch($.type){case REGISTER:return _objectSpread$2({},a,{registry:[].concat(_toConsumableArray(a.registry),[$.key])});case REHYDRATE:var j=a.registry.indexOf($.key),et=_toConsumableArray(a.registry);return et.splice(j,1),_objectSpread$2({},a,{registry:et,bootstrapped:et.length===0});default:return a}};function persistStore(_,a,$){var j=createStore(persistorReducer,initialState$b,void 0),et=function(it){j.dispatch({type:REGISTER,key:it})},tt=function(it,at,st){var ot={type:REHYDRATE,payload:at,err:st,key:it};_.dispatch(ot),j.dispatch(ot)},rt=_objectSpread$2({},j,{purge:function(){var it=[];return _.dispatch({type:PURGE,result:function(st){it.push(st)}}),Promise.all(it)},flush:function(){var it=[];return _.dispatch({type:FLUSH,result:function(st){it.push(st)}}),Promise.all(it)},pause:function(){_.dispatch({type:PAUSE})},persist:function(){_.dispatch({type:PERSIST,register:et,rehydrate:tt})}});return rt.persist(),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: ${_}. Full error at: https://bit.ly/3cXEKWf`)}var getPrototypeOf$1=Object.getPrototypeOf;function isDraft(_){return!!_&&!!_[DRAFT_STATE]}function isDraftable(_){var a;return _?isPlainObject$1(_)||Array.isArray(_)||!!_[DRAFTABLE]||!!((a=_.constructor)!=null&&a[DRAFTABLE])||isMap(_)||isSet(_):!1}var objectCtorString=Object.prototype.constructor.toString();function isPlainObject$1(_){if(!_||typeof _!="object")return!1;const a=getPrototypeOf$1(_);if(a===null)return!0;const $=Object.hasOwnProperty.call(a,"constructor")&&a.constructor;return $===Object?!0:typeof $=="function"&&Function.toString.call($)===objectCtorString}function each(_,a){getArchtype(_)===0?Reflect.ownKeys(_).forEach($=>{a($,_[$],_)}):_.forEach(($,j)=>a(j,$,_))}function getArchtype(_){const a=_[DRAFT_STATE];return a?a.type_:Array.isArray(_)?1:isMap(_)?2:isSet(_)?3:0}function has(_,a){return getArchtype(_)===2?_.has(a):Object.prototype.hasOwnProperty.call(_,a)}function set(_,a,$){const j=getArchtype(_);j===2?_.set(a,$):j===3?_.add($):_[a]=$}function is(_,a){return _===a?_!==0||1/_===1/a:_!==_&&a!==a}function isMap(_){return _ instanceof Map}function isSet(_){return _ instanceof Set}function latest(_){return _.copy_||_.base_}function shallowCopy(_,a){if(isMap(_))return new Map(_);if(isSet(_))return new Set(_);if(Array.isArray(_))return Array.prototype.slice.call(_);const $=isPlainObject$1(_);if(a===!0||a==="class_only"&&!$){const j=Object.getOwnPropertyDescriptors(_);delete j[DRAFT_STATE];let et=Reflect.ownKeys(j);for(let tt=0;tt1&&(_.set=_.add=_.clear=_.delete=dontMutateFrozenCollections),Object.freeze(_),a&&Object.entries(_).forEach(([$,j])=>freeze(j,!0))),_}function dontMutateFrozenCollections(){die(2)}function isFrozen(_){return Object.isFrozen(_)}var plugins={};function getPlugin(_){const a=plugins[_];return a||die(0,_),a}var currentScope;function getCurrentScope(){return currentScope}function createScope(_,a){return{drafts_:[],parent_:_,immer_:a,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function usePatchesInScope(_,a){a&&(getPlugin("Patches"),_.patches_=[],_.inversePatches_=[],_.patchListener_=a)}function revokeScope(_){leaveScope(_),_.drafts_.forEach(revokeDraft),_.drafts_=null}function leaveScope(_){_===currentScope&&(currentScope=_.parent_)}function enterScope(_){return currentScope=createScope(currentScope,_)}function revokeDraft(_){const a=_[DRAFT_STATE];a.type_===0||a.type_===1?a.revoke_():a.revoked_=!0}function processResult(_,a){a.unfinalizedDrafts_=a.drafts_.length;const $=a.drafts_[0];return _!==void 0&&_!==$?($[DRAFT_STATE].modified_&&(revokeScope(a),die(4)),isDraftable(_)&&(_=finalize(a,_),a.parent_||maybeFreeze(a,_)),a.patches_&&getPlugin("Patches").generateReplacementPatches_($[DRAFT_STATE].base_,_,a.patches_,a.inversePatches_)):_=finalize(a,$,[]),revokeScope(a),a.patches_&&a.patchListener_(a.patches_,a.inversePatches_),_!==NOTHING?_:void 0}function finalize(_,a,$){if(isFrozen(a))return a;const j=a[DRAFT_STATE];if(!j)return each(a,(et,tt)=>finalizeProperty(_,j,a,et,tt,$)),a;if(j.scope_!==_)return a;if(!j.modified_)return maybeFreeze(_,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(_,j,et,nt,it,$,rt)),maybeFreeze(_,et,!1),$&&_.patches_&&getPlugin("Patches").generatePatches_(j,$,_.patches_,_.inversePatches_)}return j.copy_}function finalizeProperty(_,a,$,j,et,tt,rt){if(isDraft(et)){const nt=tt&&a&&a.type_!==3&&!has(a.assigned_,j)?tt.concat(j):void 0,it=finalize(_,et,nt);if(set($,j,it),isDraft(it))_.canAutoFreeze_=!1;else return}else rt&&$.add(et);if(isDraftable(et)&&!isFrozen(et)){if(!_.immer_.autoFreeze_&&_.unfinalizedDrafts_<1)return;finalize(_,et),(!a||!a.scope_.parent_)&&typeof j!="symbol"&&Object.prototype.propertyIsEnumerable.call($,j)&&maybeFreeze(_,et)}}function maybeFreeze(_,a,$=!1){!_.parent_&&_.immer_.autoFreeze_&&_.canAutoFreeze_&&freeze(a,$)}function createProxyProxy(_,a){const $=Array.isArray(_),j={type_:$?1:0,scope_:a?a.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:{},parent_:a,base_:_,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(a===DRAFT_STATE)return _;const $=latest(_);if(!has($,a))return readPropFromProto(_,$,a);const j=$[a];return _.finalized_||!isDraftable(j)?j:j===peek(_.base_,a)?(prepareCopy(_),_.copy_[a]=createProxy(j,_)):j},has(_,a){return a in latest(_)},ownKeys(_){return Reflect.ownKeys(latest(_))},set(_,a,$){const j=getDescriptorFromProto(latest(_),a);if(j!=null&&j.set)return j.set.call(_.draft_,$),!0;if(!_.modified_){const et=peek(latest(_),a),tt=et==null?void 0:et[DRAFT_STATE];if(tt&&tt.base_===$)return _.copy_[a]=$,_.assigned_[a]=!1,!0;if(is($,et)&&($!==void 0||has(_.base_,a)))return!0;prepareCopy(_),markChanged(_)}return _.copy_[a]===$&&($!==void 0||a in _.copy_)||Number.isNaN($)&&Number.isNaN(_.copy_[a])||(_.copy_[a]=$,_.assigned_[a]=!0),!0},deleteProperty(_,a){return peek(_.base_,a)!==void 0||a in _.base_?(_.assigned_[a]=!1,prepareCopy(_),markChanged(_)):delete _.assigned_[a],_.copy_&&delete _.copy_[a],!0},getOwnPropertyDescriptor(_,a){const $=latest(_),j=Reflect.getOwnPropertyDescriptor($,a);return j&&{writable:!0,configurable:_.type_!==1||a!=="length",enumerable:j.enumerable,value:$[a]}},defineProperty(){die(11)},getPrototypeOf(_){return getPrototypeOf$1(_.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(_,a)=>{arrayTraps[_]=function(){return arguments[0]=arguments[0][0],a.apply(this,arguments)}});arrayTraps.deleteProperty=function(_,a){return arrayTraps.set.call(this,_,a,void 0)};arrayTraps.set=function(_,a,$){return objectTraps.set.call(this,_[0],a,$,_[0])};function peek(_,a){const $=_[DRAFT_STATE];return($?latest($):_)[a]}function readPropFromProto(_,a,$){var et;const j=getDescriptorFromProto(a,$);return j?"value"in j?j.value:(et=j.get)==null?void 0:et.call(_.draft_):void 0}function getDescriptorFromProto(_,a){if(!(a in _))return;let $=getPrototypeOf$1(_);for(;$;){const j=Object.getOwnPropertyDescriptor($,a);if(j)return j;$=getPrototypeOf$1($)}}function markChanged(_){_.modified_||(_.modified_=!0,_.parent_&&markChanged(_.parent_))}function prepareCopy(_){_.copy_||(_.copy_=shallowCopy(_.base_,_.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(_){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(a,$,j)=>{if(typeof a=="function"&&typeof $!="function"){const tt=$;$=a;const rt=this;return function(it=tt,...at){return rt.produce(it,st=>$.call(this,st,...at))}}typeof $!="function"&&die(6),j!==void 0&&typeof j!="function"&&die(7);let et;if(isDraftable(a)){const tt=enterScope(this),rt=createProxy(a,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(!a||typeof a!="object"){if(et=$(a),et===void 0&&(et=a),et===NOTHING&&(et=void 0),this.autoFreeze_&&freeze(et,!0),j){const tt=[],rt=[];getPlugin("Patches").generateReplacementPatches_(a,et,tt,rt),j(tt,rt)}return et}else die(1,a)},this.produceWithPatches=(a,$)=>{if(typeof a=="function")return(rt,...nt)=>this.produceWithPatches(rt,it=>a(it,...nt));let j,et;return[this.produce(a,$,(rt,nt)=>{j=rt,et=nt}),j,et]},typeof(_==null?void 0:_.autoFreeze)=="boolean"&&this.setAutoFreeze(_.autoFreeze),typeof(_==null?void 0:_.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(_.useStrictShallowCopy)}createDraft(_){isDraftable(_)||die(8),isDraft(_)&&(_=current(_));const a=enterScope(this),$=createProxy(_,void 0);return $[DRAFT_STATE].isManual_=!0,leaveScope(a),$}finishDraft(_,a){const $=_&&_[DRAFT_STATE];(!$||!$.isManual_)&&die(9);const{scope_:j}=$;return usePatchesInScope(j,a),processResult(void 0,j)}setAutoFreeze(_){this.autoFreeze_=_}setUseStrictShallowCopy(_){this.useStrictShallowCopy_=_}applyPatches(_,a){let $;for($=a.length-1;$>=0;$--){const et=a[$];if(et.path.length===0&&et.op==="replace"){_=et.value;break}}$>-1&&(a=a.slice($+1));const j=getPlugin("Patches").applyPatches_;return isDraft(_)?j(_,a):this.produce(_,et=>j(et,a))}};function createProxy(_,a){const $=isMap(_)?getPlugin("MapSet").proxyMap_(_,a):isSet(_)?getPlugin("MapSet").proxySet_(_,a):createProxyProxy(_,a);return(a?a.scope_:getCurrentScope()).drafts_.push($),$}function current(_){return isDraft(_)||die(10,_),currentImpl(_)}function currentImpl(_){if(!isDraftable(_)||isFrozen(_))return _;const a=_[DRAFT_STATE];let $;if(a){if(!a.modified_)return a.base_;a.finalized_=!0,$=shallowCopy(_,a.scope_.immer_.useStrictShallowCopy_)}else $=shallowCopy(_,!0);return each($,(j,et)=>{set($,j,currentImpl(et))}),a&&(a.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);function assertIsFunction(_,a=`expected a function, instead received ${typeof _}`){if(typeof _!="function")throw new TypeError(a)}function assertIsObject(_,a=`expected an object, instead received ${typeof _}`){if(typeof _!="object")throw new TypeError(a)}function assertIsArrayOfFunctions(_,a="expected all items to be functions, instead received the following types: "){if(!_.every($=>typeof $=="function")){const $=_.map(j=>typeof j=="function"?`function ${j.name||"unnamed"}()`:typeof j).join(", ");throw new TypeError(`${a}[${$}]`)}}var ensureIsArray=_=>Array.isArray(_)?_:[_];function getDependencies(_){const a=Array.isArray(_[0])?_[0]:_;return assertIsArrayOfFunctions(a,"createSelector expects all input-selectors to be functions, but received the following types: "),a}function collectInputSelectorResults(_,a){const $=[],{length:j}=_;for(let et=0;et{$=createCacheNode(),rt.resetResultsCount()},rt.resultsCount=()=>tt,rt.resetResultsCount=()=>{tt=0},rt}function createSelectorCreator(_,...a){const $=typeof _=="function"?{memoize:_,memoizeOptions:a}:_,j=(...et)=>{let tt=0,rt=0,nt,it={},at=et.pop();typeof at=="object"&&(it=at,at=et.pop()),assertIsFunction(at,`createSelector expects an output function after the inputs, but received: [${typeof at}]`);const st={...$,...it},{memoize:ot,memoizeOptions:ut=[],argsMemoize:dt=weakMapMemoize,argsMemoizeOptions:mt=[],devModeChecks:xt={}}=st,Ct=ensureIsArray(ut),Pt=ensureIsArray(mt),Tt=getDependencies(et),Mt=ot(function(){return tt++,at.apply(null,arguments)},...Ct),Lt=dt(function(){rt++;const zt=collectInputSelectorResults(Tt,arguments);return nt=Mt.apply(null,zt),nt},...Pt);return Object.assign(Lt,{resultFunc:at,memoizedResultFunc:Mt,dependencies:Tt,dependencyRecomputations:()=>rt,resetDependencyRecomputations:()=>{rt=0},lastResult:()=>nt,recomputations:()=>tt,resetRecomputations:()=>{tt=0},memoize:ot,argsMemoize:dt})};return Object.assign(j,{withTypes:()=>j}),j}var createSelector=createSelectorCreator(weakMapMemoize),createStructuredSelector=Object.assign((_,a=createSelector)=>{assertIsObject(_,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof _}`);const $=Object.keys(_),j=$.map(tt=>_[tt]);return a(j,(...tt)=>tt.reduce((rt,nt,it)=>(rt[$[it]]=nt,rt),{}))},{withTypes:()=>createStructuredSelector});function createThunkMiddleware(_){return({dispatch:$,getState:j})=>et=>tt=>typeof tt=="function"?tt($,j,_):et(tt)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,createDraftSafeSelectorCreator=(..._)=>{const a=createSelectorCreator(..._),$=Object.assign((...j)=>{const et=a(...j),tt=(rt,...nt)=>et(isDraft(rt)?current(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=_=>_&&typeof _.match=="function";function createAction(_,a){function $(...j){if(a){let et=a(...j);if(!et)throw new Error(formatProdErrorMessage(0));return{type:_,payload:et.payload,..."meta"in et&&{meta:et.meta},..."error"in et&&{error:et.error}}}return{type:_,payload:j[0]}}return $.toString=()=>`${_}`,$.type=_,$.match=j=>isAction(j)&&j.type===_,$}var Tuple=class ip extends Array{constructor(...a){super(...a),Object.setPrototypeOf(this,ip.prototype)}static get[Symbol.species](){return ip}concat(...a){return super.concat.apply(this,a)}prepend(...a){return a.length===1&&Array.isArray(a[0])?new ip(...a[0].concat(this)):new ip(...a.concat(this))}};function freezeDraftable(_){return isDraftable(_)?produce(_,()=>{}):_}function emplace(_,a,$){if(_.has(a)){let et=_.get(a);return $.update&&(et=$.update(et,a,_),_.set(a,et)),et}if(!$.insert)throw new Error(formatProdErrorMessage(10));const j=$.insert(a,_);return _.set(a,j),j}function isBoolean(_){return typeof _=="boolean"}var buildGetDefaultMiddleware=()=>function(a){const{thunk:$=!0,immutableCheck:j=!0,serializableCheck:et=!0,actionCreatorCheck:tt=!0}=a??{};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=(_={type:"raf"})=>a=>(...$)=>{const j=a(...$);let et=!0,tt=!1,rt=!1;const nt=new Set,it=_.type==="tick"?queueMicrotask:_.type==="raf"?rAF:_.type==="callback"?_.queueNotification:createQueueWithTimer(_.timeout),at=()=>{rt=!1,tt&&(tt=!1,nt.forEach(st=>st()))};return Object.assign({},j,{subscribe(st){const ot=()=>et&&st(),ut=j.subscribe(ot);return nt.add(st),()=>{ut(),nt.delete(st)}},dispatch(st){var ot;try{return et=!((ot=st==null?void 0:st.meta)!=null&&ot[SHOULD_AUTOBATCH]),tt=!et,tt&&(rt||(rt=!0,it(at))),j.dispatch(st)}finally{et=!0}}})},buildGetDefaultEnhancers=_=>function($){const{autoBatch:j=!0}=$??{};let et=new Tuple(_);return j&&et.push(autoBatchEnhancer(typeof j=="object"?j:void 0)),et},IS_PRODUCTION=!0;function configureStore(_){const a=buildGetDefaultMiddleware(),{reducer:$=void 0,middleware:j,devTools:et=!0,preloadedState:tt=void 0,enhancers:rt=void 0}=_||{};let nt;if(typeof $=="function")nt=$;else if(isPlainObject$2($))nt=combineReducers($);else throw new Error(formatProdErrorMessage(1));let it;typeof j=="function"?it=j(a):it=a();let at=compose;et&&(at=composeWithDevTools({trace:!IS_PRODUCTION,...typeof et=="object"&&et}));const st=applyMiddleware(...it),ot=buildGetDefaultEnhancers(st);let ut=typeof rt=="function"?rt(ot):ot();const dt=at(...ut);return createStore(nt,tt,dt)}function executeReducerBuilderCallback(_){const a={},$=[];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 a)throw new Error(formatProdErrorMessage(29));return a[nt]=rt,et},addMatcher(tt,rt){return $.push({matcher:tt,reducer:rt}),et},addDefaultCase(tt){return j=tt,et}};return _(et),[a,$,j]}function isStateFunction(_){return typeof _=="function"}function createReducer(_,a){let[$,j,et]=executeReducerBuilderCallback(a),tt;if(isStateFunction(_))tt=()=>freezeDraftable(_());else{const nt=freezeDraftable(_);tt=()=>nt}function rt(nt=tt(),it){let at=[$[it.type],...j.filter(({matcher:st})=>st(it)).map(({reducer:st})=>st)];return at.filter(st=>!!st).length===0&&(at=[et]),at.reduce((st,ot)=>{if(ot)if(isDraft(st)){const dt=ot(st,it);return dt===void 0?st:dt}else{if(isDraftable(st))return produce(st,ut=>ot(ut,it));{const ut=ot(st,it);if(ut===void 0){if(st===null)return st;throw new Error(formatProdErrorMessage(9))}return ut}}return st},nt)}return rt.getInitialState=tt,rt}var urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",nanoid=(_=21)=>{let a="",$=_;for(;$--;)a+=urlAlphabet[Math.random()*64|0];return a},matches=(_,a)=>hasMatchFunction(_)?_.match(a):_(a);function isAnyOf(..._){return a=>_.some($=>matches($,a))}var commonProperties=["name","message","stack","code"],RejectWithValue=class{constructor(_,a){Yr(this,"_type");this.payload=_,this.meta=a}},FulfillWithMeta=class{constructor(_,a){Yr(this,"_type");this.payload=_,this.meta=a}},miniSerializeError=_=>{if(typeof _=="object"&&_!==null){const a={};for(const $ of commonProperties)typeof _[$]=="string"&&(a[$]=_[$]);return a}return{message:String(_)}},createAsyncThunk=(()=>{function _(a,$,j){const et=createAction(a+"/fulfilled",(it,at,st,ot)=>({payload:it,meta:{...ot||{},arg:st,requestId:at,requestStatus:"fulfilled"}})),tt=createAction(a+"/pending",(it,at,st)=>({payload:void 0,meta:{...st||{},arg:at,requestId:it,requestStatus:"pending"}})),rt=createAction(a+"/rejected",(it,at,st,ot,ut)=>({payload:ot,error:(j&&j.serializeError||miniSerializeError)(it||"Rejected"),meta:{...ut||{},arg:st,requestId:at,rejectedWithValue:!!ot,requestStatus:"rejected",aborted:(it==null?void 0:it.name)==="AbortError",condition:(it==null?void 0:it.name)==="ConditionError"}}));function nt(it){return(at,st,ot)=>{const ut=j!=null&&j.idGenerator?j.idGenerator(it):nanoid(),dt=new AbortController;let mt,xt;function Ct(Tt){xt=Tt,dt.abort()}const Pt=async function(){var Lt,Nt;let Tt;try{let zt=(Lt=j==null?void 0:j.condition)==null?void 0:Lt.call(j,it,{getState:st,extra:ot});if(isThenable(zt)&&(zt=await zt),zt===!1||dt.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const Bt=new Promise((It,Dt)=>{mt=()=>{Dt({name:"AbortError",message:xt||"Aborted"})},dt.signal.addEventListener("abort",mt)});at(tt(ut,it,(Nt=j==null?void 0:j.getPendingMeta)==null?void 0:Nt.call(j,{requestId:ut,arg:it},{getState:st,extra:ot}))),Tt=await Promise.race([Bt,Promise.resolve($(it,{dispatch:at,getState:st,extra:ot,requestId:ut,signal:dt.signal,abort:Ct,rejectWithValue:(It,Dt)=>new RejectWithValue(It,Dt),fulfillWithValue:(It,Dt)=>new FulfillWithMeta(It,Dt)})).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){Tt=zt instanceof RejectWithValue?rt(null,ut,it,zt.payload,zt.meta):rt(zt,ut,it)}finally{mt&&dt.signal.removeEventListener("abort",mt)}return j&&!j.dispatchConditionRejection&&rt.match(Tt)&&Tt.meta.condition||at(Tt),Tt}();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:a})}return _.withTypes=()=>_,_})();function unwrapResult(_){if(_.meta&&_.meta.rejectedWithValue)throw _.payload;if(_.error)throw _.error;return _.payload}function isThenable(_){return _!==null&&typeof _=="object"&&typeof _.then=="function"}var asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType(_,a){return`${_}/${a}`}function buildCreateSlice({creators:_}={}){var $;const a=($=_==null?void 0:_.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),at={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},st={addCase(Mt,Lt){const Nt=typeof Mt=="string"?Mt:Mt.type;if(!Nt)throw new Error(formatProdErrorMessage(12));if(Nt in at.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return at.sliceCaseReducersByType[Nt]=Lt,st},addMatcher(Mt,Lt){return at.sliceMatchers.push({matcher:Mt,reducer:Lt}),st},exposeAction(Mt,Lt){return at.actionCreators[Mt]=Lt,st},exposeCaseReducer(Mt,Lt){return at.sliceCaseReducersByName[Mt]=Lt,st}};it.forEach(Mt=>{const Lt=nt[Mt],Nt={reducerName:Mt,type:getType(tt,Mt),createNotation:typeof et.reducers=="function"};isAsyncThunkSliceReducerDefinition(Lt)?handleThunkCaseReducerDefinition(Nt,Lt,st,a):handleNormalReducerDefinition(Nt,Lt,st)});function ot(){const[Mt={},Lt=[],Nt=void 0]=typeof et.extraReducers=="function"?executeReducerBuilderCallback(et.extraReducers):[et.extraReducers],zt={...Mt,...at.sliceCaseReducersByType};return createReducer(et.initialState,Bt=>{for(let It in zt)Bt.addCase(It,zt[It]);for(let It of at.sliceMatchers)Bt.addMatcher(It.matcher,It.reducer);for(let It of Lt)Bt.addMatcher(It.matcher,It.reducer);Nt&&Bt.addDefaultCase(Nt)})}const ut=Mt=>Mt,dt=new Map;let mt;function xt(Mt,Lt){return mt||(mt=ot()),mt(Mt,Lt)}function Ct(){return mt||(mt=ot()),mt.getInitialState()}function Pt(Mt,Lt=!1){function Nt(Bt){let It=Bt[Mt];return typeof It>"u"&&Lt&&(It=Ct()),It}function zt(Bt=ut){const It=emplace(dt,Lt,{insert:()=>new WeakMap});return emplace(It,Bt,{insert:()=>{const Dt={};for(const[Ft,Ot]of Object.entries(et.selectors??{}))Dt[Ft]=wrapSelector(Ot,Bt,Ct,Lt);return Dt}})}return{reducerPath:Mt,getSelectors:zt,get selectors(){return zt(Nt)},selectSlice:Nt}}const Tt={name:tt,reducer:xt,actions:at.actionCreators,caseReducers:at.sliceCaseReducersByName,getInitialState:Ct,...Pt(rt),injectInto(Mt,{reducerPath:Lt,...Nt}={}){const zt=Lt??rt;return Mt.inject({reducerPath:zt,reducer:xt},Nt),{...Tt,...Pt(zt,!0)}}};return Tt}}function wrapSelector(_,a,$,j){function et(tt,...rt){let nt=a(tt);return typeof nt>"u"&&j&&(nt=$()),_(nt,...rt)}return et.unwrapped=_,et}var createSlice=buildCreateSlice();function buildReducerCreators(){function _(a,$){return{_reducerDefinitionType:"asyncThunk",payloadCreator:a,...$}}return _.withTypes=()=>_,{reducer(a){return Object.assign({[a.name](...$){return a(...$)}}[a.name],{_reducerDefinitionType:"reducer"})},preparedReducer(a,$){return{_reducerDefinitionType:"reducerWithPrepare",prepare:a,reducer:$}},asyncThunk:_}}function handleNormalReducerDefinition({type:_,reducerName:a,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(_,tt).exposeCaseReducer(a,tt).exposeAction(a,rt?createAction(_,rt):createAction(_))}function isAsyncThunkSliceReducerDefinition(_){return _._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(_){return _._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:_,reducerName:a},$,j,et){if(!et)throw new Error(formatProdErrorMessage(18));const{payloadCreator:tt,fulfilled:rt,pending:nt,rejected:it,settled:at,options:st}=$,ot=et(_,tt,st);j.exposeAction(a,ot),rt&&j.addCase(ot.fulfilled,rt),nt&&j.addCase(ot.pending,nt),it&&j.addCase(ot.rejected,it),at&&j.addMatcher(ot.settled,at),j.exposeCaseReducer(a,{fulfilled:rt||noop$5,pending:nt||noop$5,rejected:it||noop$5,settled:at||noop$5})}function noop$5(){}var assertFunction=(_,a)=>{if(typeof _!="function")throw new Error(formatProdErrorMessage(32))},alm="listenerMiddleware",getListenerEntryPropsFrom=_=>{let{type:a,actionCreator:$,matcher:j,predicate:et,effect:tt}=_;if(a)et=createAction(a).match;else if($)a=$.type,et=$.match;else if(j)et=j;else if(!et)throw new Error(formatProdErrorMessage(21));return assertFunction(tt),{predicate:et,type:a,effect:tt}},createListenerEntry=Object.assign(_=>{const{type:a,predicate:$,effect:j}=getListenerEntryPropsFrom(_);return{id:nanoid(),effect:j,type:a,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(_){return`Minified Redux Toolkit error #${_}; visit https://redux-toolkit.js.org/Errors?code=${_} 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(_){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(_)}function noop$4(){}var noopStorage={getItem:noop$4,setItem:noop$4,removeItem:noop$4};function hasStorage(_){if((typeof self>"u"?"undefined":_typeof$4(self))!=="object"||!(_ in self))return!1;try{var a=self[_],$="redux-persist ".concat(_," test");a.setItem($,"test"),a.getItem($),a.removeItem($)}catch{return!1}return!0}function getStorage(_){var a="".concat(_,"Storage");return hasStorage(a)?self[a]:noopStorage}createWebStorage$1.__esModule=!0;createWebStorage$1.default=createWebStorage;var _getStorage=_interopRequireDefault$6(getStorage$1);function _interopRequireDefault$6(_){return _&&_.__esModule?_:{default:_}}function createWebStorage(_){var a=(0,_getStorage.default)(_);return{getItem:function(j){return new Promise(function(et,tt){et(a.getItem(j))})},setItem:function(j,et){return new Promise(function(tt,rt){tt(a.setItem(j,et))})},removeItem:function(j){return new Promise(function(et,tt){et(a.removeItem(j))})}}}var default_1=void 0,_createWebStorage=_interopRequireDefault$5(createWebStorage$1);function _interopRequireDefault$5(_){return _&&_.__esModule?_:{default:_}}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(_).map(nt=>parseInt(nt)).filter(nt=>j>=nt&&nt>et).sort((nt,it)=>nt-it);let rt=$;for(const nt of tt)rt=await _[nt](rt);return rt}}const initialState$a={html:"",seen:!0},announcementSlice=createSlice({name:"announcements",initialState:initialState$a,reducers:{reset:()=>initialState$a,setCurrent:(_,{payload:a})=>{a!==_.html&&(_.seen=!1),_.html=a},setSeen:_=>{_.seen=!0}}}),ERROR_MSG_INPUT="Input must be an string, Buffer or Uint8Array";function normalizeInput(_){let a;if(_ instanceof Uint8Array)a=_;else if(typeof _=="string")a=new TextEncoder().encode(_);else throw new Error(ERROR_MSG_INPUT);return a}function toHex(_){return Array.prototype.map.call(_,function(a){return(a<16?"0":"")+a.toString(16)}).join("")}function uint32ToHex(_){return(4294967296+_).toString(16).substring(1)}function debugPrint(_,a,$){let j=` `+_+" = ";for(let et=0;et=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],at=m$1[tt+1];ADD64AA(v$2,_,a),ADD64AC(v$2,_,rt,nt);let st=v$2[j]^v$2[_],ot=v$2[j+1]^v$2[_+1];v$2[j]=ot,v$2[j+1]=st,ADD64AA(v$2,$,j),st=v$2[a]^v$2[$],ot=v$2[a+1]^v$2[$+1],v$2[a]=st>>>24^ot<<8,v$2[a+1]=ot>>>24^st<<8,ADD64AA(v$2,_,a),ADD64AC(v$2,_,it,at),st=v$2[j]^v$2[_],ot=v$2[j+1]^v$2[_+1],v$2[j]=st>>>16^ot<<16,v$2[j+1]=ot>>>16^st<<16,ADD64AA(v$2,$,j),st=v$2[a]^v$2[$],ot=v$2[a+1]^v$2[$+1],v$2[a]=ot>>>31^st<<1,v$2[a+1]=st>>>31^ot<<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(_){return _*2})),v$2=new Uint32Array(32),m$1=new Uint32Array(32);function blake2bCompress(_,a){let $=0;for($=0;$<16;$++)v$2[$]=_.h[$],v$2[$+16]=BLAKE2B_IV32[$];for(v$2[24]=v$2[24]^_.t,v$2[25]=v$2[25]^_.t/4294967296,a&&(v$2[28]=~v$2[28],v$2[29]=~v$2[29]),$=0;$<32;$++)m$1[$]=B2B_GET32(_.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;$++)_.h[$]=_.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(_===0||_>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(a&&a.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:_};parameterBlock.fill(0),parameterBlock[0]=_,a&&(parameterBlock[1]=a.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 a&&(blake2bUpdate(et,a),et.c=128),et}function blake2bUpdate(_,a){for(let $=0;$>2]>>8*($&3);return a}function blake2b(_,a,$,j,et){$=$||64,_=util$2.normalizeInput(_),j&&(j=util$2.normalizeInput(j)),et&&(et=util$2.normalizeInput(et));const tt=blake2bInit($,a,j,et);return blake2bUpdate(tt,_),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[_]=v$1[_]+v$1[a]+et,v$1[j]=ROTR32(v$1[j]^v$1[_],16),v$1[$]=v$1[$]+v$1[j],v$1[a]=ROTR32(v$1[a]^v$1[$],12),v$1[_]=v$1[_]+v$1[a]+tt,v$1[j]=ROTR32(v$1[j]^v$1[_],8),v$1[$]=v$1[$]+v$1[j],v$1[a]=ROTR32(v$1[a]^v$1[$],7)}function ROTR32(_,a){return _>>>a^_<<32-a}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[$]=_.h[$],v$1[$+8]=BLAKE2S_IV[$];for(v$1[12]^=_.t,v$1[13]^=_.t/4294967296,a&&(v$1[14]=~v$1[14]),$=0;$<16;$++)m[$]=B2S_GET32(_.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;$++)_.h[$]^=v$1[$]^v$1[$+8]}function blake2sInit(_,a){if(!(_>0&&_<=32))throw new Error("Incorrect output length, should be in [1, 32]");const $=a?a.length:0;if(a&&!($>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:_};return j.h[0]^=16842752^$<<8^_,$>0&&(blake2sUpdate(j,a),j.c=64),j}function blake2sUpdate(_,a){for(let $=0;$>2]>>8*($&3)&255;return a}function blake2s(_,a,$){$=$||32,_=util$1.normalizeInput(_);const j=blake2sInit($,a);return blake2sUpdate(j,_),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$3={},_sha2$1={},_assert$1={};Object.defineProperty(_assert$1,"__esModule",{value:!0});_assert$1.output=_assert$1.exists=_assert$1.hash=_assert$1.bytes=_assert$1.bool=_assert$1.number=void 0;function number$3(_){if(!Number.isSafeInteger(_)||_<0)throw new Error(`Wrong positive integer: ${_}`)}_assert$1.number=number$3;function bool$3(_){if(typeof _!="boolean")throw new Error(`Expected boolean, not ${_}`)}_assert$1.bool=bool$3;function bytes$2(_,...a){if(!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length>0&&!a.includes(_.length))throw new TypeError(`Expected Uint8Array of length ${a}, not of length=${_.length}`)}_assert$1.bytes=bytes$2;function hash$6(_){if(typeof _!="function"||typeof _.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$3(_.outputLen),number$3(_.blockLen)}_assert$1.hash=hash$6;function exists$2(_,a=!0){if(_.destroyed)throw new Error("Hash instance has been destroyed");if(a&&_.finished)throw new Error("Hash#digest() has already been called")}_assert$1.exists=exists$2;function output$2(_,a){bytes$2(_);const $=a.outputLen;if(_.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}_assert$1.output=output$2;const assert$u={number:number$3,bool:bool$3,bytes:bytes$2,hash:hash$6,exists:exists$2,output:output$2};_assert$1.default=assert$u;var utils$A={},crypto$2={};Object.defineProperty(crypto$2,"__esModule",{value:!0});crypto$2.crypto=void 0;crypto$2.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(_){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(_,"__esModule",{value:!0}),_.randomBytes=_.wrapConstructorWithOpts=_.wrapConstructor=_.checkOpts=_.Hash=_.concatBytes=_.toBytes=_.utf8ToBytes=_.asyncLoop=_.nextTick=_.hexToBytes=_.bytesToHex=_.isLE=_.rotr=_.createView=_.u32=_.u8=void 0;const a=crypto$2,$=Lt=>new Uint8Array(Lt.buffer,Lt.byteOffset,Lt.byteLength);_.u8=$;const j=Lt=>new Uint32Array(Lt.buffer,Lt.byteOffset,Math.floor(Lt.byteLength/4));_.u32=j;const et=Lt=>new DataView(Lt.buffer,Lt.byteOffset,Lt.byteLength);_.createView=et;const tt=(Lt,Nt)=>Lt<<32-Nt|Lt>>>Nt;if(_.rotr=tt,_.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!_.isLE)throw new Error("Non little-endian hardware is not supported");const rt=Array.from({length:256},(Lt,Nt)=>Nt.toString(16).padStart(2,"0"));function nt(Lt){if(!(Lt instanceof Uint8Array))throw new Error("Uint8Array expected");let Nt="";for(let zt=0;zt{};_.nextTick=at;async function st(Lt,Nt,zt){let Bt=Date.now();for(let It=0;It=0&&DtBt instanceof Uint8Array))throw new Error("Uint8Array list expected");if(Lt.length===1)return Lt[0];const Nt=Lt.reduce((Bt,It)=>Bt+It.length,0),zt=new Uint8Array(Nt);for(let Bt=0,It=0;BtObject.prototype.toString.call(Lt)==="[object Object]"&&Lt.constructor===Object;function Ct(Lt,Nt){if(Nt!==void 0&&(typeof Nt!="object"||!xt(Nt)))throw new TypeError("Options should be object or undefined");return Object.assign(Lt,Nt)}_.checkOpts=Ct;function Pt(Lt){const Nt=Bt=>Lt().update(ut(Bt)).digest(),zt=Lt();return Nt.outputLen=zt.outputLen,Nt.blockLen=zt.blockLen,Nt.create=()=>Lt(),Nt}_.wrapConstructor=Pt;function Tt(Lt){const Nt=(Bt,It)=>Lt(It).update(ut(Bt)).digest(),zt=Lt({});return Nt.outputLen=zt.outputLen,Nt.blockLen=zt.blockLen,Nt.create=Bt=>Lt(Bt),Nt}_.wrapConstructorWithOpts=Tt;function Mt(Lt=32){if(a.crypto&&typeof a.crypto.getRandomValues=="function")return a.crypto.getRandomValues(new Uint8Array(Lt));throw new Error("crypto.getRandomValues must be defined")}_.randomBytes=Mt})(utils$A);Object.defineProperty(_sha2$1,"__esModule",{value:!0});_sha2$1.SHA2=void 0;const _assert_js_1$2=_assert$1,utils_js_1$5=utils$A;function setBigUint64$1(_,a,$,j){if(typeof _.setBigUint64=="function")return _.setBigUint64(a,$,j);const et=BigInt(32),tt=BigInt(4294967295),rt=Number($>>et&tt),nt=Number($&tt),it=j?4:0,at=j?0:4;_.setUint32(a+it,rt,j),_.setUint32(a+at,nt,j)}let SHA2$1=class extends utils_js_1$5.Hash{constructor(a,$,j,et){super(),this.blockLen=a,this.outputLen=$,this.padOffset=j,this.isLE=et,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(a),this.view=(0,utils_js_1$5.createView)(this.buffer)}update(a){_assert_js_1$2.default.exists(this);const{view:$,buffer:j,blockLen:et}=this;a=(0,utils_js_1$5.toBytes)(a);const tt=a.length;for(let rt=0;rtet-rt&&(this.process(j,0),rt=0);for(let ot=rt;otst.length)throw new Error("_sha2: outputLen bigger than state");for(let ot=0;ot_&a^~_&$,Maj$1=(_,a,$)=>_&a^_&$^a&$,SHA256_K$1=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$1=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W$1=new Uint32Array(64);let SHA256$1=class extends _sha2_js_1$2.SHA2{constructor(){super(64,32,8,!1),this.A=IV$1[0]|0,this.B=IV$1[1]|0,this.C=IV$1[2]|0,this.D=IV$1[3]|0,this.E=IV$1[4]|0,this.F=IV$1[5]|0,this.G=IV$1[6]|0,this.H=IV$1[7]|0}get(){const{A:a,B:$,C:j,D:et,E:tt,F:rt,G:nt,H:it}=this;return[a,$,j,et,tt,rt,nt,it]}set(a,$,j,et,tt,rt,nt,it){this.A=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(a,$){for(let ot=0;ot<16;ot++,$+=4)SHA256_W$1[ot]=a.getUint32($,!1);for(let ot=16;ot<64;ot++){const ut=SHA256_W$1[ot-15],dt=SHA256_W$1[ot-2],mt=(0,utils_js_1$4.rotr)(ut,7)^(0,utils_js_1$4.rotr)(ut,18)^ut>>>3,xt=(0,utils_js_1$4.rotr)(dt,17)^(0,utils_js_1$4.rotr)(dt,19)^dt>>>10;SHA256_W$1[ot]=xt+SHA256_W$1[ot-7]+mt+SHA256_W$1[ot-16]|0}let{A:j,B:et,C:tt,D:rt,E:nt,F:it,G:at,H:st}=this;for(let ot=0;ot<64;ot++){const ut=(0,utils_js_1$4.rotr)(nt,6)^(0,utils_js_1$4.rotr)(nt,11)^(0,utils_js_1$4.rotr)(nt,25),dt=st+ut+Chi$1(nt,it,at)+SHA256_K$1[ot]+SHA256_W$1[ot]|0,xt=((0,utils_js_1$4.rotr)(j,2)^(0,utils_js_1$4.rotr)(j,13)^(0,utils_js_1$4.rotr)(j,22))+Maj$1(j,et,tt)|0;st=at,at=it,it=nt,nt=rt+dt|0,rt=tt,tt=et,et=j,j=dt+xt|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,at=at+this.G|0,st=st+this.H|0,this.set(j,et,tt,rt,nt,it,at,st)}roundClean(){SHA256_W$1.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},SHA224$1=class extends SHA256$1{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$3.sha256=(0,utils_js_1$4.wrapConstructor)(()=>new SHA256$1);sha256$3.sha224=(0,utils_js_1$4.wrapConstructor)(()=>new SHA224$1);function base$4(_){if(_.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),$=0;$>>0,Mt=new Uint8Array(Tt);Ct!==Pt;){for(var Lt=dt[Ct],Nt=0,zt=Tt-1;(Lt!==0||Nt>>0,Mt[zt]=Lt%rt>>>0,Lt=Lt/rt>>>0;if(Lt!==0)throw new Error("Non-zero carry");xt=Nt,Ct++}for(var Bt=Tt-xt;Bt!==Tt&&Mt[Bt]===0;)Bt++;for(var It=nt.repeat(mt);Bt>>0,Tt=new Uint8Array(Pt);dt[mt];){var Mt=a[dt.charCodeAt(mt)];if(Mt===255)return;for(var Lt=0,Nt=Pt-1;(Mt!==0||Lt>>0,Tt[Nt]=Mt%256>>>0,Mt=Mt/256>>>0;if(Mt!==0)throw new Error("Non-zero carry");Ct=Lt,mt++}for(var zt=Pt-Ct;zt!==Pt&&Tt[zt]===0;)zt++;for(var Bt=new Uint8Array(xt+(Pt-zt)),It=xt;zt!==Pt;)Bt[It++]=Tt[zt++];return Bt}function ut(dt){var mt=ot(dt);if(mt)return mt;throw new Error("Non-base"+rt+" character")}return{encode:st,decodeUnsafe:ot,decode:ut}}var src$1=base$4;const basex=src$1,ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var bs58=basex(ALPHABET),base58=bs58,base$3=function(_){function a(tt){var rt=Uint8Array.from(tt),nt=_(rt),it=rt.length+4,at=new Uint8Array(it);return at.set(rt,0),at.set(nt.subarray(0,4),rt.length),base58.encode(at,it)}function $(tt){var rt=tt.slice(0,-4),nt=tt.slice(-4),it=_(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:a,decode:et,decodeUnsafe:j}},{sha256:sha256$2}=sha256$3,bs58checkBase=base$3;function sha256x2(_){return sha256$2(sha256$2(_))}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(a,$){super(),this.address=a,this.errorDetail=$,this.name="InvalidAddressError",this.message=`Invalid address "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidStakingAddressError extends ParameterValidationError{constructor(a,$){super(),this.address=a,this.errorDetail=$,this.name="InvalidStakingAddressError",this.message=`Invalid staking address "${a}", you can only set destination as your own address`}}class InvalidFinalizeUnstakeAmountError extends ParameterValidationError{constructor(a,$){super(),this.address=a,this.errorDetail=$,this.name="InvalidFinalizeUnstakeAmountError",this.message="The amount can only be 0 when finalizing an unstake"}}class InvalidBlockHashError extends ParameterValidationError{constructor(a,$){super(),this.blockHash=a,this.errorDetail=$,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidAmountError extends ParameterValidationError{constructor(a){super(),this.amount=a,this.name="InvalidAmountError",this.message=`Invalid amount "${a}"`}}class InvalidDerivationPathError extends ParameterValidationError{constructor(a,$){super(),this.derivationPath=a,this.errorDetail=$,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidHexStringError extends ParameterValidationError{constructor(a,$){super(),this.hexString=a,this.errorDetail=$,this.name="InvalidHexStringError",this.message=`Invalid hex string "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidMessageError extends ParameterValidationError{constructor(a,$){super(),this.msg=a,this.errorDetail=$,this.name="InvalidMessageError",this.message=`Invalid message "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidViewParameterError extends ParameterValidationError{constructor(a,$,j,et){super(),this.viewName=a,this.sigs=$,this.args=j,this.cause=et,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(j)} received for name "${a}" expecting one of the following signatures ${JSON.stringify($)}.`}}class InvalidKeyError extends ParameterValidationError{constructor(a){super(),this.errorDetail=a,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=a?` ${a}.`:"."}}class InvalidPublicKeyError extends ParameterValidationError{constructor(a,$){super(),this.publicKey=a,this.errorDetail=$,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidContractAddressError extends ParameterValidationError{constructor(a,$){super(),this.contractAddress=a,this.errorDetail=$,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidChainIdError extends ParameterValidationError{constructor(a,$){super(),this.chainId=a,this.errorDetail=$,this.name="InvalidChainIdError",this.message=`Invalid chain id "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidKeyHashError extends ParameterValidationError{constructor(a,$){super(),this.keyHash=a,this.errorDetail=$,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidOperationHashError extends ParameterValidationError{constructor(a,$){super(),this.operationHash=a,this.errorDetail=$,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidOperationKindError extends ParameterValidationError{constructor(a,$){super(),this.operationKind=a,this.errorDetail=$,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${a}"`,this.message+=$?` ${$}.`:"."}}class DeprecationError extends UnsupportedActionError{constructor(a){super(),this.message=a,this.name="DeprecationError"}}class ProhibitedActionError extends UnsupportedActionError{constructor(a){super(),this.message=a,this.name="ProhibitedActionError"}}class PublicKeyNotFoundError extends TaquitoError{constructor(a,$){super(),this.pkh=a,this.cause=$,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${a}" 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(_){var a,$,j,et=Tt.prototype={constructor:Tt,toString:null,valueOf:null},tt=new Tt(1),rt=20,nt=4,it=-7,at=21,st=-1e7,ot=1e7,ut=!1,dt=1,mt=0,xt={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Ct="0123456789abcdefghijklmnopqrstuvwxyz",Pt=!0;function Tt(It,Dt){var Ft,Ot,yt,bt,ct,ht,vt,wt,At=this;if(!(At instanceof Tt))return new Tt(It,Dt);if(Dt==null){if(It&&It._isBigNumber===!0){At.s=It.s,!It.c||It.e>ot?At.c=At.e=null:It.e=10;ct/=10,bt++);bt>ot?At.c=At.e=null:(At.e=bt,At.c=[It]);return}wt=String(It)}else{if(!isNumeric.test(wt=String(It)))return j(At,wt,ht);At.s=wt.charCodeAt(0)==45?(wt=wt.slice(1),-1):1}(bt=wt.indexOf("."))>-1&&(wt=wt.replace(".","")),(ct=wt.search(/e/i))>0?(bt<0&&(bt=ct),bt+=+wt.slice(ct+1),wt=wt.substring(0,ct)):bt<0&&(bt=wt.length)}else{if(intCheck(Dt,2,Ct.length,"Base"),Dt==10&&Pt)return At=new Tt(It),zt(At,rt+At.e+1,nt);if(wt=String(It),ht=typeof It=="number"){if(It*0!=0)return j(At,wt,ht,Dt);if(At.s=1/It<0?(wt=wt.slice(1),-1):1,Tt.DEBUG&&wt.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+It)}else At.s=wt.charCodeAt(0)===45?(wt=wt.slice(1),-1):1;for(Ft=Ct.slice(0,Dt),bt=ct=0,vt=wt.length;ctbt){bt=vt;continue}}else if(!yt&&(wt==wt.toUpperCase()&&(wt=wt.toLowerCase())||wt==wt.toLowerCase()&&(wt=wt.toUpperCase()))){yt=!0,ct=-1,bt=0;continue}return j(At,String(It),ht,Dt)}ht=!1,wt=$(wt,Dt,10,At.s),(bt=wt.indexOf("."))>-1?wt=wt.replace(".",""):bt=wt.length}for(ct=0;wt.charCodeAt(ct)===48;ct++);for(vt=wt.length;wt.charCodeAt(--vt)===48;);if(wt=wt.slice(ct,++vt)){if(vt-=ct,ht&&Tt.DEBUG&&vt>15&&(It>MAX_SAFE_INTEGER$2||It!==mathfloor(It)))throw Error(tooManyDigits+At.s*It);if((bt=bt-ct-1)>ot)At.c=At.e=null;else if(bt=-MAX$1&&yt<=MAX$1&&yt===mathfloor(yt)){if(Ot[0]===0){if(yt===0&&Ot.length===1)return!0;break e}if(Dt=(yt+1)%LOG_BASE,Dt<1&&(Dt+=LOG_BASE),String(Ot[0]).length==Dt){for(Dt=0;Dt=BASE||Ft!==mathfloor(Ft))break e;if(Ft!==0)return!0}}}else if(Ot===null&&yt===null&&(bt===null||bt===1||bt===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+It)},Tt.maximum=Tt.max=function(){return Lt(arguments,-1)},Tt.minimum=Tt.min=function(){return Lt(arguments,1)},Tt.random=function(){var It=9007199254740992,Dt=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 Ot,yt,bt,ct,ht,vt=0,wt=[],At=new Tt(tt);if(Ft==null?Ft=rt:intCheck(Ft,0,MAX$1),ct=mathceil(Ft/LOG_BASE),ut)if(crypto.getRandomValues){for(Ot=crypto.getRandomValues(new Uint32Array(ct*=2));vt>>11),ht>=9e15?(yt=crypto.getRandomValues(new Uint32Array(2)),Ot[vt]=yt[0],Ot[vt+1]=yt[1]):(wt.push(ht%1e14),vt+=2);vt=ct/2}else if(crypto.randomBytes){for(Ot=crypto.randomBytes(ct*=7);vt=9e15?crypto.randomBytes(7).copy(Ot,vt):(wt.push(ht%1e14),vt+=7);vt=ct/7}else throw ut=!1,Error(bignumberError+"crypto unavailable");if(!ut)for(;vt=10;ht/=10,vt++);vtyt-1&&(ht[ct+1]==null&&(ht[ct+1]=0),ht[ct+1]+=ht[ct]/yt|0,ht[ct]%=yt)}return ht.reverse()}return function(Ft,Ot,yt,bt,ct){var ht,vt,wt,At,Rt,Et,$t,_t,jt=Ft.indexOf("."),tr=rt,nr=nt;for(jt>=0&&(At=mt,mt=0,Ft=Ft.replace(".",""),_t=new Tt(Ot),Et=_t.pow(Ft.length-jt),mt=At,_t.c=Dt(toFixedPoint(coeffToString(Et.c),Et.e,"0"),10,yt,It),_t.e=_t.c.length),$t=Dt(Ft,Ot,yt,ct?(ht=Ct,It):(ht=It,Ct)),wt=At=$t.length;$t[--At]==0;$t.pop());if(!$t[0])return ht.charAt(0);if(jt<0?--wt:(Et.c=$t,Et.e=wt,Et.s=bt,Et=a(Et,_t,tr,nr,yt),$t=Et.c,Rt=Et.r,wt=Et.e),vt=wt+tr+1,jt=$t[vt],At=yt/2,Rt=Rt||vt<0||$t[vt+1]!=null,Rt=nr<4?(jt!=null||Rt)&&(nr==0||nr==(Et.s<0?3:2)):jt>At||jt==At&&(nr==4||Rt||nr==6&&$t[vt-1]&1||nr==(Et.s<0?8:7)),vt<1||!$t[0])Ft=Rt?toFixedPoint(ht.charAt(1),-tr,ht.charAt(0)):ht.charAt(0);else{if($t.length=vt,Rt)for(--yt;++$t[--vt]>yt;)$t[vt]=0,vt||(++wt,$t=[1].concat($t));for(At=$t.length;!$t[--At];);for(jt=0,Ft="";jt<=At;Ft+=ht.charAt($t[jt++]));Ft=toFixedPoint(Ft,wt,ht.charAt(0))}return Ft}}(),a=function(){function It(Ot,yt,bt){var ct,ht,vt,wt,At=0,Rt=Ot.length,Et=yt%SQRT_BASE,$t=yt/SQRT_BASE|0;for(Ot=Ot.slice();Rt--;)vt=Ot[Rt]%SQRT_BASE,wt=Ot[Rt]/SQRT_BASE|0,ct=$t*vt+wt*Et,ht=Et*vt+ct%SQRT_BASE*SQRT_BASE+At,At=(ht/bt|0)+(ct/SQRT_BASE|0)+$t*wt,Ot[Rt]=ht%bt;return At&&(Ot=[At].concat(Ot)),Ot}function Dt(Ot,yt,bt,ct){var ht,vt;if(bt!=ct)vt=bt>ct?1:-1;else for(ht=vt=0;htyt[ht]?1:-1;break}return vt}function Ft(Ot,yt,bt,ct){for(var ht=0;bt--;)Ot[bt]-=ht,ht=Ot[bt]1;Ot.splice(0,1));}return function(Ot,yt,bt,ct,ht){var vt,wt,At,Rt,Et,$t,_t,jt,tr,nr,ir,Wt,Kt,Jt,Ht,Vt,Qt,dr=Ot.s==yt.s?1:-1,yr=Ot.c,pr=yt.c;if(!yr||!yr[0]||!pr||!pr[0])return new Tt(!Ot.s||!yt.s||(yr?pr&&yr[0]==pr[0]:!pr)?NaN:yr&&yr[0]==0||!pr?dr*0:dr/0);for(jt=new Tt(dr),tr=jt.c=[],wt=Ot.e-yt.e,dr=bt+wt+1,ht||(ht=BASE,wt=bitFloor(Ot.e/LOG_BASE)-bitFloor(yt.e/LOG_BASE),dr=dr/LOG_BASE|0),At=0;pr[At]==(yr[At]||0);At++);if(pr[At]>(yr[At]||0)&&wt--,dr<0)tr.push(1),Rt=!0;else{for(Jt=yr.length,Vt=pr.length,At=0,dr+=2,Et=mathfloor(ht/(pr[0]+1)),Et>1&&(pr=It(pr,Et,ht),yr=It(yr,Et,ht),Vt=pr.length,Jt=yr.length),Kt=Vt,nr=yr.slice(0,Vt),ir=nr.length;ir=ht/2&&Ht++;do{if(Et=0,vt=Dt(pr,nr,Vt,ir),vt<0){if(Wt=nr[0],Vt!=ir&&(Wt=Wt*ht+(nr[1]||0)),Et=mathfloor(Wt/Ht),Et>1)for(Et>=ht&&(Et=ht-1),$t=It(pr,Et,ht),_t=$t.length,ir=nr.length;Dt($t,nr,_t,ir)==1;)Et--,Ft($t,Vt<_t?Qt:pr,_t,ht),_t=$t.length,vt=1;else Et==0&&(vt=Et=1),$t=pr.slice(),_t=$t.length;if(_t=10;dr/=10,At++);zt(jt,bt+(jt.e=At+wt*LOG_BASE-1)+1,ct,Rt)}else jt.e=wt,jt.r=+Rt;return jt}}();function Mt(It,Dt,Ft,Ot){var yt,bt,ct,ht,vt;if(Ft==null?Ft=nt:intCheck(Ft,0,8),!It.c)return It.toString();if(yt=It.c[0],ct=It.e,Dt==null)vt=coeffToString(It.c),vt=Ot==1||Ot==2&&(ct<=it||ct>=at)?toExponential(vt,ct):toFixedPoint(vt,ct,"0");else if(It=zt(new Tt(It),Dt,Ft),bt=It.e,vt=coeffToString(It.c),ht=vt.length,Ot==1||Ot==2&&(Dt<=bt||bt<=it)){for(;htht){if(--Dt>0)for(vt+=".";Dt--;vt+="0");}else if(Dt+=bt-ht,Dt>0)for(bt+1==ht&&(vt+=".");Dt--;vt+="0");return It.s<0&&yt?"-"+vt:vt}function Lt(It,Dt){for(var Ft,Ot,yt=1,bt=new Tt(It[0]);yt=10;yt/=10,Ot++);return(Ft=Ot+Ft*LOG_BASE-1)>ot?It.c=It.e=null:Ft=10;ht/=10,yt++);if(bt=Dt-yt,bt<0)bt+=LOG_BASE,ct=Dt,vt=Rt[wt=0],At=mathfloor(vt/Et[yt-ct-1]%10);else if(wt=mathceil((bt+1)/LOG_BASE),wt>=Rt.length)if(Ot){for(;Rt.length<=wt;Rt.push(0));vt=At=0,yt=1,bt%=LOG_BASE,ct=bt-LOG_BASE+1}else break e;else{for(vt=ht=Rt[wt],yt=1;ht>=10;ht/=10,yt++);bt%=LOG_BASE,ct=bt-LOG_BASE+yt,At=ct<0?0:mathfloor(vt/Et[yt-ct-1]%10)}if(Ot=Ot||Dt<0||Rt[wt+1]!=null||(ct<0?vt:vt%Et[yt-ct-1]),Ot=Ft<4?(At||Ot)&&(Ft==0||Ft==(It.s<0?3:2)):At>5||At==5&&(Ft==4||Ot||Ft==6&&(bt>0?ct>0?vt/Et[yt-ct]:0:Rt[wt-1])%10&1||Ft==(It.s<0?8:7)),Dt<1||!Rt[0])return Rt.length=0,Ot?(Dt-=It.e+1,Rt[0]=Et[(LOG_BASE-Dt%LOG_BASE)%LOG_BASE],It.e=-Dt||0):Rt[0]=It.e=0,It;if(bt==0?(Rt.length=wt,ht=1,wt--):(Rt.length=wt+1,ht=Et[LOG_BASE-bt],Rt[wt]=ct>0?mathfloor(vt/Et[yt-ct]%Et[ct])*ht:0),Ot)for(;;)if(wt==0){for(bt=1,ct=Rt[0];ct>=10;ct/=10,bt++);for(ct=Rt[0]+=ht,ht=1;ct>=10;ct/=10,ht++);bt!=ht&&(It.e++,Rt[0]==BASE&&(Rt[0]=1));break}else{if(Rt[wt]+=ht,Rt[wt]!=BASE)break;Rt[wt--]=0,ht=1}for(bt=Rt.length;Rt[--bt]===0;Rt.pop());}It.e>ot?It.c=It.e=null:It.e=at?toExponential(Dt,Ft):toFixedPoint(Dt,Ft,"0"),It.s<0?"-"+Dt:Dt)}return et.absoluteValue=et.abs=function(){var It=new Tt(this);return It.s<0&&(It.s=1),It},et.comparedTo=function(It,Dt){return compare$c(this,new Tt(It,Dt))},et.decimalPlaces=et.dp=function(It,Dt){var Ft,Ot,yt,bt=this;if(It!=null)return intCheck(It,0,MAX$1),Dt==null?Dt=nt:intCheck(Dt,0,8),zt(new Tt(bt),It+bt.e+1,Dt);if(!(Ft=bt.c))return null;if(Ot=((yt=Ft.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,yt=Ft[yt])for(;yt%10==0;yt/=10,Ot--);return Ot<0&&(Ot=0),Ot},et.dividedBy=et.div=function(It,Dt){return a(this,new Tt(It,Dt),rt,nt)},et.dividedToIntegerBy=et.idiv=function(It,Dt){return a(this,new Tt(It,Dt),0,1)},et.exponentiatedBy=et.pow=function(It,Dt){var Ft,Ot,yt,bt,ct,ht,vt,wt,At,Rt=this;if(It=new Tt(It),It.c&&!It.isInteger())throw Error(bignumberError+"Exponent not an integer: "+Bt(It));if(Dt!=null&&(Dt=new Tt(Dt)),ht=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 Tt(Math.pow(+Bt(Rt),ht?It.s*(2-isOdd(It)):+Bt(It))),Dt?At.mod(Dt):At;if(vt=It.s<0,Dt){if(Dt.c?!Dt.c[0]:!Dt.s)return new Tt(NaN);Ot=!vt&&Rt.isInteger()&&Dt.isInteger(),Ot&&(Rt=Rt.mod(Dt))}else{if(It.e>9&&(Rt.e>0||Rt.e<-1||(Rt.e==0?Rt.c[0]>1||ht&&Rt.c[1]>=24e7:Rt.c[0]<8e13||ht&&Rt.c[0]<=9999975e7)))return bt=Rt.s<0&&isOdd(It)?-0:0,Rt.e>-1&&(bt=1/bt),new Tt(vt?1/bt:bt);mt&&(bt=mathceil(mt/LOG_BASE+2))}for(ht?(Ft=new Tt(.5),vt&&(It.s=1),wt=isOdd(It)):(yt=Math.abs(+Bt(It)),wt=yt%2),At=new Tt(tt);;){if(wt){if(At=At.times(Rt),!At.c)break;bt?At.c.length>bt&&(At.c.length=bt):Ot&&(At=At.mod(Dt))}if(yt){if(yt=mathfloor(yt/2),yt===0)break;wt=yt%2}else if(It=It.times(Ft),zt(It,It.e+1,1),It.e>14)wt=isOdd(It);else{if(yt=+Bt(It),yt===0)break;wt=yt%2}Rt=Rt.times(Rt),bt?Rt.c&&Rt.c.length>bt&&(Rt.c.length=bt):Ot&&(Rt=Rt.mod(Dt))}return Ot?At:(vt&&(At=tt.div(At)),Dt?At.mod(Dt):bt?zt(At,mt,nt,ct):At)},et.integerValue=function(It){var Dt=new Tt(this);return It==null?It=nt:intCheck(It,0,8),zt(Dt,Dt.e+1,It)},et.isEqualTo=et.eq=function(It,Dt){return compare$c(this,new Tt(It,Dt))===0},et.isFinite=function(){return!!this.c},et.isGreaterThan=et.gt=function(It,Dt){return compare$c(this,new Tt(It,Dt))>0},et.isGreaterThanOrEqualTo=et.gte=function(It,Dt){return(Dt=compare$c(this,new Tt(It,Dt)))===1||Dt===0},et.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},et.isLessThan=et.lt=function(It,Dt){return compare$c(this,new Tt(It,Dt))<0},et.isLessThanOrEqualTo=et.lte=function(It,Dt){return(Dt=compare$c(this,new Tt(It,Dt)))===-1||Dt===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,Dt){var Ft,Ot,yt,bt,ct=this,ht=ct.s;if(It=new Tt(It,Dt),Dt=It.s,!ht||!Dt)return new Tt(NaN);if(ht!=Dt)return It.s=-Dt,ct.plus(It);var vt=ct.e/LOG_BASE,wt=It.e/LOG_BASE,At=ct.c,Rt=It.c;if(!vt||!wt){if(!At||!Rt)return At?(It.s=-Dt,It):new Tt(Rt?ct:NaN);if(!At[0]||!Rt[0])return Rt[0]?(It.s=-Dt,It):new Tt(At[0]?ct:nt==3?-0:0)}if(vt=bitFloor(vt),wt=bitFloor(wt),At=At.slice(),ht=vt-wt){for((bt=ht<0)?(ht=-ht,yt=At):(wt=vt,yt=Rt),yt.reverse(),Dt=ht;Dt--;yt.push(0));yt.reverse()}else for(Ot=(bt=(ht=At.length)<(Dt=Rt.length))?ht:Dt,ht=Dt=0;Dt0)for(;Dt--;At[Ft++]=0);for(Dt=BASE-1;Ot>ht;){if(At[--Ot]=0;){for(Ft=0,Et=Wt[yt]%tr,$t=Wt[yt]/tr|0,ct=vt,bt=yt+ct;bt>yt;)wt=ir[--ct]%tr,At=ir[ct]/tr|0,ht=$t*wt+At*Et,wt=Et*wt+ht%tr*tr+_t[bt]+Ft,Ft=(wt/jt|0)+(ht/tr|0)+$t*At,_t[bt--]=wt%jt;_t[bt]=Ft}return Ft?++Ot:_t.splice(0,1),Nt(It,_t,Ot)},et.negated=function(){var It=new Tt(this);return It.s=-It.s||null,It},et.plus=function(It,Dt){var Ft,Ot=this,yt=Ot.s;if(It=new Tt(It,Dt),Dt=It.s,!yt||!Dt)return new Tt(NaN);if(yt!=Dt)return It.s=-Dt,Ot.minus(It);var bt=Ot.e/LOG_BASE,ct=It.e/LOG_BASE,ht=Ot.c,vt=It.c;if(!bt||!ct){if(!ht||!vt)return new Tt(yt/0);if(!ht[0]||!vt[0])return vt[0]?It:new Tt(ht[0]?Ot:yt*0)}if(bt=bitFloor(bt),ct=bitFloor(ct),ht=ht.slice(),yt=bt-ct){for(yt>0?(ct=bt,Ft=vt):(yt=-yt,Ft=ht),Ft.reverse();yt--;Ft.push(0));Ft.reverse()}for(yt=ht.length,Dt=vt.length,yt-Dt<0&&(Ft=vt,vt=ht,ht=Ft,Dt=yt),yt=0;Dt;)yt=(ht[--Dt]=ht[Dt]+vt[Dt]+yt)/BASE|0,ht[Dt]=BASE===ht[Dt]?0:ht[Dt]%BASE;return yt&&(ht=[yt].concat(ht),++ct),Nt(It,ht,ct)},et.precision=et.sd=function(It,Dt){var Ft,Ot,yt,bt=this;if(It!=null&&It!==!!It)return intCheck(It,1,MAX$1),Dt==null?Dt=nt:intCheck(Dt,0,8),zt(new Tt(bt),It,Dt);if(!(Ft=bt.c))return null;if(yt=Ft.length-1,Ot=yt*LOG_BASE+1,yt=Ft[yt]){for(;yt%10==0;yt/=10,Ot--);for(yt=Ft[0];yt>=10;yt/=10,Ot++);}return It&&bt.e+1>Ot&&(Ot=bt.e+1),Ot},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,Dt,Ft,Ot,yt,bt=this,ct=bt.c,ht=bt.s,vt=bt.e,wt=rt+4,At=new Tt("0.5");if(ht!==1||!ct||!ct[0])return new Tt(!ht||ht<0&&(!ct||ct[0])?NaN:ct?bt:1/0);if(ht=Math.sqrt(+Bt(bt)),ht==0||ht==1/0?(Dt=coeffToString(ct),(Dt.length+vt)%2==0&&(Dt+="0"),ht=Math.sqrt(+Dt),vt=bitFloor((vt+1)/2)-(vt<0||vt%2),ht==1/0?Dt="5e"+vt:(Dt=ht.toExponential(),Dt=Dt.slice(0,Dt.indexOf("e")+1)+vt),Ft=new Tt(Dt)):Ft=new Tt(ht+""),Ft.c[0]){for(vt=Ft.e,ht=vt+wt,ht<3&&(ht=0);;)if(yt=Ft,Ft=At.times(yt.plus(a(bt,yt,wt,1))),coeffToString(yt.c).slice(0,ht)===(Dt=coeffToString(Ft.c)).slice(0,ht))if(Ft.e0&&_t>0){for(bt=_t%ht||ht,At=$t.substr(0,bt);bt<_t;bt+=ht)At+=wt+$t.substr(bt,ht);vt>0&&(At+=wt+$t.slice(bt)),Et&&(At="-"+At)}Ot=Rt?At+(Ft.decimalSeparator||"")+((vt=+Ft.fractionGroupSize)?Rt.replace(new RegExp("\\d{"+vt+"}\\B","g"),"$&"+(Ft.fractionGroupSeparator||"")):Rt):At}return(Ft.prefix||"")+Ot+(Ft.suffix||"")},et.toFraction=function(It){var Dt,Ft,Ot,yt,bt,ct,ht,vt,wt,At,Rt,Et,$t=this,_t=$t.c;if(It!=null&&(ht=new Tt(It),!ht.isInteger()&&(ht.c||ht.s!==1)||ht.lt(tt)))throw Error(bignumberError+"Argument "+(ht.isInteger()?"out of range: ":"not an integer: ")+Bt(ht));if(!_t)return new Tt($t);for(Dt=new Tt(tt),wt=Ft=new Tt(tt),Ot=vt=new Tt(tt),Et=coeffToString(_t),bt=Dt.e=Et.length-$t.e-1,Dt.c[0]=POWS_TEN[(ct=bt%LOG_BASE)<0?LOG_BASE+ct:ct],It=!It||ht.comparedTo(Dt)>0?bt>0?Dt:wt:ht,ct=ot,ot=1/0,ht=new Tt(Et),vt.c[0]=0;At=a(ht,Dt,0,1),yt=Ft.plus(At.times(Ot)),yt.comparedTo(It)!=1;)Ft=Ot,Ot=yt,wt=vt.plus(At.times(yt=wt)),vt=yt,Dt=ht.minus(At.times(yt=Dt)),ht=yt;return yt=a(It.minus(Ft),Ot,0,1),vt=vt.plus(yt.times(wt)),Ft=Ft.plus(yt.times(Ot)),vt.s=wt.s=$t.s,bt=bt*2,Rt=a(wt,Ot,bt,nt).minus($t).abs().comparedTo(a(vt,Ft,bt,nt).minus($t).abs())<1?[wt,Ot]:[vt,Ft],ot=ct,Rt},et.toNumber=function(){return+Bt(this)},et.toPrecision=function(It,Dt){return It!=null&&intCheck(It,1,MAX$1),Mt(this,It,Dt,2)},et.toString=function(It){var Dt,Ft=this,Ot=Ft.s,yt=Ft.e;return yt===null?Ot?(Dt="Infinity",Ot<0&&(Dt="-"+Dt)):Dt="NaN":(It==null?Dt=yt<=it||yt>=at?toExponential(coeffToString(Ft.c),yt):toFixedPoint(coeffToString(Ft.c),yt,"0"):It===10&&Pt?(Ft=zt(new Tt(Ft),rt+yt+1,nt),Dt=toFixedPoint(coeffToString(Ft.c),Ft.e,"0")):(intCheck(It,2,Ct.length,"Base"),Dt=$(toFixedPoint(coeffToString(Ft.c),yt,"0"),10,It,Ot,!0)),Ot<0&&Ft.c[0]&&(Dt="-"+Dt)),Dt},et.valueOf=et.toJSON=function(){return Bt(this)},et._isBigNumber=!0,et[Symbol.toStringTag]="BigNumber",et[Symbol.for("nodejs.util.inspect.custom")]=et.valueOf,_!=null&&Tt.set(_),Tt}function bitFloor(_){var a=_|0;return _>0||_===a?a:a-1}function coeffToString(_){for(var a,$,j=1,et=_.length,tt=_[0]+"";jat^$?1:-1;for(nt=(it=et.length)<(at=tt.length)?it:at,rt=0;rttt[rt]^$?1:-1;return it==at?0:it>at^$?1:-1}function intCheck(_,a,$,j){if(_$||_!==mathfloor(_))throw Error(bignumberError+(j||"Argument")+(typeof _=="number"?_$?" out of range: ":" not an integer: ":" not a primitive number: ")+String(_))}function isOdd(_){var a=_.c.length-1;return bitFloor(_.e/LOG_BASE)==a&&_.c[a]%2!=0}function toExponential(_,a){return(_.length>1?_.charAt(0)+"."+_.slice(1):_)+(a<0?"e":"e+")+a}function toFixedPoint(_,a,$){var j,et;if(a<0){for(et=$+".";++a;et+=$);_=et+_}else if(j=_.length,++a>j){for(et=$,a-=j;--a;et+=$);_+=et}else a",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$z={};(function(_){var a=_,$=bnExports$1,j=minimalisticAssert,et=utils$P;a.assert=j,a.toArray=et.toArray,a.zero2=et.zero2,a.toHex=et.toHex,a.encode=et.encode;function tt(st,ot,ut){var dt=new Array(Math.max(st.bitLength(),ut)+1);dt.fill(0);for(var mt=1<(mt>>1)-1?Pt=(mt>>1)-Tt:Pt=Tt,xt.isubn(Pt)):Pt=0,dt[Ct]=Pt,xt.iushrn(1)}return dt}a.getNAF=tt;function rt(st,ot){var ut=[[],[]];st=st.clone(),ot=ot.clone();for(var dt=0,mt=0,xt;st.cmpn(-dt)>0||ot.cmpn(-mt)>0;){var Ct=st.andln(3)+dt&3,Pt=ot.andln(3)+mt&3;Ct===3&&(Ct=-1),Pt===3&&(Pt=-1);var Tt;Ct&1?(xt=st.andln(7)+dt&7,(xt===3||xt===5)&&Pt===2?Tt=-Ct:Tt=Ct):Tt=0,ut[0].push(Tt);var Mt;Pt&1?(xt=ot.andln(7)+mt&7,(xt===3||xt===5)&&Ct===2?Mt=-Pt:Mt=Pt):Mt=0,ut[1].push(Mt),2*dt===Tt+1&&(dt=1-dt),2*mt===Mt+1&&(mt=1-mt),st.iushrn(1),ot.iushrn(1)}return ut}a.getJSF=rt;function nt(st,ot,ut){var dt="_"+ot;st.prototype[ot]=function(){return this[dt]!==void 0?this[dt]:this[dt]=ut.call(this)}}a.cachedProperty=nt;function it(st){return typeof st=="string"?a.toArray(st,"hex"):st}a.parseBytes=it;function at(st){return new $(st,"hex","le")}a.intFromLE=at})(utils$z);var curve$2={},BN$o=bnExports$1,utils$y=utils$z,getNAF$2=utils$y.getNAF,getJSF$2=utils$y.getJSF,assert$t=utils$y.assert;function BaseCurve$2(_,a){this.type=_,this.p=new BN$o(a.p,16),this.red=a.prime?BN$o.red(a.prime):BN$o.mont(this.p),this.zero=new BN$o(0).toRed(this.red),this.one=new BN$o(1).toRed(this.red),this.two=new BN$o(2).toRed(this.red),this.n=a.n&&new BN$o(a.n,16),this.g=a.g&&this.pointFromJSON(a.g,a.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$2=BaseCurve$2;BaseCurve$2.prototype.point=function _(){throw new Error("Not implemented")};BaseCurve$2.prototype.validate=function _(){throw new Error("Not implemented")};BaseCurve$2.prototype._fixedNafMul=function _(a,$){assert$t(a.precomputed);var j=a._getDoubles(),et=getNAF$2($,1,this._bitLength),tt=(1<=nt;at--)it=(it<<1)+et[at];rt.push(it)}for(var st=this.jpoint(null,null,null),ot=this.jpoint(null,null,null),ut=tt;ut>0;ut--){for(nt=0;nt=0;it--){for(var at=0;it>=0&&rt[it]===0;it--)at++;if(it>=0&&at++,nt=nt.dblp(at),it<0)break;var st=rt[it];assert$t(st!==0),a.type==="affine"?st>0?nt=nt.mixedAdd(tt[st-1>>1]):nt=nt.mixedAdd(tt[-st-1>>1].neg()):st>0?nt=nt.add(tt[st-1>>1]):nt=nt.add(tt[-st-1>>1].neg())}return a.type==="affine"?nt.toP():nt};BaseCurve$2.prototype._wnafMulAdd=function _(a,$,j,et,tt){var rt=this._wnafT1,nt=this._wnafT2,it=this._wnafT3,at=0,st,ot,ut;for(st=0;st=1;st-=2){var mt=st-1,xt=st;if(rt[mt]!==1||rt[xt]!==1){it[mt]=getNAF$2(j[mt],rt[mt],this._bitLength),it[xt]=getNAF$2(j[xt],rt[xt],this._bitLength),at=Math.max(it[mt].length,at),at=Math.max(it[xt].length,at);continue}var Ct=[$[mt],null,null,$[xt]];$[mt].y.cmp($[xt].y)===0?(Ct[1]=$[mt].add($[xt]),Ct[2]=$[mt].toJ().mixedAdd($[xt].neg())):$[mt].y.cmp($[xt].y.redNeg())===0?(Ct[1]=$[mt].toJ().mixedAdd($[xt]),Ct[2]=$[mt].add($[xt].neg())):(Ct[1]=$[mt].toJ().mixedAdd($[xt]),Ct[2]=$[mt].toJ().mixedAdd($[xt].neg()));var Pt=[-3,-1,-5,-7,0,7,5,1,3],Tt=getJSF$2(j[mt],j[xt]);for(at=Math.max(Tt[0].length,at),it[mt]=new Array(at),it[xt]=new Array(at),ot=0;ot=0;st--){for(var Bt=0;st>=0;){var It=!0;for(ot=0;ot=0&&Bt++,Nt=Nt.dblp(Bt),st<0)break;for(ot=0;ot0?ut=nt[ot][Dt-1>>1]:Dt<0&&(ut=nt[ot][-Dt-1>>1].neg()),ut.type==="affine"?Nt=Nt.mixedAdd(ut):Nt=Nt.add(ut))}}for(st=0;st=Math.ceil((a.bitLength()+1)/$.step):!1};BasePoint$2.prototype._getDoubles=function _(a,$){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var j=[this],et=this,tt=0;tt<$;tt+=a){for(var rt=0;rt=0&&(dt=at,mt=st),ot.negative&&(ot=ot.neg(),ut=ut.neg()),dt.negative&&(dt=dt.neg(),mt=mt.neg()),[{a:ot,b:ut},{a:dt,b:mt}]};ShortCurve$2.prototype._endoSplit=function _(a){var $=this.endo.basis,j=$[0],et=$[1],tt=et.b.mul(a).divRound(this.n),rt=j.b.neg().mul(a).divRound(this.n),nt=tt.mul(j.a),it=rt.mul(et.a),at=tt.mul(j.b),st=rt.mul(et.b),ot=a.sub(nt).sub(it),ut=at.add(st).neg();return{k1:ot,k2:ut}};ShortCurve$2.prototype.pointFromX=function _(a,$){a=new BN$n(a,16),a.red||(a=a.toRed(this.red));var j=a.redSqr().redMul(a).redIAdd(a.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(a,et)};ShortCurve$2.prototype.validate=function _(a){if(a.inf)return!0;var $=a.x,j=a.y,et=this.a.redMul($),tt=$.redSqr().redMul($).redIAdd(et).redIAdd(this.b);return j.redSqr().redISub(tt).cmpn(0)===0};ShortCurve$2.prototype._endoWnafMulAdd=function _(a,$,j){for(var et=this._endoWnafT1,tt=this._endoWnafT2,rt=0;rt":""};Point$8.prototype.isInfinity=function _(){return this.inf};Point$8.prototype.add=function _(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(this.x.cmp(a.x)===0)return this.curve.point(null,null);var $=this.y.redSub(a.y);$.cmpn(0)!==0&&($=$.redMul(this.x.redSub(a.x).redInvm()));var j=$.redSqr().redISub(this.x).redISub(a.x),et=$.redMul(this.x.redSub(j)).redISub(this.y);return this.curve.point(j,et)};Point$8.prototype.dbl=function _(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(a.cmpn(0)===0)return this.curve.point(null,null);var $=this.curve.a,j=this.x.redSqr(),et=a.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$8.prototype.getX=function _(){return this.x.fromRed()};Point$8.prototype.getY=function _(){return this.y.fromRed()};Point$8.prototype.mul=function _(a){return a=new BN$n(a,16),this.isInfinity()?this:this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)};Point$8.prototype.mulAdd=function _(a,$,j){var et=[this,$],tt=[a,j];return this.curve.endo?this.curve._endoWnafMulAdd(et,tt):this.curve._wnafMulAdd(1,et,tt,2)};Point$8.prototype.jmulAdd=function _(a,$,j){var et=[this,$],tt=[a,j];return this.curve.endo?this.curve._endoWnafMulAdd(et,tt,!0):this.curve._wnafMulAdd(1,et,tt,2,!0)};Point$8.prototype.eq=function _(a){return this===a||this.inf===a.inf&&(this.inf||this.x.cmp(a.x)===0&&this.y.cmp(a.y)===0)};Point$8.prototype.neg=function _(a){if(this.inf)return this;var $=this.curve.point(this.x,this.y.redNeg());if(a&&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$8.prototype.toJ=function _(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a};function JPoint$2(_,a,$,j){Base$8.BasePoint.call(this,_,"jacobian"),a===null&&$===null&&j===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$n(0)):(this.x=new BN$n(a,16),this.y=new BN$n($,16),this.z=new BN$n(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$8(JPoint$2,Base$8.BasePoint);ShortCurve$2.prototype.jpoint=function _(a,$,j){return new JPoint$2(this,a,$,j)};JPoint$2.prototype.toP=function _(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),$=a.redSqr(),j=this.x.redMul($),et=this.y.redMul($).redMul(a);return this.curve.point(j,et)};JPoint$2.prototype.neg=function _(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint$2.prototype.add=function _(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var $=a.z.redSqr(),j=this.z.redSqr(),et=this.x.redMul($),tt=a.x.redMul(j),rt=this.y.redMul($.redMul(a.z)),nt=a.y.redMul(j.redMul(this.z)),it=et.redSub(tt),at=rt.redSub(nt);if(it.cmpn(0)===0)return at.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var st=it.redSqr(),ot=st.redMul(it),ut=et.redMul(st),dt=at.redSqr().redIAdd(ot).redISub(ut).redISub(ut),mt=at.redMul(ut.redISub(dt)).redISub(rt.redMul(ot)),xt=this.z.redMul(a.z).redMul(it);return this.curve.jpoint(dt,mt,xt)};JPoint$2.prototype.mixedAdd=function _(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var $=this.z.redSqr(),j=this.x,et=a.x.redMul($),tt=this.y,rt=a.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 at=nt.redSqr(),st=at.redMul(nt),ot=j.redMul(at),ut=it.redSqr().redIAdd(st).redISub(ot).redISub(ot),dt=it.redMul(ot.redISub(ut)).redISub(tt.redMul(st)),mt=this.z.redMul(nt);return this.curve.jpoint(ut,dt,mt)};JPoint$2.prototype.dblp=function _(a){if(a===0)return this;if(this.isInfinity())return this;if(!a)return this.dbl();var $;if(this.curve.zeroA||this.curve.threeA){var j=this;for($=0;$=0)return!1;if(j.redIAdd(tt),this.x.cmp(j)===0)return!0}};JPoint$2.prototype.inspect=function _(){return this.isInfinity()?"":""};JPoint$2.prototype.isInfinity=function _(){return this.z.cmpn(0)===0};var BN$m=bnExports$1,inherits$7=inherits_browserExports,Base$7=base$2,utils$w=utils$z;function MontCurve$2(_){Base$7.call(this,"mont",_),this.a=new BN$m(_.a,16).toRed(this.red),this.b=new BN$m(_.b,16).toRed(this.red),this.i4=new BN$m(4).toRed(this.red).redInvm(),this.two=new BN$m(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$7(MontCurve$2,Base$7);var mont$2=MontCurve$2;MontCurve$2.prototype.validate=function _(a){var $=a.normalize().x,j=$.redSqr(),et=j.redMul($).redAdd(j.redMul(this.a)).redAdd($),tt=et.redSqrt();return tt.redSqr().cmp(et)===0};function Point$7(_,a,$){Base$7.BasePoint.call(this,_,"projective"),a===null&&$===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$m(a,16),this.z=new BN$m($,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$7(Point$7,Base$7.BasePoint);MontCurve$2.prototype.decodePoint=function _(a,$){return this.point(utils$w.toArray(a,$),1)};MontCurve$2.prototype.point=function _(a,$){return new Point$7(this,a,$)};MontCurve$2.prototype.pointFromJSON=function _(a){return Point$7.fromJSON(this,a)};Point$7.prototype.precompute=function _(){};Point$7.prototype._encode=function _(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$7.fromJSON=function _(a,$){return new Point$7(a,$[0],$[1]||a.one)};Point$7.prototype.inspect=function _(){return this.isInfinity()?"":""};Point$7.prototype.isInfinity=function _(){return this.z.cmpn(0)===0};Point$7.prototype.dbl=function _(){var a=this.x.redAdd(this.z),$=a.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$7.prototype.add=function _(){throw new Error("Not supported on Montgomery curve")};Point$7.prototype.diffAdd=function _(a,$){var j=this.x.redAdd(this.z),et=this.x.redSub(this.z),tt=a.x.redAdd(a.z),rt=a.x.redSub(a.z),nt=rt.redMul(j),it=tt.redMul(et),at=$.z.redMul(nt.redAdd(it).redSqr()),st=$.x.redMul(nt.redISub(it).redSqr());return this.curve.point(at,st)};Point$7.prototype.mul=function _(a){for(var $=a.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$7.prototype.mulAdd=function _(){throw new Error("Not supported on Montgomery curve")};Point$7.prototype.jumlAdd=function _(){throw new Error("Not supported on Montgomery curve")};Point$7.prototype.eq=function _(a){return this.getX().cmp(a.getX())===0};Point$7.prototype.normalize=function _(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$7.prototype.getX=function _(){return this.normalize(),this.x.fromRed()};var utils$v=utils$z,BN$l=bnExports$1,inherits$6=inherits_browserExports,Base$6=base$2,assert$r=utils$v.assert;function EdwardsCurve$2(_){this.twisted=(_.a|0)!==1,this.mOneA=this.twisted&&(_.a|0)===-1,this.extended=this.mOneA,Base$6.call(this,"edwards",_),this.a=new BN$l(_.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$l(_.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$l(_.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$r(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(_.c|0)===1}inherits$6(EdwardsCurve$2,Base$6);var edwards$2=EdwardsCurve$2;EdwardsCurve$2.prototype._mulA=function _(a){return this.mOneA?a.redNeg():this.a.redMul(a)};EdwardsCurve$2.prototype._mulC=function _(a){return this.oneC?a:this.c.redMul(a)};EdwardsCurve$2.prototype.jpoint=function _(a,$,j,et){return this.point(a,$,j,et)};EdwardsCurve$2.prototype.pointFromX=function _(a,$){a=new BN$l(a,16),a.red||(a=a.toRed(this.red));var j=a.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(a,nt)};EdwardsCurve$2.prototype.pointFromY=function _(a,$){a=new BN$l(a,16),a.red||(a=a.toRed(this.red));var j=a.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,a)}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,a)};EdwardsCurve$2.prototype.validate=function _(a){if(a.isInfinity())return!0;a.normalize();var $=a.x.redSqr(),j=a.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$6(_,a,$,j,et){Base$6.BasePoint.call(this,_,"projective"),a===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$l(a,16),this.y=new BN$l($,16),this.z=j?new BN$l(j,16):this.curve.one,this.t=et&&new BN$l(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$6(Point$6,Base$6.BasePoint);EdwardsCurve$2.prototype.pointFromJSON=function _(a){return Point$6.fromJSON(this,a)};EdwardsCurve$2.prototype.point=function _(a,$,j,et){return new Point$6(this,a,$,j,et)};Point$6.fromJSON=function _(a,$){return new Point$6(a,$[0],$[1],$[2])};Point$6.prototype.inspect=function _(){return this.isInfinity()?"":""};Point$6.prototype.isInfinity=function _(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point$6.prototype._extDbl=function _(){var a=this.x.redSqr(),$=this.y.redSqr(),j=this.z.redSqr();j=j.redIAdd(j);var et=this.curve._mulA(a),tt=this.x.redAdd(this.y).redSqr().redISub(a).redISub($),rt=et.redAdd($),nt=rt.redSub(j),it=et.redSub($),at=tt.redMul(nt),st=rt.redMul(it),ot=tt.redMul(it),ut=nt.redMul(rt);return this.curve.point(at,st,ut,ot)};Point$6.prototype._projDbl=function _(){var a=this.x.redAdd(this.y).redSqr(),$=this.x.redSqr(),j=this.y.redSqr(),et,tt,rt,nt,it,at;if(this.curve.twisted){nt=this.curve._mulA($);var st=nt.redAdd(j);this.zOne?(et=a.redSub($).redSub(j).redMul(st.redSub(this.curve.two)),tt=st.redMul(nt.redSub(j)),rt=st.redSqr().redSub(st).redSub(st)):(it=this.z.redSqr(),at=st.redSub(it).redISub(it),et=a.redSub($).redISub(j).redMul(at),tt=st.redMul(nt.redSub(j)),rt=st.redMul(at))}else nt=$.redAdd(j),it=this.curve._mulC(this.z).redSqr(),at=nt.redSub(it).redSub(it),et=this.curve._mulC(a.redISub(nt)).redMul(at),tt=this.curve._mulC(nt).redMul($.redISub(j)),rt=nt.redMul(at);return this.curve.point(et,tt,rt)};Point$6.prototype.dbl=function _(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point$6.prototype._extAdd=function _(a){var $=this.y.redSub(this.x).redMul(a.y.redSub(a.x)),j=this.y.redAdd(this.x).redMul(a.y.redAdd(a.x)),et=this.t.redMul(this.curve.dd).redMul(a.t),tt=this.z.redMul(a.z.redAdd(a.z)),rt=j.redSub($),nt=tt.redSub(et),it=tt.redAdd(et),at=j.redAdd($),st=rt.redMul(nt),ot=it.redMul(at),ut=rt.redMul(at),dt=nt.redMul(it);return this.curve.point(st,ot,dt,ut)};Point$6.prototype._projAdd=function _(a){var $=this.z.redMul(a.z),j=$.redSqr(),et=this.x.redMul(a.x),tt=this.y.redMul(a.y),rt=this.curve.d.redMul(et).redMul(tt),nt=j.redSub(rt),it=j.redAdd(rt),at=this.x.redAdd(this.y).redMul(a.x.redAdd(a.y)).redISub(et).redISub(tt),st=$.redMul(nt).redMul(at),ot,ut;return this.curve.twisted?(ot=$.redMul(it).redMul(tt.redSub(this.curve._mulA(et))),ut=nt.redMul(it)):(ot=$.redMul(it).redMul(tt.redSub(et)),ut=this.curve._mulC(nt).redMul(it)),this.curve.point(st,ot,ut)};Point$6.prototype.add=function _(a){return this.isInfinity()?a:a.isInfinity()?this:this.curve.extended?this._extAdd(a):this._projAdd(a)};Point$6.prototype.mul=function _(a){return this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve._wnafMul(this,a)};Point$6.prototype.mulAdd=function _(a,$,j){return this.curve._wnafMulAdd(1,[this,$],[a,j],2,!1)};Point$6.prototype.jmulAdd=function _(a,$,j){return this.curve._wnafMulAdd(1,[this,$],[a,j],2,!0)};Point$6.prototype.normalize=function _(){if(this.zOne)return this;var a=this.z.redInvm();return this.x=this.x.redMul(a),this.y=this.y.redMul(a),this.t&&(this.t=this.t.redMul(a)),this.z=this.curve.one,this.zOne=!0,this};Point$6.prototype.neg=function _(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point$6.prototype.getX=function _(){return this.normalize(),this.x.fromRed()};Point$6.prototype.getY=function _(){return this.normalize(),this.y.fromRed()};Point$6.prototype.eq=function _(a){return this===a||this.getX().cmp(a.getX())===0&&this.getY().cmp(a.getY())===0};Point$6.prototype.eqXToP=function _(a){var $=a.toRed(this.curve.red).redMul(this.z);if(this.x.cmp($)===0)return!0;for(var j=a.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$6.prototype.toP=Point$6.prototype.normalize;Point$6.prototype.mixedAdd=Point$6.prototype.add;(function(_){var a=_;a.base=base$2,a.short=short$2,a.mont=mont$2,a.edwards=edwards$2})(curve$2);var curves$8={},secp256k1$2,hasRequiredSecp256k1$2;function requireSecp256k1$2(){return hasRequiredSecp256k1$2||(hasRequiredSecp256k1$2=1,secp256k1$2={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$2}(function(_){var a=_,$=hash$8,j=curve$2,et=utils$z,tt=et.assert;function rt(at){at.type==="short"?this.curve=new j.short(at):at.type==="edwards"?this.curve=new j.edwards(at):this.curve=new j.mont(at),this.g=this.curve.g,this.n=this.curve.n,this.hash=at.hash,tt(this.g.validate(),"Invalid curve"),tt(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}a.PresetCurve=rt;function nt(at,st){Object.defineProperty(a,at,{configurable:!0,enumerable:!0,get:function(){var ot=new rt(st);return Object.defineProperty(a,at,{configurable:!0,enumerable:!0,value:ot}),ot}})}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$2()}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$8);var BN$k=bnExports$1,utils$u=utils$z,assert$q=utils$u.assert;function KeyPair$b(_,a){this.ec=_,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}var key$5=KeyPair$b;KeyPair$b.fromPublic=function _(a,$,j){return $ instanceof KeyPair$b?$:new KeyPair$b(a,{pub:$,pubEnc:j})};KeyPair$b.fromPrivate=function _(a,$,j){return $ instanceof KeyPair$b?$:new KeyPair$b(a,{priv:$,privEnc:j})};KeyPair$b.prototype.validate=function _(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.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$b.prototype.getPublic=function _(a,$){return typeof a=="string"&&($=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),$?this.pub.encode($,a):this.pub};KeyPair$b.prototype.getPrivate=function _(a){return a==="hex"?this.priv.toString(16,2):this.priv};KeyPair$b.prototype._importPrivate=function _(a,$){this.priv=new BN$k(a,$||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair$b.prototype._importPublic=function _(a,$){if(a.x||a.y){this.ec.curve.type==="mont"?assert$q(a.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$q(a.x&&a.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(a.x,a.y);return}this.pub=this.ec.curve.decodePoint(a,$)};KeyPair$b.prototype.derive=function _(a){return a.validate()||assert$q(a.validate(),"public point not validated"),a.mul(this.priv).getX()};KeyPair$b.prototype.sign=function _(a,$,j){return this.ec.sign(a,this,$,j)};KeyPair$b.prototype.verify=function _(a,$){return this.ec.verify(a,$,this)};KeyPair$b.prototype.inspect=function _(){return""};var BN$j=bnExports$1,utils$t=utils$z,assert$p=utils$t.assert;function Signature$b(_,a){if(_ instanceof Signature$b)return _;this._importDER(_,a)||(assert$p(_.r&&_.s,"Signature without r or s"),this.r=new BN$j(_.r,16),this.s=new BN$j(_.s,16),_.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=_.recoveryParam)}var signature$5=Signature$b;function Position$2(){this.place=0}function getLength$2(_,a){var $=_[a.place++];if(!($&128))return $;var j=$&15;if(j===0||j>4)return!1;for(var et=0,tt=0,rt=a.place;tt>>=0;return et<=127?!1:(a.place=rt,et)}function rmPadding$2(_){for(var a=0,$=_.length-1;!_[a]&&!(_[a+1]&128)&&a<$;)a++;return a===0?_:_.slice(a)}Signature$b.prototype._importDER=function _(a,$){a=utils$t.toArray(a,$);var j=new Position$2;if(a[j.place++]!==48)return!1;var et=getLength$2(a,j);if(et===!1||et+j.place!==a.length||a[j.place++]!==2)return!1;var tt=getLength$2(a,j);if(tt===!1)return!1;var rt=a.slice(j.place,tt+j.place);if(j.place+=tt,a[j.place++]!==2)return!1;var nt=getLength$2(a,j);if(nt===!1||a.length!==nt+j.place)return!1;var it=a.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$j(rt),this.s=new BN$j(it),this.recoveryParam=null,!0};function constructLength$2(_,a){if(a<128){_.push(a);return}var $=1+(Math.log(a)/Math.LN2>>>3);for(_.push($|128);--$;)_.push(a>>>($<<3)&255);_.push(a)}Signature$b.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$2($),j=rmPadding$2(j);!j[0]&&!(j[1]&128);)j=j.slice(1);var et=[2];constructLength$2(et,$.length),et=et.concat($),et.push(2),constructLength$2(et,j.length);var tt=et.concat(j),rt=[48];return constructLength$2(rt,tt.length),rt=rt.concat(tt),utils$t.encode(rt,a)};var BN$i=bnExports$1,HmacDRBG$2=hmacDrbg,utils$s=utils$z,curves$7=curves$8,rand$2=requireBrorand(),assert$o=utils$s.assert,KeyPair$a=key$5,Signature$a=signature$5;function EC$2(_){if(!(this instanceof EC$2))return new EC$2(_);typeof _=="string"&&(assert$o(Object.prototype.hasOwnProperty.call(curves$7,_),"Unknown curve "+_),_=curves$7[_]),_ instanceof curves$7.PresetCurve&&(_={curve:_}),this.curve=_.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=_.curve.g,this.g.precompute(_.curve.n.bitLength()+1),this.hash=_.hash||_.curve.hash}var ec$5=EC$2;EC$2.prototype.keyPair=function _(a){return new KeyPair$a(this,a)};EC$2.prototype.keyFromPrivate=function _(a,$){return KeyPair$a.fromPrivate(this,a,$)};EC$2.prototype.keyFromPublic=function _(a,$){return KeyPair$a.fromPublic(this,a,$)};EC$2.prototype.genKeyPair=function _(a){a||(a={});for(var $=new HmacDRBG$2({hash:this.hash,pers:a.pers,persEnc:a.persEnc||"utf8",entropy:a.entropy||rand$2(this.hash.hmacStrength),entropyEnc:a.entropy&&a.entropyEnc||"utf8",nonce:this.n.toArray()}),j=this.n.byteLength(),et=this.n.sub(new BN$i(2));;){var tt=new BN$i($.generate(j));if(!(tt.cmp(et)>0))return tt.iaddn(1),this.keyFromPrivate(tt)}};EC$2.prototype._truncateToN=function _(a,$){var j=a.byteLength()*8-this.n.bitLength();return j>0&&(a=a.ushrn(j)),!$&&a.cmp(this.n)>=0?a.sub(this.n):a};EC$2.prototype.sign=function _(a,$,j,et){typeof j=="object"&&(et=j,j=null),et||(et={}),$=this.keyFromPrivate($,j),a=this._truncateToN(new BN$i(a,16));for(var tt=this.n.byteLength(),rt=$.getPrivate().toArray("be",tt),nt=a.toArray("be",tt),it=new HmacDRBG$2({hash:this.hash,entropy:rt,nonce:nt,pers:et.pers,persEnc:et.persEnc||"utf8"}),at=this.n.sub(new BN$i(1)),st=0;;st++){var ot=et.k?et.k(st):new BN$i(it.generate(this.n.byteLength()));if(ot=this._truncateToN(ot,!0),!(ot.cmpn(1)<=0||ot.cmp(at)>=0)){var ut=this.g.mul(ot);if(!ut.isInfinity()){var dt=ut.getX(),mt=dt.umod(this.n);if(mt.cmpn(0)!==0){var xt=ot.invm(this.n).mul(mt.mul($.getPrivate()).iadd(a));if(xt=xt.umod(this.n),xt.cmpn(0)!==0){var Ct=(ut.getY().isOdd()?1:0)|(dt.cmp(mt)!==0?2:0);return et.canonical&&xt.cmp(this.nh)>0&&(xt=this.n.sub(xt),Ct^=1),new Signature$a({r:mt,s:xt,recoveryParam:Ct})}}}}}};EC$2.prototype.verify=function _(a,$,j,et){a=this._truncateToN(new BN$i(a,16)),j=this.keyFromPublic(j,et),$=new Signature$a($,"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(a).umod(this.n),at=nt.mul(tt).umod(this.n),st;return this.curve._maxwellTrick?(st=this.g.jmulAdd(it,j.getPublic(),at),st.isInfinity()?!1:st.eqXToP(tt)):(st=this.g.mulAdd(it,j.getPublic(),at),st.isInfinity()?!1:st.getX().umod(this.n).cmp(tt)===0)};EC$2.prototype.recoverPubKey=function(_,a,$,j){assert$o((3&$)===$,"The recovery param is more than two bits"),a=new Signature$a(a,j);var et=this.n,tt=new BN$i(_),rt=a.r,nt=a.s,it=$&1,at=$>>1;if(rt.cmp(this.curve.p.umod(this.curve.n))>=0&&at)throw new Error("Unable to find sencond key candinate");at?rt=this.curve.pointFromX(rt.add(this.curve.n),it):rt=this.curve.pointFromX(rt,it);var st=a.r.invm(et),ot=et.sub(tt).mul(st).umod(et),ut=nt.mul(st).umod(et);return this.g.mulAdd(ot,rt,ut)};EC$2.prototype.getKeyRecoveryParam=function(_,a,$,j){if(a=new Signature$a(a,j),a.recoveryParam!==null)return a.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$r=utils$z,assert$n=utils$r.assert,parseBytes$9=utils$r.parseBytes,cachedProperty$5=utils$r.cachedProperty;function KeyPair$9(_,a){this.eddsa=_,this._secret=parseBytes$9(a.secret),_.isPoint(a.pub)?this._pub=a.pub:this._pubBytes=parseBytes$9(a.pub)}KeyPair$9.fromPublic=function _(a,$){return $ instanceof KeyPair$9?$:new KeyPair$9(a,{pub:$})};KeyPair$9.fromSecret=function _(a,$){return $ instanceof KeyPair$9?$:new KeyPair$9(a,{secret:$})};KeyPair$9.prototype.secret=function _(){return this._secret};cachedProperty$5(KeyPair$9,"pubBytes",function _(){return this.eddsa.encodePoint(this.pub())});cachedProperty$5(KeyPair$9,"pub",function _(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$5(KeyPair$9,"privBytes",function _(){var a=this.eddsa,$=this.hash(),j=a.encodingLength-1,et=$.slice(0,a.encodingLength);return et[0]&=248,et[j]&=127,et[j]|=64,et});cachedProperty$5(KeyPair$9,"priv",function _(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$5(KeyPair$9,"hash",function _(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$5(KeyPair$9,"messagePrefix",function _(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$9.prototype.sign=function _(a){return assert$n(this._secret,"KeyPair can only verify"),this.eddsa.sign(a,this)};KeyPair$9.prototype.verify=function _(a,$){return this.eddsa.verify(a,$,this)};KeyPair$9.prototype.getSecret=function _(a){return assert$n(this._secret,"KeyPair is public only"),utils$r.encode(this.secret(),a)};KeyPair$9.prototype.getPublic=function _(a){return utils$r.encode(this.pubBytes(),a)};var key$4=KeyPair$9,BN$h=bnExports$1,utils$q=utils$z,assert$m=utils$q.assert,cachedProperty$4=utils$q.cachedProperty,parseBytes$8=utils$q.parseBytes;function Signature$9(_,a){this.eddsa=_,typeof a!="object"&&(a=parseBytes$8(a)),Array.isArray(a)&&(a={R:a.slice(0,_.encodingLength),S:a.slice(_.encodingLength)}),assert$m(a.R&&a.S,"Signature without R or S"),_.isPoint(a.R)&&(this._R=a.R),a.S instanceof BN$h&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}cachedProperty$4(Signature$9,"S",function _(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty$4(Signature$9,"R",function _(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty$4(Signature$9,"Rencoded",function _(){return this.eddsa.encodePoint(this.R())});cachedProperty$4(Signature$9,"Sencoded",function _(){return this.eddsa.encodeInt(this.S())});Signature$9.prototype.toBytes=function _(){return this.Rencoded().concat(this.Sencoded())};Signature$9.prototype.toHex=function _(){return utils$q.encode(this.toBytes(),"hex").toUpperCase()};var signature$4=Signature$9,hash$5=hash$8,curves$6=curves$8,utils$p=utils$z,assert$l=utils$p.assert,parseBytes$7=utils$p.parseBytes,KeyPair$8=key$4,Signature$8=signature$4;function EDDSA$2(_){if(assert$l(_==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA$2))return new EDDSA$2(_);_=curves$6[_].curve,this.curve=_,this.g=_.g,this.g.precompute(_.n.bitLength()+1),this.pointClass=_.point().constructor,this.encodingLength=Math.ceil(_.n.bitLength()/8),this.hash=hash$5.sha512}var eddsa$2=EDDSA$2;EDDSA$2.prototype.sign=function _(a,$){a=parseBytes$7(a);var j=this.keyFromSecret($),et=this.hashInt(j.messagePrefix(),a),tt=this.g.mul(et),rt=this.encodePoint(tt),nt=this.hashInt(rt,j.pubBytes(),a).mul(j.priv()),it=et.add(nt).umod(this.curve.n);return this.makeSignature({R:tt,S:it,Rencoded:rt})};EDDSA$2.prototype.verify=function _(a,$,j){a=parseBytes$7(a),$=this.makeSignature($);var et=this.keyFromPublic(j),tt=this.hashInt($.Rencoded(),et.pubBytes(),a),rt=this.g.mul($.S()),nt=$.R().add(et.pub().mul(tt));return nt.eq(rt)};EDDSA$2.prototype.hashInt=function _(){for(var a=this.hash(),$=0;$bs58check$1.decode(_).slice(a.length);function b58decode(_){const a=bs58check$1.decode(_),j={[prefix.tz1.toString()]:"0000",[prefix.tz2.toString()]:"0001",[prefix.tz3.toString()]:"0002"}[new Uint8Array(a.slice(0,3)).toString()];if(j){const et=buf2hex(a.slice(3));return j+et}else return"01"+buf2hex(a.slice(3,42))+"00"}function encodeAddress(_){if(_.substring(0,2)==="0x"&&(_=_.slice(2)),_.substring(0,2)==="00"){const a={"0000":prefix.tz1,"0001":prefix.tz2,"0002":prefix.tz3};return b58cencode(_.substring(4),a[_.substring(0,4)])}return b58cencode(_.substring(2,42),prefix.KT)}function encodeKey(_){if(_[0]==="0"){const a={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return b58cencode(_.substring(2),a[_.substring(0,2)])}}function encodeKeyHash(_){if(_[0]==="0"){const a={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return b58cencode(_.substring(2),a[_.substring(0,2)])}}const hex2buf=_=>{if(_.length%2!==0)throw new InvalidHexStringError(_,": Expecting even number of characters");const a=stripHexPrefix$1(_);if(!a.match(/^([\da-f]{2})*$/gi))throw new InvalidHexStringError(_,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const $=new Uint8Array(a.length/2);let j=0;for(let et=0;et{const $=new Uint8Array(_.length+a.length);return $.set(_),$.set(a,_.length),$},buf2hex=_=>{const a=[];return _.forEach($=>{const et=`00${$.toString(16)}`.slice(-2);a.push(et)}),a.join("")};function hex2Bytes(_){const a=stripHexPrefix$1(_);if(!a.match(/^(0x)?([\da-f]{2})*$/gi))throw new InvalidHexStringError(_,": Expecting even number of characters: 0-9, a-z, A-Z, optionally prefixed with 0x");return buffer$1.Buffer.from(a,"hex")}function stripHexPrefix$1(_){return _.startsWith("0x")?_.slice(2):_}var util;(function(_){_.assertEqual=et=>et;function a(et){}_.assertIs=a;function $(et){throw new Error}_.assertNever=$,_.arrayToEnum=et=>{const tt={};for(const rt of et)tt[rt]=rt;return tt},_.getValidEnumValues=et=>{const tt=_.objectKeys(et).filter(nt=>typeof et[et[nt]]!="number"),rt={};for(const nt of tt)rt[nt]=et[nt];return _.objectValues(rt)},_.objectValues=et=>_.objectKeys(et).map(function(tt){return et[tt]}),_.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},_.find=(et,tt)=>{for(const rt of et)if(tt(rt))return rt},_.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)}_.joinValues=j,_.jsonStringifyReplacer=(et,tt)=>typeof tt=="bigint"?tt.toString():tt})(util||(util={}));var objectUtil;(function(_){_.mergeShapes=(a,$)=>({...a,...$})})(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=_=>{switch(typeof _){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(_)?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(_)?ZodParsedType.array:_===null?ZodParsedType.null:_.then&&typeof _.then=="function"&&_.catch&&typeof _.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&_ instanceof Map?ZodParsedType.map:typeof Set<"u"&&_ instanceof Set?ZodParsedType.set:typeof Date<"u"&&_ 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=_=>JSON.stringify(_,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(a){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=a}get errors(){return this.issues}format(a){const $=a||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(a(et))):j.push(a(et));return{formErrors:j,fieldErrors:$}}get formErrors(){return this.flatten()}}ZodError.create=_=>new ZodError(_);const errorMap=(_,a)=>{let $;switch(_.code){case ZodIssueCode.invalid_type:_.received===ZodParsedType.undefined?$="Required":$=`Expected ${_.expected}, received ${_.received}`;break;case ZodIssueCode.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(_.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:$=`Unrecognized key(s) in object: ${util.joinValues(_.keys,", ")}`;break;case ZodIssueCode.invalid_union:$="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${util.joinValues(_.options)}`;break;case ZodIssueCode.invalid_enum_value:$=`Invalid enum value. Expected ${util.joinValues(_.options)}, received '${_.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 _.validation=="object"?"includes"in _.validation?($=`Invalid input: must include "${_.validation.includes}"`,typeof _.validation.position=="number"&&($=`${$} at one or more positions greater than or equal to ${_.validation.position}`)):"startsWith"in _.validation?$=`Invalid input: must start with "${_.validation.startsWith}"`:"endsWith"in _.validation?$=`Invalid input: must end with "${_.validation.endsWith}"`:util.assertNever(_.validation):_.validation!=="regex"?$=`Invalid ${_.validation}`:$="Invalid";break;case ZodIssueCode.too_small:_.type==="array"?$=`Array must contain ${_.exact?"exactly":_.inclusive?"at least":"more than"} ${_.minimum} element(s)`:_.type==="string"?$=`String must contain ${_.exact?"exactly":_.inclusive?"at least":"over"} ${_.minimum} character(s)`:_.type==="number"?$=`Number must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${_.minimum}`:_.type==="date"?$=`Date must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(_.minimum))}`:$="Invalid input";break;case ZodIssueCode.too_big:_.type==="array"?$=`Array must contain ${_.exact?"exactly":_.inclusive?"at most":"less than"} ${_.maximum} element(s)`:_.type==="string"?$=`String must contain ${_.exact?"exactly":_.inclusive?"at most":"under"} ${_.maximum} character(s)`:_.type==="number"?$=`Number must be ${_.exact?"exactly":_.inclusive?"less than or equal to":"less than"} ${_.maximum}`:_.type==="bigint"?$=`BigInt must be ${_.exact?"exactly":_.inclusive?"less than or equal to":"less than"} ${_.maximum}`:_.type==="date"?$=`Date must be ${_.exact?"exactly":_.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(_.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 ${_.multipleOf}`;break;case ZodIssueCode.not_finite:$="Number must be finite";break;default:$=a.defaultError,util.assertNever(_)}return{message:$}};let overrideErrorMap=errorMap;function setErrorMap(_){overrideErrorMap=_}function getErrorMap(){return overrideErrorMap}const makeIssue=_=>{const{data:a,path:$,errorMaps:j,issueData:et}=_,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(at=>!!at).slice().reverse();for(const at of it)nt=at(rt,{data:a,defaultError:nt}).message;return{...et,path:tt,message:nt}},EMPTY_PATH=[];function addIssueToContext(_,a){const $=getErrorMap(),j=makeIssue({issueData:a,data:_.data,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,$,$===errorMap?void 0:errorMap].filter(et=>!!et)});_.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(a,$){const j=[];for(const et of $){if(et.status==="aborted")return INVALID;et.status==="dirty"&&a.dirty(),j.push(et.value)}return{status:a.value,value:j}}static async mergeObjectAsync(a,$){const j=[];for(const et of $){const tt=await et.key,rt=await et.value;j.push({key:tt,value:rt})}return ParseStatus.mergeObjectSync(a,j)}static mergeObjectSync(a,$){const j={};for(const et of $){const{key:tt,value:rt}=et;if(tt.status==="aborted"||rt.status==="aborted")return INVALID;tt.status==="dirty"&&a.dirty(),rt.status==="dirty"&&a.dirty(),tt.value!=="__proto__"&&(typeof rt.value<"u"||et.alwaysSet)&&(j[tt.value]=rt.value)}return{status:a.value,value:j}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=_=>({status:"dirty",value:_}),OK=_=>({status:"valid",value:_}),isAborted=_=>_.status==="aborted",isDirty=_=>_.status==="dirty",isValid$1=_=>_.status==="valid",isAsync=_=>typeof Promise<"u"&&_ instanceof Promise;function __classPrivateFieldGet$1(_,a,$,j){if(typeof a=="function"?_!==a||!j:!a.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a.get(_)}function __classPrivateFieldSet$1(_,a,$,j,et){if(typeof a=="function"?_!==a||!et:!a.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a.set(_,$),$}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(_){_.errToObj=a=>typeof a=="string"?{message:a}:a||{},_.toString=a=>typeof a=="string"?a:a==null?void 0:a.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(a,$,j,et){this._cachedPath=[],this.parent=a,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(a))return{success:!0,data:a.value};if(!_.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(_.common.issues);return this._error=$,this._error}}};function processCreateParams(_){if(!_)return{};const{errorMap:a,invalid_type_error:$,required_error:j,description:et}=_;if(a&&($||j))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return a?{errorMap:a,description:et}:{errorMap:(rt,nt)=>{var it,at;const{message:st}=_;return rt.code==="invalid_enum_value"?{message:st??nt.defaultError}:typeof nt.data>"u"?{message:(it=st??j)!==null&&it!==void 0?it:nt.defaultError}:rt.code!=="invalid_type"?{message:nt.defaultError}:{message:(at=st??$)!==null&&at!==void 0?at:nt.defaultError}},description:et}}class ZodType{constructor(a){this.spa=this.safeParseAsync,this._def=a,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(a){return getParsedType(a.data)}_getOrReturnCtx(a,$){return $||{common:a.parent.common,data:a.data,parsedType:getParsedType(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}_processInputParams(a){return{status:new ParseStatus,ctx:{common:a.parent.common,data:a.data,parsedType:getParsedType(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}}_parseSync(a){const $=this._parse(a);if(isAsync($))throw new Error("Synchronous parse encountered promise.");return $}_parseAsync(a){const $=this._parse(a);return Promise.resolve($)}parse(a,$){const j=this.safeParse(a,$);if(j.success)return j.data;throw j.error}safeParse(a,$){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:a,parsedType:getParsedType(a)},tt=this._parseSync({data:a,path:et.path,parent:et});return handleResult(et,tt)}async parseAsync(a,$){const j=await this.safeParseAsync(a,$);if(j.success)return j.data;throw j.error}async safeParseAsync(a,$){const j={common:{issues:[],contextualErrorMap:$==null?void 0:$.errorMap,async:!0},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:getParsedType(a)},et=this._parse({data:a,path:j.path,parent:j}),tt=await(isAsync(et)?et:Promise.resolve(et));return handleResult(j,tt)}refine(a,$){const j=et=>typeof $=="string"||typeof $>"u"?{message:$}:typeof $=="function"?$(et):$;return this._refinement((et,tt)=>{const rt=a(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(a,$){return this._refinement((j,et)=>a(j)?!0:(et.addIssue(typeof $=="function"?$(j,et):$),!1))}_refinement(a){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:a}})}superRefine(a){return this._refinement(a)}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(a){return ZodUnion.create([this,a],this._def)}and(a){return ZodIntersection.create(this,a,this._def)}transform(a){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:a}})}default(a){const $=typeof a=="function"?a:()=>a;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(a){const $=typeof a=="function"?a:()=>a;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:$,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(a){const $=this.constructor;return new $({...this._def,description:a})}pipe(a){return ZodPipeline.create(this,a)}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(_){let a="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return _.precision?a=`${a}\\.\\d{${_.precision}}`:_.precision==null&&(a=`${a}(\\.\\d+)?`),a}function timeRegex(_){return new RegExp(`^${timeRegexSource(_)}$`)}function datetimeRegex(_){let a=`${dateRegexSource}T${timeRegexSource(_)}`;const $=[];return $.push(_.local?"Z?":"Z"),_.offset&&$.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${$.join("|")})`,new RegExp(`^${a}$`)}function isValidIP(_,a){return!!((a==="v4"||!a)&&ipv4Regex.test(_)||(a==="v6"||!a)&&ipv6Regex.test(_))}class ZodString extends ZodType{_parse(a){if(this._def.coerce&&(a.data=String(a.data)),this._getType(a)!==ZodParsedType.string){const tt=this._getOrReturnCtx(a);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")a.data.lengthtt.value&&(et=this._getOrReturnCtx(a,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=a.data.length>tt.value,nt=a.data.lengtha.test(et),{validation:$,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(j)})}_addCheck(a){return new ZodString({...this._def,checks:[...this._def.checks,a]})}email(a){return this._addCheck({kind:"email",...errorUtil.errToObj(a)})}url(a){return this._addCheck({kind:"url",...errorUtil.errToObj(a)})}emoji(a){return this._addCheck({kind:"emoji",...errorUtil.errToObj(a)})}uuid(a){return this._addCheck({kind:"uuid",...errorUtil.errToObj(a)})}nanoid(a){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(a)})}cuid(a){return this._addCheck({kind:"cuid",...errorUtil.errToObj(a)})}cuid2(a){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(a)})}ulid(a){return this._addCheck({kind:"ulid",...errorUtil.errToObj(a)})}base64(a){return this._addCheck({kind:"base64",...errorUtil.errToObj(a)})}ip(a){return this._addCheck({kind:"ip",...errorUtil.errToObj(a)})}datetime(a){var $,j;return typeof a=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:a}):this._addCheck({kind:"datetime",precision:typeof(a==null?void 0:a.precision)>"u"?null:a==null?void 0:a.precision,offset:($=a==null?void 0:a.offset)!==null&&$!==void 0?$:!1,local:(j=a==null?void 0:a.local)!==null&&j!==void 0?j:!1,...errorUtil.errToObj(a==null?void 0:a.message)})}date(a){return this._addCheck({kind:"date",message:a})}time(a){return typeof a=="string"?this._addCheck({kind:"time",precision:null,message:a}):this._addCheck({kind:"time",precision:typeof(a==null?void 0:a.precision)>"u"?null:a==null?void 0:a.precision,...errorUtil.errToObj(a==null?void 0:a.message)})}duration(a){return this._addCheck({kind:"duration",...errorUtil.errToObj(a)})}regex(a,$){return this._addCheck({kind:"regex",regex:a,...errorUtil.errToObj($)})}includes(a,$){return this._addCheck({kind:"includes",value:a,position:$==null?void 0:$.position,...errorUtil.errToObj($==null?void 0:$.message)})}startsWith(a,$){return this._addCheck({kind:"startsWith",value:a,...errorUtil.errToObj($)})}endsWith(a,$){return this._addCheck({kind:"endsWith",value:a,...errorUtil.errToObj($)})}min(a,$){return this._addCheck({kind:"min",value:a,...errorUtil.errToObj($)})}max(a,$){return this._addCheck({kind:"max",value:a,...errorUtil.errToObj($)})}length(a,$){return this._addCheck({kind:"length",value:a,...errorUtil.errToObj($)})}nonempty(a){return this.min(1,errorUtil.errToObj(a))}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(a=>a.kind==="datetime")}get isDate(){return!!this._def.checks.find(a=>a.kind==="date")}get isTime(){return!!this._def.checks.find(a=>a.kind==="time")}get isDuration(){return!!this._def.checks.find(a=>a.kind==="duration")}get isEmail(){return!!this._def.checks.find(a=>a.kind==="email")}get isURL(){return!!this._def.checks.find(a=>a.kind==="url")}get isEmoji(){return!!this._def.checks.find(a=>a.kind==="emoji")}get isUUID(){return!!this._def.checks.find(a=>a.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(a=>a.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(a=>a.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(a=>a.kind==="cuid2")}get isULID(){return!!this._def.checks.find(a=>a.kind==="ulid")}get isIP(){return!!this._def.checks.find(a=>a.kind==="ip")}get isBase64(){return!!this._def.checks.find(a=>a.kind==="base64")}get minLength(){let a=null;for(const $ of this._def.checks)$.kind==="min"&&(a===null||$.value>a)&&(a=$.value);return a}get maxLength(){let a=null;for(const $ of this._def.checks)$.kind==="max"&&(a===null||$.value{var a;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(a=_==null?void 0:_.coerce)!==null&&a!==void 0?a:!1,...processCreateParams(_)})};function floatSafeRemainder(_,a){const $=(_.toString().split(".")[1]||"").length,j=(a.toString().split(".")[1]||"").length,et=$>j?$:j,tt=parseInt(_.toFixed(et).replace(".","")),rt=parseInt(a.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(a){if(this._def.coerce&&(a.data=Number(a.data)),this._getType(a)!==ZodParsedType.number){const tt=this._getOrReturnCtx(a);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(a.data)||(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:tt.message}),et.dirty()):tt.kind==="min"?(tt.inclusive?a.datatt.value:a.data>=tt.value)&&(j=this._getOrReturnCtx(a,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(a.data,tt.value)!==0&&(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:tt.value,message:tt.message}),et.dirty()):tt.kind==="finite"?Number.isFinite(a.data)||(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.not_finite,message:tt.message}),et.dirty()):util.assertNever(tt);return{status:et.value,value:a.data}}gte(a,$){return this.setLimit("min",a,!0,errorUtil.toString($))}gt(a,$){return this.setLimit("min",a,!1,errorUtil.toString($))}lte(a,$){return this.setLimit("max",a,!0,errorUtil.toString($))}lt(a,$){return this.setLimit("max",a,!1,errorUtil.toString($))}setLimit(a,$,j,et){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:a,value:$,inclusive:j,message:errorUtil.toString(et)}]})}_addCheck(a){return new ZodNumber({...this._def,checks:[...this._def.checks,a]})}int(a){return this._addCheck({kind:"int",message:errorUtil.toString(a)})}positive(a){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(a)})}negative(a){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(a)})}multipleOf(a,$){return this._addCheck({kind:"multipleOf",value:a,message:errorUtil.toString($)})}finite(a){return this._addCheck({kind:"finite",message:errorUtil.toString(a)})}safe(a){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(a)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(a)})}get minValue(){let a=null;for(const $ of this._def.checks)$.kind==="min"&&(a===null||$.value>a)&&(a=$.value);return a}get maxValue(){let a=null;for(const $ of this._def.checks)$.kind==="max"&&(a===null||$.valuea.kind==="int"||a.kind==="multipleOf"&&util.isInteger(a.value))}get isFinite(){let a=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"&&(a===null||j.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(_==null?void 0:_.coerce)||!1,...processCreateParams(_)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(a){if(this._def.coerce&&(a.data=BigInt(a.data)),this._getType(a)!==ZodParsedType.bigint){const tt=this._getOrReturnCtx(a);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?a.datatt.value:a.data>=tt.value)&&(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.too_big,type:"bigint",maximum:tt.value,inclusive:tt.inclusive,message:tt.message}),et.dirty()):tt.kind==="multipleOf"?a.data%tt.value!==BigInt(0)&&(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:tt.value,message:tt.message}),et.dirty()):util.assertNever(tt);return{status:et.value,value:a.data}}gte(a,$){return this.setLimit("min",a,!0,errorUtil.toString($))}gt(a,$){return this.setLimit("min",a,!1,errorUtil.toString($))}lte(a,$){return this.setLimit("max",a,!0,errorUtil.toString($))}lt(a,$){return this.setLimit("max",a,!1,errorUtil.toString($))}setLimit(a,$,j,et){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:a,value:$,inclusive:j,message:errorUtil.toString(et)}]})}_addCheck(a){return new ZodBigInt({...this._def,checks:[...this._def.checks,a]})}positive(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(a)})}negative(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(a)})}multipleOf(a,$){return this._addCheck({kind:"multipleOf",value:a,message:errorUtil.toString($)})}get minValue(){let a=null;for(const $ of this._def.checks)$.kind==="min"&&(a===null||$.value>a)&&(a=$.value);return a}get maxValue(){let a=null;for(const $ of this._def.checks)$.kind==="max"&&(a===null||$.value{var a;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(a=_==null?void 0:_.coerce)!==null&&a!==void 0?a:!1,...processCreateParams(_)})};class ZodBoolean extends ZodType{_parse(a){if(this._def.coerce&&(a.data=!!a.data),this._getType(a)!==ZodParsedType.boolean){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:j.parsedType}),INVALID}return OK(a.data)}}ZodBoolean.create=_=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(_==null?void 0:_.coerce)||!1,...processCreateParams(_)});class ZodDate extends ZodType{_parse(a){if(this._def.coerce&&(a.data=new Date(a.data)),this._getType(a)!==ZodParsedType.date){const tt=this._getOrReturnCtx(a);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:tt.parsedType}),INVALID}if(isNaN(a.data.getTime())){const tt=this._getOrReturnCtx(a);return addIssueToContext(tt,{code:ZodIssueCode.invalid_date}),INVALID}const j=new ParseStatus;let et;for(const tt of this._def.checks)tt.kind==="min"?a.data.getTime()tt.value&&(et=this._getOrReturnCtx(a,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(a.data.getTime())}}_addCheck(a){return new ZodDate({...this._def,checks:[...this._def.checks,a]})}min(a,$){return this._addCheck({kind:"min",value:a.getTime(),message:errorUtil.toString($)})}max(a,$){return this._addCheck({kind:"max",value:a.getTime(),message:errorUtil.toString($)})}get minDate(){let a=null;for(const $ of this._def.checks)$.kind==="min"&&(a===null||$.value>a)&&(a=$.value);return a!=null?new Date(a):null}get maxDate(){let a=null;for(const $ of this._def.checks)$.kind==="max"&&(a===null||$.valuenew ZodDate({checks:[],coerce:(_==null?void 0:_.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(_)});class ZodSymbol extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.symbol){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:j.parsedType}),INVALID}return OK(a.data)}}ZodSymbol.create=_=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(_)});class ZodUndefined extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:j.parsedType}),INVALID}return OK(a.data)}}ZodUndefined.create=_=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(_)});class ZodNull extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.null){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:j.parsedType}),INVALID}return OK(a.data)}}ZodNull.create=_=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(_)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(a){return OK(a.data)}}ZodAny.create=_=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(_)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(a){return OK(a.data)}}ZodUnknown.create=_=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(_)});class ZodNever extends ZodType{_parse(a){const $=this._getOrReturnCtx(a);return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:$.parsedType}),INVALID}}ZodNever.create=_=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(_)});class ZodVoid extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:j.parsedType}),INVALID}return OK(a.data)}}ZodVoid.create=_=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(_)});class ZodArray extends ZodType{_parse(a){const{ctx:$,status:j}=this._processInputParams(a),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(a,$){return new ZodArray({...this._def,minLength:{value:a,message:errorUtil.toString($)}})}max(a,$){return new ZodArray({...this._def,maxLength:{value:a,message:errorUtil.toString($)}})}length(a,$){return new ZodArray({...this._def,exactLength:{value:a,message:errorUtil.toString($)}})}nonempty(a){return this.min(1,a)}}ZodArray.create=(_,a)=>new ZodArray({type:_,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(a)});function deepPartialify(_){if(_ instanceof ZodObject){const a={};for(const $ in _.shape){const j=_.shape[$];a[$]=ZodOptional.create(deepPartialify(j))}return new ZodObject({..._._def,shape:()=>a})}else return _ instanceof ZodArray?new ZodArray({..._._def,type:deepPartialify(_.element)}):_ instanceof ZodOptional?ZodOptional.create(deepPartialify(_.unwrap())):_ instanceof ZodNullable?ZodNullable.create(deepPartialify(_.unwrap())):_ instanceof ZodTuple?ZodTuple.create(_.items.map(a=>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 a=this._def.shape(),$=util.objectKeys(a);return this._cached={shape:a,keys:$}}_parse(a){if(this._getType(a)!==ZodParsedType.object){const at=this._getOrReturnCtx(a);return addIssueToContext(at,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:at.parsedType}),INVALID}const{status:j,ctx:et}=this._processInputParams(a),{shape:tt,keys:rt}=this._getCached(),nt=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const at in et.data)rt.includes(at)||nt.push(at);const it=[];for(const at of rt){const st=tt[at],ot=et.data[at];it.push({key:{status:"valid",value:at},value:st._parse(new ParseInputLazyPath(et,ot,et.path,at)),alwaysSet:at in et.data})}if(this._def.catchall instanceof ZodNever){const at=this._def.unknownKeys;if(at==="passthrough")for(const st of nt)it.push({key:{status:"valid",value:st},value:{status:"valid",value:et.data[st]}});else if(at==="strict")nt.length>0&&(addIssueToContext(et,{code:ZodIssueCode.unrecognized_keys,keys:nt}),j.dirty());else if(at!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const at=this._def.catchall;for(const st of nt){const ot=et.data[st];it.push({key:{status:"valid",value:st},value:at._parse(new ParseInputLazyPath(et,ot,et.path,st)),alwaysSet:st in et.data})}}return et.common.async?Promise.resolve().then(async()=>{const at=[];for(const st of it){const ot=await st.key,ut=await st.value;at.push({key:ot,value:ut,alwaysSet:st.alwaysSet})}return at}).then(at=>ParseStatus.mergeObjectSync(j,at)):ParseStatus.mergeObjectSync(j,it)}get shape(){return this._def.shape()}strict(a){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...a!==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(a).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(a){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...a})})}merge(a){return new ZodObject({unknownKeys:a._def.unknownKeys,catchall:a._def.catchall,shape:()=>({...this._def.shape(),...a._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(a,$){return this.augment({[a]:$})}catchall(a){return new ZodObject({...this._def,catchall:a})}pick(a){const $={};return util.objectKeys(a).forEach(j=>{a[j]&&this.shape[j]&&($[j]=this.shape[j])}),new ZodObject({...this._def,shape:()=>$})}omit(a){const $={};return util.objectKeys(this.shape).forEach(j=>{a[j]||($[j]=this.shape[j])}),new ZodObject({...this._def,shape:()=>$})}deepPartial(){return deepPartialify(this)}partial(a){const $={};return util.objectKeys(this.shape).forEach(j=>{const et=this.shape[j];a&&!a[j]?$[j]=et:$[j]=et.optional()}),new ZodObject({...this._def,shape:()=>$})}required(a){const $={};return util.objectKeys(this.shape).forEach(j=>{if(a&&!a[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:()=>_,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});ZodObject.strictCreate=(_,a)=>new ZodObject({shape:()=>_,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});ZodObject.lazycreate=(_,a)=>new ZodObject({shape:_,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});class ZodUnion extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a),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 at={...$,common:{...$.common,issues:[]},parent:null},st=it._parseSync({data:$.data,path:$.path,parent:at});if(st.status==="valid")return st;st.status==="dirty"&&!tt&&(tt={result:st,ctx:at}),at.common.issues.length&&rt.push(at.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:_,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(a)});const getDiscriminator=_=>_ instanceof ZodLazy?getDiscriminator(_.schema):_ instanceof ZodEffects?getDiscriminator(_.innerType()):_ instanceof ZodLiteral?[_.value]:_ instanceof ZodEnum?_.options:_ instanceof ZodNativeEnum?util.objectValues(_.enum):_ instanceof ZodDefault?getDiscriminator(_._def.innerType):_ instanceof ZodUndefined?[void 0]:_ instanceof ZodNull?[null]:_ instanceof ZodOptional?[void 0,...getDiscriminator(_.unwrap())]:_ instanceof ZodNullable?[null,...getDiscriminator(_.unwrap())]:_ instanceof ZodBranded||_ instanceof ZodReadonly?getDiscriminator(_.unwrap()):_ instanceof ZodCatch?getDiscriminator(_._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a);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(a,$,j){const et=new Map;for(const tt of $){const rt=getDiscriminator(tt.shape[a]);if(!rt.length)throw new Error(`A discriminator value for key \`${a}\` could not be extracted from all schema options`);for(const nt of rt){if(et.has(nt))throw new Error(`Discriminator property ${String(a)} has duplicate value ${String(nt)}`);et.set(nt,tt)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:a,options:$,optionsMap:et,...processCreateParams(j)})}}function mergeValues(_,a){const $=getParsedType(_),j=getParsedType(a);if(_===a)return{valid:!0,data:_};if($===ZodParsedType.object&&j===ZodParsedType.object){const et=util.objectKeys(a),tt=util.objectKeys(_).filter(nt=>et.indexOf(nt)!==-1),rt={..._,...a};for(const nt of tt){const it=mergeValues(_[nt],a[nt]);if(!it.valid)return{valid:!1};rt[nt]=it.data}return{valid:!0,data:rt}}else if($===ZodParsedType.array&&j===ZodParsedType.array){if(_.length!==a.length)return{valid:!1};const et=[];for(let tt=0;tt<_.length;tt++){const rt=_[tt],nt=a[tt],it=mergeValues(rt,nt);if(!it.valid)return{valid:!1};et.push(it.data)}return{valid:!0,data:et}}else return $===ZodParsedType.date&&j===ZodParsedType.date&&+_==+a?{valid:!0,data:_}:{valid:!1}}class ZodIntersection extends ZodType{_parse(a){const{status:$,ctx:j}=this._processInputParams(a),et=(tt,rt)=>{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:_,right:a,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams($)});class ZodTuple extends ZodType{_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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(a){return new ZodTuple({...this._def,rest:a})}}ZodTuple.create=(_,a)=>{if(!Array.isArray(_))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:_,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(a)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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(a,$,j){return $ instanceof ZodType?new ZodRecord({keyType:a,valueType:$,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(j)}):new ZodRecord({keyType:ZodString.create(),valueType:a,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams($)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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],at)=>({key:et._parse(new ParseInputLazyPath(j,nt,j.path,[at,"key"])),value:tt._parse(new ParseInputLazyPath(j,it,j.path,[at,"value"]))}));if(j.common.async){const nt=new Map;return Promise.resolve().then(async()=>{for(const it of rt){const at=await it.key,st=await it.value;if(at.status==="aborted"||st.status==="aborted")return INVALID;(at.status==="dirty"||st.status==="dirty")&&$.dirty(),nt.set(at.value,st.value)}return{status:$.value,value:nt}})}else{const nt=new Map;for(const it of rt){const at=it.key,st=it.value;if(at.status==="aborted"||st.status==="aborted")return INVALID;(at.status==="dirty"||st.status==="dirty")&&$.dirty(),nt.set(at.value,st.value)}return{status:$.value,value:nt}}}}ZodMap.create=(_,a,$)=>new ZodMap({valueType:a,keyType:_,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams($)});class ZodSet extends ZodType{_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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 at=new Set;for(const st of it){if(st.status==="aborted")return INVALID;st.status==="dirty"&&$.dirty(),at.add(st.value)}return{status:$.value,value:at}}const nt=[...j.data.values()].map((it,at)=>tt._parse(new ParseInputLazyPath(j,it,j.path,at)));return j.common.async?Promise.all(nt).then(it=>rt(it)):rt(nt)}min(a,$){return new ZodSet({...this._def,minSize:{value:a,message:errorUtil.toString($)}})}max(a,$){return new ZodSet({...this._def,maxSize:{value:a,message:errorUtil.toString($)}})}size(a,$){return this.min(a,$).max(a,$)}nonempty(a){return this.min(1,a)}}ZodSet.create=(_,a)=>new ZodSet({valueType:_,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(a)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(a){const{ctx:$}=this._processInputParams(a);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(at=>!!at),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:it}})}function et(nt,it){return makeIssue({data:nt,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,getErrorMap(),errorMap].filter(at=>!!at),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 at=new ZodError([]),st=await nt._def.args.parseAsync(it,tt).catch(dt=>{throw at.addIssue(j(it,dt)),at}),ot=await Reflect.apply(rt,this,st);return await nt._def.returns._def.type.parseAsync(ot,tt).catch(dt=>{throw at.addIssue(et(ot,dt)),at})})}else{const nt=this;return OK(function(...it){const at=nt._def.args.safeParse(it,tt);if(!at.success)throw new ZodError([j(it,at.error)]);const st=Reflect.apply(rt,this,at.data),ot=nt._def.returns.safeParse(st,tt);if(!ot.success)throw new ZodError([et(st,ot.error)]);return ot.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...a){return new ZodFunction({...this._def,args:ZodTuple.create(a).rest(ZodUnknown.create())})}returns(a){return new ZodFunction({...this._def,returns:a})}implement(a){return this.parse(a)}strictImplement(a){return this.parse(a)}static create(a,$,j){return new ZodFunction({args:a||ZodTuple.create([]).rest(ZodUnknown.create()),returns:$||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(j)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(a){const{ctx:$}=this._processInputParams(a);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}}ZodLazy.create=(_,a)=>new ZodLazy({getter:_,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(a)});class ZodLiteral extends ZodType{_parse(a){if(a.data!==this._def.value){const $=this._getOrReturnCtx(a);return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:a.data}}get value(){return this._def.value}}ZodLiteral.create=(_,a)=>new ZodLiteral({value:_,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(a)});function createZodEnum(_,a){return new ZodEnum({values:_,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(a)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(a){if(typeof a.data!="string"){const $=this._getOrReturnCtx(a),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(a.data)){const $=this._getOrReturnCtx(a),j=this._def.values;return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_enum_value,options:j}),INVALID}return OK(a.data)}get options(){return this._def.values}get enum(){const a={};for(const $ of this._def.values)a[$]=$;return a}get Values(){const a={};for(const $ of this._def.values)a[$]=$;return a}get Enum(){const a={};for(const $ of this._def.values)a[$]=$;return a}extract(a,$=this._def){return ZodEnum.create(a,{...this._def,...$})}exclude(a,$=this._def){return ZodEnum.create(this.options.filter(j=>!a.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(a){const $=util.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(a);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(a.data)){const et=util.objectValues($);return addIssueToContext(j,{received:j.data,code:ZodIssueCode.invalid_enum_value,options:et}),INVALID}return OK(a.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(_,a)=>new ZodNativeEnum({values:_,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(a)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(a){const{ctx:$}=this._processInputParams(a);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:_,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(a)});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(a){const{status:$,ctx:j}=this._processInputParams(a),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:_,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:a,...processCreateParams($)});ZodEffects.createWithPreprocess=(_,a,$)=>new ZodEffects({schema:a,effect:{type:"preprocess",transform:_},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams($)});class ZodOptional extends ZodType{_parse(a){return this._getType(a)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}ZodOptional.create=(_,a)=>new ZodOptional({innerType:_,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(a)});class ZodNullable extends ZodType{_parse(a){return this._getType(a)===ZodParsedType.null?OK(null):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}ZodNullable.create=(_,a)=>new ZodNullable({innerType:_,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(a)});class ZodDefault extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a);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:_,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof a.default=="function"?a.default:()=>a.default,...processCreateParams(a)});class ZodCatch extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a),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:_,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof a.catch=="function"?a.catch:()=>a.catch,...processCreateParams(a)});class ZodNaN extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.nan){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:j.parsedType}),INVALID}return{status:"valid",value:a.data}}}ZodNaN.create=_=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(_)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a),j=$.data;return this._def.type._parse({data:j,path:$.path,parent:$})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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(a,$){return new ZodPipeline({in:a,out:$,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(a){const $=this._def.innerType._parse(a),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:_,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(a)});function custom(_,a={},$){return _?ZodAny.create().superRefine((j,et)=>{var tt,rt;if(!_(j)){const nt=typeof a=="function"?a(j):typeof a=="string"?{message:a}:a,it=(rt=(tt=nt.fatal)!==null&&tt!==void 0?tt:$)!==null&&rt!==void 0?rt:!0,at=typeof nt=="string"?{message:nt}:nt;et.addIssue({code:"custom",...at,fatal:it})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(_){_.ZodString="ZodString",_.ZodNumber="ZodNumber",_.ZodNaN="ZodNaN",_.ZodBigInt="ZodBigInt",_.ZodBoolean="ZodBoolean",_.ZodDate="ZodDate",_.ZodSymbol="ZodSymbol",_.ZodUndefined="ZodUndefined",_.ZodNull="ZodNull",_.ZodAny="ZodAny",_.ZodUnknown="ZodUnknown",_.ZodNever="ZodNever",_.ZodVoid="ZodVoid",_.ZodArray="ZodArray",_.ZodObject="ZodObject",_.ZodUnion="ZodUnion",_.ZodDiscriminatedUnion="ZodDiscriminatedUnion",_.ZodIntersection="ZodIntersection",_.ZodTuple="ZodTuple",_.ZodRecord="ZodRecord",_.ZodMap="ZodMap",_.ZodSet="ZodSet",_.ZodFunction="ZodFunction",_.ZodLazy="ZodLazy",_.ZodLiteral="ZodLiteral",_.ZodEnum="ZodEnum",_.ZodEffects="ZodEffects",_.ZodNativeEnum="ZodNativeEnum",_.ZodOptional="ZodOptional",_.ZodNullable="ZodNullable",_.ZodDefault="ZodDefault",_.ZodCatch="ZodCatch",_.ZodPromise="ZodPromise",_.ZodBranded="ZodBranded",_.ZodPipeline="ZodPipeline",_.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(_,a={message:`Input not instance of ${_.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:_=>ZodString.create({..._,coerce:!0}),number:_=>ZodNumber.create({..._,coerce:!0}),boolean:_=>ZodBoolean.create({..._,coerce:!0}),bigint:_=>ZodBigInt.create({..._,coerce:!0}),date:_=>ZodDate.create({..._,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=_=>{if(isValidContractPkh(_))return parseContractPkh(_);if(isValidImplicitPkh(_))return parseImplicitPkh(_);throw new Error(`Cannot parse address type: ${_}`)},isAddressValid=_=>validateAddress(_)===ValidationResult.VALID,isValidContractPkh=_=>isAddressValid(_)&&_.match(/^KT1\w+/),isValidImplicitPkh=_=>isAddressValid(_)&&_.match(/^tz[1234]\w+/),parseContractPkh=_=>{if(isValidContractPkh(_))return{type:"contract",pkh:_};throw new Error(`Invalid contract address: ${_}`)},parseImplicitPkh=_=>{if(isValidImplicitPkh(_))return{type:"implicit",pkh:_};throw new Error(`Invalid implicit address: ${_}`)},encodeReserved=[encodeURIComponent,encodeURIComponent];function encode$3(_,a=","){const $=(j,et)=>{const tt=_[et%_.length];return typeof j>"u"?"":typeof j=="object"?Array.isArray(j)?j.map(tt).join(a):Object.entries(j).reduce((nt,it)=>[...nt,...it],[]).map(tt).join(a):tt(String(j))};return(j,...et)=>j.reduce((tt,rt,nt)=>`${tt}${rt}${$(et[nt],nt)}`,"")}function delimited(_=","){return(a,$=encodeReserved)=>Object.entries(a).filter(([,j])=>j!==void 0).map(([j,et])=>encode$3($,_)`${j}=${et}`).join("&")}function stripUndefined(_){return _&&JSON.parse(JSON.stringify(_))}function joinUrl(..._){return _.filter(Boolean).map((a,$)=>$===0?a:a.replace(/^\/+/,"")).map((a,$,j)=>$===j.length-1?a:a.replace(/\/+$/,"")).join("/")}function query(..._){const a=_.filter(Boolean).join("&");return a&&`?${a}`}function explode(_,a=encodeReserved){const $=encode$3(a);return Object.entries(_).filter(([,j])=>j!==void 0).map(([j,et])=>Array.isArray(et)?et.map(tt=>$`${j}=${tt}`).join("&"):typeof et=="object"?explode(et,a):$`${j}=${et}`).join("&")}const form=delimited(),SUCCESS_CODES=[200,201,202,204];async function ok(_){const a=await _;if(SUCCESS_CODES.some($=>$==a.status))return a.data;throw new HttpError(a.status,a.data)}class HttpError extends Error{constructor($,j){super(`Error: ${$}`);Yr(this,"status");Yr(this,"data");this.status=$,this.data=j}}function runtime$1(_){async function a(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:at,data:st}=await a(tt,{...rt,headers:{Accept:"application/json",...rt.headers}});return(at?at.includes("json"):!1)?{status:nt,headers:it,data:st?JSON.parse(st):null}:{status:nt,headers:it,data:st}}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:at,...st}={..._,...rt},ot=joinUrl(nt,tt);return await(at||fetch)(ot,{...st,headers:stripUndefined({..._.headers,...it})})}return{ok,fetchText:a,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(_.formDataConstructor||rt.formDataConstructor||FormData);return Object.entries(tt).forEach(([it,at])=>{nt.append(it,at)}),{...rt,body:nt}}}}const jsonParameter=(_,a)=>{if(!a)return{};const $={};return Object.entries(a).forEach(([j,et])=>{if(!(et instanceof Object))throw new Error(`Expected ${_} value to be object, received ${typeof et}`);const{jsonPath:tt,jsonValue:rt}=et;if(rt==null)throw new Error(`Expected jsonValue in ${_} -> ${j}, found: ${rt}`);const it=[_,tt,j].filter(at=>at!==void 0).join(".");$[it]=rt}),$},anyofParameter=(_,a)=>{if(!a)return{};const{fields:$}=a;(rt=>{if(!Array.isArray(rt))throw new Error(`Expected ${_} fields to be Array. Received ${typeof rt}.`);return rt.forEach(nt=>{if(typeof nt!="string")throw new Error(`Expected ${_} fields to be strings. Received ${typeof nt}`)}),!0})($);const et={},tt=$.join(".");if(a.value){const rt=`${_}.${tt}`;et[rt]=a.value}for(const rt of["in","eq","null"])if(a[rt]){const nt=`${_}.${tt}.${rt}`;return et[nt]=Array.isArray(a[rt])?a[rt].join(","):a[rt],et}return et},queryParameter=(_,a)=>{if(!a)return{};const $={};return Object.entries(a).forEach(([j,et])=>{const tt=`${_}.${j}`;$[tt]=et}),$},parsers={jsonParameter,queryParameter,anyofParameter},defaults={baseUrl:"https://api.tzkt.io"},oazapfts=runtime$1(defaults);function blocksGet({baker:_,anyof:a,proposer:$,producer:j,level:et,timestamp:tt,priority:rt,blockRound:nt,select:it,sort:at,offset:st,limit:ot,quote:ut}={},dt){return oazapfts.ok(oazapfts.fetchJson(`/v1/blocks${query(explode({limit:ot,quote:ut,...parsers.queryParameter("baker",_),...parsers.anyofParameter("anyof",a),...parsers.queryParameter("proposer",$),...parsers.queryParameter("producer",j),...parsers.queryParameter("level",et),...parsers.queryParameter("timestamp",tt),...parsers.queryParameter("priority",rt),...parsers.queryParameter("blockRound",nt),...parsers.queryParameter("select",it),...parsers.queryParameter("sort",at),...parsers.queryParameter("offset",st)}))}`,{...dt}))}function contractsGet({address:_,kind:a,tzips:$,creator:j,manager:et,delegate:tt,balance:rt,lastActivity:nt,typeHash:it,codeHash:at,select:st,sort:ot,offset:ut,limit:dt,includeStorage:mt}={},xt){return oazapfts.ok(oazapfts.fetchJson(`/v1/contracts${query(explode({limit:dt,includeStorage:mt,...parsers.queryParameter("address",_),...parsers.queryParameter("kind",a),...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",at),...parsers.queryParameter("select",st),...parsers.queryParameter("sort",ot),...parsers.queryParameter("offset",ut)}))}`,{...xt}))}function delegatesGet({active:_,lastActivity:a,select:$,sort:j,offset:et,limit:tt}={},rt){return oazapfts.ok(oazapfts.fetchJson(`/v1/delegates${query(explode({limit:tt,...parsers.queryParameter("active",_),...parsers.queryParameter("lastActivity",a),...parsers.queryParameter("select",$),...parsers.queryParameter("sort",j),...parsers.queryParameter("offset",et)}))}`,{...rt}))}function operationsGetDelegations({anyof:_,initiator:a,sender:$,prevDelegate:j,newDelegate:et,level:tt,timestamp:rt,senderCodeHash:nt,status:it,select:at,sort:st,offset:ot,limit:ut,quote:dt}={},mt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/delegations${query(explode({limit:ut,quote:dt,...parsers.anyofParameter("anyof",_),...parsers.queryParameter("initiator",a),...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",at),...parsers.queryParameter("sort",st),...parsers.queryParameter("offset",ot)}))}`,{...mt}))}function operationsGetOriginations({anyof:_,initiator:a,sender:$,contractManager:j,contractDelegate:et,originatedContract:tt,id:rt,typeHash:nt,codeHash:it,level:at,timestamp:st,senderCodeHash:ot,anyCodeHash:ut,status:dt,select:mt,sort:xt,offset:Ct,limit:Pt,micheline:Tt,quote:Mt}={},Lt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/originations${query(explode({limit:Pt,micheline:Tt,quote:Mt,...parsers.anyofParameter("anyof",_),...parsers.queryParameter("initiator",a),...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",at),...parsers.queryParameter("timestamp",st),...parsers.queryParameter("senderCodeHash",ot),...parsers.queryParameter("anyCodeHash",ut),...parsers.queryParameter("status",dt),...parsers.queryParameter("select",mt),...parsers.queryParameter("sort",xt),...parsers.queryParameter("offset",Ct)}))}`,{...Lt}))}function operationsGetTransactions({anyof:_,initiator:a,sender:$,target:j,amount:et,id:tt,level:rt,timestamp:nt,senderCodeHash:it,targetCodeHash:at,codeHash:st,entrypoint:ot,parameter:ut,hasInternals:dt,status:mt,select:xt,sort:Ct,offset:Pt,limit:Tt,micheline:Mt,quote:Lt}={},Nt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/transactions${query(explode({limit:Tt,micheline:Mt,quote:Lt,...parsers.anyofParameter("anyof",_),...parsers.queryParameter("initiator",a),...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",at),...parsers.queryParameter("codeHash",st),...parsers.queryParameter("entrypoint",ot),...parsers.jsonParameter("parameter",ut),...parsers.queryParameter("hasInternals",dt),...parsers.queryParameter("status",mt),...parsers.queryParameter("select",xt),...parsers.queryParameter("sort",Ct),...parsers.queryParameter("offset",Pt)}))}`,{...Nt}))}function quotesGetLast(_){return oazapfts.ok(oazapfts.fetchJson("/v1/quotes/last",{..._}))}function tokensGetTokenBalances({id:_,account:a,tokenId:$,tokenContract:j,tokenTokenId:et,tokenStandard:tt,tokenMetadata:rt,tokenHasFilters:nt,balance:it,firstLevel:at,firstTime:st,lastLevel:ot,lastTime:ut,indexedAt:dt,sort:mt,offset:xt,limit:Ct,select:Pt}={},Tt){return oazapfts.ok(oazapfts.fetchJson(`/v1/tokens/balances${query(explode({"token.HasFilters":nt,limit:Ct,...parsers.queryParameter("id",_),...parsers.queryParameter("account",a),...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",at),...parsers.queryParameter("firstTime",st),...parsers.queryParameter("lastLevel",ot),...parsers.queryParameter("lastTime",ut),...parsers.queryParameter("indexedAt",dt),...parsers.queryParameter("sort",mt),...parsers.queryParameter("offset",xt),...parsers.queryParameter("select",Pt)}))}`,{...Tt}))}function tokensGetTokenTransfers({id:_,level:a,timestamp:$,tokenId:j,tokenContract:et,tokenTokenId:tt,tokenStandard:rt,tokenMetadata:nt,tokenHasFilters:it,anyof:at,$from:st,to:ot,amount:ut,transactionId:dt,originationId:mt,migrationId:xt,indexedAt:Ct,sort:Pt,offset:Tt,limit:Mt,select:Lt}={},Nt){return oazapfts.ok(oazapfts.fetchJson(`/v1/tokens/transfers${query(explode({"token.HasFilters":it,limit:Mt,...parsers.queryParameter("id",_),...parsers.queryParameter("level",a),...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",at),...parsers.queryParameter("from",st),...parsers.queryParameter("to",ot),...parsers.queryParameter("amount",ut),...parsers.queryParameter("transactionId",dt),...parsers.queryParameter("originationId",mt),...parsers.queryParameter("migrationId",xt),...parsers.queryParameter("indexedAt",Ct),...parsers.queryParameter("sort",Pt),...parsers.queryParameter("offset",Tt),...parsers.queryParameter("select",Lt)}))}`,{...Nt}))}let e$1=class{constructor(a){this.queue=void 0,this.maxConcurrent=void 0,this.count=void 0,this.queue=[],this.maxConcurrent=a,this.count=0}get canAcquire(){return this.countthis.queue.push(a))}release(){const a=this.queue.shift();a?setTimeout(a,0):this.count--}};const t$4="_default";class s{constructor(a=1){this.semaphoreInstances=void 0,this.maxConcurrent=void 0,this.semaphoreInstances={},this.maxConcurrent=a}hasSemaphoreInstance(a=t$4){return!!this.semaphoreInstances[a]}getSemaphoreInstance(a=t$4){return this.hasSemaphoreInstance(a)||(this.semaphoreInstances[a]=new e$1(this.maxConcurrent)),this.semaphoreInstances[a]}tidy(a=t$4){this.hasSemaphoreInstance(a)&&this.getSemaphoreInstance(a).count===0&&delete this.semaphoreInstances[a]}canAcquire(a=t$4){return this.getSemaphoreInstance(a).canAcquire}acquire(a=t$4){return this.getSemaphoreInstance(a).acquire()}release(a=t$4){this.getSemaphoreInstance(a).release(),this.tidy(a)}count(a=t$4){return this.hasSemaphoreInstance(a)?this.getSemaphoreInstance(a).count:0}hasTasks(a=t$4){return this.count(a)>0}async request(a,$=t$4){try{return await this.acquire($),await a()}finally{this.release($)}}async requestIfAvailable(a,$=t$4){return this.canAcquire($)?this.request(a,$):null}}function assign(_,a){for(const $ in a)Object.defineProperty(_,$,{value:a[$],enumerable:!0,configurable:!0});return _}function createError(_,a,$){if(!_||typeof _=="string")throw new TypeError("Please pass an Error to err-code");$||($={}),typeof a=="object"&&($=a,a=void 0),a!=null&&($.code=a);try{return assign(_,$)}catch{$.message=_.message,$.stack=_.stack;const et=function(){};return et.prototype=Object.create(Object.getPrototypeOf(_)),assign(new et,$)}}var errCode=createError,retry$3={};function RetryOperation(_,a){typeof a=="boolean"&&(a={forever:a}),this._originalTimeouts=JSON.parse(JSON.stringify(_)),this._timeouts=_,this._options=a||{},this._maxRetryTime=a&&a.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(_){if(this._timeout&&clearTimeout(this._timeout),!_)return!1;var a=new Date().getTime();if(_&&a-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(_);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&&(a.timeout&&(this._operationTimeout=a.timeout),a.cb&&(this._operationTimeoutCb=a.cb));var $=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){$._operationTimeoutCb()},$._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(_){console.log("Using RetryOperation.try() is deprecated"),this.attempt(_)};RetryOperation.prototype.start=function(_){console.log("Using RetryOperation.start() is deprecated"),this.attempt(_)};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=$&&(a=et,$=rt)}return a};(function(_){var a=retry_operation;_.operation=function($){var j=_.timeouts($);return new a(j,{forever:$&&$.forever,unref:$&&$.unref,maxRetryTime:$&&$.maxRetryTime})},_.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(a),{retries:3,minTimeout:100})).catch(a=>{throw"status"in a&&"data"in a?new Error(`Fetching data from tzkt failed with: ${a.status}, ${a.data}`):a}).finally(()=>tzktRateLimiter.release()),MULTISIG_FETCH_LIMIT=1e4,TYPE_HASH=1963879877,CODE_HASH=-1890025422,getAllMultiSigContracts=async _=>withRateLimit(async()=>{try{const a=`${_.tzktApiUrl}/v1/contracts?typeHash=${TYPE_HASH}&codeHash=${CODE_HASH}&includeStorage=true&limit=${MULTISIG_FETCH_LIMIT}`,{data:$}=await axios.get(a);return $}catch(a){throw new Error(`Error fetching same contracts from tzkt: ${a.message}`)}}),getExistingContracts=(_,a)=>withRateLimit(()=>contractsGet({address:{in:[_.join(",")]},select:{fields:["address"]},limit:Math.min(1e4,_.length)},{baseUrl:a.tzktApiUrl})),getPendingOperations=async(_,a)=>withRateLimit(async()=>{if(_.length===0)return Promise.resolve([]);const $=`${a.tzktApiUrl}/v1/bigmaps/keys?active=true&bigmap.in=${_.join(",")}&limit=${MULTISIG_FETCH_LIMIT}`,{data:j}=await axios.get($);return j}),parseMultisig=_=>({address:parseContractPkh(_.address),threshold:Number(_.storage.threshold),signers:_.storage.signers.map(parseImplicitPkh),pendingOperationsBigmapId:_.storage.pending_ops}),getRelevantMultisigContracts=async(_,a)=>(await getAllMultiSigContracts(a)).filter(({storage:{signers:j}})=>lodashExports.every(j,isValidImplicitPkh)?j.filter(tt=>_.has(tt)).length>0:!1).map(parseMultisig),getNetworksForContracts=async(_,a)=>{const $=new Map;return a.length===0||(await Promise.all(_.map(async et=>(await getExistingContracts(a,et)).map(tt=>[tt,et.name])))).flat().forEach(([et,tt])=>$.set(et,tt)),$},parseMultisigOperation=_=>{const{bigmap:a,key:$,value:j}=_;if($===null||j===null)throw new Error("parseMultisigOperation failed");return{id:$,bigmapId:a,rawActions:j.actions,approvals:j.approvals.map(parseImplicitPkh)}},getPendingOperationsForMultisigs=async(_,a)=>{if(_.length===0)return[];const $=_.map(et=>et.pendingOperationsBigmapId),j=await getPendingOperations($,a);return lodashExports.compact(j.map(parseMultisigOperation))},VERSION$1=7,mainStoreMigrations={0:_=>produce(_,a=>{a.multisigs.labelsMap={}}),1:_=>produce(_,a=>{a.announcement=initialState$a}),2:lodashExports.identity,3:_=>produce(_,a=>{a.networks.current.name==="ghostnet"&&(a.networks.current.buyTezUrl="https://faucet.ghostnet.teztnets.com/");for(const $ of a.networks.available)if($.name==="ghostnet"){$.buyTezUrl="https://faucet.ghostnet.teztnets.com/";break}}),4:lodashExports.identity,5:_=>produce(_,a=>{delete a.assets.transfers.tez}),6:async _=>{const a=Object.values(_.contacts).filter(tt=>isValidImplicitPkh(tt.pkh)).map(tt=>[tt.pkh,{...tt,network:void 0}]),$=Object.values(_.contacts).filter(tt=>isValidContractPkh(tt.pkh)).map(tt=>tt.pkh),et=[...(await getNetworksForContracts(_.networks.available,$)).entries()].map(([tt,rt])=>[tt,{..._.contacts[tt],network:rt}]);return produce(_,tt=>{tt.contacts=lodashExports.fromPairs([...a,...et])})},7:_=>produce(_,a=>{a.assets.accountStates={},a.assets.block={level:a.assets.blockLevel},delete a.assets.blockLevel,delete a.assets.balances,delete a.assets.delegationLevels})},accountsMigrations={0:lodashExports.identity,1:lodashExports.identity,2:_=>produce(_,a=>{a.items.forEach($=>{$.type==="secret_key"&&($.curve="ed25519")})}),3:lodashExports.identity,4:_=>produce(_,a=>{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,7: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,_,"utf-8"),a,NUM_ITERATIONS_V1),derivePasswordBasedKeyV2=async(_,a)=>derivePasswordBasedKey(Buffer$g.from(_,"utf-8"),a,NUM_ITERATIONS_V2),derivePasswordBasedKey=async(_,a,$)=>{const j={name:"PBKDF2",salt:a,iterations:$,hash:"SHA-256"},et=await crypto.subtle.importKey("raw",_,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(a,$),et=crypto.getRandomValues(new Uint8Array(IV_SIZE)),tt=await crypto.subtle.encrypt({name:AES_MODE,iv:et},j,Buffer$g.from(_,"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}=_;try{const rt=$==="V2"?await derivePasswordBasedKeyV2(a,hex2Bytes(et)):await derivePasswordBasedKeyV1(a,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:_,newPassword:a},{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,_),at=await encrypt$1(it,a);return[rt,at]}catch(it){throw new Error(it.message)}}));return{newEncryptedMnemonics:lodashExports.fromPairs(tt)}}),initialState$9={items:[],seedPhrases:{},secretKeys:{}},accountsSlice=createSlice({name:"accounts",initialState:initialState$9,extraReducers:_=>{_.addCase(changeMnemonicPassword.fulfilled,(a,$)=>{const{newEncryptedMnemonics:j}=$.payload;a.seedPhrases=j})},reducers:{reset:()=>initialState$9,removeMnemonicAndAccounts:(_,{payload:a})=>{const{fingerPrint:$}=a,j=_.items.filter(et=>!(et.type==="mnemonic"&&et.seedFingerPrint===$));_.items=j,delete _.seedPhrases[$]},removeNonMnemonicAccounts:(_,{payload:a})=>{_.items=lodashExports.remove(_.items,$=>$.type==="mnemonic"||$.type!==a.accountType),a.accountType==="secret_key"&&(_.secretKeys={})},removeAccount:(_,{payload:a})=>{lodashExports.remove(_.items,$=>$.address.pkh===a.address.pkh),a.type==="secret_key"&&delete _.secretKeys[a.address.pkh]},renameAccount:(_,{payload:a})=>{const{account:$,newName:j}=a;if(j.length===0)throw new Error("Cannot rename account to an empty name.");if(_.items.find(tt=>tt.label===j))throw new Error(`Cannot rename account ${$.address.pkh} to ${j} since the name already exists.`);const et=_.items.find(tt=>tt.address.pkh===$.address.pkh&&tt.label===$.label);et&&(et.label=j)},addAccount:(_,{payload:a})=>{_.items=concatUnique(_.items,[a])},addMnemonicAccounts:(_,{payload:{encryptedMnemonic:a,accounts:$,seedFingerprint:j}})=>{_.items=concatUnique(_.items,$),_.seedPhrases[j]=a},addSecretKey:(_,{payload:{pkh:a,encryptedSecretKey:$}})=>{_.secretKeys[a]=$}}}),concatUnique=(_,a)=>(a.forEach($=>{if(_.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=_=>{const a=_.metadata;if(_.standard==="fa1.2"){const et=FA12TokenSchema.safeParse(_);return et.success?{type:"fa1.2",metadata:a,contract:et.data.contract.address,tokenId:"0"}:(console.warn("Invalid FA1 token: "+JSON.stringify(_)),null)}const $=NFTSchema.safeParse(_);if($.success)return{metadata:a,type:"nft",id:$.data.id,contract:$.data.contract.address,tokenId:$.data.tokenId,displayUri:$.data.metadata.displayUri,totalSupply:$.data.totalSupply};const j=FA2TokenSchema.safeParse(_);return j.success?{type:"fa2",metadata:a,contract:j.data.contract.address,tokenId:j.data.tokenId}:(console.warn("Invalid FA2 token: "+JSON.stringify(_)),null)},fullId=_=>`${_.contract}:${_.tokenId}`,defaultTokenName=_=>{switch(_.type){case"fa1.2":return DEFAULT_FA1_NAME;case"fa2":return DEFAULT_FA2_NAME;case"nft":return DEFAULT_NFT_NAME}},tokenNameSafe=_=>tokenName(_)||defaultTokenName(_),tokenName=_=>{var a;return(a=_.metadata)==null?void 0:a.name},defaultTokenSymbol=_=>{switch(_.type){case"fa1.2":return DEFAULT_FA1_SYMBOL;case"fa2":return DEFAULT_FA2_SYMBOL;case"nft":return DEFAULT_NFT_SYMBOL}},tokenSymbolSafe=_=>tokenSymbol(_)||defaultTokenSymbol(_),tokenSymbol=_=>{var a;return(a=_.metadata)==null?void 0:a.symbol},tokenDecimals=_=>{var a;return((a=_.metadata)==null?void 0:a.decimals)??DEFAULT_TOKEN_DECIMALS},getRealAmount=(_,a)=>{const $=new BigNumber(a),j=tokenDecimals(_);return $.multipliedBy(new BigNumber(10).exponentiatedBy(j)).toFixed()},formatTokenAmount=(_,a=DEFAULT_TOKEN_DECIMALS)=>{const $=BigNumber(_).dividedBy(BigNumber(10).pow(a));try{return new Intl.NumberFormat("en-US",{minimumFractionDigits:Number(a),maximumFractionDigits:Number(a)}).format($.toNumber())}catch{return console.warn(`Can't format token amount with decimals = ${a}`),formatTokenAmount(_,"0")}},tokenPrettyAmount=(_,a,$)=>{var nt;if(a.type==="nft")return _;const j=tokenSymbolSafe(a),et=(nt=a.metadata)==null?void 0:nt.decimals,tt=$!=null&&$.showSymbol?` ${j}`:"";return`${formatTokenAmount(_,et)}${tt}`},artifactUri=_=>_.metadata.artifactUri||_.displayUri,thumbnailUri=_=>_.metadata.thumbnailUri||_.displayUri,mimeType=_=>{var a,$;return($=(a=_.metadata.formats)==null?void 0:a.find(j=>j.uri===artifactUri(_)))==null?void 0:$.mimeType},royalties=_=>{const a=_.metadata.royalties;if(!a)return[];const $=Math.pow(10,Number(a.decimals)),j=Object.entries(a.shares).map(([et,tt])=>({address:et,share:Number(tt)*100/$}));return j.sort((et,tt)=>et.share`${tokenUri(_,a)}/metadata`,tokenUri=({contract:_,tokenId:a},$)=>`${$.tzktExplorerUrl}/${_}/tokens/${a}`,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=_=>{const a=fromRaw$1(_.token);return!a||!_.balance?null:{balance:_.balance,lastLevel:_.lastLevel,...a}},keepNFTs=_=>_.filter(a=>a.type==="nft"),keepFA1s=_=>_.filter(a=>a.type==="fa1.2"),keepFA2s=_=>_.filter(a=>a.type==="fa2"),initialState$8={block:{},transfers:{tokens:{}},accountStates:{},bakers:[],conversionRate:void 0,refetchTrigger:0,isLoading:!1,lastTimeUpdated:null},assetsSlice=createSlice({name:"assets",initialState:initialState$8,extraReducers:_=>_.addCase(accountsSlice.actions.reset,()=>initialState$8),reducers:{reset:()=>initialState$8,updateBlock:(_,{payload:a})=>{_.block=a},updateTokenTransfers:(_,{payload:a})=>{a.forEach($=>{_.transfers.tokens[$.transactionId]=$})},updateAccountStates:(_,{payload:a})=>{a.forEach($=>{const{balance:j,address:et,delegate:tt,stakedBalance:rt,unstakedBalance:nt,rollupBonds:it,smartRollupBonds:at}=$,st=j-rt-nt-it-at;_.accountStates[et]={..._.accountStates[et],delegate:tt,balance:st,stakedBalance:rt}})},updateUnstakeRequests:(_,{payload:a})=>{const $=lodashExports.groupBy(a,j=>j.staker.address);for(const j of Object.values(_.accountStates))j.unstakeRequests=[];for(const[j,et]of Object.entries($))_.accountStates[j]={..._.accountStates[j],unstakeRequests:lodashExports.sortBy(et.map(tt=>lodashExports.omit(tt,"staker")),"cycle")}},cleanAccountStates:_=>{_.accountStates={}},updateTokenBalance:(_,{payload:a})=>{const $=lodashExports.groupBy(a,j=>j.account.address);for(const j of Object.values(_.accountStates))j.tokens=[];for(const[j,et]of Object.entries($)){const tt=lodashExports.compact(et.map(fromRaw)).map(({balance:rt,contract:nt,tokenId:it,lastLevel:at})=>({balance:rt,contract:nt,tokenId:it,lastLevel:at}));_.accountStates[j]={..._.accountStates[j],tokens:tt}}},removeAccountsData:(_,{payload:a})=>{a.forEach($=>{delete _.accountStates[$]})},updateBakers:(_,{payload:a})=>{_.bakers=a},updateConversionRate:(_,{payload:a})=>{_.conversionRate=a},refetch:_=>{_.refetchTrigger+=1},setIsLoading:(_,{payload:a})=>{_.isLoading=a},setLastTimeUpdated:(_,{payload:a})=>{_.lastTimeUpdated=a}}}),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=_=>DefaultNetworks.map(a=>a.name).includes(_.name),DefaultNetworks=[MAINNET,GHOSTNET],initialState$7=lodashExports.fromPairs(DefaultNetworks.map(_=>[_.name,[]])),batchesSlice=createSlice({name:"batches",initialState:initialState$7,reducers:{reset:()=>initialState$7,add:(_,{payload:{operations:a,network:$}})=>{$.name in _||(_[$.name]=[]);const j=_[$.name],et=j.find(tt=>tt.sender.address.pkh===a.sender.address.pkh);if(et){et.operations.push(...a.operations);return}j.push(a)},clear:(_,{payload:{pkh:a,network:$}})=>{const j=_[$.name]||[],et=lodashExports.findIndex(j,tt=>tt.sender.address.pkh===a);et!==-1&&j.splice(et,1)},removeItem:(_,{payload:{pkh:a,index:$,network:j}})=>{const et=_[j.name]||[],tt=lodashExports.findIndex(et,nt=>nt.sender.address.pkh===a);if(tt===-1)return;const rt=et[tt];$lodashExports.fromPairs(Object.entries(_).map(([$,j])=>{const et=(j||[]).filter(tt=>!a.includes(tt.sender.address.pkh));return[$,et]}))}}),batchesActions=batchesSlice.actions,initialState$6={},beaconSlice=createSlice({name:"beacon",initialState:initialState$6,reducers:{reset:()=>initialState$6,addConnection:(_,{payload:a})=>{_[a.dAppId]={accountPkh:a.accountPkh,networkType:a.networkType}},removeConnection:(_,{payload:a})=>{delete _[a]},removeConnections:(_,{payload:a})=>lodashExports.fromPairs(Object.entries(_).filter(([$,j])=>!a.includes(j.accountPkh)))}});beaconSlice.actions;const initialState$5={},contactsSlice=createSlice({name:"contacts",initialState:initialState$5,reducers:{reset:()=>initialState$5,upsert:(_,{payload:a})=>{_[a.pkh]=a},remove:(_,{payload:a})=>{delete _[a]}}}),contactsActions=contactsSlice.actions,MAX_ERRORS_LEN=100,initialState$4=[],errorsSlice=createSlice({name:"errors",initialState:initialState$4,reducers:{reset:()=>initialState$4,add(_,{payload:a}){_.length===MAX_ERRORS_LEN&&_.shift(),_.push(a)}}}),initialState$3={items:[],pendingOperations:{},labelsMap:{}},multisigsSlice=createSlice({name:"multisigs",initialState:initialState$3,reducers:{reset:()=>initialState$3,mockAddAccount:(_,{payload:a})=>{_.items.push({label:`Multisig Account ${_.items.length}`,type:"multisig",...a})},setMultisigs:(_,{payload:a})=>{const $=lodashExports.fromPairs(_.items.map(j=>[j.address.pkh,j.label]));_.items=a.map((j,et)=>({...j,label:$[j.address.pkh]||_.labelsMap[j.address.pkh]||`Multisig Account ${et}`,type:"multisig"}))},addMultisigLabel:(_,{payload:{pkh:a,label:$}})=>{_.labelsMap[a]=$},setPendingOperations:(_,{payload:a})=>{_.pendingOperations=lodashExports.groupBy(a,$=>$.bigmapId)},setName:(_,{payload:a})=>{const{account:{address:{pkh:$}},newName:j}=a,et=_.items.find(tt=>tt.address.pkh===$);et&&(et.label=j)},removeMultisigsData:(_,{payload:a})=>{const $=_.items.filter(j=>a.includes(j.address.pkh)).map(j=>String(j.pendingOperationsBigmapId));_.pendingOperations=lodashExports.omit(_.pendingOperations,$),_.labelsMap=lodashExports.omit(_.labelsMap,a)}}}),multisigActions=multisigsSlice.actions,initialState$2={available:DefaultNetworks,current:MAINNET},networksSlice=createSlice({name:"networks",initialState:initialState$2,reducers:{reset:()=>initialState$2,setCurrent:(_,{payload:a})=>{_.current=a},upsertNetwork:(_,{payload:a})=>{if(isDefault(a))return;const $=_.available.findIndex(j=>j.name===a.name);if(_.current.name===a.name&&(_.current=a),$!==-1){_.available[$]=a;return}_.available.push(a)},removeNetwork:(_,{payload:a})=>{isDefault(a)||lodashExports.remove(_.available,$=>$.name===a.name)}}}),networksActions=networksSlice.actions,initialState$1=lodashExports.fromPairs(DefaultNetworks.map(_=>[_.name,{maxSlashingPeriod:2,consensusRightsDelay:2}])),protocolSettingsSlice=createSlice({name:"protocolSettings",initialState:initialState$1,reducers:{update:(_,{payload:{network:a,settings:$}})=>{_[a.name]=$}}}),protocolSettingsActions=protocolSettingsSlice.actions,initialState=lodashExports.fromPairs(DefaultNetworks.map(_=>[_.name,{}])),tokensSlice=createSlice({name:"tokens",initialState,reducers:{reset:()=>initialState,addTokens:(_,{payload:{network:a,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,protocolSettings:protocolSettingsSlice.reducer,tokens:tokensSlice.reducer}),reducer=persistReducer(rootPersistConfig,rootReducers),store=configureStore({reducer,middleware:_=>_({serializableCheck:{ignoredActions:[FLUSH,REHYDRATE,PAUSE,PERSIST,PURGE,REGISTER]}})}),persistor=persistStore(store),FormErrorMessage=({children:_,...a})=>jsxRuntimeExports.jsxs(FormErrorMessage$1,{color:colors.orange,fontSize:"12px",...a,children:[jsxRuntimeExports.jsx(Icon,{as:ExclamationIcon,marginRight:"6px"}),_]}),CONFIRMATION_CODE="wasabi",reset=()=>WalletClient.destroy().catch(lodashExports.noop).finally(()=>{persistor.pause(),localStorage.clear(),window.location.reload()}),OffboardingForm=()=>{const _=useForm({mode:"onBlur"}),{register:a,handleSubmit:$,formState:{isValid:j,errors:et},getValues:tt}=_,rt=()=>{if(!(!tt("check")||tt("confirmationCode")!==CONFIRMATION_CODE))return reset()};return jsxRuntimeExports.jsx(FormProvider,{..._,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,{...a("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",...a("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:_,onOpen:a,onClose:$}=useDisclosure$1();return{modalElement:jsxRuntimeExports.jsxs(Modal,{isCentered:!0,isOpen:_,onClose:$,children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[900],children:jsxRuntimeExports.jsx(OffboardingForm,{})})]}),onOpen:a}},CircleIcon=({icon:_,size:a,onClick:$=()=>{}})=>jsxRuntimeExports.jsx(Box,{width:a,height:a,margin:"auto",background:colors.gray[700],borderRadius:"full",onClick:$,children:jsxRuntimeExports.jsx(Center,{height:"100%",children:_})}),ModalContentWrapper=({children:_,icon:a,title:$,subtitle:j})=>jsxRuntimeExports.jsxs(VStack,{maxHeight:"83vh",spacing:0,children:[jsxRuntimeExports.jsx(Box,{marginBottom:"16px",children:jsxRuntimeExports.jsx(CircleIcon,{icon:a,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})]}),_]}),name$2="umami",productName="umami",version$2="2.2.0",author$2="Trilitech ",description$2="Tezos Wallet",homepage$2="https://umamiwallet.com",repository$2="https://github.com/trilitech/umami-v2",license$2="MIT",engines={node:">=20 <21.0.0"},type$5="commonjs",main$2="build/electron.js",scripts$2={build:"vite build",dev:"vite dev --host 127.0.0.1",preview:"vite preview","electron:package:linux":"electron-builder -l","electron:package:mac":"electron-builder -m","electron:package:mac:debug":"DEBUG=true yarn build --mode dev && sed -i='' 's@devTools: false@devTools: true@g' build/electron.js && yarn electron:package:mac -c electron-builder.dev.yml && rm -rf build","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":"cross-env DEV=true 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$2={"@airgap/beacon-wallet":"^4.2.2","@babel/core":"^7.24.7","@babel/preset-env":"^7.24.7","@babel/preset-react":"^7.24.7","@babel/preset-typescript":"^7.24.7","@babel/runtime":"^7.24.7","@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.8.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.1","@reduxjs/toolkit":"^2.2.5","@stylistic/eslint-plugin":"^2.1.0","@tanstack/eslint-plugin-query":"^5.43.1","@tanstack/react-query":"^5.45.0","@tanstack/react-query-devtools":"^5.45.0","@taquito/ledger-signer":"^20.0.0","@taquito/michel-codec":"^20.0.0","@taquito/rpc":"^20.0.0","@taquito/signer":"^20.0.0","@taquito/taquito":"20.0.0","@taquito/utils":"^20.0.0","@testing-library/dom":"^10.1.0","@testing-library/jest-dom":"6.4.6","@testing-library/react":"14.3.1","@testing-library/user-event":"14.5.2","@toruslabs/customauth":"^16.0.6","@types/babel__core":"^7.20.5","@types/babel__preset-env":"^7.9.6","@types/identity-obj-proxy":"^3.0.2","@types/jest":"^29.5.12","@types/md5":"^2.3.5","@types/node":"20.14.2","@types/papaparse":"^5.3.14","@types/pluralize":"^0.0.33","@types/promise-retry":"^1.1.6","@types/react":"18.3.3","@types/react-dom":"18.3.0","@types/react-test-renderer":"^18.3.0","@typescript-eslint/eslint-plugin":"^7.13.0","@typescript-eslint/parser":"^7.13.0","@tzkt/sdk-api":"^2.2.1","@vitejs/plugin-react":"^4.3.1",axios:"^1.7.2","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:"^31.0.1","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":"^3.0.0","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^28.6.0","eslint-plugin-jest-dom":"^5.4.0","eslint-plugin-playwright":"^1.6.2","eslint-plugin-react":"^7.34.2","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.3.0","eslint-plugin-unused-imports":"^3.2.0","framer-motion":"^11.2.10","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.3.2","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":"^3.0.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.3.0",typescript:"5.4.5",vite:"^5.3.0","vite-plugin-checker":"^0.6.4","vite-plugin-node-polyfills":"^0.22.0",zipurl:"^0.2.18",zod:"^3.23.8"},packageManager="yarn@4.3.0",dependencies$2={"electron-updater":"^6.2.1"},resolutions={jsdom:"^23.0.1","@types/jsdom":"^21.1.6"},packageInfo={name:name$2,productName,version:version$2,author:author$2,description:description$2,homepage:homepage$2,repository:repository$2,license:license$2,engines,type:type$5,main:main$2,scripts:scripts$2,devDependencies:devDependencies$2,packageManager,dependencies:dependencies$2,resolutions};var withSelector={exports:{}},useSyncExternalStoreWithSelector_production_min={};/** +`+new Array(_.length+4).join(" "):et=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],at=m$1[tt+1];ADD64AA(v$2,_,a),ADD64AC(v$2,_,rt,nt);let st=v$2[j]^v$2[_],ot=v$2[j+1]^v$2[_+1];v$2[j]=ot,v$2[j+1]=st,ADD64AA(v$2,$,j),st=v$2[a]^v$2[$],ot=v$2[a+1]^v$2[$+1],v$2[a]=st>>>24^ot<<8,v$2[a+1]=ot>>>24^st<<8,ADD64AA(v$2,_,a),ADD64AC(v$2,_,it,at),st=v$2[j]^v$2[_],ot=v$2[j+1]^v$2[_+1],v$2[j]=st>>>16^ot<<16,v$2[j+1]=ot>>>16^st<<16,ADD64AA(v$2,$,j),st=v$2[a]^v$2[$],ot=v$2[a+1]^v$2[$+1],v$2[a]=ot>>>31^st<<1,v$2[a+1]=st>>>31^ot<<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(_){return _*2})),v$2=new Uint32Array(32),m$1=new Uint32Array(32);function blake2bCompress(_,a){let $=0;for($=0;$<16;$++)v$2[$]=_.h[$],v$2[$+16]=BLAKE2B_IV32[$];for(v$2[24]=v$2[24]^_.t,v$2[25]=v$2[25]^_.t/4294967296,a&&(v$2[28]=~v$2[28],v$2[29]=~v$2[29]),$=0;$<32;$++)m$1[$]=B2B_GET32(_.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;$++)_.h[$]=_.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(_===0||_>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(a&&a.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:_};parameterBlock.fill(0),parameterBlock[0]=_,a&&(parameterBlock[1]=a.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 a&&(blake2bUpdate(et,a),et.c=128),et}function blake2bUpdate(_,a){for(let $=0;$>2]>>8*($&3);return a}function blake2b(_,a,$,j,et){$=$||64,_=util$2.normalizeInput(_),j&&(j=util$2.normalizeInput(j)),et&&(et=util$2.normalizeInput(et));const tt=blake2bInit($,a,j,et);return blake2bUpdate(tt,_),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[_]=v$1[_]+v$1[a]+et,v$1[j]=ROTR32(v$1[j]^v$1[_],16),v$1[$]=v$1[$]+v$1[j],v$1[a]=ROTR32(v$1[a]^v$1[$],12),v$1[_]=v$1[_]+v$1[a]+tt,v$1[j]=ROTR32(v$1[j]^v$1[_],8),v$1[$]=v$1[$]+v$1[j],v$1[a]=ROTR32(v$1[a]^v$1[$],7)}function ROTR32(_,a){return _>>>a^_<<32-a}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[$]=_.h[$],v$1[$+8]=BLAKE2S_IV[$];for(v$1[12]^=_.t,v$1[13]^=_.t/4294967296,a&&(v$1[14]=~v$1[14]),$=0;$<16;$++)m[$]=B2S_GET32(_.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;$++)_.h[$]^=v$1[$]^v$1[$+8]}function blake2sInit(_,a){if(!(_>0&&_<=32))throw new Error("Incorrect output length, should be in [1, 32]");const $=a?a.length:0;if(a&&!($>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:_};return j.h[0]^=16842752^$<<8^_,$>0&&(blake2sUpdate(j,a),j.c=64),j}function blake2sUpdate(_,a){for(let $=0;$>2]>>8*($&3)&255;return a}function blake2s(_,a,$){$=$||32,_=util$1.normalizeInput(_);const j=blake2sInit($,a);return blake2sUpdate(j,_),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$3={},_sha2$1={},_assert$1={};Object.defineProperty(_assert$1,"__esModule",{value:!0});_assert$1.output=_assert$1.exists=_assert$1.hash=_assert$1.bytes=_assert$1.bool=_assert$1.number=void 0;function number$3(_){if(!Number.isSafeInteger(_)||_<0)throw new Error(`Wrong positive integer: ${_}`)}_assert$1.number=number$3;function bool$3(_){if(typeof _!="boolean")throw new Error(`Expected boolean, not ${_}`)}_assert$1.bool=bool$3;function bytes$2(_,...a){if(!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length>0&&!a.includes(_.length))throw new TypeError(`Expected Uint8Array of length ${a}, not of length=${_.length}`)}_assert$1.bytes=bytes$2;function hash$6(_){if(typeof _!="function"||typeof _.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$3(_.outputLen),number$3(_.blockLen)}_assert$1.hash=hash$6;function exists$2(_,a=!0){if(_.destroyed)throw new Error("Hash instance has been destroyed");if(a&&_.finished)throw new Error("Hash#digest() has already been called")}_assert$1.exists=exists$2;function output$2(_,a){bytes$2(_);const $=a.outputLen;if(_.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}_assert$1.output=output$2;const assert$u={number:number$3,bool:bool$3,bytes:bytes$2,hash:hash$6,exists:exists$2,output:output$2};_assert$1.default=assert$u;var utils$A={},crypto$2={};Object.defineProperty(crypto$2,"__esModule",{value:!0});crypto$2.crypto=void 0;crypto$2.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(_){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(_,"__esModule",{value:!0}),_.randomBytes=_.wrapConstructorWithOpts=_.wrapConstructor=_.checkOpts=_.Hash=_.concatBytes=_.toBytes=_.utf8ToBytes=_.asyncLoop=_.nextTick=_.hexToBytes=_.bytesToHex=_.isLE=_.rotr=_.createView=_.u32=_.u8=void 0;const a=crypto$2,$=Lt=>new Uint8Array(Lt.buffer,Lt.byteOffset,Lt.byteLength);_.u8=$;const j=Lt=>new Uint32Array(Lt.buffer,Lt.byteOffset,Math.floor(Lt.byteLength/4));_.u32=j;const et=Lt=>new DataView(Lt.buffer,Lt.byteOffset,Lt.byteLength);_.createView=et;const tt=(Lt,Nt)=>Lt<<32-Nt|Lt>>>Nt;if(_.rotr=tt,_.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!_.isLE)throw new Error("Non little-endian hardware is not supported");const rt=Array.from({length:256},(Lt,Nt)=>Nt.toString(16).padStart(2,"0"));function nt(Lt){if(!(Lt instanceof Uint8Array))throw new Error("Uint8Array expected");let Nt="";for(let zt=0;zt{};_.nextTick=at;async function st(Lt,Nt,zt){let Bt=Date.now();for(let It=0;It=0&&DtBt instanceof Uint8Array))throw new Error("Uint8Array list expected");if(Lt.length===1)return Lt[0];const Nt=Lt.reduce((Bt,It)=>Bt+It.length,0),zt=new Uint8Array(Nt);for(let Bt=0,It=0;BtObject.prototype.toString.call(Lt)==="[object Object]"&&Lt.constructor===Object;function Ct(Lt,Nt){if(Nt!==void 0&&(typeof Nt!="object"||!xt(Nt)))throw new TypeError("Options should be object or undefined");return Object.assign(Lt,Nt)}_.checkOpts=Ct;function Pt(Lt){const Nt=Bt=>Lt().update(ut(Bt)).digest(),zt=Lt();return Nt.outputLen=zt.outputLen,Nt.blockLen=zt.blockLen,Nt.create=()=>Lt(),Nt}_.wrapConstructor=Pt;function Tt(Lt){const Nt=(Bt,It)=>Lt(It).update(ut(Bt)).digest(),zt=Lt({});return Nt.outputLen=zt.outputLen,Nt.blockLen=zt.blockLen,Nt.create=Bt=>Lt(Bt),Nt}_.wrapConstructorWithOpts=Tt;function Mt(Lt=32){if(a.crypto&&typeof a.crypto.getRandomValues=="function")return a.crypto.getRandomValues(new Uint8Array(Lt));throw new Error("crypto.getRandomValues must be defined")}_.randomBytes=Mt})(utils$A);Object.defineProperty(_sha2$1,"__esModule",{value:!0});_sha2$1.SHA2=void 0;const _assert_js_1$2=_assert$1,utils_js_1$5=utils$A;function setBigUint64$1(_,a,$,j){if(typeof _.setBigUint64=="function")return _.setBigUint64(a,$,j);const et=BigInt(32),tt=BigInt(4294967295),rt=Number($>>et&tt),nt=Number($&tt),it=j?4:0,at=j?0:4;_.setUint32(a+it,rt,j),_.setUint32(a+at,nt,j)}let SHA2$1=class extends utils_js_1$5.Hash{constructor(a,$,j,et){super(),this.blockLen=a,this.outputLen=$,this.padOffset=j,this.isLE=et,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(a),this.view=(0,utils_js_1$5.createView)(this.buffer)}update(a){_assert_js_1$2.default.exists(this);const{view:$,buffer:j,blockLen:et}=this;a=(0,utils_js_1$5.toBytes)(a);const tt=a.length;for(let rt=0;rtet-rt&&(this.process(j,0),rt=0);for(let ot=rt;otst.length)throw new Error("_sha2: outputLen bigger than state");for(let ot=0;ot_&a^~_&$,Maj$1=(_,a,$)=>_&a^_&$^a&$,SHA256_K$1=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$1=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W$1=new Uint32Array(64);let SHA256$1=class extends _sha2_js_1$2.SHA2{constructor(){super(64,32,8,!1),this.A=IV$1[0]|0,this.B=IV$1[1]|0,this.C=IV$1[2]|0,this.D=IV$1[3]|0,this.E=IV$1[4]|0,this.F=IV$1[5]|0,this.G=IV$1[6]|0,this.H=IV$1[7]|0}get(){const{A:a,B:$,C:j,D:et,E:tt,F:rt,G:nt,H:it}=this;return[a,$,j,et,tt,rt,nt,it]}set(a,$,j,et,tt,rt,nt,it){this.A=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(a,$){for(let ot=0;ot<16;ot++,$+=4)SHA256_W$1[ot]=a.getUint32($,!1);for(let ot=16;ot<64;ot++){const ut=SHA256_W$1[ot-15],dt=SHA256_W$1[ot-2],mt=(0,utils_js_1$4.rotr)(ut,7)^(0,utils_js_1$4.rotr)(ut,18)^ut>>>3,xt=(0,utils_js_1$4.rotr)(dt,17)^(0,utils_js_1$4.rotr)(dt,19)^dt>>>10;SHA256_W$1[ot]=xt+SHA256_W$1[ot-7]+mt+SHA256_W$1[ot-16]|0}let{A:j,B:et,C:tt,D:rt,E:nt,F:it,G:at,H:st}=this;for(let ot=0;ot<64;ot++){const ut=(0,utils_js_1$4.rotr)(nt,6)^(0,utils_js_1$4.rotr)(nt,11)^(0,utils_js_1$4.rotr)(nt,25),dt=st+ut+Chi$1(nt,it,at)+SHA256_K$1[ot]+SHA256_W$1[ot]|0,xt=((0,utils_js_1$4.rotr)(j,2)^(0,utils_js_1$4.rotr)(j,13)^(0,utils_js_1$4.rotr)(j,22))+Maj$1(j,et,tt)|0;st=at,at=it,it=nt,nt=rt+dt|0,rt=tt,tt=et,et=j,j=dt+xt|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,at=at+this.G|0,st=st+this.H|0,this.set(j,et,tt,rt,nt,it,at,st)}roundClean(){SHA256_W$1.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},SHA224$1=class extends SHA256$1{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$3.sha256=(0,utils_js_1$4.wrapConstructor)(()=>new SHA256$1);sha256$3.sha224=(0,utils_js_1$4.wrapConstructor)(()=>new SHA224$1);function base$4(_){if(_.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),$=0;$>>0,Mt=new Uint8Array(Tt);Ct!==Pt;){for(var Lt=dt[Ct],Nt=0,zt=Tt-1;(Lt!==0||Nt>>0,Mt[zt]=Lt%rt>>>0,Lt=Lt/rt>>>0;if(Lt!==0)throw new Error("Non-zero carry");xt=Nt,Ct++}for(var Bt=Tt-xt;Bt!==Tt&&Mt[Bt]===0;)Bt++;for(var It=nt.repeat(mt);Bt>>0,Tt=new Uint8Array(Pt);dt[mt];){var Mt=a[dt.charCodeAt(mt)];if(Mt===255)return;for(var Lt=0,Nt=Pt-1;(Mt!==0||Lt>>0,Tt[Nt]=Mt%256>>>0,Mt=Mt/256>>>0;if(Mt!==0)throw new Error("Non-zero carry");Ct=Lt,mt++}for(var zt=Pt-Ct;zt!==Pt&&Tt[zt]===0;)zt++;for(var Bt=new Uint8Array(xt+(Pt-zt)),It=xt;zt!==Pt;)Bt[It++]=Tt[zt++];return Bt}function ut(dt){var mt=ot(dt);if(mt)return mt;throw new Error("Non-base"+rt+" character")}return{encode:st,decodeUnsafe:ot,decode:ut}}var src$1=base$4;const basex=src$1,ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var bs58=basex(ALPHABET),base58=bs58,base$3=function(_){function a(tt){var rt=Uint8Array.from(tt),nt=_(rt),it=rt.length+4,at=new Uint8Array(it);return at.set(rt,0),at.set(nt.subarray(0,4),rt.length),base58.encode(at,it)}function $(tt){var rt=tt.slice(0,-4),nt=tt.slice(-4),it=_(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:a,decode:et,decodeUnsafe:j}},{sha256:sha256$2}=sha256$3,bs58checkBase=base$3;function sha256x2(_){return sha256$2(sha256$2(_))}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(a,$){super(),this.address=a,this.errorDetail=$,this.name="InvalidAddressError",this.message=`Invalid address "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidStakingAddressError extends ParameterValidationError{constructor(a,$){super(),this.address=a,this.errorDetail=$,this.name="InvalidStakingAddressError",this.message=`Invalid staking address "${a}", you can only set destination as your own address`}}class InvalidFinalizeUnstakeAmountError extends ParameterValidationError{constructor(a,$){super(),this.address=a,this.errorDetail=$,this.name="InvalidFinalizeUnstakeAmountError",this.message="The amount can only be 0 when finalizing an unstake"}}class InvalidBlockHashError extends ParameterValidationError{constructor(a,$){super(),this.blockHash=a,this.errorDetail=$,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidAmountError extends ParameterValidationError{constructor(a){super(),this.amount=a,this.name="InvalidAmountError",this.message=`Invalid amount "${a}"`}}class InvalidDerivationPathError extends ParameterValidationError{constructor(a,$){super(),this.derivationPath=a,this.errorDetail=$,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidHexStringError extends ParameterValidationError{constructor(a,$){super(),this.hexString=a,this.errorDetail=$,this.name="InvalidHexStringError",this.message=`Invalid hex string "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidMessageError extends ParameterValidationError{constructor(a,$){super(),this.msg=a,this.errorDetail=$,this.name="InvalidMessageError",this.message=`Invalid message "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidViewParameterError extends ParameterValidationError{constructor(a,$,j,et){super(),this.viewName=a,this.sigs=$,this.args=j,this.cause=et,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(j)} received for name "${a}" expecting one of the following signatures ${JSON.stringify($)}.`}}class InvalidKeyError extends ParameterValidationError{constructor(a){super(),this.errorDetail=a,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=a?` ${a}.`:"."}}class InvalidPublicKeyError extends ParameterValidationError{constructor(a,$){super(),this.publicKey=a,this.errorDetail=$,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidContractAddressError extends ParameterValidationError{constructor(a,$){super(),this.contractAddress=a,this.errorDetail=$,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidChainIdError extends ParameterValidationError{constructor(a,$){super(),this.chainId=a,this.errorDetail=$,this.name="InvalidChainIdError",this.message=`Invalid chain id "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidKeyHashError extends ParameterValidationError{constructor(a,$){super(),this.keyHash=a,this.errorDetail=$,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidOperationHashError extends ParameterValidationError{constructor(a,$){super(),this.operationHash=a,this.errorDetail=$,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${a}"`,this.message+=$?` ${$}.`:"."}}class InvalidOperationKindError extends ParameterValidationError{constructor(a,$){super(),this.operationKind=a,this.errorDetail=$,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${a}"`,this.message+=$?` ${$}.`:"."}}class DeprecationError extends UnsupportedActionError{constructor(a){super(),this.message=a,this.name="DeprecationError"}}class ProhibitedActionError extends UnsupportedActionError{constructor(a){super(),this.message=a,this.name="ProhibitedActionError"}}class PublicKeyNotFoundError extends TaquitoError{constructor(a,$){super(),this.pkh=a,this.cause=$,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${a}" 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(_){var a,$,j,et=Tt.prototype={constructor:Tt,toString:null,valueOf:null},tt=new Tt(1),rt=20,nt=4,it=-7,at=21,st=-1e7,ot=1e7,ut=!1,dt=1,mt=0,xt={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Ct="0123456789abcdefghijklmnopqrstuvwxyz",Pt=!0;function Tt(It,Dt){var Ft,Ot,yt,bt,ct,ht,vt,wt,At=this;if(!(At instanceof Tt))return new Tt(It,Dt);if(Dt==null){if(It&&It._isBigNumber===!0){At.s=It.s,!It.c||It.e>ot?At.c=At.e=null:It.e=10;ct/=10,bt++);bt>ot?At.c=At.e=null:(At.e=bt,At.c=[It]);return}wt=String(It)}else{if(!isNumeric.test(wt=String(It)))return j(At,wt,ht);At.s=wt.charCodeAt(0)==45?(wt=wt.slice(1),-1):1}(bt=wt.indexOf("."))>-1&&(wt=wt.replace(".","")),(ct=wt.search(/e/i))>0?(bt<0&&(bt=ct),bt+=+wt.slice(ct+1),wt=wt.substring(0,ct)):bt<0&&(bt=wt.length)}else{if(intCheck(Dt,2,Ct.length,"Base"),Dt==10&&Pt)return At=new Tt(It),zt(At,rt+At.e+1,nt);if(wt=String(It),ht=typeof It=="number"){if(It*0!=0)return j(At,wt,ht,Dt);if(At.s=1/It<0?(wt=wt.slice(1),-1):1,Tt.DEBUG&&wt.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+It)}else At.s=wt.charCodeAt(0)===45?(wt=wt.slice(1),-1):1;for(Ft=Ct.slice(0,Dt),bt=ct=0,vt=wt.length;ctbt){bt=vt;continue}}else if(!yt&&(wt==wt.toUpperCase()&&(wt=wt.toLowerCase())||wt==wt.toLowerCase()&&(wt=wt.toUpperCase()))){yt=!0,ct=-1,bt=0;continue}return j(At,String(It),ht,Dt)}ht=!1,wt=$(wt,Dt,10,At.s),(bt=wt.indexOf("."))>-1?wt=wt.replace(".",""):bt=wt.length}for(ct=0;wt.charCodeAt(ct)===48;ct++);for(vt=wt.length;wt.charCodeAt(--vt)===48;);if(wt=wt.slice(ct,++vt)){if(vt-=ct,ht&&Tt.DEBUG&&vt>15&&(It>MAX_SAFE_INTEGER$2||It!==mathfloor(It)))throw Error(tooManyDigits+At.s*It);if((bt=bt-ct-1)>ot)At.c=At.e=null;else if(bt=-MAX$1&&yt<=MAX$1&&yt===mathfloor(yt)){if(Ot[0]===0){if(yt===0&&Ot.length===1)return!0;break e}if(Dt=(yt+1)%LOG_BASE,Dt<1&&(Dt+=LOG_BASE),String(Ot[0]).length==Dt){for(Dt=0;Dt=BASE||Ft!==mathfloor(Ft))break e;if(Ft!==0)return!0}}}else if(Ot===null&&yt===null&&(bt===null||bt===1||bt===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+It)},Tt.maximum=Tt.max=function(){return Lt(arguments,-1)},Tt.minimum=Tt.min=function(){return Lt(arguments,1)},Tt.random=function(){var It=9007199254740992,Dt=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 Ot,yt,bt,ct,ht,vt=0,wt=[],At=new Tt(tt);if(Ft==null?Ft=rt:intCheck(Ft,0,MAX$1),ct=mathceil(Ft/LOG_BASE),ut)if(crypto.getRandomValues){for(Ot=crypto.getRandomValues(new Uint32Array(ct*=2));vt>>11),ht>=9e15?(yt=crypto.getRandomValues(new Uint32Array(2)),Ot[vt]=yt[0],Ot[vt+1]=yt[1]):(wt.push(ht%1e14),vt+=2);vt=ct/2}else if(crypto.randomBytes){for(Ot=crypto.randomBytes(ct*=7);vt=9e15?crypto.randomBytes(7).copy(Ot,vt):(wt.push(ht%1e14),vt+=7);vt=ct/7}else throw ut=!1,Error(bignumberError+"crypto unavailable");if(!ut)for(;vt=10;ht/=10,vt++);vtyt-1&&(ht[ct+1]==null&&(ht[ct+1]=0),ht[ct+1]+=ht[ct]/yt|0,ht[ct]%=yt)}return ht.reverse()}return function(Ft,Ot,yt,bt,ct){var ht,vt,wt,At,Rt,Et,$t,_t,jt=Ft.indexOf("."),tr=rt,nr=nt;for(jt>=0&&(At=mt,mt=0,Ft=Ft.replace(".",""),_t=new Tt(Ot),Et=_t.pow(Ft.length-jt),mt=At,_t.c=Dt(toFixedPoint(coeffToString(Et.c),Et.e,"0"),10,yt,It),_t.e=_t.c.length),$t=Dt(Ft,Ot,yt,ct?(ht=Ct,It):(ht=It,Ct)),wt=At=$t.length;$t[--At]==0;$t.pop());if(!$t[0])return ht.charAt(0);if(jt<0?--wt:(Et.c=$t,Et.e=wt,Et.s=bt,Et=a(Et,_t,tr,nr,yt),$t=Et.c,Rt=Et.r,wt=Et.e),vt=wt+tr+1,jt=$t[vt],At=yt/2,Rt=Rt||vt<0||$t[vt+1]!=null,Rt=nr<4?(jt!=null||Rt)&&(nr==0||nr==(Et.s<0?3:2)):jt>At||jt==At&&(nr==4||Rt||nr==6&&$t[vt-1]&1||nr==(Et.s<0?8:7)),vt<1||!$t[0])Ft=Rt?toFixedPoint(ht.charAt(1),-tr,ht.charAt(0)):ht.charAt(0);else{if($t.length=vt,Rt)for(--yt;++$t[--vt]>yt;)$t[vt]=0,vt||(++wt,$t=[1].concat($t));for(At=$t.length;!$t[--At];);for(jt=0,Ft="";jt<=At;Ft+=ht.charAt($t[jt++]));Ft=toFixedPoint(Ft,wt,ht.charAt(0))}return Ft}}(),a=function(){function It(Ot,yt,bt){var ct,ht,vt,wt,At=0,Rt=Ot.length,Et=yt%SQRT_BASE,$t=yt/SQRT_BASE|0;for(Ot=Ot.slice();Rt--;)vt=Ot[Rt]%SQRT_BASE,wt=Ot[Rt]/SQRT_BASE|0,ct=$t*vt+wt*Et,ht=Et*vt+ct%SQRT_BASE*SQRT_BASE+At,At=(ht/bt|0)+(ct/SQRT_BASE|0)+$t*wt,Ot[Rt]=ht%bt;return At&&(Ot=[At].concat(Ot)),Ot}function Dt(Ot,yt,bt,ct){var ht,vt;if(bt!=ct)vt=bt>ct?1:-1;else for(ht=vt=0;htyt[ht]?1:-1;break}return vt}function Ft(Ot,yt,bt,ct){for(var ht=0;bt--;)Ot[bt]-=ht,ht=Ot[bt]1;Ot.splice(0,1));}return function(Ot,yt,bt,ct,ht){var vt,wt,At,Rt,Et,$t,_t,jt,tr,nr,ir,Wt,Kt,Jt,Ht,Vt,Qt,dr=Ot.s==yt.s?1:-1,yr=Ot.c,pr=yt.c;if(!yr||!yr[0]||!pr||!pr[0])return new Tt(!Ot.s||!yt.s||(yr?pr&&yr[0]==pr[0]:!pr)?NaN:yr&&yr[0]==0||!pr?dr*0:dr/0);for(jt=new Tt(dr),tr=jt.c=[],wt=Ot.e-yt.e,dr=bt+wt+1,ht||(ht=BASE,wt=bitFloor(Ot.e/LOG_BASE)-bitFloor(yt.e/LOG_BASE),dr=dr/LOG_BASE|0),At=0;pr[At]==(yr[At]||0);At++);if(pr[At]>(yr[At]||0)&&wt--,dr<0)tr.push(1),Rt=!0;else{for(Jt=yr.length,Vt=pr.length,At=0,dr+=2,Et=mathfloor(ht/(pr[0]+1)),Et>1&&(pr=It(pr,Et,ht),yr=It(yr,Et,ht),Vt=pr.length,Jt=yr.length),Kt=Vt,nr=yr.slice(0,Vt),ir=nr.length;ir=ht/2&&Ht++;do{if(Et=0,vt=Dt(pr,nr,Vt,ir),vt<0){if(Wt=nr[0],Vt!=ir&&(Wt=Wt*ht+(nr[1]||0)),Et=mathfloor(Wt/Ht),Et>1)for(Et>=ht&&(Et=ht-1),$t=It(pr,Et,ht),_t=$t.length,ir=nr.length;Dt($t,nr,_t,ir)==1;)Et--,Ft($t,Vt<_t?Qt:pr,_t,ht),_t=$t.length,vt=1;else Et==0&&(vt=Et=1),$t=pr.slice(),_t=$t.length;if(_t=10;dr/=10,At++);zt(jt,bt+(jt.e=At+wt*LOG_BASE-1)+1,ct,Rt)}else jt.e=wt,jt.r=+Rt;return jt}}();function Mt(It,Dt,Ft,Ot){var yt,bt,ct,ht,vt;if(Ft==null?Ft=nt:intCheck(Ft,0,8),!It.c)return It.toString();if(yt=It.c[0],ct=It.e,Dt==null)vt=coeffToString(It.c),vt=Ot==1||Ot==2&&(ct<=it||ct>=at)?toExponential(vt,ct):toFixedPoint(vt,ct,"0");else if(It=zt(new Tt(It),Dt,Ft),bt=It.e,vt=coeffToString(It.c),ht=vt.length,Ot==1||Ot==2&&(Dt<=bt||bt<=it)){for(;htht){if(--Dt>0)for(vt+=".";Dt--;vt+="0");}else if(Dt+=bt-ht,Dt>0)for(bt+1==ht&&(vt+=".");Dt--;vt+="0");return It.s<0&&yt?"-"+vt:vt}function Lt(It,Dt){for(var Ft,Ot,yt=1,bt=new Tt(It[0]);yt=10;yt/=10,Ot++);return(Ft=Ot+Ft*LOG_BASE-1)>ot?It.c=It.e=null:Ft=10;ht/=10,yt++);if(bt=Dt-yt,bt<0)bt+=LOG_BASE,ct=Dt,vt=Rt[wt=0],At=mathfloor(vt/Et[yt-ct-1]%10);else if(wt=mathceil((bt+1)/LOG_BASE),wt>=Rt.length)if(Ot){for(;Rt.length<=wt;Rt.push(0));vt=At=0,yt=1,bt%=LOG_BASE,ct=bt-LOG_BASE+1}else break e;else{for(vt=ht=Rt[wt],yt=1;ht>=10;ht/=10,yt++);bt%=LOG_BASE,ct=bt-LOG_BASE+yt,At=ct<0?0:mathfloor(vt/Et[yt-ct-1]%10)}if(Ot=Ot||Dt<0||Rt[wt+1]!=null||(ct<0?vt:vt%Et[yt-ct-1]),Ot=Ft<4?(At||Ot)&&(Ft==0||Ft==(It.s<0?3:2)):At>5||At==5&&(Ft==4||Ot||Ft==6&&(bt>0?ct>0?vt/Et[yt-ct]:0:Rt[wt-1])%10&1||Ft==(It.s<0?8:7)),Dt<1||!Rt[0])return Rt.length=0,Ot?(Dt-=It.e+1,Rt[0]=Et[(LOG_BASE-Dt%LOG_BASE)%LOG_BASE],It.e=-Dt||0):Rt[0]=It.e=0,It;if(bt==0?(Rt.length=wt,ht=1,wt--):(Rt.length=wt+1,ht=Et[LOG_BASE-bt],Rt[wt]=ct>0?mathfloor(vt/Et[yt-ct]%Et[ct])*ht:0),Ot)for(;;)if(wt==0){for(bt=1,ct=Rt[0];ct>=10;ct/=10,bt++);for(ct=Rt[0]+=ht,ht=1;ct>=10;ct/=10,ht++);bt!=ht&&(It.e++,Rt[0]==BASE&&(Rt[0]=1));break}else{if(Rt[wt]+=ht,Rt[wt]!=BASE)break;Rt[wt--]=0,ht=1}for(bt=Rt.length;Rt[--bt]===0;Rt.pop());}It.e>ot?It.c=It.e=null:It.e=at?toExponential(Dt,Ft):toFixedPoint(Dt,Ft,"0"),It.s<0?"-"+Dt:Dt)}return et.absoluteValue=et.abs=function(){var It=new Tt(this);return It.s<0&&(It.s=1),It},et.comparedTo=function(It,Dt){return compare$c(this,new Tt(It,Dt))},et.decimalPlaces=et.dp=function(It,Dt){var Ft,Ot,yt,bt=this;if(It!=null)return intCheck(It,0,MAX$1),Dt==null?Dt=nt:intCheck(Dt,0,8),zt(new Tt(bt),It+bt.e+1,Dt);if(!(Ft=bt.c))return null;if(Ot=((yt=Ft.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,yt=Ft[yt])for(;yt%10==0;yt/=10,Ot--);return Ot<0&&(Ot=0),Ot},et.dividedBy=et.div=function(It,Dt){return a(this,new Tt(It,Dt),rt,nt)},et.dividedToIntegerBy=et.idiv=function(It,Dt){return a(this,new Tt(It,Dt),0,1)},et.exponentiatedBy=et.pow=function(It,Dt){var Ft,Ot,yt,bt,ct,ht,vt,wt,At,Rt=this;if(It=new Tt(It),It.c&&!It.isInteger())throw Error(bignumberError+"Exponent not an integer: "+Bt(It));if(Dt!=null&&(Dt=new Tt(Dt)),ht=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 Tt(Math.pow(+Bt(Rt),ht?It.s*(2-isOdd(It)):+Bt(It))),Dt?At.mod(Dt):At;if(vt=It.s<0,Dt){if(Dt.c?!Dt.c[0]:!Dt.s)return new Tt(NaN);Ot=!vt&&Rt.isInteger()&&Dt.isInteger(),Ot&&(Rt=Rt.mod(Dt))}else{if(It.e>9&&(Rt.e>0||Rt.e<-1||(Rt.e==0?Rt.c[0]>1||ht&&Rt.c[1]>=24e7:Rt.c[0]<8e13||ht&&Rt.c[0]<=9999975e7)))return bt=Rt.s<0&&isOdd(It)?-0:0,Rt.e>-1&&(bt=1/bt),new Tt(vt?1/bt:bt);mt&&(bt=mathceil(mt/LOG_BASE+2))}for(ht?(Ft=new Tt(.5),vt&&(It.s=1),wt=isOdd(It)):(yt=Math.abs(+Bt(It)),wt=yt%2),At=new Tt(tt);;){if(wt){if(At=At.times(Rt),!At.c)break;bt?At.c.length>bt&&(At.c.length=bt):Ot&&(At=At.mod(Dt))}if(yt){if(yt=mathfloor(yt/2),yt===0)break;wt=yt%2}else if(It=It.times(Ft),zt(It,It.e+1,1),It.e>14)wt=isOdd(It);else{if(yt=+Bt(It),yt===0)break;wt=yt%2}Rt=Rt.times(Rt),bt?Rt.c&&Rt.c.length>bt&&(Rt.c.length=bt):Ot&&(Rt=Rt.mod(Dt))}return Ot?At:(vt&&(At=tt.div(At)),Dt?At.mod(Dt):bt?zt(At,mt,nt,ct):At)},et.integerValue=function(It){var Dt=new Tt(this);return It==null?It=nt:intCheck(It,0,8),zt(Dt,Dt.e+1,It)},et.isEqualTo=et.eq=function(It,Dt){return compare$c(this,new Tt(It,Dt))===0},et.isFinite=function(){return!!this.c},et.isGreaterThan=et.gt=function(It,Dt){return compare$c(this,new Tt(It,Dt))>0},et.isGreaterThanOrEqualTo=et.gte=function(It,Dt){return(Dt=compare$c(this,new Tt(It,Dt)))===1||Dt===0},et.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},et.isLessThan=et.lt=function(It,Dt){return compare$c(this,new Tt(It,Dt))<0},et.isLessThanOrEqualTo=et.lte=function(It,Dt){return(Dt=compare$c(this,new Tt(It,Dt)))===-1||Dt===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,Dt){var Ft,Ot,yt,bt,ct=this,ht=ct.s;if(It=new Tt(It,Dt),Dt=It.s,!ht||!Dt)return new Tt(NaN);if(ht!=Dt)return It.s=-Dt,ct.plus(It);var vt=ct.e/LOG_BASE,wt=It.e/LOG_BASE,At=ct.c,Rt=It.c;if(!vt||!wt){if(!At||!Rt)return At?(It.s=-Dt,It):new Tt(Rt?ct:NaN);if(!At[0]||!Rt[0])return Rt[0]?(It.s=-Dt,It):new Tt(At[0]?ct:nt==3?-0:0)}if(vt=bitFloor(vt),wt=bitFloor(wt),At=At.slice(),ht=vt-wt){for((bt=ht<0)?(ht=-ht,yt=At):(wt=vt,yt=Rt),yt.reverse(),Dt=ht;Dt--;yt.push(0));yt.reverse()}else for(Ot=(bt=(ht=At.length)<(Dt=Rt.length))?ht:Dt,ht=Dt=0;Dt0)for(;Dt--;At[Ft++]=0);for(Dt=BASE-1;Ot>ht;){if(At[--Ot]=0;){for(Ft=0,Et=Wt[yt]%tr,$t=Wt[yt]/tr|0,ct=vt,bt=yt+ct;bt>yt;)wt=ir[--ct]%tr,At=ir[ct]/tr|0,ht=$t*wt+At*Et,wt=Et*wt+ht%tr*tr+_t[bt]+Ft,Ft=(wt/jt|0)+(ht/tr|0)+$t*At,_t[bt--]=wt%jt;_t[bt]=Ft}return Ft?++Ot:_t.splice(0,1),Nt(It,_t,Ot)},et.negated=function(){var It=new Tt(this);return It.s=-It.s||null,It},et.plus=function(It,Dt){var Ft,Ot=this,yt=Ot.s;if(It=new Tt(It,Dt),Dt=It.s,!yt||!Dt)return new Tt(NaN);if(yt!=Dt)return It.s=-Dt,Ot.minus(It);var bt=Ot.e/LOG_BASE,ct=It.e/LOG_BASE,ht=Ot.c,vt=It.c;if(!bt||!ct){if(!ht||!vt)return new Tt(yt/0);if(!ht[0]||!vt[0])return vt[0]?It:new Tt(ht[0]?Ot:yt*0)}if(bt=bitFloor(bt),ct=bitFloor(ct),ht=ht.slice(),yt=bt-ct){for(yt>0?(ct=bt,Ft=vt):(yt=-yt,Ft=ht),Ft.reverse();yt--;Ft.push(0));Ft.reverse()}for(yt=ht.length,Dt=vt.length,yt-Dt<0&&(Ft=vt,vt=ht,ht=Ft,Dt=yt),yt=0;Dt;)yt=(ht[--Dt]=ht[Dt]+vt[Dt]+yt)/BASE|0,ht[Dt]=BASE===ht[Dt]?0:ht[Dt]%BASE;return yt&&(ht=[yt].concat(ht),++ct),Nt(It,ht,ct)},et.precision=et.sd=function(It,Dt){var Ft,Ot,yt,bt=this;if(It!=null&&It!==!!It)return intCheck(It,1,MAX$1),Dt==null?Dt=nt:intCheck(Dt,0,8),zt(new Tt(bt),It,Dt);if(!(Ft=bt.c))return null;if(yt=Ft.length-1,Ot=yt*LOG_BASE+1,yt=Ft[yt]){for(;yt%10==0;yt/=10,Ot--);for(yt=Ft[0];yt>=10;yt/=10,Ot++);}return It&&bt.e+1>Ot&&(Ot=bt.e+1),Ot},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,Dt,Ft,Ot,yt,bt=this,ct=bt.c,ht=bt.s,vt=bt.e,wt=rt+4,At=new Tt("0.5");if(ht!==1||!ct||!ct[0])return new Tt(!ht||ht<0&&(!ct||ct[0])?NaN:ct?bt:1/0);if(ht=Math.sqrt(+Bt(bt)),ht==0||ht==1/0?(Dt=coeffToString(ct),(Dt.length+vt)%2==0&&(Dt+="0"),ht=Math.sqrt(+Dt),vt=bitFloor((vt+1)/2)-(vt<0||vt%2),ht==1/0?Dt="5e"+vt:(Dt=ht.toExponential(),Dt=Dt.slice(0,Dt.indexOf("e")+1)+vt),Ft=new Tt(Dt)):Ft=new Tt(ht+""),Ft.c[0]){for(vt=Ft.e,ht=vt+wt,ht<3&&(ht=0);;)if(yt=Ft,Ft=At.times(yt.plus(a(bt,yt,wt,1))),coeffToString(yt.c).slice(0,ht)===(Dt=coeffToString(Ft.c)).slice(0,ht))if(Ft.e0&&_t>0){for(bt=_t%ht||ht,At=$t.substr(0,bt);bt<_t;bt+=ht)At+=wt+$t.substr(bt,ht);vt>0&&(At+=wt+$t.slice(bt)),Et&&(At="-"+At)}Ot=Rt?At+(Ft.decimalSeparator||"")+((vt=+Ft.fractionGroupSize)?Rt.replace(new RegExp("\\d{"+vt+"}\\B","g"),"$&"+(Ft.fractionGroupSeparator||"")):Rt):At}return(Ft.prefix||"")+Ot+(Ft.suffix||"")},et.toFraction=function(It){var Dt,Ft,Ot,yt,bt,ct,ht,vt,wt,At,Rt,Et,$t=this,_t=$t.c;if(It!=null&&(ht=new Tt(It),!ht.isInteger()&&(ht.c||ht.s!==1)||ht.lt(tt)))throw Error(bignumberError+"Argument "+(ht.isInteger()?"out of range: ":"not an integer: ")+Bt(ht));if(!_t)return new Tt($t);for(Dt=new Tt(tt),wt=Ft=new Tt(tt),Ot=vt=new Tt(tt),Et=coeffToString(_t),bt=Dt.e=Et.length-$t.e-1,Dt.c[0]=POWS_TEN[(ct=bt%LOG_BASE)<0?LOG_BASE+ct:ct],It=!It||ht.comparedTo(Dt)>0?bt>0?Dt:wt:ht,ct=ot,ot=1/0,ht=new Tt(Et),vt.c[0]=0;At=a(ht,Dt,0,1),yt=Ft.plus(At.times(Ot)),yt.comparedTo(It)!=1;)Ft=Ot,Ot=yt,wt=vt.plus(At.times(yt=wt)),vt=yt,Dt=ht.minus(At.times(yt=Dt)),ht=yt;return yt=a(It.minus(Ft),Ot,0,1),vt=vt.plus(yt.times(wt)),Ft=Ft.plus(yt.times(Ot)),vt.s=wt.s=$t.s,bt=bt*2,Rt=a(wt,Ot,bt,nt).minus($t).abs().comparedTo(a(vt,Ft,bt,nt).minus($t).abs())<1?[wt,Ot]:[vt,Ft],ot=ct,Rt},et.toNumber=function(){return+Bt(this)},et.toPrecision=function(It,Dt){return It!=null&&intCheck(It,1,MAX$1),Mt(this,It,Dt,2)},et.toString=function(It){var Dt,Ft=this,Ot=Ft.s,yt=Ft.e;return yt===null?Ot?(Dt="Infinity",Ot<0&&(Dt="-"+Dt)):Dt="NaN":(It==null?Dt=yt<=it||yt>=at?toExponential(coeffToString(Ft.c),yt):toFixedPoint(coeffToString(Ft.c),yt,"0"):It===10&&Pt?(Ft=zt(new Tt(Ft),rt+yt+1,nt),Dt=toFixedPoint(coeffToString(Ft.c),Ft.e,"0")):(intCheck(It,2,Ct.length,"Base"),Dt=$(toFixedPoint(coeffToString(Ft.c),yt,"0"),10,It,Ot,!0)),Ot<0&&Ft.c[0]&&(Dt="-"+Dt)),Dt},et.valueOf=et.toJSON=function(){return Bt(this)},et._isBigNumber=!0,et[Symbol.toStringTag]="BigNumber",et[Symbol.for("nodejs.util.inspect.custom")]=et.valueOf,_!=null&&Tt.set(_),Tt}function bitFloor(_){var a=_|0;return _>0||_===a?a:a-1}function coeffToString(_){for(var a,$,j=1,et=_.length,tt=_[0]+"";jat^$?1:-1;for(nt=(it=et.length)<(at=tt.length)?it:at,rt=0;rttt[rt]^$?1:-1;return it==at?0:it>at^$?1:-1}function intCheck(_,a,$,j){if(_$||_!==mathfloor(_))throw Error(bignumberError+(j||"Argument")+(typeof _=="number"?_$?" out of range: ":" not an integer: ":" not a primitive number: ")+String(_))}function isOdd(_){var a=_.c.length-1;return bitFloor(_.e/LOG_BASE)==a&&_.c[a]%2!=0}function toExponential(_,a){return(_.length>1?_.charAt(0)+"."+_.slice(1):_)+(a<0?"e":"e+")+a}function toFixedPoint(_,a,$){var j,et;if(a<0){for(et=$+".";++a;et+=$);_=et+_}else if(j=_.length,++a>j){for(et=$,a-=j;--a;et+=$);_+=et}else a",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$z={};(function(_){var a=_,$=bnExports$1,j=minimalisticAssert,et=utils$P;a.assert=j,a.toArray=et.toArray,a.zero2=et.zero2,a.toHex=et.toHex,a.encode=et.encode;function tt(st,ot,ut){var dt=new Array(Math.max(st.bitLength(),ut)+1);dt.fill(0);for(var mt=1<(mt>>1)-1?Pt=(mt>>1)-Tt:Pt=Tt,xt.isubn(Pt)):Pt=0,dt[Ct]=Pt,xt.iushrn(1)}return dt}a.getNAF=tt;function rt(st,ot){var ut=[[],[]];st=st.clone(),ot=ot.clone();for(var dt=0,mt=0,xt;st.cmpn(-dt)>0||ot.cmpn(-mt)>0;){var Ct=st.andln(3)+dt&3,Pt=ot.andln(3)+mt&3;Ct===3&&(Ct=-1),Pt===3&&(Pt=-1);var Tt;Ct&1?(xt=st.andln(7)+dt&7,(xt===3||xt===5)&&Pt===2?Tt=-Ct:Tt=Ct):Tt=0,ut[0].push(Tt);var Mt;Pt&1?(xt=ot.andln(7)+mt&7,(xt===3||xt===5)&&Ct===2?Mt=-Pt:Mt=Pt):Mt=0,ut[1].push(Mt),2*dt===Tt+1&&(dt=1-dt),2*mt===Mt+1&&(mt=1-mt),st.iushrn(1),ot.iushrn(1)}return ut}a.getJSF=rt;function nt(st,ot,ut){var dt="_"+ot;st.prototype[ot]=function(){return this[dt]!==void 0?this[dt]:this[dt]=ut.call(this)}}a.cachedProperty=nt;function it(st){return typeof st=="string"?a.toArray(st,"hex"):st}a.parseBytes=it;function at(st){return new $(st,"hex","le")}a.intFromLE=at})(utils$z);var curve$2={},BN$o=bnExports$1,utils$y=utils$z,getNAF$2=utils$y.getNAF,getJSF$2=utils$y.getJSF,assert$t=utils$y.assert;function BaseCurve$2(_,a){this.type=_,this.p=new BN$o(a.p,16),this.red=a.prime?BN$o.red(a.prime):BN$o.mont(this.p),this.zero=new BN$o(0).toRed(this.red),this.one=new BN$o(1).toRed(this.red),this.two=new BN$o(2).toRed(this.red),this.n=a.n&&new BN$o(a.n,16),this.g=a.g&&this.pointFromJSON(a.g,a.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$2=BaseCurve$2;BaseCurve$2.prototype.point=function _(){throw new Error("Not implemented")};BaseCurve$2.prototype.validate=function _(){throw new Error("Not implemented")};BaseCurve$2.prototype._fixedNafMul=function _(a,$){assert$t(a.precomputed);var j=a._getDoubles(),et=getNAF$2($,1,this._bitLength),tt=(1<=nt;at--)it=(it<<1)+et[at];rt.push(it)}for(var st=this.jpoint(null,null,null),ot=this.jpoint(null,null,null),ut=tt;ut>0;ut--){for(nt=0;nt=0;it--){for(var at=0;it>=0&&rt[it]===0;it--)at++;if(it>=0&&at++,nt=nt.dblp(at),it<0)break;var st=rt[it];assert$t(st!==0),a.type==="affine"?st>0?nt=nt.mixedAdd(tt[st-1>>1]):nt=nt.mixedAdd(tt[-st-1>>1].neg()):st>0?nt=nt.add(tt[st-1>>1]):nt=nt.add(tt[-st-1>>1].neg())}return a.type==="affine"?nt.toP():nt};BaseCurve$2.prototype._wnafMulAdd=function _(a,$,j,et,tt){var rt=this._wnafT1,nt=this._wnafT2,it=this._wnafT3,at=0,st,ot,ut;for(st=0;st=1;st-=2){var mt=st-1,xt=st;if(rt[mt]!==1||rt[xt]!==1){it[mt]=getNAF$2(j[mt],rt[mt],this._bitLength),it[xt]=getNAF$2(j[xt],rt[xt],this._bitLength),at=Math.max(it[mt].length,at),at=Math.max(it[xt].length,at);continue}var Ct=[$[mt],null,null,$[xt]];$[mt].y.cmp($[xt].y)===0?(Ct[1]=$[mt].add($[xt]),Ct[2]=$[mt].toJ().mixedAdd($[xt].neg())):$[mt].y.cmp($[xt].y.redNeg())===0?(Ct[1]=$[mt].toJ().mixedAdd($[xt]),Ct[2]=$[mt].add($[xt].neg())):(Ct[1]=$[mt].toJ().mixedAdd($[xt]),Ct[2]=$[mt].toJ().mixedAdd($[xt].neg()));var Pt=[-3,-1,-5,-7,0,7,5,1,3],Tt=getJSF$2(j[mt],j[xt]);for(at=Math.max(Tt[0].length,at),it[mt]=new Array(at),it[xt]=new Array(at),ot=0;ot=0;st--){for(var Bt=0;st>=0;){var It=!0;for(ot=0;ot=0&&Bt++,Nt=Nt.dblp(Bt),st<0)break;for(ot=0;ot0?ut=nt[ot][Dt-1>>1]:Dt<0&&(ut=nt[ot][-Dt-1>>1].neg()),ut.type==="affine"?Nt=Nt.mixedAdd(ut):Nt=Nt.add(ut))}}for(st=0;st=Math.ceil((a.bitLength()+1)/$.step):!1};BasePoint$2.prototype._getDoubles=function _(a,$){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var j=[this],et=this,tt=0;tt<$;tt+=a){for(var rt=0;rt=0&&(dt=at,mt=st),ot.negative&&(ot=ot.neg(),ut=ut.neg()),dt.negative&&(dt=dt.neg(),mt=mt.neg()),[{a:ot,b:ut},{a:dt,b:mt}]};ShortCurve$2.prototype._endoSplit=function _(a){var $=this.endo.basis,j=$[0],et=$[1],tt=et.b.mul(a).divRound(this.n),rt=j.b.neg().mul(a).divRound(this.n),nt=tt.mul(j.a),it=rt.mul(et.a),at=tt.mul(j.b),st=rt.mul(et.b),ot=a.sub(nt).sub(it),ut=at.add(st).neg();return{k1:ot,k2:ut}};ShortCurve$2.prototype.pointFromX=function _(a,$){a=new BN$n(a,16),a.red||(a=a.toRed(this.red));var j=a.redSqr().redMul(a).redIAdd(a.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(a,et)};ShortCurve$2.prototype.validate=function _(a){if(a.inf)return!0;var $=a.x,j=a.y,et=this.a.redMul($),tt=$.redSqr().redMul($).redIAdd(et).redIAdd(this.b);return j.redSqr().redISub(tt).cmpn(0)===0};ShortCurve$2.prototype._endoWnafMulAdd=function _(a,$,j){for(var et=this._endoWnafT1,tt=this._endoWnafT2,rt=0;rt":""};Point$8.prototype.isInfinity=function _(){return this.inf};Point$8.prototype.add=function _(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(this.x.cmp(a.x)===0)return this.curve.point(null,null);var $=this.y.redSub(a.y);$.cmpn(0)!==0&&($=$.redMul(this.x.redSub(a.x).redInvm()));var j=$.redSqr().redISub(this.x).redISub(a.x),et=$.redMul(this.x.redSub(j)).redISub(this.y);return this.curve.point(j,et)};Point$8.prototype.dbl=function _(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(a.cmpn(0)===0)return this.curve.point(null,null);var $=this.curve.a,j=this.x.redSqr(),et=a.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$8.prototype.getX=function _(){return this.x.fromRed()};Point$8.prototype.getY=function _(){return this.y.fromRed()};Point$8.prototype.mul=function _(a){return a=new BN$n(a,16),this.isInfinity()?this:this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)};Point$8.prototype.mulAdd=function _(a,$,j){var et=[this,$],tt=[a,j];return this.curve.endo?this.curve._endoWnafMulAdd(et,tt):this.curve._wnafMulAdd(1,et,tt,2)};Point$8.prototype.jmulAdd=function _(a,$,j){var et=[this,$],tt=[a,j];return this.curve.endo?this.curve._endoWnafMulAdd(et,tt,!0):this.curve._wnafMulAdd(1,et,tt,2,!0)};Point$8.prototype.eq=function _(a){return this===a||this.inf===a.inf&&(this.inf||this.x.cmp(a.x)===0&&this.y.cmp(a.y)===0)};Point$8.prototype.neg=function _(a){if(this.inf)return this;var $=this.curve.point(this.x,this.y.redNeg());if(a&&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$8.prototype.toJ=function _(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a};function JPoint$2(_,a,$,j){Base$8.BasePoint.call(this,_,"jacobian"),a===null&&$===null&&j===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$n(0)):(this.x=new BN$n(a,16),this.y=new BN$n($,16),this.z=new BN$n(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$8(JPoint$2,Base$8.BasePoint);ShortCurve$2.prototype.jpoint=function _(a,$,j){return new JPoint$2(this,a,$,j)};JPoint$2.prototype.toP=function _(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),$=a.redSqr(),j=this.x.redMul($),et=this.y.redMul($).redMul(a);return this.curve.point(j,et)};JPoint$2.prototype.neg=function _(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint$2.prototype.add=function _(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var $=a.z.redSqr(),j=this.z.redSqr(),et=this.x.redMul($),tt=a.x.redMul(j),rt=this.y.redMul($.redMul(a.z)),nt=a.y.redMul(j.redMul(this.z)),it=et.redSub(tt),at=rt.redSub(nt);if(it.cmpn(0)===0)return at.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var st=it.redSqr(),ot=st.redMul(it),ut=et.redMul(st),dt=at.redSqr().redIAdd(ot).redISub(ut).redISub(ut),mt=at.redMul(ut.redISub(dt)).redISub(rt.redMul(ot)),xt=this.z.redMul(a.z).redMul(it);return this.curve.jpoint(dt,mt,xt)};JPoint$2.prototype.mixedAdd=function _(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var $=this.z.redSqr(),j=this.x,et=a.x.redMul($),tt=this.y,rt=a.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 at=nt.redSqr(),st=at.redMul(nt),ot=j.redMul(at),ut=it.redSqr().redIAdd(st).redISub(ot).redISub(ot),dt=it.redMul(ot.redISub(ut)).redISub(tt.redMul(st)),mt=this.z.redMul(nt);return this.curve.jpoint(ut,dt,mt)};JPoint$2.prototype.dblp=function _(a){if(a===0)return this;if(this.isInfinity())return this;if(!a)return this.dbl();var $;if(this.curve.zeroA||this.curve.threeA){var j=this;for($=0;$=0)return!1;if(j.redIAdd(tt),this.x.cmp(j)===0)return!0}};JPoint$2.prototype.inspect=function _(){return this.isInfinity()?"":""};JPoint$2.prototype.isInfinity=function _(){return this.z.cmpn(0)===0};var BN$m=bnExports$1,inherits$7=inherits_browserExports,Base$7=base$2,utils$w=utils$z;function MontCurve$2(_){Base$7.call(this,"mont",_),this.a=new BN$m(_.a,16).toRed(this.red),this.b=new BN$m(_.b,16).toRed(this.red),this.i4=new BN$m(4).toRed(this.red).redInvm(),this.two=new BN$m(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$7(MontCurve$2,Base$7);var mont$2=MontCurve$2;MontCurve$2.prototype.validate=function _(a){var $=a.normalize().x,j=$.redSqr(),et=j.redMul($).redAdd(j.redMul(this.a)).redAdd($),tt=et.redSqrt();return tt.redSqr().cmp(et)===0};function Point$7(_,a,$){Base$7.BasePoint.call(this,_,"projective"),a===null&&$===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$m(a,16),this.z=new BN$m($,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$7(Point$7,Base$7.BasePoint);MontCurve$2.prototype.decodePoint=function _(a,$){return this.point(utils$w.toArray(a,$),1)};MontCurve$2.prototype.point=function _(a,$){return new Point$7(this,a,$)};MontCurve$2.prototype.pointFromJSON=function _(a){return Point$7.fromJSON(this,a)};Point$7.prototype.precompute=function _(){};Point$7.prototype._encode=function _(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$7.fromJSON=function _(a,$){return new Point$7(a,$[0],$[1]||a.one)};Point$7.prototype.inspect=function _(){return this.isInfinity()?"":""};Point$7.prototype.isInfinity=function _(){return this.z.cmpn(0)===0};Point$7.prototype.dbl=function _(){var a=this.x.redAdd(this.z),$=a.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$7.prototype.add=function _(){throw new Error("Not supported on Montgomery curve")};Point$7.prototype.diffAdd=function _(a,$){var j=this.x.redAdd(this.z),et=this.x.redSub(this.z),tt=a.x.redAdd(a.z),rt=a.x.redSub(a.z),nt=rt.redMul(j),it=tt.redMul(et),at=$.z.redMul(nt.redAdd(it).redSqr()),st=$.x.redMul(nt.redISub(it).redSqr());return this.curve.point(at,st)};Point$7.prototype.mul=function _(a){for(var $=a.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$7.prototype.mulAdd=function _(){throw new Error("Not supported on Montgomery curve")};Point$7.prototype.jumlAdd=function _(){throw new Error("Not supported on Montgomery curve")};Point$7.prototype.eq=function _(a){return this.getX().cmp(a.getX())===0};Point$7.prototype.normalize=function _(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$7.prototype.getX=function _(){return this.normalize(),this.x.fromRed()};var utils$v=utils$z,BN$l=bnExports$1,inherits$6=inherits_browserExports,Base$6=base$2,assert$r=utils$v.assert;function EdwardsCurve$2(_){this.twisted=(_.a|0)!==1,this.mOneA=this.twisted&&(_.a|0)===-1,this.extended=this.mOneA,Base$6.call(this,"edwards",_),this.a=new BN$l(_.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$l(_.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$l(_.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$r(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(_.c|0)===1}inherits$6(EdwardsCurve$2,Base$6);var edwards$2=EdwardsCurve$2;EdwardsCurve$2.prototype._mulA=function _(a){return this.mOneA?a.redNeg():this.a.redMul(a)};EdwardsCurve$2.prototype._mulC=function _(a){return this.oneC?a:this.c.redMul(a)};EdwardsCurve$2.prototype.jpoint=function _(a,$,j,et){return this.point(a,$,j,et)};EdwardsCurve$2.prototype.pointFromX=function _(a,$){a=new BN$l(a,16),a.red||(a=a.toRed(this.red));var j=a.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(a,nt)};EdwardsCurve$2.prototype.pointFromY=function _(a,$){a=new BN$l(a,16),a.red||(a=a.toRed(this.red));var j=a.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,a)}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,a)};EdwardsCurve$2.prototype.validate=function _(a){if(a.isInfinity())return!0;a.normalize();var $=a.x.redSqr(),j=a.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$6(_,a,$,j,et){Base$6.BasePoint.call(this,_,"projective"),a===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$l(a,16),this.y=new BN$l($,16),this.z=j?new BN$l(j,16):this.curve.one,this.t=et&&new BN$l(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$6(Point$6,Base$6.BasePoint);EdwardsCurve$2.prototype.pointFromJSON=function _(a){return Point$6.fromJSON(this,a)};EdwardsCurve$2.prototype.point=function _(a,$,j,et){return new Point$6(this,a,$,j,et)};Point$6.fromJSON=function _(a,$){return new Point$6(a,$[0],$[1],$[2])};Point$6.prototype.inspect=function _(){return this.isInfinity()?"":""};Point$6.prototype.isInfinity=function _(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point$6.prototype._extDbl=function _(){var a=this.x.redSqr(),$=this.y.redSqr(),j=this.z.redSqr();j=j.redIAdd(j);var et=this.curve._mulA(a),tt=this.x.redAdd(this.y).redSqr().redISub(a).redISub($),rt=et.redAdd($),nt=rt.redSub(j),it=et.redSub($),at=tt.redMul(nt),st=rt.redMul(it),ot=tt.redMul(it),ut=nt.redMul(rt);return this.curve.point(at,st,ut,ot)};Point$6.prototype._projDbl=function _(){var a=this.x.redAdd(this.y).redSqr(),$=this.x.redSqr(),j=this.y.redSqr(),et,tt,rt,nt,it,at;if(this.curve.twisted){nt=this.curve._mulA($);var st=nt.redAdd(j);this.zOne?(et=a.redSub($).redSub(j).redMul(st.redSub(this.curve.two)),tt=st.redMul(nt.redSub(j)),rt=st.redSqr().redSub(st).redSub(st)):(it=this.z.redSqr(),at=st.redSub(it).redISub(it),et=a.redSub($).redISub(j).redMul(at),tt=st.redMul(nt.redSub(j)),rt=st.redMul(at))}else nt=$.redAdd(j),it=this.curve._mulC(this.z).redSqr(),at=nt.redSub(it).redSub(it),et=this.curve._mulC(a.redISub(nt)).redMul(at),tt=this.curve._mulC(nt).redMul($.redISub(j)),rt=nt.redMul(at);return this.curve.point(et,tt,rt)};Point$6.prototype.dbl=function _(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point$6.prototype._extAdd=function _(a){var $=this.y.redSub(this.x).redMul(a.y.redSub(a.x)),j=this.y.redAdd(this.x).redMul(a.y.redAdd(a.x)),et=this.t.redMul(this.curve.dd).redMul(a.t),tt=this.z.redMul(a.z.redAdd(a.z)),rt=j.redSub($),nt=tt.redSub(et),it=tt.redAdd(et),at=j.redAdd($),st=rt.redMul(nt),ot=it.redMul(at),ut=rt.redMul(at),dt=nt.redMul(it);return this.curve.point(st,ot,dt,ut)};Point$6.prototype._projAdd=function _(a){var $=this.z.redMul(a.z),j=$.redSqr(),et=this.x.redMul(a.x),tt=this.y.redMul(a.y),rt=this.curve.d.redMul(et).redMul(tt),nt=j.redSub(rt),it=j.redAdd(rt),at=this.x.redAdd(this.y).redMul(a.x.redAdd(a.y)).redISub(et).redISub(tt),st=$.redMul(nt).redMul(at),ot,ut;return this.curve.twisted?(ot=$.redMul(it).redMul(tt.redSub(this.curve._mulA(et))),ut=nt.redMul(it)):(ot=$.redMul(it).redMul(tt.redSub(et)),ut=this.curve._mulC(nt).redMul(it)),this.curve.point(st,ot,ut)};Point$6.prototype.add=function _(a){return this.isInfinity()?a:a.isInfinity()?this:this.curve.extended?this._extAdd(a):this._projAdd(a)};Point$6.prototype.mul=function _(a){return this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve._wnafMul(this,a)};Point$6.prototype.mulAdd=function _(a,$,j){return this.curve._wnafMulAdd(1,[this,$],[a,j],2,!1)};Point$6.prototype.jmulAdd=function _(a,$,j){return this.curve._wnafMulAdd(1,[this,$],[a,j],2,!0)};Point$6.prototype.normalize=function _(){if(this.zOne)return this;var a=this.z.redInvm();return this.x=this.x.redMul(a),this.y=this.y.redMul(a),this.t&&(this.t=this.t.redMul(a)),this.z=this.curve.one,this.zOne=!0,this};Point$6.prototype.neg=function _(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point$6.prototype.getX=function _(){return this.normalize(),this.x.fromRed()};Point$6.prototype.getY=function _(){return this.normalize(),this.y.fromRed()};Point$6.prototype.eq=function _(a){return this===a||this.getX().cmp(a.getX())===0&&this.getY().cmp(a.getY())===0};Point$6.prototype.eqXToP=function _(a){var $=a.toRed(this.curve.red).redMul(this.z);if(this.x.cmp($)===0)return!0;for(var j=a.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$6.prototype.toP=Point$6.prototype.normalize;Point$6.prototype.mixedAdd=Point$6.prototype.add;(function(_){var a=_;a.base=base$2,a.short=short$2,a.mont=mont$2,a.edwards=edwards$2})(curve$2);var curves$8={},secp256k1$2,hasRequiredSecp256k1$2;function requireSecp256k1$2(){return hasRequiredSecp256k1$2||(hasRequiredSecp256k1$2=1,secp256k1$2={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$2}(function(_){var a=_,$=hash$8,j=curve$2,et=utils$z,tt=et.assert;function rt(at){at.type==="short"?this.curve=new j.short(at):at.type==="edwards"?this.curve=new j.edwards(at):this.curve=new j.mont(at),this.g=this.curve.g,this.n=this.curve.n,this.hash=at.hash,tt(this.g.validate(),"Invalid curve"),tt(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}a.PresetCurve=rt;function nt(at,st){Object.defineProperty(a,at,{configurable:!0,enumerable:!0,get:function(){var ot=new rt(st);return Object.defineProperty(a,at,{configurable:!0,enumerable:!0,value:ot}),ot}})}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$2()}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$8);var BN$k=bnExports$1,utils$u=utils$z,assert$q=utils$u.assert;function KeyPair$b(_,a){this.ec=_,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}var key$5=KeyPair$b;KeyPair$b.fromPublic=function _(a,$,j){return $ instanceof KeyPair$b?$:new KeyPair$b(a,{pub:$,pubEnc:j})};KeyPair$b.fromPrivate=function _(a,$,j){return $ instanceof KeyPair$b?$:new KeyPair$b(a,{priv:$,privEnc:j})};KeyPair$b.prototype.validate=function _(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.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$b.prototype.getPublic=function _(a,$){return typeof a=="string"&&($=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),$?this.pub.encode($,a):this.pub};KeyPair$b.prototype.getPrivate=function _(a){return a==="hex"?this.priv.toString(16,2):this.priv};KeyPair$b.prototype._importPrivate=function _(a,$){this.priv=new BN$k(a,$||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair$b.prototype._importPublic=function _(a,$){if(a.x||a.y){this.ec.curve.type==="mont"?assert$q(a.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$q(a.x&&a.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(a.x,a.y);return}this.pub=this.ec.curve.decodePoint(a,$)};KeyPair$b.prototype.derive=function _(a){return a.validate()||assert$q(a.validate(),"public point not validated"),a.mul(this.priv).getX()};KeyPair$b.prototype.sign=function _(a,$,j){return this.ec.sign(a,this,$,j)};KeyPair$b.prototype.verify=function _(a,$){return this.ec.verify(a,$,this)};KeyPair$b.prototype.inspect=function _(){return""};var BN$j=bnExports$1,utils$t=utils$z,assert$p=utils$t.assert;function Signature$b(_,a){if(_ instanceof Signature$b)return _;this._importDER(_,a)||(assert$p(_.r&&_.s,"Signature without r or s"),this.r=new BN$j(_.r,16),this.s=new BN$j(_.s,16),_.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=_.recoveryParam)}var signature$5=Signature$b;function Position$2(){this.place=0}function getLength$2(_,a){var $=_[a.place++];if(!($&128))return $;var j=$&15;if(j===0||j>4)return!1;for(var et=0,tt=0,rt=a.place;tt>>=0;return et<=127?!1:(a.place=rt,et)}function rmPadding$2(_){for(var a=0,$=_.length-1;!_[a]&&!(_[a+1]&128)&&a<$;)a++;return a===0?_:_.slice(a)}Signature$b.prototype._importDER=function _(a,$){a=utils$t.toArray(a,$);var j=new Position$2;if(a[j.place++]!==48)return!1;var et=getLength$2(a,j);if(et===!1||et+j.place!==a.length||a[j.place++]!==2)return!1;var tt=getLength$2(a,j);if(tt===!1)return!1;var rt=a.slice(j.place,tt+j.place);if(j.place+=tt,a[j.place++]!==2)return!1;var nt=getLength$2(a,j);if(nt===!1||a.length!==nt+j.place)return!1;var it=a.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$j(rt),this.s=new BN$j(it),this.recoveryParam=null,!0};function constructLength$2(_,a){if(a<128){_.push(a);return}var $=1+(Math.log(a)/Math.LN2>>>3);for(_.push($|128);--$;)_.push(a>>>($<<3)&255);_.push(a)}Signature$b.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$2($),j=rmPadding$2(j);!j[0]&&!(j[1]&128);)j=j.slice(1);var et=[2];constructLength$2(et,$.length),et=et.concat($),et.push(2),constructLength$2(et,j.length);var tt=et.concat(j),rt=[48];return constructLength$2(rt,tt.length),rt=rt.concat(tt),utils$t.encode(rt,a)};var BN$i=bnExports$1,HmacDRBG$2=hmacDrbg,utils$s=utils$z,curves$7=curves$8,rand$2=requireBrorand(),assert$o=utils$s.assert,KeyPair$a=key$5,Signature$a=signature$5;function EC$2(_){if(!(this instanceof EC$2))return new EC$2(_);typeof _=="string"&&(assert$o(Object.prototype.hasOwnProperty.call(curves$7,_),"Unknown curve "+_),_=curves$7[_]),_ instanceof curves$7.PresetCurve&&(_={curve:_}),this.curve=_.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=_.curve.g,this.g.precompute(_.curve.n.bitLength()+1),this.hash=_.hash||_.curve.hash}var ec$5=EC$2;EC$2.prototype.keyPair=function _(a){return new KeyPair$a(this,a)};EC$2.prototype.keyFromPrivate=function _(a,$){return KeyPair$a.fromPrivate(this,a,$)};EC$2.prototype.keyFromPublic=function _(a,$){return KeyPair$a.fromPublic(this,a,$)};EC$2.prototype.genKeyPair=function _(a){a||(a={});for(var $=new HmacDRBG$2({hash:this.hash,pers:a.pers,persEnc:a.persEnc||"utf8",entropy:a.entropy||rand$2(this.hash.hmacStrength),entropyEnc:a.entropy&&a.entropyEnc||"utf8",nonce:this.n.toArray()}),j=this.n.byteLength(),et=this.n.sub(new BN$i(2));;){var tt=new BN$i($.generate(j));if(!(tt.cmp(et)>0))return tt.iaddn(1),this.keyFromPrivate(tt)}};EC$2.prototype._truncateToN=function _(a,$){var j=a.byteLength()*8-this.n.bitLength();return j>0&&(a=a.ushrn(j)),!$&&a.cmp(this.n)>=0?a.sub(this.n):a};EC$2.prototype.sign=function _(a,$,j,et){typeof j=="object"&&(et=j,j=null),et||(et={}),$=this.keyFromPrivate($,j),a=this._truncateToN(new BN$i(a,16));for(var tt=this.n.byteLength(),rt=$.getPrivate().toArray("be",tt),nt=a.toArray("be",tt),it=new HmacDRBG$2({hash:this.hash,entropy:rt,nonce:nt,pers:et.pers,persEnc:et.persEnc||"utf8"}),at=this.n.sub(new BN$i(1)),st=0;;st++){var ot=et.k?et.k(st):new BN$i(it.generate(this.n.byteLength()));if(ot=this._truncateToN(ot,!0),!(ot.cmpn(1)<=0||ot.cmp(at)>=0)){var ut=this.g.mul(ot);if(!ut.isInfinity()){var dt=ut.getX(),mt=dt.umod(this.n);if(mt.cmpn(0)!==0){var xt=ot.invm(this.n).mul(mt.mul($.getPrivate()).iadd(a));if(xt=xt.umod(this.n),xt.cmpn(0)!==0){var Ct=(ut.getY().isOdd()?1:0)|(dt.cmp(mt)!==0?2:0);return et.canonical&&xt.cmp(this.nh)>0&&(xt=this.n.sub(xt),Ct^=1),new Signature$a({r:mt,s:xt,recoveryParam:Ct})}}}}}};EC$2.prototype.verify=function _(a,$,j,et){a=this._truncateToN(new BN$i(a,16)),j=this.keyFromPublic(j,et),$=new Signature$a($,"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(a).umod(this.n),at=nt.mul(tt).umod(this.n),st;return this.curve._maxwellTrick?(st=this.g.jmulAdd(it,j.getPublic(),at),st.isInfinity()?!1:st.eqXToP(tt)):(st=this.g.mulAdd(it,j.getPublic(),at),st.isInfinity()?!1:st.getX().umod(this.n).cmp(tt)===0)};EC$2.prototype.recoverPubKey=function(_,a,$,j){assert$o((3&$)===$,"The recovery param is more than two bits"),a=new Signature$a(a,j);var et=this.n,tt=new BN$i(_),rt=a.r,nt=a.s,it=$&1,at=$>>1;if(rt.cmp(this.curve.p.umod(this.curve.n))>=0&&at)throw new Error("Unable to find sencond key candinate");at?rt=this.curve.pointFromX(rt.add(this.curve.n),it):rt=this.curve.pointFromX(rt,it);var st=a.r.invm(et),ot=et.sub(tt).mul(st).umod(et),ut=nt.mul(st).umod(et);return this.g.mulAdd(ot,rt,ut)};EC$2.prototype.getKeyRecoveryParam=function(_,a,$,j){if(a=new Signature$a(a,j),a.recoveryParam!==null)return a.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$r=utils$z,assert$n=utils$r.assert,parseBytes$9=utils$r.parseBytes,cachedProperty$5=utils$r.cachedProperty;function KeyPair$9(_,a){this.eddsa=_,this._secret=parseBytes$9(a.secret),_.isPoint(a.pub)?this._pub=a.pub:this._pubBytes=parseBytes$9(a.pub)}KeyPair$9.fromPublic=function _(a,$){return $ instanceof KeyPair$9?$:new KeyPair$9(a,{pub:$})};KeyPair$9.fromSecret=function _(a,$){return $ instanceof KeyPair$9?$:new KeyPair$9(a,{secret:$})};KeyPair$9.prototype.secret=function _(){return this._secret};cachedProperty$5(KeyPair$9,"pubBytes",function _(){return this.eddsa.encodePoint(this.pub())});cachedProperty$5(KeyPair$9,"pub",function _(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$5(KeyPair$9,"privBytes",function _(){var a=this.eddsa,$=this.hash(),j=a.encodingLength-1,et=$.slice(0,a.encodingLength);return et[0]&=248,et[j]&=127,et[j]|=64,et});cachedProperty$5(KeyPair$9,"priv",function _(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$5(KeyPair$9,"hash",function _(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$5(KeyPair$9,"messagePrefix",function _(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$9.prototype.sign=function _(a){return assert$n(this._secret,"KeyPair can only verify"),this.eddsa.sign(a,this)};KeyPair$9.prototype.verify=function _(a,$){return this.eddsa.verify(a,$,this)};KeyPair$9.prototype.getSecret=function _(a){return assert$n(this._secret,"KeyPair is public only"),utils$r.encode(this.secret(),a)};KeyPair$9.prototype.getPublic=function _(a){return utils$r.encode(this.pubBytes(),a)};var key$4=KeyPair$9,BN$h=bnExports$1,utils$q=utils$z,assert$m=utils$q.assert,cachedProperty$4=utils$q.cachedProperty,parseBytes$8=utils$q.parseBytes;function Signature$9(_,a){this.eddsa=_,typeof a!="object"&&(a=parseBytes$8(a)),Array.isArray(a)&&(a={R:a.slice(0,_.encodingLength),S:a.slice(_.encodingLength)}),assert$m(a.R&&a.S,"Signature without R or S"),_.isPoint(a.R)&&(this._R=a.R),a.S instanceof BN$h&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}cachedProperty$4(Signature$9,"S",function _(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty$4(Signature$9,"R",function _(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty$4(Signature$9,"Rencoded",function _(){return this.eddsa.encodePoint(this.R())});cachedProperty$4(Signature$9,"Sencoded",function _(){return this.eddsa.encodeInt(this.S())});Signature$9.prototype.toBytes=function _(){return this.Rencoded().concat(this.Sencoded())};Signature$9.prototype.toHex=function _(){return utils$q.encode(this.toBytes(),"hex").toUpperCase()};var signature$4=Signature$9,hash$5=hash$8,curves$6=curves$8,utils$p=utils$z,assert$l=utils$p.assert,parseBytes$7=utils$p.parseBytes,KeyPair$8=key$4,Signature$8=signature$4;function EDDSA$2(_){if(assert$l(_==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA$2))return new EDDSA$2(_);_=curves$6[_].curve,this.curve=_,this.g=_.g,this.g.precompute(_.n.bitLength()+1),this.pointClass=_.point().constructor,this.encodingLength=Math.ceil(_.n.bitLength()/8),this.hash=hash$5.sha512}var eddsa$2=EDDSA$2;EDDSA$2.prototype.sign=function _(a,$){a=parseBytes$7(a);var j=this.keyFromSecret($),et=this.hashInt(j.messagePrefix(),a),tt=this.g.mul(et),rt=this.encodePoint(tt),nt=this.hashInt(rt,j.pubBytes(),a).mul(j.priv()),it=et.add(nt).umod(this.curve.n);return this.makeSignature({R:tt,S:it,Rencoded:rt})};EDDSA$2.prototype.verify=function _(a,$,j){a=parseBytes$7(a),$=this.makeSignature($);var et=this.keyFromPublic(j),tt=this.hashInt($.Rencoded(),et.pubBytes(),a),rt=this.g.mul($.S()),nt=$.R().add(et.pub().mul(tt));return nt.eq(rt)};EDDSA$2.prototype.hashInt=function _(){for(var a=this.hash(),$=0;$bs58check$1.decode(_).slice(a.length);function b58decode(_){const a=bs58check$1.decode(_),j={[prefix.tz1.toString()]:"0000",[prefix.tz2.toString()]:"0001",[prefix.tz3.toString()]:"0002"}[new Uint8Array(a.slice(0,3)).toString()];if(j){const et=buf2hex(a.slice(3));return j+et}else return"01"+buf2hex(a.slice(3,42))+"00"}function encodeAddress(_){if(_.substring(0,2)==="0x"&&(_=_.slice(2)),_.substring(0,2)==="00"){const a={"0000":prefix.tz1,"0001":prefix.tz2,"0002":prefix.tz3};return b58cencode(_.substring(4),a[_.substring(0,4)])}return b58cencode(_.substring(2,42),prefix.KT)}function encodeKey(_){if(_[0]==="0"){const a={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return b58cencode(_.substring(2),a[_.substring(0,2)])}}function encodeKeyHash(_){if(_[0]==="0"){const a={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return b58cencode(_.substring(2),a[_.substring(0,2)])}}const hex2buf=_=>{if(_.length%2!==0)throw new InvalidHexStringError(_,": Expecting even number of characters");const a=stripHexPrefix$1(_);if(!a.match(/^([\da-f]{2})*$/gi))throw new InvalidHexStringError(_,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const $=new Uint8Array(a.length/2);let j=0;for(let et=0;et{const $=new Uint8Array(_.length+a.length);return $.set(_),$.set(a,_.length),$},buf2hex=_=>{const a=[];return _.forEach($=>{const et=`00${$.toString(16)}`.slice(-2);a.push(et)}),a.join("")};function hex2Bytes(_){const a=stripHexPrefix$1(_);if(!a.match(/^(0x)?([\da-f]{2})*$/gi))throw new InvalidHexStringError(_,": Expecting even number of characters: 0-9, a-z, A-Z, optionally prefixed with 0x");return buffer$1.Buffer.from(a,"hex")}function stripHexPrefix$1(_){return _.startsWith("0x")?_.slice(2):_}var util;(function(_){_.assertEqual=et=>et;function a(et){}_.assertIs=a;function $(et){throw new Error}_.assertNever=$,_.arrayToEnum=et=>{const tt={};for(const rt of et)tt[rt]=rt;return tt},_.getValidEnumValues=et=>{const tt=_.objectKeys(et).filter(nt=>typeof et[et[nt]]!="number"),rt={};for(const nt of tt)rt[nt]=et[nt];return _.objectValues(rt)},_.objectValues=et=>_.objectKeys(et).map(function(tt){return et[tt]}),_.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},_.find=(et,tt)=>{for(const rt of et)if(tt(rt))return rt},_.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)}_.joinValues=j,_.jsonStringifyReplacer=(et,tt)=>typeof tt=="bigint"?tt.toString():tt})(util||(util={}));var objectUtil;(function(_){_.mergeShapes=(a,$)=>({...a,...$})})(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=_=>{switch(typeof _){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(_)?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(_)?ZodParsedType.array:_===null?ZodParsedType.null:_.then&&typeof _.then=="function"&&_.catch&&typeof _.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&_ instanceof Map?ZodParsedType.map:typeof Set<"u"&&_ instanceof Set?ZodParsedType.set:typeof Date<"u"&&_ 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=_=>JSON.stringify(_,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(a){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=a}get errors(){return this.issues}format(a){const $=a||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(a(et))):j.push(a(et));return{formErrors:j,fieldErrors:$}}get formErrors(){return this.flatten()}}ZodError.create=_=>new ZodError(_);const errorMap=(_,a)=>{let $;switch(_.code){case ZodIssueCode.invalid_type:_.received===ZodParsedType.undefined?$="Required":$=`Expected ${_.expected}, received ${_.received}`;break;case ZodIssueCode.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(_.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:$=`Unrecognized key(s) in object: ${util.joinValues(_.keys,", ")}`;break;case ZodIssueCode.invalid_union:$="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${util.joinValues(_.options)}`;break;case ZodIssueCode.invalid_enum_value:$=`Invalid enum value. Expected ${util.joinValues(_.options)}, received '${_.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 _.validation=="object"?"includes"in _.validation?($=`Invalid input: must include "${_.validation.includes}"`,typeof _.validation.position=="number"&&($=`${$} at one or more positions greater than or equal to ${_.validation.position}`)):"startsWith"in _.validation?$=`Invalid input: must start with "${_.validation.startsWith}"`:"endsWith"in _.validation?$=`Invalid input: must end with "${_.validation.endsWith}"`:util.assertNever(_.validation):_.validation!=="regex"?$=`Invalid ${_.validation}`:$="Invalid";break;case ZodIssueCode.too_small:_.type==="array"?$=`Array must contain ${_.exact?"exactly":_.inclusive?"at least":"more than"} ${_.minimum} element(s)`:_.type==="string"?$=`String must contain ${_.exact?"exactly":_.inclusive?"at least":"over"} ${_.minimum} character(s)`:_.type==="number"?$=`Number must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${_.minimum}`:_.type==="date"?$=`Date must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(_.minimum))}`:$="Invalid input";break;case ZodIssueCode.too_big:_.type==="array"?$=`Array must contain ${_.exact?"exactly":_.inclusive?"at most":"less than"} ${_.maximum} element(s)`:_.type==="string"?$=`String must contain ${_.exact?"exactly":_.inclusive?"at most":"under"} ${_.maximum} character(s)`:_.type==="number"?$=`Number must be ${_.exact?"exactly":_.inclusive?"less than or equal to":"less than"} ${_.maximum}`:_.type==="bigint"?$=`BigInt must be ${_.exact?"exactly":_.inclusive?"less than or equal to":"less than"} ${_.maximum}`:_.type==="date"?$=`Date must be ${_.exact?"exactly":_.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(_.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 ${_.multipleOf}`;break;case ZodIssueCode.not_finite:$="Number must be finite";break;default:$=a.defaultError,util.assertNever(_)}return{message:$}};let overrideErrorMap=errorMap;function setErrorMap(_){overrideErrorMap=_}function getErrorMap(){return overrideErrorMap}const makeIssue=_=>{const{data:a,path:$,errorMaps:j,issueData:et}=_,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(at=>!!at).slice().reverse();for(const at of it)nt=at(rt,{data:a,defaultError:nt}).message;return{...et,path:tt,message:nt}},EMPTY_PATH=[];function addIssueToContext(_,a){const $=getErrorMap(),j=makeIssue({issueData:a,data:_.data,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,$,$===errorMap?void 0:errorMap].filter(et=>!!et)});_.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(a,$){const j=[];for(const et of $){if(et.status==="aborted")return INVALID;et.status==="dirty"&&a.dirty(),j.push(et.value)}return{status:a.value,value:j}}static async mergeObjectAsync(a,$){const j=[];for(const et of $){const tt=await et.key,rt=await et.value;j.push({key:tt,value:rt})}return ParseStatus.mergeObjectSync(a,j)}static mergeObjectSync(a,$){const j={};for(const et of $){const{key:tt,value:rt}=et;if(tt.status==="aborted"||rt.status==="aborted")return INVALID;tt.status==="dirty"&&a.dirty(),rt.status==="dirty"&&a.dirty(),tt.value!=="__proto__"&&(typeof rt.value<"u"||et.alwaysSet)&&(j[tt.value]=rt.value)}return{status:a.value,value:j}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=_=>({status:"dirty",value:_}),OK=_=>({status:"valid",value:_}),isAborted=_=>_.status==="aborted",isDirty=_=>_.status==="dirty",isValid$1=_=>_.status==="valid",isAsync=_=>typeof Promise<"u"&&_ instanceof Promise;function __classPrivateFieldGet$1(_,a,$,j){if(typeof a=="function"?_!==a||!j:!a.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a.get(_)}function __classPrivateFieldSet$1(_,a,$,j,et){if(typeof a=="function"?_!==a||!et:!a.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a.set(_,$),$}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(_){_.errToObj=a=>typeof a=="string"?{message:a}:a||{},_.toString=a=>typeof a=="string"?a:a==null?void 0:a.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(a,$,j,et){this._cachedPath=[],this.parent=a,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(a))return{success:!0,data:a.value};if(!_.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(_.common.issues);return this._error=$,this._error}}};function processCreateParams(_){if(!_)return{};const{errorMap:a,invalid_type_error:$,required_error:j,description:et}=_;if(a&&($||j))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return a?{errorMap:a,description:et}:{errorMap:(rt,nt)=>{var it,at;const{message:st}=_;return rt.code==="invalid_enum_value"?{message:st??nt.defaultError}:typeof nt.data>"u"?{message:(it=st??j)!==null&&it!==void 0?it:nt.defaultError}:rt.code!=="invalid_type"?{message:nt.defaultError}:{message:(at=st??$)!==null&&at!==void 0?at:nt.defaultError}},description:et}}class ZodType{constructor(a){this.spa=this.safeParseAsync,this._def=a,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(a){return getParsedType(a.data)}_getOrReturnCtx(a,$){return $||{common:a.parent.common,data:a.data,parsedType:getParsedType(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}_processInputParams(a){return{status:new ParseStatus,ctx:{common:a.parent.common,data:a.data,parsedType:getParsedType(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}}_parseSync(a){const $=this._parse(a);if(isAsync($))throw new Error("Synchronous parse encountered promise.");return $}_parseAsync(a){const $=this._parse(a);return Promise.resolve($)}parse(a,$){const j=this.safeParse(a,$);if(j.success)return j.data;throw j.error}safeParse(a,$){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:a,parsedType:getParsedType(a)},tt=this._parseSync({data:a,path:et.path,parent:et});return handleResult(et,tt)}async parseAsync(a,$){const j=await this.safeParseAsync(a,$);if(j.success)return j.data;throw j.error}async safeParseAsync(a,$){const j={common:{issues:[],contextualErrorMap:$==null?void 0:$.errorMap,async:!0},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:getParsedType(a)},et=this._parse({data:a,path:j.path,parent:j}),tt=await(isAsync(et)?et:Promise.resolve(et));return handleResult(j,tt)}refine(a,$){const j=et=>typeof $=="string"||typeof $>"u"?{message:$}:typeof $=="function"?$(et):$;return this._refinement((et,tt)=>{const rt=a(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(a,$){return this._refinement((j,et)=>a(j)?!0:(et.addIssue(typeof $=="function"?$(j,et):$),!1))}_refinement(a){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:a}})}superRefine(a){return this._refinement(a)}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(a){return ZodUnion.create([this,a],this._def)}and(a){return ZodIntersection.create(this,a,this._def)}transform(a){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:a}})}default(a){const $=typeof a=="function"?a:()=>a;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(a){const $=typeof a=="function"?a:()=>a;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:$,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(a){const $=this.constructor;return new $({...this._def,description:a})}pipe(a){return ZodPipeline.create(this,a)}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(_){let a="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return _.precision?a=`${a}\\.\\d{${_.precision}}`:_.precision==null&&(a=`${a}(\\.\\d+)?`),a}function timeRegex(_){return new RegExp(`^${timeRegexSource(_)}$`)}function datetimeRegex(_){let a=`${dateRegexSource}T${timeRegexSource(_)}`;const $=[];return $.push(_.local?"Z?":"Z"),_.offset&&$.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${$.join("|")})`,new RegExp(`^${a}$`)}function isValidIP(_,a){return!!((a==="v4"||!a)&&ipv4Regex.test(_)||(a==="v6"||!a)&&ipv6Regex.test(_))}class ZodString extends ZodType{_parse(a){if(this._def.coerce&&(a.data=String(a.data)),this._getType(a)!==ZodParsedType.string){const tt=this._getOrReturnCtx(a);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")a.data.lengthtt.value&&(et=this._getOrReturnCtx(a,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=a.data.length>tt.value,nt=a.data.lengtha.test(et),{validation:$,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(j)})}_addCheck(a){return new ZodString({...this._def,checks:[...this._def.checks,a]})}email(a){return this._addCheck({kind:"email",...errorUtil.errToObj(a)})}url(a){return this._addCheck({kind:"url",...errorUtil.errToObj(a)})}emoji(a){return this._addCheck({kind:"emoji",...errorUtil.errToObj(a)})}uuid(a){return this._addCheck({kind:"uuid",...errorUtil.errToObj(a)})}nanoid(a){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(a)})}cuid(a){return this._addCheck({kind:"cuid",...errorUtil.errToObj(a)})}cuid2(a){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(a)})}ulid(a){return this._addCheck({kind:"ulid",...errorUtil.errToObj(a)})}base64(a){return this._addCheck({kind:"base64",...errorUtil.errToObj(a)})}ip(a){return this._addCheck({kind:"ip",...errorUtil.errToObj(a)})}datetime(a){var $,j;return typeof a=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:a}):this._addCheck({kind:"datetime",precision:typeof(a==null?void 0:a.precision)>"u"?null:a==null?void 0:a.precision,offset:($=a==null?void 0:a.offset)!==null&&$!==void 0?$:!1,local:(j=a==null?void 0:a.local)!==null&&j!==void 0?j:!1,...errorUtil.errToObj(a==null?void 0:a.message)})}date(a){return this._addCheck({kind:"date",message:a})}time(a){return typeof a=="string"?this._addCheck({kind:"time",precision:null,message:a}):this._addCheck({kind:"time",precision:typeof(a==null?void 0:a.precision)>"u"?null:a==null?void 0:a.precision,...errorUtil.errToObj(a==null?void 0:a.message)})}duration(a){return this._addCheck({kind:"duration",...errorUtil.errToObj(a)})}regex(a,$){return this._addCheck({kind:"regex",regex:a,...errorUtil.errToObj($)})}includes(a,$){return this._addCheck({kind:"includes",value:a,position:$==null?void 0:$.position,...errorUtil.errToObj($==null?void 0:$.message)})}startsWith(a,$){return this._addCheck({kind:"startsWith",value:a,...errorUtil.errToObj($)})}endsWith(a,$){return this._addCheck({kind:"endsWith",value:a,...errorUtil.errToObj($)})}min(a,$){return this._addCheck({kind:"min",value:a,...errorUtil.errToObj($)})}max(a,$){return this._addCheck({kind:"max",value:a,...errorUtil.errToObj($)})}length(a,$){return this._addCheck({kind:"length",value:a,...errorUtil.errToObj($)})}nonempty(a){return this.min(1,errorUtil.errToObj(a))}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(a=>a.kind==="datetime")}get isDate(){return!!this._def.checks.find(a=>a.kind==="date")}get isTime(){return!!this._def.checks.find(a=>a.kind==="time")}get isDuration(){return!!this._def.checks.find(a=>a.kind==="duration")}get isEmail(){return!!this._def.checks.find(a=>a.kind==="email")}get isURL(){return!!this._def.checks.find(a=>a.kind==="url")}get isEmoji(){return!!this._def.checks.find(a=>a.kind==="emoji")}get isUUID(){return!!this._def.checks.find(a=>a.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(a=>a.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(a=>a.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(a=>a.kind==="cuid2")}get isULID(){return!!this._def.checks.find(a=>a.kind==="ulid")}get isIP(){return!!this._def.checks.find(a=>a.kind==="ip")}get isBase64(){return!!this._def.checks.find(a=>a.kind==="base64")}get minLength(){let a=null;for(const $ of this._def.checks)$.kind==="min"&&(a===null||$.value>a)&&(a=$.value);return a}get maxLength(){let a=null;for(const $ of this._def.checks)$.kind==="max"&&(a===null||$.value{var a;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(a=_==null?void 0:_.coerce)!==null&&a!==void 0?a:!1,...processCreateParams(_)})};function floatSafeRemainder(_,a){const $=(_.toString().split(".")[1]||"").length,j=(a.toString().split(".")[1]||"").length,et=$>j?$:j,tt=parseInt(_.toFixed(et).replace(".","")),rt=parseInt(a.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(a){if(this._def.coerce&&(a.data=Number(a.data)),this._getType(a)!==ZodParsedType.number){const tt=this._getOrReturnCtx(a);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(a.data)||(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:tt.message}),et.dirty()):tt.kind==="min"?(tt.inclusive?a.datatt.value:a.data>=tt.value)&&(j=this._getOrReturnCtx(a,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(a.data,tt.value)!==0&&(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:tt.value,message:tt.message}),et.dirty()):tt.kind==="finite"?Number.isFinite(a.data)||(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.not_finite,message:tt.message}),et.dirty()):util.assertNever(tt);return{status:et.value,value:a.data}}gte(a,$){return this.setLimit("min",a,!0,errorUtil.toString($))}gt(a,$){return this.setLimit("min",a,!1,errorUtil.toString($))}lte(a,$){return this.setLimit("max",a,!0,errorUtil.toString($))}lt(a,$){return this.setLimit("max",a,!1,errorUtil.toString($))}setLimit(a,$,j,et){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:a,value:$,inclusive:j,message:errorUtil.toString(et)}]})}_addCheck(a){return new ZodNumber({...this._def,checks:[...this._def.checks,a]})}int(a){return this._addCheck({kind:"int",message:errorUtil.toString(a)})}positive(a){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(a)})}negative(a){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(a)})}multipleOf(a,$){return this._addCheck({kind:"multipleOf",value:a,message:errorUtil.toString($)})}finite(a){return this._addCheck({kind:"finite",message:errorUtil.toString(a)})}safe(a){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(a)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(a)})}get minValue(){let a=null;for(const $ of this._def.checks)$.kind==="min"&&(a===null||$.value>a)&&(a=$.value);return a}get maxValue(){let a=null;for(const $ of this._def.checks)$.kind==="max"&&(a===null||$.valuea.kind==="int"||a.kind==="multipleOf"&&util.isInteger(a.value))}get isFinite(){let a=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"&&(a===null||j.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(_==null?void 0:_.coerce)||!1,...processCreateParams(_)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(a){if(this._def.coerce&&(a.data=BigInt(a.data)),this._getType(a)!==ZodParsedType.bigint){const tt=this._getOrReturnCtx(a);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?a.datatt.value:a.data>=tt.value)&&(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.too_big,type:"bigint",maximum:tt.value,inclusive:tt.inclusive,message:tt.message}),et.dirty()):tt.kind==="multipleOf"?a.data%tt.value!==BigInt(0)&&(j=this._getOrReturnCtx(a,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:tt.value,message:tt.message}),et.dirty()):util.assertNever(tt);return{status:et.value,value:a.data}}gte(a,$){return this.setLimit("min",a,!0,errorUtil.toString($))}gt(a,$){return this.setLimit("min",a,!1,errorUtil.toString($))}lte(a,$){return this.setLimit("max",a,!0,errorUtil.toString($))}lt(a,$){return this.setLimit("max",a,!1,errorUtil.toString($))}setLimit(a,$,j,et){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:a,value:$,inclusive:j,message:errorUtil.toString(et)}]})}_addCheck(a){return new ZodBigInt({...this._def,checks:[...this._def.checks,a]})}positive(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(a)})}negative(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(a)})}multipleOf(a,$){return this._addCheck({kind:"multipleOf",value:a,message:errorUtil.toString($)})}get minValue(){let a=null;for(const $ of this._def.checks)$.kind==="min"&&(a===null||$.value>a)&&(a=$.value);return a}get maxValue(){let a=null;for(const $ of this._def.checks)$.kind==="max"&&(a===null||$.value{var a;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(a=_==null?void 0:_.coerce)!==null&&a!==void 0?a:!1,...processCreateParams(_)})};class ZodBoolean extends ZodType{_parse(a){if(this._def.coerce&&(a.data=!!a.data),this._getType(a)!==ZodParsedType.boolean){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:j.parsedType}),INVALID}return OK(a.data)}}ZodBoolean.create=_=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(_==null?void 0:_.coerce)||!1,...processCreateParams(_)});class ZodDate extends ZodType{_parse(a){if(this._def.coerce&&(a.data=new Date(a.data)),this._getType(a)!==ZodParsedType.date){const tt=this._getOrReturnCtx(a);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:tt.parsedType}),INVALID}if(isNaN(a.data.getTime())){const tt=this._getOrReturnCtx(a);return addIssueToContext(tt,{code:ZodIssueCode.invalid_date}),INVALID}const j=new ParseStatus;let et;for(const tt of this._def.checks)tt.kind==="min"?a.data.getTime()tt.value&&(et=this._getOrReturnCtx(a,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(a.data.getTime())}}_addCheck(a){return new ZodDate({...this._def,checks:[...this._def.checks,a]})}min(a,$){return this._addCheck({kind:"min",value:a.getTime(),message:errorUtil.toString($)})}max(a,$){return this._addCheck({kind:"max",value:a.getTime(),message:errorUtil.toString($)})}get minDate(){let a=null;for(const $ of this._def.checks)$.kind==="min"&&(a===null||$.value>a)&&(a=$.value);return a!=null?new Date(a):null}get maxDate(){let a=null;for(const $ of this._def.checks)$.kind==="max"&&(a===null||$.valuenew ZodDate({checks:[],coerce:(_==null?void 0:_.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(_)});class ZodSymbol extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.symbol){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:j.parsedType}),INVALID}return OK(a.data)}}ZodSymbol.create=_=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(_)});class ZodUndefined extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:j.parsedType}),INVALID}return OK(a.data)}}ZodUndefined.create=_=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(_)});class ZodNull extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.null){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:j.parsedType}),INVALID}return OK(a.data)}}ZodNull.create=_=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(_)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(a){return OK(a.data)}}ZodAny.create=_=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(_)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(a){return OK(a.data)}}ZodUnknown.create=_=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(_)});class ZodNever extends ZodType{_parse(a){const $=this._getOrReturnCtx(a);return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:$.parsedType}),INVALID}}ZodNever.create=_=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(_)});class ZodVoid extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:j.parsedType}),INVALID}return OK(a.data)}}ZodVoid.create=_=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(_)});class ZodArray extends ZodType{_parse(a){const{ctx:$,status:j}=this._processInputParams(a),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(a,$){return new ZodArray({...this._def,minLength:{value:a,message:errorUtil.toString($)}})}max(a,$){return new ZodArray({...this._def,maxLength:{value:a,message:errorUtil.toString($)}})}length(a,$){return new ZodArray({...this._def,exactLength:{value:a,message:errorUtil.toString($)}})}nonempty(a){return this.min(1,a)}}ZodArray.create=(_,a)=>new ZodArray({type:_,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(a)});function deepPartialify(_){if(_ instanceof ZodObject){const a={};for(const $ in _.shape){const j=_.shape[$];a[$]=ZodOptional.create(deepPartialify(j))}return new ZodObject({..._._def,shape:()=>a})}else return _ instanceof ZodArray?new ZodArray({..._._def,type:deepPartialify(_.element)}):_ instanceof ZodOptional?ZodOptional.create(deepPartialify(_.unwrap())):_ instanceof ZodNullable?ZodNullable.create(deepPartialify(_.unwrap())):_ instanceof ZodTuple?ZodTuple.create(_.items.map(a=>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 a=this._def.shape(),$=util.objectKeys(a);return this._cached={shape:a,keys:$}}_parse(a){if(this._getType(a)!==ZodParsedType.object){const at=this._getOrReturnCtx(a);return addIssueToContext(at,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:at.parsedType}),INVALID}const{status:j,ctx:et}=this._processInputParams(a),{shape:tt,keys:rt}=this._getCached(),nt=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const at in et.data)rt.includes(at)||nt.push(at);const it=[];for(const at of rt){const st=tt[at],ot=et.data[at];it.push({key:{status:"valid",value:at},value:st._parse(new ParseInputLazyPath(et,ot,et.path,at)),alwaysSet:at in et.data})}if(this._def.catchall instanceof ZodNever){const at=this._def.unknownKeys;if(at==="passthrough")for(const st of nt)it.push({key:{status:"valid",value:st},value:{status:"valid",value:et.data[st]}});else if(at==="strict")nt.length>0&&(addIssueToContext(et,{code:ZodIssueCode.unrecognized_keys,keys:nt}),j.dirty());else if(at!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const at=this._def.catchall;for(const st of nt){const ot=et.data[st];it.push({key:{status:"valid",value:st},value:at._parse(new ParseInputLazyPath(et,ot,et.path,st)),alwaysSet:st in et.data})}}return et.common.async?Promise.resolve().then(async()=>{const at=[];for(const st of it){const ot=await st.key,ut=await st.value;at.push({key:ot,value:ut,alwaysSet:st.alwaysSet})}return at}).then(at=>ParseStatus.mergeObjectSync(j,at)):ParseStatus.mergeObjectSync(j,it)}get shape(){return this._def.shape()}strict(a){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...a!==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(a).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(a){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...a})})}merge(a){return new ZodObject({unknownKeys:a._def.unknownKeys,catchall:a._def.catchall,shape:()=>({...this._def.shape(),...a._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(a,$){return this.augment({[a]:$})}catchall(a){return new ZodObject({...this._def,catchall:a})}pick(a){const $={};return util.objectKeys(a).forEach(j=>{a[j]&&this.shape[j]&&($[j]=this.shape[j])}),new ZodObject({...this._def,shape:()=>$})}omit(a){const $={};return util.objectKeys(this.shape).forEach(j=>{a[j]||($[j]=this.shape[j])}),new ZodObject({...this._def,shape:()=>$})}deepPartial(){return deepPartialify(this)}partial(a){const $={};return util.objectKeys(this.shape).forEach(j=>{const et=this.shape[j];a&&!a[j]?$[j]=et:$[j]=et.optional()}),new ZodObject({...this._def,shape:()=>$})}required(a){const $={};return util.objectKeys(this.shape).forEach(j=>{if(a&&!a[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:()=>_,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});ZodObject.strictCreate=(_,a)=>new ZodObject({shape:()=>_,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});ZodObject.lazycreate=(_,a)=>new ZodObject({shape:_,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});class ZodUnion extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a),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 at={...$,common:{...$.common,issues:[]},parent:null},st=it._parseSync({data:$.data,path:$.path,parent:at});if(st.status==="valid")return st;st.status==="dirty"&&!tt&&(tt={result:st,ctx:at}),at.common.issues.length&&rt.push(at.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:_,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(a)});const getDiscriminator=_=>_ instanceof ZodLazy?getDiscriminator(_.schema):_ instanceof ZodEffects?getDiscriminator(_.innerType()):_ instanceof ZodLiteral?[_.value]:_ instanceof ZodEnum?_.options:_ instanceof ZodNativeEnum?util.objectValues(_.enum):_ instanceof ZodDefault?getDiscriminator(_._def.innerType):_ instanceof ZodUndefined?[void 0]:_ instanceof ZodNull?[null]:_ instanceof ZodOptional?[void 0,...getDiscriminator(_.unwrap())]:_ instanceof ZodNullable?[null,...getDiscriminator(_.unwrap())]:_ instanceof ZodBranded||_ instanceof ZodReadonly?getDiscriminator(_.unwrap()):_ instanceof ZodCatch?getDiscriminator(_._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a);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(a,$,j){const et=new Map;for(const tt of $){const rt=getDiscriminator(tt.shape[a]);if(!rt.length)throw new Error(`A discriminator value for key \`${a}\` could not be extracted from all schema options`);for(const nt of rt){if(et.has(nt))throw new Error(`Discriminator property ${String(a)} has duplicate value ${String(nt)}`);et.set(nt,tt)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:a,options:$,optionsMap:et,...processCreateParams(j)})}}function mergeValues(_,a){const $=getParsedType(_),j=getParsedType(a);if(_===a)return{valid:!0,data:_};if($===ZodParsedType.object&&j===ZodParsedType.object){const et=util.objectKeys(a),tt=util.objectKeys(_).filter(nt=>et.indexOf(nt)!==-1),rt={..._,...a};for(const nt of tt){const it=mergeValues(_[nt],a[nt]);if(!it.valid)return{valid:!1};rt[nt]=it.data}return{valid:!0,data:rt}}else if($===ZodParsedType.array&&j===ZodParsedType.array){if(_.length!==a.length)return{valid:!1};const et=[];for(let tt=0;tt<_.length;tt++){const rt=_[tt],nt=a[tt],it=mergeValues(rt,nt);if(!it.valid)return{valid:!1};et.push(it.data)}return{valid:!0,data:et}}else return $===ZodParsedType.date&&j===ZodParsedType.date&&+_==+a?{valid:!0,data:_}:{valid:!1}}class ZodIntersection extends ZodType{_parse(a){const{status:$,ctx:j}=this._processInputParams(a),et=(tt,rt)=>{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:_,right:a,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams($)});class ZodTuple extends ZodType{_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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(a){return new ZodTuple({...this._def,rest:a})}}ZodTuple.create=(_,a)=>{if(!Array.isArray(_))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:_,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(a)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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(a,$,j){return $ instanceof ZodType?new ZodRecord({keyType:a,valueType:$,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(j)}):new ZodRecord({keyType:ZodString.create(),valueType:a,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams($)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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],at)=>({key:et._parse(new ParseInputLazyPath(j,nt,j.path,[at,"key"])),value:tt._parse(new ParseInputLazyPath(j,it,j.path,[at,"value"]))}));if(j.common.async){const nt=new Map;return Promise.resolve().then(async()=>{for(const it of rt){const at=await it.key,st=await it.value;if(at.status==="aborted"||st.status==="aborted")return INVALID;(at.status==="dirty"||st.status==="dirty")&&$.dirty(),nt.set(at.value,st.value)}return{status:$.value,value:nt}})}else{const nt=new Map;for(const it of rt){const at=it.key,st=it.value;if(at.status==="aborted"||st.status==="aborted")return INVALID;(at.status==="dirty"||st.status==="dirty")&&$.dirty(),nt.set(at.value,st.value)}return{status:$.value,value:nt}}}}ZodMap.create=(_,a,$)=>new ZodMap({valueType:a,keyType:_,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams($)});class ZodSet extends ZodType{_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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 at=new Set;for(const st of it){if(st.status==="aborted")return INVALID;st.status==="dirty"&&$.dirty(),at.add(st.value)}return{status:$.value,value:at}}const nt=[...j.data.values()].map((it,at)=>tt._parse(new ParseInputLazyPath(j,it,j.path,at)));return j.common.async?Promise.all(nt).then(it=>rt(it)):rt(nt)}min(a,$){return new ZodSet({...this._def,minSize:{value:a,message:errorUtil.toString($)}})}max(a,$){return new ZodSet({...this._def,maxSize:{value:a,message:errorUtil.toString($)}})}size(a,$){return this.min(a,$).max(a,$)}nonempty(a){return this.min(1,a)}}ZodSet.create=(_,a)=>new ZodSet({valueType:_,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(a)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(a){const{ctx:$}=this._processInputParams(a);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(at=>!!at),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:it}})}function et(nt,it){return makeIssue({data:nt,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,getErrorMap(),errorMap].filter(at=>!!at),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 at=new ZodError([]),st=await nt._def.args.parseAsync(it,tt).catch(dt=>{throw at.addIssue(j(it,dt)),at}),ot=await Reflect.apply(rt,this,st);return await nt._def.returns._def.type.parseAsync(ot,tt).catch(dt=>{throw at.addIssue(et(ot,dt)),at})})}else{const nt=this;return OK(function(...it){const at=nt._def.args.safeParse(it,tt);if(!at.success)throw new ZodError([j(it,at.error)]);const st=Reflect.apply(rt,this,at.data),ot=nt._def.returns.safeParse(st,tt);if(!ot.success)throw new ZodError([et(st,ot.error)]);return ot.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...a){return new ZodFunction({...this._def,args:ZodTuple.create(a).rest(ZodUnknown.create())})}returns(a){return new ZodFunction({...this._def,returns:a})}implement(a){return this.parse(a)}strictImplement(a){return this.parse(a)}static create(a,$,j){return new ZodFunction({args:a||ZodTuple.create([]).rest(ZodUnknown.create()),returns:$||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(j)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(a){const{ctx:$}=this._processInputParams(a);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}}ZodLazy.create=(_,a)=>new ZodLazy({getter:_,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(a)});class ZodLiteral extends ZodType{_parse(a){if(a.data!==this._def.value){const $=this._getOrReturnCtx(a);return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:a.data}}get value(){return this._def.value}}ZodLiteral.create=(_,a)=>new ZodLiteral({value:_,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(a)});function createZodEnum(_,a){return new ZodEnum({values:_,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(a)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(a){if(typeof a.data!="string"){const $=this._getOrReturnCtx(a),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(a.data)){const $=this._getOrReturnCtx(a),j=this._def.values;return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_enum_value,options:j}),INVALID}return OK(a.data)}get options(){return this._def.values}get enum(){const a={};for(const $ of this._def.values)a[$]=$;return a}get Values(){const a={};for(const $ of this._def.values)a[$]=$;return a}get Enum(){const a={};for(const $ of this._def.values)a[$]=$;return a}extract(a,$=this._def){return ZodEnum.create(a,{...this._def,...$})}exclude(a,$=this._def){return ZodEnum.create(this.options.filter(j=>!a.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(a){const $=util.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(a);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(a.data)){const et=util.objectValues($);return addIssueToContext(j,{received:j.data,code:ZodIssueCode.invalid_enum_value,options:et}),INVALID}return OK(a.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(_,a)=>new ZodNativeEnum({values:_,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(a)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(a){const{ctx:$}=this._processInputParams(a);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:_,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(a)});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(a){const{status:$,ctx:j}=this._processInputParams(a),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:_,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:a,...processCreateParams($)});ZodEffects.createWithPreprocess=(_,a,$)=>new ZodEffects({schema:a,effect:{type:"preprocess",transform:_},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams($)});class ZodOptional extends ZodType{_parse(a){return this._getType(a)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}ZodOptional.create=(_,a)=>new ZodOptional({innerType:_,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(a)});class ZodNullable extends ZodType{_parse(a){return this._getType(a)===ZodParsedType.null?OK(null):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}ZodNullable.create=(_,a)=>new ZodNullable({innerType:_,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(a)});class ZodDefault extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a);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:_,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof a.default=="function"?a.default:()=>a.default,...processCreateParams(a)});class ZodCatch extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a),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:_,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof a.catch=="function"?a.catch:()=>a.catch,...processCreateParams(a)});class ZodNaN extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.nan){const j=this._getOrReturnCtx(a);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:j.parsedType}),INVALID}return{status:"valid",value:a.data}}}ZodNaN.create=_=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(_)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(a){const{ctx:$}=this._processInputParams(a),j=$.data;return this._def.type._parse({data:j,path:$.path,parent:$})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(a){const{status:$,ctx:j}=this._processInputParams(a);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(a,$){return new ZodPipeline({in:a,out:$,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(a){const $=this._def.innerType._parse(a),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:_,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(a)});function custom(_,a={},$){return _?ZodAny.create().superRefine((j,et)=>{var tt,rt;if(!_(j)){const nt=typeof a=="function"?a(j):typeof a=="string"?{message:a}:a,it=(rt=(tt=nt.fatal)!==null&&tt!==void 0?tt:$)!==null&&rt!==void 0?rt:!0,at=typeof nt=="string"?{message:nt}:nt;et.addIssue({code:"custom",...at,fatal:it})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(_){_.ZodString="ZodString",_.ZodNumber="ZodNumber",_.ZodNaN="ZodNaN",_.ZodBigInt="ZodBigInt",_.ZodBoolean="ZodBoolean",_.ZodDate="ZodDate",_.ZodSymbol="ZodSymbol",_.ZodUndefined="ZodUndefined",_.ZodNull="ZodNull",_.ZodAny="ZodAny",_.ZodUnknown="ZodUnknown",_.ZodNever="ZodNever",_.ZodVoid="ZodVoid",_.ZodArray="ZodArray",_.ZodObject="ZodObject",_.ZodUnion="ZodUnion",_.ZodDiscriminatedUnion="ZodDiscriminatedUnion",_.ZodIntersection="ZodIntersection",_.ZodTuple="ZodTuple",_.ZodRecord="ZodRecord",_.ZodMap="ZodMap",_.ZodSet="ZodSet",_.ZodFunction="ZodFunction",_.ZodLazy="ZodLazy",_.ZodLiteral="ZodLiteral",_.ZodEnum="ZodEnum",_.ZodEffects="ZodEffects",_.ZodNativeEnum="ZodNativeEnum",_.ZodOptional="ZodOptional",_.ZodNullable="ZodNullable",_.ZodDefault="ZodDefault",_.ZodCatch="ZodCatch",_.ZodPromise="ZodPromise",_.ZodBranded="ZodBranded",_.ZodPipeline="ZodPipeline",_.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(_,a={message:`Input not instance of ${_.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:_=>ZodString.create({..._,coerce:!0}),number:_=>ZodNumber.create({..._,coerce:!0}),boolean:_=>ZodBoolean.create({..._,coerce:!0}),bigint:_=>ZodBigInt.create({..._,coerce:!0}),date:_=>ZodDate.create({..._,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=_=>{if(isValidContractPkh(_))return parseContractPkh(_);if(isValidImplicitPkh(_))return parseImplicitPkh(_);throw new Error(`Cannot parse address type: ${_}`)},isAddressValid=_=>validateAddress(_)===ValidationResult.VALID,isValidContractPkh=_=>isAddressValid(_)&&_.match(/^KT1\w+/),isValidImplicitPkh=_=>isAddressValid(_)&&_.match(/^tz[1234]\w+/),parseContractPkh=_=>{if(isValidContractPkh(_))return{type:"contract",pkh:_};throw new Error(`Invalid contract address: ${_}`)},parseImplicitPkh=_=>{if(isValidImplicitPkh(_))return{type:"implicit",pkh:_};throw new Error(`Invalid implicit address: ${_}`)},encodeReserved=[encodeURIComponent,encodeURIComponent];function encode$3(_,a=","){const $=(j,et)=>{const tt=_[et%_.length];return typeof j>"u"?"":typeof j=="object"?Array.isArray(j)?j.map(tt).join(a):Object.entries(j).reduce((nt,it)=>[...nt,...it],[]).map(tt).join(a):tt(String(j))};return(j,...et)=>j.reduce((tt,rt,nt)=>`${tt}${rt}${$(et[nt],nt)}`,"")}function delimited(_=","){return(a,$=encodeReserved)=>Object.entries(a).filter(([,j])=>j!==void 0).map(([j,et])=>encode$3($,_)`${j}=${et}`).join("&")}function stripUndefined(_){return _&&JSON.parse(JSON.stringify(_))}function joinUrl(..._){return _.filter(Boolean).map((a,$)=>$===0?a:a.replace(/^\/+/,"")).map((a,$,j)=>$===j.length-1?a:a.replace(/\/+$/,"")).join("/")}function query(..._){const a=_.filter(Boolean).join("&");return a&&`?${a}`}function explode(_,a=encodeReserved){const $=encode$3(a);return Object.entries(_).filter(([,j])=>j!==void 0).map(([j,et])=>Array.isArray(et)?et.map(tt=>$`${j}=${tt}`).join("&"):typeof et=="object"?explode(et,a):$`${j}=${et}`).join("&")}const form=delimited(),SUCCESS_CODES=[200,201,202,204];async function ok(_){const a=await _;if(SUCCESS_CODES.some($=>$==a.status))return a.data;throw new HttpError(a.status,a.data)}class HttpError extends Error{constructor($,j){super(`Error: ${$}`);Yr(this,"status");Yr(this,"data");this.status=$,this.data=j}}function runtime$1(_){async function a(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:at,data:st}=await a(tt,{...rt,headers:{Accept:"application/json",...rt.headers}});return(at?at.includes("json"):!1)?{status:nt,headers:it,data:st?JSON.parse(st):null}:{status:nt,headers:it,data:st}}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:at,...st}={..._,...rt},ot=joinUrl(nt,tt);return await(at||fetch)(ot,{...st,headers:stripUndefined({..._.headers,...it})})}return{ok,fetchText:a,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(_.formDataConstructor||rt.formDataConstructor||FormData);return Object.entries(tt).forEach(([it,at])=>{nt.append(it,at)}),{...rt,body:nt}}}}const jsonParameter=(_,a)=>{if(!a)return{};const $={};return Object.entries(a).forEach(([j,et])=>{if(!(et instanceof Object))throw new Error(`Expected ${_} value to be object, received ${typeof et}`);const{jsonPath:tt,jsonValue:rt}=et;if(rt==null)throw new Error(`Expected jsonValue in ${_} -> ${j}, found: ${rt}`);const it=[_,tt,j].filter(at=>at!==void 0).join(".");$[it]=rt}),$},anyofParameter=(_,a)=>{if(!a)return{};const{fields:$}=a;(rt=>{if(!Array.isArray(rt))throw new Error(`Expected ${_} fields to be Array. Received ${typeof rt}.`);return rt.forEach(nt=>{if(typeof nt!="string")throw new Error(`Expected ${_} fields to be strings. Received ${typeof nt}`)}),!0})($);const et={},tt=$.join(".");if(a.value){const rt=`${_}.${tt}`;et[rt]=a.value}for(const rt of["in","eq","null"])if(a[rt]){const nt=`${_}.${tt}.${rt}`;return et[nt]=Array.isArray(a[rt])?a[rt].join(","):a[rt],et}return et},queryParameter=(_,a)=>{if(!a)return{};const $={};return Object.entries(a).forEach(([j,et])=>{const tt=`${_}.${j}`;$[tt]=et}),$},parsers={jsonParameter,queryParameter,anyofParameter},defaults={baseUrl:"https://api.tzkt.io"},oazapfts=runtime$1(defaults);function blocksGet({baker:_,anyof:a,proposer:$,producer:j,level:et,timestamp:tt,priority:rt,blockRound:nt,select:it,sort:at,offset:st,limit:ot,quote:ut}={},dt){return oazapfts.ok(oazapfts.fetchJson(`/v1/blocks${query(explode({limit:ot,quote:ut,...parsers.queryParameter("baker",_),...parsers.anyofParameter("anyof",a),...parsers.queryParameter("proposer",$),...parsers.queryParameter("producer",j),...parsers.queryParameter("level",et),...parsers.queryParameter("timestamp",tt),...parsers.queryParameter("priority",rt),...parsers.queryParameter("blockRound",nt),...parsers.queryParameter("select",it),...parsers.queryParameter("sort",at),...parsers.queryParameter("offset",st)}))}`,{...dt}))}function contractsGet({address:_,kind:a,tzips:$,creator:j,manager:et,delegate:tt,balance:rt,lastActivity:nt,typeHash:it,codeHash:at,select:st,sort:ot,offset:ut,limit:dt,includeStorage:mt}={},xt){return oazapfts.ok(oazapfts.fetchJson(`/v1/contracts${query(explode({limit:dt,includeStorage:mt,...parsers.queryParameter("address",_),...parsers.queryParameter("kind",a),...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",at),...parsers.queryParameter("select",st),...parsers.queryParameter("sort",ot),...parsers.queryParameter("offset",ut)}))}`,{...xt}))}function delegatesGet({active:_,lastActivity:a,select:$,sort:j,offset:et,limit:tt}={},rt){return oazapfts.ok(oazapfts.fetchJson(`/v1/delegates${query(explode({limit:tt,...parsers.queryParameter("active",_),...parsers.queryParameter("lastActivity",a),...parsers.queryParameter("select",$),...parsers.queryParameter("sort",j),...parsers.queryParameter("offset",et)}))}`,{...rt}))}function operationsGetDelegations({anyof:_,initiator:a,sender:$,prevDelegate:j,newDelegate:et,level:tt,timestamp:rt,senderCodeHash:nt,status:it,select:at,sort:st,offset:ot,limit:ut,quote:dt}={},mt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/delegations${query(explode({limit:ut,quote:dt,...parsers.anyofParameter("anyof",_),...parsers.queryParameter("initiator",a),...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",at),...parsers.queryParameter("sort",st),...parsers.queryParameter("offset",ot)}))}`,{...mt}))}function operationsGetOriginations({anyof:_,initiator:a,sender:$,contractManager:j,contractDelegate:et,originatedContract:tt,id:rt,typeHash:nt,codeHash:it,level:at,timestamp:st,senderCodeHash:ot,anyCodeHash:ut,status:dt,select:mt,sort:xt,offset:Ct,limit:Pt,micheline:Tt,quote:Mt}={},Lt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/originations${query(explode({limit:Pt,micheline:Tt,quote:Mt,...parsers.anyofParameter("anyof",_),...parsers.queryParameter("initiator",a),...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",at),...parsers.queryParameter("timestamp",st),...parsers.queryParameter("senderCodeHash",ot),...parsers.queryParameter("anyCodeHash",ut),...parsers.queryParameter("status",dt),...parsers.queryParameter("select",mt),...parsers.queryParameter("sort",xt),...parsers.queryParameter("offset",Ct)}))}`,{...Lt}))}function operationsGetTransactions({anyof:_,initiator:a,sender:$,target:j,amount:et,id:tt,level:rt,timestamp:nt,senderCodeHash:it,targetCodeHash:at,codeHash:st,entrypoint:ot,parameter:ut,hasInternals:dt,status:mt,select:xt,sort:Ct,offset:Pt,limit:Tt,micheline:Mt,quote:Lt}={},Nt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/transactions${query(explode({limit:Tt,micheline:Mt,quote:Lt,...parsers.anyofParameter("anyof",_),...parsers.queryParameter("initiator",a),...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",at),...parsers.queryParameter("codeHash",st),...parsers.queryParameter("entrypoint",ot),...parsers.jsonParameter("parameter",ut),...parsers.queryParameter("hasInternals",dt),...parsers.queryParameter("status",mt),...parsers.queryParameter("select",xt),...parsers.queryParameter("sort",Ct),...parsers.queryParameter("offset",Pt)}))}`,{...Nt}))}function quotesGetLast(_){return oazapfts.ok(oazapfts.fetchJson("/v1/quotes/last",{..._}))}function tokensGetTokenBalances({id:_,account:a,tokenId:$,tokenContract:j,tokenTokenId:et,tokenStandard:tt,tokenMetadata:rt,tokenHasFilters:nt,balance:it,firstLevel:at,firstTime:st,lastLevel:ot,lastTime:ut,indexedAt:dt,sort:mt,offset:xt,limit:Ct,select:Pt}={},Tt){return oazapfts.ok(oazapfts.fetchJson(`/v1/tokens/balances${query(explode({"token.HasFilters":nt,limit:Ct,...parsers.queryParameter("id",_),...parsers.queryParameter("account",a),...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",at),...parsers.queryParameter("firstTime",st),...parsers.queryParameter("lastLevel",ot),...parsers.queryParameter("lastTime",ut),...parsers.queryParameter("indexedAt",dt),...parsers.queryParameter("sort",mt),...parsers.queryParameter("offset",xt),...parsers.queryParameter("select",Pt)}))}`,{...Tt}))}function tokensGetTokenTransfers({id:_,level:a,timestamp:$,tokenId:j,tokenContract:et,tokenTokenId:tt,tokenStandard:rt,tokenMetadata:nt,tokenHasFilters:it,anyof:at,$from:st,to:ot,amount:ut,transactionId:dt,originationId:mt,migrationId:xt,indexedAt:Ct,sort:Pt,offset:Tt,limit:Mt,select:Lt}={},Nt){return oazapfts.ok(oazapfts.fetchJson(`/v1/tokens/transfers${query(explode({"token.HasFilters":it,limit:Mt,...parsers.queryParameter("id",_),...parsers.queryParameter("level",a),...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",at),...parsers.queryParameter("from",st),...parsers.queryParameter("to",ot),...parsers.queryParameter("amount",ut),...parsers.queryParameter("transactionId",dt),...parsers.queryParameter("originationId",mt),...parsers.queryParameter("migrationId",xt),...parsers.queryParameter("indexedAt",Ct),...parsers.queryParameter("sort",Pt),...parsers.queryParameter("offset",Tt),...parsers.queryParameter("select",Lt)}))}`,{...Nt}))}let e$1=class{constructor(a){this.queue=void 0,this.maxConcurrent=void 0,this.count=void 0,this.queue=[],this.maxConcurrent=a,this.count=0}get canAcquire(){return this.countthis.queue.push(a))}release(){const a=this.queue.shift();a?setTimeout(a,0):this.count--}};const t$4="_default";class s{constructor(a=1){this.semaphoreInstances=void 0,this.maxConcurrent=void 0,this.semaphoreInstances={},this.maxConcurrent=a}hasSemaphoreInstance(a=t$4){return!!this.semaphoreInstances[a]}getSemaphoreInstance(a=t$4){return this.hasSemaphoreInstance(a)||(this.semaphoreInstances[a]=new e$1(this.maxConcurrent)),this.semaphoreInstances[a]}tidy(a=t$4){this.hasSemaphoreInstance(a)&&this.getSemaphoreInstance(a).count===0&&delete this.semaphoreInstances[a]}canAcquire(a=t$4){return this.getSemaphoreInstance(a).canAcquire}acquire(a=t$4){return this.getSemaphoreInstance(a).acquire()}release(a=t$4){this.getSemaphoreInstance(a).release(),this.tidy(a)}count(a=t$4){return this.hasSemaphoreInstance(a)?this.getSemaphoreInstance(a).count:0}hasTasks(a=t$4){return this.count(a)>0}async request(a,$=t$4){try{return await this.acquire($),await a()}finally{this.release($)}}async requestIfAvailable(a,$=t$4){return this.canAcquire($)?this.request(a,$):null}}function assign(_,a){for(const $ in a)Object.defineProperty(_,$,{value:a[$],enumerable:!0,configurable:!0});return _}function createError(_,a,$){if(!_||typeof _=="string")throw new TypeError("Please pass an Error to err-code");$||($={}),typeof a=="object"&&($=a,a=void 0),a!=null&&($.code=a);try{return assign(_,$)}catch{$.message=_.message,$.stack=_.stack;const et=function(){};return et.prototype=Object.create(Object.getPrototypeOf(_)),assign(new et,$)}}var errCode=createError,retry$3={};function RetryOperation(_,a){typeof a=="boolean"&&(a={forever:a}),this._originalTimeouts=JSON.parse(JSON.stringify(_)),this._timeouts=_,this._options=a||{},this._maxRetryTime=a&&a.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(_){if(this._timeout&&clearTimeout(this._timeout),!_)return!1;var a=new Date().getTime();if(_&&a-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(_);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&&(a.timeout&&(this._operationTimeout=a.timeout),a.cb&&(this._operationTimeoutCb=a.cb));var $=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){$._operationTimeoutCb()},$._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(_){console.log("Using RetryOperation.try() is deprecated"),this.attempt(_)};RetryOperation.prototype.start=function(_){console.log("Using RetryOperation.start() is deprecated"),this.attempt(_)};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=$&&(a=et,$=rt)}return a};(function(_){var a=retry_operation;_.operation=function($){var j=_.timeouts($);return new a(j,{forever:$&&$.forever,unref:$&&$.unref,maxRetryTime:$&&$.maxRetryTime})},_.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(a),{retries:3,minTimeout:100})).catch(a=>{throw"status"in a&&"data"in a?new Error(`Fetching data from tzkt failed with: ${a.status}, ${a.data}`):a}).finally(()=>tzktRateLimiter.release()),MULTISIG_FETCH_LIMIT=1e4,TYPE_HASH=1963879877,CODE_HASH=-1890025422,getAllMultiSigContracts=async _=>withRateLimit(async()=>{try{const a=`${_.tzktApiUrl}/v1/contracts?typeHash=${TYPE_HASH}&codeHash=${CODE_HASH}&includeStorage=true&limit=${MULTISIG_FETCH_LIMIT}`,{data:$}=await axios.get(a);return $}catch(a){throw new Error(`Error fetching same contracts from tzkt: ${a.message}`)}}),getExistingContracts=(_,a)=>withRateLimit(()=>contractsGet({address:{in:[_.join(",")]},select:{fields:["address"]},limit:Math.min(1e4,_.length)},{baseUrl:a.tzktApiUrl})),getPendingOperations=async(_,a)=>withRateLimit(async()=>{if(_.length===0)return Promise.resolve([]);const $=`${a.tzktApiUrl}/v1/bigmaps/keys?active=true&bigmap.in=${_.join(",")}&limit=${MULTISIG_FETCH_LIMIT}`,{data:j}=await axios.get($);return j}),parseMultisig=_=>({address:parseContractPkh(_.address),threshold:Number(_.storage.threshold),signers:_.storage.signers.map(parseImplicitPkh),pendingOperationsBigmapId:_.storage.pending_ops}),getRelevantMultisigContracts=async(_,a)=>(await getAllMultiSigContracts(a)).filter(({storage:{signers:j}})=>lodashExports.every(j,isValidImplicitPkh)?j.filter(tt=>_.has(tt)).length>0:!1).map(parseMultisig),getNetworksForContracts=async(_,a)=>{const $=new Map;return a.length===0||(await Promise.all(_.map(async et=>(await getExistingContracts(a,et)).map(tt=>[tt,et.name])))).flat().forEach(([et,tt])=>$.set(et,tt)),$},parseMultisigOperation=_=>{const{bigmap:a,key:$,value:j}=_;if($===null||j===null)throw new Error("parseMultisigOperation failed");return{id:$,bigmapId:a,rawActions:j.actions,approvals:j.approvals.map(parseImplicitPkh)}},getPendingOperationsForMultisigs=async(_,a)=>{if(_.length===0)return[];const $=_.map(et=>et.pendingOperationsBigmapId),j=await getPendingOperations($,a);return lodashExports.compact(j.map(parseMultisigOperation))},VERSION$1=7,mainStoreMigrations={0:_=>produce(_,a=>{a.multisigs.labelsMap={}}),1:_=>produce(_,a=>{a.announcement=initialState$a}),2:lodashExports.identity,3:_=>produce(_,a=>{a.networks.current.name==="ghostnet"&&(a.networks.current.buyTezUrl="https://faucet.ghostnet.teztnets.com/");for(const $ of a.networks.available)if($.name==="ghostnet"){$.buyTezUrl="https://faucet.ghostnet.teztnets.com/";break}}),4:lodashExports.identity,5:_=>produce(_,a=>{delete a.assets.transfers.tez}),6:async _=>{const a=Object.values(_.contacts).filter(tt=>isValidImplicitPkh(tt.pkh)).map(tt=>[tt.pkh,{...tt,network:void 0}]),$=Object.values(_.contacts).filter(tt=>isValidContractPkh(tt.pkh)).map(tt=>tt.pkh),et=[...(await getNetworksForContracts(_.networks.available,$)).entries()].map(([tt,rt])=>[tt,{..._.contacts[tt],network:rt}]);return produce(_,tt=>{tt.contacts=lodashExports.fromPairs([...a,...et])})},7:_=>produce(_,a=>{a.assets.accountStates={},a.assets.block={level:a.assets.blockLevel},delete a.assets.blockLevel,delete a.assets.balances,delete a.assets.delegationLevels})},accountsMigrations={0:lodashExports.identity,1:lodashExports.identity,2:_=>produce(_,a=>{a.items.forEach($=>{$.type==="secret_key"&&($.curve="ed25519")})}),3:lodashExports.identity,4:_=>produce(_,a=>{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,7: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,_,"utf-8"),a,NUM_ITERATIONS_V1),derivePasswordBasedKeyV2=async(_,a)=>derivePasswordBasedKey(Buffer$g.from(_,"utf-8"),a,NUM_ITERATIONS_V2),derivePasswordBasedKey=async(_,a,$)=>{const j={name:"PBKDF2",salt:a,iterations:$,hash:"SHA-256"},et=await crypto.subtle.importKey("raw",_,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(a,$),et=crypto.getRandomValues(new Uint8Array(IV_SIZE)),tt=await crypto.subtle.encrypt({name:AES_MODE,iv:et},j,Buffer$g.from(_,"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}=_;try{const rt=$==="V2"?await derivePasswordBasedKeyV2(a,hex2Bytes(et)):await derivePasswordBasedKeyV1(a,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:_,newPassword:a},{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,_),at=await encrypt$1(it,a);return[rt,at]}catch(it){throw new Error(it.message)}}));return{newEncryptedMnemonics:lodashExports.fromPairs(tt)}}),initialState$9={items:[],seedPhrases:{},secretKeys:{}},accountsSlice=createSlice({name:"accounts",initialState:initialState$9,extraReducers:_=>{_.addCase(changeMnemonicPassword.fulfilled,(a,$)=>{const{newEncryptedMnemonics:j}=$.payload;a.seedPhrases=j})},reducers:{reset:()=>initialState$9,removeMnemonicAndAccounts:(_,{payload:a})=>{const{fingerPrint:$}=a,j=_.items.filter(et=>!(et.type==="mnemonic"&&et.seedFingerPrint===$));_.items=j,delete _.seedPhrases[$]},removeNonMnemonicAccounts:(_,{payload:a})=>{_.items=lodashExports.remove(_.items,$=>$.type==="mnemonic"||$.type!==a.accountType),a.accountType==="secret_key"&&(_.secretKeys={})},removeAccount:(_,{payload:a})=>{lodashExports.remove(_.items,$=>$.address.pkh===a.address.pkh),a.type==="secret_key"&&delete _.secretKeys[a.address.pkh]},renameAccount:(_,{payload:a})=>{const{account:$,newName:j}=a;if(j.length===0)throw new Error("Cannot rename account to an empty name.");if(_.items.find(tt=>tt.label===j))throw new Error(`Cannot rename account ${$.address.pkh} to ${j} since the name already exists.`);const et=_.items.find(tt=>tt.address.pkh===$.address.pkh&&tt.label===$.label);et&&(et.label=j)},addAccount:(_,{payload:a})=>{_.items=concatUnique(_.items,[a])},addMnemonicAccounts:(_,{payload:{encryptedMnemonic:a,accounts:$,seedFingerprint:j}})=>{_.items=concatUnique(_.items,$),_.seedPhrases[j]=a},addSecretKey:(_,{payload:{pkh:a,encryptedSecretKey:$}})=>{_.secretKeys[a]=$}}}),concatUnique=(_,a)=>(a.forEach($=>{if(_.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=_=>{const a=_.metadata;if(_.standard==="fa1.2"){const et=FA12TokenSchema.safeParse(_);return et.success?{type:"fa1.2",metadata:a,contract:et.data.contract.address,tokenId:"0"}:(console.warn("Invalid FA1 token: "+JSON.stringify(_)),null)}const $=NFTSchema.safeParse(_);if($.success)return{metadata:a,type:"nft",id:$.data.id,contract:$.data.contract.address,tokenId:$.data.tokenId,displayUri:$.data.metadata.displayUri,totalSupply:$.data.totalSupply};const j=FA2TokenSchema.safeParse(_);return j.success?{type:"fa2",metadata:a,contract:j.data.contract.address,tokenId:j.data.tokenId}:(console.warn("Invalid FA2 token: "+JSON.stringify(_)),null)},fullId=_=>`${_.contract}:${_.tokenId}`,defaultTokenName=_=>{switch(_.type){case"fa1.2":return DEFAULT_FA1_NAME;case"fa2":return DEFAULT_FA2_NAME;case"nft":return DEFAULT_NFT_NAME}},tokenNameSafe=_=>tokenName(_)||defaultTokenName(_),tokenName=_=>{var a;return(a=_.metadata)==null?void 0:a.name},defaultTokenSymbol=_=>{switch(_.type){case"fa1.2":return DEFAULT_FA1_SYMBOL;case"fa2":return DEFAULT_FA2_SYMBOL;case"nft":return DEFAULT_NFT_SYMBOL}},tokenSymbolSafe=_=>tokenSymbol(_)||defaultTokenSymbol(_),tokenSymbol=_=>{var a;return(a=_.metadata)==null?void 0:a.symbol},tokenDecimals=_=>{var a;return((a=_.metadata)==null?void 0:a.decimals)??DEFAULT_TOKEN_DECIMALS},getRealAmount=(_,a)=>{const $=new BigNumber(a),j=tokenDecimals(_);return $.multipliedBy(new BigNumber(10).exponentiatedBy(j)).toFixed()},formatTokenAmount=(_,a=DEFAULT_TOKEN_DECIMALS)=>{const $=BigNumber(_).dividedBy(BigNumber(10).pow(a));try{return new Intl.NumberFormat("en-US",{minimumFractionDigits:Number(a),maximumFractionDigits:Number(a)}).format($.toNumber())}catch{return console.warn(`Can't format token amount with decimals = ${a}`),formatTokenAmount(_,"0")}},tokenPrettyAmount=(_,a,$)=>{var nt;if(a.type==="nft")return _;const j=tokenSymbolSafe(a),et=(nt=a.metadata)==null?void 0:nt.decimals,tt=$!=null&&$.showSymbol?` ${j}`:"";return`${formatTokenAmount(_,et)}${tt}`},artifactUri=_=>_.metadata.artifactUri||_.displayUri,thumbnailUri=_=>_.metadata.thumbnailUri||_.displayUri,mimeType=_=>{var a,$;return($=(a=_.metadata.formats)==null?void 0:a.find(j=>j.uri===artifactUri(_)))==null?void 0:$.mimeType},royalties=_=>{const a=_.metadata.royalties;if(!a)return[];const $=Math.pow(10,Number(a.decimals)),j=Object.entries(a.shares).map(([et,tt])=>({address:et,share:Number(tt)*100/$}));return j.sort((et,tt)=>et.share`${tokenUri(_,a)}/metadata`,tokenUri=({contract:_,tokenId:a},$)=>`${$.tzktExplorerUrl}/${_}/tokens/${a}`,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=_=>{const a=fromRaw$1(_.token);return!a||!_.balance?null:{balance:_.balance,lastLevel:_.lastLevel,...a}},keepNFTs=_=>_.filter(a=>a.type==="nft"),keepFA1s=_=>_.filter(a=>a.type==="fa1.2"),keepFA2s=_=>_.filter(a=>a.type==="fa2"),initialState$8={block:{},transfers:{tokens:{}},accountStates:{},bakers:[],conversionRate:void 0,refetchTrigger:0,isLoading:!1,lastTimeUpdated:null},assetsSlice=createSlice({name:"assets",initialState:initialState$8,extraReducers:_=>_.addCase(accountsSlice.actions.reset,()=>initialState$8),reducers:{reset:()=>initialState$8,updateBlock:(_,{payload:a})=>{_.block=a},updateTokenTransfers:(_,{payload:a})=>{a.forEach($=>{_.transfers.tokens[$.transactionId]=$})},updateAccountStates:(_,{payload:a})=>{a.forEach($=>{const{balance:j,address:et,delegate:tt,stakedBalance:rt,unstakedBalance:nt,rollupBonds:it,smartRollupBonds:at}=$,st=j-rt-nt-it-at;_.accountStates[et]={..._.accountStates[et],delegate:tt,balance:st,stakedBalance:rt}})},updateUnstakeRequests:(_,{payload:a})=>{const $=lodashExports.groupBy(a,j=>j.staker.address);for(const j of Object.values(_.accountStates))j.unstakeRequests=[];for(const[j,et]of Object.entries($))_.accountStates[j]={..._.accountStates[j],unstakeRequests:lodashExports.sortBy(et.map(tt=>lodashExports.omit(tt,"staker")),"cycle")}},cleanAccountStates:_=>{_.accountStates={}},updateTokenBalance:(_,{payload:a})=>{const $=lodashExports.groupBy(a,j=>j.account.address);for(const j of Object.values(_.accountStates))j.tokens=[];for(const[j,et]of Object.entries($)){const tt=lodashExports.compact(et.map(fromRaw)).map(({balance:rt,contract:nt,tokenId:it,lastLevel:at})=>({balance:rt,contract:nt,tokenId:it,lastLevel:at}));_.accountStates[j]={..._.accountStates[j],tokens:tt}}},removeAccountsData:(_,{payload:a})=>{a.forEach($=>{delete _.accountStates[$]})},updateBakers:(_,{payload:a})=>{_.bakers=a},updateConversionRate:(_,{payload:a})=>{_.conversionRate=a},refetch:_=>{_.refetchTrigger+=1},setIsLoading:(_,{payload:a})=>{_.isLoading=a},setLastTimeUpdated:(_,{payload:a})=>{_.lastTimeUpdated=a}}}),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=_=>DefaultNetworks.map(a=>a.name).includes(_.name),DefaultNetworks=[MAINNET,GHOSTNET],initialState$7=lodashExports.fromPairs(DefaultNetworks.map(_=>[_.name,[]])),batchesSlice=createSlice({name:"batches",initialState:initialState$7,reducers:{reset:()=>initialState$7,add:(_,{payload:{operations:a,network:$}})=>{$.name in _||(_[$.name]=[]);const j=_[$.name],et=j.find(tt=>tt.sender.address.pkh===a.sender.address.pkh);if(et){et.operations.push(...a.operations);return}j.push(a)},clear:(_,{payload:{pkh:a,network:$}})=>{const j=_[$.name]||[],et=lodashExports.findIndex(j,tt=>tt.sender.address.pkh===a);et!==-1&&j.splice(et,1)},removeItem:(_,{payload:{pkh:a,index:$,network:j}})=>{const et=_[j.name]||[],tt=lodashExports.findIndex(et,nt=>nt.sender.address.pkh===a);if(tt===-1)return;const rt=et[tt];$lodashExports.fromPairs(Object.entries(_).map(([$,j])=>{const et=(j||[]).filter(tt=>!a.includes(tt.sender.address.pkh));return[$,et]}))}}),batchesActions=batchesSlice.actions,initialState$6={},beaconSlice=createSlice({name:"beacon",initialState:initialState$6,reducers:{reset:()=>initialState$6,addConnection:(_,{payload:a})=>{_[a.dAppId]={accountPkh:a.accountPkh,networkType:a.networkType}},removeConnection:(_,{payload:a})=>{delete _[a]},removeConnections:(_,{payload:a})=>lodashExports.fromPairs(Object.entries(_).filter(([$,j])=>!a.includes(j.accountPkh)))}});beaconSlice.actions;const initialState$5={},contactsSlice=createSlice({name:"contacts",initialState:initialState$5,reducers:{reset:()=>initialState$5,upsert:(_,{payload:a})=>{_[a.pkh]=a},remove:(_,{payload:a})=>{delete _[a]}}}),contactsActions=contactsSlice.actions,MAX_ERRORS_LEN=100,initialState$4=[],errorsSlice=createSlice({name:"errors",initialState:initialState$4,reducers:{reset:()=>initialState$4,add(_,{payload:a}){_.length===MAX_ERRORS_LEN&&_.shift(),_.push(a)}}}),initialState$3={items:[],pendingOperations:{},labelsMap:{}},multisigsSlice=createSlice({name:"multisigs",initialState:initialState$3,reducers:{reset:()=>initialState$3,mockAddAccount:(_,{payload:a})=>{_.items.push({label:`Multisig Account ${_.items.length}`,type:"multisig",...a})},setMultisigs:(_,{payload:a})=>{const $=lodashExports.fromPairs(_.items.map(j=>[j.address.pkh,j.label]));_.items=a.map((j,et)=>({...j,label:$[j.address.pkh]||_.labelsMap[j.address.pkh]||`Multisig Account ${et}`,type:"multisig"}))},addMultisigLabel:(_,{payload:{pkh:a,label:$}})=>{_.labelsMap[a]=$},setPendingOperations:(_,{payload:a})=>{_.pendingOperations=lodashExports.groupBy(a,$=>$.bigmapId)},setName:(_,{payload:a})=>{const{account:{address:{pkh:$}},newName:j}=a,et=_.items.find(tt=>tt.address.pkh===$);et&&(et.label=j)},removeMultisigsData:(_,{payload:a})=>{const $=_.items.filter(j=>a.includes(j.address.pkh)).map(j=>String(j.pendingOperationsBigmapId));_.pendingOperations=lodashExports.omit(_.pendingOperations,$),_.labelsMap=lodashExports.omit(_.labelsMap,a)}}}),multisigActions=multisigsSlice.actions,initialState$2={available:DefaultNetworks,current:MAINNET},networksSlice=createSlice({name:"networks",initialState:initialState$2,reducers:{reset:()=>initialState$2,setCurrent:(_,{payload:a})=>{_.current=a},upsertNetwork:(_,{payload:a})=>{if(isDefault(a))return;const $=_.available.findIndex(j=>j.name===a.name);if(_.current.name===a.name&&(_.current=a),$!==-1){_.available[$]=a;return}_.available.push(a)},removeNetwork:(_,{payload:a})=>{isDefault(a)||lodashExports.remove(_.available,$=>$.name===a.name)}}}),networksActions=networksSlice.actions,initialState$1=lodashExports.fromPairs(DefaultNetworks.map(_=>[_.name,{maxSlashingPeriod:2,consensusRightsDelay:2}])),protocolSettingsSlice=createSlice({name:"protocolSettings",initialState:initialState$1,reducers:{update:(_,{payload:{network:a,settings:$}})=>{_[a.name]=$}}}),protocolSettingsActions=protocolSettingsSlice.actions,initialState=lodashExports.fromPairs(DefaultNetworks.map(_=>[_.name,{}])),tokensSlice=createSlice({name:"tokens",initialState,reducers:{reset:()=>initialState,addTokens:(_,{payload:{network:a,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,protocolSettings:protocolSettingsSlice.reducer,tokens:tokensSlice.reducer}),reducer=persistReducer(rootPersistConfig,rootReducers),store=configureStore({reducer,middleware:_=>_({serializableCheck:{ignoredActions:[FLUSH,REHYDRATE,PAUSE,PERSIST,PURGE,REGISTER]}})}),persistor=persistStore(store),FormErrorMessage=({children:_,...a})=>jsxRuntimeExports.jsxs(FormErrorMessage$1,{color:colors.orange,fontSize:"12px",...a,children:[jsxRuntimeExports.jsx(Icon,{as:ExclamationIcon,marginRight:"6px"}),_]}),CONFIRMATION_CODE="wasabi",reset=()=>WalletClient.destroy().catch(lodashExports.noop).finally(()=>{persistor.pause(),localStorage.clear(),window.location.reload()}),OffboardingForm=()=>{const _=useForm({mode:"onBlur"}),{register:a,handleSubmit:$,formState:{isValid:j,errors:et},getValues:tt}=_,rt=()=>{if(!(!tt("check")||tt("confirmationCode")!==CONFIRMATION_CODE))return reset()};return jsxRuntimeExports.jsx(FormProvider,{..._,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,{...a("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",...a("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:_,onOpen:a,onClose:$}=useDisclosure$1();return{modalElement:jsxRuntimeExports.jsxs(Modal,{isCentered:!0,isOpen:_,onClose:$,children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[900],children:jsxRuntimeExports.jsx(OffboardingForm,{})})]}),onOpen:a}},CircleIcon=({icon:_,size:a,onClick:$=()=>{}})=>jsxRuntimeExports.jsx(Box,{width:a,height:a,margin:"auto",background:colors.gray[700],borderRadius:"full",onClick:$,children:jsxRuntimeExports.jsx(Center,{height:"100%",children:_})}),ModalContentWrapper=({children:_,icon:a,title:$,subtitle:j})=>jsxRuntimeExports.jsxs(VStack,{maxHeight:"83vh",spacing:0,children:[jsxRuntimeExports.jsx(Box,{marginBottom:"16px",children:jsxRuntimeExports.jsx(CircleIcon,{icon:a,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})]}),_]}),name$2="umami",productName="umami",version$2="2.2.0",author$2="Trilitech ",description$2="Tezos Wallet",homepage$2="https://umamiwallet.com",repository$2="https://github.com/trilitech/umami-v2",license$2="MIT",engines={node:">=20 <21.0.0"},type$5="commonjs",main$2="build/electron.js",scripts$2={build:"vite build",dev:"vite dev --host 127.0.0.1",preview:"vite preview","electron:package:linux":"electron-builder -l","electron:package:mac":"electron-builder -m","electron:package:mac:debug":"DEBUG=true yarn build --mode dev && sed -i='' 's@devTools: false@devTools: true@g' build/electron.js && yarn electron:package:mac -c electron-builder.dev.yml && rm -rf build","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":"cross-env DEV=true 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$2={"@airgap/beacon-wallet":"^4.2.2","@babel/core":"^7.24.7","@babel/preset-env":"^7.24.7","@babel/preset-react":"^7.24.7","@babel/preset-typescript":"^7.24.7","@babel/runtime":"^7.24.7","@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.8.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.1","@reduxjs/toolkit":"^2.2.5","@stylistic/eslint-plugin":"^2.1.0","@tanstack/eslint-plugin-query":"^5.43.1","@tanstack/react-query":"^5.45.0","@tanstack/react-query-devtools":"^5.45.0","@taquito/ledger-signer":"^20.0.0","@taquito/michel-codec":"^20.0.0","@taquito/rpc":"^20.0.0","@taquito/signer":"^20.0.0","@taquito/taquito":"20.0.0","@taquito/utils":"^20.0.0","@testing-library/dom":"^10.1.0","@testing-library/jest-dom":"6.4.6","@testing-library/react":"14.3.1","@testing-library/user-event":"14.5.2","@toruslabs/customauth":"^16.0.6","@types/babel__core":"^7.20.5","@types/babel__preset-env":"^7.9.6","@types/identity-obj-proxy":"^3.0.2","@types/jest":"^29.5.12","@types/md5":"^2.3.5","@types/node":"20.14.2","@types/papaparse":"^5.3.14","@types/pluralize":"^0.0.33","@types/promise-retry":"^1.1.6","@types/react":"18.3.3","@types/react-dom":"18.3.0","@types/react-test-renderer":"^18.3.0","@typescript-eslint/eslint-plugin":"^7.13.0","@typescript-eslint/parser":"^7.13.0","@tzkt/sdk-api":"^2.2.1","@vitejs/plugin-react":"^4.3.1",axios:"^1.7.2","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:"^31.0.1","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":"^3.0.0","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^28.6.0","eslint-plugin-jest-dom":"^5.4.0","eslint-plugin-playwright":"^1.6.2","eslint-plugin-react":"^7.34.2","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.3.0","eslint-plugin-unused-imports":"^3.2.0","framer-motion":"^11.2.10","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.3.2","prettier-plugin-gherkin":"^2.3.0",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":"^3.0.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.3.0",typescript:"5.4.5",vite:"^5.3.0","vite-plugin-checker":"^0.6.4","vite-plugin-node-polyfills":"^0.22.0",zipurl:"^0.2.18",zod:"^3.23.8"},packageManager="yarn@4.3.0",dependencies$2={"electron-updater":"^6.2.1"},resolutions={jsdom:"^23.0.1","@types/jsdom":"^21.1.6"},packageInfo={name:name$2,productName,version:version$2,author:author$2,description:description$2,homepage:homepage$2,repository:repository$2,license:license$2,engines,type:type$5,main:main$2,scripts:scripts$2,devDependencies:devDependencies$2,packageManager,dependencies:dependencies$2,resolutions};var withSelector={exports:{}},useSyncExternalStoreWithSelector_production_min={};/** * @license React * use-sync-external-store-with-selector.production.min.js * @@ -582,7 +582,7 @@ License: MIT "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:_,externalLink:a,linkDescription:$})=>jsxRuntimeExports.jsx(Link,{rel:"noopener noreferrer",target:"_blank",to:a,children:jsxRuntimeExports.jsx(ClickableCard,{cursor:"pointer",isSelected:!1,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:_}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[$&&jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[400],size:"sm",children:$}),jsxRuntimeExports.jsx(ExternalLinkIcon,{})]})]})})}),HelpCard=({title:_,children:a})=>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:_})=>{const a=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:$=>_({type:"restoreMnemonic"}),size:"lg",children:"Import with Seed Phrase"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"restoreSecretKey"}),size:"lg",variant:"tertiary",children:"Import with Secret Key"}),!a&&jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"restoreBackup"}),size:"lg",variant:"tertiary",children:"Restore from Backup"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"nameAccount",account:{type:"ledger"}}),size:"lg",variant:"tertiary",children:"Connect ledger"})]})})},withTimeout=(_,a,$)=>Promise.race([_(),new Promise((j,et)=>setTimeout(()=>{et(new Error("The operation has timed out"))},a))]),LOGIN_TIMEOUT=minutesToMilliseconds(1),useOnboardWithSocial=(_,a)=>{const $=useToast(),{isLoading:j,handleAsyncAction:et}=useAsyncActionHandler(),tt=useRestoreSocial(),rt=reactExports.useCallback(()=>et(async()=>{const{secretKey:nt,name:it}=await withTimeout(()=>forIDP(_).getCredentials(),LOGIN_TIMEOUT),{pk:at,pkh:st}=await getPublicKeyPairFromSk(nt);tt(at,st,it,_),$({description:`Successfully added ${it} account`,status:"success"}),a()},{title:"Social login failed"}),[_,$,et,tt,a]);return{isLoading:j,onboard:rt}},OnboardWithFacebookButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("facebook",_);return jsxRuntimeExports.jsx(IconButton,{"aria-label":"Facebook SSO","data-testid":"login-button-facebook",icon:jsxRuntimeExports.jsx(FacebookIcon,{}),isLoading:a,onClick:$,variant:"socialLogin"})},OnboardWithGoogleButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("google",_);return jsxRuntimeExports.jsx(IconButton,{"aria-label":"Google SSO","data-testid":"login-button-google",icon:jsxRuntimeExports.jsx(GoogleIcon,{}),isLoading:a,onClick:$,variant:"socialLogin"})},OnboardWithRedditButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("reddit",_);return jsxRuntimeExports.jsx(IconButton,{"aria-label":"Reddit SSO","data-testid":"login-button-reddit",icon:jsxRuntimeExports.jsx(RedditIcon,{}),isLoading:a,onClick:$,variant:"socialLogin"})},OnboardWithTwitterButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("twitter",_);return jsxRuntimeExports.jsx(IconButton,{color:"black","aria-label":"Twitter SSO","data-testid":"login-button-twitter",icon:jsxRuntimeExports.jsx(TwitterIcon,{fill:"currentColor"}),isLoading:a,onClick:$,variant:"socialLogin"})},IS_DEV=!1,ConnectOrCreate=({goToStep:_,closeModal:a})=>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:$=>_({type:"notice"}),size:"lg",children:"Create a new Account"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({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 social"}),jsxRuntimeExports.jsx(Divider,{marginTop:"11px"})]}),jsxRuntimeExports.jsxs(Flex,{gap:"12px",children:[jsxRuntimeExports.jsx(OnboardWithGoogleButton,{onAuth:a}),jsxRuntimeExports.jsx(OnboardWithFacebookButton,{onAuth:a}),jsxRuntimeExports.jsx(OnboardWithTwitterButton,{onAuth:a}),jsxRuntimeExports.jsx(OnboardWithRedditButton,{onAuth:a})]})]})}),Select=({selected:_,options:a,onChange:$})=>{const[j,et]=reactExports.useState(_),[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:a.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:_,account:a})=>{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)}}),at=async({derivationPathTemplate:st,derivationPath:ot})=>{switch(a.type){case"ledger":return _($?{type:"restoreLedger",account:{...a,derivationPath:normalizeDerivationPath(ot)}}:{type:"restoreLedger",account:{...a,derivationPathTemplate:normalizeDerivationPath(st)}});case"mnemonic":{if($){const ut=await deriveSecretKey(a.mnemonic,ot,"ed25519");return _({type:"masterPassword",account:{type:"secret_key",secretKey:ut,label:a.label}})}return _({type:"masterPassword",account:{...a,derivationPathTemplate:st}})}}};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(at),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(st=>!st),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:st=>rt("derivationPathTemplate",st),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=_=>_.trim().toLowerCase().replace("m/",""),validateDerivationPath=_=>{const a=normalizeDerivationPath(_);return a.length===0?"Derivation path is required":a.startsWith("44'/1729'/")?a.match(new RegExp("^44'/1729'/([0-9]+'/)*([0-9]+')$"))?!0:"Invalid derivation path":"Derivation path must start with `44'/1729'/`"},Eula=({goToStep:_})=>{const[a,$]=React$2.useState(!1);return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(DocumentIcon,{}),title:"Accept to Continue",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Checkbox,{marginTop:"-20px",marginBottom:"24px",fontWeight:"600",onChange:j=>$(j.target.checked),children:jsxRuntimeExports.jsxs(Box,{marginTop:"20px",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:!a,onClick:()=>{_({type:"connectOrCreate"})},size:"lg",children:"Continue"})]})})},FakeAccount=({onClose:_})=>{const{register:a,handleSubmit:$,formState:{errors:j}}=useForm({mode:"onBlur"}),et=useRestoreLedger(),tt=useRestoreSocial(),rt=async({pkh:nt,name:it,idp:at})=>{if(at&&at.length>0&&!["google","facebook","twitter","reddit","email"].includes(at))throw new Error("Invalid IDP");const ot=await new RpcClient(GHOSTNET.rpcUrl).getManagerKey(nt),ut=typeof ot=="string"?ot:ot.key;at?tt(ut,nt,it,at):et(defaultDerivationPathTemplate,makeDerivationPath(defaultDerivationPathTemplate,0),ut,nt,it),_()};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(WalletPlusIcon,{}),title:"Add a Fake Account",children:jsxRuntimeExports.jsxs("form",{onSubmit:$(rt),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.pkh,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Address"}),jsxRuntimeExports.jsx(Input,{...a("pkh",{required:!0}),autoComplete:"off",placeholder:"Please enter the account address"})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"12px",isInvalid:!!j.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Name"}),jsxRuntimeExports.jsx(Input,{...a("name",{required:!0}),autoComplete:"off",placeholder:"Please enter the account name"})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"12px",isInvalid:!!j.idp,children:[jsxRuntimeExports.jsx(FormLabel,{children:"IDP (For a social account)"}),jsxRuntimeExports.jsx(Input,{...a("idp"),autoComplete:"off",placeholder:"Please enter the IDP"})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"12px",size:"lg",type:"submit",children:"Add account"})]})})},EnterAndConfirmPassword=({onSubmit:_,isLoading:a})=>{const $=useForm({mode:"onBlur"}),{handleSubmit:j,formState:{errors:et,isValid:tt},getValues:rt}=$,nt=({confirm:it})=>_(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||a,isLoading:a,size:"lg",type:"submit",children:"Submit"})]})})})},EnterPassword=({onSubmit:_,isLoading:a})=>{const $=useForm({mode:"onBlur"}),{handleSubmit:j,formState:{errors:et,isValid:tt}}=$,rt=nt=>{_(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:a,size:"lg",type:"submit",children:"Submit"})]})})})},MasterPassword=({account:_,onClose:a})=>{const $=useRestoreFromMnemonic(),j=useRestoreFromSecretKey(),et=useValidateMasterPassword(),tt=et!==null,{isLoading:rt,handleAsyncAction:nt}=useAsyncActionHandler(),it=useToast(),at=st=>nt(async()=>{switch(tt&&await et(st),_.type){case"secret_key":await j(_.secretKey,st,_.label);break;case"mnemonic":await $({..._,password:st})}it({description:"Account successfully created!",status:"success"}),a()});return tt?jsxRuntimeExports.jsx(EnterPassword,{isLoading:rt,onSubmit:at}):jsxRuntimeExports.jsx(EnterAndConfirmPassword,{isLoading:rt,onSubmit:at})},Notice=({goToStep:_})=>{const a=[{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:a.map(($,j)=>jsxRuntimeExports.jsx(ListItem,{fontSize:"16px",fontWeight:600,children:$.content},j))}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"28px",onClick:()=>_({type:"showSeedphrase",account:{type:"mnemonic",mnemonic:generate24WordMnemonic()}}),size:"lg",children:"I understand"}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"16px",onClick:()=>_({type:"restoreMnemonic"}),size:"lg",variant:"tertiary",children:"I already have a Seed Phrase"})]})})},RestoreBackupFile=()=>{const _=useForm({mode:"onBlur"}),{handleSubmit:a,register:$,formState:{errors:j,isValid:et}}=_,{handleAsyncAction:tt}=useAsyncActionHandler(),rt=useRestoreV1BackupFile(),nt=({password:it,file:at})=>tt(async()=>{const st=await at[0].text(),ot=JSON.parse(st);if(ot.recoveryPhrases&&ot.derivationPaths)await rt(ot,it);else if(ot["persist:accounts"])await restoreV2BackupFile(ot,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,{..._,children:jsxRuntimeExports.jsx("form",{onSubmit:a(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 _=>{const a=await TransportWebUSB.create(),$=new LedgerSigner(a,_,!0),j=await $.publicKey(),et=await $.publicKeyHash();return await a.close(),{pk:j,pkh:et}},LEDGER_TIMEOUT=60*1e3,RestoreLedger=({closeModal:_,account:a})=>{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"}),at=a.derivationPathTemplate?makeDerivationPath(a.derivationPathTemplate,0):a.derivationPath,{pk:st,pkh:ot}=await getPk(at);$(a.derivationPathTemplate,at,st,ot,a.label),j.close(it),j({description:"Account successfully created!",status:"success"}),_()},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,at)=>jsxRuntimeExports.jsx(ListItem,{children:it.content},at))}),jsxRuntimeExports.jsx(Button,{width:"100%",isLoading:et,onClick:nt,size:"lg",children:"Export Public Key"})]})})},MnemonicAutocomplete=({inputName:_,validate:a,inputProps:$,listProps:j})=>{const[et,tt]=reactExports.useState(!0),{register:rt,setValue:nt,watch:it}=useFormContext(),at=it(_),st=wordlists.EN.filter(ut=>at&&ut.startsWith(at)).sort(),ot=!et&&st.length>0&&(st.length>1||st[0]!==at);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Input,{zIndex:0,autoComplete:"off","data-testid":"mnemonic-input",onFocus:()=>tt(!1),placeholder:"Type here...",...rt(_,{required:"Required",validate:a,onChange:()=>tt(!1),onBlur:()=>tt(!0)}),...$}),ot&&jsxRuntimeExports.jsx(UnorderedList,{"data-testid":"suggestions",variant:"suggestions",...j,children:st.map(ut=>jsxRuntimeExports.jsx(ListItem,{paddingTop:"2px",fontSize:"14px",fontWeight:600,"data-testid":"suggestion",onMouseDown:()=>nt(_,ut),paddingX:"7px",children:ut},ut))})]})},mnemonicSizes=[12,15,18,24],RestoreMnemonic=({goToStep:_})=>{const a=useForm({mode:"onBlur"}),{handleSubmit:$,setValue:j,trigger:et,formState:{isValid:tt}}=a,{handleAsyncAction:rt}=useAsyncActionHandler(),[nt,it]=reactExports.useState(24),at=ut=>{const dt=Number(ut);if(mnemonicSizes.includes(dt))return it(mt=>(mt>dt&&lodashExports.range(dt,Math.max(...mnemonicSizes)).forEach(xt=>{j(`word${xt}`,void 0)}),dt)),et()},st=ut=>rt(async()=>{const dt=ut.split(" ");if(!mnemonicSizes.includes(dt.length))throw new Error(`the mnemonic must be ${mnemonicSizes.join(", ")} words long`);return dt.slice(0,nt).forEach((mt,xt)=>{j(`word${xt}`,mt)}),et()}),ot=ut=>rt(async()=>{const dt=Object.values(ut).join(" ").trim();if(!validateMnemonic_1(dt))throw new Error(`Invalid Mnemonic: "${dt}"`);return _({type:"nameAccount",account:{type:"mnemonic",mnemonic:dt}}),Promise.resolve()});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px"}),subtitle:"Please fill in the Seed Phrase in sequence.",title:"Import Seed Phrase",children:jsxRuntimeExports.jsx(Box,{overflowX:"hidden",children:jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx("form",{onSubmit:$(ot),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=>at(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 dt=`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:dt,inputProps:{onPaste:async mt=>{mt.preventDefault();const xt=await navigator.clipboard.readText();return st(xt)},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:_})=>{const[a,$]=reactExports.useState(!1),{handleAsyncAction:j}=useAsyncActionHandler(),et=useForm({mode:"onBlur",defaultValues:{password:""}}),{register:tt,handleSubmit:rt,formState:{errors:nt,isValid:it}}=et,at=async({secretKey:st,password:ot})=>j(async()=>{try{const dt=await(await InMemorySigner.fromSecretKey(st.trim(),ot)).secretKey();_({type:"nameAccount",account:{type:"secret_key",secretKey:dt}})}catch(ut){const dt=ut.message||"";throw dt.includes("Cannot read properties of null")?new Error("Key-password pair is invalid"):dt.includes("Invalid checksum")?new Error("Invalid secret key: checksum doesn't match"):ut}});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px"}),title:"Insert Secret Key",children:jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsxs("form",{onSubmit:rt(at),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!nt.secretKey,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Secret Key"}),jsxRuntimeExports.jsx(Textarea,{minHeight:"130px","data-testid":"secret-key",...tt("secretKey",{required:"Secret key is required",onChange:st=>$(isEncryptedSecretKeyPrefix(st.target.value.trim()))}),placeholder:"Your secret key"}),nt.secretKey&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:nt.secretKey.message})]}),a&&jsxRuntimeExports.jsxs(FormControl,{marginTop:"20px",isInvalid:!!nt.password,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password",inputName:"password",minLength:0}),nt.password&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:nt.password.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px","data-testid":"restore-continue-button",isDisabled:!it,size:"lg",type:"submit",children:"Continue"})]})})})},ShowSeedphrase=({goToStep:_,account:a})=>jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px"}),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:a.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:$=>{_({type:"verifySeedphrase",account:a})},size:"lg",children:"OK, I've recorded it"})]})}),VerifySeedphrase=({goToStep:_,account:a})=>{const $=a.mnemonic.split(" "),j=useForm({mode:"onBlur"}),{handleSubmit:et,formState:{errors:tt,isValid:rt}}=j,[nt]=reactExports.useState(selectRandomElements($,5)),it=()=>_({type:"nameAccount",account:a});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((at,st)=>{const ot=`${at.index}`,ut=tt[ot];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:at.index+1}),jsxRuntimeExports.jsx(Box,{width:"100%",children:jsxRuntimeExports.jsx(MnemonicAutocomplete,{inputName:ot,inputProps:{paddingLeft:"36px",size:"md"},listProps:{marginTop:"6px"},validate:dt=>{if(dt!==at.value)return"Word doesn't match"}})}),(ut==null?void 0:ut.message)&&jsxRuntimeExports.jsx(FormErrorMessage,{children:ut.message})]},st)}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"20px",isDisabled:!rt,size:"lg",type:"submit",children:"Continue"}),IS_DEV]})})})})},useStepHistory=_=>{const[a,$]=reactExports.useState(_),[j,et]=reactExports.useState([a]),tt=j.length===1;return{reset:()=>{$(_),et([_])},goToStep:rt=>{$(rt),et([...j,rt])},currentStep:a,goBack:()=>{if(tt)return;j.pop();const rt=j[j.length-1];et(j),$(rt)},atInitialStep:tt,fullHistory:j}},useOnboardingModal=_=>{const{isOpen:a,onOpen:$,onClose:j}=useDisclosure$1(),et=useImplicitAccounts().length!==0,tt=useStepHistory({type:et?"connectOrCreate":"eula"}),{currentStep:rt,goToStep:nt}=tt,it=()=>{tt.reset(),_&&_(),j()},at=()=>{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:a,onClose:it,children:[et&&jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(ModalContent,{children:[!tt.atInitialStep&&jsxRuntimeExports.jsx(ModalBackButton,{onClick:tt.goBack}),jsxRuntimeExports.jsx(ModalCloseButton,{onClick:it}),at()]})]}),onOpen:$}},AccountListHeader=()=>{const{onOpen:_,modalElement:a}=useOnboardingModal();return jsxRuntimeExports.jsxs(Flex,{flexDirection:"row-reverse",marginTop:"12px",marginBottom:"16px",children:[jsxRuntimeExports.jsxs(Button,{paddingRight:"0",onClick:_,variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(AddAccountIcon,{stroke:"currentcolor"}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:"Add Account"})]}),a]})},AccountGroupPopover=({onRemove:_,onCreate:a})=>jsxRuntimeExports.jsx(PopoverMenu,{children:jsxRuntimeExports.jsxs(Box,{paddingY:"0",children:[jsxRuntimeExports.jsx(Button,{height:a?"24px":"28px","data-testid":"popover-remove",onClick:_,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"})]})}),a&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{marginY:"4px"}),jsxRuntimeExports.jsx(Button,{onClick:a,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:_,fingerPrint:a})=>{const[$,j]=reactExports.useState(),{isLoading:et,handleAsyncAction:tt}=useAsyncActionHandler(),rt=useToast(),nt=useDeriveMnemonicAccount(),it=({name:at,password:st})=>tt(async()=>{await nt({fingerPrint:a,password:st,label:at.trim()||DEFAULT_ACCOUNT_LABEL}),_(),rt({description:`New account created! Successfully derived account from ${a}`})},{title:"Failed to derive new account"});return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),$?jsxRuntimeExports.jsx(EnterPassword,{isLoading:et,onSubmit:at=>it({name:$,password:at})}):jsxRuntimeExports.jsx(NameAccountDisplay,{onSubmit:at=>j(at.accountName),subtitle:`Name the new account derived from ${a}`})]})},getAccountGroupLabel=_=>{switch(_.type){case"mnemonic":return`Seedphrase ${_.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:_,accounts:a})=>{const $=a[0],j=$.type==="multisig",et=$.type==="mnemonic",{openWith:tt,onClose:rt}=reactExports.useContext(DynamicModalContext),nt=useRemoveMnemonic(),it=useRemoveNonMnemonic(),at=useImplicitAccounts().length===a.length,st="Remove All Accounts";let ot,ut="Remove All";const dt=getAccountGroupLabel($);at?(ot="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.",ut="Remove & Off-board"):et?ot=`Are you sure you want to remove all accounts derived from ${dt}?`:ot=`Are you sure you want to remove all of your ${dt}?`;const mt=()=>tt(jsxRuntimeExports.jsx(ConfirmationModal,{buttonLabel:ut,description:ot,onSubmit:()=>{et?nt($.seedFingerPrint):j||it($.type),rt()},title:st})),xt=()=>{if(!et)throw new Error("Can't derive a non mnemonic account!");return tt(jsxRuntimeExports.jsx(DeriveMnemonicAccountModal,{fingerPrint:$.seedFingerPrint,onDone:rt}))};return jsxRuntimeExports.jsxs(Box,{"data-testid":`account-group-${_}`,children:[jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",marginTop:"24px",marginBottom:"16px",children:[jsxRuntimeExports.jsx(Heading,{"data-testid":"account-group-title",size:"md",children:_}),!j&&jsxRuntimeExports.jsx(AccountGroupPopover,{onCreate:et?xt:void 0,onRemove:mt})]}),a.map(Ct=>jsxRuntimeExports.jsx(Box,{marginBottom:"16px",children:jsxRuntimeExports.jsx(AccountTile,{account:Ct})},Ct.address.pkh))]})},NestedScroll=_=>jsxRuntimeExports.jsx(Box,{overflowY:"auto",height:"100%",children:_.children});var indicator$1=function _(a){a=Math.abs(a);var $=a%100;if($>=10&&$<=20)return"th";var j=a%10;return j===1?"st":j===2?"nd":j===3?"rd":"th"},indicator=indicator$1;function ordinal(_){if(typeof _!="number")throw new TypeError("Expected Number, got "+typeof _+" "+_);return Number.isFinite(_)?_+indicator(_):_}ordinal.indicator=indicator;var ordinal_1=ordinal;const ordinal$1=getDefaultExportFromCjs$1(ordinal_1),SignTransactionFormPage=_=>{const a=useAppDispatch(),{isLoading:$,handleAsyncAction:j}=useAsyncActionHandler(),{mode:et,operations:tt,data:{threshold:rt,signers:nt,name:it}}=_,{fee:at,operations:st,estimationFailed:ot,isLoading:ut,form:dt,reEstimate:mt,signer:xt,onSign:Ct}=useSignPageHelpers(tt,et),Pt=$||ut,Tt=Mt=>j(async()=>{const Lt=await Ct(Mt);if(!Lt)throw new Error("An error occurred during contract origination");const Nt=(await Lt.getOriginatedContractAddresses())[0];a(multisigActions.addMultisigLabel({pkh:Nt,label:it}))});return jsxRuntimeExports.jsx(FormProvider,{...dt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,description:"Please review the details and then continue to submit contract.",operationsType:st.type,signer:xt,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:it}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{}),jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"Approvers"}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column",gap:"12px",marginBottom:"12px","data-testid":"approvers",children:nt.map(Mt=>jsxRuntimeExports.jsx(AddressTile,{address:parsePkh(Mt.val),"data-testid":`approver-${Mt.val}`},Mt.val))}),jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",children:jsxRuntimeExports.jsx(Threshold,{signersAmount:nt.length,threshold:rt})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(FormControl,{marginTop:"24px",marginBottom:"12px",children:jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!1,inputName:"signer",isLoading:Pt,keepValid:!0,label:"Creation Fee Payer",onUpdate:mt})}),jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",children:jsxRuntimeExports.jsx(SignPageFee,{fee:at})})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:ot,isLoading:Pt,onSubmit:Tt,signer:xt,text:"Submit Contract"})})]})})})},Threshold=({threshold:_,signersAmount:a})=>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:`${_} out of ${a}`})]}),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:_,signers:a,threshold:$,last_op_id:"0",pending_ops:[],metadata:[]}),toOperation$6=_=>({type:"contract_origination",sender:parsePkh(_.sender),code:contract,storage:makeStorageJSON(_.sender,_.signers.map(a=>a.val),String(_.threshold))}),SelectApproversFormPage=_=>{const{goBack:a,sender:$,...j}=_,et=useForm({mode:"onBlur",defaultValues:{sender:$.address.pkh,signers:[{val:""}],threshold:1,...formDefaultValues(j)}}),{formState:{errors:tt,isValid:rt},control:nt,register:it,handleSubmit:at,getValues:st,watch:ot}=et,ut=useFieldArray({control:nt,name:"signers",rules:{minLength:1}}),dt=ot("signers").length,mt=useOpenSignPageFormAction({SignPage:SignTransactionFormPage,signPageExtraData:ot(),FormPage:SelectApproversFormPage,defaultFormPageProps:_,toOperation:toOperation$6}),{onFormSubmitActionHandlers:[xt],isLoading:Ct}=useHandleOnSubmitFormActions([mt]);return jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalBackButton,{onClick:a}),jsxRuntimeExports.jsxs("form",{onSubmit:at(xt),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,Tt)=>{var Bt;const Mt=tt.signers&&tt.signers[Tt],Lt=`${Tt===0?"Select ":""}${ordinal$1(Tt+1)} approver`,Nt=dt>1?"short":"default",zt=Nt==="short"?"368px":"100%";return jsxRuntimeExports.jsxs(FormControl,{display:"inline-block",width:zt,marginBottom:"8px","data-testid":`signer-input-${Tt}`,isInvalid:!!Mt,children:[jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!0,inputName:`signers.${Tt}.val`,label:Lt,size:Nt,style:{width:zt},validate:It=>{if(!isValidImplicitPkh(It))return"Signer must be valid TZ address";const Dt=st("signers").map(Ft=>Ft.val);if(Dt.length>new Set(Dt).size)return"Duplicate approver"}}),dt>1&&jsxRuntimeExports.jsx(IconButton,{position:"absolute",height:"24px",marginTop:"-36px",marginLeft:"374px",background:colors.gray[500],"aria-label":"Remove","data-testid":`remove-signer-${Tt}`,icon:jsxRuntimeExports.jsx(TrashIcon,{width:"12px",height:"14px",stroke:colors.gray[300]}),isRound:!0,onClick:()=>ut.remove(Tt),size:"xs",variant:"tertiary"}),Mt&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":`signer-${Tt}-error`,children:(Bt=Mt.val)==null?void 0:Bt.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:dt,message:`Max no. of approvals is ${dt}`},min:{value:1,message:"Min no. of approvals is 1"}})})})]}),jsxRuntimeExports.jsxs(Text,{display:"inline","data-testid":"max-signers",children:["out of ",dt]}),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:_})=>{const a=useForm({mode:"onBlur",defaultValues:{name:_||""}}),{formState:{errors:$,isValid:j},register:et,handleSubmit:tt}=a,rt=useImplicitAccounts(),nt=useGetMostFundedImplicitAccount(),{openWith:it}=reactExports.useContext(DynamicModalContext),at=({name:ot})=>it(jsxRuntimeExports.jsx(SelectApproversFormPage,{form:{name:ot.trim()},goBack:()=>it(jsxRuntimeExports.jsx(NameMultisigFormPage,{name:ot})),sender:nt(rt)})),st=useValidateName();return jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:tt(at),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:st}),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 _=useAllAccounts(),a=lodashExports.groupBy(_,getAccountGroupLabel),{openWith:$}=reactExports.useContext(DynamicModalContext),j=Object.entries(a).map(([et,tt])=>jsxRuntimeExports.jsx(AccountGroup,{accounts:tt,groupLabel:et},et));return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box,{height:"100%",marginRight:0,children:jsxRuntimeExports.jsxs(NestedScroll,{children:[lodashExports.compact(j),jsxRuntimeExports.jsx(Button,{width:"100%",height:"90px",background:colors.black,border:"1px dashed",borderColor:colors.gray[500],onClick:()=>$(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"}),"Create New Multisig"]})})]})})})},SignPage$7=_=>{const{mode:a,operations:$,data:{finalizableAmount:j}}=_,{isLoading:et,form:tt,signer:rt,onSign:nt,fee:it}=useSignPageHelpers($,a);return jsxRuntimeExports.jsx(FormProvider,{...tt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Heading,{children:"Finalize"})}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:$.sender.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",children:jsxRuntimeExports.jsx(SignPageFee,{fee:it})}),jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"Withdraw"}),jsxRuntimeExports.jsx(TezTile,{mutezAmount:j}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isLoading:et,onSubmit:nt,signer:rt,text:headerText($.type,a)})})]})})})},FinalizableUnstakeRequest=({account:_,...a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext),{handleAsyncAction:j,isLoading:et}=useAsyncActionHandler(),tt=useSelectedNetwork(),rt=useAccountTotalFinalizableUnstakeAmount(_.address.pkh);if(rt.eq(0))return null;const nt=()=>j(async()=>{const it=makeAccountOperations(_,_,[{type:"finalize_unstake",sender:_.address}]),at=await estimate(it,tt);return $(jsxRuntimeExports.jsx(SignPage$7,{data:{finalizableAmount:rt},mode:"single",operations:at}))});return jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",padding:"15px",background:colors.gray[700],borderRadius:"8px",...a,children:[jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",gap:"8px",children:[jsxRuntimeExports.jsx(PrettyNumber,{number:prettyTezAmount(rt),size:"md"}),jsxRuntimeExports.jsx(Box,{display:"inline",color:colors.gray[450],children:jsxRuntimeExports.jsx(Text,{display:"inline",size:"sm",children:"Ready to be finalized"})})]}),jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Button,{isLoading:et,onClick:nt,children:"Finalize"})})]})},PendingUnstakeRequest=({request:_,account:a,...$})=>{const j=useGetFirstFinalizableCycle()(_.cycle),{tzktExplorerUrl:et}=useSelectedNetwork();return jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",padding:"15px",background:colors.gray[700],borderRadius:"8px",...$,children:[jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",gap:"8px",children:[jsxRuntimeExports.jsx(PrettyNumber,{number:prettyTezAmount(_.amount),size:"md"}),jsxRuntimeExports.jsxs(Box,{display:"inline",color:colors.gray[450],children:[jsxRuntimeExports.jsxs(Text,{display:"inline",size:"sm",children:["Requested in"," "]}),jsxRuntimeExports.jsxs(Heading,{display:"inline",size:"sm",children:["cycle ",_.cycle]})]})]}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column-reverse",children:jsxRuntimeExports.jsxs(Center,{gap:"4px",children:[jsxRuntimeExports.jsxs(Text,{color:colors.gray[300],size:"sm",children:["Ready to be finalized in cycle"," ",jsxRuntimeExports.jsx(Link$1,{href:`${et}/cycles`,isExternal:!0,children:j})]}),jsxRuntimeExports.jsx(HourglassIcon,{stroke:colors.orange})]})})]})},PendingUnstakeRequests=({account:_,...a})=>{const $=useAccountPendingUnstakeRequests(_.address.pkh),j=useAccountTotalFinalizableUnstakeAmount(_.address.pkh),et=$.length+(j.eq(0)?0:1);return et?jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",gap:"20px",width:"100%",padding:"15px",background:colors.gray[800],borderRadius:"8px",...a,children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:"Pending Unstake"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:et})]}),jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",gap:"10px",children:[jsxRuntimeExports.jsx(FinalizableUnstakeRequest,{account:_}),$.map(tt=>jsxRuntimeExports.jsx(PendingUnstakeRequest,{account:_,request:tt},tt.cycle))]})]}):null},buildTzktUrl=(_,a)=>`${_.tzktExplorerUrl}/${a}`,SignPage$6=_=>{const{mode:a,operations:$}=_,{fee:j,operations:et,estimationFailed:tt,isLoading:rt,form:nt,signer:it,reEstimate:at,onSign:st}=useSignPageHelpers($,a),ot=et.operations[0].recipient;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:et.type,signer:et.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:it.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:j})})}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:ot}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:rt,operationType:et.type,reEstimate:at,sender:et.sender}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:tt,isLoading:rt,onSubmit:st,signer:it,text:headerText(et.type,a)})})]})})})},FormPage$5=_=>{var ot;const a=(ot=_.form)==null?void 0:ot.baker,$=useOpenSignPageFormAction({SignPage:SignPage$6,signPageExtraData:void 0,FormPage:FormPage$5,defaultFormPageProps:_,toOperation:toOperation$5}),j=useAddToBatchFormAction(toOperation$5),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(_)}),{formState:{isValid:it,errors:at},handleSubmit:st}=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:a?"Change Baker":"Delegate"}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!!_.sender,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px","data-testid":"baker",isInvalid:!!at.baker,children:[jsxRuntimeExports.jsx(BakersAutocomplete,{allowUnknown:!0,inputName:"baker",label:"Baker"}),at.baker&&jsxRuntimeExports.jsx(FormErrorMessage,{children:at.baker.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:st(tt),onSingleSubmit:st(et)})})]})})})},toOperation$5=_=>({type:"delegation",sender:parsePkh(_.sender),recipient:parseImplicitPkh(_.baker)}),ChangeDelegateNoticeModal=({account:_,delegate:a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",gap:"16px",children:[jsxRuntimeExports.jsx(WarningIcon,{width:"24px",height:"24px",stroke:colors.gray[450],strokeWidth:"3"}),jsxRuntimeExports.jsx(Heading,{children:"Important Notice"})]})]}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(Center,{flexDirection:"column",gap:"32px",children:[jsxRuntimeExports.jsx(Text,{width:"340px",marginTop:"10px",color:colors.gray[400],textAlign:"center",size:"sm",children:"Changing the baker will automatically unstake all the existing staked balance. This balance will be finalizable after 4 cycles."}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:()=>$(jsxRuntimeExports.jsx(FormPage$5,{form:{baker:a.address,sender:_.address.pkh},sender:_})),size:"lg",children:"I understand"})]})})]})},NoticeSteps=({steps:_,...a})=>jsxRuntimeExports.jsx(Flex,{...a,children:_.map(($,j)=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Center,{gap:"10px",color:colors.gray[400],border:"1px solid",borderColor:colors.gray[500],borderRadius:"100px",paddingX:"15px",paddingY:"10px",children:[jsxRuntimeExports.jsx(Heading,{width:"26px",height:"26px",padding:"4px",textAlign:"center",background:colors.gray[500],borderRadius:"100%",size:"sm",children:j+1}),jsxRuntimeExports.jsx(Heading,{textTransform:"uppercase",size:"sm",children:$})]}),j<_.length-1&&jsxRuntimeExports.jsx(Center,{flexGrow:2,children:jsxRuntimeExports.jsx(Box,{width:"30px",height:"1px",border:"1px solid",borderColor:colors.gray[500]})})]},$))}),NewDelegateNoticeModal=({account:_})=>{const{openWith:a}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",gap:"16px",children:[jsxRuntimeExports.jsx(NoticeIcon,{}),jsxRuntimeExports.jsx(Heading,{children:"Delegation"})]})]}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(Center,{flexDirection:"column",gap:"32px",children:[jsxRuntimeExports.jsx(Text,{width:"340px",marginTop:"10px",color:colors.gray[400],textAlign:"center",size:"sm",children:"Earn risk-free rewards by delegating to a Tezos baker. Delegated funds remain in your account, and you can always spend them at will."}),jsxRuntimeExports.jsx(NoticeSteps,{steps:["delegate","stake tez"]}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:()=>a(jsxRuntimeExports.jsx(FormPage$5,{sender:_})),size:"lg",children:"Continue"})]})})]})},NoticeModal$2=({account:_})=>{const a=useGetAccountDelegate()(_.address.pkh);return a?jsxRuntimeExports.jsx(ChangeDelegateNoticeModal,{account:_,delegate:a}):jsxRuntimeExports.jsx(NewDelegateNoticeModal,{account:_})},SignPage$5=_=>{const{mode:a,operations:$}=_,{isLoading:j,form:et,signer:tt,onSign:rt,fee:nt}=useSignPageHelpers($,a),{amount:it}=$.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:$.type,signer:$.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:$.sender.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",children:jsxRuntimeExports.jsx(SignPageFee,{fee:nt})}),jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"Stake amount"}),jsxRuntimeExports.jsx(TezTile,{mutezAmount:it}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isLoading:j,onSubmit:rt,signer:tt,text:headerText($.type,a)})})]})})})},FormPage$4=_=>{const a=useOpenSignPageFormAction({SignPage:SignPage$5,signPageExtraData:void 0,FormPage:FormPage$4,defaultFormPageProps:_,toOperation:toOperation$4}),$=useAddToBatchFormAction(toOperation$4),{onFormSubmitActionHandlers:[j,et],isLoading:tt}=useHandleOnSubmitFormActions([a,$]),rt=useForm({mode:"onBlur",defaultValues:formDefaultValues(_)}),{formState:{isValid:nt,errors:it},register:at,handleSubmit:st}=rt;return jsxRuntimeExports.jsx(FormProvider,{...rt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsxs(ModalHeader,{marginBottom:"32px",children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Heading,{children:"Select amount"})}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:_.sender.address}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!it.prettyAmount,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Enter Amount"}),jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{isDisabled:tt,step:getSmallestUnit(TEZ_DECIMALS),type:"number",...at("prettyAmount",{required:"Amount is required",validate:makeValidateDecimals(TEZ_DECIMALS)}),placeholder:"0.000000"}),jsxRuntimeExports.jsx(InputRightElement,{children:TEZ})]}),it.prettyAmount&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"amount-error",children:it.prettyAmount.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:tt,isValid:nt,onAddToBatch:st(et),onSingleSubmit:st(j)})})]})})})},toOperation$4=_=>({type:"stake",amount:tezToMutez(_.prettyAmount).toFixed(),sender:parsePkh(_.sender)}),NoticeModal$1=({account:_})=>{const{openWith:a}=reactExports.useContext(DynamicModalContext),{setValue:$,watch:j}=useForm({mode:"onBlur",defaultValues:{consent:!1}}),et=!j("consent");return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",gap:"16px",children:[jsxRuntimeExports.jsx(WarningIcon,{width:"24px",height:"24px",stroke:colors.gray[450]}),jsxRuntimeExports.jsx(Heading,{children:"Disclaimer"})]})]}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(Center,{flexDirection:"column",gap:"32px",children:[jsxRuntimeExports.jsx(Text,{width:"340px",marginTop:"10px",color:colors.gray[400],textAlign:"center",size:"sm",children:"Staked balances are locked in your account until they are manually unstaked and finalized. You need to wait 4 cycles to finalize after an unstake."}),jsxRuntimeExports.jsx(Text,{width:"340px",color:colors.gray[400],textAlign:"center",size:"sm",children:"Staked funds are at risk. You might lose a portion of your stake if the chosen baker is slashed for not following Tezos consensus mechanism rules."}),jsxRuntimeExports.jsx(Checkbox,{width:"100%",fontWeight:600,background:colors.gray[600],borderRadius:"8px",onChange:tt=>$("consent",tt.target.checked),paddingX:"50px",paddingY:"25px",children:"I understand and accept the risks."}),jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:et,onClick:()=>a(jsxRuntimeExports.jsx(FormPage$4,{sender:_})),size:"lg",children:"Continue"})]})})]})},SignPage$4=_=>{const{mode:a,operations:$}=_,{fee:j,operations:et,estimationFailed:tt,isLoading:rt,form:nt,signer:it,reEstimate:at,onSign:st}=useSignPageHelpers($,a);return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:et.type,signer:et.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:it.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",paddingX:"4px",children:jsxRuntimeExports.jsx(SignPageFee,{fee:j})}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:rt,operationType:et.type,reEstimate:at,sender:et.sender}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:tt,isLoading:rt,onSubmit:st,signer:it,text:headerText(et.type,a)})})]})})})},FormPage$3=_=>{var st;const{sender:a}=_,$=(st=_.form)==null?void 0:st.baker,j=useOpenSignPageFormAction({SignPage:SignPage$4,signPageExtraData:void 0,FormPage:FormPage$3,defaultFormPageProps:{sender:a},toOperation:toOperation$3}),et=useAddToBatchFormAction(toOperation$3),{onFormSubmitActionHandlers:[tt,rt],isLoading:nt}=useHandleOnSubmitFormActions([j,et]),it=useForm({mode:"onBlur",defaultValues:formDefaultValues({sender:a})}),{handleSubmit:at}=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:at(rt),onSingleSubmit:at(tt)})})]})})})},toOperation$3=_=>({type:"undelegation",sender:parsePkh(_.sender)}),SignPage$3=_=>{const{mode:a,operations:$,data:{stakedBalance:j}}=_,{isLoading:et,form:tt,signer:rt,onSign:nt,fee:it}=useSignPageHelpers($,a),{amount:at}=$.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...tt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:$.type,signer:$.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:$.sender.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",children:jsxRuntimeExports.jsx(SignPageFee,{fee:it})}),jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"Stake amount"}),jsxRuntimeExports.jsx(TezTile,{mutezAmount:j}),jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"Amount to Unstake"}),jsxRuntimeExports.jsx(TezTile,{mutezAmount:at}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isLoading:et,onSubmit:nt,signer:rt,text:headerText($.type,a)})})]})})})},FormPage$2=_=>{const a=_.stakedBalance,$=useOpenSignPageFormAction({SignPage:SignPage$3,signPageExtraData:{stakedBalance:a},FormPage:FormPage$2,defaultFormPageProps:_,toOperation:toOperation$2}),j=useAddToBatchFormAction(toOperation$2),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(_)}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=nt;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsxs(ModalHeader,{marginBottom:"32px",children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Heading,{children:"Select amount"})}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Stake amount"}),jsxRuntimeExports.jsx(TezTile,{mutezAmount:a}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.prettyAmount,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Enter Amount"}),jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{isDisabled:rt,step:getSmallestUnit(TEZ_DECIMALS),type:"number",...st("prettyAmount",{required:"Amount is required",validate:ut=>tezToMutez(ut).gt(BigNumber(a))?"Amount must be less than or equal to the staked balance":makeValidateDecimals(TEZ_DECIMALS)(ut)}),placeholder:"0.000000"}),jsxRuntimeExports.jsx(InputRightElement,{children:TEZ})]}),at.prettyAmount&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"amount-error",children:at.prettyAmount.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation$2=_=>({type:"unstake",amount:tezToMutez(_.prettyAmount).toFixed(),sender:parsePkh(_.sender)}),NoticeModal=({account:_})=>{const{openWith:a}=reactExports.useContext(DynamicModalContext),$=useGetAccountStakedBalance(_.address.pkh);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",gap:"16px",children:[jsxRuntimeExports.jsx(WarningIcon,{width:"24px",height:"24px",stroke:colors.gray[450],strokeWidth:"3"}),jsxRuntimeExports.jsx(Heading,{children:"Important Notice"})]})]}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(Center,{flexDirection:"column",gap:"32px",children:[jsxRuntimeExports.jsx(Text,{width:"340px",marginTop:"10px",color:colors.gray[400],textAlign:"center",size:"sm",children:"After submitting an unstake, the chosen amount will become finalizable after 4 cycles (~10 days). Then, you will need to finalize unstaked balances in order to make them spendable."}),jsxRuntimeExports.jsx(NoticeSteps,{steps:["unstake","finalize"]}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:()=>a(jsxRuntimeExports.jsx(FormPage$2,{sender:_,stakedBalance:$})),size:"lg",children:"I understand"})]})})]})},Row=({label:_,value:a,...$})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"50px",padding:"16px","data-testid":_,...$,children:[jsxRuntimeExports.jsx(Box,{flex:1,children:jsxRuntimeExports.jsx(Heading,{color:colors.gray[400],size:"sm",children:_})}),jsxRuntimeExports.jsx(Box,{flex:1,children:a})]}),RoundStatusDot=({background:_})=>jsxRuntimeExports.jsx(Box,{display:"inline-block",width:"8px",height:"8px",marginRight:"5px",background:_,borderRadius:"100%"}),EarnTab=({account:_})=>{const{openWith:a}=reactExports.useContext(DynamicModalContext),$=useSelectedNetwork(),j=_.address.pkh,et=useGetAccountDelegate()(j),tt=useGetAccountStakedBalance(j);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Row,{borderBottom:`1px solid ${colors.gray[700]}`,borderTopRadius:"8px",_odd:{background:colors.gray[800]},"data-testid":"staked-balance",label:"Staked:",value:prettyTezAmount(tt)}),jsxRuntimeExports.jsx(Row,{borderBottom:`1px solid ${colors.gray[700]}`,_odd:{background:colors.gray[800]},"data-testid":"delegation-status",label:"Delegation:",value:jsxRuntimeExports.jsx(Flex,{justifyContent:"space-between",children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(RoundStatusDot,{background:colors.greenL}),jsxRuntimeExports.jsx(Text,{size:"sm",children:"Active"})]}),jsxRuntimeExports.jsxs(Button,{justifyContent:"space-between",gap:"4px",padding:"0","data-testid":"end-delegation-button",onClick:()=>a(jsxRuntimeExports.jsx(FormPage$3,{form:{sender:j,baker:et.address},sender:_})),size:"sm",variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{display:"inline",children:"End"}),jsxRuntimeExports.jsx(XMarkIcon,{stroke:"inherit"})]})]}):jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(RoundStatusDot,{background:colors.orangeL}),jsxRuntimeExports.jsx(Text,{size:"sm",children:"Inactive"})]})})}),jsxRuntimeExports.jsx(Row,{borderBottomRadius:"8px",_odd:{background:colors.gray[800]},label:"Baker:",value:jsxRuntimeExports.jsx(Flex,{justifyContent:"space-between",children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(AddressPill,{address:et,"data-testid":"current-baker"})}),jsxRuntimeExports.jsxs(Button,{justifyContent:"space-between",gap:"4px",padding:"0","data-testid":"change-delegation-button",onClick:()=>a(jsxRuntimeExports.jsx(NoticeModal$2,{account:_})),size:"sm",variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{display:"inline",children:"Edit"}),jsxRuntimeExports.jsx(PenIcon,{stroke:"inherit"})]})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Text,{color:colors.gray[450],size:"sm",children:"--"})}),jsxRuntimeExports.jsx(ExternalLink,{href:buildTzktUrl($,"bakers"),children:jsxRuntimeExports.jsxs(Button,{padding:"0",variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"7px",size:"sm",children:"View Bakers"}),jsxRuntimeExports.jsx(ExternalLinkIcon,{stroke:"inherit"})]})})]})})}),jsxRuntimeExports.jsx(Flex,{justifyContent:"space-between",gap:"16px",marginTop:"24px",children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{flex:1,isDisabled:!tt,onClick:()=>a(jsxRuntimeExports.jsx(NoticeModal,{account:_})),variant:"secondary",children:"Unstake"}),jsxRuntimeExports.jsx(Button,{flex:1,onClick:()=>a(jsxRuntimeExports.jsx(NoticeModal$1,{account:_})),children:"Stake"})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{flex:1,onClick:()=>a(jsxRuntimeExports.jsx(NoticeModal$2,{account:_})),children:"Delegate"}),jsxRuntimeExports.jsx(Button,{flex:1,isDisabled:!0,children:"Stake"})]})}),jsxRuntimeExports.jsx(PendingUnstakeRequests,{marginTop:"24px",account:_})]})},MultisigDecodedOperation=({operation:_})=>{switch(_.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:_.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:_}),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:_.recipient})]})]});case"contract_origination":case"contract_call":case"stake":case"unstake":case"finalize_unstake":throw new Error(`${_.type} is not supported yet`)}},MultisigOperationAmount=({operation:_})=>{const a=useGetToken();switch(_.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(_.amount)]})]});case"fa1.2":case"fa2":{const $=a(_.contract.pkh,_.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:_.amount}),jsxRuntimeExports.jsx(Text,{display:"inline",color:"white",fontSize:"14px",fontWeight:600,children:j})]}):jsxRuntimeExports.jsxs(Text,{fontSize:"14px",fontWeight:600,children:["-",tokenPrettyAmount(_.amount,$,{showSymbol:!0})]})})]})}case"delegation":case"undelegation":case"contract_origination":case"contract_call":case"stake":case"unstake":case"finalize_unstake":return null}},caseInsensitiveLiteral=_=>z.string().regex(new RegExp(`^${_}$`,"i")),prim=_=>z.object({prim:caseInsensitiveLiteral(_)}),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=_=>(_.length===42&&(_="00"+_),encodeAddress(_)),parseTez=_=>{const a=tezSchema.parse(_),$=a[0].args[1].bytes,j=a[2].args[1].int;return{type:"tez",recipient:parseImplicitPkh(convertToPkh($)),amount:j}},parseTezContract=_=>{const a=contractTezSchema.parse(_),$=a[0].args[1].bytes,j=a[3].args[1].int;return{type:"tez",recipient:parseContractPkh(convertToPkh($)),amount:j}},parseFa2=_=>{const a=fa2Schema.parse(_),$=parseContractPkh(convertToPkh(a[0].args[1].bytes));return a[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,at=rt.args[1].args[1].int;return{type:"fa2",contract:$,sender:parsePkh(convertToPkh(tt)),recipient:parsePkh(convertToPkh(nt)),tokenId:it,amount:at}})})},parseFa1=_=>{const a=fa1Schema.parse(_),$=a[0],j=a[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(_);return{type:"delegation",sender:a.address,recipient:parseImplicitPkh(convertToPkh($[0].args[1].bytes))}},parseRemoveDelegate=(_,a)=>({type:"undelegation",sender:a.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(_.length===0)return $;for(let j=0;j{batchHeadSchema.parse(_.slice(0,2))},decode=(_,a)=>(assertHead(_),parse(_.slice(2),a)),parseRawMichelson=(_,a)=>{const $=JSON.parse(_);return decode($,a)},MultisigDecodedOperations=({rawMichelson:_,sender:a})=>{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:_}):jsxRuntimeExports.jsxs(Box,{height:"50px",padding:"10px",background:colors.gray[900],borderRadius:"8px",children:["Invalid michelson code: ",$.message]})}},UnrecognizedOperation=({rawMichelson:_})=>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(_)})})]})}),MultisigActionButton=({approveOrExecute:_,isLoading:a,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:a,onClick:_,children:"Execute"});case"approvable":return jsxRuntimeExports.jsx(Button,{"data-testid":"multisig-signer-button",isLoading:a,onClick:_,children:"Approve"})}},SignPage$2=({signer:_,operation:a,actionType:$,transactionCount:j})=>{const{handleAsyncAction:et}=useAsyncActionHandler(),{openWith:tt}=reactExports.useContext(DynamicModalContext),rt=useForm({defaultValues:{executeParams:a.estimates}}),nt={...a,estimates:rt.watch("executeParams")},it=st=>et(async()=>{const{opHash:ot}=await executeOperations(nt,st);return tt(jsxRuntimeExports.jsx(SuccessStep,{hash:ot}))},{title:`Failed ${$}`}),at=`${lodashExports.capitalize($)} transaction`;return jsxRuntimeExports.jsx(FormProvider,{...rt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(BatchModalBody,{operation:nt,title:at,transactionCount:j,children:jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{onSubmit:it,signer:_,text:at})})]})})})},MultisigSignerTile=({pendingApprovals:_,sender:a,operation:$,signerAddress:j})=>{const et=useAddressKind$1(j),tt=useGetImplicitAccountSafe(),{isLoading:rt,handleAsyncAction:nt}=useAsyncActionHandler(),{openWith:it}=reactExports.useContext(DynamicModalContext),at=useSelectedNetwork(),st=tt(j.pkh),ot=_===0,ut=()=>nt(async()=>{if(!st)throw new Error("Can't approve or execute with an account you don't own");const mt=ot?"execute":"approve",xt=makeAccountOperations(st,st,[makeMultisigApproveOrExecuteOperation(a.address,mt,$.id)]),Ct=await estimate(xt,at);let Pt;try{Pt=parseRawMichelson($.rawActions,a).length}catch{Pt=1}return it(jsxRuntimeExports.jsx(SignPage$2,{actionType:mt,operation:Ct,signer:st,transactionCount:Pt}))}),dt=getMultisigSignerState({approvals:$.approvals,signerAddress:j,operationIsExecutable:ot,signerAccount:st});return jsxRuntimeExports.jsx(AccountTileBase,{height:"80px",marginTop:"10px",marginBottom:"0",padding:"15px",borderRadius:"8px",backgroundColor:colors.gray[700],icon:jsxRuntimeExports.jsx(AddressTileIcon,{addressKind:et,size:"lg"}),leftElement:jsxRuntimeExports.jsx(LabelAndAddress,{label:et.label,pkh:et.pkh}),rightElement:jsxRuntimeExports.jsx(MultisigActionButton,{approveOrExecute:ut,"data-testid":"multisig-signer-button",isLoading:rt,signerState:dt})})},getMultisigSignerState=({signerAccount:_,operationIsExecutable:a,approvals:$,signerAddress:j})=>{const et=!!$.find(tt=>tt.pkh===j.pkh);return _?et&&!a?"approved":a?"executable":"approvable":et?"approved":"awaitingApprovalByExternalSigner"},MultisigPendingOperation=({operation:_,sender:a})=>{const{signers:$,threshold:j}=a,et=Math.max(j-_.approvals.length,0);return jsxRuntimeExports.jsxs(Box,{marginBottom:"24px",background:colors.gray[800],border:"none",borderRadius:"8px","data-testid":"multisig-pending-operation-"+_.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 #",_.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:_.rawActions,sender:a}),$.map(tt=>jsxRuntimeExports.jsx(MultisigSignerTile,{operation:_,pendingApprovals:et,sender:a,signerAddress:tt},tt.pkh))]})]})},MultisigPendingOperations=({account:_})=>{const $=useGetPendingMultisigOperations()(_);return jsxRuntimeExports.jsx(Box,{margin:"0",padding:"0",children:$.map(j=>jsxRuntimeExports.jsx(MultisigPendingOperation,{operation:j,sender:_},j.id))})},ViewAllLink=({to:_,owner:a,...$})=>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:`${_}?accounts=${a}`,children:[jsxRuntimeExports.jsx(RefreshClockIcon,{display:"inline",stroke:"inherit"}),jsxRuntimeExports.jsx(Text,{display:"inline",size:"sm",children:" View All"})]})}),MAX_NFTS_SIZE=18,NFTsGrid=({owner:_,nfts:a,...$})=>{if(a.length===0)return jsxRuntimeExports.jsx(NoNFTs,{size:"md"});const j=sortedByLastUpdate(a).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/${_}/${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})]})})},`${_}:${fullId(et)}`)})}),a.length>MAX_NFTS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{marginBottom:"40px",owner:_,to:"/nfts"})]})},OperationTileContext=React$2.createContext({mode:"page"}),FEE_FIELDS=["bakerFee","storageFee","allocationFee"],Fee=({operation:_})=>{const a=reactExports.useContext(OperationTileContext),j=useIsOwnedAddress()(_.sender.address);if(a.mode==="drawer"||!j)return null;const et=FEE_FIELDS.reduce((tt,rt)=>rt in _?tt.plus(lodashExports.get(_,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=$(_),et=$(a);return!j&&!et?"unrelated":j?"outgoing":"incoming"},operationSign=_=>{switch(_){case"incoming":return"+";case"outgoing":return"-";case"unrelated":return""}},operationColor=_=>{switch(_){case"incoming":return colors.green;case"outgoing":return colors.orange;case"unrelated":return"white"}},InternalPrefix=({operation:_})=>{var et,tt,rt;let a,$;switch(_.type){case"transaction":a=(et=_.target)==null?void 0:et.address,$=_.sender.address;break;case"origination":case"delegation":a=null,$=_.sender.address;break;case"token_transfer":a=(tt=_.to)==null?void 0:tt.address,$=(rt=_.from)==null?void 0:rt.address;break;case"stake":case"unstake":case"finalize":a=_.sender.address,$=_.sender.address}return useGetOperationDestination($,a)!=="unrelated"?null:jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],"data-testid":"internal-prefix",size:"md",children:"Internal:"})},OperationStatus=({level:_,status:a})=>{const $=useIsBlockFinalised(_);return a===void 0||a==="applied"?$?jsxRuntimeExports.jsx(CheckmarkIcon,{"data-testid":"checkmark"}):jsxRuntimeExports.jsx(HourglassIcon,{"data-testid":"hourglass"}):jsxRuntimeExports.jsx(CrossedCircleIcon,{"data-testid":"crossed-circle"})},OperationTypeWrapper=({children:_})=>reactExports.useContext(OperationTileContext).mode==="drawer"?null:jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],"data-testid":"operation-type",size:"sm",children:_}),Timestamp=({timestamp:_})=>_?jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"timestamp",size:"sm",children:getDisplayTimestamp(_)}):null,getDisplayTimestamp=_=>{const a=new Date,$=new Date(_);return differenceInDays(a,$)<2?formatDistance($,a,{addSuffix:!0}):format($,"dd MMM yyyy")},TzktLink$1=({hash:_,counter:a,transactionId:$,originationId:j,migrationId:et,children:tt,...rt})=>{const{tzktExplorerUrl:nt}=useSelectedNetwork();let it=nt;return _?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:_})=>{var a;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:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Contract Call: ",(a=_.parameter)==null?void 0:a.entrypoint]})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),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:[_.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:_.target})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.sender})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Contract Call"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})},DelegationTile=({operation:_})=>{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:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsx(Heading,{size:"md",children:a})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),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:[_.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:_.newDelegate})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.sender})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:a}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})},FinalizeUnstakeTile=reactExports.memo(({operation:_})=>{const a=prettyTezAmount(String(_.amount));return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-finalize-unstake",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(BakerIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsxs(Center,{gap:"4px",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:"Finalize Unstake:"}),jsxRuntimeExports.jsx(Text,{children:a})]})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),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,{gap:"6px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.sender.address)})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Finalize Unstake"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})}),OriginationTile=({operation:_})=>{const $=_.originatedContract.codeHash===CODE_HASH&&_.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:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsx(Heading,{size:"md",children:$})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),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,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.sender})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Contract Origination"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})},StakeTile=reactExports.memo(({operation:_})=>{const a=prettyTezAmount(String(_.amount));return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-stake",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(BakerIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsxs(Center,{gap:"4px",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:"Stake:"}),jsxRuntimeExports.jsx(Text,{children:a})]})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),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,{gap:"15px",children:[jsxRuntimeExports.jsxs(Flex,{gap:"6px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.baker.address)})]}),jsxRuntimeExports.jsxs(Flex,{gap:"6px","data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.sender.address)})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Stake"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})}),TransactionDirectionIcon=({destination:_,...a})=>_==="outgoing"?jsxRuntimeExports.jsx(OutgoingArrow,{"data-testid":"outgoing-arrow",...a}):_==="incoming"?jsxRuntimeExports.jsx(IncomingArrow,{"data-testid":"incoming-arrow",...a}):jsxRuntimeExports.jsx(ContractIcon,{"data-testid":"unrelated-operation-icon",...a}),TokenTransferTile=({operation:_,tokenTransfer:a,token:$})=>{var ot,ut;const j=a.amount,et=useGetOperationDestination((ot=a.from)==null?void 0:ot.address,(ut=a.to)==null?void 0:ut.address),tt=$.type==="nft",rt=tokenPrettyAmount(j,$,{showSymbol:!0}),nt=operationColor(et),it=tt?"white":nt,at=operationSign(et),st=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:a.migrationId,originationId:a.originationId,transactionId:a.transactionId,children:[jsxRuntimeExports.jsxs(Text,{display:"inline",color:nt,fontWeight:"600",children:[at,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:a.migrationId,originationId:a.originationId,transactionId:a.transactionId,children:jsxRuntimeExports.jsxs(Text,{display:"inline",color:nt,fontWeight:"600",children:[at,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}),st,_&&jsxRuntimeExports.jsx(Fee,{operation:_})]}),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.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:a.to})]}),a.from&&jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.from})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Token Transfer"}),jsxRuntimeExports.jsx(OperationStatus,{level:a.level})]})]})})]})},TransactionTile=({operation:_})=>{var tt;const a=useGetOperationDestination(_.sender.address,(tt=_.target)==null?void 0:tt.address),$=prettyTezAmount(String(_.amount)),j=operationColor(a),et=operationSign(a);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:a}),jsxRuntimeExports.jsx(InternalPrefix,{operation:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",color:j,counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsxs(Text,{color:j,fontWeight:"600",children:[et," ",$]})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),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:[_.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(_.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(_.sender.address)})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Transaction"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})},UnstakeTile=reactExports.memo(({operation:_})=>{const a=prettyTezAmount(String(_.amount));return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-unstake",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(BakerIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsxs(Center,{gap:"4px",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:"Unstake:"}),jsxRuntimeExports.jsx(Text,{children:a})]})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),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,{gap:"15px",children:[jsxRuntimeExports.jsxs(Flex,{gap:"6px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.baker.address)})]}),jsxRuntimeExports.jsxs(Flex,{gap:"6px","data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.sender.address)})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Unstake"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})}),OperationTile=({operation:_})=>{const a=useGetTokenTransfer();switch(_.type){case"token_transfer":{const $=fromRaw$1(_.token);return $?jsxRuntimeExports.jsx(TokenTransferTile,{token:$,tokenTransfer:_}):(console.warn(`Could not parse token transfer ${_.id}`),null)}case"transaction":{const $=!!_.parameter,j=a(_.id);if(j){const et=fromRaw$1(j.token);return et?jsxRuntimeExports.jsx(TokenTransferTile,{operation:_,token:et,tokenTransfer:j}):jsxRuntimeExports.jsx(TransactionTile,{operation:_})}else return $?jsxRuntimeExports.jsx(ContractCallTile,{operation:_}):jsxRuntimeExports.jsx(TransactionTile,{operation:_})}case"delegation":return jsxRuntimeExports.jsx(DelegationTile,{operation:_});case"origination":return jsxRuntimeExports.jsx(OriginationTile,{operation:_});case"stake":return jsxRuntimeExports.jsx(StakeTile,{operation:_});case"unstake":return jsxRuntimeExports.jsx(UnstakeTile,{operation:_});case"finalize":return jsxRuntimeExports.jsx(FinalizeUnstakeTile,{operation:_})}},MAX_OPERATIONS_SIZE=20,OperationListDisplay=({owner:_,operations:a})=>{if(a.length===0)return jsxRuntimeExports.jsx(NoOperations,{size:"md"});const $=a.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)),a.length>MAX_OPERATIONS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{owner:_,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(_.contract);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Text,{...a,marginRight:"4px",children:tokenNameSafe(_)}),$&&jsxRuntimeExports.jsx(VerifiedIcon,{})]})},MAX_TOKENS_SIZE=20,TokenList=({owner:_,tokens:a})=>{if(a.length===0)return jsxRuntimeExports.jsx(NoTokens,{size:"md"});const $=a.slice(0,MAX_TOKENS_SIZE);return jsxRuntimeExports.jsxs(Box,{children:[$.map(j=>jsxRuntimeExports.jsx(TokenTile$1,{token:j},fullId(j))),a.length>MAX_TOKENS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{owner:_,to:"/tokens"})]})},TokenTile$1=({token:_})=>{const a=tokenPrettyAmount(_.balance,_,{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:_.contract}),jsxRuntimeExports.jsx(Box,{marginLeft:"16px",children:jsxRuntimeExports.jsx(TokenNameWithIcon,{fontWeight:600,"data-testid":"token-name",token:_})})]}),jsxRuntimeExports.jsx(Heading,{"data-testid":"token-balance",size:"lg",children:a})]})},useGetOperations=_=>{const a=useSelectedNetwork(),$=useAppDispatch(),j=useRefetchTrigger(),et=useReactQueryErrorHandler(),{isFetching:tt,data:rt,hasNextPage:nt,isLoading:it,fetchNextPage:at,fetchPreviousPage:st,error:ot}=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,dt)=>{var xt;const mt=(xt=lodashExports.maxBy(dt.flat(),"id"))==null?void 0:xt.id;return mt?{lastId:mt,sort:"asc"}:{}},select:({pages:ut})=>filterDuplicatedTokenTransfers([[...ut[0]].sort((dt,mt)=>dt.id{const ut=setInterval(()=>void st(),BLOCK_TIME);return()=>clearInterval(ut)},[st]),reactExports.useEffect(()=>{st()},[j,st]),{operations:rt||[],isFirstLoad:it,isLoading:tt,hasMore:nt,loadMore:at}},fetchOperationsAndUpdateTokensInfo=async(_,a,$,j)=>{const et=await getCombinedOperations($.map(at=>at.address.pkh),a,j),tt=et.filter(at=>at.type==="transaction").map(at=>at.id),rt=await getRelatedTokenTransfers(tt,a),nt=et.filter(at=>at.type==="token_transfer"),it=[...rt,...nt];return _(assetsActions.updateTokenTransfers(it)),_(tokensActions.addTokens({network:a,tokens:it.map(at=>at.token)})),et},filterDuplicatedTokenTransfers=_=>{const a=new Set(_.filter($=>$.type!=="token_transfer").map($=>$.id));return _.filter($=>$.type!=="token_transfer"||!a.has($.transactionId))},SmallTab=({children:_,...a})=>jsxRuntimeExports.jsx(Tab,{...a,fontSize:"sm",paddingX:3,children:_}),AssetsPanel=({tokens:_,nfts:a,account:$})=>{const j=useGetPendingMultisigOperations(),et=$.type==="multisig"&&j($).length>0,tt=useGetAccountUnstakeRequests($.address.pkh).length>0,rt=et||tt,nt=useSelectedNetwork(),{operations:it,isFirstLoad:at}=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:[rt&&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-nfts-tab",children:"NFTs"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-tokens-tab",children:"Tokens"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-earn-tab",children:"Earn"})]}),jsxRuntimeExports.jsx(ExternalLink,{href:buildTzktUrl(nt,$.address.pkh),children:jsxRuntimeExports.jsxs(Button,{padding:"0",variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"7px",size:"sm",children:"View on Tzkt"}),jsxRuntimeExports.jsx(ExternalLinkIcon,{stroke:"inherit"})]})})]}),jsxRuntimeExports.jsxs(TabPanels,{height:"100%",children:[rt&&jsxRuntimeExports.jsxs(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:"60px","data-testid":"account-card-pending-tab-panel",paddingX:"0",children:[et&&jsxRuntimeExports.jsx(MultisigPendingOperations,{account:$}),tt&&jsxRuntimeExports.jsx(PendingUnstakeRequests,{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:at?"flex":"none",height:"50px",children:jsxRuntimeExports.jsx(Image$1,{width:"150px",height:"75px",src:"./static/media/loading-wheel.gif"})}),!at&&jsxRuntimeExports.jsx(OperationListDisplay,{operations:it,owner:$.address.pkh})]})}),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:a,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:_})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",paddingTop:"24px","data-testid":"account-card-earn-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(EarnTab,{account:$})})]})]})},MultisigApprovers=({signers:_})=>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:_.map(a=>jsxRuntimeExports.jsx(AddressPill,{marginRight:"12px",address:a},a.pkh))})})]})})}),renameAccount=(_,a)=>($,j)=>{const{accounts:et,multisigs:tt,contacts:rt}=j(),nt=_.type==="multisig",it=et.items.map(ot=>ot.label),at=tt.items.map(ot=>ot.label),st=Object.values(rt).map(ot=>ot.name);[it,at,st].flat().includes(a)||$(nt?multisigsSlice.actions.setName({newName:a,account:_}):accountsSlice.actions.renameAccount({newName:a,account:_}))},RenameAccountModal=({account:_})=>{const a=useAppDispatch(),{onClose:$}=reactExports.useContext(DynamicModalContext),j=({name:ot})=>{a(renameAccount(_,ot)),$()},{handleSubmit:et,formState:{isValid:tt,errors:rt},register:nt,reset:it}=useForm({mode:"onBlur",defaultValues:{name:_.label}}),at=({name:ot})=>{j({name:ot.trim()}),it()},st=useValidateName(_.label);return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:et(at),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:st}),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:_})=>{const{openWith:a,onClose:$}=reactExports.useContext(DynamicModalContext),j=useNavigate(),et=useImplicitAccounts().length===1,tt=useRemoveAccount();let rt;switch(_.type){case"secret_key":case"ledger":case"social":rt=()=>a(jsxRuntimeExports.jsx(ConfirmationModal,{buttonLabel:at,description:it,onSubmit:()=>{tt(_),$(),j("/")},title:nt}));break}const nt="Remove Account";let it="Are you sure you want to remove this account?",at="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.",at="Remove & Off-board"),jsxRuntimeExports.jsx(RenameRemoveMenu,{onRemove:rt,onRename:()=>a(jsxRuntimeExports.jsx(RenameAccountModal,{account:_}))})},TezRecapDisplay=_=>jsxRuntimeExports.jsxs(Box,{textAlign:_.center?"center":"initial",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:prettyTezAmount(_.balance)}),_.dollarBalance!==void 0&&jsxRuntimeExports.jsxs(Text,{marginTop:"6px",color:colors.gray[400],size:"sm",children:["$",_.dollarBalance.toFixed(2)]})]}),RoundButton=({icon:_,label:a,onClick:$=()=>{}})=>jsxRuntimeExports.jsxs(Box,{className:"account-drawer-cta-button",color:colors.gray[300],textAlign:"center",_hover:{color:colors.green},cursor:"pointer","data-testid":"account-drawer-cta-button",marginX:"24px",onClick:$,children:[jsxRuntimeExports.jsx(IconButton,{className:"account-drawer-cta-button-icon",marginBottom:"8px","aria-label":"button",icon:_,size:"lg",variant:"circle_without_color"}),jsxRuntimeExports.jsx(Text,{cursor:"pointer",size:"sm",children:a})]}),AccountDrawerDisplay=({onSend:_,onReceive:a=()=>{},tokens:$,nfts:j,account:et})=>{const tt=et.type==="multisig",{openWith:rt}=reactExports.useContext(DynamicModalContext),nt=et.address.pkh,it=useGetAccountBalance()(nt),at=useGetDollarBalance()(nt);return jsxRuntimeExports.jsxs(Flex,{zIndex:2,alignItems:"center",flexDirection:"column",height:"100%",marginTop:"-86px",paddingTop:"86px",paddingRight:"30px",background:accountIconGradient({account:et,radius:"350px",opacity:"35",mainBackgroundColor:"transparent",left:"300px",top:"-125px"}),"data-testid":`account-card-${et.address.pkh}`,children:[jsxRuntimeExports.jsx(AccountTileIcon,{account:et,size:"lg"}),jsxRuntimeExports.jsx(Heading,{marginTop:"24px",size:"md",children:et.label}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"8px",marginBottom:"30px",children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"4px",address:et.address,mode:{type:"no_icons"}}),jsxRuntimeExports.jsx(RenameRemoveMenuSwitch,{account:et})]}),it&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:it,center:!0,dollarBalance:at}),jsxRuntimeExports.jsxs(Center,{marginTop:"34px",children:[jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(OutgoingArrow,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Send",onClick:_}),jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(IncomingArrow,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Receive",onClick:a}),!tt&&jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(PlusIcon,{stroke:"currentcolor"}),label:"Buy Tez",onClick:()=>rt(jsxRuntimeExports.jsx(BuyTezForm,{recipient:et.address.pkh}))}),jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(BakerIcon,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Delegate",onClick:()=>rt(jsxRuntimeExports.jsx(NoticeModal$2,{account:et}))})]}),tt&&jsxRuntimeExports.jsx(MultisigApprovers,{signers:et.signers}),jsxRuntimeExports.jsx(AssetsPanel,{account:et,nfts:j,tokens:$})]})};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]",at="[object AsyncFunction]",st="[object Boolean]",ot="[object Date]",ut="[object Error]",dt="[object Function]",mt="[object GeneratorFunction]",xt="[object Map]",Ct="[object Number]",Pt="[object Null]",Tt="[object Object]",Mt="[object Promise]",Lt="[object Proxy]",Nt="[object RegExp]",zt="[object Set]",Bt="[object String]",It="[object Symbol]",Dt="[object Undefined]",Ft="[object WeakMap]",Ot="[object ArrayBuffer]",yt="[object DataView]",bt="[object Float32Array]",ct="[object Float64Array]",ht="[object Int8Array]",vt="[object Int16Array]",wt="[object Int32Array]",At="[object Uint8Array]",Rt="[object Uint8ClampedArray]",Et="[object Uint16Array]",$t="[object Uint32Array]",_t=/[\\^$.*+?()[\]{}|]/g,jt=/^\[object .+?Constructor\]$/,tr=/^(?:0|[1-9]\d*)$/,nr={};nr[bt]=nr[ct]=nr[ht]=nr[vt]=nr[wt]=nr[At]=nr[Rt]=nr[Et]=nr[$t]=!0,nr[nt]=nr[it]=nr[Ot]=nr[st]=nr[yt]=nr[ot]=nr[ut]=nr[dt]=nr[xt]=nr[Ct]=nr[Tt]=nr[Nt]=nr[zt]=nr[Bt]=nr[Ft]=!1;var ir=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Wt=typeof self=="object"&&self&&self.Object===Object&&self,Kt=ir||Wt||Function("return this")(),Jt=a&&!a.nodeType&&a,Ht=Jt&&!0&&_&&!_.nodeType&&_,Vt=Ht&&Ht.exports===Jt,Qt=Vt&&ir.process,dr=function(){try{return Qt&&Qt.binding&&Qt.binding("util")}catch{}}(),yr=dr&&dr.isTypedArray;function pr(_r,Xt){for(var cr=-1,gr=_r==null?0:_r.length,Dr=0,rn=[];++cr-1}function gs(_r,Xt){var cr=this.__data__,gr=vo(cr,_r);return gr<0?(++this.size,cr.push([_r,Xt])):cr[gr][1]=Xt,this}yn.prototype.clear=En,yn.prototype.delete=hs,yn.prototype.get=ps,yn.prototype.has=ms,yn.prototype.set=gs;function qn(_r){var Xt=-1,cr=_r==null?0:_r.length;for(this.clear();++XtPn))return!1;var _n=rn.get(_r);if(_n&&rn.get(Xt))return _n==Xt;var Bn=-1,Fn=!0,ts=cr&tt?new es:void 0;for(rn.set(_r,Xt),rn.set(Xt,_r);++Bn-1&&_r%1==0&&_r-1&&_r%1==0&&_r<=rt}function Io(_r){var Xt=typeof _r;return _r!=null&&(Xt=="object"||Xt=="function")}function Ro(_r){return _r!=null&&typeof _r=="object"}var Mo=yr?fr(yr):El;function Jl(_r){return _o(_r)?xl(_r):wl(_r)}function rs(){return[]}function Xn(){return!1}_.exports=Cs})(lodash_isequal,lodash_isequal.exports);var lodash_isequalExports=lodash_isequal.exports,qrcode={exports:{}};(function(_,a){var $=function(){var j=function(Nt,zt){var Bt=236,It=17,Dt=Nt,Ft=tt[zt],Ot=null,yt=0,bt=null,ct=[],ht={},vt=function(Kt,Jt){yt=Dt*4+17,Ot=function(Ht){for(var Vt=new Array(Ht),Qt=0;Qt=7&&$t(Kt),bt==null&&(bt=nr(Dt,Ft,ct)),jt(bt,Jt)},wt=function(Kt,Jt){for(var Ht=-1;Ht<=7;Ht+=1)if(!(Kt+Ht<=-1||yt<=Kt+Ht))for(var Vt=-1;Vt<=7;Vt+=1)Jt+Vt<=-1||yt<=Jt+Vt||(0<=Ht&&Ht<=6&&(Vt==0||Vt==6)||0<=Vt&&Vt<=6&&(Ht==0||Ht==6)||2<=Ht&&Ht<=4&&2<=Vt&&Vt<=4?Ot[Kt+Ht][Jt+Vt]=!0:Ot[Kt+Ht][Jt+Vt]=!1)},At=function(){for(var Kt=0,Jt=0,Ht=0;Ht<8;Ht+=1){vt(!0,Ht);var Vt=nt.getLostPoint(ht);(Ht==0||Kt>Vt)&&(Kt=Vt,Jt=Ht)}return Jt},Rt=function(){for(var Kt=8;Kt>Ht&1)==1;Ot[Math.floor(Ht/3)][Ht%3+yt-8-3]=Vt}for(var Ht=0;Ht<18;Ht+=1){var Vt=!Kt&&(Jt>>Ht&1)==1;Ot[Ht%3+yt-8-3][Math.floor(Ht/3)]=Vt}},_t=function(Kt,Jt){for(var Ht=Ft<<3|Jt,Vt=nt.getBCHTypeInfo(Ht),Qt=0;Qt<15;Qt+=1){var dr=!Kt&&(Vt>>Qt&1)==1;Qt<6?Ot[Qt][8]=dr:Qt<8?Ot[Qt+1][8]=dr:Ot[yt-15+Qt][8]=dr}for(var Qt=0;Qt<15;Qt+=1){var dr=!Kt&&(Vt>>Qt&1)==1;Qt<8?Ot[8][yt-Qt-1]=dr:Qt<9?Ot[8][15-Qt-1+1]=dr:Ot[8][15-Qt-1]=dr}Ot[yt-8][8]=!Kt},jt=function(Kt,Jt){for(var Ht=-1,Vt=yt-1,Qt=7,dr=0,yr=nt.getMaskFunction(Jt),pr=yt-1;pr>0;pr-=2)for(pr==6&&(pr-=1);;){for(var kr=0;kr<2;kr+=1)if(Ot[Vt][pr-kr]==null){var Ir=!1;dr>>Qt&1)==1);var lr=yr(Vt,pr-kr);lr&&(Ir=!Ir),Ot[Vt][pr-kr]=Ir,Qt-=1,Qt==-1&&(dr+=1,Qt=7)}if(Vt+=Ht,Vt<0||yt<=Vt){Vt-=Ht,Ht=-Ht;break}}},tr=function(Kt,Jt){for(var Ht=0,Vt=0,Qt=0,dr=new Array(Jt.length),yr=new Array(Jt.length),pr=0;pr=0?Rr.getAt(Pr):0}}for(var Ar=0,lr=0;lrpr*8)throw"code length overflow. ("+Qt.getLengthInBits()+">"+pr*8+")";for(Qt.getLengthInBits()+4<=pr*8&&Qt.put(0,4);Qt.getLengthInBits()%8!=0;)Qt.putBit(!1);for(;!(Qt.getLengthInBits()>=pr*8||(Qt.put(Bt,8),Qt.getLengthInBits()>=pr*8));)Qt.put(It,8);return tr(Qt,Vt)};ht.addData=function(Kt,Jt){Jt=Jt||"Byte";var Ht=null;switch(Jt){case"Numeric":Ht=ut(Kt);break;case"Alphanumeric":Ht=dt(Kt);break;case"Byte":Ht=mt(Kt);break;case"Kanji":Ht=xt(Kt);break;default:throw"mode:"+Jt}ct.push(Ht),bt=null},ht.isDark=function(Kt,Jt){if(Kt<0||yt<=Kt||Jt<0||yt<=Jt)throw Kt+","+Jt;return Ot[Kt][Jt]},ht.getModuleCount=function(){return yt},ht.make=function(){if(Dt<1){for(var Kt=1;Kt<40;Kt++){for(var Jt=st.getRSBlocks(Kt,Ft),Ht=ot(),Vt=0;Vt"u"?Kt*4:Jt;var Ht="";Ht+='";for(var Qt=0;Qt';Ht+=""}return Ht+="",Ht+="
",Ht},ht.createSvgTag=function(Kt,Jt,Ht,Vt){var Qt={};typeof arguments[0]=="object"&&(Qt=arguments[0],Kt=Qt.cellSize,Jt=Qt.margin,Ht=Qt.alt,Vt=Qt.title),Kt=Kt||2,Jt=typeof Jt>"u"?Kt*4:Jt,Ht=typeof Ht=="string"?{text:Ht}:Ht||{},Ht.text=Ht.text||null,Ht.id=Ht.text?Ht.id||"qrcode-description":null,Vt=typeof Vt=="string"?{text:Vt}:Vt||{},Vt.text=Vt.text||null,Vt.id=Vt.text?Vt.id||"qrcode-title":null;var dr=ht.getModuleCount()*Kt+Jt*2,yr,pr,kr,Ir,lr="",fr;for(fr="l"+Kt+",0 0,"+Kt+" -"+Kt+",0 0,-"+Kt+"z ",lr+=''+ir(Vt.text)+"":"",lr+=Ht.text?''+ir(Ht.text)+"":"",lr+='',lr+='"u"?Kt*4:Jt;var Ht=ht.getModuleCount()*Kt+Jt*2,Vt=Jt,Qt=Ht-Jt;return Lt(Ht,Ht,function(dr,yr){if(Vt<=dr&&dr"u"?Kt*4:Jt;var Vt=ht.getModuleCount()*Kt+Jt*2,Qt="";return Qt+="",Qt};var ir=function(Kt){for(var Jt="",Ht=0;Ht":Jt+=">";break;case"&":Jt+="&";break;case'"':Jt+=""";break;default:Jt+=Vt;break}}return Jt},Wt=function(Kt){var Jt=1;Kt=typeof Kt>"u"?Jt*2:Kt;var Ht=ht.getModuleCount()*Jt+Kt*2,Vt=Kt,Qt=Ht-Kt,dr,yr,pr,kr,Ir,lr={"██":"█","█ ":"▀"," █":"▄"," ":" "},fr={"██":"▀","█ ":"▀"," █":" "," ":" "},Er="";for(dr=0;dr=Qt?fr[Ir]:lr[Ir];Er+=` `}return Ht%2&&Kt>0?Er.substring(0,Er.length-Ht-1)+Array(Ht+1).join("▀"):Er.substring(0,Er.length-1)};return ht.createASCII=function(Kt,Jt){if(Kt=Kt||1,Kt<2)return Wt(Jt);Kt-=1,Jt=typeof Jt>"u"?Kt*2:Jt;var Ht=ht.getModuleCount()*Kt+Jt*2,Vt=Jt,Qt=Ht-Jt,dr,yr,pr,kr,Ir=Array(Kt+1).join("██"),lr=Array(Kt+1).join(" "),fr="",Er="";for(dr=0;dr>>8),Ft.push(bt&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 Nt=[[],[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,Bt=7973,It=21522,Dt={},Ft=function(Ot){for(var yt=0;Ot!=0;)yt+=1,Ot>>>=1;return yt};return Dt.getBCHTypeInfo=function(Ot){for(var yt=Ot<<10;Ft(yt)-Ft(zt)>=0;)yt^=zt<=0;)yt^=Bt<5&&(bt+=3+vt-5)}for(var ct=0;ct=256;)Dt-=255;return Nt[Dt]},It}();function at(Nt,zt){if(typeof Nt.length>"u")throw Nt.length+"/"+zt;var Bt=function(){for(var Dt=0;Dt"u")throw"bad rs block @ typeNumber:"+Dt+"/errorCorrectionLevel:"+Ft;for(var yt=Ot.length/3,bt=[],ct=0;ct>>7-It%8&1)==1},Bt.put=function(It,Dt){for(var Ft=0;Ft>>Dt-Ft-1&1)==1)},Bt.getLengthInBits=function(){return zt},Bt.putBit=function(It){var Dt=Math.floor(zt/8);Nt.length<=Dt&&Nt.push(0),It&&(Nt[Dt]|=128>>>zt%8),zt+=1},Bt},ut=function(Nt){var zt=et.MODE_NUMBER,Bt=Nt,It={};It.getMode=function(){return zt},It.getLength=function(Ot){return Bt.length},It.write=function(Ot){for(var yt=Bt,bt=0;bt+2>>8&255)*192+(bt&255),Ft.put(bt,13),yt+=2}if(yt>>8)},zt.writeBytes=function(Bt,It,Dt){It=It||0,Dt=Dt||Bt.length;for(var Ft=0;Ft0&&(Bt+=","),Bt+=Nt[It];return Bt+="]",Bt},zt},Pt=function(){var Nt=0,zt=0,Bt=0,It="",Dt={},Ft=function(yt){It+=String.fromCharCode(Ot(yt&63))},Ot=function(yt){if(!(yt<0)){if(yt<26)return 65+yt;if(yt<52)return 97+(yt-26);if(yt<62)return 48+(yt-52);if(yt==62)return 43;if(yt==63)return 47}throw"n:"+yt};return Dt.writeByte=function(yt){for(Nt=Nt<<8|yt&255,zt+=8,Bt+=1;zt>=6;)Ft(Nt>>>zt-6),zt-=6},Dt.flush=function(){if(zt>0&&(Ft(Nt<<6-zt),Nt=0,zt=0),Bt%3!=0)for(var yt=3-Bt%3,bt=0;bt=zt.length){if(Dt==0)return-1;throw"unexpected end of file./"+Dt}var yt=zt.charAt(Bt);if(Bt+=1,yt=="=")return Dt=0,-1;if(yt.match(/^\s$/))continue;It=It<<6|Ot(yt.charCodeAt(0)),Dt+=6}var bt=It>>>Dt-8&255;return Dt-=8,bt};var Ot=function(yt){if(65<=yt&&yt<=90)return yt-65;if(97<=yt&&yt<=122)return yt-97+26;if(48<=yt&&yt<=57)return yt-48+52;if(yt==43)return 62;if(yt==47)return 63;throw"c:"+yt};return Ft},Mt=function(Nt,zt){var Bt=Nt,It=zt,Dt=new Array(Nt*zt),Ft={};Ft.setPixel=function(ct,ht,vt){Dt[ht*Bt+ct]=vt},Ft.write=function(ct){ct.writeString("GIF87a"),ct.writeShort(Bt),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(Bt),ct.writeShort(It),ct.writeByte(0);var ht=2,vt=yt(ht);ct.writeByte(ht);for(var wt=0;vt.length-wt>255;)ct.writeByte(255),ct.writeBytes(vt,wt,255),wt+=255;ct.writeByte(vt.length-wt),ct.writeBytes(vt,wt,vt.length-wt),ct.writeByte(0),ct.writeString(";")};var Ot=function(ct){var ht=ct,vt=0,wt=0,At={};return At.write=function(Rt,Et){if(Rt>>>Et)throw"length over";for(;vt+Et>=8;)ht.writeByte(255&(Rt<>>=8-vt,wt=0,vt=0;wt=Rt<0&&ht.writeByte(wt)},At},yt=function(ct){for(var ht=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){_.exports=j()}(function(){return $})})(qrcode);var qrcodeExports=qrcode.exports,__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var _=function(a,$){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,et){j.__proto__=et}||function(j,et){for(var tt in et)Object.prototype.hasOwnProperty.call(et,tt)&&(j[tt]=et[tt])},_(a,$)};return function(a,$){if(typeof $!="function"&&$!==null)throw new TypeError("Class extends value "+String($)+" is not a constructor or null");_(a,$);function j(){this.constructor=a}a.prototype=$===null?Object.create($):(j.prototype=$.prototype,new j)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(_){for(var a,$=1,j=arguments.length;$=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},a.prototype.drawRoundedSquare=function($,j,et,tt,rt,nt,it,at){at.lineWidth=$,at.fillStyle=rt,at.strokeStyle=rt,et+=$/2,j+=$/2,tt-=$,Array.isArray(nt)||(nt=[nt,nt,nt,nt]),nt=nt.map(function(mt){return mt=Math.min(mt,tt/2),mt<0?0:mt});var st=nt[0]||0,ot=nt[1]||0,ut=nt[2]||0,dt=nt[3]||0;at.beginPath(),at.moveTo(j+st,et),at.lineTo(j+tt-ot,et),ot&&at.quadraticCurveTo(j+tt,et,j+tt,et+ot),at.lineTo(j+tt,et+tt-ut),ut&&at.quadraticCurveTo(j+tt,et+tt,j+tt-ut,et+tt),at.lineTo(j+dt,et+tt),dt&&at.quadraticCurveTo(j,et+tt,j,et+tt-dt),at.lineTo(j,et+st),st&&at.quadraticCurveTo(j,et,j+st,et),at.closePath(),at.stroke(),it&&at.fill()},a.prototype.drawPositioningPattern=function($,j,et,tt,rt,nt,it){it===void 0&&(it=[0,0,0,0]);var at=Math.ceil(j),st,ot;typeof it!="number"&&!Array.isArray(it)?(st=it.outer||0,ot=it.inner||0):(st=it,ot=st);var ut,dt;typeof nt!="string"?(ut=nt.outer,dt=nt.inner):(ut=nt,dt=nt);var mt=tt*j+et,xt=rt*j+et,Ct=j*7;this.drawRoundedSquare(at,xt,mt,Ct,ut,st,!1,$),Ct=j*3,mt+=j*2,xt+=j*2,this.drawRoundedSquare(at,xt,mt,Ct,dt,ot,!0,$)},a.prototype.isInPositioninZone=function($,j,et){return et.some(function(tt){return j>=tt.row&&j<=tt.row+7&&$>=tt.col&&$<=tt.col+7})},a.prototype.transformPixelLengthIntoNumberOfCells=function($,j){return $/j},a.prototype.isCoordinateInImage=function($,j,et,tt,rt,nt,it,at){if(at){var st=2,ot=this.transformPixelLengthIntoNumberOfCells(rt,it),ut=this.transformPixelLengthIntoNumberOfCells(nt,it),dt=this.transformPixelLengthIntoNumberOfCells(et,it)-1,mt=this.transformPixelLengthIntoNumberOfCells(tt,it)-1;return j>=ot-st&&j<=ot+dt+st&&$>=ut-st&&$<=ut+mt+st}else return!1},a.prototype.shouldComponentUpdate=function($){return!isEqual$1(this.props,$)},a.prototype.componentDidMount=function(){this.update()},a.prototype.componentDidUpdate=function(){this.update()},a.prototype.update=function(){var $,j=this.props,et=j.value,tt=j.ecLevel,rt=j.enableCORS,nt=j.bgColor,it=j.fgColor,at=j.logoImage,st=j.logoOpacity,ot=j.logoOnLoad,ut=j.removeQrCodeBehindLogo,dt=j.qrStyle,mt=j.eyeRadius,xt=j.eyeColor,Ct=j.logoPaddingStyle,Pt=+this.props.size,Tt=+this.props.quietZone,Mt=this.props.logoWidth?+this.props.logoWidth:0,Lt=this.props.logoHeight?+this.props.logoHeight:0,Nt=this.props.logoPadding?+this.props.logoPadding:0,zt=qrGenerator(0,tt);zt.addData(this.utf16to8(et)),zt.make();var Bt=($=this.canvasRef)===null||$===void 0?void 0:$.current,It=Bt.getContext("2d"),Dt=Pt+2*Tt,Ft=zt.getModuleCount(),Ot=Pt/Ft,yt=window.devicePixelRatio||1;Bt.height=Bt.width=Dt*yt,It.scale(yt,yt),It.fillStyle=nt,It.fillRect(0,0,Dt,Dt);var bt=Tt,ct=[{row:0,col:0},{row:0,col:Ft-7},{row:Ft-7,col:0}];if(It.strokeStyle=it,dt==="dots"){It.fillStyle=it;for(var ht=Ot/2,vt=0;vt0&&!zt.isDark(vt-1,wt)&&wt>0&&!zt.isDark(vt,wt-1)&&(At[0]=!0),vt>0&&!zt.isDark(vt-1,wt)&&wt0&&!zt.isDark(vt,wt-1)&&(At[3]=!0);var Rt=Math.ceil((wt+1)*Ot)-Math.floor(wt*Ot),Et=Math.ceil((vt+1)*Ot)-Math.floor(vt*Ot);It.fillStyle=it,It.beginPath(),It.arc(Math.round(wt*Ot)+ht+bt,Math.round(vt*Ot)+ht+bt,ht,0,2*Math.PI,!1),It.closePath(),It.fill(),At[0]||It.fillRect(Math.round(wt*Ot)+bt,Math.round(vt*Ot)+bt,Rt/2,Et/2),At[1]||It.fillRect(Math.round(wt*Ot)+bt+Math.floor(Rt/2),Math.round(vt*Ot)+bt,Rt/2,Et/2),At[2]||It.fillRect(Math.round(wt*Ot)+bt+Math.floor(Rt/2),Math.round(vt*Ot)+bt+Math.floor(Et/2),Rt/2,Et/2),At[3]||It.fillRect(Math.round(wt*Ot)+bt,Math.round(vt*Ot)+bt+Math.floor(Et/2),Rt/2,Et/2)}}else for(var vt=0;vt{const $=useGetOwnedAccountSafe()(_);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:_})})})}),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(_),mode:{type:"no_icons"}})})]})})]})},AccountCard=({accountPkh:_})=>{const a=useGetOwnedAccount(),$=useGetAccountAllTokens(),j=useGetAccountNFTs(),{openWith:et}=reactExports.useContext(DynamicModalContext),tt=a(_),rt=$(_),nt=sortedByLastUpdate(j(_));return jsxRuntimeExports.jsx(AccountDrawerDisplay,{account:tt,nfts:nt,onReceive:()=>et(jsxRuntimeExports.jsx(ReceiveModal,{pkh:_})),onSend:()=>et(jsxRuntimeExports.jsx(FormPage$6,{sender:tt})),tokens:rt})},InfoModal=({account:_})=>{const a=[{title:"Template",content:_.derivationPathTemplate},{title:"Path",content:_.derivationPath},{title:"Type (Curve)",content:_.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:a.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(_.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:_})),variant:"CTAWithIcon",...a,children:jsxRuntimeExports.jsx(FolderInfoIcon,{stroke:"currentcolor"})})}},CloseDrawerButton=({onClose:_})=>jsxRuntimeExports.jsx(Button,{minWidth:"24px",padding:"0","data-testid":"close-drawer-button",onClick:_,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 at=it.endsWith(".css"),st=at?'[rel="stylesheet"]':"";if(!!j)for(let dt=tt.length-1;dt>=0;dt--){const mt=tt[dt];if(mt.href===it&&(!at||mt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${it}"]${st}`))return;const ut=document.createElement("link");if(ut.rel=at?"stylesheet":scriptRel,at||(ut.as="script",ut.crossOrigin=""),ut.href=it,nt&&ut.setAttribute("nonce",nt),document.head.appendChild(ut),at)return new Promise((dt,mt)=>{ut.addEventListener("load",dt),ut.addEventListener("error",()=>mt(new Error(`Unable to preload CSS for ${it}`)))})}))}return et.then(()=>a()).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=a,$.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($,a[$])}function stdOnEnd(_,a){_.onload=function(){this.onerror=this.onload=null,a(null,_)},_.onerror=function(){this.onerror=this.onload=null,a(new Error("Failed to load "+this.src),_)}}function ieOnEnd(_,a){_.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,a(null,_))}}var isMergeableObject=function _(a){return isNonNullObject(a)&&!isSpecial(a)};function isNonNullObject(_){return!!_&&typeof _=="object"}function isSpecial(_){var a=Object.prototype.toString.call(_);return a==="[object RegExp]"||a==="[object Date]"||isReactElement(_)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(_){return _.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(_){return Array.isArray(_)?[]:{}}function cloneUnlessOtherwiseSpecified(_,a){return a.clone!==!1&&a.isMergeableObject(_)?deepmerge(emptyTarget(_),_,a):_}function defaultArrayMerge(_,a,$){return _.concat(a).map(function(j){return cloneUnlessOtherwiseSpecified(j,$)})}function getMergeFunction(_,a){if(!a.customMerge)return deepmerge;var $=a.customMerge(_);return typeof $=="function"?$:deepmerge}function getEnumerableOwnPropertySymbols(_){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(_).filter(function(a){return Object.propertyIsEnumerable.call(_,a)}):[]}function getKeys(_){return Object.keys(_).concat(getEnumerableOwnPropertySymbols(_))}function propertyIsOnObject(_,a){try{return a in _}catch{return!1}}function propertyIsUnsafe(_,a){return propertyIsOnObject(_,a)&&!(Object.hasOwnProperty.call(_,a)&&Object.propertyIsEnumerable.call(_,a))}function mergeObject(_,a,$){var j={};return $.isMergeableObject(_)&&getKeys(_).forEach(function(et){j[et]=cloneUnlessOtherwiseSpecified(_[et],$)}),getKeys(a).forEach(function(et){propertyIsUnsafe(_,et)||(propertyIsOnObject(_,et)&&$.isMergeableObject(a[et])?j[et]=getMergeFunction(et,$)(_[et],a[et],$):j[et]=cloneUnlessOtherwiseSpecified(a[et],$))}),j}function deepmerge(_,a,$){$=$||{},$.arrayMerge=$.arrayMerge||defaultArrayMerge,$.isMergeableObject=$.isMergeableObject||isMergeableObject,$.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var j=Array.isArray(a),et=Array.isArray(_),tt=j===et;return tt?j?$.arrayMerge(_,a,$):mergeObject(_,a,$):cloneUnlessOtherwiseSpecified(a,$)}deepmerge.all=function _(a,$){if(!Array.isArray(a))throw new Error("first argument should be an array");return a.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 a)__defProp$6(_,$,{get:a[$],enumerable:!0})},__copyProps$6=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$6(a))!__hasOwnProp$6.call(_,et)&&et!==$&&__defProp$6(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$6(a,et))||j.enumerable});return _},__toESM$4=(_,a,$)=>($=_!=null?__create$4(__getProtoOf$4(_)):{},__copyProps$6(!_||!_.__esModule?__defProp$6($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$6=_=>__copyProps$6(__defProp$6({},"__esModule",{value:!0}),_),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=_=>import_react$2.default.lazy(async()=>{const a=await _();return typeof a.default=="function"?a:a.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(_ instanceof Array)return;const $=_.match(a);if($){const j=$[1];if(j.match(MATCH_START_STAMP))return parseTimeString(j);if(MATCH_NUMERIC.test(j))return parseInt(j)}}function parseTimeString(_){let a=0,$=MATCH_START_STAMP.exec(_);for(;$!==null;){const[,j,et]=$;et==="h"&&(a+=parseInt(j,10)*60*60),et==="m"&&(a+=parseInt(j,10)*60),et==="s"&&(a+=parseInt(j,10)),$=MATCH_START_STAMP.exec(_)}return a}function parseStartTime(_){return parseTimeParam(_,MATCH_START_QUERY)}function parseEndTime(_){return parseTimeParam(_,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(_){return Object.keys(_).map(a=>`${a}=${_[a]}`).join("&")}function getGlobal(_){return window[_]?window[_]:window.exports&&window.exports[_]?window.exports[_]:window.module&&window.module.exports&&window.module.exports[_]?window.module.exports[_]: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[a]){requests[a].push({resolve:nt,reject:it});return}requests[a]=[{resolve:nt,reject:it}];const at=st=>{requests[a].forEach(ot=>ot.resolve(st))};if(j){const st=window[j];window[j]=function(){st&&st(),at(getGlobal($))}}tt(a,st=>{st?(requests[a].forEach(ot=>ot.reject(st)),requests[a]=null):j||at(getGlobal($))})})};function getConfig(_,a){return(0,import_deepmerge$1.default)(a.config,_.config)}function omit(_,...a){const $=[].concat(...a),j={},et=Object.keys(_);for(const tt of et)$.indexOf(tt)===-1&&(j[tt]=_[tt]);return j}function callPlayer(_,...a){if(!this.player||!this.player[_]){let $=`ReactPlayer: ${this.constructor.displayName} player could not call %c${_}%c – `;return this.player?this.player[_]||($+="The method was not available"):$+="The player was not available",console.warn($,"font-weight: bold",""),null}return this.player[_](...a)}function isMediaStream(_){return typeof window<"u"&&typeof window.MediaStream<"u"&&_ instanceof window.MediaStream}function isBlobUrl(_){return/^blob:/.test(_)}function supportsWebKitPresentationMode(_=document.createElement("video")){const a=/iPhone|iPod/.test(navigator.userAgent)===!1;return _.webkitSupportsPresentationMode&&typeof _.webkitSetPresentationMode=="function"&&a}function enableStubOn(_){return _}var __defProp$5=Object.defineProperty,__getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__getOwnPropNames$5=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__export$5=(_,a)=>{for(var $ in a)__defProp$5(_,$,{get:a[$],enumerable:!0})},__copyProps$5=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$5(a))!__hasOwnProp$5.call(_,et)&&et!==$&&__defProp$5(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$5(a,et))||j.enumerable});return _},__toCommonJS$5=_=>__copyProps$5(__defProp$5({},"__esModule",{value:!0}),_),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=_=>{if(_ instanceof Array){for(const a of _)if(typeof a=="string"&&canPlayFile(a)||canPlayFile(a.src))return!0;return!1}return(0,import_utils$3.isMediaStream)(_)||(0,import_utils$3.isBlobUrl)(_)?!0:AUDIO_EXTENSIONS.test(_)||VIDEO_EXTENSIONS.test(_)||HLS_EXTENSIONS.test(_)||DASH_EXTENSIONS.test(_)||FLV_EXTENSIONS.test(_)},canPlay={youtube:_=>_ instanceof Array?_.every(a=>MATCH_URL_YOUTUBE.test(a)):MATCH_URL_YOUTUBE.test(_),soundcloud:_=>MATCH_URL_SOUNDCLOUD.test(_)&&!AUDIO_EXTENSIONS.test(_),vimeo:_=>MATCH_URL_VIMEO.test(_)&&!VIDEO_EXTENSIONS.test(_)&&!HLS_EXTENSIONS.test(_),mux:_=>MATCH_URL_MUX.test(_),facebook:_=>MATCH_URL_FACEBOOK.test(_)||MATCH_URL_FACEBOOK_WATCH.test(_),streamable:_=>MATCH_URL_STREAMABLE.test(_),wistia:_=>MATCH_URL_WISTIA.test(_),twitch:_=>MATCH_URL_TWITCH_VIDEO.test(_)||MATCH_URL_TWITCH_CHANNEL.test(_),dailymotion:_=>MATCH_URL_DAILYMOTION.test(_),mixcloud:_=>MATCH_URL_MIXCLOUD.test(_),vidyard:_=>MATCH_URL_VIDYARD.test(_),kaltura:_=>MATCH_URL_KALTURA.test(_),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 a)__defProp$4(_,$,{get:a[$],enumerable:!0})},__copyProps$4=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$4(a))!__hasOwnProp$4.call(_,et)&&et!==$&&__defProp$4(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$4(a,et))||j.enumerable});return _},__toCommonJS$4=_=>__copyProps$4(__defProp$4({},"__esModule",{value:!0}),_),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-CSvCyxF6.js").then(_=>_.Y),[],import.meta.url))},{key:"soundcloud",name:"SoundCloud",canPlay:import_patterns.canPlay.soundcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./SoundCloud-vnpoNRig.js").then(_=>_.S),[],import.meta.url))},{key:"vimeo",name:"Vimeo",canPlay:import_patterns.canPlay.vimeo,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vimeo-BEBB_kk3.js").then(_=>_.V),[],import.meta.url))},{key:"mux",name:"Mux",canPlay:import_patterns.canPlay.mux,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mux-73v6q4C9.js").then(_=>_.M),[],import.meta.url))},{key:"facebook",name:"Facebook",canPlay:import_patterns.canPlay.facebook,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Facebook-DBfk6UAn.js").then(_=>_.F),[],import.meta.url))},{key:"streamable",name:"Streamable",canPlay:import_patterns.canPlay.streamable,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Streamable-BVMLG62i.js").then(_=>_.S),[],import.meta.url))},{key:"wistia",name:"Wistia",canPlay:import_patterns.canPlay.wistia,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Wistia-CtIm8wZy.js").then(_=>_.W),[],import.meta.url))},{key:"twitch",name:"Twitch",canPlay:import_patterns.canPlay.twitch,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Twitch-ClbRcSjm.js").then(_=>_.T),[],import.meta.url))},{key:"dailymotion",name:"DailyMotion",canPlay:import_patterns.canPlay.dailymotion,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./DailyMotion-D6Fm3btq.js").then(_=>_.D),[],import.meta.url))},{key:"mixcloud",name:"Mixcloud",canPlay:import_patterns.canPlay.mixcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mixcloud-BSAT7qfZ.js").then(_=>_.M),[],import.meta.url))},{key:"vidyard",name:"Vidyard",canPlay:import_patterns.canPlay.vidyard,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vidyard-B9AJa_UB.js").then(_=>_.V),[],import.meta.url))},{key:"kaltura",name:"Kaltura",canPlay:import_patterns.canPlay.kaltura,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Kaltura-BxuUjAjC.js").then(_=>_.K),[],import.meta.url))},{key:"file",name:"FilePlayer",canPlay:import_patterns.canPlay.file,canEnablePIP:_=>import_patterns.canPlay.file(_)&&(document.pictureInPictureEnabled||(0,import_utils$2.supportsWebKitPresentationMode)())&&!import_patterns.AUDIO_EXTENSIONS.test(_),lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./FilePlayer-DHva2v9W.js").then(_=>_.F),[],import.meta.url))}],safeIsNaN=Number.isNaN||function _(a){return typeof a=="number"&&a!==a};function isEqual(_,a){return!!(_===a||safeIsNaN(_)&&safeIsNaN(a))}function areInputsEqual(_,a){if(_.length!==a.length)return!1;for(var $=0;$<_.length;$++)if(!isEqual(_[$],a[$]))return!1;return!0}function memoizeOne(_,a){a===void 0&&(a=areInputsEqual);var $,j=[],et,tt=!1;function rt(){for(var nt=[],it=0;it{for(var $ in a)__defProp$3(_,$,{get:a[$],enumerable:!0})},__copyProps$3=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$3(a))!__hasOwnProp$3.call(_,et)&&et!==$&&__defProp$3(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$3(a,et))||j.enumerable});return _},__toESM$3=(_,a,$)=>($=_!=null?__create$3(__getProtoOf$3(_)):{},__copyProps$3(!_||!_.__esModule?__defProp$3($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$3=_=>__copyProps$3(__defProp$3({},"__esModule",{value:!0}),_),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,$)=>a in _?__defProp$2(_,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):_[a]=$,__export$2=(_,a)=>{for(var $ in a)__defProp$2(_,$,{get:a[$],enumerable:!0})},__copyProps$2=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$2(a))!__hasOwnProp$2.call(_,et)&&et!==$&&__defProp$2(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$2(a,et))||j.enumerable});return _},__toESM$2=(_,a,$)=>($=_!=null?__create$2(__getProtoOf$2(_)):{},__copyProps$2(!_||!_.__esModule?__defProp$2($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$2=_=>__copyProps$2(__defProp$2({},"__esModule",{value:!0}),_),__publicField$1=(_,a,$)=>(__defNormalProp$1(_,typeof a!="symbol"?a+"":a,$),$),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",a=>{if(this.player){this.progress();return}this.player=a,this.player.load(this.props.url),this.progress()}),__publicField$1(this,"getInternalPlayer",a=>this.player?this.player[a]:null),__publicField$1(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const a=this.getCurrentTime()||0,$=this.getSecondsLoaded(),j=this.getDuration();if(j){const et={playedSeconds:a,played:a/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:a,playing:$,volume:j,muted:et}=this.props;a(),!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:a,onPlay:$,playbackRate:j}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&j!==1&&this.player.setPlaybackRate(j),a(),this.startOnPlay=!1),$(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),__publicField$1(this,"handlePause",a=>{this.isPlaying=!1,this.isLoading||this.props.onPause(a)}),__publicField$1(this,"handleEnded",()=>{const{activePlayer:a,loop:$,onEnded:j}=this.props;a.loopOnEnded&&$&&this.seekTo(0),$||(this.isPlaying=!1,j())}),__publicField$1(this,"handleError",(...a)=>{this.isLoading=!1,this.props.onError(...a)}),__publicField$1(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const a=this.getDuration();a?this.onDurationCalled||(this.props.onDuration(a),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(a){if(!this.player)return;const{url:$,playing:j,volume:et,muted:tt,playbackRate:rt,pip:nt,loop:it,activePlayer:at,disableDeferredLoading:st}=this.props;if(!(0,import_react_fast_compare$1.default)(a.url,$)){if(this.isLoading&&!at.forceLoad&&!st&&!(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)}!a.playing&&j&&!this.isPlaying&&this.player.play(),a.playing&&!j&&this.isPlaying&&this.player.pause(),!a.pip&&nt&&this.player.enablePIP&&this.player.enablePIP(),a.pip&&!nt&&this.player.disablePIP&&this.player.disablePIP(),a.volume!==et&&et!==null&&this.player.setVolume(et),a.muted!==tt&&(tt?this.player.mute():(this.player.unmute(),et!==null&&setTimeout(()=>this.player.setVolume(et)))),a.playbackRate!==rt&&this.player.setPlaybackRate&&this.player.setPlaybackRate(rt),a.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(a,$,j){if(!this.isReady){a!==0&&(this.seekOnPlay=a,setTimeout(()=>{this.seekOnPlay=null},SEEK_ON_PLAY_EXPIRY));return}if($?$==="fraction":a>0&&a<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*a,j);return}this.player.seekTo(a,j)}render(){const a=this.props.activePlayer;return a?import_react$1.default.createElement(a,{...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,$)=>a in _?__defProp$1(_,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):_[a]=$,__export$1=(_,a)=>{for(var $ in a)__defProp$1(_,$,{get:a[$],enumerable:!0})},__copyProps$1=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$1(a))!__hasOwnProp$1.call(_,et)&&et!==$&&__defProp$1(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$1(a,et))||j.enumerable});return _},__toESM$1=(_,a,$)=>($=_!=null?__create$1(__getProtoOf$1(_)):{},__copyProps$1(!_||!_.__esModule?__defProp$1($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$1=_=>__copyProps$1(__defProp$1({},"__esModule",{value:!0}),_),__publicField=(_,a,$)=>(__defNormalProp(_,typeof a!="symbol"?a+"":a,$),$),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-CBYRu9Ir.js").then(_=>_.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,..._])if(et.canPlay(j))return et;return a||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:at}=this.state,st=this.getAttributes(j),ot=typeof it=="string"?this.references.wrapper:void 0;return import_react.default.createElement(it,{ref:ot,style:{...et,width:tt,height:rt},...st},import_react.default.createElement(UniversalSuspense,{fallback:nt},at?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,..._])if(et.canPlay(j))return!0;return!1}),__publicField($,"canEnablePIP",j=>{for(const et of[...customPlayers,..._])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 a)__defProp(_,$,{get:a[$],enumerable:!0})},__copyProps=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames(a))!__hasOwnProp.call(_,et)&&et!==$&&__defProp(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc(a,et))||j.enumerable});return _},__toESM=(_,a,$)=>($=_!=null?__create(__getProtoOf(_)):{},__copyProps(!_||!_.__esModule?__defProp($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS=_=>__copyProps(__defProp({},"__esModule",{value:!0}),_),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:_,style:a})=>{const $=_.metadata.attributes;return!$||$.length===0?null:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],"data-testid":"attributes-section",style:a,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:_,maxLength:a})=>_.length<=a?jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:_}):jsxRuntimeExports.jsx(Tooltip,{label:_,children:jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:truncate(_,a)})}),TzktLink=({url:_,...a})=>jsxRuntimeExports.jsx("a",{"data-testid":"tzkt-link",href:_,rel:"noopener noreferrer",target:"_blank",children:jsxRuntimeExports.jsx(WindowLinkIcon,{...a})}),CreatorElement=({nft:_})=>{if(!_.metadata.creators||_.metadata.creators.length===0)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"-"});const a=_.metadata.creators[0];return a.startsWith("tz")?jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(a)}):jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:a})},PropertiesAccordionItem=({nft:_,style:a})=>{const $=royalties(_),j=$.reduce((tt,rt)=>tt+rt.share,0).toFixed(2),et=useSelectedNetwork();return jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:a,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:_.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:_.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(_)||"-"})]}),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(_.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(_,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:_})}),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:_.metadata.rights||"-"})})]})]})})})})]})},TagsSection=({nft:_})=>{const a=_.metadata.tags;return!a||a.length===0?null:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"tags-section",children:a.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:_})=>{const a=getIPFSurl(thumbnailUri(_)),$=getIPFSurl(_.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(_.metadata.name,45)})]})})},SignPage$1=_=>{const{mode:a,operations:$,data:{nft:j}}=_,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:at,reEstimate:st,onSign:ot}=useSignPageHelpers($,a),{recipient:ut}=tt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:j})}),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:j.balance})]}),jsxRuntimeExports.jsx(SignPageFee,{fee:et})]}),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:[tt.operations[0].amount," out of ",j.balance]})})]}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:tt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:ut}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:st,sender:tt.sender}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:ot,signer:at,text:headerText(tt.type,a)})})]})})})},FormPage$1=_=>{const{nft:a}=_,$=useOpenSignPageFormAction({SignPage:SignPage$1,signPageExtraData:{nft:a},FormPage:FormPage$1,defaultFormPageProps:_,toOperation:toOperation$1(a)}),j=useAddToBatchFormAction(toOperation$1(a)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:{quantity:1,...formDefaultValues(_)}}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=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:_.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:a.balance})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.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",...st("quantity",{required:"Quantity is required",max:{value:a.balance,message:`Max quantity is ${a.balance}`},min:{value:1,message:"Min quantity is 1"}})})}),jsxRuntimeExports.jsxs(Text,{"data-testid":"out-of-nft",children:["out of ",a.balance]})]})]})}),at.quantity&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"quantity-error",children:at.quantity.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),at.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:at.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation$1=_=>a=>({type:"fa2",sender:parsePkh(a.sender),recipient:parsePkh(a.recipient),contract:parseContractPkh(_.contract),tokenId:_.tokenId,amount:a.quantity.toString()}),NFTDrawerCard=({nft:_})=>{var it;const a=getIPFSurl(artifactUri(_)),$=getIPFSurl(_.displayUri),j=useGetOwnedAccount(),{openWith:et}=reactExports.useContext(DynamicModalContext),tt=(it=mimeType(_))==null?void 0:it.startsWith("video/"),rt=tokenName(_),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:a})}),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:a}),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:a})]})}),Number(_.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"+_.balance})]})}),jsxRuntimeExports.jsx(TagsSection,{nft:_}),rt&&jsxRuntimeExports.jsx(Heading,{marginTop:"16px",marginBottom:"14px","data-testid":"nft-name",size:"lg",children:rt}),_.metadata.description&&jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-description",size:"sm",children:_.metadata.description}),jsxRuntimeExports.jsx(Button,{marginTop:"20px",onClick:()=>et(jsxRuntimeExports.jsx(FormPage$1,{nft:_,sender:j(_.owner)})),children:"Send"}),jsxRuntimeExports.jsxs(Accordion,{marginTop:"32px",allowMultiple:!0,children:[jsxRuntimeExports.jsx(AttributesAccordionItem,{nft:_,style:nt}),jsxRuntimeExports.jsx(PropertiesAccordionItem,{nft:_,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:_})})]})]})]})},NFTDrawerBody=({nft:_,onCloseDrawer:a})=>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(_.owner)}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:a})]}),jsxRuntimeExports.jsx(NFTDrawerCard,{nft:_})]}),AccountListWithDrawer=()=>{const[_,a]=reactExports.useState(null),{ownerPkh:$,nftId:j}=useParams(),et=useAllNfts(),tt=$&&lodashExports.get(et,[$],[]).find(dt=>fullId(dt)===j),rt=!!tt,{isOpen:nt,onOpen:it,onClose:at}=useDisclosure$1({defaultIsOpen:rt}),st=useNavigate(),ot=reactExports.useCallback(()=>{a(null),at(),st("/home")},[at,st]);reactExports.useEffect(()=>{const dt=mt=>{mt.key==="Escape"&&ot()};return document.addEventListener("keydown",dt),()=>document.removeEventListener("keydown",dt)},[ot]);const ut=reactExports.useMemo(()=>({selectedAccount:_,selectAccount:dt=>{a(dt),it()}}),[_,it]);return jsxRuntimeExports.jsxs(SelectedAccountContext.Provider,{value:ut,children:[jsxRuntimeExports.jsx(AccountsList,{}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:nt,onClose:ot,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(DrawerContent,{children:[rt&&jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(NFTDrawerBody,{nft:{...tt,owner:$},onCloseDrawer:ot})}),!rt&&_&&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:_}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:ot})]}),jsxRuntimeExports.jsx(AccountCard,{accountPkh:_.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:_=>{}}),NFTCard=({nft:_})=>{const{selectedNFT:a,setSelectedNFT:$}=reactExports.useContext(SelectedNFTContext),j=getIPFSurl(thumbnailUri(_)),et=getIPFSurl(_.displayUri),tt=_.metadata.name,rt={width:"100%",minWidth:"242px",minHeight:"242px",objectFit:"contain",aspectRatio:"1",fallbackSrc:et,src:j},nt=a&&fullId(a)===fullId(_)&&a.owner===_.owner;return jsxRuntimeExports.jsx(Card,{minWidth:"274px",borderRadius:"8px",cursor:"pointer","data-testid":`nft-card${nt?"-selected":""}`,onClick:()=>$(_),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(_.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"+_.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(_.owner)})]})})},NFTGallery=({nftsByOwner:_})=>{const a=Object.entries(_).flatMap(([j,et])=>(et||[]).map(tt=>({owner:j,...tt})));let $="repeat(auto-fit, minmax(min(100%/2, max(274px, 100%/7)), 1fr))";return a.length<3&&($=`repeat(auto-fit, min(100% / ${a.length} - 16px, 450px))`),jsxRuntimeExports.jsx(SimpleGrid,{gridTemplateColumns:$,marginBottom:"16px",minChildWidth:"340px",spacing:"16px",children:sortedByLastUpdate(a).map(j=>jsxRuntimeExports.jsx(NFTCard,{nft:j},`${j.owner}:${fullId(j)}`))})},AccountListDisplay=({accounts:_,onSelect:a})=>jsxRuntimeExports.jsx(MenuList,{zIndex:"docked",overflowY:"scroll",maxHeight:"300px",padding:0,background:colors.gray[900],children:_.map($=>jsxRuntimeExports.jsx(MenuItem$1,{width:"100%",minHeight:"48px",padding:"5px",background:colors.gray[700],"aria-label":$.label,onClick:()=>{a($)},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 _=useAllAccounts(),[a]=reactExports.useState(_),[$,j]=useSearchParams(),et=$.getAll("accounts"),[tt,rt]=reactExports.useState(et.length===0),[nt,it]=reactExports.useState(_.filter(ot=>et.includes(ot.address.pkh))),at=lodashExports.differenceBy(_,nt,ot=>ot.address.pkh),st=nt.length===_.length;return reactExports.useEffect(()=>{j(ot=>({...ot,accounts:nt.map(ut=>ut.address.pkh)}))},[nt,j]),{selectedAccounts:tt?a: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:st,marginY:"16px",rightIcon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),variant:"ghost",children:"Filter by Account"}),jsxRuntimeExports.jsx(AccountListDisplay,{accounts:at,onSelect:ot=>{rt(!1),it(ut=>[...ut,ot])}})]})}),jsxRuntimeExports.jsx(Wrap,{width:"100%",children:nt.map(ot=>jsxRuntimeExports.jsx(AddressPill,{address:ot.address,"data-testid":"account-pill",mode:{type:"removable",onRemove:()=>{rt(nt.length===1),it(ut=>ut.filter(dt=>dt.address.pkh!==ot.address.pkh))}}},ot.address.pkh))})]})}},NFTsView=()=>{const _=useAllNfts(),{accountsFilter:a,selectedAccounts:$}=useAccountsFilter(),[j,et]=reactExports.useState(void 0);reactExports.useEffect(()=>{const it=at=>{at.key==="Escape"&&et(void 0)};return document.addEventListener("keydown",it),()=>document.removeEventListener("keydown",it)},[]);const tt=lodashExports.pick(_,$.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"}),a,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:_,selectedAccounts:a}=useAccountsFilter(),{operations:$,loadMore:j,hasMore:et,isLoading:tt,isFirstLoad:rt}=useGetOperations(a),nt=reactExports.useRef(!1),it=at=>{if(nt.current||!et||tt)return;const st=at.target;if(st.scrollHeight-st.scrollTop-st.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"}),_,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((at,st)=>{const ot=st===$.length-1;return jsxRuntimeExports.jsxs(Box,{height:"90px",marginBottom:ot?"10px":0,paddingY:"20px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:at}),!ot&&jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Divider,{marginTop:"20px"})})]},at.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",...a,children:jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:_})}),BeaconPeers=()=>{const _=usePeers(),[a,$]=reactExports.useState([]);return reactExports.useEffect(()=>{const j=_.map(async et=>({...et,senderId:et.senderId||await getSenderId(et.publicKey)}));Promise.all(j).then($).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:a})},PeersDisplay=({peerInfos:_})=>jsxRuntimeExports.jsx(Box,{children:_.map(a=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(PeerRow,{peerInfo:a})]},a.senderId))}),PeerRow=({peerInfo:_})=>{const a=useRemovePeer();return 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:_.icon})}),jsxRuntimeExports.jsxs(Center,{alignItems:"flex-start",flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"6px",size:"md",children:_.name}),jsxRuntimeExports.jsx(StoredPeerInfo,{peerInfo:_})]})]}),jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(IconButton,{"aria-label":"Remove Peer",icon:jsxRuntimeExports.jsx(TrashIcon,{}),onClick:()=>a(_),size:"xs",variant:"circle"})})]})},StoredPeerInfo=({peerInfo:_})=>{const a=useGetConnectionInfo(_.senderId);return a?jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"10px",address:parsePkh(a.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(a.networkType)})]}):null},DAppsDrawerCard=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1(),j=useAddPeer();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"dApps",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"drawer-body",children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),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:_,onClose:a,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Error Logs",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsx(ErrorLogsDrawerBody,{})]})})]})]})},ErrorLogsDrawerBody=()=>{const _=[...useAppSelector(j=>j.errors)].reverse(),a=useDispatch(),$=()=>{a(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(_))}`,children:jsxRuntimeExports.jsx(Button,{variant:"tertiary",children:"Download error logs"})}),jsxRuntimeExports.jsx(Button,{marginLeft:"8px",onClick:$,variant:"warning",children:"Clear All"})]})]}),_.map(j=>jsxRuntimeExports.jsx(ErrorLogRow,{errorLog:j},nanoid()))]})},ErrorLogRow=({errorLog:_})=>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:_.description}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:_.timestamp})]})]})})]}),removeTrailingSlashes=_=>_.replace(/\/+$/g,""),UpsertNetworkModal=({network:_})=>{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:_}),at=st=>{j(networksActions.upsertNetwork(st)),$()};return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:it(at),children:[jsxRuntimeExports.jsxs(ModalHeader,{textAlign:"center",children:[a==="edit"?"Edit":"Add"," Network",jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[a==="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:st=>{if(et.find(ot=>ot.name===st))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:a==="edit"?"Save changes":"Add network"})})]})]})})},NetworkSettingsDrawerBody=()=>{const{openWith:_}=reactExports.useContext(DynamicModalContext),a=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:()=>_(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:a.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:()=>_(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:_,onClose:a,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Network Settings",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsx(NetworkSettingsDrawerBody,{})]})})]})]})},ChangePasswordForm=()=>{const{onClose:_}=reactExports.useContext(DynamicModalContext),a=useForm({mode:"onBlur"}),$=useToast(),j=useAppDispatch(),{handleAsyncAction:et,isLoading:tt}=useAsyncActionHandler(),{handleSubmit:rt,formState:{isValid:nt,errors:it},getValues:at}=a,st=async({currentPassword:ot,newPassword:ut,newPasswordConfirmation:dt})=>{if(!(ot===ut||ut!==dt))return et(async()=>{await j(changeMnemonicPassword({currentPassword:ot,newPassword:ut})).unwrap(),$({description:"Password updated",status:"success"}),_()})};return jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[700],"data-testid":"change-password-modal",children:jsxRuntimeExports.jsxs("form",{onSubmit:rt(st),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:ot=>at("currentPassword")!==ot||"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:ot=>at("newPassword")===ot||"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:_,onOpen:a}=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:a}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Change Password",isSelected:!1,onClick:()=>$(jsxRuntimeExports.jsx(ChangePasswordForm,{}))}),_]})},SectionContainer=({title:_,children:a})=>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:_,amount:a,...$})=>{const{contract:j}=_,et=tokenPrettyAmount(a,_),tt=tokenSymbolSafe(_);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=_=>{const{mode:a,operations:$,data:{token:j}}=_,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:at,reEstimate:st,onSign:ot}=useSignPageHelpers($,a),{amount:ut,recipient:dt}=tt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(TokenTile,{amount:ut,token:j}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(SignPageFee,{fee:et})})}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:tt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:dt}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:st,sender:tt.sender}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:ot,signer:at,text:headerText(tt.type,a)})})]})})})},FormPage=_=>{const{token:a}=_,$=useOpenSignPageFormAction({SignPage,signPageExtraData:{token:a},FormPage,defaultFormPageProps:_,toOperation:toOperation(a)}),j=useAddToBatchFormAction(toOperation(a)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(_)}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=nt,ut=tokenDecimals(a),dt=formatTokenAmount(a.balance,ut),mt=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:!!at.prettyAmount,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Amount"}),jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{isDisabled:rt,step:mt,type:"number",...st("prettyAmount",{required:"Amount is required",max:{value:dt.toString(),message:`Max amount is ${dt}`},validate:makeValidateDecimals(Number(ut))}),placeholder:mt}),jsxRuntimeExports.jsx(InputRightElement,{paddingRight:"12px","data-testid":"token-symbol",children:tokenSymbolSafe(a)})]}),at.prettyAmount&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"amount-error",children:at.prettyAmount.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),at.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:at.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation=_=>a=>{const $={type:"fa2",sender:parsePkh(a.sender),recipient:parsePkh(a.recipient),contract:parseContractPkh(_.contract),tokenId:_.tokenId,amount:getRealAmount(_,a.prettyAmount)};return _.type==="fa2"?$:{...$,type:"fa1.2",tokenId:"0"}},Header=({account:_})=>{const{address:a,label:$}=_;return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"78px",background:accountIconGradient({left:"-10px",top:"-10px",account:_,radius:"100px",mainBackgroundColor:colors.gray[800]}),borderTopRadius:"8px","data-testid":"header",paddingX:"30px",children:[jsxRuntimeExports.jsx(AccountTileIcon,{account:_,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(a.pkh)})]}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column-reverse",children:jsxRuntimeExports.jsx(AccountBalance,{verticalAlign:"bottom",address:_.address.pkh})})]})]})},AccountTokens=({account:_,tokens:a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(Card,{overflowX:"auto",marginBottom:"16px",borderBottomRadius:"8px",backgroundColor:colors.gray[900],children:[jsxRuntimeExports.jsx(Header,{account:_}),jsxRuntimeExports.jsx(TableContainer,{paddingX:"30px",children:jsxRuntimeExports.jsx(Table,{children:jsxRuntimeExports.jsx(Tbody,{children:a.map((j,et)=>{const tt=et===a.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:_,token:j}))})})]},fullId(j))})})})})]})},TokensPage=()=>{const{accountsFilter:_,selectedAccounts:a}=useAccountsFilter(),$=useGetAccountAllTokens(),j=a.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"}),_,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 $=_?packageInfo.version:`Umami v${packageInfo.version}`;return jsxRuntimeExports.jsx(Text,{color:colors.gray[450],...a,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(()=>{a(j=>!j)},[]);return{isCollapsed:_,toggle:$}},ORANGE="#F74F18",MakiLogo=_=>{const a=useSelectedNetwork();return jsxRuntimeExports.jsx(MakiIcon,{background:"white",borderRadius:"8px","data-testid":"maki-logo",fishColor:a.name==="mainnet"?ORANGE:"black",..._})},NetworkSelector=()=>{const _=useSelectedNetwork(),a=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(_.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:a.map((rt,nt)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{height:"34px",color:rt.name===_.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{const[_,a]=reactExports.useState(!1),$=window;reactExports.useEffect(()=>{$&&$.electronAPI&&$.electronAPI.onAppUpdateDownloaded(et=>a(!0))},[$]);const j=()=>{$&&$.electronAPI&&$.electronAPI.installAppUpdateAndQuit()};return _?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:_,toggle:a}=useCollapseMenu(),$=jsxRuntimeExports.jsx(CollapseMenuButton,{marginTop:_?0:"2px",marginRight:_?0:"-14px",toggle:a});return jsxRuntimeExports.jsxs(Flex,{alignItems:_?"center":"normal",flexDirection:"column",width:_?"80px":"236px",padding:_?"30px 20px":"30px",background:colors.gray[900],"data-testid":`side-navbar${_?"-collapsed":""}`,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"30px",children:_?$: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:_?"center":"normal",justifyContent:_?"space-around":"normal",display:_?"flex":"block",height:"100%",children:[!_&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(UpdateAppButton,{}),jsxRuntimeExports.jsx(TotalBalance,{})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(AccountsIcon,{}),isCollapsed:_,label:"Accounts",to:"/home"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(DiamondIcon,{}),isCollapsed:_,label:"NFTs",to:"/nfts"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(RefreshClockIcon,{width:"24px",height:"24px"}),isCollapsed:_,label:"Operations",to:"/operations"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(CoinIcon,{}),isCollapsed:_,label:"Tokens",to:"/tokens"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(BatchIcon,{}),isCollapsed:_,label:"Batch",to:"/batch"})]})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(MenuItem,{marginTop:"22px",icon:jsxRuntimeExports.jsx(AddressBookIcon,{}),isCollapsed:_,label:"Address Book",to:"/address-book"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(GearIcon,{}),isCollapsed:_,label:"Settings",to:"/settings"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(HelpIcon,{}),isCollapsed:_,label:"Help",to:"/help"}),jsxRuntimeExports.jsx(AppVersion,{marginTop:"24px",fontSize:"14px",textAlign:_?"center":"left",isCollapsed:_})]})]})]})},MenuItem=({icon:_,label:a,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:[_,!j&&jsxRuntimeExports.jsx(Text,{marginLeft:"10px",size:"sm",children:a})]})})},TotalBalance=()=>{const _=useTotalBalance(),[a]=useMediaQuery("(max-height: 900px)");return jsxRuntimeExports.jsxs(Box,{marginTop:"24px",marginBottom:a?"30px":"100px","data-testid":"total-balance",children:[jsxRuntimeExports.jsx(Text,{marginBottom:"4px",size:"sm",children:"Balance"}),_&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:_.mutez,dollarBalance:_.usd})]})},withSideMenu=_=>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:_})]}),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(_){(function(a,$){$(_,reactExports,propTypesExports)})(commonjsGlobal,function(a,$,j){Object.defineProperty(a,"__esModule",{value:!0}),a.setHasSupportToCaptureOption=mt;var et=rt($),tt=rt(j);function rt(Tt){return Tt&&Tt.__esModule?Tt:{default:Tt}}var nt=Object.assign||function(Tt){for(var Mt=1;Mt=0||Object.prototype.hasOwnProperty.call(Tt,Nt)&&(Lt[Nt]=Tt[Nt]);return Lt}function at(Tt,Mt){if(!(Tt instanceof Mt))throw new TypeError("Cannot call a class as a function")}var st=function(){function Tt(Mt,Lt){for(var Nt=0;Nt0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return dt?Tt:Tt.capture}function Ct(Tt){if("touches"in Tt){var Mt=Tt.touches[0],Lt=Mt.pageX,Nt=Mt.pageY;return{x:Lt,y:Nt}}var zt=Tt.screenX,Bt=Tt.screenY;return{x:zt,y:Bt}}var Pt=function(Tt){ut(Mt,Tt);function Mt(){var Lt;at(this,Mt);for(var Nt=arguments.length,zt=Array(Nt),Bt=0;Btzt&&this.props.onSwipeRight(1,Nt),this.movePosition.deltaY<-zt?this.props.onSwipeUp(1,Nt):this.movePosition.deltaY>zt&&this.props.onSwipeDown(1,Nt)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(Nt){this.swiper=Nt,this.props.innerRef(Nt)}},{key:"render",value:function(){var Nt=this.props;Nt.tagName;var zt=Nt.className,Bt=Nt.style,It=Nt.children;Nt.allowMouseEvents,Nt.onSwipeUp,Nt.onSwipeDown,Nt.onSwipeLeft,Nt.onSwipeRight,Nt.onSwipeStart,Nt.onSwipeMove,Nt.onSwipeEnd,Nt.innerRef,Nt.tolerance;var Dt=it(Nt,["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:Bt},Dt),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},a.default=Pt})}(reactSwipe)),reactSwipe}(function(_){(function(a,$){$(_,requireReactSwipe())})(commonjsGlobal,function(a,$){Object.defineProperty(a,"__esModule",{value:!0});var j=et($);function et(tt){return tt&&tt.__esModule?tt:{default:tt}}a.default=j.default})})(lib);var cssClasses={},classnames={exports:{}};/*! +`}return fr.substring(0,fr.length-1)},ht.renderTo2dContext=function(Kt,Jt){Jt=Jt||2;for(var Ht=ht.getModuleCount(),Vt=0;Vt>>8),Ft.push(bt&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 Nt=[[],[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,Bt=7973,It=21522,Dt={},Ft=function(Ot){for(var yt=0;Ot!=0;)yt+=1,Ot>>>=1;return yt};return Dt.getBCHTypeInfo=function(Ot){for(var yt=Ot<<10;Ft(yt)-Ft(zt)>=0;)yt^=zt<=0;)yt^=Bt<5&&(bt+=3+vt-5)}for(var ct=0;ct=256;)Dt-=255;return Nt[Dt]},It}();function at(Nt,zt){if(typeof Nt.length>"u")throw Nt.length+"/"+zt;var Bt=function(){for(var Dt=0;Dt"u")throw"bad rs block @ typeNumber:"+Dt+"/errorCorrectionLevel:"+Ft;for(var yt=Ot.length/3,bt=[],ct=0;ct>>7-It%8&1)==1},Bt.put=function(It,Dt){for(var Ft=0;Ft>>Dt-Ft-1&1)==1)},Bt.getLengthInBits=function(){return zt},Bt.putBit=function(It){var Dt=Math.floor(zt/8);Nt.length<=Dt&&Nt.push(0),It&&(Nt[Dt]|=128>>>zt%8),zt+=1},Bt},ut=function(Nt){var zt=et.MODE_NUMBER,Bt=Nt,It={};It.getMode=function(){return zt},It.getLength=function(Ot){return Bt.length},It.write=function(Ot){for(var yt=Bt,bt=0;bt+2>>8&255)*192+(bt&255),Ft.put(bt,13),yt+=2}if(yt>>8)},zt.writeBytes=function(Bt,It,Dt){It=It||0,Dt=Dt||Bt.length;for(var Ft=0;Ft0&&(Bt+=","),Bt+=Nt[It];return Bt+="]",Bt},zt},Pt=function(){var Nt=0,zt=0,Bt=0,It="",Dt={},Ft=function(yt){It+=String.fromCharCode(Ot(yt&63))},Ot=function(yt){if(!(yt<0)){if(yt<26)return 65+yt;if(yt<52)return 97+(yt-26);if(yt<62)return 48+(yt-52);if(yt==62)return 43;if(yt==63)return 47}throw"n:"+yt};return Dt.writeByte=function(yt){for(Nt=Nt<<8|yt&255,zt+=8,Bt+=1;zt>=6;)Ft(Nt>>>zt-6),zt-=6},Dt.flush=function(){if(zt>0&&(Ft(Nt<<6-zt),Nt=0,zt=0),Bt%3!=0)for(var yt=3-Bt%3,bt=0;bt=zt.length){if(Dt==0)return-1;throw"unexpected end of file./"+Dt}var yt=zt.charAt(Bt);if(Bt+=1,yt=="=")return Dt=0,-1;if(yt.match(/^\s$/))continue;It=It<<6|Ot(yt.charCodeAt(0)),Dt+=6}var bt=It>>>Dt-8&255;return Dt-=8,bt};var Ot=function(yt){if(65<=yt&&yt<=90)return yt-65;if(97<=yt&&yt<=122)return yt-97+26;if(48<=yt&&yt<=57)return yt-48+52;if(yt==43)return 62;if(yt==47)return 63;throw"c:"+yt};return Ft},Mt=function(Nt,zt){var Bt=Nt,It=zt,Dt=new Array(Nt*zt),Ft={};Ft.setPixel=function(ct,ht,vt){Dt[ht*Bt+ct]=vt},Ft.write=function(ct){ct.writeString("GIF87a"),ct.writeShort(Bt),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(Bt),ct.writeShort(It),ct.writeByte(0);var ht=2,vt=yt(ht);ct.writeByte(ht);for(var wt=0;vt.length-wt>255;)ct.writeByte(255),ct.writeBytes(vt,wt,255),wt+=255;ct.writeByte(vt.length-wt),ct.writeBytes(vt,wt,vt.length-wt),ct.writeByte(0),ct.writeString(";")};var Ot=function(ct){var ht=ct,vt=0,wt=0,At={};return At.write=function(Rt,Et){if(Rt>>>Et)throw"length over";for(;vt+Et>=8;)ht.writeByte(255&(Rt<>>=8-vt,wt=0,vt=0;wt=Rt<0&&ht.writeByte(wt)},At},yt=function(ct){for(var ht=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){_.exports=j()}(function(){return $})})(qrcode);var qrcodeExports=qrcode.exports,__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var _=function(a,$){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,et){j.__proto__=et}||function(j,et){for(var tt in et)Object.prototype.hasOwnProperty.call(et,tt)&&(j[tt]=et[tt])},_(a,$)};return function(a,$){if(typeof $!="function"&&$!==null)throw new TypeError("Class extends value "+String($)+" is not a constructor or null");_(a,$);function j(){this.constructor=a}a.prototype=$===null?Object.create($):(j.prototype=$.prototype,new j)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(_){for(var a,$=1,j=arguments.length;$=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},a.prototype.drawRoundedSquare=function($,j,et,tt,rt,nt,it,at){at.lineWidth=$,at.fillStyle=rt,at.strokeStyle=rt,et+=$/2,j+=$/2,tt-=$,Array.isArray(nt)||(nt=[nt,nt,nt,nt]),nt=nt.map(function(mt){return mt=Math.min(mt,tt/2),mt<0?0:mt});var st=nt[0]||0,ot=nt[1]||0,ut=nt[2]||0,dt=nt[3]||0;at.beginPath(),at.moveTo(j+st,et),at.lineTo(j+tt-ot,et),ot&&at.quadraticCurveTo(j+tt,et,j+tt,et+ot),at.lineTo(j+tt,et+tt-ut),ut&&at.quadraticCurveTo(j+tt,et+tt,j+tt-ut,et+tt),at.lineTo(j+dt,et+tt),dt&&at.quadraticCurveTo(j,et+tt,j,et+tt-dt),at.lineTo(j,et+st),st&&at.quadraticCurveTo(j,et,j+st,et),at.closePath(),at.stroke(),it&&at.fill()},a.prototype.drawPositioningPattern=function($,j,et,tt,rt,nt,it){it===void 0&&(it=[0,0,0,0]);var at=Math.ceil(j),st,ot;typeof it!="number"&&!Array.isArray(it)?(st=it.outer||0,ot=it.inner||0):(st=it,ot=st);var ut,dt;typeof nt!="string"?(ut=nt.outer,dt=nt.inner):(ut=nt,dt=nt);var mt=tt*j+et,xt=rt*j+et,Ct=j*7;this.drawRoundedSquare(at,xt,mt,Ct,ut,st,!1,$),Ct=j*3,mt+=j*2,xt+=j*2,this.drawRoundedSquare(at,xt,mt,Ct,dt,ot,!0,$)},a.prototype.isInPositioninZone=function($,j,et){return et.some(function(tt){return j>=tt.row&&j<=tt.row+7&&$>=tt.col&&$<=tt.col+7})},a.prototype.transformPixelLengthIntoNumberOfCells=function($,j){return $/j},a.prototype.isCoordinateInImage=function($,j,et,tt,rt,nt,it,at){if(at){var st=2,ot=this.transformPixelLengthIntoNumberOfCells(rt,it),ut=this.transformPixelLengthIntoNumberOfCells(nt,it),dt=this.transformPixelLengthIntoNumberOfCells(et,it)-1,mt=this.transformPixelLengthIntoNumberOfCells(tt,it)-1;return j>=ot-st&&j<=ot+dt+st&&$>=ut-st&&$<=ut+mt+st}else return!1},a.prototype.shouldComponentUpdate=function($){return!isEqual$1(this.props,$)},a.prototype.componentDidMount=function(){this.update()},a.prototype.componentDidUpdate=function(){this.update()},a.prototype.update=function(){var $,j=this.props,et=j.value,tt=j.ecLevel,rt=j.enableCORS,nt=j.bgColor,it=j.fgColor,at=j.logoImage,st=j.logoOpacity,ot=j.logoOnLoad,ut=j.removeQrCodeBehindLogo,dt=j.qrStyle,mt=j.eyeRadius,xt=j.eyeColor,Ct=j.logoPaddingStyle,Pt=+this.props.size,Tt=+this.props.quietZone,Mt=this.props.logoWidth?+this.props.logoWidth:0,Lt=this.props.logoHeight?+this.props.logoHeight:0,Nt=this.props.logoPadding?+this.props.logoPadding:0,zt=qrGenerator(0,tt);zt.addData(this.utf16to8(et)),zt.make();var Bt=($=this.canvasRef)===null||$===void 0?void 0:$.current,It=Bt.getContext("2d"),Dt=Pt+2*Tt,Ft=zt.getModuleCount(),Ot=Pt/Ft,yt=window.devicePixelRatio||1;Bt.height=Bt.width=Dt*yt,It.scale(yt,yt),It.fillStyle=nt,It.fillRect(0,0,Dt,Dt);var bt=Tt,ct=[{row:0,col:0},{row:0,col:Ft-7},{row:Ft-7,col:0}];if(It.strokeStyle=it,dt==="dots"){It.fillStyle=it;for(var ht=Ot/2,vt=0;vt0&&!zt.isDark(vt-1,wt)&&wt>0&&!zt.isDark(vt,wt-1)&&(At[0]=!0),vt>0&&!zt.isDark(vt-1,wt)&&wt0&&!zt.isDark(vt,wt-1)&&(At[3]=!0);var Rt=Math.ceil((wt+1)*Ot)-Math.floor(wt*Ot),Et=Math.ceil((vt+1)*Ot)-Math.floor(vt*Ot);It.fillStyle=it,It.beginPath(),It.arc(Math.round(wt*Ot)+ht+bt,Math.round(vt*Ot)+ht+bt,ht,0,2*Math.PI,!1),It.closePath(),It.fill(),At[0]||It.fillRect(Math.round(wt*Ot)+bt,Math.round(vt*Ot)+bt,Rt/2,Et/2),At[1]||It.fillRect(Math.round(wt*Ot)+bt+Math.floor(Rt/2),Math.round(vt*Ot)+bt,Rt/2,Et/2),At[2]||It.fillRect(Math.round(wt*Ot)+bt+Math.floor(Rt/2),Math.round(vt*Ot)+bt+Math.floor(Et/2),Rt/2,Et/2),At[3]||It.fillRect(Math.round(wt*Ot)+bt,Math.round(vt*Ot)+bt+Math.floor(Et/2),Rt/2,Et/2)}}else for(var vt=0;vt{const $=useGetOwnedAccountSafe()(_);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:_})})})}),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(_),mode:{type:"no_icons"}})})]})})]})},AccountCard=({accountPkh:_})=>{const a=useGetOwnedAccount(),$=useGetAccountAllTokens(),j=useGetAccountNFTs(),{openWith:et}=reactExports.useContext(DynamicModalContext),tt=a(_),rt=$(_),nt=sortedByLastUpdate(j(_));return jsxRuntimeExports.jsx(AccountDrawerDisplay,{account:tt,nfts:nt,onReceive:()=>et(jsxRuntimeExports.jsx(ReceiveModal,{pkh:_})),onSend:()=>et(jsxRuntimeExports.jsx(FormPage$6,{sender:tt})),tokens:rt})},InfoModal=({account:_})=>{const a=[{title:"Template",content:_.derivationPathTemplate},{title:"Path",content:_.derivationPath},{title:"Type (Curve)",content:_.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:a.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(_.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:_})),variant:"CTAWithIcon",...a,children:jsxRuntimeExports.jsx(FolderInfoIcon,{stroke:"currentcolor"})})}},CloseDrawerButton=({onClose:_})=>jsxRuntimeExports.jsx(Button,{minWidth:"24px",padding:"0","data-testid":"close-drawer-button",onClick:_,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 at=it.endsWith(".css"),st=at?'[rel="stylesheet"]':"";if(!!j)for(let dt=tt.length-1;dt>=0;dt--){const mt=tt[dt];if(mt.href===it&&(!at||mt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${it}"]${st}`))return;const ut=document.createElement("link");if(ut.rel=at?"stylesheet":scriptRel,at||(ut.as="script",ut.crossOrigin=""),ut.href=it,nt&&ut.setAttribute("nonce",nt),document.head.appendChild(ut),at)return new Promise((dt,mt)=>{ut.addEventListener("load",dt),ut.addEventListener("error",()=>mt(new Error(`Unable to preload CSS for ${it}`)))})}))}return et.then(()=>a()).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=a,$.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($,a[$])}function stdOnEnd(_,a){_.onload=function(){this.onerror=this.onload=null,a(null,_)},_.onerror=function(){this.onerror=this.onload=null,a(new Error("Failed to load "+this.src),_)}}function ieOnEnd(_,a){_.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,a(null,_))}}var isMergeableObject=function _(a){return isNonNullObject(a)&&!isSpecial(a)};function isNonNullObject(_){return!!_&&typeof _=="object"}function isSpecial(_){var a=Object.prototype.toString.call(_);return a==="[object RegExp]"||a==="[object Date]"||isReactElement(_)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(_){return _.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(_){return Array.isArray(_)?[]:{}}function cloneUnlessOtherwiseSpecified(_,a){return a.clone!==!1&&a.isMergeableObject(_)?deepmerge(emptyTarget(_),_,a):_}function defaultArrayMerge(_,a,$){return _.concat(a).map(function(j){return cloneUnlessOtherwiseSpecified(j,$)})}function getMergeFunction(_,a){if(!a.customMerge)return deepmerge;var $=a.customMerge(_);return typeof $=="function"?$:deepmerge}function getEnumerableOwnPropertySymbols(_){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(_).filter(function(a){return Object.propertyIsEnumerable.call(_,a)}):[]}function getKeys(_){return Object.keys(_).concat(getEnumerableOwnPropertySymbols(_))}function propertyIsOnObject(_,a){try{return a in _}catch{return!1}}function propertyIsUnsafe(_,a){return propertyIsOnObject(_,a)&&!(Object.hasOwnProperty.call(_,a)&&Object.propertyIsEnumerable.call(_,a))}function mergeObject(_,a,$){var j={};return $.isMergeableObject(_)&&getKeys(_).forEach(function(et){j[et]=cloneUnlessOtherwiseSpecified(_[et],$)}),getKeys(a).forEach(function(et){propertyIsUnsafe(_,et)||(propertyIsOnObject(_,et)&&$.isMergeableObject(a[et])?j[et]=getMergeFunction(et,$)(_[et],a[et],$):j[et]=cloneUnlessOtherwiseSpecified(a[et],$))}),j}function deepmerge(_,a,$){$=$||{},$.arrayMerge=$.arrayMerge||defaultArrayMerge,$.isMergeableObject=$.isMergeableObject||isMergeableObject,$.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var j=Array.isArray(a),et=Array.isArray(_),tt=j===et;return tt?j?$.arrayMerge(_,a,$):mergeObject(_,a,$):cloneUnlessOtherwiseSpecified(a,$)}deepmerge.all=function _(a,$){if(!Array.isArray(a))throw new Error("first argument should be an array");return a.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 a)__defProp$6(_,$,{get:a[$],enumerable:!0})},__copyProps$6=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$6(a))!__hasOwnProp$6.call(_,et)&&et!==$&&__defProp$6(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$6(a,et))||j.enumerable});return _},__toESM$4=(_,a,$)=>($=_!=null?__create$4(__getProtoOf$4(_)):{},__copyProps$6(!_||!_.__esModule?__defProp$6($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$6=_=>__copyProps$6(__defProp$6({},"__esModule",{value:!0}),_),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=_=>import_react$2.default.lazy(async()=>{const a=await _();return typeof a.default=="function"?a:a.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(_ instanceof Array)return;const $=_.match(a);if($){const j=$[1];if(j.match(MATCH_START_STAMP))return parseTimeString(j);if(MATCH_NUMERIC.test(j))return parseInt(j)}}function parseTimeString(_){let a=0,$=MATCH_START_STAMP.exec(_);for(;$!==null;){const[,j,et]=$;et==="h"&&(a+=parseInt(j,10)*60*60),et==="m"&&(a+=parseInt(j,10)*60),et==="s"&&(a+=parseInt(j,10)),$=MATCH_START_STAMP.exec(_)}return a}function parseStartTime(_){return parseTimeParam(_,MATCH_START_QUERY)}function parseEndTime(_){return parseTimeParam(_,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(_){return Object.keys(_).map(a=>`${a}=${_[a]}`).join("&")}function getGlobal(_){return window[_]?window[_]:window.exports&&window.exports[_]?window.exports[_]:window.module&&window.module.exports&&window.module.exports[_]?window.module.exports[_]: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[a]){requests[a].push({resolve:nt,reject:it});return}requests[a]=[{resolve:nt,reject:it}];const at=st=>{requests[a].forEach(ot=>ot.resolve(st))};if(j){const st=window[j];window[j]=function(){st&&st(),at(getGlobal($))}}tt(a,st=>{st?(requests[a].forEach(ot=>ot.reject(st)),requests[a]=null):j||at(getGlobal($))})})};function getConfig(_,a){return(0,import_deepmerge$1.default)(a.config,_.config)}function omit(_,...a){const $=[].concat(...a),j={},et=Object.keys(_);for(const tt of et)$.indexOf(tt)===-1&&(j[tt]=_[tt]);return j}function callPlayer(_,...a){if(!this.player||!this.player[_]){let $=`ReactPlayer: ${this.constructor.displayName} player could not call %c${_}%c – `;return this.player?this.player[_]||($+="The method was not available"):$+="The player was not available",console.warn($,"font-weight: bold",""),null}return this.player[_](...a)}function isMediaStream(_){return typeof window<"u"&&typeof window.MediaStream<"u"&&_ instanceof window.MediaStream}function isBlobUrl(_){return/^blob:/.test(_)}function supportsWebKitPresentationMode(_=document.createElement("video")){const a=/iPhone|iPod/.test(navigator.userAgent)===!1;return _.webkitSupportsPresentationMode&&typeof _.webkitSetPresentationMode=="function"&&a}function enableStubOn(_){return _}var __defProp$5=Object.defineProperty,__getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__getOwnPropNames$5=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__export$5=(_,a)=>{for(var $ in a)__defProp$5(_,$,{get:a[$],enumerable:!0})},__copyProps$5=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$5(a))!__hasOwnProp$5.call(_,et)&&et!==$&&__defProp$5(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$5(a,et))||j.enumerable});return _},__toCommonJS$5=_=>__copyProps$5(__defProp$5({},"__esModule",{value:!0}),_),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=_=>{if(_ instanceof Array){for(const a of _)if(typeof a=="string"&&canPlayFile(a)||canPlayFile(a.src))return!0;return!1}return(0,import_utils$3.isMediaStream)(_)||(0,import_utils$3.isBlobUrl)(_)?!0:AUDIO_EXTENSIONS.test(_)||VIDEO_EXTENSIONS.test(_)||HLS_EXTENSIONS.test(_)||DASH_EXTENSIONS.test(_)||FLV_EXTENSIONS.test(_)},canPlay={youtube:_=>_ instanceof Array?_.every(a=>MATCH_URL_YOUTUBE.test(a)):MATCH_URL_YOUTUBE.test(_),soundcloud:_=>MATCH_URL_SOUNDCLOUD.test(_)&&!AUDIO_EXTENSIONS.test(_),vimeo:_=>MATCH_URL_VIMEO.test(_)&&!VIDEO_EXTENSIONS.test(_)&&!HLS_EXTENSIONS.test(_),mux:_=>MATCH_URL_MUX.test(_),facebook:_=>MATCH_URL_FACEBOOK.test(_)||MATCH_URL_FACEBOOK_WATCH.test(_),streamable:_=>MATCH_URL_STREAMABLE.test(_),wistia:_=>MATCH_URL_WISTIA.test(_),twitch:_=>MATCH_URL_TWITCH_VIDEO.test(_)||MATCH_URL_TWITCH_CHANNEL.test(_),dailymotion:_=>MATCH_URL_DAILYMOTION.test(_),mixcloud:_=>MATCH_URL_MIXCLOUD.test(_),vidyard:_=>MATCH_URL_VIDYARD.test(_),kaltura:_=>MATCH_URL_KALTURA.test(_),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 a)__defProp$4(_,$,{get:a[$],enumerable:!0})},__copyProps$4=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$4(a))!__hasOwnProp$4.call(_,et)&&et!==$&&__defProp$4(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$4(a,et))||j.enumerable});return _},__toCommonJS$4=_=>__copyProps$4(__defProp$4({},"__esModule",{value:!0}),_),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-Cwa38Ls5.js").then(_=>_.Y),[],import.meta.url))},{key:"soundcloud",name:"SoundCloud",canPlay:import_patterns.canPlay.soundcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./SoundCloud-DS8KXVAo.js").then(_=>_.S),[],import.meta.url))},{key:"vimeo",name:"Vimeo",canPlay:import_patterns.canPlay.vimeo,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vimeo-nVpRmTEP.js").then(_=>_.V),[],import.meta.url))},{key:"mux",name:"Mux",canPlay:import_patterns.canPlay.mux,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mux-D9G8DHjb.js").then(_=>_.M),[],import.meta.url))},{key:"facebook",name:"Facebook",canPlay:import_patterns.canPlay.facebook,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Facebook-CEQRJtOO.js").then(_=>_.F),[],import.meta.url))},{key:"streamable",name:"Streamable",canPlay:import_patterns.canPlay.streamable,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Streamable-DWbRU8FY.js").then(_=>_.S),[],import.meta.url))},{key:"wistia",name:"Wistia",canPlay:import_patterns.canPlay.wistia,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Wistia-BHULf2Bi.js").then(_=>_.W),[],import.meta.url))},{key:"twitch",name:"Twitch",canPlay:import_patterns.canPlay.twitch,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Twitch-DDWkSoF2.js").then(_=>_.T),[],import.meta.url))},{key:"dailymotion",name:"DailyMotion",canPlay:import_patterns.canPlay.dailymotion,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./DailyMotion-LcyIyxiV.js").then(_=>_.D),[],import.meta.url))},{key:"mixcloud",name:"Mixcloud",canPlay:import_patterns.canPlay.mixcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mixcloud-Dmu-zW6D.js").then(_=>_.M),[],import.meta.url))},{key:"vidyard",name:"Vidyard",canPlay:import_patterns.canPlay.vidyard,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vidyard-DD9iuBbH.js").then(_=>_.V),[],import.meta.url))},{key:"kaltura",name:"Kaltura",canPlay:import_patterns.canPlay.kaltura,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Kaltura-B-5UXQjQ.js").then(_=>_.K),[],import.meta.url))},{key:"file",name:"FilePlayer",canPlay:import_patterns.canPlay.file,canEnablePIP:_=>import_patterns.canPlay.file(_)&&(document.pictureInPictureEnabled||(0,import_utils$2.supportsWebKitPresentationMode)())&&!import_patterns.AUDIO_EXTENSIONS.test(_),lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./FilePlayer-DvQ-UKAf.js").then(_=>_.F),[],import.meta.url))}],safeIsNaN=Number.isNaN||function _(a){return typeof a=="number"&&a!==a};function isEqual(_,a){return!!(_===a||safeIsNaN(_)&&safeIsNaN(a))}function areInputsEqual(_,a){if(_.length!==a.length)return!1;for(var $=0;$<_.length;$++)if(!isEqual(_[$],a[$]))return!1;return!0}function memoizeOne(_,a){a===void 0&&(a=areInputsEqual);var $,j=[],et,tt=!1;function rt(){for(var nt=[],it=0;it{for(var $ in a)__defProp$3(_,$,{get:a[$],enumerable:!0})},__copyProps$3=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$3(a))!__hasOwnProp$3.call(_,et)&&et!==$&&__defProp$3(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$3(a,et))||j.enumerable});return _},__toESM$3=(_,a,$)=>($=_!=null?__create$3(__getProtoOf$3(_)):{},__copyProps$3(!_||!_.__esModule?__defProp$3($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$3=_=>__copyProps$3(__defProp$3({},"__esModule",{value:!0}),_),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,$)=>a in _?__defProp$2(_,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):_[a]=$,__export$2=(_,a)=>{for(var $ in a)__defProp$2(_,$,{get:a[$],enumerable:!0})},__copyProps$2=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$2(a))!__hasOwnProp$2.call(_,et)&&et!==$&&__defProp$2(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$2(a,et))||j.enumerable});return _},__toESM$2=(_,a,$)=>($=_!=null?__create$2(__getProtoOf$2(_)):{},__copyProps$2(!_||!_.__esModule?__defProp$2($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$2=_=>__copyProps$2(__defProp$2({},"__esModule",{value:!0}),_),__publicField$1=(_,a,$)=>(__defNormalProp$1(_,typeof a!="symbol"?a+"":a,$),$),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",a=>{if(this.player){this.progress();return}this.player=a,this.player.load(this.props.url),this.progress()}),__publicField$1(this,"getInternalPlayer",a=>this.player?this.player[a]:null),__publicField$1(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const a=this.getCurrentTime()||0,$=this.getSecondsLoaded(),j=this.getDuration();if(j){const et={playedSeconds:a,played:a/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:a,playing:$,volume:j,muted:et}=this.props;a(),!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:a,onPlay:$,playbackRate:j}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&j!==1&&this.player.setPlaybackRate(j),a(),this.startOnPlay=!1),$(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),__publicField$1(this,"handlePause",a=>{this.isPlaying=!1,this.isLoading||this.props.onPause(a)}),__publicField$1(this,"handleEnded",()=>{const{activePlayer:a,loop:$,onEnded:j}=this.props;a.loopOnEnded&&$&&this.seekTo(0),$||(this.isPlaying=!1,j())}),__publicField$1(this,"handleError",(...a)=>{this.isLoading=!1,this.props.onError(...a)}),__publicField$1(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const a=this.getDuration();a?this.onDurationCalled||(this.props.onDuration(a),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(a){if(!this.player)return;const{url:$,playing:j,volume:et,muted:tt,playbackRate:rt,pip:nt,loop:it,activePlayer:at,disableDeferredLoading:st}=this.props;if(!(0,import_react_fast_compare$1.default)(a.url,$)){if(this.isLoading&&!at.forceLoad&&!st&&!(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)}!a.playing&&j&&!this.isPlaying&&this.player.play(),a.playing&&!j&&this.isPlaying&&this.player.pause(),!a.pip&&nt&&this.player.enablePIP&&this.player.enablePIP(),a.pip&&!nt&&this.player.disablePIP&&this.player.disablePIP(),a.volume!==et&&et!==null&&this.player.setVolume(et),a.muted!==tt&&(tt?this.player.mute():(this.player.unmute(),et!==null&&setTimeout(()=>this.player.setVolume(et)))),a.playbackRate!==rt&&this.player.setPlaybackRate&&this.player.setPlaybackRate(rt),a.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(a,$,j){if(!this.isReady){a!==0&&(this.seekOnPlay=a,setTimeout(()=>{this.seekOnPlay=null},SEEK_ON_PLAY_EXPIRY));return}if($?$==="fraction":a>0&&a<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*a,j);return}this.player.seekTo(a,j)}render(){const a=this.props.activePlayer;return a?import_react$1.default.createElement(a,{...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,$)=>a in _?__defProp$1(_,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):_[a]=$,__export$1=(_,a)=>{for(var $ in a)__defProp$1(_,$,{get:a[$],enumerable:!0})},__copyProps$1=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$1(a))!__hasOwnProp$1.call(_,et)&&et!==$&&__defProp$1(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$1(a,et))||j.enumerable});return _},__toESM$1=(_,a,$)=>($=_!=null?__create$1(__getProtoOf$1(_)):{},__copyProps$1(!_||!_.__esModule?__defProp$1($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$1=_=>__copyProps$1(__defProp$1({},"__esModule",{value:!0}),_),__publicField=(_,a,$)=>(__defNormalProp(_,typeof a!="symbol"?a+"":a,$),$),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-Bd7ZaSyq.js").then(_=>_.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,..._])if(et.canPlay(j))return et;return a||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:at}=this.state,st=this.getAttributes(j),ot=typeof it=="string"?this.references.wrapper:void 0;return import_react.default.createElement(it,{ref:ot,style:{...et,width:tt,height:rt},...st},import_react.default.createElement(UniversalSuspense,{fallback:nt},at?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,..._])if(et.canPlay(j))return!0;return!1}),__publicField($,"canEnablePIP",j=>{for(const et of[...customPlayers,..._])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 a)__defProp(_,$,{get:a[$],enumerable:!0})},__copyProps=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames(a))!__hasOwnProp.call(_,et)&&et!==$&&__defProp(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc(a,et))||j.enumerable});return _},__toESM=(_,a,$)=>($=_!=null?__create(__getProtoOf(_)):{},__copyProps(!_||!_.__esModule?__defProp($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS=_=>__copyProps(__defProp({},"__esModule",{value:!0}),_),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:_,style:a})=>{const $=_.metadata.attributes;return!$||$.length===0?null:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],"data-testid":"attributes-section",style:a,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:_,maxLength:a})=>_.length<=a?jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:_}):jsxRuntimeExports.jsx(Tooltip,{label:_,children:jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:truncate(_,a)})}),TzktLink=({url:_,...a})=>jsxRuntimeExports.jsx("a",{"data-testid":"tzkt-link",href:_,rel:"noopener noreferrer",target:"_blank",children:jsxRuntimeExports.jsx(WindowLinkIcon,{...a})}),CreatorElement=({nft:_})=>{if(!_.metadata.creators||_.metadata.creators.length===0)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"-"});const a=_.metadata.creators[0];return a.startsWith("tz")?jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(a)}):jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:a})},PropertiesAccordionItem=({nft:_,style:a})=>{const $=royalties(_),j=$.reduce((tt,rt)=>tt+rt.share,0).toFixed(2),et=useSelectedNetwork();return jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:a,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:_.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:_.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(_)||"-"})]}),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(_.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(_,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:_})}),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:_.metadata.rights||"-"})})]})]})})})})]})},TagsSection=({nft:_})=>{const a=_.metadata.tags;return!a||a.length===0?null:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"tags-section",children:a.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:_})=>{const a=getIPFSurl(thumbnailUri(_)),$=getIPFSurl(_.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(_.metadata.name,45)})]})})},SignPage$1=_=>{const{mode:a,operations:$,data:{nft:j}}=_,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:at,reEstimate:st,onSign:ot}=useSignPageHelpers($,a),{recipient:ut}=tt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:j})}),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:j.balance})]}),jsxRuntimeExports.jsx(SignPageFee,{fee:et})]}),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:[tt.operations[0].amount," out of ",j.balance]})})]}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:tt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:ut}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:st,sender:tt.sender}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:ot,signer:at,text:headerText(tt.type,a)})})]})})})},FormPage$1=_=>{const{nft:a}=_,$=useOpenSignPageFormAction({SignPage:SignPage$1,signPageExtraData:{nft:a},FormPage:FormPage$1,defaultFormPageProps:_,toOperation:toOperation$1(a)}),j=useAddToBatchFormAction(toOperation$1(a)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:{quantity:1,...formDefaultValues(_)}}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=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:_.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:a.balance})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.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",...st("quantity",{required:"Quantity is required",max:{value:a.balance,message:`Max quantity is ${a.balance}`},min:{value:1,message:"Min quantity is 1"}})})}),jsxRuntimeExports.jsxs(Text,{"data-testid":"out-of-nft",children:["out of ",a.balance]})]})]})}),at.quantity&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"quantity-error",children:at.quantity.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),at.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:at.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation$1=_=>a=>({type:"fa2",sender:parsePkh(a.sender),recipient:parsePkh(a.recipient),contract:parseContractPkh(_.contract),tokenId:_.tokenId,amount:a.quantity.toString()}),NFTDrawerCard=({nft:_})=>{var it;const a=getIPFSurl(artifactUri(_)),$=getIPFSurl(_.displayUri),j=useGetOwnedAccount(),{openWith:et}=reactExports.useContext(DynamicModalContext),tt=(it=mimeType(_))==null?void 0:it.startsWith("video/"),rt=tokenName(_),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:a})}),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:a}),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:a})]})}),Number(_.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"+_.balance})]})}),jsxRuntimeExports.jsx(TagsSection,{nft:_}),rt&&jsxRuntimeExports.jsx(Heading,{marginTop:"16px",marginBottom:"14px","data-testid":"nft-name",size:"lg",children:rt}),_.metadata.description&&jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-description",size:"sm",children:_.metadata.description}),jsxRuntimeExports.jsx(Button,{marginTop:"20px",onClick:()=>et(jsxRuntimeExports.jsx(FormPage$1,{nft:_,sender:j(_.owner)})),children:"Send"}),jsxRuntimeExports.jsxs(Accordion,{marginTop:"32px",allowMultiple:!0,children:[jsxRuntimeExports.jsx(AttributesAccordionItem,{nft:_,style:nt}),jsxRuntimeExports.jsx(PropertiesAccordionItem,{nft:_,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:_})})]})]})]})},NFTDrawerBody=({nft:_,onCloseDrawer:a})=>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(_.owner)}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:a})]}),jsxRuntimeExports.jsx(NFTDrawerCard,{nft:_})]}),AccountListWithDrawer=()=>{const[_,a]=reactExports.useState(null),{ownerPkh:$,nftId:j}=useParams(),et=useAllNfts(),tt=$&&lodashExports.get(et,[$],[]).find(dt=>fullId(dt)===j),rt=!!tt,{isOpen:nt,onOpen:it,onClose:at}=useDisclosure$1({defaultIsOpen:rt}),st=useNavigate(),ot=reactExports.useCallback(()=>{a(null),at(),st("/home")},[at,st]);reactExports.useEffect(()=>{const dt=mt=>{mt.key==="Escape"&&ot()};return document.addEventListener("keydown",dt),()=>document.removeEventListener("keydown",dt)},[ot]);const ut=reactExports.useMemo(()=>({selectedAccount:_,selectAccount:dt=>{a(dt),it()}}),[_,it]);return jsxRuntimeExports.jsxs(SelectedAccountContext.Provider,{value:ut,children:[jsxRuntimeExports.jsx(AccountsList,{}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:nt,onClose:ot,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(DrawerContent,{children:[rt&&jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(NFTDrawerBody,{nft:{...tt,owner:$},onCloseDrawer:ot})}),!rt&&_&&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:_}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:ot})]}),jsxRuntimeExports.jsx(AccountCard,{accountPkh:_.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:_=>{}}),NFTCard=({nft:_})=>{const{selectedNFT:a,setSelectedNFT:$}=reactExports.useContext(SelectedNFTContext),j=getIPFSurl(thumbnailUri(_)),et=getIPFSurl(_.displayUri),tt=_.metadata.name,rt={width:"100%",minWidth:"242px",minHeight:"242px",objectFit:"contain",aspectRatio:"1",fallbackSrc:et,src:j},nt=a&&fullId(a)===fullId(_)&&a.owner===_.owner;return jsxRuntimeExports.jsx(Card,{minWidth:"274px",borderRadius:"8px",cursor:"pointer","data-testid":`nft-card${nt?"-selected":""}`,onClick:()=>$(_),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(_.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"+_.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(_.owner)})]})})},NFTGallery=({nftsByOwner:_})=>{const a=Object.entries(_).flatMap(([j,et])=>(et||[]).map(tt=>({owner:j,...tt})));let $="repeat(auto-fit, minmax(min(100%/2, max(274px, 100%/7)), 1fr))";return a.length<3&&($=`repeat(auto-fit, min(100% / ${a.length} - 16px, 450px))`),jsxRuntimeExports.jsx(SimpleGrid,{gridTemplateColumns:$,marginBottom:"16px",minChildWidth:"340px",spacing:"16px",children:sortedByLastUpdate(a).map(j=>jsxRuntimeExports.jsx(NFTCard,{nft:j},`${j.owner}:${fullId(j)}`))})},AccountListDisplay=({accounts:_,onSelect:a})=>jsxRuntimeExports.jsx(MenuList,{zIndex:"docked",overflowY:"scroll",maxHeight:"300px",padding:0,background:colors.gray[900],children:_.map($=>jsxRuntimeExports.jsx(MenuItem$1,{width:"100%",minHeight:"48px",padding:"5px",background:colors.gray[700],"aria-label":$.label,onClick:()=>{a($)},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 _=useAllAccounts(),[a]=reactExports.useState(_),[$,j]=useSearchParams(),et=$.getAll("accounts"),[tt,rt]=reactExports.useState(et.length===0),[nt,it]=reactExports.useState(_.filter(ot=>et.includes(ot.address.pkh))),at=lodashExports.differenceBy(_,nt,ot=>ot.address.pkh),st=nt.length===_.length;return reactExports.useEffect(()=>{j(ot=>({...ot,accounts:nt.map(ut=>ut.address.pkh)}))},[nt,j]),{selectedAccounts:tt?a: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:st,marginY:"16px",rightIcon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),variant:"ghost",children:"Filter by Account"}),jsxRuntimeExports.jsx(AccountListDisplay,{accounts:at,onSelect:ot=>{rt(!1),it(ut=>[...ut,ot])}})]})}),jsxRuntimeExports.jsx(Wrap,{width:"100%",children:nt.map(ot=>jsxRuntimeExports.jsx(AddressPill,{address:ot.address,"data-testid":"account-pill",mode:{type:"removable",onRemove:()=>{rt(nt.length===1),it(ut=>ut.filter(dt=>dt.address.pkh!==ot.address.pkh))}}},ot.address.pkh))})]})}},NFTsView=()=>{const _=useAllNfts(),{accountsFilter:a,selectedAccounts:$}=useAccountsFilter(),[j,et]=reactExports.useState(void 0);reactExports.useEffect(()=>{const it=at=>{at.key==="Escape"&&et(void 0)};return document.addEventListener("keydown",it),()=>document.removeEventListener("keydown",it)},[]);const tt=lodashExports.pick(_,$.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"}),a,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:_,selectedAccounts:a}=useAccountsFilter(),{operations:$,loadMore:j,hasMore:et,isLoading:tt,isFirstLoad:rt}=useGetOperations(a),nt=reactExports.useRef(!1),it=at=>{if(nt.current||!et||tt)return;const st=at.target;if(st.scrollHeight-st.scrollTop-st.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"}),_,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((at,st)=>{const ot=st===$.length-1;return jsxRuntimeExports.jsxs(Box,{height:"90px",marginBottom:ot?"10px":0,paddingY:"20px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:at}),!ot&&jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Divider,{marginTop:"20px"})})]},at.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",...a,children:jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:_})}),BeaconPeers=()=>{const _=usePeers(),[a,$]=reactExports.useState([]);return reactExports.useEffect(()=>{const j=_.map(async et=>({...et,senderId:et.senderId||await getSenderId(et.publicKey)}));Promise.all(j).then($).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:a})},PeersDisplay=({peerInfos:_})=>jsxRuntimeExports.jsx(Box,{children:_.map(a=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(PeerRow,{peerInfo:a})]},a.senderId))}),PeerRow=({peerInfo:_})=>{const a=useRemovePeer();return 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:_.icon})}),jsxRuntimeExports.jsxs(Center,{alignItems:"flex-start",flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"6px",size:"md",children:_.name}),jsxRuntimeExports.jsx(StoredPeerInfo,{peerInfo:_})]})]}),jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(IconButton,{"aria-label":"Remove Peer",icon:jsxRuntimeExports.jsx(TrashIcon,{}),onClick:()=>a(_),size:"xs",variant:"circle"})})]})},StoredPeerInfo=({peerInfo:_})=>{const a=useGetConnectionInfo(_.senderId);return a?jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"10px",address:parsePkh(a.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(a.networkType)})]}):null},DAppsDrawerCard=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1(),j=useAddPeer();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"dApps",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"drawer-body",children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),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:_,onClose:a,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Error Logs",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsx(ErrorLogsDrawerBody,{})]})})]})]})},ErrorLogsDrawerBody=()=>{const _=[...useAppSelector(j=>j.errors)].reverse(),a=useDispatch(),$=()=>{a(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(_))}`,children:jsxRuntimeExports.jsx(Button,{variant:"tertiary",children:"Download error logs"})}),jsxRuntimeExports.jsx(Button,{marginLeft:"8px",onClick:$,variant:"warning",children:"Clear All"})]})]}),_.map(j=>jsxRuntimeExports.jsx(ErrorLogRow,{errorLog:j},nanoid()))]})},ErrorLogRow=({errorLog:_})=>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:_.description}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:_.timestamp})]})]})})]}),removeTrailingSlashes=_=>_.replace(/\/+$/g,""),UpsertNetworkModal=({network:_})=>{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:_}),at=st=>{j(networksActions.upsertNetwork(st)),$()};return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:it(at),children:[jsxRuntimeExports.jsxs(ModalHeader,{textAlign:"center",children:[a==="edit"?"Edit":"Add"," Network",jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[a==="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:st=>{if(et.find(ot=>ot.name===st))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:a==="edit"?"Save changes":"Add network"})})]})]})})},NetworkSettingsDrawerBody=()=>{const{openWith:_}=reactExports.useContext(DynamicModalContext),a=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:()=>_(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:a.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:()=>_(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:_,onClose:a,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Network Settings",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsx(NetworkSettingsDrawerBody,{})]})})]})]})},ChangePasswordForm=()=>{const{onClose:_}=reactExports.useContext(DynamicModalContext),a=useForm({mode:"onBlur"}),$=useToast(),j=useAppDispatch(),{handleAsyncAction:et,isLoading:tt}=useAsyncActionHandler(),{handleSubmit:rt,formState:{isValid:nt,errors:it},getValues:at}=a,st=async({currentPassword:ot,newPassword:ut,newPasswordConfirmation:dt})=>{if(!(ot===ut||ut!==dt))return et(async()=>{await j(changeMnemonicPassword({currentPassword:ot,newPassword:ut})).unwrap(),$({description:"Password updated",status:"success"}),_()})};return jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[700],"data-testid":"change-password-modal",children:jsxRuntimeExports.jsxs("form",{onSubmit:rt(st),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:ot=>at("currentPassword")!==ot||"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:ot=>at("newPassword")===ot||"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:_,onOpen:a}=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:a}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Change Password",isSelected:!1,onClick:()=>$(jsxRuntimeExports.jsx(ChangePasswordForm,{}))}),_]})},SectionContainer=({title:_,children:a})=>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:_,amount:a,...$})=>{const{contract:j}=_,et=tokenPrettyAmount(a,_),tt=tokenSymbolSafe(_);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=_=>{const{mode:a,operations:$,data:{token:j}}=_,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:at,reEstimate:st,onSign:ot}=useSignPageHelpers($,a),{amount:ut,recipient:dt}=tt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(TokenTile,{amount:ut,token:j}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(SignPageFee,{fee:et})})}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:tt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:dt}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:st,sender:tt.sender}),jsxRuntimeExports.jsx(AdvancedSettingsAccordion,{})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:ot,signer:at,text:headerText(tt.type,a)})})]})})})},FormPage=_=>{const{token:a}=_,$=useOpenSignPageFormAction({SignPage,signPageExtraData:{token:a},FormPage,defaultFormPageProps:_,toOperation:toOperation(a)}),j=useAddToBatchFormAction(toOperation(a)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(_)}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=nt,ut=tokenDecimals(a),dt=formatTokenAmount(a.balance,ut),mt=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:!!at.prettyAmount,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Amount"}),jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{isDisabled:rt,step:mt,type:"number",...st("prettyAmount",{required:"Amount is required",max:{value:dt.toString(),message:`Max amount is ${dt}`},validate:makeValidateDecimals(Number(ut))}),placeholder:mt}),jsxRuntimeExports.jsx(InputRightElement,{paddingRight:"12px","data-testid":"token-symbol",children:tokenSymbolSafe(a)})]}),at.prettyAmount&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"amount-error",children:at.prettyAmount.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),at.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:at.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation=_=>a=>{const $={type:"fa2",sender:parsePkh(a.sender),recipient:parsePkh(a.recipient),contract:parseContractPkh(_.contract),tokenId:_.tokenId,amount:getRealAmount(_,a.prettyAmount)};return _.type==="fa2"?$:{...$,type:"fa1.2",tokenId:"0"}},Header=({account:_})=>{const{address:a,label:$}=_;return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"78px",background:accountIconGradient({left:"-10px",top:"-10px",account:_,radius:"100px",mainBackgroundColor:colors.gray[800]}),borderTopRadius:"8px","data-testid":"header",paddingX:"30px",children:[jsxRuntimeExports.jsx(AccountTileIcon,{account:_,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(a.pkh)})]}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column-reverse",children:jsxRuntimeExports.jsx(AccountBalance,{verticalAlign:"bottom",address:_.address.pkh})})]})]})},AccountTokens=({account:_,tokens:a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(Card,{overflowX:"auto",marginBottom:"16px",borderBottomRadius:"8px",backgroundColor:colors.gray[900],children:[jsxRuntimeExports.jsx(Header,{account:_}),jsxRuntimeExports.jsx(TableContainer,{paddingX:"30px",children:jsxRuntimeExports.jsx(Table,{children:jsxRuntimeExports.jsx(Tbody,{children:a.map((j,et)=>{const tt=et===a.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:_,token:j}))})})]},fullId(j))})})})})]})},TokensPage=()=>{const{accountsFilter:_,selectedAccounts:a}=useAccountsFilter(),$=useGetAccountAllTokens(),j=a.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"}),_,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 $=_?packageInfo.version:`Umami v${packageInfo.version}`;return jsxRuntimeExports.jsx(Text,{color:colors.gray[450],...a,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(()=>{a(j=>!j)},[]);return{isCollapsed:_,toggle:$}},ORANGE="#F74F18",MakiLogo=_=>{const a=useSelectedNetwork();return jsxRuntimeExports.jsx(MakiIcon,{background:"white",borderRadius:"8px","data-testid":"maki-logo",fishColor:a.name==="mainnet"?ORANGE:"black",..._})},NetworkSelector=()=>{const _=useSelectedNetwork(),a=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(_.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:a.map((rt,nt)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{height:"34px",color:rt.name===_.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{const[_,a]=reactExports.useState(!1),$=window;reactExports.useEffect(()=>{$&&$.electronAPI&&$.electronAPI.onAppUpdateDownloaded(et=>a(!0))},[$]);const j=()=>{$&&$.electronAPI&&$.electronAPI.installAppUpdateAndQuit()};return _?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:_,toggle:a}=useCollapseMenu(),$=jsxRuntimeExports.jsx(CollapseMenuButton,{marginTop:_?0:"2px",marginRight:_?0:"-14px",toggle:a});return jsxRuntimeExports.jsxs(Flex,{alignItems:_?"center":"normal",flexDirection:"column",width:_?"80px":"236px",padding:_?"30px 20px":"30px",background:colors.gray[900],"data-testid":`side-navbar${_?"-collapsed":""}`,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"30px",children:_?$: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:_?"center":"normal",justifyContent:_?"space-around":"normal",display:_?"flex":"block",height:"100%",children:[!_&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(UpdateAppButton,{}),jsxRuntimeExports.jsx(TotalBalance,{})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(AccountsIcon,{}),isCollapsed:_,label:"Accounts",to:"/home"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(DiamondIcon,{}),isCollapsed:_,label:"NFTs",to:"/nfts"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(RefreshClockIcon,{width:"24px",height:"24px"}),isCollapsed:_,label:"Operations",to:"/operations"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(CoinIcon,{}),isCollapsed:_,label:"Tokens",to:"/tokens"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(BatchIcon,{}),isCollapsed:_,label:"Batch",to:"/batch"})]})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(MenuItem,{marginTop:"22px",icon:jsxRuntimeExports.jsx(AddressBookIcon,{}),isCollapsed:_,label:"Address Book",to:"/address-book"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(GearIcon,{}),isCollapsed:_,label:"Settings",to:"/settings"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(HelpIcon,{}),isCollapsed:_,label:"Help",to:"/help"}),jsxRuntimeExports.jsx(AppVersion,{marginTop:"24px",fontSize:"14px",textAlign:_?"center":"left",isCollapsed:_})]})]})]})},MenuItem=({icon:_,label:a,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:[_,!j&&jsxRuntimeExports.jsx(Text,{marginLeft:"10px",size:"sm",children:a})]})})},TotalBalance=()=>{const _=useTotalBalance(),[a]=useMediaQuery("(max-height: 900px)");return jsxRuntimeExports.jsxs(Box,{marginTop:"24px",marginBottom:a?"30px":"100px","data-testid":"total-balance",children:[jsxRuntimeExports.jsx(Text,{marginBottom:"4px",size:"sm",children:"Balance"}),_&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:_.mutez,dollarBalance:_.usd})]})},withSideMenu=_=>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:_})]}),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(_){(function(a,$){$(_,reactExports,propTypesExports)})(commonjsGlobal,function(a,$,j){Object.defineProperty(a,"__esModule",{value:!0}),a.setHasSupportToCaptureOption=mt;var et=rt($),tt=rt(j);function rt(Tt){return Tt&&Tt.__esModule?Tt:{default:Tt}}var nt=Object.assign||function(Tt){for(var Mt=1;Mt=0||Object.prototype.hasOwnProperty.call(Tt,Nt)&&(Lt[Nt]=Tt[Nt]);return Lt}function at(Tt,Mt){if(!(Tt instanceof Mt))throw new TypeError("Cannot call a class as a function")}var st=function(){function Tt(Mt,Lt){for(var Nt=0;Nt0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return dt?Tt:Tt.capture}function Ct(Tt){if("touches"in Tt){var Mt=Tt.touches[0],Lt=Mt.pageX,Nt=Mt.pageY;return{x:Lt,y:Nt}}var zt=Tt.screenX,Bt=Tt.screenY;return{x:zt,y:Bt}}var Pt=function(Tt){ut(Mt,Tt);function Mt(){var Lt;at(this,Mt);for(var Nt=arguments.length,zt=Array(Nt),Bt=0;Btzt&&this.props.onSwipeRight(1,Nt),this.movePosition.deltaY<-zt?this.props.onSwipeUp(1,Nt):this.movePosition.deltaY>zt&&this.props.onSwipeDown(1,Nt)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(Nt){this.swiper=Nt,this.props.innerRef(Nt)}},{key:"render",value:function(){var Nt=this.props;Nt.tagName;var zt=Nt.className,Bt=Nt.style,It=Nt.children;Nt.allowMouseEvents,Nt.onSwipeUp,Nt.onSwipeDown,Nt.onSwipeLeft,Nt.onSwipeRight,Nt.onSwipeStart,Nt.onSwipeMove,Nt.onSwipeEnd,Nt.innerRef,Nt.tolerance;var Dt=it(Nt,["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:Bt},Dt),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},a.default=Pt})}(reactSwipe)),reactSwipe}(function(_){(function(a,$){$(_,requireReactSwipe())})(commonjsGlobal,function(a,$){Object.defineProperty(a,"__esModule",{value:!0});var j=et($);function et(tt){return tt&&tt.__esModule?tt:{default:tt}}a.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 5c75f7990..fbcc9f3b9 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ --> Umami - +