From 40688aeca2356c1e4acf48ba8d1162ade888e4f1 Mon Sep 17 00:00:00 2001 From: taylanpince Date: Wed, 22 May 2024 15:31:17 +0000 Subject: [PATCH] Build: (0989289) Fix css issues --- .../{index-fb6932bc.js => index-c628a5bb.js} | 30 +++++++++---------- index.html | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) rename assets/{index-fb6932bc.js => index-c628a5bb.js} (91%) diff --git a/assets/index-fb6932bc.js b/assets/index-c628a5bb.js similarity index 91% rename from assets/index-fb6932bc.js rename to assets/index-c628a5bb.js index 905be3a..a80741b 100644 --- a/assets/index-fb6932bc.js +++ b/assets/index-c628a5bb.js @@ -58,7 +58,7 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var kw;function _O(){if(kw)return nc;kw=1;var t=gr,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var f,u={},d=null,v=null;c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(v=l.ref);for(f in l)n.call(l,f)&&!s.hasOwnProperty(f)&&(u[f]=l[f]);if(a&&a.defaultProps)for(f in l=a.defaultProps,l)u[f]===void 0&&(u[f]=l[f]);return{$$typeof:e,type:a,key:d,ref:v,props:u,_owner:i.current}}return nc.Fragment=r,nc.jsx=o,nc.jsxs=o,nc}K8.exports=_O();var J=K8.exports;function OO(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function NO(t){var e=OO(t,"string");return typeof e=="symbol"?e:String(e)}function DO(t,e,r){return e=NO(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pw(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Rw(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},Qt=t=>{var e=r=>{var n=t.defaultClassName,i=Rw(Rw({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var l=a;typeof l=="boolean"&&(l=l===!0?"true":"false");var c=t.variantClassNames[s][l];c&&(n+=" "+c)}}for(var[f,u]of t.compoundVariants)LO(f,i,t.defaultVariants)&&(n+=" "+u);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return Tw(t.variantClassNames,r=>Tw(r,n=>n.split(" ")[0]))}},e};Qt({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"_2q9vfj8 _2q9vfj0 fyvr11ov",warning:"_2q9vfj9 _2q9vfj1 fyvr11p1",success:"_2q9vfja _2q9vfj2 fyvr11oj",error:"_2q9vfjb _2q9vfj3 fyvr11op"},size:{sm:"_2q9vfjc _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _2q9vfj4 fyvr1wo fyvr1yk fyvr13w fyvr1e8",md:"_2q9vfjd _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _2q9vfj5 fyvr1ws fyvr1yo fyvr140 fyvr1ec",lg:"_2q9vfje _1qxj1ib9 _1qxj1ibd _1qxj1ib3 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc _2q9vfj6 fyvr1ww fyvr1ys fyvr144 fyvr1eg"}},defaultVariants:{},compoundVariants:[]});const Co=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return J.jsx(re,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var jO=Qt({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"_1qxj1iba _1qxj1ib0 fyvr11mu fyvr11e4 fyvr11gg fyvr11fg fyvr11ew",xlarge:"_1qxj1ibb _1qxj1ib1 fyvr11mv fyvr11es fyvr11gc fyvr11fk fyvr11fc",large:"_1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8",medium:"_1qxj1ibd _1qxj1ib3 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc",normal:"_1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",small:"_1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4",xsmall:"_1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc",code:"_1qxj1ibh _1qxj1ib7 fyvr11mw fyvr11eg fyvr11g0 fyvr11fk fyvr11f0"},ellipsis:{true:"_1qxj1ibi _1qxj1ib8 fyvr11ls fyvr11m8 fyvr11n9 fyvr11mx"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const Pe=p.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:l,ellipsis:c,uppercase:f,capitalize:u,...d}=t,v=SO[n];return J.jsx(re,{as:r,className:fn(i,jO({hidden:s,ellipsis:c,italic:o,underline:a,uppercase:f,capitalize:u})),ref:e,...v,...d,children:l})});var BO=Qt({defaultClassName:"_140wn8ni _140wn8n0 fyvr11ls fyvr11m8 fyvr11n9 fyvr11ko fyvr12o1 fyvr11n2 fyvr11h0 _4efw240",variantClassNames:{variant:{base:"_140wn8nj _140wn8n1 fyvr11od fyvr12s1",ghost:"_140wn8nk _140wn8n2 fyvr11od fyvr12s1",feature:"_140wn8nl _140wn8n3 fyvr11pj fyvr12od",primary:"_140wn8nm _140wn8n4 fyvr11pd fyvr12od",glass:"_140wn8nn _140wn8n5 fyvr11tv fyvr12s1",emphasis:"_140wn8no _140wn8n6 fyvr11u1 fyvr12s1",raised:"_140wn8np _140wn8n7 fyvr11tp fyvr12s1",danger:"_140wn8nq _140wn8n8 fyvr11op fyvr12od",text:"_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _140wn8n9 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11od fyvr12sd"},shape:{circle:"_140wn8ns _140wn8na fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",square:"_140wn8nt _140wn8nb fyvr11d0 fyvr11do fyvr11bo fyvr11cc"},disabled:{true:"_140wn8nu _140wn8nc fyvr12v1 fyvr12vp",false:"_140wn8nv _140wn8nd fyvr12v7 fyvr12w1 fyvr12vz"},size:{xs:"_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _140wn8ne fyvr1ws fyvr1yo",sm:"_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nf fyvr1ww fyvr1ys",md:"_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8ng fyvr1x0 fyvr1yw",lg:"_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nh fyvr1x0 fyvr1yw"},iconOnly:{true:"_140wn8n10"},hasLeftIcon:{true:"_140wn8n11"},hasRightIcon:{true:"_140wn8n12"},activeOutline:{light:"_140wn8n13",bold:"_140wn8n14"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n15"],[{iconOnly:!0,size:"sm"},"_140wn8n16"],[{iconOnly:!0,size:"md"},"_140wn8n17"],[{iconOnly:!0,size:"lg"},"_140wn8n18"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n1b"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n1c"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1d"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1e"]]});const pr=p.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:l=!1,label:c,leftIcon:f,rightIcon:u,size:d="md",variant:v="glass",width:g="fit",shape:y="circle",type:w="button",...x}=t,b=f!==void 0&&c!==void 0,S=u!==void 0&&c!==void 0,P=f!==void 0&&c===void 0,_=d==="xs"?"xs":"sm";return J.jsx(re,{as:r,className:fn(i,BO({activeOutline:n,disabled:s||l,hasLeftIcon:b,hasRightIcon:S,iconOnly:P,size:v==="text"?void 0:d,shape:v==="text"?void 0:y,variant:v})),disabled:s||l,display:o,fontWeight:a,ref:e,type:w,width:g,...x,children:P?J.jsx(f,{size:_}):J.jsxs(re,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:d==="xs"?"1":"2",children:[J.jsxs(re,{justifyContent:"flex-start",alignItems:"center",gap:d==="xs"?"1":"2",children:[f&&J.jsx(f,{size:_}),J.jsx(Pe,{children:c})]}),u&&J.jsx(u,{size:_})]})})});var $O=Qt({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"rhmai64 rhmai60 fyvr11a4 fyvr11ag fyvr11as fyvr11b4 fyvr12vz fyvr12v7 _4efw240"},disabled:{true:"rhmai65"},outlined:{true:"rhmai66 rhmai61 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12nj fyvr12g7 fyvr121j fyvr128v"},blur:{true:"rhmai67 rhmai62 fyvr11ms"}},defaultVariants:{},compoundVariants:[]});p.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:l="full",...c}=t;return J.jsx(re,{className:fn(r,$O({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:l,ref:e,...c,children:n})});function Kt(){return Kt=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>FO(r,e))}function It(...t){return p.useCallback(Q8(...t),t)}function qr(t,e=[]){let r=[];function n(s,o){const a=p.createContext(o),l=r.length;r=[...r,o];function c(u){const{scope:d,children:v,...g}=u,y=(d==null?void 0:d[t][l])||a,w=p.useMemo(()=>g,Object.values(g));return p.createElement(y.Provider,{value:w},v)}function f(u,d){const v=(d==null?void 0:d[t][l])||a,g=p.useContext(v);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,f]}const i=()=>{const s=r.map(o=>p.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[n,UO(i,...e)]}function UO(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...a,...u}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function Se(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Hn(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function ea({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=zO({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Hn(r),l=p.useCallback(c=>{if(s){const u=typeof c=="function"?c(t):c;u!==t&&a(u)}else i(c)},[s,t,i,a]);return[o,l]}function zO({defaultProp:t,onChange:e}){const r=p.useState(t),[n]=r,i=p.useRef(n),s=Hn(e);return p.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function zm(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const kn=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{};function Vm(t){const[e,r]=p.useState(void 0);return kn(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function VO(t,e){return p.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const wo=t=>{const{present:e,children:r}=t,n=qO(e),i=typeof r=="function"?r({present:n.isPresent}):p.Children.only(r),s=It(n.ref,i.ref);return typeof r=="function"||n.isPresent?p.cloneElement(i,{ref:s}):null};wo.displayName="Presence";function qO(t){const[e,r]=p.useState(),n=p.useRef({}),i=p.useRef(t),s=p.useRef("none"),o=t?"mounted":"unmounted",[a,l]=VO(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=Tu(n.current);s.current=a==="mounted"?c:"none"},[a]),kn(()=>{const c=n.current,f=i.current;if(f!==t){const d=s.current,v=Tu(c);t?l("MOUNT"):v==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&d!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),kn(()=>{if(e){const c=u=>{const v=Tu(n.current).includes(u.animationName);u.target===e&&v&&ks.flushSync(()=>l("ANIMATION_END"))},f=u=>{u.target===e&&(s.current=Tu(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function Tu(t){return(t==null?void 0:t.animationName)||"none"}function Re(){return Re=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:r,...n}=t,i=p.Children.toArray(r),s=i.find(WO);if(s){const o=s.props.children,a=i.map(l=>l===s?p.Children.count(o)>1?p.Children.only(null):p.isValidElement(o)?o.props.children:null:l);return p.createElement(Ny,Re({},n,{ref:e}),p.isValidElement(o)?p.cloneElement(o,void 0,a):null)}return p.createElement(Ny,Re({},n,{ref:e}),r)});ml.displayName="Slot";const Ny=p.forwardRef((t,e)=>{const{children:r,...n}=t;return p.isValidElement(r)?p.cloneElement(r,{...GO(n,r.props),ref:e?Q8(e,r.ref):r.ref}):p.Children.count(r)>1?p.Children.only(null):null});Ny.displayName="SlotClone";const HO=({children:t})=>p.createElement(p.Fragment,null,t);function WO(t){return p.isValidElement(t)&&t.type===HO}function GO(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const KO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=KO.reduce((t,e)=>{const r=p.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?ml:e;return p.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),p.createElement(a,Kt({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function qm(t,e){t&&ks.flushSync(()=>t.dispatchEvent(e))}const Y8="Checkbox",[QO,qee]=qr(Y8),[YO,JO]=QO(Y8),XO=p.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:c,...f}=t,[u,d]=p.useState(null),v=It(e,S=>d(S)),g=p.useRef(!1),y=u?!!u.closest("form"):!0,[w=!1,x]=ea({prop:i,defaultProp:s,onChange:c}),b=p.useRef(w);return p.useEffect(()=>{const S=u==null?void 0:u.form;if(S){const P=()=>x(b.current);return S.addEventListener("reset",P),()=>S.removeEventListener("reset",P)}},[u,x]),p.createElement(YO,{scope:r,state:w,disabled:a},p.createElement(Xe.button,Kt({type:"button",role:"checkbox","aria-checked":qo(w)?"mixed":w,"aria-required":o,"data-state":J8(w),"data-disabled":a?"":void 0,disabled:a,value:l},f,{ref:v,onKeyDown:Se(t.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Se(t.onClick,S=>{x(P=>qo(P)?!0:!P),y&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})})),y&&p.createElement(tN,{control:u,bubbles:!g.current,name:n,value:l,checked:w,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),ZO="CheckboxIndicator",eN=p.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=JO(ZO,r);return p.createElement(wo,{present:n||qo(s.state)||s.state===!0},p.createElement(Xe.span,Kt({"data-state":J8(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),tN=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=p.useRef(null),o=zm(r),a=Vm(e);return p.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(o!==r&&u){const d=new Event("click",{bubbles:n});l.indeterminate=qo(r),u.call(l,qo(r)?!1:r),l.dispatchEvent(d)}},[o,r,n]),p.createElement("input",Kt({type:"checkbox","aria-hidden":!0,defaultChecked:qo(r)?!1:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function qo(t){return t==="indeterminate"}function J8(t){return qo(t)?"indeterminate":t?"checked":"unchecked"}const rN=XO,nN=eN;var iN=Qt({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"_43lu9r5 _43lu9r0 fyvr11kw fyvr11i4 fyvr118k fyvr11h0",left:"_43lu9r6 _43lu9r1 fyvr11ko fyvr11ic fyvr118k fyvr11h0",right:"_43lu9r7 _43lu9r2 fyvr11ko fyvr11ic fyvr118k fyvr11h0",hidden:"_43lu9r8 _43lu9r3 fyvr1188 fyvr11h0"}},defaultVariants:{},compoundVariants:[]});const Tl=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?J.jsxs(re,{flexDirection:"column",gap:"0.5",children:[r&&J.jsx(Pe,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&J.jsx(Pe,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return J.jsxs(re,{as:"label",className:iN({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var r0=Qt({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const sN=t=>J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:J.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),X8=({size:t="sm",...e})=>J.jsx(re,{as:sN,className:r0({size:t}),...e}),oN=t=>J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:J.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),Z8=({size:t="sm",...e})=>J.jsx(re,{as:oN,className:r0({size:t}),...e}),aN=t=>J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:J.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),Hm=({size:t="sm",...e})=>J.jsx(re,{as:aN,className:r0({size:t}),...e}),lN=t=>J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:J.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),cN=({size:t="sm",...e})=>J.jsx(re,{as:lN,className:r0({size:t}),...e});var fN=Qt({defaultClassName:"_1c9x66f1 _1c9x66f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11h0 fyvr11ko fyvr11jg fyvr11od fyvr12w1 fyvr12vz fyvr12vr fyvr12v7 fyvr12v3 _4efw240",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),uN="_1c9x66f4 fyvr12s1 fyvr11h0 fyvr11ko fyvr11jg fyvr128 fyvr15o";const dN=({size:t="sm"})=>J.jsx(nN,{className:uN,children:J.jsx(X8,{size:t==="lg"?"sm":"xs"})});p.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...l}=t;return J.jsx(Tl,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:J.jsx(rN,{className:fN({size:a}),disabled:r,id:n??i,name:i,ref:e,...l,children:J.jsx(dN,{size:a})})})});gr.createContext(null);const hN=gA["useId".toString()]||(()=>{});let vN=0;function ro(t){const[e,r]=p.useState(hN());return kn(()=>{t||r(n=>n??String(vN++))},[t]),t||(e?`radix-${e}`:"")}const eS="Collapsible",[yN,Hee]=qr(eS),[pN,Wm]=yN(eS),mN=p.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[l=!1,c]=ea({prop:n,defaultProp:i,onChange:o});return p.createElement(pN,{scope:r,disabled:s,contentId:ro(),open:l,onOpenToggle:p.useCallback(()=>c(f=>!f),[c])},p.createElement(Xe.div,Kt({"data-state":Gm(l),"data-disabled":s?"":void 0},a,{ref:e})))}),gN="CollapsibleTrigger",xN=p.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=Wm(gN,r);return p.createElement(Xe.button,Kt({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Gm(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},n,{ref:e,onClick:Se(t.onClick,i.onOpenToggle)}))}),tS="CollapsibleContent",bN=p.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=Wm(tS,t.__scopeCollapsible);return p.createElement(wo,{present:r||i.open},({present:s})=>p.createElement(wN,Kt({},n,{ref:e,present:s})))}),wN=p.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=Wm(tS,r),[a,l]=p.useState(n),c=p.useRef(null),f=It(e,c),u=p.useRef(0),d=u.current,v=p.useRef(0),g=v.current,y=o.open||a,w=p.useRef(y),x=p.useRef();return p.useEffect(()=>{const b=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(b)},[]),kn(()=>{const b=c.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const S=b.getBoundingClientRect();u.current=S.height,v.current=S.width,w.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),l(n)}},[o.open,n]),p.createElement(Xe.div,Kt({"data-state":Gm(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!y},s,{ref:f,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style}}),y&&i)});function Gm(t){return t?"open":"closed"}const EN=mN,AN=xN,SN=bN;var Mw="64px",CN="_4j62fl0",kN="_4j62fl2 _4j62fl1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11h0 fyvr11ko fyvr11od fyvr128 fyvr12v7 fyvr11n4 _4efw240",PN="_4j62fl4 _4j62fl3 fyvr1ww fyvr1ys fyvr1so fyvr1v0 fyvr128",RN="_4j62fl5";const ic=t=>{const{className:e,children:r,defaultOpen:n,open:i,onOpenChange:s,label:o,...a}=t,[l,c]=p.useState(n),f=i??l,u=v=>{i===void 0&&c(v)},d=v=>{u(v),s==null||s(v)};return J.jsx(EN,{open:f,defaultOpen:n,onOpenChange:d,asChild:!0,children:J.jsxs(re,{as:Za.div,className:fn(e,CN),initial:{height:f?"auto":Mw},animate:{height:f?"auto":Mw},transition:{ease:"easeOut",duration:.3},borderRadius:"md",background:"backgroundSecondary",position:"relative",overflow:"hidden",width:"full",...a,children:[J.jsxs(AN,{className:kN,children:[J.jsx(Pe,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),J.jsx(re,{as:Za.div,position:"absolute",right:"0",marginRight:"4",initial:{rotate:f?180:0},animate:{rotate:f?180:0},transition:{ease:"linear",duration:.1},children:J.jsx(Z8,{className:RN,color:"text50"})})]}),J.jsx(q8,{children:f&&J.jsx(SN,{className:PN,asChild:!0,forceMount:!0,children:J.jsx(Za.div,{initial:{opacity:f?1:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"easeOut",duration:.3},children:r})})})]})})};function n0(t){const e=t+"CollectionProvider",[r,n]=qr(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:g,children:y}=v,w=gr.useRef(null),x=gr.useRef(new Map).current;return gr.createElement(i,{scope:g,itemMap:x,collectionRef:w},y)},a=t+"CollectionSlot",l=gr.forwardRef((v,g)=>{const{scope:y,children:w}=v,x=s(a,y),b=It(g,x.collectionRef);return gr.createElement(ml,{ref:b},w)}),c=t+"CollectionItemSlot",f="data-radix-collection-item",u=gr.forwardRef((v,g)=>{const{scope:y,children:w,...x}=v,b=gr.useRef(null),S=It(g,b),P=s(c,y);return gr.useEffect(()=>(P.itemMap.set(b,{ref:b,...x}),()=>void P.itemMap.delete(b))),gr.createElement(ml,{[f]:"",ref:S},w)});function d(v){const g=s(t+"CollectionConsumer",v);return gr.useCallback(()=>{const w=g.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(g.itemMap.values()).sort((P,_)=>x.indexOf(P.ref.current)-x.indexOf(_.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:l,ItemSlot:u},d,n]}const TN=p.createContext(void 0);function Km(t){const e=p.useContext(TN);return t||e||"ltr"}function MN(t,e=globalThis==null?void 0:globalThis.document){const r=Hn(t);p.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const Dy="dismissableLayer.update",IN="dismissableLayer.pointerDownOutside",_N="dismissableLayer.focusOutside";let Iw;const ON=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qm=p.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=t,f=p.useContext(ON),[u,d]=p.useState(null),v=(r=u==null?void 0:u.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,g]=p.useState({}),y=It(e,L=>d(L)),w=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w.indexOf(x),S=u?w.indexOf(u):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,_=S>=b,D=NN(L=>{const z=L.target,H=[...f.branches].some(Y=>Y.contains(z));!_||H||(s==null||s(L),a==null||a(L),L.defaultPrevented||l==null||l())},v),M=DN(L=>{const z=L.target;[...f.branches].some(Y=>Y.contains(z))||(o==null||o(L),a==null||a(L),L.defaultPrevented||l==null||l())},v);return MN(L=>{S===f.layers.size-1&&(i==null||i(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},v),p.useEffect(()=>{if(u)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Iw=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(u)),f.layers.add(u),_w(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Iw)}},[u,v,n,f]),p.useEffect(()=>()=>{u&&(f.layers.delete(u),f.layersWithOutsidePointerEventsDisabled.delete(u),_w())},[u,f]),p.useEffect(()=>{const L=()=>g({});return document.addEventListener(Dy,L),()=>document.removeEventListener(Dy,L)},[]),p.createElement(Xe.div,Re({},c,{ref:y,style:{pointerEvents:P?_?"auto":"none":void 0,...t.style},onFocusCapture:Se(t.onFocusCapture,M.onFocusCapture),onBlurCapture:Se(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Se(t.onPointerDownCapture,D.onPointerDownCapture)}))});function NN(t,e=globalThis==null?void 0:globalThis.document){const r=Hn(t),n=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){rS(IN,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function DN(t,e=globalThis==null?void 0:globalThis.document){const r=Hn(t),n=p.useRef(!1);return p.useEffect(()=>{const i=s=>{s.target&&!n.current&&rS(_N,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function _w(){const t=new CustomEvent(Dy);document.dispatchEvent(t)}function rS(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?qm(i,s):i.dispatchEvent(s)}const LN=Qm;let R1=0;function nS(){p.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:Ow()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:Ow()),R1++,()=>{R1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),R1--}},[])}function Ow(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const T1="focusScope.autoFocusOnMount",M1="focusScope.autoFocusOnUnmount",Nw={bubbles:!1,cancelable:!0},iS=p.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=p.useState(null),c=Hn(i),f=Hn(s),u=p.useRef(null),d=It(e,y=>l(y)),v=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(n){let y=function(S){if(v.paused||!a)return;const P=S.target;a.contains(P)?u.current=P:Ns(u.current,{select:!0})},w=function(S){if(v.paused||!a)return;const P=S.relatedTarget;P!==null&&(a.contains(P)||Ns(u.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const _ of S)_.removedNodes.length>0&&Ns(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",w);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",w),b.disconnect()}}},[n,a,v.paused]),p.useEffect(()=>{if(a){Lw.add(v);const y=document.activeElement;if(!a.contains(y)){const x=new CustomEvent(T1,Nw);a.addEventListener(T1,c),a.dispatchEvent(x),x.defaultPrevented||(jN(zN(sS(a)),{select:!0}),document.activeElement===y&&Ns(a))}return()=>{a.removeEventListener(T1,c),setTimeout(()=>{const x=new CustomEvent(M1,Nw);a.addEventListener(M1,f),a.dispatchEvent(x),x.defaultPrevented||Ns(y??document.body,{select:!0}),a.removeEventListener(M1,f),Lw.remove(v)},0)}}},[a,c,f,v]);const g=p.useCallback(y=>{if(!r&&!n||v.paused)return;const w=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,x=document.activeElement;if(w&&x){const b=y.currentTarget,[S,P]=BN(b);S&&P?!y.shiftKey&&x===P?(y.preventDefault(),r&&Ns(S,{select:!0})):y.shiftKey&&x===S&&(y.preventDefault(),r&&Ns(P,{select:!0})):x===b&&y.preventDefault()}},[r,n,v.paused]);return p.createElement(Xe.div,Re({tabIndex:-1},o,{ref:d,onKeyDown:g}))});function jN(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Ns(n,{select:e}),document.activeElement!==r)return}function BN(t){const e=sS(t),r=Dw(e,t),n=Dw(e.reverse(),t);return[r,n]}function sS(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Dw(t,e){for(const r of t)if(!$N(r,{upTo:e}))return r}function $N(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function FN(t){return t instanceof HTMLInputElement&&"select"in t}function Ns(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&FN(t)&&e&&t.select()}}const Lw=UN();function UN(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=jw(t,e),t.unshift(e)},remove(e){var r;t=jw(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function jw(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function zN(t){return t.filter(e=>e.tagName!=="A")}const VN=["top","right","bottom","left"],co=Math.min,bn=Math.max,rh=Math.round,Mu=Math.floor,fo=t=>({x:t,y:t}),qN={left:"right",right:"left",bottom:"top",top:"bottom"},HN={start:"end",end:"start"};function Ly(t,e,r){return bn(t,co(e,r))}function xs(t,e){return typeof t=="function"?t(e):t}function bs(t){return t.split("-")[0]}function Ml(t){return t.split("-")[1]}function Ym(t){return t==="x"?"y":"x"}function Jm(t){return t==="y"?"height":"width"}function Il(t){return["top","bottom"].includes(bs(t))?"y":"x"}function Xm(t){return Ym(Il(t))}function WN(t,e,r){r===void 0&&(r=!1);const n=Ml(t),i=Xm(t),s=Jm(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=nh(o)),[o,nh(o)]}function GN(t){const e=nh(t);return[jy(t),e,jy(e)]}function jy(t){return t.replace(/start|end/g,e=>HN[e])}function KN(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function QN(t,e,r,n){const i=Ml(t);let s=KN(bs(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(jy)))),s}function nh(t){return t.replace(/left|right|bottom|top/g,e=>qN[e])}function YN(t){return{top:0,right:0,bottom:0,left:0,...t}}function oS(t){return typeof t!="number"?YN(t):{top:t,right:t,bottom:t,left:t}}function ih(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Bw(t,e,r){let{reference:n,floating:i}=t;const s=Il(e),o=Xm(e),a=Jm(o),l=bs(e),c=s==="y",f=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let v;switch(l){case"top":v={x:f,y:n.y-i.height};break;case"bottom":v={x:f,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:u};break;case"left":v={x:n.x-i.width,y:u};break;default:v={x:n.x,y:n.y}}switch(Ml(e)){case"start":v[o]-=d*(r&&c?-1:1);break;case"end":v[o]+=d*(r&&c?-1:1);break}return v}const JN=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=Bw(c,n,l),d=n,v={},g=0;for(let y=0;y({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:f=0}=xs(t,e)||{};if(c==null)return{};const u=oS(f),d={x:r,y:n},v=Xm(i),g=Jm(v),y=await o.getDimensions(c),w=v==="y",x=w?"top":"left",b=w?"bottom":"right",S=w?"clientHeight":"clientWidth",P=s.reference[g]+s.reference[v]-d[v]-s.floating[g],_=d[v]-s.reference[v],D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let M=D?D[S]:0;(!M||!await(o.isElement==null?void 0:o.isElement(D)))&&(M=a.floating[S]||s.floating[g]);const L=P/2-_/2,z=M/2-y[g]/2-1,H=co(u[x],z),Y=co(u[b],z),Z=H,O=M-y[g]-Y,h=M/2-y[g]/2+L,A=Ly(Z,h,O),k=!l.arrow&&Ml(i)!=null&&h!=A&&s.reference[g]/2-(hZ<=0)){var z,H;const Z=(((z=s.flip)==null?void 0:z.index)||0)+1,O=_[Z];if(O)return{data:{index:Z,overflows:L},reset:{placement:O}};let h=(H=L.filter(A=>A.overflows[0]<=0).sort((A,k)=>A.overflows[1]-k.overflows[1])[0])==null?void 0:H.placement;if(!h)switch(v){case"bestFit":{var Y;const A=(Y=L.map(k=>[k.placement,k.overflows.filter(I=>I>0).reduce((I,R)=>I+R,0)]).sort((k,I)=>k[1]-I[1])[0])==null?void 0:Y[0];A&&(h=A);break}case"initialPlacement":h=a;break}if(i!==h)return{reset:{placement:h}}}return{}}}};function Fw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Uw(t){return VN.some(e=>t[e]>=0)}const ZN=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=xs(t,e);switch(n){case"referenceHidden":{const s=await Af(e,{...i,elementContext:"reference"}),o=Fw(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Uw(o)}}}case"escaped":{const s=await Af(e,{...i,altBoundary:!0}),o=Fw(s,r.floating);return{data:{escapedOffsets:o,escaped:Uw(o)}}}default:return{}}}}};async function eD(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=bs(r),a=Ml(r),l=Il(r)==="y",c=["left","top"].includes(o)?-1:1,f=s&&l?-1:1,u=xs(e,t);let{mainAxis:d,crossAxis:v,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof g=="number"&&(v=a==="end"?g*-1:g),l?{x:v*f,y:d*c}:{x:d*c,y:v*f}}const tD=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await eD(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},rD=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x,y:b}=w;return{x,y:b}}},...l}=xs(t,e),c={x:r,y:n},f=await Af(e,l),u=Il(bs(i)),d=Ym(u);let v=c[d],g=c[u];if(s){const w=d==="y"?"top":"left",x=d==="y"?"bottom":"right",b=v+f[w],S=v-f[x];v=Ly(b,v,S)}if(o){const w=u==="y"?"top":"left",x=u==="y"?"bottom":"right",b=g+f[w],S=g-f[x];g=Ly(b,g,S)}const y=a.fn({...e,[d]:v,[u]:g});return{...y,data:{x:y.x-r,y:y.y-n}}}}},nD=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=xs(t,e),f={x:r,y:n},u=Il(i),d=Ym(u);let v=f[d],g=f[u];const y=xs(a,e),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const S=d==="y"?"height":"width",P=s.reference[d]-s.floating[S]+w.mainAxis,_=s.reference[d]+s.reference[S]-w.mainAxis;v_&&(v=_)}if(c){var x,b;const S=d==="y"?"width":"height",P=["top","left"].includes(bs(i)),_=s.reference[u]-s.floating[S]+(P&&((x=o.offset)==null?void 0:x[u])||0)+(P?0:w.crossAxis),D=s.reference[u]+s.reference[S]+(P?0:((b=o.offset)==null?void 0:b[u])||0)-(P?w.crossAxis:0);g<_?g=_:g>D&&(g=D)}return{[d]:v,[u]:g}}}},iD=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=xs(t,e),l=await Af(e,a),c=bs(r),f=Ml(r),u=Il(r)==="y",{width:d,height:v}=n.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=c,g=f==="end"?"top":"bottom");const w=v-l[g],x=d-l[y],b=!e.middlewareData.shift;let S=w,P=x;if(u){const D=d-l.left-l.right;P=f||b?co(x,D):D}else{const D=v-l.top-l.bottom;S=f||b?co(w,D):D}if(b&&!f){const D=bn(l.left,0),M=bn(l.right,0),L=bn(l.top,0),z=bn(l.bottom,0);u?P=d-2*(D!==0||M!==0?D+M:bn(l.left,l.right)):S=v-2*(L!==0||z!==0?L+z:bn(l.top,l.bottom))}await o({...e,availableWidth:P,availableHeight:S});const _=await i.getDimensions(s.floating);return d!==_.width||v!==_.height?{reset:{rects:!0}}:{}}}};function uo(t){return aS(t)?(t.nodeName||"").toLowerCase():"#document"}function An(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ps(t){var e;return(e=(aS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function aS(t){return t instanceof Node||t instanceof An(t).Node}function ws(t){return t instanceof Element||t instanceof An(t).Element}function Ui(t){return t instanceof HTMLElement||t instanceof An(t).HTMLElement}function zw(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof An(t).ShadowRoot}function Yf(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Wn(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function sD(t){return["table","td","th"].includes(uo(t))}function Zm(t){const e=eg(),r=Wn(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function oD(t){let e=gl(t);for(;Ui(e)&&!i0(e);){if(Zm(e))return e;e=gl(e)}return null}function eg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function i0(t){return["html","body","#document"].includes(uo(t))}function Wn(t){return An(t).getComputedStyle(t)}function s0(t){return ws(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function gl(t){if(uo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||zw(t)&&t.host||Ps(t);return zw(e)?e.host:e}function lS(t){const e=gl(t);return i0(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ui(e)&&Yf(e)?e:lS(e)}function Sf(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=lS(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=An(i);return s?e.concat(o,o.visualViewport||[],Yf(i)?i:[],o.frameElement&&r?Sf(o.frameElement):[]):e.concat(i,Sf(i,[],r))}function cS(t){const e=Wn(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Ui(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=rh(r)!==s||rh(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function tg(t){return ws(t)?t:t.contextElement}function el(t){const e=tg(t);if(!Ui(e))return fo(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=cS(e);let o=(s?rh(r.width):r.width)/n,a=(s?rh(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const aD=fo(0);function fS(t){const e=An(t);return!eg()||!e.visualViewport?aD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lD(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==An(t)?!1:e}function ta(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=tg(t);let o=fo(1);e&&(n?ws(n)&&(o=el(n)):o=el(t));const a=lD(s,r,n)?fS(s):fo(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,f=i.width/o.x,u=i.height/o.y;if(s){const d=An(s),v=n&&ws(n)?An(n):n;let g=d.frameElement;for(;g&&n&&v!==d;){const y=el(g),w=g.getBoundingClientRect(),x=Wn(g),b=w.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,S=w.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,f*=y.x,u*=y.y,l+=b,c+=S,g=An(g).frameElement}}return ih({width:f,height:u,x:l,y:c})}function cD(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=Ui(r),s=Ps(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=fo(1);const l=fo(0);if((i||!i&&n!=="fixed")&&((uo(r)!=="body"||Yf(s))&&(o=s0(r)),Ui(r))){const c=ta(r);a=el(r),l.x=c.x+r.clientLeft,l.y=c.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+l.x,y:e.y*a.y-o.scrollTop*a.y+l.y}}function fD(t){return Array.from(t.getClientRects())}function uS(t){return ta(Ps(t)).left+s0(t).scrollLeft}function uD(t){const e=Ps(t),r=s0(t),n=t.ownerDocument.body,i=bn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=bn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+uS(t);const a=-r.scrollTop;return Wn(n).direction==="rtl"&&(o+=bn(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function dD(t,e){const r=An(t),n=Ps(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=eg();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function hD(t,e){const r=ta(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Ui(t)?el(t):fo(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function Vw(t,e,r){let n;if(e==="viewport")n=dD(t,r);else if(e==="document")n=uD(Ps(t));else if(ws(e))n=hD(e,r);else{const i=fS(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return ih(n)}function dS(t,e){const r=gl(t);return r===e||!ws(r)||i0(r)?!1:Wn(r).position==="fixed"||dS(r,e)}function vD(t,e){const r=e.get(t);if(r)return r;let n=Sf(t,[],!1).filter(a=>ws(a)&&uo(a)!=="body"),i=null;const s=Wn(t).position==="fixed";let o=s?gl(t):t;for(;ws(o)&&!i0(o);){const a=Wn(o),l=Zm(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Yf(o)&&!l&&dS(t,o))?n=n.filter(f=>f!==o):i=a,o=gl(o)}return e.set(t,n),n}function yD(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?vD(e,this._c):[].concat(r),n],a=o[0],l=o.reduce((c,f)=>{const u=Vw(e,f,i);return c.top=bn(u.top,c.top),c.right=co(u.right,c.right),c.bottom=co(u.bottom,c.bottom),c.left=bn(u.left,c.left),c},Vw(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function pD(t){return cS(t)}function mD(t,e,r){const n=Ui(e),i=Ps(e),s=r==="fixed",o=ta(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=fo(0);if(n||!n&&!s)if((uo(e)!=="body"||Yf(i))&&(a=s0(e)),n){const c=ta(e,!0,s,e);l.x=c.x+e.clientLeft,l.y=c.y+e.clientTop}else i&&(l.x=uS(i));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function qw(t,e){return!Ui(t)||Wn(t).position==="fixed"?null:e?e(t):t.offsetParent}function hS(t,e){const r=An(t);if(!Ui(t))return r;let n=qw(t,e);for(;n&&sD(n)&&Wn(n).position==="static";)n=qw(n,e);return n&&(uo(n)==="html"||uo(n)==="body"&&Wn(n).position==="static"&&!Zm(n))?r:n||oD(t)||r}const gD=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||hS,s=this.getDimensions;return{reference:mD(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function xD(t){return Wn(t).direction==="rtl"}const bD={convertOffsetParentRelativeRectToViewportRelativeRect:cD,getDocumentElement:Ps,getClippingRect:yD,getOffsetParent:hS,getElementRects:gD,getClientRects:fD,getDimensions:pD,getScale:el,isElement:ws,isRTL:xD};function wD(t,e){let r=null,n;const i=Ps(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:f,width:u,height:d}=t.getBoundingClientRect();if(a||e(),!u||!d)return;const v=Mu(f),g=Mu(i.clientWidth-(c+u)),y=Mu(i.clientHeight-(f+d)),w=Mu(c),b={rootMargin:-v+"px "+-g+"px "+-y+"px "+-w+"px",threshold:bn(0,co(1,l))||1};let S=!0;function P(_){const D=_[0].intersectionRatio;if(D!==l){if(!S)return o();D?o(!1,D):n=setTimeout(()=>{o(!1,1e-7)},100)}S=!1}try{r=new IntersectionObserver(P,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(P,b)}r.observe(t)}return o(!0),s}function ED(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=tg(t),f=i||s?[...c?Sf(c):[],...Sf(e)]:[];f.forEach(x=>{i&&x.addEventListener("scroll",r,{passive:!0}),s&&x.addEventListener("resize",r)});const u=c&&a?wD(c,r):null;let d=-1,v=null;o&&(v=new ResizeObserver(x=>{let[b]=x;b&&b.target===c&&v&&(v.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{v&&v.observe(e)})),r()}),c&&!l&&v.observe(c),v.observe(e));let g,y=l?ta(t):null;l&&w();function w(){const x=ta(t);y&&(x.x!==y.x||x.y!==y.y||x.width!==y.width||x.height!==y.height)&&r(),y=x,g=requestAnimationFrame(w)}return r(),()=>{f.forEach(x=>{i&&x.removeEventListener("scroll",r),s&&x.removeEventListener("resize",r)}),u&&u(),v&&v.disconnect(),v=null,l&&cancelAnimationFrame(g)}}const AD=(t,e,r)=>{const n=new Map,i={platform:bD,...r},s={...i.platform,_c:n};return JN(t,e,{...i,platform:s})},SD=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?$w({element:n.current,padding:i}).fn(r):{}:n?$w({element:n,padding:i}).fn(r):{}}}};var fd=typeof document<"u"?p.useLayoutEffect:p.useEffect;function sh(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!sh(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!sh(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function vS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Hw(t,e){const r=vS(t);return Math.round(e*r)/r}function Ww(t){const e=p.useRef(t);return fd(()=>{e.current=t}),e}function CD(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[f,u]=p.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,v]=p.useState(n);sh(d,n)||v(n);const[g,y]=p.useState(null),[w,x]=p.useState(null),b=p.useCallback(k=>{k!=D.current&&(D.current=k,y(k))},[y]),S=p.useCallback(k=>{k!==M.current&&(M.current=k,x(k))},[x]),P=s||g,_=o||w,D=p.useRef(null),M=p.useRef(null),L=p.useRef(f),z=Ww(l),H=Ww(i),Y=p.useCallback(()=>{if(!D.current||!M.current)return;const k={placement:e,strategy:r,middleware:d};H.current&&(k.platform=H.current),AD(D.current,M.current,k).then(I=>{const R={...I,isPositioned:!0};Z.current&&!sh(L.current,R)&&(L.current=R,ks.flushSync(()=>{u(R)}))})},[d,e,r,H]);fd(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,u(k=>({...k,isPositioned:!1})))},[c]);const Z=p.useRef(!1);fd(()=>(Z.current=!0,()=>{Z.current=!1}),[]),fd(()=>{if(P&&(D.current=P),_&&(M.current=_),P&&_){if(z.current)return z.current(P,_,Y);Y()}},[P,_,Y,z]);const O=p.useMemo(()=>({reference:D,floating:M,setReference:b,setFloating:S}),[b,S]),h=p.useMemo(()=>({reference:P,floating:_}),[P,_]),A=p.useMemo(()=>{const k={position:r,left:0,top:0};if(!h.floating)return k;const I=Hw(h.floating,f.x),R=Hw(h.floating,f.y);return a?{...k,transform:"translate("+I+"px, "+R+"px)",...vS(h.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:I,top:R}},[r,a,h.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:Y,refs:O,elements:h,floatingStyles:A}),[f,Y,O,h,A])}const yS="Popper",[pS,_l]=qr(yS),[kD,mS]=pS(yS),PD=t=>{const{__scopePopper:e,children:r}=t,[n,i]=p.useState(null);return p.createElement(kD,{scope:e,anchor:n,onAnchorChange:i},r)},RD="PopperAnchor",TD=p.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=mS(RD,r),o=p.useRef(null),a=It(e,o);return p.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:p.createElement(Xe.div,Re({},i,{ref:a}))}),gS="PopperContent",[MD,Wee]=pS(gS),ID=p.forwardRef((t,e)=>{var r,n,i,s,o,a,l,c;const{__scopePopper:f,side:u="bottom",sideOffset:d=0,align:v="center",alignOffset:g=0,arrowPadding:y=0,avoidCollisions:w=!0,collisionBoundary:x=[],collisionPadding:b=0,sticky:S="partial",hideWhenDetached:P=!1,updatePositionStrategy:_="optimized",onPlaced:D,...M}=t,L=mS(gS,f),[z,H]=p.useState(null),Y=It(e,we=>H(we)),[Z,O]=p.useState(null),h=Vm(Z),A=(r=h==null?void 0:h.width)!==null&&r!==void 0?r:0,k=(n=h==null?void 0:h.height)!==null&&n!==void 0?n:0,I=u+(v!=="center"?"-"+v:""),R=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},N=Array.isArray(x)?x:[x],j=N.length>0,C={padding:R,boundary:N.filter(_D),altBoundary:j},{refs:m,floatingStyles:T,placement:F,isPositioned:E,middlewareData:B}=CD({strategy:"fixed",placement:I,whileElementsMounted:(...we)=>ED(...we,{animationFrame:_==="always"}),elements:{reference:L.anchor},middleware:[tD({mainAxis:d+k,alignmentAxis:g}),w&&rD({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?nD():void 0,...C}),w&&XN({...C}),iD({...C,apply:({elements:we,rects:zt,availableWidth:Ve,availableHeight:ot})=>{const{width:Jn,height:at}=zt.reference,Ge=we.floating.style;Ge.setProperty("--radix-popper-available-width",`${Ve}px`),Ge.setProperty("--radix-popper-available-height",`${ot}px`),Ge.setProperty("--radix-popper-anchor-width",`${Jn}px`),Ge.setProperty("--radix-popper-anchor-height",`${at}px`)}}),Z&&SD({element:Z,padding:y}),OD({arrowWidth:A,arrowHeight:k}),P&&ZN({strategy:"referenceHidden",...C})]}),[V,q]=xS(F),K=Hn(D);kn(()=>{E&&(K==null||K())},[E,K]);const oe=(i=B.arrow)===null||i===void 0?void 0:i.x,ee=(s=B.arrow)===null||s===void 0?void 0:s.y,te=((o=B.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[Ie,ue]=p.useState();return kn(()=>{z&&ue(window.getComputedStyle(z).zIndex)},[z]),p.createElement("div",{ref:m.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:E?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[(a=B.transformOrigin)===null||a===void 0?void 0:a.x,(l=B.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},p.createElement(MD,{scope:f,placedSide:V,onArrowChange:O,arrowX:oe,arrowY:ee,shouldHideArrow:te},p.createElement(Xe.div,Re({"data-side":V,"data-align":q},M,{ref:Y,style:{...M.style,animation:E?void 0:"none",opacity:(c=B.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function _D(t){return t!==null}const OD=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:l,middlewareData:c}=e,u=((r=c.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=u?0:t.arrowWidth,v=u?0:t.arrowHeight,[g,y]=xS(a),w={start:"0%",center:"50%",end:"100%"}[y],x=((n=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,b=((s=(o=c.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+v/2;let S="",P="";return g==="bottom"?(S=u?w:`${x}px`,P=`${-v}px`):g==="top"?(S=u?w:`${x}px`,P=`${l.floating.height+v}px`):g==="right"?(S=`${-v}px`,P=u?w:`${b}px`):g==="left"&&(S=`${l.floating.width+v}px`,P=u?w:`${b}px`),{data:{x:S,y:P}}}});function xS(t){const[e,r="center"]=t.split("-");return[e,r]}const ND=PD,DD=TD,LD=ID,bS=p.forwardRef((t,e)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...i}=t;return n?w5.createPortal(p.createElement(Xe.div,Re({},i,{ref:e})),n):null}),I1="rovingFocusGroup.onEntryFocus",jD={bubbles:!1,cancelable:!0},rg="RovingFocusGroup",[By,wS,BD]=n0(rg),[$D,Ol]=qr(rg,[BD]),[FD,UD]=$D(rg),zD=p.forwardRef((t,e)=>p.createElement(By.Provider,{scope:t.__scopeRovingFocusGroup},p.createElement(By.Slot,{scope:t.__scopeRovingFocusGroup},p.createElement(VD,Kt({},t,{ref:e}))))),VD=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...f}=t,u=p.useRef(null),d=It(e,u),v=Km(s),[g=null,y]=ea({prop:o,defaultProp:a,onChange:l}),[w,x]=p.useState(!1),b=Hn(c),S=wS(r),P=p.useRef(!1),[_,D]=p.useState(0);return p.useEffect(()=>{const M=u.current;if(M)return M.addEventListener(I1,b),()=>M.removeEventListener(I1,b)},[b]),p.createElement(FD,{scope:r,orientation:n,dir:v,loop:i,currentTabStopId:g,onItemFocus:p.useCallback(M=>y(M),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>D(M=>M+1),[]),onFocusableItemRemove:p.useCallback(()=>D(M=>M-1),[])},p.createElement(Xe.div,Kt({tabIndex:w||_===0?-1:0,"data-orientation":n},f,{ref:d,style:{outline:"none",...t.style},onMouseDown:Se(t.onMouseDown,()=>{P.current=!0}),onFocus:Se(t.onFocus,M=>{const L=!P.current;if(M.target===M.currentTarget&&L&&!w){const z=new CustomEvent(I1,jD);if(M.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=S().filter(A=>A.focusable),Y=H.find(A=>A.active),Z=H.find(A=>A.id===g),h=[Y,Z,...H].filter(Boolean).map(A=>A.ref.current);ES(h)}}P.current=!1}),onBlur:Se(t.onBlur,()=>x(!1))})))}),qD="RovingFocusGroupItem",HD=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=ro(),l=s||a,c=UD(qD,r),f=c.currentTabStopId===l,u=wS(r),{onFocusableItemAdd:d,onFocusableItemRemove:v}=c;return p.useEffect(()=>{if(n)return d(),()=>v()},[n,d,v]),p.createElement(By.ItemSlot,{scope:r,id:l,focusable:n,active:i},p.createElement(Xe.span,Kt({tabIndex:f?0:-1,"data-orientation":c.orientation},o,{ref:e,onMouseDown:Se(t.onMouseDown,g=>{n?c.onItemFocus(l):g.preventDefault()}),onFocus:Se(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:Se(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=KD(g,c.orientation,c.dir);if(y!==void 0){g.preventDefault();let x=u().filter(b=>b.focusable).map(b=>b.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const b=x.indexOf(g.currentTarget);x=c.loop?QD(x,b+1):x.slice(b+1)}setTimeout(()=>ES(x))}})})))}),WD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function GD(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function KD(t,e,r){const n=GD(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return WD[n]}function ES(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function QD(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const YD=zD,AS=HD;var JD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},xa=new WeakMap,Iu=new WeakMap,_u={},_1=0,SS=function(t){return t&&(t.host||SS(t.parentNode))},XD=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=SS(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},ZD=function(t,e,r,n){var i=XD(e,Array.isArray(t)?t:[t]);_u[r]||(_u[r]=new WeakMap);var s=_u[r],o=[],a=new Set,l=new Set(i),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};i.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(d){if(a.has(d))f(d);else{var v=d.getAttribute(n),g=v!==null&&v!=="false",y=(xa.get(d)||0)+1,w=(s.get(d)||0)+1;xa.set(d,y),s.set(d,w),o.push(d),y===1&&g&&Iu.set(d,!0),w===1&&d.setAttribute(r,"true"),g||d.setAttribute(n,"true")}})};return f(e),a.clear(),_1++,function(){o.forEach(function(u){var d=xa.get(u)-1,v=s.get(u)-1;xa.set(u,d),s.set(u,v),d||(Iu.has(u)||u.removeAttribute(n),Iu.delete(u)),v||u.removeAttribute(r)}),_1--,_1||(xa=new WeakMap,xa=new WeakMap,Iu=new WeakMap,_u={})}},CS=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=JD(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),ZD(n,i,r,"aria-hidden")):function(){return null}},Ri=function(){return Ri=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return pL;var e=mL(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},xL=TS(),bL=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + */var kw;function _O(){if(kw)return nc;kw=1;var t=gr,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var f,u={},d=null,v=null;c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(v=l.ref);for(f in l)n.call(l,f)&&!s.hasOwnProperty(f)&&(u[f]=l[f]);if(a&&a.defaultProps)for(f in l=a.defaultProps,l)u[f]===void 0&&(u[f]=l[f]);return{$$typeof:e,type:a,key:d,ref:v,props:u,_owner:i.current}}return nc.Fragment=r,nc.jsx=o,nc.jsxs=o,nc}K8.exports=_O();var J=K8.exports;function OO(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function NO(t){var e=OO(t,"string");return typeof e=="symbol"?e:String(e)}function DO(t,e,r){return e=NO(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pw(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Rw(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},Qt=t=>{var e=r=>{var n=t.defaultClassName,i=Rw(Rw({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var l=a;typeof l=="boolean"&&(l=l===!0?"true":"false");var c=t.variantClassNames[s][l];c&&(n+=" "+c)}}for(var[f,u]of t.compoundVariants)LO(f,i,t.defaultVariants)&&(n+=" "+u);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return Tw(t.variantClassNames,r=>Tw(r,n=>n.split(" ")[0]))}},e};Qt({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"_2q9vfj8 _2q9vfj0 fyvr11ov",warning:"_2q9vfj9 _2q9vfj1 fyvr11p1",success:"_2q9vfja _2q9vfj2 fyvr11oj",error:"_2q9vfjb _2q9vfj3 fyvr11op"},size:{sm:"_2q9vfjc _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _2q9vfj4 fyvr1wo fyvr1yk fyvr13w fyvr1e8",md:"_2q9vfjd _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _2q9vfj5 fyvr1ws fyvr1yo fyvr140 fyvr1ec",lg:"_2q9vfje _1qxj1ib9 _1qxj1ibd _1qxj1ib3 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc _2q9vfj6 fyvr1ww fyvr1ys fyvr144 fyvr1eg"}},defaultVariants:{},compoundVariants:[]});const Co=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return J.jsx(re,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var jO=Qt({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"_1qxj1iba _1qxj1ib0 fyvr11mu fyvr11e4 fyvr11gg fyvr11fg fyvr11ew",xlarge:"_1qxj1ibb _1qxj1ib1 fyvr11mv fyvr11es fyvr11gc fyvr11fk fyvr11fc",large:"_1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8",medium:"_1qxj1ibd _1qxj1ib3 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc",normal:"_1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",small:"_1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4",xsmall:"_1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc",code:"_1qxj1ibh _1qxj1ib7 fyvr11mw fyvr11eg fyvr11g0 fyvr11fk fyvr11f0"},ellipsis:{true:"_1qxj1ibi _1qxj1ib8 fyvr11ls fyvr11m8 fyvr11n9 fyvr11mx"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const Se=p.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:l,ellipsis:c,uppercase:f,capitalize:u,...d}=t,v=SO[n];return J.jsx(re,{as:r,className:fn(i,jO({hidden:s,ellipsis:c,italic:o,underline:a,uppercase:f,capitalize:u})),ref:e,...v,...d,children:l})});var BO=Qt({defaultClassName:"_140wn8ni _140wn8n0 fyvr11ls fyvr11m8 fyvr11n9 fyvr11ko fyvr12o1 fyvr11n2 fyvr11h0 _4efw240",variantClassNames:{variant:{base:"_140wn8nj _140wn8n1 fyvr11od fyvr12s1",ghost:"_140wn8nk _140wn8n2 fyvr11od fyvr12s1",feature:"_140wn8nl _140wn8n3 fyvr11pj fyvr12od",primary:"_140wn8nm _140wn8n4 fyvr11pd fyvr12od",glass:"_140wn8nn _140wn8n5 fyvr11tv fyvr12s1",emphasis:"_140wn8no _140wn8n6 fyvr11u1 fyvr12s1",raised:"_140wn8np _140wn8n7 fyvr11tp fyvr12s1",danger:"_140wn8nq _140wn8n8 fyvr11op fyvr12od",text:"_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _140wn8n9 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11od fyvr12sd"},shape:{circle:"_140wn8ns _140wn8na fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",square:"_140wn8nt _140wn8nb fyvr11d0 fyvr11do fyvr11bo fyvr11cc"},disabled:{true:"_140wn8nu _140wn8nc fyvr12v1 fyvr12vp",false:"_140wn8nv _140wn8nd fyvr12v7 fyvr12w1 fyvr12vz"},size:{xs:"_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _140wn8ne fyvr1ws fyvr1yo",sm:"_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nf fyvr1ww fyvr1ys",md:"_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8ng fyvr1x0 fyvr1yw",lg:"_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nh fyvr1x0 fyvr1yw"},iconOnly:{true:"_140wn8n10"},hasLeftIcon:{true:"_140wn8n11"},hasRightIcon:{true:"_140wn8n12"},activeOutline:{light:"_140wn8n13",bold:"_140wn8n14"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n15"],[{iconOnly:!0,size:"sm"},"_140wn8n16"],[{iconOnly:!0,size:"md"},"_140wn8n17"],[{iconOnly:!0,size:"lg"},"_140wn8n18"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n1b"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n1c"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1d"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1e"]]});const pr=p.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:l=!1,label:c,leftIcon:f,rightIcon:u,size:d="md",variant:v="glass",width:g="fit",shape:y="circle",type:w="button",...x}=t,b=f!==void 0&&c!==void 0,S=u!==void 0&&c!==void 0,P=f!==void 0&&c===void 0,_=d==="xs"?"xs":"sm";return J.jsx(re,{as:r,className:fn(i,BO({activeOutline:n,disabled:s||l,hasLeftIcon:b,hasRightIcon:S,iconOnly:P,size:v==="text"?void 0:d,shape:v==="text"?void 0:y,variant:v})),disabled:s||l,display:o,fontWeight:a,ref:e,type:w,width:g,...x,children:P?J.jsx(f,{size:_}):J.jsxs(re,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:d==="xs"?"1":"2",children:[J.jsxs(re,{justifyContent:"flex-start",alignItems:"center",gap:d==="xs"?"1":"2",children:[f&&J.jsx(f,{size:_}),J.jsx(Se,{children:c})]}),u&&J.jsx(u,{size:_})]})})});var $O=Qt({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"rhmai64 rhmai60 fyvr11a4 fyvr11ag fyvr11as fyvr11b4 fyvr12vz fyvr12v7 _4efw240"},disabled:{true:"rhmai65"},outlined:{true:"rhmai66 rhmai61 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12nj fyvr12g7 fyvr121j fyvr128v"},blur:{true:"rhmai67 rhmai62 fyvr11ms"}},defaultVariants:{},compoundVariants:[]});p.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:l="full",...c}=t;return J.jsx(re,{className:fn(r,$O({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:l,ref:e,...c,children:n})});function Kt(){return Kt=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>FO(r,e))}function It(...t){return p.useCallback(Q8(...t),t)}function qr(t,e=[]){let r=[];function n(s,o){const a=p.createContext(o),l=r.length;r=[...r,o];function c(u){const{scope:d,children:v,...g}=u,y=(d==null?void 0:d[t][l])||a,w=p.useMemo(()=>g,Object.values(g));return p.createElement(y.Provider,{value:w},v)}function f(u,d){const v=(d==null?void 0:d[t][l])||a,g=p.useContext(v);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,f]}const i=()=>{const s=r.map(o=>p.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[n,UO(i,...e)]}function UO(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...a,...u}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function Ce(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Hn(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function ea({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=zO({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Hn(r),l=p.useCallback(c=>{if(s){const u=typeof c=="function"?c(t):c;u!==t&&a(u)}else i(c)},[s,t,i,a]);return[o,l]}function zO({defaultProp:t,onChange:e}){const r=p.useState(t),[n]=r,i=p.useRef(n),s=Hn(e);return p.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function zm(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const kn=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{};function Vm(t){const[e,r]=p.useState(void 0);return kn(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function VO(t,e){return p.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const wo=t=>{const{present:e,children:r}=t,n=qO(e),i=typeof r=="function"?r({present:n.isPresent}):p.Children.only(r),s=It(n.ref,i.ref);return typeof r=="function"||n.isPresent?p.cloneElement(i,{ref:s}):null};wo.displayName="Presence";function qO(t){const[e,r]=p.useState(),n=p.useRef({}),i=p.useRef(t),s=p.useRef("none"),o=t?"mounted":"unmounted",[a,l]=VO(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=Tu(n.current);s.current=a==="mounted"?c:"none"},[a]),kn(()=>{const c=n.current,f=i.current;if(f!==t){const d=s.current,v=Tu(c);t?l("MOUNT"):v==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&d!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),kn(()=>{if(e){const c=u=>{const v=Tu(n.current).includes(u.animationName);u.target===e&&v&&ks.flushSync(()=>l("ANIMATION_END"))},f=u=>{u.target===e&&(s.current=Tu(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function Tu(t){return(t==null?void 0:t.animationName)||"none"}function Re(){return Re=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:r,...n}=t,i=p.Children.toArray(r),s=i.find(WO);if(s){const o=s.props.children,a=i.map(l=>l===s?p.Children.count(o)>1?p.Children.only(null):p.isValidElement(o)?o.props.children:null:l);return p.createElement(Ny,Re({},n,{ref:e}),p.isValidElement(o)?p.cloneElement(o,void 0,a):null)}return p.createElement(Ny,Re({},n,{ref:e}),r)});ml.displayName="Slot";const Ny=p.forwardRef((t,e)=>{const{children:r,...n}=t;return p.isValidElement(r)?p.cloneElement(r,{...GO(n,r.props),ref:e?Q8(e,r.ref):r.ref}):p.Children.count(r)>1?p.Children.only(null):null});Ny.displayName="SlotClone";const HO=({children:t})=>p.createElement(p.Fragment,null,t);function WO(t){return p.isValidElement(t)&&t.type===HO}function GO(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const KO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=KO.reduce((t,e)=>{const r=p.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?ml:e;return p.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),p.createElement(a,Kt({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function qm(t,e){t&&ks.flushSync(()=>t.dispatchEvent(e))}const Y8="Checkbox",[QO,qee]=qr(Y8),[YO,JO]=QO(Y8),XO=p.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:c,...f}=t,[u,d]=p.useState(null),v=It(e,S=>d(S)),g=p.useRef(!1),y=u?!!u.closest("form"):!0,[w=!1,x]=ea({prop:i,defaultProp:s,onChange:c}),b=p.useRef(w);return p.useEffect(()=>{const S=u==null?void 0:u.form;if(S){const P=()=>x(b.current);return S.addEventListener("reset",P),()=>S.removeEventListener("reset",P)}},[u,x]),p.createElement(YO,{scope:r,state:w,disabled:a},p.createElement(Xe.button,Kt({type:"button",role:"checkbox","aria-checked":qo(w)?"mixed":w,"aria-required":o,"data-state":J8(w),"data-disabled":a?"":void 0,disabled:a,value:l},f,{ref:v,onKeyDown:Ce(t.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ce(t.onClick,S=>{x(P=>qo(P)?!0:!P),y&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})})),y&&p.createElement(tN,{control:u,bubbles:!g.current,name:n,value:l,checked:w,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),ZO="CheckboxIndicator",eN=p.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=JO(ZO,r);return p.createElement(wo,{present:n||qo(s.state)||s.state===!0},p.createElement(Xe.span,Kt({"data-state":J8(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),tN=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=p.useRef(null),o=zm(r),a=Vm(e);return p.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(o!==r&&u){const d=new Event("click",{bubbles:n});l.indeterminate=qo(r),u.call(l,qo(r)?!1:r),l.dispatchEvent(d)}},[o,r,n]),p.createElement("input",Kt({type:"checkbox","aria-hidden":!0,defaultChecked:qo(r)?!1:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function qo(t){return t==="indeterminate"}function J8(t){return qo(t)?"indeterminate":t?"checked":"unchecked"}const rN=XO,nN=eN;var iN=Qt({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"_43lu9r5 _43lu9r0 fyvr11kw fyvr11i4 fyvr118k fyvr11h0",left:"_43lu9r6 _43lu9r1 fyvr11ko fyvr11ic fyvr118k fyvr11h0",right:"_43lu9r7 _43lu9r2 fyvr11ko fyvr11ic fyvr118k fyvr11h0",hidden:"_43lu9r8 _43lu9r3 fyvr1188 fyvr11h0"}},defaultVariants:{},compoundVariants:[]});const Tl=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?J.jsxs(re,{flexDirection:"column",gap:"0.5",children:[r&&J.jsx(Se,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&J.jsx(Se,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return J.jsxs(re,{as:"label",className:iN({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var r0=Qt({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const sN=t=>J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:J.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),X8=({size:t="sm",...e})=>J.jsx(re,{as:sN,className:r0({size:t}),...e}),oN=t=>J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:J.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),Z8=({size:t="sm",...e})=>J.jsx(re,{as:oN,className:r0({size:t}),...e}),aN=t=>J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:J.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),Hm=({size:t="sm",...e})=>J.jsx(re,{as:aN,className:r0({size:t}),...e}),lN=t=>J.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:J.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),cN=({size:t="sm",...e})=>J.jsx(re,{as:lN,className:r0({size:t}),...e});var fN=Qt({defaultClassName:"_1c9x66f1 _1c9x66f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11h0 fyvr11ko fyvr11jg fyvr11od fyvr12w1 fyvr12vz fyvr12vr fyvr12v7 fyvr12v3 _4efw240",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),uN="_1c9x66f4 fyvr12s1 fyvr11h0 fyvr11ko fyvr11jg fyvr128 fyvr15o";const dN=({size:t="sm"})=>J.jsx(nN,{className:uN,children:J.jsx(X8,{size:t==="lg"?"sm":"xs"})});p.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...l}=t;return J.jsx(Tl,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:J.jsx(rN,{className:fN({size:a}),disabled:r,id:n??i,name:i,ref:e,...l,children:J.jsx(dN,{size:a})})})});gr.createContext(null);const hN=gA["useId".toString()]||(()=>{});let vN=0;function ro(t){const[e,r]=p.useState(hN());return kn(()=>{t||r(n=>n??String(vN++))},[t]),t||(e?`radix-${e}`:"")}const eS="Collapsible",[yN,Hee]=qr(eS),[pN,Wm]=yN(eS),mN=p.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[l=!1,c]=ea({prop:n,defaultProp:i,onChange:o});return p.createElement(pN,{scope:r,disabled:s,contentId:ro(),open:l,onOpenToggle:p.useCallback(()=>c(f=>!f),[c])},p.createElement(Xe.div,Kt({"data-state":Gm(l),"data-disabled":s?"":void 0},a,{ref:e})))}),gN="CollapsibleTrigger",xN=p.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=Wm(gN,r);return p.createElement(Xe.button,Kt({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Gm(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},n,{ref:e,onClick:Ce(t.onClick,i.onOpenToggle)}))}),tS="CollapsibleContent",bN=p.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=Wm(tS,t.__scopeCollapsible);return p.createElement(wo,{present:r||i.open},({present:s})=>p.createElement(wN,Kt({},n,{ref:e,present:s})))}),wN=p.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=Wm(tS,r),[a,l]=p.useState(n),c=p.useRef(null),f=It(e,c),u=p.useRef(0),d=u.current,v=p.useRef(0),g=v.current,y=o.open||a,w=p.useRef(y),x=p.useRef();return p.useEffect(()=>{const b=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(b)},[]),kn(()=>{const b=c.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const S=b.getBoundingClientRect();u.current=S.height,v.current=S.width,w.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),l(n)}},[o.open,n]),p.createElement(Xe.div,Kt({"data-state":Gm(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!y},s,{ref:f,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style}}),y&&i)});function Gm(t){return t?"open":"closed"}const EN=mN,AN=xN,SN=bN;var Mw="64px",CN="_4j62fl0",kN="_4j62fl2 _4j62fl1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11h0 fyvr11ko fyvr11od fyvr128 fyvr12v7 fyvr11n4 _4efw240",PN="_4j62fl4 _4j62fl3 fyvr1ww fyvr1ys fyvr1so fyvr1v0 fyvr128",RN="_4j62fl5";const ic=t=>{const{className:e,children:r,defaultOpen:n,open:i,onOpenChange:s,label:o,...a}=t,[l,c]=p.useState(n),f=i??l,u=v=>{i===void 0&&c(v)},d=v=>{u(v),s==null||s(v)};return J.jsx(EN,{open:f,defaultOpen:n,onOpenChange:d,asChild:!0,children:J.jsxs(re,{as:Za.div,className:fn(e,CN),initial:{height:f?"auto":Mw},animate:{height:f?"auto":Mw},transition:{ease:"easeOut",duration:.3},borderRadius:"md",background:"backgroundSecondary",position:"relative",overflow:"hidden",width:"full",...a,children:[J.jsxs(AN,{className:kN,children:[J.jsx(Se,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),J.jsx(re,{as:Za.div,position:"absolute",right:"0",marginRight:"4",initial:{rotate:f?180:0},animate:{rotate:f?180:0},transition:{ease:"linear",duration:.1},children:J.jsx(Z8,{className:RN,color:"text50"})})]}),J.jsx(q8,{children:f&&J.jsx(SN,{className:PN,asChild:!0,forceMount:!0,children:J.jsx(Za.div,{initial:{opacity:f?1:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"easeOut",duration:.3},children:r})})})]})})};function n0(t){const e=t+"CollectionProvider",[r,n]=qr(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:g,children:y}=v,w=gr.useRef(null),x=gr.useRef(new Map).current;return gr.createElement(i,{scope:g,itemMap:x,collectionRef:w},y)},a=t+"CollectionSlot",l=gr.forwardRef((v,g)=>{const{scope:y,children:w}=v,x=s(a,y),b=It(g,x.collectionRef);return gr.createElement(ml,{ref:b},w)}),c=t+"CollectionItemSlot",f="data-radix-collection-item",u=gr.forwardRef((v,g)=>{const{scope:y,children:w,...x}=v,b=gr.useRef(null),S=It(g,b),P=s(c,y);return gr.useEffect(()=>(P.itemMap.set(b,{ref:b,...x}),()=>void P.itemMap.delete(b))),gr.createElement(ml,{[f]:"",ref:S},w)});function d(v){const g=s(t+"CollectionConsumer",v);return gr.useCallback(()=>{const w=g.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(g.itemMap.values()).sort((P,_)=>x.indexOf(P.ref.current)-x.indexOf(_.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:l,ItemSlot:u},d,n]}const TN=p.createContext(void 0);function Km(t){const e=p.useContext(TN);return t||e||"ltr"}function MN(t,e=globalThis==null?void 0:globalThis.document){const r=Hn(t);p.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const Dy="dismissableLayer.update",IN="dismissableLayer.pointerDownOutside",_N="dismissableLayer.focusOutside";let Iw;const ON=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qm=p.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=t,f=p.useContext(ON),[u,d]=p.useState(null),v=(r=u==null?void 0:u.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,g]=p.useState({}),y=It(e,L=>d(L)),w=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w.indexOf(x),S=u?w.indexOf(u):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,_=S>=b,D=NN(L=>{const z=L.target,H=[...f.branches].some(Y=>Y.contains(z));!_||H||(s==null||s(L),a==null||a(L),L.defaultPrevented||l==null||l())},v),M=DN(L=>{const z=L.target;[...f.branches].some(Y=>Y.contains(z))||(o==null||o(L),a==null||a(L),L.defaultPrevented||l==null||l())},v);return MN(L=>{S===f.layers.size-1&&(i==null||i(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},v),p.useEffect(()=>{if(u)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Iw=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(u)),f.layers.add(u),_w(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Iw)}},[u,v,n,f]),p.useEffect(()=>()=>{u&&(f.layers.delete(u),f.layersWithOutsidePointerEventsDisabled.delete(u),_w())},[u,f]),p.useEffect(()=>{const L=()=>g({});return document.addEventListener(Dy,L),()=>document.removeEventListener(Dy,L)},[]),p.createElement(Xe.div,Re({},c,{ref:y,style:{pointerEvents:P?_?"auto":"none":void 0,...t.style},onFocusCapture:Ce(t.onFocusCapture,M.onFocusCapture),onBlurCapture:Ce(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Ce(t.onPointerDownCapture,D.onPointerDownCapture)}))});function NN(t,e=globalThis==null?void 0:globalThis.document){const r=Hn(t),n=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){rS(IN,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function DN(t,e=globalThis==null?void 0:globalThis.document){const r=Hn(t),n=p.useRef(!1);return p.useEffect(()=>{const i=s=>{s.target&&!n.current&&rS(_N,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function _w(){const t=new CustomEvent(Dy);document.dispatchEvent(t)}function rS(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?qm(i,s):i.dispatchEvent(s)}const LN=Qm;let R1=0;function nS(){p.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:Ow()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:Ow()),R1++,()=>{R1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),R1--}},[])}function Ow(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const T1="focusScope.autoFocusOnMount",M1="focusScope.autoFocusOnUnmount",Nw={bubbles:!1,cancelable:!0},iS=p.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=p.useState(null),c=Hn(i),f=Hn(s),u=p.useRef(null),d=It(e,y=>l(y)),v=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(n){let y=function(S){if(v.paused||!a)return;const P=S.target;a.contains(P)?u.current=P:Ns(u.current,{select:!0})},w=function(S){if(v.paused||!a)return;const P=S.relatedTarget;P!==null&&(a.contains(P)||Ns(u.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const _ of S)_.removedNodes.length>0&&Ns(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",w);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",w),b.disconnect()}}},[n,a,v.paused]),p.useEffect(()=>{if(a){Lw.add(v);const y=document.activeElement;if(!a.contains(y)){const x=new CustomEvent(T1,Nw);a.addEventListener(T1,c),a.dispatchEvent(x),x.defaultPrevented||(jN(zN(sS(a)),{select:!0}),document.activeElement===y&&Ns(a))}return()=>{a.removeEventListener(T1,c),setTimeout(()=>{const x=new CustomEvent(M1,Nw);a.addEventListener(M1,f),a.dispatchEvent(x),x.defaultPrevented||Ns(y??document.body,{select:!0}),a.removeEventListener(M1,f),Lw.remove(v)},0)}}},[a,c,f,v]);const g=p.useCallback(y=>{if(!r&&!n||v.paused)return;const w=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,x=document.activeElement;if(w&&x){const b=y.currentTarget,[S,P]=BN(b);S&&P?!y.shiftKey&&x===P?(y.preventDefault(),r&&Ns(S,{select:!0})):y.shiftKey&&x===S&&(y.preventDefault(),r&&Ns(P,{select:!0})):x===b&&y.preventDefault()}},[r,n,v.paused]);return p.createElement(Xe.div,Re({tabIndex:-1},o,{ref:d,onKeyDown:g}))});function jN(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Ns(n,{select:e}),document.activeElement!==r)return}function BN(t){const e=sS(t),r=Dw(e,t),n=Dw(e.reverse(),t);return[r,n]}function sS(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Dw(t,e){for(const r of t)if(!$N(r,{upTo:e}))return r}function $N(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function FN(t){return t instanceof HTMLInputElement&&"select"in t}function Ns(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&FN(t)&&e&&t.select()}}const Lw=UN();function UN(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=jw(t,e),t.unshift(e)},remove(e){var r;t=jw(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function jw(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function zN(t){return t.filter(e=>e.tagName!=="A")}const VN=["top","right","bottom","left"],co=Math.min,bn=Math.max,rh=Math.round,Mu=Math.floor,fo=t=>({x:t,y:t}),qN={left:"right",right:"left",bottom:"top",top:"bottom"},HN={start:"end",end:"start"};function Ly(t,e,r){return bn(t,co(e,r))}function xs(t,e){return typeof t=="function"?t(e):t}function bs(t){return t.split("-")[0]}function Ml(t){return t.split("-")[1]}function Ym(t){return t==="x"?"y":"x"}function Jm(t){return t==="y"?"height":"width"}function Il(t){return["top","bottom"].includes(bs(t))?"y":"x"}function Xm(t){return Ym(Il(t))}function WN(t,e,r){r===void 0&&(r=!1);const n=Ml(t),i=Xm(t),s=Jm(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=nh(o)),[o,nh(o)]}function GN(t){const e=nh(t);return[jy(t),e,jy(e)]}function jy(t){return t.replace(/start|end/g,e=>HN[e])}function KN(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function QN(t,e,r,n){const i=Ml(t);let s=KN(bs(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(jy)))),s}function nh(t){return t.replace(/left|right|bottom|top/g,e=>qN[e])}function YN(t){return{top:0,right:0,bottom:0,left:0,...t}}function oS(t){return typeof t!="number"?YN(t):{top:t,right:t,bottom:t,left:t}}function ih(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Bw(t,e,r){let{reference:n,floating:i}=t;const s=Il(e),o=Xm(e),a=Jm(o),l=bs(e),c=s==="y",f=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let v;switch(l){case"top":v={x:f,y:n.y-i.height};break;case"bottom":v={x:f,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:u};break;case"left":v={x:n.x-i.width,y:u};break;default:v={x:n.x,y:n.y}}switch(Ml(e)){case"start":v[o]-=d*(r&&c?-1:1);break;case"end":v[o]+=d*(r&&c?-1:1);break}return v}const JN=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=Bw(c,n,l),d=n,v={},g=0;for(let y=0;y({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:f=0}=xs(t,e)||{};if(c==null)return{};const u=oS(f),d={x:r,y:n},v=Xm(i),g=Jm(v),y=await o.getDimensions(c),w=v==="y",x=w?"top":"left",b=w?"bottom":"right",S=w?"clientHeight":"clientWidth",P=s.reference[g]+s.reference[v]-d[v]-s.floating[g],_=d[v]-s.reference[v],D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let M=D?D[S]:0;(!M||!await(o.isElement==null?void 0:o.isElement(D)))&&(M=a.floating[S]||s.floating[g]);const L=P/2-_/2,z=M/2-y[g]/2-1,H=co(u[x],z),Y=co(u[b],z),Z=H,O=M-y[g]-Y,h=M/2-y[g]/2+L,A=Ly(Z,h,O),k=!l.arrow&&Ml(i)!=null&&h!=A&&s.reference[g]/2-(hZ<=0)){var z,H;const Z=(((z=s.flip)==null?void 0:z.index)||0)+1,O=_[Z];if(O)return{data:{index:Z,overflows:L},reset:{placement:O}};let h=(H=L.filter(A=>A.overflows[0]<=0).sort((A,k)=>A.overflows[1]-k.overflows[1])[0])==null?void 0:H.placement;if(!h)switch(v){case"bestFit":{var Y;const A=(Y=L.map(k=>[k.placement,k.overflows.filter(I=>I>0).reduce((I,R)=>I+R,0)]).sort((k,I)=>k[1]-I[1])[0])==null?void 0:Y[0];A&&(h=A);break}case"initialPlacement":h=a;break}if(i!==h)return{reset:{placement:h}}}return{}}}};function Fw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Uw(t){return VN.some(e=>t[e]>=0)}const ZN=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=xs(t,e);switch(n){case"referenceHidden":{const s=await Af(e,{...i,elementContext:"reference"}),o=Fw(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Uw(o)}}}case"escaped":{const s=await Af(e,{...i,altBoundary:!0}),o=Fw(s,r.floating);return{data:{escapedOffsets:o,escaped:Uw(o)}}}default:return{}}}}};async function eD(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=bs(r),a=Ml(r),l=Il(r)==="y",c=["left","top"].includes(o)?-1:1,f=s&&l?-1:1,u=xs(e,t);let{mainAxis:d,crossAxis:v,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof g=="number"&&(v=a==="end"?g*-1:g),l?{x:v*f,y:d*c}:{x:d*c,y:v*f}}const tD=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await eD(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},rD=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x,y:b}=w;return{x,y:b}}},...l}=xs(t,e),c={x:r,y:n},f=await Af(e,l),u=Il(bs(i)),d=Ym(u);let v=c[d],g=c[u];if(s){const w=d==="y"?"top":"left",x=d==="y"?"bottom":"right",b=v+f[w],S=v-f[x];v=Ly(b,v,S)}if(o){const w=u==="y"?"top":"left",x=u==="y"?"bottom":"right",b=g+f[w],S=g-f[x];g=Ly(b,g,S)}const y=a.fn({...e,[d]:v,[u]:g});return{...y,data:{x:y.x-r,y:y.y-n}}}}},nD=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=xs(t,e),f={x:r,y:n},u=Il(i),d=Ym(u);let v=f[d],g=f[u];const y=xs(a,e),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const S=d==="y"?"height":"width",P=s.reference[d]-s.floating[S]+w.mainAxis,_=s.reference[d]+s.reference[S]-w.mainAxis;v_&&(v=_)}if(c){var x,b;const S=d==="y"?"width":"height",P=["top","left"].includes(bs(i)),_=s.reference[u]-s.floating[S]+(P&&((x=o.offset)==null?void 0:x[u])||0)+(P?0:w.crossAxis),D=s.reference[u]+s.reference[S]+(P?0:((b=o.offset)==null?void 0:b[u])||0)-(P?w.crossAxis:0);g<_?g=_:g>D&&(g=D)}return{[d]:v,[u]:g}}}},iD=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=xs(t,e),l=await Af(e,a),c=bs(r),f=Ml(r),u=Il(r)==="y",{width:d,height:v}=n.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=c,g=f==="end"?"top":"bottom");const w=v-l[g],x=d-l[y],b=!e.middlewareData.shift;let S=w,P=x;if(u){const D=d-l.left-l.right;P=f||b?co(x,D):D}else{const D=v-l.top-l.bottom;S=f||b?co(w,D):D}if(b&&!f){const D=bn(l.left,0),M=bn(l.right,0),L=bn(l.top,0),z=bn(l.bottom,0);u?P=d-2*(D!==0||M!==0?D+M:bn(l.left,l.right)):S=v-2*(L!==0||z!==0?L+z:bn(l.top,l.bottom))}await o({...e,availableWidth:P,availableHeight:S});const _=await i.getDimensions(s.floating);return d!==_.width||v!==_.height?{reset:{rects:!0}}:{}}}};function uo(t){return aS(t)?(t.nodeName||"").toLowerCase():"#document"}function An(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ps(t){var e;return(e=(aS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function aS(t){return t instanceof Node||t instanceof An(t).Node}function ws(t){return t instanceof Element||t instanceof An(t).Element}function Ui(t){return t instanceof HTMLElement||t instanceof An(t).HTMLElement}function zw(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof An(t).ShadowRoot}function Yf(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Wn(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function sD(t){return["table","td","th"].includes(uo(t))}function Zm(t){const e=eg(),r=Wn(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function oD(t){let e=gl(t);for(;Ui(e)&&!i0(e);){if(Zm(e))return e;e=gl(e)}return null}function eg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function i0(t){return["html","body","#document"].includes(uo(t))}function Wn(t){return An(t).getComputedStyle(t)}function s0(t){return ws(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function gl(t){if(uo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||zw(t)&&t.host||Ps(t);return zw(e)?e.host:e}function lS(t){const e=gl(t);return i0(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ui(e)&&Yf(e)?e:lS(e)}function Sf(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=lS(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=An(i);return s?e.concat(o,o.visualViewport||[],Yf(i)?i:[],o.frameElement&&r?Sf(o.frameElement):[]):e.concat(i,Sf(i,[],r))}function cS(t){const e=Wn(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Ui(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=rh(r)!==s||rh(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function tg(t){return ws(t)?t:t.contextElement}function el(t){const e=tg(t);if(!Ui(e))return fo(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=cS(e);let o=(s?rh(r.width):r.width)/n,a=(s?rh(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const aD=fo(0);function fS(t){const e=An(t);return!eg()||!e.visualViewport?aD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lD(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==An(t)?!1:e}function ta(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=tg(t);let o=fo(1);e&&(n?ws(n)&&(o=el(n)):o=el(t));const a=lD(s,r,n)?fS(s):fo(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,f=i.width/o.x,u=i.height/o.y;if(s){const d=An(s),v=n&&ws(n)?An(n):n;let g=d.frameElement;for(;g&&n&&v!==d;){const y=el(g),w=g.getBoundingClientRect(),x=Wn(g),b=w.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,S=w.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,f*=y.x,u*=y.y,l+=b,c+=S,g=An(g).frameElement}}return ih({width:f,height:u,x:l,y:c})}function cD(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=Ui(r),s=Ps(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=fo(1);const l=fo(0);if((i||!i&&n!=="fixed")&&((uo(r)!=="body"||Yf(s))&&(o=s0(r)),Ui(r))){const c=ta(r);a=el(r),l.x=c.x+r.clientLeft,l.y=c.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+l.x,y:e.y*a.y-o.scrollTop*a.y+l.y}}function fD(t){return Array.from(t.getClientRects())}function uS(t){return ta(Ps(t)).left+s0(t).scrollLeft}function uD(t){const e=Ps(t),r=s0(t),n=t.ownerDocument.body,i=bn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=bn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+uS(t);const a=-r.scrollTop;return Wn(n).direction==="rtl"&&(o+=bn(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function dD(t,e){const r=An(t),n=Ps(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=eg();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function hD(t,e){const r=ta(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Ui(t)?el(t):fo(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function Vw(t,e,r){let n;if(e==="viewport")n=dD(t,r);else if(e==="document")n=uD(Ps(t));else if(ws(e))n=hD(e,r);else{const i=fS(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return ih(n)}function dS(t,e){const r=gl(t);return r===e||!ws(r)||i0(r)?!1:Wn(r).position==="fixed"||dS(r,e)}function vD(t,e){const r=e.get(t);if(r)return r;let n=Sf(t,[],!1).filter(a=>ws(a)&&uo(a)!=="body"),i=null;const s=Wn(t).position==="fixed";let o=s?gl(t):t;for(;ws(o)&&!i0(o);){const a=Wn(o),l=Zm(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Yf(o)&&!l&&dS(t,o))?n=n.filter(f=>f!==o):i=a,o=gl(o)}return e.set(t,n),n}function yD(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?vD(e,this._c):[].concat(r),n],a=o[0],l=o.reduce((c,f)=>{const u=Vw(e,f,i);return c.top=bn(u.top,c.top),c.right=co(u.right,c.right),c.bottom=co(u.bottom,c.bottom),c.left=bn(u.left,c.left),c},Vw(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function pD(t){return cS(t)}function mD(t,e,r){const n=Ui(e),i=Ps(e),s=r==="fixed",o=ta(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=fo(0);if(n||!n&&!s)if((uo(e)!=="body"||Yf(i))&&(a=s0(e)),n){const c=ta(e,!0,s,e);l.x=c.x+e.clientLeft,l.y=c.y+e.clientTop}else i&&(l.x=uS(i));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function qw(t,e){return!Ui(t)||Wn(t).position==="fixed"?null:e?e(t):t.offsetParent}function hS(t,e){const r=An(t);if(!Ui(t))return r;let n=qw(t,e);for(;n&&sD(n)&&Wn(n).position==="static";)n=qw(n,e);return n&&(uo(n)==="html"||uo(n)==="body"&&Wn(n).position==="static"&&!Zm(n))?r:n||oD(t)||r}const gD=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||hS,s=this.getDimensions;return{reference:mD(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function xD(t){return Wn(t).direction==="rtl"}const bD={convertOffsetParentRelativeRectToViewportRelativeRect:cD,getDocumentElement:Ps,getClippingRect:yD,getOffsetParent:hS,getElementRects:gD,getClientRects:fD,getDimensions:pD,getScale:el,isElement:ws,isRTL:xD};function wD(t,e){let r=null,n;const i=Ps(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:f,width:u,height:d}=t.getBoundingClientRect();if(a||e(),!u||!d)return;const v=Mu(f),g=Mu(i.clientWidth-(c+u)),y=Mu(i.clientHeight-(f+d)),w=Mu(c),b={rootMargin:-v+"px "+-g+"px "+-y+"px "+-w+"px",threshold:bn(0,co(1,l))||1};let S=!0;function P(_){const D=_[0].intersectionRatio;if(D!==l){if(!S)return o();D?o(!1,D):n=setTimeout(()=>{o(!1,1e-7)},100)}S=!1}try{r=new IntersectionObserver(P,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(P,b)}r.observe(t)}return o(!0),s}function ED(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=tg(t),f=i||s?[...c?Sf(c):[],...Sf(e)]:[];f.forEach(x=>{i&&x.addEventListener("scroll",r,{passive:!0}),s&&x.addEventListener("resize",r)});const u=c&&a?wD(c,r):null;let d=-1,v=null;o&&(v=new ResizeObserver(x=>{let[b]=x;b&&b.target===c&&v&&(v.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{v&&v.observe(e)})),r()}),c&&!l&&v.observe(c),v.observe(e));let g,y=l?ta(t):null;l&&w();function w(){const x=ta(t);y&&(x.x!==y.x||x.y!==y.y||x.width!==y.width||x.height!==y.height)&&r(),y=x,g=requestAnimationFrame(w)}return r(),()=>{f.forEach(x=>{i&&x.removeEventListener("scroll",r),s&&x.removeEventListener("resize",r)}),u&&u(),v&&v.disconnect(),v=null,l&&cancelAnimationFrame(g)}}const AD=(t,e,r)=>{const n=new Map,i={platform:bD,...r},s={...i.platform,_c:n};return JN(t,e,{...i,platform:s})},SD=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?$w({element:n.current,padding:i}).fn(r):{}:n?$w({element:n,padding:i}).fn(r):{}}}};var fd=typeof document<"u"?p.useLayoutEffect:p.useEffect;function sh(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!sh(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!sh(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function vS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Hw(t,e){const r=vS(t);return Math.round(e*r)/r}function Ww(t){const e=p.useRef(t);return fd(()=>{e.current=t}),e}function CD(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[f,u]=p.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,v]=p.useState(n);sh(d,n)||v(n);const[g,y]=p.useState(null),[w,x]=p.useState(null),b=p.useCallback(k=>{k!=D.current&&(D.current=k,y(k))},[y]),S=p.useCallback(k=>{k!==M.current&&(M.current=k,x(k))},[x]),P=s||g,_=o||w,D=p.useRef(null),M=p.useRef(null),L=p.useRef(f),z=Ww(l),H=Ww(i),Y=p.useCallback(()=>{if(!D.current||!M.current)return;const k={placement:e,strategy:r,middleware:d};H.current&&(k.platform=H.current),AD(D.current,M.current,k).then(I=>{const R={...I,isPositioned:!0};Z.current&&!sh(L.current,R)&&(L.current=R,ks.flushSync(()=>{u(R)}))})},[d,e,r,H]);fd(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,u(k=>({...k,isPositioned:!1})))},[c]);const Z=p.useRef(!1);fd(()=>(Z.current=!0,()=>{Z.current=!1}),[]),fd(()=>{if(P&&(D.current=P),_&&(M.current=_),P&&_){if(z.current)return z.current(P,_,Y);Y()}},[P,_,Y,z]);const O=p.useMemo(()=>({reference:D,floating:M,setReference:b,setFloating:S}),[b,S]),h=p.useMemo(()=>({reference:P,floating:_}),[P,_]),A=p.useMemo(()=>{const k={position:r,left:0,top:0};if(!h.floating)return k;const I=Hw(h.floating,f.x),R=Hw(h.floating,f.y);return a?{...k,transform:"translate("+I+"px, "+R+"px)",...vS(h.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:I,top:R}},[r,a,h.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:Y,refs:O,elements:h,floatingStyles:A}),[f,Y,O,h,A])}const yS="Popper",[pS,_l]=qr(yS),[kD,mS]=pS(yS),PD=t=>{const{__scopePopper:e,children:r}=t,[n,i]=p.useState(null);return p.createElement(kD,{scope:e,anchor:n,onAnchorChange:i},r)},RD="PopperAnchor",TD=p.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=mS(RD,r),o=p.useRef(null),a=It(e,o);return p.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:p.createElement(Xe.div,Re({},i,{ref:a}))}),gS="PopperContent",[MD,Wee]=pS(gS),ID=p.forwardRef((t,e)=>{var r,n,i,s,o,a,l,c;const{__scopePopper:f,side:u="bottom",sideOffset:d=0,align:v="center",alignOffset:g=0,arrowPadding:y=0,avoidCollisions:w=!0,collisionBoundary:x=[],collisionPadding:b=0,sticky:S="partial",hideWhenDetached:P=!1,updatePositionStrategy:_="optimized",onPlaced:D,...M}=t,L=mS(gS,f),[z,H]=p.useState(null),Y=It(e,we=>H(we)),[Z,O]=p.useState(null),h=Vm(Z),A=(r=h==null?void 0:h.width)!==null&&r!==void 0?r:0,k=(n=h==null?void 0:h.height)!==null&&n!==void 0?n:0,I=u+(v!=="center"?"-"+v:""),R=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},N=Array.isArray(x)?x:[x],j=N.length>0,C={padding:R,boundary:N.filter(_D),altBoundary:j},{refs:m,floatingStyles:T,placement:F,isPositioned:E,middlewareData:B}=CD({strategy:"fixed",placement:I,whileElementsMounted:(...we)=>ED(...we,{animationFrame:_==="always"}),elements:{reference:L.anchor},middleware:[tD({mainAxis:d+k,alignmentAxis:g}),w&&rD({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?nD():void 0,...C}),w&&XN({...C}),iD({...C,apply:({elements:we,rects:zt,availableWidth:Ve,availableHeight:ot})=>{const{width:Jn,height:at}=zt.reference,Ge=we.floating.style;Ge.setProperty("--radix-popper-available-width",`${Ve}px`),Ge.setProperty("--radix-popper-available-height",`${ot}px`),Ge.setProperty("--radix-popper-anchor-width",`${Jn}px`),Ge.setProperty("--radix-popper-anchor-height",`${at}px`)}}),Z&&SD({element:Z,padding:y}),OD({arrowWidth:A,arrowHeight:k}),P&&ZN({strategy:"referenceHidden",...C})]}),[V,q]=xS(F),K=Hn(D);kn(()=>{E&&(K==null||K())},[E,K]);const oe=(i=B.arrow)===null||i===void 0?void 0:i.x,ee=(s=B.arrow)===null||s===void 0?void 0:s.y,te=((o=B.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[Ie,ue]=p.useState();return kn(()=>{z&&ue(window.getComputedStyle(z).zIndex)},[z]),p.createElement("div",{ref:m.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:E?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[(a=B.transformOrigin)===null||a===void 0?void 0:a.x,(l=B.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},p.createElement(MD,{scope:f,placedSide:V,onArrowChange:O,arrowX:oe,arrowY:ee,shouldHideArrow:te},p.createElement(Xe.div,Re({"data-side":V,"data-align":q},M,{ref:Y,style:{...M.style,animation:E?void 0:"none",opacity:(c=B.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function _D(t){return t!==null}const OD=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:l,middlewareData:c}=e,u=((r=c.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=u?0:t.arrowWidth,v=u?0:t.arrowHeight,[g,y]=xS(a),w={start:"0%",center:"50%",end:"100%"}[y],x=((n=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,b=((s=(o=c.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+v/2;let S="",P="";return g==="bottom"?(S=u?w:`${x}px`,P=`${-v}px`):g==="top"?(S=u?w:`${x}px`,P=`${l.floating.height+v}px`):g==="right"?(S=`${-v}px`,P=u?w:`${b}px`):g==="left"&&(S=`${l.floating.width+v}px`,P=u?w:`${b}px`),{data:{x:S,y:P}}}});function xS(t){const[e,r="center"]=t.split("-");return[e,r]}const ND=PD,DD=TD,LD=ID,bS=p.forwardRef((t,e)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...i}=t;return n?w5.createPortal(p.createElement(Xe.div,Re({},i,{ref:e})),n):null}),I1="rovingFocusGroup.onEntryFocus",jD={bubbles:!1,cancelable:!0},rg="RovingFocusGroup",[By,wS,BD]=n0(rg),[$D,Ol]=qr(rg,[BD]),[FD,UD]=$D(rg),zD=p.forwardRef((t,e)=>p.createElement(By.Provider,{scope:t.__scopeRovingFocusGroup},p.createElement(By.Slot,{scope:t.__scopeRovingFocusGroup},p.createElement(VD,Kt({},t,{ref:e}))))),VD=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...f}=t,u=p.useRef(null),d=It(e,u),v=Km(s),[g=null,y]=ea({prop:o,defaultProp:a,onChange:l}),[w,x]=p.useState(!1),b=Hn(c),S=wS(r),P=p.useRef(!1),[_,D]=p.useState(0);return p.useEffect(()=>{const M=u.current;if(M)return M.addEventListener(I1,b),()=>M.removeEventListener(I1,b)},[b]),p.createElement(FD,{scope:r,orientation:n,dir:v,loop:i,currentTabStopId:g,onItemFocus:p.useCallback(M=>y(M),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>D(M=>M+1),[]),onFocusableItemRemove:p.useCallback(()=>D(M=>M-1),[])},p.createElement(Xe.div,Kt({tabIndex:w||_===0?-1:0,"data-orientation":n},f,{ref:d,style:{outline:"none",...t.style},onMouseDown:Ce(t.onMouseDown,()=>{P.current=!0}),onFocus:Ce(t.onFocus,M=>{const L=!P.current;if(M.target===M.currentTarget&&L&&!w){const z=new CustomEvent(I1,jD);if(M.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=S().filter(A=>A.focusable),Y=H.find(A=>A.active),Z=H.find(A=>A.id===g),h=[Y,Z,...H].filter(Boolean).map(A=>A.ref.current);ES(h)}}P.current=!1}),onBlur:Ce(t.onBlur,()=>x(!1))})))}),qD="RovingFocusGroupItem",HD=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=ro(),l=s||a,c=UD(qD,r),f=c.currentTabStopId===l,u=wS(r),{onFocusableItemAdd:d,onFocusableItemRemove:v}=c;return p.useEffect(()=>{if(n)return d(),()=>v()},[n,d,v]),p.createElement(By.ItemSlot,{scope:r,id:l,focusable:n,active:i},p.createElement(Xe.span,Kt({tabIndex:f?0:-1,"data-orientation":c.orientation},o,{ref:e,onMouseDown:Ce(t.onMouseDown,g=>{n?c.onItemFocus(l):g.preventDefault()}),onFocus:Ce(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ce(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=KD(g,c.orientation,c.dir);if(y!==void 0){g.preventDefault();let x=u().filter(b=>b.focusable).map(b=>b.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const b=x.indexOf(g.currentTarget);x=c.loop?QD(x,b+1):x.slice(b+1)}setTimeout(()=>ES(x))}})})))}),WD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function GD(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function KD(t,e,r){const n=GD(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return WD[n]}function ES(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function QD(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const YD=zD,AS=HD;var JD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},xa=new WeakMap,Iu=new WeakMap,_u={},_1=0,SS=function(t){return t&&(t.host||SS(t.parentNode))},XD=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=SS(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},ZD=function(t,e,r,n){var i=XD(e,Array.isArray(t)?t:[t]);_u[r]||(_u[r]=new WeakMap);var s=_u[r],o=[],a=new Set,l=new Set(i),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};i.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(d){if(a.has(d))f(d);else{var v=d.getAttribute(n),g=v!==null&&v!=="false",y=(xa.get(d)||0)+1,w=(s.get(d)||0)+1;xa.set(d,y),s.set(d,w),o.push(d),y===1&&g&&Iu.set(d,!0),w===1&&d.setAttribute(r,"true"),g||d.setAttribute(n,"true")}})};return f(e),a.clear(),_1++,function(){o.forEach(function(u){var d=xa.get(u)-1,v=s.get(u)-1;xa.set(u,d),s.set(u,v),d||(Iu.has(u)||u.removeAttribute(n),Iu.delete(u)),v||u.removeAttribute(r)}),_1--,_1||(xa=new WeakMap,xa=new WeakMap,Iu=new WeakMap,_u={})}},CS=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=JD(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),ZD(n,i,r,"aria-hidden")):function(){return null}},Ri=function(){return Ri=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return pL;var e=mL(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},xL=TS(),bL=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` .`.concat(tL,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; @@ -98,13 +98,13 @@ Error generating stack: `+s.message+` `)},wL=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=p.useMemo(function(){return gL(i)},[i]);return p.createElement(xL,{styles:bL(s,!e,i,r?"":"!important")})},$y=!1;if(typeof window<"u")try{var Ou=Object.defineProperty({},"passive",{get:function(){return $y=!0,!0}});window.addEventListener("test",Ou,Ou),window.removeEventListener("test",Ou,Ou)}catch{$y=!1}var ba=$y?{passive:!1}:!1,EL=function(t){return t.tagName==="TEXTAREA"},MS=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!EL(t)&&r[e]==="visible")},AL=function(t){return MS(t,"overflowY")},SL=function(t){return MS(t,"overflowX")},Gw=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=IS(t,r);if(n){var i=_S(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},CL=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},kL=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},IS=function(t,e){return t==="v"?AL(e):SL(e)},_S=function(t,e){return t==="v"?CL(e):kL(e)},PL=function(t,e){return t==="h"&&e==="rtl"?-1:1},RL=function(t,e,r,n,i){var s=PL(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,l=e.contains(a),c=!1,f=o>0,u=0,d=0;do{var v=_S(t,a),g=v[0],y=v[1],w=v[2],x=y-w-s*g;(g||x)&&IS(t,a)&&(u+=x,d+=g),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(f&&(u===0||!i)||!f&&(d===0||!i))&&(c=!0),c},Nu=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Kw=function(t){return[t.deltaX,t.deltaY]},Qw=function(t){return t&&"current"in t?t.current:t},TL=function(t,e){return t[0]===e[0]&&t[1]===e[1]},ML=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},IL=0,wa=[];function _L(t){var e=p.useRef([]),r=p.useRef([0,0]),n=p.useRef(),i=p.useState(IL++)[0],s=p.useState(function(){return TS()})[0],o=p.useRef(t);p.useEffect(function(){o.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var y=eL([t.lockRef.current],(t.shards||[]).map(Qw),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(y,w){if("touches"in y&&y.touches.length===2)return!o.current.allowPinchZoom;var x=Nu(y),b=r.current,S="deltaX"in y?y.deltaX:b[0]-x[0],P="deltaY"in y?y.deltaY:b[1]-x[1],_,D=y.target,M=Math.abs(S)>Math.abs(P)?"h":"v";if("touches"in y&&M==="h"&&D.type==="range")return!1;var L=Gw(M,D);if(!L)return!0;if(L?_=M:(_=M==="v"?"h":"v",L=Gw(M,D)),!L)return!1;if(!n.current&&"changedTouches"in y&&(S||P)&&(n.current=_),!_)return!0;var z=n.current||_;return RL(z,w,y,z==="h"?S:P,!0)},[]),l=p.useCallback(function(y){var w=y;if(!(!wa.length||wa[wa.length-1]!==s)){var x="deltaY"in w?Kw(w):Nu(w),b=e.current.filter(function(_){return _.name===w.type&&_.target===w.target&&TL(_.delta,x)})[0];if(b&&b.should){w.cancelable&&w.preventDefault();return}if(!b){var S=(o.current.shards||[]).map(Qw).filter(Boolean).filter(function(_){return _.contains(w.target)}),P=S.length>0?a(w,S[0]):!o.current.noIsolation;P&&w.cancelable&&w.preventDefault()}}},[]),c=p.useCallback(function(y,w,x,b){var S={name:y,delta:w,target:x,should:b};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(P){return P!==S})},1)},[]),f=p.useCallback(function(y){r.current=Nu(y),n.current=void 0},[]),u=p.useCallback(function(y){c(y.type,Kw(y),y.target,a(y,t.lockRef.current))},[]),d=p.useCallback(function(y){c(y.type,Nu(y),y.target,a(y,t.lockRef.current))},[]);p.useEffect(function(){return wa.push(s),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",l,ba),document.addEventListener("touchmove",l,ba),document.addEventListener("touchstart",f,ba),function(){wa=wa.filter(function(y){return y!==s}),document.removeEventListener("wheel",l,ba),document.removeEventListener("touchmove",l,ba),document.removeEventListener("touchstart",f,ba)}},[]);var v=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:ML(i)}):null,v?p.createElement(wL,{gapMode:"margin"}):null)}const OL=cL(RS,_L);var ng=p.forwardRef(function(t,e){return p.createElement(o0,Ri({},t,{ref:e,sideCar:OL}))});ng.classNames=o0.classNames;const NL=["Enter"," "],a0="Menu",[DL,Gee,LL]=n0(a0),[ha,OS]=qr(a0,[LL,_l,Ol]);_l();const jL=Ol();ha(a0);const[Kee,BL]=ha(a0),$L="MenuPortal";ha($L,{forceMount:void 0});const FL="MenuContent",[Qee,NS]=ha(FL),Fy="MenuItem",Yw="menu.itemSelect",DS=p.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=p.useRef(null),o=BL(Fy,t.__scopeMenu),a=NS(Fy,t.__scopeMenu),l=It(e,s),c=p.useRef(!1),f=()=>{const u=s.current;if(!r&&u){const d=new CustomEvent(Yw,{bubbles:!0,cancelable:!0});u.addEventListener(Yw,v=>n==null?void 0:n(v),{once:!0}),qm(u,d),d.defaultPrevented?c.current=!1:o.onClose()}};return p.createElement(UL,Re({},i,{ref:l,disabled:r,onClick:Se(t.onClick,f),onPointerDown:u=>{var d;(d=t.onPointerDown)===null||d===void 0||d.call(t,u),c.current=!0},onPointerUp:Se(t.onPointerUp,u=>{var d;c.current||(d=u.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Se(t.onKeyDown,u=>{const d=a.searchRef.current!=="";r||d&&u.key===" "||NL.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})}))}),UL=p.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=NS(Fy,r),a=jL(r),l=p.useRef(null),c=It(e,l),[f,u]=p.useState(!1),[d,v]=p.useState("");return p.useEffect(()=>{const g=l.current;if(g){var y;v(((y=g.textContent)!==null&&y!==void 0?y:"").trim())}},[s.children]),p.createElement(DL.ItemSlot,{scope:r,disabled:n,textValue:i??d},p.createElement(AS,Re({asChild:!0},a,{focusable:!n}),p.createElement(Xe.div,Re({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},s,{ref:c,onPointerMove:Se(t.onPointerMove,Jw(g=>{n?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus())})),onPointerLeave:Se(t.onPointerLeave,Jw(g=>o.onItemLeave(g))),onFocus:Se(t.onFocus,()=>u(!0)),onBlur:Se(t.onBlur,()=>u(!1))}))))}),zL=p.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return p.createElement(jS,{scope:t.__scopeMenu,checked:r},p.createElement(DS,Re({role:"menuitemcheckbox","aria-checked":oh(r)?"mixed":r},i,{ref:e,"data-state":ig(r),onSelect:Se(i.onSelect,()=>n==null?void 0:n(oh(r)?!0:!r),{checkForDefaultPrevented:!1})})))}),VL="MenuRadioGroup",[Yee,qL]=ha(VL,{value:void 0,onValueChange:()=>{}}),HL="MenuRadioItem",WL=p.forwardRef((t,e)=>{const{value:r,...n}=t,i=qL(HL,t.__scopeMenu),s=r===i.value;return p.createElement(jS,{scope:t.__scopeMenu,checked:s},p.createElement(DS,Re({role:"menuitemradio","aria-checked":s},n,{ref:e,"data-state":ig(s),onSelect:Se(n.onSelect,()=>{var o;return(o=i.onValueChange)===null||o===void 0?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})))}),LS="MenuItemIndicator",[jS,GL]=ha(LS,{checked:!1}),KL=p.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=GL(LS,r);return p.createElement(wo,{present:n||oh(s.checked)||s.checked===!0},p.createElement(Xe.span,Re({},i,{ref:e,"data-state":ig(s.checked)})))}),QL="MenuSub";ha(QL);function oh(t){return t==="indeterminate"}function ig(t){return oh(t)?"indeterminate":t?"checked":"unchecked"}function Jw(t){return e=>e.pointerType==="mouse"?t(e):void 0}const YL=zL,JL=WL,XL=KL,BS="DropdownMenu",[ZL,Jee]=qr(BS,[OS]),sg=OS();ZL(BS);const ej=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=sg(r);return p.createElement(YL,Re({},i,n,{ref:e}))}),tj=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=sg(r);return p.createElement(JL,Re({},i,n,{ref:e}))}),rj=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=sg(r);return p.createElement(XL,Re({},i,n,{ref:e}))}),nj=ej,ij=tj,$S=rj;var FS="_1k2mbvi4 _1k2mbvi3 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1x4 fyvr1yk fyvr1ss fyvr1uo fyvr12ws fyvr12wm fyvr11h0 fyvr11ko fyvr11jw fyvr12v7 fyvr11n4 fyvr11hw fyvr12s7",US="_1k2mbvi5";const sj=({children:t})=>J.jsx($S,{className:US,children:t});p.forwardRef(({className:t,children:e,...r},n)=>J.jsxs(nj,{className:fn(FS,t),...r,ref:n,children:[J.jsx(sj,{children:J.jsx(X8,{size:"xs"})}),J.jsx(Pe,{variant:"small",children:e})]}));p.forwardRef(({className:t,children:e,...r},n)=>J.jsxs(ij,{className:fn(FS,t),...r,ref:n,children:[J.jsx($S,{className:US,children:J.jsx(Pe,{children:"•"})}),J.jsx(Pe,{variant:"small",children:e})]}));const og=p.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return J.jsx(pr,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),oj=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var aj="_1hq71vk1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _1hq71vk0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12np fyvr12gd fyvr121p fyvr1291 fyvr11ko fyvr11hc fyvr11ic fyvr11jc fyvr1g0 fyvr11hw",lj=Qt({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"_1hq71vk6 _1hq71vk2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"_1hq71vk7 _1hq71vk3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"_1hq71vk8 _1hq71vk4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),cj="_1hq71vka _1hq71vk9 fyvr12wp fyvr12wj fyvr11ho fyvr12vj fyvr1ko fyvr1oo fyvr1mo fyvr1qo";const fj={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*, video/*",pdf:".pdf,application/pdf",mp4:".mp4,video/mp4"};p.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:l,onValueChange:c,placeholder:f="Upload a file",validExtensions:u,...d}=t,v=p.useRef(null),g=oj(v,e),[y,w]=p.useState(null),x=S=>{const P=S.currentTarget.files;if(!P||!P[0])return;const _=P[0],D=_.name,M=_.size/1e3;w({name:D,size:M,extension:D.split(".").pop()??""}),c==null||c(_)},b=u.map(S=>fj[S]).join(",");return J.jsx(Tl,{description:n,disabled:i,display:"grid",id:s??l,label:o,labelLocation:a,children:J.jsxs(re,{width:"full",minWidth:"0",justifyContent:y?"space-between":"flex-start",gap:"2",color:y?"text100":"text50",className:fn(aj,lj({borderRadius:r})),children:[y?J.jsxs(re,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[J.jsx(Pe,{ellipsis:!0,children:y.name}),J.jsxs(Pe,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[y.size.toFixed(2)," kb"]})]}):J.jsx(Pe,{ellipsis:!0,children:f}),J.jsx(re,{accept:b,as:"input",className:cj,cursor:"pointer",disabled:i,id:s??l,name:l,onChange:x,ref:g,type:"file",...d}),y&&J.jsx(og,{cursor:"pointer",icon:Hm,size:"xs",onClick:S=>{var P;S.preventDefault(),S.stopPropagation(),(P=v.current)!=null&&P.value&&(v.current.value=""),c==null||c(null),w(null)},zIndex:"10"})]})})});var uj=Qt({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const Uy=1e3,tl=64,D1=tl/2,L1=(t,e=Uy)=>t%e/(Uy/tl),_o=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},dj=(t,e,r)=>{const n=Math.random().toString(36).slice(2,12),i=t%360,s=(t+120)%360,o=r%360;return{id:_o(n),a:`hsl(${i}deg 100% 40%)`,b:`hsl(${s}deg 100% 50%)`,c:`hsl(${o}deg 100% 50%)`}},hj=(t,e)=>{const r=[];for(let n=0;n{const s=tl/10+L1(n.r,Uy*1.5/(i+1));return{...dj(n.a,n.b,n.c),x:L1(n.x),y:L1(n.y),r:s}})};p.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=hj(r,i);return J.jsxs(re,{as:"svg",className:fn(e,uj({size:n})),viewBox:`0 0 ${tl} ${tl}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[J.jsxs("defs",{children:[J.jsx("clipPath",{id:"circle-clip",children:J.jsx("circle",{cx:D1,cy:D1,r:D1})}),J.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[J.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),J.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),J.jsx("feGaussianBlur",{stdDeviation:tl/10,result:"effect1_foregroundBlur"})]}),J.jsxs("linearGradient",{id:`gradient-background-${o[0].id}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[J.jsx("stop",{offset:"0",stopColor:o[0].c}),J.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map(a=>J.jsxs(p.Fragment,{children:[J.jsxs("radialGradient",{id:`gradient-primary-${a.id}`,children:[J.jsx("stop",{offset:"0",stopColor:a.a}),J.jsx("stop",{offset:"1",stopColor:a.b})]}),J.jsxs("radialGradient",{id:`gradient-secondary-${a.id}`,children:[J.jsx("stop",{offset:"0",stopColor:a.c}),J.jsx("stop",{offset:"1",stopColor:a.b})]})]},a.id))]}),J.jsxs("g",{clipPath:"url(#circle-clip)",children:[J.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${o[0].id})`}),J.jsx("g",{filter:"url(#blur)",children:o.map(a=>J.jsxs(p.Fragment,{children:[J.jsx("circle",{fill:`url(#gradient-primary-${a.id})`,cx:a.x,cy:a.y,r:a.r}),J.jsx("circle",{fill:`url(#gradient-secondary-${a.id})`,cx:a.y,cy:a.x,r:a.r/2})]},a.id))})]})]})});const vj=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=p.useState(!1),o=a=>{s(!0),r==null||r(a)};return J.jsx(re,{as:Za.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})},zS="Dialog",[VS,Xee]=qr(zS),[yj,Eo]=VS(zS),pj=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=p.useRef(null),l=p.useRef(null),[c=!1,f]=ea({prop:n,defaultProp:i,onChange:s});return p.createElement(yj,{scope:e,triggerRef:a,contentRef:l,contentId:ro(),titleId:ro(),descriptionId:ro(),open:c,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(u=>!u),[f]),modal:o},r)},qS="DialogPortal",[mj,HS]=VS(qS,{forceMount:void 0}),gj=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Eo(qS,e);return p.createElement(mj,{scope:e,forceMount:r},p.Children.map(n,o=>p.createElement(wo,{present:r||s.open},p.createElement(bS,{asChild:!0,container:i},o))))},zy="DialogOverlay",xj=p.forwardRef((t,e)=>{const r=HS(zy,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Eo(zy,t.__scopeDialog);return s.modal?p.createElement(wo,{present:n||s.open},p.createElement(bj,Re({},i,{ref:e}))):null}),bj=p.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Eo(zy,r);return p.createElement(ng,{as:ml,allowPinchZoom:!0,shards:[i.contentRef]},p.createElement(Xe.div,Re({"data-state":GS(i.open)},n,{ref:e,style:{pointerEvents:"auto",...n.style}})))}),Cf="DialogContent",wj=p.forwardRef((t,e)=>{const r=HS(Cf,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Eo(Cf,t.__scopeDialog);return p.createElement(wo,{present:n||s.open},s.modal?p.createElement(Ej,Re({},i,{ref:e})):p.createElement(Aj,Re({},i,{ref:e})))}),Ej=p.forwardRef((t,e)=>{const r=Eo(Cf,t.__scopeDialog),n=p.useRef(null),i=It(e,r.contentRef,n);return p.useEffect(()=>{const s=n.current;if(s)return CS(s)},[]),p.createElement(WS,Re({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Se(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Se(t.onFocusOutside,s=>s.preventDefault())}))}),Aj=p.forwardRef((t,e)=>{const r=Eo(Cf,t.__scopeDialog),n=p.useRef(!1),i=p.useRef(!1);return p.createElement(WS,Re({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),WS=p.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Eo(Cf,r),l=p.useRef(null),c=It(e,l);return nS(),p.createElement(p.Fragment,null,p.createElement(iS,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},p.createElement(Qm,Re({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":GS(a.open)},o,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Sj="DialogClose",Cj=p.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Eo(Sj,r);return p.createElement(Xe.button,Re({type:"button"},n,{ref:e,onClick:Se(t.onClick,()=>i.onOpenChange(!1))}))});function GS(t){return t?"open":"closed"}const kj=pj,Pj=gj,Rj=xj,Tj=wj,Mj=Cj;var Ij=Qt({defaultClassName:"_1vqx0w91 _1vqx0w90 fyvr128 fyvr15o",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]}),_j=Qt({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]});const Oj=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return J.jsx(re,{className:_j({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:J.jsx(re,{className:Ij({direction:n}),background:"backgroundPrimary",...i,children:e})})};function Nj(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function Dj(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function KS(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.constructor();for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=KS(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function Xw(t,e,r){t.style.setProperty(Nj(e),r)}function Zw(t,e,r){if(typeof r=="object"){var n=e;KS(r,(a,l)=>{a!=null&&Xw(t,Dj(n,l),String(a))})}else{var i=e;for(var s in i){var o=i[s];o!=null&&Xw(t,s,i[s])}}}const ag=["dark","light"],QS="dark",Lj="data-theme",e3="@sequence.theme",jj=t=>ag.includes(t),Bj=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),YS=t=>t?`${e3}.${t}`:e3,$j=t=>{const e=localStorage.getItem(YS(t));return e&&ag.includes(e)?e:QS},JS=p.createContext(null),Fj=t=>{const[e,r]=p.useState(t.theme||QS);p.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),p.useEffect(()=>{t.theme||r($j(t.scope))},[t.theme,t.scope]),p.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),p.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(jj(e)?(i.setAttribute(Lj,e),Zw(i,Sw,{colors:AO[e]})):Bj(e)&&Zw(i,Sw,{colors:e}))},[e,t.root]);const n=p.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{ag.includes(i)&&(localStorage.setItem(YS(t.scope),i),r(i))}}),[e,t.root,t.scope]);return J.jsx(JS.Provider,{value:n,children:t.children})},XS=()=>{const t=p.useContext(JS);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var Uj="_5b32m91 _5b32m90 fyvr11jg fyvr11ko fyvr11h0 fyvr11hs fyvr11nk fyvr1ko fyvr1oo fyvr1qo fyvr1mo",zj="_5b32m93 _5b32m92 fyvr11hs fyvr1ko fyvr1oo fyvr1qo fyvr1mo",Vj=Qt({defaultClassName:"_5b32m95 _5b32m94 fyvr11d8 fyvr11dw fyvr11bg fyvr11by fyvr11c4 fyvr11cm fyvr11ls fyvr11m8 fyvr12ws fyvr12wm fyvr11h0 fyvr11i4 fyvr11hs fyvr11sd fyvr1mo fyvr1om",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),qj="_5b32m9b _5b32m9a fyvr110o fyvr112o fyvr114o fyvr116o fyvr11ho fyvr1qo fyvr1ko fyvr11nk";const Hj=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:l="lg",overlayProps:c,contentProps:f}=t,{root:u}=XS(),[d,v]=p.useState(null);return p.useEffect(()=>{v(document.querySelector(u||"body"))},[u]),d?J.jsx(kj,{modal:!0,defaultOpen:!0,onOpenChange:o,children:J.jsx(Pj,{forceMount:!0,container:d,children:J.jsxs(re,{className:Uj,children:[J.jsx(re,{as:Rj,asChild:!0,background:r,className:zj,forceMount:!0,children:J.jsx(Za.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...c},"modal-overlay")}),J.jsx(Tj,{asChild:!0,className:Vj({autoHeight:e,size:l}),forceMount:!0,onEscapeKeyDown:g=>{s?o==null||o():g.preventDefault()},onInteractOutside:g=>{s||g.preventDefault()},children:J.jsxs(Za.div,{initial:i?!1:{y:"100%",opacity:l==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:l==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...f,children:[a?J.jsx(Oj,{children:n}):n,s&&J.jsx(Mj,{asChild:!0,children:J.jsx(og,{icon:Hm,backdropFilter:"blur",size:"xs",className:qj,"aria-label":"Close"})})]},"modal-content")})]})})}):null};var Wj="_1acm19y1 _1acm19y0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1ww fyvr1ys fyvr11hc fyvr11ko fyvr11od fyvr12s1 fyvr1g0 fyvr118g",Gj=Qt({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"_1acm19y6 _1acm19y2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"_1acm19y7 _1acm19y3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"_1acm19y8 _1acm19y4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),Kj=Qt({defaultClassName:"_1acm19ya _1acm19y9 fyvr1wg fyvr1yc fyvr1t4 fyvr1v0 fyvr12wp fyvr12wj fyvr11gw fyvr11od fyvr12s1 fyvr12o1 fyvr128 fyvr15o",variantClassNames:{numeric:{false:"_1acm19yb _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",true:"_1acm19yc _1qxj1ib9 _1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8"}},defaultVariants:{},compoundVariants:[]});const Pr=p.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:l="",labelLocation:c="hidden",leftIcon:f,rightIcon:u,name:d,controls:v,type:g="text",numeric:y=!1,...w}=t;return J.jsx(Tl,{description:s,disabled:o,display:"grid",id:a??d,label:l,labelLocation:c,children:J.jsx(re,{width:"full",children:J.jsxs(re,{className:fn(Wj,Gj({borderRadius:i})),children:[f&&J.jsx(f,{size:"sm"}),J.jsx(re,{as:r,autoComplete:n,spellCheck:"false",className:Kj({numeric:y}),disabled:o,id:a??d,name:d,ref:e,type:g,...w}),u&&J.jsx(u,{size:"sm"}),v]})})})}),Qj=RegExp("^\\d*(?:\\\\[.])?\\d*$");function Yj(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}p.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=c=>{let{value:f}=c.target;f=f.replace(/,/g,"."),f.startsWith(".")&&(f="0"+f),f.startsWith("0")&&(f=f.replace(/^0+(?=\d)/,"")),(f===""||Qj.test(Yj(f)))&&(i==null||i({...c,target:{...c.target,value:f}}))},l=c=>{const{value:f}=c.target;let u=f;u.endsWith(".")&&(u=u.slice(0,-1)),u.endsWith(".0")&&(u=u.slice(0,-2)),u==="0"&&(u=""),s==null||s(c),u!==f&&(i==null||i({...c,target:{...c.target,value:u}}))};return J.jsx(Pr,{name:r,onChange:a,onBlur:l,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});Qt({defaultClassName:"_1jujggt1",variantClassNames:{size:{sm:"_1jujggt2",normal:"_1jujggt3",md:"_1jujggt4",lg:"_1jujggt5",xl:"_1jujggt6"}},defaultVariants:{},compoundVariants:[]});const ZS="Progress",l0=100,[Jj,Zee]=qr(ZS),[Xj,ete]=Jj(ZS),Zj=p.forwardRef((t,e)=>{const{__scopeProgress:r,value:n,max:i,getValueLabel:s=eB,...o}=t,a=Vy(i)?i:l0,l=eC(n,a)?n:null,c=ah(l)?s(l,a):void 0;return p.createElement(Xj,{scope:r,value:l,max:a},p.createElement(Xe.div,Kt({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":ah(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":tB(l,a),"data-value":l??void 0,"data-max":a},o,{ref:e})))});Zj.propTypes={max(t,e,r){const n=t[e],i=String(n);return n&&!Vy(n)?new Error(rB(i,r)):null},value(t,e,r){const n=t[e],i=String(n),s=Vy(t.max)?t.max:l0;return n!=null&&!eC(n,s)?new Error(nB(i,r)):null}};function eB(t,e){return`${Math.round(t/e*100)}%`}function tB(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function ah(t){return typeof t=="number"}function Vy(t){return ah(t)&&!isNaN(t)&&t>0}function eC(t,e){return ah(t)&&!isNaN(t)&&t<=e&&t>=0}function rB(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${l0}\`.`}function nB(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: +`)},IL=0,wa=[];function _L(t){var e=p.useRef([]),r=p.useRef([0,0]),n=p.useRef(),i=p.useState(IL++)[0],s=p.useState(function(){return TS()})[0],o=p.useRef(t);p.useEffect(function(){o.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var y=eL([t.lockRef.current],(t.shards||[]).map(Qw),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(y,w){if("touches"in y&&y.touches.length===2)return!o.current.allowPinchZoom;var x=Nu(y),b=r.current,S="deltaX"in y?y.deltaX:b[0]-x[0],P="deltaY"in y?y.deltaY:b[1]-x[1],_,D=y.target,M=Math.abs(S)>Math.abs(P)?"h":"v";if("touches"in y&&M==="h"&&D.type==="range")return!1;var L=Gw(M,D);if(!L)return!0;if(L?_=M:(_=M==="v"?"h":"v",L=Gw(M,D)),!L)return!1;if(!n.current&&"changedTouches"in y&&(S||P)&&(n.current=_),!_)return!0;var z=n.current||_;return RL(z,w,y,z==="h"?S:P,!0)},[]),l=p.useCallback(function(y){var w=y;if(!(!wa.length||wa[wa.length-1]!==s)){var x="deltaY"in w?Kw(w):Nu(w),b=e.current.filter(function(_){return _.name===w.type&&_.target===w.target&&TL(_.delta,x)})[0];if(b&&b.should){w.cancelable&&w.preventDefault();return}if(!b){var S=(o.current.shards||[]).map(Qw).filter(Boolean).filter(function(_){return _.contains(w.target)}),P=S.length>0?a(w,S[0]):!o.current.noIsolation;P&&w.cancelable&&w.preventDefault()}}},[]),c=p.useCallback(function(y,w,x,b){var S={name:y,delta:w,target:x,should:b};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(P){return P!==S})},1)},[]),f=p.useCallback(function(y){r.current=Nu(y),n.current=void 0},[]),u=p.useCallback(function(y){c(y.type,Kw(y),y.target,a(y,t.lockRef.current))},[]),d=p.useCallback(function(y){c(y.type,Nu(y),y.target,a(y,t.lockRef.current))},[]);p.useEffect(function(){return wa.push(s),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",l,ba),document.addEventListener("touchmove",l,ba),document.addEventListener("touchstart",f,ba),function(){wa=wa.filter(function(y){return y!==s}),document.removeEventListener("wheel",l,ba),document.removeEventListener("touchmove",l,ba),document.removeEventListener("touchstart",f,ba)}},[]);var v=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:ML(i)}):null,v?p.createElement(wL,{gapMode:"margin"}):null)}const OL=cL(RS,_L);var ng=p.forwardRef(function(t,e){return p.createElement(o0,Ri({},t,{ref:e,sideCar:OL}))});ng.classNames=o0.classNames;const NL=["Enter"," "],a0="Menu",[DL,Gee,LL]=n0(a0),[ha,OS]=qr(a0,[LL,_l,Ol]);_l();const jL=Ol();ha(a0);const[Kee,BL]=ha(a0),$L="MenuPortal";ha($L,{forceMount:void 0});const FL="MenuContent",[Qee,NS]=ha(FL),Fy="MenuItem",Yw="menu.itemSelect",DS=p.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=p.useRef(null),o=BL(Fy,t.__scopeMenu),a=NS(Fy,t.__scopeMenu),l=It(e,s),c=p.useRef(!1),f=()=>{const u=s.current;if(!r&&u){const d=new CustomEvent(Yw,{bubbles:!0,cancelable:!0});u.addEventListener(Yw,v=>n==null?void 0:n(v),{once:!0}),qm(u,d),d.defaultPrevented?c.current=!1:o.onClose()}};return p.createElement(UL,Re({},i,{ref:l,disabled:r,onClick:Ce(t.onClick,f),onPointerDown:u=>{var d;(d=t.onPointerDown)===null||d===void 0||d.call(t,u),c.current=!0},onPointerUp:Ce(t.onPointerUp,u=>{var d;c.current||(d=u.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Ce(t.onKeyDown,u=>{const d=a.searchRef.current!=="";r||d&&u.key===" "||NL.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})}))}),UL=p.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=NS(Fy,r),a=jL(r),l=p.useRef(null),c=It(e,l),[f,u]=p.useState(!1),[d,v]=p.useState("");return p.useEffect(()=>{const g=l.current;if(g){var y;v(((y=g.textContent)!==null&&y!==void 0?y:"").trim())}},[s.children]),p.createElement(DL.ItemSlot,{scope:r,disabled:n,textValue:i??d},p.createElement(AS,Re({asChild:!0},a,{focusable:!n}),p.createElement(Xe.div,Re({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},s,{ref:c,onPointerMove:Ce(t.onPointerMove,Jw(g=>{n?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus())})),onPointerLeave:Ce(t.onPointerLeave,Jw(g=>o.onItemLeave(g))),onFocus:Ce(t.onFocus,()=>u(!0)),onBlur:Ce(t.onBlur,()=>u(!1))}))))}),zL=p.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return p.createElement(jS,{scope:t.__scopeMenu,checked:r},p.createElement(DS,Re({role:"menuitemcheckbox","aria-checked":oh(r)?"mixed":r},i,{ref:e,"data-state":ig(r),onSelect:Ce(i.onSelect,()=>n==null?void 0:n(oh(r)?!0:!r),{checkForDefaultPrevented:!1})})))}),VL="MenuRadioGroup",[Yee,qL]=ha(VL,{value:void 0,onValueChange:()=>{}}),HL="MenuRadioItem",WL=p.forwardRef((t,e)=>{const{value:r,...n}=t,i=qL(HL,t.__scopeMenu),s=r===i.value;return p.createElement(jS,{scope:t.__scopeMenu,checked:s},p.createElement(DS,Re({role:"menuitemradio","aria-checked":s},n,{ref:e,"data-state":ig(s),onSelect:Ce(n.onSelect,()=>{var o;return(o=i.onValueChange)===null||o===void 0?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})))}),LS="MenuItemIndicator",[jS,GL]=ha(LS,{checked:!1}),KL=p.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=GL(LS,r);return p.createElement(wo,{present:n||oh(s.checked)||s.checked===!0},p.createElement(Xe.span,Re({},i,{ref:e,"data-state":ig(s.checked)})))}),QL="MenuSub";ha(QL);function oh(t){return t==="indeterminate"}function ig(t){return oh(t)?"indeterminate":t?"checked":"unchecked"}function Jw(t){return e=>e.pointerType==="mouse"?t(e):void 0}const YL=zL,JL=WL,XL=KL,BS="DropdownMenu",[ZL,Jee]=qr(BS,[OS]),sg=OS();ZL(BS);const ej=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=sg(r);return p.createElement(YL,Re({},i,n,{ref:e}))}),tj=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=sg(r);return p.createElement(JL,Re({},i,n,{ref:e}))}),rj=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=sg(r);return p.createElement(XL,Re({},i,n,{ref:e}))}),nj=ej,ij=tj,$S=rj;var FS="_1k2mbvi4 _1k2mbvi3 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1x4 fyvr1yk fyvr1ss fyvr1uo fyvr12ws fyvr12wm fyvr11h0 fyvr11ko fyvr11jw fyvr12v7 fyvr11n4 fyvr11hw fyvr12s7",US="_1k2mbvi5";const sj=({children:t})=>J.jsx($S,{className:US,children:t});p.forwardRef(({className:t,children:e,...r},n)=>J.jsxs(nj,{className:fn(FS,t),...r,ref:n,children:[J.jsx(sj,{children:J.jsx(X8,{size:"xs"})}),J.jsx(Se,{variant:"small",children:e})]}));p.forwardRef(({className:t,children:e,...r},n)=>J.jsxs(ij,{className:fn(FS,t),...r,ref:n,children:[J.jsx($S,{className:US,children:J.jsx(Se,{children:"•"})}),J.jsx(Se,{variant:"small",children:e})]}));const og=p.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return J.jsx(pr,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),oj=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var aj="_1hq71vk1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _1hq71vk0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12np fyvr12gd fyvr121p fyvr1291 fyvr11ko fyvr11hc fyvr11ic fyvr11jc fyvr1g0 fyvr11hw",lj=Qt({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"_1hq71vk6 _1hq71vk2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"_1hq71vk7 _1hq71vk3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"_1hq71vk8 _1hq71vk4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),cj="_1hq71vka _1hq71vk9 fyvr12wp fyvr12wj fyvr11ho fyvr12vj fyvr1ko fyvr1oo fyvr1mo fyvr1qo";const fj={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*, video/*",pdf:".pdf,application/pdf",mp4:".mp4,video/mp4"};p.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:l,onValueChange:c,placeholder:f="Upload a file",validExtensions:u,...d}=t,v=p.useRef(null),g=oj(v,e),[y,w]=p.useState(null),x=S=>{const P=S.currentTarget.files;if(!P||!P[0])return;const _=P[0],D=_.name,M=_.size/1e3;w({name:D,size:M,extension:D.split(".").pop()??""}),c==null||c(_)},b=u.map(S=>fj[S]).join(",");return J.jsx(Tl,{description:n,disabled:i,display:"grid",id:s??l,label:o,labelLocation:a,children:J.jsxs(re,{width:"full",minWidth:"0",justifyContent:y?"space-between":"flex-start",gap:"2",color:y?"text100":"text50",className:fn(aj,lj({borderRadius:r})),children:[y?J.jsxs(re,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[J.jsx(Se,{ellipsis:!0,children:y.name}),J.jsxs(Se,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[y.size.toFixed(2)," kb"]})]}):J.jsx(Se,{ellipsis:!0,children:f}),J.jsx(re,{accept:b,as:"input",className:cj,cursor:"pointer",disabled:i,id:s??l,name:l,onChange:x,ref:g,type:"file",...d}),y&&J.jsx(og,{cursor:"pointer",icon:Hm,size:"xs",onClick:S=>{var P;S.preventDefault(),S.stopPropagation(),(P=v.current)!=null&&P.value&&(v.current.value=""),c==null||c(null),w(null)},zIndex:"10"})]})})});var uj=Qt({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const Uy=1e3,tl=64,D1=tl/2,L1=(t,e=Uy)=>t%e/(Uy/tl),_o=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},dj=(t,e,r)=>{const n=Math.random().toString(36).slice(2,12),i=t%360,s=(t+120)%360,o=r%360;return{id:_o(n),a:`hsl(${i}deg 100% 40%)`,b:`hsl(${s}deg 100% 50%)`,c:`hsl(${o}deg 100% 50%)`}},hj=(t,e)=>{const r=[];for(let n=0;n{const s=tl/10+L1(n.r,Uy*1.5/(i+1));return{...dj(n.a,n.b,n.c),x:L1(n.x),y:L1(n.y),r:s}})};p.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=hj(r,i);return J.jsxs(re,{as:"svg",className:fn(e,uj({size:n})),viewBox:`0 0 ${tl} ${tl}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[J.jsxs("defs",{children:[J.jsx("clipPath",{id:"circle-clip",children:J.jsx("circle",{cx:D1,cy:D1,r:D1})}),J.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[J.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),J.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),J.jsx("feGaussianBlur",{stdDeviation:tl/10,result:"effect1_foregroundBlur"})]}),J.jsxs("linearGradient",{id:`gradient-background-${o[0].id}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[J.jsx("stop",{offset:"0",stopColor:o[0].c}),J.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map(a=>J.jsxs(p.Fragment,{children:[J.jsxs("radialGradient",{id:`gradient-primary-${a.id}`,children:[J.jsx("stop",{offset:"0",stopColor:a.a}),J.jsx("stop",{offset:"1",stopColor:a.b})]}),J.jsxs("radialGradient",{id:`gradient-secondary-${a.id}`,children:[J.jsx("stop",{offset:"0",stopColor:a.c}),J.jsx("stop",{offset:"1",stopColor:a.b})]})]},a.id))]}),J.jsxs("g",{clipPath:"url(#circle-clip)",children:[J.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${o[0].id})`}),J.jsx("g",{filter:"url(#blur)",children:o.map(a=>J.jsxs(p.Fragment,{children:[J.jsx("circle",{fill:`url(#gradient-primary-${a.id})`,cx:a.x,cy:a.y,r:a.r}),J.jsx("circle",{fill:`url(#gradient-secondary-${a.id})`,cx:a.y,cy:a.x,r:a.r/2})]},a.id))})]})]})});const vj=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=p.useState(!1),o=a=>{s(!0),r==null||r(a)};return J.jsx(re,{as:Za.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})},zS="Dialog",[VS,Xee]=qr(zS),[yj,Eo]=VS(zS),pj=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=p.useRef(null),l=p.useRef(null),[c=!1,f]=ea({prop:n,defaultProp:i,onChange:s});return p.createElement(yj,{scope:e,triggerRef:a,contentRef:l,contentId:ro(),titleId:ro(),descriptionId:ro(),open:c,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(u=>!u),[f]),modal:o},r)},qS="DialogPortal",[mj,HS]=VS(qS,{forceMount:void 0}),gj=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Eo(qS,e);return p.createElement(mj,{scope:e,forceMount:r},p.Children.map(n,o=>p.createElement(wo,{present:r||s.open},p.createElement(bS,{asChild:!0,container:i},o))))},zy="DialogOverlay",xj=p.forwardRef((t,e)=>{const r=HS(zy,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Eo(zy,t.__scopeDialog);return s.modal?p.createElement(wo,{present:n||s.open},p.createElement(bj,Re({},i,{ref:e}))):null}),bj=p.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Eo(zy,r);return p.createElement(ng,{as:ml,allowPinchZoom:!0,shards:[i.contentRef]},p.createElement(Xe.div,Re({"data-state":GS(i.open)},n,{ref:e,style:{pointerEvents:"auto",...n.style}})))}),Cf="DialogContent",wj=p.forwardRef((t,e)=>{const r=HS(Cf,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Eo(Cf,t.__scopeDialog);return p.createElement(wo,{present:n||s.open},s.modal?p.createElement(Ej,Re({},i,{ref:e})):p.createElement(Aj,Re({},i,{ref:e})))}),Ej=p.forwardRef((t,e)=>{const r=Eo(Cf,t.__scopeDialog),n=p.useRef(null),i=It(e,r.contentRef,n);return p.useEffect(()=>{const s=n.current;if(s)return CS(s)},[]),p.createElement(WS,Re({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Ce(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Ce(t.onFocusOutside,s=>s.preventDefault())}))}),Aj=p.forwardRef((t,e)=>{const r=Eo(Cf,t.__scopeDialog),n=p.useRef(!1),i=p.useRef(!1);return p.createElement(WS,Re({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),WS=p.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Eo(Cf,r),l=p.useRef(null),c=It(e,l);return nS(),p.createElement(p.Fragment,null,p.createElement(iS,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},p.createElement(Qm,Re({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":GS(a.open)},o,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Sj="DialogClose",Cj=p.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Eo(Sj,r);return p.createElement(Xe.button,Re({type:"button"},n,{ref:e,onClick:Ce(t.onClick,()=>i.onOpenChange(!1))}))});function GS(t){return t?"open":"closed"}const kj=pj,Pj=gj,Rj=xj,Tj=wj,Mj=Cj;var Ij=Qt({defaultClassName:"_1vqx0w91 _1vqx0w90 fyvr128 fyvr15o",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]}),_j=Qt({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]});const Oj=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return J.jsx(re,{className:_j({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:J.jsx(re,{className:Ij({direction:n}),background:"backgroundPrimary",...i,children:e})})};function Nj(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function Dj(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function KS(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.constructor();for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=KS(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function Xw(t,e,r){t.style.setProperty(Nj(e),r)}function Zw(t,e,r){if(typeof r=="object"){var n=e;KS(r,(a,l)=>{a!=null&&Xw(t,Dj(n,l),String(a))})}else{var i=e;for(var s in i){var o=i[s];o!=null&&Xw(t,s,i[s])}}}const ag=["dark","light"],QS="dark",Lj="data-theme",e3="@sequence.theme",jj=t=>ag.includes(t),Bj=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),YS=t=>t?`${e3}.${t}`:e3,$j=t=>{const e=localStorage.getItem(YS(t));return e&&ag.includes(e)?e:QS},JS=p.createContext(null),Fj=t=>{const[e,r]=p.useState(t.theme||QS);p.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),p.useEffect(()=>{t.theme||r($j(t.scope))},[t.theme,t.scope]),p.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),p.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(jj(e)?(i.setAttribute(Lj,e),Zw(i,Sw,{colors:AO[e]})):Bj(e)&&Zw(i,Sw,{colors:e}))},[e,t.root]);const n=p.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{ag.includes(i)&&(localStorage.setItem(YS(t.scope),i),r(i))}}),[e,t.root,t.scope]);return J.jsx(JS.Provider,{value:n,children:t.children})},XS=()=>{const t=p.useContext(JS);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var Uj="_5b32m91 _5b32m90 fyvr11jg fyvr11ko fyvr11h0 fyvr11hs fyvr11nk fyvr1ko fyvr1oo fyvr1qo fyvr1mo",zj="_5b32m93 _5b32m92 fyvr11hs fyvr1ko fyvr1oo fyvr1qo fyvr1mo",Vj=Qt({defaultClassName:"_5b32m95 _5b32m94 fyvr11d8 fyvr11dw fyvr11bg fyvr11by fyvr11c4 fyvr11cm fyvr11ls fyvr11m8 fyvr12ws fyvr12wm fyvr11h0 fyvr11i4 fyvr11hs fyvr11sd fyvr1mo fyvr1om",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),qj="_5b32m9b _5b32m9a fyvr110o fyvr112o fyvr114o fyvr116o fyvr11ho fyvr1qo fyvr1ko fyvr11nk";const Hj=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:l="lg",overlayProps:c,contentProps:f}=t,{root:u}=XS(),[d,v]=p.useState(null);return p.useEffect(()=>{v(document.querySelector(u||"body"))},[u]),d?J.jsx(kj,{modal:!0,defaultOpen:!0,onOpenChange:o,children:J.jsx(Pj,{forceMount:!0,container:d,children:J.jsxs(re,{className:Uj,children:[J.jsx(re,{as:Rj,asChild:!0,background:r,className:zj,forceMount:!0,children:J.jsx(Za.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...c},"modal-overlay")}),J.jsx(Tj,{asChild:!0,className:Vj({autoHeight:e,size:l}),forceMount:!0,onEscapeKeyDown:g=>{s?o==null||o():g.preventDefault()},onInteractOutside:g=>{s||g.preventDefault()},children:J.jsxs(Za.div,{initial:i?!1:{y:"100%",opacity:l==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:l==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...f,children:[a?J.jsx(Oj,{children:n}):n,s&&J.jsx(Mj,{asChild:!0,children:J.jsx(og,{icon:Hm,backdropFilter:"blur",size:"xs",className:qj,"aria-label":"Close"})})]},"modal-content")})]})})}):null};var Wj="_1acm19y1 _1acm19y0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1ww fyvr1ys fyvr11hc fyvr11ko fyvr11od fyvr12s1 fyvr1g0 fyvr118g",Gj=Qt({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"_1acm19y6 _1acm19y2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"_1acm19y7 _1acm19y3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"_1acm19y8 _1acm19y4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),Kj=Qt({defaultClassName:"_1acm19ya _1acm19y9 fyvr1wg fyvr1yc fyvr1t4 fyvr1v0 fyvr12wp fyvr12wj fyvr11gw fyvr11od fyvr12s1 fyvr12o1 fyvr128 fyvr15o",variantClassNames:{numeric:{false:"_1acm19yb _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",true:"_1acm19yc _1qxj1ib9 _1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8"}},defaultVariants:{},compoundVariants:[]});const Pr=p.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:l="",labelLocation:c="hidden",leftIcon:f,rightIcon:u,name:d,controls:v,type:g="text",numeric:y=!1,...w}=t;return J.jsx(Tl,{description:s,disabled:o,display:"grid",id:a??d,label:l,labelLocation:c,children:J.jsx(re,{width:"full",children:J.jsxs(re,{className:fn(Wj,Gj({borderRadius:i})),children:[f&&J.jsx(f,{size:"sm"}),J.jsx(re,{as:r,autoComplete:n,spellCheck:"false",className:Kj({numeric:y}),disabled:o,id:a??d,name:d,ref:e,type:g,...w}),u&&J.jsx(u,{size:"sm"}),v]})})})}),Qj=RegExp("^\\d*(?:\\\\[.])?\\d*$");function Yj(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}p.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=c=>{let{value:f}=c.target;f=f.replace(/,/g,"."),f.startsWith(".")&&(f="0"+f),f.startsWith("0")&&(f=f.replace(/^0+(?=\d)/,"")),(f===""||Qj.test(Yj(f)))&&(i==null||i({...c,target:{...c.target,value:f}}))},l=c=>{const{value:f}=c.target;let u=f;u.endsWith(".")&&(u=u.slice(0,-1)),u.endsWith(".0")&&(u=u.slice(0,-2)),u==="0"&&(u=""),s==null||s(c),u!==f&&(i==null||i({...c,target:{...c.target,value:u}}))};return J.jsx(Pr,{name:r,onChange:a,onBlur:l,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});Qt({defaultClassName:"_1jujggt1",variantClassNames:{size:{sm:"_1jujggt2",normal:"_1jujggt3",md:"_1jujggt4",lg:"_1jujggt5",xl:"_1jujggt6"}},defaultVariants:{},compoundVariants:[]});const ZS="Progress",l0=100,[Jj,Zee]=qr(ZS),[Xj,ete]=Jj(ZS),Zj=p.forwardRef((t,e)=>{const{__scopeProgress:r,value:n,max:i,getValueLabel:s=eB,...o}=t,a=Vy(i)?i:l0,l=eC(n,a)?n:null,c=ah(l)?s(l,a):void 0;return p.createElement(Xj,{scope:r,value:l,max:a},p.createElement(Xe.div,Kt({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":ah(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":tB(l,a),"data-value":l??void 0,"data-max":a},o,{ref:e})))});Zj.propTypes={max(t,e,r){const n=t[e],i=String(n);return n&&!Vy(n)?new Error(rB(i,r)):null},value(t,e,r){const n=t[e],i=String(n),s=Vy(t.max)?t.max:l0;return n!=null&&!eC(n,s)?new Error(nB(i,r)):null}};function eB(t,e){return`${Math.round(t/e*100)}%`}function tB(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function ah(t){return typeof t=="number"}function Vy(t){return ah(t)&&!isNaN(t)&&t>0}function eC(t,e){return ah(t)&&!isNaN(t)&&t<=e&&t>=0}function rB(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${l0}\`.`}function nB(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${l0} if no \`max\` prop is set) - \`null\` if the progress is indeterminate. -Defaulting to \`null\`.`}const tC="Radio",[iB,rC]=qr(tC),[sB,oB]=iB(tC),aB=p.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:l,...c}=t,[f,u]=p.useState(null),d=It(e,y=>u(y)),v=p.useRef(!1),g=f?!!f.closest("form"):!0;return p.createElement(sB,{scope:r,checked:i,disabled:o},p.createElement(Xe.button,Kt({type:"button",role:"radio","aria-checked":i,"data-state":nC(i),"data-disabled":o?"":void 0,disabled:o,value:a},c,{ref:d,onClick:Se(t.onClick,y=>{i||l==null||l(),g&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})})),g&&p.createElement(fB,{control:f,bubbles:!v.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}}))}),lB="RadioIndicator",cB=p.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=oB(lB,r);return p.createElement(wo,{present:n||s.checked},p.createElement(Xe.span,Kt({"data-state":nC(s.checked),"data-disabled":s.disabled?"":void 0},i,{ref:e})))}),fB=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=p.useRef(null),o=zm(r),a=Vm(e);return p.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(o!==r&&u){const d=new Event("click",{bubbles:n});u.call(l,r),l.dispatchEvent(d)}},[o,r,n]),p.createElement("input",Kt({type:"radio","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function nC(t){return t?"checked":"unchecked"}const uB=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iC="RadioGroup",[dB,tte]=qr(iC,[Ol,rC]),sC=Ol(),oC=rC(),[hB,vB]=dB(iC),yB=p.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:l,dir:c,loop:f=!0,onValueChange:u,...d}=t,v=sC(r),g=Km(c),[y,w]=ea({prop:s,defaultProp:i,onChange:u});return p.createElement(hB,{scope:r,name:n,required:o,disabled:a,value:y,onValueChange:w},p.createElement(YD,Kt({asChild:!0},v,{orientation:l,dir:g,loop:f}),p.createElement(Xe.div,Kt({role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":a?"":void 0,dir:g},d,{ref:e}))))}),pB="RadioGroupItem",mB=p.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=vB(pB,r),o=s.disabled||n,a=sC(r),l=oC(r),c=p.useRef(null),f=It(e,c),u=s.value===i.value,d=p.useRef(!1);return p.useEffect(()=>{const v=y=>{uB.includes(y.key)&&(d.current=!0)},g=()=>d.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",g)}},[]),p.createElement(AS,Kt({asChild:!0},a,{focusable:!o,active:u}),p.createElement(aB,Kt({disabled:o,required:s.required,checked:u},l,i,{name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:Se(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:Se(i.onFocus,()=>{var v;d.current&&((v=c.current)===null||v===void 0||v.click())})})))}),gB=p.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=oC(r);return p.createElement(cB,Kt({},i,n,{ref:e}))}),xB=yB,bB=mB,wB=gB;var EB=Qt({defaultClassName:"io59uy3 io59uy0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1so fyvr1uk fyvr1wg fyvr1yc fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11od fyvr12v7 fyvr12v3 fyvr12vz fyvr12vr _4efw240",variantClassNames:{size:{sm:"io59uy4 io59uy1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8",lg:"io59uy5 io59uy2 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc"}},defaultVariants:{},compoundVariants:[]}),AB=Qt({defaultClassName:"io59uy8 io59uy7 io59uy6 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12s1",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]});const SB=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return J.jsx(re,{alignItems:"center",children:J.jsx(Tl,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:J.jsx(bB,{className:EB({size:n}),value:i,id:e,disabled:s,children:J.jsx(wB,{className:AB({size:n})})})})})};p.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...l}=t;return J.jsx(xB,{disabled:n,name:s,ref:e,...l,children:J.jsx(re,{flexDirection:r,gap:i,children:o.map(({label:c,value:f,disabled:u})=>J.jsx(SB,{id:`${s}-${f}`,label:c,size:a,value:f,disabled:u},f))})})});function t3(t,[e,r]){return Math.min(r,Math.max(e,t))}const aC=p.forwardRef((t,e)=>p.createElement(Xe.span,Re({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),CB=[" ","Enter","ArrowUp","ArrowDown"],kB=[" ","Enter"],c0="Select",[f0,lg,PB]=n0(c0),[Nl,rte]=qr(c0,[PB,_l]),cg=_l(),[RB,va]=Nl(c0),[TB,MB]=Nl(c0),IB=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:d,required:v}=t,g=cg(e),[y,w]=p.useState(null),[x,b]=p.useState(null),[S,P]=p.useState(!1),_=Km(c),[D=!1,M]=ea({prop:n,defaultProp:i,onChange:s}),[L,z]=ea({prop:o,defaultProp:a,onChange:l}),H=p.useRef(null),Y=y?!!y.closest("form"):!0,[Z,O]=p.useState(new Set),h=Array.from(Z).map(A=>A.props.value).join(";");return p.createElement(ND,g,p.createElement(RB,{required:v,scope:e,trigger:y,onTriggerChange:w,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:P,contentId:ro(),value:L,onValueChange:z,open:D,onOpenChange:M,dir:_,triggerPointerDownPosRef:H,disabled:d},p.createElement(f0.Provider,{scope:e},p.createElement(TB,{scope:t.__scopeSelect,onNativeOptionAdd:p.useCallback(A=>{O(k=>new Set(k).add(A))},[]),onNativeOptionRemove:p.useCallback(A=>{O(k=>{const I=new Set(k);return I.delete(A),I})},[])},r)),Y?p.createElement(fC,{key:h,"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:u,value:L,onChange:A=>z(A.target.value),disabled:d},L===void 0?p.createElement("option",{value:""}):null,Array.from(Z)):null))},_B="SelectTrigger",OB=p.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=cg(r),o=va(_B,r),a=o.disabled||n,l=It(e,o.onTriggerChange),c=lg(r),[f,u,d]=uC(g=>{const y=c().filter(b=>!b.disabled),w=y.find(b=>b.value===o.value),x=dC(y,g,w);x!==void 0&&o.onValueChange(x.value)}),v=()=>{a||(o.onOpenChange(!0),d())};return p.createElement(DD,Re({asChild:!0},s),p.createElement(Xe.button,Re({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":cC(o.value)?"":void 0},i,{ref:l,onClick:Se(i.onClick,g=>{g.currentTarget.focus()}),onPointerDown:Se(i.onPointerDown,g=>{const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(v(),o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)},g.preventDefault())}),onKeyDown:Se(i.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&u(g.key),!(y&&g.key===" ")&&CB.includes(g.key)&&(v(),g.preventDefault())})})))}),NB="SelectValue",DB=p.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,l=va(NB,r),{onValueNodeHasChildrenChange:c}=l,f=s!==void 0,u=It(e,l.onValueNodeChange);return kn(()=>{c(f)},[c,f]),p.createElement(Xe.span,Re({},a,{ref:u,style:{pointerEvents:"none"}}),cC(l.value)?p.createElement(p.Fragment,null,o):s)}),LB=p.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return p.createElement(Xe.span,Re({"aria-hidden":!0},i,{ref:e}),n||"▼")}),xl="SelectContent",jB=p.forwardRef((t,e)=>{const r=va(xl,t.__scopeSelect),[n,i]=p.useState();if(kn(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?ks.createPortal(p.createElement(lC,{scope:t.__scopeSelect},p.createElement(f0.Slot,{scope:t.__scopeSelect},p.createElement("div",null,t.children))),s):null}return p.createElement(BB,Re({},t,{ref:e}))}),Zi=10,[lC,u0]=Nl(xl),BB=p.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:v,sticky:g,hideWhenDetached:y,avoidCollisions:w,...x}=t,b=va(xl,r),[S,P]=p.useState(null),[_,D]=p.useState(null),M=It(e,V=>P(V)),[L,z]=p.useState(null),[H,Y]=p.useState(null),Z=lg(r),[O,h]=p.useState(!1),A=p.useRef(!1);p.useEffect(()=>{if(S)return CS(S)},[S]),nS();const k=p.useCallback(V=>{const[q,...K]=Z().map(te=>te.ref.current),[oe]=K.slice(-1),ee=document.activeElement;for(const te of V)if(te===ee||(te==null||te.scrollIntoView({block:"nearest"}),te===q&&_&&(_.scrollTop=0),te===oe&&_&&(_.scrollTop=_.scrollHeight),te==null||te.focus(),document.activeElement!==ee))return},[Z,_]),I=p.useCallback(()=>k([L,S]),[k,L,S]);p.useEffect(()=>{O&&I()},[O,I]);const{onOpenChange:R,triggerPointerDownPosRef:N}=b;p.useEffect(()=>{if(S){let V={x:0,y:0};const q=oe=>{var ee,te,Ie,ue;V={x:Math.abs(Math.round(oe.pageX)-((ee=(te=N.current)===null||te===void 0?void 0:te.x)!==null&&ee!==void 0?ee:0)),y:Math.abs(Math.round(oe.pageY)-((Ie=(ue=N.current)===null||ue===void 0?void 0:ue.y)!==null&&Ie!==void 0?Ie:0))}},K=oe=>{V.x<=10&&V.y<=10?oe.preventDefault():S.contains(oe.target)||R(!1),document.removeEventListener("pointermove",q),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",K,{capture:!0})}}},[S,R,N]),p.useEffect(()=>{const V=()=>R(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[R]);const[j,C]=uC(V=>{const q=Z().filter(ee=>!ee.disabled),K=q.find(ee=>ee.ref.current===document.activeElement),oe=dC(q,V,K);oe&&setTimeout(()=>oe.ref.current.focus())}),m=p.useCallback((V,q,K)=>{const oe=!A.current&&!K;(b.value!==void 0&&b.value===q||oe)&&(z(V),oe&&(A.current=!0))},[b.value]),T=p.useCallback(()=>S==null?void 0:S.focus(),[S]),F=p.useCallback((V,q,K)=>{const oe=!A.current&&!K;(b.value!==void 0&&b.value===q||oe)&&Y(V)},[b.value]),E=n==="popper"?r3:$B,B=E===r3?{side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:v,sticky:g,hideWhenDetached:y,avoidCollisions:w}:{};return p.createElement(lC,{scope:r,content:S,viewport:_,onViewportChange:D,itemRefCallback:m,selectedItem:L,onItemLeave:T,itemTextRefCallback:F,focusSelectedItem:I,selectedItemText:H,position:n,isPositioned:O,searchRef:j},p.createElement(ng,{as:ml,allowPinchZoom:!0},p.createElement(iS,{asChild:!0,trapped:b.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:Se(i,V=>{var q;(q=b.trigger)===null||q===void 0||q.focus({preventScroll:!0}),V.preventDefault()})},p.createElement(Qm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>b.onOpenChange(!1)},p.createElement(E,Re({role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:V=>V.preventDefault()},x,B,{onPlaced:()=>h(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Se(x.onKeyDown,V=>{const q=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!q&&V.key.length===1&&C(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let oe=Z().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(V.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const ee=V.target,te=oe.indexOf(ee);oe=oe.slice(te+1)}setTimeout(()=>k(oe)),V.preventDefault()}})}))))))}),$B=p.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=va(xl,r),o=u0(xl,r),[a,l]=p.useState(null),[c,f]=p.useState(null),u=It(e,M=>f(M)),d=lg(r),v=p.useRef(!1),g=p.useRef(!0),{viewport:y,selectedItem:w,selectedItemText:x,focusSelectedItem:b}=o,S=p.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&c&&y&&w&&x){const M=s.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),z=s.valueNode.getBoundingClientRect(),H=x.getBoundingClientRect();if(s.dir!=="rtl"){const ee=H.left-L.left,te=z.left-ee,Ie=M.left-te,ue=M.width+Ie,we=Math.max(ue,L.width),zt=window.innerWidth-Zi,Ve=t3(te,[Zi,zt-we]);a.style.minWidth=ue+"px",a.style.left=Ve+"px"}else{const ee=L.right-H.right,te=window.innerWidth-z.right-ee,Ie=window.innerWidth-M.right-te,ue=M.width+Ie,we=Math.max(ue,L.width),zt=window.innerWidth-Zi,Ve=t3(te,[Zi,zt-we]);a.style.minWidth=ue+"px",a.style.right=Ve+"px"}const Y=d(),Z=window.innerHeight-Zi*2,O=y.scrollHeight,h=window.getComputedStyle(c),A=parseInt(h.borderTopWidth,10),k=parseInt(h.paddingTop,10),I=parseInt(h.borderBottomWidth,10),R=parseInt(h.paddingBottom,10),N=A+k+O+R+I,j=Math.min(w.offsetHeight*5,N),C=window.getComputedStyle(y),m=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),F=M.top+M.height/2-Zi,E=Z-F,B=w.offsetHeight/2,V=w.offsetTop+B,q=A+k+V,K=N-q;if(q<=F){const ee=w===Y[Y.length-1].ref.current;a.style.bottom="0px";const te=c.clientHeight-y.offsetTop-y.offsetHeight,Ie=Math.max(E,B+(ee?T:0)+te+I),ue=q+Ie;a.style.height=ue+"px"}else{const ee=w===Y[0].ref.current;a.style.top="0px";const Ie=Math.max(F,A+y.offsetTop+(ee?m:0)+B)+K;a.style.height=Ie+"px",y.scrollTop=q-F+y.offsetTop}a.style.margin=`${Zi}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=Z+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[d,s.trigger,s.valueNode,a,c,y,w,x,s.dir,n]);kn(()=>S(),[S]);const[P,_]=p.useState();kn(()=>{c&&_(window.getComputedStyle(c).zIndex)},[c]);const D=p.useCallback(M=>{M&&g.current===!0&&(S(),b==null||b(),g.current=!1)},[S,b]);return p.createElement(FB,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:v,onScrollButtonChange:D},p.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},p.createElement(Xe.div,Re({},i,{ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),r3=p.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Zi,...s}=t,o=cg(r);return p.createElement(LD,Re({},o,s,{ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[FB,UB]=Nl(xl,{}),n3="SelectViewport",zB=p.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=u0(n3,r),s=UB(n3,r),o=It(e,i.onViewportChange),a=p.useRef(0);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(f0.Slot,{scope:r},p.createElement(Xe.div,Re({"data-radix-select-viewport":"",role:"presentation"},n,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Se(n.onScroll,l=>{const c=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:u}=s;if(u!=null&&u.current&&f){const d=Math.abs(a.current-c.scrollTop);if(d>0){const v=window.innerHeight-Zi*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),w=Math.max(g,y);if(w0?S:0,f.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),VB="SelectGroup",[qB,nte]=Nl(VB),HB=p.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=ro();return p.createElement(qB,{scope:r,id:i},p.createElement(Xe.div,Re({role:"group","aria-labelledby":i},n,{ref:e})))}),qy="SelectItem",[WB,GB]=Nl(qy),KB=p.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=va(qy,r),l=u0(qy,r),c=a.value===n,[f,u]=p.useState(s??""),[d,v]=p.useState(!1),g=It(e,x=>{var b;return(b=l.itemRefCallback)===null||b===void 0?void 0:b.call(l,x,n,i)}),y=ro(),w=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.createElement(WB,{scope:r,value:n,disabled:i,textId:y,isSelected:c,onItemTextChange:p.useCallback(x=>{u(b=>{var S;return b||((S=x==null?void 0:x.textContent)!==null&&S!==void 0?S:"").trim()})},[])},p.createElement(f0.ItemSlot,{scope:r,value:n,disabled:i,textValue:f},p.createElement(Xe.div,Re({role:"option","aria-labelledby":y,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:g,onFocus:Se(o.onFocus,()=>v(!0)),onBlur:Se(o.onBlur,()=>v(!1)),onPointerUp:Se(o.onPointerUp,w),onPointerMove:Se(o.onPointerMove,x=>{if(i){var b;(b=l.onItemLeave)===null||b===void 0||b.call(l)}else x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(o.onPointerLeave,x=>{if(x.currentTarget===document.activeElement){var b;(b=l.onItemLeave)===null||b===void 0||b.call(l)}}),onKeyDown:Se(o.onKeyDown,x=>{var b;((b=l.searchRef)===null||b===void 0?void 0:b.current)!==""&&x.key===" "||(kB.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})}))))}),Du="SelectItemText",QB=p.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=va(Du,r),a=u0(Du,r),l=GB(Du,r),c=MB(Du,r),[f,u]=p.useState(null),d=It(e,x=>u(x),l.onItemTextChange,x=>{var b;return(b=a.itemTextRefCallback)===null||b===void 0?void 0:b.call(a,x,l.value,l.disabled)}),v=f==null?void 0:f.textContent,g=p.useMemo(()=>p.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},v),[l.disabled,l.value,v]),{onNativeOptionAdd:y,onNativeOptionRemove:w}=c;return kn(()=>(y(g),()=>w(g)),[y,w,g]),p.createElement(p.Fragment,null,p.createElement(Xe.span,Re({id:l.textId},s,{ref:d})),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ks.createPortal(s.children,o.valueNode):null)});function cC(t){return t===""||t===void 0}const fC=p.forwardRef((t,e)=>{const{value:r,...n}=t,i=p.useRef(null),s=It(e,i),o=zm(r);return p.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==r&&f){const u=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(u)}},[o,r]),p.createElement(aC,{asChild:!0},p.createElement("select",Re({},n,{ref:s,defaultValue:r})))});fC.displayName="BubbleSelect";function uC(t){const e=Hn(t),r=p.useRef(""),n=p.useRef(0),i=p.useCallback(o=>{const a=r.current+o;e(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),s=p.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function dC(t,e,r){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=YB(t,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==r));const l=o.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function YB(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const JB=IB,XB=OB,ZB=DB,e$=LB,t$=jB,r$=zB,n$=HB,i$=KB,s$=QB;var o$="gohwum1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 gohwum0 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11od fyvr11hc fyvr11f4 fyvr12s1 fyvr118c fyvr11jw fyvr11n4 fyvr12v7 fyvr12o1",a$=Qt({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"gohwum6 gohwum2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"gohwum7 gohwum3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"gohwum8 gohwum4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),l$="gohwuma gohwum9 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ls fyvr11m8 fyvr11ms fyvr11tv fyvr12s1 fyvr11nl",c$="gohwume _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 gohwumd fyvr1ww fyvr1ys fyvr1t0 fyvr1uw fyvr12ws fyvr12wt fyvr12wm fyvr12wn fyvr11h0 fyvr11jw fyvr11ko fyvr12v7 fyvr12v3 fyvr12s1 fyvr12w1 fyvr12vr";const f$=p.forwardRef(({children:t,className:e,...r},n)=>J.jsx(i$,{className:fn(c$,e),...r,ref:n,children:J.jsx(s$,{children:t})})),d0=p.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:l,options:c,placeholder:f,...u}=t;return J.jsx(Tl,{disabled:n,display:"grid",id:i??l,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:J.jsxs(JB,{disabled:n,name:l,...u,children:[J.jsxs(XB,{id:i??l,className:fn(o$,a$({borderRadius:r})),ref:e,children:[J.jsx(ZB,{placeholder:f}),J.jsx(re,{as:e$,display:"inline-flex",children:J.jsx(Z8,{})})]}),J.jsx(t$,{className:l$,children:J.jsx(r$,{children:J.jsx(n$,{children:c.map(({value:d,label:v,...g})=>J.jsx(f$,{value:d,...g,children:v},d))})})})]})})});p.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,l=o?J.jsx(og,{icon:Hm,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return J.jsx(Pr,{ref:e,name:s,leftIcon:cN,controls:r||l,placeholder:i,value:o,onChange:c=>n==null?void 0:n(c),...a})});var u$=Qt({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const zi=p.forwardRef((t,e)=>{const{size:r="md",...n}=t;return J.jsx(re,{className:u$({size:r}),color:"text50",ref:e,...n,children:J.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[J.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),J.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});p.forwardRef(({children:t},e)=>J.jsx(re,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));const hC="Switch",[d$,ite]=qr(hC);d$(hC);Qt({defaultClassName:"nwwh3z8",variantClassNames:{variant:{pill:"nwwh3z9",line:"nwwh3za nwwh3z1 fyvr11g0"},active:{true:"nwwh3zb nwwh3z2 fyvr12w5",false:"nwwh3zc"},disabled:{true:"nwwh3zd nwwh3z3 fyvr12vp"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"nwwh3z4 fyvr11u7 fyvr12sj"],[{active:!1,variant:"pill"},"nwwh3z5 fyvr11od fyvr12s7"],[{active:!0,variant:"line"},"nwwh3z6 fyvr12s1"],[{active:!1,variant:"line"},"nwwh3z7 fyvr12s7"]]});const vC="Tabs",[h$,ste]=qr(vC,[Ol]);Ol();h$(vC);var v$="_1ppqbnx1 _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _1ppqbnx0 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1wo fyvr1yk fyvr1ss fyvr1uo fyvr11hc fyvr118c fyvr11n9";p.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return J.jsxs(re,{className:v$,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&J.jsx(r,{size:"xs"}),J.jsx(Pe,{children:n})]})});const y$="ToastProvider",[p$,ote,m$]=n0("Toast"),[yC,ate]=qr("Toast",[m$]),[lte,pC]=yC(y$),i3="toast.viewportPause",s3="toast.viewportResume",h0="Toast",g$="toast.swipeStart",x$="toast.swipeMove",b$="toast.swipeCancel",w$="toast.swipeEnd",[E$,A$]=yC(h0,{onClose(){}}),S$=p.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:f,onSwipeMove:u,onSwipeCancel:d,onSwipeEnd:v,...g}=t,y=pC(h0,r),[w,x]=p.useState(null),b=It(e,h=>x(h)),S=p.useRef(null),P=p.useRef(null),_=i||y.duration,D=p.useRef(0),M=p.useRef(_),L=p.useRef(0),{onToastAdd:z,onToastRemove:H}=y,Y=Hn(()=>{var h;(w==null?void 0:w.contains(document.activeElement))&&((h=y.viewport)===null||h===void 0||h.focus()),o()}),Z=p.useCallback(h=>{!h||h===1/0||(window.clearTimeout(L.current),D.current=new Date().getTime(),L.current=window.setTimeout(Y,h))},[Y]);p.useEffect(()=>{const h=y.viewport;if(h){const A=()=>{Z(M.current),c==null||c()},k=()=>{const I=new Date().getTime()-D.current;M.current=M.current-I,window.clearTimeout(L.current),l==null||l()};return h.addEventListener(i3,k),h.addEventListener(s3,A),()=>{h.removeEventListener(i3,k),h.removeEventListener(s3,A)}}},[y.viewport,_,l,c,Z]),p.useEffect(()=>{s&&!y.isClosePausedRef.current&&Z(_)},[s,_,y.isClosePausedRef,Z]),p.useEffect(()=>(z(),()=>H()),[z,H]);const O=p.useMemo(()=>w?gC(w):null,[w]);return y.viewport?p.createElement(p.Fragment,null,O&&p.createElement(C$,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},O),p.createElement(E$,{scope:r,onClose:Y},ks.createPortal(p.createElement(p$.ItemSlot,{scope:r},p.createElement(LN,{asChild:!0,onEscapeKeyDown:Se(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||Y(),y.isFocusedToastEscapeKeyDownRef.current=!1})},p.createElement(Xe.li,Re({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":y.swipeDirection},g,{ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Se(t.onKeyDown,h=>{h.key==="Escape"&&(a==null||a(h.nativeEvent),h.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,Y()))}),onPointerDown:Se(t.onPointerDown,h=>{h.button===0&&(S.current={x:h.clientX,y:h.clientY})}),onPointerMove:Se(t.onPointerMove,h=>{if(!S.current)return;const A=h.clientX-S.current.x,k=h.clientY-S.current.y,I=!!P.current,R=["left","right"].includes(y.swipeDirection),N=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,j=R?N(0,A):0,C=R?0:N(0,k),m=h.pointerType==="touch"?10:2,T={x:j,y:C},F={originalEvent:h,delta:T};I?(P.current=T,Lu(x$,u,F,{discrete:!1})):o3(T,y.swipeDirection,m)?(P.current=T,Lu(g$,f,F,{discrete:!1}),h.target.setPointerCapture(h.pointerId)):(Math.abs(A)>m||Math.abs(k)>m)&&(S.current=null)}),onPointerUp:Se(t.onPointerUp,h=>{const A=P.current,k=h.target;if(k.hasPointerCapture(h.pointerId)&&k.releasePointerCapture(h.pointerId),P.current=null,S.current=null,A){const I=h.currentTarget,R={originalEvent:h,delta:A};o3(A,y.swipeDirection,y.swipeThreshold)?Lu(w$,v,R,{discrete:!0}):Lu(b$,d,R,{discrete:!0}),I.addEventListener("click",N=>N.preventDefault(),{once:!0})}})})))),y.viewport))):null});S$.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const e=`Invalid prop \`type\` supplied to \`${h0}\`. Expected \`foreground | background\`.`;return new Error(e)}return null}};const C$=t=>{const{__scopeToast:e,children:r,...n}=t,i=pC(h0,e),[s,o]=p.useState(!1),[a,l]=p.useState(!1);return M$(()=>o(!0)),p.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:p.createElement(bS,{asChild:!0},p.createElement(aC,n,s&&p.createElement(p.Fragment,null,i.label," ",r)))},k$="ToastAction",P$=p.forwardRef((t,e)=>{const{altText:r,...n}=t;return r?p.createElement(mC,{altText:r,asChild:!0},p.createElement(T$,Re({},n,{ref:e}))):null});P$.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${k$}\``)}};const R$="ToastClose",T$=p.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=A$(R$,r);return p.createElement(mC,{asChild:!0},p.createElement(Xe.button,Re({type:"button"},n,{ref:e,onClick:Se(t.onClick,i.onClose)})))}),mC=p.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return p.createElement(Xe.div,Re({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:e}))});function gC(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),I$(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...gC(n))}}),e}function Lu(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?qm(i,s):i.dispatchEvent(s)}const o3=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function M$(t=()=>{}){const e=Hn(t);kn(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function I$(t){return t.nodeType===t.ELEMENT_NODE}Qt({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});p.createContext(null);var _$="_15pztn1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _15pztn0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11od fyvr12s1 fyvr12o1 fyvr12wj fyvr128 fyvr11h0",O$="_15pztn2";p.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:l="",labelLocation:c="hidden",name:f,rows:u,resize:d=!1,...v}=t;return J.jsx(Tl,{description:s,disabled:o,display:"grid",id:a??f,label:l,labelLocation:c,children:J.jsx(re,{as:r,autoComplete:n,spellCheck:"false",className:fn(_$,d&&O$),disabled:o,id:a??f,name:f,ref:e,rows:u,borderRadius:i,...v})})});var N$=Qt({defaultClassName:"bnrreb5 bnrreb0 fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11h0",variantClassNames:{size:{xs:"bnrreb6",sm:"bnrreb7",md:"bnrreb8",lg:"bnrreb9",xl:"bnrreba"},borderRadius:{circle:"bnrrebb bnrreb1 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",lg:"bnrrebc bnrreb2 fyvr11d8 fyvr11dw fyvr11bw fyvr11ck",md:"bnrrebd bnrreb3 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg",sm:"bnrrebe bnrreb4 fyvr11d0 fyvr11do fyvr11bo fyvr11cc"}},defaultVariants:{},compoundVariants:[]}),D$="bnrrebf",L$="bnrrebh bnrrebg fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11sj fyvr128 fyvr15o fyvr11h0";const j$=p.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",...l}=t;return J.jsx(re,{className:fn(r,N$({borderRadius:e,size:a})),style:i,flexShrink:"0",...l,children:s?J.jsx(vj,{className:D$,disableAnimation:n,src:s}):J.jsx(Pe,{className:L$,variant:"normal",fontWeight:"medium",color:"text50",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)})})}),[v0,cte]=qr("Tooltip",[_l]);_l();const B$="TooltipProvider";v0(B$);const xC="Tooltip";v0(xC);const $$="TooltipPortal";v0($$,{forceMount:void 0});v0(xC,{isInside:!1});/** - * @remix-run/router v1.16.0 +Defaulting to \`null\`.`}const tC="Radio",[iB,rC]=qr(tC),[sB,oB]=iB(tC),aB=p.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:l,...c}=t,[f,u]=p.useState(null),d=It(e,y=>u(y)),v=p.useRef(!1),g=f?!!f.closest("form"):!0;return p.createElement(sB,{scope:r,checked:i,disabled:o},p.createElement(Xe.button,Kt({type:"button",role:"radio","aria-checked":i,"data-state":nC(i),"data-disabled":o?"":void 0,disabled:o,value:a},c,{ref:d,onClick:Ce(t.onClick,y=>{i||l==null||l(),g&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})})),g&&p.createElement(fB,{control:f,bubbles:!v.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}}))}),lB="RadioIndicator",cB=p.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=oB(lB,r);return p.createElement(wo,{present:n||s.checked},p.createElement(Xe.span,Kt({"data-state":nC(s.checked),"data-disabled":s.disabled?"":void 0},i,{ref:e})))}),fB=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=p.useRef(null),o=zm(r),a=Vm(e);return p.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(o!==r&&u){const d=new Event("click",{bubbles:n});u.call(l,r),l.dispatchEvent(d)}},[o,r,n]),p.createElement("input",Kt({type:"radio","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function nC(t){return t?"checked":"unchecked"}const uB=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iC="RadioGroup",[dB,tte]=qr(iC,[Ol,rC]),sC=Ol(),oC=rC(),[hB,vB]=dB(iC),yB=p.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:l,dir:c,loop:f=!0,onValueChange:u,...d}=t,v=sC(r),g=Km(c),[y,w]=ea({prop:s,defaultProp:i,onChange:u});return p.createElement(hB,{scope:r,name:n,required:o,disabled:a,value:y,onValueChange:w},p.createElement(YD,Kt({asChild:!0},v,{orientation:l,dir:g,loop:f}),p.createElement(Xe.div,Kt({role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":a?"":void 0,dir:g},d,{ref:e}))))}),pB="RadioGroupItem",mB=p.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=vB(pB,r),o=s.disabled||n,a=sC(r),l=oC(r),c=p.useRef(null),f=It(e,c),u=s.value===i.value,d=p.useRef(!1);return p.useEffect(()=>{const v=y=>{uB.includes(y.key)&&(d.current=!0)},g=()=>d.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",g)}},[]),p.createElement(AS,Kt({asChild:!0},a,{focusable:!o,active:u}),p.createElement(aB,Kt({disabled:o,required:s.required,checked:u},l,i,{name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:Ce(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:Ce(i.onFocus,()=>{var v;d.current&&((v=c.current)===null||v===void 0||v.click())})})))}),gB=p.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=oC(r);return p.createElement(cB,Kt({},i,n,{ref:e}))}),xB=yB,bB=mB,wB=gB;var EB=Qt({defaultClassName:"io59uy3 io59uy0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1so fyvr1uk fyvr1wg fyvr1yc fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11od fyvr12v7 fyvr12v3 fyvr12vz fyvr12vr _4efw240",variantClassNames:{size:{sm:"io59uy4 io59uy1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8",lg:"io59uy5 io59uy2 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc"}},defaultVariants:{},compoundVariants:[]}),AB=Qt({defaultClassName:"io59uy8 io59uy7 io59uy6 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12s1",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]});const SB=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return J.jsx(re,{alignItems:"center",children:J.jsx(Tl,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:J.jsx(bB,{className:EB({size:n}),value:i,id:e,disabled:s,children:J.jsx(wB,{className:AB({size:n})})})})})};p.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...l}=t;return J.jsx(xB,{disabled:n,name:s,ref:e,...l,children:J.jsx(re,{flexDirection:r,gap:i,children:o.map(({label:c,value:f,disabled:u})=>J.jsx(SB,{id:`${s}-${f}`,label:c,size:a,value:f,disabled:u},f))})})});function t3(t,[e,r]){return Math.min(r,Math.max(e,t))}const aC=p.forwardRef((t,e)=>p.createElement(Xe.span,Re({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),CB=[" ","Enter","ArrowUp","ArrowDown"],kB=[" ","Enter"],c0="Select",[f0,lg,PB]=n0(c0),[Nl,rte]=qr(c0,[PB,_l]),cg=_l(),[RB,va]=Nl(c0),[TB,MB]=Nl(c0),IB=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:d,required:v}=t,g=cg(e),[y,w]=p.useState(null),[x,b]=p.useState(null),[S,P]=p.useState(!1),_=Km(c),[D=!1,M]=ea({prop:n,defaultProp:i,onChange:s}),[L,z]=ea({prop:o,defaultProp:a,onChange:l}),H=p.useRef(null),Y=y?!!y.closest("form"):!0,[Z,O]=p.useState(new Set),h=Array.from(Z).map(A=>A.props.value).join(";");return p.createElement(ND,g,p.createElement(RB,{required:v,scope:e,trigger:y,onTriggerChange:w,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:P,contentId:ro(),value:L,onValueChange:z,open:D,onOpenChange:M,dir:_,triggerPointerDownPosRef:H,disabled:d},p.createElement(f0.Provider,{scope:e},p.createElement(TB,{scope:t.__scopeSelect,onNativeOptionAdd:p.useCallback(A=>{O(k=>new Set(k).add(A))},[]),onNativeOptionRemove:p.useCallback(A=>{O(k=>{const I=new Set(k);return I.delete(A),I})},[])},r)),Y?p.createElement(fC,{key:h,"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:u,value:L,onChange:A=>z(A.target.value),disabled:d},L===void 0?p.createElement("option",{value:""}):null,Array.from(Z)):null))},_B="SelectTrigger",OB=p.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=cg(r),o=va(_B,r),a=o.disabled||n,l=It(e,o.onTriggerChange),c=lg(r),[f,u,d]=uC(g=>{const y=c().filter(b=>!b.disabled),w=y.find(b=>b.value===o.value),x=dC(y,g,w);x!==void 0&&o.onValueChange(x.value)}),v=()=>{a||(o.onOpenChange(!0),d())};return p.createElement(DD,Re({asChild:!0},s),p.createElement(Xe.button,Re({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":cC(o.value)?"":void 0},i,{ref:l,onClick:Ce(i.onClick,g=>{g.currentTarget.focus()}),onPointerDown:Ce(i.onPointerDown,g=>{const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(v(),o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)},g.preventDefault())}),onKeyDown:Ce(i.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&u(g.key),!(y&&g.key===" ")&&CB.includes(g.key)&&(v(),g.preventDefault())})})))}),NB="SelectValue",DB=p.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,l=va(NB,r),{onValueNodeHasChildrenChange:c}=l,f=s!==void 0,u=It(e,l.onValueNodeChange);return kn(()=>{c(f)},[c,f]),p.createElement(Xe.span,Re({},a,{ref:u,style:{pointerEvents:"none"}}),cC(l.value)?p.createElement(p.Fragment,null,o):s)}),LB=p.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return p.createElement(Xe.span,Re({"aria-hidden":!0},i,{ref:e}),n||"▼")}),xl="SelectContent",jB=p.forwardRef((t,e)=>{const r=va(xl,t.__scopeSelect),[n,i]=p.useState();if(kn(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?ks.createPortal(p.createElement(lC,{scope:t.__scopeSelect},p.createElement(f0.Slot,{scope:t.__scopeSelect},p.createElement("div",null,t.children))),s):null}return p.createElement(BB,Re({},t,{ref:e}))}),Zi=10,[lC,u0]=Nl(xl),BB=p.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:v,sticky:g,hideWhenDetached:y,avoidCollisions:w,...x}=t,b=va(xl,r),[S,P]=p.useState(null),[_,D]=p.useState(null),M=It(e,V=>P(V)),[L,z]=p.useState(null),[H,Y]=p.useState(null),Z=lg(r),[O,h]=p.useState(!1),A=p.useRef(!1);p.useEffect(()=>{if(S)return CS(S)},[S]),nS();const k=p.useCallback(V=>{const[q,...K]=Z().map(te=>te.ref.current),[oe]=K.slice(-1),ee=document.activeElement;for(const te of V)if(te===ee||(te==null||te.scrollIntoView({block:"nearest"}),te===q&&_&&(_.scrollTop=0),te===oe&&_&&(_.scrollTop=_.scrollHeight),te==null||te.focus(),document.activeElement!==ee))return},[Z,_]),I=p.useCallback(()=>k([L,S]),[k,L,S]);p.useEffect(()=>{O&&I()},[O,I]);const{onOpenChange:R,triggerPointerDownPosRef:N}=b;p.useEffect(()=>{if(S){let V={x:0,y:0};const q=oe=>{var ee,te,Ie,ue;V={x:Math.abs(Math.round(oe.pageX)-((ee=(te=N.current)===null||te===void 0?void 0:te.x)!==null&&ee!==void 0?ee:0)),y:Math.abs(Math.round(oe.pageY)-((Ie=(ue=N.current)===null||ue===void 0?void 0:ue.y)!==null&&Ie!==void 0?Ie:0))}},K=oe=>{V.x<=10&&V.y<=10?oe.preventDefault():S.contains(oe.target)||R(!1),document.removeEventListener("pointermove",q),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",K,{capture:!0})}}},[S,R,N]),p.useEffect(()=>{const V=()=>R(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[R]);const[j,C]=uC(V=>{const q=Z().filter(ee=>!ee.disabled),K=q.find(ee=>ee.ref.current===document.activeElement),oe=dC(q,V,K);oe&&setTimeout(()=>oe.ref.current.focus())}),m=p.useCallback((V,q,K)=>{const oe=!A.current&&!K;(b.value!==void 0&&b.value===q||oe)&&(z(V),oe&&(A.current=!0))},[b.value]),T=p.useCallback(()=>S==null?void 0:S.focus(),[S]),F=p.useCallback((V,q,K)=>{const oe=!A.current&&!K;(b.value!==void 0&&b.value===q||oe)&&Y(V)},[b.value]),E=n==="popper"?r3:$B,B=E===r3?{side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:v,sticky:g,hideWhenDetached:y,avoidCollisions:w}:{};return p.createElement(lC,{scope:r,content:S,viewport:_,onViewportChange:D,itemRefCallback:m,selectedItem:L,onItemLeave:T,itemTextRefCallback:F,focusSelectedItem:I,selectedItemText:H,position:n,isPositioned:O,searchRef:j},p.createElement(ng,{as:ml,allowPinchZoom:!0},p.createElement(iS,{asChild:!0,trapped:b.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:Ce(i,V=>{var q;(q=b.trigger)===null||q===void 0||q.focus({preventScroll:!0}),V.preventDefault()})},p.createElement(Qm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>b.onOpenChange(!1)},p.createElement(E,Re({role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:V=>V.preventDefault()},x,B,{onPlaced:()=>h(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ce(x.onKeyDown,V=>{const q=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!q&&V.key.length===1&&C(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let oe=Z().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(V.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const ee=V.target,te=oe.indexOf(ee);oe=oe.slice(te+1)}setTimeout(()=>k(oe)),V.preventDefault()}})}))))))}),$B=p.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=va(xl,r),o=u0(xl,r),[a,l]=p.useState(null),[c,f]=p.useState(null),u=It(e,M=>f(M)),d=lg(r),v=p.useRef(!1),g=p.useRef(!0),{viewport:y,selectedItem:w,selectedItemText:x,focusSelectedItem:b}=o,S=p.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&c&&y&&w&&x){const M=s.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),z=s.valueNode.getBoundingClientRect(),H=x.getBoundingClientRect();if(s.dir!=="rtl"){const ee=H.left-L.left,te=z.left-ee,Ie=M.left-te,ue=M.width+Ie,we=Math.max(ue,L.width),zt=window.innerWidth-Zi,Ve=t3(te,[Zi,zt-we]);a.style.minWidth=ue+"px",a.style.left=Ve+"px"}else{const ee=L.right-H.right,te=window.innerWidth-z.right-ee,Ie=window.innerWidth-M.right-te,ue=M.width+Ie,we=Math.max(ue,L.width),zt=window.innerWidth-Zi,Ve=t3(te,[Zi,zt-we]);a.style.minWidth=ue+"px",a.style.right=Ve+"px"}const Y=d(),Z=window.innerHeight-Zi*2,O=y.scrollHeight,h=window.getComputedStyle(c),A=parseInt(h.borderTopWidth,10),k=parseInt(h.paddingTop,10),I=parseInt(h.borderBottomWidth,10),R=parseInt(h.paddingBottom,10),N=A+k+O+R+I,j=Math.min(w.offsetHeight*5,N),C=window.getComputedStyle(y),m=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),F=M.top+M.height/2-Zi,E=Z-F,B=w.offsetHeight/2,V=w.offsetTop+B,q=A+k+V,K=N-q;if(q<=F){const ee=w===Y[Y.length-1].ref.current;a.style.bottom="0px";const te=c.clientHeight-y.offsetTop-y.offsetHeight,Ie=Math.max(E,B+(ee?T:0)+te+I),ue=q+Ie;a.style.height=ue+"px"}else{const ee=w===Y[0].ref.current;a.style.top="0px";const Ie=Math.max(F,A+y.offsetTop+(ee?m:0)+B)+K;a.style.height=Ie+"px",y.scrollTop=q-F+y.offsetTop}a.style.margin=`${Zi}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=Z+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[d,s.trigger,s.valueNode,a,c,y,w,x,s.dir,n]);kn(()=>S(),[S]);const[P,_]=p.useState();kn(()=>{c&&_(window.getComputedStyle(c).zIndex)},[c]);const D=p.useCallback(M=>{M&&g.current===!0&&(S(),b==null||b(),g.current=!1)},[S,b]);return p.createElement(FB,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:v,onScrollButtonChange:D},p.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},p.createElement(Xe.div,Re({},i,{ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),r3=p.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Zi,...s}=t,o=cg(r);return p.createElement(LD,Re({},o,s,{ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[FB,UB]=Nl(xl,{}),n3="SelectViewport",zB=p.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=u0(n3,r),s=UB(n3,r),o=It(e,i.onViewportChange),a=p.useRef(0);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(f0.Slot,{scope:r},p.createElement(Xe.div,Re({"data-radix-select-viewport":"",role:"presentation"},n,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Ce(n.onScroll,l=>{const c=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:u}=s;if(u!=null&&u.current&&f){const d=Math.abs(a.current-c.scrollTop);if(d>0){const v=window.innerHeight-Zi*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),w=Math.max(g,y);if(w0?S:0,f.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),VB="SelectGroup",[qB,nte]=Nl(VB),HB=p.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=ro();return p.createElement(qB,{scope:r,id:i},p.createElement(Xe.div,Re({role:"group","aria-labelledby":i},n,{ref:e})))}),qy="SelectItem",[WB,GB]=Nl(qy),KB=p.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=va(qy,r),l=u0(qy,r),c=a.value===n,[f,u]=p.useState(s??""),[d,v]=p.useState(!1),g=It(e,x=>{var b;return(b=l.itemRefCallback)===null||b===void 0?void 0:b.call(l,x,n,i)}),y=ro(),w=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.createElement(WB,{scope:r,value:n,disabled:i,textId:y,isSelected:c,onItemTextChange:p.useCallback(x=>{u(b=>{var S;return b||((S=x==null?void 0:x.textContent)!==null&&S!==void 0?S:"").trim()})},[])},p.createElement(f0.ItemSlot,{scope:r,value:n,disabled:i,textValue:f},p.createElement(Xe.div,Re({role:"option","aria-labelledby":y,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:g,onFocus:Ce(o.onFocus,()=>v(!0)),onBlur:Ce(o.onBlur,()=>v(!1)),onPointerUp:Ce(o.onPointerUp,w),onPointerMove:Ce(o.onPointerMove,x=>{if(i){var b;(b=l.onItemLeave)===null||b===void 0||b.call(l)}else x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(o.onPointerLeave,x=>{if(x.currentTarget===document.activeElement){var b;(b=l.onItemLeave)===null||b===void 0||b.call(l)}}),onKeyDown:Ce(o.onKeyDown,x=>{var b;((b=l.searchRef)===null||b===void 0?void 0:b.current)!==""&&x.key===" "||(kB.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})}))))}),Du="SelectItemText",QB=p.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=va(Du,r),a=u0(Du,r),l=GB(Du,r),c=MB(Du,r),[f,u]=p.useState(null),d=It(e,x=>u(x),l.onItemTextChange,x=>{var b;return(b=a.itemTextRefCallback)===null||b===void 0?void 0:b.call(a,x,l.value,l.disabled)}),v=f==null?void 0:f.textContent,g=p.useMemo(()=>p.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},v),[l.disabled,l.value,v]),{onNativeOptionAdd:y,onNativeOptionRemove:w}=c;return kn(()=>(y(g),()=>w(g)),[y,w,g]),p.createElement(p.Fragment,null,p.createElement(Xe.span,Re({id:l.textId},s,{ref:d})),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ks.createPortal(s.children,o.valueNode):null)});function cC(t){return t===""||t===void 0}const fC=p.forwardRef((t,e)=>{const{value:r,...n}=t,i=p.useRef(null),s=It(e,i),o=zm(r);return p.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==r&&f){const u=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(u)}},[o,r]),p.createElement(aC,{asChild:!0},p.createElement("select",Re({},n,{ref:s,defaultValue:r})))});fC.displayName="BubbleSelect";function uC(t){const e=Hn(t),r=p.useRef(""),n=p.useRef(0),i=p.useCallback(o=>{const a=r.current+o;e(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),s=p.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function dC(t,e,r){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=YB(t,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==r));const l=o.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function YB(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const JB=IB,XB=OB,ZB=DB,e$=LB,t$=jB,r$=zB,n$=HB,i$=KB,s$=QB;var o$="gohwum1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 gohwum0 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11od fyvr11hc fyvr11f4 fyvr12s1 fyvr118c fyvr11jw fyvr11n4 fyvr12v7 fyvr12o1",a$=Qt({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"gohwum6 gohwum2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"gohwum7 gohwum3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"gohwum8 gohwum4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),l$="gohwuma gohwum9 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ls fyvr11m8 fyvr11ms fyvr11tv fyvr12s1 fyvr11nl",c$="gohwume _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 gohwumd fyvr1ww fyvr1ys fyvr1t0 fyvr1uw fyvr12ws fyvr12wt fyvr12wm fyvr12wn fyvr11h0 fyvr11jw fyvr11ko fyvr12v7 fyvr12v3 fyvr12s1 fyvr12w1 fyvr12vr";const f$=p.forwardRef(({children:t,className:e,...r},n)=>J.jsx(i$,{className:fn(c$,e),...r,ref:n,children:J.jsx(s$,{children:t})})),d0=p.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:l,options:c,placeholder:f,...u}=t;return J.jsx(Tl,{disabled:n,display:"grid",id:i??l,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:J.jsxs(JB,{disabled:n,name:l,...u,children:[J.jsxs(XB,{id:i??l,className:fn(o$,a$({borderRadius:r})),ref:e,children:[J.jsx(ZB,{placeholder:f}),J.jsx(re,{as:e$,display:"inline-flex",children:J.jsx(Z8,{})})]}),J.jsx(t$,{className:l$,children:J.jsx(r$,{children:J.jsx(n$,{children:c.map(({value:d,label:v,...g})=>J.jsx(f$,{value:d,...g,children:v},d))})})})]})})});p.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,l=o?J.jsx(og,{icon:Hm,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return J.jsx(Pr,{ref:e,name:s,leftIcon:cN,controls:r||l,placeholder:i,value:o,onChange:c=>n==null?void 0:n(c),...a})});var u$=Qt({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const zi=p.forwardRef((t,e)=>{const{size:r="md",...n}=t;return J.jsx(re,{className:u$({size:r}),color:"text50",ref:e,...n,children:J.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[J.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),J.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});p.forwardRef(({children:t},e)=>J.jsx(re,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));const hC="Switch",[d$,ite]=qr(hC);d$(hC);Qt({defaultClassName:"nwwh3z8",variantClassNames:{variant:{pill:"nwwh3z9",line:"nwwh3za nwwh3z1 fyvr11g0"},active:{true:"nwwh3zb nwwh3z2 fyvr12w5",false:"nwwh3zc"},disabled:{true:"nwwh3zd nwwh3z3 fyvr12vp"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"nwwh3z4 fyvr11u7 fyvr12sj"],[{active:!1,variant:"pill"},"nwwh3z5 fyvr11od fyvr12s7"],[{active:!0,variant:"line"},"nwwh3z6 fyvr12s1"],[{active:!1,variant:"line"},"nwwh3z7 fyvr12s7"]]});const vC="Tabs",[h$,ste]=qr(vC,[Ol]);Ol();h$(vC);var v$="_1ppqbnx1 _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _1ppqbnx0 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1wo fyvr1yk fyvr1ss fyvr1uo fyvr11hc fyvr118c fyvr11n9";p.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return J.jsxs(re,{className:v$,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&J.jsx(r,{size:"xs"}),J.jsx(Se,{children:n})]})});const y$="ToastProvider",[p$,ote,m$]=n0("Toast"),[yC,ate]=qr("Toast",[m$]),[lte,pC]=yC(y$),i3="toast.viewportPause",s3="toast.viewportResume",h0="Toast",g$="toast.swipeStart",x$="toast.swipeMove",b$="toast.swipeCancel",w$="toast.swipeEnd",[E$,A$]=yC(h0,{onClose(){}}),S$=p.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:f,onSwipeMove:u,onSwipeCancel:d,onSwipeEnd:v,...g}=t,y=pC(h0,r),[w,x]=p.useState(null),b=It(e,h=>x(h)),S=p.useRef(null),P=p.useRef(null),_=i||y.duration,D=p.useRef(0),M=p.useRef(_),L=p.useRef(0),{onToastAdd:z,onToastRemove:H}=y,Y=Hn(()=>{var h;(w==null?void 0:w.contains(document.activeElement))&&((h=y.viewport)===null||h===void 0||h.focus()),o()}),Z=p.useCallback(h=>{!h||h===1/0||(window.clearTimeout(L.current),D.current=new Date().getTime(),L.current=window.setTimeout(Y,h))},[Y]);p.useEffect(()=>{const h=y.viewport;if(h){const A=()=>{Z(M.current),c==null||c()},k=()=>{const I=new Date().getTime()-D.current;M.current=M.current-I,window.clearTimeout(L.current),l==null||l()};return h.addEventListener(i3,k),h.addEventListener(s3,A),()=>{h.removeEventListener(i3,k),h.removeEventListener(s3,A)}}},[y.viewport,_,l,c,Z]),p.useEffect(()=>{s&&!y.isClosePausedRef.current&&Z(_)},[s,_,y.isClosePausedRef,Z]),p.useEffect(()=>(z(),()=>H()),[z,H]);const O=p.useMemo(()=>w?gC(w):null,[w]);return y.viewport?p.createElement(p.Fragment,null,O&&p.createElement(C$,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},O),p.createElement(E$,{scope:r,onClose:Y},ks.createPortal(p.createElement(p$.ItemSlot,{scope:r},p.createElement(LN,{asChild:!0,onEscapeKeyDown:Ce(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||Y(),y.isFocusedToastEscapeKeyDownRef.current=!1})},p.createElement(Xe.li,Re({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":y.swipeDirection},g,{ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ce(t.onKeyDown,h=>{h.key==="Escape"&&(a==null||a(h.nativeEvent),h.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,Y()))}),onPointerDown:Ce(t.onPointerDown,h=>{h.button===0&&(S.current={x:h.clientX,y:h.clientY})}),onPointerMove:Ce(t.onPointerMove,h=>{if(!S.current)return;const A=h.clientX-S.current.x,k=h.clientY-S.current.y,I=!!P.current,R=["left","right"].includes(y.swipeDirection),N=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,j=R?N(0,A):0,C=R?0:N(0,k),m=h.pointerType==="touch"?10:2,T={x:j,y:C},F={originalEvent:h,delta:T};I?(P.current=T,Lu(x$,u,F,{discrete:!1})):o3(T,y.swipeDirection,m)?(P.current=T,Lu(g$,f,F,{discrete:!1}),h.target.setPointerCapture(h.pointerId)):(Math.abs(A)>m||Math.abs(k)>m)&&(S.current=null)}),onPointerUp:Ce(t.onPointerUp,h=>{const A=P.current,k=h.target;if(k.hasPointerCapture(h.pointerId)&&k.releasePointerCapture(h.pointerId),P.current=null,S.current=null,A){const I=h.currentTarget,R={originalEvent:h,delta:A};o3(A,y.swipeDirection,y.swipeThreshold)?Lu(w$,v,R,{discrete:!0}):Lu(b$,d,R,{discrete:!0}),I.addEventListener("click",N=>N.preventDefault(),{once:!0})}})})))),y.viewport))):null});S$.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const e=`Invalid prop \`type\` supplied to \`${h0}\`. Expected \`foreground | background\`.`;return new Error(e)}return null}};const C$=t=>{const{__scopeToast:e,children:r,...n}=t,i=pC(h0,e),[s,o]=p.useState(!1),[a,l]=p.useState(!1);return M$(()=>o(!0)),p.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:p.createElement(bS,{asChild:!0},p.createElement(aC,n,s&&p.createElement(p.Fragment,null,i.label," ",r)))},k$="ToastAction",P$=p.forwardRef((t,e)=>{const{altText:r,...n}=t;return r?p.createElement(mC,{altText:r,asChild:!0},p.createElement(T$,Re({},n,{ref:e}))):null});P$.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${k$}\``)}};const R$="ToastClose",T$=p.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=A$(R$,r);return p.createElement(mC,{asChild:!0},p.createElement(Xe.button,Re({type:"button"},n,{ref:e,onClick:Ce(t.onClick,i.onClose)})))}),mC=p.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return p.createElement(Xe.div,Re({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:e}))});function gC(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),I$(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...gC(n))}}),e}function Lu(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?qm(i,s):i.dispatchEvent(s)}const o3=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function M$(t=()=>{}){const e=Hn(t);kn(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function I$(t){return t.nodeType===t.ELEMENT_NODE}Qt({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});p.createContext(null);var _$="_15pztn1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _15pztn0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11od fyvr12s1 fyvr12o1 fyvr12wj fyvr128 fyvr11h0",O$="_15pztn2";p.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:l="",labelLocation:c="hidden",name:f,rows:u,resize:d=!1,...v}=t;return J.jsx(Tl,{description:s,disabled:o,display:"grid",id:a??f,label:l,labelLocation:c,children:J.jsx(re,{as:r,autoComplete:n,spellCheck:"false",className:fn(_$,d&&O$),disabled:o,id:a??f,name:f,ref:e,rows:u,borderRadius:i,...v})})});var N$=Qt({defaultClassName:"bnrreb5 bnrreb0 fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11h0",variantClassNames:{size:{xs:"bnrreb6",sm:"bnrreb7",md:"bnrreb8",lg:"bnrreb9",xl:"bnrreba"},borderRadius:{circle:"bnrrebb bnrreb1 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",lg:"bnrrebc bnrreb2 fyvr11d8 fyvr11dw fyvr11bw fyvr11ck",md:"bnrrebd bnrreb3 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg",sm:"bnrrebe bnrreb4 fyvr11d0 fyvr11do fyvr11bo fyvr11cc"}},defaultVariants:{},compoundVariants:[]}),D$="bnrrebf",L$="bnrrebh bnrrebg fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11sj fyvr128 fyvr15o fyvr11h0";const j$=p.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",...l}=t;return J.jsx(re,{className:fn(r,N$({borderRadius:e,size:a})),style:i,flexShrink:"0",...l,children:s?J.jsx(vj,{className:D$,disableAnimation:n,src:s}):J.jsx(Se,{className:L$,variant:"normal",fontWeight:"medium",color:"text50",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)})})}),[v0,cte]=qr("Tooltip",[_l]);_l();const B$="TooltipProvider";v0(B$);const xC="Tooltip";v0(xC);const $$="TooltipPortal";v0($$,{forceMount:void 0});v0(xC,{isInside:!1});/** + * @remix-run/router v1.16.1 * * Copyright (c) Remix Software Inc. * @@ -112,9 +112,9 @@ Defaulting to \`null\`.`}const tC="Radio",[iB,rC]=qr(tC),[sB,oB]=iB(tC),aB=p.for * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Lt(){return Lt=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function ra(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function U$(){return Math.random().toString(36).substr(2,8)}function l3(t,e){return{usr:t.state,key:t.key,idx:e}}function kf(t,e,r,n){return r===void 0&&(r=null),Lt({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Wi(e):e,{state:r,key:e&&e.key||n||U$()})}function Jf(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Wi(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function z$(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Zt.Pop,l=null,c=f();c==null&&(c=0,o.replaceState(Lt({},o.state,{idx:c}),""));function f(){return(o.state||{idx:null}).idx}function u(){a=Zt.Pop;let w=f(),x=w==null?null:w-c;c=w,l&&l({action:a,location:y.location,delta:x})}function d(w,x){a=Zt.Push;let b=kf(y.location,w,x);r&&r(b,w),c=f()+1;let S=l3(b,c),P=y.createHref(b);try{o.pushState(S,"",P)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(P)}s&&l&&l({action:a,location:y.location,delta:1})}function v(w,x){a=Zt.Replace;let b=kf(y.location,w,x);r&&r(b,w),c=f();let S=l3(b,c),P=y.createHref(b);o.replaceState(S,"",P),s&&l&&l({action:a,location:y.location,delta:0})}function g(w){let x=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof w=="string"?w:Jf(w);return b=b.replace(/ $/,"%20"),Fe(x,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,x)}let y={get action(){return a},get location(){return t(i,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(a3,u),l=w,()=>{i.removeEventListener(a3,u),l=null}},createHref(w){return e(i,w)},createURL:g,encodeLocation(w){let x=g(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:d,replace:v,go(w){return o.go(w)}};return y}var _t;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(_t||(_t={}));const V$=new Set(["lazy","caseSensitive","path","id","index","children"]);function q$(t){return t.index===!0}function Hy(t,e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),t.map((i,s)=>{let o=[...r,s],a=typeof i.id=="string"?i.id:o.join("-");if(Fe(i.index!==!0||!i.children,"Cannot specify children on an index route"),Fe(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),q$(i)){let l=Lt({},i,e(i),{id:a});return n[a]=l,l}else{let l=Lt({},i,e(i),{id:a,children:void 0});return n[a]=l,i.children&&(l.children=Hy(i.children,e,o,n)),l}})}function qa(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?Wi(e):e,i=Xf(n.pathname||"/",r);if(i==null)return null;let s=bC(t);W$(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Fe(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=Ho([n,l.relativePath]),f=r.concat(l);s.children&&s.children.length>0&&(Fe(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),bC(s.children,e,f,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:Z$(c,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of wC(s.path))i(s,o,l)}),e}function wC(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=wC(n.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function W$(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:eF(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const G$=/^:[\w-]+$/,K$=3,Q$=2,Y$=1,J$=10,X$=-2,c3=t=>t==="*";function Z$(t,e){let r=t.split("/"),n=r.length;return r.some(c3)&&(n+=X$),e&&(n+=Q$),r.filter(i=>!c3(i)).reduce((i,s)=>i+(G$.test(s)?K$:s===""?Y$:J$),n)}function eF(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function tF(t,e){let{routesMeta:r}=t,n={},i="/",s=[];for(let o=0;o{let{paramName:d,isOptional:v}=f;if(d==="*"){let y=a[u]||"";o=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const g=a[u];return v&&!g?c[d]=void 0:c[d]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:t}}function nF(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),ra(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function iF(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ra(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Xf(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function sF(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Wi(t):t;return{pathname:r?r.startsWith("/")?r:oF(r,e):e,search:fF(n),hash:uF(i)}}function oF(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function j1(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function EC(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function aF(t,e){let r=EC(t);return e?r.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function lF(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Wi(t):(i=Lt({},t),Fe(!i.pathname||!i.pathname.includes("?"),j1("?","pathname","search",i)),Fe(!i.pathname||!i.pathname.includes("#"),j1("#","pathname","hash",i)),Fe(!i.search||!i.search.includes("#"),j1("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=r;else{let u=e.length-1;if(!n&&o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),u-=1;i.pathname=d.join("/")}a=u>=0?e[u]:"/"}let l=sF(i,a),c=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}const Ho=t=>t.join("/").replace(/\/\/+/g,"/"),cF=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),fF=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,uF=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class fg{constructor(e,r,n,i){i===void 0&&(i=!1),this.status=e,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function ug(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const AC=["post","put","patch","delete"],dF=new Set(AC),hF=["get",...AC],vF=new Set(hF),yF=new Set([301,302,303,307,308]),pF=new Set([307,308]),B1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mF={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gF=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),SC="remix-router-transitions";function xF(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",n=!r;Fe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let U=t.detectErrorBoundary;i=G=>({hasErrorBoundary:U(G)})}else i=gF;let s={},o=Hy(t.routes,i,void 0,s),a,l=t.basename||"/",c=t.unstable_dataStrategy||AF,f=Lt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},t.future),u=null,d=new Set,v=null,g=null,y=null,w=t.hydrationData!=null,x=qa(o,t.history.location,l),b=null;if(x==null){let U=Ln(404,{pathname:t.history.location.pathname}),{matches:G,route:Q}=x3(o);x=G,b={[Q.id]:U}}let S,P=x.some(U=>U.route.lazy),_=x.some(U=>U.route.loader);if(P)S=!1;else if(!_)S=!0;else if(f.v7_partialHydration){let U=t.hydrationData?t.hydrationData.loaderData:null,G=t.hydrationData?t.hydrationData.errors:null,Q=ie=>ie.route.loader?typeof ie.route.loader=="function"&&ie.route.loader.hydrate===!0?!1:U&&U[ie.route.id]!==void 0||G&&G[ie.route.id]!==void 0:!0;if(G){let ie=x.findIndex(he=>G[he.route.id]!==void 0);S=x.slice(0,ie+1).every(Q)}else S=x.every(Q)}else S=t.hydrationData!=null;let D,M={historyAction:t.history.action,location:t.history.location,matches:x,initialized:S,navigation:B1,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||b,fetchers:new Map,blockers:new Map},L=Zt.Pop,z=!1,H,Y=!1,Z=new Map,O=null,h=!1,A=!1,k=[],I=[],R=new Map,N=0,j=-1,C=new Map,m=new Set,T=new Map,F=new Map,E=new Set,B=new Map,V=new Map,q=!1;function K(){if(u=t.history.listen(U=>{let{action:G,location:Q,delta:ie}=U;if(q){q=!1;return}ra(V.size===0||ie!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let he=vt({currentLocation:M.location,nextLocation:Q,historyAction:G});if(he&&ie!=null){q=!0,t.history.go(ie*-1),In(he,{state:"blocked",location:Q,proceed(){In(he,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),t.history.go(ie)},reset(){let me=new Map(M.blockers);me.set(he,sc),te({blockers:me})}});return}return zt(G,Q)}),r){DF(e,Z);let U=()=>LF(e,Z);e.addEventListener("pagehide",U),O=()=>e.removeEventListener("pagehide",U)}return M.initialized||zt(Zt.Pop,M.location,{initialHydration:!0}),D}function oe(){u&&u(),O&&O(),d.clear(),H&&H.abort(),M.fetchers.forEach((U,G)=>nt(G)),M.blockers.forEach((U,G)=>ht(G))}function ee(U){return d.add(U),()=>d.delete(U)}function te(U,G){G===void 0&&(G={}),M=Lt({},M,U);let Q=[],ie=[];f.v7_fetcherPersist&&M.fetchers.forEach((he,me)=>{he.state==="idle"&&(E.has(me)?ie.push(me):Q.push(me))}),[...d].forEach(he=>he(M,{deletedFetchers:ie,unstable_viewTransitionOpts:G.viewTransitionOpts,unstable_flushSync:G.flushSync===!0})),f.v7_fetcherPersist&&(Q.forEach(he=>M.fetchers.delete(he)),ie.forEach(he=>nt(he)))}function Ie(U,G,Q){var ie,he;let{flushSync:me}=Q===void 0?{}:Q,de=M.actionData!=null&&M.navigation.formMethod!=null&&li(M.navigation.formMethod)&&M.navigation.state==="loading"&&((ie=U.state)==null?void 0:ie._isRedirect)!==!0,ye;G.actionData?Object.keys(G.actionData).length>0?ye=G.actionData:ye=null:de?ye=M.actionData:ye=null;let ge=G.loaderData?m3(M.loaderData,G.loaderData,G.matches||[],G.errors):M.loaderData,pe=M.blockers;pe.size>0&&(pe=new Map(pe),pe.forEach((ve,Ke)=>pe.set(Ke,sc)));let Rt=z===!0||M.navigation.formMethod!=null&&li(M.navigation.formMethod)&&((he=U.state)==null?void 0:he._isRedirect)!==!0;a&&(o=a,a=void 0),h||L===Zt.Pop||(L===Zt.Push?t.history.push(U,U.state):L===Zt.Replace&&t.history.replace(U,U.state));let _e;if(L===Zt.Pop){let ve=Z.get(M.location.pathname);ve&&ve.has(U.pathname)?_e={currentLocation:M.location,nextLocation:U}:Z.has(U.pathname)&&(_e={currentLocation:U,nextLocation:M.location})}else if(Y){let ve=Z.get(M.location.pathname);ve?ve.add(U.pathname):(ve=new Set([U.pathname]),Z.set(M.location.pathname,ve)),_e={currentLocation:M.location,nextLocation:U}}te(Lt({},G,{actionData:ye,loaderData:ge,historyAction:L,location:U,initialized:!0,navigation:B1,revalidation:"idle",restoreScrollPosition:gi(U,G.matches||M.matches),preventScrollReset:Rt,blockers:pe}),{viewTransitionOpts:_e,flushSync:me===!0}),L=Zt.Pop,z=!1,Y=!1,h=!1,A=!1,k=[],I=[]}async function ue(U,G){if(typeof U=="number"){t.history.go(U);return}let Q=Wy(M.location,M.matches,l,f.v7_prependBasename,U,f.v7_relativeSplatPath,G==null?void 0:G.fromRouteId,G==null?void 0:G.relative),{path:ie,submission:he,error:me}=f3(f.v7_normalizeFormMethod,!1,Q,G),de=M.location,ye=kf(M.location,ie,G&&G.state);ye=Lt({},ye,t.history.encodeLocation(ye));let ge=G&&G.replace!=null?G.replace:void 0,pe=Zt.Push;ge===!0?pe=Zt.Replace:ge===!1||he!=null&&li(he.formMethod)&&he.formAction===M.location.pathname+M.location.search&&(pe=Zt.Replace);let Rt=G&&"preventScrollReset"in G?G.preventScrollReset===!0:void 0,_e=(G&&G.unstable_flushSync)===!0,ve=vt({currentLocation:de,nextLocation:ye,historyAction:pe});if(ve){In(ve,{state:"blocked",location:ye,proceed(){In(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),ue(U,G)},reset(){let Ke=new Map(M.blockers);Ke.set(ve,sc),te({blockers:Ke})}});return}return await zt(pe,ye,{submission:he,pendingError:me,preventScrollReset:Rt,replace:G&&G.replace,enableViewTransition:G&&G.unstable_viewTransition,flushSync:_e})}function we(){if(Xn(),te({revalidation:"loading"}),M.navigation.state!=="submitting"){if(M.navigation.state==="idle"){zt(M.historyAction,M.location,{startUninterruptedRevalidation:!0});return}zt(L||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation})}}async function zt(U,G,Q){H&&H.abort(),H=null,L=U,h=(Q&&Q.startUninterruptedRevalidation)===!0,gt(M.location,M.matches),z=(Q&&Q.preventScrollReset)===!0,Y=(Q&&Q.enableViewTransition)===!0;let ie=a||o,he=Q&&Q.overrideNavigation,me=qa(ie,G,l),de=(Q&&Q.flushSync)===!0;if(!me){let ve=Ln(404,{pathname:G.pathname}),{matches:Ke,route:Ce}=x3(ie);lt(),Ie(G,{matches:Ke,loaderData:{},errors:{[Ce.id]:ve}},{flushSync:de});return}if(M.initialized&&!A&&TF(M.location,G)&&!(Q&&Q.submission&&li(Q.submission.formMethod))){Ie(G,{matches:me},{flushSync:de});return}H=new AbortController;let ye=Ea(t.history,G,H.signal,Q&&Q.submission),ge;if(Q&&Q.pendingError)ge=[Kc(me).route.id,{type:_t.error,error:Q.pendingError}];else if(Q&&Q.submission&&li(Q.submission.formMethod)){let ve=await Ve(ye,G,Q.submission,me,{replace:Q.replace,flushSync:de});if(ve.shortCircuited)return;ge=ve.pendingActionResult,he=$1(G,Q.submission),de=!1,ye=Ea(t.history,ye.url,ye.signal)}let{shortCircuited:pe,loaderData:Rt,errors:_e}=await ot(ye,G,me,he,Q&&Q.submission,Q&&Q.fetcherSubmission,Q&&Q.replace,Q&&Q.initialHydration===!0,de,ge);pe||(H=null,Ie(G,Lt({matches:me},g3(ge),{loaderData:Rt,errors:_e})))}async function Ve(U,G,Q,ie,he){he===void 0&&(he={}),Xn();let me=OF(G,Q);te({navigation:me},{flushSync:he.flushSync===!0});let de,ye=Ky(ie,G);if(!ye.route.action&&!ye.route.lazy)de={type:_t.error,error:Ln(405,{method:U.method,pathname:G.pathname,routeId:ye.route.id})};else if(de=(await Ze("action",U,[ye],ie))[0],U.signal.aborted)return{shortCircuited:!0};if(Bo(de)){let ge;return he&&he.replace!=null?ge=he.replace:ge=v3(de.response.headers.get("Location"),new URL(U.url),l)===M.location.pathname+M.location.search,await un(U,de,{submission:Q,replace:ge}),{shortCircuited:!0}}if(jo(de))throw Ln(400,{type:"defer-action"});if(Fn(de)){let ge=Kc(ie,ye.route.id);return(he&&he.replace)!==!0&&(L=Zt.Push),{pendingActionResult:[ge.route.id,de]}}return{pendingActionResult:[ye.route.id,de]}}async function ot(U,G,Q,ie,he,me,de,ye,ge,pe){let Rt=ie||$1(G,he),_e=he||me||E3(Rt),ve=a||o,[Ke,Ce]=u3(t.history,M,Q,_e,G,f.v7_partialHydration&&ye===!0,f.unstable_skipActionErrorRevalidation,A,k,I,E,T,m,ve,l,pe);if(lt(De=>!(Q&&Q.some(fr=>fr.route.id===De))||Ke&&Ke.some(fr=>fr.route.id===De)),j=++N,Ke.length===0&&Ce.length===0){let De=dt();return Ie(G,Lt({matches:Q,loaderData:{},errors:pe&&Fn(pe[1])?{[pe[0]]:pe[1].error}:null},g3(pe),De?{fetchers:new Map(M.fetchers)}:{}),{flushSync:ge}),{shortCircuited:!0}}if(!h&&(!f.v7_partialHydration||!ye)){Ce.forEach(fr=>{let Nr=M.fetchers.get(fr.key),Yt=oc(void 0,Nr?Nr.data:void 0);M.fetchers.set(fr.key,Yt)});let De;pe&&!Fn(pe[1])?De={[pe[0]]:pe[1].data}:M.actionData&&(Object.keys(M.actionData).length===0?De=null:De=M.actionData),te(Lt({navigation:Rt},De!==void 0?{actionData:De}:{},Ce.length>0?{fetchers:new Map(M.fetchers)}:{}),{flushSync:ge})}Ce.forEach(De=>{R.has(De.key)&&_r(De.key),De.controller&&R.set(De.key,De.controller)});let tt=()=>Ce.forEach(De=>_r(De.key));H&&H.signal.addEventListener("abort",tt);let{loaderResults:Or,fetcherResults:Qe}=await ft(M.matches,Q,Ke,Ce,U);if(U.signal.aborted)return{shortCircuited:!0};H&&H.signal.removeEventListener("abort",tt),Ce.forEach(De=>R.delete(De.key));let Ye=b3([...Or,...Qe]);if(Ye){if(Ye.idx>=Ke.length){let De=Ce[Ye.idx-Ke.length].key;m.add(De)}return await un(U,Ye.result,{replace:de}),{shortCircuited:!0}}let{loaderData:Hr,errors:cr}=p3(M,Q,Ke,Or,pe,Ce,Qe,B);B.forEach((De,fr)=>{De.subscribe(Nr=>{(Nr||De.done)&&B.delete(fr)})}),f.v7_partialHydration&&ye&&M.errors&&Object.entries(M.errors).filter(De=>{let[fr]=De;return!Ke.some(Nr=>Nr.route.id===fr)}).forEach(De=>{let[fr,Nr]=De;cr=Object.assign(cr||{},{[fr]:Nr})});let dn=dt(),hn=mi(j),vn=dn||hn||Ce.length>0;return Lt({loaderData:Hr,errors:cr},vn?{fetchers:new Map(M.fetchers)}:{})}function Jn(U,G,Q,ie){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");R.has(U)&&_r(U);let he=(ie&&ie.unstable_flushSync)===!0,me=a||o,de=Wy(M.location,M.matches,l,f.v7_prependBasename,Q,f.v7_relativeSplatPath,G,ie==null?void 0:ie.relative),ye=qa(me,de,l);if(!ye){et(U,G,Ln(404,{pathname:de}),{flushSync:he});return}let{path:ge,submission:pe,error:Rt}=f3(f.v7_normalizeFormMethod,!0,de,ie);if(Rt){et(U,G,Rt,{flushSync:he});return}let _e=Ky(ye,ge);if(z=(ie&&ie.preventScrollReset)===!0,pe&&li(pe.formMethod)){at(U,G,ge,_e,ye,he,pe);return}T.set(U,{routeId:G,path:ge}),Ge(U,G,ge,_e,ye,he,pe)}async function at(U,G,Q,ie,he,me,de){if(Xn(),T.delete(U),!ie.route.action&&!ie.route.lazy){let Yt=Ln(405,{method:de.formMethod,pathname:Q,routeId:G});et(U,G,Yt,{flushSync:me});return}let ye=M.fetchers.get(U);ze(U,NF(de,ye),{flushSync:me});let ge=new AbortController,pe=Ea(t.history,Q,ge.signal,de);R.set(U,ge);let Rt=N,ve=(await Ze("action",pe,[ie],he))[0];if(pe.signal.aborted){R.get(U)===ge&&R.delete(U);return}if(f.v7_fetcherPersist&&E.has(U)){if(Bo(ve)||Fn(ve)){ze(U,Ds(void 0));return}}else{if(Bo(ve))if(R.delete(U),j>Rt){ze(U,Ds(void 0));return}else return m.add(U),ze(U,oc(de)),un(pe,ve,{fetcherSubmission:de});if(Fn(ve)){et(U,G,ve.error);return}}if(jo(ve))throw Ln(400,{type:"defer-action"});let Ke=M.navigation.location||M.location,Ce=Ea(t.history,Ke,ge.signal),tt=a||o,Or=M.navigation.state!=="idle"?qa(tt,M.navigation.location,l):M.matches;Fe(Or,"Didn't find any matches after fetcher action");let Qe=++N;C.set(U,Qe);let Ye=oc(de,ve.data);M.fetchers.set(U,Ye);let[Hr,cr]=u3(t.history,M,Or,de,Ke,!1,f.unstable_skipActionErrorRevalidation,A,k,I,E,T,m,tt,l,[ie.route.id,ve]);cr.filter(Yt=>Yt.key!==U).forEach(Yt=>{let Yi=Yt.key,ma=M.fetchers.get(Yi),Wl=oc(void 0,ma?ma.data:void 0);M.fetchers.set(Yi,Wl),R.has(Yi)&&_r(Yi),Yt.controller&&R.set(Yi,Yt.controller)}),te({fetchers:new Map(M.fetchers)});let dn=()=>cr.forEach(Yt=>_r(Yt.key));ge.signal.addEventListener("abort",dn);let{loaderResults:hn,fetcherResults:vn}=await ft(M.matches,Or,Hr,cr,Ce);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",dn),C.delete(U),R.delete(U),cr.forEach(Yt=>R.delete(Yt.key));let De=b3([...hn,...vn]);if(De){if(De.idx>=Hr.length){let Yt=cr[De.idx-Hr.length].key;m.add(Yt)}return un(Ce,De.result)}let{loaderData:fr,errors:Nr}=p3(M,M.matches,Hr,hn,void 0,cr,vn,B);if(M.fetchers.has(U)){let Yt=Ds(ve.data);M.fetchers.set(U,Yt)}mi(Qe),M.navigation.state==="loading"&&Qe>j?(Fe(L,"Expected pending action"),H&&H.abort(),Ie(M.navigation.location,{matches:Or,loaderData:fr,errors:Nr,fetchers:new Map(M.fetchers)})):(te({errors:Nr,loaderData:m3(M.loaderData,fr,Or,Nr),fetchers:new Map(M.fetchers)}),A=!1)}async function Ge(U,G,Q,ie,he,me,de){let ye=M.fetchers.get(U);ze(U,oc(de,ye?ye.data:void 0),{flushSync:me});let ge=new AbortController,pe=Ea(t.history,Q,ge.signal);R.set(U,ge);let Rt=N,ve=(await Ze("loader",pe,[ie],he))[0];if(jo(ve)&&(ve=await RC(ve,pe.signal,!0)||ve),R.get(U)===ge&&R.delete(U),!pe.signal.aborted){if(E.has(U)){ze(U,Ds(void 0));return}if(Bo(ve))if(j>Rt){ze(U,Ds(void 0));return}else{m.add(U),await un(pe,ve);return}if(Fn(ve)){et(U,G,ve.error);return}Fe(!jo(ve),"Unhandled fetcher deferred data"),ze(U,Ds(ve.data))}}async function un(U,G,Q){let{submission:ie,fetcherSubmission:he,replace:me}=Q===void 0?{}:Q;G.response.headers.has("X-Remix-Revalidate")&&(A=!0);let de=G.response.headers.get("Location");Fe(de,"Expected a Location header on the redirect Response"),de=v3(de,new URL(U.url),l);let ye=kf(M.location,de,{_isRedirect:!0});if(r){let Ke=!1;if(G.response.headers.has("X-Remix-Reload-Document"))Ke=!0;else if(dg.test(de)){const Ce=t.history.createURL(de);Ke=Ce.origin!==e.location.origin||Xf(Ce.pathname,l)==null}if(Ke){me?e.location.replace(de):e.location.assign(de);return}}H=null;let ge=me===!0?Zt.Replace:Zt.Push,{formMethod:pe,formAction:Rt,formEncType:_e}=M.navigation;!ie&&!he&&pe&&Rt&&_e&&(ie=E3(M.navigation));let ve=ie||he;if(pF.has(G.response.status)&&ve&&li(ve.formMethod))await zt(ge,ye,{submission:Lt({},ve,{formAction:de}),preventScrollReset:z});else{let Ke=$1(ye,ie);await zt(ge,ye,{overrideNavigation:Ke,fetcherSubmission:he,preventScrollReset:z})}}async function Ze(U,G,Q,ie){try{let he=await SF(c,U,G,Q,ie,s,i);return await Promise.all(he.map((me,de)=>{if(MF(me)){let ye=me.result;return{type:_t.redirect,response:PF(ye,G,Q[de].route.id,ie,l,f.v7_relativeSplatPath)}}return kF(me)}))}catch(he){return Q.map(()=>({type:_t.error,error:he}))}}async function ft(U,G,Q,ie,he){let[me,...de]=await Promise.all([Q.length?Ze("loader",he,Q,G):[],...ie.map(ye=>{if(ye.matches&&ye.match&&ye.controller){let ge=Ea(t.history,ye.path,ye.controller.signal);return Ze("loader",ge,[ye.match],ye.matches).then(pe=>pe[0])}else return Promise.resolve({type:_t.error,error:Ln(404,{pathname:ye.path})})})]);return await Promise.all([w3(U,Q,me,me.map(()=>he.signal),!1,M.loaderData),w3(U,ie.map(ye=>ye.match),de,ie.map(ye=>ye.controller?ye.controller.signal:null),!0)]),{loaderResults:me,fetcherResults:de}}function Xn(){A=!0,k.push(...lt()),T.forEach((U,G)=>{R.has(G)&&(I.push(G),_r(G))})}function ze(U,G,Q){Q===void 0&&(Q={}),M.fetchers.set(U,G),te({fetchers:new Map(M.fetchers)},{flushSync:(Q&&Q.flushSync)===!0})}function et(U,G,Q,ie){ie===void 0&&(ie={});let he=Kc(M.matches,G);nt(U),te({errors:{[he.route.id]:Q},fetchers:new Map(M.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function pi(U){return f.v7_fetcherPersist&&(F.set(U,(F.get(U)||0)+1),E.has(U)&&E.delete(U)),M.fetchers.get(U)||mF}function nt(U){let G=M.fetchers.get(U);R.has(U)&&!(G&&G.state==="loading"&&C.has(U))&&_r(U),T.delete(U),C.delete(U),m.delete(U),E.delete(U),M.fetchers.delete(U)}function pt(U){if(f.v7_fetcherPersist){let G=(F.get(U)||0)-1;G<=0?(F.delete(U),E.add(U)):F.set(U,G)}else nt(U);te({fetchers:new Map(M.fetchers)})}function _r(U){let G=R.get(U);Fe(G,"Expected fetch controller: "+U),G.abort(),R.delete(U)}function ut(U){for(let G of U){let Q=pi(G),ie=Ds(Q.data);M.fetchers.set(G,ie)}}function dt(){let U=[],G=!1;for(let Q of m){let ie=M.fetchers.get(Q);Fe(ie,"Expected fetcher: "+Q),ie.state==="loading"&&(m.delete(Q),U.push(Q),G=!0)}return ut(U),G}function mi(U){let G=[];for(let[Q,ie]of C)if(ie0}function mt(U,G){let Q=M.blockers.get(U)||sc;return V.get(U)!==G&&V.set(U,G),Q}function ht(U){M.blockers.delete(U),V.delete(U)}function In(U,G){let Q=M.blockers.get(U)||sc;Fe(Q.state==="unblocked"&&G.state==="blocked"||Q.state==="blocked"&&G.state==="blocked"||Q.state==="blocked"&&G.state==="proceeding"||Q.state==="blocked"&&G.state==="unblocked"||Q.state==="proceeding"&&G.state==="unblocked","Invalid blocker state transition: "+Q.state+" -> "+G.state);let ie=new Map(M.blockers);ie.set(U,G),te({blockers:ie})}function vt(U){let{currentLocation:G,nextLocation:Q,historyAction:ie}=U;if(V.size===0)return;V.size>1&&ra(!1,"A router only supports one blocker at a time");let he=Array.from(V.entries()),[me,de]=he[he.length-1],ye=M.blockers.get(me);if(!(ye&&ye.state==="proceeding")&&de({currentLocation:G,nextLocation:Q,historyAction:ie}))return me}function lt(U){let G=[];return B.forEach((Q,ie)=>{(!U||U(ie))&&(Q.cancel(),G.push(ie),B.delete(ie))}),G}function Qi(U,G,Q){if(v=U,y=G,g=Q||null,!w&&M.navigation===B1){w=!0;let ie=gi(M.location,M.matches);ie!=null&&te({restoreScrollPosition:ie})}return()=>{v=null,y=null,g=null}}function yt(U,G){return g&&g(U,G.map(ie=>H$(ie,M.loaderData)))||U.key}function gt(U,G){if(v&&y){let Q=yt(U,G);v[Q]=y()}}function gi(U,G){if(v){let Q=yt(U,G),ie=v[Q];if(typeof ie=="number")return ie}return null}function xt(U){s={},a=Hy(U,i,void 0,s)}return D={get basename(){return l},get future(){return f},get state(){return M},get routes(){return o},get window(){return e},initialize:K,subscribe:ee,enableScrollRestoration:Qi,navigate:ue,fetch:Jn,revalidate:we,createHref:U=>t.history.createHref(U),encodeLocation:U=>t.history.encodeLocation(U),getFetcher:pi,deleteFetcher:pt,dispose:oe,getBlocker:mt,deleteBlocker:ht,_internalFetchControllers:R,_internalActiveDeferreds:B,_internalSetRoutes:xt},D}function bF(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Wy(t,e,r,n,i,s,o,a){let l,c;if(o){l=[];for(let u of e)if(l.push(u),u.route.id===o){c=u;break}}else l=e,c=e[e.length-1];let f=lF(i||".",aF(l,s),Xf(t.pathname,r)||t.pathname,a==="path");return i==null&&(f.search=t.search,f.hash=t.hash),(i==null||i===""||i===".")&&c&&c.route.index&&!hg(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(f.pathname=f.pathname==="/"?r:Ho([r,f.pathname])),Jf(f)}function f3(t,e,r,n){if(!n||!bF(n))return{path:r};if(n.formMethod&&!_F(n.formMethod))return{path:r,error:Ln(405,{method:n.formMethod})};let i=()=>({path:r,error:Ln(400,{type:"invalid-body"})}),s=n.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=kC(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!li(o))return i();let d=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,g)=>{let[y,w]=g;return""+v+y+"="+w+` + */function Lt(){return Lt=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function ra(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function U$(){return Math.random().toString(36).substr(2,8)}function l3(t,e){return{usr:t.state,key:t.key,idx:e}}function kf(t,e,r,n){return r===void 0&&(r=null),Lt({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Wi(e):e,{state:r,key:e&&e.key||n||U$()})}function Jf(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Wi(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function z$(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Zt.Pop,l=null,c=f();c==null&&(c=0,o.replaceState(Lt({},o.state,{idx:c}),""));function f(){return(o.state||{idx:null}).idx}function u(){a=Zt.Pop;let w=f(),x=w==null?null:w-c;c=w,l&&l({action:a,location:y.location,delta:x})}function d(w,x){a=Zt.Push;let b=kf(y.location,w,x);r&&r(b,w),c=f()+1;let S=l3(b,c),P=y.createHref(b);try{o.pushState(S,"",P)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(P)}s&&l&&l({action:a,location:y.location,delta:1})}function v(w,x){a=Zt.Replace;let b=kf(y.location,w,x);r&&r(b,w),c=f();let S=l3(b,c),P=y.createHref(b);o.replaceState(S,"",P),s&&l&&l({action:a,location:y.location,delta:0})}function g(w){let x=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof w=="string"?w:Jf(w);return b=b.replace(/ $/,"%20"),Fe(x,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,x)}let y={get action(){return a},get location(){return t(i,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(a3,u),l=w,()=>{i.removeEventListener(a3,u),l=null}},createHref(w){return e(i,w)},createURL:g,encodeLocation(w){let x=g(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:d,replace:v,go(w){return o.go(w)}};return y}var _t;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(_t||(_t={}));const V$=new Set(["lazy","caseSensitive","path","id","index","children"]);function q$(t){return t.index===!0}function Hy(t,e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),t.map((i,s)=>{let o=[...r,s],a=typeof i.id=="string"?i.id:o.join("-");if(Fe(i.index!==!0||!i.children,"Cannot specify children on an index route"),Fe(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),q$(i)){let l=Lt({},i,e(i),{id:a});return n[a]=l,l}else{let l=Lt({},i,e(i),{id:a,children:void 0});return n[a]=l,i.children&&(l.children=Hy(i.children,e,o,n)),l}})}function qa(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?Wi(e):e,i=Xf(n.pathname||"/",r);if(i==null)return null;let s=bC(t);W$(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Fe(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=Ho([n,l.relativePath]),f=r.concat(l);s.children&&s.children.length>0&&(Fe(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),bC(s.children,e,f,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:Z$(c,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of wC(s.path))i(s,o,l)}),e}function wC(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=wC(n.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function W$(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:eF(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const G$=/^:[\w-]+$/,K$=3,Q$=2,Y$=1,J$=10,X$=-2,c3=t=>t==="*";function Z$(t,e){let r=t.split("/"),n=r.length;return r.some(c3)&&(n+=X$),e&&(n+=Q$),r.filter(i=>!c3(i)).reduce((i,s)=>i+(G$.test(s)?K$:s===""?Y$:J$),n)}function eF(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function tF(t,e){let{routesMeta:r}=t,n={},i="/",s=[];for(let o=0;o{let{paramName:d,isOptional:v}=f;if(d==="*"){let y=a[u]||"";o=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const g=a[u];return v&&!g?c[d]=void 0:c[d]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:t}}function nF(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),ra(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function iF(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ra(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Xf(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function sF(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Wi(t):t;return{pathname:r?r.startsWith("/")?r:oF(r,e):e,search:fF(n),hash:uF(i)}}function oF(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function j1(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function EC(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function aF(t,e){let r=EC(t);return e?r.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function lF(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Wi(t):(i=Lt({},t),Fe(!i.pathname||!i.pathname.includes("?"),j1("?","pathname","search",i)),Fe(!i.pathname||!i.pathname.includes("#"),j1("#","pathname","hash",i)),Fe(!i.search||!i.search.includes("#"),j1("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=r;else{let u=e.length-1;if(!n&&o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),u-=1;i.pathname=d.join("/")}a=u>=0?e[u]:"/"}let l=sF(i,a),c=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}const Ho=t=>t.join("/").replace(/\/\/+/g,"/"),cF=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),fF=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,uF=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class fg{constructor(e,r,n,i){i===void 0&&(i=!1),this.status=e,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function ug(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const AC=["post","put","patch","delete"],dF=new Set(AC),hF=["get",...AC],vF=new Set(hF),yF=new Set([301,302,303,307,308]),pF=new Set([307,308]),B1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mF={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gF=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),SC="remix-router-transitions";function xF(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",n=!r;Fe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let U=t.detectErrorBoundary;i=G=>({hasErrorBoundary:U(G)})}else i=gF;let s={},o=Hy(t.routes,i,void 0,s),a,l=t.basename||"/",c=t.unstable_dataStrategy||AF,f=Lt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},t.future),u=null,d=new Set,v=null,g=null,y=null,w=t.hydrationData!=null,x=qa(o,t.history.location,l),b=null;if(x==null){let U=Ln(404,{pathname:t.history.location.pathname}),{matches:G,route:Q}=x3(o);x=G,b={[Q.id]:U}}let S,P=x.some(U=>U.route.lazy),_=x.some(U=>U.route.loader);if(P)S=!1;else if(!_)S=!0;else if(f.v7_partialHydration){let U=t.hydrationData?t.hydrationData.loaderData:null,G=t.hydrationData?t.hydrationData.errors:null,Q=ie=>ie.route.loader?typeof ie.route.loader=="function"&&ie.route.loader.hydrate===!0?!1:U&&U[ie.route.id]!==void 0||G&&G[ie.route.id]!==void 0:!0;if(G){let ie=x.findIndex(he=>G[he.route.id]!==void 0);S=x.slice(0,ie+1).every(Q)}else S=x.every(Q)}else S=t.hydrationData!=null;let D,M={historyAction:t.history.action,location:t.history.location,matches:x,initialized:S,navigation:B1,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||b,fetchers:new Map,blockers:new Map},L=Zt.Pop,z=!1,H,Y=!1,Z=new Map,O=null,h=!1,A=!1,k=[],I=[],R=new Map,N=0,j=-1,C=new Map,m=new Set,T=new Map,F=new Map,E=new Set,B=new Map,V=new Map,q=!1;function K(){if(u=t.history.listen(U=>{let{action:G,location:Q,delta:ie}=U;if(q){q=!1;return}ra(V.size===0||ie!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let he=vt({currentLocation:M.location,nextLocation:Q,historyAction:G});if(he&&ie!=null){q=!0,t.history.go(ie*-1),In(he,{state:"blocked",location:Q,proceed(){In(he,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),t.history.go(ie)},reset(){let me=new Map(M.blockers);me.set(he,sc),te({blockers:me})}});return}return zt(G,Q)}),r){DF(e,Z);let U=()=>LF(e,Z);e.addEventListener("pagehide",U),O=()=>e.removeEventListener("pagehide",U)}return M.initialized||zt(Zt.Pop,M.location,{initialHydration:!0}),D}function oe(){u&&u(),O&&O(),d.clear(),H&&H.abort(),M.fetchers.forEach((U,G)=>nt(G)),M.blockers.forEach((U,G)=>ht(G))}function ee(U){return d.add(U),()=>d.delete(U)}function te(U,G){G===void 0&&(G={}),M=Lt({},M,U);let Q=[],ie=[];f.v7_fetcherPersist&&M.fetchers.forEach((he,me)=>{he.state==="idle"&&(E.has(me)?ie.push(me):Q.push(me))}),[...d].forEach(he=>he(M,{deletedFetchers:ie,unstable_viewTransitionOpts:G.viewTransitionOpts,unstable_flushSync:G.flushSync===!0})),f.v7_fetcherPersist&&(Q.forEach(he=>M.fetchers.delete(he)),ie.forEach(he=>nt(he)))}function Ie(U,G,Q){var ie,he;let{flushSync:me}=Q===void 0?{}:Q,de=M.actionData!=null&&M.navigation.formMethod!=null&&li(M.navigation.formMethod)&&M.navigation.state==="loading"&&((ie=U.state)==null?void 0:ie._isRedirect)!==!0,ye;G.actionData?Object.keys(G.actionData).length>0?ye=G.actionData:ye=null:de?ye=M.actionData:ye=null;let ge=G.loaderData?m3(M.loaderData,G.loaderData,G.matches||[],G.errors):M.loaderData,pe=M.blockers;pe.size>0&&(pe=new Map(pe),pe.forEach((ve,Ke)=>pe.set(Ke,sc)));let Rt=z===!0||M.navigation.formMethod!=null&&li(M.navigation.formMethod)&&((he=U.state)==null?void 0:he._isRedirect)!==!0;a&&(o=a,a=void 0),h||L===Zt.Pop||(L===Zt.Push?t.history.push(U,U.state):L===Zt.Replace&&t.history.replace(U,U.state));let _e;if(L===Zt.Pop){let ve=Z.get(M.location.pathname);ve&&ve.has(U.pathname)?_e={currentLocation:M.location,nextLocation:U}:Z.has(U.pathname)&&(_e={currentLocation:U,nextLocation:M.location})}else if(Y){let ve=Z.get(M.location.pathname);ve?ve.add(U.pathname):(ve=new Set([U.pathname]),Z.set(M.location.pathname,ve)),_e={currentLocation:M.location,nextLocation:U}}te(Lt({},G,{actionData:ye,loaderData:ge,historyAction:L,location:U,initialized:!0,navigation:B1,revalidation:"idle",restoreScrollPosition:gi(U,G.matches||M.matches),preventScrollReset:Rt,blockers:pe}),{viewTransitionOpts:_e,flushSync:me===!0}),L=Zt.Pop,z=!1,Y=!1,h=!1,A=!1,k=[],I=[]}async function ue(U,G){if(typeof U=="number"){t.history.go(U);return}let Q=Wy(M.location,M.matches,l,f.v7_prependBasename,U,f.v7_relativeSplatPath,G==null?void 0:G.fromRouteId,G==null?void 0:G.relative),{path:ie,submission:he,error:me}=f3(f.v7_normalizeFormMethod,!1,Q,G),de=M.location,ye=kf(M.location,ie,G&&G.state);ye=Lt({},ye,t.history.encodeLocation(ye));let ge=G&&G.replace!=null?G.replace:void 0,pe=Zt.Push;ge===!0?pe=Zt.Replace:ge===!1||he!=null&&li(he.formMethod)&&he.formAction===M.location.pathname+M.location.search&&(pe=Zt.Replace);let Rt=G&&"preventScrollReset"in G?G.preventScrollReset===!0:void 0,_e=(G&&G.unstable_flushSync)===!0,ve=vt({currentLocation:de,nextLocation:ye,historyAction:pe});if(ve){In(ve,{state:"blocked",location:ye,proceed(){In(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),ue(U,G)},reset(){let Ke=new Map(M.blockers);Ke.set(ve,sc),te({blockers:Ke})}});return}return await zt(pe,ye,{submission:he,pendingError:me,preventScrollReset:Rt,replace:G&&G.replace,enableViewTransition:G&&G.unstable_viewTransition,flushSync:_e})}function we(){if(Xn(),te({revalidation:"loading"}),M.navigation.state!=="submitting"){if(M.navigation.state==="idle"){zt(M.historyAction,M.location,{startUninterruptedRevalidation:!0});return}zt(L||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation})}}async function zt(U,G,Q){H&&H.abort(),H=null,L=U,h=(Q&&Q.startUninterruptedRevalidation)===!0,gt(M.location,M.matches),z=(Q&&Q.preventScrollReset)===!0,Y=(Q&&Q.enableViewTransition)===!0;let ie=a||o,he=Q&&Q.overrideNavigation,me=qa(ie,G,l),de=(Q&&Q.flushSync)===!0;if(!me){let ve=Ln(404,{pathname:G.pathname}),{matches:Ke,route:ke}=x3(ie);lt(),Ie(G,{matches:Ke,loaderData:{},errors:{[ke.id]:ve}},{flushSync:de});return}if(M.initialized&&!A&&TF(M.location,G)&&!(Q&&Q.submission&&li(Q.submission.formMethod))){Ie(G,{matches:me},{flushSync:de});return}H=new AbortController;let ye=Ea(t.history,G,H.signal,Q&&Q.submission),ge;if(Q&&Q.pendingError)ge=[Kc(me).route.id,{type:_t.error,error:Q.pendingError}];else if(Q&&Q.submission&&li(Q.submission.formMethod)){let ve=await Ve(ye,G,Q.submission,me,{replace:Q.replace,flushSync:de});if(ve.shortCircuited)return;ge=ve.pendingActionResult,he=$1(G,Q.submission),de=!1,ye=Ea(t.history,ye.url,ye.signal)}let{shortCircuited:pe,loaderData:Rt,errors:_e}=await ot(ye,G,me,he,Q&&Q.submission,Q&&Q.fetcherSubmission,Q&&Q.replace,Q&&Q.initialHydration===!0,de,ge);pe||(H=null,Ie(G,Lt({matches:me},g3(ge),{loaderData:Rt,errors:_e})))}async function Ve(U,G,Q,ie,he){he===void 0&&(he={}),Xn();let me=OF(G,Q);te({navigation:me},{flushSync:he.flushSync===!0});let de,ye=Ky(ie,G);if(!ye.route.action&&!ye.route.lazy)de={type:_t.error,error:Ln(405,{method:U.method,pathname:G.pathname,routeId:ye.route.id})};else if(de=(await Ze("action",U,[ye],ie))[0],U.signal.aborted)return{shortCircuited:!0};if(Bo(de)){let ge;return he&&he.replace!=null?ge=he.replace:ge=v3(de.response.headers.get("Location"),new URL(U.url),l)===M.location.pathname+M.location.search,await un(U,de,{submission:Q,replace:ge}),{shortCircuited:!0}}if(jo(de))throw Ln(400,{type:"defer-action"});if(Fn(de)){let ge=Kc(ie,ye.route.id);return(he&&he.replace)!==!0&&(L=Zt.Push),{pendingActionResult:[ge.route.id,de]}}return{pendingActionResult:[ye.route.id,de]}}async function ot(U,G,Q,ie,he,me,de,ye,ge,pe){let Rt=ie||$1(G,he),_e=he||me||E3(Rt),ve=a||o,[Ke,ke]=u3(t.history,M,Q,_e,G,f.v7_partialHydration&&ye===!0,f.unstable_skipActionErrorRevalidation,A,k,I,E,T,m,ve,l,pe);if(lt(De=>!(Q&&Q.some(fr=>fr.route.id===De))||Ke&&Ke.some(fr=>fr.route.id===De)),j=++N,Ke.length===0&&ke.length===0){let De=dt();return Ie(G,Lt({matches:Q,loaderData:{},errors:pe&&Fn(pe[1])?{[pe[0]]:pe[1].error}:null},g3(pe),De?{fetchers:new Map(M.fetchers)}:{}),{flushSync:ge}),{shortCircuited:!0}}if(!h&&(!f.v7_partialHydration||!ye)){ke.forEach(fr=>{let Nr=M.fetchers.get(fr.key),Yt=oc(void 0,Nr?Nr.data:void 0);M.fetchers.set(fr.key,Yt)});let De;pe&&!Fn(pe[1])?De={[pe[0]]:pe[1].data}:M.actionData&&(Object.keys(M.actionData).length===0?De=null:De=M.actionData),te(Lt({navigation:Rt},De!==void 0?{actionData:De}:{},ke.length>0?{fetchers:new Map(M.fetchers)}:{}),{flushSync:ge})}ke.forEach(De=>{R.has(De.key)&&_r(De.key),De.controller&&R.set(De.key,De.controller)});let tt=()=>ke.forEach(De=>_r(De.key));H&&H.signal.addEventListener("abort",tt);let{loaderResults:Or,fetcherResults:Qe}=await ft(M.matches,Q,Ke,ke,U);if(U.signal.aborted)return{shortCircuited:!0};H&&H.signal.removeEventListener("abort",tt),ke.forEach(De=>R.delete(De.key));let Ye=b3([...Or,...Qe]);if(Ye){if(Ye.idx>=Ke.length){let De=ke[Ye.idx-Ke.length].key;m.add(De)}return await un(U,Ye.result,{replace:de}),{shortCircuited:!0}}let{loaderData:Hr,errors:cr}=p3(M,Q,Ke,Or,pe,ke,Qe,B);B.forEach((De,fr)=>{De.subscribe(Nr=>{(Nr||De.done)&&B.delete(fr)})}),f.v7_partialHydration&&ye&&M.errors&&Object.entries(M.errors).filter(De=>{let[fr]=De;return!Ke.some(Nr=>Nr.route.id===fr)}).forEach(De=>{let[fr,Nr]=De;cr=Object.assign(cr||{},{[fr]:Nr})});let dn=dt(),hn=mi(j),vn=dn||hn||ke.length>0;return Lt({loaderData:Hr,errors:cr},vn?{fetchers:new Map(M.fetchers)}:{})}function Jn(U,G,Q,ie){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");R.has(U)&&_r(U);let he=(ie&&ie.unstable_flushSync)===!0,me=a||o,de=Wy(M.location,M.matches,l,f.v7_prependBasename,Q,f.v7_relativeSplatPath,G,ie==null?void 0:ie.relative),ye=qa(me,de,l);if(!ye){et(U,G,Ln(404,{pathname:de}),{flushSync:he});return}let{path:ge,submission:pe,error:Rt}=f3(f.v7_normalizeFormMethod,!0,de,ie);if(Rt){et(U,G,Rt,{flushSync:he});return}let _e=Ky(ye,ge);if(z=(ie&&ie.preventScrollReset)===!0,pe&&li(pe.formMethod)){at(U,G,ge,_e,ye,he,pe);return}T.set(U,{routeId:G,path:ge}),Ge(U,G,ge,_e,ye,he,pe)}async function at(U,G,Q,ie,he,me,de){if(Xn(),T.delete(U),!ie.route.action&&!ie.route.lazy){let Yt=Ln(405,{method:de.formMethod,pathname:Q,routeId:G});et(U,G,Yt,{flushSync:me});return}let ye=M.fetchers.get(U);ze(U,NF(de,ye),{flushSync:me});let ge=new AbortController,pe=Ea(t.history,Q,ge.signal,de);R.set(U,ge);let Rt=N,ve=(await Ze("action",pe,[ie],he))[0];if(pe.signal.aborted){R.get(U)===ge&&R.delete(U);return}if(f.v7_fetcherPersist&&E.has(U)){if(Bo(ve)||Fn(ve)){ze(U,Ds(void 0));return}}else{if(Bo(ve))if(R.delete(U),j>Rt){ze(U,Ds(void 0));return}else return m.add(U),ze(U,oc(de)),un(pe,ve,{fetcherSubmission:de});if(Fn(ve)){et(U,G,ve.error);return}}if(jo(ve))throw Ln(400,{type:"defer-action"});let Ke=M.navigation.location||M.location,ke=Ea(t.history,Ke,ge.signal),tt=a||o,Or=M.navigation.state!=="idle"?qa(tt,M.navigation.location,l):M.matches;Fe(Or,"Didn't find any matches after fetcher action");let Qe=++N;C.set(U,Qe);let Ye=oc(de,ve.data);M.fetchers.set(U,Ye);let[Hr,cr]=u3(t.history,M,Or,de,Ke,!1,f.unstable_skipActionErrorRevalidation,A,k,I,E,T,m,tt,l,[ie.route.id,ve]);cr.filter(Yt=>Yt.key!==U).forEach(Yt=>{let Yi=Yt.key,ma=M.fetchers.get(Yi),Wl=oc(void 0,ma?ma.data:void 0);M.fetchers.set(Yi,Wl),R.has(Yi)&&_r(Yi),Yt.controller&&R.set(Yi,Yt.controller)}),te({fetchers:new Map(M.fetchers)});let dn=()=>cr.forEach(Yt=>_r(Yt.key));ge.signal.addEventListener("abort",dn);let{loaderResults:hn,fetcherResults:vn}=await ft(M.matches,Or,Hr,cr,ke);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",dn),C.delete(U),R.delete(U),cr.forEach(Yt=>R.delete(Yt.key));let De=b3([...hn,...vn]);if(De){if(De.idx>=Hr.length){let Yt=cr[De.idx-Hr.length].key;m.add(Yt)}return un(ke,De.result)}let{loaderData:fr,errors:Nr}=p3(M,M.matches,Hr,hn,void 0,cr,vn,B);if(M.fetchers.has(U)){let Yt=Ds(ve.data);M.fetchers.set(U,Yt)}mi(Qe),M.navigation.state==="loading"&&Qe>j?(Fe(L,"Expected pending action"),H&&H.abort(),Ie(M.navigation.location,{matches:Or,loaderData:fr,errors:Nr,fetchers:new Map(M.fetchers)})):(te({errors:Nr,loaderData:m3(M.loaderData,fr,Or,Nr),fetchers:new Map(M.fetchers)}),A=!1)}async function Ge(U,G,Q,ie,he,me,de){let ye=M.fetchers.get(U);ze(U,oc(de,ye?ye.data:void 0),{flushSync:me});let ge=new AbortController,pe=Ea(t.history,Q,ge.signal);R.set(U,ge);let Rt=N,ve=(await Ze("loader",pe,[ie],he))[0];if(jo(ve)&&(ve=await RC(ve,pe.signal,!0)||ve),R.get(U)===ge&&R.delete(U),!pe.signal.aborted){if(E.has(U)){ze(U,Ds(void 0));return}if(Bo(ve))if(j>Rt){ze(U,Ds(void 0));return}else{m.add(U),await un(pe,ve);return}if(Fn(ve)){et(U,G,ve.error);return}Fe(!jo(ve),"Unhandled fetcher deferred data"),ze(U,Ds(ve.data))}}async function un(U,G,Q){let{submission:ie,fetcherSubmission:he,replace:me}=Q===void 0?{}:Q;G.response.headers.has("X-Remix-Revalidate")&&(A=!0);let de=G.response.headers.get("Location");Fe(de,"Expected a Location header on the redirect Response"),de=v3(de,new URL(U.url),l);let ye=kf(M.location,de,{_isRedirect:!0});if(r){let Ke=!1;if(G.response.headers.has("X-Remix-Reload-Document"))Ke=!0;else if(dg.test(de)){const ke=t.history.createURL(de);Ke=ke.origin!==e.location.origin||Xf(ke.pathname,l)==null}if(Ke){me?e.location.replace(de):e.location.assign(de);return}}H=null;let ge=me===!0?Zt.Replace:Zt.Push,{formMethod:pe,formAction:Rt,formEncType:_e}=M.navigation;!ie&&!he&&pe&&Rt&&_e&&(ie=E3(M.navigation));let ve=ie||he;if(pF.has(G.response.status)&&ve&&li(ve.formMethod))await zt(ge,ye,{submission:Lt({},ve,{formAction:de}),preventScrollReset:z});else{let Ke=$1(ye,ie);await zt(ge,ye,{overrideNavigation:Ke,fetcherSubmission:he,preventScrollReset:z})}}async function Ze(U,G,Q,ie){try{let he=await SF(c,U,G,Q,ie,s,i);return await Promise.all(he.map((me,de)=>{if(MF(me)){let ye=me.result;return{type:_t.redirect,response:PF(ye,G,Q[de].route.id,ie,l,f.v7_relativeSplatPath)}}return kF(me)}))}catch(he){return Q.map(()=>({type:_t.error,error:he}))}}async function ft(U,G,Q,ie,he){let[me,...de]=await Promise.all([Q.length?Ze("loader",he,Q,G):[],...ie.map(ye=>{if(ye.matches&&ye.match&&ye.controller){let ge=Ea(t.history,ye.path,ye.controller.signal);return Ze("loader",ge,[ye.match],ye.matches).then(pe=>pe[0])}else return Promise.resolve({type:_t.error,error:Ln(404,{pathname:ye.path})})})]);return await Promise.all([w3(U,Q,me,me.map(()=>he.signal),!1,M.loaderData),w3(U,ie.map(ye=>ye.match),de,ie.map(ye=>ye.controller?ye.controller.signal:null),!0)]),{loaderResults:me,fetcherResults:de}}function Xn(){A=!0,k.push(...lt()),T.forEach((U,G)=>{R.has(G)&&(I.push(G),_r(G))})}function ze(U,G,Q){Q===void 0&&(Q={}),M.fetchers.set(U,G),te({fetchers:new Map(M.fetchers)},{flushSync:(Q&&Q.flushSync)===!0})}function et(U,G,Q,ie){ie===void 0&&(ie={});let he=Kc(M.matches,G);nt(U),te({errors:{[he.route.id]:Q},fetchers:new Map(M.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function pi(U){return f.v7_fetcherPersist&&(F.set(U,(F.get(U)||0)+1),E.has(U)&&E.delete(U)),M.fetchers.get(U)||mF}function nt(U){let G=M.fetchers.get(U);R.has(U)&&!(G&&G.state==="loading"&&C.has(U))&&_r(U),T.delete(U),C.delete(U),m.delete(U),E.delete(U),M.fetchers.delete(U)}function pt(U){if(f.v7_fetcherPersist){let G=(F.get(U)||0)-1;G<=0?(F.delete(U),E.add(U)):F.set(U,G)}else nt(U);te({fetchers:new Map(M.fetchers)})}function _r(U){let G=R.get(U);Fe(G,"Expected fetch controller: "+U),G.abort(),R.delete(U)}function ut(U){for(let G of U){let Q=pi(G),ie=Ds(Q.data);M.fetchers.set(G,ie)}}function dt(){let U=[],G=!1;for(let Q of m){let ie=M.fetchers.get(Q);Fe(ie,"Expected fetcher: "+Q),ie.state==="loading"&&(m.delete(Q),U.push(Q),G=!0)}return ut(U),G}function mi(U){let G=[];for(let[Q,ie]of C)if(ie0}function mt(U,G){let Q=M.blockers.get(U)||sc;return V.get(U)!==G&&V.set(U,G),Q}function ht(U){M.blockers.delete(U),V.delete(U)}function In(U,G){let Q=M.blockers.get(U)||sc;Fe(Q.state==="unblocked"&&G.state==="blocked"||Q.state==="blocked"&&G.state==="blocked"||Q.state==="blocked"&&G.state==="proceeding"||Q.state==="blocked"&&G.state==="unblocked"||Q.state==="proceeding"&&G.state==="unblocked","Invalid blocker state transition: "+Q.state+" -> "+G.state);let ie=new Map(M.blockers);ie.set(U,G),te({blockers:ie})}function vt(U){let{currentLocation:G,nextLocation:Q,historyAction:ie}=U;if(V.size===0)return;V.size>1&&ra(!1,"A router only supports one blocker at a time");let he=Array.from(V.entries()),[me,de]=he[he.length-1],ye=M.blockers.get(me);if(!(ye&&ye.state==="proceeding")&&de({currentLocation:G,nextLocation:Q,historyAction:ie}))return me}function lt(U){let G=[];return B.forEach((Q,ie)=>{(!U||U(ie))&&(Q.cancel(),G.push(ie),B.delete(ie))}),G}function Qi(U,G,Q){if(v=U,y=G,g=Q||null,!w&&M.navigation===B1){w=!0;let ie=gi(M.location,M.matches);ie!=null&&te({restoreScrollPosition:ie})}return()=>{v=null,y=null,g=null}}function yt(U,G){return g&&g(U,G.map(ie=>H$(ie,M.loaderData)))||U.key}function gt(U,G){if(v&&y){let Q=yt(U,G);v[Q]=y()}}function gi(U,G){if(v){let Q=yt(U,G),ie=v[Q];if(typeof ie=="number")return ie}return null}function xt(U){s={},a=Hy(U,i,void 0,s)}return D={get basename(){return l},get future(){return f},get state(){return M},get routes(){return o},get window(){return e},initialize:K,subscribe:ee,enableScrollRestoration:Qi,navigate:ue,fetch:Jn,revalidate:we,createHref:U=>t.history.createHref(U),encodeLocation:U=>t.history.encodeLocation(U),getFetcher:pi,deleteFetcher:pt,dispose:oe,getBlocker:mt,deleteBlocker:ht,_internalFetchControllers:R,_internalActiveDeferreds:B,_internalSetRoutes:xt},D}function bF(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Wy(t,e,r,n,i,s,o,a){let l,c;if(o){l=[];for(let u of e)if(l.push(u),u.route.id===o){c=u;break}}else l=e,c=e[e.length-1];let f=lF(i||".",aF(l,s),Xf(t.pathname,r)||t.pathname,a==="path");return i==null&&(f.search=t.search,f.hash=t.hash),(i==null||i===""||i===".")&&c&&c.route.index&&!hg(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(f.pathname=f.pathname==="/"?r:Ho([r,f.pathname])),Jf(f)}function f3(t,e,r,n){if(!n||!bF(n))return{path:r};if(n.formMethod&&!_F(n.formMethod))return{path:r,error:Ln(405,{method:n.formMethod})};let i=()=>({path:r,error:Ln(400,{type:"invalid-body"})}),s=n.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=kC(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!li(o))return i();let d=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,g)=>{let[y,w]=g;return""+v+y+"="+w+` `},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:d}}}else if(n.formEncType==="application/json"){if(!li(o))return i();try{let d=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch{return i()}}}Fe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(n.formData)l=Gy(n.formData),c=n.formData;else if(n.body instanceof FormData)l=Gy(n.body),c=n.body;else if(n.body instanceof URLSearchParams)l=n.body,c=y3(l);else if(n.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(n.body),c=y3(l)}catch{return i()}let f={formMethod:o,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(li(f.formMethod))return{path:r,submission:f};let u=Wi(r);return e&&u.search&&hg(u.search)&&l.append("index",""),u.search="?"+l,{path:Jf(u),submission:f}}function wF(t,e){let r=t;if(e){let n=t.findIndex(i=>i.route.id===e);n>=0&&(r=t.slice(0,n))}return r}function u3(t,e,r,n,i,s,o,a,l,c,f,u,d,v,g,y){let w=y?Fn(y[1])?y[1].error:y[1].data:void 0,x=t.createURL(e.location),b=t.createURL(i),S=y&&Fn(y[1])?y[0]:void 0,P=S?wF(r,S):r,_=y?y[1].statusCode:void 0,D=o&&_&&_>=400,M=P.filter((z,H)=>{let{route:Y}=z;if(Y.lazy)return!0;if(Y.loader==null)return!1;if(s)return typeof Y.loader!="function"||Y.loader.hydrate?!0:e.loaderData[Y.id]===void 0&&(!e.errors||e.errors[Y.id]===void 0);if(EF(e.loaderData,e.matches[H],z)||l.some(h=>h===z.route.id))return!0;let Z=e.matches[H],O=z;return d3(z,Lt({currentUrl:x,currentParams:Z.params,nextUrl:b,nextParams:O.params},n,{actionResult:w,unstable_actionStatus:_,defaultShouldRevalidate:D?!1:a||x.pathname+x.search===b.pathname+b.search||x.search!==b.search||CC(Z,O)}))}),L=[];return u.forEach((z,H)=>{if(s||!r.some(A=>A.route.id===z.routeId)||f.has(H))return;let Y=qa(v,z.path,g);if(!Y){L.push({key:H,routeId:z.routeId,path:z.path,matches:null,match:null,controller:null});return}let Z=e.fetchers.get(H),O=Ky(Y,z.path),h=!1;d.has(H)?h=!1:c.includes(H)?h=!0:Z&&Z.state!=="idle"&&Z.data===void 0?h=a:h=d3(O,Lt({currentUrl:x,currentParams:e.matches[e.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:w,unstable_actionStatus:_,defaultShouldRevalidate:D?!1:a})),h&&L.push({key:H,routeId:z.routeId,path:z.path,matches:Y,match:O,controller:new AbortController})}),[M,L]}function EF(t,e,r){let n=!e||r.route.id!==e.route.id,i=t[r.route.id]===void 0;return n||i}function CC(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function d3(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}async function h3(t,e,r){if(!t.lazy)return;let n=await t.lazy();if(!t.lazy)return;let i=r[t.id];Fe(i,"No route found in manifest");let s={};for(let o in n){let l=i[o]!==void 0&&o!=="hasErrorBoundary";ra(!l,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!V$.has(o)&&(s[o]=n[o])}Object.assign(i,s),Object.assign(i,Lt({},e(i),{lazy:void 0}))}function AF(t){return Promise.all(t.matches.map(e=>e.resolve()))}async function SF(t,e,r,n,i,s,o,a){let l=n.reduce((u,d)=>u.add(d.route.id),new Set),c=new Set,f=await t({matches:i.map(u=>{let d=l.has(u.route.id);return Lt({},u,{shouldLoad:d,resolve:g=>(c.add(u.route.id),d?CF(e,r,u,s,o,g,a):Promise.resolve({type:_t.data,result:void 0}))})}),request:r,params:i[0].params,context:a});return i.forEach(u=>Fe(c.has(u.route.id),'`match.resolve()` was not called for route id "'+u.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),f.filter((u,d)=>l.has(i[d].route.id))}async function CF(t,e,r,n,i,s,o){let a,l,c=f=>{let u,d=new Promise((y,w)=>u=w);l=()=>u(),e.signal.addEventListener("abort",l);let v=y=>typeof f!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+r.route.id+"]"))):f({request:e,params:r.params,context:o},...y!==void 0?[y]:[]),g;return s?g=s(y=>v(y)):g=(async()=>{try{return{type:"data",result:await v()}}catch(y){return{type:"error",result:y}}})(),Promise.race([g,d])};try{let f=r.route[t];if(r.route.lazy)if(f){let u,[d]=await Promise.all([c(f).catch(v=>{u=v}),h3(r.route,i,n)]);if(u!==void 0)throw u;a=d}else if(await h3(r.route,i,n),f=r.route[t],f)a=await c(f);else if(t==="action"){let u=new URL(e.url),d=u.pathname+u.search;throw Ln(405,{method:e.method,pathname:d,routeId:r.route.id})}else return{type:_t.data,result:void 0};else if(f)a=await c(f);else{let u=new URL(e.url),d=u.pathname+u.search;throw Ln(404,{pathname:d})}Fe(a.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(f){return{type:_t.error,result:f}}finally{l&&e.signal.removeEventListener("abort",l)}return a}async function kF(t){let{result:e,type:r,status:n}=t;if(PC(e)){let o;try{let a=e.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?e.body==null?o=null:o=await e.json():o=await e.text()}catch(a){return{type:_t.error,error:a}}return r===_t.error?{type:_t.error,error:new fg(e.status,e.statusText,o),statusCode:e.status,headers:e.headers}:{type:_t.data,data:o,statusCode:e.status,headers:e.headers}}if(r===_t.error)return{type:_t.error,error:e,statusCode:ug(e)?e.status:n};if(IF(e)){var i,s;return{type:_t.deferred,deferredData:e,statusCode:(i=e.init)==null?void 0:i.status,headers:((s=e.init)==null?void 0:s.headers)&&new Headers(e.init.headers)}}return{type:_t.data,data:e,statusCode:n}}function PF(t,e,r,n,i,s){let o=t.headers.get("Location");if(Fe(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!dg.test(o)){let a=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=Wy(new URL(e.url),a,i,!0,o,s),t.headers.set("Location",o)}return t}function v3(t,e,r){if(dg.test(t)){let n=t,i=n.startsWith("//")?new URL(e.protocol+n):new URL(n),s=Xf(i.pathname,r)!=null;if(i.origin===e.origin&&s)return i.pathname+i.search+i.hash}return t}function Ea(t,e,r,n){let i=t.createURL(kC(e)).toString(),s={signal:r};if(n&&li(n.formMethod)){let{formMethod:o,formEncType:a}=n;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(n.json)):a==="text/plain"?s.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?s.body=Gy(n.formData):s.body=n.formData}return new Request(i,s)}function Gy(t){let e=new URLSearchParams;for(let[r,n]of t.entries())e.append(r,typeof n=="string"?n:n.name);return e}function y3(t){let e=new FormData;for(let[r,n]of t.entries())e.append(r,n);return e}function RF(t,e,r,n,i,s){let o={},a=null,l,c=!1,f={},u=n&&Fn(n[1])?n[1].error:void 0;return r.forEach((d,v)=>{let g=e[v].route.id;if(Fe(!Bo(d),"Cannot handle redirect results in processLoaderData"),Fn(d)){let y=d.error;if(u!==void 0&&(y=u,u=void 0),a=a||{},s)a[g]=y;else{let w=Kc(t,g);a[w.route.id]==null&&(a[w.route.id]=y)}o[g]=void 0,c||(c=!0,l=ug(d.error)?d.error.status:500),d.headers&&(f[g]=d.headers)}else jo(d)?(i.set(g,d.deferredData),o[g]=d.deferredData.data,d.statusCode!=null&&d.statusCode!==200&&!c&&(l=d.statusCode),d.headers&&(f[g]=d.headers)):(o[g]=d.data,d.statusCode&&d.statusCode!==200&&!c&&(l=d.statusCode),d.headers&&(f[g]=d.headers))}),u!==void 0&&n&&(a={[n[0]]:u},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:l||200,loaderHeaders:f}}function p3(t,e,r,n,i,s,o,a){let{loaderData:l,errors:c}=RF(e,r,n,i,a,!1);for(let f=0;fn.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function x3(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Ln(t,e){let{pathname:r,routeId:n,method:i,type:s}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&r&&n?a="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":s==="defer-action"?a="defer() is not supported in actions":s==="invalid-body"&&(a="Unable to encode submission body")):t===403?(o="Forbidden",a='Route "'+n+'" does not match URL "'+r+'"'):t===404?(o="Not Found",a='No route matches URL "'+r+'"'):t===405&&(o="Method Not Allowed",i&&r&&n?a="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(a='Invalid request method "'+i.toUpperCase()+'"')),new fg(t||500,o,new Error(a),!0)}function b3(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(Bo(r))return{result:r,idx:e}}}function kC(t){let e=typeof t=="string"?Wi(t):t;return Jf(Lt({},e,{hash:""}))}function TF(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function MF(t){return PC(t.result)&&yF.has(t.result.status)}function jo(t){return t.type===_t.deferred}function Fn(t){return t.type===_t.error}function Bo(t){return(t&&t.type)===_t.redirect}function IF(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function PC(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function _F(t){return vF.has(t.toLowerCase())}function li(t){return dF.has(t.toLowerCase())}async function w3(t,e,r,n,i,s){for(let o=0;ou.route.id===l.route.id),f=c!=null&&!CC(c,l)&&(s&&s[l.route.id])!==void 0;if(jo(a)&&(i||f)){let u=n[o];Fe(u,"Expected an AbortSignal for revalidating fetcher deferred result"),await RC(a,u,i).then(d=>{d&&(r[o]=d||r[o])})}}}async function RC(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:_t.data,data:t.deferredData.unwrappedData}}catch(i){return{type:_t.error,error:i}}return{type:_t.data,data:t.deferredData.data}}}function hg(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Ky(t,e){let r=typeof e=="string"?Wi(e).search:e.search;if(t[t.length-1].route.index&&hg(r||""))return t[t.length-1];let n=EC(t);return n[n.length-1]}function E3(t){let{formMethod:e,formAction:r,formEncType:n,text:i,formData:s,json:o}=t;if(!(!e||!r||!n)){if(i!=null)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:r,formEncType:n,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function $1(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function OF(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function oc(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function NF(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Ds(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function DF(t,e){try{let r=t.sessionStorage.getItem(SC);if(r){let n=JSON.parse(r);for(let[i,s]of Object.entries(n||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function LF(t,e){if(e.size>0){let r={};for(let[n,i]of e)r[n]=[...i];try{t.sessionStorage.setItem(SC,JSON.stringify(r))}catch(n){ra(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** - * React Router v6.23.0 + * React Router v6.23.1 * * Copyright (c) Remix Software Inc. * @@ -123,7 +123,7 @@ Defaulting to \`null\`.`}const tC="Radio",[iB,rC]=qr(tC),[sB,oB]=iB(tC),aB=p.for * * @license MIT */function lh(){return lh=Object.assign?Object.assign.bind():function(t){for(var e=1;eObject.assign({},w,{params:Object.assign({},a,w.params),pathname:Ho([l,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:Ho([l,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,r,n);return e&&y?p.createElement(y0.Provider,{value:{location:lh({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Zt.Pop}},y):y}function $F(){let t=GF(),e=ug(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},e),r?p.createElement("pre",{style:i},r):null,s)}const FF=p.createElement($F,null);class UF extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?p.createElement(p0.Provider,{value:this.props.routeContext},p.createElement(_C.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function zF(t){let{routeContext:e,match:r,children:n}=t,i=p.useContext(TC);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(p0.Provider,{value:e},n)}function VF(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var s;if((s=r)!=null&&s.errors)t=r.matches;else return null}let o=t,a=(i=r)==null?void 0:i.errors;if(a!=null){let f=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);f>=0||Fe(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((f,u,d)=>{let v,g=!1,y=null,w=null;r&&(v=a&&u.route.id?a[u.route.id]:void 0,y=u.route.errorElement||FF,l&&(c<0&&d===0?(KF("route-fallback",!1),g=!0,w=null):c===d&&(g=!0,w=u.route.hydrateFallbackElement||null)));let x=e.concat(o.slice(0,d+1)),b=()=>{let S;return v?S=y:g?S=w:u.route.Component?S=p.createElement(u.route.Component,null):u.route.element?S=u.route.element:S=f,p.createElement(zF,{match:u,routeContext:{outlet:f,matches:x,isDataRoute:r!=null},children:S})};return r&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?p.createElement(UF,{location:r.location,revalidation:r.revalidation,component:y,error:v,children:b(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):b()},null)}var Qy=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Qy||{});function qF(t){let e=p.useContext(MC);return e||Fe(!1),e}function HF(t){let e=p.useContext(p0);return e||Fe(!1),e}function WF(t){let e=HF(),r=e.matches[e.matches.length-1];return r.route.id||Fe(!1),r.route.id}function GF(){var t;let e=p.useContext(_C),r=qF(Qy.UseRouteError),n=WF(Qy.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}const A3={};function KF(t,e,r){!e&&!A3[t]&&(A3[t]=!0)}function QF(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Zt.Pop,navigator:s,static:o=!1,future:a}=t;vg()&&Fe(!1);let l=e.replace(/^\/*/,"/"),c=p.useMemo(()=>({basename:l,navigator:s,static:o,future:lh({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof n=="string"&&(n=Wi(n));let{pathname:f="/",search:u="",hash:d="",state:v=null,key:g="default"}=n,y=p.useMemo(()=>{let w=Xf(f,l);return w==null?null:{location:{pathname:w,search:u,hash:d,state:v,key:g},navigationType:i}},[l,f,u,d,v,g,i]);return y==null?null:p.createElement(IC.Provider,{value:c},p.createElement(y0.Provider,{children:r,value:y}))}new Promise(()=>{});function YF(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:p.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:p.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:p.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** - * React Router DOM v6.23.0 + * React Router DOM v6.23.1 * * Copyright (c) Remix Software Inc. * @@ -131,7 +131,7 @@ Defaulting to \`null\`.`}const tC="Radio",[iB,rC]=qr(tC),[sB,oB]=iB(tC),aB=p.for * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ch(){return ch=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function aU(t){let{fallbackElement:e,router:r,future:n}=t,[i,s]=p.useState(r.state),[o,a]=p.useState(),[l,c]=p.useState({isTransitioning:!1}),[f,u]=p.useState(),[d,v]=p.useState(),[g,y]=p.useState(),w=p.useRef(new Map),{v7_startTransition:x}=n||{},b=p.useCallback(M=>{x?sU(M):M()},[x]),S=p.useCallback((M,L)=>{let{deletedFetchers:z,unstable_flushSync:H,unstable_viewTransitionOpts:Y}=L;z.forEach(O=>w.current.delete(O)),M.fetchers.forEach((O,h)=>{O.data!==void 0&&w.current.set(h,O.data)});let Z=r.window==null||typeof r.window.document.startViewTransition!="function";if(!Y||Z){H?ac(()=>s(M)):b(()=>s(M));return}if(H){ac(()=>{d&&(f&&f.resolve(),d.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let O=r.window.document.startViewTransition(()=>{ac(()=>s(M))});O.finished.finally(()=>{ac(()=>{u(void 0),v(void 0),a(void 0),c({isTransitioning:!1})})}),ac(()=>v(O));return}d?(f&&f.resolve(),d.skipTransition(),y({state:M,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(a(M),c({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[r.window,d,f,w,b]);p.useLayoutEffect(()=>r.subscribe(S),[r,S]),p.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new oU)},[l]),p.useEffect(()=>{if(f&&o&&r.window){let M=o,L=f.promise,z=r.window.document.startViewTransition(async()=>{b(()=>s(M)),await L});z.finished.finally(()=>{u(void 0),v(void 0),a(void 0),c({isTransitioning:!1})}),v(z)}},[b,o,f,r.window]),p.useEffect(()=>{f&&o&&i.location.key===o.location.key&&f.resolve()},[f,d,i.location,o]),p.useEffect(()=>{!l.isTransitioning&&g&&(a(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[l.isTransitioning,g]),p.useEffect(()=>{},[]);let P=p.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:M=>r.navigate(M),push:(M,L,z)=>r.navigate(M,{state:L,preventScrollReset:z==null?void 0:z.preventScrollReset}),replace:(M,L,z)=>r.navigate(M,{replace:!0,state:L,preventScrollReset:z==null?void 0:z.preventScrollReset})}),[r]),_=r.basename||"/",D=p.useMemo(()=>({router:r,navigator:P,static:!1,basename:_}),[r,P,_]);return p.createElement(p.Fragment,null,p.createElement(TC.Provider,{value:D},p.createElement(MC.Provider,{value:i},p.createElement(rU.Provider,{value:w.current},p.createElement(tU.Provider,{value:l},p.createElement(QF,{basename:_,location:i.location,navigationType:i.historyAction,navigator:P,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},i.initialized||r.future.v7_partialHydration?p.createElement(lU,{routes:r.routes,future:r.future,state:i}):e))))),null)}function lU(t){let{routes:e,future:r,state:n}=t;return BF(e,void 0,n,r)}var k3;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(k3||(k3={}));var P3;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(P3||(P3={}));var cU="_1csw4y80 _1qxj1ib9 _1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8";const OC=t=>{const{value:e,digits:r=6,onChange:n,disabled:i=!1}=t,s=p.useMemo(()=>R3(0,r).map(()=>p.createRef()),[]);p.useEffect(()=>{var c,f;(f=(c=s[0])==null?void 0:c.current)==null||f.focus()},[]);const o=(c,f)=>{var d,v;/^\d$/.test(f)||(f="");const u=[...e];u[c]=f,f!==""&&((v=(d=s[c+1])==null?void 0:d.current)==null||v.focus()),n(u)},a=(c,f)=>{var g,y;const u=s[c].current,d=(g=s[c-1])==null?void 0:g.current,v=(y=s[c+1])==null?void 0:y.current;switch(f.key){case"Backspace":f.preventDefault(),u&&(u.value="",o(c,"")),d==null||d.focus();break;case"ArrowLeft":f.preventDefault(),d==null||d.focus();break;case"ArrowRight":f.preventDefault(),v==null||v.focus();break;default:(u==null?void 0:u.value)===f.key&&(f.preventDefault(),o(c,f.key))}},l=(c,f)=>{var v,g;const d=f.clipboardData.getData("text/plain").replace(/\D/g,"");/^\d{6}$/.test(d)&&((g=(v=s[0])==null?void 0:v.current)==null||g.focus(),n(d.split("")),setTimeout(()=>{var y,w;(w=(y=s[s.length-1])==null?void 0:y.current)==null||w.focus()}))};return $.jsx(re,{gap:"2",children:R3(0,r).map(c=>$.jsxs(p.Fragment,{children:[c===r/2&&$.jsx("span",{}),$.jsx(re,{as:"input",className:cU,value:e[c]||"",ref:s[c],type:"text",inputMode:"numeric",maxLength:1,disabled:i,onFocus:f=>f.target.select(),onPaste:f=>l(c,f),onChange:f=>o(c,f.target.value),onKeyDown:f=>{a(c,f)}})]},c))})},R3=(t,e)=>Array.from({length:e-t},(r,n)=>n+t),NC=()=>$.jsxs(re,{gap:"2",flexDirection:"column",borderStyle:"solid",width:"1/3",padding:"4",borderWidth:"thin",borderColor:"borderNormal",borderRadius:"sm",children:[$.jsx(Pe,{variant:"xlarge",fontWeight:"bold",color:"gnosisLight",children:"Demo App"}),$.jsx(Pe,{variant:"normal",marginLeft:"auto",color:"polygonLight",children:"Showcasing WaaS"})]});function fU(t={}){const{nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n}=t,[i,s]=p.useState(!1),o=p.useRef(r);o.current=r;const a=p.useRef(n);return a.current=n,p.useEffect(()=>{const l=document.createElement("script");return l.src="https://accounts.google.com/gsi/client",l.async=!0,l.defer=!0,l.nonce=e,l.onload=()=>{var c;s(!0),(c=o.current)===null||c===void 0||c.call(o)},l.onerror=()=>{var c;s(!1),(c=a.current)===null||c===void 0||c.call(a)},document.body.appendChild(l),()=>{document.body.removeChild(l)}},[e]),i}const DC=p.createContext(null);function uU({clientId:t,nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n,children:i}){const s=fU({nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n}),o=p.useMemo(()=>({clientId:t,scriptLoadedSuccessfully:s}),[t,s]);return gr.createElement(DC.Provider,{value:o},i)}function dU(){const t=p.useContext(DC);if(!t)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return t}function hU(t){var e;return(e=t==null?void 0:t.clientId)!==null&&e!==void 0?e:t==null?void 0:t.client_id}const vU={large:40,medium:32,small:20};function yU({onSuccess:t,onError:e,useOneTap:r,promptMomentNotification:n,type:i="standard",theme:s="outline",size:o="large",text:a,shape:l,logo_alignment:c,width:f,locale:u,click_listener:d,containerProps:v,...g}){const y=p.useRef(null),{clientId:w,scriptLoadedSuccessfully:x}=dU(),b=p.useRef(t);b.current=t;const S=p.useRef(e);S.current=e;const P=p.useRef(n);return P.current=n,p.useEffect(()=>{var _,D,M,L,z,H,Y,Z,O;if(x)return(M=(D=(_=window==null?void 0:window.google)===null||_===void 0?void 0:_.accounts)===null||D===void 0?void 0:D.id)===null||M===void 0||M.initialize({client_id:w,callback:h=>{var A;if(!(h!=null&&h.credential))return(A=S.current)===null||A===void 0?void 0:A.call(S);const{credential:k,select_by:I}=h;b.current({credential:k,clientId:hU(h),select_by:I})},...g}),(H=(z=(L=window==null?void 0:window.google)===null||L===void 0?void 0:L.accounts)===null||z===void 0?void 0:z.id)===null||H===void 0||H.renderButton(y.current,{type:i,theme:s,size:o,text:a,shape:l,logo_alignment:c,width:f,locale:u,click_listener:d}),r&&((O=(Z=(Y=window==null?void 0:window.google)===null||Y===void 0?void 0:Y.accounts)===null||Z===void 0?void 0:Z.id)===null||O===void 0||O.prompt(P.current)),()=>{var h,A,k;r&&((k=(A=(h=window==null?void 0:window.google)===null||h===void 0?void 0:h.accounts)===null||A===void 0?void 0:A.id)===null||k===void 0||k.cancel())}},[w,x,r,i,s,o,a,l,c,f,u]),gr.createElement("div",{...v,ref:y,style:{height:vU[o],...v==null?void 0:v.style}})}function pU(){var t,e,r;(r=(e=(t=window==null?void 0:window.google)===null||t===void 0?void 0:t.accounts)===null||e===void 0?void 0:e.id)===null||r===void 0||r.disableAutoSelect()}var LC={},m0={},Zf={};Object.defineProperty(Zf,"__esModule",{value:!0});Zf.default=void 0;var mU=p;function gU(t){(0,mU.useEffect)(function(){if(t){var e=document.querySelectorAll('script[src="'.concat(t,'"]'))[0];e||(e=document.createElement("script"),e.src=t,e.async=!0,document.body.appendChild(e))}},[t])}var xU=gU;Zf.default=xU;var eu={},g0={};Object.defineProperty(g0,"__esModule",{value:!0});g0.default=void 0;var bU=function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{pollFrequency:1e3,retries:100,parent:window},n=r.pollFrequency,i=n===void 0?1e3:n,s=r.retries,o=s===void 0?100:s,a=r.parent,l=a===void 0?window:a;if(l&&l.hasOwnProperty(e))return Promise.resolve(l[e]);if(!o)return Promise.resolve(void 0);var c=o-1;return new Promise(function(f){return setTimeout(f,typeof i=="function"?i({retries:c}):i)}).then(function(){return t(e,{pollFrequency:i,parent:l,retries:c})})},wU=bU;g0.default=wU;Object.defineProperty(eu,"__esModule",{value:!0});eu.default=void 0;var EU=AU(g0);function AU(t){return t&&t.__esModule?t:{default:t}}var SU="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",CU=function(e){var r=e.authOptions,n=e.onSuccess,i=e.onError;return(0,EU.default)("AppleID").then(function(){return window.AppleID||console.error(new Error("Error loading apple script")),window.AppleID.auth.init(r),window.AppleID.auth.signIn().then(function(s){return n&&n(s),s}).catch(function(s){return i?i(s):console.error(s),null})}).catch(function(s){return i?i(s):console.error(s),null})},kU={APPLE_SCRIPT_SRC:SU,signIn:CU};eu.default=kU;Object.defineProperty(m0,"__esModule",{value:!0});m0.default=void 0;var bi=yg(p),PU=yg(Zf),T3=yg(eu),RU=["onSuccess","onError","skipScript","authOptions","iconProps","render","uiType","className","noDefaultStyle","buttonExtraChildren"];function yg(t){return t&&t.__esModule?t:{default:t}}function fh(){return fh=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function _U(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}var OU=` + */function ch(){return ch=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function aU(t){let{fallbackElement:e,router:r,future:n}=t,[i,s]=p.useState(r.state),[o,a]=p.useState(),[l,c]=p.useState({isTransitioning:!1}),[f,u]=p.useState(),[d,v]=p.useState(),[g,y]=p.useState(),w=p.useRef(new Map),{v7_startTransition:x}=n||{},b=p.useCallback(M=>{x?sU(M):M()},[x]),S=p.useCallback((M,L)=>{let{deletedFetchers:z,unstable_flushSync:H,unstable_viewTransitionOpts:Y}=L;z.forEach(O=>w.current.delete(O)),M.fetchers.forEach((O,h)=>{O.data!==void 0&&w.current.set(h,O.data)});let Z=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!Y||Z){H?ac(()=>s(M)):b(()=>s(M));return}if(H){ac(()=>{d&&(f&&f.resolve(),d.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let O=r.window.document.startViewTransition(()=>{ac(()=>s(M))});O.finished.finally(()=>{ac(()=>{u(void 0),v(void 0),a(void 0),c({isTransitioning:!1})})}),ac(()=>v(O));return}d?(f&&f.resolve(),d.skipTransition(),y({state:M,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(a(M),c({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[r.window,d,f,w,b]);p.useLayoutEffect(()=>r.subscribe(S),[r,S]),p.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new oU)},[l]),p.useEffect(()=>{if(f&&o&&r.window){let M=o,L=f.promise,z=r.window.document.startViewTransition(async()=>{b(()=>s(M)),await L});z.finished.finally(()=>{u(void 0),v(void 0),a(void 0),c({isTransitioning:!1})}),v(z)}},[b,o,f,r.window]),p.useEffect(()=>{f&&o&&i.location.key===o.location.key&&f.resolve()},[f,d,i.location,o]),p.useEffect(()=>{!l.isTransitioning&&g&&(a(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[l.isTransitioning,g]),p.useEffect(()=>{},[]);let P=p.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:M=>r.navigate(M),push:(M,L,z)=>r.navigate(M,{state:L,preventScrollReset:z==null?void 0:z.preventScrollReset}),replace:(M,L,z)=>r.navigate(M,{replace:!0,state:L,preventScrollReset:z==null?void 0:z.preventScrollReset})}),[r]),_=r.basename||"/",D=p.useMemo(()=>({router:r,navigator:P,static:!1,basename:_}),[r,P,_]);return p.createElement(p.Fragment,null,p.createElement(TC.Provider,{value:D},p.createElement(MC.Provider,{value:i},p.createElement(rU.Provider,{value:w.current},p.createElement(tU.Provider,{value:l},p.createElement(QF,{basename:_,location:i.location,navigationType:i.historyAction,navigator:P,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},i.initialized||r.future.v7_partialHydration?p.createElement(lU,{routes:r.routes,future:r.future,state:i}):e))))),null)}function lU(t){let{routes:e,future:r,state:n}=t;return BF(e,void 0,n,r)}var k3;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(k3||(k3={}));var P3;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(P3||(P3={}));var cU="_1csw4y80 _1qxj1ib9 _1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8";const OC=t=>{const{value:e,digits:r=6,onChange:n,disabled:i=!1}=t,s=p.useMemo(()=>R3(0,r).map(()=>p.createRef()),[]);p.useEffect(()=>{var c,f;(f=(c=s[0])==null?void 0:c.current)==null||f.focus()},[]);const o=(c,f)=>{var d,v;/^\d$/.test(f)||(f="");const u=[...e];u[c]=f,f!==""&&((v=(d=s[c+1])==null?void 0:d.current)==null||v.focus()),n(u)},a=(c,f)=>{var g,y;const u=s[c].current,d=(g=s[c-1])==null?void 0:g.current,v=(y=s[c+1])==null?void 0:y.current;switch(f.key){case"Backspace":f.preventDefault(),u&&(u.value="",o(c,"")),d==null||d.focus();break;case"ArrowLeft":f.preventDefault(),d==null||d.focus();break;case"ArrowRight":f.preventDefault(),v==null||v.focus();break;default:(u==null?void 0:u.value)===f.key&&(f.preventDefault(),o(c,f.key))}},l=(c,f)=>{var v,g;const d=f.clipboardData.getData("text/plain").replace(/\D/g,"");/^\d{6}$/.test(d)&&((g=(v=s[0])==null?void 0:v.current)==null||g.focus(),n(d.split("")),setTimeout(()=>{var y,w;(w=(y=s[s.length-1])==null?void 0:y.current)==null||w.focus()}))};return $.jsx(re,{gap:"2",children:R3(0,r).map(c=>$.jsxs(p.Fragment,{children:[c===r/2&&$.jsx("span",{}),$.jsx(re,{as:"input",className:cU,value:e[c]||"",ref:s[c],type:"text",inputMode:"numeric",maxLength:1,disabled:i,onFocus:f=>f.target.select(),onPaste:f=>l(c,f),onChange:f=>o(c,f.target.value),onKeyDown:f=>{a(c,f)}})]},c))})},R3=(t,e)=>Array.from({length:e-t},(r,n)=>n+t),NC=()=>$.jsxs(re,{gap:"2",flexDirection:"column",borderStyle:"solid",width:"1/3",padding:"4",borderWidth:"thin",borderColor:"borderNormal",borderRadius:"sm",children:[$.jsx(Se,{variant:"xlarge",fontWeight:"bold",color:"gnosisLight",children:"Demo App"}),$.jsx(Se,{variant:"normal",marginLeft:"auto",color:"polygonLight",children:"Showcasing WaaS"})]});function fU(t={}){const{nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n}=t,[i,s]=p.useState(!1),o=p.useRef(r);o.current=r;const a=p.useRef(n);return a.current=n,p.useEffect(()=>{const l=document.createElement("script");return l.src="https://accounts.google.com/gsi/client",l.async=!0,l.defer=!0,l.nonce=e,l.onload=()=>{var c;s(!0),(c=o.current)===null||c===void 0||c.call(o)},l.onerror=()=>{var c;s(!1),(c=a.current)===null||c===void 0||c.call(a)},document.body.appendChild(l),()=>{document.body.removeChild(l)}},[e]),i}const DC=p.createContext(null);function uU({clientId:t,nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n,children:i}){const s=fU({nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n}),o=p.useMemo(()=>({clientId:t,scriptLoadedSuccessfully:s}),[t,s]);return gr.createElement(DC.Provider,{value:o},i)}function dU(){const t=p.useContext(DC);if(!t)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return t}function hU(t){var e;return(e=t==null?void 0:t.clientId)!==null&&e!==void 0?e:t==null?void 0:t.client_id}const vU={large:40,medium:32,small:20};function yU({onSuccess:t,onError:e,useOneTap:r,promptMomentNotification:n,type:i="standard",theme:s="outline",size:o="large",text:a,shape:l,logo_alignment:c,width:f,locale:u,click_listener:d,containerProps:v,...g}){const y=p.useRef(null),{clientId:w,scriptLoadedSuccessfully:x}=dU(),b=p.useRef(t);b.current=t;const S=p.useRef(e);S.current=e;const P=p.useRef(n);return P.current=n,p.useEffect(()=>{var _,D,M,L,z,H,Y,Z,O;if(x)return(M=(D=(_=window==null?void 0:window.google)===null||_===void 0?void 0:_.accounts)===null||D===void 0?void 0:D.id)===null||M===void 0||M.initialize({client_id:w,callback:h=>{var A;if(!(h!=null&&h.credential))return(A=S.current)===null||A===void 0?void 0:A.call(S);const{credential:k,select_by:I}=h;b.current({credential:k,clientId:hU(h),select_by:I})},...g}),(H=(z=(L=window==null?void 0:window.google)===null||L===void 0?void 0:L.accounts)===null||z===void 0?void 0:z.id)===null||H===void 0||H.renderButton(y.current,{type:i,theme:s,size:o,text:a,shape:l,logo_alignment:c,width:f,locale:u,click_listener:d}),r&&((O=(Z=(Y=window==null?void 0:window.google)===null||Y===void 0?void 0:Y.accounts)===null||Z===void 0?void 0:Z.id)===null||O===void 0||O.prompt(P.current)),()=>{var h,A,k;r&&((k=(A=(h=window==null?void 0:window.google)===null||h===void 0?void 0:h.accounts)===null||A===void 0?void 0:A.id)===null||k===void 0||k.cancel())}},[w,x,r,i,s,o,a,l,c,f,u]),gr.createElement("div",{...v,ref:y,style:{height:vU[o],...v==null?void 0:v.style}})}function pU(){var t,e,r;(r=(e=(t=window==null?void 0:window.google)===null||t===void 0?void 0:t.accounts)===null||e===void 0?void 0:e.id)===null||r===void 0||r.disableAutoSelect()}var LC={},m0={},Zf={};Object.defineProperty(Zf,"__esModule",{value:!0});Zf.default=void 0;var mU=p;function gU(t){(0,mU.useEffect)(function(){if(t){var e=document.querySelectorAll('script[src="'.concat(t,'"]'))[0];e||(e=document.createElement("script"),e.src=t,e.async=!0,document.body.appendChild(e))}},[t])}var xU=gU;Zf.default=xU;var eu={},g0={};Object.defineProperty(g0,"__esModule",{value:!0});g0.default=void 0;var bU=function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{pollFrequency:1e3,retries:100,parent:window},n=r.pollFrequency,i=n===void 0?1e3:n,s=r.retries,o=s===void 0?100:s,a=r.parent,l=a===void 0?window:a;if(l&&l.hasOwnProperty(e))return Promise.resolve(l[e]);if(!o)return Promise.resolve(void 0);var c=o-1;return new Promise(function(f){return setTimeout(f,typeof i=="function"?i({retries:c}):i)}).then(function(){return t(e,{pollFrequency:i,parent:l,retries:c})})},wU=bU;g0.default=wU;Object.defineProperty(eu,"__esModule",{value:!0});eu.default=void 0;var EU=AU(g0);function AU(t){return t&&t.__esModule?t:{default:t}}var SU="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",CU=function(e){var r=e.authOptions,n=e.onSuccess,i=e.onError;return(0,EU.default)("AppleID").then(function(){return window.AppleID||console.error(new Error("Error loading apple script")),window.AppleID.auth.init(r),window.AppleID.auth.signIn().then(function(s){return n&&n(s),s}).catch(function(s){return i?i(s):console.error(s),null})}).catch(function(s){return i?i(s):console.error(s),null})},kU={APPLE_SCRIPT_SRC:SU,signIn:CU};eu.default=kU;Object.defineProperty(m0,"__esModule",{value:!0});m0.default=void 0;var bi=yg(p),PU=yg(Zf),T3=yg(eu),RU=["onSuccess","onError","skipScript","authOptions","iconProps","render","uiType","className","noDefaultStyle","buttonExtraChildren"];function yg(t){return t&&t.__esModule?t:{default:t}}function fh(){return fh=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function _U(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}var OU=` .react-apple-signin-auth-btn { background-color: transparent; border: none; @@ -158,19 +158,19 @@ Defaulting to \`null\`.`}const tC="Radio",[iB,rC]=qr(tC),[sB,oB]=iB(tC),aB=p.for color: #FFF; border-color: #FFF; }`.replace(/ {2}|\n/g,""),NU=function(e){var r=e.onSuccess,n=e.onError,i=e.skipScript,s=i===void 0?!1:i,o=e.authOptions,a=e.iconProps,l=e.render,c=e.uiType,f=c===void 0?"dark":c,u=e.className,d=e.noDefaultStyle,v=d===void 0?!1:d,g=e.buttonExtraChildren,y=g===void 0?"Continue with Apple":g,w=IU(e,RU);(0,PU.default)(s?null:T3.default.APPLE_SCRIPT_SRC);var x=function(P){P&&(P.preventDefault(),P.stopPropagation()),T3.default.signIn({authOptions:o,onSuccess:r,onError:n})},b=TU({children:bi.default.createElement(bi.default.Fragment,null,bi.default.createElement("svg",fh({width:"24px",height:"44px",viewBox:"0 0 24 44"},a),bi.default.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},bi.default.createElement("rect",{fill:f==="light"?"#FFF":"#000",x:"0",y:"0",width:"24",height:"44"}),bi.default.createElement("path",{d:"M12.2337427,16.9879688 C12.8896607,16.9879688 13.7118677,16.5445313 14.2014966,15.9532812 C14.6449341,15.4174609 14.968274,14.6691602 14.968274,13.9208594 C14.968274,13.8192383 14.9590357,13.7176172 14.9405591,13.6344727 C14.2107349,13.6621875 13.3330982,14.1241016 12.8065162,14.7430664 C12.3907935,15.2142188 12.012024,15.9532812 12.012024,16.7108203 C12.012024,16.8216797 12.0305005,16.9325391 12.0397388,16.9694922 C12.0859302,16.9787305 12.1598365,16.9879688 12.2337427,16.9879688 Z M9.92417241,28.1662891 C10.8202857,28.1662891 11.2175318,27.5658008 12.3353638,27.5658008 C13.4716724,27.5658008 13.721106,28.1478125 14.7188404,28.1478125 C15.6980982,28.1478125 16.3540162,27.2424609 16.972981,26.3555859 C17.6658521,25.339375 17.9522388,24.3416406 17.9707154,24.2954492 C17.9060474,24.2769727 16.0306763,23.5101953 16.0306763,21.3576758 C16.0306763,19.491543 17.5088013,18.6508594 17.5919459,18.5861914 C16.612688,17.1819727 15.1253248,17.1450195 14.7188404,17.1450195 C13.6194849,17.1450195 12.7233716,17.8101758 12.1598365,17.8101758 C11.5501099,17.8101758 10.7463794,17.1819727 9.79483648,17.1819727 C7.98413335,17.1819727 6.14571538,18.6785742 6.14571538,21.5054883 C6.14571538,23.2607617 6.8293482,25.1176563 7.67003179,26.3186328 C8.39061773,27.3348438 9.01882085,28.1662891 9.92417241,28.1662891 Z",fill:f==="light"?"#000":"#FFF",fillRule:"nonzero"}))),y),onClick:x},w);return l?l(b):bi.default.createElement(bi.default.Fragment,null,bi.default.createElement("button",fh({className:"".concat(v?"":"react-apple-signin-auth-btn react-apple-signin-auth-btn-".concat(f)).concat(u?" ".concat(u):""),type:"button","aria-label":"Signin with apple ID"},b)),v?null:bi.default.createElement("style",null,OU))},DU=NU;m0.default=DU;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appleAuthHelpers",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"useScript",{enumerable:!0,get:function(){return n.default}}),t.default=void 0;var e=i(m0),r=i(eu),n=i(Zf);function i(o){return o&&o.__esModule?o:{default:o}}var s=e.default;t.default=s})(LC);const LU=Ss(LC);function uh(){return uh=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Vt({},n,i)).then(s=>Jt(s).then(o=>({status:o.status})),s=>{throw qt.new({cause:`fetch(): ${s.message||""}`})}),this.version=(n,i)=>this.fetch(this.url("Version"),Vt({},n,i)).then(s=>Jt(s).then(o=>({version:o.version})),s=>{throw qt.new({cause:`fetch(): ${s.message||""}`})}),this.runtimeStatus=(n,i)=>this.fetch(this.url("RuntimeStatus"),Vt({},n,i)).then(s=>Jt(s).then(o=>({status:o.status})),s=>{throw qt.new({cause:`fetch(): ${s.message||""}`})}),this.getChainID=(n,i)=>this.fetch(this.url("GetChainID"),Vt({},n,i)).then(s=>Jt(s).then(o=>({chainID:o.chainID})),s=>{throw qt.new({cause:`fetch(): ${s.message||""}`})}),this.getEtherBalance=(n,i,s)=>this.fetch(this.url("GetEtherBalance"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({balance:a.balance})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getTokenBalances=(n,i,s)=>this.fetch(this.url("GetTokenBalances"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({page:a.page,balances:a.balances})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getTokenSupplies=(n,i,s)=>this.fetch(this.url("GetTokenSupplies"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({page:a.page,contractType:a.contractType,tokenIDs:a.tokenIDs})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getTokenSuppliesMap=(n,i,s)=>this.fetch(this.url("GetTokenSuppliesMap"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({supplies:a.supplies})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getBalanceUpdates=(n,i,s)=>this.fetch(this.url("GetBalanceUpdates"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({page:a.page,balances:a.balances})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getTransactionHistory=(n,i,s)=>this.fetch(this.url("GetTransactionHistory"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.syncBalance=(n,i,s)=>this.fetch(this.url("SyncBalance"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.fetchTransactionReceipt=(n,i,s)=>this.fetch(this.url("FetchTransactionReceipt"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({receipt:a.receipt})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getOrderbookOrders=(n,i,s)=>this.fetch(this.url("GetOrderbookOrders"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({page:a.page,orders:a.orders})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getTopOrders=(n,i,s)=>this.fetch(this.url("GetTopOrders"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({orders:a.orders})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.fetchTransactionReceiptWithFilter=(n,i,s)=>this.fetch(this.url("FetchTransactionReceiptWithFilter"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({receipt:a.receipt})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getAllWebhookListeners=(n,i,s)=>this.fetch(this.url("GetAllWebhookListeners"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({listeners:a.listeners})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.getWebhookListener=(n,i,s)=>this.fetch(this.url("GetWebhookListener"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({listener:a.listener})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.addWebhookListener=(n,i,s)=>this.fetch(this.url("AddWebhookListener"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({status:a.status,listener:a.listener})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.updateWebhookListener=(n,i,s)=>this.fetch(this.url("UpdateWebhookListener"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({status:a.status})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.removeWebhookListener=(n,i,s)=>this.fetch(this.url("RemoveWebhookListener"),Vt(n,i,s)).then(o=>Jt(o).then(a=>({status:a.status})),o=>{throw qt.new({cause:`fetch(): ${o.message||""}`})}),this.subscribeReceipts=(n,i)=>{const s=()=>this.fetch(this.url("SubscribeReceipts"),Vt(n,i.headers,i.signal)).then(async function(o){await I3(o,i,s)},o=>{i.onError(o,s)});return s()},this.subscribeEvents=(n,i)=>{const s=()=>this.fetch(this.url("SubscribeEvents"),Vt(n,i.headers,i.signal)).then(async function(o){await I3(o,i,s)},o=>{i.onError(o,s)});return s()},this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const I3=async(t,e,r)=>{const{onMessage:n,onOpen:i,onClose:s,onError:o}=e;if(!t.ok){try{await Jt(t)}catch(v){o(v,r)}return}if(!t.body){o(dh.new({status:t.status,cause:"Invalid response, missing body"}),r);return}i&&i();const a=t.body.getReader(),l=new TextDecoder;let c="",f=Date.now();const u=(10+1)*1e3;let d;try{for(d=setInterval(()=>{if(Date.now()-f>u)throw hd.new({cause:"Stream timed out"})},u);;){let v,g;try{({value:v,done:g}=await a.read()),f=Date.now(),c+=l.decode(v,{stream:!0})}catch(w){let x="";w instanceof Error&&(x=w.message),w instanceof DOMException&&w.name==="AbortError"?o(qt.new({message:"AbortError",cause:`AbortError: ${x}`}),()=>{throw new Error("Abort signal cannot be used to reconnect")}):o(hd.new({cause:`reader.read(): ${x}`}),r);return}let y=c.split(` -`);for(let w=0;w({method:"POST",headers:uh({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Jt=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),dh.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(YC[n]||Pt).new(r)}return r});let Pt=class jC extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,jC.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}},BU=class BC extends Pt{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,BC.prototype)}},qt=class $C extends Pt{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,$C.prototype)}},$U=class FC extends Pt{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,FC.prototype)}},FU=class UC extends Pt{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,UC.prototype)}},UU=class zC extends Pt{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,zC.prototype)}},dh=class VC extends Pt{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,VC.prototype)}},zU=class qC extends Pt{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,qC.prototype)}},VU=class HC extends Pt{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,HC.prototype)}},qU=class WC extends Pt{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,WC.prototype)}},hd=class GC extends Pt{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,GC.prototype)}},HU=class KC extends Pt{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,KC.prototype)}},WU=class QC extends Pt{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,QC.prototype)}};class pg extends Pt{constructor(e="PermissionDenied",r=1001,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,pg.prototype)}}class mg extends Pt{constructor(e="SessionExpired",r=1002,n="Session expired",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,mg.prototype)}}class gg extends Pt{constructor(e="MethodNotFound",r=1003,n="Method not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,gg.prototype)}}class xg extends Pt{constructor(e="RequestConflict",r=1004,n="Conflict with target resource",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,xg.prototype)}}class bg extends Pt{constructor(e="Aborted",r=1005,n="Request aborted",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,bg.prototype)}}class wg extends Pt{constructor(e="Timeout",r=2e3,n="Request timed out",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,wg.prototype)}}class Eg extends Pt{constructor(e="InvalidArgument",r=2001,n="Invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Eg.prototype)}}class Ag extends Pt{constructor(e="Unavailable",r=2002,n="Unavailable resource",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ag.prototype)}}class Sg extends Pt{constructor(e="QueryFailed",r=2003,n="Query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Sg.prototype)}}class Cg extends Pt{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Cg.prototype)}}class kg extends Pt{constructor(e="ProjectNotFound",r=3002,n="Project not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,kg.prototype)}}class Pg extends Pt{constructor(e="MetadataCallFailed",r=3003,n="Metadata service call failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Pg.prototype)}}const YC={0:BU,[-1]:qt,[-2]:$U,[-3]:FU,[-4]:UU,[-5]:dh,[-6]:zU,[-7]:VU,[-8]:qU,[-9]:hd,[-10]:HU,1e3:WU,1001:pg,1002:mg,1003:gg,1004:xg,1005:bg,2e3:wg,2001:Eg,2002:Ag,2003:Sg,3e3:Cg,3002:kg,3003:Pg},_3=typeof global=="object"?global.fetch:window.fetch;class JC extends jU{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,_3),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,l=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),l&&l.length>0&&(o["X-Access-Key"]=l),s.headers=uh({},s.headers,o),_3(i,s)},this.fetch=this._fetch}}let X=function(t){return t[t.MAINNET=1]="MAINNET",t[t.ROPSTEN=3]="ROPSTEN",t[t.RINKEBY=4]="RINKEBY",t[t.GOERLI=5]="GOERLI",t[t.KOVAN=42]="KOVAN",t[t.SEPOLIA=11155111]="SEPOLIA",t[t.POLYGON=137]="POLYGON",t[t.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",t[t.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",t[t.POLYGON_AMOY=80002]="POLYGON_AMOY",t[t.BSC=56]="BSC",t[t.BSC_TESTNET=97]="BSC_TESTNET",t[t.OPTIMISM=10]="OPTIMISM",t[t.OPTIMISM_KOVAN=69]="OPTIMISM_KOVAN",t[t.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",t[t.OPTIMISM_SEPOLIA=11155420]="OPTIMISM_SEPOLIA",t[t.ARBITRUM=42161]="ARBITRUM",t[t.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",t[t.ARBITRUM_SEPOLIA=421614]="ARBITRUM_SEPOLIA",t[t.ARBITRUM_NOVA=42170]="ARBITRUM_NOVA",t[t.AVALANCHE=43114]="AVALANCHE",t[t.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",t[t.GNOSIS=100]="GNOSIS",t[t.BASE=8453]="BASE",t[t.BASE_GOERLI=84531]="BASE_GOERLI",t[t.BASE_SEPOLIA=84532]="BASE_SEPOLIA",t[t.HOMEVERSE_TESTNET=40875]="HOMEVERSE_TESTNET",t[t.HOMEVERSE=19011]="HOMEVERSE",t[t.XAI=660279]="XAI",t[t.XAI_SEPOLIA=37714555429]="XAI_SEPOLIA",t[t.ASTAR_ZKEVM=3776]="ASTAR_ZKEVM",t[t.ASTAR_ZKYOTO=6038361]="ASTAR_ZKYOTO",t[t.XR_SEPOLIA=2730]="XR_SEPOLIA",t[t.HARDHAT=31337]="HARDHAT",t[t.HARDHAT_2=31338]="HARDHAT_2",t}({}),qe=function(t){return t.MAINNET="mainnet",t.TESTNET="testnet",t}({});const it={[X.MAINNET]:{chainId:X.MAINNET,type:qe.MAINNET,name:"mainnet",title:"Ethereum",logoURI:`https://assets.sequence.info/images/networks/medium/${X.MAINNET}.webp`,blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[X.ROPSTEN]:{chainId:X.ROPSTEN,type:qe.TESTNET,name:"ropsten",title:"Ropsten",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ROPSTEN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[X.RINKEBY]:{chainId:X.RINKEBY,type:qe.TESTNET,name:"rinkeby",title:"Rinkeby",logoURI:`https://assets.sequence.info/images/networks/medium/${X.RINKEBY}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[X.GOERLI]:{chainId:X.GOERLI,type:qe.TESTNET,name:"goerli",title:"Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${X.GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[X.KOVAN]:{chainId:X.KOVAN,type:qe.TESTNET,name:"kovan",title:"Kovan",logoURI:`https://assets.sequence.info/images/networks/medium/${X.KOVAN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"},deprecated:!0},[X.SEPOLIA]:{chainId:X.SEPOLIA,type:qe.TESTNET,name:"sepolia",title:"Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Sepolia)",rootUrl:"https://sepolia.etherscan.io/"}},[X.POLYGON]:{chainId:X.POLYGON,type:qe.MAINNET,name:"polygon",title:"Polygon",logoURI:`https://assets.sequence.info/images/networks/medium/${X.POLYGON}.webp`,blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[X.POLYGON_MUMBAI]:{chainId:X.POLYGON_MUMBAI,type:qe.TESTNET,name:"mumbai",title:"Polygon Mumbai",logoURI:`https://assets.sequence.info/images/networks/medium/${X.POLYGON_MUMBAI}.webp`,testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"},deprecated:!0},[X.POLYGON_AMOY]:{chainId:X.POLYGON_AMOY,type:qe.TESTNET,name:"amoy",title:"Polygon Amoy",logoURI:`https://assets.sequence.info/images/networks/medium/${X.POLYGON_AMOY}.webp`,testnet:!0,blockExplorer:{name:"OKLink (Amoy)",rootUrl:"https://www.oklink.com/amoy"}},[X.POLYGON_ZKEVM]:{chainId:X.POLYGON_ZKEVM,type:qe.MAINNET,name:"polygon-zkevm",title:"Polygon zkEVM",logoURI:`https://assets.sequence.info/images/networks/medium/${X.POLYGON_ZKEVM}.webp`,blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"}},[X.BSC]:{chainId:X.BSC,type:qe.MAINNET,name:"bsc",title:"BNB Smart Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BSC}.webp`,blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[X.BSC_TESTNET]:{chainId:X.BSC_TESTNET,type:qe.TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BSC_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[X.OPTIMISM]:{chainId:X.OPTIMISM,type:qe.MAINNET,name:"optimism",title:"Optimism",logoURI:`https://assets.sequence.info/images/networks/medium/${X.OPTIMISM}.webp`,blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[X.OPTIMISM_KOVAN]:{chainId:X.OPTIMISM_KOVAN,type:qe.TESTNET,name:"optimism-kovan",title:"Optimistic Kovan",logoURI:`https://assets.sequence.info/images/networks/medium/${X.OPTIMISM_KOVAN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Kovan)",rootUrl:"https://kovan-optimistic.etherscan.io/"},deprecated:!0},[X.OPTIMISM_GOERLI]:{chainId:X.OPTIMISM_GOERLI,type:qe.TESTNET,name:"optimism-goerli",title:"Optimistic Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${X.OPTIMISM_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Goerli)",rootUrl:"https://goerli-optimistic.etherscan.io/"},deprecated:!0},[X.OPTIMISM_SEPOLIA]:{chainId:X.OPTIMISM_SEPOLIA,type:qe.TESTNET,name:"optimism-sepolia",title:"Optimistic Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.OPTIMISM_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Sepolia)",rootUrl:"https://sepolia-optimistic.etherscan.io/"}},[X.ARBITRUM]:{chainId:X.ARBITRUM,type:qe.MAINNET,name:"arbitrum",title:"Arbitrum One",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ARBITRUM}.webp`,blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[X.ARBITRUM_GOERLI]:{chainId:X.ARBITRUM_GOERLI,type:qe.TESTNET,name:"arbitrum-goerli",title:"Arbitrum Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ARBITRUM_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Arbiscan (Goerli Testnet)",rootUrl:"https://testnet.arbiscan.io/"},deprecated:!0},[X.ARBITRUM_SEPOLIA]:{chainId:X.ARBITRUM_SEPOLIA,type:qe.TESTNET,name:"arbitrum-sepolia",title:"Arbitrum Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ARBITRUM_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Arbiscan (Sepolia Testnet)",rootUrl:"https://sepolia.arbiscan.io/"}},[X.ARBITRUM_NOVA]:{chainId:X.ARBITRUM_NOVA,type:qe.MAINNET,name:"arbitrum-nova",title:"Arbitrum Nova",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ARBITRUM_NOVA}.webp`,blockExplorer:{name:"Arbiscan Nova",rootUrl:"https://nova.arbiscan.io/"}},[X.AVALANCHE]:{chainId:X.AVALANCHE,type:qe.MAINNET,name:"avalanche",title:"Avalanche",logoURI:`https://assets.sequence.info/images/networks/medium/${X.AVALANCHE}.webp`,blockExplorer:{name:"Snowtrace",rootUrl:"https://subnets.avax.network/c-chain/"}},[X.AVALANCHE_TESTNET]:{chainId:X.AVALANCHE_TESTNET,type:qe.TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${X.AVALANCHE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://subnets-test.avax.network/c-chain/"}},[X.GNOSIS]:{chainId:X.GNOSIS,type:qe.MAINNET,name:"gnosis",title:"Gnosis Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${X.GNOSIS}.webp`,blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[X.BASE]:{chainId:X.BASE,type:qe.MAINNET,name:"base",title:"Base (Coinbase)",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BASE}.webp`,blockExplorer:{name:"Base Explorer",rootUrl:"https://basescan.org/"}},[X.BASE_GOERLI]:{chainId:X.BASE_GOERLI,type:qe.TESTNET,name:"base-goerli",title:"Base Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BASE_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"},deprecated:!0},[X.BASE_SEPOLIA]:{chainId:X.BASE_SEPOLIA,type:qe.TESTNET,name:"base-sepolia",title:"Base Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BASE_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Base Sepolia Explorer",rootUrl:"https://base-sepolia.blockscout.com/"}},[X.HOMEVERSE]:{chainId:X.HOMEVERSE,type:qe.MAINNET,name:"homeverse",title:"Oasys Homeverse",logoURI:`https://assets.sequence.info/images/networks/medium/${X.HOMEVERSE}.webp`,blockExplorer:{name:"Oasys Homeverse Explorer",rootUrl:"https://explorer.oasys.homeverse.games/"}},[X.HOMEVERSE_TESTNET]:{chainId:X.HOMEVERSE_TESTNET,type:qe.TESTNET,name:"homeverse-testnet",title:"Oasys Homeverse Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${X.HOMEVERSE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Oasys Homeverse Explorer (Testnet)",rootUrl:"https://explorer.testnet.oasys.homeverse.games/"}},[X.XAI]:{chainId:X.XAI,type:qe.MAINNET,name:"xai",title:"Xai",logoURI:`https://assets.sequence.info/images/networks/medium/${X.XAI}.webp`,blockExplorer:{name:"Xai Explorer",rootUrl:"https://explorer.xai-chain.net/"}},[X.XAI_SEPOLIA]:{chainId:X.XAI_SEPOLIA,type:qe.TESTNET,name:"xai-sepolia",title:"Xai Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.XAI_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Xai Sepolia Explorer",rootUrl:"https://testnet-explorer-v2.xai-chain.net/"}},[X.ASTAR_ZKEVM]:{chainId:X.ASTAR_ZKEVM,type:qe.MAINNET,name:"astar-zkevm",title:"Astar zkEVM",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ASTAR_ZKEVM}.webp`,blockExplorer:{name:"Astar zkEVM Explorer",rootUrl:"https://astar-zkevm.explorer.startale.com/"}},[X.ASTAR_ZKYOTO]:{chainId:X.ASTAR_ZKYOTO,type:qe.TESTNET,name:"astar-zkyoto",title:"Astar zKyoto Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ASTAR_ZKYOTO}.webp`,testnet:!0,blockExplorer:{name:"Astar zKyoto Explorer",rootUrl:"https://astar-zkyoto.blockscout.com/"}},[X.XR_SEPOLIA]:{chainId:X.XR_SEPOLIA,type:qe.TESTNET,name:"xr-sepolia",title:"XR Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.XR_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"XR Sepolia Explorer",rootUrl:"https://xr-sepolia-testnet.explorer.caldera.xyz/"}},[X.HARDHAT]:{chainId:X.HARDHAT,name:"hardhat",title:"Hardhat (local testnet)"},[X.HARDHAT_2]:{chainId:X.HARDHAT_2,name:"hardhat2",title:"Hardhat (local testnet)"}};var Rg={exports:{}};const GU={},KU=Object.freeze(Object.defineProperty({__proto__:null,default:GU},Symbol.toStringTag,{value:"Module"})),QU=Ih(KU);Rg.exports;(function(t){(function(e,r){function n(O,h){if(!O)throw new Error(h||"Assertion failed")}function i(O,h){O.super_=h;var A=function(){};A.prototype=h.prototype,O.prototype=new A,O.prototype.constructor=O}function s(O,h,A){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((h==="le"||h==="be")&&(A=h,h=10),this._init(O||0,h||10,A||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=QU.Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,A){return h.cmp(A)>0?h:A},s.min=function(h,A){return h.cmp(A)<0?h:A},s.prototype._init=function(h,A,k){if(typeof h=="number")return this._initNumber(h,A,k);if(typeof h=="object")return this._initArray(h,A,k);A==="hex"&&(A=16),n(A===(A|0)&&A>=2&&A<=36),h=h.toString().replace(/\s+/g,"");var I=0;h[0]==="-"&&(I++,this.negative=1),I=0;I-=3)N=h[I]|h[I-1]<<8|h[I-2]<<16,this.words[R]|=N<>>26-j&67108863,j+=24,j>=26&&(j-=26,R++);else if(k==="le")for(I=0,R=0;I>>26-j&67108863,j+=24,j>=26&&(j-=26,R++);return this._strip()};function a(O,h){var A=O.charCodeAt(h);if(A>=48&&A<=57)return A-48;if(A>=65&&A<=70)return A-55;if(A>=97&&A<=102)return A-87;n(!1,"Invalid character in "+O)}function l(O,h,A){var k=a(O,A);return A-1>=h&&(k|=a(O,A-1)<<4),k}s.prototype._parseHex=function(h,A,k){this.length=Math.ceil((h.length-A)/6),this.words=new Array(this.length);for(var I=0;I=A;I-=2)j=l(h,A,I)<=18?(R-=18,N+=1,this.words[N]|=j>>>26):R+=8;else{var C=h.length-A;for(I=C%2===0?A+1:A;I=18?(R-=18,N+=1,this.words[N]|=j>>>26):R+=8}this._strip()};function c(O,h,A,k){for(var I=0,R=0,N=Math.min(O.length,A),j=h;j=49?R=C-49+10:C>=17?R=C-17+10:R=C,n(C>=0&&R1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{s.prototype.inspect=u}else s.prototype.inspect=u;function u(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],v=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(h,A){h=h||10,A=A|0||1;var k;if(h===16||h==="hex"){k="";for(var I=0,R=0,N=0;N>>24-I&16777215,I+=2,I>=26&&(I-=26,N--),R!==0||N!==this.length-1?k=d[6-C.length]+C+k:k=C+k}for(R!==0&&(k=R.toString(16)+k);k.length%A!==0;)k="0"+k;return this.negative!==0&&(k="-"+k),k}if(h===(h|0)&&h>=2&&h<=36){var m=v[h],T=g[h];k="";var F=this.clone();for(F.negative=0;!F.isZero();){var E=F.modrn(T).toString(h);F=F.idivn(T),F.isZero()?k=E+k:k=d[m-E.length]+E+k}for(this.isZero()&&(k="0"+k);k.length%A!==0;)k="0"+k;return this.negative!==0&&(k="-"+k),k}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(h,A){return this.toArrayLike(o,h,A)}),s.prototype.toArray=function(h,A){return this.toArrayLike(Array,h,A)};var y=function(h,A){return h.allocUnsafe?h.allocUnsafe(A):new h(A)};s.prototype.toArrayLike=function(h,A,k){this._strip();var I=this.byteLength(),R=k||Math.max(1,I);n(I<=R,"byte array longer than desired length"),n(R>0,"Requested array length <= 0");var N=y(h,R),j=A==="le"?"LE":"BE";return this["_toArrayLike"+j](N,I),N},s.prototype._toArrayLikeLE=function(h,A){for(var k=0,I=0,R=0,N=0;R>8&255),k>16&255),N===6?(k>24&255),I=0,N=0):(I=j>>>24,N+=2)}if(k=0&&(h[k--]=j>>8&255),k>=0&&(h[k--]=j>>16&255),N===6?(k>=0&&(h[k--]=j>>24&255),I=0,N=0):(I=j>>>24,N+=2)}if(k>=0)for(h[k--]=I;k>=0;)h[k--]=0},Math.clz32?s.prototype._countBits=function(h){return 32-Math.clz32(h)}:s.prototype._countBits=function(h){var A=h,k=0;return A>=4096&&(k+=13,A>>>=13),A>=64&&(k+=7,A>>>=7),A>=8&&(k+=4,A>>>=4),A>=2&&(k+=2,A>>>=2),k+A},s.prototype._zeroBits=function(h){if(h===0)return 26;var A=h,k=0;return A&8191||(k+=13,A>>>=13),A&127||(k+=7,A>>>=7),A&15||(k+=4,A>>>=4),A&3||(k+=2,A>>>=2),A&1||k++,k},s.prototype.bitLength=function(){var h=this.words[this.length-1],A=this._countBits(h);return(this.length-1)*26+A};function w(O){for(var h=new Array(O.bitLength()),A=0;A>>I&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,A=0;Ah.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var A;this.length>h.length?A=h:A=this;for(var k=0;kh.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var A,k;this.length>h.length?(A=this,k=h):(A=h,k=this);for(var I=0;Ih.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var A=Math.ceil(h/26)|0,k=h%26;this._expand(A),k>0&&A--;for(var I=0;I0&&(this.words[I]=~this.words[I]&67108863>>26-k),this._strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,A){n(typeof h=="number"&&h>=0);var k=h/26|0,I=h%26;return this._expand(k+1),A?this.words[k]=this.words[k]|1<h.length?(k=this,I=h):(k=h,I=this);for(var R=0,N=0;N>>26;for(;R!==0&&N>>26;if(this.length=k.length,R!==0)this.words[this.length]=R,this.length++;else if(k!==this)for(;Nh.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var A=this.iadd(h);return h.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var k=this.cmp(h);if(k===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,R;k>0?(I=this,R=h):(I=h,R=this);for(var N=0,j=0;j>26,this.words[j]=A&67108863;for(;N!==0&&j>26,this.words[j]=A&67108863;if(N===0&&j>>26,F=C&67108863,E=Math.min(m,h.length-1),B=Math.max(0,m-O.length+1);B<=E;B++){var V=m-B|0;I=O.words[V]|0,R=h.words[B]|0,N=I*R+F,T+=N/67108864|0,F=N&67108863}A.words[m]=F|0,C=T|0}return C!==0?A.words[m]=C|0:A.length--,A._strip()}var b=function(h,A,k){var I=h.words,R=A.words,N=k.words,j=0,C,m,T,F=I[0]|0,E=F&8191,B=F>>>13,V=I[1]|0,q=V&8191,K=V>>>13,oe=I[2]|0,ee=oe&8191,te=oe>>>13,Ie=I[3]|0,ue=Ie&8191,we=Ie>>>13,zt=I[4]|0,Ve=zt&8191,ot=zt>>>13,Jn=I[5]|0,at=Jn&8191,Ge=Jn>>>13,un=I[6]|0,Ze=un&8191,ft=un>>>13,Xn=I[7]|0,ze=Xn&8191,et=Xn>>>13,pi=I[8]|0,nt=pi&8191,pt=pi>>>13,_r=I[9]|0,ut=_r&8191,dt=_r>>>13,mi=R[0]|0,mt=mi&8191,ht=mi>>>13,In=R[1]|0,vt=In&8191,lt=In>>>13,Qi=R[2]|0,yt=Qi&8191,gt=Qi>>>13,gi=R[3]|0,xt=gi&8191,U=gi>>>13,G=R[4]|0,Q=G&8191,ie=G>>>13,he=R[5]|0,me=he&8191,de=he>>>13,ye=R[6]|0,ge=ye&8191,pe=ye>>>13,Rt=R[7]|0,_e=Rt&8191,ve=Rt>>>13,Ke=R[8]|0,Ce=Ke&8191,tt=Ke>>>13,Or=R[9]|0,Qe=Or&8191,Ye=Or>>>13;k.negative=h.negative^A.negative,k.length=19,C=Math.imul(E,mt),m=Math.imul(E,ht),m=m+Math.imul(B,mt)|0,T=Math.imul(B,ht);var Hr=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,C=Math.imul(q,mt),m=Math.imul(q,ht),m=m+Math.imul(K,mt)|0,T=Math.imul(K,ht),C=C+Math.imul(E,vt)|0,m=m+Math.imul(E,lt)|0,m=m+Math.imul(B,vt)|0,T=T+Math.imul(B,lt)|0;var cr=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(cr>>>26)|0,cr&=67108863,C=Math.imul(ee,mt),m=Math.imul(ee,ht),m=m+Math.imul(te,mt)|0,T=Math.imul(te,ht),C=C+Math.imul(q,vt)|0,m=m+Math.imul(q,lt)|0,m=m+Math.imul(K,vt)|0,T=T+Math.imul(K,lt)|0,C=C+Math.imul(E,yt)|0,m=m+Math.imul(E,gt)|0,m=m+Math.imul(B,yt)|0,T=T+Math.imul(B,gt)|0;var dn=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(dn>>>26)|0,dn&=67108863,C=Math.imul(ue,mt),m=Math.imul(ue,ht),m=m+Math.imul(we,mt)|0,T=Math.imul(we,ht),C=C+Math.imul(ee,vt)|0,m=m+Math.imul(ee,lt)|0,m=m+Math.imul(te,vt)|0,T=T+Math.imul(te,lt)|0,C=C+Math.imul(q,yt)|0,m=m+Math.imul(q,gt)|0,m=m+Math.imul(K,yt)|0,T=T+Math.imul(K,gt)|0,C=C+Math.imul(E,xt)|0,m=m+Math.imul(E,U)|0,m=m+Math.imul(B,xt)|0,T=T+Math.imul(B,U)|0;var hn=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(hn>>>26)|0,hn&=67108863,C=Math.imul(Ve,mt),m=Math.imul(Ve,ht),m=m+Math.imul(ot,mt)|0,T=Math.imul(ot,ht),C=C+Math.imul(ue,vt)|0,m=m+Math.imul(ue,lt)|0,m=m+Math.imul(we,vt)|0,T=T+Math.imul(we,lt)|0,C=C+Math.imul(ee,yt)|0,m=m+Math.imul(ee,gt)|0,m=m+Math.imul(te,yt)|0,T=T+Math.imul(te,gt)|0,C=C+Math.imul(q,xt)|0,m=m+Math.imul(q,U)|0,m=m+Math.imul(K,xt)|0,T=T+Math.imul(K,U)|0,C=C+Math.imul(E,Q)|0,m=m+Math.imul(E,ie)|0,m=m+Math.imul(B,Q)|0,T=T+Math.imul(B,ie)|0;var vn=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(vn>>>26)|0,vn&=67108863,C=Math.imul(at,mt),m=Math.imul(at,ht),m=m+Math.imul(Ge,mt)|0,T=Math.imul(Ge,ht),C=C+Math.imul(Ve,vt)|0,m=m+Math.imul(Ve,lt)|0,m=m+Math.imul(ot,vt)|0,T=T+Math.imul(ot,lt)|0,C=C+Math.imul(ue,yt)|0,m=m+Math.imul(ue,gt)|0,m=m+Math.imul(we,yt)|0,T=T+Math.imul(we,gt)|0,C=C+Math.imul(ee,xt)|0,m=m+Math.imul(ee,U)|0,m=m+Math.imul(te,xt)|0,T=T+Math.imul(te,U)|0,C=C+Math.imul(q,Q)|0,m=m+Math.imul(q,ie)|0,m=m+Math.imul(K,Q)|0,T=T+Math.imul(K,ie)|0,C=C+Math.imul(E,me)|0,m=m+Math.imul(E,de)|0,m=m+Math.imul(B,me)|0,T=T+Math.imul(B,de)|0;var De=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(De>>>26)|0,De&=67108863,C=Math.imul(Ze,mt),m=Math.imul(Ze,ht),m=m+Math.imul(ft,mt)|0,T=Math.imul(ft,ht),C=C+Math.imul(at,vt)|0,m=m+Math.imul(at,lt)|0,m=m+Math.imul(Ge,vt)|0,T=T+Math.imul(Ge,lt)|0,C=C+Math.imul(Ve,yt)|0,m=m+Math.imul(Ve,gt)|0,m=m+Math.imul(ot,yt)|0,T=T+Math.imul(ot,gt)|0,C=C+Math.imul(ue,xt)|0,m=m+Math.imul(ue,U)|0,m=m+Math.imul(we,xt)|0,T=T+Math.imul(we,U)|0,C=C+Math.imul(ee,Q)|0,m=m+Math.imul(ee,ie)|0,m=m+Math.imul(te,Q)|0,T=T+Math.imul(te,ie)|0,C=C+Math.imul(q,me)|0,m=m+Math.imul(q,de)|0,m=m+Math.imul(K,me)|0,T=T+Math.imul(K,de)|0,C=C+Math.imul(E,ge)|0,m=m+Math.imul(E,pe)|0,m=m+Math.imul(B,ge)|0,T=T+Math.imul(B,pe)|0;var fr=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,C=Math.imul(ze,mt),m=Math.imul(ze,ht),m=m+Math.imul(et,mt)|0,T=Math.imul(et,ht),C=C+Math.imul(Ze,vt)|0,m=m+Math.imul(Ze,lt)|0,m=m+Math.imul(ft,vt)|0,T=T+Math.imul(ft,lt)|0,C=C+Math.imul(at,yt)|0,m=m+Math.imul(at,gt)|0,m=m+Math.imul(Ge,yt)|0,T=T+Math.imul(Ge,gt)|0,C=C+Math.imul(Ve,xt)|0,m=m+Math.imul(Ve,U)|0,m=m+Math.imul(ot,xt)|0,T=T+Math.imul(ot,U)|0,C=C+Math.imul(ue,Q)|0,m=m+Math.imul(ue,ie)|0,m=m+Math.imul(we,Q)|0,T=T+Math.imul(we,ie)|0,C=C+Math.imul(ee,me)|0,m=m+Math.imul(ee,de)|0,m=m+Math.imul(te,me)|0,T=T+Math.imul(te,de)|0,C=C+Math.imul(q,ge)|0,m=m+Math.imul(q,pe)|0,m=m+Math.imul(K,ge)|0,T=T+Math.imul(K,pe)|0,C=C+Math.imul(E,_e)|0,m=m+Math.imul(E,ve)|0,m=m+Math.imul(B,_e)|0,T=T+Math.imul(B,ve)|0;var Nr=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,C=Math.imul(nt,mt),m=Math.imul(nt,ht),m=m+Math.imul(pt,mt)|0,T=Math.imul(pt,ht),C=C+Math.imul(ze,vt)|0,m=m+Math.imul(ze,lt)|0,m=m+Math.imul(et,vt)|0,T=T+Math.imul(et,lt)|0,C=C+Math.imul(Ze,yt)|0,m=m+Math.imul(Ze,gt)|0,m=m+Math.imul(ft,yt)|0,T=T+Math.imul(ft,gt)|0,C=C+Math.imul(at,xt)|0,m=m+Math.imul(at,U)|0,m=m+Math.imul(Ge,xt)|0,T=T+Math.imul(Ge,U)|0,C=C+Math.imul(Ve,Q)|0,m=m+Math.imul(Ve,ie)|0,m=m+Math.imul(ot,Q)|0,T=T+Math.imul(ot,ie)|0,C=C+Math.imul(ue,me)|0,m=m+Math.imul(ue,de)|0,m=m+Math.imul(we,me)|0,T=T+Math.imul(we,de)|0,C=C+Math.imul(ee,ge)|0,m=m+Math.imul(ee,pe)|0,m=m+Math.imul(te,ge)|0,T=T+Math.imul(te,pe)|0,C=C+Math.imul(q,_e)|0,m=m+Math.imul(q,ve)|0,m=m+Math.imul(K,_e)|0,T=T+Math.imul(K,ve)|0,C=C+Math.imul(E,Ce)|0,m=m+Math.imul(E,tt)|0,m=m+Math.imul(B,Ce)|0,T=T+Math.imul(B,tt)|0;var Yt=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,C=Math.imul(ut,mt),m=Math.imul(ut,ht),m=m+Math.imul(dt,mt)|0,T=Math.imul(dt,ht),C=C+Math.imul(nt,vt)|0,m=m+Math.imul(nt,lt)|0,m=m+Math.imul(pt,vt)|0,T=T+Math.imul(pt,lt)|0,C=C+Math.imul(ze,yt)|0,m=m+Math.imul(ze,gt)|0,m=m+Math.imul(et,yt)|0,T=T+Math.imul(et,gt)|0,C=C+Math.imul(Ze,xt)|0,m=m+Math.imul(Ze,U)|0,m=m+Math.imul(ft,xt)|0,T=T+Math.imul(ft,U)|0,C=C+Math.imul(at,Q)|0,m=m+Math.imul(at,ie)|0,m=m+Math.imul(Ge,Q)|0,T=T+Math.imul(Ge,ie)|0,C=C+Math.imul(Ve,me)|0,m=m+Math.imul(Ve,de)|0,m=m+Math.imul(ot,me)|0,T=T+Math.imul(ot,de)|0,C=C+Math.imul(ue,ge)|0,m=m+Math.imul(ue,pe)|0,m=m+Math.imul(we,ge)|0,T=T+Math.imul(we,pe)|0,C=C+Math.imul(ee,_e)|0,m=m+Math.imul(ee,ve)|0,m=m+Math.imul(te,_e)|0,T=T+Math.imul(te,ve)|0,C=C+Math.imul(q,Ce)|0,m=m+Math.imul(q,tt)|0,m=m+Math.imul(K,Ce)|0,T=T+Math.imul(K,tt)|0,C=C+Math.imul(E,Qe)|0,m=m+Math.imul(E,Ye)|0,m=m+Math.imul(B,Qe)|0,T=T+Math.imul(B,Ye)|0;var Yi=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,C=Math.imul(ut,vt),m=Math.imul(ut,lt),m=m+Math.imul(dt,vt)|0,T=Math.imul(dt,lt),C=C+Math.imul(nt,yt)|0,m=m+Math.imul(nt,gt)|0,m=m+Math.imul(pt,yt)|0,T=T+Math.imul(pt,gt)|0,C=C+Math.imul(ze,xt)|0,m=m+Math.imul(ze,U)|0,m=m+Math.imul(et,xt)|0,T=T+Math.imul(et,U)|0,C=C+Math.imul(Ze,Q)|0,m=m+Math.imul(Ze,ie)|0,m=m+Math.imul(ft,Q)|0,T=T+Math.imul(ft,ie)|0,C=C+Math.imul(at,me)|0,m=m+Math.imul(at,de)|0,m=m+Math.imul(Ge,me)|0,T=T+Math.imul(Ge,de)|0,C=C+Math.imul(Ve,ge)|0,m=m+Math.imul(Ve,pe)|0,m=m+Math.imul(ot,ge)|0,T=T+Math.imul(ot,pe)|0,C=C+Math.imul(ue,_e)|0,m=m+Math.imul(ue,ve)|0,m=m+Math.imul(we,_e)|0,T=T+Math.imul(we,ve)|0,C=C+Math.imul(ee,Ce)|0,m=m+Math.imul(ee,tt)|0,m=m+Math.imul(te,Ce)|0,T=T+Math.imul(te,tt)|0,C=C+Math.imul(q,Qe)|0,m=m+Math.imul(q,Ye)|0,m=m+Math.imul(K,Qe)|0,T=T+Math.imul(K,Ye)|0;var ma=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(ma>>>26)|0,ma&=67108863,C=Math.imul(ut,yt),m=Math.imul(ut,gt),m=m+Math.imul(dt,yt)|0,T=Math.imul(dt,gt),C=C+Math.imul(nt,xt)|0,m=m+Math.imul(nt,U)|0,m=m+Math.imul(pt,xt)|0,T=T+Math.imul(pt,U)|0,C=C+Math.imul(ze,Q)|0,m=m+Math.imul(ze,ie)|0,m=m+Math.imul(et,Q)|0,T=T+Math.imul(et,ie)|0,C=C+Math.imul(Ze,me)|0,m=m+Math.imul(Ze,de)|0,m=m+Math.imul(ft,me)|0,T=T+Math.imul(ft,de)|0,C=C+Math.imul(at,ge)|0,m=m+Math.imul(at,pe)|0,m=m+Math.imul(Ge,ge)|0,T=T+Math.imul(Ge,pe)|0,C=C+Math.imul(Ve,_e)|0,m=m+Math.imul(Ve,ve)|0,m=m+Math.imul(ot,_e)|0,T=T+Math.imul(ot,ve)|0,C=C+Math.imul(ue,Ce)|0,m=m+Math.imul(ue,tt)|0,m=m+Math.imul(we,Ce)|0,T=T+Math.imul(we,tt)|0,C=C+Math.imul(ee,Qe)|0,m=m+Math.imul(ee,Ye)|0,m=m+Math.imul(te,Qe)|0,T=T+Math.imul(te,Ye)|0;var Wl=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Wl>>>26)|0,Wl&=67108863,C=Math.imul(ut,xt),m=Math.imul(ut,U),m=m+Math.imul(dt,xt)|0,T=Math.imul(dt,U),C=C+Math.imul(nt,Q)|0,m=m+Math.imul(nt,ie)|0,m=m+Math.imul(pt,Q)|0,T=T+Math.imul(pt,ie)|0,C=C+Math.imul(ze,me)|0,m=m+Math.imul(ze,de)|0,m=m+Math.imul(et,me)|0,T=T+Math.imul(et,de)|0,C=C+Math.imul(Ze,ge)|0,m=m+Math.imul(Ze,pe)|0,m=m+Math.imul(ft,ge)|0,T=T+Math.imul(ft,pe)|0,C=C+Math.imul(at,_e)|0,m=m+Math.imul(at,ve)|0,m=m+Math.imul(Ge,_e)|0,T=T+Math.imul(Ge,ve)|0,C=C+Math.imul(Ve,Ce)|0,m=m+Math.imul(Ve,tt)|0,m=m+Math.imul(ot,Ce)|0,T=T+Math.imul(ot,tt)|0,C=C+Math.imul(ue,Qe)|0,m=m+Math.imul(ue,Ye)|0,m=m+Math.imul(we,Qe)|0,T=T+Math.imul(we,Ye)|0;var D0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(D0>>>26)|0,D0&=67108863,C=Math.imul(ut,Q),m=Math.imul(ut,ie),m=m+Math.imul(dt,Q)|0,T=Math.imul(dt,ie),C=C+Math.imul(nt,me)|0,m=m+Math.imul(nt,de)|0,m=m+Math.imul(pt,me)|0,T=T+Math.imul(pt,de)|0,C=C+Math.imul(ze,ge)|0,m=m+Math.imul(ze,pe)|0,m=m+Math.imul(et,ge)|0,T=T+Math.imul(et,pe)|0,C=C+Math.imul(Ze,_e)|0,m=m+Math.imul(Ze,ve)|0,m=m+Math.imul(ft,_e)|0,T=T+Math.imul(ft,ve)|0,C=C+Math.imul(at,Ce)|0,m=m+Math.imul(at,tt)|0,m=m+Math.imul(Ge,Ce)|0,T=T+Math.imul(Ge,tt)|0,C=C+Math.imul(Ve,Qe)|0,m=m+Math.imul(Ve,Ye)|0,m=m+Math.imul(ot,Qe)|0,T=T+Math.imul(ot,Ye)|0;var L0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(L0>>>26)|0,L0&=67108863,C=Math.imul(ut,me),m=Math.imul(ut,de),m=m+Math.imul(dt,me)|0,T=Math.imul(dt,de),C=C+Math.imul(nt,ge)|0,m=m+Math.imul(nt,pe)|0,m=m+Math.imul(pt,ge)|0,T=T+Math.imul(pt,pe)|0,C=C+Math.imul(ze,_e)|0,m=m+Math.imul(ze,ve)|0,m=m+Math.imul(et,_e)|0,T=T+Math.imul(et,ve)|0,C=C+Math.imul(Ze,Ce)|0,m=m+Math.imul(Ze,tt)|0,m=m+Math.imul(ft,Ce)|0,T=T+Math.imul(ft,tt)|0,C=C+Math.imul(at,Qe)|0,m=m+Math.imul(at,Ye)|0,m=m+Math.imul(Ge,Qe)|0,T=T+Math.imul(Ge,Ye)|0;var j0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(j0>>>26)|0,j0&=67108863,C=Math.imul(ut,ge),m=Math.imul(ut,pe),m=m+Math.imul(dt,ge)|0,T=Math.imul(dt,pe),C=C+Math.imul(nt,_e)|0,m=m+Math.imul(nt,ve)|0,m=m+Math.imul(pt,_e)|0,T=T+Math.imul(pt,ve)|0,C=C+Math.imul(ze,Ce)|0,m=m+Math.imul(ze,tt)|0,m=m+Math.imul(et,Ce)|0,T=T+Math.imul(et,tt)|0,C=C+Math.imul(Ze,Qe)|0,m=m+Math.imul(Ze,Ye)|0,m=m+Math.imul(ft,Qe)|0,T=T+Math.imul(ft,Ye)|0;var B0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(B0>>>26)|0,B0&=67108863,C=Math.imul(ut,_e),m=Math.imul(ut,ve),m=m+Math.imul(dt,_e)|0,T=Math.imul(dt,ve),C=C+Math.imul(nt,Ce)|0,m=m+Math.imul(nt,tt)|0,m=m+Math.imul(pt,Ce)|0,T=T+Math.imul(pt,tt)|0,C=C+Math.imul(ze,Qe)|0,m=m+Math.imul(ze,Ye)|0,m=m+Math.imul(et,Qe)|0,T=T+Math.imul(et,Ye)|0;var $0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+($0>>>26)|0,$0&=67108863,C=Math.imul(ut,Ce),m=Math.imul(ut,tt),m=m+Math.imul(dt,Ce)|0,T=Math.imul(dt,tt),C=C+Math.imul(nt,Qe)|0,m=m+Math.imul(nt,Ye)|0,m=m+Math.imul(pt,Qe)|0,T=T+Math.imul(pt,Ye)|0;var F0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(F0>>>26)|0,F0&=67108863,C=Math.imul(ut,Qe),m=Math.imul(ut,Ye),m=m+Math.imul(dt,Qe)|0,T=Math.imul(dt,Ye);var U0=(j+C|0)+((m&8191)<<13)|0;return j=(T+(m>>>13)|0)+(U0>>>26)|0,U0&=67108863,N[0]=Hr,N[1]=cr,N[2]=dn,N[3]=hn,N[4]=vn,N[5]=De,N[6]=fr,N[7]=Nr,N[8]=Yt,N[9]=Yi,N[10]=ma,N[11]=Wl,N[12]=D0,N[13]=L0,N[14]=j0,N[15]=B0,N[16]=$0,N[17]=F0,N[18]=U0,j!==0&&(N[19]=j,k.length++),k};Math.imul||(b=x);function S(O,h,A){A.negative=h.negative^O.negative,A.length=O.length+h.length;for(var k=0,I=0,R=0;R>>26)|0,I+=N>>>26,N&=67108863}A.words[R]=j,k=N,N=I}return k!==0?A.words[R]=k:A.length--,A._strip()}function P(O,h,A){return S(O,h,A)}s.prototype.mulTo=function(h,A){var k,I=this.length+h.length;return this.length===10&&h.length===10?k=b(this,h,A):I<63?k=x(this,h,A):I<1024?k=S(this,h,A):k=P(this,h,A),k},s.prototype.mul=function(h){var A=new s(null);return A.words=new Array(this.length+h.length),this.mulTo(h,A)},s.prototype.mulf=function(h){var A=new s(null);return A.words=new Array(this.length+h.length),P(this,h,A)},s.prototype.imul=function(h){return this.clone().mulTo(h,this)},s.prototype.imuln=function(h){var A=h<0;A&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var k=0,I=0;I>=26,k+=R/67108864|0,k+=N>>>26,this.words[I]=N&67108863}return k!==0&&(this.words[I]=k,this.length++),A?this.ineg():this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var A=w(h);if(A.length===0)return new s(1);for(var k=this,I=0;I=0);var A=h%26,k=(h-A)/26,I=67108863>>>26-A<<26-A,R;if(A!==0){var N=0;for(R=0;R>>26-A}N&&(this.words[R]=N,this.length++)}if(k!==0){for(R=this.length-1;R>=0;R--)this.words[R+k]=this.words[R];for(R=0;R=0);var I;A?I=(A-A%26)/26:I=0;var R=h%26,N=Math.min((h-R)/26,this.length),j=67108863^67108863>>>R<N)for(this.length-=N,m=0;m=0&&(T!==0||m>=I);m--){var F=this.words[m]|0;this.words[m]=T<<26-R|F>>>R,T=F&j}return C&&T!==0&&(C.words[C.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(h,A,k){return n(this.negative===0),this.iushrn(h,A,k)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var A=h%26,k=(h-A)/26,I=1<=0);var A=h%26,k=(h-A)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=k)return this;if(A!==0&&k++,this.length=Math.min(k,this.length),A!==0){var I=67108863^67108863>>>A<=67108864;A++)this.words[A]-=67108864,A===this.length-1?this.words[A+1]=1:this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},s.prototype.isubn=function(h){if(n(typeof h=="number"),n(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A>26)-(C/67108864|0),this.words[R+k]=N&67108863}for(;R>26,this.words[R+k]=N&67108863;if(j===0)return this._strip();for(n(j===-1),j=0,R=0;R>26,this.words[R]=N&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(h,A){var k=this.length-h.length,I=this.clone(),R=h,N=R.words[R.length-1]|0,j=this._countBits(N);k=26-j,k!==0&&(R=R.ushln(k),I.iushln(k),N=R.words[R.length-1]|0);var C=I.length-R.length,m;if(A!=="mod"){m=new s(null),m.length=C+1,m.words=new Array(m.length);for(var T=0;T=0;E--){var B=(I.words[R.length+E]|0)*67108864+(I.words[R.length+E-1]|0);for(B=Math.min(B/N|0,67108863),I._ishlnsubmul(R,B,E);I.negative!==0;)B--,I.negative=0,I._ishlnsubmul(R,1,E),I.isZero()||(I.negative^=1);m&&(m.words[E]=B)}return m&&m._strip(),I._strip(),A!=="div"&&k!==0&&I.iushrn(k),{div:m||null,mod:I}},s.prototype.divmod=function(h,A,k){if(n(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var I,R,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,A),A!=="mod"&&(I=N.div.neg()),A!=="div"&&(R=N.mod.neg(),k&&R.negative!==0&&R.iadd(h)),{div:I,mod:R}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),A),A!=="mod"&&(I=N.div.neg()),{div:I,mod:N.mod}):this.negative&h.negative?(N=this.neg().divmod(h.neg(),A),A!=="div"&&(R=N.mod.neg(),k&&R.negative!==0&&R.isub(h)),{div:N.div,mod:R}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?A==="div"?{div:this.divn(h.words[0]),mod:null}:A==="mod"?{div:null,mod:new s(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modrn(h.words[0]))}:this._wordDiv(h,A)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var A=this.divmod(h);if(A.mod.isZero())return A.div;var k=A.div.negative!==0?A.mod.isub(h):A.mod,I=h.ushrn(1),R=h.andln(1),N=k.cmp(I);return N<0||R===1&&N===0?A.div:A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},s.prototype.modrn=function(h){var A=h<0;A&&(h=-h),n(h<=67108863);for(var k=(1<<26)%h,I=0,R=this.length-1;R>=0;R--)I=(k*I+(this.words[R]|0))%h;return A?-I:I},s.prototype.modn=function(h){return this.modrn(h)},s.prototype.idivn=function(h){var A=h<0;A&&(h=-h),n(h<=67108863);for(var k=0,I=this.length-1;I>=0;I--){var R=(this.words[I]|0)+k*67108864;this.words[I]=R/h|0,k=R%h}return this._strip(),A?this.ineg():this},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var A=this,k=h.clone();A.negative!==0?A=A.umod(h):A=A.clone();for(var I=new s(1),R=new s(0),N=new s(0),j=new s(1),C=0;A.isEven()&&k.isEven();)A.iushrn(1),k.iushrn(1),++C;for(var m=k.clone(),T=A.clone();!A.isZero();){for(var F=0,E=1;!(A.words[0]&E)&&F<26;++F,E<<=1);if(F>0)for(A.iushrn(F);F-- >0;)(I.isOdd()||R.isOdd())&&(I.iadd(m),R.isub(T)),I.iushrn(1),R.iushrn(1);for(var B=0,V=1;!(k.words[0]&V)&&B<26;++B,V<<=1);if(B>0)for(k.iushrn(B);B-- >0;)(N.isOdd()||j.isOdd())&&(N.iadd(m),j.isub(T)),N.iushrn(1),j.iushrn(1);A.cmp(k)>=0?(A.isub(k),I.isub(N),R.isub(j)):(k.isub(A),N.isub(I),j.isub(R))}return{a:N,b:j,gcd:k.iushln(C)}},s.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var A=this,k=h.clone();A.negative!==0?A=A.umod(h):A=A.clone();for(var I=new s(1),R=new s(0),N=k.clone();A.cmpn(1)>0&&k.cmpn(1)>0;){for(var j=0,C=1;!(A.words[0]&C)&&j<26;++j,C<<=1);if(j>0)for(A.iushrn(j);j-- >0;)I.isOdd()&&I.iadd(N),I.iushrn(1);for(var m=0,T=1;!(k.words[0]&T)&&m<26;++m,T<<=1);if(m>0)for(k.iushrn(m);m-- >0;)R.isOdd()&&R.iadd(N),R.iushrn(1);A.cmp(k)>=0?(A.isub(k),I.isub(R)):(k.isub(A),R.isub(I))}var F;return A.cmpn(1)===0?F=I:F=R,F.cmpn(0)<0&&F.iadd(h),F},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var A=this.clone(),k=h.clone();A.negative=0,k.negative=0;for(var I=0;A.isEven()&&k.isEven();I++)A.iushrn(1),k.iushrn(1);do{for(;A.isEven();)A.iushrn(1);for(;k.isEven();)k.iushrn(1);var R=A.cmp(k);if(R<0){var N=A;A=k,k=N}else if(R===0||k.cmpn(1)===0)break;A.isub(k)}while(!0);return k.iushln(I)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){n(typeof h=="number");var A=h%26,k=(h-A)/26,I=1<>>26,j&=67108863,this.words[N]=j}return R!==0&&(this.words[N]=R,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var A=h<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this._strip();var k;if(this.length>1)k=1;else{A&&(h=-h),n(h<=67108863,"Number is too big");var I=this.words[0]|0;k=I===h?0:Ih.length)return 1;if(this.length=0;k--){var I=this.words[k]|0,R=h.words[k]|0;if(I!==R){IR&&(A=1);break}}return A},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new Y(h)},s.prototype.toRed=function(h){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(h){return n(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var _={k256:null,p224:null,p192:null,p25519:null};function D(O,h){this.name=O,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},D.prototype.ireduce=function(h){var A=h,k;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),k=A.bitLength();while(k>this.n);var I=k0?A.isub(this.p):A.strip!==void 0?A.strip():A._strip(),A},D.prototype.split=function(h,A){h.iushrn(this.n,0,A)},D.prototype.imulK=function(h){return h.imul(this.k)};function M(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(M,D),M.prototype.split=function(h,A){for(var k=4194303,I=Math.min(h.length,9),R=0;R>>22,N=j}N>>>=22,h.words[R-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},M.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var A=0,k=0;k>>=26,h.words[k]=R,A=I}return A!==0&&(h.words[h.length++]=A),h},s._prime=function(h){if(_[h])return _[h];var A;if(h==="k256")A=new M;else if(h==="p224")A=new L;else if(h==="p192")A=new z;else if(h==="p25519")A=new H;else throw new Error("Unknown prime "+h);return _[h]=A,A};function Y(O){if(typeof O=="string"){var h=s._prime(O);this.m=h.p,this.prime=h}else n(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}Y.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},Y.prototype._verify2=function(h,A){n((h.negative|A.negative)===0,"red works only with positives"),n(h.red&&h.red===A.red,"red works only with red numbers")},Y.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(f(h,h.umod(this.m)._forceRed(this)),h)},Y.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},Y.prototype.add=function(h,A){this._verify2(h,A);var k=h.add(A);return k.cmp(this.m)>=0&&k.isub(this.m),k._forceRed(this)},Y.prototype.iadd=function(h,A){this._verify2(h,A);var k=h.iadd(A);return k.cmp(this.m)>=0&&k.isub(this.m),k},Y.prototype.sub=function(h,A){this._verify2(h,A);var k=h.sub(A);return k.cmpn(0)<0&&k.iadd(this.m),k._forceRed(this)},Y.prototype.isub=function(h,A){this._verify2(h,A);var k=h.isub(A);return k.cmpn(0)<0&&k.iadd(this.m),k},Y.prototype.shl=function(h,A){return this._verify1(h),this.imod(h.ushln(A))},Y.prototype.imul=function(h,A){return this._verify2(h,A),this.imod(h.imul(A))},Y.prototype.mul=function(h,A){return this._verify2(h,A),this.imod(h.mul(A))},Y.prototype.isqr=function(h){return this.imul(h,h.clone())},Y.prototype.sqr=function(h){return this.mul(h,h)},Y.prototype.sqrt=function(h){if(h.isZero())return h.clone();var A=this.m.andln(3);if(n(A%2===1),A===3){var k=this.m.add(new s(1)).iushrn(2);return this.pow(h,k)}for(var I=this.m.subn(1),R=0;!I.isZero()&&I.andln(1)===0;)R++,I.iushrn(1);n(!I.isZero());var N=new s(1).toRed(this),j=N.redNeg(),C=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new s(2*m*m).toRed(this);this.pow(m,C).cmp(j)!==0;)m.redIAdd(j);for(var T=this.pow(m,I),F=this.pow(h,I.addn(1).iushrn(1)),E=this.pow(h,I),B=R;E.cmp(N)!==0;){for(var V=E,q=0;V.cmp(N)!==0;q++)V=V.redSqr();n(q=0;R--){for(var T=A.words[R],F=m-1;F>=0;F--){var E=T>>F&1;if(N!==I[0]&&(N=this.sqr(N)),E===0&&j===0){C=0;continue}j<<=1,j|=E,C++,!(C!==k&&(R!==0||F!==0))&&(N=this.mul(N,I[j]),C=0,j=0)}m=26}return N},Y.prototype.convertTo=function(h){var A=h.umod(this.m);return A===h?A.clone():A},Y.prototype.convertFrom=function(h){var A=h.clone();return A.red=null,A},s.mont=function(h){return new Z(h)};function Z(O){Y.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Z,Y),Z.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},Z.prototype.convertFrom=function(h){var A=this.imod(h.mul(this.rinv));return A.red=null,A},Z.prototype.imul=function(h,A){if(h.isZero()||A.isZero())return h.words[0]=0,h.length=1,h;var k=h.imul(A),I=k.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=k.isub(I).iushrn(this.shift),N=R;return R.cmp(this.m)>=0?N=R.isub(this.m):R.cmpn(0)<0&&(N=R.iadd(this.m)),N._forceRed(this)},Z.prototype.mul=function(h,A){if(h.isZero()||A.isZero())return new s(0)._forceRed(this);var k=h.mul(A),I=k.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=k.isub(I).iushrn(this.shift),N=R;return R.cmp(this.m)>=0?N=R.isub(this.m):R.cmpn(0)<0&&(N=R.iadd(this.m)),N._forceRed(this)},Z.prototype.invm=function(h){var A=this.imod(h._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(t,aA)})(Rg);var YU=Rg.exports;const Oe=Ss(YU),JU="logger/5.7.0";let O3=!1,N3=!1;const vd={debug:1,default:2,info:2,warning:3,error:4,off:5};let D3=vd.default,F1=null;function XU(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const L3=XU();var Yy;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Yy||(Yy={}));var oi;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(oi||(oi={}));const j3="0123456789abcdef";let W=class dr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();vd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(D3>vd[n])&&console.log.apply(console,r)}debug(...e){this._log(dr.levels.DEBUG,e)}info(...e){this._log(dr.levels.INFO,e)}warn(...e){this._log(dr.levels.WARNING,e)}makeError(e,r,n){if(N3)return this.makeError("censored error",r,{});r||(r=dr.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const c=n[l];try{if(c instanceof Uint8Array){let f="";for(let u=0;u>4],f+=j3[c[u]&15];i.push(l+"=Uint8Array(0x"+f+")")}else i.push(l+"="+JSON.stringify(c))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case oi.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case oi.CALL_EXCEPTION:case oi.INSUFFICIENT_FUNDS:case oi.MISSING_NEW:case oi.NONCE_EXPIRED:case oi.REPLACEMENT_UNDERPRICED:case oi.TRANSACTION_REPLACED:case oi.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,dr.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){L3&&this.throwError("platform missing String.prototype.normalize",dr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:L3})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,dr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,dr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,dr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",dr.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",dr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",dr.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return F1||(F1=new dr(JU)),F1}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",dr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),O3){if(!e)return;this.globalLogger().throwError("error censorship permanent",dr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}N3=!!e,O3=!!r}static setLogLevel(e){const r=vd[e.toLowerCase()];if(r==null){dr.globalLogger().warn("invalid log level - "+e);return}D3=r}static from(e){return new dr(e)}};W.errors=oi;W.levels=Yy;const ZU="bytes/5.7.0",Ht=new W(ZU);function XC(t){return!!t.toHexString}function rl(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return rl(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function x0(t){return He(t)&&!(t.length%2)||Dl(t)}function B3(t){return typeof t=="number"&&t==t&&t%1===0}function Dl(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!B3(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ce(t,e){if(e||(e={}),typeof t=="number"){Ht.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),rl(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),XC(t)&&(t=t.toHexString()),He(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Ht.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ice(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),rl(n)}function hs(t){let e=ce(t);if(e.length===0)return e;let r=0;for(;re&&Ht.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),rl(r)}function He(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const U1="0123456789abcdef";function fe(t,e){if(e||(e={}),typeof t=="number"){Ht.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=U1[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),XC(t))return t.toHexString();if(He(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Ht.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Dl(t)){let r="0x";for(let n=0;n>4]+U1[i&15]}return r}return Ht.throwArgumentError("invalid hexlify value","value",t)}function na(t){if(typeof t!="string")t=fe(t);else if(!He(t)||t.length%2)return null;return(t.length-2)/2}function vr(t,e,r){return typeof t!="string"?t=fe(t):(!He(t)||t.length%2)&&Ht.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function rn(t){let e="0x";return t.forEach(r=>{e+=fe(r).substring(2)}),e}function Tg(t){const e=tz(fe(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function tz(t){typeof t!="string"&&(t=fe(t)),He(t)||Ht.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Ht.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Ll(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(x0(t)){let r=ce(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=fe(r.slice(0,32)),e.s=fe(r.slice(32,64))):r.length===65?(e.r=fe(r.slice(0,32)),e.s=fe(r.slice(32,64)),e.v=r[64]):Ht.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Ht.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=fe(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=ez(ce(e._vs),32);e._vs=fe(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Ht.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=fe(i);e.s==null?e.s=o:e.s!==o&&Ht.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Ht.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Ht.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!He(e.r)?Ht.throwArgumentError("signature missing or invalid r","signature",t):e.r=kt(e.r,32),e.s==null||!He(e.s)?Ht.throwArgumentError("signature missing or invalid s","signature",t):e.s=kt(e.s,32);const r=ce(e.s);r[0]>=128&&Ht.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=fe(r);e._vs&&(He(e._vs)||Ht.throwArgumentError("signature invalid _vs","signature",t),e._vs=kt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Ht.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function $3(t){return t=Ll(t),fe(ir([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const ZC="bignumber/5.7.0";var hh=Oe.BN;const es=new W(ZC),z1={},F3=9007199254740991;function rz(t){return t!=null&&(ae.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||He(t)||typeof t=="bigint"||Dl(t))}let U3=!1;class ae{constructor(e,r){e!==z1&&es.throwError("cannot call constructor directly; use BigNumber.from",W.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return en(Be(this).fromTwos(e))}toTwos(e){return en(Be(this).toTwos(e))}abs(){return this._hex[0]==="-"?ae.from(this._hex.substring(1)):this}add(e){return en(Be(this).add(Be(e)))}sub(e){return en(Be(this).sub(Be(e)))}div(e){return ae.from(e).isZero()&&On("division-by-zero","div"),en(Be(this).div(Be(e)))}mul(e){return en(Be(this).mul(Be(e)))}mod(e){const r=Be(e);return r.isNeg()&&On("division-by-zero","mod"),en(Be(this).umod(r))}pow(e){const r=Be(e);return r.isNeg()&&On("negative-power","pow"),en(Be(this).pow(r))}and(e){const r=Be(e);return(this.isNegative()||r.isNeg())&&On("unbound-bitwise-result","and"),en(Be(this).and(r))}or(e){const r=Be(e);return(this.isNegative()||r.isNeg())&&On("unbound-bitwise-result","or"),en(Be(this).or(r))}xor(e){const r=Be(e);return(this.isNegative()||r.isNeg())&&On("unbound-bitwise-result","xor"),en(Be(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&On("negative-width","mask"),en(Be(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&On("negative-width","shl"),en(Be(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&On("negative-width","shr"),en(Be(this).shrn(e))}eq(e){return Be(this).eq(Be(e))}lt(e){return Be(this).lt(Be(e))}lte(e){return Be(this).lte(Be(e))}gt(e){return Be(this).gt(Be(e))}gte(e){return Be(this).gte(Be(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Be(this).isZero()}toNumber(){try{return Be(this).toNumber()}catch{On("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return es.throwError("this platform does not support BigInt",W.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?U3||(U3=!0,es.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?es.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",W.errors.UNEXPECTED_ARGUMENT,{}):es.throwError("BigNumber.toString does not accept parameters",W.errors.UNEXPECTED_ARGUMENT,{})),Be(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof ae)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new ae(z1,Pf(e)):e.match(/^-?[0-9]+$/)?new ae(z1,Pf(new hh(e))):es.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&On("underflow","BigNumber.from",e),(e>=F3||e<=-F3)&&On("overflow","BigNumber.from",e),ae.from(String(e));const r=e;if(typeof r=="bigint")return ae.from(r.toString());if(Dl(r))return ae.from(fe(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return ae.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(He(n)||n[0]==="-"&&He(n.substring(1))))return ae.from(n)}return es.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Pf(t){if(typeof t!="string")return Pf(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&es.throwArgumentError("invalid hex","value",t),t=Pf(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function en(t){return ae.from(Pf(t))}function Be(t){const e=ae.from(t).toHexString();return e[0]==="-"?new hh("-"+e.substring(3),16):new hh(e.substring(2),16)}function On(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),es.throwError(t,W.errors.NUMERIC_FAULT,n)}function nz(t){return new hh(t,36).toString(16)}const Yr=new W(ZC),Qc={},e7=ae.from(0),t7=ae.from(-1);function r7(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Yr.throwError(t,W.errors.NUMERIC_FAULT,i)}let Yc="0";for(;Yc.length<256;)Yc+=Yc;function Mg(t){if(typeof t!="number")try{t=ae.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+Yc.substring(0,t):Yr.throwArgumentError("invalid decimal size","decimals",t)}function yd(t,e){e==null&&(e=0);const r=Mg(e);t=ae.from(t);const n=t.lt(e7);n&&(t=t.mul(t7));let i=t.mod(r).toString();for(;i.length2&&Yr.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&r7("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?l:(typeof e[o]!==a&&Yr.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Yr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Yr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new nl(Qc,r,n,i)}}class Cr{constructor(e,r,n,i){e!==Qc&&Yr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",W.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Yr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Ai(this._value,this.format.decimals),n=Ai(e._value,e.format.decimals);return Cr.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Ai(this._value,this.format.decimals),n=Ai(e._value,e.format.decimals);return Cr.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Ai(this._value,this.format.decimals),n=Ai(e._value,e.format.decimals);return Cr.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Ai(this._value,this.format.decimals),n=Ai(e._value,e.format.decimals);return Cr.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Cr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(z3.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Cr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(z3.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Yr.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=Cr.from("1"+Yc.substring(0,e),this.format),i=iz.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Yr.throwArgumentError("invalid byte width","width",e);const r=ae.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return kt(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Cr.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!rz(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Cr.fromString(yd(e,r),nl.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=nl.from(r),i=Ai(e,n.decimals);!n.signed&&i.lt(e7)&&r7("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=kt(s,n.width/8));const o=yd(i,n.decimals);return new Cr(Qc,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=nl.from(r);if(ce(e).length>n.width/8)throw new Error("overflow");let i=ae.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=yd(i,n.decimals);return new Cr(Qc,s,o,n)}static from(e,r){if(typeof e=="string")return Cr.fromString(e,r);if(Dl(e))return Cr.fromBytes(e,r);try{return Cr.fromValue(e,0,r)}catch(n){if(n.code!==W.errors.INVALID_ARGUMENT)throw n}return Yr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const z3=Cr.from(1),iz=Cr.from("0.5"),sz="properties/5.7.0";var oz=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const vh=new W(sz);function ne(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Oi(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function er(t){return oz(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function n7(t,e){(!t||typeof t!="object")&&vh.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||vh.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function mr(t){const e={};for(const r in t)e[r]=t[r];return e}const az={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function i7(t){if(t==null||az[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;ria(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&ne(e,r,ia(n))}return e}return vh.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function ia(t){return lz(t)}class ya{constructor(e){for(const r in e)this[r]=ia(e[r])}}const tu="abi/5.7.0",Ue=new W(tu),sa={};let V3={calldata:!0,memory:!0,storage:!0},cz={calldata:!0,memory:!0};function ju(t,e){if(t==="bytes"||t==="string"){if(V3[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&cz[e])return!0;return(V3[e]||e==="payable")&&Ue.throwArgumentError("invalid modifier","name",e),!1}function fz(t,e){let r=t;function n(a){Ue.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==Je.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===Je.full?", ":",")+")"):r+=this.type,e!==Je.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Je.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?br.fromString(e,r):br.fromObject(e)}static fromObject(e){return br.isParamType(e)?e:new br(sa,{name:e.name||null,type:Pa(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(br.fromObject):null})}static fromString(e,r){function n(i){return br.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(fz(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function Rf(t,e){return hz(t).map(r=>br.fromString(r,e))}class cs{constructor(e,r){e!==sa&&Ue.throwError("use a static from method",W.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),pd(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return cs.isFragment(e)?e:typeof e=="string"?cs.fromString(e):cs.fromObject(e)}static fromObject(e){if(cs.isFragment(e))return e;switch(e.type){case"function":return Mi.fromObject(e);case"event":return is.fromObject(e);case"constructor":return Ti.fromObject(e);case"error":return zs.fromObject(e);case"fallback":case"receive":return null}return Ue.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?is.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Mi.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Ti.fromString(e.trim()):e.split(" ")[0]==="error"?zs.fromString(e.substring(5).trim()):Ue.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class is extends cs{format(e){if(e||(e=Je.sighash),Je[e]||Ue.throwArgumentError("invalid format type","format",e),e===Je.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Je.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Je.full?", ":",")+") ",e!==Je.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?is.fromString(e):is.fromObject(e)}static fromObject(e){if(is.isEventFragment(e))return e;e.type!=="event"&&Ue.throwArgumentError("invalid event object","value",e);const r={name:Tf(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(br.fromObject):[],type:"event"};return new is(sa,r)}static fromString(e){let r=e.match(Mf);r||Ue.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Ue.warn("unknown modifier: "+i)}}),is.fromObject({name:r[1].trim(),anonymous:n,inputs:Rf(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function s7(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Ue.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Ue.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=ae.from(r[1]),r[0]):t}function o7(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function a7(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Ue.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Ue.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Ue.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Ue.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Ue.throwArgumentError("unable to determine stateMutability","value",t),e}class Ti extends cs{format(e){if(e||(e=Je.sighash),Je[e]||Ue.throwArgumentError("invalid format type","format",e),e===Je.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===Je.sighash&&Ue.throwError("cannot format a constructor for sighash",W.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===Je.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Ti.fromString(e):Ti.fromObject(e)}static fromObject(e){if(Ti.isConstructorFragment(e))return e;e.type!=="constructor"&&Ue.throwArgumentError("invalid constructor object","value",e);let r=a7(e);r.constant&&Ue.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(br.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?ae.from(e.gas):null};return new Ti(sa,n)}static fromString(e){let r={type:"constructor"};e=s7(e,r);let n=e.match(Mf);return(!n||n[1].trim()!=="constructor")&&Ue.throwArgumentError("invalid constructor string","value",e),r.inputs=Rf(n[2].trim(),!1),o7(n[3].trim(),r),Ti.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Mi extends Ti{format(e){if(e||(e=Je.sighash),Je[e]||Ue.throwArgumentError("invalid format type","format",e),e===Je.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Je.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Je.full?", ":",")+") ",e!==Je.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Mi.fromString(e):Mi.fromObject(e)}static fromObject(e){if(Mi.isFunctionFragment(e))return e;e.type!=="function"&&Ue.throwArgumentError("invalid function object","value",e);let r=a7(e);const n={type:e.type,name:Tf(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(br.fromObject):[],outputs:e.outputs?e.outputs.map(br.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?ae.from(e.gas):null};return new Mi(sa,n)}static fromString(e){let r={type:"function"};e=s7(e,r);let n=e.split(" returns ");n.length>2&&Ue.throwArgumentError("invalid function string","value",e);let i=n[0].match(Mf);if(i||Ue.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Tf(r.name),r.inputs=Rf(i[2],!1),o7(i[3].trim(),r),n.length>1){let s=n[1].match(Mf);(s[1].trim()!=""||s[3].trim()!="")&&Ue.throwArgumentError("unexpected tokens","value",e),r.outputs=Rf(s[2],!1)}else r.outputs=[];return Mi.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function q3(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Ue.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class zs extends cs{format(e){if(e||(e=Je.sighash),Je[e]||Ue.throwArgumentError("invalid format type","format",e),e===Je.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Je.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Je.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?zs.fromString(e):zs.fromObject(e)}static fromObject(e){if(zs.isErrorFragment(e))return e;e.type!=="error"&&Ue.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Tf(e.name),inputs:e.inputs?e.inputs.map(br.fromObject):[]};return q3(new zs(sa,r))}static fromString(e){let r={type:"error"},n=e.match(Mf);return n||Ue.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Tf(r.name),r.inputs=Rf(n[2],!1),q3(zs.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Pa(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const dz=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Tf(t){return(!t||!t.match(dz))&&Ue.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Mf=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function hz(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&Ig.throwError("value out-of-bounds",W.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=ir([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class yh{constructor(e,r,n,i){ne(this,"_data",ce(e)),ne(this,"wordSize",r||32),ne(this,"_coerceFunc",n),ne(this,"allowLoose",i),this._offset=0}get data(){return fe(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):yh.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:Ig.throwError("data out-of-bounds",W.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new yh(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return ae.from(this.readBytes(this.wordSize))}}var l7={exports:{}};/** +`);for(let w=0;w({method:"POST",headers:uh({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Jt=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),dh.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(YC[n]||Pt).new(r)}return r});let Pt=class jC extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,jC.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}},BU=class BC extends Pt{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,BC.prototype)}},qt=class $C extends Pt{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,$C.prototype)}},$U=class FC extends Pt{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,FC.prototype)}},FU=class UC extends Pt{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,UC.prototype)}},UU=class zC extends Pt{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,zC.prototype)}},dh=class VC extends Pt{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,VC.prototype)}},zU=class qC extends Pt{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,qC.prototype)}},VU=class HC extends Pt{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,HC.prototype)}},qU=class WC extends Pt{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,WC.prototype)}},hd=class GC extends Pt{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,GC.prototype)}},HU=class KC extends Pt{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,KC.prototype)}},WU=class QC extends Pt{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,QC.prototype)}};class pg extends Pt{constructor(e="PermissionDenied",r=1001,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,pg.prototype)}}class mg extends Pt{constructor(e="SessionExpired",r=1002,n="Session expired",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,mg.prototype)}}class gg extends Pt{constructor(e="MethodNotFound",r=1003,n="Method not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,gg.prototype)}}class xg extends Pt{constructor(e="RequestConflict",r=1004,n="Conflict with target resource",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,xg.prototype)}}class bg extends Pt{constructor(e="Aborted",r=1005,n="Request aborted",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,bg.prototype)}}class wg extends Pt{constructor(e="Timeout",r=2e3,n="Request timed out",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,wg.prototype)}}class Eg extends Pt{constructor(e="InvalidArgument",r=2001,n="Invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Eg.prototype)}}class Ag extends Pt{constructor(e="Unavailable",r=2002,n="Unavailable resource",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ag.prototype)}}class Sg extends Pt{constructor(e="QueryFailed",r=2003,n="Query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Sg.prototype)}}class Cg extends Pt{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Cg.prototype)}}class kg extends Pt{constructor(e="ProjectNotFound",r=3002,n="Project not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,kg.prototype)}}class Pg extends Pt{constructor(e="MetadataCallFailed",r=3003,n="Metadata service call failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Pg.prototype)}}const YC={0:BU,[-1]:qt,[-2]:$U,[-3]:FU,[-4]:UU,[-5]:dh,[-6]:zU,[-7]:VU,[-8]:qU,[-9]:hd,[-10]:HU,1e3:WU,1001:pg,1002:mg,1003:gg,1004:xg,1005:bg,2e3:wg,2001:Eg,2002:Ag,2003:Sg,3e3:Cg,3002:kg,3003:Pg},_3=typeof global=="object"?global.fetch:window.fetch;class JC extends jU{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,_3),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,l=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),l&&l.length>0&&(o["X-Access-Key"]=l),s.headers=uh({},s.headers,o),_3(i,s)},this.fetch=this._fetch}}let X=function(t){return t[t.MAINNET=1]="MAINNET",t[t.ROPSTEN=3]="ROPSTEN",t[t.RINKEBY=4]="RINKEBY",t[t.GOERLI=5]="GOERLI",t[t.KOVAN=42]="KOVAN",t[t.SEPOLIA=11155111]="SEPOLIA",t[t.POLYGON=137]="POLYGON",t[t.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",t[t.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",t[t.POLYGON_AMOY=80002]="POLYGON_AMOY",t[t.BSC=56]="BSC",t[t.BSC_TESTNET=97]="BSC_TESTNET",t[t.OPTIMISM=10]="OPTIMISM",t[t.OPTIMISM_KOVAN=69]="OPTIMISM_KOVAN",t[t.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",t[t.OPTIMISM_SEPOLIA=11155420]="OPTIMISM_SEPOLIA",t[t.ARBITRUM=42161]="ARBITRUM",t[t.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",t[t.ARBITRUM_SEPOLIA=421614]="ARBITRUM_SEPOLIA",t[t.ARBITRUM_NOVA=42170]="ARBITRUM_NOVA",t[t.AVALANCHE=43114]="AVALANCHE",t[t.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",t[t.GNOSIS=100]="GNOSIS",t[t.BASE=8453]="BASE",t[t.BASE_GOERLI=84531]="BASE_GOERLI",t[t.BASE_SEPOLIA=84532]="BASE_SEPOLIA",t[t.HOMEVERSE_TESTNET=40875]="HOMEVERSE_TESTNET",t[t.HOMEVERSE=19011]="HOMEVERSE",t[t.XAI=660279]="XAI",t[t.XAI_SEPOLIA=37714555429]="XAI_SEPOLIA",t[t.ASTAR_ZKEVM=3776]="ASTAR_ZKEVM",t[t.ASTAR_ZKYOTO=6038361]="ASTAR_ZKYOTO",t[t.XR_SEPOLIA=2730]="XR_SEPOLIA",t[t.HARDHAT=31337]="HARDHAT",t[t.HARDHAT_2=31338]="HARDHAT_2",t}({}),qe=function(t){return t.MAINNET="mainnet",t.TESTNET="testnet",t}({});const it={[X.MAINNET]:{chainId:X.MAINNET,type:qe.MAINNET,name:"mainnet",title:"Ethereum",logoURI:`https://assets.sequence.info/images/networks/medium/${X.MAINNET}.webp`,blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[X.ROPSTEN]:{chainId:X.ROPSTEN,type:qe.TESTNET,name:"ropsten",title:"Ropsten",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ROPSTEN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[X.RINKEBY]:{chainId:X.RINKEBY,type:qe.TESTNET,name:"rinkeby",title:"Rinkeby",logoURI:`https://assets.sequence.info/images/networks/medium/${X.RINKEBY}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[X.GOERLI]:{chainId:X.GOERLI,type:qe.TESTNET,name:"goerli",title:"Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${X.GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[X.KOVAN]:{chainId:X.KOVAN,type:qe.TESTNET,name:"kovan",title:"Kovan",logoURI:`https://assets.sequence.info/images/networks/medium/${X.KOVAN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"},deprecated:!0},[X.SEPOLIA]:{chainId:X.SEPOLIA,type:qe.TESTNET,name:"sepolia",title:"Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Sepolia)",rootUrl:"https://sepolia.etherscan.io/"}},[X.POLYGON]:{chainId:X.POLYGON,type:qe.MAINNET,name:"polygon",title:"Polygon",logoURI:`https://assets.sequence.info/images/networks/medium/${X.POLYGON}.webp`,blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[X.POLYGON_MUMBAI]:{chainId:X.POLYGON_MUMBAI,type:qe.TESTNET,name:"mumbai",title:"Polygon Mumbai",logoURI:`https://assets.sequence.info/images/networks/medium/${X.POLYGON_MUMBAI}.webp`,testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"},deprecated:!0},[X.POLYGON_AMOY]:{chainId:X.POLYGON_AMOY,type:qe.TESTNET,name:"amoy",title:"Polygon Amoy",logoURI:`https://assets.sequence.info/images/networks/medium/${X.POLYGON_AMOY}.webp`,testnet:!0,blockExplorer:{name:"OKLink (Amoy)",rootUrl:"https://www.oklink.com/amoy"}},[X.POLYGON_ZKEVM]:{chainId:X.POLYGON_ZKEVM,type:qe.MAINNET,name:"polygon-zkevm",title:"Polygon zkEVM",logoURI:`https://assets.sequence.info/images/networks/medium/${X.POLYGON_ZKEVM}.webp`,blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"}},[X.BSC]:{chainId:X.BSC,type:qe.MAINNET,name:"bsc",title:"BNB Smart Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BSC}.webp`,blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[X.BSC_TESTNET]:{chainId:X.BSC_TESTNET,type:qe.TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BSC_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[X.OPTIMISM]:{chainId:X.OPTIMISM,type:qe.MAINNET,name:"optimism",title:"Optimism",logoURI:`https://assets.sequence.info/images/networks/medium/${X.OPTIMISM}.webp`,blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[X.OPTIMISM_KOVAN]:{chainId:X.OPTIMISM_KOVAN,type:qe.TESTNET,name:"optimism-kovan",title:"Optimistic Kovan",logoURI:`https://assets.sequence.info/images/networks/medium/${X.OPTIMISM_KOVAN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Kovan)",rootUrl:"https://kovan-optimistic.etherscan.io/"},deprecated:!0},[X.OPTIMISM_GOERLI]:{chainId:X.OPTIMISM_GOERLI,type:qe.TESTNET,name:"optimism-goerli",title:"Optimistic Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${X.OPTIMISM_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Goerli)",rootUrl:"https://goerli-optimistic.etherscan.io/"},deprecated:!0},[X.OPTIMISM_SEPOLIA]:{chainId:X.OPTIMISM_SEPOLIA,type:qe.TESTNET,name:"optimism-sepolia",title:"Optimistic Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.OPTIMISM_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Sepolia)",rootUrl:"https://sepolia-optimistic.etherscan.io/"}},[X.ARBITRUM]:{chainId:X.ARBITRUM,type:qe.MAINNET,name:"arbitrum",title:"Arbitrum One",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ARBITRUM}.webp`,blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[X.ARBITRUM_GOERLI]:{chainId:X.ARBITRUM_GOERLI,type:qe.TESTNET,name:"arbitrum-goerli",title:"Arbitrum Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ARBITRUM_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Arbiscan (Goerli Testnet)",rootUrl:"https://testnet.arbiscan.io/"},deprecated:!0},[X.ARBITRUM_SEPOLIA]:{chainId:X.ARBITRUM_SEPOLIA,type:qe.TESTNET,name:"arbitrum-sepolia",title:"Arbitrum Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ARBITRUM_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Arbiscan (Sepolia Testnet)",rootUrl:"https://sepolia.arbiscan.io/"}},[X.ARBITRUM_NOVA]:{chainId:X.ARBITRUM_NOVA,type:qe.MAINNET,name:"arbitrum-nova",title:"Arbitrum Nova",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ARBITRUM_NOVA}.webp`,blockExplorer:{name:"Arbiscan Nova",rootUrl:"https://nova.arbiscan.io/"}},[X.AVALANCHE]:{chainId:X.AVALANCHE,type:qe.MAINNET,name:"avalanche",title:"Avalanche",logoURI:`https://assets.sequence.info/images/networks/medium/${X.AVALANCHE}.webp`,blockExplorer:{name:"Snowtrace",rootUrl:"https://subnets.avax.network/c-chain/"}},[X.AVALANCHE_TESTNET]:{chainId:X.AVALANCHE_TESTNET,type:qe.TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${X.AVALANCHE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://subnets-test.avax.network/c-chain/"}},[X.GNOSIS]:{chainId:X.GNOSIS,type:qe.MAINNET,name:"gnosis",title:"Gnosis Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${X.GNOSIS}.webp`,blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[X.BASE]:{chainId:X.BASE,type:qe.MAINNET,name:"base",title:"Base (Coinbase)",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BASE}.webp`,blockExplorer:{name:"Base Explorer",rootUrl:"https://basescan.org/"}},[X.BASE_GOERLI]:{chainId:X.BASE_GOERLI,type:qe.TESTNET,name:"base-goerli",title:"Base Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BASE_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"},deprecated:!0},[X.BASE_SEPOLIA]:{chainId:X.BASE_SEPOLIA,type:qe.TESTNET,name:"base-sepolia",title:"Base Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.BASE_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Base Sepolia Explorer",rootUrl:"https://base-sepolia.blockscout.com/"}},[X.HOMEVERSE]:{chainId:X.HOMEVERSE,type:qe.MAINNET,name:"homeverse",title:"Oasys Homeverse",logoURI:`https://assets.sequence.info/images/networks/medium/${X.HOMEVERSE}.webp`,blockExplorer:{name:"Oasys Homeverse Explorer",rootUrl:"https://explorer.oasys.homeverse.games/"}},[X.HOMEVERSE_TESTNET]:{chainId:X.HOMEVERSE_TESTNET,type:qe.TESTNET,name:"homeverse-testnet",title:"Oasys Homeverse Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${X.HOMEVERSE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Oasys Homeverse Explorer (Testnet)",rootUrl:"https://explorer.testnet.oasys.homeverse.games/"}},[X.XAI]:{chainId:X.XAI,type:qe.MAINNET,name:"xai",title:"Xai",logoURI:`https://assets.sequence.info/images/networks/medium/${X.XAI}.webp`,blockExplorer:{name:"Xai Explorer",rootUrl:"https://explorer.xai-chain.net/"}},[X.XAI_SEPOLIA]:{chainId:X.XAI_SEPOLIA,type:qe.TESTNET,name:"xai-sepolia",title:"Xai Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.XAI_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Xai Sepolia Explorer",rootUrl:"https://testnet-explorer-v2.xai-chain.net/"}},[X.ASTAR_ZKEVM]:{chainId:X.ASTAR_ZKEVM,type:qe.MAINNET,name:"astar-zkevm",title:"Astar zkEVM",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ASTAR_ZKEVM}.webp`,blockExplorer:{name:"Astar zkEVM Explorer",rootUrl:"https://astar-zkevm.explorer.startale.com/"}},[X.ASTAR_ZKYOTO]:{chainId:X.ASTAR_ZKYOTO,type:qe.TESTNET,name:"astar-zkyoto",title:"Astar zKyoto Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${X.ASTAR_ZKYOTO}.webp`,testnet:!0,blockExplorer:{name:"Astar zKyoto Explorer",rootUrl:"https://astar-zkyoto.blockscout.com/"}},[X.XR_SEPOLIA]:{chainId:X.XR_SEPOLIA,type:qe.TESTNET,name:"xr-sepolia",title:"XR Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${X.XR_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"XR Sepolia Explorer",rootUrl:"https://xr-sepolia-testnet.explorer.caldera.xyz/"}},[X.HARDHAT]:{chainId:X.HARDHAT,name:"hardhat",title:"Hardhat (local testnet)"},[X.HARDHAT_2]:{chainId:X.HARDHAT_2,name:"hardhat2",title:"Hardhat (local testnet)"}};var Rg={exports:{}};const GU={},KU=Object.freeze(Object.defineProperty({__proto__:null,default:GU},Symbol.toStringTag,{value:"Module"})),QU=Ih(KU);Rg.exports;(function(t){(function(e,r){function n(O,h){if(!O)throw new Error(h||"Assertion failed")}function i(O,h){O.super_=h;var A=function(){};A.prototype=h.prototype,O.prototype=new A,O.prototype.constructor=O}function s(O,h,A){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((h==="le"||h==="be")&&(A=h,h=10),this._init(O||0,h||10,A||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=QU.Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,A){return h.cmp(A)>0?h:A},s.min=function(h,A){return h.cmp(A)<0?h:A},s.prototype._init=function(h,A,k){if(typeof h=="number")return this._initNumber(h,A,k);if(typeof h=="object")return this._initArray(h,A,k);A==="hex"&&(A=16),n(A===(A|0)&&A>=2&&A<=36),h=h.toString().replace(/\s+/g,"");var I=0;h[0]==="-"&&(I++,this.negative=1),I=0;I-=3)N=h[I]|h[I-1]<<8|h[I-2]<<16,this.words[R]|=N<>>26-j&67108863,j+=24,j>=26&&(j-=26,R++);else if(k==="le")for(I=0,R=0;I>>26-j&67108863,j+=24,j>=26&&(j-=26,R++);return this._strip()};function a(O,h){var A=O.charCodeAt(h);if(A>=48&&A<=57)return A-48;if(A>=65&&A<=70)return A-55;if(A>=97&&A<=102)return A-87;n(!1,"Invalid character in "+O)}function l(O,h,A){var k=a(O,A);return A-1>=h&&(k|=a(O,A-1)<<4),k}s.prototype._parseHex=function(h,A,k){this.length=Math.ceil((h.length-A)/6),this.words=new Array(this.length);for(var I=0;I=A;I-=2)j=l(h,A,I)<=18?(R-=18,N+=1,this.words[N]|=j>>>26):R+=8;else{var C=h.length-A;for(I=C%2===0?A+1:A;I=18?(R-=18,N+=1,this.words[N]|=j>>>26):R+=8}this._strip()};function c(O,h,A,k){for(var I=0,R=0,N=Math.min(O.length,A),j=h;j=49?R=C-49+10:C>=17?R=C-17+10:R=C,n(C>=0&&R1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{s.prototype.inspect=u}else s.prototype.inspect=u;function u(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],v=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(h,A){h=h||10,A=A|0||1;var k;if(h===16||h==="hex"){k="";for(var I=0,R=0,N=0;N>>24-I&16777215,I+=2,I>=26&&(I-=26,N--),R!==0||N!==this.length-1?k=d[6-C.length]+C+k:k=C+k}for(R!==0&&(k=R.toString(16)+k);k.length%A!==0;)k="0"+k;return this.negative!==0&&(k="-"+k),k}if(h===(h|0)&&h>=2&&h<=36){var m=v[h],T=g[h];k="";var F=this.clone();for(F.negative=0;!F.isZero();){var E=F.modrn(T).toString(h);F=F.idivn(T),F.isZero()?k=E+k:k=d[m-E.length]+E+k}for(this.isZero()&&(k="0"+k);k.length%A!==0;)k="0"+k;return this.negative!==0&&(k="-"+k),k}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(h,A){return this.toArrayLike(o,h,A)}),s.prototype.toArray=function(h,A){return this.toArrayLike(Array,h,A)};var y=function(h,A){return h.allocUnsafe?h.allocUnsafe(A):new h(A)};s.prototype.toArrayLike=function(h,A,k){this._strip();var I=this.byteLength(),R=k||Math.max(1,I);n(I<=R,"byte array longer than desired length"),n(R>0,"Requested array length <= 0");var N=y(h,R),j=A==="le"?"LE":"BE";return this["_toArrayLike"+j](N,I),N},s.prototype._toArrayLikeLE=function(h,A){for(var k=0,I=0,R=0,N=0;R>8&255),k>16&255),N===6?(k>24&255),I=0,N=0):(I=j>>>24,N+=2)}if(k=0&&(h[k--]=j>>8&255),k>=0&&(h[k--]=j>>16&255),N===6?(k>=0&&(h[k--]=j>>24&255),I=0,N=0):(I=j>>>24,N+=2)}if(k>=0)for(h[k--]=I;k>=0;)h[k--]=0},Math.clz32?s.prototype._countBits=function(h){return 32-Math.clz32(h)}:s.prototype._countBits=function(h){var A=h,k=0;return A>=4096&&(k+=13,A>>>=13),A>=64&&(k+=7,A>>>=7),A>=8&&(k+=4,A>>>=4),A>=2&&(k+=2,A>>>=2),k+A},s.prototype._zeroBits=function(h){if(h===0)return 26;var A=h,k=0;return A&8191||(k+=13,A>>>=13),A&127||(k+=7,A>>>=7),A&15||(k+=4,A>>>=4),A&3||(k+=2,A>>>=2),A&1||k++,k},s.prototype.bitLength=function(){var h=this.words[this.length-1],A=this._countBits(h);return(this.length-1)*26+A};function w(O){for(var h=new Array(O.bitLength()),A=0;A>>I&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,A=0;Ah.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var A;this.length>h.length?A=h:A=this;for(var k=0;kh.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var A,k;this.length>h.length?(A=this,k=h):(A=h,k=this);for(var I=0;Ih.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var A=Math.ceil(h/26)|0,k=h%26;this._expand(A),k>0&&A--;for(var I=0;I0&&(this.words[I]=~this.words[I]&67108863>>26-k),this._strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,A){n(typeof h=="number"&&h>=0);var k=h/26|0,I=h%26;return this._expand(k+1),A?this.words[k]=this.words[k]|1<h.length?(k=this,I=h):(k=h,I=this);for(var R=0,N=0;N>>26;for(;R!==0&&N>>26;if(this.length=k.length,R!==0)this.words[this.length]=R,this.length++;else if(k!==this)for(;Nh.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var A=this.iadd(h);return h.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var k=this.cmp(h);if(k===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,R;k>0?(I=this,R=h):(I=h,R=this);for(var N=0,j=0;j>26,this.words[j]=A&67108863;for(;N!==0&&j>26,this.words[j]=A&67108863;if(N===0&&j>>26,F=C&67108863,E=Math.min(m,h.length-1),B=Math.max(0,m-O.length+1);B<=E;B++){var V=m-B|0;I=O.words[V]|0,R=h.words[B]|0,N=I*R+F,T+=N/67108864|0,F=N&67108863}A.words[m]=F|0,C=T|0}return C!==0?A.words[m]=C|0:A.length--,A._strip()}var b=function(h,A,k){var I=h.words,R=A.words,N=k.words,j=0,C,m,T,F=I[0]|0,E=F&8191,B=F>>>13,V=I[1]|0,q=V&8191,K=V>>>13,oe=I[2]|0,ee=oe&8191,te=oe>>>13,Ie=I[3]|0,ue=Ie&8191,we=Ie>>>13,zt=I[4]|0,Ve=zt&8191,ot=zt>>>13,Jn=I[5]|0,at=Jn&8191,Ge=Jn>>>13,un=I[6]|0,Ze=un&8191,ft=un>>>13,Xn=I[7]|0,ze=Xn&8191,et=Xn>>>13,pi=I[8]|0,nt=pi&8191,pt=pi>>>13,_r=I[9]|0,ut=_r&8191,dt=_r>>>13,mi=R[0]|0,mt=mi&8191,ht=mi>>>13,In=R[1]|0,vt=In&8191,lt=In>>>13,Qi=R[2]|0,yt=Qi&8191,gt=Qi>>>13,gi=R[3]|0,xt=gi&8191,U=gi>>>13,G=R[4]|0,Q=G&8191,ie=G>>>13,he=R[5]|0,me=he&8191,de=he>>>13,ye=R[6]|0,ge=ye&8191,pe=ye>>>13,Rt=R[7]|0,_e=Rt&8191,ve=Rt>>>13,Ke=R[8]|0,ke=Ke&8191,tt=Ke>>>13,Or=R[9]|0,Qe=Or&8191,Ye=Or>>>13;k.negative=h.negative^A.negative,k.length=19,C=Math.imul(E,mt),m=Math.imul(E,ht),m=m+Math.imul(B,mt)|0,T=Math.imul(B,ht);var Hr=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,C=Math.imul(q,mt),m=Math.imul(q,ht),m=m+Math.imul(K,mt)|0,T=Math.imul(K,ht),C=C+Math.imul(E,vt)|0,m=m+Math.imul(E,lt)|0,m=m+Math.imul(B,vt)|0,T=T+Math.imul(B,lt)|0;var cr=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(cr>>>26)|0,cr&=67108863,C=Math.imul(ee,mt),m=Math.imul(ee,ht),m=m+Math.imul(te,mt)|0,T=Math.imul(te,ht),C=C+Math.imul(q,vt)|0,m=m+Math.imul(q,lt)|0,m=m+Math.imul(K,vt)|0,T=T+Math.imul(K,lt)|0,C=C+Math.imul(E,yt)|0,m=m+Math.imul(E,gt)|0,m=m+Math.imul(B,yt)|0,T=T+Math.imul(B,gt)|0;var dn=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(dn>>>26)|0,dn&=67108863,C=Math.imul(ue,mt),m=Math.imul(ue,ht),m=m+Math.imul(we,mt)|0,T=Math.imul(we,ht),C=C+Math.imul(ee,vt)|0,m=m+Math.imul(ee,lt)|0,m=m+Math.imul(te,vt)|0,T=T+Math.imul(te,lt)|0,C=C+Math.imul(q,yt)|0,m=m+Math.imul(q,gt)|0,m=m+Math.imul(K,yt)|0,T=T+Math.imul(K,gt)|0,C=C+Math.imul(E,xt)|0,m=m+Math.imul(E,U)|0,m=m+Math.imul(B,xt)|0,T=T+Math.imul(B,U)|0;var hn=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(hn>>>26)|0,hn&=67108863,C=Math.imul(Ve,mt),m=Math.imul(Ve,ht),m=m+Math.imul(ot,mt)|0,T=Math.imul(ot,ht),C=C+Math.imul(ue,vt)|0,m=m+Math.imul(ue,lt)|0,m=m+Math.imul(we,vt)|0,T=T+Math.imul(we,lt)|0,C=C+Math.imul(ee,yt)|0,m=m+Math.imul(ee,gt)|0,m=m+Math.imul(te,yt)|0,T=T+Math.imul(te,gt)|0,C=C+Math.imul(q,xt)|0,m=m+Math.imul(q,U)|0,m=m+Math.imul(K,xt)|0,T=T+Math.imul(K,U)|0,C=C+Math.imul(E,Q)|0,m=m+Math.imul(E,ie)|0,m=m+Math.imul(B,Q)|0,T=T+Math.imul(B,ie)|0;var vn=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(vn>>>26)|0,vn&=67108863,C=Math.imul(at,mt),m=Math.imul(at,ht),m=m+Math.imul(Ge,mt)|0,T=Math.imul(Ge,ht),C=C+Math.imul(Ve,vt)|0,m=m+Math.imul(Ve,lt)|0,m=m+Math.imul(ot,vt)|0,T=T+Math.imul(ot,lt)|0,C=C+Math.imul(ue,yt)|0,m=m+Math.imul(ue,gt)|0,m=m+Math.imul(we,yt)|0,T=T+Math.imul(we,gt)|0,C=C+Math.imul(ee,xt)|0,m=m+Math.imul(ee,U)|0,m=m+Math.imul(te,xt)|0,T=T+Math.imul(te,U)|0,C=C+Math.imul(q,Q)|0,m=m+Math.imul(q,ie)|0,m=m+Math.imul(K,Q)|0,T=T+Math.imul(K,ie)|0,C=C+Math.imul(E,me)|0,m=m+Math.imul(E,de)|0,m=m+Math.imul(B,me)|0,T=T+Math.imul(B,de)|0;var De=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(De>>>26)|0,De&=67108863,C=Math.imul(Ze,mt),m=Math.imul(Ze,ht),m=m+Math.imul(ft,mt)|0,T=Math.imul(ft,ht),C=C+Math.imul(at,vt)|0,m=m+Math.imul(at,lt)|0,m=m+Math.imul(Ge,vt)|0,T=T+Math.imul(Ge,lt)|0,C=C+Math.imul(Ve,yt)|0,m=m+Math.imul(Ve,gt)|0,m=m+Math.imul(ot,yt)|0,T=T+Math.imul(ot,gt)|0,C=C+Math.imul(ue,xt)|0,m=m+Math.imul(ue,U)|0,m=m+Math.imul(we,xt)|0,T=T+Math.imul(we,U)|0,C=C+Math.imul(ee,Q)|0,m=m+Math.imul(ee,ie)|0,m=m+Math.imul(te,Q)|0,T=T+Math.imul(te,ie)|0,C=C+Math.imul(q,me)|0,m=m+Math.imul(q,de)|0,m=m+Math.imul(K,me)|0,T=T+Math.imul(K,de)|0,C=C+Math.imul(E,ge)|0,m=m+Math.imul(E,pe)|0,m=m+Math.imul(B,ge)|0,T=T+Math.imul(B,pe)|0;var fr=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,C=Math.imul(ze,mt),m=Math.imul(ze,ht),m=m+Math.imul(et,mt)|0,T=Math.imul(et,ht),C=C+Math.imul(Ze,vt)|0,m=m+Math.imul(Ze,lt)|0,m=m+Math.imul(ft,vt)|0,T=T+Math.imul(ft,lt)|0,C=C+Math.imul(at,yt)|0,m=m+Math.imul(at,gt)|0,m=m+Math.imul(Ge,yt)|0,T=T+Math.imul(Ge,gt)|0,C=C+Math.imul(Ve,xt)|0,m=m+Math.imul(Ve,U)|0,m=m+Math.imul(ot,xt)|0,T=T+Math.imul(ot,U)|0,C=C+Math.imul(ue,Q)|0,m=m+Math.imul(ue,ie)|0,m=m+Math.imul(we,Q)|0,T=T+Math.imul(we,ie)|0,C=C+Math.imul(ee,me)|0,m=m+Math.imul(ee,de)|0,m=m+Math.imul(te,me)|0,T=T+Math.imul(te,de)|0,C=C+Math.imul(q,ge)|0,m=m+Math.imul(q,pe)|0,m=m+Math.imul(K,ge)|0,T=T+Math.imul(K,pe)|0,C=C+Math.imul(E,_e)|0,m=m+Math.imul(E,ve)|0,m=m+Math.imul(B,_e)|0,T=T+Math.imul(B,ve)|0;var Nr=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,C=Math.imul(nt,mt),m=Math.imul(nt,ht),m=m+Math.imul(pt,mt)|0,T=Math.imul(pt,ht),C=C+Math.imul(ze,vt)|0,m=m+Math.imul(ze,lt)|0,m=m+Math.imul(et,vt)|0,T=T+Math.imul(et,lt)|0,C=C+Math.imul(Ze,yt)|0,m=m+Math.imul(Ze,gt)|0,m=m+Math.imul(ft,yt)|0,T=T+Math.imul(ft,gt)|0,C=C+Math.imul(at,xt)|0,m=m+Math.imul(at,U)|0,m=m+Math.imul(Ge,xt)|0,T=T+Math.imul(Ge,U)|0,C=C+Math.imul(Ve,Q)|0,m=m+Math.imul(Ve,ie)|0,m=m+Math.imul(ot,Q)|0,T=T+Math.imul(ot,ie)|0,C=C+Math.imul(ue,me)|0,m=m+Math.imul(ue,de)|0,m=m+Math.imul(we,me)|0,T=T+Math.imul(we,de)|0,C=C+Math.imul(ee,ge)|0,m=m+Math.imul(ee,pe)|0,m=m+Math.imul(te,ge)|0,T=T+Math.imul(te,pe)|0,C=C+Math.imul(q,_e)|0,m=m+Math.imul(q,ve)|0,m=m+Math.imul(K,_e)|0,T=T+Math.imul(K,ve)|0,C=C+Math.imul(E,ke)|0,m=m+Math.imul(E,tt)|0,m=m+Math.imul(B,ke)|0,T=T+Math.imul(B,tt)|0;var Yt=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,C=Math.imul(ut,mt),m=Math.imul(ut,ht),m=m+Math.imul(dt,mt)|0,T=Math.imul(dt,ht),C=C+Math.imul(nt,vt)|0,m=m+Math.imul(nt,lt)|0,m=m+Math.imul(pt,vt)|0,T=T+Math.imul(pt,lt)|0,C=C+Math.imul(ze,yt)|0,m=m+Math.imul(ze,gt)|0,m=m+Math.imul(et,yt)|0,T=T+Math.imul(et,gt)|0,C=C+Math.imul(Ze,xt)|0,m=m+Math.imul(Ze,U)|0,m=m+Math.imul(ft,xt)|0,T=T+Math.imul(ft,U)|0,C=C+Math.imul(at,Q)|0,m=m+Math.imul(at,ie)|0,m=m+Math.imul(Ge,Q)|0,T=T+Math.imul(Ge,ie)|0,C=C+Math.imul(Ve,me)|0,m=m+Math.imul(Ve,de)|0,m=m+Math.imul(ot,me)|0,T=T+Math.imul(ot,de)|0,C=C+Math.imul(ue,ge)|0,m=m+Math.imul(ue,pe)|0,m=m+Math.imul(we,ge)|0,T=T+Math.imul(we,pe)|0,C=C+Math.imul(ee,_e)|0,m=m+Math.imul(ee,ve)|0,m=m+Math.imul(te,_e)|0,T=T+Math.imul(te,ve)|0,C=C+Math.imul(q,ke)|0,m=m+Math.imul(q,tt)|0,m=m+Math.imul(K,ke)|0,T=T+Math.imul(K,tt)|0,C=C+Math.imul(E,Qe)|0,m=m+Math.imul(E,Ye)|0,m=m+Math.imul(B,Qe)|0,T=T+Math.imul(B,Ye)|0;var Yi=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,C=Math.imul(ut,vt),m=Math.imul(ut,lt),m=m+Math.imul(dt,vt)|0,T=Math.imul(dt,lt),C=C+Math.imul(nt,yt)|0,m=m+Math.imul(nt,gt)|0,m=m+Math.imul(pt,yt)|0,T=T+Math.imul(pt,gt)|0,C=C+Math.imul(ze,xt)|0,m=m+Math.imul(ze,U)|0,m=m+Math.imul(et,xt)|0,T=T+Math.imul(et,U)|0,C=C+Math.imul(Ze,Q)|0,m=m+Math.imul(Ze,ie)|0,m=m+Math.imul(ft,Q)|0,T=T+Math.imul(ft,ie)|0,C=C+Math.imul(at,me)|0,m=m+Math.imul(at,de)|0,m=m+Math.imul(Ge,me)|0,T=T+Math.imul(Ge,de)|0,C=C+Math.imul(Ve,ge)|0,m=m+Math.imul(Ve,pe)|0,m=m+Math.imul(ot,ge)|0,T=T+Math.imul(ot,pe)|0,C=C+Math.imul(ue,_e)|0,m=m+Math.imul(ue,ve)|0,m=m+Math.imul(we,_e)|0,T=T+Math.imul(we,ve)|0,C=C+Math.imul(ee,ke)|0,m=m+Math.imul(ee,tt)|0,m=m+Math.imul(te,ke)|0,T=T+Math.imul(te,tt)|0,C=C+Math.imul(q,Qe)|0,m=m+Math.imul(q,Ye)|0,m=m+Math.imul(K,Qe)|0,T=T+Math.imul(K,Ye)|0;var ma=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(ma>>>26)|0,ma&=67108863,C=Math.imul(ut,yt),m=Math.imul(ut,gt),m=m+Math.imul(dt,yt)|0,T=Math.imul(dt,gt),C=C+Math.imul(nt,xt)|0,m=m+Math.imul(nt,U)|0,m=m+Math.imul(pt,xt)|0,T=T+Math.imul(pt,U)|0,C=C+Math.imul(ze,Q)|0,m=m+Math.imul(ze,ie)|0,m=m+Math.imul(et,Q)|0,T=T+Math.imul(et,ie)|0,C=C+Math.imul(Ze,me)|0,m=m+Math.imul(Ze,de)|0,m=m+Math.imul(ft,me)|0,T=T+Math.imul(ft,de)|0,C=C+Math.imul(at,ge)|0,m=m+Math.imul(at,pe)|0,m=m+Math.imul(Ge,ge)|0,T=T+Math.imul(Ge,pe)|0,C=C+Math.imul(Ve,_e)|0,m=m+Math.imul(Ve,ve)|0,m=m+Math.imul(ot,_e)|0,T=T+Math.imul(ot,ve)|0,C=C+Math.imul(ue,ke)|0,m=m+Math.imul(ue,tt)|0,m=m+Math.imul(we,ke)|0,T=T+Math.imul(we,tt)|0,C=C+Math.imul(ee,Qe)|0,m=m+Math.imul(ee,Ye)|0,m=m+Math.imul(te,Qe)|0,T=T+Math.imul(te,Ye)|0;var Wl=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(Wl>>>26)|0,Wl&=67108863,C=Math.imul(ut,xt),m=Math.imul(ut,U),m=m+Math.imul(dt,xt)|0,T=Math.imul(dt,U),C=C+Math.imul(nt,Q)|0,m=m+Math.imul(nt,ie)|0,m=m+Math.imul(pt,Q)|0,T=T+Math.imul(pt,ie)|0,C=C+Math.imul(ze,me)|0,m=m+Math.imul(ze,de)|0,m=m+Math.imul(et,me)|0,T=T+Math.imul(et,de)|0,C=C+Math.imul(Ze,ge)|0,m=m+Math.imul(Ze,pe)|0,m=m+Math.imul(ft,ge)|0,T=T+Math.imul(ft,pe)|0,C=C+Math.imul(at,_e)|0,m=m+Math.imul(at,ve)|0,m=m+Math.imul(Ge,_e)|0,T=T+Math.imul(Ge,ve)|0,C=C+Math.imul(Ve,ke)|0,m=m+Math.imul(Ve,tt)|0,m=m+Math.imul(ot,ke)|0,T=T+Math.imul(ot,tt)|0,C=C+Math.imul(ue,Qe)|0,m=m+Math.imul(ue,Ye)|0,m=m+Math.imul(we,Qe)|0,T=T+Math.imul(we,Ye)|0;var D0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(D0>>>26)|0,D0&=67108863,C=Math.imul(ut,Q),m=Math.imul(ut,ie),m=m+Math.imul(dt,Q)|0,T=Math.imul(dt,ie),C=C+Math.imul(nt,me)|0,m=m+Math.imul(nt,de)|0,m=m+Math.imul(pt,me)|0,T=T+Math.imul(pt,de)|0,C=C+Math.imul(ze,ge)|0,m=m+Math.imul(ze,pe)|0,m=m+Math.imul(et,ge)|0,T=T+Math.imul(et,pe)|0,C=C+Math.imul(Ze,_e)|0,m=m+Math.imul(Ze,ve)|0,m=m+Math.imul(ft,_e)|0,T=T+Math.imul(ft,ve)|0,C=C+Math.imul(at,ke)|0,m=m+Math.imul(at,tt)|0,m=m+Math.imul(Ge,ke)|0,T=T+Math.imul(Ge,tt)|0,C=C+Math.imul(Ve,Qe)|0,m=m+Math.imul(Ve,Ye)|0,m=m+Math.imul(ot,Qe)|0,T=T+Math.imul(ot,Ye)|0;var L0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(L0>>>26)|0,L0&=67108863,C=Math.imul(ut,me),m=Math.imul(ut,de),m=m+Math.imul(dt,me)|0,T=Math.imul(dt,de),C=C+Math.imul(nt,ge)|0,m=m+Math.imul(nt,pe)|0,m=m+Math.imul(pt,ge)|0,T=T+Math.imul(pt,pe)|0,C=C+Math.imul(ze,_e)|0,m=m+Math.imul(ze,ve)|0,m=m+Math.imul(et,_e)|0,T=T+Math.imul(et,ve)|0,C=C+Math.imul(Ze,ke)|0,m=m+Math.imul(Ze,tt)|0,m=m+Math.imul(ft,ke)|0,T=T+Math.imul(ft,tt)|0,C=C+Math.imul(at,Qe)|0,m=m+Math.imul(at,Ye)|0,m=m+Math.imul(Ge,Qe)|0,T=T+Math.imul(Ge,Ye)|0;var j0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(j0>>>26)|0,j0&=67108863,C=Math.imul(ut,ge),m=Math.imul(ut,pe),m=m+Math.imul(dt,ge)|0,T=Math.imul(dt,pe),C=C+Math.imul(nt,_e)|0,m=m+Math.imul(nt,ve)|0,m=m+Math.imul(pt,_e)|0,T=T+Math.imul(pt,ve)|0,C=C+Math.imul(ze,ke)|0,m=m+Math.imul(ze,tt)|0,m=m+Math.imul(et,ke)|0,T=T+Math.imul(et,tt)|0,C=C+Math.imul(Ze,Qe)|0,m=m+Math.imul(Ze,Ye)|0,m=m+Math.imul(ft,Qe)|0,T=T+Math.imul(ft,Ye)|0;var B0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(B0>>>26)|0,B0&=67108863,C=Math.imul(ut,_e),m=Math.imul(ut,ve),m=m+Math.imul(dt,_e)|0,T=Math.imul(dt,ve),C=C+Math.imul(nt,ke)|0,m=m+Math.imul(nt,tt)|0,m=m+Math.imul(pt,ke)|0,T=T+Math.imul(pt,tt)|0,C=C+Math.imul(ze,Qe)|0,m=m+Math.imul(ze,Ye)|0,m=m+Math.imul(et,Qe)|0,T=T+Math.imul(et,Ye)|0;var $0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+($0>>>26)|0,$0&=67108863,C=Math.imul(ut,ke),m=Math.imul(ut,tt),m=m+Math.imul(dt,ke)|0,T=Math.imul(dt,tt),C=C+Math.imul(nt,Qe)|0,m=m+Math.imul(nt,Ye)|0,m=m+Math.imul(pt,Qe)|0,T=T+Math.imul(pt,Ye)|0;var F0=(j+C|0)+((m&8191)<<13)|0;j=(T+(m>>>13)|0)+(F0>>>26)|0,F0&=67108863,C=Math.imul(ut,Qe),m=Math.imul(ut,Ye),m=m+Math.imul(dt,Qe)|0,T=Math.imul(dt,Ye);var U0=(j+C|0)+((m&8191)<<13)|0;return j=(T+(m>>>13)|0)+(U0>>>26)|0,U0&=67108863,N[0]=Hr,N[1]=cr,N[2]=dn,N[3]=hn,N[4]=vn,N[5]=De,N[6]=fr,N[7]=Nr,N[8]=Yt,N[9]=Yi,N[10]=ma,N[11]=Wl,N[12]=D0,N[13]=L0,N[14]=j0,N[15]=B0,N[16]=$0,N[17]=F0,N[18]=U0,j!==0&&(N[19]=j,k.length++),k};Math.imul||(b=x);function S(O,h,A){A.negative=h.negative^O.negative,A.length=O.length+h.length;for(var k=0,I=0,R=0;R>>26)|0,I+=N>>>26,N&=67108863}A.words[R]=j,k=N,N=I}return k!==0?A.words[R]=k:A.length--,A._strip()}function P(O,h,A){return S(O,h,A)}s.prototype.mulTo=function(h,A){var k,I=this.length+h.length;return this.length===10&&h.length===10?k=b(this,h,A):I<63?k=x(this,h,A):I<1024?k=S(this,h,A):k=P(this,h,A),k},s.prototype.mul=function(h){var A=new s(null);return A.words=new Array(this.length+h.length),this.mulTo(h,A)},s.prototype.mulf=function(h){var A=new s(null);return A.words=new Array(this.length+h.length),P(this,h,A)},s.prototype.imul=function(h){return this.clone().mulTo(h,this)},s.prototype.imuln=function(h){var A=h<0;A&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var k=0,I=0;I>=26,k+=R/67108864|0,k+=N>>>26,this.words[I]=N&67108863}return k!==0&&(this.words[I]=k,this.length++),A?this.ineg():this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var A=w(h);if(A.length===0)return new s(1);for(var k=this,I=0;I=0);var A=h%26,k=(h-A)/26,I=67108863>>>26-A<<26-A,R;if(A!==0){var N=0;for(R=0;R>>26-A}N&&(this.words[R]=N,this.length++)}if(k!==0){for(R=this.length-1;R>=0;R--)this.words[R+k]=this.words[R];for(R=0;R=0);var I;A?I=(A-A%26)/26:I=0;var R=h%26,N=Math.min((h-R)/26,this.length),j=67108863^67108863>>>R<N)for(this.length-=N,m=0;m=0&&(T!==0||m>=I);m--){var F=this.words[m]|0;this.words[m]=T<<26-R|F>>>R,T=F&j}return C&&T!==0&&(C.words[C.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(h,A,k){return n(this.negative===0),this.iushrn(h,A,k)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var A=h%26,k=(h-A)/26,I=1<=0);var A=h%26,k=(h-A)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=k)return this;if(A!==0&&k++,this.length=Math.min(k,this.length),A!==0){var I=67108863^67108863>>>A<=67108864;A++)this.words[A]-=67108864,A===this.length-1?this.words[A+1]=1:this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},s.prototype.isubn=function(h){if(n(typeof h=="number"),n(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A>26)-(C/67108864|0),this.words[R+k]=N&67108863}for(;R>26,this.words[R+k]=N&67108863;if(j===0)return this._strip();for(n(j===-1),j=0,R=0;R>26,this.words[R]=N&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(h,A){var k=this.length-h.length,I=this.clone(),R=h,N=R.words[R.length-1]|0,j=this._countBits(N);k=26-j,k!==0&&(R=R.ushln(k),I.iushln(k),N=R.words[R.length-1]|0);var C=I.length-R.length,m;if(A!=="mod"){m=new s(null),m.length=C+1,m.words=new Array(m.length);for(var T=0;T=0;E--){var B=(I.words[R.length+E]|0)*67108864+(I.words[R.length+E-1]|0);for(B=Math.min(B/N|0,67108863),I._ishlnsubmul(R,B,E);I.negative!==0;)B--,I.negative=0,I._ishlnsubmul(R,1,E),I.isZero()||(I.negative^=1);m&&(m.words[E]=B)}return m&&m._strip(),I._strip(),A!=="div"&&k!==0&&I.iushrn(k),{div:m||null,mod:I}},s.prototype.divmod=function(h,A,k){if(n(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var I,R,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,A),A!=="mod"&&(I=N.div.neg()),A!=="div"&&(R=N.mod.neg(),k&&R.negative!==0&&R.iadd(h)),{div:I,mod:R}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),A),A!=="mod"&&(I=N.div.neg()),{div:I,mod:N.mod}):this.negative&h.negative?(N=this.neg().divmod(h.neg(),A),A!=="div"&&(R=N.mod.neg(),k&&R.negative!==0&&R.isub(h)),{div:N.div,mod:R}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?A==="div"?{div:this.divn(h.words[0]),mod:null}:A==="mod"?{div:null,mod:new s(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modrn(h.words[0]))}:this._wordDiv(h,A)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var A=this.divmod(h);if(A.mod.isZero())return A.div;var k=A.div.negative!==0?A.mod.isub(h):A.mod,I=h.ushrn(1),R=h.andln(1),N=k.cmp(I);return N<0||R===1&&N===0?A.div:A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},s.prototype.modrn=function(h){var A=h<0;A&&(h=-h),n(h<=67108863);for(var k=(1<<26)%h,I=0,R=this.length-1;R>=0;R--)I=(k*I+(this.words[R]|0))%h;return A?-I:I},s.prototype.modn=function(h){return this.modrn(h)},s.prototype.idivn=function(h){var A=h<0;A&&(h=-h),n(h<=67108863);for(var k=0,I=this.length-1;I>=0;I--){var R=(this.words[I]|0)+k*67108864;this.words[I]=R/h|0,k=R%h}return this._strip(),A?this.ineg():this},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var A=this,k=h.clone();A.negative!==0?A=A.umod(h):A=A.clone();for(var I=new s(1),R=new s(0),N=new s(0),j=new s(1),C=0;A.isEven()&&k.isEven();)A.iushrn(1),k.iushrn(1),++C;for(var m=k.clone(),T=A.clone();!A.isZero();){for(var F=0,E=1;!(A.words[0]&E)&&F<26;++F,E<<=1);if(F>0)for(A.iushrn(F);F-- >0;)(I.isOdd()||R.isOdd())&&(I.iadd(m),R.isub(T)),I.iushrn(1),R.iushrn(1);for(var B=0,V=1;!(k.words[0]&V)&&B<26;++B,V<<=1);if(B>0)for(k.iushrn(B);B-- >0;)(N.isOdd()||j.isOdd())&&(N.iadd(m),j.isub(T)),N.iushrn(1),j.iushrn(1);A.cmp(k)>=0?(A.isub(k),I.isub(N),R.isub(j)):(k.isub(A),N.isub(I),j.isub(R))}return{a:N,b:j,gcd:k.iushln(C)}},s.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var A=this,k=h.clone();A.negative!==0?A=A.umod(h):A=A.clone();for(var I=new s(1),R=new s(0),N=k.clone();A.cmpn(1)>0&&k.cmpn(1)>0;){for(var j=0,C=1;!(A.words[0]&C)&&j<26;++j,C<<=1);if(j>0)for(A.iushrn(j);j-- >0;)I.isOdd()&&I.iadd(N),I.iushrn(1);for(var m=0,T=1;!(k.words[0]&T)&&m<26;++m,T<<=1);if(m>0)for(k.iushrn(m);m-- >0;)R.isOdd()&&R.iadd(N),R.iushrn(1);A.cmp(k)>=0?(A.isub(k),I.isub(R)):(k.isub(A),R.isub(I))}var F;return A.cmpn(1)===0?F=I:F=R,F.cmpn(0)<0&&F.iadd(h),F},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var A=this.clone(),k=h.clone();A.negative=0,k.negative=0;for(var I=0;A.isEven()&&k.isEven();I++)A.iushrn(1),k.iushrn(1);do{for(;A.isEven();)A.iushrn(1);for(;k.isEven();)k.iushrn(1);var R=A.cmp(k);if(R<0){var N=A;A=k,k=N}else if(R===0||k.cmpn(1)===0)break;A.isub(k)}while(!0);return k.iushln(I)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){n(typeof h=="number");var A=h%26,k=(h-A)/26,I=1<>>26,j&=67108863,this.words[N]=j}return R!==0&&(this.words[N]=R,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var A=h<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this._strip();var k;if(this.length>1)k=1;else{A&&(h=-h),n(h<=67108863,"Number is too big");var I=this.words[0]|0;k=I===h?0:Ih.length)return 1;if(this.length=0;k--){var I=this.words[k]|0,R=h.words[k]|0;if(I!==R){IR&&(A=1);break}}return A},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new Y(h)},s.prototype.toRed=function(h){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(h){return n(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var _={k256:null,p224:null,p192:null,p25519:null};function D(O,h){this.name=O,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},D.prototype.ireduce=function(h){var A=h,k;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),k=A.bitLength();while(k>this.n);var I=k0?A.isub(this.p):A.strip!==void 0?A.strip():A._strip(),A},D.prototype.split=function(h,A){h.iushrn(this.n,0,A)},D.prototype.imulK=function(h){return h.imul(this.k)};function M(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(M,D),M.prototype.split=function(h,A){for(var k=4194303,I=Math.min(h.length,9),R=0;R>>22,N=j}N>>>=22,h.words[R-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},M.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var A=0,k=0;k>>=26,h.words[k]=R,A=I}return A!==0&&(h.words[h.length++]=A),h},s._prime=function(h){if(_[h])return _[h];var A;if(h==="k256")A=new M;else if(h==="p224")A=new L;else if(h==="p192")A=new z;else if(h==="p25519")A=new H;else throw new Error("Unknown prime "+h);return _[h]=A,A};function Y(O){if(typeof O=="string"){var h=s._prime(O);this.m=h.p,this.prime=h}else n(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}Y.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},Y.prototype._verify2=function(h,A){n((h.negative|A.negative)===0,"red works only with positives"),n(h.red&&h.red===A.red,"red works only with red numbers")},Y.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(f(h,h.umod(this.m)._forceRed(this)),h)},Y.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},Y.prototype.add=function(h,A){this._verify2(h,A);var k=h.add(A);return k.cmp(this.m)>=0&&k.isub(this.m),k._forceRed(this)},Y.prototype.iadd=function(h,A){this._verify2(h,A);var k=h.iadd(A);return k.cmp(this.m)>=0&&k.isub(this.m),k},Y.prototype.sub=function(h,A){this._verify2(h,A);var k=h.sub(A);return k.cmpn(0)<0&&k.iadd(this.m),k._forceRed(this)},Y.prototype.isub=function(h,A){this._verify2(h,A);var k=h.isub(A);return k.cmpn(0)<0&&k.iadd(this.m),k},Y.prototype.shl=function(h,A){return this._verify1(h),this.imod(h.ushln(A))},Y.prototype.imul=function(h,A){return this._verify2(h,A),this.imod(h.imul(A))},Y.prototype.mul=function(h,A){return this._verify2(h,A),this.imod(h.mul(A))},Y.prototype.isqr=function(h){return this.imul(h,h.clone())},Y.prototype.sqr=function(h){return this.mul(h,h)},Y.prototype.sqrt=function(h){if(h.isZero())return h.clone();var A=this.m.andln(3);if(n(A%2===1),A===3){var k=this.m.add(new s(1)).iushrn(2);return this.pow(h,k)}for(var I=this.m.subn(1),R=0;!I.isZero()&&I.andln(1)===0;)R++,I.iushrn(1);n(!I.isZero());var N=new s(1).toRed(this),j=N.redNeg(),C=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new s(2*m*m).toRed(this);this.pow(m,C).cmp(j)!==0;)m.redIAdd(j);for(var T=this.pow(m,I),F=this.pow(h,I.addn(1).iushrn(1)),E=this.pow(h,I),B=R;E.cmp(N)!==0;){for(var V=E,q=0;V.cmp(N)!==0;q++)V=V.redSqr();n(q=0;R--){for(var T=A.words[R],F=m-1;F>=0;F--){var E=T>>F&1;if(N!==I[0]&&(N=this.sqr(N)),E===0&&j===0){C=0;continue}j<<=1,j|=E,C++,!(C!==k&&(R!==0||F!==0))&&(N=this.mul(N,I[j]),C=0,j=0)}m=26}return N},Y.prototype.convertTo=function(h){var A=h.umod(this.m);return A===h?A.clone():A},Y.prototype.convertFrom=function(h){var A=h.clone();return A.red=null,A},s.mont=function(h){return new Z(h)};function Z(O){Y.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Z,Y),Z.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},Z.prototype.convertFrom=function(h){var A=this.imod(h.mul(this.rinv));return A.red=null,A},Z.prototype.imul=function(h,A){if(h.isZero()||A.isZero())return h.words[0]=0,h.length=1,h;var k=h.imul(A),I=k.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=k.isub(I).iushrn(this.shift),N=R;return R.cmp(this.m)>=0?N=R.isub(this.m):R.cmpn(0)<0&&(N=R.iadd(this.m)),N._forceRed(this)},Z.prototype.mul=function(h,A){if(h.isZero()||A.isZero())return new s(0)._forceRed(this);var k=h.mul(A),I=k.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=k.isub(I).iushrn(this.shift),N=R;return R.cmp(this.m)>=0?N=R.isub(this.m):R.cmpn(0)<0&&(N=R.iadd(this.m)),N._forceRed(this)},Z.prototype.invm=function(h){var A=this.imod(h._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(t,aA)})(Rg);var YU=Rg.exports;const Oe=Ss(YU),JU="logger/5.7.0";let O3=!1,N3=!1;const vd={debug:1,default:2,info:2,warning:3,error:4,off:5};let D3=vd.default,F1=null;function XU(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const L3=XU();var Yy;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Yy||(Yy={}));var oi;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(oi||(oi={}));const j3="0123456789abcdef";let W=class dr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();vd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(D3>vd[n])&&console.log.apply(console,r)}debug(...e){this._log(dr.levels.DEBUG,e)}info(...e){this._log(dr.levels.INFO,e)}warn(...e){this._log(dr.levels.WARNING,e)}makeError(e,r,n){if(N3)return this.makeError("censored error",r,{});r||(r=dr.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const c=n[l];try{if(c instanceof Uint8Array){let f="";for(let u=0;u>4],f+=j3[c[u]&15];i.push(l+"=Uint8Array(0x"+f+")")}else i.push(l+"="+JSON.stringify(c))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case oi.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case oi.CALL_EXCEPTION:case oi.INSUFFICIENT_FUNDS:case oi.MISSING_NEW:case oi.NONCE_EXPIRED:case oi.REPLACEMENT_UNDERPRICED:case oi.TRANSACTION_REPLACED:case oi.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,dr.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){L3&&this.throwError("platform missing String.prototype.normalize",dr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:L3})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,dr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,dr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,dr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",dr.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",dr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",dr.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return F1||(F1=new dr(JU)),F1}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",dr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),O3){if(!e)return;this.globalLogger().throwError("error censorship permanent",dr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}N3=!!e,O3=!!r}static setLogLevel(e){const r=vd[e.toLowerCase()];if(r==null){dr.globalLogger().warn("invalid log level - "+e);return}D3=r}static from(e){return new dr(e)}};W.errors=oi;W.levels=Yy;const ZU="bytes/5.7.0",Ht=new W(ZU);function XC(t){return!!t.toHexString}function rl(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return rl(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function x0(t){return He(t)&&!(t.length%2)||Dl(t)}function B3(t){return typeof t=="number"&&t==t&&t%1===0}function Dl(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!B3(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ce(t,e){if(e||(e={}),typeof t=="number"){Ht.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),rl(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),XC(t)&&(t=t.toHexString()),He(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Ht.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ice(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),rl(n)}function hs(t){let e=ce(t);if(e.length===0)return e;let r=0;for(;re&&Ht.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),rl(r)}function He(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const U1="0123456789abcdef";function fe(t,e){if(e||(e={}),typeof t=="number"){Ht.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=U1[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),XC(t))return t.toHexString();if(He(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Ht.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Dl(t)){let r="0x";for(let n=0;n>4]+U1[i&15]}return r}return Ht.throwArgumentError("invalid hexlify value","value",t)}function na(t){if(typeof t!="string")t=fe(t);else if(!He(t)||t.length%2)return null;return(t.length-2)/2}function vr(t,e,r){return typeof t!="string"?t=fe(t):(!He(t)||t.length%2)&&Ht.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function rn(t){let e="0x";return t.forEach(r=>{e+=fe(r).substring(2)}),e}function Tg(t){const e=tz(fe(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function tz(t){typeof t!="string"&&(t=fe(t)),He(t)||Ht.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Ht.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Ll(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(x0(t)){let r=ce(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=fe(r.slice(0,32)),e.s=fe(r.slice(32,64))):r.length===65?(e.r=fe(r.slice(0,32)),e.s=fe(r.slice(32,64)),e.v=r[64]):Ht.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Ht.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=fe(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=ez(ce(e._vs),32);e._vs=fe(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Ht.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=fe(i);e.s==null?e.s=o:e.s!==o&&Ht.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Ht.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Ht.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!He(e.r)?Ht.throwArgumentError("signature missing or invalid r","signature",t):e.r=kt(e.r,32),e.s==null||!He(e.s)?Ht.throwArgumentError("signature missing or invalid s","signature",t):e.s=kt(e.s,32);const r=ce(e.s);r[0]>=128&&Ht.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=fe(r);e._vs&&(He(e._vs)||Ht.throwArgumentError("signature invalid _vs","signature",t),e._vs=kt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Ht.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function $3(t){return t=Ll(t),fe(ir([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const ZC="bignumber/5.7.0";var hh=Oe.BN;const es=new W(ZC),z1={},F3=9007199254740991;function rz(t){return t!=null&&(ae.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||He(t)||typeof t=="bigint"||Dl(t))}let U3=!1;class ae{constructor(e,r){e!==z1&&es.throwError("cannot call constructor directly; use BigNumber.from",W.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return en(Be(this).fromTwos(e))}toTwos(e){return en(Be(this).toTwos(e))}abs(){return this._hex[0]==="-"?ae.from(this._hex.substring(1)):this}add(e){return en(Be(this).add(Be(e)))}sub(e){return en(Be(this).sub(Be(e)))}div(e){return ae.from(e).isZero()&&On("division-by-zero","div"),en(Be(this).div(Be(e)))}mul(e){return en(Be(this).mul(Be(e)))}mod(e){const r=Be(e);return r.isNeg()&&On("division-by-zero","mod"),en(Be(this).umod(r))}pow(e){const r=Be(e);return r.isNeg()&&On("negative-power","pow"),en(Be(this).pow(r))}and(e){const r=Be(e);return(this.isNegative()||r.isNeg())&&On("unbound-bitwise-result","and"),en(Be(this).and(r))}or(e){const r=Be(e);return(this.isNegative()||r.isNeg())&&On("unbound-bitwise-result","or"),en(Be(this).or(r))}xor(e){const r=Be(e);return(this.isNegative()||r.isNeg())&&On("unbound-bitwise-result","xor"),en(Be(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&On("negative-width","mask"),en(Be(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&On("negative-width","shl"),en(Be(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&On("negative-width","shr"),en(Be(this).shrn(e))}eq(e){return Be(this).eq(Be(e))}lt(e){return Be(this).lt(Be(e))}lte(e){return Be(this).lte(Be(e))}gt(e){return Be(this).gt(Be(e))}gte(e){return Be(this).gte(Be(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Be(this).isZero()}toNumber(){try{return Be(this).toNumber()}catch{On("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return es.throwError("this platform does not support BigInt",W.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?U3||(U3=!0,es.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?es.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",W.errors.UNEXPECTED_ARGUMENT,{}):es.throwError("BigNumber.toString does not accept parameters",W.errors.UNEXPECTED_ARGUMENT,{})),Be(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof ae)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new ae(z1,Pf(e)):e.match(/^-?[0-9]+$/)?new ae(z1,Pf(new hh(e))):es.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&On("underflow","BigNumber.from",e),(e>=F3||e<=-F3)&&On("overflow","BigNumber.from",e),ae.from(String(e));const r=e;if(typeof r=="bigint")return ae.from(r.toString());if(Dl(r))return ae.from(fe(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return ae.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(He(n)||n[0]==="-"&&He(n.substring(1))))return ae.from(n)}return es.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Pf(t){if(typeof t!="string")return Pf(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&es.throwArgumentError("invalid hex","value",t),t=Pf(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function en(t){return ae.from(Pf(t))}function Be(t){const e=ae.from(t).toHexString();return e[0]==="-"?new hh("-"+e.substring(3),16):new hh(e.substring(2),16)}function On(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),es.throwError(t,W.errors.NUMERIC_FAULT,n)}function nz(t){return new hh(t,36).toString(16)}const Yr=new W(ZC),Qc={},e7=ae.from(0),t7=ae.from(-1);function r7(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Yr.throwError(t,W.errors.NUMERIC_FAULT,i)}let Yc="0";for(;Yc.length<256;)Yc+=Yc;function Mg(t){if(typeof t!="number")try{t=ae.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+Yc.substring(0,t):Yr.throwArgumentError("invalid decimal size","decimals",t)}function yd(t,e){e==null&&(e=0);const r=Mg(e);t=ae.from(t);const n=t.lt(e7);n&&(t=t.mul(t7));let i=t.mod(r).toString();for(;i.length2&&Yr.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&r7("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?l:(typeof e[o]!==a&&Yr.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Yr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Yr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new nl(Qc,r,n,i)}}class Cr{constructor(e,r,n,i){e!==Qc&&Yr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",W.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Yr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Ai(this._value,this.format.decimals),n=Ai(e._value,e.format.decimals);return Cr.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Ai(this._value,this.format.decimals),n=Ai(e._value,e.format.decimals);return Cr.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Ai(this._value,this.format.decimals),n=Ai(e._value,e.format.decimals);return Cr.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Ai(this._value,this.format.decimals),n=Ai(e._value,e.format.decimals);return Cr.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Cr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(z3.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Cr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(z3.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Yr.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=Cr.from("1"+Yc.substring(0,e),this.format),i=iz.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Yr.throwArgumentError("invalid byte width","width",e);const r=ae.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return kt(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Cr.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!rz(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Cr.fromString(yd(e,r),nl.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=nl.from(r),i=Ai(e,n.decimals);!n.signed&&i.lt(e7)&&r7("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=kt(s,n.width/8));const o=yd(i,n.decimals);return new Cr(Qc,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=nl.from(r);if(ce(e).length>n.width/8)throw new Error("overflow");let i=ae.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=yd(i,n.decimals);return new Cr(Qc,s,o,n)}static from(e,r){if(typeof e=="string")return Cr.fromString(e,r);if(Dl(e))return Cr.fromBytes(e,r);try{return Cr.fromValue(e,0,r)}catch(n){if(n.code!==W.errors.INVALID_ARGUMENT)throw n}return Yr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const z3=Cr.from(1),iz=Cr.from("0.5"),sz="properties/5.7.0";var oz=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const vh=new W(sz);function ne(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Oi(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function er(t){return oz(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function n7(t,e){(!t||typeof t!="object")&&vh.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||vh.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function mr(t){const e={};for(const r in t)e[r]=t[r];return e}const az={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function i7(t){if(t==null||az[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;ria(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&ne(e,r,ia(n))}return e}return vh.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function ia(t){return lz(t)}class ya{constructor(e){for(const r in e)this[r]=ia(e[r])}}const tu="abi/5.7.0",Ue=new W(tu),sa={};let V3={calldata:!0,memory:!0,storage:!0},cz={calldata:!0,memory:!0};function ju(t,e){if(t==="bytes"||t==="string"){if(V3[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&cz[e])return!0;return(V3[e]||e==="payable")&&Ue.throwArgumentError("invalid modifier","name",e),!1}function fz(t,e){let r=t;function n(a){Ue.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==Je.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===Je.full?", ":",")+")"):r+=this.type,e!==Je.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Je.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?br.fromString(e,r):br.fromObject(e)}static fromObject(e){return br.isParamType(e)?e:new br(sa,{name:e.name||null,type:Pa(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(br.fromObject):null})}static fromString(e,r){function n(i){return br.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(fz(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function Rf(t,e){return hz(t).map(r=>br.fromString(r,e))}class cs{constructor(e,r){e!==sa&&Ue.throwError("use a static from method",W.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),pd(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return cs.isFragment(e)?e:typeof e=="string"?cs.fromString(e):cs.fromObject(e)}static fromObject(e){if(cs.isFragment(e))return e;switch(e.type){case"function":return Mi.fromObject(e);case"event":return is.fromObject(e);case"constructor":return Ti.fromObject(e);case"error":return zs.fromObject(e);case"fallback":case"receive":return null}return Ue.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?is.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Mi.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Ti.fromString(e.trim()):e.split(" ")[0]==="error"?zs.fromString(e.substring(5).trim()):Ue.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class is extends cs{format(e){if(e||(e=Je.sighash),Je[e]||Ue.throwArgumentError("invalid format type","format",e),e===Je.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Je.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Je.full?", ":",")+") ",e!==Je.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?is.fromString(e):is.fromObject(e)}static fromObject(e){if(is.isEventFragment(e))return e;e.type!=="event"&&Ue.throwArgumentError("invalid event object","value",e);const r={name:Tf(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(br.fromObject):[],type:"event"};return new is(sa,r)}static fromString(e){let r=e.match(Mf);r||Ue.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Ue.warn("unknown modifier: "+i)}}),is.fromObject({name:r[1].trim(),anonymous:n,inputs:Rf(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function s7(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Ue.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Ue.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=ae.from(r[1]),r[0]):t}function o7(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function a7(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Ue.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Ue.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Ue.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Ue.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Ue.throwArgumentError("unable to determine stateMutability","value",t),e}class Ti extends cs{format(e){if(e||(e=Je.sighash),Je[e]||Ue.throwArgumentError("invalid format type","format",e),e===Je.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===Je.sighash&&Ue.throwError("cannot format a constructor for sighash",W.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===Je.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Ti.fromString(e):Ti.fromObject(e)}static fromObject(e){if(Ti.isConstructorFragment(e))return e;e.type!=="constructor"&&Ue.throwArgumentError("invalid constructor object","value",e);let r=a7(e);r.constant&&Ue.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(br.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?ae.from(e.gas):null};return new Ti(sa,n)}static fromString(e){let r={type:"constructor"};e=s7(e,r);let n=e.match(Mf);return(!n||n[1].trim()!=="constructor")&&Ue.throwArgumentError("invalid constructor string","value",e),r.inputs=Rf(n[2].trim(),!1),o7(n[3].trim(),r),Ti.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Mi extends Ti{format(e){if(e||(e=Je.sighash),Je[e]||Ue.throwArgumentError("invalid format type","format",e),e===Je.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Je.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Je.full?", ":",")+") ",e!==Je.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Mi.fromString(e):Mi.fromObject(e)}static fromObject(e){if(Mi.isFunctionFragment(e))return e;e.type!=="function"&&Ue.throwArgumentError("invalid function object","value",e);let r=a7(e);const n={type:e.type,name:Tf(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(br.fromObject):[],outputs:e.outputs?e.outputs.map(br.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?ae.from(e.gas):null};return new Mi(sa,n)}static fromString(e){let r={type:"function"};e=s7(e,r);let n=e.split(" returns ");n.length>2&&Ue.throwArgumentError("invalid function string","value",e);let i=n[0].match(Mf);if(i||Ue.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Tf(r.name),r.inputs=Rf(i[2],!1),o7(i[3].trim(),r),n.length>1){let s=n[1].match(Mf);(s[1].trim()!=""||s[3].trim()!="")&&Ue.throwArgumentError("unexpected tokens","value",e),r.outputs=Rf(s[2],!1)}else r.outputs=[];return Mi.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function q3(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Ue.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class zs extends cs{format(e){if(e||(e=Je.sighash),Je[e]||Ue.throwArgumentError("invalid format type","format",e),e===Je.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Je.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Je.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?zs.fromString(e):zs.fromObject(e)}static fromObject(e){if(zs.isErrorFragment(e))return e;e.type!=="error"&&Ue.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Tf(e.name),inputs:e.inputs?e.inputs.map(br.fromObject):[]};return q3(new zs(sa,r))}static fromString(e){let r={type:"error"},n=e.match(Mf);return n||Ue.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Tf(r.name),r.inputs=Rf(n[2],!1),q3(zs.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Pa(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const dz=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Tf(t){return(!t||!t.match(dz))&&Ue.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Mf=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function hz(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&Ig.throwError("value out-of-bounds",W.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=ir([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class yh{constructor(e,r,n,i){ne(this,"_data",ce(e)),ne(this,"wordSize",r||32),ne(this,"_coerceFunc",n),ne(this,"allowLoose",i),this._offset=0}get data(){return fe(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):yh.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:Ig.throwError("data out-of-bounds",W.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new yh(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return ae.from(this.readBytes(this.wordSize))}}var l7={exports:{}};/** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=aA:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],u=[4,1024,262144,67108864],d=[1,256,65536,16777216],v=[6,1536,393216,100663296],g=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],w=[224,256,384,512],x=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],S={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(E){return Object.prototype.toString.call(E)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(E){return typeof E=="object"&&E.buffer&&E.buffer.constructor===ArrayBuffer});for(var P=function(E,B,V){return function(q){return new m(E,B,E).update(q)[V]()}},_=function(E,B,V){return function(q,K){return new m(E,B,K).update(q)[V]()}},D=function(E,B,V){return function(q,K,oe,ee){return h["cshake"+E].update(q,K,oe,ee)[V]()}},M=function(E,B,V){return function(q,K,oe,ee){return h["kmac"+E].update(q,K,oe,ee)[V]()}},L=function(E,B,V,q){for(var K=0;K>5,this.byteCount=this.blockCount<<2,this.outputBlocks=V>>5,this.extraBytes=(V&31)>>3;for(var q=0;q<50;++q)this.s[q]=0}m.prototype.update=function(E){if(this.finalized)throw new Error(r);var B,V=typeof E;if(V!=="string"){if(V==="object"){if(E===null)throw new Error(e);if(l&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!l||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);B=!0}for(var q=this.blocks,K=this.byteCount,oe=E.length,ee=this.blockCount,te=0,Ie=this.s,ue,we;te>2]|=E[te]<>2]|=we<>2]|=(192|we>>6)<>2]|=(128|we&63)<=57344?(q[ue>>2]|=(224|we>>12)<>2]|=(128|we>>6&63)<>2]|=(128|we&63)<>2]|=(240|we>>18)<>2]|=(128|we>>12&63)<>2]|=(128|we>>6&63)<>2]|=(128|we&63)<=K){for(this.start=ue-K,this.block=q[ee],ue=0;ue>8,V=E&255;V>0;)K.unshift(V),E=E>>8,V=E&255,++q;return B?K.push(q):K.unshift(q),this.update(K),K.length},m.prototype.encodeString=function(E){var B,V=typeof E;if(V!=="string"){if(V==="object"){if(E===null)throw new Error(e);if(l&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!l||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);B=!0}var q=0,K=E.length;if(B)q=K;else for(var oe=0;oe=57344?q+=3:(ee=65536+((ee&1023)<<10|E.charCodeAt(++oe)&1023),q+=4)}return q+=this.encode(q*8),this.update(E),q},m.prototype.bytepad=function(E,B){for(var V=this.encode(B),q=0;q>2]|=this.padding[B&3],this.lastByteIndex===this.byteCount)for(E[0]=E[V],B=1;B>4&15]+c[te&15]+c[te>>12&15]+c[te>>8&15]+c[te>>20&15]+c[te>>16&15]+c[te>>28&15]+c[te>>24&15];oe%E===0&&(F(B),K=0)}return q&&(te=B[K],ee+=c[te>>4&15]+c[te&15],q>1&&(ee+=c[te>>12&15]+c[te>>8&15]),q>2&&(ee+=c[te>>20&15]+c[te>>16&15])),ee},m.prototype.arrayBuffer=function(){this.finalize();var E=this.blockCount,B=this.s,V=this.outputBlocks,q=this.extraBytes,K=0,oe=0,ee=this.outputBits>>3,te;q?te=new ArrayBuffer(V+1<<2):te=new ArrayBuffer(ee);for(var Ie=new Uint32Array(te);oe>8&255,ee[te+2]=Ie>>16&255,ee[te+3]=Ie>>24&255;oe%E===0&&F(B)}return q&&(te=oe<<2,Ie=B[K],ee[te]=Ie&255,q>1&&(ee[te+1]=Ie>>8&255),q>2&&(ee[te+2]=Ie>>16&255)),ee};function T(E,B,V){m.call(this,E,B,V)}T.prototype=new m,T.prototype.finalize=function(){return this.encode(this.outputBits,!0),m.prototype.finalize.call(this)};var F=function(E){var B,V,q,K,oe,ee,te,Ie,ue,we,zt,Ve,ot,Jn,at,Ge,un,Ze,ft,Xn,ze,et,pi,nt,pt,_r,ut,dt,mi,mt,ht,In,vt,lt,Qi,yt,gt,gi,xt,U,G,Q,ie,he,me,de,ye,ge,pe,Rt,_e,ve,Ke,Ce,tt,Or,Qe,Ye,Hr,cr,dn,hn,vn;for(q=0;q<48;q+=2)K=E[0]^E[10]^E[20]^E[30]^E[40],oe=E[1]^E[11]^E[21]^E[31]^E[41],ee=E[2]^E[12]^E[22]^E[32]^E[42],te=E[3]^E[13]^E[23]^E[33]^E[43],Ie=E[4]^E[14]^E[24]^E[34]^E[44],ue=E[5]^E[15]^E[25]^E[35]^E[45],we=E[6]^E[16]^E[26]^E[36]^E[46],zt=E[7]^E[17]^E[27]^E[37]^E[47],Ve=E[8]^E[18]^E[28]^E[38]^E[48],ot=E[9]^E[19]^E[29]^E[39]^E[49],B=Ve^(ee<<1|te>>>31),V=ot^(te<<1|ee>>>31),E[0]^=B,E[1]^=V,E[10]^=B,E[11]^=V,E[20]^=B,E[21]^=V,E[30]^=B,E[31]^=V,E[40]^=B,E[41]^=V,B=K^(Ie<<1|ue>>>31),V=oe^(ue<<1|Ie>>>31),E[2]^=B,E[3]^=V,E[12]^=B,E[13]^=V,E[22]^=B,E[23]^=V,E[32]^=B,E[33]^=V,E[42]^=B,E[43]^=V,B=ee^(we<<1|zt>>>31),V=te^(zt<<1|we>>>31),E[4]^=B,E[5]^=V,E[14]^=B,E[15]^=V,E[24]^=B,E[25]^=V,E[34]^=B,E[35]^=V,E[44]^=B,E[45]^=V,B=Ie^(Ve<<1|ot>>>31),V=ue^(ot<<1|Ve>>>31),E[6]^=B,E[7]^=V,E[16]^=B,E[17]^=V,E[26]^=B,E[27]^=V,E[36]^=B,E[37]^=V,E[46]^=B,E[47]^=V,B=we^(K<<1|oe>>>31),V=zt^(oe<<1|K>>>31),E[8]^=B,E[9]^=V,E[18]^=B,E[19]^=V,E[28]^=B,E[29]^=V,E[38]^=B,E[39]^=V,E[48]^=B,E[49]^=V,Jn=E[0],at=E[1],de=E[11]<<4|E[10]>>>28,ye=E[10]<<4|E[11]>>>28,dt=E[20]<<3|E[21]>>>29,mi=E[21]<<3|E[20]>>>29,cr=E[31]<<9|E[30]>>>23,dn=E[30]<<9|E[31]>>>23,Q=E[40]<<18|E[41]>>>14,ie=E[41]<<18|E[40]>>>14,lt=E[2]<<1|E[3]>>>31,Qi=E[3]<<1|E[2]>>>31,Ge=E[13]<<12|E[12]>>>20,un=E[12]<<12|E[13]>>>20,ge=E[22]<<10|E[23]>>>22,pe=E[23]<<10|E[22]>>>22,mt=E[33]<<13|E[32]>>>19,ht=E[32]<<13|E[33]>>>19,hn=E[42]<<2|E[43]>>>30,vn=E[43]<<2|E[42]>>>30,Ce=E[5]<<30|E[4]>>>2,tt=E[4]<<30|E[5]>>>2,yt=E[14]<<6|E[15]>>>26,gt=E[15]<<6|E[14]>>>26,Ze=E[25]<<11|E[24]>>>21,ft=E[24]<<11|E[25]>>>21,Rt=E[34]<<15|E[35]>>>17,_e=E[35]<<15|E[34]>>>17,In=E[45]<<29|E[44]>>>3,vt=E[44]<<29|E[45]>>>3,nt=E[6]<<28|E[7]>>>4,pt=E[7]<<28|E[6]>>>4,Or=E[17]<<23|E[16]>>>9,Qe=E[16]<<23|E[17]>>>9,gi=E[26]<<25|E[27]>>>7,xt=E[27]<<25|E[26]>>>7,Xn=E[36]<<21|E[37]>>>11,ze=E[37]<<21|E[36]>>>11,ve=E[47]<<24|E[46]>>>8,Ke=E[46]<<24|E[47]>>>8,he=E[8]<<27|E[9]>>>5,me=E[9]<<27|E[8]>>>5,_r=E[18]<<20|E[19]>>>12,ut=E[19]<<20|E[18]>>>12,Ye=E[29]<<7|E[28]>>>25,Hr=E[28]<<7|E[29]>>>25,U=E[38]<<8|E[39]>>>24,G=E[39]<<8|E[38]>>>24,et=E[48]<<14|E[49]>>>18,pi=E[49]<<14|E[48]>>>18,E[0]=Jn^~Ge&Ze,E[1]=at^~un&ft,E[10]=nt^~_r&dt,E[11]=pt^~ut&mi,E[20]=lt^~yt&gi,E[21]=Qi^~gt&xt,E[30]=he^~de&ge,E[31]=me^~ye&pe,E[40]=Ce^~Or&Ye,E[41]=tt^~Qe&Hr,E[2]=Ge^~Ze&Xn,E[3]=un^~ft&ze,E[12]=_r^~dt&mt,E[13]=ut^~mi&ht,E[22]=yt^~gi&U,E[23]=gt^~xt&G,E[32]=de^~ge&Rt,E[33]=ye^~pe&_e,E[42]=Or^~Ye&cr,E[43]=Qe^~Hr&dn,E[4]=Ze^~Xn&et,E[5]=ft^~ze&pi,E[14]=dt^~mt&In,E[15]=mi^~ht&vt,E[24]=gi^~U&Q,E[25]=xt^~G&ie,E[34]=ge^~Rt&ve,E[35]=pe^~_e&Ke,E[44]=Ye^~cr&hn,E[45]=Hr^~dn&vn,E[6]=Xn^~et&Jn,E[7]=ze^~pi&at,E[16]=mt^~In&nt,E[17]=ht^~vt&pt,E[26]=U^~Q<,E[27]=G^~ie&Qi,E[36]=Rt^~ve&he,E[37]=_e^~Ke&me,E[46]=cr^~hn&Ce,E[47]=dn^~vn&tt,E[8]=et^~Jn&Ge,E[9]=pi^~at&un,E[18]=In^~nt&_r,E[19]=vt^~pt&ut,E[28]=Q^~lt&yt,E[29]=ie^~Qi>,E[38]=ve^~he&de,E[39]=Ke^~me&ye,E[48]=hn^~Ce&Or,E[49]=vn^~tt&Qe,E[0]^=y[q],E[1]^=y[q+1]};if(a)t.exports=h;else for(k=0;k>=8;return e}function W3(t,e,r){let n=0;for(let i=0;ie+1+n&&Ci.throwError("child data too short",W.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function f7(t,e){if(t.length===0&&Ci.throwError("data too short",W.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Ci.throwError("data short segment too short",W.errors.BUFFER_OVERRUN,{});const n=W3(t,e+1,r);return e+1+r+n>t.length&&Ci.throwError("data long segment too short",W.errors.BUFFER_OVERRUN,{}),G3(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Ci.throwError("data array too short",W.errors.BUFFER_OVERRUN,{}),G3(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Ci.throwError("data array too short",W.errors.BUFFER_OVERRUN,{});const n=W3(t,e+1,r);e+1+r+n>t.length&&Ci.throwError("data array too short",W.errors.BUFFER_OVERRUN,{});const i=fe(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&Ci.throwError("data too short",W.errors.BUFFER_OVERRUN,{});const n=fe(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:fe(t[e])}}function _g(t){const e=ce(t),r=f7(e,0);return r.consumed!==e.length&&Ci.throwArgumentError("invalid rlp data","data",t),r.result}const gz="address/5.7.0",Ha=new W(gz);function K3(t){He(t,20)||Ha.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ce(Et(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const xz=9007199254740991;function bz(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Og={};for(let t=0;t<10;t++)Og[String(t)]=String(t);for(let t=0;t<26;t++)Og[String.fromCharCode(65+t)]=String(10+t);const Q3=Math.floor(bz(xz));function wz(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Og[n]).join("");for(;e.length>=Q3;){let n=e.substring(0,Q3);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Ut(t){let e=null;if(typeof t!="string"&&Ha.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=K3(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Ha.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==wz(t)&&Ha.throwArgumentError("bad icap checksum","address",t),e=nz(t.substring(4));e.length<40;)e="0"+e;e=K3("0x"+e)}else Ha.throwArgumentError("invalid address","address",t);return e}function Ez(t){try{return Ut(t),!0}catch{}return!1}function u7(t){let e=null;try{e=Ut(t.from)}catch{Ha.throwArgumentError("missing from address","transaction",t)}const r=hs(ce(ae.from(t.nonce).toHexString()));return Ut(vr(Et(bl([e,r])),12))}class Az extends Rs{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Ut(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Ut(kt(e.readValue().toHexString(),20))}}class Sz extends Rs{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Wa=new W(tu);function d7(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(c=>{const f=c.localName;return f||Wa.throwError("cannot encode object for signature with missing names",W.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[f]&&Wa.throwError("cannot encode object for signature with duplicate names",W.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[f]=!0,r[f]})}else Wa.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Wa.throwArgumentError("types/value length mismatch","tuple",r);let i=new Jy(t.wordSize),s=new Jy(t.wordSize),o=[];e.forEach((l,c)=>{let f=n[c];if(l.dynamic){let u=s.length;l.encode(s,f);let d=i.writeUpdatableValue();o.push(v=>{d(v+u)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function h7(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{o=s.decode(l)}catch(c){if(c.code===W.errors.BUFFER_OVERRUN)throw c;o=c,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===W.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let s=0;s{throw o}})}return Object.freeze(r)}class Cz extends Rs{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Wa.throwError("insufficient data length",W.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===gn.OVERRUN?r.length-e-1:0}function jz(t,e,r,n,i){return t===gn.OVERLONG?(n.push(i),0):(n.push(65533),m7(t,e,r))}const Bz=Object.freeze({error:Lz,ignore:m7,replace:jz});function g7(t,e){e==null&&(e=Bz.error),t=ce(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(gn.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(gn.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(gn.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(gn.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(gn.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(gn.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function sr(t,e=ho.current){e!=ho.current&&(p7.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return ce(r)}function $z(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function ru(t,e){return $z(g7(t,e))}function Fz(t,e=ho.current){return g7(sr(t,e))}class Uz extends v7{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,sr(r))}decode(e){return ru(super.decode(e))}}class Bu extends Rs{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return d7(e,this.coders,r)}decode(e){return e.coerce(this.name,h7(e,this.coders))}}const $u=new W(tu),zz=new RegExp(/^bytes([0-9]*)$/),Vz=new RegExp(/^(u?int)([0-9]*)$/);class qz{constructor(e){ne(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Az(e.name);case"bool":return new kz(e.name);case"string":return new Uz(e.name);case"bytes":return new Pz(e.name);case"array":return new Cz(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Bu((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new Tz(e.name)}let r=e.type.match(Vz);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&$u.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Nz(n/8,r[1]==="int",e.name)}if(r=e.type.match(zz),r){let n=parseInt(r[1]);return(n===0||n>32)&&$u.throwArgumentError("invalid bytes length","param",e),new Rz(n,e.name)}return $u.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new yh(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Jy(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(br.from(i)));return new Bu(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&$u.throwError("types/values length mismatch",W.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(br.from(o))),i=new Bu(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(br.from(o)));return new Bu(i,"_").decode(this._getReader(ce(r),n))}}const Hz=new qz;function $o(t){return Et(sr(t))}const x7="hash/5.7.0";function b7(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function Wz(t){const e={};for(let r=0;r>--l&1}const u=31,d=Math.pow(2,u),v=d>>>1,g=v>>1,y=d-1;let w=0;for(let _=0;_1;){let H=D+M>>>1;_>>1|f(),L=L<<1^v,z=(z^v)<<1|v|1;b=L,S=1+z-L}let P=n-4;return x.map(_=>{switch(_-P){case 3:return P+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return P+256+(t[a++]<<8|t[a++]);case 1:return P+t[a++];default:return _-1}})}function Kz(t){let e=0;return()=>t[e++]}function Qz(t){return Kz(Gz(t))}function Yz(t){return t&1?~t>>1:t>>1}function Jz(t,e){let r=Array(t);for(let n=0;ne[o]):r}function Zz(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(tV(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(rV(r,t))}return Wz(E7(e))}function eV(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function A7(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function tV(t,e){let r=1+e(),n=e(),i=eV(e),s=A7(i.length,1+t,e);return E7(s.map((o,a)=>{const l=o[0],c=o.slice(1);return Array(i[a]).fill(void 0).map((f,u)=>{let d=u*n;return[l+u*r,c.map(v=>v+d)]})}))}function rV(t,e){let r=1+e();return A7(r,1+t,e).map(i=>[i[0],i.slice(1)])}function nV(t){let e=ph(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let c=ph(t,e);if(c.length==0)break;n.push({set:new Set(c),node:r()})}n.sort((c,f)=>f.set.size-c.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function iV(){return Qz(b7("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"))}const b0=iV(),sV=new Set(ph(b0)),oV=new Set(ph(b0)),aV=Zz(b0),lV=nV(b0),J3=45,X3=95;function S7(t){return Fz(t)}function cV(t){return t.filter(e=>e!=65039)}function C7(t){for(let e of t.split(".")){let r=S7(e);try{for(let n=r.lastIndexOf(X3)-1;n>=0;n--)if(r[n]!==X3)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===J3&&r[3]===J3)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function fV(t){return C7(uV(t,cV))}function uV(t,e){let r=S7(t).reverse(),n=[];for(;r.length;){let i=hV(r);if(i){n.push(...e(i));continue}let s=r.pop();if(sV.has(s)){n.push(s);continue}if(oV.has(s))continue;let o=aV[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return C7(dV(String.fromCodePoint(...n)))}function dV(t){return t.normalize("NFC")}function hV(t,e){var r;let n=lV,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(c=>c.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const vV=new W(x7),k7=new Uint8Array(32);k7.fill(0);function Z3(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function P7(t){const e=sr(fV(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(Z3(e.slice(n))),r}function md(t){typeof t!="string"&&vV.throwArgumentError("invalid ENS name; not a string","name",t);let e=k7;const r=P7(t);for(;r.length;)e=Et(ir([e,Et(r.pop())]));return fe(e)}function yV(t){return fe(ir(P7(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const pV=`Ethereum Signed Message: + */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=aA:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],u=[4,1024,262144,67108864],d=[1,256,65536,16777216],v=[6,1536,393216,100663296],g=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],w=[224,256,384,512],x=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],S={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(E){return Object.prototype.toString.call(E)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(E){return typeof E=="object"&&E.buffer&&E.buffer.constructor===ArrayBuffer});for(var P=function(E,B,V){return function(q){return new m(E,B,E).update(q)[V]()}},_=function(E,B,V){return function(q,K){return new m(E,B,K).update(q)[V]()}},D=function(E,B,V){return function(q,K,oe,ee){return h["cshake"+E].update(q,K,oe,ee)[V]()}},M=function(E,B,V){return function(q,K,oe,ee){return h["kmac"+E].update(q,K,oe,ee)[V]()}},L=function(E,B,V,q){for(var K=0;K>5,this.byteCount=this.blockCount<<2,this.outputBlocks=V>>5,this.extraBytes=(V&31)>>3;for(var q=0;q<50;++q)this.s[q]=0}m.prototype.update=function(E){if(this.finalized)throw new Error(r);var B,V=typeof E;if(V!=="string"){if(V==="object"){if(E===null)throw new Error(e);if(l&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!l||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);B=!0}for(var q=this.blocks,K=this.byteCount,oe=E.length,ee=this.blockCount,te=0,Ie=this.s,ue,we;te>2]|=E[te]<>2]|=we<>2]|=(192|we>>6)<>2]|=(128|we&63)<=57344?(q[ue>>2]|=(224|we>>12)<>2]|=(128|we>>6&63)<>2]|=(128|we&63)<>2]|=(240|we>>18)<>2]|=(128|we>>12&63)<>2]|=(128|we>>6&63)<>2]|=(128|we&63)<=K){for(this.start=ue-K,this.block=q[ee],ue=0;ue>8,V=E&255;V>0;)K.unshift(V),E=E>>8,V=E&255,++q;return B?K.push(q):K.unshift(q),this.update(K),K.length},m.prototype.encodeString=function(E){var B,V=typeof E;if(V!=="string"){if(V==="object"){if(E===null)throw new Error(e);if(l&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!l||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);B=!0}var q=0,K=E.length;if(B)q=K;else for(var oe=0;oe=57344?q+=3:(ee=65536+((ee&1023)<<10|E.charCodeAt(++oe)&1023),q+=4)}return q+=this.encode(q*8),this.update(E),q},m.prototype.bytepad=function(E,B){for(var V=this.encode(B),q=0;q>2]|=this.padding[B&3],this.lastByteIndex===this.byteCount)for(E[0]=E[V],B=1;B>4&15]+c[te&15]+c[te>>12&15]+c[te>>8&15]+c[te>>20&15]+c[te>>16&15]+c[te>>28&15]+c[te>>24&15];oe%E===0&&(F(B),K=0)}return q&&(te=B[K],ee+=c[te>>4&15]+c[te&15],q>1&&(ee+=c[te>>12&15]+c[te>>8&15]),q>2&&(ee+=c[te>>20&15]+c[te>>16&15])),ee},m.prototype.arrayBuffer=function(){this.finalize();var E=this.blockCount,B=this.s,V=this.outputBlocks,q=this.extraBytes,K=0,oe=0,ee=this.outputBits>>3,te;q?te=new ArrayBuffer(V+1<<2):te=new ArrayBuffer(ee);for(var Ie=new Uint32Array(te);oe>8&255,ee[te+2]=Ie>>16&255,ee[te+3]=Ie>>24&255;oe%E===0&&F(B)}return q&&(te=oe<<2,Ie=B[K],ee[te]=Ie&255,q>1&&(ee[te+1]=Ie>>8&255),q>2&&(ee[te+2]=Ie>>16&255)),ee};function T(E,B,V){m.call(this,E,B,V)}T.prototype=new m,T.prototype.finalize=function(){return this.encode(this.outputBits,!0),m.prototype.finalize.call(this)};var F=function(E){var B,V,q,K,oe,ee,te,Ie,ue,we,zt,Ve,ot,Jn,at,Ge,un,Ze,ft,Xn,ze,et,pi,nt,pt,_r,ut,dt,mi,mt,ht,In,vt,lt,Qi,yt,gt,gi,xt,U,G,Q,ie,he,me,de,ye,ge,pe,Rt,_e,ve,Ke,ke,tt,Or,Qe,Ye,Hr,cr,dn,hn,vn;for(q=0;q<48;q+=2)K=E[0]^E[10]^E[20]^E[30]^E[40],oe=E[1]^E[11]^E[21]^E[31]^E[41],ee=E[2]^E[12]^E[22]^E[32]^E[42],te=E[3]^E[13]^E[23]^E[33]^E[43],Ie=E[4]^E[14]^E[24]^E[34]^E[44],ue=E[5]^E[15]^E[25]^E[35]^E[45],we=E[6]^E[16]^E[26]^E[36]^E[46],zt=E[7]^E[17]^E[27]^E[37]^E[47],Ve=E[8]^E[18]^E[28]^E[38]^E[48],ot=E[9]^E[19]^E[29]^E[39]^E[49],B=Ve^(ee<<1|te>>>31),V=ot^(te<<1|ee>>>31),E[0]^=B,E[1]^=V,E[10]^=B,E[11]^=V,E[20]^=B,E[21]^=V,E[30]^=B,E[31]^=V,E[40]^=B,E[41]^=V,B=K^(Ie<<1|ue>>>31),V=oe^(ue<<1|Ie>>>31),E[2]^=B,E[3]^=V,E[12]^=B,E[13]^=V,E[22]^=B,E[23]^=V,E[32]^=B,E[33]^=V,E[42]^=B,E[43]^=V,B=ee^(we<<1|zt>>>31),V=te^(zt<<1|we>>>31),E[4]^=B,E[5]^=V,E[14]^=B,E[15]^=V,E[24]^=B,E[25]^=V,E[34]^=B,E[35]^=V,E[44]^=B,E[45]^=V,B=Ie^(Ve<<1|ot>>>31),V=ue^(ot<<1|Ve>>>31),E[6]^=B,E[7]^=V,E[16]^=B,E[17]^=V,E[26]^=B,E[27]^=V,E[36]^=B,E[37]^=V,E[46]^=B,E[47]^=V,B=we^(K<<1|oe>>>31),V=zt^(oe<<1|K>>>31),E[8]^=B,E[9]^=V,E[18]^=B,E[19]^=V,E[28]^=B,E[29]^=V,E[38]^=B,E[39]^=V,E[48]^=B,E[49]^=V,Jn=E[0],at=E[1],de=E[11]<<4|E[10]>>>28,ye=E[10]<<4|E[11]>>>28,dt=E[20]<<3|E[21]>>>29,mi=E[21]<<3|E[20]>>>29,cr=E[31]<<9|E[30]>>>23,dn=E[30]<<9|E[31]>>>23,Q=E[40]<<18|E[41]>>>14,ie=E[41]<<18|E[40]>>>14,lt=E[2]<<1|E[3]>>>31,Qi=E[3]<<1|E[2]>>>31,Ge=E[13]<<12|E[12]>>>20,un=E[12]<<12|E[13]>>>20,ge=E[22]<<10|E[23]>>>22,pe=E[23]<<10|E[22]>>>22,mt=E[33]<<13|E[32]>>>19,ht=E[32]<<13|E[33]>>>19,hn=E[42]<<2|E[43]>>>30,vn=E[43]<<2|E[42]>>>30,ke=E[5]<<30|E[4]>>>2,tt=E[4]<<30|E[5]>>>2,yt=E[14]<<6|E[15]>>>26,gt=E[15]<<6|E[14]>>>26,Ze=E[25]<<11|E[24]>>>21,ft=E[24]<<11|E[25]>>>21,Rt=E[34]<<15|E[35]>>>17,_e=E[35]<<15|E[34]>>>17,In=E[45]<<29|E[44]>>>3,vt=E[44]<<29|E[45]>>>3,nt=E[6]<<28|E[7]>>>4,pt=E[7]<<28|E[6]>>>4,Or=E[17]<<23|E[16]>>>9,Qe=E[16]<<23|E[17]>>>9,gi=E[26]<<25|E[27]>>>7,xt=E[27]<<25|E[26]>>>7,Xn=E[36]<<21|E[37]>>>11,ze=E[37]<<21|E[36]>>>11,ve=E[47]<<24|E[46]>>>8,Ke=E[46]<<24|E[47]>>>8,he=E[8]<<27|E[9]>>>5,me=E[9]<<27|E[8]>>>5,_r=E[18]<<20|E[19]>>>12,ut=E[19]<<20|E[18]>>>12,Ye=E[29]<<7|E[28]>>>25,Hr=E[28]<<7|E[29]>>>25,U=E[38]<<8|E[39]>>>24,G=E[39]<<8|E[38]>>>24,et=E[48]<<14|E[49]>>>18,pi=E[49]<<14|E[48]>>>18,E[0]=Jn^~Ge&Ze,E[1]=at^~un&ft,E[10]=nt^~_r&dt,E[11]=pt^~ut&mi,E[20]=lt^~yt&gi,E[21]=Qi^~gt&xt,E[30]=he^~de&ge,E[31]=me^~ye&pe,E[40]=ke^~Or&Ye,E[41]=tt^~Qe&Hr,E[2]=Ge^~Ze&Xn,E[3]=un^~ft&ze,E[12]=_r^~dt&mt,E[13]=ut^~mi&ht,E[22]=yt^~gi&U,E[23]=gt^~xt&G,E[32]=de^~ge&Rt,E[33]=ye^~pe&_e,E[42]=Or^~Ye&cr,E[43]=Qe^~Hr&dn,E[4]=Ze^~Xn&et,E[5]=ft^~ze&pi,E[14]=dt^~mt&In,E[15]=mi^~ht&vt,E[24]=gi^~U&Q,E[25]=xt^~G&ie,E[34]=ge^~Rt&ve,E[35]=pe^~_e&Ke,E[44]=Ye^~cr&hn,E[45]=Hr^~dn&vn,E[6]=Xn^~et&Jn,E[7]=ze^~pi&at,E[16]=mt^~In&nt,E[17]=ht^~vt&pt,E[26]=U^~Q<,E[27]=G^~ie&Qi,E[36]=Rt^~ve&he,E[37]=_e^~Ke&me,E[46]=cr^~hn&ke,E[47]=dn^~vn&tt,E[8]=et^~Jn&Ge,E[9]=pi^~at&un,E[18]=In^~nt&_r,E[19]=vt^~pt&ut,E[28]=Q^~lt&yt,E[29]=ie^~Qi>,E[38]=ve^~he&de,E[39]=Ke^~me&ye,E[48]=hn^~ke&Or,E[49]=vn^~tt&Qe,E[0]^=y[q],E[1]^=y[q+1]};if(a)t.exports=h;else for(k=0;k>=8;return e}function W3(t,e,r){let n=0;for(let i=0;ie+1+n&&Ci.throwError("child data too short",W.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function f7(t,e){if(t.length===0&&Ci.throwError("data too short",W.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Ci.throwError("data short segment too short",W.errors.BUFFER_OVERRUN,{});const n=W3(t,e+1,r);return e+1+r+n>t.length&&Ci.throwError("data long segment too short",W.errors.BUFFER_OVERRUN,{}),G3(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Ci.throwError("data array too short",W.errors.BUFFER_OVERRUN,{}),G3(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Ci.throwError("data array too short",W.errors.BUFFER_OVERRUN,{});const n=W3(t,e+1,r);e+1+r+n>t.length&&Ci.throwError("data array too short",W.errors.BUFFER_OVERRUN,{});const i=fe(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&Ci.throwError("data too short",W.errors.BUFFER_OVERRUN,{});const n=fe(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:fe(t[e])}}function _g(t){const e=ce(t),r=f7(e,0);return r.consumed!==e.length&&Ci.throwArgumentError("invalid rlp data","data",t),r.result}const gz="address/5.7.0",Ha=new W(gz);function K3(t){He(t,20)||Ha.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ce(Et(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const xz=9007199254740991;function bz(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Og={};for(let t=0;t<10;t++)Og[String(t)]=String(t);for(let t=0;t<26;t++)Og[String.fromCharCode(65+t)]=String(10+t);const Q3=Math.floor(bz(xz));function wz(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Og[n]).join("");for(;e.length>=Q3;){let n=e.substring(0,Q3);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Ut(t){let e=null;if(typeof t!="string"&&Ha.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=K3(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Ha.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==wz(t)&&Ha.throwArgumentError("bad icap checksum","address",t),e=nz(t.substring(4));e.length<40;)e="0"+e;e=K3("0x"+e)}else Ha.throwArgumentError("invalid address","address",t);return e}function Ez(t){try{return Ut(t),!0}catch{}return!1}function u7(t){let e=null;try{e=Ut(t.from)}catch{Ha.throwArgumentError("missing from address","transaction",t)}const r=hs(ce(ae.from(t.nonce).toHexString()));return Ut(vr(Et(bl([e,r])),12))}class Az extends Rs{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Ut(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Ut(kt(e.readValue().toHexString(),20))}}class Sz extends Rs{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Wa=new W(tu);function d7(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(c=>{const f=c.localName;return f||Wa.throwError("cannot encode object for signature with missing names",W.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[f]&&Wa.throwError("cannot encode object for signature with duplicate names",W.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[f]=!0,r[f]})}else Wa.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Wa.throwArgumentError("types/value length mismatch","tuple",r);let i=new Jy(t.wordSize),s=new Jy(t.wordSize),o=[];e.forEach((l,c)=>{let f=n[c];if(l.dynamic){let u=s.length;l.encode(s,f);let d=i.writeUpdatableValue();o.push(v=>{d(v+u)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function h7(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{o=s.decode(l)}catch(c){if(c.code===W.errors.BUFFER_OVERRUN)throw c;o=c,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===W.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let s=0;s{throw o}})}return Object.freeze(r)}class Cz extends Rs{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Wa.throwError("insufficient data length",W.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===gn.OVERRUN?r.length-e-1:0}function jz(t,e,r,n,i){return t===gn.OVERLONG?(n.push(i),0):(n.push(65533),m7(t,e,r))}const Bz=Object.freeze({error:Lz,ignore:m7,replace:jz});function g7(t,e){e==null&&(e=Bz.error),t=ce(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(gn.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(gn.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(gn.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(gn.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(gn.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(gn.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function sr(t,e=ho.current){e!=ho.current&&(p7.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return ce(r)}function $z(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function ru(t,e){return $z(g7(t,e))}function Fz(t,e=ho.current){return g7(sr(t,e))}class Uz extends v7{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,sr(r))}decode(e){return ru(super.decode(e))}}class Bu extends Rs{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return d7(e,this.coders,r)}decode(e){return e.coerce(this.name,h7(e,this.coders))}}const $u=new W(tu),zz=new RegExp(/^bytes([0-9]*)$/),Vz=new RegExp(/^(u?int)([0-9]*)$/);class qz{constructor(e){ne(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Az(e.name);case"bool":return new kz(e.name);case"string":return new Uz(e.name);case"bytes":return new Pz(e.name);case"array":return new Cz(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Bu((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new Tz(e.name)}let r=e.type.match(Vz);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&$u.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Nz(n/8,r[1]==="int",e.name)}if(r=e.type.match(zz),r){let n=parseInt(r[1]);return(n===0||n>32)&&$u.throwArgumentError("invalid bytes length","param",e),new Rz(n,e.name)}return $u.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new yh(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Jy(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(br.from(i)));return new Bu(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&$u.throwError("types/values length mismatch",W.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(br.from(o))),i=new Bu(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(br.from(o)));return new Bu(i,"_").decode(this._getReader(ce(r),n))}}const Hz=new qz;function $o(t){return Et(sr(t))}const x7="hash/5.7.0";function b7(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function Wz(t){const e={};for(let r=0;r>--l&1}const u=31,d=Math.pow(2,u),v=d>>>1,g=v>>1,y=d-1;let w=0;for(let _=0;_1;){let H=D+M>>>1;_>>1|f(),L=L<<1^v,z=(z^v)<<1|v|1;b=L,S=1+z-L}let P=n-4;return x.map(_=>{switch(_-P){case 3:return P+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return P+256+(t[a++]<<8|t[a++]);case 1:return P+t[a++];default:return _-1}})}function Kz(t){let e=0;return()=>t[e++]}function Qz(t){return Kz(Gz(t))}function Yz(t){return t&1?~t>>1:t>>1}function Jz(t,e){let r=Array(t);for(let n=0;ne[o]):r}function Zz(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(tV(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(rV(r,t))}return Wz(E7(e))}function eV(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function A7(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function tV(t,e){let r=1+e(),n=e(),i=eV(e),s=A7(i.length,1+t,e);return E7(s.map((o,a)=>{const l=o[0],c=o.slice(1);return Array(i[a]).fill(void 0).map((f,u)=>{let d=u*n;return[l+u*r,c.map(v=>v+d)]})}))}function rV(t,e){let r=1+e();return A7(r,1+t,e).map(i=>[i[0],i.slice(1)])}function nV(t){let e=ph(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let c=ph(t,e);if(c.length==0)break;n.push({set:new Set(c),node:r()})}n.sort((c,f)=>f.set.size-c.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function iV(){return Qz(b7("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"))}const b0=iV(),sV=new Set(ph(b0)),oV=new Set(ph(b0)),aV=Zz(b0),lV=nV(b0),J3=45,X3=95;function S7(t){return Fz(t)}function cV(t){return t.filter(e=>e!=65039)}function C7(t){for(let e of t.split(".")){let r=S7(e);try{for(let n=r.lastIndexOf(X3)-1;n>=0;n--)if(r[n]!==X3)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===J3&&r[3]===J3)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function fV(t){return C7(uV(t,cV))}function uV(t,e){let r=S7(t).reverse(),n=[];for(;r.length;){let i=hV(r);if(i){n.push(...e(i));continue}let s=r.pop();if(sV.has(s)){n.push(s);continue}if(oV.has(s))continue;let o=aV[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return C7(dV(String.fromCodePoint(...n)))}function dV(t){return t.normalize("NFC")}function hV(t,e){var r;let n=lV,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(c=>c.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const vV=new W(x7),k7=new Uint8Array(32);k7.fill(0);function Z3(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function P7(t){const e=sr(fV(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(Z3(e.slice(n))),r}function md(t){typeof t!="string"&&vV.throwArgumentError("invalid ENS name; not a string","name",t);let e=k7;const r=P7(t);for(;r.length;)e=Et(ir([e,Et(r.pop())]));return fe(e)}function yV(t){return fe(ir(P7(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const pV=`Ethereum Signed Message: `;function mV(t){return typeof t=="string"&&(t=sr(t)),Et(ir([sr(pV),sr(String(t.length)),t]))}var gV=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Dt=new W(x7),R7=new Uint8Array(32);R7.fill(0);const xV=ae.from(-1),T7=ae.from(0),M7=ae.from(1),bV=ae.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function wV(t){const e=ce(t),r=e.length%32;return r?rn([e,R7.slice(r)]):fe(e)}const EV=kt(M7.toHexString(),32),AV=kt(T7.toHexString(),32),eE={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},V1=["name","version","chainId","verifyingContract","salt"];function tE(t){return function(e){return typeof e!="string"&&Dt.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const SV={name:tE("name"),version:tE("version"),chainId:function(t){try{return ae.from(t).toString()}catch{}return Dt.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ut(t).toLowerCase()}catch{}return Dt.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=ce(t);if(e.length!==32)throw new Error("bad length");return fe(e)}catch{}return Dt.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function q1(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&Dt.throwArgumentError("invalid numeric width","type",t);const i=bV.mask(r?n-1:n),s=r?i.add(M7).mul(xV):T7;return function(o){const a=ae.from(o);return(a.lt(s)||a.gt(i))&&Dt.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),kt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&Dt.throwArgumentError("invalid bytes width","type",t),function(n){return ce(n).length!==r&&Dt.throwArgumentError(`invalid length for ${t}`,"value",n),wV(n)}}}switch(t){case"address":return function(e){return kt(Ut(e),32)};case"bool":return function(e){return e?EV:AV};case"bytes":return function(e){return Et(e)};case"string":return function(e){return $o(e)}}return null}function rE(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class Kr{constructor(e){ne(this,"types",Object.freeze(ia(e))),ne(this,"_encoderCache",{}),ne(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(c=>{l[c.name]&&Dt.throwArgumentError(`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(a)}`,"types",e),l[c.name]=!0;const f=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1];f===a&&Dt.throwArgumentError(`circular type reference to ${JSON.stringify(f)}`,"types",e),!q1(f)&&(n[f]||Dt.throwArgumentError(`unknown type ${JSON.stringify(f)}`,"types",e),n[f].push(a),r[a][f]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?Dt.throwArgumentError("missing primary type","types",e):s.length>1&&Dt.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),ne(this,"primaryType",s[0]);function o(a,l){l[a]&&Dt.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(c=>{n[c]&&(o(c,l),Object.keys(l).forEach(f=>{i[f][c]=!0}))}),delete l[a]}o(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=rE(a,e[a])+l.map(c=>rE(c,e[c])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=q1(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&Dt.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(s);return this._types[i]&&(l=l.map(Et)),Et(rn(l))}}const n=this.types[e];if(n){const i=$o(this._types[e]);return s=>{const o=n.map(({name:a,type:l})=>{const c=this.getEncoder(l)(s[a]);return this._types[l]?Et(c):c});return o.unshift(i),rn(o)}}return Dt.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Dt.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Et(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(q1(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&Dt.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{}):Dt.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Kr(e)}static getPrimaryType(e){return Kr.from(e).primaryType}static hashStruct(e,r,n){return Kr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=eE[n];i||Dt.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>V1.indexOf(n.name)-V1.indexOf(i.name)),Kr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return rn(["0x1901",Kr.hashDomain(e),Kr.from(r).hash(n)])}static hash(e,r,n){return Et(Kr.encode(e,r,n))}static resolveNames(e,r,n,i){return gV(this,void 0,void 0,function*(){e=mr(e);const s={};e.verifyingContract&&!He(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Kr.from(r);o.visit(n,(a,l)=>(a==="address"&&!He(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){Kr.hashDomain(e);const i={},s=[];V1.forEach(l=>{const c=e[l];c!=null&&(i[l]=SV[l](c),s.push({name:l,type:eE[l]}))});const o=Kr.from(r),a=mr(r);return a.EIP712Domain?Dt.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,c)=>{if(l.match(/^bytes(\d*)/))return fe(ce(c));if(l.match(/^u?int/))return ae.from(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return typeof c!="string"&&Dt.throwArgumentError("invalid string","value",c),c}return Dt.throwArgumentError("unsupported type","type",l)})}}}const Nt=new W(tu);class CV extends ya{}class kV extends ya{}class PV extends ya{}class Xy extends ya{static isIndexed(e){return!!(e&&e._isIndexed)}}const RV={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function nE(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class iE{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ne(this,"fragments",r.map(n=>cs.from(n)).filter(n=>n!=null)),ne(this,"_abiCoder",Oi(new.target,"getAbiCoder")()),ne(this,"functions",{}),ne(this,"errors",{}),ne(this,"events",{}),ne(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Nt.warn("duplicate definition - constructor");return}ne(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){Nt.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||ne(this,"deploy",Ti.from({payable:!1,type:"constructor"})),ne(this,"_isInterface",!0)}format(e){e||(e=Je.full),e===Je.sighash&&Nt.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===Je.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return Hz}static getAddress(e){return Ut(e)}static getSighash(e){return vr($o(e.format()),0,4)}static getEventTopic(e){return $o(e.format())}getFunction(e){if(He(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Nt.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?Nt.throwArgumentError("no matching function","name",n):i.length>1&&Nt.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Mi.fromString(e).format()];return r||Nt.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(He(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Nt.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?Nt.throwArgumentError("no matching event","name",n):i.length>1&&Nt.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[is.fromString(e).format()];return r||Nt.throwArgumentError("no matching event","signature",e),r}getError(e){if(He(e)){const n=Oi(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}Nt.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?Nt.throwArgumentError("no matching error","name",n):i.length>1&&Nt.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Mi.fromString(e).format()];return r||Nt.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Oi(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Oi(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=ce(r);return fe(n.slice(0,4))!==this.getSighash(e)&&Nt.throwArgumentError(`data signature does not match error ${e.name}.`,"data",fe(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),fe(ir([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=ce(r);return fe(n.slice(0,4))!==this.getSighash(e)&&Nt.throwArgumentError(`data signature does not match function ${e.name}.`,"data",fe(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),fe(ir([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=ce(r),i=null,s="",o=null,a=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const c=fe(n.slice(0,4)),f=RV[c];if(f)o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,l=f.signature,f.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const u=this.getError(c);o=this._abiCoder.decode(u.inputs,n.slice(4)),a=u.name,l=u.format()}catch{}break}}return Nt.throwError("call revert exception"+s,W.errors.CALL_EXCEPTION,{method:e.format(),data:fe(r),errorArgs:o,errorName:a,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),fe(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Nt.throwError("too many arguments for "+e.format(),W.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?$o(o):s.type==="bytes"?Et(fe(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=ae.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),kt(fe(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&Nt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?Nt.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Nt.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push($o(l));else if(o.type==="bytes")n.push(Et(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let d=this.getEventTopic(e);(!He(n[0],32)||n[0].toLowerCase()!==d)&&Nt.throwError("fragment/topic mismatch",W.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((d,v)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(br.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(s.push(d),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,ir(n)):null,l=this._abiCoder.decode(s,r,!0),c=[],f=0,u=0;e.inputs.forEach((d,v)=>{if(d.indexed)if(a==null)c[v]=new Xy({_isIndexed:!0,hash:null});else if(o[v])c[v]=new Xy({_isIndexed:!0,hash:a[u++]});else try{c[v]=a[u++]}catch(g){c[v]=g}else try{c[v]=l[f++]}catch(g){c[v]=g}if(d.name&&c[d.name]==null){const g=c[v];g instanceof Error?Object.defineProperty(c,d.name,{enumerable:!0,get:()=>{throw nE(`property ${JSON.stringify(d.name)}`,g)}}):c[d.name]=g}});for(let d=0;d{throw nE(`index ${d}`,v)}})}return Object.freeze(c)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new kV({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:ae.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new CV({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=fe(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new PV({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const TV="abstract-provider/5.7.0";var MV=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const IV=new W(TV);class _V extends ya{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class nu{constructor(){IV.checkAbstract(new.target,nu),ne(this,"_isProvider",!0)}getFeeData(){return MV(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield er({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=ae.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const OV="abstract-signer/5.7.0";var ei=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Nn=new W(OV),NV=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],DV=[W.errors.INSUFFICIENT_FUNDS,W.errors.NONCE_EXPIRED,W.errors.REPLACEMENT_UNDERPRICED];class jl{constructor(){Nn.checkAbstract(new.target,jl),ne(this,"_isSigner",!0)}getBalance(e){return ei(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return ei(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return ei(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield er(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return ei(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield er(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return ei(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return ei(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return ei(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return ei(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return ei(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)NV.indexOf(n)===-1&&Nn.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=mr(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Nn.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return ei(this,void 0,void 0,function*(){const r=yield er(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>ei(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Nn.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Nn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Nn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Nn.throwError("network does not support EIP-1559",W.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Nn.throwError("failed to get consistent fee data",W.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(DV.indexOf(i.code)>=0)throw i;return Nn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",W.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Nn.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield er(r)})}_checkProvider(e){this.provider||Nn.throwError("missing provider",W.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class Dg extends jl{constructor(e,r){super(),ne(this,"address",e),ne(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Nn.throwError(e,W.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Dg(this.address,e)}}var I7={},$e={},iu=_7;function _7(t,e){if(!t)throw new Error(e||"Assertion failed")}_7.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Zy={exports:{}};typeof Object.create=="function"?Zy.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Zy.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var LV=Zy.exports,jV=iu,BV=LV;$e.inherits=BV;function $V(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function FV(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):$V(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}$e.htonl=O7;function zV(t,e){for(var r="",n=0;n>>0}return s}$e.join32=VV;function qV(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}$e.split32=qV;function HV(t,e){return t>>>e|t<<32-e}$e.rotr32=HV;function WV(t,e){return t<>>32-e}$e.rotl32=WV;function GV(t,e){return t+e>>>0}$e.sum32=GV;function KV(t,e,r){return t+e+r>>>0}$e.sum32_3=KV;function QV(t,e,r,n){return t+e+r+n>>>0}$e.sum32_4=QV;function YV(t,e,r,n,i){return t+e+r+n+i>>>0}$e.sum32_5=YV;function JV(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}$e.sum64=JV;function XV(t,e,r,n){var i=e+n>>>0,s=(i>>0}$e.sum64_hi=XV;function ZV(t,e,r,n){var i=e+n;return i>>>0}$e.sum64_lo=ZV;function eq(t,e,r,n,i,s,o,a){var l=0,c=e;c=c+n>>>0,l+=c>>0,l+=c>>0,l+=c>>0}$e.sum64_4_hi=eq;function tq(t,e,r,n,i,s,o,a){var l=e+n+s+a;return l>>>0}$e.sum64_4_lo=tq;function rq(t,e,r,n,i,s,o,a,l,c){var f=0,u=e;u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0,f+=u>>0}$e.sum64_5_hi=rq;function nq(t,e,r,n,i,s,o,a,l,c){var f=e+n+s+a+c;return f>>>0}$e.sum64_5_lo=nq;function iq(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}$e.rotr64_hi=iq;function sq(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}$e.rotr64_lo=sq;function oq(t,e,r){return t>>>r}$e.shr64_hi=oq;function aq(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}$e.shr64_lo=aq;var Bl={},sE=$e,lq=iu;function w0(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Bl.BlockHash=w0;w0.prototype.update=function(e,r){if(e=sE.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=sE.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}Gi.g0_256=hq;function vq(t){return Bi(t,17)^Bi(t,19)^t>>>10}Gi.g1_256=vq;var wl=$e,yq=Bl,pq=Gi,H1=wl.rotl32,lc=wl.sum32,mq=wl.sum32_5,gq=pq.ft_1,$7=yq.BlockHash,xq=[1518500249,1859775393,2400959708,3395469782];function Vi(){if(!(this instanceof Vi))return new Vi;$7.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}wl.inherits(Vi,$7);var bq=Vi;Vi.blockSize=512;Vi.outSize=160;Vi.hmacStrength=80;Vi.padLength=64;Vi.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),aH(e.length<=this.blockSize);for(var r=e.length;r>8,d=f&255;u?l.push(u,d):l.push(d)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",l=0;l(d>>1)-1?y=(d>>1)-w:y=w,v.isubn(y)):y=0,u[g]=y,v.iushrn(1)}return u}r.getNAF=n;function i(l,c){var f=[[],[]];l=l.clone(),c=c.clone();for(var u=0,d=0,v;l.cmpn(-u)>0||c.cmpn(-d)>0;){var g=l.andln(3)+u&3,y=c.andln(3)+d&3;g===3&&(g=-1),y===3&&(y=-1);var w;g&1?(v=l.andln(7)+u&7,(v===3||v===5)&&y===2?w=-g:w=g):w=0,f[0].push(w);var x;y&1?(v=c.andln(7)+d&7,(v===3||v===5)&&g===2?x=-y:x=y):x=0,f[1].push(x),2*u===w+1&&(u=1-u),2*d===x+1&&(d=1-d),l.iushrn(1),c.iushrn(1)}return f}r.getJSF=i;function s(l,c,f){var u="_"+c;l.prototype[c]=function(){return this[u]!==void 0?this[u]:this[u]=f.call(this)}}r.cachedProperty=s;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function a(l){return new Oe(l,"hex","le")}r.intFromLE=a}),mh=Mn.getNAF,fH=Mn.getJSF,gh=Mn.assert;function Ao(t,e){this.type=t,this.p=new Oe(e.p,16),this.red=e.prime?Oe.red(e.prime):Oe.mont(this.p),this.zero=new Oe(0).toRed(this.red),this.one=new Oe(1).toRed(this.red),this.two=new Oe(2).toRed(this.red),this.n=e.n&&new Oe(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var pa=Ao;Ao.prototype.point=function(){throw new Error("Not implemented")};Ao.prototype.validate=function(){throw new Error("Not implemented")};Ao.prototype._fixedNafMul=function(e,r){gh(e.precomputed);var n=e._getDoubles(),i=mh(r,1,this._bitLength),s=(1<=a;c--)l=(l<<1)+i[c];o.push(l)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a=0;l--){for(var c=0;l>=0&&o[l]===0;l--)c++;if(l>=0&&c++,a=a.dblp(c),l<0)break;var f=o[l];gh(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Ao.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,c=0,f,u,d;for(f=0;f=1;f-=2){var g=f-1,y=f;if(o[g]!==1||o[y]!==1){l[g]=mh(n[g],o[g],this._bitLength),l[y]=mh(n[y],o[y],this._bitLength),c=Math.max(l[g].length,c),c=Math.max(l[y].length,c);continue}var w=[r[g],null,null,r[y]];r[g].y.cmp(r[y].y)===0?(w[1]=r[g].add(r[y]),w[2]=r[g].toJ().mixedAdd(r[y].neg())):r[g].y.cmp(r[y].y.redNeg())===0?(w[1]=r[g].toJ().mixedAdd(r[y]),w[2]=r[g].add(r[y].neg())):(w[1]=r[g].toJ().mixedAdd(r[y]),w[2]=r[g].toJ().mixedAdd(r[y].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],b=fH(n[g],n[y]);for(c=Math.max(b[0].length,c),l[g]=new Array(c),l[y]=new Array(c),u=0;u=0;f--){for(var M=0;f>=0;){var L=!0;for(u=0;u=0&&M++,_=_.dblp(M),f<0)break;for(u=0;u0?d=a[u][z-1>>1]:z<0&&(d=a[u][-z-1>>1].neg()),d.type==="affine"?_=_.mixedAdd(d):_=_.add(d))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};Kn.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(v=c,g=f),u.negative&&(u=u.neg(),d=d.neg()),v.negative&&(v=v.neg(),g=g.neg()),[{a:u,b:d},{a:v,b:g}]};Qn.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),c=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(l),d=c.add(f).neg();return{k1:u,k2:d}};Qn.prototype.pointFromX=function(e,r){e=new Oe(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};Qn.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};Qn.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Ar.prototype.isInfinity=function(){return this.inf};Ar.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Ar.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Ar.prototype.getX=function(){return this.x.fromRed()};Ar.prototype.getY=function(){return this.y.fromRed()};Ar.prototype.mul=function(e){return e=new Oe(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Ar.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Ar.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Ar.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Ar.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Ar.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Mr(t,e,r,n){pa.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Oe(0)):(this.x=new Oe(e,16),this.y=new Oe(r,16),this.z=new Oe(n,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}jg(Mr,pa.BasePoint);Qn.prototype.jpoint=function(e,r,n){return new Mr(this,e,r,n)};Mr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};Mr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Mr.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),c=o.redSub(a);if(l.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=l.redSqr(),u=f.redMul(l),d=i.redMul(f),v=c.redSqr().redIAdd(u).redISub(d).redISub(d),g=c.redMul(d.redISub(v)).redISub(o.redMul(u)),y=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(v,g,y)};Mr.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),f=c.redMul(a),u=n.redMul(c),d=l.redSqr().redIAdd(f).redISub(u).redISub(u),v=l.redMul(u.redISub(d)).redISub(s.redMul(f)),g=this.z.redMul(a);return this.curve.jpoint(d,v,g)};Mr.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};Mr.prototype.inspect=function(){return this.isInfinity()?"":""};Mr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var gd=Ul(function(t,e){var r=e;r.base=pa,r.short=dH,r.mont=null,r.edwards=null}),xd=Ul(function(t,e){var r=e,n=Mn.assert;function i(a){a.type==="short"?this.curve=new gd.short(a):a.type==="edwards"?this.curve=new gd.edwards(a):this.curve=new gd.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var c=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:c}),c}})}s("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:mn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:mn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:mn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:mn.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"]}),s("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:mn.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:mn.sha256,gRed:!1,g:["9"]}),s("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:mn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("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:mn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function vo(t){if(!(this instanceof vo))return new vo(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=fi.toArray(t.entropy,t.entropyEnc||"hex"),r=fi.toArray(t.nonce,t.nonceEnc||"hex"),n=fi.toArray(t.pers,t.persEnc||"hex");Lg(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var J7=vo;vo.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};vo.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=fi.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var hH=Mn.assert;function E0(t,e){if(t instanceof E0)return t;this._importDER(t,e)||(hH(t.r&&t.s,"Signature without r or s"),this.r=new Oe(t.r,16),this.s=new Oe(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var A0=E0;function vH(){this.place=0}function K1(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function cE(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}E0.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=cE(r),n=cE(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Q1(i,r.length),i=i.concat(r),i.push(2),Q1(i,n.length);var s=i.concat(n),o=[48];return Q1(o,s.length),o=o.concat(s),Mn.encode(o,e)};var yH=function(){throw new Error("unsupported")},X7=Mn.assert;function Gn(t){if(!(this instanceof Gn))return new Gn(t);typeof t=="string"&&(X7(Object.prototype.hasOwnProperty.call(xd,t),"Unknown curve "+t),t=xd[t]),t instanceof xd.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var pH=Gn;Gn.prototype.keyPair=function(e){return new Bg(this,e)};Gn.prototype.keyFromPrivate=function(e,r){return Bg.fromPrivate(this,e,r)};Gn.prototype.keyFromPublic=function(e,r){return Bg.fromPublic(this,e,r)};Gn.prototype.genKeyPair=function(e){e||(e={});for(var r=new J7({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||yH(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Oe(2));;){var s=new Oe(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Gn.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Gn.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new Oe(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),l=new J7({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new Oe(1)),f=0;;f++){var u=i.k?i.k(f):new Oe(l.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(c)>=0)){var d=this.g.mul(u);if(!d.isInfinity()){var v=d.getX(),g=v.umod(this.n);if(g.cmpn(0)!==0){var y=u.invm(this.n).mul(g.mul(r.getPrivate()).iadd(e));if(y=y.umod(this.n),y.cmpn(0)!==0){var w=(d.getY().isOdd()?1:0)|(v.cmp(g)!==0?2:0);return i.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new A0({r:g,s:y,recoveryParam:w})}}}}}};Gn.prototype.verify=function(e,r,n,i){e=this._truncateToN(new Oe(e,16)),n=this.keyFromPublic(n,i),r=new A0(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),c=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(l,n.getPublic(),c),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(l,n.getPublic(),c),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};Gn.prototype.recoverPubKey=function(t,e,r,n){X7((3&r)===r,"The recovery param is more than two bits"),e=new A0(e,n);var i=this.n,s=new Oe(t),o=e.r,a=e.s,l=r&1,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),d=a.mul(f).umod(i);return this.g.mulAdd(u,o,d)};Gn.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new A0(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var mH=Ul(function(t,e){var r=e;r.version="6.5.4",r.utils=Mn,r.rand=function(){throw new Error("unsupported")},r.curve=gd,r.curves=xd,r.ec=pH,r.eddsa=null}),gH=mH.ec;const xH="signing-key/5.7.0",np=new W(xH);let Y1=null;function ki(){return Y1||(Y1=new gH("secp256k1")),Y1}class il{constructor(e){ne(this,"curve","secp256k1"),ne(this,"privateKey",fe(e)),na(this.privateKey)!==32&&np.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=ki().keyFromPrivate(ce(this.privateKey));ne(this,"publicKey","0x"+r.getPublic(!1,"hex")),ne(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ne(this,"_isSigningKey",!0)}_addPoint(e){const r=ki().keyFromPublic(ce(this.publicKey)),n=ki().keyFromPublic(ce(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=ki().keyFromPrivate(ce(this.privateKey)),n=ce(e);n.length!==32&&np.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Ll({recoveryParam:i.recoveryParam,r:kt("0x"+i.r.toString(16),32),s:kt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=ki().keyFromPrivate(ce(this.privateKey)),n=ki().keyFromPublic(ce(Z7(e)));return kt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function bH(t,e){const r=Ll(e),n={r:ce(r.r),s:ce(r.s)};return"0x"+ki().recoverPubKey(ce(t),n,r.recoveryParam).encode("hex",!1)}function Z7(t,e){const r=ce(t);if(r.length===32){const n=new il(r);return e?"0x"+ki().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?fe(r):"0x"+ki().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+ki().keyFromPublic(r).getPublic(!0,"hex"):fe(r)}return np.throwArgumentError("invalid public or private key","key","[REDACTED]")}const wH="transactions/5.7.0",Fr=new W(wH);var fE;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(fE||(fE={}));function $g(t){return t==="0x"?null:Ut(t)}function $r(t){return t==="0x"?y7:ae.from(t)}const EH=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],AH={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Wo(t){const e=Z7(t);return Ut(vr(Et(vr(e,1)),12))}function e9(t,e){return Wo(bH(ce(t),e))}function xn(t,e){const r=hs(ae.from(t).toHexString());return r.length>32&&Fr.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function J1(t,e){return{address:Ut(t),storageKeys:(e||[]).map((r,n)=>(na(r)!==32&&Fr.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function zl(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Fr.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),J1(r[0],r[1])):J1(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return J1(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function t9(t){return zl(t).map(e=>[e.address,e.storageKeys])}function r9(t,e){if(t.gasPrice!=null){const n=ae.from(t.gasPrice),i=ae.from(t.maxFeePerGas||0);n.eq(i)||Fr.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[xn(t.chainId||0,"chainId"),xn(t.nonce||0,"nonce"),xn(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),xn(t.maxFeePerGas||0,"maxFeePerGas"),xn(t.gasLimit||0,"gasLimit"),t.to!=null?Ut(t.to):"0x",xn(t.value||0,"value"),t.data||"0x",t9(t.accessList||[])];if(e){const n=Ll(e);r.push(xn(n.recoveryParam,"recoveryParam")),r.push(hs(n.r)),r.push(hs(n.s))}return rn(["0x02",bl(r)])}function n9(t,e){const r=[xn(t.chainId||0,"chainId"),xn(t.nonce||0,"nonce"),xn(t.gasPrice||0,"gasPrice"),xn(t.gasLimit||0,"gasLimit"),t.to!=null?Ut(t.to):"0x",xn(t.value||0,"value"),t.data||"0x",t9(t.accessList||[])];if(e){const n=Ll(e);r.push(xn(n.recoveryParam,"recoveryParam")),r.push(hs(n.r)),r.push(hs(n.s))}return rn(["0x01",bl(r)])}function SH(t,e){n7(t,AH);const r=[];EH.forEach(function(o){let a=t[o.name]||[];const l={};o.numeric&&(l.hexPad="left"),a=ce(fe(a,l)),o.length&&a.length!==o.length&&a.length>0&&Fr.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a),o.maxLength&&(a=hs(a),a.length>o.maxLength&&Fr.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a)),r.push(fe(a))});let n=0;if(t.chainId!=null?(n=t.chainId,typeof n!="number"&&Fr.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!x0(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),n!==0&&(r.push(fe(n)),r.push("0x"),r.push("0x")),!e)return bl(r);const i=Ll(e);let s=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),s+=n*2+8,i.v>28&&i.v!==s&&Fr.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&Fr.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(fe(s)),r.push(hs(ce(i.r))),r.push(hs(ce(i.s))),bl(r)}function uE(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Fr.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),SH(t,e);switch(t.type){case 1:return n9(t,e);case 2:return r9(t,e)}return Fr.throwError(`unsupported transaction type: ${t.type}`,W.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function i9(t,e,r){try{const n=$r(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Fr.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=kt(e[1],32),t.s=kt(e[2],32);try{const n=Et(r(t));t.from=e9(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function CH(t){const e=_g(t.slice(1));e.length!==9&&e.length!==12&&Fr.throwArgumentError("invalid component count for transaction type: 2","payload",fe(t));const r=$r(e[2]),n=$r(e[3]),i={type:2,chainId:$r(e[0]).toNumber(),nonce:$r(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:$r(e[4]),to:$g(e[5]),value:$r(e[6]),data:e[7],accessList:zl(e[8])};return e.length===9||(i.hash=Et(t),i9(i,e.slice(9),r9)),i}function kH(t){const e=_g(t.slice(1));e.length!==8&&e.length!==11&&Fr.throwArgumentError("invalid component count for transaction type: 1","payload",fe(t));const r={type:1,chainId:$r(e[0]).toNumber(),nonce:$r(e[1]).toNumber(),gasPrice:$r(e[2]),gasLimit:$r(e[3]),to:$g(e[4]),value:$r(e[5]),data:e[6],accessList:zl(e[7])};return e.length===8||(r.hash=Et(t),i9(r,e.slice(8),n9)),r}function PH(t){const e=_g(t);e.length!==9&&e.length!==6&&Fr.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:$r(e[0]).toNumber(),gasPrice:$r(e[1]),gasLimit:$r(e[2]),to:$g(e[3]),value:$r(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=ae.from(e[6]).toNumber()}catch{return r}if(r.r=kt(e[7],32),r.s=kt(e[8],32),ae.from(r.r).isZero()&&ae.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(fe(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Et(bl(i));try{r.from=e9(s,{r:fe(r.r),s:fe(r.s),recoveryParam:n})}catch{}r.hash=Et(t)}return r.type=null,r}function RH(t){const e=ce(t);if(e[0]>127)return PH(e);switch(e[0]){case 1:return kH(e);case 2:return CH(e)}return Fr.throwError(`unsupported transaction type: ${e[0]}`,W.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const TH="contracts/5.7.0";var aa=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const tr=new W(TH);function xh(t,e){return aa(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&tr.throwArgumentError("invalid address or ENS name","name",r);try{return Ut(r)}catch{}t||tr.throwError("a provider or signer is needed to resolve ENS names",W.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&tr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function bd(t,e,r){return aa(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>bd(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield xh(t,e):r.type==="tuple"?yield bd(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>bd(t,n,r.arrayChildren))):Promise.reject(tr.makeError("invalid value for array",W.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function S0(t,e,r){return aa(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=mr(r.pop())),tr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=er({override:xh(t.signer,n.from),signer:t.signer.getAddress()}).then(c=>aa(this,void 0,void 0,function*(){return Ut(c.signer)!==c.override&&tr.throwError("Contract with a Signer cannot override from",W.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),c.override})):n.from=t.signer.getAddress():n.from&&(n.from=xh(t.provider,n.from));const i=yield er({args:bd(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:er(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=ae.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=ae.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=ae.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=ae.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=ae.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=zl(a.accessList)),o.gasLimit==null&&e.gas!=null){let c=21e3;const f=ce(s);for(let u=0;un[c]!=null);return l.length&&tr.throwError(`cannot override ${l.map(c=>JSON.stringify(c)).join(",")}`,W.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function MH(t,e){return function(...r){return S0(t,e,r)}}function IH(t,e){const r=t.signer||t.provider;return function(...n){return aa(this,void 0,void 0,function*(){r||tr.throwError("estimate require a provider or signer",W.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield S0(t,e,n);return yield r.estimateGas(i)})}}function _H(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=ia(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(l,c)=>t.interface.decodeEventLog(a.eventFragment,l,c),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function s9(t,e,r){const n=t.signer||t.provider;return function(...i){return aa(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=mr(i.pop());l.blockTag!=null&&(s=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield S0(t,e,i),a=yield n.call(o,s);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===W.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=o),l}})}}function OH(t,e){return function(...r){return aa(this,void 0,void 0,function*(){t.signer||tr.throwError("sending a transaction requires a signer",W.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield S0(t,e,r),i=yield t.signer.sendTransaction(n);return _H(t,i),i})}}function dE(t,e,r){return e.constant?s9(t,e,r):OH(t,e)}function o9(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class If{constructor(e,r){ne(this,"tag",e),ne(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class NH extends If{constructor(){super("error",null)}}class hE extends If{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&tr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(o9(s),s),ne(this,"address",e),ne(this,"interface",r),ne(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=vz(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class vE extends If{constructor(e,r){super("*",{address:e}),ne(this,"address",e),ne(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class DH{constructor(e,r,n){ne(this,"interface",Oi(new.target,"getInterface")(r)),n==null?(ne(this,"provider",null),ne(this,"signer",null)):jl.isSigner(n)?(ne(this,"provider",n.provider||null),ne(this,"signer",n)):nu.isProvider(n)?(ne(this,"provider",n),ne(this,"signer",null)):tr.throwArgumentError("invalid signer or provider","signerOrProvider",n),ne(this,"callStatic",{}),ne(this,"estimateGas",{}),ne(this,"functions",{}),ne(this,"populateTransaction",{}),ne(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];ne(this.filters,a,(...c)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,c)})),o[l.name]||(o[l.name]=[]),o[l.name].push(a)}),Object.keys(o).forEach(a=>{const l=o[a];l.length===1?ne(this.filters,a,this.filters[l[0]]):tr.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if(ne(this,"_runningEvents",{}),ne(this,"_wrappedEmits",{}),e==null&&tr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ne(this,"address",e),this.provider)ne(this,"resolvedAddress",xh(this.provider,e));else try{ne(this,"resolvedAddress",Promise.resolve(Ut(e)))}catch{tr.throwError("provider is required to use ENS name as contract address",W.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){tr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(o)}this[o]==null&&ne(this,o,dE(this,a,!0)),this.functions[o]==null&&ne(this.functions,o,dE(this,a,!1)),this.callStatic[o]==null&&ne(this.callStatic,o,s9(this,a,!0)),this.populateTransaction[o]==null&&ne(this.populateTransaction,o,MH(this,a)),this.estimateGas[o]==null&&ne(this.estimateGas,o,IH(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const l=a[0];try{this[o]==null&&ne(this,o,this[l])}catch{}this.functions[o]==null&&ne(this.functions,o,this.functions[l]),this.callStatic[o]==null&&ne(this.callStatic,o,this.callStatic[l]),this.populateTransaction[o]==null&&ne(this.populateTransaction,o,this.populateTransaction[l]),this.estimateGas[o]==null&&ne(this.estimateGas,o,this.estimateGas[l])})}static getContractAddress(e){return u7(e)}static getInterface(e){return iE.isInterface(e)?e:new iE(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&tr.throwError("contract not deployed",W.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||tr.throwError("sending a transactions require a signer",W.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=mr(e||{});return["from","to"].forEach(function(n){r[n]!=null&&tr.throwError("cannot override "+n,W.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new Dg(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ne(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Xy.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new NH);if(e==="event")return this._normalizeRunningEvent(new If("event",null));if(e==="*")return this._normalizeRunningEvent(new vE(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new hE(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new hE(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new If(o9(r),r))}return this._normalizeRunningEvent(new vE(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=ia(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||tr.throwError("events require a provider or a signer with a provider",W.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=mr(i.filter);return typeof r=="string"&&He(r,32)?(n!=null&&tr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class LH extends DH{}class a9{constructor(e){ne(this,"alphabet",e),ne(this,"base",e.length),ne(this,"_alphabetMap",{}),ne(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>24&255,l[e.length+1]=u>>16&255,l[e.length+2]=u>>8&255,l[e.length+3]=u&255;let d=ce(bh(i,t,l));s||(s=d.length,f=new Uint8Array(s),o=Math.ceil(n/s),c=n-(o-1)*s),f.set(d);for(let y=1;y=256)throw new Error("Depth too large!");return pE(ir([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",fe(this.depth),this.parentFingerprint,kt(fe(this.index),4),this.chainCode,this.privateKey!=null?ir(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new jn(Aa,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~fc));const n=new Uint8Array(37);if(e&fc){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(ce(this.privateKey),1),r&&(r+="'")}else n.set(ce(this.publicKey));for(let u=24;u>=0;u-=8)n[33+(u>>3)]=e>>24-u&255;const i=ce(bh(Of.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,l=null;this.privateKey?a=Uu(ae.from(s).add(this.privateKey).mod(HH)):l=new il(fe(s))._addPoint(this.publicKey);let c=r;const f=this.mnemonic;return f&&(c=Object.freeze({phrase:f.phrase,path:r,locale:f.locale||"en"})),new jn(Aa,a,l,this.fingerprint,Uu(o),e,this.depth+1,c)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i=fc)throw new Error("invalid path index - "+s);n=n._derive(fc+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=fc)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=ce(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=ce(bh(Of.sha512,WH,n));return new jn(Aa,Uu(i.slice(0,32)),null,"0x00000000",Uu(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=Ug(n),e=zg(f9(e,n),n),jn._fromSeed(KH(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return jn._fromSeed(e,null)}static fromExtendedKey(e){const r=_f.decode(e);(r.length!==82||pE(r.slice(0,78))!==e)&&wh.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=fe(r.slice(5,9)),s=parseInt(fe(r.slice(9,13)).substring(2),16),o=fe(r.slice(13,45)),a=r.slice(45,78);switch(fe(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new jn(Aa,null,fe(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new jn(Aa,fe(a.slice(1)),null,i,o,s,n,null)}return wh.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function KH(t,e){e||(e="");const r=sr("mnemonic"+e,ho.NFKD);return Fg(sr(t,ho.NFKD),r,2048,64,"sha512")}function f9(t,e){e=Ug(e),wh.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=ce(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let c=0;c>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=c9(o);if((ce(la(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return fe(n.slice(0,s/8))}function zg(t,e){if(e=Ug(e),t=ce(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&GH(8-n)),n+=3);const i=t.length/4,s=ce(la(t))[0]&c9(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}const QH="random/5.7.0",sp=new W(QH);function YH(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const mE=YH();let wd=mE.crypto||mE.msCrypto;(!wd||!wd.getRandomValues)&&(sp.warn("WARNING: Missing strong random number source"),wd={getRandomValues:function(t){return sp.throwError("no secure random source avaialble",W.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function _c(t){(t<=0||t>1024||t%1||t!=t)&&sp.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return wd.getRandomValues(e),ce(e)}var u9={exports:{}};(function(t,e){(function(r){function n(C){return parseInt(C)===C}function i(C){if(!n(C.length))return!1;for(var m=0;m255)return!1;return!0}function s(C,m){if(C.buffer&&ArrayBuffer.isView(C)&&C.name==="Uint8Array")return m&&(C.slice?C=C.slice():C=Array.prototype.slice.call(C)),C;if(Array.isArray(C)){if(!i(C))throw new Error("Array contains invalid value: "+C);return new Uint8Array(C)}if(n(C.length)&&i(C))return new Uint8Array(C);throw new Error("unsupported array-like object")}function o(C){return new Uint8Array(C)}function a(C,m,T,F,E){(F!=null||E!=null)&&(C.slice?C=C.slice(F,E):C=Array.prototype.slice.call(C,F,E)),m.set(C,T)}var l=function(){function C(T){var F=[],E=0;for(T=encodeURI(T);E191&&B<224?(F.push(String.fromCharCode((B&31)<<6|T[E+1]&63)),E+=2):(F.push(String.fromCharCode((B&15)<<12|(T[E+1]&63)<<6|T[E+2]&63)),E+=3)}return F.join("")}return{toBytes:C,fromBytes:m}}(),c=function(){function C(F){for(var E=[],B=0;B>4]+m[V&15])}return E.join("")}return{toBytes:C,fromBytes:T}}(),f={16:10,24:12,32:14},u=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],v=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],g=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],w=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],x=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],S=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],P=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],D=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],M=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],L=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],z=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function H(C){for(var m=[],T=0;T>2,this._Ke[B][m%4]=E[m],this._Kd[C-B][m%4]=E[m];for(var V=0,q=F,K;q>16&255]<<24^d[K>>8&255]<<16^d[K&255]<<8^d[K>>24&255]^u[V]<<24,V+=1,F!=8)for(var m=1;m>8&255]<<8^d[K>>16&255]<<16^d[K>>24&255]<<24;for(var m=F/2+1;m>2,ee=q%4,this._Ke[oe][ee]=E[m],this._Kd[C-oe][ee]=E[m++],q++}for(var oe=1;oe>24&255]^M[K>>16&255]^L[K>>8&255]^z[K&255]},Y.prototype.encrypt=function(C){if(C.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var m=this._Ke.length-1,T=[0,0,0,0],F=H(C),E=0;E<4;E++)F[E]^=this._Ke[0][E];for(var B=1;B>24&255]^y[F[(E+1)%4]>>16&255]^w[F[(E+2)%4]>>8&255]^x[F[(E+3)%4]&255]^this._Ke[B][E];F=T.slice()}for(var V=o(16),q,E=0;E<4;E++)q=this._Ke[m][E],V[4*E]=(d[F[E]>>24&255]^q>>24)&255,V[4*E+1]=(d[F[(E+1)%4]>>16&255]^q>>16)&255,V[4*E+2]=(d[F[(E+2)%4]>>8&255]^q>>8)&255,V[4*E+3]=(d[F[(E+3)%4]&255]^q)&255;return V},Y.prototype.decrypt=function(C){if(C.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var m=this._Kd.length-1,T=[0,0,0,0],F=H(C),E=0;E<4;E++)F[E]^=this._Kd[0][E];for(var B=1;B>24&255]^S[F[(E+3)%4]>>16&255]^P[F[(E+2)%4]>>8&255]^_[F[(E+1)%4]&255]^this._Kd[B][E];F=T.slice()}for(var V=o(16),q,E=0;E<4;E++)q=this._Kd[m][E],V[4*E]=(v[F[E]>>24&255]^q>>24)&255,V[4*E+1]=(v[F[(E+3)%4]>>16&255]^q>>16)&255,V[4*E+2]=(v[F[(E+2)%4]>>8&255]^q>>8)&255,V[4*E+3]=(v[F[(E+1)%4]&255]^q)&255;return V};var Z=function(C){if(!(this instanceof Z))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new Y(C)};Z.prototype.encrypt=function(C){if(C=s(C),C.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var m=o(C.length),T=o(16),F=0;F=0;--m)this._counter[m]=C%256,C=C>>8},k.prototype.setBytes=function(C){if(C=s(C,!0),C.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=C},k.prototype.increment=function(){for(var C=15;C>=0;C--)if(this._counter[C]===255)this._counter[C]=0;else{this._counter[C]++;break}};var I=function(C,m){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",m instanceof k||(m=new k(m)),this._counter=m,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new Y(C)};I.prototype.encrypt=function(C){for(var m=s(C,!0),T=0;T16)throw new Error("PKCS#7 padding byte out of range");for(var T=C.length-m,F=0;F=64;){let j=x,C=b,m=S,T=P,F=_,E=D,B=M,V=L,q,K,oe,ee,te;for(K=0;K<16;K++)oe=R+K*4,z[K]=(I[oe]&255)<<24|(I[oe+1]&255)<<16|(I[oe+2]&255)<<8|I[oe+3]&255;for(K=16;K<64;K++)q=z[K-2],ee=(q>>>17|q<<32-17)^(q>>>19|q<<32-19)^q>>>10,q=z[K-15],te=(q>>>7|q<<32-7)^(q>>>18|q<<32-18)^q>>>3,z[K]=(ee+z[K-7]|0)+(te+z[K-16]|0)|0;for(K=0;K<64;K++)ee=(((F>>>6|F<<32-6)^(F>>>11|F<<32-11)^(F>>>25|F<<32-25))+(F&E^~F&B)|0)+(V+(w[K]+z[K]|0)|0)|0,te=((j>>>2|j<<32-2)^(j>>>13|j<<32-13)^(j>>>22|j<<32-22))+(j&C^j&m^C&m)|0,V=B,B=E,E=F,F=T+ee|0,T=m,m=C,C=j,j=ee+te|0;x=x+j|0,b=b+C|0,S=S+m|0,P=P+T|0,_=_+F|0,D=D+E|0,M=M+B|0,L=L+V|0,R+=64,N-=64}}H(y);let Y,Z=y.length%64,O=y.length/536870912|0,h=y.length<<3,A=Z<56?56:120,k=y.slice(y.length-Z,y.length);for(k.push(128),Y=Z+1;Y>>24&255),k.push(O>>>16&255),k.push(O>>>8&255),k.push(O>>>0&255),k.push(h>>>24&255),k.push(h>>>16&255),k.push(h>>>8&255),k.push(h>>>0&255),H(k),[x>>>24&255,x>>>16&255,x>>>8&255,x>>>0&255,b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,S>>>24&255,S>>>16&255,S>>>8&255,S>>>0&255,P>>>24&255,P>>>16&255,P>>>8&255,P>>>0&255,_>>>24&255,_>>>16&255,_>>>8&255,_>>>0&255,D>>>24&255,D>>>16&255,D>>>8&255,D>>>0&255,M>>>24&255,M>>>16&255,M>>>8&255,M>>>0&255,L>>>24&255,L>>>16&255,L>>>8&255,L>>>0&255]}function s(y,w,x){y=y.length<=64?y:i(y);const b=64+w.length+4,S=new Array(b),P=new Array(64);let _,D=[];for(_=0;_<64;_++)S[_]=54;for(_=0;_=b-4;L--){if(S[L]++,S[L]<=255)return;S[L]=0}}for(;x>=32;)M(),D=D.concat(i(P.concat(i(S)))),x-=32;return x>0&&(M(),D=D.concat(i(P.concat(i(S))).slice(0,x))),D}function o(y,w,x,b,S){let P;for(f(y,(2*x-1)*16,S,0,16),P=0;P<2*x;P++)c(y,P*16,S,16),l(S,b),f(S,0,y,w+P*16,16);for(P=0;P>>32-w}function l(y,w){f(y,0,w,0,16);for(let x=8;x>0;x-=2)w[4]^=a(w[0]+w[12],7),w[8]^=a(w[4]+w[0],9),w[12]^=a(w[8]+w[4],13),w[0]^=a(w[12]+w[8],18),w[9]^=a(w[5]+w[1],7),w[13]^=a(w[9]+w[5],9),w[1]^=a(w[13]+w[9],13),w[5]^=a(w[1]+w[13],18),w[14]^=a(w[10]+w[6],7),w[2]^=a(w[14]+w[10],9),w[6]^=a(w[2]+w[14],13),w[10]^=a(w[6]+w[2],18),w[3]^=a(w[15]+w[11],7),w[7]^=a(w[3]+w[15],9),w[11]^=a(w[7]+w[3],13),w[15]^=a(w[11]+w[7],18),w[1]^=a(w[0]+w[3],7),w[2]^=a(w[1]+w[0],9),w[3]^=a(w[2]+w[1],13),w[0]^=a(w[3]+w[2],18),w[6]^=a(w[5]+w[4],7),w[7]^=a(w[6]+w[5],9),w[4]^=a(w[7]+w[6],13),w[5]^=a(w[4]+w[7],18),w[11]^=a(w[10]+w[9],7),w[8]^=a(w[11]+w[10],9),w[9]^=a(w[8]+w[11],13),w[10]^=a(w[9]+w[8],18),w[12]^=a(w[15]+w[14],7),w[13]^=a(w[12]+w[15],9),w[14]^=a(w[13]+w[12],13),w[15]^=a(w[14]+w[13],18);for(let x=0;x<16;++x)y[x]+=w[x]}function c(y,w,x,b){for(let S=0;S=256)return!1}return!0}function d(y,w){if(typeof y!="number"||y%1)throw new Error("invalid "+w);return y}function v(y,w,x,b,S,P,_){if(x=d(x,"N"),b=d(b,"r"),S=d(S,"p"),P=d(P,"dkLen"),x===0||x&x-1)throw new Error("N must be power of 2");if(x>2147483647/128/b)throw new Error("N too large");if(b>2147483647/128/S)throw new Error("r too large");if(!u(y))throw new Error("password must be an array or buffer");if(y=Array.prototype.slice.call(y),!u(w))throw new Error("salt must be an array or buffer");w=Array.prototype.slice.call(w);let D=s(y,w,S*128*b);const M=new Uint32Array(S*32*b);for(let F=0;FC&&(F=C);for(let B=0;BC&&(F=C);for(let B=0;B>0&255),D.push(M[B]>>8&255),D.push(M[B]>>16&255),D.push(M[B]>>24&255);const E=s(y,D,P);return _&&_(null,1,E),E}_&&m(T)};if(!_)for(;;){const F=T();if(F!=null)return F}T()}const g={scrypt:function(y,w,x,b,S,P,_){return new Promise(function(D,M){let L=0;_&&_(0),v(y,w,x,b,S,P,function(z,H,Y){if(z)M(z);else if(Y)_&&L!==1&&_(1),D(new Uint8Array(Y));else if(_&&H!==L)return L=H,_(H)})})},syncScrypt:function(y,w,x,b,S,P){return new Uint8Array(v(y,w,x,b,S,P))}};t.exports=g})()})(p9);var tW=p9.exports;const qg=Ss(tW);var rW=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const op=new W(d9);function gE(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}class nW extends ya{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function iW(t,e,r){if(rr(t,"crypto/cipher")==="aes-128-ctr"){const i=Go(rr(t,"crypto/cipherparams/iv")),s=new Ni.Counter(i),o=new Ni.ModeOfOperation.ctr(e,s);return ce(o.decrypt(r))}return null}function m9(t,e){const r=Go(rr(t,"crypto/ciphertext"));if(fe(Et(ir([e.slice(16,32),r]))).substring(2)!==rr(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=iW(t,e.slice(0,16),r);i||op.throwError("unsupported cipher",W.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const s=e.slice(32,64),o=Wo(i);if(t.address){let l=t.address.toLowerCase();if(l.substring(0,2)!=="0x"&&(l="0x"+l),Ut(l)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:fe(i)};if(rr(t,"x-ethers/version")==="0.1"){const l=Go(rr(t,"x-ethers/mnemonicCiphertext")),c=Go(rr(t,"x-ethers/mnemonicCounter")),f=new Ni.Counter(c),u=new Ni.ModeOfOperation.ctr(s,f),d=rr(t,"x-ethers/path")||Nf,v=rr(t,"x-ethers/locale")||"en",g=ce(u.decrypt(l));try{const y=zg(g,v),w=jn.fromMnemonic(y,null,v).derivePath(d);if(w.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=w.mnemonic}catch(y){if(y.code!==W.errors.INVALID_ARGUMENT||y.argument!=="wordlist")throw y}}return new nW(a)}function g9(t,e,r,n,i){return ce(Fg(t,e,r,n,i))}function sW(t,e,r,n,i){return Promise.resolve(g9(t,e,r,n,i))}function x9(t,e,r,n,i){const s=Vg(e),o=rr(t,"crypto/kdf");if(o&&typeof o=="string"){const a=function(l,c){return op.throwArgumentError("invalid key-derivation function parameters",l,c)};if(o.toLowerCase()==="scrypt"){const l=Go(rr(t,"crypto/kdfparams/salt")),c=parseInt(rr(t,"crypto/kdfparams/n")),f=parseInt(rr(t,"crypto/kdfparams/r")),u=parseInt(rr(t,"crypto/kdfparams/p"));(!c||!f||!u)&&a("kdf",o),c&c-1&&a("N",c);const d=parseInt(rr(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),n(s,l,c,f,u,64,i)}else if(o.toLowerCase()==="pbkdf2"){const l=Go(rr(t,"crypto/kdfparams/salt"));let c=null;const f=rr(t,"crypto/kdfparams/prf");f==="hmac-sha256"?c="sha256":f==="hmac-sha512"?c="sha512":a("prf",f);const u=parseInt(rr(t,"crypto/kdfparams/c")),d=parseInt(rr(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),r(s,l,u,d,c)}}return op.throwArgumentError("unsupported key-derivation function","kdf",o)}function oW(t,e){const r=JSON.parse(t),n=x9(r,e,g9,qg.syncScrypt);return m9(r,n)}function aW(t,e,r){return rW(this,void 0,void 0,function*(){const n=JSON.parse(t),i=yield x9(n,e,sW,qg.scrypt,r);return m9(n,i)})}function lW(t,e,r,n){try{if(Ut(t.address)!==Wo(t.privateKey))throw new Error("address/privateKey mismatch");if(gE(t)){const w=t.mnemonic;if(jn.fromMnemonic(w.phrase,null,w.locale).derivePath(w.path||Nf).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(w){return Promise.reject(w)}typeof r=="function"&&!n&&(n=r,r={}),r||(r={});const i=ce(t.privateKey),s=Vg(e);let o=null,a=null,l=null;if(gE(t)){const w=t.mnemonic;o=ce(f9(w.phrase,w.locale||"en")),a=w.path||Nf,l=w.locale||"en"}let c=r.client;c||(c="ethers.js");let f=null;r.salt?f=ce(r.salt):f=_c(32);let u=null;if(r.iv){if(u=ce(r.iv),u.length!==16)throw new Error("invalid iv")}else u=_c(16);let d=null;if(r.uuid){if(d=ce(r.uuid),d.length!==16)throw new Error("invalid uuid")}else d=_c(16);let v=1<<17,g=8,y=1;return r.scrypt&&(r.scrypt.N&&(v=r.scrypt.N),r.scrypt.r&&(g=r.scrypt.r),r.scrypt.p&&(y=r.scrypt.p)),qg.scrypt(s,f,v,g,y,64,n).then(w=>{w=ce(w);const x=w.slice(0,16),b=w.slice(16,32),S=w.slice(32,64),P=new Ni.Counter(u),_=new Ni.ModeOfOperation.ctr(x,P),D=ce(_.encrypt(i)),M=Et(ir([b,D])),L={address:t.address.substring(2).toLowerCase(),id:XH(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:fe(u).substring(2)},ciphertext:fe(D).substring(2),kdf:"scrypt",kdfparams:{salt:fe(f).substring(2),n:v,dklen:32,p:y,r:g},mac:M.substring(2)}};if(o){const z=_c(16),H=new Ni.Counter(z),Y=new Ni.ModeOfOperation.ctr(S,H),Z=ce(Y.encrypt(o)),O=new Date,h=O.getUTCFullYear()+"-"+uc(O.getUTCMonth()+1,2)+"-"+uc(O.getUTCDate(),2)+"T"+uc(O.getUTCHours(),2)+"-"+uc(O.getUTCMinutes(),2)+"-"+uc(O.getUTCSeconds(),2)+".0Z";L["x-ethers"]={client:c,gethFilename:"UTC--"+h+"--"+L.address,mnemonicCounter:fe(z).substring(2),mnemonicCiphertext:fe(Z).substring(2),path:a,locale:l,version:"0.1"}}return JSON.stringify(L)})}function cW(t,e,r){if(v9(t)){r&&r(0);const n=h9(t,e);return r&&r(1),Promise.resolve(n)}return y9(t)?aW(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function fW(t,e){if(v9(t))return h9(t,e);if(y9(t))return oW(t,e);throw new Error("invalid JSON wallet")}const uW="wallet/5.7.0";var xE=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Sa=new W(uW);function dW(t){return t!=null&&He(t.privateKey,32)&&t.address!=null}function hW(t){const e=t.mnemonic;return e&&e.phrase}class ss extends jl{constructor(e,r){if(super(),dW(e)){const n=new il(e.privateKey);if(ne(this,"_signingKey",()=>n),ne(this,"address",Wo(this.publicKey)),this.address!==Ut(e.address)&&Sa.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),hW(e)){const i=e.mnemonic;ne(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||Nf,locale:i.locale||"en"}));const s=this.mnemonic,o=jn.fromMnemonic(s.phrase,null,s.locale).derivePath(s.path);Wo(o.privateKey)!==this.address&&Sa.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ne(this,"_mnemonic",()=>null)}else{if(il.isSigningKey(e))e.curve!=="secp256k1"&&Sa.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ne(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const n=new il(e);ne(this,"_signingKey",()=>n)}ne(this,"_mnemonic",()=>null),ne(this,"address",Wo(this.publicKey))}r&&!nu.isProvider(r)&&Sa.throwArgumentError("invalid provider","provider",r),ne(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new ss(this,e)}signTransaction(e){return er(e).then(r=>{r.from!=null&&(Ut(r.from)!==this.address&&Sa.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);const n=this._signingKey().signDigest(Et(uE(r)));return uE(r,n)})}signMessage(e){return xE(this,void 0,void 0,function*(){return $3(this._signingKey().signDigest(mV(e)))})}_signTypedData(e,r,n){return xE(this,void 0,void 0,function*(){const i=yield Kr.resolveNames(e,r,n,s=>(this.provider==null&&Sa.throwError("cannot resolve ENS names without a provider",W.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:s}),this.provider.resolveName(s)));return $3(this._signingKey().signDigest(Kr.hash(i.domain,r,i.value)))})}encrypt(e,r,n){if(typeof r=="function"&&!n&&(n=r,r={}),n&&typeof n!="function")throw new Error("invalid callback");return r||(r={}),lW(this,e,r,n)}static createRandom(e){let r=_c(16);e||(e={}),e.extraEntropy&&(r=ce(vr(Et(ir([r,e.extraEntropy])),0,16)));const n=zg(r,e.locale);return ss.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,r,n){return cW(e,r,n).then(i=>new ss(i))}static fromEncryptedJsonSync(e,r){return new ss(fW(e,r))}static fromMnemonic(e,r,n){return r||(r=Nf),new ss(jn.fromMnemonic(e,null,n).derivePath(r))}}const vW="networks/5.7.1",bE=new W(vW);function yW(t){return t&&typeof t.renetwork=="function"}function ns(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return ns(r)},e}function Eh(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return Eh(t,n)},r}const wE={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ns("homestead")},EE={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ns("ropsten")},AE={chainId:63,name:"classicMordor",_defaultProvider:Eh("https://www.ethercluster.com/mordor","classicMordor")},zu={unspecified:{chainId:0,name:"unspecified"},homestead:wE,mainnet:wE,morden:{chainId:2,name:"morden"},ropsten:EE,testnet:EE,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ns("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ns("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ns("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ns("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Eh("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:AE,classicTestnet:AE,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Eh("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ns("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ns("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function pW(t){if(t==null)return null;if(typeof t=="number"){for(const n in zu){const i=zu[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=zu[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=zu[t.name];if(!e)return typeof t.chainId!="number"&&bE.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&bE.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(yW(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const mW="web/5.7.1";var gW=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};function xW(t,e){return gW(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:ce(new Uint8Array(i))}})}var bW=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const ni=new W(mW);function SE(t){return new Promise(e=>{setTimeout(e,t)})}function Is(t,e){if(t==null)return null;if(typeof t=="string")return t;if(x0(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return ru(t)}catch{}return fe(t)}return t}function wW(t){return sr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function EW(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;ni.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;ni.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const c={method:"GET"};let f=!1,u=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&ni.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(u=t.timeout),t.headers)for(const x in t.headers)a[x.toLowerCase()]={key:x,value:String(t.headers[x])},["if-none-match","if-modified-since"].indexOf(x.toLowerCase())>=0&&(f=!0);if(c.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&ni.throwError("basic authentication requires a secure https url",W.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const x=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+w7(sr(x))}}t.skipFetchSetup!=null&&(c.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(c.fetchOptions=mr(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),v=l?l.match(d):null;if(v)try{const x={statusCode:200,statusMessage:"OK",headers:{"content-type":v[1]||"text/plain"},body:v[2]?b7(v[3]):wW(v[3])};let b=x.body;return r&&(b=r(x.body,x)),Promise.resolve(b)}catch(x){ni.throwError("processing response error",W.errors.SERVER_ERROR,{body:Is(v[1],v[2]),error:x,requestBody:null,requestMethod:"GET",url:l})}e&&(c.method="POST",c.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const g={};Object.keys(a).forEach(x=>{const b=a[x];g[b.key]=b.value}),c.headers=g;const y=function(){let x=null;return{promise:new Promise(function(P,_){u&&(x=setTimeout(()=>{x!=null&&(x=null,_(ni.makeError("timeout",W.errors.TIMEOUT,{requestBody:Is(c.body,g["content-type"]),requestMethod:c.method,timeout:u,url:l})))},u))}),cancel:function(){x!=null&&(clearTimeout(x),x=null)}}}(),w=function(){return bW(this,void 0,void 0,function*(){for(let x=0;x=300)&&(y.cancel(),ni.throwError("bad response",W.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:Is(S,b.headers?b.headers["content-type"]:null),requestBody:Is(c.body,g["content-type"]),requestMethod:c.method,url:l})),r)try{const P=yield r(S,b);return y.cancel(),P}catch(P){if(P.throttleRetry&&x{let a=null;if(s!=null)try{a=JSON.parse(ru(s))}catch(l){ni.throwError("invalid JSON",W.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=sr(e);const s=typeof t=="string"?{url:t}:mr(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=mr(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return EW(t,i,n)}function Oc(t,e){return e||(e={}),e=mr(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function c(){return t().then(function(f){if(f!==void 0)o()&&r(f);else if(e.oncePoll)e.oncePoll.once("poll",c);else if(e.onceBlock)e.onceBlock.once("block",c);else if(!s){if(l++,l>a){o()&&n(new Error("retry limit reached"));return}let u=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));ue.ceiling&&(u=e.ceiling),setTimeout(c,u)}return null},function(f){o()&&n(f)})}c()})}var Ah="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ap={};for(var Vu=0;Vu>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function b9(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=sl(e)^n>>5}for(e=sl(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=b9(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=sl(n)^o,i+=Ah.charAt(o)}for(s=0;s<6;++s)n=sl(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=Ah.charAt(a)}return i}function w9(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=b9(s);if(typeof a=="string")return a;for(var l=[],c=0;c=o.length)&&l.push(u)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function SW(){var t=w9.apply(null,arguments);if(typeof t=="object")return t}function CW(t){var e=w9.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function C0(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(u,!0);return e.transaction={hash:o,type:c,accessList:be.allowNull(this.accessList.bind(this),null),blockHash:be.allowNull(o,null),blockNumber:be.allowNull(l,null),transactionIndex:be.allowNull(l,null),confirmations:be.allowNull(l,null),from:r,gasPrice:be.allowNull(n),maxPriorityFeePerGas:be.allowNull(n),maxFeePerGas:be.allowNull(n),gasLimit:n,to:be.allowNull(r,null),value:n,nonce:l,data:s,r:be.allowNull(this.uint256),s:be.allowNull(this.uint256),v:be.allowNull(l),creates:be.allowNull(r,null),raw:be.allowNull(s)},e.transactionRequest={from:be.allowNull(r),nonce:be.allowNull(l),gasLimit:be.allowNull(n),gasPrice:be.allowNull(n),maxPriorityFeePerGas:be.allowNull(n),maxFeePerGas:be.allowNull(n),to:be.allowNull(r),value:be.allowNull(n),data:be.allowNull(f),type:be.allowNull(l),accessList:be.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:be.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:be.allowNull(this.address,null),from:be.allowNull(this.address,null),contractAddress:be.allowNull(r,null),transactionIndex:l,root:be.allowNull(a),gasUsed:n,logsBloom:be.allowNull(s),blockHash:o,transactionHash:o,logs:be.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:be.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:be.allowNull(n),status:be.allowNull(l),type:c},e.block={hash:be.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:be.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:be.allowNull(r),extraData:s,transactions:be.allowNull(be.arrayOf(o)),baseFeePerGas:be.allowNull(n)},e.blockWithTransactions=mr(e.block),e.blockWithTransactions.transactions=be.allowNull(be.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:be.allowNull(i,void 0),toBlock:be.allowNull(i,void 0),blockHash:be.allowNull(o,void 0),address:be.allowNull(r,void 0),topics:be.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:be.allowNull(l),blockHash:be.allowNull(o),transactionIndex:l,removed:be.allowNull(this.boolean.bind(this)),address:r,data:be.allowFalsish(s,"0x"),topics:be.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return zl(e||[])}number(e){return e==="0x"?0:ae.from(e).toNumber()}type(e){return e==="0x"||e==null?0:ae.from(e).toNumber()}bigNumber(e){return ae.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),He(e))?e.toLowerCase():dc.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Ut(e)}callAddress(e){if(!He(e,32))return null;const r=Ut(vr(e,12));return r===Ng?null:r}contractAddress(e){return u7(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||He(e))return Tg(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return na(n)!==32?dc.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=ae.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!He(e))throw new Error("invalid uint256");return kt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=be.check(r,e);return i._difficulty=n==null?null:ae.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return be.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&ae.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=be.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;He(n)&&(n=ae.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),He(n)&&(n=ae.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return RH(e)}receiptLog(e){return be.check(this.formats.receiptLog,e)}receipt(e){const r=be.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=ae.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&dc.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):dc.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&dc.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return be.check(this.formats.filter,e)}filterLog(e){return be.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var ke=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Le=new W(Wg),IW=10;function kE(t){return t==null?"null":(na(t)!==32&&Le.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function PE(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[kE(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return kE(e)}).join("&")}function _W(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Ca(t){if(typeof t=="string"){if(t=t.toLowerCase(),na(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+PE(t);if(_V.isForkEvent(t))throw Le.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+PE(t.topics||[])}throw new Error("invalid event - "+t)}function hc(){return new Date().getTime()}function RE(t){return new Promise(e=>{setTimeout(e,t)})}const OW=["block","network","pending","poll"];let NW=class{constructor(e,r,n){ne(this,"tag",e),ne(this,"listener",r),ne(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=_W(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||OW.indexOf(this.tag)>=0}};const DW={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Z1(t){return kt(ae.from(t).toHexString(),32)}function TE(t){return _f.encode(ir([t,vr(la(la(t)),0,4)]))}const E9=new RegExp("^(ipfs)://(.*)$","i"),ME=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),E9,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Ed(t,e){try{return ru(Df(t,e))}catch{}return null}function Df(t,e){if(t==="0x")return null;const r=ae.from(vr(t,e,e+32)).toNumber(),n=ae.from(vr(t,r,r+32)).toNumber();return vr(t,r+32,r+32+n)}function ev(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Le.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function IE(t){const e=ce(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function LW(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function A9(t){const e=[];let r=0;for(let n=0;nae.from(e).eq(1)).catch(e=>{if(e.code===W.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return ke(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:rn([e,md(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=rn(["0x9061b923",A9([yV(this.name),n.data])]));try{let s=yield this.provider.call(n);return ce(s).length%32===4&&Le.throwError("resolver threw error",W.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=Df(s,0)),s}catch(s){if(s.code===W.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return ke(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?Df(n,0):null})}_getAddress(e,r){const n=DW[String(e)];if(n==null&&Le.throwError(`unsupported coin type: ${e}`,W.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=ce(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return TE(ir([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return TE(ir([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=CE.toWords(i.slice(2));return a.unshift(o),CE.encode(n.prefix,a)}}return null}getAddress(e){return ke(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Oz?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===W.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",Z1(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Le.throwError("invalid or unsupported coin data",W.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return ke(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[l])}return Le.throwError("invalid or unsupported content hash data",W.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return ke(this,void 0,void 0,function*(){let r=sr(e);r=ir([Z1(64),Z1(r.length),r]),r.length%32!==0&&(r=ir([r,kt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",fe(r));return n==null||n==="0x"?null:ru(n)})}}let tv=null,jW=1;class BW extends nu{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ne(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Oi(new.target,"getNetwork")(e);r?(ne(this,"_network",r),this.emit("network",r,null)):Le.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ke(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Le.throwError("no network detected",W.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:ne(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Oc(()=>this._ready().then(e=>e,e=>{if(!(e.code===W.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return tv==null&&(tv=new be),tv}static getNetwork(e){return pW(e??"homestead")}ccipReadFetch(e,r,n){return ke(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),u=yield Hg({url:c,errorPassThrough:!0},f,(v,g)=>(v.status=g.statusCode,v));if(u.data)return u.data;const d=u.message||"unknown error";if(u.status>=400&&u.status<500)return Le.throwError(`response not found during CCIP fetch: ${d}`,W.errors.SERVER_ERROR,{url:l,errorMessage:d});o.push(d)}return Le.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,W.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return ke(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(hc()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=hc(),n=er({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=hc();return i=ae.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return ke(this,void 0,void 0,function*(){const e=jW++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Le.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Le.makeError("network block skew detected",W.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(c=>{c.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=c.blockNumber),this._emitted["b:"+c.blockHash]=c.blockNumber,this._emitted["t:"+c.transactionHash]=c.blockNumber,this.emit(s,c)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ke(this,void 0,void 0,function*(){return Le.throwError("provider does not support network detection",W.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ke(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield RE(0),this._network;const n=Le.makeError("underlying network changed",W.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=hc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return ke(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return ke(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const l=[];let c=!1;const f=function(){return c?!0:(c=!0,l.forEach(d=>{d()}),!1)},u=d=>{d.confirmations{this.removeListener(e,u)}),i){let d=i.startBlock,v=null;const g=y=>ke(this,void 0,void 0,function*(){c||(yield RE(1e3),this.getTransactionCount(i.from).then(w=>ke(this,void 0,void 0,function*(){if(!c){if(w<=i.nonce)d=y;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(v==null&&(v=d-3,v{c||this.once("block",g)}))});if(c)return;this.once("block",g),l.push(()=>{this.removeListener("block",g)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{f()||a(Le.makeError("timeout exceeded",W.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),l.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return ke(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return ae.from(e)}catch(r){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield er({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return ae.from(i)}catch(s){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield er({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return ae.from(i).toNumber()}catch(s){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield er({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return fe(i)}catch(s){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield er({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>Tg(o))}),s=yield this.perform("getStorageAt",i);try{return fe(s)}catch(o){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&na(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Le.throwError("Transaction hash mismatch from Provider.sendTransaction.",W.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>ke(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Le.throwError("transaction failed",W.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>fe(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return ke(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?ae.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?fe(s):null))}),this.formatter.transactionRequest(yield er(n))})}_getFilter(e){return ke(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield er(r))})}_call(e,r,n){return ke(this,void 0,void 0,function*(){n>=IW&&Le.throwError("CCIP read exceeded maximum redirections",W.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&na(s)%32===4)try{const o=vr(s,4),a=vr(o,0,32);ae.from(a).eq(i)||Le.throwError("CCIP Read sender did not match",W.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],c=ae.from(vr(o,32,64)).toNumber(),f=ae.from(vr(o,c,c+32)).toNumber(),u=vr(o,c+32);for(let x=0;xke(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return ke(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Oc(()=>ke(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return ke(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Oc(()=>ke(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield er({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),be.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return ke(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return ke(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Le.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return ke(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new _E(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return ke(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Le.throwError("network does not support ENS",W.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+md(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return ke(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(He(e))throw n}typeof e!="string"&&Le.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return ke(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Ed(yield this.call({to:n,data:"0x691f3431"+md(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return ke(this,void 0,void 0,function*(){let r=null;if(He(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new _E(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==W.errors.CALL_EXCEPTION)throw a}try{const a=Ed(yield this.call({to:o,data:"0x691f3431"+md(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==W.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Le.throwError(e+" not implemented",W.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new NW(Ca(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Ca(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Ca(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Ca(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Ca(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Ca(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var ts=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const ar=new W(Wg),$W=["call","estimateGas"];function Xc(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=He(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Xc(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Xc(JSON.parse(t),e)}catch{}return null}function S9(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=Xc(e,!0);if(s)return s.data;ar.throwError("missing revert data in call exception; Transaction reverted without a reason string",W.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=Xc(e.body,!1);s==null&&(s=Xc(e,!1)),s&&ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",W.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===W.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ar.throwError("insufficient funds for intrinsic transaction cost",W.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&ar.throwError("nonce has already been used",W.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ar.throwError("replacement fee too low",W.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&ar.throwError("legacy pre-eip-155 transactions not supported",W.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),$W.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",W.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function OE(t){return new Promise(function(e){setTimeout(e,t)})}function FW(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function vc(t){return t&&t.toLowerCase()}const lp={};class C9 extends jl{constructor(e,r,n){if(super(),e!==lp)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ne(this,"provider",r),n==null&&(n=0),typeof n=="string"?(ne(this,"_address",this.provider.formatter.address(n)),ne(this,"_index",null)):typeof n=="number"?(ne(this,"_index",n),ne(this,"_address",null)):ar.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return ar.throwError("cannot alter JSON-RPC Signer connection",W.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UW(lp,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&ar.throwError("unknown account #"+this._index,W.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=mr(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=mr(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>ts(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&ar.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),er({tx:er(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&ar.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&ar.throwError("user rejected transaction",W.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),S9("sendTransaction",o,s)))})}signTransaction(e){return ar.throwError("signing transactions is unsupported",W.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return ts(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Oc(()=>ts(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return ts(this,void 0,void 0,function*(){const r=typeof e=="string"?sr(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[fe(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&ar.throwError("user rejected signing",W.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return ts(this,void 0,void 0,function*(){const r=typeof e=="string"?sr(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),fe(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&ar.throwError("user rejected signing",W.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return ts(this,void 0,void 0,function*(){const i=yield Kr.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(Kr.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&ar.throwError("user rejected signing",W.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return ts(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class UW extends C9{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const zW={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let VW=class extends BW{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Oi(this.constructor,"defaultUrl")()),typeof e=="string"?ne(this,"connection",Object.freeze({url:e})):ne(this,"connection",Object.freeze(mr(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return ts(this,void 0,void 0,function*(){yield OE(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Oi(this.constructor,"getNetwork");try{return r(ae.from(e).toNumber())}catch(n){return ar.throwError("could not detect network",W.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return ar.throwError("could not detect network",W.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new C9(lp,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:ia(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=Hg(this.connection,JSON.stringify(n),FW).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[vc(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[vc(r.address),r.blockTag]];case"getCode":return["eth_getCode",[vc(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[vc(r.address),kt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Oi(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Oi(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=vc(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return ts(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&ae.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=mr(r),r.transaction=mr(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&ar.throwError(e+" not implemented",W.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return S9(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return OE(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=mr(zW);if(r)for(const s in r)r[s]&&(n[s]=!0);n7(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Tg(ae.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=fe(e[s]))}),e.accessList&&(i.accessList=zl(e.accessList)),i}};const qW="units/5.7.0",HW=new W(qW),k9=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Gg(t,e){if(typeof e=="string"){const r=k9.indexOf(e);r!==-1&&(e=3*r)}return yd(t,e??18)}function Lf(t,e){if(typeof t!="string"&&HW.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=k9.indexOf(e);r!==-1&&(e=3*r)}return Ai(t,e??18)}function WW(t){return Gg(t,18)}function NE(t){return Lf(t,18)}function cp(){return cp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(c=>c.chainId).sort(),s=i.filter((c,f)=>i.indexOf(c)!==f);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(c=>c.name=c.name.toLowerCase());const o=n.map(c=>c.name).sort(),a=o.filter((c,f)=>o.indexOf(c)!==f);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let l=!1;for(let c=0;c(KW(t,!0,e),t),YW=t=>QW(XW(t)),JW=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=ae.from(e).toNumber();return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(ae.isBigNumber(e)){const r=e.toNumber();return t.find(n=>n.chainId===r)}else return}},XW=t=>{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},Kg=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",P9=t=>Kg("https://${network}-indexer.sequence.app",{network:t}),ZW=t=>Kg("https://${network}-relayer.sequence.app",{network:t}),eG=t=>Kg("https://nodes.sequence.app/${network}",{network:t});function DE(t){return JW(tG,t)}const bt=t=>{const e=eG(t);return{rpcUrl:e,relayer:{url:ZW(t),provider:{url:e}},indexerUrl:P9(t)}},tG=YW([rt({},it[X.POLYGON],bt("polygon"),{isDefaultChain:!0,isAuthChain:!0}),rt({},it[X.MAINNET],bt("mainnet")),rt({},it[X.BSC],bt("bsc")),rt({},it[X.AVALANCHE],bt("avalanche")),rt({},it[X.ARBITRUM],bt("arbitrum")),rt({},it[X.ARBITRUM_NOVA],bt("arbitrum-nova")),rt({},it[X.OPTIMISM],bt("optimism")),rt({},it[X.OPTIMISM_SEPOLIA],bt("optimism-sepolia")),rt({},it[X.POLYGON_ZKEVM],bt("polygon-zkevm")),rt({},it[X.GNOSIS],bt("gnosis")),rt({},it[X.RINKEBY],bt("rinkeby"),{disabled:!0}),rt({},it[X.GOERLI],bt("goerli"),{disabled:!0}),rt({},it[X.SEPOLIA],bt("sepolia")),rt({},it[X.POLYGON_MUMBAI],bt("mumbai"),{disabled:!0}),rt({},it[X.POLYGON_AMOY],bt("amoy")),rt({},it[X.BSC_TESTNET],bt("bsc-testnet")),rt({},it[X.ARBITRUM_SEPOLIA],bt("arbitrum-sepolia")),rt({},it[X.BASE],bt("base")),rt({},it[X.BASE_SEPOLIA],bt("base-sepolia")),rt({},it[X.HOMEVERSE],bt("homeverse")),rt({},it[X.HOMEVERSE_TESTNET],bt("homeverse-testnet")),rt({},it[X.XAI],bt("xai")),rt({},it[X.XAI_SEPOLIA],bt("xai-sepolia")),rt({},it[X.AVALANCHE_TESTNET],bt("avalanche-testnet")),rt({},it[X.ASTAR_ZKEVM],bt("astar-zkevm")),rt({},it[X.ASTAR_ZKYOTO],bt("astar-zkyoto")),rt({},it[X.XR_SEPOLIA],bt("xr-sepolia")),rt({},it[X.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),rt({},it[X.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})]),LE=[..."🐶🐱🐭🐹🐰🦊🐻🐼🐨🐯🦁🐮🐷🐽🐸🐵🙈🙉🙊🐒🐔🐧🐦🐤🐣🐥🦆🦅🦉🦇🐺🐗🐴🦄🐝🐛🦋🐌🐞🐜🦟🦗🕷🕸🦂🐢🐍🦎🦖🦕🐙🦑🦐🦞🦀🐡🐠🐟🐬🐳🐋🦈🐊🐅🐆🦓🦍🦧🐘🦛🦏🐪🐫🦒🦘🐃🐂🐄🐎🐖🐏🐑🦙🐐🦌🐕🐩🦮🐈🐓🦃🦚🦜🦢🦩🕊🐇🦝🦨🦡🦦🦥🐁🐀🐿🦔🐾🐉🐲🌵🎄🌲🌳🌴🌱🌿🍀🎍🎋🍃👣🍂🍁🍄🐚🌾💐🌷🌹🥀🌺🌸🌼🌻🌞🌝🍏🍎🍐🍊🍋🍌🍉🍇🍓🍈🥭🍍🥥🥝🍅🥑🥦🥬🥒🌶🌽🥕🧄🧅🥔🍠🥐🥯🍞🥖🥨🧀🥚🍳🧈🥞🧇🥓🥩🍗🍖🦴🌭🍔🍟🍕🥪🥙🧆🌮🌯🥗🥘🥫🍝🍜🍲🍛🍣🍱🥟🦪🍤🍙🍚🍘🍥🥠🥮🍢🍡🍧🍨🍦🥧🧁🍰🎂🍮🍭🍬🍫🍿🍩🍪🌰🥜👀👂👃👄👅👆👇👈👉👊👋👌👍👎👏👐👑👒👓🎯🎰🎱🎲🎳👾👯👺👻👽🏂🏃🏄"];function rv(){const e=ip.en,r=LE[Math.floor(Math.random()*LE.length)],n=e.getWord(Math.floor(Math.random()*2048)),i=e.getWord(Math.floor(Math.random()*2048));return`${r} ${n} ${i}`}function rG({onSuccess:t}){const[e,r]=p.useState(""),[n,i]=p.useState(),[s,o]=p.useState(!1),[a,l]=p.useState("");return{inProgress:s||!!a,loading:s,error:n,initiateAuth:async u=>{o(!0);try{const{instance:d}=await st.email.initiateAuth({email:u});l(d),r(u)}catch(d){console.error(d),i(d.message||"Unknown error")}finally{o(!1)}},sendChallengeAnswer:a?async u=>{o(!0);try{const d=await st.getSessionHash(),{idToken:v}=await st.email.finalizeAuth({instance:a,answer:u,email:e,sessionHash:d});t(v)}catch(d){i(d.message||"Unknown error")}finally{o(!1)}}:void 0}}function nG(){const[t,e]=p.useState(""),[r,n]=p.useState(void 0);return p.useEffect(()=>{const i=async()=>{try{e(await st.getSessionHash())}catch(s){console.error(s),n(s)}};return i(),st.onSessionStateChanged(i)},[e,n]),{sessionHash:t,error:r,loading:!!t}}function iG(){var P;const{sessionHash:t}=nG(),[e,r]=p.useState(""),n=p.useRef(null),i=(P=n.current)==null?void 0:P.validity.valid,[s,o]=p.useState(!1),[a,l]=p.useState([]),[c,f]=p.useState(!1),{theme:u,setTheme:d}=XS(),{inProgress:v,loading:g,initiateAuth:y,sendChallengeAnswer:w}=rG({onSuccess:async _=>{f(!0);const D=await st.signIn({idToken:_},rv());console.log(`Wallet address: ${D}`),Uo.navigate("/")}});p.useEffect(()=>{(async()=>await st.isSignedIn()&&Uo.navigate("/"))()},[]);const x=async _=>{const D=await st.signIn({idToken:_.credential},rv());console.log(`Wallet address: ${D}`),Uo.navigate("/")},b="https://"+window.location.host+(window.location.host.includes("github.io")?"/demo-waas-auth":""),S=async _=>{const D=await st.signIn({idToken:_.authorization.id_token},rv());console.log(`Wallet address: ${D}`),Uo.navigate("/")};return $.jsxs(re,{marginY:"0",marginX:"auto",paddingX:"6",style:{maxWidth:"720px",marginTop:"80px",marginBottom:"80px"},children:[$.jsx(re,{marginBottom:"16",children:$.jsx(NC,{})}),$.jsx(re,{children:$.jsx(pr,{variant:"primary",label:"Change theme",onClick:()=>d(u==="dark"?"light":"dark")})}),$.jsx(re,{children:$.jsx(Pe,{variant:"large",color:"text100",fontWeight:"bold",children:"Email Login"})}),w?$.jsxs(re,{flexDirection:"column",children:[$.jsx(re,{marginTop:"6",children:$.jsx(Pe,{marginTop:"5",variant:"normal",color:"text80",children:"Enter code received in email."})}),$.jsx(re,{marginTop:"4",children:$.jsx(OC,{value:a,digits:6,onChange:l})}),$.jsx(re,{gap:"2",marginY:"4",children:g||c?$.jsx(zi,{}):$.jsx(pr,{variant:"primary",disabled:a.includes(""),label:"Verify",onClick:()=>w(a.join("")),"data-id":"verifyButton"})})]}):$.jsxs(re,{marginTop:"5",marginBottom:"4",children:[$.jsxs(Pe,{variant:"normal",color:"text80",children:["Enter your email to recieve a code to login and create your wallet. ",$.jsx("br",{}),"Please check your spam folder if you don't see it in your inbox."]}),$.jsxs(re,{marginTop:"6",children:[$.jsx(Pr,{name:"email",type:"email",onChange:_=>{r(_.target.value)},ref:n,onKeyDown:_=>{e&&_.key==="Enter"&&y(e)},onBlur:()=>o(!!e&&!i),value:e,placeholder:"hello@example.com",required:!0,"data-id":"loginEmail"}),s&&$.jsx(Pe,{as:"p",variant:"small",color:"negative",marginY:"2",children:"Invalid email address"})]}),$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:g?$.jsx(zi,{}):$.jsx(pr,{variant:"primary",disabled:!i,label:"Continue",onClick:()=>y(e),"data-id":"continueButton"})})]}),$.jsx("hr",{}),!v&&!!t&&$.jsxs($.Fragment,{children:[$.jsx(re,{children:$.jsx(Pe,{variant:"large",color:"text100",fontWeight:"bold",children:"Social Login"})}),$.jsx(yU,{onSuccess:x,shape:"circle",width:230,nonce:t},t),$.jsx(LU,{authOptions:{clientId:"com.horizon.sequence.waas",scope:"openid email",redirectURI:b,usePopup:!0,nonce:t},onError:_=>console.error(_),onSuccess:S,uiType:"dark"},t)]})]})}function sG(t){var e="";return r(t),e;function r(i){if(i===null||typeof i!="object"||i.toJSON!=null)e+=JSON.stringify(i);else if(Array.isArray(i)){e+="[";var s=!1;i.forEach(function(a){s&&(e+=","),s=!0,a===void 0&&(a=null),r(a)}),e+="]"}else{e+="{";var o=Object.keys(i).filter(function(a){return i[a]!==void 0}).sort();o.forEach(function(a,l){return n(i,a,l)}),e+="}"}}function n(i,s,o){o>0&&(e+=","),e+=JSON.stringify(s),e+=":",r(i[s])}}const oG=(t,e)=>e.some(r=>t instanceof r);let jE,BE;function aG(){return jE||(jE=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function lG(){return BE||(BE=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const R9=new WeakMap,fp=new WeakMap,T9=new WeakMap,nv=new WeakMap,Qg=new WeakMap;function cG(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(no(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&R9.set(r,t)}).catch(()=>{}),Qg.set(e,t),e}function fG(t){if(fp.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});fp.set(t,e)}let up={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return fp.get(t);if(e==="objectStoreNames")return t.objectStoreNames||T9.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return no(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function uG(t){up=t(up)}function dG(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(iv(this),e,...r);return T9.set(n,e.sort?e.sort():[e]),no(n)}:lG().includes(t)?function(...e){return t.apply(iv(this),e),no(R9.get(this))}:function(...e){return no(t.apply(iv(this),e))}}function hG(t){return typeof t=="function"?dG(t):(t instanceof IDBTransaction&&fG(t),oG(t,aG())?new Proxy(t,up):t)}function no(t){if(t instanceof IDBRequest)return cG(t);if(nv.has(t))return nv.get(t);const e=hG(t);return e!==t&&(nv.set(t,e),Qg.set(e,t)),e}const iv=t=>Qg.get(t);function vG(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=no(o);return n&&o.addEventListener("upgradeneeded",l=>{n(no(o.result),l.oldVersion,l.newVersion,no(o.transaction),l)}),r&&o.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const yG=["get","getKey","getAll","getAllKeys","count"],pG=["put","add","delete","clear"],sv=new Map;function $E(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(sv.get(e))return sv.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=pG.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||yG.includes(r)))return;const s=async function(o,...a){const l=this.transaction(o,i?"readwrite":"readonly");let c=l.store;return n&&(c=c.index(a.shift())),(await Promise.all([c[r](...a),i&&l.done]))[0]};return sv.set(e,s),s}uG(t=>({...t,get:(e,r,n)=>$E(e,r)||t.get(e,r,n),has:(e,r)=>!!$E(e,r)||t.has(e,r)}));class Nc extends Error{}Nc.prototype.name="InvalidTokenError";function mG(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function gG(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return mG(e)}catch{return atob(e)}}function xG(t,e){if(typeof t!="string")throw new Nc("Invalid token specified: must be a string");e||(e={});const r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new Nc(`Invalid token specified: missing part #${r+1}`);let i;try{i=gG(n)}catch(s){throw new Nc(`Invalid token specified: invalid base64 for part #${r+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new Nc(`Invalid token specified: invalid json for part #${r+1} (${s.message})`)}}const bG=t=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},wG=t=>({httpHandler:t.httpHandler()});var FE;(function(t){t.HEADER="header",t.QUERY="query"})(FE||(FE={}));var UE;(function(t){t.HEADER="header",t.QUERY="query"})(UE||(UE={}));var jf;(function(t){t.HTTP="http",t.HTTPS="https"})(jf||(jf={}));var Sh;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Sh||(Sh={}));var zE;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(zE||(zE={}));const dp="__smithy_context";var VE;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(VE||(VE={}));var qE;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(qE||(qE={}));class Ki{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static isInstance(e){if(!e)return!1;const r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){const e=new Ki({...this,headers:{...this.headers}});return e.query&&(e.query=EG(e.query)),e}}function EG(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}class Ch{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}const AG=t=>e=>async r=>{if(!Ki.isInstance(r.request))return e(r);const{request:n}=r,{handlerProtocol:i=""}=t.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let s=n.hostname;n.port!=null&&(s+=`:${n.port}`),n.headers.host=s}return e(r)},SG={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},CG=t=>({applyToStack:e=>{e.add(AG(t),SG)}}),kG=()=>(t,e)=>async r=>{var n,i;try{const s=await t(r),{clientName:o,commandName:a,logger:l,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:f,overrideOutputFilterSensitiveLog:u}=c,d=f??e.inputFilterSensitiveLog,v=u??e.outputFilterSensitiveLog,{$metadata:g,...y}=s.output;return(n=l==null?void 0:l.info)==null||n.call(l,{clientName:o,commandName:a,input:d(r.input),output:v(y),metadata:g}),s}catch(s){const{clientName:o,commandName:a,logger:l,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:f}=c,u=f??e.inputFilterSensitiveLog;throw(i=l==null?void 0:l.error)==null||i.call(l,{clientName:o,commandName:a,input:u(r.input),error:s,metadata:s.$metadata}),s}},PG={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},RG=t=>({applyToStack:e=>{e.add(kG(),PG)}}),HE="X-Amzn-Trace-Id",TG="AWS_LAMBDA_FUNCTION_NAME",MG="_X_AMZN_TRACE_ID",IG=t=>e=>async r=>{const{request:n}=r;if(!Ki.isInstance(n)||t.runtime!=="node"||n.headers.hasOwnProperty(HE))return e(r);const i=process.env[TG],s=process.env[MG],o=a=>typeof a=="string"&&a.length>0;return o(i)&&o(s)&&(n.headers[HE]=s),e({...r,request:n})},_G={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},OG=t=>({applyToStack:e=>{e.add(IG(t),_G)}});function NG(t){return{...t,customUserAgent:typeof t.customUserAgent=="string"?[[t.customUserAgent]]:t.customUserAgent}}const DG=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),M9=t=>DG.test(t)||t.startsWith("[")&&t.endsWith("]"),LG=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Yg=(t,e=!1)=>{if(!e)return LG.test(t);const r=t.split(".");for(const n of r)if(!Yg(n))return!1;return!0},kh={},Bf="endpoints";function yo(t){return typeof t!="object"||t==null?t:"ref"in t?`$${yo(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(yo).join(", ")})`:JSON.stringify(t,null,2)}class Pn extends Error{constructor(e){super(e),this.name="EndpointError"}}const jG=(t,e)=>t===e,BG=t=>{const e=t.split("."),r=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Pn(`Path: '${t}' does not end with ']'`);const s=n.slice(i+1,-1);if(Number.isNaN(parseInt(s)))throw new Pn(`Invalid array index: '${s}' in path: '${t}'`);i!==0&&r.push(n.slice(0,i)),r.push(s)}else r.push(n)}return r},I9=(t,e)=>BG(e).reduce((r,n)=>{if(typeof r!="object")throw new Pn(`Index '${n}' in '${e}' not found in '${JSON.stringify(t)}'`);return Array.isArray(r)?r[parseInt(n)]:r[n]},t),$G=t=>t!=null,FG=t=>!t,ov={[jf.HTTP]:80,[jf.HTTPS]:443},UG=t=>{const e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){const{hostname:d,port:v,protocol:g="",path:y="",query:w={}}=t,x=new URL(`${g}//${d}${v?`:${v}`:""}${y}`);return x.search=Object.entries(w).map(([b,S])=>`${b}=${S}`).join("&"),x}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;const r=e.href,{host:n,hostname:i,pathname:s,protocol:o,search:a}=e;if(a)return null;const l=o.slice(0,-1);if(!Object.values(jf).includes(l))return null;const c=M9(i),f=r.includes(`${n}:${ov[l]}`)||typeof t=="string"&&t.includes(`${n}:${ov[l]}`),u=`${n}${f?`:${ov[l]}`:""}`;return{scheme:l,authority:u,path:s,normalizedPath:s.endsWith("/")?s:`${s}/`,isIp:c}},zG=(t,e)=>t===e,VG=(t,e,r,n)=>e>=r||t.lengthencodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),HG={booleanEquals:jG,getAttr:I9,isSet:$G,isValidHostLabel:Yg,not:FG,parseURL:UG,stringEquals:zG,substring:VG,uriEncode:qG},_9=(t,e)=>{const r=[],n={...e.endpointParams,...e.referenceRecord};let i=0;for(;i({...e.endpointParams,...e.referenceRecord})[t],k0=(t,e,r)=>{if(typeof t=="string")return _9(t,r);if(t.fn)return O9(t,r);if(t.ref)return WG(t,r);throw new Pn(`'${e}': ${String(t)} is not a string, function or reference.`)},O9=({fn:t,argv:e},r)=>{const n=e.map(s=>["boolean","number"].includes(typeof s)?s:k0(s,"arg",r)),i=t.split(".");return i[0]in kh&&i[1]!=null?kh[i[0]][i[1]](...n):HG[t](...n)},GG=({assign:t,...e},r)=>{var i,s;if(t&&t in r.referenceRecord)throw new Pn(`'${t}' is already defined in Reference Record.`);const n=O9(e,r);return(s=(i=r.logger)==null?void 0:i.debug)==null||s.call(i,Bf,`evaluateCondition: ${yo(e)} = ${yo(n)}`),{result:n===""?!0:!!n,...t!=null&&{toAssign:{name:t,value:n}}}},Jg=(t=[],e)=>{var n,i;const r={};for(const s of t){const{result:o,toAssign:a}=GG(s,{...e,referenceRecord:{...e.referenceRecord,...r}});if(!o)return{result:o};a&&(r[a.name]=a.value,(i=(n=e.logger)==null?void 0:n.debug)==null||i.call(n,Bf,`assign: ${a.name} := ${yo(a.value)}`))}return{result:!0,referenceRecord:r}},KG=(t,e)=>Object.entries(t).reduce((r,[n,i])=>({...r,[n]:i.map(s=>{const o=k0(s,"Header value entry",e);if(typeof o!="string")throw new Pn(`Header '${n}' value '${o}' is not a string`);return o})}),{}),N9=(t,e)=>{if(Array.isArray(t))return t.map(r=>N9(r,e));switch(typeof t){case"string":return _9(t,e);case"object":if(t===null)throw new Pn(`Unexpected endpoint property: ${t}`);return D9(t,e);case"boolean":return t;default:throw new Pn(`Unexpected endpoint property type: ${typeof t}`)}},D9=(t,e)=>Object.entries(t).reduce((r,[n,i])=>({...r,[n]:N9(i,e)}),{}),QG=(t,e)=>{const r=k0(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(n){throw console.error(`Failed to construct URL with ${r}`,n),n}throw new Pn(`Endpoint URL must be a string, got ${typeof r}`)},YG=(t,e)=>{var f,u;const{conditions:r,endpoint:n}=t,{result:i,referenceRecord:s}=Jg(r,e);if(!i)return;const o={...e,referenceRecord:{...e.referenceRecord,...s}},{url:a,properties:l,headers:c}=n;return(u=(f=e.logger)==null?void 0:f.debug)==null||u.call(f,Bf,`Resolving endpoint from template: ${yo(n)}`),{...c!=null&&{headers:KG(c,o)},...l!=null&&{properties:D9(l,o)},url:QG(a,o)}},JG=(t,e)=>{const{conditions:r,error:n}=t,{result:i,referenceRecord:s}=Jg(r,e);if(i)throw new Pn(k0(n,"Error",{...e,referenceRecord:{...e.referenceRecord,...s}}))},XG=(t,e)=>{const{conditions:r,rules:n}=t,{result:i,referenceRecord:s}=Jg(r,e);if(i)return L9(n,{...e,referenceRecord:{...e.referenceRecord,...s}})},L9=(t,e)=>{for(const r of t)if(r.type==="endpoint"){const n=YG(r,e);if(n)return n}else if(r.type==="error")JG(r,e);else if(r.type==="tree"){const n=XG(r,e);if(n)return n}else throw new Pn(`Unknown endpoint rule: ${r}`);throw new Pn("Rules evaluation failed")},ZG=(t,e)=>{var c,f,u,d,v;const{endpointParams:r,logger:n}=e,{parameters:i,rules:s}=t;(f=(c=e.logger)==null?void 0:c.debug)==null||f.call(c,`${Bf} Initial EndpointParams: ${yo(r)}`);const o=Object.entries(i).filter(([,g])=>g.default!=null).map(([g,y])=>[g,y.default]);if(o.length>0)for(const[g,y]of o)r[g]=r[g]??y;const a=Object.entries(i).filter(([,g])=>g.required).map(([g])=>g);for(const g of a)if(r[g]==null)throw new Pn(`Missing required parameter: '${g}'`);const l=L9(s,{endpointParams:r,logger:n,referenceRecord:{}});if((u=e.endpointParams)!=null&&u.Endpoint)try{const g=new URL(e.endpointParams.Endpoint),{protocol:y,port:w}=g;l.url.protocol=y,l.url.port=w}catch{}return(v=(d=e.logger)==null?void 0:d.debug)==null||v.call(d,`${Bf} Resolved endpoint: ${yo(l)}`),l},j9=(t,e=!1)=>{if(e){for(const r of t.split("."))if(!j9(r))return!1;return!0}return!(!Yg(t)||t.length<3||t.length>63||t!==t.toLowerCase()||M9(t))},eK=t=>{const e=t.split(":");if(e.length<6)return null;const[r,n,i,s,o,...a]=e;return r!=="arn"||n===""||i===""||a[0]===""?null:{partition:n,service:i,region:s,accountId:o,resourceId:a[0].includes("/")?a[0].split("/"):a}},tK=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],rK="1.1",nK={partitions:tK,version:rK};let iK=nK;const sK=t=>{const{partitions:e}=iK;for(const n of e){const{regions:i,outputs:s}=n;for(const[o,a]of Object.entries(i))if(o===t)return{...s,...a}}for(const n of e){const{regionRegex:i,outputs:s}=n;if(new RegExp(i).test(t))return{...s}}const r=e.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},B9={isVirtualHostableS3Bucket:j9,parseArn:eK,partition:sK};kh.aws=B9;const WE="user-agent",av="x-amz-user-agent",GE=" ",lv="/",oK=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,aK=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,KE="-",lK=t=>(e,r)=>async n=>{var u,d;const{request:i}=n;if(!Ki.isInstance(i))return e(n);const{headers:s}=i,o=((u=r==null?void 0:r.userAgent)==null?void 0:u.map(cv))||[],a=(await t.defaultUserAgentProvider()).map(cv),l=((d=t==null?void 0:t.customUserAgent)==null?void 0:d.map(cv))||[],c=[].concat([...a,...o,...l]).join(GE),f=[...a.filter(v=>v.startsWith("aws-sdk-")),...l].join(GE);return t.runtime!=="browser"?(f&&(s[av]=s[av]?`${s[WE]} ${f}`:f),s[WE]=c):s[av]=c,e({...n,request:i})},cv=t=>{var o;const e=t[0].split(lv).map(a=>a.replace(oK,KE)).join(lv),r=(o=t[1])==null?void 0:o.replace(aK,KE),n=e.indexOf(lv),i=e.substring(0,n);let s=e.substring(n+1);return i==="api"&&(s=s.toLowerCase()),[i,s,r].filter(a=>a&&a.length>0).reduce((a,l,c)=>{switch(c){case 0:return l;case 1:return`${a}/${l}`;default:return`${a}#${l}`}},"")},cK={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},fK=t=>({applyToStack:e=>{e.add(lK(t),cK)}});var QE;(function(t){t.ENV="env",t.CONFIG="shared config entry"})(QE||(QE={}));const uK=!1,dK=!1,P0=t=>t[dp]||(t[dp]={}),io=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},$9=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),YE=t=>$9(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,hK=t=>{const{region:e,useFipsEndpoint:r}=t;if(!e)throw new Error("Region is missing");return{...t,region:async()=>{if(typeof e=="string")return YE(e);const n=await e();return YE(n)},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return $9(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}}};function vK(t){const e=new Map;for(const r of t)e.set(r.schemeId,r);return e}const yK=(t,e)=>(r,n)=>async i=>{var c;const s=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,n,i.input)),o=vK(t.httpAuthSchemes),a=P0(n),l=[];for(const f of s){const u=o.get(f.schemeId);if(!u){l.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}const d=u.identityProvider(await e.identityProviderConfigProvider(t));if(!d){l.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:v={},signingProperties:g={}}=((c=f.propertiesExtractor)==null?void 0:c.call(f,t,n))||{};f.identityProperties=Object.assign(f.identityProperties||{},v),f.signingProperties=Object.assign(f.signingProperties||{},g),a.selectedHttpAuthScheme={httpAuthOption:f,identity:await d(f.identityProperties),signer:u.signer};break}if(!a.selectedHttpAuthScheme)throw new Error(l.join(` -`));return r(i)},pK=async t=>{const e=(t==null?void 0:t.Bucket)||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),wK(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!bK(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},mK=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,gK=/(\d+\.){3}\d+/,xK=/\.\./,bK=t=>mK.test(t)&&!gK.test(t)&&!xK.test(t),wK=t=>{const[e,r,n,,,i]=t.split(":"),s=e==="arn"&&t.split(":").length>=6,o=!!(s&&r&&n&&i);if(s&&!o)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return o},EK=(t,e,r)=>{const n=async()=>{const i=r[t]??r[e];return typeof i=="function"?i():i};return t==="credentialScope"||e==="CredentialScope"?async()=>{const i=typeof r.credentials=="function"?await r.credentials():r.credentials;return(i==null?void 0:i.credentialScope)??(i==null?void 0:i.CredentialScope)}:t==="endpoint"||e==="endpoint"?async()=>{const i=await n();if(i&&typeof i=="object"){if("url"in i)return i.url.href;if("hostname"in i){const{protocol:s,hostname:o,port:a,path:l}=i;return`${s}//${o}${a?":"+a:""}${l}`}}return i}:n},AK=async t=>{};function SK(t){const e={};if(t=t.replace(/^\?/,""),t)for(const r of t.split("&")){let[n,i=null]=r.split("=");n=decodeURIComponent(n),i&&(i=decodeURIComponent(i)),n in e?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i}return e}const Ph=t=>{if(typeof t=="string")return Ph(new URL(t));const{hostname:e,pathname:r,port:n,protocol:i,search:s}=t;let o;return s&&(o=SK(s)),{hostname:e,port:n?parseInt(n):void 0,protocol:i,path:r,query:o}},F9=t=>typeof t=="object"?"url"in t?Ph(t.url):t:Ph(t),CK=async(t,e,r,n)=>{if(!r.endpoint){const o=await AK(r.serviceId||"");o&&(r.endpoint=()=>Promise.resolve(F9(o)))}const i=await kK(t,e,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(i,n)},kK=async(t,e,r)=>{var s;const n={},i=((s=e==null?void 0:e.getEndpointParameterInstructions)==null?void 0:s.call(e))||{};for(const[o,a]of Object.entries(i))switch(a.type){case"staticContextParams":n[o]=a.value;break;case"contextParams":n[o]=t[a.name];break;case"clientContextParams":case"builtInParams":n[o]=await EK(a.name,o,r)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(n,r),String(r.serviceId).toLowerCase()==="s3"&&await pK(n),n},PK=({config:t,instructions:e})=>(r,n)=>async i=>{var a,l,c;const s=await CK(i.input,{getEndpointParameterInstructions(){return e}},{...t},n);n.endpointV2=s,n.authSchemes=(a=s.properties)==null?void 0:a.authSchemes;const o=(l=n.authSchemes)==null?void 0:l[0];if(o){n.signing_region=o.signingRegion,n.signing_service=o.signingName;const f=P0(n),u=(c=f==null?void 0:f.selectedHttpAuthScheme)==null?void 0:c.httpAuthOption;u&&(u.signingProperties=Object.assign(u.signingProperties||{},{signing_region:o.signingRegion,signingRegion:o.signingRegion,signing_service:o.signingName,signingName:o.signingName,signingRegionSet:o.signingRegionSet},o.properties))}return r({...i})},RK=(t,e)=>(r,n)=>async i=>{const{response:s}=await r(i);try{const o=await e(s,t);return{response:s,output:o}}catch(o){if(Object.defineProperty(o,"$response",{value:s}),!("$metadata"in o)){const a="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";o.message+=` - `+a,typeof o.$responseBodyText<"u"&&o.$response&&(o.$response.body=o.$responseBodyText)}throw o}},TK=(t,e)=>(r,n)=>async i=>{var a;const s=(a=n.endpointV2)!=null&&a.url&&t.urlParser?async()=>t.urlParser(n.endpointV2.url):t.endpoint;if(!s)throw new Error("No valid endpoint provider available.");const o=await e(i.input,{...t,endpoint:s});return r({...i,request:o})},MK={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Xg={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Zg(t,e,r){return{applyToStack:n=>{n.add(RK(t,r),MK),n.add(TK(t,e),Xg)}}}const U9={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Xg.name},ex=(t,e)=>({applyToStack:r=>{r.addRelativeTo(PK({config:t,instructions:e}),U9)}}),IK=t=>{const e=t.tls??!0,{endpoint:r}=t,n=r!=null?async()=>F9(await io(r)()):void 0;return{...t,endpoint:n,tls:e,isCustomEndpoint:!!r,useDualstackEndpoint:io(t.useDualstackEndpoint??!1),useFipsEndpoint:io(t.useFipsEndpoint??!1)}},_K={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:U9.name},OK=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(yK(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),_K)}});Xg.name;const NK=t=>e=>{throw e},DK=(t,e)=>{},LK=t=>(e,r)=>async n=>{if(!Ki.isInstance(n.request))return e(n);const s=P0(r).selectedHttpAuthScheme;if(!s)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:o={}},identity:a,signer:l}=s,c=await e({...n,request:await l.sign(n.request,a,o)}).catch((l.errorHandler||NK)(o));return(l.successHandler||DK)(c.response,o),c};var Sl;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(Sl||(Sl={}));const Rh=3,jK=Sl.STANDARD,BK=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],$K=["TimeoutError","RequestTimeout","RequestTimeoutException"],FK=[500,502,503,504],UK=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],zK=t=>{var e;return(e=t.$metadata)==null?void 0:e.clockSkewCorrected},z9=t=>{var e,r;return((e=t.$metadata)==null?void 0:e.httpStatusCode)===429||BK.includes(t.name)||((r=t.$retryable)==null?void 0:r.throttling)==!0},V9=t=>{var e;return zK(t)||$K.includes(t.name)||UK.includes((t==null?void 0:t.code)||"")||FK.includes(((e=t.$metadata)==null?void 0:e.httpStatusCode)||0)},VK=t=>{var e;if(((e=t.$metadata)==null?void 0:e.httpStatusCode)!==void 0){const r=t.$metadata.httpStatusCode;return 500<=r&&r<=599&&!V9(t)}return!1};class qK{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(e==null?void 0:e.beta)??.7,this.minCapacity=(e==null?void 0:e.minCapacity)??1,this.minFillRate=(e==null?void 0:e.minFillRate)??.5,this.scaleConstant=(e==null?void 0:e.scaleConstant)??.4,this.smooth=(e==null?void 0:e.smooth)??.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const r=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(n=>setTimeout(n,r))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const r=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=e}updateClientSendingRate(e){let r;if(this.updateMeasuredRate(),z9(e)){const i=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}}const hp=100,q9=20*1e3,HK=500,JE=500,WK=5,GK=10,KK=1,QK="amz-sdk-invocation-id",YK="amz-sdk-request",JK=()=>{let t=hp;return{computeNextBackoffDelay:n=>Math.floor(Math.min(q9,Math.random()*2**n*t)),setDelayBase:n=>{t=n}}},XE=({retryDelay:t,retryCount:e,retryCost:r})=>({getRetryCount:()=>e,getRetryDelay:()=>Math.min(q9,t),getRetryCost:()=>r});class H9{constructor(e){this.maxAttempts=e,this.mode=Sl.STANDARD,this.capacity=JE,this.retryBackoffStrategy=JK(),this.maxAttemptsProvider=typeof e=="function"?e:async()=>e}async acquireInitialRetryToken(e){return XE({retryDelay:hp,retryCount:0})}async refreshRetryTokenForRetry(e,r){const n=await this.getMaxAttempts();if(this.shouldRetry(e,r,n)){const i=r.errorType;this.retryBackoffStrategy.setDelayBase(i==="THROTTLING"?HK:hp);const s=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),o=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,s):s,a=this.getCapacityCost(i);return this.capacity-=a,XE({retryDelay:o,retryCount:e.getRetryCount()+1,retryCost:a})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(JE,this.capacity+(e.getRetryCost()??KK))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Rh}`),Rh}}shouldRetry(e,r,n){return e.getRetryCount()+1=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(e){return e==="TRANSIENT"?GK:WK}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class XK{constructor(e,r){this.maxAttemptsProvider=e,this.mode=Sl.ADAPTIVE;const{rateLimiter:n}=r??{};this.rateLimiter=n??new qK,this.standardRetryStrategy=new H9(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(e,r)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}let qu;const ZK=new Uint8Array(16);function eQ(){if(!qu&&(qu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qu(ZK)}const Sr=[];for(let t=0;t<256;++t)Sr.push((t+256).toString(16).slice(1));function tQ(t,e=0){return Sr[t[e+0]]+Sr[t[e+1]]+Sr[t[e+2]]+Sr[t[e+3]]+"-"+Sr[t[e+4]]+Sr[t[e+5]]+"-"+Sr[t[e+6]]+Sr[t[e+7]]+"-"+Sr[t[e+8]]+Sr[t[e+9]]+"-"+Sr[t[e+10]]+Sr[t[e+11]]+Sr[t[e+12]]+Sr[t[e+13]]+Sr[t[e+14]]+Sr[t[e+15]]}const rQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ZE={randomUUID:rQ};function nQ(t,e,r){if(ZE.randomUUID&&!e&&!t)return ZE.randomUUID();t=t||{};const n=t.random||(t.rng||eQ)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return tQ(n)}const iQ=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`),sQ=t=>{const{retryStrategy:e}=t,r=io(t.maxAttempts??Rh);return{...t,maxAttempts:r,retryStrategy:async()=>e||(await io(t.retryMode)()===Sl.ADAPTIVE?new XK(r):new H9(r))}};class W9{trace(){}debug(){}info(){}warn(){}error(){}}const ko=(t,e)=>{const r=[];if(t&&r.push(t),e)for(const n of e)r.push(n);return r},_s=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Th=()=>{let t=[],e=[],r=!1;const n=new Set,i=u=>u.sort((d,v)=>e4[v.step]-e4[d.step]||t4[v.priority||"normal"]-t4[d.priority||"normal"]),s=u=>{let d=!1;const v=g=>{const y=ko(g.name,g.aliases);if(y.includes(u)){d=!0;for(const w of y)n.delete(w);return!1}return!0};return t=t.filter(v),e=e.filter(v),d},o=u=>{let d=!1;const v=g=>{if(g.middleware===u){d=!0;for(const y of ko(g.name,g.aliases))n.delete(y);return!1}return!0};return t=t.filter(v),e=e.filter(v),d},a=u=>{var d;return t.forEach(v=>{u.add(v.middleware,{...v})}),e.forEach(v=>{u.addRelativeTo(v.middleware,{...v})}),(d=u.identifyOnResolve)==null||d.call(u,f.identifyOnResolve()),u},l=u=>{const d=[];return u.before.forEach(v=>{v.before.length===0&&v.after.length===0?d.push(v):d.push(...l(v))}),d.push(u),u.after.reverse().forEach(v=>{v.before.length===0&&v.after.length===0?d.push(v):d.push(...l(v))}),d},c=(u=!1)=>{const d=[],v=[],g={};return t.forEach(w=>{const x={...w,before:[],after:[]};for(const b of ko(x.name,x.aliases))g[b]=x;d.push(x)}),e.forEach(w=>{const x={...w,before:[],after:[]};for(const b of ko(x.name,x.aliases))g[b]=x;v.push(x)}),v.forEach(w=>{if(w.toMiddleware){const x=g[w.toMiddleware];if(x===void 0){if(u)return;throw new Error(`${w.toMiddleware} is not found when adding ${_s(w.name,w.aliases)} middleware ${w.relation} ${w.toMiddleware}`)}w.relation==="after"&&x.after.push(w),w.relation==="before"&&x.before.push(w)}}),i(d).map(l).reduce((w,x)=>(w.push(...x),w),[])},f={add:(u,d={})=>{const{name:v,override:g,aliases:y}=d,w={step:"initialize",priority:"normal",middleware:u,...d},x=ko(v,y);if(x.length>0){if(x.some(b=>n.has(b))){if(!g)throw new Error(`Duplicate middleware name '${_s(v,y)}'`);for(const b of x){const S=t.findIndex(_=>{var D;return _.name===b||((D=_.aliases)==null?void 0:D.some(M=>M===b))});if(S===-1)continue;const P=t[S];if(P.step!==w.step||w.priority!==P.priority)throw new Error(`"${_s(P.name,P.aliases)}" middleware with ${P.priority} priority in ${P.step} step cannot be overridden by "${_s(v,y)}" middleware with ${w.priority} priority in ${w.step} step.`);t.splice(S,1)}}for(const b of x)n.add(b)}t.push(w)},addRelativeTo:(u,d)=>{const{name:v,override:g,aliases:y}=d,w={middleware:u,...d},x=ko(v,y);if(x.length>0){if(x.some(b=>n.has(b))){if(!g)throw new Error(`Duplicate middleware name '${_s(v,y)}'`);for(const b of x){const S=e.findIndex(_=>{var D;return _.name===b||((D=_.aliases)==null?void 0:D.some(M=>M===b))});if(S===-1)continue;const P=e[S];if(P.toMiddleware!==w.toMiddleware||P.relation!==w.relation)throw new Error(`"${_s(P.name,P.aliases)}" middleware ${P.relation} "${P.toMiddleware}" middleware cannot be overridden by "${_s(v,y)}" middleware ${w.relation} "${w.toMiddleware}" middleware.`);e.splice(S,1)}}for(const b of x)n.add(b)}e.push(w)},clone:()=>a(Th()),use:u=>{u.applyToStack(f)},remove:u=>typeof u=="string"?s(u):o(u),removeByTag:u=>{let d=!1;const v=g=>{const{tags:y,name:w,aliases:x}=g;if(y&&y.includes(u)){const b=ko(w,x);for(const S of b)n.delete(S);return d=!0,!1}return!0};return t=t.filter(v),e=e.filter(v),d},concat:u=>{var v;const d=a(Th());return d.use(u),d.identifyOnResolve(r||d.identifyOnResolve()||(((v=u.identifyOnResolve)==null?void 0:v.call(u))??!1)),d},applyToStack:a,identify:()=>c(!0).map(u=>{const d=u.step??u.relation+" "+u.toMiddleware;return _s(u.name,u.aliases)+" - "+d}),identifyOnResolve(u){return typeof u=="boolean"&&(r=u),r},resolve:(u,d)=>{for(const v of c().map(g=>g.middleware).reverse())u=v(u,d);return r&&console.log(f.identify()),u}};return f},e4={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},t4={high:3,normal:2,low:1};class oQ{constructor(e){this.middlewareStack=Th(),this.config=e}send(e,r,n){const i=typeof r!="function"?r:void 0,s=typeof r=="function"?r:n,o=e.resolveMiddleware(this.middlewareStack,this.config,i);if(s)o(e).then(a=>s(null,a.output),a=>s(a)).catch(()=>{});else return o(e).then(a=>a.output)}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}const po={},Vl=new Array(64);for(let t=0,e="A".charCodeAt(0),r="Z".charCodeAt(0);t+e<=r;t++){const n=String.fromCharCode(t+e);po[n]=t,Vl[t]=n}for(let t=0,e="a".charCodeAt(0),r="z".charCodeAt(0);t+e<=r;t++){const n=String.fromCharCode(t+e),i=t+26;po[n]=i,Vl[i]=n}for(let t=0;t<10;t++){po[t.toString(10)]=t+52;const e=t.toString(10),r=t+52;po[e]=r,Vl[r]=e}po["+"]=62;Vl[62]="+";po["/"]=63;Vl[63]="/";const ol=6,Zc=8,aQ=63,tx=t=>{let e=t.length/4*3;t.slice(-2)==="=="?e-=2:t.slice(-1)==="="&&e--;const r=new ArrayBuffer(e),n=new DataView(r);for(let i=0;i>=ol;const a=i/4*3;s>>=o%Zc;const l=Math.floor(o/Zc);for(let c=0;c>f)}}return new Uint8Array(r)},Cl=t=>new TextEncoder().encode(t),ef=t=>typeof t=="string"?Cl(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),G9=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)};function K9(t){let e;typeof t=="string"?e=Cl(t):e=t;const r=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let s=0;s>f]}i+="==".slice(0,4-l)}return i}function lQ(t,e="utf-8"){return e==="base64"?K9(t):G9(t)}function cQ(t,e){return e==="base64"?Ko.mutate(tx(t)):Ko.mutate(Cl(t))}class Ko extends Uint8Array{static fromString(e,r="utf-8"){switch(typeof e){case"string":return cQ(e,r);default:throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}}static mutate(e){return Object.setPrototypeOf(e,Ko.prototype),e}transformToString(e="utf-8"){return lQ(this,e)}}const Hs=t=>encodeURIComponent(t).replace(/[!'()*]/g,fQ),fQ=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function uQ(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=Hs(r),Array.isArray(n))for(let i=0,s=n.length;i{t&&setTimeout(()=>{const n=new Error(`Request did not complete within ${t} ms`);n.name="TimeoutError",r(n)},t)})}const hQ={supported:typeof Request<"u"&&"keepalive"in new Request("https://[::1]")};class rx{static create(e){return typeof(e==null?void 0:e.handle)=="function"?e:new rx(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(r=>r||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config))}destroy(){}async handle(e,{abortSignal:r}={}){this.config||(this.config=await this.configProvider);const n=this.config.requestTimeout,i=this.config.keepAlive===!0;if(r!=null&&r.aborted){const y=new Error("Request aborted");return y.name="AbortError",Promise.reject(y)}let s=e.path;const o=uQ(e.query||{});o&&(s+=`?${o}`),e.fragment&&(s+=`#${e.fragment}`);let a="";if(e.username!=null||e.password!=null){const y=e.username??"",w=e.password??"";a=`${y}:${w}@`}const{port:l,method:c}=e,f=`${e.protocol}//${a}${e.hostname}${l?`:${l}`:""}${s}`,d={body:c==="GET"||c==="HEAD"?void 0:e.body,headers:new Headers(e.headers),method:c};typeof AbortController<"u"&&(d.signal=r),hQ.supported&&(d.keepalive=i);const v=new Request(f,d),g=[fetch(v).then(y=>{const w=y.headers,x={};for(const S of w.entries())x[S[0]]=S[1];return y.body!=null?{response:new Ch({headers:x,reason:y.statusText,statusCode:y.status,body:y.body})}:y.blob().then(S=>({response:new Ch({headers:x,reason:y.statusText,statusCode:y.status,body:S})}))}),dQ(n)];return r&&g.push(new Promise((y,w)=>{r.onabort=()=>{const x=new Error("Request aborted");x.name="AbortError",w(x)}})),Promise.race(g)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=r,n))}httpHandlerConfigs(){return this.config??{}}}const vQ=t=>typeof Blob=="function"&&t instanceof Blob?yQ(t):pQ(t);async function yQ(t){const e=await mQ(t),r=tx(e);return new Uint8Array(r)}async function pQ(t){let e=new Uint8Array(0);const r=t.getReader();let n=!1;for(;!n;){const{done:i,value:s}=await r.read();if(s){const o=e;e=new Uint8Array(o.length+s.length),e.set(o),e.set(s,o.length)}n=i}return e}function mQ(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const i=n.result??"",s=i.indexOf(","),o=s>-1?s+1:i.length;e(i.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}const Q9={},vp={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),Q9[t]=e,vp[e]=t}function gQ(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let r=0;r{if(t instanceof Uint8Array)return Ko.mutate(t);if(!t)return Ko.mutate(new Uint8Array);const r=e.streamCollector(t);return Ko.mutate(await r)};class R0{constructor(){this.middlewareStack=Th()}static classBuilder(){return new bQ}resolveMiddlewareWithContext(e,r,n,{middlewareFn:i,clientName:s,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:l,smithyContext:c,additionalContext:f,CommandCtor:u}){for(const w of i.bind(this)(u,e,r,n))this.middlewareStack.use(w);const d=e.concat(this.middlewareStack),{logger:v}=r,g={logger:v,clientName:s,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:l,[dp]:{...c},...f},{requestHandler:y}=r;return d.resolve(w=>y.handle(w.request,n||{}),g)}}class bQ{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=e=>e,this._outputFilterSensitiveLog=e=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,r,n={}){return this._smithyContext={service:e,operation:r,...n},this}c(e={}){return this._additionalContext=e,this}n(e,r){return this._clientName=e,this._commandName=r,this}f(e=n=>n,r=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=r,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){const e=this;let r;return r=class extends R0{static getEndpointParameterInstructions(){return e._ep}constructor(...[n]){super(),this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=n??{},e._init(this)}resolveMiddleware(n,i,s){return this.resolveMiddlewareWithContext(n,i,s,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}const wr="***SensitiveInformation***";class nx extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,nx.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const Ne=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,i])=>{(t[n]==null||t[n]==="")&&(t[n]=i)});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t},wQ=({output:t,parsedBody:e,exceptionCtor:r,errorCode:n})=>{const i=AQ(t),s=i.httpStatusCode?i.httpStatusCode+"":void 0,o=new r({name:(e==null?void 0:e.code)||(e==null?void 0:e.Code)||n||s||"UnknownError",$fault:"client",$metadata:i});throw Ne(o,e)},EQ=t=>({output:e,parsedBody:r,errorCode:n})=>{wQ({output:e,parsedBody:r,exceptionCtor:t,errorCode:n})},AQ=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),SQ=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},CQ=t=>{const e=[];for(const r in Sh){const n=Sh[r];t[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},kQ=t=>{const e={};return t.checksumAlgorithms().forEach(r=>{e[r.algorithmId()]=r.checksumConstructor()}),e},PQ=t=>{let e=t.retryStrategy;return{setRetryStrategy(r){e=r},retryStrategy(){return e}}},RQ=t=>{const e={};return e.retryStrategy=t.retryStrategy(),e},TQ=t=>({...CQ(t),...PQ(t)}),MQ=t=>({...kQ(t),...RQ(t)}),yp=function(){const t=Object.getPrototypeOf(this).constructor,e=Function.bind.apply(String,[null,...arguments]),r=new e;return Object.setPrototypeOf(r,t.prototype),r};yp.prototype=Object.create(String.prototype,{constructor:{value:yp,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(yp,String);const Ae=t=>{if(t==null)return{};if(Array.isArray(t))return t.filter(e=>e!=null).map(Ae);if(typeof t=="object"){const e={};for(const r of Object.keys(t))t[r]!=null&&(e[r]=Ae(t[r]));return e}return t},IQ=t=>(t==null?void 0:t.body)instanceof ReadableStream,_Q=t=>(e,r)=>async n=>{var o;let i=await t.retryStrategy();const s=await t.maxAttempts();if(OQ(i)){i=i;let a=await i.acquireInitialRetryToken(r.partition_id),l=new Error,c=0,f=0;const{request:u}=n,d=Ki.isInstance(u);for(d&&(u.headers[QK]=nQ());;)try{d&&(u.headers[YK]=`attempt=${c+1}; max=${s}`);const{response:v,output:g}=await e(n);return i.recordSuccess(a),g.$metadata.attempts=c+1,g.$metadata.totalRetryDelay=f,{response:v,output:g}}catch(v){const g=NQ(v);if(l=iQ(v),d&&IQ(u))throw(o=r.logger instanceof W9?console:r.logger)==null||o.warn("An error was encountered in a non-retryable streaming request."),l;try{a=await i.refreshRetryTokenForRetry(a,g)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=c+1,l.$metadata.totalRetryDelay=f,l}c=a.getRetryCount();const y=a.getRetryDelay();f+=y,await new Promise(w=>setTimeout(w,y))}}else return i=i,i!=null&&i.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(e,n)},OQ=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",NQ=t=>{const e={error:t,errorType:DQ(t)},r=jQ(t.$response);return r&&(e.retryAfterHint=r),e},DQ=t=>z9(t)?"THROTTLING":V9(t)?"TRANSIENT":VK(t)?"SERVER_ERROR":"CLIENT_ERROR",Y9={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},LQ=t=>({applyToStack:e=>{e.add(_Q(t),Y9)}}),jQ=t=>{if(!Ch.isInstance(t))return;const e=Object.keys(t.headers).find(s=>s.toLowerCase()==="retry-after");if(!e)return;const r=t.headers[e],n=Number(r);return Number.isNaN(n)?new Date(r):new Date(n*1e3)},BQ={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:Y9.name},$Q=t=>({applyToStack:e=>{e.addRelativeTo(LK(),BQ)}});class FQ{constructor(e){this.authSchemes=new Map;for(const[r,n]of Object.entries(e))n!==void 0&&this.authSchemes.set(r,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}class UQ{async sign(e,r,n){return e}}const zQ=t=>e=>J9(e)&&e.expiration.getTime()-Date.now()t.expiration!==void 0,HQ=(t,e,r)=>{if(t===void 0)return;const n=typeof t!="function"?async()=>Promise.resolve(t):t;let i,s,o,a=!1;const l=async c=>{s||(s=n(c));try{i=await s,o=!0,a=!1}finally{s=void 0}return i};return e===void 0?async c=>((!o||c!=null&&c.forceRefresh)&&(i=await l(c)),i):async c=>((!o||c!=null&&c.forceRefresh)&&(i=await l(c)),a?i:r(i)?(e(i)&&await l(c),i):(a=!0,i))},Hu=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},r4="content-length";function WQ(t){return e=>async r=>{const n=r.request;if(Ki.isInstance(n)){const{body:i,headers:s}=n;if(i&&Object.keys(s).map(o=>o.toLowerCase()).indexOf(r4)===-1)try{const o=t(i);n.headers={...n.headers,[r4]:String(o)}}catch{}}return e({...r,request:n})}}const GQ={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},KQ=t=>({applyToStack:e=>{e.add(WQ(t.bodyLengthChecker),GQ)}}),n4=t=>{var e,r;return Ch.isInstance(t)?((e=t.headers)==null?void 0:e.date)??((r=t.headers)==null?void 0:r.Date):void 0},X9=t=>new Date(Date.now()+t),QQ=(t,e)=>Math.abs(X9(e).getTime()-t)>=3e5,i4=(t,e)=>{const r=Date.parse(t);return QQ(r,e)?r-Date.now():e},tf=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},YQ=async t=>{var l,c,f;const e=tf("context",t.context),r=tf("config",t.config),n=(f=(c=(l=e.endpointV2)==null?void 0:l.properties)==null?void 0:c.authSchemes)==null?void 0:f[0],s=await tf("signer",r.signer)(n),o=t==null?void 0:t.signingRegion,a=t==null?void 0:t.signingName;return{config:r,signer:s,signingRegion:o,signingName:a}};class JQ{async sign(e,r,n){if(!Ki.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:i,signer:s,signingRegion:o,signingName:a}=await YQ(n);return await s.sign(e,{signingDate:X9(i.systemClockOffset),signingRegion:o,signingService:a})}errorHandler(e){return r=>{const n=r.ServerTime??n4(r.$response);if(n){const i=tf("config",e.config),s=i.systemClockOffset;i.systemClockOffset=i4(n,i.systemClockOffset),i.systemClockOffset!==s&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(e,r){const n=n4(e);if(n){const i=tf("config",r.config);i.systemClockOffset=i4(n,i.systemClockOffset)}}}const XQ="X-Amz-Algorithm",ZQ="X-Amz-Credential",Z9="X-Amz-Date",eY="X-Amz-SignedHeaders",tY="X-Amz-Expires",ek="X-Amz-Signature",tk="X-Amz-Security-Token",rk="authorization",nk=Z9.toLowerCase(),rY="date",nY=[rk,nk,rY],iY=ek.toLowerCase(),pp="x-amz-content-sha256",sY=tk.toLowerCase(),oY={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},aY=/^proxy-/,lY=/^sec-/,fv="AWS4-HMAC-SHA256",cY="AWS4-HMAC-SHA256-PAYLOAD",fY="UNSIGNED-PAYLOAD",uY=50,ik="aws4_request",dY=60*60*24*7,Wu={},uv=[],dv=(t,e,r)=>`${t}/${e}/${r}/${ik}`,hY=async(t,e,r,n,i)=>{const s=await s4(t,e.secretAccessKey,e.accessKeyId),o=`${r}:${n}:${i}:${Fo(s)}:${e.sessionToken}`;if(o in Wu)return Wu[o];for(uv.push(o);uv.length>uY;)delete Wu[uv.shift()];let a=`AWS4${e.secretAccessKey}`;for(const l of[r,n,i,ik])a=await s4(t,a,l);return Wu[o]=a},s4=(t,e,r)=>{const n=new t(e);return n.update(ef(r)),n.digest()},o4=({headers:t},e,r)=>{const n={};for(const i of Object.keys(t).sort()){if(t[i]==null)continue;const s=i.toLowerCase();(s in oY||e!=null&&e.has(s)||aY.test(s)||lY.test(s))&&(!r||r&&!r.has(s))||(n[s]=t[i].trim().replace(/\s+/g," "))}return n},vY=({query:t={}})=>{const e=[],r={};for(const n of Object.keys(t).sort()){if(n.toLowerCase()===iY)continue;e.push(n);const i=t[n];typeof i=="string"?r[n]=`${Hs(n)}=${Hs(i)}`:Array.isArray(i)&&(r[n]=i.slice(0).reduce((s,o)=>s.concat([`${Hs(n)}=${Hs(o)}`]),[]).sort().join("&"))}return e.map(n=>r[n]).filter(n=>n).join("&")},yY=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",hv=async({headers:t,body:e},r)=>{for(const n of Object.keys(t))if(n.toLowerCase()===pp)return t[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||yY(e)){const n=new r;return n.update(ef(e)),Fo(await n.digest())}return fY};class pY{format(e){const r=[];for(const s of Object.keys(e)){const o=Cl(s);r.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[s]))}const n=new Uint8Array(r.reduce((s,o)=>s+o.byteLength,0));let i=0;for(const s of r)n.set(s,i),i+=s.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":const s=new DataView(new ArrayBuffer(3+e.value.byteLength));s.setUint8(0,6),s.setUint16(1,e.value.byteLength,!1);const o=new Uint8Array(s.buffer);return o.set(e.value,3),o;case"string":const a=Cl(e.value),l=new DataView(new ArrayBuffer(3+a.byteLength));l.setUint8(0,7),l.setUint16(1,a.byteLength,!1);const c=new Uint8Array(l.buffer);return c.set(a,3),c;case"timestamp":const f=new Uint8Array(9);return f[0]=8,f.set(ix.fromNumber(e.value.valueOf()).bytes,1),f;case"uuid":if(!mY.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const u=new Uint8Array(17);return u[0]=9,u.set(gQ(e.value.replace(/\-/g,"")),1),u}}}var a4;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(a4||(a4={}));const mY=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class ix{constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,i=Math.abs(Math.round(e));n>-1&&i>0;n--,i/=256)r[n]=i;return e<0&&l4(r),new ix(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&l4(e),parseInt(Fo(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function l4(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}const gY=(t,e)=>{t=t.toLowerCase();for(const r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1},sk=({headers:t,query:e,...r})=>({...r,headers:{...t},query:e?xY(e):void 0}),xY=t=>Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{}),bY=(t,e={})=>{var i;const{headers:r,query:n={}}=typeof t.clone=="function"?t.clone():sk(t);for(const s of Object.keys(r)){const o=s.toLowerCase();o.slice(0,6)==="x-amz-"&&!((i=e.unhoistableHeaders)!=null&&i.has(o))&&(n[s]=r[s],delete r[s])}return{...t,headers:r,query:n}},c4=t=>{t=typeof t.clone=="function"?t.clone():sk(t);for(const e of Object.keys(t.headers))nY.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t},wY=t=>EY(t).toISOString().replace(/\.\d{3}Z$/,"Z"),EY=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;class f4{constructor({applyChecksum:e,credentials:r,region:n,service:i,sha256:s,uriEscapePath:o=!0}){this.headerFormatter=new pY,this.service=i,this.sha256=s,this.uriEscapePath=o,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=io(n),this.credentialProvider=io(r)}async presign(e,r={}){const{signingDate:n=new Date,expiresIn:i=3600,unsignableHeaders:s,unhoistableHeaders:o,signableHeaders:a,signingRegion:l,signingService:c}=r,f=await this.credentialProvider();this.validateResolvedCredentials(f);const u=l??await this.regionProvider(),{longDate:d,shortDate:v}=Gu(n);if(i>dY)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const g=dv(v,u,c??this.service),y=bY(c4(e),{unhoistableHeaders:o});f.sessionToken&&(y.query[tk]=f.sessionToken),y.query[XQ]=fv,y.query[ZQ]=`${f.accessKeyId}/${g}`,y.query[Z9]=d,y.query[tY]=i.toString(10);const w=o4(y,s,a);return y.query[eY]=u4(w),y.query[ek]=await this.getSignature(d,g,this.getSigningKey(f,u,v,c),this.createCanonicalRequest(y,w,await hv(e,this.sha256))),y}async sign(e,r){return typeof e=="string"?this.signString(e,r):e.headers&&e.payload?this.signEvent(e,r):e.message?this.signMessage(e,r):this.signRequest(e,r)}async signEvent({headers:e,payload:r},{signingDate:n=new Date,priorSignature:i,signingRegion:s,signingService:o}){const a=s??await this.regionProvider(),{shortDate:l,longDate:c}=Gu(n),f=dv(l,a,o??this.service),u=await hv({headers:{},body:r},this.sha256),d=new this.sha256;d.update(e);const v=Fo(await d.digest()),g=[cY,c,f,i,v,u].join(` +`)}static register(e,r){r||(r=e.locale)}}const zH="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let Jc=null;function yE(t){if(Jc==null&&(Jc=zH.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),su.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw Jc=null,new Error("BIP39 Wordlist for en (English) FAILED")}class VH extends su{constructor(){super("en")}getWord(e){return yE(this),Jc[e]}getWordIndex(e){return yE(this),Jc.indexOf(e)}}const l9=new VH;su.register(l9);const ip={en:l9},qH="hdnode/5.7.0",wh=new W(qH),HH=ae.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),WH=sr("Bitcoin seed"),fc=2147483648;function c9(t){return(1<=256)throw new Error("Depth too large!");return pE(ir([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",fe(this.depth),this.parentFingerprint,kt(fe(this.index),4),this.chainCode,this.privateKey!=null?ir(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new jn(Aa,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~fc));const n=new Uint8Array(37);if(e&fc){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(ce(this.privateKey),1),r&&(r+="'")}else n.set(ce(this.publicKey));for(let u=24;u>=0;u-=8)n[33+(u>>3)]=e>>24-u&255;const i=ce(bh(Of.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,l=null;this.privateKey?a=Uu(ae.from(s).add(this.privateKey).mod(HH)):l=new il(fe(s))._addPoint(this.publicKey);let c=r;const f=this.mnemonic;return f&&(c=Object.freeze({phrase:f.phrase,path:r,locale:f.locale||"en"})),new jn(Aa,a,l,this.fingerprint,Uu(o),e,this.depth+1,c)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i=fc)throw new Error("invalid path index - "+s);n=n._derive(fc+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=fc)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=ce(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=ce(bh(Of.sha512,WH,n));return new jn(Aa,Uu(i.slice(0,32)),null,"0x00000000",Uu(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=Ug(n),e=zg(f9(e,n),n),jn._fromSeed(KH(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return jn._fromSeed(e,null)}static fromExtendedKey(e){const r=_f.decode(e);(r.length!==82||pE(r.slice(0,78))!==e)&&wh.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=fe(r.slice(5,9)),s=parseInt(fe(r.slice(9,13)).substring(2),16),o=fe(r.slice(13,45)),a=r.slice(45,78);switch(fe(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new jn(Aa,null,fe(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new jn(Aa,fe(a.slice(1)),null,i,o,s,n,null)}return wh.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function KH(t,e){e||(e="");const r=sr("mnemonic"+e,ho.NFKD);return Fg(sr(t,ho.NFKD),r,2048,64,"sha512")}function f9(t,e){e=Ug(e),wh.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=ce(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let c=0;c>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=c9(o);if((ce(la(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return fe(n.slice(0,s/8))}function zg(t,e){if(e=Ug(e),t=ce(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&GH(8-n)),n+=3);const i=t.length/4,s=ce(la(t))[0]&c9(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}const QH="random/5.7.0",sp=new W(QH);function YH(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const mE=YH();let wd=mE.crypto||mE.msCrypto;(!wd||!wd.getRandomValues)&&(sp.warn("WARNING: Missing strong random number source"),wd={getRandomValues:function(t){return sp.throwError("no secure random source avaialble",W.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function _c(t){(t<=0||t>1024||t%1||t!=t)&&sp.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return wd.getRandomValues(e),ce(e)}var u9={exports:{}};(function(t,e){(function(r){function n(C){return parseInt(C)===C}function i(C){if(!n(C.length))return!1;for(var m=0;m255)return!1;return!0}function s(C,m){if(C.buffer&&ArrayBuffer.isView(C)&&C.name==="Uint8Array")return m&&(C.slice?C=C.slice():C=Array.prototype.slice.call(C)),C;if(Array.isArray(C)){if(!i(C))throw new Error("Array contains invalid value: "+C);return new Uint8Array(C)}if(n(C.length)&&i(C))return new Uint8Array(C);throw new Error("unsupported array-like object")}function o(C){return new Uint8Array(C)}function a(C,m,T,F,E){(F!=null||E!=null)&&(C.slice?C=C.slice(F,E):C=Array.prototype.slice.call(C,F,E)),m.set(C,T)}var l=function(){function C(T){var F=[],E=0;for(T=encodeURI(T);E191&&B<224?(F.push(String.fromCharCode((B&31)<<6|T[E+1]&63)),E+=2):(F.push(String.fromCharCode((B&15)<<12|(T[E+1]&63)<<6|T[E+2]&63)),E+=3)}return F.join("")}return{toBytes:C,fromBytes:m}}(),c=function(){function C(F){for(var E=[],B=0;B>4]+m[V&15])}return E.join("")}return{toBytes:C,fromBytes:T}}(),f={16:10,24:12,32:14},u=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],v=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],g=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],w=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],x=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],S=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],P=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],D=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],M=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],L=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],z=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function H(C){for(var m=[],T=0;T>2,this._Ke[B][m%4]=E[m],this._Kd[C-B][m%4]=E[m];for(var V=0,q=F,K;q>16&255]<<24^d[K>>8&255]<<16^d[K&255]<<8^d[K>>24&255]^u[V]<<24,V+=1,F!=8)for(var m=1;m>8&255]<<8^d[K>>16&255]<<16^d[K>>24&255]<<24;for(var m=F/2+1;m>2,ee=q%4,this._Ke[oe][ee]=E[m],this._Kd[C-oe][ee]=E[m++],q++}for(var oe=1;oe>24&255]^M[K>>16&255]^L[K>>8&255]^z[K&255]},Y.prototype.encrypt=function(C){if(C.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var m=this._Ke.length-1,T=[0,0,0,0],F=H(C),E=0;E<4;E++)F[E]^=this._Ke[0][E];for(var B=1;B>24&255]^y[F[(E+1)%4]>>16&255]^w[F[(E+2)%4]>>8&255]^x[F[(E+3)%4]&255]^this._Ke[B][E];F=T.slice()}for(var V=o(16),q,E=0;E<4;E++)q=this._Ke[m][E],V[4*E]=(d[F[E]>>24&255]^q>>24)&255,V[4*E+1]=(d[F[(E+1)%4]>>16&255]^q>>16)&255,V[4*E+2]=(d[F[(E+2)%4]>>8&255]^q>>8)&255,V[4*E+3]=(d[F[(E+3)%4]&255]^q)&255;return V},Y.prototype.decrypt=function(C){if(C.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var m=this._Kd.length-1,T=[0,0,0,0],F=H(C),E=0;E<4;E++)F[E]^=this._Kd[0][E];for(var B=1;B>24&255]^S[F[(E+3)%4]>>16&255]^P[F[(E+2)%4]>>8&255]^_[F[(E+1)%4]&255]^this._Kd[B][E];F=T.slice()}for(var V=o(16),q,E=0;E<4;E++)q=this._Kd[m][E],V[4*E]=(v[F[E]>>24&255]^q>>24)&255,V[4*E+1]=(v[F[(E+3)%4]>>16&255]^q>>16)&255,V[4*E+2]=(v[F[(E+2)%4]>>8&255]^q>>8)&255,V[4*E+3]=(v[F[(E+1)%4]&255]^q)&255;return V};var Z=function(C){if(!(this instanceof Z))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new Y(C)};Z.prototype.encrypt=function(C){if(C=s(C),C.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var m=o(C.length),T=o(16),F=0;F=0;--m)this._counter[m]=C%256,C=C>>8},k.prototype.setBytes=function(C){if(C=s(C,!0),C.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=C},k.prototype.increment=function(){for(var C=15;C>=0;C--)if(this._counter[C]===255)this._counter[C]=0;else{this._counter[C]++;break}};var I=function(C,m){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",m instanceof k||(m=new k(m)),this._counter=m,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new Y(C)};I.prototype.encrypt=function(C){for(var m=s(C,!0),T=0;T16)throw new Error("PKCS#7 padding byte out of range");for(var T=C.length-m,F=0;F=64;){let j=x,C=b,m=S,T=P,F=_,E=D,B=M,V=L,q,K,oe,ee,te;for(K=0;K<16;K++)oe=R+K*4,z[K]=(I[oe]&255)<<24|(I[oe+1]&255)<<16|(I[oe+2]&255)<<8|I[oe+3]&255;for(K=16;K<64;K++)q=z[K-2],ee=(q>>>17|q<<32-17)^(q>>>19|q<<32-19)^q>>>10,q=z[K-15],te=(q>>>7|q<<32-7)^(q>>>18|q<<32-18)^q>>>3,z[K]=(ee+z[K-7]|0)+(te+z[K-16]|0)|0;for(K=0;K<64;K++)ee=(((F>>>6|F<<32-6)^(F>>>11|F<<32-11)^(F>>>25|F<<32-25))+(F&E^~F&B)|0)+(V+(w[K]+z[K]|0)|0)|0,te=((j>>>2|j<<32-2)^(j>>>13|j<<32-13)^(j>>>22|j<<32-22))+(j&C^j&m^C&m)|0,V=B,B=E,E=F,F=T+ee|0,T=m,m=C,C=j,j=ee+te|0;x=x+j|0,b=b+C|0,S=S+m|0,P=P+T|0,_=_+F|0,D=D+E|0,M=M+B|0,L=L+V|0,R+=64,N-=64}}H(y);let Y,Z=y.length%64,O=y.length/536870912|0,h=y.length<<3,A=Z<56?56:120,k=y.slice(y.length-Z,y.length);for(k.push(128),Y=Z+1;Y>>24&255),k.push(O>>>16&255),k.push(O>>>8&255),k.push(O>>>0&255),k.push(h>>>24&255),k.push(h>>>16&255),k.push(h>>>8&255),k.push(h>>>0&255),H(k),[x>>>24&255,x>>>16&255,x>>>8&255,x>>>0&255,b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,S>>>24&255,S>>>16&255,S>>>8&255,S>>>0&255,P>>>24&255,P>>>16&255,P>>>8&255,P>>>0&255,_>>>24&255,_>>>16&255,_>>>8&255,_>>>0&255,D>>>24&255,D>>>16&255,D>>>8&255,D>>>0&255,M>>>24&255,M>>>16&255,M>>>8&255,M>>>0&255,L>>>24&255,L>>>16&255,L>>>8&255,L>>>0&255]}function s(y,w,x){y=y.length<=64?y:i(y);const b=64+w.length+4,S=new Array(b),P=new Array(64);let _,D=[];for(_=0;_<64;_++)S[_]=54;for(_=0;_=b-4;L--){if(S[L]++,S[L]<=255)return;S[L]=0}}for(;x>=32;)M(),D=D.concat(i(P.concat(i(S)))),x-=32;return x>0&&(M(),D=D.concat(i(P.concat(i(S))).slice(0,x))),D}function o(y,w,x,b,S){let P;for(f(y,(2*x-1)*16,S,0,16),P=0;P<2*x;P++)c(y,P*16,S,16),l(S,b),f(S,0,y,w+P*16,16);for(P=0;P>>32-w}function l(y,w){f(y,0,w,0,16);for(let x=8;x>0;x-=2)w[4]^=a(w[0]+w[12],7),w[8]^=a(w[4]+w[0],9),w[12]^=a(w[8]+w[4],13),w[0]^=a(w[12]+w[8],18),w[9]^=a(w[5]+w[1],7),w[13]^=a(w[9]+w[5],9),w[1]^=a(w[13]+w[9],13),w[5]^=a(w[1]+w[13],18),w[14]^=a(w[10]+w[6],7),w[2]^=a(w[14]+w[10],9),w[6]^=a(w[2]+w[14],13),w[10]^=a(w[6]+w[2],18),w[3]^=a(w[15]+w[11],7),w[7]^=a(w[3]+w[15],9),w[11]^=a(w[7]+w[3],13),w[15]^=a(w[11]+w[7],18),w[1]^=a(w[0]+w[3],7),w[2]^=a(w[1]+w[0],9),w[3]^=a(w[2]+w[1],13),w[0]^=a(w[3]+w[2],18),w[6]^=a(w[5]+w[4],7),w[7]^=a(w[6]+w[5],9),w[4]^=a(w[7]+w[6],13),w[5]^=a(w[4]+w[7],18),w[11]^=a(w[10]+w[9],7),w[8]^=a(w[11]+w[10],9),w[9]^=a(w[8]+w[11],13),w[10]^=a(w[9]+w[8],18),w[12]^=a(w[15]+w[14],7),w[13]^=a(w[12]+w[15],9),w[14]^=a(w[13]+w[12],13),w[15]^=a(w[14]+w[13],18);for(let x=0;x<16;++x)y[x]+=w[x]}function c(y,w,x,b){for(let S=0;S=256)return!1}return!0}function d(y,w){if(typeof y!="number"||y%1)throw new Error("invalid "+w);return y}function v(y,w,x,b,S,P,_){if(x=d(x,"N"),b=d(b,"r"),S=d(S,"p"),P=d(P,"dkLen"),x===0||x&x-1)throw new Error("N must be power of 2");if(x>2147483647/128/b)throw new Error("N too large");if(b>2147483647/128/S)throw new Error("r too large");if(!u(y))throw new Error("password must be an array or buffer");if(y=Array.prototype.slice.call(y),!u(w))throw new Error("salt must be an array or buffer");w=Array.prototype.slice.call(w);let D=s(y,w,S*128*b);const M=new Uint32Array(S*32*b);for(let F=0;FC&&(F=C);for(let B=0;BC&&(F=C);for(let B=0;B>0&255),D.push(M[B]>>8&255),D.push(M[B]>>16&255),D.push(M[B]>>24&255);const E=s(y,D,P);return _&&_(null,1,E),E}_&&m(T)};if(!_)for(;;){const F=T();if(F!=null)return F}T()}const g={scrypt:function(y,w,x,b,S,P,_){return new Promise(function(D,M){let L=0;_&&_(0),v(y,w,x,b,S,P,function(z,H,Y){if(z)M(z);else if(Y)_&&L!==1&&_(1),D(new Uint8Array(Y));else if(_&&H!==L)return L=H,_(H)})})},syncScrypt:function(y,w,x,b,S,P){return new Uint8Array(v(y,w,x,b,S,P))}};t.exports=g})()})(p9);var tW=p9.exports;const qg=Ss(tW);var rW=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const op=new W(d9);function gE(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}class nW extends ya{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function iW(t,e,r){if(rr(t,"crypto/cipher")==="aes-128-ctr"){const i=Go(rr(t,"crypto/cipherparams/iv")),s=new Ni.Counter(i),o=new Ni.ModeOfOperation.ctr(e,s);return ce(o.decrypt(r))}return null}function m9(t,e){const r=Go(rr(t,"crypto/ciphertext"));if(fe(Et(ir([e.slice(16,32),r]))).substring(2)!==rr(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=iW(t,e.slice(0,16),r);i||op.throwError("unsupported cipher",W.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const s=e.slice(32,64),o=Wo(i);if(t.address){let l=t.address.toLowerCase();if(l.substring(0,2)!=="0x"&&(l="0x"+l),Ut(l)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:fe(i)};if(rr(t,"x-ethers/version")==="0.1"){const l=Go(rr(t,"x-ethers/mnemonicCiphertext")),c=Go(rr(t,"x-ethers/mnemonicCounter")),f=new Ni.Counter(c),u=new Ni.ModeOfOperation.ctr(s,f),d=rr(t,"x-ethers/path")||Nf,v=rr(t,"x-ethers/locale")||"en",g=ce(u.decrypt(l));try{const y=zg(g,v),w=jn.fromMnemonic(y,null,v).derivePath(d);if(w.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=w.mnemonic}catch(y){if(y.code!==W.errors.INVALID_ARGUMENT||y.argument!=="wordlist")throw y}}return new nW(a)}function g9(t,e,r,n,i){return ce(Fg(t,e,r,n,i))}function sW(t,e,r,n,i){return Promise.resolve(g9(t,e,r,n,i))}function x9(t,e,r,n,i){const s=Vg(e),o=rr(t,"crypto/kdf");if(o&&typeof o=="string"){const a=function(l,c){return op.throwArgumentError("invalid key-derivation function parameters",l,c)};if(o.toLowerCase()==="scrypt"){const l=Go(rr(t,"crypto/kdfparams/salt")),c=parseInt(rr(t,"crypto/kdfparams/n")),f=parseInt(rr(t,"crypto/kdfparams/r")),u=parseInt(rr(t,"crypto/kdfparams/p"));(!c||!f||!u)&&a("kdf",o),c&c-1&&a("N",c);const d=parseInt(rr(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),n(s,l,c,f,u,64,i)}else if(o.toLowerCase()==="pbkdf2"){const l=Go(rr(t,"crypto/kdfparams/salt"));let c=null;const f=rr(t,"crypto/kdfparams/prf");f==="hmac-sha256"?c="sha256":f==="hmac-sha512"?c="sha512":a("prf",f);const u=parseInt(rr(t,"crypto/kdfparams/c")),d=parseInt(rr(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),r(s,l,u,d,c)}}return op.throwArgumentError("unsupported key-derivation function","kdf",o)}function oW(t,e){const r=JSON.parse(t),n=x9(r,e,g9,qg.syncScrypt);return m9(r,n)}function aW(t,e,r){return rW(this,void 0,void 0,function*(){const n=JSON.parse(t),i=yield x9(n,e,sW,qg.scrypt,r);return m9(n,i)})}function lW(t,e,r,n){try{if(Ut(t.address)!==Wo(t.privateKey))throw new Error("address/privateKey mismatch");if(gE(t)){const w=t.mnemonic;if(jn.fromMnemonic(w.phrase,null,w.locale).derivePath(w.path||Nf).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(w){return Promise.reject(w)}typeof r=="function"&&!n&&(n=r,r={}),r||(r={});const i=ce(t.privateKey),s=Vg(e);let o=null,a=null,l=null;if(gE(t)){const w=t.mnemonic;o=ce(f9(w.phrase,w.locale||"en")),a=w.path||Nf,l=w.locale||"en"}let c=r.client;c||(c="ethers.js");let f=null;r.salt?f=ce(r.salt):f=_c(32);let u=null;if(r.iv){if(u=ce(r.iv),u.length!==16)throw new Error("invalid iv")}else u=_c(16);let d=null;if(r.uuid){if(d=ce(r.uuid),d.length!==16)throw new Error("invalid uuid")}else d=_c(16);let v=1<<17,g=8,y=1;return r.scrypt&&(r.scrypt.N&&(v=r.scrypt.N),r.scrypt.r&&(g=r.scrypt.r),r.scrypt.p&&(y=r.scrypt.p)),qg.scrypt(s,f,v,g,y,64,n).then(w=>{w=ce(w);const x=w.slice(0,16),b=w.slice(16,32),S=w.slice(32,64),P=new Ni.Counter(u),_=new Ni.ModeOfOperation.ctr(x,P),D=ce(_.encrypt(i)),M=Et(ir([b,D])),L={address:t.address.substring(2).toLowerCase(),id:XH(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:fe(u).substring(2)},ciphertext:fe(D).substring(2),kdf:"scrypt",kdfparams:{salt:fe(f).substring(2),n:v,dklen:32,p:y,r:g},mac:M.substring(2)}};if(o){const z=_c(16),H=new Ni.Counter(z),Y=new Ni.ModeOfOperation.ctr(S,H),Z=ce(Y.encrypt(o)),O=new Date,h=O.getUTCFullYear()+"-"+uc(O.getUTCMonth()+1,2)+"-"+uc(O.getUTCDate(),2)+"T"+uc(O.getUTCHours(),2)+"-"+uc(O.getUTCMinutes(),2)+"-"+uc(O.getUTCSeconds(),2)+".0Z";L["x-ethers"]={client:c,gethFilename:"UTC--"+h+"--"+L.address,mnemonicCounter:fe(z).substring(2),mnemonicCiphertext:fe(Z).substring(2),path:a,locale:l,version:"0.1"}}return JSON.stringify(L)})}function cW(t,e,r){if(v9(t)){r&&r(0);const n=h9(t,e);return r&&r(1),Promise.resolve(n)}return y9(t)?aW(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function fW(t,e){if(v9(t))return h9(t,e);if(y9(t))return oW(t,e);throw new Error("invalid JSON wallet")}const uW="wallet/5.7.0";var xE=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Sa=new W(uW);function dW(t){return t!=null&&He(t.privateKey,32)&&t.address!=null}function hW(t){const e=t.mnemonic;return e&&e.phrase}class ss extends jl{constructor(e,r){if(super(),dW(e)){const n=new il(e.privateKey);if(ne(this,"_signingKey",()=>n),ne(this,"address",Wo(this.publicKey)),this.address!==Ut(e.address)&&Sa.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),hW(e)){const i=e.mnemonic;ne(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||Nf,locale:i.locale||"en"}));const s=this.mnemonic,o=jn.fromMnemonic(s.phrase,null,s.locale).derivePath(s.path);Wo(o.privateKey)!==this.address&&Sa.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ne(this,"_mnemonic",()=>null)}else{if(il.isSigningKey(e))e.curve!=="secp256k1"&&Sa.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ne(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const n=new il(e);ne(this,"_signingKey",()=>n)}ne(this,"_mnemonic",()=>null),ne(this,"address",Wo(this.publicKey))}r&&!nu.isProvider(r)&&Sa.throwArgumentError("invalid provider","provider",r),ne(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new ss(this,e)}signTransaction(e){return er(e).then(r=>{r.from!=null&&(Ut(r.from)!==this.address&&Sa.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);const n=this._signingKey().signDigest(Et(uE(r)));return uE(r,n)})}signMessage(e){return xE(this,void 0,void 0,function*(){return $3(this._signingKey().signDigest(mV(e)))})}_signTypedData(e,r,n){return xE(this,void 0,void 0,function*(){const i=yield Kr.resolveNames(e,r,n,s=>(this.provider==null&&Sa.throwError("cannot resolve ENS names without a provider",W.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:s}),this.provider.resolveName(s)));return $3(this._signingKey().signDigest(Kr.hash(i.domain,r,i.value)))})}encrypt(e,r,n){if(typeof r=="function"&&!n&&(n=r,r={}),n&&typeof n!="function")throw new Error("invalid callback");return r||(r={}),lW(this,e,r,n)}static createRandom(e){let r=_c(16);e||(e={}),e.extraEntropy&&(r=ce(vr(Et(ir([r,e.extraEntropy])),0,16)));const n=zg(r,e.locale);return ss.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,r,n){return cW(e,r,n).then(i=>new ss(i))}static fromEncryptedJsonSync(e,r){return new ss(fW(e,r))}static fromMnemonic(e,r,n){return r||(r=Nf),new ss(jn.fromMnemonic(e,null,n).derivePath(r))}}const vW="networks/5.7.1",bE=new W(vW);function yW(t){return t&&typeof t.renetwork=="function"}function ns(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return ns(r)},e}function Eh(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return Eh(t,n)},r}const wE={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ns("homestead")},EE={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ns("ropsten")},AE={chainId:63,name:"classicMordor",_defaultProvider:Eh("https://www.ethercluster.com/mordor","classicMordor")},zu={unspecified:{chainId:0,name:"unspecified"},homestead:wE,mainnet:wE,morden:{chainId:2,name:"morden"},ropsten:EE,testnet:EE,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ns("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ns("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ns("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ns("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Eh("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:AE,classicTestnet:AE,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Eh("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ns("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ns("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function pW(t){if(t==null)return null;if(typeof t=="number"){for(const n in zu){const i=zu[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=zu[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=zu[t.name];if(!e)return typeof t.chainId!="number"&&bE.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&bE.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(yW(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const mW="web/5.7.1";var gW=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};function xW(t,e){return gW(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:ce(new Uint8Array(i))}})}var bW=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const ni=new W(mW);function SE(t){return new Promise(e=>{setTimeout(e,t)})}function Is(t,e){if(t==null)return null;if(typeof t=="string")return t;if(x0(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return ru(t)}catch{}return fe(t)}return t}function wW(t){return sr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function EW(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;ni.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;ni.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const c={method:"GET"};let f=!1,u=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&ni.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(u=t.timeout),t.headers)for(const x in t.headers)a[x.toLowerCase()]={key:x,value:String(t.headers[x])},["if-none-match","if-modified-since"].indexOf(x.toLowerCase())>=0&&(f=!0);if(c.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&ni.throwError("basic authentication requires a secure https url",W.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const x=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+w7(sr(x))}}t.skipFetchSetup!=null&&(c.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(c.fetchOptions=mr(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),v=l?l.match(d):null;if(v)try{const x={statusCode:200,statusMessage:"OK",headers:{"content-type":v[1]||"text/plain"},body:v[2]?b7(v[3]):wW(v[3])};let b=x.body;return r&&(b=r(x.body,x)),Promise.resolve(b)}catch(x){ni.throwError("processing response error",W.errors.SERVER_ERROR,{body:Is(v[1],v[2]),error:x,requestBody:null,requestMethod:"GET",url:l})}e&&(c.method="POST",c.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const g={};Object.keys(a).forEach(x=>{const b=a[x];g[b.key]=b.value}),c.headers=g;const y=function(){let x=null;return{promise:new Promise(function(P,_){u&&(x=setTimeout(()=>{x!=null&&(x=null,_(ni.makeError("timeout",W.errors.TIMEOUT,{requestBody:Is(c.body,g["content-type"]),requestMethod:c.method,timeout:u,url:l})))},u))}),cancel:function(){x!=null&&(clearTimeout(x),x=null)}}}(),w=function(){return bW(this,void 0,void 0,function*(){for(let x=0;x=300)&&(y.cancel(),ni.throwError("bad response",W.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:Is(S,b.headers?b.headers["content-type"]:null),requestBody:Is(c.body,g["content-type"]),requestMethod:c.method,url:l})),r)try{const P=yield r(S,b);return y.cancel(),P}catch(P){if(P.throttleRetry&&x{let a=null;if(s!=null)try{a=JSON.parse(ru(s))}catch(l){ni.throwError("invalid JSON",W.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=sr(e);const s=typeof t=="string"?{url:t}:mr(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=mr(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return EW(t,i,n)}function Oc(t,e){return e||(e={}),e=mr(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function c(){return t().then(function(f){if(f!==void 0)o()&&r(f);else if(e.oncePoll)e.oncePoll.once("poll",c);else if(e.onceBlock)e.onceBlock.once("block",c);else if(!s){if(l++,l>a){o()&&n(new Error("retry limit reached"));return}let u=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));ue.ceiling&&(u=e.ceiling),setTimeout(c,u)}return null},function(f){o()&&n(f)})}c()})}var Ah="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ap={};for(var Vu=0;Vu>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function b9(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=sl(e)^n>>5}for(e=sl(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=b9(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=sl(n)^o,i+=Ah.charAt(o)}for(s=0;s<6;++s)n=sl(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=Ah.charAt(a)}return i}function w9(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=b9(s);if(typeof a=="string")return a;for(var l=[],c=0;c=o.length)&&l.push(u)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function SW(){var t=w9.apply(null,arguments);if(typeof t=="object")return t}function CW(t){var e=w9.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function C0(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(u,!0);return e.transaction={hash:o,type:c,accessList:be.allowNull(this.accessList.bind(this),null),blockHash:be.allowNull(o,null),blockNumber:be.allowNull(l,null),transactionIndex:be.allowNull(l,null),confirmations:be.allowNull(l,null),from:r,gasPrice:be.allowNull(n),maxPriorityFeePerGas:be.allowNull(n),maxFeePerGas:be.allowNull(n),gasLimit:n,to:be.allowNull(r,null),value:n,nonce:l,data:s,r:be.allowNull(this.uint256),s:be.allowNull(this.uint256),v:be.allowNull(l),creates:be.allowNull(r,null),raw:be.allowNull(s)},e.transactionRequest={from:be.allowNull(r),nonce:be.allowNull(l),gasLimit:be.allowNull(n),gasPrice:be.allowNull(n),maxPriorityFeePerGas:be.allowNull(n),maxFeePerGas:be.allowNull(n),to:be.allowNull(r),value:be.allowNull(n),data:be.allowNull(f),type:be.allowNull(l),accessList:be.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:be.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:be.allowNull(this.address,null),from:be.allowNull(this.address,null),contractAddress:be.allowNull(r,null),transactionIndex:l,root:be.allowNull(a),gasUsed:n,logsBloom:be.allowNull(s),blockHash:o,transactionHash:o,logs:be.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:be.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:be.allowNull(n),status:be.allowNull(l),type:c},e.block={hash:be.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:be.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:be.allowNull(r),extraData:s,transactions:be.allowNull(be.arrayOf(o)),baseFeePerGas:be.allowNull(n)},e.blockWithTransactions=mr(e.block),e.blockWithTransactions.transactions=be.allowNull(be.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:be.allowNull(i,void 0),toBlock:be.allowNull(i,void 0),blockHash:be.allowNull(o,void 0),address:be.allowNull(r,void 0),topics:be.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:be.allowNull(l),blockHash:be.allowNull(o),transactionIndex:l,removed:be.allowNull(this.boolean.bind(this)),address:r,data:be.allowFalsish(s,"0x"),topics:be.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return zl(e||[])}number(e){return e==="0x"?0:ae.from(e).toNumber()}type(e){return e==="0x"||e==null?0:ae.from(e).toNumber()}bigNumber(e){return ae.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),He(e))?e.toLowerCase():dc.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Ut(e)}callAddress(e){if(!He(e,32))return null;const r=Ut(vr(e,12));return r===Ng?null:r}contractAddress(e){return u7(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||He(e))return Tg(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return na(n)!==32?dc.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=ae.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!He(e))throw new Error("invalid uint256");return kt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=be.check(r,e);return i._difficulty=n==null?null:ae.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return be.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&ae.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=be.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;He(n)&&(n=ae.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),He(n)&&(n=ae.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return RH(e)}receiptLog(e){return be.check(this.formats.receiptLog,e)}receipt(e){const r=be.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=ae.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&dc.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):dc.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&dc.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return be.check(this.formats.filter,e)}filterLog(e){return be.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var Pe=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Le=new W(Wg),IW=10;function kE(t){return t==null?"null":(na(t)!==32&&Le.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function PE(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[kE(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return kE(e)}).join("&")}function _W(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Ca(t){if(typeof t=="string"){if(t=t.toLowerCase(),na(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+PE(t);if(_V.isForkEvent(t))throw Le.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+PE(t.topics||[])}throw new Error("invalid event - "+t)}function hc(){return new Date().getTime()}function RE(t){return new Promise(e=>{setTimeout(e,t)})}const OW=["block","network","pending","poll"];let NW=class{constructor(e,r,n){ne(this,"tag",e),ne(this,"listener",r),ne(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=_W(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||OW.indexOf(this.tag)>=0}};const DW={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Z1(t){return kt(ae.from(t).toHexString(),32)}function TE(t){return _f.encode(ir([t,vr(la(la(t)),0,4)]))}const E9=new RegExp("^(ipfs)://(.*)$","i"),ME=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),E9,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Ed(t,e){try{return ru(Df(t,e))}catch{}return null}function Df(t,e){if(t==="0x")return null;const r=ae.from(vr(t,e,e+32)).toNumber(),n=ae.from(vr(t,r,r+32)).toNumber();return vr(t,r+32,r+32+n)}function ev(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Le.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function IE(t){const e=ce(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function LW(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function A9(t){const e=[];let r=0;for(let n=0;nae.from(e).eq(1)).catch(e=>{if(e.code===W.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Pe(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:rn([e,md(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=rn(["0x9061b923",A9([yV(this.name),n.data])]));try{let s=yield this.provider.call(n);return ce(s).length%32===4&&Le.throwError("resolver threw error",W.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=Df(s,0)),s}catch(s){if(s.code===W.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return Pe(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?Df(n,0):null})}_getAddress(e,r){const n=DW[String(e)];if(n==null&&Le.throwError(`unsupported coin type: ${e}`,W.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=ce(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return TE(ir([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return TE(ir([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=CE.toWords(i.slice(2));return a.unshift(o),CE.encode(n.prefix,a)}}return null}getAddress(e){return Pe(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Oz?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===W.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",Z1(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Le.throwError("invalid or unsupported coin data",W.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return Pe(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[l])}return Le.throwError("invalid or unsupported content hash data",W.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Pe(this,void 0,void 0,function*(){let r=sr(e);r=ir([Z1(64),Z1(r.length),r]),r.length%32!==0&&(r=ir([r,kt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",fe(r));return n==null||n==="0x"?null:ru(n)})}}let tv=null,jW=1;class BW extends nu{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ne(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Oi(new.target,"getNetwork")(e);r?(ne(this,"_network",r),this.emit("network",r,null)):Le.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Pe(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Le.throwError("no network detected",W.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:ne(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Oc(()=>this._ready().then(e=>e,e=>{if(!(e.code===W.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return tv==null&&(tv=new be),tv}static getNetwork(e){return pW(e??"homestead")}ccipReadFetch(e,r,n){return Pe(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),u=yield Hg({url:c,errorPassThrough:!0},f,(v,g)=>(v.status=g.statusCode,v));if(u.data)return u.data;const d=u.message||"unknown error";if(u.status>=400&&u.status<500)return Le.throwError(`response not found during CCIP fetch: ${d}`,W.errors.SERVER_ERROR,{url:l,errorMessage:d});o.push(d)}return Le.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,W.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return Pe(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(hc()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=hc(),n=er({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=hc();return i=ae.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Pe(this,void 0,void 0,function*(){const e=jW++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Le.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Le.makeError("network block skew detected",W.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(c=>{c.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=c.blockNumber),this._emitted["b:"+c.blockHash]=c.blockNumber,this._emitted["t:"+c.transactionHash]=c.blockNumber,this.emit(s,c)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Pe(this,void 0,void 0,function*(){return Le.throwError("provider does not support network detection",W.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Pe(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield RE(0),this._network;const n=Le.makeError("underlying network changed",W.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=hc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Pe(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Pe(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const l=[];let c=!1;const f=function(){return c?!0:(c=!0,l.forEach(d=>{d()}),!1)},u=d=>{d.confirmations{this.removeListener(e,u)}),i){let d=i.startBlock,v=null;const g=y=>Pe(this,void 0,void 0,function*(){c||(yield RE(1e3),this.getTransactionCount(i.from).then(w=>Pe(this,void 0,void 0,function*(){if(!c){if(w<=i.nonce)d=y;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(v==null&&(v=d-3,v{c||this.once("block",g)}))});if(c)return;this.once("block",g),l.push(()=>{this.removeListener("block",g)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{f()||a(Le.makeError("timeout exceeded",W.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),l.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return Pe(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Pe(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return ae.from(e)}catch(r){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Pe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield er({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return ae.from(i)}catch(s){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Pe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield er({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return ae.from(i).toNumber()}catch(s){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Pe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield er({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return fe(i)}catch(s){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Pe(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield er({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>Tg(o))}),s=yield this.perform("getStorageAt",i);try{return fe(s)}catch(o){return Le.throwError("bad result from backend",W.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&na(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Le.throwError("Transaction hash mismatch from Provider.sendTransaction.",W.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Pe(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Le.throwError("transaction failed",W.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return Pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>fe(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Pe(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?ae.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?fe(s):null))}),this.formatter.transactionRequest(yield er(n))})}_getFilter(e){return Pe(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield er(r))})}_call(e,r,n){return Pe(this,void 0,void 0,function*(){n>=IW&&Le.throwError("CCIP read exceeded maximum redirections",W.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&na(s)%32===4)try{const o=vr(s,4),a=vr(o,0,32);ae.from(a).eq(i)||Le.throwError("CCIP Read sender did not match",W.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],c=ae.from(vr(o,32,64)).toNumber(),f=ae.from(vr(o,c,c+32)).toNumber(),u=vr(o,c+32);for(let x=0;xPe(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Pe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Oc(()=>Pe(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Pe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Oc(()=>Pe(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield er({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),be.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Pe(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Pe(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Le.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Pe(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new _E(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Pe(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Le.throwError("network does not support ENS",W.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+md(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return Pe(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(He(e))throw n}typeof e!="string"&&Le.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Pe(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Ed(yield this.call({to:n,data:"0x691f3431"+md(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Pe(this,void 0,void 0,function*(){let r=null;if(He(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new _E(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==W.errors.CALL_EXCEPTION)throw a}try{const a=Ed(yield this.call({to:o,data:"0x691f3431"+md(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==W.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Le.throwError(e+" not implemented",W.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new NW(Ca(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Ca(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Ca(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Ca(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Ca(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Ca(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var ts=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(u){o(u)}}function l(f){try{c(n.throw(f))}catch(u){o(u)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const ar=new W(Wg),$W=["call","estimateGas"];function Xc(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=He(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Xc(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Xc(JSON.parse(t),e)}catch{}return null}function S9(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=Xc(e,!0);if(s)return s.data;ar.throwError("missing revert data in call exception; Transaction reverted without a reason string",W.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=Xc(e.body,!1);s==null&&(s=Xc(e,!1)),s&&ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",W.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===W.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ar.throwError("insufficient funds for intrinsic transaction cost",W.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&ar.throwError("nonce has already been used",W.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ar.throwError("replacement fee too low",W.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&ar.throwError("legacy pre-eip-155 transactions not supported",W.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),$W.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",W.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function OE(t){return new Promise(function(e){setTimeout(e,t)})}function FW(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function vc(t){return t&&t.toLowerCase()}const lp={};class C9 extends jl{constructor(e,r,n){if(super(),e!==lp)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ne(this,"provider",r),n==null&&(n=0),typeof n=="string"?(ne(this,"_address",this.provider.formatter.address(n)),ne(this,"_index",null)):typeof n=="number"?(ne(this,"_index",n),ne(this,"_address",null)):ar.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return ar.throwError("cannot alter JSON-RPC Signer connection",W.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UW(lp,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&ar.throwError("unknown account #"+this._index,W.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=mr(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=mr(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>ts(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&ar.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),er({tx:er(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&ar.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&ar.throwError("user rejected transaction",W.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),S9("sendTransaction",o,s)))})}signTransaction(e){return ar.throwError("signing transactions is unsupported",W.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return ts(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Oc(()=>ts(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return ts(this,void 0,void 0,function*(){const r=typeof e=="string"?sr(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[fe(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&ar.throwError("user rejected signing",W.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return ts(this,void 0,void 0,function*(){const r=typeof e=="string"?sr(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),fe(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&ar.throwError("user rejected signing",W.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return ts(this,void 0,void 0,function*(){const i=yield Kr.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(Kr.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&ar.throwError("user rejected signing",W.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return ts(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class UW extends C9{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const zW={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let VW=class extends BW{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Oi(this.constructor,"defaultUrl")()),typeof e=="string"?ne(this,"connection",Object.freeze({url:e})):ne(this,"connection",Object.freeze(mr(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return ts(this,void 0,void 0,function*(){yield OE(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Oi(this.constructor,"getNetwork");try{return r(ae.from(e).toNumber())}catch(n){return ar.throwError("could not detect network",W.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return ar.throwError("could not detect network",W.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new C9(lp,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:ia(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=Hg(this.connection,JSON.stringify(n),FW).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[vc(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[vc(r.address),r.blockTag]];case"getCode":return["eth_getCode",[vc(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[vc(r.address),kt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Oi(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Oi(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=vc(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return ts(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&ae.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=mr(r),r.transaction=mr(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&ar.throwError(e+" not implemented",W.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return S9(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return OE(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=mr(zW);if(r)for(const s in r)r[s]&&(n[s]=!0);n7(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Tg(ae.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=fe(e[s]))}),e.accessList&&(i.accessList=zl(e.accessList)),i}};const qW="units/5.7.0",HW=new W(qW),k9=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Gg(t,e){if(typeof e=="string"){const r=k9.indexOf(e);r!==-1&&(e=3*r)}return yd(t,e??18)}function Lf(t,e){if(typeof t!="string"&&HW.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=k9.indexOf(e);r!==-1&&(e=3*r)}return Ai(t,e??18)}function WW(t){return Gg(t,18)}function NE(t){return Lf(t,18)}function cp(){return cp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(c=>c.chainId).sort(),s=i.filter((c,f)=>i.indexOf(c)!==f);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(c=>c.name=c.name.toLowerCase());const o=n.map(c=>c.name).sort(),a=o.filter((c,f)=>o.indexOf(c)!==f);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let l=!1;for(let c=0;c(KW(t,!0,e),t),YW=t=>QW(XW(t)),JW=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=ae.from(e).toNumber();return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(ae.isBigNumber(e)){const r=e.toNumber();return t.find(n=>n.chainId===r)}else return}},XW=t=>{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},Kg=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",P9=t=>Kg("https://${network}-indexer.sequence.app",{network:t}),ZW=t=>Kg("https://${network}-relayer.sequence.app",{network:t}),eG=t=>Kg("https://nodes.sequence.app/${network}",{network:t});function DE(t){return JW(tG,t)}const bt=t=>{const e=eG(t);return{rpcUrl:e,relayer:{url:ZW(t),provider:{url:e}},indexerUrl:P9(t)}},tG=YW([rt({},it[X.POLYGON],bt("polygon"),{isDefaultChain:!0,isAuthChain:!0}),rt({},it[X.MAINNET],bt("mainnet")),rt({},it[X.BSC],bt("bsc")),rt({},it[X.AVALANCHE],bt("avalanche")),rt({},it[X.ARBITRUM],bt("arbitrum")),rt({},it[X.ARBITRUM_NOVA],bt("arbitrum-nova")),rt({},it[X.OPTIMISM],bt("optimism")),rt({},it[X.OPTIMISM_SEPOLIA],bt("optimism-sepolia")),rt({},it[X.POLYGON_ZKEVM],bt("polygon-zkevm")),rt({},it[X.GNOSIS],bt("gnosis")),rt({},it[X.RINKEBY],bt("rinkeby"),{disabled:!0}),rt({},it[X.GOERLI],bt("goerli"),{disabled:!0}),rt({},it[X.SEPOLIA],bt("sepolia")),rt({},it[X.POLYGON_MUMBAI],bt("mumbai"),{disabled:!0}),rt({},it[X.POLYGON_AMOY],bt("amoy")),rt({},it[X.BSC_TESTNET],bt("bsc-testnet")),rt({},it[X.ARBITRUM_SEPOLIA],bt("arbitrum-sepolia")),rt({},it[X.BASE],bt("base")),rt({},it[X.BASE_SEPOLIA],bt("base-sepolia")),rt({},it[X.HOMEVERSE],bt("homeverse")),rt({},it[X.HOMEVERSE_TESTNET],bt("homeverse-testnet")),rt({},it[X.XAI],bt("xai")),rt({},it[X.XAI_SEPOLIA],bt("xai-sepolia")),rt({},it[X.AVALANCHE_TESTNET],bt("avalanche-testnet")),rt({},it[X.ASTAR_ZKEVM],bt("astar-zkevm")),rt({},it[X.ASTAR_ZKYOTO],bt("astar-zkyoto")),rt({},it[X.XR_SEPOLIA],bt("xr-sepolia")),rt({},it[X.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),rt({},it[X.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})]),LE=[..."🐶🐱🐭🐹🐰🦊🐻🐼🐨🐯🦁🐮🐷🐽🐸🐵🙈🙉🙊🐒🐔🐧🐦🐤🐣🐥🦆🦅🦉🦇🐺🐗🐴🦄🐝🐛🦋🐌🐞🐜🦟🦗🕷🕸🦂🐢🐍🦎🦖🦕🐙🦑🦐🦞🦀🐡🐠🐟🐬🐳🐋🦈🐊🐅🐆🦓🦍🦧🐘🦛🦏🐪🐫🦒🦘🐃🐂🐄🐎🐖🐏🐑🦙🐐🦌🐕🐩🦮🐈🐓🦃🦚🦜🦢🦩🕊🐇🦝🦨🦡🦦🦥🐁🐀🐿🦔🐾🐉🐲🌵🎄🌲🌳🌴🌱🌿🍀🎍🎋🍃👣🍂🍁🍄🐚🌾💐🌷🌹🥀🌺🌸🌼🌻🌞🌝🍏🍎🍐🍊🍋🍌🍉🍇🍓🍈🥭🍍🥥🥝🍅🥑🥦🥬🥒🌶🌽🥕🧄🧅🥔🍠🥐🥯🍞🥖🥨🧀🥚🍳🧈🥞🧇🥓🥩🍗🍖🦴🌭🍔🍟🍕🥪🥙🧆🌮🌯🥗🥘🥫🍝🍜🍲🍛🍣🍱🥟🦪🍤🍙🍚🍘🍥🥠🥮🍢🍡🍧🍨🍦🥧🧁🍰🎂🍮🍭🍬🍫🍿🍩🍪🌰🥜👀👂👃👄👅👆👇👈👉👊👋👌👍👎👏👐👑👒👓🎯🎰🎱🎲🎳👾👯👺👻👽🏂🏃🏄"];function rv(){const e=ip.en,r=LE[Math.floor(Math.random()*LE.length)],n=e.getWord(Math.floor(Math.random()*2048)),i=e.getWord(Math.floor(Math.random()*2048));return`${r} ${n} ${i}`}function rG({onSuccess:t}){const[e,r]=p.useState(""),[n,i]=p.useState(),[s,o]=p.useState(!1),[a,l]=p.useState("");return{inProgress:s||!!a,loading:s,error:n,initiateAuth:async u=>{o(!0);try{const{instance:d}=await st.email.initiateAuth({email:u});l(d),r(u)}catch(d){console.error(d),i(d.message||"Unknown error")}finally{o(!1)}},sendChallengeAnswer:a?async u=>{o(!0);try{const d=await st.getSessionHash(),{idToken:v}=await st.email.finalizeAuth({instance:a,answer:u,email:e,sessionHash:d});t(v)}catch(d){i(d.message||"Unknown error")}finally{o(!1)}}:void 0}}function nG(){const[t,e]=p.useState(""),[r,n]=p.useState(void 0);return p.useEffect(()=>{const i=async()=>{try{e(await st.getSessionHash())}catch(s){console.error(s),n(s)}};return i(),st.onSessionStateChanged(i)},[e,n]),{sessionHash:t,error:r,loading:!!t}}function iG(){var P;const{sessionHash:t}=nG(),[e,r]=p.useState(""),n=p.useRef(null),i=(P=n.current)==null?void 0:P.validity.valid,[s,o]=p.useState(!1),[a,l]=p.useState([]),[c,f]=p.useState(!1),{theme:u,setTheme:d}=XS(),{inProgress:v,loading:g,initiateAuth:y,sendChallengeAnswer:w}=rG({onSuccess:async _=>{f(!0);const D=await st.signIn({idToken:_},rv());console.log(`Wallet address: ${D}`),Uo.navigate("/")}});p.useEffect(()=>{(async()=>await st.isSignedIn()&&Uo.navigate("/"))()},[]);const x=async _=>{const D=await st.signIn({idToken:_.credential},rv());console.log(`Wallet address: ${D}`),Uo.navigate("/")},b="https://"+window.location.host+(window.location.host.includes("github.io")?"/demo-waas-auth":""),S=async _=>{const D=await st.signIn({idToken:_.authorization.id_token},rv());console.log(`Wallet address: ${D}`),Uo.navigate("/")};return $.jsxs(re,{marginY:"0",marginX:"auto",paddingX:"6",style:{maxWidth:"720px",marginTop:"80px",marginBottom:"80px"},children:[$.jsx(re,{marginBottom:"16",children:$.jsx(NC,{})}),$.jsx(re,{children:$.jsx(pr,{variant:"primary",label:"Change theme",onClick:()=>d(u==="dark"?"light":"dark")})}),$.jsx(re,{children:$.jsx(Se,{variant:"large",color:"text100",fontWeight:"bold",children:"Email Login"})}),w?$.jsxs(re,{flexDirection:"column",children:[$.jsx(re,{marginTop:"6",children:$.jsx(Se,{marginTop:"5",variant:"normal",color:"text80",children:"Enter code received in email."})}),$.jsx(re,{marginTop:"4",children:$.jsx(OC,{value:a,digits:6,onChange:l})}),$.jsx(re,{gap:"2",marginY:"4",children:g||c?$.jsx(zi,{}):$.jsx(pr,{variant:"primary",disabled:a.includes(""),label:"Verify",onClick:()=>w(a.join("")),"data-id":"verifyButton"})})]}):$.jsxs(re,{marginTop:"5",marginBottom:"4",children:[$.jsxs(Se,{variant:"normal",color:"text80",children:["Enter your email to recieve a code to login and create your wallet. ",$.jsx("br",{}),"Please check your spam folder if you don't see it in your inbox."]}),$.jsxs(re,{marginTop:"6",children:[$.jsx(Pr,{name:"email",type:"email",onChange:_=>{r(_.target.value)},ref:n,onKeyDown:_=>{e&&_.key==="Enter"&&y(e)},onBlur:()=>o(!!e&&!i),value:e,placeholder:"hello@example.com",required:!0,"data-id":"loginEmail"}),s&&$.jsx(Se,{as:"p",variant:"small",color:"negative",marginY:"2",children:"Invalid email address"})]}),$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:g?$.jsx(zi,{}):$.jsx(pr,{variant:"primary",disabled:!i,label:"Continue",onClick:()=>y(e),"data-id":"continueButton"})})]}),$.jsx("hr",{}),!v&&!!t&&$.jsxs($.Fragment,{children:[$.jsx(re,{children:$.jsx(Se,{variant:"large",color:"text100",fontWeight:"bold",children:"Social Login"})}),$.jsx(yU,{onSuccess:x,shape:"circle",width:230,nonce:t},t),$.jsx(LU,{authOptions:{clientId:"com.horizon.sequence.waas",scope:"openid email",redirectURI:b,usePopup:!0,nonce:t},onError:_=>console.error(_),onSuccess:S,uiType:"dark"},t)]})]})}function sG(t){var e="";return r(t),e;function r(i){if(i===null||typeof i!="object"||i.toJSON!=null)e+=JSON.stringify(i);else if(Array.isArray(i)){e+="[";var s=!1;i.forEach(function(a){s&&(e+=","),s=!0,a===void 0&&(a=null),r(a)}),e+="]"}else{e+="{";var o=Object.keys(i).filter(function(a){return i[a]!==void 0}).sort();o.forEach(function(a,l){return n(i,a,l)}),e+="}"}}function n(i,s,o){o>0&&(e+=","),e+=JSON.stringify(s),e+=":",r(i[s])}}const oG=(t,e)=>e.some(r=>t instanceof r);let jE,BE;function aG(){return jE||(jE=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function lG(){return BE||(BE=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const R9=new WeakMap,fp=new WeakMap,T9=new WeakMap,nv=new WeakMap,Qg=new WeakMap;function cG(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(no(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&R9.set(r,t)}).catch(()=>{}),Qg.set(e,t),e}function fG(t){if(fp.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});fp.set(t,e)}let up={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return fp.get(t);if(e==="objectStoreNames")return t.objectStoreNames||T9.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return no(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function uG(t){up=t(up)}function dG(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(iv(this),e,...r);return T9.set(n,e.sort?e.sort():[e]),no(n)}:lG().includes(t)?function(...e){return t.apply(iv(this),e),no(R9.get(this))}:function(...e){return no(t.apply(iv(this),e))}}function hG(t){return typeof t=="function"?dG(t):(t instanceof IDBTransaction&&fG(t),oG(t,aG())?new Proxy(t,up):t)}function no(t){if(t instanceof IDBRequest)return cG(t);if(nv.has(t))return nv.get(t);const e=hG(t);return e!==t&&(nv.set(t,e),Qg.set(e,t)),e}const iv=t=>Qg.get(t);function vG(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=no(o);return n&&o.addEventListener("upgradeneeded",l=>{n(no(o.result),l.oldVersion,l.newVersion,no(o.transaction),l)}),r&&o.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const yG=["get","getKey","getAll","getAllKeys","count"],pG=["put","add","delete","clear"],sv=new Map;function $E(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(sv.get(e))return sv.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=pG.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||yG.includes(r)))return;const s=async function(o,...a){const l=this.transaction(o,i?"readwrite":"readonly");let c=l.store;return n&&(c=c.index(a.shift())),(await Promise.all([c[r](...a),i&&l.done]))[0]};return sv.set(e,s),s}uG(t=>({...t,get:(e,r,n)=>$E(e,r)||t.get(e,r,n),has:(e,r)=>!!$E(e,r)||t.has(e,r)}));class Nc extends Error{}Nc.prototype.name="InvalidTokenError";function mG(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function gG(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return mG(e)}catch{return atob(e)}}function xG(t,e){if(typeof t!="string")throw new Nc("Invalid token specified: must be a string");e||(e={});const r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new Nc(`Invalid token specified: missing part #${r+1}`);let i;try{i=gG(n)}catch(s){throw new Nc(`Invalid token specified: invalid base64 for part #${r+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new Nc(`Invalid token specified: invalid json for part #${r+1} (${s.message})`)}}const bG=t=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},wG=t=>({httpHandler:t.httpHandler()});var FE;(function(t){t.HEADER="header",t.QUERY="query"})(FE||(FE={}));var UE;(function(t){t.HEADER="header",t.QUERY="query"})(UE||(UE={}));var jf;(function(t){t.HTTP="http",t.HTTPS="https"})(jf||(jf={}));var Sh;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Sh||(Sh={}));var zE;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(zE||(zE={}));const dp="__smithy_context";var VE;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(VE||(VE={}));var qE;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(qE||(qE={}));class Ki{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static isInstance(e){if(!e)return!1;const r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){const e=new Ki({...this,headers:{...this.headers}});return e.query&&(e.query=EG(e.query)),e}}function EG(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}class Ch{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}const AG=t=>e=>async r=>{if(!Ki.isInstance(r.request))return e(r);const{request:n}=r,{handlerProtocol:i=""}=t.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let s=n.hostname;n.port!=null&&(s+=`:${n.port}`),n.headers.host=s}return e(r)},SG={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},CG=t=>({applyToStack:e=>{e.add(AG(t),SG)}}),kG=()=>(t,e)=>async r=>{var n,i;try{const s=await t(r),{clientName:o,commandName:a,logger:l,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:f,overrideOutputFilterSensitiveLog:u}=c,d=f??e.inputFilterSensitiveLog,v=u??e.outputFilterSensitiveLog,{$metadata:g,...y}=s.output;return(n=l==null?void 0:l.info)==null||n.call(l,{clientName:o,commandName:a,input:d(r.input),output:v(y),metadata:g}),s}catch(s){const{clientName:o,commandName:a,logger:l,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:f}=c,u=f??e.inputFilterSensitiveLog;throw(i=l==null?void 0:l.error)==null||i.call(l,{clientName:o,commandName:a,input:u(r.input),error:s,metadata:s.$metadata}),s}},PG={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},RG=t=>({applyToStack:e=>{e.add(kG(),PG)}}),HE="X-Amzn-Trace-Id",TG="AWS_LAMBDA_FUNCTION_NAME",MG="_X_AMZN_TRACE_ID",IG=t=>e=>async r=>{const{request:n}=r;if(!Ki.isInstance(n)||t.runtime!=="node"||n.headers.hasOwnProperty(HE))return e(r);const i=process.env[TG],s=process.env[MG],o=a=>typeof a=="string"&&a.length>0;return o(i)&&o(s)&&(n.headers[HE]=s),e({...r,request:n})},_G={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},OG=t=>({applyToStack:e=>{e.add(IG(t),_G)}});function NG(t){return{...t,customUserAgent:typeof t.customUserAgent=="string"?[[t.customUserAgent]]:t.customUserAgent}}const DG=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),M9=t=>DG.test(t)||t.startsWith("[")&&t.endsWith("]"),LG=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Yg=(t,e=!1)=>{if(!e)return LG.test(t);const r=t.split(".");for(const n of r)if(!Yg(n))return!1;return!0},kh={},Bf="endpoints";function yo(t){return typeof t!="object"||t==null?t:"ref"in t?`$${yo(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(yo).join(", ")})`:JSON.stringify(t,null,2)}class Pn extends Error{constructor(e){super(e),this.name="EndpointError"}}const jG=(t,e)=>t===e,BG=t=>{const e=t.split("."),r=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Pn(`Path: '${t}' does not end with ']'`);const s=n.slice(i+1,-1);if(Number.isNaN(parseInt(s)))throw new Pn(`Invalid array index: '${s}' in path: '${t}'`);i!==0&&r.push(n.slice(0,i)),r.push(s)}else r.push(n)}return r},I9=(t,e)=>BG(e).reduce((r,n)=>{if(typeof r!="object")throw new Pn(`Index '${n}' in '${e}' not found in '${JSON.stringify(t)}'`);return Array.isArray(r)?r[parseInt(n)]:r[n]},t),$G=t=>t!=null,FG=t=>!t,ov={[jf.HTTP]:80,[jf.HTTPS]:443},UG=t=>{const e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){const{hostname:d,port:v,protocol:g="",path:y="",query:w={}}=t,x=new URL(`${g}//${d}${v?`:${v}`:""}${y}`);return x.search=Object.entries(w).map(([b,S])=>`${b}=${S}`).join("&"),x}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;const r=e.href,{host:n,hostname:i,pathname:s,protocol:o,search:a}=e;if(a)return null;const l=o.slice(0,-1);if(!Object.values(jf).includes(l))return null;const c=M9(i),f=r.includes(`${n}:${ov[l]}`)||typeof t=="string"&&t.includes(`${n}:${ov[l]}`),u=`${n}${f?`:${ov[l]}`:""}`;return{scheme:l,authority:u,path:s,normalizedPath:s.endsWith("/")?s:`${s}/`,isIp:c}},zG=(t,e)=>t===e,VG=(t,e,r,n)=>e>=r||t.lengthencodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),HG={booleanEquals:jG,getAttr:I9,isSet:$G,isValidHostLabel:Yg,not:FG,parseURL:UG,stringEquals:zG,substring:VG,uriEncode:qG},_9=(t,e)=>{const r=[],n={...e.endpointParams,...e.referenceRecord};let i=0;for(;i({...e.endpointParams,...e.referenceRecord})[t],k0=(t,e,r)=>{if(typeof t=="string")return _9(t,r);if(t.fn)return O9(t,r);if(t.ref)return WG(t,r);throw new Pn(`'${e}': ${String(t)} is not a string, function or reference.`)},O9=({fn:t,argv:e},r)=>{const n=e.map(s=>["boolean","number"].includes(typeof s)?s:k0(s,"arg",r)),i=t.split(".");return i[0]in kh&&i[1]!=null?kh[i[0]][i[1]](...n):HG[t](...n)},GG=({assign:t,...e},r)=>{var i,s;if(t&&t in r.referenceRecord)throw new Pn(`'${t}' is already defined in Reference Record.`);const n=O9(e,r);return(s=(i=r.logger)==null?void 0:i.debug)==null||s.call(i,`${Bf} evaluateCondition: ${yo(e)} = ${yo(n)}`),{result:n===""?!0:!!n,...t!=null&&{toAssign:{name:t,value:n}}}},Jg=(t=[],e)=>{var n,i;const r={};for(const s of t){const{result:o,toAssign:a}=GG(s,{...e,referenceRecord:{...e.referenceRecord,...r}});if(!o)return{result:o};a&&(r[a.name]=a.value,(i=(n=e.logger)==null?void 0:n.debug)==null||i.call(n,`${Bf} assign: ${a.name} := ${yo(a.value)}`))}return{result:!0,referenceRecord:r}},KG=(t,e)=>Object.entries(t).reduce((r,[n,i])=>({...r,[n]:i.map(s=>{const o=k0(s,"Header value entry",e);if(typeof o!="string")throw new Pn(`Header '${n}' value '${o}' is not a string`);return o})}),{}),N9=(t,e)=>{if(Array.isArray(t))return t.map(r=>N9(r,e));switch(typeof t){case"string":return _9(t,e);case"object":if(t===null)throw new Pn(`Unexpected endpoint property: ${t}`);return D9(t,e);case"boolean":return t;default:throw new Pn(`Unexpected endpoint property type: ${typeof t}`)}},D9=(t,e)=>Object.entries(t).reduce((r,[n,i])=>({...r,[n]:N9(i,e)}),{}),QG=(t,e)=>{const r=k0(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(n){throw console.error(`Failed to construct URL with ${r}`,n),n}throw new Pn(`Endpoint URL must be a string, got ${typeof r}`)},YG=(t,e)=>{var f,u;const{conditions:r,endpoint:n}=t,{result:i,referenceRecord:s}=Jg(r,e);if(!i)return;const o={...e,referenceRecord:{...e.referenceRecord,...s}},{url:a,properties:l,headers:c}=n;return(u=(f=e.logger)==null?void 0:f.debug)==null||u.call(f,`${Bf} Resolving endpoint from template: ${yo(n)}`),{...c!=null&&{headers:KG(c,o)},...l!=null&&{properties:D9(l,o)},url:QG(a,o)}},JG=(t,e)=>{const{conditions:r,error:n}=t,{result:i,referenceRecord:s}=Jg(r,e);if(i)throw new Pn(k0(n,"Error",{...e,referenceRecord:{...e.referenceRecord,...s}}))},XG=(t,e)=>{const{conditions:r,rules:n}=t,{result:i,referenceRecord:s}=Jg(r,e);if(i)return L9(n,{...e,referenceRecord:{...e.referenceRecord,...s}})},L9=(t,e)=>{for(const r of t)if(r.type==="endpoint"){const n=YG(r,e);if(n)return n}else if(r.type==="error")JG(r,e);else if(r.type==="tree"){const n=XG(r,e);if(n)return n}else throw new Pn(`Unknown endpoint rule: ${r}`);throw new Pn("Rules evaluation failed")},ZG=(t,e)=>{var c,f,u,d,v;const{endpointParams:r,logger:n}=e,{parameters:i,rules:s}=t;(f=(c=e.logger)==null?void 0:c.debug)==null||f.call(c,`${Bf} Initial EndpointParams: ${yo(r)}`);const o=Object.entries(i).filter(([,g])=>g.default!=null).map(([g,y])=>[g,y.default]);if(o.length>0)for(const[g,y]of o)r[g]=r[g]??y;const a=Object.entries(i).filter(([,g])=>g.required).map(([g])=>g);for(const g of a)if(r[g]==null)throw new Pn(`Missing required parameter: '${g}'`);const l=L9(s,{endpointParams:r,logger:n,referenceRecord:{}});if((u=e.endpointParams)!=null&&u.Endpoint)try{const g=new URL(e.endpointParams.Endpoint),{protocol:y,port:w}=g;l.url.protocol=y,l.url.port=w}catch{}return(v=(d=e.logger)==null?void 0:d.debug)==null||v.call(d,`${Bf} Resolved endpoint: ${yo(l)}`),l},j9=(t,e=!1)=>{if(e){for(const r of t.split("."))if(!j9(r))return!1;return!0}return!(!Yg(t)||t.length<3||t.length>63||t!==t.toLowerCase()||M9(t))},eK=t=>{const e=t.split(":");if(e.length<6)return null;const[r,n,i,s,o,...a]=e;return r!=="arn"||n===""||i===""||a[0]===""?null:{partition:n,service:i,region:s,accountId:o,resourceId:a[0].includes("/")?a[0].split("/"):a}},tK=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],rK="1.1",nK={partitions:tK,version:rK};let iK=nK;const sK=t=>{const{partitions:e}=iK;for(const n of e){const{regions:i,outputs:s}=n;for(const[o,a]of Object.entries(i))if(o===t)return{...s,...a}}for(const n of e){const{regionRegex:i,outputs:s}=n;if(new RegExp(i).test(t))return{...s}}const r=e.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},B9={isVirtualHostableS3Bucket:j9,parseArn:eK,partition:sK};kh.aws=B9;const WE="user-agent",av="x-amz-user-agent",GE=" ",lv="/",oK=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,aK=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,KE="-",lK=t=>(e,r)=>async n=>{var u,d;const{request:i}=n;if(!Ki.isInstance(i))return e(n);const{headers:s}=i,o=((u=r==null?void 0:r.userAgent)==null?void 0:u.map(cv))||[],a=(await t.defaultUserAgentProvider()).map(cv),l=((d=t==null?void 0:t.customUserAgent)==null?void 0:d.map(cv))||[],c=[].concat([...a,...o,...l]).join(GE),f=[...a.filter(v=>v.startsWith("aws-sdk-")),...l].join(GE);return t.runtime!=="browser"?(f&&(s[av]=s[av]?`${s[WE]} ${f}`:f),s[WE]=c):s[av]=c,e({...n,request:i})},cv=t=>{var o;const e=t[0].split(lv).map(a=>a.replace(oK,KE)).join(lv),r=(o=t[1])==null?void 0:o.replace(aK,KE),n=e.indexOf(lv),i=e.substring(0,n);let s=e.substring(n+1);return i==="api"&&(s=s.toLowerCase()),[i,s,r].filter(a=>a&&a.length>0).reduce((a,l,c)=>{switch(c){case 0:return l;case 1:return`${a}/${l}`;default:return`${a}#${l}`}},"")},cK={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},fK=t=>({applyToStack:e=>{e.add(lK(t),cK)}});var QE;(function(t){t.ENV="env",t.CONFIG="shared config entry"})(QE||(QE={}));const uK=!1,dK=!1,P0=t=>t[dp]||(t[dp]={}),io=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},$9=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),YE=t=>$9(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,hK=t=>{const{region:e,useFipsEndpoint:r}=t;if(!e)throw new Error("Region is missing");return{...t,region:async()=>{if(typeof e=="string")return YE(e);const n=await e();return YE(n)},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return $9(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}}};function vK(t){const e=new Map;for(const r of t)e.set(r.schemeId,r);return e}const yK=(t,e)=>(r,n)=>async i=>{var c;const s=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,n,i.input)),o=vK(t.httpAuthSchemes),a=P0(n),l=[];for(const f of s){const u=o.get(f.schemeId);if(!u){l.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}const d=u.identityProvider(await e.identityProviderConfigProvider(t));if(!d){l.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:v={},signingProperties:g={}}=((c=f.propertiesExtractor)==null?void 0:c.call(f,t,n))||{};f.identityProperties=Object.assign(f.identityProperties||{},v),f.signingProperties=Object.assign(f.signingProperties||{},g),a.selectedHttpAuthScheme={httpAuthOption:f,identity:await d(f.identityProperties),signer:u.signer};break}if(!a.selectedHttpAuthScheme)throw new Error(l.join(` +`));return r(i)},pK=async t=>{const e=(t==null?void 0:t.Bucket)||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),wK(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!bK(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},mK=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,gK=/(\d+\.){3}\d+/,xK=/\.\./,bK=t=>mK.test(t)&&!gK.test(t)&&!xK.test(t),wK=t=>{const[e,r,n,,,i]=t.split(":"),s=e==="arn"&&t.split(":").length>=6,o=!!(s&&r&&n&&i);if(s&&!o)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return o},EK=(t,e,r)=>{const n=async()=>{const i=r[t]??r[e];return typeof i=="function"?i():i};return t==="credentialScope"||e==="CredentialScope"?async()=>{const i=typeof r.credentials=="function"?await r.credentials():r.credentials;return(i==null?void 0:i.credentialScope)??(i==null?void 0:i.CredentialScope)}:t==="endpoint"||e==="endpoint"?async()=>{const i=await n();if(i&&typeof i=="object"){if("url"in i)return i.url.href;if("hostname"in i){const{protocol:s,hostname:o,port:a,path:l}=i;return`${s}//${o}${a?":"+a:""}${l}`}}return i}:n},AK=async t=>{};function SK(t){const e={};if(t=t.replace(/^\?/,""),t)for(const r of t.split("&")){let[n,i=null]=r.split("=");n=decodeURIComponent(n),i&&(i=decodeURIComponent(i)),n in e?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i}return e}const Ph=t=>{if(typeof t=="string")return Ph(new URL(t));const{hostname:e,pathname:r,port:n,protocol:i,search:s}=t;let o;return s&&(o=SK(s)),{hostname:e,port:n?parseInt(n):void 0,protocol:i,path:r,query:o}},F9=t=>typeof t=="object"?"url"in t?Ph(t.url):t:Ph(t),CK=async(t,e,r,n)=>{if(!r.endpoint){const o=await AK(r.serviceId||"");o&&(r.endpoint=()=>Promise.resolve(F9(o)))}const i=await kK(t,e,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(i,n)},kK=async(t,e,r)=>{var s;const n={},i=((s=e==null?void 0:e.getEndpointParameterInstructions)==null?void 0:s.call(e))||{};for(const[o,a]of Object.entries(i))switch(a.type){case"staticContextParams":n[o]=a.value;break;case"contextParams":n[o]=t[a.name];break;case"clientContextParams":case"builtInParams":n[o]=await EK(a.name,o,r)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(n,r),String(r.serviceId).toLowerCase()==="s3"&&await pK(n),n},PK=({config:t,instructions:e})=>(r,n)=>async i=>{var a,l,c;const s=await CK(i.input,{getEndpointParameterInstructions(){return e}},{...t},n);n.endpointV2=s,n.authSchemes=(a=s.properties)==null?void 0:a.authSchemes;const o=(l=n.authSchemes)==null?void 0:l[0];if(o){n.signing_region=o.signingRegion,n.signing_service=o.signingName;const f=P0(n),u=(c=f==null?void 0:f.selectedHttpAuthScheme)==null?void 0:c.httpAuthOption;u&&(u.signingProperties=Object.assign(u.signingProperties||{},{signing_region:o.signingRegion,signingRegion:o.signingRegion,signing_service:o.signingName,signingName:o.signingName,signingRegionSet:o.signingRegionSet},o.properties))}return r({...i})},RK=(t,e)=>r=>async n=>{const{response:i}=await r(n);try{const s=await e(i,t);return{response:i,output:s}}catch(s){if(Object.defineProperty(s,"$response",{value:i}),!("$metadata"in s)){const o="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";s.message+=` + `+o,typeof s.$responseBodyText<"u"&&s.$response&&(s.$response.body=s.$responseBodyText)}throw s}},TK=(t,e)=>(r,n)=>async i=>{var a;const s=(a=n.endpointV2)!=null&&a.url&&t.urlParser?async()=>t.urlParser(n.endpointV2.url):t.endpoint;if(!s)throw new Error("No valid endpoint provider available.");const o=await e(i.input,{...t,endpoint:s});return r({...i,request:o})},MK={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Xg={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Zg(t,e,r){return{applyToStack:n=>{n.add(RK(t,r),MK),n.add(TK(t,e),Xg)}}}const U9={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Xg.name},ex=(t,e)=>({applyToStack:r=>{r.addRelativeTo(PK({config:t,instructions:e}),U9)}}),IK=t=>{const e=t.tls??!0,{endpoint:r}=t,n=r!=null?async()=>F9(await io(r)()):void 0;return{...t,endpoint:n,tls:e,isCustomEndpoint:!!r,useDualstackEndpoint:io(t.useDualstackEndpoint??!1),useFipsEndpoint:io(t.useFipsEndpoint??!1)}},_K={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:U9.name},OK=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(yK(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),_K)}});Xg.name;const NK=t=>e=>{throw e},DK=(t,e)=>{},LK=t=>(e,r)=>async n=>{if(!Ki.isInstance(n.request))return e(n);const s=P0(r).selectedHttpAuthScheme;if(!s)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:o={}},identity:a,signer:l}=s,c=await e({...n,request:await l.sign(n.request,a,o)}).catch((l.errorHandler||NK)(o));return(l.successHandler||DK)(c.response,o),c};var Sl;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(Sl||(Sl={}));const Rh=3,jK=Sl.STANDARD,BK=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],$K=["TimeoutError","RequestTimeout","RequestTimeoutException"],FK=[500,502,503,504],UK=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],zK=t=>{var e;return(e=t.$metadata)==null?void 0:e.clockSkewCorrected},z9=t=>{var e,r;return((e=t.$metadata)==null?void 0:e.httpStatusCode)===429||BK.includes(t.name)||((r=t.$retryable)==null?void 0:r.throttling)==!0},V9=t=>{var e;return zK(t)||$K.includes(t.name)||UK.includes((t==null?void 0:t.code)||"")||FK.includes(((e=t.$metadata)==null?void 0:e.httpStatusCode)||0)},VK=t=>{var e;if(((e=t.$metadata)==null?void 0:e.httpStatusCode)!==void 0){const r=t.$metadata.httpStatusCode;return 500<=r&&r<=599&&!V9(t)}return!1};class qK{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(e==null?void 0:e.beta)??.7,this.minCapacity=(e==null?void 0:e.minCapacity)??1,this.minFillRate=(e==null?void 0:e.minFillRate)??.5,this.scaleConstant=(e==null?void 0:e.scaleConstant)??.4,this.smooth=(e==null?void 0:e.smooth)??.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const r=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(n=>setTimeout(n,r))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const r=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=e}updateClientSendingRate(e){let r;if(this.updateMeasuredRate(),z9(e)){const i=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}}const hp=100,q9=20*1e3,HK=500,JE=500,WK=5,GK=10,KK=1,QK="amz-sdk-invocation-id",YK="amz-sdk-request",JK=()=>{let t=hp;return{computeNextBackoffDelay:n=>Math.floor(Math.min(q9,Math.random()*2**n*t)),setDelayBase:n=>{t=n}}},XE=({retryDelay:t,retryCount:e,retryCost:r})=>({getRetryCount:()=>e,getRetryDelay:()=>Math.min(q9,t),getRetryCost:()=>r});class H9{constructor(e){this.maxAttempts=e,this.mode=Sl.STANDARD,this.capacity=JE,this.retryBackoffStrategy=JK(),this.maxAttemptsProvider=typeof e=="function"?e:async()=>e}async acquireInitialRetryToken(e){return XE({retryDelay:hp,retryCount:0})}async refreshRetryTokenForRetry(e,r){const n=await this.getMaxAttempts();if(this.shouldRetry(e,r,n)){const i=r.errorType;this.retryBackoffStrategy.setDelayBase(i==="THROTTLING"?HK:hp);const s=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),o=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,s):s,a=this.getCapacityCost(i);return this.capacity-=a,XE({retryDelay:o,retryCount:e.getRetryCount()+1,retryCost:a})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(JE,this.capacity+(e.getRetryCost()??KK))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Rh}`),Rh}}shouldRetry(e,r,n){return e.getRetryCount()+1=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(e){return e==="TRANSIENT"?GK:WK}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class XK{constructor(e,r){this.maxAttemptsProvider=e,this.mode=Sl.ADAPTIVE;const{rateLimiter:n}=r??{};this.rateLimiter=n??new qK,this.standardRetryStrategy=new H9(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(e,r)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}let qu;const ZK=new Uint8Array(16);function eQ(){if(!qu&&(qu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qu(ZK)}const Sr=[];for(let t=0;t<256;++t)Sr.push((t+256).toString(16).slice(1));function tQ(t,e=0){return Sr[t[e+0]]+Sr[t[e+1]]+Sr[t[e+2]]+Sr[t[e+3]]+"-"+Sr[t[e+4]]+Sr[t[e+5]]+"-"+Sr[t[e+6]]+Sr[t[e+7]]+"-"+Sr[t[e+8]]+Sr[t[e+9]]+"-"+Sr[t[e+10]]+Sr[t[e+11]]+Sr[t[e+12]]+Sr[t[e+13]]+Sr[t[e+14]]+Sr[t[e+15]]}const rQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ZE={randomUUID:rQ};function nQ(t,e,r){if(ZE.randomUUID&&!e&&!t)return ZE.randomUUID();t=t||{};const n=t.random||(t.rng||eQ)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return tQ(n)}const iQ=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`),sQ=t=>{const{retryStrategy:e}=t,r=io(t.maxAttempts??Rh);return{...t,maxAttempts:r,retryStrategy:async()=>e||(await io(t.retryMode)()===Sl.ADAPTIVE?new XK(r):new H9(r))}};class W9{trace(){}debug(){}info(){}warn(){}error(){}}const ko=(t,e)=>{const r=[];if(t&&r.push(t),e)for(const n of e)r.push(n);return r},_s=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Th=()=>{let t=[],e=[],r=!1;const n=new Set,i=u=>u.sort((d,v)=>e4[v.step]-e4[d.step]||t4[v.priority||"normal"]-t4[d.priority||"normal"]),s=u=>{let d=!1;const v=g=>{const y=ko(g.name,g.aliases);if(y.includes(u)){d=!0;for(const w of y)n.delete(w);return!1}return!0};return t=t.filter(v),e=e.filter(v),d},o=u=>{let d=!1;const v=g=>{if(g.middleware===u){d=!0;for(const y of ko(g.name,g.aliases))n.delete(y);return!1}return!0};return t=t.filter(v),e=e.filter(v),d},a=u=>{var d;return t.forEach(v=>{u.add(v.middleware,{...v})}),e.forEach(v=>{u.addRelativeTo(v.middleware,{...v})}),(d=u.identifyOnResolve)==null||d.call(u,f.identifyOnResolve()),u},l=u=>{const d=[];return u.before.forEach(v=>{v.before.length===0&&v.after.length===0?d.push(v):d.push(...l(v))}),d.push(u),u.after.reverse().forEach(v=>{v.before.length===0&&v.after.length===0?d.push(v):d.push(...l(v))}),d},c=(u=!1)=>{const d=[],v=[],g={};return t.forEach(w=>{const x={...w,before:[],after:[]};for(const b of ko(x.name,x.aliases))g[b]=x;d.push(x)}),e.forEach(w=>{const x={...w,before:[],after:[]};for(const b of ko(x.name,x.aliases))g[b]=x;v.push(x)}),v.forEach(w=>{if(w.toMiddleware){const x=g[w.toMiddleware];if(x===void 0){if(u)return;throw new Error(`${w.toMiddleware} is not found when adding ${_s(w.name,w.aliases)} middleware ${w.relation} ${w.toMiddleware}`)}w.relation==="after"&&x.after.push(w),w.relation==="before"&&x.before.push(w)}}),i(d).map(l).reduce((w,x)=>(w.push(...x),w),[])},f={add:(u,d={})=>{const{name:v,override:g,aliases:y}=d,w={step:"initialize",priority:"normal",middleware:u,...d},x=ko(v,y);if(x.length>0){if(x.some(b=>n.has(b))){if(!g)throw new Error(`Duplicate middleware name '${_s(v,y)}'`);for(const b of x){const S=t.findIndex(_=>{var D;return _.name===b||((D=_.aliases)==null?void 0:D.some(M=>M===b))});if(S===-1)continue;const P=t[S];if(P.step!==w.step||w.priority!==P.priority)throw new Error(`"${_s(P.name,P.aliases)}" middleware with ${P.priority} priority in ${P.step} step cannot be overridden by "${_s(v,y)}" middleware with ${w.priority} priority in ${w.step} step.`);t.splice(S,1)}}for(const b of x)n.add(b)}t.push(w)},addRelativeTo:(u,d)=>{const{name:v,override:g,aliases:y}=d,w={middleware:u,...d},x=ko(v,y);if(x.length>0){if(x.some(b=>n.has(b))){if(!g)throw new Error(`Duplicate middleware name '${_s(v,y)}'`);for(const b of x){const S=e.findIndex(_=>{var D;return _.name===b||((D=_.aliases)==null?void 0:D.some(M=>M===b))});if(S===-1)continue;const P=e[S];if(P.toMiddleware!==w.toMiddleware||P.relation!==w.relation)throw new Error(`"${_s(P.name,P.aliases)}" middleware ${P.relation} "${P.toMiddleware}" middleware cannot be overridden by "${_s(v,y)}" middleware ${w.relation} "${w.toMiddleware}" middleware.`);e.splice(S,1)}}for(const b of x)n.add(b)}e.push(w)},clone:()=>a(Th()),use:u=>{u.applyToStack(f)},remove:u=>typeof u=="string"?s(u):o(u),removeByTag:u=>{let d=!1;const v=g=>{const{tags:y,name:w,aliases:x}=g;if(y&&y.includes(u)){const b=ko(w,x);for(const S of b)n.delete(S);return d=!0,!1}return!0};return t=t.filter(v),e=e.filter(v),d},concat:u=>{var v;const d=a(Th());return d.use(u),d.identifyOnResolve(r||d.identifyOnResolve()||(((v=u.identifyOnResolve)==null?void 0:v.call(u))??!1)),d},applyToStack:a,identify:()=>c(!0).map(u=>{const d=u.step??u.relation+" "+u.toMiddleware;return _s(u.name,u.aliases)+" - "+d}),identifyOnResolve(u){return typeof u=="boolean"&&(r=u),r},resolve:(u,d)=>{for(const v of c().map(g=>g.middleware).reverse())u=v(u,d);return r&&console.log(f.identify()),u}};return f},e4={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},t4={high:3,normal:2,low:1};class oQ{constructor(e){this.middlewareStack=Th(),this.config=e}send(e,r,n){const i=typeof r!="function"?r:void 0,s=typeof r=="function"?r:n,o=e.resolveMiddleware(this.middlewareStack,this.config,i);if(s)o(e).then(a=>s(null,a.output),a=>s(a)).catch(()=>{});else return o(e).then(a=>a.output)}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}const po={},Vl=new Array(64);for(let t=0,e="A".charCodeAt(0),r="Z".charCodeAt(0);t+e<=r;t++){const n=String.fromCharCode(t+e);po[n]=t,Vl[t]=n}for(let t=0,e="a".charCodeAt(0),r="z".charCodeAt(0);t+e<=r;t++){const n=String.fromCharCode(t+e),i=t+26;po[n]=i,Vl[i]=n}for(let t=0;t<10;t++){po[t.toString(10)]=t+52;const e=t.toString(10),r=t+52;po[e]=r,Vl[r]=e}po["+"]=62;Vl[62]="+";po["/"]=63;Vl[63]="/";const ol=6,Zc=8,aQ=63,tx=t=>{let e=t.length/4*3;t.slice(-2)==="=="?e-=2:t.slice(-1)==="="&&e--;const r=new ArrayBuffer(e),n=new DataView(r);for(let i=0;i>=ol;const a=i/4*3;s>>=o%Zc;const l=Math.floor(o/Zc);for(let c=0;c>f)}}return new Uint8Array(r)},Cl=t=>new TextEncoder().encode(t),ef=t=>typeof t=="string"?Cl(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),G9=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)};function K9(t){let e;typeof t=="string"?e=Cl(t):e=t;const r=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let s=0;s>f]}i+="==".slice(0,4-l)}return i}function lQ(t,e="utf-8"){return e==="base64"?K9(t):G9(t)}function cQ(t,e){return e==="base64"?Ko.mutate(tx(t)):Ko.mutate(Cl(t))}class Ko extends Uint8Array{static fromString(e,r="utf-8"){switch(typeof e){case"string":return cQ(e,r);default:throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}}static mutate(e){return Object.setPrototypeOf(e,Ko.prototype),e}transformToString(e="utf-8"){return lQ(this,e)}}const Hs=t=>encodeURIComponent(t).replace(/[!'()*]/g,fQ),fQ=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function uQ(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=Hs(r),Array.isArray(n))for(let i=0,s=n.length;i{t&&setTimeout(()=>{const n=new Error(`Request did not complete within ${t} ms`);n.name="TimeoutError",r(n)},t)})}const hQ={supported:typeof Request<"u"&&"keepalive"in new Request("https://[::1]")};class rx{static create(e){return typeof(e==null?void 0:e.handle)=="function"?e:new rx(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(r=>r||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config))}destroy(){}async handle(e,{abortSignal:r}={}){this.config||(this.config=await this.configProvider);const n=this.config.requestTimeout,i=this.config.keepAlive===!0;if(r!=null&&r.aborted){const y=new Error("Request aborted");return y.name="AbortError",Promise.reject(y)}let s=e.path;const o=uQ(e.query||{});o&&(s+=`?${o}`),e.fragment&&(s+=`#${e.fragment}`);let a="";if(e.username!=null||e.password!=null){const y=e.username??"",w=e.password??"";a=`${y}:${w}@`}const{port:l,method:c}=e,f=`${e.protocol}//${a}${e.hostname}${l?`:${l}`:""}${s}`,u=c==="GET"||c==="HEAD"?void 0:e.body,d={body:u,headers:new Headers(e.headers),method:c};u&&(d.duplex="half"),typeof AbortController<"u"&&(d.signal=r),hQ.supported&&(d.keepalive=i);const v=new Request(f,d),g=[fetch(v).then(y=>{const w=y.headers,x={};for(const S of w.entries())x[S[0]]=S[1];return y.body!=null?{response:new Ch({headers:x,reason:y.statusText,statusCode:y.status,body:y.body})}:y.blob().then(S=>({response:new Ch({headers:x,reason:y.statusText,statusCode:y.status,body:S})}))}),dQ(n)];return r&&g.push(new Promise((y,w)=>{r.onabort=()=>{const x=new Error("Request aborted");x.name="AbortError",w(x)}})),Promise.race(g)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=r,n))}httpHandlerConfigs(){return this.config??{}}}const vQ=t=>typeof Blob=="function"&&t instanceof Blob?yQ(t):pQ(t);async function yQ(t){const e=await mQ(t),r=tx(e);return new Uint8Array(r)}async function pQ(t){const e=[],r=t.getReader();let n=!1,i=0;for(;!n;){const{done:a,value:l}=await r.read();l&&(e.push(l),i+=l.length),n=a}const s=new Uint8Array(i);let o=0;for(const a of e)s.set(a,o),o+=a.length;return s}function mQ(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const i=n.result??"",s=i.indexOf(","),o=s>-1?s+1:i.length;e(i.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}const Q9={},vp={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),Q9[t]=e,vp[e]=t}function gQ(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let r=0;r{if(t instanceof Uint8Array)return Ko.mutate(t);if(!t)return Ko.mutate(new Uint8Array);const r=e.streamCollector(t);return Ko.mutate(await r)};class R0{constructor(){this.middlewareStack=Th()}static classBuilder(){return new bQ}resolveMiddlewareWithContext(e,r,n,{middlewareFn:i,clientName:s,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:l,smithyContext:c,additionalContext:f,CommandCtor:u}){for(const w of i.bind(this)(u,e,r,n))this.middlewareStack.use(w);const d=e.concat(this.middlewareStack),{logger:v}=r,g={logger:v,clientName:s,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:l,[dp]:{...c},...f},{requestHandler:y}=r;return d.resolve(w=>y.handle(w.request,n||{}),g)}}class bQ{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=e=>e,this._outputFilterSensitiveLog=e=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,r,n={}){return this._smithyContext={service:e,operation:r,...n},this}c(e={}){return this._additionalContext=e,this}n(e,r){return this._clientName=e,this._commandName=r,this}f(e=n=>n,r=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=r,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){const e=this;let r;return r=class extends R0{static getEndpointParameterInstructions(){return e._ep}constructor(...[n]){super(),this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=n??{},e._init(this)}resolveMiddleware(n,i,s){return this.resolveMiddlewareWithContext(n,i,s,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}const wr="***SensitiveInformation***";class nx extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,nx.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const Ne=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,i])=>{(t[n]==null||t[n]==="")&&(t[n]=i)});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t},wQ=({output:t,parsedBody:e,exceptionCtor:r,errorCode:n})=>{const i=AQ(t),s=i.httpStatusCode?i.httpStatusCode+"":void 0,o=new r({name:(e==null?void 0:e.code)||(e==null?void 0:e.Code)||n||s||"UnknownError",$fault:"client",$metadata:i});throw Ne(o,e)},EQ=t=>({output:e,parsedBody:r,errorCode:n})=>{wQ({output:e,parsedBody:r,exceptionCtor:t,errorCode:n})},AQ=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),SQ=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},CQ=t=>{const e=[];for(const r in Sh){const n=Sh[r];t[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},kQ=t=>{const e={};return t.checksumAlgorithms().forEach(r=>{e[r.algorithmId()]=r.checksumConstructor()}),e},PQ=t=>{let e=t.retryStrategy;return{setRetryStrategy(r){e=r},retryStrategy(){return e}}},RQ=t=>{const e={};return e.retryStrategy=t.retryStrategy(),e},TQ=t=>({...CQ(t),...PQ(t)}),MQ=t=>({...kQ(t),...RQ(t)}),yp=function(){const t=Object.getPrototypeOf(this).constructor,e=Function.bind.apply(String,[null,...arguments]),r=new e;return Object.setPrototypeOf(r,t.prototype),r};yp.prototype=Object.create(String.prototype,{constructor:{value:yp,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(yp,String);const Ae=t=>{if(t==null)return{};if(Array.isArray(t))return t.filter(e=>e!=null).map(Ae);if(typeof t=="object"){const e={};for(const r of Object.keys(t))t[r]!=null&&(e[r]=Ae(t[r]));return e}return t},IQ=t=>(t==null?void 0:t.body)instanceof ReadableStream,_Q=t=>(e,r)=>async n=>{var o;let i=await t.retryStrategy();const s=await t.maxAttempts();if(OQ(i)){i=i;let a=await i.acquireInitialRetryToken(r.partition_id),l=new Error,c=0,f=0;const{request:u}=n,d=Ki.isInstance(u);for(d&&(u.headers[QK]=nQ());;)try{d&&(u.headers[YK]=`attempt=${c+1}; max=${s}`);const{response:v,output:g}=await e(n);return i.recordSuccess(a),g.$metadata.attempts=c+1,g.$metadata.totalRetryDelay=f,{response:v,output:g}}catch(v){const g=NQ(v);if(l=iQ(v),d&&IQ(u))throw(o=r.logger instanceof W9?console:r.logger)==null||o.warn("An error was encountered in a non-retryable streaming request."),l;try{a=await i.refreshRetryTokenForRetry(a,g)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=c+1,l.$metadata.totalRetryDelay=f,l}c=a.getRetryCount();const y=a.getRetryDelay();f+=y,await new Promise(w=>setTimeout(w,y))}}else return i=i,i!=null&&i.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(e,n)},OQ=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",NQ=t=>{const e={error:t,errorType:DQ(t)},r=jQ(t.$response);return r&&(e.retryAfterHint=r),e},DQ=t=>z9(t)?"THROTTLING":V9(t)?"TRANSIENT":VK(t)?"SERVER_ERROR":"CLIENT_ERROR",Y9={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},LQ=t=>({applyToStack:e=>{e.add(_Q(t),Y9)}}),jQ=t=>{if(!Ch.isInstance(t))return;const e=Object.keys(t.headers).find(s=>s.toLowerCase()==="retry-after");if(!e)return;const r=t.headers[e],n=Number(r);return Number.isNaN(n)?new Date(r):new Date(n*1e3)},BQ={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:Y9.name},$Q=t=>({applyToStack:e=>{e.addRelativeTo(LK(),BQ)}});class FQ{constructor(e){this.authSchemes=new Map;for(const[r,n]of Object.entries(e))n!==void 0&&this.authSchemes.set(r,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}class UQ{async sign(e,r,n){return e}}const zQ=t=>e=>J9(e)&&e.expiration.getTime()-Date.now()t.expiration!==void 0,HQ=(t,e,r)=>{if(t===void 0)return;const n=typeof t!="function"?async()=>Promise.resolve(t):t;let i,s,o,a=!1;const l=async c=>{s||(s=n(c));try{i=await s,o=!0,a=!1}finally{s=void 0}return i};return e===void 0?async c=>((!o||c!=null&&c.forceRefresh)&&(i=await l(c)),i):async c=>((!o||c!=null&&c.forceRefresh)&&(i=await l(c)),a?i:r(i)?(e(i)&&await l(c),i):(a=!0,i))},Hu=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},r4="content-length";function WQ(t){return e=>async r=>{const n=r.request;if(Ki.isInstance(n)){const{body:i,headers:s}=n;if(i&&Object.keys(s).map(o=>o.toLowerCase()).indexOf(r4)===-1)try{const o=t(i);n.headers={...n.headers,[r4]:String(o)}}catch{}}return e({...r,request:n})}}const GQ={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},KQ=t=>({applyToStack:e=>{e.add(WQ(t.bodyLengthChecker),GQ)}}),n4=t=>{var e,r;return Ch.isInstance(t)?((e=t.headers)==null?void 0:e.date)??((r=t.headers)==null?void 0:r.Date):void 0},X9=t=>new Date(Date.now()+t),QQ=(t,e)=>Math.abs(X9(e).getTime()-t)>=3e5,i4=(t,e)=>{const r=Date.parse(t);return QQ(r,e)?r-Date.now():e},tf=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},YQ=async t=>{var l,c,f;const e=tf("context",t.context),r=tf("config",t.config),n=(f=(c=(l=e.endpointV2)==null?void 0:l.properties)==null?void 0:c.authSchemes)==null?void 0:f[0],s=await tf("signer",r.signer)(n),o=t==null?void 0:t.signingRegion,a=t==null?void 0:t.signingName;return{config:r,signer:s,signingRegion:o,signingName:a}};class JQ{async sign(e,r,n){if(!Ki.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:i,signer:s,signingRegion:o,signingName:a}=await YQ(n);return await s.sign(e,{signingDate:X9(i.systemClockOffset),signingRegion:o,signingService:a})}errorHandler(e){return r=>{const n=r.ServerTime??n4(r.$response);if(n){const i=tf("config",e.config),s=i.systemClockOffset;i.systemClockOffset=i4(n,i.systemClockOffset),i.systemClockOffset!==s&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(e,r){const n=n4(e);if(n){const i=tf("config",r.config);i.systemClockOffset=i4(n,i.systemClockOffset)}}}const XQ="X-Amz-Algorithm",ZQ="X-Amz-Credential",Z9="X-Amz-Date",eY="X-Amz-SignedHeaders",tY="X-Amz-Expires",ek="X-Amz-Signature",tk="X-Amz-Security-Token",rk="authorization",nk=Z9.toLowerCase(),rY="date",nY=[rk,nk,rY],iY=ek.toLowerCase(),pp="x-amz-content-sha256",sY=tk.toLowerCase(),oY={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},aY=/^proxy-/,lY=/^sec-/,fv="AWS4-HMAC-SHA256",cY="AWS4-HMAC-SHA256-PAYLOAD",fY="UNSIGNED-PAYLOAD",uY=50,ik="aws4_request",dY=60*60*24*7,Wu={},uv=[],dv=(t,e,r)=>`${t}/${e}/${r}/${ik}`,hY=async(t,e,r,n,i)=>{const s=await s4(t,e.secretAccessKey,e.accessKeyId),o=`${r}:${n}:${i}:${Fo(s)}:${e.sessionToken}`;if(o in Wu)return Wu[o];for(uv.push(o);uv.length>uY;)delete Wu[uv.shift()];let a=`AWS4${e.secretAccessKey}`;for(const l of[r,n,i,ik])a=await s4(t,a,l);return Wu[o]=a},s4=(t,e,r)=>{const n=new t(e);return n.update(ef(r)),n.digest()},o4=({headers:t},e,r)=>{const n={};for(const i of Object.keys(t).sort()){if(t[i]==null)continue;const s=i.toLowerCase();(s in oY||e!=null&&e.has(s)||aY.test(s)||lY.test(s))&&(!r||r&&!r.has(s))||(n[s]=t[i].trim().replace(/\s+/g," "))}return n},vY=({query:t={}})=>{const e=[],r={};for(const n of Object.keys(t).sort()){if(n.toLowerCase()===iY)continue;e.push(n);const i=t[n];typeof i=="string"?r[n]=`${Hs(n)}=${Hs(i)}`:Array.isArray(i)&&(r[n]=i.slice(0).reduce((s,o)=>s.concat([`${Hs(n)}=${Hs(o)}`]),[]).sort().join("&"))}return e.map(n=>r[n]).filter(n=>n).join("&")},yY=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",hv=async({headers:t,body:e},r)=>{for(const n of Object.keys(t))if(n.toLowerCase()===pp)return t[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||yY(e)){const n=new r;return n.update(ef(e)),Fo(await n.digest())}return fY};class pY{format(e){const r=[];for(const s of Object.keys(e)){const o=Cl(s);r.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[s]))}const n=new Uint8Array(r.reduce((s,o)=>s+o.byteLength,0));let i=0;for(const s of r)n.set(s,i),i+=s.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":const s=new DataView(new ArrayBuffer(3+e.value.byteLength));s.setUint8(0,6),s.setUint16(1,e.value.byteLength,!1);const o=new Uint8Array(s.buffer);return o.set(e.value,3),o;case"string":const a=Cl(e.value),l=new DataView(new ArrayBuffer(3+a.byteLength));l.setUint8(0,7),l.setUint16(1,a.byteLength,!1);const c=new Uint8Array(l.buffer);return c.set(a,3),c;case"timestamp":const f=new Uint8Array(9);return f[0]=8,f.set(ix.fromNumber(e.value.valueOf()).bytes,1),f;case"uuid":if(!mY.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const u=new Uint8Array(17);return u[0]=9,u.set(gQ(e.value.replace(/\-/g,"")),1),u}}}var a4;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(a4||(a4={}));const mY=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class ix{constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,i=Math.abs(Math.round(e));n>-1&&i>0;n--,i/=256)r[n]=i;return e<0&&l4(r),new ix(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&l4(e),parseInt(Fo(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function l4(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}const gY=(t,e)=>{t=t.toLowerCase();for(const r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1},sk=({headers:t,query:e,...r})=>({...r,headers:{...t},query:e?xY(e):void 0}),xY=t=>Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{}),bY=(t,e={})=>{var i;const{headers:r,query:n={}}=typeof t.clone=="function"?t.clone():sk(t);for(const s of Object.keys(r)){const o=s.toLowerCase();o.slice(0,6)==="x-amz-"&&!((i=e.unhoistableHeaders)!=null&&i.has(o))&&(n[s]=r[s],delete r[s])}return{...t,headers:r,query:n}},c4=t=>{t=typeof t.clone=="function"?t.clone():sk(t);for(const e of Object.keys(t.headers))nY.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t},wY=t=>EY(t).toISOString().replace(/\.\d{3}Z$/,"Z"),EY=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;class f4{constructor({applyChecksum:e,credentials:r,region:n,service:i,sha256:s,uriEscapePath:o=!0}){this.headerFormatter=new pY,this.service=i,this.sha256=s,this.uriEscapePath=o,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=io(n),this.credentialProvider=io(r)}async presign(e,r={}){const{signingDate:n=new Date,expiresIn:i=3600,unsignableHeaders:s,unhoistableHeaders:o,signableHeaders:a,signingRegion:l,signingService:c}=r,f=await this.credentialProvider();this.validateResolvedCredentials(f);const u=l??await this.regionProvider(),{longDate:d,shortDate:v}=Gu(n);if(i>dY)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const g=dv(v,u,c??this.service),y=bY(c4(e),{unhoistableHeaders:o});f.sessionToken&&(y.query[tk]=f.sessionToken),y.query[XQ]=fv,y.query[ZQ]=`${f.accessKeyId}/${g}`,y.query[Z9]=d,y.query[tY]=i.toString(10);const w=o4(y,s,a);return y.query[eY]=u4(w),y.query[ek]=await this.getSignature(d,g,this.getSigningKey(f,u,v,c),this.createCanonicalRequest(y,w,await hv(e,this.sha256))),y}async sign(e,r){return typeof e=="string"?this.signString(e,r):e.headers&&e.payload?this.signEvent(e,r):e.message?this.signMessage(e,r):this.signRequest(e,r)}async signEvent({headers:e,payload:r},{signingDate:n=new Date,priorSignature:i,signingRegion:s,signingService:o}){const a=s??await this.regionProvider(),{shortDate:l,longDate:c}=Gu(n),f=dv(l,a,o??this.service),u=await hv({headers:{},body:r},this.sha256),d=new this.sha256;d.update(e);const v=Fo(await d.digest()),g=[cY,c,f,i,v,u].join(` `);return this.signString(g,{signingDate:n,signingRegion:a,signingService:o})}async signMessage(e,{signingDate:r=new Date,signingRegion:n,signingService:i}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:r,signingRegion:n,signingService:i,priorSignature:e.priorSignature}).then(o=>({message:e.message,signature:o}))}async signString(e,{signingDate:r=new Date,signingRegion:n,signingService:i}={}){const s=await this.credentialProvider();this.validateResolvedCredentials(s);const o=n??await this.regionProvider(),{shortDate:a}=Gu(r),l=new this.sha256(await this.getSigningKey(s,o,a,i));return l.update(ef(e)),Fo(await l.digest())}async signRequest(e,{signingDate:r=new Date,signableHeaders:n,unsignableHeaders:i,signingRegion:s,signingService:o}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const l=s??await this.regionProvider(),c=c4(e),{longDate:f,shortDate:u}=Gu(r),d=dv(u,l,o??this.service);c.headers[nk]=f,a.sessionToken&&(c.headers[sY]=a.sessionToken);const v=await hv(c,this.sha256);!gY(pp,c.headers)&&this.applyChecksum&&(c.headers[pp]=v);const g=o4(c,i,n),y=await this.getSignature(f,d,this.getSigningKey(a,l,u,o),this.createCanonicalRequest(c,g,v));return c.headers[rk]=`${fv} Credential=${a.accessKeyId}/${d}, SignedHeaders=${u4(g)}, Signature=${y}`,c}createCanonicalRequest(e,r,n){const i=Object.keys(r).sort();return`${e.method} ${this.getCanonicalPath(e)} ${vY(e)} @@ -181,7 +181,7 @@ ${i.join(";")} ${n}`}async createStringToSign(e,r,n){const i=new this.sha256;i.update(ef(n));const s=await i.digest();return`${fv} ${e} ${r} -${Fo(s)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const r=[];for(const s of e.split("/"))(s==null?void 0:s.length)!==0&&s!=="."&&(s===".."?r.pop():r.push(s));const n=`${e!=null&&e.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&(e!=null&&e.endsWith("/"))?"/":""}`;return Hs(n).replace(/%2F/g,"/")}return e}async getSignature(e,r,n,i){const s=await this.createStringToSign(e,r,i),o=new this.sha256(await n);return o.update(ef(s)),Fo(await o.digest())}getSigningKey(e,r,n,i){return hY(this.sha256,e,n,r,i||this.service)}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}}const Gu=t=>{const e=wY(t).replace(/[\-:]/g,"");return{longDate:e,shortDate:e.slice(0,8)}},u4=t=>Object.keys(t).sort().join(";"),AY=t=>{let e;t.credentials&&(e=HQ(t.credentials,qQ,J9)),e||(t.credentialDefaultProvider?e=Hu(t.credentialDefaultProvider(Object.assign({},t,{parentClientConfig:t}))):e=async()=>{throw new Error("`credentials` is missing")});const{signingEscapePath:r=!0,systemClockOffset:n=t.systemClockOffset||0,sha256:i}=t;let s;return t.signer?s=Hu(t.signer):t.regionInfoProvider?s=()=>Hu(t.region)().then(async o=>[await t.regionInfoProvider(o,{useFipsEndpoint:await t.useFipsEndpoint(),useDualstackEndpoint:await t.useDualstackEndpoint()})||{},o]).then(([o,a])=>{const{signingRegion:l,signingService:c}=o;t.signingRegion=t.signingRegion||l||a,t.signingName=t.signingName||c||t.serviceId;const f={...t,credentials:e,region:t.signingRegion,service:t.signingName,sha256:i,uriEscapePath:r},u=t.signerConstructor||f4;return new u(f)}):s=async o=>{o=Object.assign({},{name:"sigv4",signingName:t.signingName||t.defaultSigningName,signingRegion:await Hu(t.region)(),properties:{}},o);const a=o.signingRegion,l=o.signingName;t.signingRegion=t.signingRegion||a,t.signingName=t.signingName||l||t.serviceId;const c={...t,credentials:e,region:t.signingRegion,service:t.signingName,sha256:i,uriEscapePath:r},f=t.signerConstructor||f4;return new f(c)},{...t,systemClockOffset:n,signingEscapePath:r,credentials:e,signer:s}},SY=(t,e)=>xQ(t,e).then(r=>e.utf8Encoder(r)),T0=(t,e)=>SY(t,e).then(r=>{if(r.length)try{return JSON.parse(r)}catch(n){throw(n==null?void 0:n.name)==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:r}),n}return{}}),CY=async(t,e)=>{const r=await T0(t,e);return r.message=r.message??r.Message,r},kY=(t,e)=>{const r=(s,o)=>Object.keys(s).find(a=>a.toLowerCase()===o.toLowerCase()),n=s=>{let o=s;return typeof o=="number"&&(o=o.toString()),o.indexOf(",")>=0&&(o=o.split(",")[0]),o.indexOf(":")>=0&&(o=o.split(":")[0]),o.indexOf("#")>=0&&(o=o.split("#")[1]),o},i=r(t.headers,"x-amzn-errortype");if(i!==void 0)return n(t.headers[i]);if(e.code!==void 0)return n(e.code);if(e.__type!==void 0)return n(e.__type)},PY=async(t,e,r)=>({operation:P0(e).operation,region:await io(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function RY(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}function At(t){return{schemeId:"smithy.api#noAuth"}}const TY=t=>{const e=[];switch(t.operation){case"AssociateSoftwareToken":{e.push(At());break}case"ChangePassword":{e.push(At());break}case"ConfirmDevice":{e.push(At());break}case"ConfirmForgotPassword":{e.push(At());break}case"ConfirmSignUp":{e.push(At());break}case"DeleteUser":{e.push(At());break}case"DeleteUserAttributes":{e.push(At());break}case"ForgetDevice":{e.push(At());break}case"ForgotPassword":{e.push(At());break}case"GetDevice":{e.push(At());break}case"GetUser":{e.push(At());break}case"GetUserAttributeVerificationCode":{e.push(At());break}case"GlobalSignOut":{e.push(At());break}case"InitiateAuth":{e.push(At());break}case"ListDevices":{e.push(At());break}case"ResendConfirmationCode":{e.push(At());break}case"RespondToAuthChallenge":{e.push(At());break}case"RevokeToken":{e.push(At());break}case"SetUserMFAPreference":{e.push(At());break}case"SetUserSettings":{e.push(At());break}case"SignUp":{e.push(At());break}case"UpdateAuthEventFeedback":{e.push(At());break}case"UpdateDeviceStatus":{e.push(At());break}case"UpdateUserAttributes":{e.push(At());break}case"VerifySoftwareToken":{e.push(At());break}case"VerifyUserAttribute":{e.push(At());break}default:e.push(RY(t))}return e},MY=t=>({...AY(t)}),IY=t=>({...t,useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}),sx={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},_Y="@aws-sdk/client-cognito-identity-provider",OY="AWS SDK for JavaScript Cognito Identity Provider Client for Node.js, Browser and React Native",NY="3.572.0",DY={build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-cognito-identity-provider","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cognito-identity-provider"},LY="./dist-cjs/index.js",jY="./dist-types/index.d.ts",BY="./dist-es/index.js",$Y=!1,FY={"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sso-oidc":"3.572.0","@aws-sdk/client-sts":"3.572.0","@aws-sdk/core":"3.572.0","@aws-sdk/credential-provider-node":"3.572.0","@aws-sdk/middleware-host-header":"3.567.0","@aws-sdk/middleware-logger":"3.568.0","@aws-sdk/middleware-recursion-detection":"3.567.0","@aws-sdk/middleware-user-agent":"3.572.0","@aws-sdk/region-config-resolver":"3.572.0","@aws-sdk/types":"3.567.0","@aws-sdk/util-endpoints":"3.572.0","@aws-sdk/util-user-agent-browser":"3.567.0","@aws-sdk/util-user-agent-node":"3.568.0","@smithy/config-resolver":"^2.2.0","@smithy/core":"^1.4.2","@smithy/fetch-http-handler":"^2.5.0","@smithy/hash-node":"^2.2.0","@smithy/invalid-dependency":"^2.2.0","@smithy/middleware-content-length":"^2.2.0","@smithy/middleware-endpoint":"^2.5.1","@smithy/middleware-retry":"^2.3.1","@smithy/middleware-serde":"^2.3.0","@smithy/middleware-stack":"^2.2.0","@smithy/node-config-provider":"^2.3.0","@smithy/node-http-handler":"^2.5.0","@smithy/protocol-http":"^3.3.0","@smithy/smithy-client":"^2.5.1","@smithy/types":"^2.12.0","@smithy/url-parser":"^2.2.0","@smithy/util-base64":"^2.3.0","@smithy/util-body-length-browser":"^2.2.0","@smithy/util-body-length-node":"^2.3.0","@smithy/util-defaults-mode-browser":"^2.2.1","@smithy/util-defaults-mode-node":"^2.3.1","@smithy/util-endpoints":"^1.2.0","@smithy/util-middleware":"^2.2.0","@smithy/util-retry":"^2.2.0","@smithy/util-utf8":"^2.3.0",tslib:"^2.6.2"},UY={"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},zY={node:">=16.0.0"},VY={"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},qY=["dist-*/**"],HY={name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},WY="Apache-2.0",GY={"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},KY="https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity-provider",QY={type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-cognito-identity-provider"},YY={name:_Y,description:OY,version:NY,scripts:DY,main:LY,types:jY,module:BY,sideEffects:$Y,dependencies:FY,devDependencies:UY,engines:zY,typesVersions:VY,files:qY,author:HY,license:WY,browser:GY,"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:KY,repository:QY};var ok={};/*! ***************************************************************************** +${Fo(s)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const r=[];for(const s of e.split("/"))(s==null?void 0:s.length)!==0&&s!=="."&&(s===".."?r.pop():r.push(s));const n=`${e!=null&&e.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&(e!=null&&e.endsWith("/"))?"/":""}`;return Hs(n).replace(/%2F/g,"/")}return e}async getSignature(e,r,n,i){const s=await this.createStringToSign(e,r,i),o=new this.sha256(await n);return o.update(ef(s)),Fo(await o.digest())}getSigningKey(e,r,n,i){return hY(this.sha256,e,n,r,i||this.service)}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}}const Gu=t=>{const e=wY(t).replace(/[\-:]/g,"");return{longDate:e,shortDate:e.slice(0,8)}},u4=t=>Object.keys(t).sort().join(";"),AY=t=>{let e;t.credentials&&(e=HQ(t.credentials,qQ,J9)),e||(t.credentialDefaultProvider?e=Hu(t.credentialDefaultProvider(Object.assign({},t,{parentClientConfig:t}))):e=async()=>{throw new Error("`credentials` is missing")});const{signingEscapePath:r=!0,systemClockOffset:n=t.systemClockOffset||0,sha256:i}=t;let s;return t.signer?s=Hu(t.signer):t.regionInfoProvider?s=()=>Hu(t.region)().then(async o=>[await t.regionInfoProvider(o,{useFipsEndpoint:await t.useFipsEndpoint(),useDualstackEndpoint:await t.useDualstackEndpoint()})||{},o]).then(([o,a])=>{const{signingRegion:l,signingService:c}=o;t.signingRegion=t.signingRegion||l||a,t.signingName=t.signingName||c||t.serviceId;const f={...t,credentials:e,region:t.signingRegion,service:t.signingName,sha256:i,uriEscapePath:r},u=t.signerConstructor||f4;return new u(f)}):s=async o=>{o=Object.assign({},{name:"sigv4",signingName:t.signingName||t.defaultSigningName,signingRegion:await Hu(t.region)(),properties:{}},o);const a=o.signingRegion,l=o.signingName;t.signingRegion=t.signingRegion||a,t.signingName=t.signingName||l||t.serviceId;const c={...t,credentials:e,region:t.signingRegion,service:t.signingName,sha256:i,uriEscapePath:r},f=t.signerConstructor||f4;return new f(c)},{...t,systemClockOffset:n,signingEscapePath:r,credentials:e,signer:s}},SY=(t,e)=>xQ(t,e).then(r=>e.utf8Encoder(r)),T0=(t,e)=>SY(t,e).then(r=>{if(r.length)try{return JSON.parse(r)}catch(n){throw(n==null?void 0:n.name)==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:r}),n}return{}}),CY=async(t,e)=>{const r=await T0(t,e);return r.message=r.message??r.Message,r},kY=(t,e)=>{const r=(s,o)=>Object.keys(s).find(a=>a.toLowerCase()===o.toLowerCase()),n=s=>{let o=s;return typeof o=="number"&&(o=o.toString()),o.indexOf(",")>=0&&(o=o.split(",")[0]),o.indexOf(":")>=0&&(o=o.split(":")[0]),o.indexOf("#")>=0&&(o=o.split("#")[1]),o},i=r(t.headers,"x-amzn-errortype");if(i!==void 0)return n(t.headers[i]);if(e.code!==void 0)return n(e.code);if(e.__type!==void 0)return n(e.__type)},PY=async(t,e,r)=>({operation:P0(e).operation,region:await io(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function RY(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}function At(t){return{schemeId:"smithy.api#noAuth"}}const TY=t=>{const e=[];switch(t.operation){case"AssociateSoftwareToken":{e.push(At());break}case"ChangePassword":{e.push(At());break}case"ConfirmDevice":{e.push(At());break}case"ConfirmForgotPassword":{e.push(At());break}case"ConfirmSignUp":{e.push(At());break}case"DeleteUser":{e.push(At());break}case"DeleteUserAttributes":{e.push(At());break}case"ForgetDevice":{e.push(At());break}case"ForgotPassword":{e.push(At());break}case"GetDevice":{e.push(At());break}case"GetUser":{e.push(At());break}case"GetUserAttributeVerificationCode":{e.push(At());break}case"GlobalSignOut":{e.push(At());break}case"InitiateAuth":{e.push(At());break}case"ListDevices":{e.push(At());break}case"ResendConfirmationCode":{e.push(At());break}case"RespondToAuthChallenge":{e.push(At());break}case"RevokeToken":{e.push(At());break}case"SetUserMFAPreference":{e.push(At());break}case"SetUserSettings":{e.push(At());break}case"SignUp":{e.push(At());break}case"UpdateAuthEventFeedback":{e.push(At());break}case"UpdateDeviceStatus":{e.push(At());break}case"UpdateUserAttributes":{e.push(At());break}case"VerifySoftwareToken":{e.push(At());break}case"VerifyUserAttribute":{e.push(At());break}default:e.push(RY(t))}return e},MY=t=>({...AY(t)}),IY=t=>({...t,useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}),sx={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},_Y="@aws-sdk/client-cognito-identity-provider",OY="AWS SDK for JavaScript Cognito Identity Provider Client for Node.js, Browser and React Native",NY="3.577.0",DY={build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-cognito-identity-provider","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cognito-identity-provider"},LY="./dist-cjs/index.js",jY="./dist-types/index.d.ts",BY="./dist-es/index.js",$Y=!1,FY={"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sso-oidc":"3.577.0","@aws-sdk/client-sts":"3.577.0","@aws-sdk/core":"3.576.0","@aws-sdk/credential-provider-node":"3.577.0","@aws-sdk/middleware-host-header":"3.577.0","@aws-sdk/middleware-logger":"3.577.0","@aws-sdk/middleware-recursion-detection":"3.577.0","@aws-sdk/middleware-user-agent":"3.577.0","@aws-sdk/region-config-resolver":"3.577.0","@aws-sdk/types":"3.577.0","@aws-sdk/util-endpoints":"3.577.0","@aws-sdk/util-user-agent-browser":"3.577.0","@aws-sdk/util-user-agent-node":"3.577.0","@smithy/config-resolver":"^3.0.0","@smithy/core":"^2.0.0","@smithy/fetch-http-handler":"^3.0.0","@smithy/hash-node":"^3.0.0","@smithy/invalid-dependency":"^3.0.0","@smithy/middleware-content-length":"^3.0.0","@smithy/middleware-endpoint":"^3.0.0","@smithy/middleware-retry":"^3.0.0","@smithy/middleware-serde":"^3.0.0","@smithy/middleware-stack":"^3.0.0","@smithy/node-config-provider":"^3.0.0","@smithy/node-http-handler":"^3.0.0","@smithy/protocol-http":"^4.0.0","@smithy/smithy-client":"^3.0.0","@smithy/types":"^3.0.0","@smithy/url-parser":"^3.0.0","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.0","@smithy/util-defaults-mode-node":"^3.0.0","@smithy/util-endpoints":"^2.0.0","@smithy/util-middleware":"^3.0.0","@smithy/util-retry":"^3.0.0","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},UY={"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},zY={node:">=16.0.0"},VY={"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},qY=["dist-*/**"],HY={name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},WY="Apache-2.0",GY={"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},KY="https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity-provider",QY={type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-cognito-identity-provider"},YY={name:_Y,description:OY,version:NY,scripts:DY,main:LY,types:jY,module:BY,sideEffects:$Y,dependencies:FY,devDependencies:UY,engines:zY,typesVersions:VY,files:qY,author:HY,license:WY,browser:GY,"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:KY,repository:QY};var ok={};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -199,4 +199,4 @@ PERFORMANCE OF THIS SOFTWARE. * https://github.com/lancedikson/bowser * MIT License | (c) Dustin Diaz 2012-2015 * MIT License | (c) Denis Demchenko 2015-2019 - */class vk{static getParser(e,r=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new N4(e,r)}static parse(e){return new N4(e).getResult()}static get BROWSER_MAP(){return hk}static get ENGINE_MAP(){return Ls}static get OS_MAP(){return Wr}static get PLATFORMS_MAP(){return Xt}}const QJ=({serviceId:t,clientVersion:e})=>async()=>{var i,s,o,a,l;const r=typeof window<"u"&&((i=window==null?void 0:window.navigator)!=null&&i.userAgent)?vk.parse(window.navigator.userAgent):void 0,n=[["aws-sdk-js",e],["ua","2.0"],[`os/${((s=r==null?void 0:r.os)==null?void 0:s.name)||"other"}`,(o=r==null?void 0:r.os)==null?void 0:o.version],["lang/js"],["md/browser",`${((a=r==null?void 0:r.browser)==null?void 0:a.name)??"unknown"}_${((l=r==null?void 0:r.browser)==null?void 0:l.version)??"unknown"}`]];return t&&n.push([`api/${t}`,e]),n},YJ=t=>()=>Promise.reject(t),D4=typeof TextEncoder=="function"?new TextEncoder:null,JJ=t=>{if(typeof t=="string"){if(D4)return D4.encode(t).byteLength;let e=t.length;for(let r=e-1;r>=0;r--){const n=t.charCodeAt(r);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&r--}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}throw new Error(`Body Length computation failed for ${t}`)},yk="required",Ii="fn",_i="argv",Hl="ref",L4=!0,j4="isSet",Ff="booleanEquals",ka="error",kc="endpoint",Ji="tree",lx="PartitionResult",B4={[yk]:!1,type:"String"},$4={[yk]:!0,default:!1,type:"Boolean"},F4={[Hl]:"Endpoint"},pk={[Ii]:Ff,[_i]:[{[Hl]:"UseFIPS"},!0]},mk={[Ii]:Ff,[_i]:[{[Hl]:"UseDualStack"},!0]},wi={},U4={[Ii]:"getAttr",[_i]:[{[Hl]:lx},"supportsFIPS"]},z4={[Ii]:Ff,[_i]:[!0,{[Ii]:"getAttr",[_i]:[{[Hl]:lx},"supportsDualStack"]}]},V4=[pk],q4=[mk],H4=[{[Hl]:"Region"}],XJ={version:"1.0",parameters:{Region:B4,UseDualStack:$4,UseFIPS:$4,Endpoint:B4},rules:[{conditions:[{[Ii]:j4,[_i]:[F4]}],rules:[{conditions:V4,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:ka},{conditions:q4,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:ka},{endpoint:{url:F4,properties:wi,headers:wi},type:kc}],type:Ji},{conditions:[{[Ii]:j4,[_i]:H4}],rules:[{conditions:[{[Ii]:"aws.partition",[_i]:H4,assign:lx}],rules:[{conditions:[pk,mk],rules:[{conditions:[{[Ii]:Ff,[_i]:[L4,U4]},z4],rules:[{endpoint:{url:"https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:wi,headers:wi},type:kc}],type:Ji},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:ka}],type:Ji},{conditions:V4,rules:[{conditions:[{[Ii]:Ff,[_i]:[U4,L4]}],rules:[{endpoint:{url:"https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",properties:wi,headers:wi},type:kc}],type:Ji},{error:"FIPS is enabled but this partition does not support FIPS",type:ka}],type:Ji},{conditions:q4,rules:[{conditions:[z4],rules:[{endpoint:{url:"https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:wi,headers:wi},type:kc}],type:Ji},{error:"DualStack is enabled but this partition does not support DualStack",type:ka}],type:Ji},{endpoint:{url:"https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",properties:wi,headers:wi},type:kc}],type:Ji}],type:Ji},{error:"Invalid Configuration: Missing Region",type:ka}]},ZJ=XJ,eX=(t,e={})=>ZG(ZJ,{endpointParams:t,logger:e.logger});kh.aws=B9;const tX=t=>({apiVersion:"2016-04-18",base64Decoder:(t==null?void 0:t.base64Decoder)??tx,base64Encoder:(t==null?void 0:t.base64Encoder)??K9,disableHostPrefix:(t==null?void 0:t.disableHostPrefix)??!1,endpointProvider:(t==null?void 0:t.endpointProvider)??eX,extensions:(t==null?void 0:t.extensions)??[],httpAuthSchemeProvider:(t==null?void 0:t.httpAuthSchemeProvider)??TY,httpAuthSchemes:(t==null?void 0:t.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new JQ},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new UQ}],logger:(t==null?void 0:t.logger)??new W9,serviceId:(t==null?void 0:t.serviceId)??"Cognito Identity Provider",urlParser:(t==null?void 0:t.urlParser)??Ph,utf8Decoder:(t==null?void 0:t.utf8Decoder)??Cl,utf8Encoder:(t==null?void 0:t.utf8Encoder)??G9}),rX=(t,e,r)=>{let n,i,s,o=!1;const a=async()=>{i||(i=t());try{n=await i,s=!0,o=!1}finally{i=void 0}return n};return e===void 0?async l=>((!s||l!=null&&l.forceRefresh)&&(n=await a()),n):async l=>((!s||l!=null&&l.forceRefresh)&&(n=await a()),o?n:r&&!r(n)?(o=!0,n):(e(n)&&await a(),n))},nX=["in-region","cross-region","mobile","standard","legacy"],iX=({defaultsMode:t}={})=>rX(async()=>{const e=typeof t=="function"?await t():t;switch(e==null?void 0:e.toLowerCase()){case"auto":return Promise.resolve(sX()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e==null?void 0:e.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${nX.join(", ")}, got ${e}`)}}),sX=()=>{var r,n;const t=typeof window<"u"&&((r=window==null?void 0:window.navigator)!=null&&r.userAgent)?vk.parse(window.navigator.userAgent):void 0,e=(n=t==null?void 0:t.platform)==null?void 0:n.type;return e==="tablet"||e==="mobile"},oX=t=>{const e=iX(t),r=()=>e().then(SQ),n=tX(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:(t==null?void 0:t.bodyLengthChecker)??JJ,credentialDefaultProvider:(t==null?void 0:t.credentialDefaultProvider)??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(t==null?void 0:t.defaultUserAgentProvider)??QJ({serviceId:n.serviceId,clientVersion:YY.version}),maxAttempts:(t==null?void 0:t.maxAttempts)??Rh,region:(t==null?void 0:t.region)??YJ("Region is missing"),requestHandler:rx.create((t==null?void 0:t.requestHandler)??r),retryMode:(t==null?void 0:t.retryMode)??(async()=>(await r()).retryMode||jK),sha256:(t==null?void 0:t.sha256)??ok.Sha256,streamCollector:(t==null?void 0:t.streamCollector)??vQ,useDualstackEndpoint:(t==null?void 0:t.useDualstackEndpoint)??(()=>Promise.resolve(uK)),useFipsEndpoint:(t==null?void 0:t.useFipsEndpoint)??(()=>Promise.resolve(dK))}},aX=t=>{let e=async()=>{if(t.region===void 0)throw new Error("Region is missing from runtimeConfig");const r=t.region;return typeof r=="string"?r:r()};return{setRegion(r){e=r},region(){return e}}},lX=t=>({region:t.region()}),cX=t=>{const e=t.httpAuthSchemes;let r=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(i){const s=e.findIndex(o=>o.schemeId===i.schemeId);s===-1?e.push(i):e.splice(s,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){r=i},httpAuthSchemeProvider(){return r},setCredentials(i){n=i},credentials(){return n}}},fX=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),Ku=t=>t,uX=(t,e)=>{const r={...Ku(aX(t)),...Ku(TQ(t)),...Ku(bG(t)),...Ku(cX(t))};return e.forEach(n=>n.configure(r)),{...t,...lX(r),...MQ(r),...wG(r),...fX(r)}};class dX extends oQ{constructor(...[e]){const r=oX(e||{}),n=IY(r),i=hK(n),s=IK(i),o=sQ(s),a=o,l=NG(a),c=MY(l),f=uX(c,(e==null?void 0:e.extensions)||[]);super(f),this.config=f,this.middlewareStack.use(LQ(this.config)),this.middlewareStack.use(KQ(this.config)),this.middlewareStack.use(CG(this.config)),this.middlewareStack.use(RG(this.config)),this.middlewareStack.use(OG(this.config)),this.middlewareStack.use(fK(this.config)),this.middlewareStack.use(OK(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use($Q(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return PY}getIdentityProviderConfigProvider(){return async e=>new FQ({"aws.auth#sigv4":e.credentials})}}class Te extends nx{constructor(e){super(e),Object.setPrototypeOf(this,Te.prototype)}}class cx extends Te{constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),this.name="InternalErrorException",this.$fault="server",Object.setPrototypeOf(this,cx.prototype)}}class fx extends Te{constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),this.name="InvalidParameterException",this.$fault="client",Object.setPrototypeOf(this,fx.prototype)}}class ux extends Te{constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),this.name="NotAuthorizedException",this.$fault="client",Object.setPrototypeOf(this,ux.prototype)}}class dx extends Te{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,dx.prototype)}}class hx extends Te{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,hx.prototype)}}class vx extends Te{constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),this.name="UserImportInProgressException",this.$fault="client",Object.setPrototypeOf(this,vx.prototype)}}class yx extends Te{constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),this.name="UserNotFoundException",this.$fault="client",Object.setPrototypeOf(this,yx.prototype)}}class px extends Te{constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),this.name="InvalidLambdaResponseException",this.$fault="client",Object.setPrototypeOf(this,px.prototype)}}class mx extends Te{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,mx.prototype)}}class gx extends Te{constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),this.name="TooManyFailedAttemptsException",this.$fault="client",Object.setPrototypeOf(this,gx.prototype)}}class xx extends Te{constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),this.name="UnexpectedLambdaException",this.$fault="client",Object.setPrototypeOf(this,xx.prototype)}}class M0 extends Te{constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),this.name="UserLambdaValidationException",this.$fault="client",Object.setPrototypeOf(this,M0.prototype)}}class bx extends Te{constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),this.name="CodeDeliveryFailureException",this.$fault="client",Object.setPrototypeOf(this,bx.prototype)}}class wx extends Te{constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),this.name="InvalidPasswordException",this.$fault="client",Object.setPrototypeOf(this,wx.prototype)}}class Ex extends Te{constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),this.name="InvalidSmsRoleAccessPolicyException",this.$fault="client",Object.setPrototypeOf(this,Ex.prototype)}}class Ax extends Te{constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),this.name="InvalidSmsRoleTrustRelationshipException",this.$fault="client",Object.setPrototypeOf(this,Ax.prototype)}}class Sx extends Te{constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),this.name="PreconditionNotMetException",this.$fault="client",Object.setPrototypeOf(this,Sx.prototype)}}class Cx extends Te{constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),this.name="UnsupportedUserStateException",this.$fault="client",Object.setPrototypeOf(this,Cx.prototype)}}class kx extends Te{constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),this.name="UsernameExistsException",this.$fault="client",Object.setPrototypeOf(this,kx.prototype)}}class Px extends Te{constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),this.name="AliasExistsException",this.$fault="client",Object.setPrototypeOf(this,Px.prototype)}}class Rx extends Te{constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),this.name="InvalidUserPoolConfigurationException",this.$fault="client",Object.setPrototypeOf(this,Rx.prototype)}}class Tx extends Te{constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),this.name="MFAMethodNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Tx.prototype)}}class Mx extends Te{constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),this.name="PasswordResetRequiredException",this.$fault="client",Object.setPrototypeOf(this,Mx.prototype)}}class Ix extends Te{constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),this.name="UserNotConfirmedException",this.$fault="client",Object.setPrototypeOf(this,Ix.prototype)}}class _x extends Te{constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),this.name="UserPoolAddOnNotEnabledException",this.$fault="client",Object.setPrototypeOf(this,_x.prototype)}}class Ox extends Te{constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),this.name="InvalidEmailRoleAccessPolicyException",this.$fault="client",Object.setPrototypeOf(this,Ox.prototype)}}class Nx extends Te{constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),this.name="CodeMismatchException",this.$fault="client",Object.setPrototypeOf(this,Nx.prototype)}}class Dx extends Te{constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),this.name="ExpiredCodeException",this.$fault="client",Object.setPrototypeOf(this,Dx.prototype)}}class Lx extends Te{constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),this.name="SoftwareTokenMFANotFoundException",this.$fault="client",Object.setPrototypeOf(this,Lx.prototype)}}class jx extends Te{constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),this.name="ConcurrentModificationException",this.$fault="client",Object.setPrototypeOf(this,jx.prototype)}}class Bx extends Te{constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),this.name="ForbiddenException",this.$fault="client",Object.setPrototypeOf(this,Bx.prototype)}}class $x extends Te{constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),this.name="GroupExistsException",this.$fault="client",Object.setPrototypeOf(this,$x.prototype)}}class Fx extends Te{constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),this.name="DuplicateProviderException",this.$fault="client",Object.setPrototypeOf(this,Fx.prototype)}}class Ux extends Te{constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),this.name="UserPoolTaggingException",this.$fault="client",Object.setPrototypeOf(this,Ux.prototype)}}class zx extends Te{constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),this.name="InvalidOAuthFlowException",this.$fault="client",Object.setPrototypeOf(this,zx.prototype)}}class Vx extends Te{constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),this.name="ScopeDoesNotExistException",this.$fault="client",Object.setPrototypeOf(this,Vx.prototype)}}class qx extends Te{constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),this.name="UnsupportedIdentityProviderException",this.$fault="client",Object.setPrototypeOf(this,qx.prototype)}}class Hx extends Te{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,Hx.prototype)}}class Wx extends Te{constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),this.name="UnsupportedOperationException",this.$fault="client",Object.setPrototypeOf(this,Wx.prototype)}}class Gx extends Te{constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),this.name="UnsupportedTokenTypeException",this.$fault="client",Object.setPrototypeOf(this,Gx.prototype)}}const W4=t=>({...t,...t.Value&&{Value:wr}}),gk=t=>({...t,...t.AccessToken&&{AccessToken:wr},...t.RefreshToken&&{RefreshToken:wr},...t.IdToken&&{IdToken:wr}}),hX=t=>({...t,...t.AuthParameters&&{AuthParameters:wr},...t.ClientId&&{ClientId:wr},...t.UserContextData&&{UserContextData:wr}}),vX=t=>({...t,...t.Session&&{Session:wr},...t.AuthenticationResult&&{AuthenticationResult:gk(t.AuthenticationResult)}}),yX=t=>({...t,...t.ClientId&&{ClientId:wr},...t.Session&&{Session:wr},...t.ChallengeResponses&&{ChallengeResponses:wr},...t.UserContextData&&{UserContextData:wr}}),pX=t=>({...t,...t.Session&&{Session:wr},...t.AuthenticationResult&&{AuthenticationResult:gk(t.AuthenticationResult)}});class Kx extends Te{constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),this.name="EnableSoftwareTokenMFAException",this.$fault="client",Object.setPrototypeOf(this,Kx.prototype)}}const mX=t=>({...t,...t.ClientId&&{ClientId:wr},...t.SecretHash&&{SecretHash:wr},...t.Username&&{Username:wr},...t.Password&&{Password:wr},...t.UserAttributes&&{UserAttributes:t.UserAttributes.map(e=>W4(e))},...t.ValidationData&&{ValidationData:t.ValidationData.map(e=>W4(e))},...t.UserContextData&&{UserContextData:wr}}),gX=async(t,e)=>{const r=Jx("InitiateAuth");let n;return n=JSON.stringify(Ae(t)),Yx(e,r,"/",void 0,n)},xX=async(t,e)=>{const r=Jx("RespondToAuthChallenge");let n;return n=JSON.stringify(Ae(t)),Yx(e,r,"/",void 0,n)},bX=async(t,e)=>{const r=Jx("SignUp");let n;return n=JSON.stringify(Ae(t)),Yx(e,r,"/",void 0,n)},wX=async(t,e)=>{if(t.statusCode>=300)return Qx(t,e);const r=await T0(t.body,e);let n={};return n=Ae(r),{$metadata:Me(t),...n}},EX=async(t,e)=>{if(t.statusCode>=300)return Qx(t,e);const r=await T0(t.body,e);let n={};return n=Ae(r),{$metadata:Me(t),...n}},AX=async(t,e)=>{if(t.statusCode>=300)return Qx(t,e);const r=await T0(t.body,e);let n={};return n=Ae(r),{$metadata:Me(t),...n}},Qx=async(t,e)=>{const r={...t,body:await CY(t.body,e)},n=kY(t,r.body);switch(n){case"InternalErrorException":case"com.amazonaws.cognitoidentityprovider#InternalErrorException":throw await OX(r);case"InvalidParameterException":case"com.amazonaws.cognitoidentityprovider#InvalidParameterException":throw await jX(r);case"NotAuthorizedException":case"com.amazonaws.cognitoidentityprovider#NotAuthorizedException":throw await qX(r);case"ResourceNotFoundException":case"com.amazonaws.cognitoidentityprovider#ResourceNotFoundException":throw await GX(r);case"TooManyRequestsException":case"com.amazonaws.cognitoidentityprovider#TooManyRequestsException":throw await JX(r);case"UserImportInProgressException":case"com.amazonaws.cognitoidentityprovider#UserImportInProgressException":throw await iZ(r);case"UserNotFoundException":case"com.amazonaws.cognitoidentityprovider#UserNotFoundException":throw await lZ(r);case"InvalidLambdaResponseException":case"com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException":throw await DX(r);case"LimitExceededException":case"com.amazonaws.cognitoidentityprovider#LimitExceededException":throw await zX(r);case"TooManyFailedAttemptsException":case"com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException":throw await YX(r);case"UnexpectedLambdaException":case"com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException":throw await ZX(r);case"UserLambdaValidationException":case"com.amazonaws.cognitoidentityprovider#UserLambdaValidationException":throw await sZ(r);case"CodeDeliveryFailureException":case"com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException":throw await CX(r);case"InvalidPasswordException":case"com.amazonaws.cognitoidentityprovider#InvalidPasswordException":throw await BX(r);case"InvalidSmsRoleAccessPolicyException":case"com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException":throw await $X(r);case"InvalidSmsRoleTrustRelationshipException":case"com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException":throw await FX(r);case"PreconditionNotMetException":case"com.amazonaws.cognitoidentityprovider#PreconditionNotMetException":throw await WX(r);case"UnsupportedUserStateException":case"com.amazonaws.cognitoidentityprovider#UnsupportedUserStateException":throw await nZ(r);case"UsernameExistsException":case"com.amazonaws.cognitoidentityprovider#UsernameExistsException":throw await oZ(r);case"AliasExistsException":case"com.amazonaws.cognitoidentityprovider#AliasExistsException":throw await SX(r);case"InvalidUserPoolConfigurationException":case"com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException":throw await UX(r);case"MFAMethodNotFoundException":case"com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException":throw await VX(r);case"PasswordResetRequiredException":case"com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException":throw await HX(r);case"UserNotConfirmedException":case"com.amazonaws.cognitoidentityprovider#UserNotConfirmedException":throw await aZ(r);case"UserPoolAddOnNotEnabledException":case"com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException":throw await cZ(r);case"InvalidEmailRoleAccessPolicyException":case"com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException":throw await NX(r);case"CodeMismatchException":case"com.amazonaws.cognitoidentityprovider#CodeMismatchException":throw await kX(r);case"ExpiredCodeException":case"com.amazonaws.cognitoidentityprovider#ExpiredCodeException":throw await MX(r);case"SoftwareTokenMFANotFoundException":case"com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException":throw await QX(r);case"ConcurrentModificationException":case"com.amazonaws.cognitoidentityprovider#ConcurrentModificationException":throw await PX(r);case"ForbiddenException":case"com.amazonaws.cognitoidentityprovider#ForbiddenException":throw await IX(r);case"GroupExistsException":case"com.amazonaws.cognitoidentityprovider#GroupExistsException":throw await _X(r);case"DuplicateProviderException":case"com.amazonaws.cognitoidentityprovider#DuplicateProviderException":throw await RX(r);case"UserPoolTaggingException":case"com.amazonaws.cognitoidentityprovider#UserPoolTaggingException":throw await fZ(r);case"InvalidOAuthFlowException":case"com.amazonaws.cognitoidentityprovider#InvalidOAuthFlowException":throw await LX(r);case"ScopeDoesNotExistException":case"com.amazonaws.cognitoidentityprovider#ScopeDoesNotExistException":throw await KX(r);case"UnsupportedIdentityProviderException":case"com.amazonaws.cognitoidentityprovider#UnsupportedIdentityProviderException":throw await eZ(r);case"UnauthorizedException":case"com.amazonaws.cognitoidentityprovider#UnauthorizedException":throw await XX(r);case"UnsupportedOperationException":case"com.amazonaws.cognitoidentityprovider#UnsupportedOperationException":throw await tZ(r);case"UnsupportedTokenTypeException":case"com.amazonaws.cognitoidentityprovider#UnsupportedTokenTypeException":throw await rZ(r);case"EnableSoftwareTokenMFAException":case"com.amazonaws.cognitoidentityprovider#EnableSoftwareTokenMFAException":throw await TX(r);default:const i=r.body;return uZ({output:t,parsedBody:i,errorCode:n})}},SX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Px({$metadata:Me(t),...n});return Ne(i,r)},CX=async(t,e)=>{const r=t.body,n=Ae(r),i=new bx({$metadata:Me(t),...n});return Ne(i,r)},kX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Nx({$metadata:Me(t),...n});return Ne(i,r)},PX=async(t,e)=>{const r=t.body,n=Ae(r),i=new jx({$metadata:Me(t),...n});return Ne(i,r)},RX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Fx({$metadata:Me(t),...n});return Ne(i,r)},TX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Kx({$metadata:Me(t),...n});return Ne(i,r)},MX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Dx({$metadata:Me(t),...n});return Ne(i,r)},IX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Bx({$metadata:Me(t),...n});return Ne(i,r)},_X=async(t,e)=>{const r=t.body,n=Ae(r),i=new $x({$metadata:Me(t),...n});return Ne(i,r)},OX=async(t,e)=>{const r=t.body,n=Ae(r),i=new cx({$metadata:Me(t),...n});return Ne(i,r)},NX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ox({$metadata:Me(t),...n});return Ne(i,r)},DX=async(t,e)=>{const r=t.body,n=Ae(r),i=new px({$metadata:Me(t),...n});return Ne(i,r)},LX=async(t,e)=>{const r=t.body,n=Ae(r),i=new zx({$metadata:Me(t),...n});return Ne(i,r)},jX=async(t,e)=>{const r=t.body,n=Ae(r),i=new fx({$metadata:Me(t),...n});return Ne(i,r)},BX=async(t,e)=>{const r=t.body,n=Ae(r),i=new wx({$metadata:Me(t),...n});return Ne(i,r)},$X=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ex({$metadata:Me(t),...n});return Ne(i,r)},FX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ax({$metadata:Me(t),...n});return Ne(i,r)},UX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Rx({$metadata:Me(t),...n});return Ne(i,r)},zX=async(t,e)=>{const r=t.body,n=Ae(r),i=new mx({$metadata:Me(t),...n});return Ne(i,r)},VX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Tx({$metadata:Me(t),...n});return Ne(i,r)},qX=async(t,e)=>{const r=t.body,n=Ae(r),i=new ux({$metadata:Me(t),...n});return Ne(i,r)},HX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Mx({$metadata:Me(t),...n});return Ne(i,r)},WX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Sx({$metadata:Me(t),...n});return Ne(i,r)},GX=async(t,e)=>{const r=t.body,n=Ae(r),i=new dx({$metadata:Me(t),...n});return Ne(i,r)},KX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Vx({$metadata:Me(t),...n});return Ne(i,r)},QX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Lx({$metadata:Me(t),...n});return Ne(i,r)},YX=async(t,e)=>{const r=t.body,n=Ae(r),i=new gx({$metadata:Me(t),...n});return Ne(i,r)},JX=async(t,e)=>{const r=t.body,n=Ae(r),i=new hx({$metadata:Me(t),...n});return Ne(i,r)},XX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Hx({$metadata:Me(t),...n});return Ne(i,r)},ZX=async(t,e)=>{const r=t.body,n=Ae(r),i=new xx({$metadata:Me(t),...n});return Ne(i,r)},eZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new qx({$metadata:Me(t),...n});return Ne(i,r)},tZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Wx({$metadata:Me(t),...n});return Ne(i,r)},rZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Gx({$metadata:Me(t),...n});return Ne(i,r)},nZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Cx({$metadata:Me(t),...n});return Ne(i,r)},iZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new vx({$metadata:Me(t),...n});return Ne(i,r)},sZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new M0({$metadata:Me(t),...n});return Ne(i,r)},oZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new kx({$metadata:Me(t),...n});return Ne(i,r)},aZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ix({$metadata:Me(t),...n});return Ne(i,r)},lZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new yx({$metadata:Me(t),...n});return Ne(i,r)},cZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new _x({$metadata:Me(t),...n});return Ne(i,r)},fZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ux({$metadata:Me(t),...n});return Ne(i,r)},Me=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),uZ=EQ(Te),Yx=async(t,e,r,n,i)=>{const{hostname:s,protocol:o="https",port:a,path:l}=await t.endpoint(),c={protocol:o,hostname:s,port:a,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+r:l+r,headers:e};return n!==void 0&&(c.hostname=n),i!==void 0&&(c.body=i),new Ki(c)};function Jx(t){return{"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${t}`}}class dZ extends R0.classBuilder().ep({...sx}).m(function(e,r,n,i){return[Zg(n,this.serialize,this.deserialize),ex(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").f(hX,vX).ser(gX).de(wX).build(){}class hZ extends R0.classBuilder().ep({...sx}).m(function(e,r,n,i){return[Zg(n,this.serialize,this.deserialize),ex(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","RespondToAuthChallenge",{}).n("CognitoIdentityProviderClient","RespondToAuthChallengeCommand").f(yX,pX).ser(xX).de(EX).build(){}class vZ extends R0.classBuilder().ep({...sx}).m(function(e,r,n,i){return[Zg(n,this.serialize,this.deserialize),ex(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","SignUp",{}).n("CognitoIdentityProviderClient","SignUpCommand").f(mX,void 0).ser(bX).de(AX).build(){}function zr(){return zr=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}const yZ=["signatures"],pZ="0.0.0";function Yn(t,e,r){const n=Math.floor(Date.now()/1e3),i=n+e;return{version:pZ,issuedAt:n,expiresAt:i,name:t,data:r}}async function mZ(t,e){const r=gZ(e),n=await t.sign(new Uint8Array(r));return zr({},e,{signatures:[{sessionId:await t.sessionId(),signature:n}]})}function gZ(t){const{version:e,issuedAt:r,expiresAt:n,name:i,data:s}=t,a=sr(sG({version:e,issuedAt:r,expiresAt:n,name:i,data:s}));return ce(Et(a))}function xZ(t,e){const r=yi(t,yZ),n=t.expiresAt-t.issuedAt;return r.issuedAt=Math.floor(e.getTime()/1e3),r.expiresAt=r.issuedAt+n,r}function bZ({wallet:t,chainId:e,message:r,lifespan:n}){return Yn("signMessage",n,{wallet:t,network:e.toString(),message:r.startsWith("0x")?r:fe(sr(r))})}const wZ=["lifespan"],EZ=["lifespan"],AZ=["lifespan"],SZ=["lifespan"],CZ=["lifespan"],kZ=["lifespan"];async function PZ({lifespan:t,sessionId:e,idToken:r}){return Yn("openSession",t,{sessionId:e,idToken:r})}async function RZ(t){let{lifespan:e}=t,r=yi(t,wZ);return Yn("validateSession",e,r)}function TZ(t){let{lifespan:e}=t,r=yi(t,EZ);return Yn("finishValidateSession",e,r)}function G4(t){let{lifespan:e}=t,r=yi(t,AZ);return Yn("closeSession",e,r)}function MZ(t){let{lifespan:e}=t,r=yi(t,SZ);return Yn("listSessions",e,r)}function IZ(t){let{lifespan:e}=t,r=yi(t,CZ);return Yn("getSession",e,r)}function _Z(t){let{lifespan:e}=t,r=yi(t,kZ);return Yn("sessionAuthProof",e,r)}class OZ{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/WaasAuthenticator/",this.registerSession=(n,i,s)=>this.fetch(this.url("RegisterSession"),Av(n,i,s)).then(o=>Sv(o).then(a=>({session:a.session,response:a.response})),o=>{throw al.new({cause:`fetch(): ${o.message||""}`})}),this.sendIntent=(n,i,s)=>this.fetch(this.url("SendIntent"),Av(n,i,s)).then(o=>Sv(o).then(a=>({response:a.response})),o=>{throw al.new({cause:`fetch(): ${o.message||""}`})}),this.chainList=(n,i)=>this.fetch(this.url("ChainList"),Av({},n,i)).then(s=>Sv(s).then(o=>({chains:o.chains})),s=>{throw al.new({cause:`fetch(): ${s.message||""}`})}),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Av=(t={},e={},r=null)=>({method:"POST",headers:zr({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Sv=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),I0.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(NZ[n]||Ir).new(r)}return r});class Ir extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,Ir.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}}class Xx extends Ir{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Xx.prototype)}}class al extends Ir{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,al.prototype)}}class Zx extends Ir{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Zx.prototype)}}class eb extends Ir{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eb.prototype)}}class tb extends Ir{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,tb.prototype)}}class I0 extends Ir{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,I0.prototype)}}class rb extends Ir{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rb.prototype)}}class nb extends Ir{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nb.prototype)}}class ib extends Ir{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ib.prototype)}}class sb extends Ir{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sb.prototype)}}class ob extends Ir{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ob.prototype)}}class ab extends Ir{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ab.prototype)}}class lb extends Ir{constructor(e="TenantNotFound",r=1001,n="Tenant not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,lb.prototype)}}const NZ={0:Xx,[-1]:al,[-2]:Zx,[-3]:eb,[-4]:tb,[-5]:I0,[-6]:rb,[-7]:nb,[-8]:ib,[-9]:sb,[-10]:ob,1e3:ab,1001:lb};let Cv=function(t){return t.unknown="unknown",t.erc20Token="erc20Token",t.erc1155Token="erc1155Token",t}({});function ou(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="transactionReceipt"&&typeof t.data=="object"&&typeof t.data.txHash=="string"&&typeof t.data.receipt=="object"&&typeof t.data.request=="object"}function xk(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="transactionReceipt"&&typeof t.data=="object"&&typeof t.data.metaTxHash=="string"&&!t.data.txHash&&typeof t.data.request=="object"}function DZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="transactionFailed"&&typeof t.data=="object"&&typeof t.data.request=="object"&&Array.isArray(t.data.simulations)&&typeof t.data.error=="string"}function K4(t){return ou(t)||DZ(t)||xk(t)}function LZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="signedMessage"&&typeof t.data=="object"&&typeof t.data.message=="string"&&typeof t.data.signature=="string"}function jZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="sessionAuthProof"&&typeof t.data=="object"&&typeof t.data.sessionId=="string"&&typeof t.data.network=="string"&&typeof t.data.wallet=="string"&&typeof t.data.message=="string"&&typeof t.data.signature=="string"}function BZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="feeOptions"&&typeof t.data=="object"&&Array.isArray(t.data.feeOptions)}function $Z(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="validationRequired"&&typeof t.data=="object"&&typeof t.data.sessionId=="string"}function FZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="finishedSessionValidation"&&typeof t.data=="object"}function UZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="sessionClosed"}function zZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="getSessionResponse"&&typeof t.data=="object"&&typeof t.data.session=="string"&&typeof t.data.wallet=="string"}function Q4(t){var e,r;return!!(t instanceof Ir&&((e=t.cause)!=null&&e.endsWith("intent is invalid: intent expired")||(r=t.cause)!=null&&r.endsWith("intent is invalid: intent issued in the future")))}const VZ=["token","to","value"],qZ=["token","to","id","safe","data"],HZ=["token","to","values","data"],WZ=["to","value","abi","func","args"];function GZ({lifespan:t,wallet:e,identifier:r,chainId:n,transactions:i}){return Yn("feeOptions",t,{identifier:r,wallet:e,network:n.toString(),transactions:i.map(s=>{if(!s.to||s.to===Ng)throw new Error("Contract creation not supported");return wk(s)?{type:"transaction",to:s.to,value:ae.from(s.value||0).toHexString(),data:fe(s.data||[])}:s})})}function au({lifespan:t,wallet:e,identifier:r,chainId:n,transactions:i,transactionsFeeQuote:s,transactionsFeeOption:o}){return Yn("sendTransaction",t,{identifier:r,wallet:e,network:n.toString(),transactions:KZ(i,o).map(a=>{if(!a.to||a.to===Ng)throw new Error("Contract creation not supported");return wk(a)?{type:"transaction",to:a.to,value:ae.from(a.value||0).toHexString(),data:fe(a.data||[])}:a}),transactionsFeeQuote:s})}function KZ(t,e){const r=[...t];if(e)switch(e.token.type){case Cv.unknown:r.push({to:e.to,value:e.value});break;case Cv.erc20Token:if(!e.token.contractAddress)throw new Error("contract address is required");r.push(cb({tokenAddress:e.token.contractAddress,to:e.to,value:e.value}));break;case Cv.erc1155Token:if(!e.token.contractAddress)throw new Error("contract address is required");if(!e.token.tokenID)throw new Error("token ID is required");r.push(fb({tokenAddress:e.token.contractAddress,to:e.to,vals:[{id:e.token.tokenID,amount:e.value}]}));break}return r}function QZ({lifespan:t,chainId:e,wallet:r,metaTxHash:n}){return Yn("getTransactionReceipt",t,{wallet:r,network:e.toString(),metaTxHash:n})}function YZ(t){let{token:e,to:r,value:n}=t,i=yi(t,VZ);return au(zr({transactions:[cb({tokenAddress:e,to:r,value:n.toString()})]},i))}function JZ(t){let{token:e,to:r,id:n,safe:i,data:s}=t,o=yi(t,qZ);return au(zr({transactions:[eee({tokenAddress:e,to:r,id:n,data:s,safe:i})]},o))}function XZ(t){let{token:e,to:r,values:n,data:i}=t,s=yi(t,HZ);const o=n.map(a=>({id:a.id,amount:ae.from(a.amount).toString()}));return au(zr({transactions:[fb({tokenAddress:e,to:r,vals:o,data:i})]},s))}function ZZ(t){let{to:e,value:r,abi:n,func:i,args:s}=t,o=yi(t,WZ);return au(zr({transactions:[bk({to:e,value:ae.from(r).toString(),data:{abi:n,func:i,args:s}})]},o))}function cb(t){const e=t,r=t;if(e.token!==void 0)return{type:"erc20send",tokenAddress:e.token,to:e.to,value:e.value.toString()};if(r.tokenAddress!==void 0)return zr({type:"erc20send"},r);throw new Error("Invalid ERC20 transaction")}function eee(t){const e=t,r=t;if(e.token!==void 0)return{type:"erc721send",tokenAddress:e.token,to:e.to,id:e.id,data:e.data,safe:e.safe};if(r.tokenAddress!==void 0)return zr({type:"erc721send"},r);throw new Error("Invalid ERC721 transaction")}function fb(t){const e=t,r=t;if(e.values!==void 0)return{type:"erc1155send",vals:e.values.map(n=>({id:n.id,amount:ae.from(n.amount).toString()})),tokenAddress:e.token,to:e.to,data:e.data};if(r.vals!==void 0)return{type:"erc1155send",vals:r.vals.map(n=>({id:n.id,amount:ae.from(n.amount).toString()})),tokenAddress:r.tokenAddress,to:r.to,data:r.data};throw new Error("Invalid ERC1155 transaction")}function bk(t){const e=t,r=t;if(e.abi!==void 0)return{type:"delayedEncode",to:e.to,value:ae.from(e.value).toString(),data:{abi:e.abi,func:e.func,args:e.args}};if(r.data!==void 0)return{type:"delayedEncode",to:r.to,value:r.value,data:r.data};throw new Error("Invalid delayed encode transaction")}function tee(t){if(t.length===0)throw new Error("No packets provided");const e=t[0].data.network,r=t[0].data.wallet,n=t[0].expiresAt-t[0].issuedAt,i=t[0].data.identifier,s=t[0].data.transactionsFeeQuote;if(!t.every(o=>o.data.network===e))throw new Error("All packets must have the same chainId");if(!t.every(o=>o.data.wallet===r))throw new Error("All packets must have the same wallet");return Yn("sendTransaction",n,{network:e,wallet:r,identifier:i,transactions:t.flatMap(o=>o.data.transactions),transactionsFeeQuote:s})}function wk(t){return!["transaction","erc20send","erc721send","erc1155send","delayedEncode"].includes(t.type)}class Ad{constructor(e,r,n){this.store=e,this.key=r,this.defaultValue=n}async get(){const e=await this.store.get(this.key);return e||this.defaultValue}async set(e){e?await this.store.set(this.key,e):await this.store.set(this.key,null)}}class Ek{constructor(){this.store=void 0,Mh.isAvailable()?this.store=new Mh:this.store=new ree}async get(e){return this.store.get(e)}async set(e,r){return this.store.set(e,r)}}class Mh{static isAvailable(){return typeof window=="object"&&typeof window.localStorage=="object"}constructor(){if(!Mh.isAvailable())throw new Error("No localStorage")}async get(e){return window.localStorage.getItem(e)}async set(e,r){r?window.localStorage.setItem(e,r):window.localStorage.removeItem(e)}}class ree{constructor(){this.store={},this.store={}}async get(e){return this.store[e]||null}async set(e,r){r?this.store[e]=r:delete this.store[e]}}const bp="seq-waas-session-p256k1",wp="seq-waas-session";async function Ak(t,e){const r=await e.get(bp,wp,t);if(!r)throw new Error("No private key found");const n=new ss(r);return{sessionId(){return n.getAddress()},sign(i){return n.signMessage(i)},clear:async()=>{await e.delete(bp,wp,t)}}}async function nee(t,e){const n=await new ss(t).getAddress();return await e.set(bp,wp,n,t),Ak(n,e)}async function iee(t){const e=ss.createRandom();return nee(e.privateKey,t)}let Sk=function(t){return t[t.ECDSAP256K1=0]="ECDSAP256K1",t[t.ECDSAP256R1=1]="ECDSAP256R1",t}({});const Ep="seq-waas-session-p256r1",Ap="seq-waas-session";async function Ck(t,e,r){const n=await r.get(Ep,Ap,t);if(!n||!n.privateKey)throw new Error("No private key found");const i=new TextEncoder;return{sessionId:async()=>{const s=await e.exportKey("raw",n.publicKey),o=new Uint8Array(s.byteLength+1);return o[0]=Sk.ECDSAP256R1,o.set(new Uint8Array(s),1),fe(o)},sign:async s=>{typeof s=="string"&&(s.startsWith("0x")?(s=s.slice(2),s=ce(s)):s=i.encode(s));const o=await e.sign({name:"ECDSA",hash:{name:"SHA-256"}},n.privateKey,s);return fe(new Uint8Array(o))},clear:async()=>{await r.delete(Ep,Ap,t)}}}async function see(t,e,r){const n=await aee(e,t.publicKey);return await r.set(Ep,Ap,n,t),Ck(n,e,r)}async function oee(t,e){const r=await t.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"]);return see(r,t,e)}async function aee(t,e){const r=await t.exportKey("raw",e),n=new Uint8Array(r.byteLength+1);return n[0]=Sk.ECDSAP256R1,n.set(new Uint8Array(r),1),fe(n)}async function Sp(t,e,r){if(!r)throw new Error("No secure store available");return e?Ck(t,e,r):Ak(t,r)}async function lee(t,e){if(!e)throw new Error("No secure store available");return t?oee(t,e):iee(e)}const Cp=Object.entries(it).reduce((t,[e,r])=>(t[r.name]=r.chainId,t),{}),cee=Object.entries(Cp).reduce((t,[e,r])=>(t[r]=e,t),{});function kv(t){const e=typeof t=="number"?t:parseInt(t);if(e in cee)return e;const r=t.toString().toLowerCase();if(r in Cp)return Cp[r];throw new Error(`Unknown network: ${t}`)}const kk=()=>Pk()?new fee:null;function Pk(){return typeof window=="object"&&typeof window.crypto=="object"&&typeof window.crypto.subtle=="object"}class fee{constructor(){if(!Pk())throw new Error("window.crypto.subtle is not available")}async generateKey(e,r,n){return window.crypto.subtle.generateKey(e,r,n)}async exportKey(e,r){const n=await window.crypto.subtle.exportKey(e,r);return new Uint8Array(n)}async digest(e,r){const n=await window.crypto.subtle.digest(e,r);return new Uint8Array(n)}async sign(e,r,n){const i=await window.crypto.subtle.sign(e,r,n);return new Uint8Array(i)}async verify(e,r,n,i){return window.crypto.subtle.verify(e,r,n,i)}getRandomValues(e){const r=new Uint8Array(e);return window.crypto.getRandomValues(r)}}const Rk=()=>Tk()?new uee:null;function Tk(){return typeof indexedDB=="object"}class uee{constructor(){if(this.db=void 0,!Tk())throw new Error("IndexedDB is not available");this.db=null}async openDB(e,r,n){return this.db?this.db:(this.db=await vG(e,1,{upgrade(i){i.createObjectStore(r)}}),this.db)}async get(e,r,n){const i=await this.openDB(e,r,1),s=i.transaction(r,"readonly"),o=await i.get(r,n);return await s.done,o}async set(e,r,n,i){const s=await this.openDB(e,r,1),o=s.transaction(r,"readwrite");return await s.put(r,i,n),await o.done,!0}async delete(e,r,n){const i=await this.openDB(e,r,1),s=i.transaction(r,"readwrite");return await i.delete(r,n),await s.done,!0}}const dee="@0xsequence.waas.wallet",hee="@0xsequence.waas.session_id",vee="@0xsequence.waas.status",Ei=5*60;class yee{constructor(e={network:1},r=new Ek,n=kk(),i=Rk()){this.config=e,this.store=r,this.cryptoBackend=n,this.secureStoreBackend=i,this.VERSION="0.0.0-dev1",this.status=void 0,this.sessionId=void 0,this.wallet=void 0,this.sessionObservers=[],this.gettingSessionIdPromise=void 0,this.status=new Ad(this.store,vee,"signed-out"),this.sessionId=new Ad(this.store,hee,void 0),this.wallet=new Ad(this.store,dee,void 0)}async getAddress(){return this.getWalletAddress()}async getWalletAddress(){if(!await this.isSignedIn())throw new Error("Not signed in");const e=await this.wallet.get();if(!e)throw new Error("No wallet");return e}async commonArgs(e){var r;return zr({},e,{identifier:e==null?void 0:e.identifier,wallet:await this.getWalletAddress(),lifespan:(r=e==null?void 0:e.lifespan)!=null?r:Ei,chainId:kv(e.network||this.config.network)})}async signIntent(e){const r=await this.sessionId.get();if(r===void 0)throw new Error("session not open");const n=await Sp(r,this.cryptoBackend,this.secureStoreBackend);return mZ(n,e)}async signUsingSessionKey(e){const r=await this.sessionId.get();if(!r)throw new Error("session not open");return(await Sp(r,this.cryptoBackend,this.secureStoreBackend)).sign(e)}async getSessionId(){var e=this;if(this.gettingSessionIdPromise)return this.gettingSessionIdPromise;const r=async function(){let i=await e.sessionId.get();return i||(i=await(await lee(e.cryptoBackend,e.secureStoreBackend)).sessionId(),await e.sessionId.set(i),e.signalObservers(e.sessionObservers,i)),e.gettingSessionIdPromise=void 0,i};return this.gettingSessionIdPromise=r(),this.gettingSessionIdPromise}async signIn({idToken:e}){if(await this.status.get()!=="signed-out")throw await this.completeSignOut(),new Error("you are already signed in");const n=await this.getSessionId(),i=await PZ({idToken:e,sessionId:n,lifespan:Ei});return await this.status.set("pending"),this.signIntent(i)}onSessionStateChanged(e){return this.sessionObservers.push(e),()=>{this.sessionObservers=this.sessionObservers.filter(r=>r!=e)}}async signOut({lifespan:e,sessionId:r}={}){if(r=r||await this.sessionId.get(),!r)throw new Error("session not open");const n=G4({lifespan:e||Ei,sessionId:r});return this.signIntent(n)}async signOutSession(e){const r=G4({lifespan:Ei,sessionId:e});return this.signIntent(r)}async listSessions(){const e=MZ({lifespan:Ei,wallet:await this.getWalletAddress()});return this.signIntent(e)}async completeSignOut(){await Promise.all([this.status.set("signed-out"),this.wallet.set(void 0),this.sessionId.set(void 0)]),this.signalObservers(this.sessionObservers,null)}async completeSignIn(e){if(e.result)return this.completeSignIn(e.result);const r=await this.status.get();if(e.code!=="sessionOpened")throw new Error("Invalid receipt");if(r!=="pending")throw new Error("No pending sign in");return await Promise.all([this.status.set("signed-in"),this.wallet.set(e.data.wallet)]),e.data.wallet}async isSignedIn(){return await this.status.get()==="signed-in"}async sessionAuthProof(e){var r;const n=_Z({lifespan:(r=e.lifespan)!=null?r:Ei,network:kv(e.network||this.config.network).toString(),wallet:await this.getWalletAddress(),nonce:e.nonce});return this.signIntent(n)}async signMessage(e){var r;const n=bZ(zr({chainId:kv(e.network||this.config.network)},e,{lifespan:(r=e.lifespan)!=null?r:Ei,wallet:await this.getWalletAddress()}));return this.signIntent(n)}async sendTransaction(e){const r=au(await this.commonArgs(e));return this.signIntent(r)}async getTransactionReceipt(e){const r=QZ(await this.commonArgs(e));return this.signIntent(r)}async sendERC20(e){if(e.token.toLowerCase()===e.to.toLowerCase())throw new Error("Cannot burn tokens using sendERC20");const r=YZ(await this.commonArgs(e));return this.signIntent(r)}async sendERC721(e){if(e.token.toLowerCase()===e.to.toLowerCase())throw new Error("Cannot burn tokens using sendERC721");const r=JZ(await this.commonArgs(e));return this.signIntent(r)}async sendERC1155(e){if(e.token.toLowerCase()===e.to.toLowerCase())throw new Error("Cannot burn tokens using sendERC1155");const r=XZ(await this.commonArgs(e));return this.signIntent(r)}async callContract(e){const r=ZZ(await this.commonArgs(e));return this.signIntent(r)}async feeOptions(e){const r=GZ(await this.commonArgs(e));return this.signIntent(r)}async validateSession({deviceMetadata:e}){const r=await this.sessionId.get();if(!r)throw new Error("session not open");const n=await RZ({lifespan:Ei,sessionId:r,deviceMetadata:e,wallet:await this.getWalletAddress()});return this.signIntent(n)}async getSession(){const e=await this.sessionId.get();if(!e)throw new Error("session not open");const r=IZ({sessionId:e,wallet:await this.getWalletAddress(),lifespan:Ei});return this.signIntent(r)}async finishValidateSession(e,r){const n=await this.sessionId.get();if(!n)throw new Error("session not open");const i=await this.getWalletAddress(),s=TZ({sessionId:n,wallet:i,lifespan:Ei,salt:e,challenge:r});return this.signIntent(s)}async batch(e){const r=tee(e);return this.signIntent(r)}signalObservers(e,r){e.forEach(n=>n(r))}async updateIntentTime(e,r){const n=xZ(e,r);return this.signIntent(n)}}const pee={rpcServer:"http://localhost:9123",emailRegion:"us-east-2"};class mee{constructor(e,r){this.region=e,this.clientId=r,this.cognitoMemo=void 0}cognito(){return this.cognitoMemo||(this.cognitoMemo=new dX({region:this.region})),this.cognitoMemo}signUp(e){return this.cognito().send(new vZ({ClientId:this.clientId,Username:e,Password:"aB1%"+gee(14),UserAttributes:[{Name:"email",Value:e}]}))}signIn(e){return this.cognito().send(new dZ({AuthFlow:"CUSTOM_AUTH",ClientId:this.clientId,AuthParameters:{USERNAME:e}}))}async initiateAuth({email:e}){let r;try{r=await this.signIn(e)}catch(n){if(n instanceof M0&&n.message.includes("user not found"))await this.signUp(e),r=await this.signIn(e);else throw n}if(!r.Session)throw new Error("response session is empty");return{instance:r.Session,email:e}}async finalizeAuth({instance:e,email:r,answer:n,sessionHash:i}){const s=await this.cognito().send(new hZ({ClientId:this.clientId,Session:e,ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:{USERNAME:r,ANSWER:n},ClientMetadata:{SESSION_HASH:i}}));if(!s.AuthenticationResult||!s.AuthenticationResult.IdToken)throw new Error("AuthenticationResult.IdToken is empty");return{idToken:s.AuthenticationResult.IdToken}}}function gee(t){return Array.from(xee(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}function xee(t){const e=new Uint8Array(t);if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto.getRandomValues(e);{console.warn("window.crypto.getRandomValues is not available. Falling back to less secure Math.random().");const r=new Uint8Array(t);for(let n=0;n{this.validationRequiredCallback=this.validationRequiredCallback.filter(r=>r!==e)}}async handleValidationRequired({onValidationRequired:e}={}){var r;if(!(e?e():!0))return!1;const i=await this.waas.validateSession({deviceMetadata:(r=await this.deviceName.get())!=null?r:"Unknown device"}),s=await this.sendIntent(i);this.validationRequiredSalt=s.data.salt;for(const o of this.validationRequiredCallback)o();return this.waitForSessionValid()}headers(){return{"X-Access-Key":this.config.projectAccessKey}}async sendIntent(e){if(!await this.waas.getSessionId())throw new Error("session not open");try{return(await this.client.sendIntent({intent:e},this.headers())).response}catch(n){if(Q4(n)&&this.lastDate){const i=await this.waas.updateIntentTime(e,this.lastDate);return(await this.client.sendIntent({intent:i},this.headers())).response}throw n}}async isSignedIn(){return this.waas.isSignedIn()}async signIn(e,r){const n=await this.waas.signIn({idToken:e.idToken});if(!xG(e.idToken).iss)throw new Error("Invalid idToken");await this.deviceName.set(r);try{const s=await this.registerSession(n,r);return await this.waas.completeSignIn({code:"sessionOpened",data:{sessionId:s.session.id,wallet:s.response.data.wallet}}),{sessionId:s.session.id,wallet:s.response.data.wallet}}catch(s){throw await this.waas.completeSignOut(),s}}async registerSession(e,r){try{return await this.client.registerSession({intent:e,friendlyName:r},this.headers())}catch(n){if(Q4(n)&&this.lastDate){const i=await this.waas.updateIntentTime(e,this.lastDate);return await this.client.registerSession({intent:i,friendlyName:r},this.headers())}throw n}}async refreshSession(){throw new Error("Not implemented")}async getSessionId(){return this.waas.getSessionId()}async getSessionHash(){const e=(await this.waas.getSessionId()).toLowerCase();return Et(sr(e))}async dropSession({sessionId:e,strict:r}={}){const n=await this.waas.getSessionId();if(!n)throw new Error("session not open");const i=e||n;try{const s=await this.waas.signOutSession(i),o=await this.sendIntent(s);if(!UZ(o))throw new Error(`Invalid response: ${JSON.stringify(o)}`)}catch(s){if(r)throw s;console.error(s)}if(i===n){if(!this.secureStoreBackend)throw new Error("No secure store available");(await Sp(n,this.cryptoBackend,this.secureStoreBackend)).clear(),await this.waas.completeSignOut(),await this.deviceName.set(void 0)}}async listSessions(){const e=await this.waas.getSessionId();if(!e)throw new Error("session not open");const r=await this.waas.listSessions();return(await this.sendIntent(r)).data.map(i=>zr({},i,{isThis:i.id===e}))}async getAddress(){return this.waas.getAddress()}async validateSession(e){return await this.isSessionValid()?!0:this.handleValidationRequired(e)}async finishValidateSession(e){const r=await this.waas.finishValidateSession(this.validationRequiredSalt,e),n=await this.sendIntent(r);if(!FZ(n))throw new Error(`Invalid response: ${JSON.stringify(n)}`);return this.validationRequiredSalt="",n.data.isValid}async isSessionValid(){const e=await this.waas.getSession(),r=await this.sendIntent(e);if(!zZ(r))throw new Error(`Invalid response: ${JSON.stringify(r)}`);return r.data.validated}async waitForSessionValid(e=6e5,r=2e3){const n=Date.now();for(;Date.now()-nsetTimeout(i,r))}return!1}async sessionAuthProof({nonce:e,network:r,validation:n}){const i=await this.waas.sessionAuthProof({nonce:e,network:r});return await this.trySendIntent({validation:n},i,jZ)}async useIdentifier(e){if(e.identifier)return e;const r=`ts-sdk-${Date.now()}-${await this.waas.getSessionId()}`;return zr({},e,{identifier:r})}async trySendIntent(e,r,n){const i=await this.sendIntent(r);if(n(i))return i;if($Z(i)&&await this.handleValidationRequired(e.validation)){const o=await this.sendIntent(r);if(n(o))return o}throw new Error(JSON.stringify(i))}async signMessage(e){const r=await this.waas.signMessage(await this.useIdentifier(e));return this.trySendIntent(e,r,LZ)}async trySendTransactionIntent(e,r){let n=await this.trySendIntent(r,e,K4);for(;xk(n);){await new Promise(o=>setTimeout(o,1e3));const i={metaTxHash:n.data.metaTxHash,network:e.data.network,identifier:e.data.identifier,validation:r.validation},s=await this.waas.getTransactionReceipt(await this.useIdentifier(i));n=await this.trySendIntent(i,s,K4)}return n}async sendTransaction(e){const r=await this.waas.sendTransaction(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async sendERC20(e){const r=await this.waas.sendERC20(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async sendERC721(e){const r=await this.waas.sendERC721(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async sendERC1155(e){const r=await this.waas.sendERC1155(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async callContract(e){const r=await this.waas.callContract(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async feeOptions(e){const r=await this.waas.feeOptions(await this.useIdentifier(e));return this.trySendIntent(e,r,BZ)}async networkList(){const e=[],r=await this.client.chainList({"X-Access-Key":this.config.projectAccessKey});for(const n of r.chains)e.push({id:n.id,name:n.name,isEnabled:n.isEnabled});return e}onSessionStateChanged(e){return this.waas.onSessionStateChanged(e)}async fetch(e,r){const n=await window.fetch(e,r),i=n.headers.get("date");return i&&(this.lastDate=new Date(i)),n}}async function _0({transactions:t,network:e}){const r=await st.feeOptions({transactions:t,network:e==null?void 0:e.id});return r.data.feeQuote&&r.data.feeOptions?{feeQuote:r.data.feeQuote,feeOptions:r.data.feeOptions,isSponsored:!1}:{feeQuote:r.data.feeQuote,feeOptions:r.data.feeOptions,isSponsored:!0}}function O0(t){var s;const{feeOptions:e,onSelected:r}=t,[n,i]=p.useState();return p.useEffect(()=>{e&&e.length>0&&(i(e[0]),r(e[0]))},[e]),p.useEffect(()=>{n&&r(n)},[n]),e?$.jsxs(re,{marginTop:"5",children:[$.jsx(Pe,{variant:"normal",fontWeight:"bold",children:"Fee options:"}),$.jsx(re,{marginTop:"3"}),$.jsx(d0,{name:"chainId",labelLocation:"top",onValueChange:o=>{const a=e.find(l=>l.token.name===o);a&&i(a)},value:(s=n==null?void 0:n.token)==null?void 0:s.name,options:[...e.map(o=>{var a,l,c;return{label:$.jsx(re,{alignItems:"center",gap:"2",children:$.jsxs(Pe,{children:[(a=o==null?void 0:o.token)==null?void 0:a.name," ",Gg(o==null?void 0:o.value,(l=o==null?void 0:o.token)==null?void 0:l.decimals)]})}),value:String((c=o==null?void 0:o.token)==null?void 0:c.name)}})]})]}):$.jsx(re,{})}const Aee="3XwfKaFvrgRIZ6om79SxYoTAAAAAAAAAA";function See(t){const[e,r]=p.useState(),[n,i]=p.useState("ETH"),[s,o]=p.useState(""),[a,l]=p.useState(""),[c,f]=p.useState(""),[u,d]=p.useState(),[v,g]=p.useState(!1),[y,w]=p.useState(),[x,b]=p.useState(),[S,P]=p.useState(),[_,D]=p.useState(),[M,L]=p.useState(!1);p.useEffect(()=>{z()},[]),p.useEffect(()=>{var Z,O;if(t.network){const h=DE(t.network.name);if(h){const A=h.name in{polygon:1,mumbai:1}?"MATIC":"ETH";i(A),z(),(Z=h.blockExplorer)!=null&&Z.rootUrl&&o((O=h.blockExplorer)==null?void 0:O.rootUrl)}}},[t.network]);const z=async()=>{if(!t.network)return;const Z=DE(t.network.name);if(!Z)return;const O=await st.getAddress(),A=await new JC(P9(Z.name),Aee).getEtherBalance({accountAddress:O});r(ae.from(A.balance.balanceWei))},H=async(Z,O)=>{const h=await _0({transactions:[{to:Z,value:NE(O)}],network:t.network});if(h.feeQuote&&h.feeOptions){b(h.feeOptions),D(h.feeQuote),console.log("feeOptions",h);return}L(!0),console.log("tx sponsored")},Y=async(Z,O)=>{var h;try{w(void 0),g(!0);const A=await st.sendTransaction({transactions:[{to:Z,value:NE(O)}],network:(h=t.network)==null?void 0:h.id,transactionsFeeOption:S,transactionsFeeQuote:_});ou(A)?d(A.data.txHash):w(A.data.error),g(!1)}catch(A){console.error(A),g(!1)}finally{D(void 0),b(void 0),P(void 0),L(!1)}};return $.jsxs(re,{children:[$.jsxs(Pe,{variant:"normal",fontWeight:"bold",children:["Native token balance: ",WW(e||0)," ",n]}),$.jsx(pr,{marginLeft:"2",size:"xs",label:"Fetch",onClick:z}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"sendNativeTokenTo",type:"text",onChange:Z=>{l(Z.target.value)},value:a,placeholder:"To address 0x...",required:!0,"data-id":"nativeTokenSendAddress"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"sendNativeTokenAmount",type:"text",onChange:Z=>{f(Z.target.value)},value:c,placeholder:"Amount",required:!0,"data-id":"nativeTokenSendAmount"})}),y&&$.jsxs(re,{marginTop:"3",children:["Transaction failed: ",y]}),$.jsx(O0,{feeOptions:x,onSelected:P}),M&&$.jsx(re,{marginTop:"5",children:$.jsx(Pe,{variant:"normal",fontWeight:"bold",children:"Fee options: Tx Sponsored!"})}),v?$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:$.jsx(zi,{})}):$.jsxs(re,{children:[$.jsx(pr,{marginTop:"5",marginRight:"2",label:"Check fee options",disabled:a===""&&c==="",onClick:()=>H(a,c)}),$.jsx(pr,{marginTop:"5",label:"Send native token",disabled:a===""&&c==="",onClick:()=>Y(a,c)})]}),u&&$.jsxs(re,{marginTop:"3",children:[$.jsx(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:"Send native token transaction hash:"}),$.jsx("br",{}),$.jsx("a",{href:`${s}tx/${u}`,target:"_blank",rel:"noopener noreferrer",children:u})]})]})}function Cee(){const[t,e]=p.useState(),[r,n]=p.useState(),[i,s]=p.useState(!0),[o,a]=p.useState(),l=async c=>{s(!0),e(void 0);try{await st.dropSession({sessionId:c}),e(await st.listSessions())}catch(f){a(f.message),e(await st.listSessions())}s(!1)};return p.useEffect(()=>{Promise.all([st.listSessions(),st.getSessionId()]).then(([c,f])=>{e(c),n(f),s(!1)}).catch(c=>{a(c.message),s(!1)})},[]),$.jsxs(re,{children:[$.jsxs(re,{marginBottom:"5",children:[$.jsx(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:"Your open sessions"}),t&&$.jsx($.Fragment,{children:t.map(c=>$.jsxs(re,{children:[c.friendlyName,!c.isThis&&$.jsx("a",{style:{marginLeft:"7px",textDecoration:"underline",cursor:"pointer"},onClick:()=>l(c.id),children:"x"}),c.isThis&&$.jsx($.Fragment,{children:" (current)"})]},c.id))}),i&&$.jsx(zi,{})]}),o&&$.jsxs(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:["Error loading sessions: ",o]})]})}function kee(t){const[e,r]=p.useState(""),[n,i]=p.useState(),s=async()=>{var a;const o=await st.signMessage({message:e,network:(a=t.network)==null?void 0:a.id});i(o.data.signature)};return $.jsxs(re,{children:[$.jsx(Pr,{name:"signMessageText",type:"text",onChange:o=>{r(o.target.value),n!=""&&i("")},value:e,placeholder:"Enter a message to sign",required:!0,"data-id":"signMessageInput"}),$.jsx(pr,{marginTop:"5",label:"Sign message",disabled:e==="",onClick:()=>s()}),n&&n!==""&&$.jsxs(re,{flexDirection:"column",marginTop:"5",children:[$.jsxs(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:["Signature for ",e,":"]}),$.jsx(re,{children:$.jsx(Pe,{as:"p",wordBreak:"break-word",children:n})})]})]})}function Pee(t){const[e,r]=p.useState(""),[n,i]=p.useState(""),[s,o]=p.useState(""),[a,l]=p.useState(""),[c,f]=p.useState(),[u,d]=p.useState(!1),[v,g]=p.useState(),[y,w]=p.useState(),[x,b]=p.useState(),[S,P]=p.useState(),[_,D]=p.useState(!1),M=async()=>{const z=await _0({transactions:[bk({to:e,abi:n,func:s,args:JSON.parse(a),value:"0"})],network:t.network});if(z.feeQuote&&z.feeOptions){w(z.feeOptions),P(z.feeQuote),console.log("feeOptions",z);return}D(!0),console.log("tx sponsored")},L=async()=>{var z;try{g(void 0),d(!0);const H=await st.callContract({network:(z=t.network)==null?void 0:z.id,to:e,abi:n,func:s,args:JSON.parse(a),value:0,transactionsFeeOption:x,transactionsFeeQuote:S});ou(H)?f(H.data.txHash):g(H.data.error),d(!1)}catch(H){console.error(H),d(!1)}};return $.jsxs(re,{children:[$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"callContractAddress",type:"text",onChange:z=>{r(z.target.value)},value:e,placeholder:"Contract address 0x...",required:!0,"data-id":"nativeTokenSendAddress"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"callContractAbi",type:"text",onChange:z=>{i(z.target.value)},value:n,placeholder:"Contract ABI or function ABI, e.g. [{...}] or [{...}, {...}] or transfer(address,uint256)",required:!0,"data-id":"nativeTokenSendAmount"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"callContractMethod",type:"text",onChange:z=>{o(z.target.value)},value:s,placeholder:"Method name, e.g. transfer",required:!0,"data-id":"nativeTokenSendAmount"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"callContractArgs",type:"text",onChange:z=>{l(z.target.value)},value:a,placeholder:'Method args, e.g. [0x..., 1000] or named { "to": "0x...", "amount": "1000" }',required:!0,"data-id":"nativeTokenSendAmount"})}),$.jsx(O0,{feeOptions:y,onSelected:b}),_&&$.jsx(re,{marginTop:"5",children:$.jsx(Pe,{variant:"normal",fontWeight:"bold",children:"Fee options: Tx Sponsored!"})}),v&&$.jsxs(re,{marginTop:"3",children:["Transaction failed: ",v]}),u?$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:$.jsx(zi,{})}):$.jsxs(re,{children:[$.jsx(pr,{marginTop:"5",marginRight:"2",label:"Check fee options",disabled:e===""&&n===""&&s===""&&a==="",onClick:()=>M()}),$.jsx(pr,{marginTop:"5",label:"Call contract",disabled:e===""&&n===""&&s===""&&a==="",onClick:()=>L()})]}),c&&$.jsxs(re,{marginTop:"3",children:[$.jsx(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:"Send native token transaction hash:"}),$.jsx("br",{}),$.jsx("a",{href:`https://polygonscan.com/tx/${c}`,target:"_blank",rel:"noopener noreferrer",children:c})]})]})}const Y4=[{label:"Custom Token",value:"Custom"},{label:"USDC Old",value:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"},{label:"USDC New",value:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"},{label:"DAI",value:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063"}];function Ree(t){const[e,r]=p.useState(Y4[0].value),[n,i]=p.useState(""),[s,o]=p.useState(!0),[a,l]=p.useState("---"),[c,f]=p.useState(""),[u,d]=p.useState(""),[v,g]=p.useState(""),[y,w]=p.useState(""),[x,b]=p.useState(!1),[S,P]=p.useState(0),[_,D]=p.useState(),[M,L]=p.useState(),[z,H]=p.useState(),[Y,Z]=p.useState(!1);p.useEffect(()=>{O(n)},[n]);const O=async I=>{if(!Ez(I)){l("---");return}l("...");const R=new LH(I,["function balanceOf(address) view returns (uint256)","function decimals() view returns (uint8)","function symbol() view returns (string)"],Uee),[N,j,C]=await Promise.all([R.balanceOf(st.getAddress()),R.decimals(),R.symbol()]);P(j),l(`${Gg(N,j)} ${C}`)},h=async()=>{const I=await _0({transactions:[cb({token:n,to:c,value:Lf(u,S).toString()})],network:t.network});if(I.feeQuote&&I.feeOptions){D(I.feeOptions),H(I.feeQuote),console.log("feeOptions",I);return}Z(!0),console.log("tx sponsored")},A=async()=>{var I;try{w(""),b(!0);const R=await st.sendERC20({token:n,to:c,value:Lf(u,S),network:(I=t.network)==null?void 0:I.id,transactionsFeeOption:M,transactionsFeeQuote:z});ou(R)?g(R.data.txHash):w(R.data.error)}catch(R){console.error(R)}finally{b(!1)}},k=I=>{r(I),I==="Custom"?(i(""),o(!0)):(i(I),o(!1))};return $.jsxs(re,{children:[$.jsxs(re,{marginTop:"5",children:[$.jsx(d0,{name:"token",options:Y4,value:e??"",onValueChange:I=>k(I)}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{type:"text",value:n,disabled:!s,onChange:I=>i(I.target.value),placeholder:"Custom ERC20 Contract Address"})})]}),$.jsxs(re,{marginTop:"3",children:[$.jsxs(Pe,{variant:"normal",children:["Token Balance: ",a]}),$.jsx(pr,{marginLeft:"2",size:"xs",label:"Fetch",onClick:()=>O(n)})]}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{type:"text",value:c,onChange:I=>f(I.target.value),placeholder:"Destination Address"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{type:"text",value:u,onChange:I=>d(I.target.value),placeholder:"Amount"})}),y&&$.jsx(re,{marginTop:"3",children:$.jsxs(Pe,{color:"error",children:["Error: ",y]})}),$.jsx(O0,{feeOptions:_,onSelected:L}),Y&&$.jsx(re,{marginTop:"5",children:$.jsx(Pe,{variant:"normal",fontWeight:"bold",children:"Fee options: Tx Sponsored!"})}),x?$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:$.jsx(zi,{})}):$.jsxs(re,{children:[$.jsx(pr,{marginTop:"5",marginRight:"2",label:"Check fee options",disabled:n===""&&c==="",onClick:()=>h()}),$.jsx(pr,{marginTop:"5",label:"Send Token",onClick:A})]}),v&&$.jsxs(re,{marginTop:"3",children:[$.jsx(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:"Transaction Hash:"}),$.jsx("a",{href:`https://polygonscan.com/tx/${v}`,target:"_blank",rel:"noopener noreferrer",children:v})]})]})}const Tee="3XwfKaFvrgRIZ6om79SxYoTAAAAAAAAAA";function Mee(t){var a;const[e,r]=p.useState(""),[n,i]=p.useState("");p.useEffect(()=>{t.onChange(t.index,e,n)},[e,n]);const s={display:"flex",gap:"10px",marginBottom:"10px"},o={flex:1};return $.jsxs(re,{style:s,children:[$.jsx(re,{style:o,children:$.jsx(d0,{name:`sendERC1155TokenId${t.index}`,value:e,disabled:!t.options,onValueChange:l=>{r(l)},options:((a=t.options)==null?void 0:a.balances.map(l=>{var c;return{label:`${((c=l.tokenMetadata)==null?void 0:c.name)||"Unknown"} - ${l.balance}`,value:l.tokenID}}))||[],placeholder:"Select a token"})}),$.jsx(re,{style:o,children:$.jsx(Pr,{type:"text",value:e,onChange:l=>r(l.target.value),placeholder:"Token ID"})}),$.jsx(re,{style:o,children:$.jsx(Pr,{type:"text",value:n,onChange:l=>i(l.target.value),placeholder:"Amount"})}),$.jsx(re,{style:o,children:$.jsx(pr,{label:"Remove",onClick:()=>t.removeTokenEntry(t.index)})})]})}function Iee(t){const[e,r]=p.useState(""),[n,i]=p.useState([]),[s,o]=p.useState(""),[a,l]=p.useState(""),[c,f]=p.useState(""),[u,d]=p.useState(!1),[v,g]=p.useState(void 0),[y,w]=p.useState(),[x,b]=p.useState(),[S,P]=p.useState(),[_,D]=p.useState(!1),M=()=>{i([...n,{tokenId:"",amount:""}])},L=async()=>{if(!e||!t.network)return;const O=t.network.name,h=new JC("https://"+O+"-indexer.sequence.app",Tee),A=e,k=await st.getAddress(),I=!0;g(await h.getTokenBalances({contractAddress:A,accountAddress:k,includeMetadata:I}))};p.useEffect(()=>{L()},[e]);const z=(O,h)=>{const A=[...n];A[O]=h,i(A)},H=O=>{const h=[...n];h.splice(O,1),i(h)},Y=async()=>{const O=await _0({transactions:[fb({to:s,token:e,values:n.map(h=>({id:h.tokenId,amount:Lf(h.amount,0)}))})],network:t.network});if(O.feeQuote&&O.feeOptions){w(O.feeOptions),P(O.feeQuote),console.log("feeOptions",O);return}D(!0),console.log("tx sponsored")},Z=async()=>{var O;try{f(""),d(!0);const h=await st.sendERC1155({to:s,token:e,values:n.map(A=>({id:A.tokenId,amount:Lf(A.amount,0)})),network:(O=t.network)==null?void 0:O.id,transactionsFeeOption:x,transactionsFeeQuote:S});ou(h)?l(h.data.txHash):f(h.data.error)}catch(h){console.error(h)}finally{d(!1)}};return $.jsxs(re,{children:[$.jsx(re,{marginBottom:"5",children:$.jsx(Pr,{type:"text",value:e,onChange:O=>r(O.target.value),placeholder:"Token Contract Address"})}),$.jsx(re,{marginBottom:"5",children:$.jsx(pr,{label:"Fetch metadata",onClick:()=>L()})}),n.map((O,h)=>$.jsx(re,{marginBottom:"3",children:$.jsx(Mee,{index:h,options:v,onChange:(A,k,I)=>z(A,{tokenId:k,amount:I}),removeTokenEntry:H})},h)),$.jsx(pr,{label:"Add Token",onClick:M}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{type:"text",value:s,onChange:O=>o(O.target.value),placeholder:"Destination Address"})}),c&&$.jsx(re,{marginTop:"3",children:$.jsxs(Pe,{color:"error",children:["Error: ",c]})}),$.jsx(O0,{feeOptions:y,onSelected:b}),_&&$.jsx(re,{marginTop:"5",children:$.jsx(Pe,{variant:"normal",fontWeight:"bold",children:"Fee options: Tx Sponsored!"})}),u?$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:$.jsx(zi,{})}):$.jsxs(re,{children:[$.jsx(pr,{marginTop:"5",marginRight:"2",label:"Check fee options",disabled:e===""&&s===""&&n.length!==0,onClick:()=>Y()}),$.jsx(pr,{marginTop:"5",label:"Send Tokens",onClick:Z})]}),a&&$.jsxs(re,{marginTop:"3",children:[$.jsx(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:"Transaction Hash:"}),$.jsx("a",{href:`https://polygonscan.com/tx/${a}`,target:"_blank",rel:"noopener noreferrer",children:a})]})]})}const Qu="data:image/png;base64,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",J4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAADYlJREFUeJztnQuUlVUVx0cGeSlqJJRWdkcQERQln4SKmUgRGqCt1BIrUMtXaTJpCWZCttQ0ExhTi0fIQ1vioPEYW/kAREdQMwVU1CyFSBLlqbz+7f8939gd5t7vfHfu980+996z1/qtNWvBd75z9t73PPbZ53wVFSUmqEy1QetUD2GoMEqYIDwkLBZWCquFjcI2AQH8e4OwRlgR/N9aYbxQLQyTcnsJbbXb5yVD0C7VSoxTJQwXJgpLhS0Zho0bll0v1KTfWSnvrki10tZDWYkoff/A4LOEdcKuBA1uY1dQh1lBnfbX1k9JCvZM7SPKHSHUCdsVDW6DdVsgjBRH3Udbb0Uvosi+wuSEu/Wk2CxMFfpp67GoRBTWQegNMwnTNmJc1AZtaq+tX2clMPwg4c8w46q20eLmXWGeMESGh7219e2McGklShkYGH6zA4ZKmq3CfGGAtL2dtv7VRBTAJVwf4T6YNbi2YVoaxiKmBToor6WkeH5nafQYmMCLtiG0WZ3WRWWqi7ZdEhdpZGuw6zORtp0OKN8VdghLYIaF1tp2SkRgInZjhfccULirrBfGUVfa9opNUJHaQ7x6sDRqVeDp2kp2nR2BrgZTd9r2K0jQKr20Gy1sckCxxQYnideJDoszdiCV50RvOvxYXwi7Ah0W1wRRKtxVWOiAAkuFRUI3bbtGEhnv2e3Pc0BppcZc6lbbvqEi41UnmP1ybWWVKvXUsbads0pg/GUOKKnUWeacE3jjl7ETBGO+7/ZbnmfU5wRSiW7g5ERfGeUKJ9tddYxfmeoCszzRVkK5w+V255Y1fqtUe5gAhXbjPYbpLTYcpGP7DFHqZuN6GsNo6+gW2TuQF50BE6fWbrSnMdxvGZy08bmlu8qBxnqyQ9sks5UcJHNwr9pv6boLbTM2kaQSmEye9Q400hMOE24GxGt8s+Rb4kDjPNFgyl08S0OY7N3r4bv+YoKrAibdFp5tDJO2vNqBRnnygxnXfQozfmWqHUzevnZjPM2Dtmv+nQYwEz+/5i9eeOBmYHN//XvDHGHSboSnMHjkLv8wMXiI0Zxj026ApzB43nJQvr9+bvb4vL7SIb9eQByAZ9nfdaDinnjgcfve+XT/pXQ5g8dQG9X4/RyorCcZ+kZxgKkOVNSTDJPCjV+Zvo2rHG7pKFd42VbHsF//SAcq6UmWEWEOUOdABT3JUpfL+LyB0+VLGD3xQBs3vdEU5qpT7cp5Wobh2RxglgMVi8Ze3YGTzgIu+Rlw4x3APdOBmbXArIeBKQ8At9wFXHwNcMwgoF23wt7VXp7v9WXg6EH5c8QA4IAv6OurKTMbG78infTh9uWMe1YBZ34PqF0AbNyMyPL2GuD2e4Dep+f/TjrPtAejvyuXbNgEPPkMcMcfgP5nA227autzHW9az1z+MdvX3Tz/7v2BiVOBd/7dPANs2w68/CpQPQ74xOHR3/vZY4GVrxfuAA2ycyfw+lvAbXcDPU4Rp1bTKW1dldn9uzn+85fynauAt96OxwC7dgHzHwcOOj7a+/t+Pb/eJh957U3g3Eull1HrDYZnOkCNurF3h93vDbcDH34Uv/IXLwU6H2mvw3d/HP+7M+X9DcDwH5nhreV1PDHTAZ5VN3gmVMj1vwa270hO+XffZ1d8zdTk3t8g//gXcPhpGnp+tsH4vKzZnfv42x8CnH1xMr/8TOG84Pgzc9djr0OBRfXJ1qFBxt2poest/L4SHaCXutEz+er5ZuYeRThBmyHLvytvAL59BXDRT4AJU4A33or2/L0zctfjkJNk7vFO+PP1L5iZ/e7cOcnUa/lr0eqx5Dlg38M09N2DDjBM3egNdDoCeOwpu8I2yrJqzK0ySz8OaHNw4zI4s2aX+tRSezlcVeQaBk79JvCRpRcacXV4ew48xjiCTeiwVV/U0PlQOkC1uuEbOOsie9f/0TaZnF1lH7+/dgGw9UO78j/VJ/vz7FXChKsDrhJsbeo9wF4H9niH9tfQ+Sg6wHh1w5MOMvbPedSurJo/Rps1c6n36hv28nqe2vRZ9iL3zQ5/7hUZfj53nL0e+/W014Gxgaq+Gnqf4E76F38p/1kXrij+6hiciVJep8OB5/5uV/5hX8r+7DLLswueiBbR697fXgfOJfbtqaH32XSAxerGJxdcaQI1YTKnLnp5+/cGXnjZrvxssXo6hS3q+Jt7o9XjvMvtdZg2W0vvi+gAK9SNT7ihY5PLR0cvj5Oq1y2rgS1bsw8np50LbN8e/iwdNko9Fjxub9cPfqql9xV0AP3PtuzXC1j6ol1R2cbrXBw3GNiwMby851/O/ix3E8OEq5Djz7DXwTaRpKyVYe8IlUAQWU0H0P9gExWw1jL+r16bX5nnXmZXPreOsz1rmzyuXBU+F+GMftL99vdTZs7R3B3cSAfYpvTy/zP0Qvv4/8Aj+ZV5s+VXTLnqF02f42zcJpyMcuL29PNNefOf9rY0CPcCTj5bU/fbKtSNT24ab1fW1TdGL6/twcCjC+1lnvKNps+ec2k048Uht96ltRH0MfoOQGPVPWlX1slnRS/zoBPMdmuYcKMp29Lrlt/FYlurzHsM+GRv9R+f/hAQJemCxurYI3qZJw6zRwGfeyn7s088HZuNc8ojfwE+7USqWHoI0L0A4liZrX9gma2/9Ep+ZV4xxm4Ebhrt/hwnY0klgFDWfwBc+6v8nDlZNtABdO//OecSu+KYlxe1PI6p9z9iL5Nj/e7P9vlK4UbeXTghZALK968FUirh3jDW0AFWqlbi57fZlcjkkKjlMT7/imVIYW7egUc3fZbbyTbhErC2Ljf3P2z2K/hLHzLCla4+F8v1Q8ETI2TdZFuu5YKZw7Yo3t+WZ392/GR7XUaM0jZanCymAzykWonJD9iVPvrWaGVxbH1wnr28sb/N/vxCSwbQ1q3mPIK+4eKilg4wQbUSzM2zCY1qK4eJIRdWm/h+mDCfoPvJTZ9nKhrz98OEiRsHqyRuJMV4OsAo1UpwfLcJjcrYfq4yeFKISSK27WTKrDnZy+BJHptwici8BX3DxUW1fkpYesyOkP3L7FmmUDPOzi1cTuK4OTRouDkStnmLvYxNssQ7MscJIc7SbcJ8P32jxckwngrqoVqJz59gn7U3CGfvTJ/iKR8mXK5Za8/by5Sxd+Sux+9n2p8//4faBoubnvz+TxtopoU3nAGgcZMSrgoYSwjLunlxRXgZDFaFDUPFB23e1o2DIQccHS0buLnGZ/p3p5Azgfw329LRtgVcfDybeTJoonqFODZzizVO4byAJ4OZbh727lPPsZc1969m40pbT/FR497h0K4nAlP/FG02HyY7ZFL5/EvAeZeZFYLtvdfcZC9T5/ROkmQcDnXpePjehwJHDTThVOb05TM3WPeeGUp4OQQPZUR9py0CyPjA6d/S10187KLN3b4ggpNDRt1urjERuv++39Qw3GhhVg1TuDnO83hYl6PyfxeTQGcEN4zsDlO2qn8J7KNydCsp1tHmxXdFDI3wmWNM2hbjAB26q2fUFCmNr4hxah7gaQmyXhLlr4krD7JfExc4waMOVNCTLAuyGj9wgBEOVNCTLCPDHKAjXLotxBM3m3kheE4HCJxgsgMV9STDlFDjBw7Q14GKepKhn9UBAidw484AT5xE+2RM4AD8aJRbkUFPIfADYHl9NKoDzKfGtCvuiYe5QvvIDhA4wSD4z8eUAvz455C8jO97gZJiPj8DnLcDBE4wEC5cIOFpLjz3OaBZxg8cgNfI+s/HFy/T5NffrtkOEDhBH7hwj5AnX3jot09Bxg8cgMkiY4SdDjTKE40dgc1a2S0czQk6Q/sQqScflkjX3yUW42c4wQDhPQca5wlnPQqZ+OV0gMpUayl4LEz3ot1IT3Zom3G0VewOkHaC1uns4VUONNSTHdqmym7JQpygMjVYXrLJgcZ6GsM1/+BEjZ92gIrUHvKi0fCrApegLa6jbRJ3gLQTVKbDxNMdaLjHMB2t8tzsKdgJzNJwoQONL3cWxb7ky8MJugrzHFBCucJt3m4qxv/YCcxw8IwDyig36ql7VeM3iIw/naRCyxxQSrmwjDrXtnsj8U5QxsZvkMAJ6h1QUqlS76zxGySYE8x1QFmlxjxnxnybSGW7gcsTfaWVClxud9W2a14iFe4izIArN48UJ4zwMeDWWduezRJGp8AQpfY3CYoT7reMFh0WR7efS4K9A24gcafKbyXb2ZHWFTfdWiq23xICs5U8DiZhQVvJrsKEG+ZcJLulqyVBUgkzi5bA9waZcKxfnNZNUskcLgk3L2CSFnU/V+MGawJdFOdEr7kCk23MlPNpKM9J4oag7dRBPNm7xSg8uAAzLMyHOcembZik4XlLHrkbKG1vq61/Z4Tn10QpQ2CiiO86YKi4WRcYnodui3tpl6SIchg74P0EpXRJRW3QJm/4fEQU1k+YguI8ps7LtiYJfbX1WPTCm61EkSOFBXD7MkvWrQ7mur2O2norSYG50ZTX2s6EGVc19xp2BXWYma5TZY4bOL0kI+lbzs1V93SIGpgvnyR5zyHLZr7DxOCdVWhXxks4F4VLK6EnzNfQqoXxMJMwRtqWwwReuAbP/Go6/2YsgoGpFTBb2bNhvqnIz+oNFXpIuW202xe3/A+tK4X9ikt4nQAAAABJRU5ErkJggg==",_ee="/demo-waas-auth/assets/100-cf3a0cbf.png",Oee="/demo-waas-auth/assets/1101-1d0b8ff9.png",X4="data:image/png;base64,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",Z4="/demo-waas-auth/assets/250-2aa72264.png",eA="/demo-waas-auth/assets/42161-90b816d4.png",Nee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAAXNSR0IB2cksfwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAkxQTFRF////AAAA74Ig8Iwx8ZA4//7974Qj74Mh///+//////78////74Mi//v4//////z5/vfx74Um//37////////////////////////////////////////8ZE774Yn8Y42/fLn////////8Isw////86FW/evc/OXR////+dGt/vPp8Igq++HK+9u/976M8pZE/ezd8Icp+dOx/vbu9KZg/vr2/OjW9a9w9Kll+ti5/e/j/vnz8pxO//r3////8Y838pZD////////////////8Iwy////851Q////+MWX+cyk+tWz+97E8ZI9////8Y0z////////////8ptM/fDk9rZ9972J+93C86Nb8ZM+9riB/OXQ+c+p/OfU/OnY8ZRB////9Kdi9a5u////9axr////////////////////////////////////9Kpn////98KS86Rd/////////vfw/////OPN////859U98GQ////////9rmB+9/G9bJ298CO+Mqg/e3f9bR686JZ8plI9a1t+dKv9bJ18ZA6/vXs8Igs+Mui/e7h/OrZ+Mmf+c6n8phI8Iov86Ve////////+MaZ////8Ikt////+tm7+c2l////++LM98OT8pdG////////+Mid9ruF855S////////////////+Mib////9rN49rd++tq997yG+ta3////98OV////////++DI////////9rV7+tW19bBy/vPq9rqD9Ktp////8ppK////////////////////////Mj9/0QAAAMR0Uk5T/wD/////////Af/+///9/////5/W9TQF4uDZ6MT/////x1L/Av///5b////////////////////////////Q///vCh77/6X/uP//////p/8SDgb/////////////////J///UP8QSyRsVr4rDZr/Wf//bwz/9/9N///8L///////////////////////////////h7H/5P9d///c////j+n////zMuxm/6D//////5v/WFv/MCz///////9U/2M11GLeOHwhNZoAAAr/SURBVHicxVv3Y1RFEJ67JCSXkII5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",tA="data:image/png;base64,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",rA="/demo-waas-auth/assets/56-06b98271.png",ur={MAINNET:1,ROPSTEN:3,RINKEBY:4,GOERLI:5,KOVAN:42,POLYGON:137,POLYGON_MUMBAI:80001,POLYGON_ZKEVM:1101,BSC:56,BSC_TESTNET:97,OPTIMISM:10,OPTIMISM_TESTNET:69,ARBITRUM:42161,ARBITRUM_GOERLI:421613,ARBITRUM_NOVA:42170,AVALANCHE:43114,AVALANCHE_TESTNET:43113,FANTOM:250,FANTOM_TESTNET:4002,GNOSIS:100,AURORA:1313161554,AURORA_TESTNET:1313161556,BASE_GOERLI:84531,HOMEVERSE_TESTNET:40875},Dee={[ur.MAINNET]:Qu,[ur.ROPSTEN]:Qu,[ur.GOERLI]:Qu,[ur.KOVAN]:Qu,[ur.OPTIMISM]:J4,[ur.OPTIMISM_TESTNET]:J4,[ur.POLYGON]:X4,[ur.POLYGON_MUMBAI]:X4,[ur.POLYGON_ZKEVM]:Oee,[ur.ARBITRUM]:eA,[ur.ARBITRUM_NOVA]:Nee,[ur.ARBITRUM_GOERLI]:eA,[ur.GNOSIS]:_ee,[ur.BSC]:rA,[ur.BSC_TESTNET]:rA,[ur.FANTOM]:Z4,[ur.FANTOM_TESTNET]:Z4,[ur.AVALANCHE]:tA,[ur.AVALANCHE_TESTNET]:tA};function Lee({onNetworkChange:t}){const[e,r]=p.useState(),[n,i]=p.useState([]);return p.useEffect(()=>{st.networkList().then(s=>{i(s),r(s[0]),t(s[0])})},[]),n.length===0?$.jsx(re,{marginY:"5",children:$.jsx(zi,{})}):$.jsxs(re,{marginBottom:"4",children:[$.jsx(re,{marginBottom:"4",children:$.jsx(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:"Network to use with requests:"})}),$.jsx(re,{children:$.jsx(d0,{name:"chainId",labelLocation:"top",onValueChange:s=>{const o=n==null?void 0:n.find(a=>a.name===s);o&&(r(o),t(o))},value:e==null?void 0:e.name,options:[...n.map(s=>({label:$.jsxs(re,{alignItems:"center",gap:"2",children:[$.jsx(j$,{src:Dee[s.id],size:"sm"}),$.jsx(Pe,{children:s.name})]}),value:String(s.name)}))]})})]})}function jee(){const[t,e]=p.useState(),[r,n]=p.useState(),[i,s]=p.useState([]),[o,a]=p.useState(!1),[l,c]=p.useState(!1),[f,u]=p.useState();return p.useEffect(()=>{st.getAddress().then(d=>{e(d)}).catch(d=>{n(d.message)})},[]),p.useEffect(()=>{st.isSignedIn().then(d=>{d||Uo.navigate("/login")})},[]),p.useEffect(()=>{const d=i.join("");d.length===6&&(c(!0),st.finishValidateSession(d))},[i]),p.useEffect(()=>{const d=st.onValidationRequired(()=>{a(!0),st.waitForSessionValid(6e5,4e3).then(v=>{console.log("isValid",v),s([]),a(!1),c(!1)})});return()=>{d.then(v=>v())}},[]),$.jsxs($.Fragment,{children:[$.jsx(q8,{children:o&&$.jsx(Hj,{children:$.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"1.2em",height:"50vh"},children:$.jsxs(re,{flexDirection:"column",alignItems:"center",children:[$.jsx(Pe,{marginBottom:"7",children:"Please enter the session verification code that was sent to your email"}),$.jsx(OC,{value:i,digits:6,onChange:s}),$.jsx(re,{marginTop:"5",children:l&&$.jsx(zi,{})})]})})})}),$.jsxs(re,{marginY:"0",marginX:"auto",paddingX:"6",style:{maxWidth:"720px",marginTop:"80px",marginBottom:"80px"},children:[$.jsx(re,{marginBottom:"10",children:$.jsx(NC,{})}),$.jsxs(re,{marginBottom:"5",flexDirection:"row",children:[$.jsxs(Pe,{marginTop:"1",variant:"normal",color:"text100",children:["Logged in with email:"," "]}),$.jsx(pr,{marginLeft:"auto",label:"Log out",size:"xs",onClick:async()=>{try{await st.dropSession({strict:!1})}catch(d){console.warn(`Could not drop session: ${d.message}`)}pU(),Uo.navigate("/login")}})]}),$.jsx(Co,{background:"buttonGlass"}),$.jsx(re,{marginBottom:"5",children:$.jsx(Pe,{variant:"normal",color:"text100",fontWeight:"bold",children:"Your wallet address:"})}),$.jsx(re,{marginBottom:"5",children:t?$.jsx(re,{children:$.jsx(Pe,{children:t})}):$.jsx(zi,{})}),$.jsx(re,{marginBottom:"5",children:$.jsx(Lee,{onNetworkChange:u})}),$.jsx(re,{children:r&&$.jsxs(Pe,{children:["Error fetching wallet address: ",r]})}),$.jsx(Co,{background:"buttonGlass"}),$.jsx(Cee,{}),$.jsxs(ic,{marginY:"3",label:"Send native token transaction",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(See,{network:f})]}),$.jsxs(ic,{marginY:"3",label:"Send ERC20 transaction",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(Ree,{network:f})]}),$.jsxs(ic,{marginY:"3",label:"Send ERC1155 transaction",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(Iee,{network:f})]}),$.jsxs(ic,{marginY:"3",label:"Sign a message",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(kee,{network:f})]}),$.jsxs(ic,{marginY:"3",label:"Call contracts",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(Pee,{network:f})]})]})]})}const Bee="970987756660-35a6tc48hvi8cev9cnknp0iugv9poa23.apps.googleusercontent.com",nA="970987756660-6ibakd38eibf3cg9rq42hri7o0jn5va8.apps.googleusercontent.com",$ee="AQAAAAAAAEGv4rUgioUNUbcdNZlvOZE72JI",Fee="eyJwcm9qZWN0SWQiOjE2ODE1LCJycGNTZXJ2ZXIiOiJodHRwczovL3dhYXMuc2VxdWVuY2UuYXBwIn0=",iA="AQAAAAAAAAK2JvvZhWqZ51riasWBftkrVXE",sA="eyJwcm9qZWN0SWQiOjY5NCwicnBjU2VydmVyIjoiaHR0cHM6Ly9kZXYtd2Fhcy5zZXF1ZW5jZS5hcHAiLCJlbWFpbFJlZ2lvbiI6ImNhLWNlbnRyYWwtMSIsImVtYWlsQ2xpZW50SWQiOiI1NGF0bjV1cGk2M3FjNTlhMWVtM3ZiaHJzbiJ9",Uee=new VW("https://nodes.sequence.app/polygon"),N0=new URLSearchParams(window.location.search),zee=N0.get("env")??"prod";let Mk=N0.get("projectAccessKey")??$ee,Ik=N0.get("waasConfigKey")??Fee,_k=N0.get("googleClientId")??Bee;zee==="dev"&&(console.log("Using dev environment"),console.log(`Project Access Key: ${iA}`),console.log(`Waas Config Key: ${sA}`),console.log(`Google Client ID: ${nA}`),Mk=iA,Ik=sA,_k=nA);const st=new Eee({network:"polygon",projectAccessKey:Mk,waasConfigKey:Ik}),Uo=XF([{path:"/login",element:$.jsx(iG,{})},{path:"/",element:$.jsx(jee,{})}]);Pv.createRoot(document.getElementById("root")).render($.jsx(gr.StrictMode,{children:$.jsx(Fj,{children:$.jsx(uU,{clientId:_k,children:$.jsx(aU,{router:Uo})})})})); + */class vk{static getParser(e,r=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new N4(e,r)}static parse(e){return new N4(e).getResult()}static get BROWSER_MAP(){return hk}static get ENGINE_MAP(){return Ls}static get OS_MAP(){return Wr}static get PLATFORMS_MAP(){return Xt}}const QJ=({serviceId:t,clientVersion:e})=>async()=>{var i,s,o,a,l;const r=typeof window<"u"&&((i=window==null?void 0:window.navigator)!=null&&i.userAgent)?vk.parse(window.navigator.userAgent):void 0,n=[["aws-sdk-js",e],["ua","2.0"],[`os/${((s=r==null?void 0:r.os)==null?void 0:s.name)||"other"}`,(o=r==null?void 0:r.os)==null?void 0:o.version],["lang/js"],["md/browser",`${((a=r==null?void 0:r.browser)==null?void 0:a.name)??"unknown"}_${((l=r==null?void 0:r.browser)==null?void 0:l.version)??"unknown"}`]];return t&&n.push([`api/${t}`,e]),n},YJ=t=>()=>Promise.reject(t),D4=typeof TextEncoder=="function"?new TextEncoder:null,JJ=t=>{if(typeof t=="string"){if(D4)return D4.encode(t).byteLength;let e=t.length;for(let r=e-1;r>=0;r--){const n=t.charCodeAt(r);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&r--}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}throw new Error(`Body Length computation failed for ${t}`)},yk="required",Ii="fn",_i="argv",Hl="ref",L4=!0,j4="isSet",Ff="booleanEquals",ka="error",kc="endpoint",Ji="tree",lx="PartitionResult",B4={[yk]:!1,type:"String"},$4={[yk]:!0,default:!1,type:"Boolean"},F4={[Hl]:"Endpoint"},pk={[Ii]:Ff,[_i]:[{[Hl]:"UseFIPS"},!0]},mk={[Ii]:Ff,[_i]:[{[Hl]:"UseDualStack"},!0]},wi={},U4={[Ii]:"getAttr",[_i]:[{[Hl]:lx},"supportsFIPS"]},z4={[Ii]:Ff,[_i]:[!0,{[Ii]:"getAttr",[_i]:[{[Hl]:lx},"supportsDualStack"]}]},V4=[pk],q4=[mk],H4=[{[Hl]:"Region"}],XJ={version:"1.0",parameters:{Region:B4,UseDualStack:$4,UseFIPS:$4,Endpoint:B4},rules:[{conditions:[{[Ii]:j4,[_i]:[F4]}],rules:[{conditions:V4,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:ka},{conditions:q4,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:ka},{endpoint:{url:F4,properties:wi,headers:wi},type:kc}],type:Ji},{conditions:[{[Ii]:j4,[_i]:H4}],rules:[{conditions:[{[Ii]:"aws.partition",[_i]:H4,assign:lx}],rules:[{conditions:[pk,mk],rules:[{conditions:[{[Ii]:Ff,[_i]:[L4,U4]},z4],rules:[{endpoint:{url:"https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:wi,headers:wi},type:kc}],type:Ji},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:ka}],type:Ji},{conditions:V4,rules:[{conditions:[{[Ii]:Ff,[_i]:[U4,L4]}],rules:[{endpoint:{url:"https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",properties:wi,headers:wi},type:kc}],type:Ji},{error:"FIPS is enabled but this partition does not support FIPS",type:ka}],type:Ji},{conditions:q4,rules:[{conditions:[z4],rules:[{endpoint:{url:"https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:wi,headers:wi},type:kc}],type:Ji},{error:"DualStack is enabled but this partition does not support DualStack",type:ka}],type:Ji},{endpoint:{url:"https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",properties:wi,headers:wi},type:kc}],type:Ji}],type:Ji},{error:"Invalid Configuration: Missing Region",type:ka}]},ZJ=XJ,eX=(t,e={})=>ZG(ZJ,{endpointParams:t,logger:e.logger});kh.aws=B9;const tX=t=>({apiVersion:"2016-04-18",base64Decoder:(t==null?void 0:t.base64Decoder)??tx,base64Encoder:(t==null?void 0:t.base64Encoder)??K9,disableHostPrefix:(t==null?void 0:t.disableHostPrefix)??!1,endpointProvider:(t==null?void 0:t.endpointProvider)??eX,extensions:(t==null?void 0:t.extensions)??[],httpAuthSchemeProvider:(t==null?void 0:t.httpAuthSchemeProvider)??TY,httpAuthSchemes:(t==null?void 0:t.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new JQ},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new UQ}],logger:(t==null?void 0:t.logger)??new W9,serviceId:(t==null?void 0:t.serviceId)??"Cognito Identity Provider",urlParser:(t==null?void 0:t.urlParser)??Ph,utf8Decoder:(t==null?void 0:t.utf8Decoder)??Cl,utf8Encoder:(t==null?void 0:t.utf8Encoder)??G9}),rX=(t,e,r)=>{let n,i,s,o=!1;const a=async()=>{i||(i=t());try{n=await i,s=!0,o=!1}finally{i=void 0}return n};return e===void 0?async l=>((!s||l!=null&&l.forceRefresh)&&(n=await a()),n):async l=>((!s||l!=null&&l.forceRefresh)&&(n=await a()),o?n:r&&!r(n)?(o=!0,n):(e(n)&&await a(),n))},nX=["in-region","cross-region","mobile","standard","legacy"],iX=({defaultsMode:t}={})=>rX(async()=>{const e=typeof t=="function"?await t():t;switch(e==null?void 0:e.toLowerCase()){case"auto":return Promise.resolve(sX()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e==null?void 0:e.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${nX.join(", ")}, got ${e}`)}}),sX=()=>{var r,n;const t=typeof window<"u"&&((r=window==null?void 0:window.navigator)!=null&&r.userAgent)?vk.parse(window.navigator.userAgent):void 0,e=(n=t==null?void 0:t.platform)==null?void 0:n.type;return e==="tablet"||e==="mobile"},oX=t=>{const e=iX(t),r=()=>e().then(SQ),n=tX(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:(t==null?void 0:t.bodyLengthChecker)??JJ,credentialDefaultProvider:(t==null?void 0:t.credentialDefaultProvider)??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(t==null?void 0:t.defaultUserAgentProvider)??QJ({serviceId:n.serviceId,clientVersion:YY.version}),maxAttempts:(t==null?void 0:t.maxAttempts)??Rh,region:(t==null?void 0:t.region)??YJ("Region is missing"),requestHandler:rx.create((t==null?void 0:t.requestHandler)??r),retryMode:(t==null?void 0:t.retryMode)??(async()=>(await r()).retryMode||jK),sha256:(t==null?void 0:t.sha256)??ok.Sha256,streamCollector:(t==null?void 0:t.streamCollector)??vQ,useDualstackEndpoint:(t==null?void 0:t.useDualstackEndpoint)??(()=>Promise.resolve(uK)),useFipsEndpoint:(t==null?void 0:t.useFipsEndpoint)??(()=>Promise.resolve(dK))}},aX=t=>{let e=async()=>{if(t.region===void 0)throw new Error("Region is missing from runtimeConfig");const r=t.region;return typeof r=="string"?r:r()};return{setRegion(r){e=r},region(){return e}}},lX=t=>({region:t.region()}),cX=t=>{const e=t.httpAuthSchemes;let r=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(i){const s=e.findIndex(o=>o.schemeId===i.schemeId);s===-1?e.push(i):e.splice(s,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){r=i},httpAuthSchemeProvider(){return r},setCredentials(i){n=i},credentials(){return n}}},fX=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),Ku=t=>t,uX=(t,e)=>{const r={...Ku(aX(t)),...Ku(TQ(t)),...Ku(bG(t)),...Ku(cX(t))};return e.forEach(n=>n.configure(r)),{...t,...lX(r),...MQ(r),...wG(r),...fX(r)}};class dX extends oQ{constructor(...[e]){const r=oX(e||{}),n=IY(r),i=hK(n),s=IK(i),o=sQ(s),a=o,l=NG(a),c=MY(l),f=uX(c,(e==null?void 0:e.extensions)||[]);super(f),this.config=f,this.middlewareStack.use(LQ(this.config)),this.middlewareStack.use(KQ(this.config)),this.middlewareStack.use(CG(this.config)),this.middlewareStack.use(RG(this.config)),this.middlewareStack.use(OG(this.config)),this.middlewareStack.use(fK(this.config)),this.middlewareStack.use(OK(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use($Q(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return PY}getIdentityProviderConfigProvider(){return async e=>new FQ({"aws.auth#sigv4":e.credentials})}}class Te extends nx{constructor(e){super(e),Object.setPrototypeOf(this,Te.prototype)}}class cx extends Te{constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),this.name="InternalErrorException",this.$fault="server",Object.setPrototypeOf(this,cx.prototype)}}class fx extends Te{constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),this.name="InvalidParameterException",this.$fault="client",Object.setPrototypeOf(this,fx.prototype)}}class ux extends Te{constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),this.name="NotAuthorizedException",this.$fault="client",Object.setPrototypeOf(this,ux.prototype)}}class dx extends Te{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,dx.prototype)}}class hx extends Te{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,hx.prototype)}}class vx extends Te{constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),this.name="UserImportInProgressException",this.$fault="client",Object.setPrototypeOf(this,vx.prototype)}}class yx extends Te{constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),this.name="UserNotFoundException",this.$fault="client",Object.setPrototypeOf(this,yx.prototype)}}class px extends Te{constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),this.name="InvalidLambdaResponseException",this.$fault="client",Object.setPrototypeOf(this,px.prototype)}}class mx extends Te{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,mx.prototype)}}class gx extends Te{constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),this.name="TooManyFailedAttemptsException",this.$fault="client",Object.setPrototypeOf(this,gx.prototype)}}class xx extends Te{constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),this.name="UnexpectedLambdaException",this.$fault="client",Object.setPrototypeOf(this,xx.prototype)}}class M0 extends Te{constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),this.name="UserLambdaValidationException",this.$fault="client",Object.setPrototypeOf(this,M0.prototype)}}class bx extends Te{constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),this.name="CodeDeliveryFailureException",this.$fault="client",Object.setPrototypeOf(this,bx.prototype)}}class wx extends Te{constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),this.name="InvalidPasswordException",this.$fault="client",Object.setPrototypeOf(this,wx.prototype)}}class Ex extends Te{constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),this.name="InvalidSmsRoleAccessPolicyException",this.$fault="client",Object.setPrototypeOf(this,Ex.prototype)}}class Ax extends Te{constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),this.name="InvalidSmsRoleTrustRelationshipException",this.$fault="client",Object.setPrototypeOf(this,Ax.prototype)}}class Sx extends Te{constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),this.name="PreconditionNotMetException",this.$fault="client",Object.setPrototypeOf(this,Sx.prototype)}}class Cx extends Te{constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),this.name="UnsupportedUserStateException",this.$fault="client",Object.setPrototypeOf(this,Cx.prototype)}}class kx extends Te{constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),this.name="UsernameExistsException",this.$fault="client",Object.setPrototypeOf(this,kx.prototype)}}class Px extends Te{constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),this.name="AliasExistsException",this.$fault="client",Object.setPrototypeOf(this,Px.prototype)}}class Rx extends Te{constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),this.name="InvalidUserPoolConfigurationException",this.$fault="client",Object.setPrototypeOf(this,Rx.prototype)}}class Tx extends Te{constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),this.name="MFAMethodNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Tx.prototype)}}class Mx extends Te{constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),this.name="PasswordResetRequiredException",this.$fault="client",Object.setPrototypeOf(this,Mx.prototype)}}class Ix extends Te{constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),this.name="UserNotConfirmedException",this.$fault="client",Object.setPrototypeOf(this,Ix.prototype)}}class _x extends Te{constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),this.name="UserPoolAddOnNotEnabledException",this.$fault="client",Object.setPrototypeOf(this,_x.prototype)}}class Ox extends Te{constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),this.name="InvalidEmailRoleAccessPolicyException",this.$fault="client",Object.setPrototypeOf(this,Ox.prototype)}}class Nx extends Te{constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),this.name="CodeMismatchException",this.$fault="client",Object.setPrototypeOf(this,Nx.prototype)}}class Dx extends Te{constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),this.name="ExpiredCodeException",this.$fault="client",Object.setPrototypeOf(this,Dx.prototype)}}class Lx extends Te{constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),this.name="SoftwareTokenMFANotFoundException",this.$fault="client",Object.setPrototypeOf(this,Lx.prototype)}}class jx extends Te{constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),this.name="ConcurrentModificationException",this.$fault="client",Object.setPrototypeOf(this,jx.prototype)}}class Bx extends Te{constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),this.name="ForbiddenException",this.$fault="client",Object.setPrototypeOf(this,Bx.prototype)}}class $x extends Te{constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),this.name="GroupExistsException",this.$fault="client",Object.setPrototypeOf(this,$x.prototype)}}class Fx extends Te{constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),this.name="DuplicateProviderException",this.$fault="client",Object.setPrototypeOf(this,Fx.prototype)}}class Ux extends Te{constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),this.name="UserPoolTaggingException",this.$fault="client",Object.setPrototypeOf(this,Ux.prototype)}}class zx extends Te{constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),this.name="InvalidOAuthFlowException",this.$fault="client",Object.setPrototypeOf(this,zx.prototype)}}class Vx extends Te{constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),this.name="ScopeDoesNotExistException",this.$fault="client",Object.setPrototypeOf(this,Vx.prototype)}}class qx extends Te{constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),this.name="UnsupportedIdentityProviderException",this.$fault="client",Object.setPrototypeOf(this,qx.prototype)}}class Hx extends Te{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,Hx.prototype)}}class Wx extends Te{constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),this.name="UnsupportedOperationException",this.$fault="client",Object.setPrototypeOf(this,Wx.prototype)}}class Gx extends Te{constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),this.name="UnsupportedTokenTypeException",this.$fault="client",Object.setPrototypeOf(this,Gx.prototype)}}const W4=t=>({...t,...t.Value&&{Value:wr}}),gk=t=>({...t,...t.AccessToken&&{AccessToken:wr},...t.RefreshToken&&{RefreshToken:wr},...t.IdToken&&{IdToken:wr}}),hX=t=>({...t,...t.AuthParameters&&{AuthParameters:wr},...t.ClientId&&{ClientId:wr},...t.UserContextData&&{UserContextData:wr}}),vX=t=>({...t,...t.Session&&{Session:wr},...t.AuthenticationResult&&{AuthenticationResult:gk(t.AuthenticationResult)}}),yX=t=>({...t,...t.ClientId&&{ClientId:wr},...t.Session&&{Session:wr},...t.ChallengeResponses&&{ChallengeResponses:wr},...t.UserContextData&&{UserContextData:wr}}),pX=t=>({...t,...t.Session&&{Session:wr},...t.AuthenticationResult&&{AuthenticationResult:gk(t.AuthenticationResult)}});class Kx extends Te{constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),this.name="EnableSoftwareTokenMFAException",this.$fault="client",Object.setPrototypeOf(this,Kx.prototype)}}const mX=t=>({...t,...t.ClientId&&{ClientId:wr},...t.SecretHash&&{SecretHash:wr},...t.Username&&{Username:wr},...t.Password&&{Password:wr},...t.UserAttributes&&{UserAttributes:t.UserAttributes.map(e=>W4(e))},...t.ValidationData&&{ValidationData:t.ValidationData.map(e=>W4(e))},...t.UserContextData&&{UserContextData:wr}}),gX=async(t,e)=>{const r=Jx("InitiateAuth");let n;return n=JSON.stringify(Ae(t)),Yx(e,r,"/",void 0,n)},xX=async(t,e)=>{const r=Jx("RespondToAuthChallenge");let n;return n=JSON.stringify(Ae(t)),Yx(e,r,"/",void 0,n)},bX=async(t,e)=>{const r=Jx("SignUp");let n;return n=JSON.stringify(Ae(t)),Yx(e,r,"/",void 0,n)},wX=async(t,e)=>{if(t.statusCode>=300)return Qx(t,e);const r=await T0(t.body,e);let n={};return n=Ae(r),{$metadata:Me(t),...n}},EX=async(t,e)=>{if(t.statusCode>=300)return Qx(t,e);const r=await T0(t.body,e);let n={};return n=Ae(r),{$metadata:Me(t),...n}},AX=async(t,e)=>{if(t.statusCode>=300)return Qx(t,e);const r=await T0(t.body,e);let n={};return n=Ae(r),{$metadata:Me(t),...n}},Qx=async(t,e)=>{const r={...t,body:await CY(t.body,e)},n=kY(t,r.body);switch(n){case"InternalErrorException":case"com.amazonaws.cognitoidentityprovider#InternalErrorException":throw await OX(r);case"InvalidParameterException":case"com.amazonaws.cognitoidentityprovider#InvalidParameterException":throw await jX(r);case"NotAuthorizedException":case"com.amazonaws.cognitoidentityprovider#NotAuthorizedException":throw await qX(r);case"ResourceNotFoundException":case"com.amazonaws.cognitoidentityprovider#ResourceNotFoundException":throw await GX(r);case"TooManyRequestsException":case"com.amazonaws.cognitoidentityprovider#TooManyRequestsException":throw await JX(r);case"UserImportInProgressException":case"com.amazonaws.cognitoidentityprovider#UserImportInProgressException":throw await iZ(r);case"UserNotFoundException":case"com.amazonaws.cognitoidentityprovider#UserNotFoundException":throw await lZ(r);case"InvalidLambdaResponseException":case"com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException":throw await DX(r);case"LimitExceededException":case"com.amazonaws.cognitoidentityprovider#LimitExceededException":throw await zX(r);case"TooManyFailedAttemptsException":case"com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException":throw await YX(r);case"UnexpectedLambdaException":case"com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException":throw await ZX(r);case"UserLambdaValidationException":case"com.amazonaws.cognitoidentityprovider#UserLambdaValidationException":throw await sZ(r);case"CodeDeliveryFailureException":case"com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException":throw await CX(r);case"InvalidPasswordException":case"com.amazonaws.cognitoidentityprovider#InvalidPasswordException":throw await BX(r);case"InvalidSmsRoleAccessPolicyException":case"com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException":throw await $X(r);case"InvalidSmsRoleTrustRelationshipException":case"com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException":throw await FX(r);case"PreconditionNotMetException":case"com.amazonaws.cognitoidentityprovider#PreconditionNotMetException":throw await WX(r);case"UnsupportedUserStateException":case"com.amazonaws.cognitoidentityprovider#UnsupportedUserStateException":throw await nZ(r);case"UsernameExistsException":case"com.amazonaws.cognitoidentityprovider#UsernameExistsException":throw await oZ(r);case"AliasExistsException":case"com.amazonaws.cognitoidentityprovider#AliasExistsException":throw await SX(r);case"InvalidUserPoolConfigurationException":case"com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException":throw await UX(r);case"MFAMethodNotFoundException":case"com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException":throw await VX(r);case"PasswordResetRequiredException":case"com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException":throw await HX(r);case"UserNotConfirmedException":case"com.amazonaws.cognitoidentityprovider#UserNotConfirmedException":throw await aZ(r);case"UserPoolAddOnNotEnabledException":case"com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException":throw await cZ(r);case"InvalidEmailRoleAccessPolicyException":case"com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException":throw await NX(r);case"CodeMismatchException":case"com.amazonaws.cognitoidentityprovider#CodeMismatchException":throw await kX(r);case"ExpiredCodeException":case"com.amazonaws.cognitoidentityprovider#ExpiredCodeException":throw await MX(r);case"SoftwareTokenMFANotFoundException":case"com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException":throw await QX(r);case"ConcurrentModificationException":case"com.amazonaws.cognitoidentityprovider#ConcurrentModificationException":throw await PX(r);case"ForbiddenException":case"com.amazonaws.cognitoidentityprovider#ForbiddenException":throw await IX(r);case"GroupExistsException":case"com.amazonaws.cognitoidentityprovider#GroupExistsException":throw await _X(r);case"DuplicateProviderException":case"com.amazonaws.cognitoidentityprovider#DuplicateProviderException":throw await RX(r);case"UserPoolTaggingException":case"com.amazonaws.cognitoidentityprovider#UserPoolTaggingException":throw await fZ(r);case"InvalidOAuthFlowException":case"com.amazonaws.cognitoidentityprovider#InvalidOAuthFlowException":throw await LX(r);case"ScopeDoesNotExistException":case"com.amazonaws.cognitoidentityprovider#ScopeDoesNotExistException":throw await KX(r);case"UnsupportedIdentityProviderException":case"com.amazonaws.cognitoidentityprovider#UnsupportedIdentityProviderException":throw await eZ(r);case"UnauthorizedException":case"com.amazonaws.cognitoidentityprovider#UnauthorizedException":throw await XX(r);case"UnsupportedOperationException":case"com.amazonaws.cognitoidentityprovider#UnsupportedOperationException":throw await tZ(r);case"UnsupportedTokenTypeException":case"com.amazonaws.cognitoidentityprovider#UnsupportedTokenTypeException":throw await rZ(r);case"EnableSoftwareTokenMFAException":case"com.amazonaws.cognitoidentityprovider#EnableSoftwareTokenMFAException":throw await TX(r);default:const i=r.body;return uZ({output:t,parsedBody:i,errorCode:n})}},SX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Px({$metadata:Me(t),...n});return Ne(i,r)},CX=async(t,e)=>{const r=t.body,n=Ae(r),i=new bx({$metadata:Me(t),...n});return Ne(i,r)},kX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Nx({$metadata:Me(t),...n});return Ne(i,r)},PX=async(t,e)=>{const r=t.body,n=Ae(r),i=new jx({$metadata:Me(t),...n});return Ne(i,r)},RX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Fx({$metadata:Me(t),...n});return Ne(i,r)},TX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Kx({$metadata:Me(t),...n});return Ne(i,r)},MX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Dx({$metadata:Me(t),...n});return Ne(i,r)},IX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Bx({$metadata:Me(t),...n});return Ne(i,r)},_X=async(t,e)=>{const r=t.body,n=Ae(r),i=new $x({$metadata:Me(t),...n});return Ne(i,r)},OX=async(t,e)=>{const r=t.body,n=Ae(r),i=new cx({$metadata:Me(t),...n});return Ne(i,r)},NX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ox({$metadata:Me(t),...n});return Ne(i,r)},DX=async(t,e)=>{const r=t.body,n=Ae(r),i=new px({$metadata:Me(t),...n});return Ne(i,r)},LX=async(t,e)=>{const r=t.body,n=Ae(r),i=new zx({$metadata:Me(t),...n});return Ne(i,r)},jX=async(t,e)=>{const r=t.body,n=Ae(r),i=new fx({$metadata:Me(t),...n});return Ne(i,r)},BX=async(t,e)=>{const r=t.body,n=Ae(r),i=new wx({$metadata:Me(t),...n});return Ne(i,r)},$X=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ex({$metadata:Me(t),...n});return Ne(i,r)},FX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ax({$metadata:Me(t),...n});return Ne(i,r)},UX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Rx({$metadata:Me(t),...n});return Ne(i,r)},zX=async(t,e)=>{const r=t.body,n=Ae(r),i=new mx({$metadata:Me(t),...n});return Ne(i,r)},VX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Tx({$metadata:Me(t),...n});return Ne(i,r)},qX=async(t,e)=>{const r=t.body,n=Ae(r),i=new ux({$metadata:Me(t),...n});return Ne(i,r)},HX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Mx({$metadata:Me(t),...n});return Ne(i,r)},WX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Sx({$metadata:Me(t),...n});return Ne(i,r)},GX=async(t,e)=>{const r=t.body,n=Ae(r),i=new dx({$metadata:Me(t),...n});return Ne(i,r)},KX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Vx({$metadata:Me(t),...n});return Ne(i,r)},QX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Lx({$metadata:Me(t),...n});return Ne(i,r)},YX=async(t,e)=>{const r=t.body,n=Ae(r),i=new gx({$metadata:Me(t),...n});return Ne(i,r)},JX=async(t,e)=>{const r=t.body,n=Ae(r),i=new hx({$metadata:Me(t),...n});return Ne(i,r)},XX=async(t,e)=>{const r=t.body,n=Ae(r),i=new Hx({$metadata:Me(t),...n});return Ne(i,r)},ZX=async(t,e)=>{const r=t.body,n=Ae(r),i=new xx({$metadata:Me(t),...n});return Ne(i,r)},eZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new qx({$metadata:Me(t),...n});return Ne(i,r)},tZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Wx({$metadata:Me(t),...n});return Ne(i,r)},rZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Gx({$metadata:Me(t),...n});return Ne(i,r)},nZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Cx({$metadata:Me(t),...n});return Ne(i,r)},iZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new vx({$metadata:Me(t),...n});return Ne(i,r)},sZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new M0({$metadata:Me(t),...n});return Ne(i,r)},oZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new kx({$metadata:Me(t),...n});return Ne(i,r)},aZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ix({$metadata:Me(t),...n});return Ne(i,r)},lZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new yx({$metadata:Me(t),...n});return Ne(i,r)},cZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new _x({$metadata:Me(t),...n});return Ne(i,r)},fZ=async(t,e)=>{const r=t.body,n=Ae(r),i=new Ux({$metadata:Me(t),...n});return Ne(i,r)},Me=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),uZ=EQ(Te),Yx=async(t,e,r,n,i)=>{const{hostname:s,protocol:o="https",port:a,path:l}=await t.endpoint(),c={protocol:o,hostname:s,port:a,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+r:l+r,headers:e};return n!==void 0&&(c.hostname=n),i!==void 0&&(c.body=i),new Ki(c)};function Jx(t){return{"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${t}`}}class dZ extends R0.classBuilder().ep({...sx}).m(function(e,r,n,i){return[Zg(n,this.serialize,this.deserialize),ex(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").f(hX,vX).ser(gX).de(wX).build(){}class hZ extends R0.classBuilder().ep({...sx}).m(function(e,r,n,i){return[Zg(n,this.serialize,this.deserialize),ex(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","RespondToAuthChallenge",{}).n("CognitoIdentityProviderClient","RespondToAuthChallengeCommand").f(yX,pX).ser(xX).de(EX).build(){}class vZ extends R0.classBuilder().ep({...sx}).m(function(e,r,n,i){return[Zg(n,this.serialize,this.deserialize),ex(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","SignUp",{}).n("CognitoIdentityProviderClient","SignUpCommand").f(mX,void 0).ser(bX).de(AX).build(){}function zr(){return zr=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}const yZ=["signatures"],pZ="0.0.0";function Yn(t,e,r){const n=Math.floor(Date.now()/1e3),i=n+e;return{version:pZ,issuedAt:n,expiresAt:i,name:t,data:r}}async function mZ(t,e){const r=gZ(e),n=await t.sign(new Uint8Array(r));return zr({},e,{signatures:[{sessionId:await t.sessionId(),signature:n}]})}function gZ(t){const{version:e,issuedAt:r,expiresAt:n,name:i,data:s}=t,a=sr(sG({version:e,issuedAt:r,expiresAt:n,name:i,data:s}));return ce(Et(a))}function xZ(t,e){const r=yi(t,yZ),n=t.expiresAt-t.issuedAt;return r.issuedAt=Math.floor(e.getTime()/1e3),r.expiresAt=r.issuedAt+n,r}function bZ({wallet:t,chainId:e,message:r,lifespan:n}){return Yn("signMessage",n,{wallet:t,network:e.toString(),message:r.startsWith("0x")?r:fe(sr(r))})}const wZ=["lifespan"],EZ=["lifespan"],AZ=["lifespan"],SZ=["lifespan"],CZ=["lifespan"],kZ=["lifespan"];async function PZ({lifespan:t,sessionId:e,idToken:r}){return Yn("openSession",t,{sessionId:e,idToken:r})}async function RZ(t){let{lifespan:e}=t,r=yi(t,wZ);return Yn("validateSession",e,r)}function TZ(t){let{lifespan:e}=t,r=yi(t,EZ);return Yn("finishValidateSession",e,r)}function G4(t){let{lifespan:e}=t,r=yi(t,AZ);return Yn("closeSession",e,r)}function MZ(t){let{lifespan:e}=t,r=yi(t,SZ);return Yn("listSessions",e,r)}function IZ(t){let{lifespan:e}=t,r=yi(t,CZ);return Yn("getSession",e,r)}function _Z(t){let{lifespan:e}=t,r=yi(t,kZ);return Yn("sessionAuthProof",e,r)}class OZ{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/WaasAuthenticator/",this.registerSession=(n,i,s)=>this.fetch(this.url("RegisterSession"),Av(n,i,s)).then(o=>Sv(o).then(a=>({session:a.session,response:a.response})),o=>{throw al.new({cause:`fetch(): ${o.message||""}`})}),this.sendIntent=(n,i,s)=>this.fetch(this.url("SendIntent"),Av(n,i,s)).then(o=>Sv(o).then(a=>({response:a.response})),o=>{throw al.new({cause:`fetch(): ${o.message||""}`})}),this.chainList=(n,i)=>this.fetch(this.url("ChainList"),Av({},n,i)).then(s=>Sv(s).then(o=>({chains:o.chains})),s=>{throw al.new({cause:`fetch(): ${s.message||""}`})}),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Av=(t={},e={},r=null)=>({method:"POST",headers:zr({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Sv=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),I0.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(NZ[n]||Ir).new(r)}return r});class Ir extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,Ir.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}}class Xx extends Ir{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Xx.prototype)}}class al extends Ir{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,al.prototype)}}class Zx extends Ir{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Zx.prototype)}}class eb extends Ir{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eb.prototype)}}class tb extends Ir{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,tb.prototype)}}class I0 extends Ir{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,I0.prototype)}}class rb extends Ir{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rb.prototype)}}class nb extends Ir{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nb.prototype)}}class ib extends Ir{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ib.prototype)}}class sb extends Ir{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sb.prototype)}}class ob extends Ir{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ob.prototype)}}class ab extends Ir{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ab.prototype)}}class lb extends Ir{constructor(e="TenantNotFound",r=1001,n="Tenant not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,lb.prototype)}}const NZ={0:Xx,[-1]:al,[-2]:Zx,[-3]:eb,[-4]:tb,[-5]:I0,[-6]:rb,[-7]:nb,[-8]:ib,[-9]:sb,[-10]:ob,1e3:ab,1001:lb};let Cv=function(t){return t.unknown="unknown",t.erc20Token="erc20Token",t.erc1155Token="erc1155Token",t}({});function ou(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="transactionReceipt"&&typeof t.data=="object"&&typeof t.data.txHash=="string"&&typeof t.data.receipt=="object"&&typeof t.data.request=="object"}function xk(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="transactionReceipt"&&typeof t.data=="object"&&typeof t.data.metaTxHash=="string"&&!t.data.txHash&&typeof t.data.request=="object"}function DZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="transactionFailed"&&typeof t.data=="object"&&typeof t.data.request=="object"&&Array.isArray(t.data.simulations)&&typeof t.data.error=="string"}function K4(t){return ou(t)||DZ(t)||xk(t)}function LZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="signedMessage"&&typeof t.data=="object"&&typeof t.data.message=="string"&&typeof t.data.signature=="string"}function jZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="sessionAuthProof"&&typeof t.data=="object"&&typeof t.data.sessionId=="string"&&typeof t.data.network=="string"&&typeof t.data.wallet=="string"&&typeof t.data.message=="string"&&typeof t.data.signature=="string"}function BZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="feeOptions"&&typeof t.data=="object"&&Array.isArray(t.data.feeOptions)}function $Z(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="validationRequired"&&typeof t.data=="object"&&typeof t.data.sessionId=="string"}function FZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="finishedSessionValidation"&&typeof t.data=="object"}function UZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="sessionClosed"}function zZ(t){return typeof t=="object"&&typeof t.code=="string"&&t.code==="getSessionResponse"&&typeof t.data=="object"&&typeof t.data.session=="string"&&typeof t.data.wallet=="string"}function Q4(t){var e,r;return!!(t instanceof Ir&&((e=t.cause)!=null&&e.endsWith("intent is invalid: intent expired")||(r=t.cause)!=null&&r.endsWith("intent is invalid: intent issued in the future")))}const VZ=["token","to","value"],qZ=["token","to","id","safe","data"],HZ=["token","to","values","data"],WZ=["to","value","abi","func","args"];function GZ({lifespan:t,wallet:e,identifier:r,chainId:n,transactions:i}){return Yn("feeOptions",t,{identifier:r,wallet:e,network:n.toString(),transactions:i.map(s=>{if(!s.to||s.to===Ng)throw new Error("Contract creation not supported");return wk(s)?{type:"transaction",to:s.to,value:ae.from(s.value||0).toHexString(),data:fe(s.data||[])}:s})})}function au({lifespan:t,wallet:e,identifier:r,chainId:n,transactions:i,transactionsFeeQuote:s,transactionsFeeOption:o}){return Yn("sendTransaction",t,{identifier:r,wallet:e,network:n.toString(),transactions:KZ(i,o).map(a=>{if(!a.to||a.to===Ng)throw new Error("Contract creation not supported");return wk(a)?{type:"transaction",to:a.to,value:ae.from(a.value||0).toHexString(),data:fe(a.data||[])}:a}),transactionsFeeQuote:s})}function KZ(t,e){const r=[...t];if(e)switch(e.token.type){case Cv.unknown:r.push({to:e.to,value:e.value});break;case Cv.erc20Token:if(!e.token.contractAddress)throw new Error("contract address is required");r.push(cb({tokenAddress:e.token.contractAddress,to:e.to,value:e.value}));break;case Cv.erc1155Token:if(!e.token.contractAddress)throw new Error("contract address is required");if(!e.token.tokenID)throw new Error("token ID is required");r.push(fb({tokenAddress:e.token.contractAddress,to:e.to,vals:[{id:e.token.tokenID,amount:e.value}]}));break}return r}function QZ({lifespan:t,chainId:e,wallet:r,metaTxHash:n}){return Yn("getTransactionReceipt",t,{wallet:r,network:e.toString(),metaTxHash:n})}function YZ(t){let{token:e,to:r,value:n}=t,i=yi(t,VZ);return au(zr({transactions:[cb({tokenAddress:e,to:r,value:n.toString()})]},i))}function JZ(t){let{token:e,to:r,id:n,safe:i,data:s}=t,o=yi(t,qZ);return au(zr({transactions:[eee({tokenAddress:e,to:r,id:n,data:s,safe:i})]},o))}function XZ(t){let{token:e,to:r,values:n,data:i}=t,s=yi(t,HZ);const o=n.map(a=>({id:a.id,amount:ae.from(a.amount).toString()}));return au(zr({transactions:[fb({tokenAddress:e,to:r,vals:o,data:i})]},s))}function ZZ(t){let{to:e,value:r,abi:n,func:i,args:s}=t,o=yi(t,WZ);return au(zr({transactions:[bk({to:e,value:ae.from(r).toString(),data:{abi:n,func:i,args:s}})]},o))}function cb(t){const e=t,r=t;if(e.token!==void 0)return{type:"erc20send",tokenAddress:e.token,to:e.to,value:e.value.toString()};if(r.tokenAddress!==void 0)return zr({type:"erc20send"},r);throw new Error("Invalid ERC20 transaction")}function eee(t){const e=t,r=t;if(e.token!==void 0)return{type:"erc721send",tokenAddress:e.token,to:e.to,id:e.id,data:e.data,safe:e.safe};if(r.tokenAddress!==void 0)return zr({type:"erc721send"},r);throw new Error("Invalid ERC721 transaction")}function fb(t){const e=t,r=t;if(e.values!==void 0)return{type:"erc1155send",vals:e.values.map(n=>({id:n.id,amount:ae.from(n.amount).toString()})),tokenAddress:e.token,to:e.to,data:e.data};if(r.vals!==void 0)return{type:"erc1155send",vals:r.vals.map(n=>({id:n.id,amount:ae.from(n.amount).toString()})),tokenAddress:r.tokenAddress,to:r.to,data:r.data};throw new Error("Invalid ERC1155 transaction")}function bk(t){const e=t,r=t;if(e.abi!==void 0)return{type:"delayedEncode",to:e.to,value:ae.from(e.value).toString(),data:{abi:e.abi,func:e.func,args:e.args}};if(r.data!==void 0)return{type:"delayedEncode",to:r.to,value:r.value,data:r.data};throw new Error("Invalid delayed encode transaction")}function tee(t){if(t.length===0)throw new Error("No packets provided");const e=t[0].data.network,r=t[0].data.wallet,n=t[0].expiresAt-t[0].issuedAt,i=t[0].data.identifier,s=t[0].data.transactionsFeeQuote;if(!t.every(o=>o.data.network===e))throw new Error("All packets must have the same chainId");if(!t.every(o=>o.data.wallet===r))throw new Error("All packets must have the same wallet");return Yn("sendTransaction",n,{network:e,wallet:r,identifier:i,transactions:t.flatMap(o=>o.data.transactions),transactionsFeeQuote:s})}function wk(t){return!["transaction","erc20send","erc721send","erc1155send","delayedEncode"].includes(t.type)}class Ad{constructor(e,r,n){this.store=e,this.key=r,this.defaultValue=n}async get(){const e=await this.store.get(this.key);return e||this.defaultValue}async set(e){e?await this.store.set(this.key,e):await this.store.set(this.key,null)}}class Ek{constructor(){this.store=void 0,Mh.isAvailable()?this.store=new Mh:this.store=new ree}async get(e){return this.store.get(e)}async set(e,r){return this.store.set(e,r)}}class Mh{static isAvailable(){return typeof window=="object"&&typeof window.localStorage=="object"}constructor(){if(!Mh.isAvailable())throw new Error("No localStorage")}async get(e){return window.localStorage.getItem(e)}async set(e,r){r?window.localStorage.setItem(e,r):window.localStorage.removeItem(e)}}class ree{constructor(){this.store={},this.store={}}async get(e){return this.store[e]||null}async set(e,r){r?this.store[e]=r:delete this.store[e]}}const bp="seq-waas-session-p256k1",wp="seq-waas-session";async function Ak(t,e){const r=await e.get(bp,wp,t);if(!r)throw new Error("No private key found");const n=new ss(r);return{sessionId(){return n.getAddress()},sign(i){return n.signMessage(i)},clear:async()=>{await e.delete(bp,wp,t)}}}async function nee(t,e){const n=await new ss(t).getAddress();return await e.set(bp,wp,n,t),Ak(n,e)}async function iee(t){const e=ss.createRandom();return nee(e.privateKey,t)}let Sk=function(t){return t[t.ECDSAP256K1=0]="ECDSAP256K1",t[t.ECDSAP256R1=1]="ECDSAP256R1",t}({});const Ep="seq-waas-session-p256r1",Ap="seq-waas-session";async function Ck(t,e,r){const n=await r.get(Ep,Ap,t);if(!n||!n.privateKey)throw new Error("No private key found");const i=new TextEncoder;return{sessionId:async()=>{const s=await e.exportKey("raw",n.publicKey),o=new Uint8Array(s.byteLength+1);return o[0]=Sk.ECDSAP256R1,o.set(new Uint8Array(s),1),fe(o)},sign:async s=>{typeof s=="string"&&(s.startsWith("0x")?(s=s.slice(2),s=ce(s)):s=i.encode(s));const o=await e.sign({name:"ECDSA",hash:{name:"SHA-256"}},n.privateKey,s);return fe(new Uint8Array(o))},clear:async()=>{await r.delete(Ep,Ap,t)}}}async function see(t,e,r){const n=await aee(e,t.publicKey);return await r.set(Ep,Ap,n,t),Ck(n,e,r)}async function oee(t,e){const r=await t.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"]);return see(r,t,e)}async function aee(t,e){const r=await t.exportKey("raw",e),n=new Uint8Array(r.byteLength+1);return n[0]=Sk.ECDSAP256R1,n.set(new Uint8Array(r),1),fe(n)}async function Sp(t,e,r){if(!r)throw new Error("No secure store available");return e?Ck(t,e,r):Ak(t,r)}async function lee(t,e){if(!e)throw new Error("No secure store available");return t?oee(t,e):iee(e)}const Cp=Object.entries(it).reduce((t,[e,r])=>(t[r.name]=r.chainId,t),{}),cee=Object.entries(Cp).reduce((t,[e,r])=>(t[r]=e,t),{});function kv(t){const e=typeof t=="number"?t:parseInt(t);if(e in cee)return e;const r=t.toString().toLowerCase();if(r in Cp)return Cp[r];throw new Error(`Unknown network: ${t}`)}const kk=()=>Pk()?new fee:null;function Pk(){return typeof window=="object"&&typeof window.crypto=="object"&&typeof window.crypto.subtle=="object"}class fee{constructor(){if(!Pk())throw new Error("window.crypto.subtle is not available")}async generateKey(e,r,n){return window.crypto.subtle.generateKey(e,r,n)}async exportKey(e,r){const n=await window.crypto.subtle.exportKey(e,r);return new Uint8Array(n)}async digest(e,r){const n=await window.crypto.subtle.digest(e,r);return new Uint8Array(n)}async sign(e,r,n){const i=await window.crypto.subtle.sign(e,r,n);return new Uint8Array(i)}async verify(e,r,n,i){return window.crypto.subtle.verify(e,r,n,i)}getRandomValues(e){const r=new Uint8Array(e);return window.crypto.getRandomValues(r)}}const Rk=()=>Tk()?new uee:null;function Tk(){return typeof indexedDB=="object"}class uee{constructor(){if(this.db=void 0,!Tk())throw new Error("IndexedDB is not available");this.db=null}async openDB(e,r,n){return this.db?this.db:(this.db=await vG(e,1,{upgrade(i){i.createObjectStore(r)}}),this.db)}async get(e,r,n){const i=await this.openDB(e,r,1),s=i.transaction(r,"readonly"),o=await i.get(r,n);return await s.done,o}async set(e,r,n,i){const s=await this.openDB(e,r,1),o=s.transaction(r,"readwrite");return await s.put(r,i,n),await o.done,!0}async delete(e,r,n){const i=await this.openDB(e,r,1),s=i.transaction(r,"readwrite");return await i.delete(r,n),await s.done,!0}}const dee="@0xsequence.waas.wallet",hee="@0xsequence.waas.session_id",vee="@0xsequence.waas.status",Ei=5*60;class yee{constructor(e={network:1},r=new Ek,n=kk(),i=Rk()){this.config=e,this.store=r,this.cryptoBackend=n,this.secureStoreBackend=i,this.VERSION="0.0.0-dev1",this.status=void 0,this.sessionId=void 0,this.wallet=void 0,this.sessionObservers=[],this.gettingSessionIdPromise=void 0,this.status=new Ad(this.store,vee,"signed-out"),this.sessionId=new Ad(this.store,hee,void 0),this.wallet=new Ad(this.store,dee,void 0)}async getAddress(){return this.getWalletAddress()}async getWalletAddress(){if(!await this.isSignedIn())throw new Error("Not signed in");const e=await this.wallet.get();if(!e)throw new Error("No wallet");return e}async commonArgs(e){var r;return zr({},e,{identifier:e==null?void 0:e.identifier,wallet:await this.getWalletAddress(),lifespan:(r=e==null?void 0:e.lifespan)!=null?r:Ei,chainId:kv(e.network||this.config.network)})}async signIntent(e){const r=await this.sessionId.get();if(r===void 0)throw new Error("session not open");const n=await Sp(r,this.cryptoBackend,this.secureStoreBackend);return mZ(n,e)}async signUsingSessionKey(e){const r=await this.sessionId.get();if(!r)throw new Error("session not open");return(await Sp(r,this.cryptoBackend,this.secureStoreBackend)).sign(e)}async getSessionId(){var e=this;if(this.gettingSessionIdPromise)return this.gettingSessionIdPromise;const r=async function(){let i=await e.sessionId.get();return i||(i=await(await lee(e.cryptoBackend,e.secureStoreBackend)).sessionId(),await e.sessionId.set(i),e.signalObservers(e.sessionObservers,i)),e.gettingSessionIdPromise=void 0,i};return this.gettingSessionIdPromise=r(),this.gettingSessionIdPromise}async signIn({idToken:e}){if(await this.status.get()!=="signed-out")throw await this.completeSignOut(),new Error("you are already signed in");const n=await this.getSessionId(),i=await PZ({idToken:e,sessionId:n,lifespan:Ei});return await this.status.set("pending"),this.signIntent(i)}onSessionStateChanged(e){return this.sessionObservers.push(e),()=>{this.sessionObservers=this.sessionObservers.filter(r=>r!=e)}}async signOut({lifespan:e,sessionId:r}={}){if(r=r||await this.sessionId.get(),!r)throw new Error("session not open");const n=G4({lifespan:e||Ei,sessionId:r});return this.signIntent(n)}async signOutSession(e){const r=G4({lifespan:Ei,sessionId:e});return this.signIntent(r)}async listSessions(){const e=MZ({lifespan:Ei,wallet:await this.getWalletAddress()});return this.signIntent(e)}async completeSignOut(){await Promise.all([this.status.set("signed-out"),this.wallet.set(void 0),this.sessionId.set(void 0)]),this.signalObservers(this.sessionObservers,null)}async completeSignIn(e){if(e.result)return this.completeSignIn(e.result);const r=await this.status.get();if(e.code!=="sessionOpened")throw new Error("Invalid receipt");if(r!=="pending")throw new Error("No pending sign in");return await Promise.all([this.status.set("signed-in"),this.wallet.set(e.data.wallet)]),e.data.wallet}async isSignedIn(){return await this.status.get()==="signed-in"}async sessionAuthProof(e){var r;const n=_Z({lifespan:(r=e.lifespan)!=null?r:Ei,network:kv(e.network||this.config.network).toString(),wallet:await this.getWalletAddress(),nonce:e.nonce});return this.signIntent(n)}async signMessage(e){var r;const n=bZ(zr({chainId:kv(e.network||this.config.network)},e,{lifespan:(r=e.lifespan)!=null?r:Ei,wallet:await this.getWalletAddress()}));return this.signIntent(n)}async sendTransaction(e){const r=au(await this.commonArgs(e));return this.signIntent(r)}async getTransactionReceipt(e){const r=QZ(await this.commonArgs(e));return this.signIntent(r)}async sendERC20(e){if(e.token.toLowerCase()===e.to.toLowerCase())throw new Error("Cannot burn tokens using sendERC20");const r=YZ(await this.commonArgs(e));return this.signIntent(r)}async sendERC721(e){if(e.token.toLowerCase()===e.to.toLowerCase())throw new Error("Cannot burn tokens using sendERC721");const r=JZ(await this.commonArgs(e));return this.signIntent(r)}async sendERC1155(e){if(e.token.toLowerCase()===e.to.toLowerCase())throw new Error("Cannot burn tokens using sendERC1155");const r=XZ(await this.commonArgs(e));return this.signIntent(r)}async callContract(e){const r=ZZ(await this.commonArgs(e));return this.signIntent(r)}async feeOptions(e){const r=GZ(await this.commonArgs(e));return this.signIntent(r)}async validateSession({deviceMetadata:e}){const r=await this.sessionId.get();if(!r)throw new Error("session not open");const n=await RZ({lifespan:Ei,sessionId:r,deviceMetadata:e,wallet:await this.getWalletAddress()});return this.signIntent(n)}async getSession(){const e=await this.sessionId.get();if(!e)throw new Error("session not open");const r=IZ({sessionId:e,wallet:await this.getWalletAddress(),lifespan:Ei});return this.signIntent(r)}async finishValidateSession(e,r){const n=await this.sessionId.get();if(!n)throw new Error("session not open");const i=await this.getWalletAddress(),s=TZ({sessionId:n,wallet:i,lifespan:Ei,salt:e,challenge:r});return this.signIntent(s)}async batch(e){const r=tee(e);return this.signIntent(r)}signalObservers(e,r){e.forEach(n=>n(r))}async updateIntentTime(e,r){const n=xZ(e,r);return this.signIntent(n)}}const pee={rpcServer:"http://localhost:9123",emailRegion:"us-east-2"};class mee{constructor(e,r){this.region=e,this.clientId=r,this.cognitoMemo=void 0}cognito(){return this.cognitoMemo||(this.cognitoMemo=new dX({region:this.region})),this.cognitoMemo}signUp(e){return this.cognito().send(new vZ({ClientId:this.clientId,Username:e,Password:"aB1%"+gee(14),UserAttributes:[{Name:"email",Value:e}]}))}signIn(e){return this.cognito().send(new dZ({AuthFlow:"CUSTOM_AUTH",ClientId:this.clientId,AuthParameters:{USERNAME:e}}))}async initiateAuth({email:e}){let r;try{r=await this.signIn(e)}catch(n){if(n instanceof M0&&n.message.includes("user not found"))await this.signUp(e),r=await this.signIn(e);else throw n}if(!r.Session)throw new Error("response session is empty");return{instance:r.Session,email:e}}async finalizeAuth({instance:e,email:r,answer:n,sessionHash:i}){const s=await this.cognito().send(new hZ({ClientId:this.clientId,Session:e,ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:{USERNAME:r,ANSWER:n},ClientMetadata:{SESSION_HASH:i}}));if(!s.AuthenticationResult||!s.AuthenticationResult.IdToken)throw new Error("AuthenticationResult.IdToken is empty");return{idToken:s.AuthenticationResult.IdToken}}}function gee(t){return Array.from(xee(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}function xee(t){const e=new Uint8Array(t);if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto.getRandomValues(e);{console.warn("window.crypto.getRandomValues is not available. Falling back to less secure Math.random().");const r=new Uint8Array(t);for(let n=0;n{this.validationRequiredCallback=this.validationRequiredCallback.filter(r=>r!==e)}}async handleValidationRequired({onValidationRequired:e}={}){var r;if(!(e?e():!0))return!1;const i=await this.waas.validateSession({deviceMetadata:(r=await this.deviceName.get())!=null?r:"Unknown device"}),s=await this.sendIntent(i);this.validationRequiredSalt=s.data.salt;for(const o of this.validationRequiredCallback)o();return this.waitForSessionValid()}headers(){return{"X-Access-Key":this.config.projectAccessKey}}async sendIntent(e){if(!await this.waas.getSessionId())throw new Error("session not open");try{return(await this.client.sendIntent({intent:e},this.headers())).response}catch(n){if(Q4(n)&&this.lastDate){const i=await this.waas.updateIntentTime(e,this.lastDate);return(await this.client.sendIntent({intent:i},this.headers())).response}throw n}}async isSignedIn(){return this.waas.isSignedIn()}async signIn(e,r){const n=await this.waas.signIn({idToken:e.idToken});if(!xG(e.idToken).iss)throw new Error("Invalid idToken");await this.deviceName.set(r);try{const s=await this.registerSession(n,r);return await this.waas.completeSignIn({code:"sessionOpened",data:{sessionId:s.session.id,wallet:s.response.data.wallet}}),{sessionId:s.session.id,wallet:s.response.data.wallet}}catch(s){throw await this.waas.completeSignOut(),s}}async registerSession(e,r){try{return await this.client.registerSession({intent:e,friendlyName:r},this.headers())}catch(n){if(Q4(n)&&this.lastDate){const i=await this.waas.updateIntentTime(e,this.lastDate);return await this.client.registerSession({intent:i,friendlyName:r},this.headers())}throw n}}async refreshSession(){throw new Error("Not implemented")}async getSessionId(){return this.waas.getSessionId()}async getSessionHash(){const e=(await this.waas.getSessionId()).toLowerCase();return Et(sr(e))}async dropSession({sessionId:e,strict:r}={}){const n=await this.waas.getSessionId();if(!n)throw new Error("session not open");const i=e||n;try{const s=await this.waas.signOutSession(i),o=await this.sendIntent(s);if(!UZ(o))throw new Error(`Invalid response: ${JSON.stringify(o)}`)}catch(s){if(r)throw s;console.error(s)}if(i===n){if(!this.secureStoreBackend)throw new Error("No secure store available");(await Sp(n,this.cryptoBackend,this.secureStoreBackend)).clear(),await this.waas.completeSignOut(),await this.deviceName.set(void 0)}}async listSessions(){const e=await this.waas.getSessionId();if(!e)throw new Error("session not open");const r=await this.waas.listSessions();return(await this.sendIntent(r)).data.map(i=>zr({},i,{isThis:i.id===e}))}async getAddress(){return this.waas.getAddress()}async validateSession(e){return await this.isSessionValid()?!0:this.handleValidationRequired(e)}async finishValidateSession(e){const r=await this.waas.finishValidateSession(this.validationRequiredSalt,e),n=await this.sendIntent(r);if(!FZ(n))throw new Error(`Invalid response: ${JSON.stringify(n)}`);return this.validationRequiredSalt="",n.data.isValid}async isSessionValid(){const e=await this.waas.getSession(),r=await this.sendIntent(e);if(!zZ(r))throw new Error(`Invalid response: ${JSON.stringify(r)}`);return r.data.validated}async waitForSessionValid(e=6e5,r=2e3){const n=Date.now();for(;Date.now()-nsetTimeout(i,r))}return!1}async sessionAuthProof({nonce:e,network:r,validation:n}){const i=await this.waas.sessionAuthProof({nonce:e,network:r});return await this.trySendIntent({validation:n},i,jZ)}async useIdentifier(e){if(e.identifier)return e;const r=`ts-sdk-${Date.now()}-${await this.waas.getSessionId()}`;return zr({},e,{identifier:r})}async trySendIntent(e,r,n){const i=await this.sendIntent(r);if(n(i))return i;if($Z(i)&&await this.handleValidationRequired(e.validation)){const o=await this.sendIntent(r);if(n(o))return o}throw new Error(JSON.stringify(i))}async signMessage(e){const r=await this.waas.signMessage(await this.useIdentifier(e));return this.trySendIntent(e,r,LZ)}async trySendTransactionIntent(e,r){let n=await this.trySendIntent(r,e,K4);for(;xk(n);){await new Promise(o=>setTimeout(o,1e3));const i={metaTxHash:n.data.metaTxHash,network:e.data.network,identifier:e.data.identifier,validation:r.validation},s=await this.waas.getTransactionReceipt(await this.useIdentifier(i));n=await this.trySendIntent(i,s,K4)}return n}async sendTransaction(e){const r=await this.waas.sendTransaction(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async sendERC20(e){const r=await this.waas.sendERC20(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async sendERC721(e){const r=await this.waas.sendERC721(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async sendERC1155(e){const r=await this.waas.sendERC1155(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async callContract(e){const r=await this.waas.callContract(await this.useIdentifier(e));return this.trySendTransactionIntent(r,e)}async feeOptions(e){const r=await this.waas.feeOptions(await this.useIdentifier(e));return this.trySendIntent(e,r,BZ)}async networkList(){const e=[],r=await this.client.chainList({"X-Access-Key":this.config.projectAccessKey});for(const n of r.chains)e.push({id:n.id,name:n.name,isEnabled:n.isEnabled});return e}onSessionStateChanged(e){return this.waas.onSessionStateChanged(e)}async fetch(e,r){const n=await window.fetch(e,r),i=n.headers.get("date");return i&&(this.lastDate=new Date(i)),n}}async function _0({transactions:t,network:e}){const r=await st.feeOptions({transactions:t,network:e==null?void 0:e.id});return r.data.feeQuote&&r.data.feeOptions?{feeQuote:r.data.feeQuote,feeOptions:r.data.feeOptions,isSponsored:!1}:{feeQuote:r.data.feeQuote,feeOptions:r.data.feeOptions,isSponsored:!0}}function O0(t){var s;const{feeOptions:e,onSelected:r}=t,[n,i]=p.useState();return p.useEffect(()=>{e&&e.length>0&&(i(e[0]),r(e[0]))},[e]),p.useEffect(()=>{n&&r(n)},[n]),e?$.jsxs(re,{marginTop:"5",children:[$.jsx(Se,{variant:"normal",fontWeight:"bold",children:"Fee options:"}),$.jsx(re,{marginTop:"3"}),$.jsx(d0,{name:"chainId",labelLocation:"top",onValueChange:o=>{const a=e.find(l=>l.token.name===o);a&&i(a)},value:(s=n==null?void 0:n.token)==null?void 0:s.name,options:[...e.map(o=>{var a,l,c;return{label:$.jsx(re,{alignItems:"center",gap:"2",children:$.jsxs(Se,{children:[(a=o==null?void 0:o.token)==null?void 0:a.name," ",Gg(o==null?void 0:o.value,(l=o==null?void 0:o.token)==null?void 0:l.decimals)]})}),value:String((c=o==null?void 0:o.token)==null?void 0:c.name)}})]})]}):$.jsx(re,{})}const Aee="3XwfKaFvrgRIZ6om79SxYoTAAAAAAAAAA";function See(t){const[e,r]=p.useState(),[n,i]=p.useState("ETH"),[s,o]=p.useState(""),[a,l]=p.useState(""),[c,f]=p.useState(""),[u,d]=p.useState(),[v,g]=p.useState(!1),[y,w]=p.useState(),[x,b]=p.useState(),[S,P]=p.useState(),[_,D]=p.useState(),[M,L]=p.useState(!1);p.useEffect(()=>{z()},[]),p.useEffect(()=>{var Z,O;if(t.network){const h=DE(t.network.name);if(h){const A=h.name in{polygon:1,mumbai:1}?"MATIC":"ETH";i(A),z(),(Z=h.blockExplorer)!=null&&Z.rootUrl&&o((O=h.blockExplorer)==null?void 0:O.rootUrl)}}},[t.network]);const z=async()=>{if(!t.network)return;const Z=DE(t.network.name);if(!Z)return;const O=await st.getAddress(),A=await new JC(P9(Z.name),Aee).getEtherBalance({accountAddress:O});r(ae.from(A.balance.balanceWei))},H=async(Z,O)=>{const h=await _0({transactions:[{to:Z,value:NE(O)}],network:t.network});if(h.feeQuote&&h.feeOptions){b(h.feeOptions),D(h.feeQuote),console.log("feeOptions",h);return}L(!0),console.log("tx sponsored")},Y=async(Z,O)=>{var h;try{w(void 0),g(!0);const A=await st.sendTransaction({transactions:[{to:Z,value:NE(O)}],network:(h=t.network)==null?void 0:h.id,transactionsFeeOption:S,transactionsFeeQuote:_});ou(A)?d(A.data.txHash):w(A.data.error),g(!1)}catch(A){console.error(A),g(!1)}finally{D(void 0),b(void 0),P(void 0),L(!1)}};return $.jsxs(re,{children:[$.jsxs(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:["Native token balance: ",WW(e||0)," ",n]}),$.jsx(pr,{marginLeft:"2",size:"xs",label:"Fetch",onClick:z}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"sendNativeTokenTo",type:"text",onChange:Z=>{l(Z.target.value)},value:a,placeholder:"To address 0x...",required:!0,"data-id":"nativeTokenSendAddress"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"sendNativeTokenAmount",type:"text",onChange:Z=>{f(Z.target.value)},value:c,placeholder:"Amount",required:!0,"data-id":"nativeTokenSendAmount"})}),y&&$.jsxs(re,{marginTop:"3",children:["Transaction failed: ",y]}),$.jsx(O0,{feeOptions:x,onSelected:P}),M&&$.jsx(re,{marginTop:"5",children:$.jsx(Se,{variant:"normal",fontWeight:"bold",children:"Fee options: Tx Sponsored!"})}),v?$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:$.jsx(zi,{})}):$.jsxs(re,{children:[$.jsx(pr,{marginTop:"5",marginRight:"2",label:"Check fee options",disabled:a===""&&c==="",onClick:()=>H(a,c)}),$.jsx(pr,{marginTop:"5",label:"Send native token",disabled:a===""&&c==="",onClick:()=>Y(a,c)})]}),u&&$.jsxs(re,{marginTop:"3",children:[$.jsx(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:"Send native token transaction hash:"}),$.jsx("br",{}),$.jsx("a",{href:`${s}tx/${u}`,target:"_blank",rel:"noopener noreferrer",children:u})]})]})}function Cee(){const[t,e]=p.useState(),[r,n]=p.useState(),[i,s]=p.useState(!0),[o,a]=p.useState(),l=async c=>{s(!0),e(void 0);try{await st.dropSession({sessionId:c}),e(await st.listSessions())}catch(f){a(f.message),e(await st.listSessions())}s(!1)};return p.useEffect(()=>{Promise.all([st.listSessions(),st.getSessionId()]).then(([c,f])=>{e(c),n(f),s(!1)}).catch(c=>{a(c.message),s(!1)})},[]),$.jsxs(re,{children:[$.jsxs(re,{marginBottom:"5",children:[$.jsx(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:"Your open sessions"}),t&&$.jsx($.Fragment,{children:t.map(c=>$.jsx(re,{children:$.jsxs(Se,{variant:"normal",color:"text100",fontWeight:"normal",children:[c.friendlyName,!c.isThis&&$.jsx("a",{style:{marginLeft:"7px",textDecoration:"underline",cursor:"pointer"},onClick:()=>l(c.id),children:"x"}),c.isThis&&$.jsx($.Fragment,{children:" (current)"})]})},c.id))}),i&&$.jsx(zi,{})]}),o&&$.jsxs(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:["Error loading sessions: ",o]})]})}function kee(t){const[e,r]=p.useState(""),[n,i]=p.useState(),s=async()=>{var a;const o=await st.signMessage({message:e,network:(a=t.network)==null?void 0:a.id});i(o.data.signature)};return $.jsxs(re,{children:[$.jsx(Pr,{name:"signMessageText",type:"text",onChange:o=>{r(o.target.value),n!=""&&i("")},value:e,placeholder:"Enter a message to sign",required:!0,"data-id":"signMessageInput"}),$.jsx(pr,{marginTop:"5",label:"Sign message",disabled:e==="",onClick:()=>s()}),n&&n!==""&&$.jsxs(re,{flexDirection:"column",marginTop:"5",children:[$.jsxs(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:["Signature for ",e,":"]}),$.jsx(re,{children:$.jsx(Se,{as:"p",wordBreak:"break-word",children:n})})]})]})}function Pee(t){const[e,r]=p.useState(""),[n,i]=p.useState(""),[s,o]=p.useState(""),[a,l]=p.useState(""),[c,f]=p.useState(),[u,d]=p.useState(!1),[v,g]=p.useState(),[y,w]=p.useState(),[x,b]=p.useState(),[S,P]=p.useState(),[_,D]=p.useState(!1),M=async()=>{const z=await _0({transactions:[bk({to:e,abi:n,func:s,args:JSON.parse(a),value:"0"})],network:t.network});if(z.feeQuote&&z.feeOptions){w(z.feeOptions),P(z.feeQuote),console.log("feeOptions",z);return}D(!0),console.log("tx sponsored")},L=async()=>{var z;try{g(void 0),d(!0);const H=await st.callContract({network:(z=t.network)==null?void 0:z.id,to:e,abi:n,func:s,args:JSON.parse(a),value:0,transactionsFeeOption:x,transactionsFeeQuote:S});ou(H)?f(H.data.txHash):g(H.data.error),d(!1)}catch(H){console.error(H),d(!1)}};return $.jsxs(re,{children:[$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"callContractAddress",type:"text",onChange:z=>{r(z.target.value)},value:e,placeholder:"Contract address 0x...",required:!0,"data-id":"nativeTokenSendAddress"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"callContractAbi",type:"text",onChange:z=>{i(z.target.value)},value:n,placeholder:"Contract ABI or function ABI, e.g. [{...}] or [{...}, {...}] or transfer(address,uint256)",required:!0,"data-id":"nativeTokenSendAmount"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"callContractMethod",type:"text",onChange:z=>{o(z.target.value)},value:s,placeholder:"Method name, e.g. transfer",required:!0,"data-id":"nativeTokenSendAmount"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{name:"callContractArgs",type:"text",onChange:z=>{l(z.target.value)},value:a,placeholder:'Method args, e.g. [0x..., 1000] or named { "to": "0x...", "amount": "1000" }',required:!0,"data-id":"nativeTokenSendAmount"})}),$.jsx(O0,{feeOptions:y,onSelected:b}),_&&$.jsx(re,{marginTop:"5",children:$.jsx(Se,{variant:"normal",fontWeight:"bold",children:"Fee options: Tx Sponsored!"})}),v&&$.jsxs(re,{marginTop:"3",children:["Transaction failed: ",v]}),u?$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:$.jsx(zi,{})}):$.jsxs(re,{children:[$.jsx(pr,{marginTop:"5",marginRight:"2",label:"Check fee options",disabled:e===""&&n===""&&s===""&&a==="",onClick:()=>M()}),$.jsx(pr,{marginTop:"5",label:"Call contract",disabled:e===""&&n===""&&s===""&&a==="",onClick:()=>L()})]}),c&&$.jsxs(re,{marginTop:"3",children:[$.jsx(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:"Send native token transaction hash:"}),$.jsx("br",{}),$.jsx("a",{href:`https://polygonscan.com/tx/${c}`,target:"_blank",rel:"noopener noreferrer",children:c})]})]})}const Y4=[{label:"Custom Token",value:"Custom"},{label:"USDC Old",value:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"},{label:"USDC New",value:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"},{label:"DAI",value:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063"}];function Ree(t){const[e,r]=p.useState(Y4[0].value),[n,i]=p.useState(""),[s,o]=p.useState(!0),[a,l]=p.useState("---"),[c,f]=p.useState(""),[u,d]=p.useState(""),[v,g]=p.useState(""),[y,w]=p.useState(""),[x,b]=p.useState(!1),[S,P]=p.useState(0),[_,D]=p.useState(),[M,L]=p.useState(),[z,H]=p.useState(),[Y,Z]=p.useState(!1);p.useEffect(()=>{O(n)},[n]);const O=async I=>{if(!Ez(I)){l("---");return}l("...");const R=new LH(I,["function balanceOf(address) view returns (uint256)","function decimals() view returns (uint8)","function symbol() view returns (string)"],Uee),[N,j,C]=await Promise.all([R.balanceOf(st.getAddress()),R.decimals(),R.symbol()]);P(j),l(`${Gg(N,j)} ${C}`)},h=async()=>{const I=await _0({transactions:[cb({token:n,to:c,value:Lf(u,S).toString()})],network:t.network});if(I.feeQuote&&I.feeOptions){D(I.feeOptions),H(I.feeQuote),console.log("feeOptions",I);return}Z(!0),console.log("tx sponsored")},A=async()=>{var I;try{w(""),b(!0);const R=await st.sendERC20({token:n,to:c,value:Lf(u,S),network:(I=t.network)==null?void 0:I.id,transactionsFeeOption:M,transactionsFeeQuote:z});ou(R)?g(R.data.txHash):w(R.data.error)}catch(R){console.error(R)}finally{b(!1)}},k=I=>{r(I),I==="Custom"?(i(""),o(!0)):(i(I),o(!1))};return $.jsxs(re,{children:[$.jsxs(re,{marginTop:"5",children:[$.jsx(d0,{name:"token",options:Y4,value:e??"",onValueChange:I=>k(I)}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{type:"text",value:n,disabled:!s,onChange:I=>i(I.target.value),placeholder:"Custom ERC20 Contract Address"})})]}),$.jsxs(re,{marginTop:"3",children:[$.jsxs(Se,{variant:"normal",color:"text100",children:["Token Balance: ",a]}),$.jsx(pr,{marginLeft:"2",size:"xs",label:"Fetch",onClick:()=>O(n)})]}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{type:"text",value:c,onChange:I=>f(I.target.value),placeholder:"Destination Address"})}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{type:"text",value:u,onChange:I=>d(I.target.value),placeholder:"Amount"})}),y&&$.jsx(re,{marginTop:"3",children:$.jsxs(Se,{color:"error",children:["Error: ",y]})}),$.jsx(O0,{feeOptions:_,onSelected:L}),Y&&$.jsx(re,{marginTop:"5",children:$.jsx(Se,{variant:"normal",fontWeight:"bold",children:"Fee options: Tx Sponsored!"})}),x?$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:$.jsx(zi,{})}):$.jsxs(re,{children:[$.jsx(pr,{marginTop:"5",marginRight:"2",label:"Check fee options",disabled:n===""&&c==="",onClick:()=>h()}),$.jsx(pr,{marginTop:"5",label:"Send Token",onClick:A})]}),v&&$.jsxs(re,{marginTop:"3",children:[$.jsx(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:"Transaction Hash:"}),$.jsx("a",{href:`https://polygonscan.com/tx/${v}`,target:"_blank",rel:"noopener noreferrer",children:v})]})]})}const Tee="3XwfKaFvrgRIZ6om79SxYoTAAAAAAAAAA";function Mee(t){var a;const[e,r]=p.useState(""),[n,i]=p.useState("");p.useEffect(()=>{t.onChange(t.index,e,n)},[e,n]);const s={display:"flex",gap:"10px",marginBottom:"10px"},o={flex:1};return $.jsxs(re,{style:s,children:[$.jsx(re,{style:o,children:$.jsx(d0,{name:`sendERC1155TokenId${t.index}`,value:e,disabled:!t.options,onValueChange:l=>{r(l)},options:((a=t.options)==null?void 0:a.balances.map(l=>{var c;return{label:`${((c=l.tokenMetadata)==null?void 0:c.name)||"Unknown"} - ${l.balance}`,value:l.tokenID}}))||[],placeholder:"Select a token"})}),$.jsx(re,{style:o,children:$.jsx(Pr,{type:"text",value:e,onChange:l=>r(l.target.value),placeholder:"Token ID"})}),$.jsx(re,{style:o,children:$.jsx(Pr,{type:"text",value:n,onChange:l=>i(l.target.value),placeholder:"Amount"})}),$.jsx(re,{style:o,children:$.jsx(pr,{label:"Remove",onClick:()=>t.removeTokenEntry(t.index)})})]})}function Iee(t){const[e,r]=p.useState(""),[n,i]=p.useState([]),[s,o]=p.useState(""),[a,l]=p.useState(""),[c,f]=p.useState(""),[u,d]=p.useState(!1),[v,g]=p.useState(void 0),[y,w]=p.useState(),[x,b]=p.useState(),[S,P]=p.useState(),[_,D]=p.useState(!1),M=()=>{i([...n,{tokenId:"",amount:""}])},L=async()=>{if(!e||!t.network)return;const O=t.network.name,h=new JC("https://"+O+"-indexer.sequence.app",Tee),A=e,k=await st.getAddress(),I=!0;g(await h.getTokenBalances({contractAddress:A,accountAddress:k,includeMetadata:I}))};p.useEffect(()=>{L()},[e]);const z=(O,h)=>{const A=[...n];A[O]=h,i(A)},H=O=>{const h=[...n];h.splice(O,1),i(h)},Y=async()=>{const O=await _0({transactions:[fb({to:s,token:e,values:n.map(h=>({id:h.tokenId,amount:Lf(h.amount,0)}))})],network:t.network});if(O.feeQuote&&O.feeOptions){w(O.feeOptions),P(O.feeQuote),console.log("feeOptions",O);return}D(!0),console.log("tx sponsored")},Z=async()=>{var O;try{f(""),d(!0);const h=await st.sendERC1155({to:s,token:e,values:n.map(A=>({id:A.tokenId,amount:Lf(A.amount,0)})),network:(O=t.network)==null?void 0:O.id,transactionsFeeOption:x,transactionsFeeQuote:S});ou(h)?l(h.data.txHash):f(h.data.error)}catch(h){console.error(h)}finally{d(!1)}};return $.jsxs(re,{children:[$.jsx(re,{marginBottom:"5",children:$.jsx(Pr,{type:"text",value:e,onChange:O=>r(O.target.value),placeholder:"Token Contract Address"})}),$.jsx(re,{marginBottom:"5",children:$.jsx(pr,{label:"Fetch metadata",onClick:()=>L()})}),n.map((O,h)=>$.jsx(re,{marginBottom:"3",children:$.jsx(Mee,{index:h,options:v,onChange:(A,k,I)=>z(A,{tokenId:k,amount:I}),removeTokenEntry:H})},h)),$.jsx(pr,{label:"Add Token",onClick:M}),$.jsx(re,{marginTop:"5",children:$.jsx(Pr,{type:"text",value:s,onChange:O=>o(O.target.value),placeholder:"Destination Address"})}),c&&$.jsx(re,{marginTop:"3",children:$.jsxs(Se,{color:"error",children:["Error: ",c]})}),$.jsx(O0,{feeOptions:y,onSelected:b}),_&&$.jsx(re,{marginTop:"5",children:$.jsx(Se,{variant:"normal",fontWeight:"bold",children:"Fee options: Tx Sponsored!"})}),u?$.jsx(re,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",children:$.jsx(zi,{})}):$.jsxs(re,{children:[$.jsx(pr,{marginTop:"5",marginRight:"2",label:"Check fee options",disabled:e===""&&s===""&&n.length!==0,onClick:()=>Y()}),$.jsx(pr,{marginTop:"5",label:"Send Tokens",onClick:Z})]}),a&&$.jsxs(re,{marginTop:"3",children:[$.jsx(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:"Transaction Hash:"}),$.jsx("a",{href:`https://polygonscan.com/tx/${a}`,target:"_blank",rel:"noopener noreferrer",children:a})]})]})}const Qu="data:image/png;base64,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",J4="data:image/png;base64,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",_ee="/demo-waas-auth/assets/100-cf3a0cbf.png",Oee="/demo-waas-auth/assets/1101-1d0b8ff9.png",X4="data:image/png;base64,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",Z4="/demo-waas-auth/assets/250-2aa72264.png",eA="/demo-waas-auth/assets/42161-90b816d4.png",Nee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAAXNSR0IB2cksfwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAkxQTFRF////AAAA74Ig8Iwx8ZA4//7974Qj74Mh///+//////78////74Mi//v4//////z5/vfx74Um//37////////////////////////////////////////8ZE774Yn8Y42/fLn////////8Isw////86FW/evc/OXR////+dGt/vPp8Igq++HK+9u/976M8pZE/ezd8Icp+dOx/vbu9KZg/vr2/OjW9a9w9Kll+ti5/e/j/vnz8pxO//r3////8Y838pZD////////////////8Iwy////851Q////+MWX+cyk+tWz+97E8ZI9////8Y0z////////////8ptM/fDk9rZ9972J+93C86Nb8ZM+9riB/OXQ+c+p/OfU/OnY8ZRB////9Kdi9a5u////9axr////////////////////////////////////9Kpn////98KS86Rd/////////vfw/////OPN////859U98GQ////////9rmB+9/G9bJ298CO+Mqg/e3f9bR686JZ8plI9a1t+dKv9bJ18ZA6/vXs8Igs+Mui/e7h/OrZ+Mmf+c6n8phI8Iov86Ve////////+MaZ////8Ikt////+tm7+c2l////++LM98OT8pdG////////+Mid9ruF855S////////////////+Mib////9rN49rd++tq997yG+ta3////98OV////////++DI////////9rV7+tW19bBy/vPq9rqD9Ktp////8ppK////////////////////////Mj9/0QAAAMR0Uk5T/wD/////////Af/+///9/////5/W9TQF4uDZ6MT/////x1L/Av///5b////////////////////////////Q///vCh77/6X/uP//////p/8SDgb/////////////////J///UP8QSyRsVr4rDZr/Wf//bwz/9/9N///8L///////////////////////////////h7H/5P9d///c////j+n////zMuxm/6D//////5v/WFv/MCz///////9U/2M11GLeOHwhNZoAAAr/SURBVHicxVv3Y1RFEJ67JCSXkII5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",tA="data:image/png;base64,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",rA="/demo-waas-auth/assets/56-06b98271.png",ur={MAINNET:1,ROPSTEN:3,RINKEBY:4,GOERLI:5,KOVAN:42,POLYGON:137,POLYGON_MUMBAI:80001,POLYGON_ZKEVM:1101,BSC:56,BSC_TESTNET:97,OPTIMISM:10,OPTIMISM_TESTNET:69,ARBITRUM:42161,ARBITRUM_GOERLI:421613,ARBITRUM_NOVA:42170,AVALANCHE:43114,AVALANCHE_TESTNET:43113,FANTOM:250,FANTOM_TESTNET:4002,GNOSIS:100,AURORA:1313161554,AURORA_TESTNET:1313161556,BASE_GOERLI:84531,HOMEVERSE_TESTNET:40875},Dee={[ur.MAINNET]:Qu,[ur.ROPSTEN]:Qu,[ur.GOERLI]:Qu,[ur.KOVAN]:Qu,[ur.OPTIMISM]:J4,[ur.OPTIMISM_TESTNET]:J4,[ur.POLYGON]:X4,[ur.POLYGON_MUMBAI]:X4,[ur.POLYGON_ZKEVM]:Oee,[ur.ARBITRUM]:eA,[ur.ARBITRUM_NOVA]:Nee,[ur.ARBITRUM_GOERLI]:eA,[ur.GNOSIS]:_ee,[ur.BSC]:rA,[ur.BSC_TESTNET]:rA,[ur.FANTOM]:Z4,[ur.FANTOM_TESTNET]:Z4,[ur.AVALANCHE]:tA,[ur.AVALANCHE_TESTNET]:tA};function Lee({onNetworkChange:t}){const[e,r]=p.useState(),[n,i]=p.useState([]);return p.useEffect(()=>{st.networkList().then(s=>{i(s),r(s[0]),t(s[0])})},[]),n.length===0?$.jsx(re,{marginY:"5",children:$.jsx(zi,{})}):$.jsxs(re,{marginBottom:"4",children:[$.jsx(re,{marginBottom:"4",children:$.jsx(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:"Network to use with requests:"})}),$.jsx(re,{children:$.jsx(d0,{name:"chainId",labelLocation:"top",onValueChange:s=>{const o=n==null?void 0:n.find(a=>a.name===s);o&&(r(o),t(o))},value:e==null?void 0:e.name,options:[...n.map(s=>({label:$.jsxs(re,{alignItems:"center",gap:"2",children:[$.jsx(j$,{src:Dee[s.id],size:"sm"}),$.jsx(Se,{children:s.name})]}),value:String(s.name)}))]})})]})}function jee(){const[t,e]=p.useState(),[r,n]=p.useState(),[i,s]=p.useState([]),[o,a]=p.useState(!1),[l,c]=p.useState(!1),[f,u]=p.useState();return p.useEffect(()=>{st.getAddress().then(d=>{e(d)}).catch(d=>{n(d.message)})},[]),p.useEffect(()=>{st.isSignedIn().then(d=>{d||Uo.navigate("/login")})},[]),p.useEffect(()=>{const d=i.join("");d.length===6&&(c(!0),st.finishValidateSession(d))},[i]),p.useEffect(()=>{const d=st.onValidationRequired(()=>{a(!0),st.waitForSessionValid(6e5,4e3).then(v=>{console.log("isValid",v),s([]),a(!1),c(!1)})});return()=>{d.then(v=>v())}},[]),$.jsxs($.Fragment,{children:[$.jsx(q8,{children:o&&$.jsx(Hj,{children:$.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"1.2em",height:"50vh"},children:$.jsxs(re,{flexDirection:"column",alignItems:"center",children:[$.jsx(Se,{marginBottom:"7",children:"Please enter the session verification code that was sent to your email"}),$.jsx(OC,{value:i,digits:6,onChange:s}),$.jsx(re,{marginTop:"5",children:l&&$.jsx(zi,{})})]})})})}),$.jsxs(re,{marginY:"0",marginX:"auto",paddingX:"6",style:{maxWidth:"720px",marginTop:"80px",marginBottom:"80px"},children:[$.jsx(re,{marginBottom:"10",children:$.jsx(NC,{})}),$.jsxs(re,{marginBottom:"5",flexDirection:"row",children:[$.jsxs(Se,{marginTop:"1",variant:"normal",color:"text100",children:["Logged in with email:"," "]}),$.jsx(pr,{marginLeft:"auto",label:"Log out",size:"xs",onClick:async()=>{try{await st.dropSession({strict:!1})}catch(d){console.warn(`Could not drop session: ${d.message}`)}pU(),Uo.navigate("/login")}})]}),$.jsx(Co,{background:"buttonGlass"}),$.jsx(re,{marginBottom:"5",children:$.jsx(Se,{variant:"normal",color:"text100",fontWeight:"bold",children:"Your wallet address:"})}),$.jsx(re,{marginBottom:"5",children:$.jsx(Se,{variant:"normal",color:"text100",fontWeight:"normal",children:t?$.jsx(re,{children:$.jsx(Se,{children:t})}):$.jsx(zi,{})})}),$.jsx(re,{marginBottom:"5",children:$.jsx(Lee,{onNetworkChange:u})}),$.jsx(re,{children:r&&$.jsxs(Se,{children:["Error fetching wallet address: ",r]})}),$.jsx(Co,{background:"buttonGlass"}),$.jsx(Cee,{}),$.jsxs(ic,{marginY:"3",label:"Send native token transaction",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(See,{network:f})]}),$.jsxs(ic,{marginY:"3",label:"Send ERC20 transaction",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(Ree,{network:f})]}),$.jsxs(ic,{marginY:"3",label:"Send ERC1155 transaction",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(Iee,{network:f})]}),$.jsxs(ic,{marginY:"3",label:"Sign a message",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(kee,{network:f})]}),$.jsxs(ic,{marginY:"3",label:"Call contracts",children:[$.jsx(Co,{background:"buttonGlass"}),$.jsx(Pee,{network:f})]})]})]})}const Bee="970987756660-35a6tc48hvi8cev9cnknp0iugv9poa23.apps.googleusercontent.com",nA="970987756660-6ibakd38eibf3cg9rq42hri7o0jn5va8.apps.googleusercontent.com",$ee="AQAAAAAAAEGv4rUgioUNUbcdNZlvOZE72JI",Fee="eyJwcm9qZWN0SWQiOjE2ODE1LCJlbWFpbFJlZ2lvbiI6ImNhLWNlbnRyYWwtMSIsImVtYWlsQ2xpZW50SWQiOiI2N2V2NXVvc3ZxMzVmcGI2OXI3NnJoYnVoIiwicnBjU2VydmVyIjoiaHR0cHM6Ly93YWFzLnNlcXVlbmNlLmFwcCJ9",iA="AQAAAAAAAAK2JvvZhWqZ51riasWBftkrVXE",sA="eyJwcm9qZWN0SWQiOjY5NCwicnBjU2VydmVyIjoiaHR0cHM6Ly9kZXYtd2Fhcy5zZXF1ZW5jZS5hcHAiLCJlbWFpbFJlZ2lvbiI6ImNhLWNlbnRyYWwtMSIsImVtYWlsQ2xpZW50SWQiOiI1NGF0bjV1cGk2M3FjNTlhMWVtM3ZiaHJzbiJ9",Uee=new VW("https://nodes.sequence.app/polygon"),N0=new URLSearchParams(window.location.search),zee=N0.get("env")??"prod";let Mk=N0.get("projectAccessKey")??$ee,Ik=N0.get("waasConfigKey")??Fee,_k=N0.get("googleClientId")??Bee;zee==="dev"&&(console.log("Using dev environment"),console.log(`Project Access Key: ${iA}`),console.log(`Waas Config Key: ${sA}`),console.log(`Google Client ID: ${nA}`),Mk=iA,Ik=sA,_k=nA);const st=new Eee({network:"polygon",projectAccessKey:Mk,waasConfigKey:Ik}),Uo=XF([{path:"/login",element:$.jsx(iG,{})},{path:"/",element:$.jsx(jee,{})}]);Pv.createRoot(document.getElementById("root")).render($.jsx(gr.StrictMode,{children:$.jsx(Fj,{children:$.jsx(uU,{clientId:_k,children:$.jsx(aU,{router:Uo})})})})); diff --git a/index.html b/index.html index e8ab5a0..242d758 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Demo Waas App - +