@fileverse-dev/ddoc 1.6.6 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +7 -10
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
@@ -480,7 +480,7 @@ ${n.innerHTML}
|
|
480
480
|
`),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),B6=Xe.create({name:"hardBreak"}).extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let s=r+1;s<n.childCount;s++)if(n.child(s).type!=e.type){t.write(t.inTable?Bg.storage.markdown.serialize.call(this,t,e,n):`\\
|
481
481
|
`);return}},parse:{}}}}}),Wee=Xe.create({name:"heading"}).extend({addStorage(){return{markdown:{serialize:ui.nodes.heading,parse:{}}}}}),Kee=Xe.create({name:"horizontalRule"}).extend({addStorage(){return{markdown:{serialize:ui.nodes.horizontal_rule,parse:{}}}}}),qee=Xe.create({name:"image"}).extend({addStorage(){return{markdown:{serialize:ui.nodes.image,parse:{}}}}}),Qee=Xe.create({name:"listItem"}).extend({addStorage(){return{markdown:{serialize:ui.nodes.list_item,parse:{}}}}}),Jee=Xe.create({name:"orderedList"});function Yee(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const Xee=Jee.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const s=e.attrs.start||1,i=String(s+e.childCount-1).length,o=t.repeat(" ",i+2),l=Yee(e,n,r)%2?") ":". ";t.renderList(e,o,u=>{const c=String(s+u);return t.repeat(" ",i-c.length)+c+l})},parse:{}}}}}),Zee=Xe.create({name:"paragraph"}).extend({addStorage(){return{markdown:{serialize:ui.nodes.paragraph,parse:{}}}}});function ax(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const ete=Xe.create({name:"table"}).extend({addStorage(){return{markdown:{serialize(t,e,n){if(!tte(e)){Bg.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,s,i)=>{if(t.write("| "),r.forEach((o,a,l)=>{l&&t.write(" | ");const u=o.firstChild;u.textContent.trim()&&t.renderInline(u)}),t.write(" |"),t.ensureNewLine(),!i){const o=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${o} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function F6(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function tte(t){const e=ax(t),n=e[0],r=e.slice(1);return!(ax(n).some(s=>s.type.name!=="tableHeader"||F6(s)||s.childCount>1)||r.some(s=>ax(s).some(i=>i.type.name==="tableHeader"||F6(i)||i.childCount>1)))}const nte=Xe.create({name:"taskItem"}).extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),rte=Xe.create({name:"taskList"}).extend({addStorage(){return{markdown:{serialize:L6.storage.markdown.serialize,parse:{setup(t){t.use(Nee)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),ste=Xe.create({name:"text"}).extend({addStorage(){return{markdown:{serialize(t,e){t.text(jee(e.text))},parse:{}}}}}),ite=Yt.create({name:"bold"}).extend({addStorage(){return{markdown:{serialize:ui.marks.strong,parse:{}}}}}),ote=Yt.create({name:"code"}).extend({addStorage(){return{markdown:{serialize:ui.marks.code,parse:{}}}}}),ate=Yt.create({name:"italic"}).extend({addStorage(){return{markdown:{serialize:ui.marks.em,parse:{}}}}}),lte=Yt.create({name:"link"}).extend({addStorage(){return{markdown:{serialize:ui.marks.link,parse:{}}}}}),ute=Yt.create({name:"strike"}).extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),cte=[$ee,L6,Gee,B6,Wee,Kee,Bg,qee,Qee,Xee,Zee,ete,nte,rte,ste,ite,ote,P6,ate,lte,ute];function Fg(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,s=(n=cte.find(i=>i.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||s?{...s,...r}:null}class fte{constructor(e){Lg(this,"editor",null),this.editor=e}serialize(e){const n=new Fee(this.nodes,this.marks,{hardBreakNodeName:B6.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Bg)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(P6)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=Fg(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=Fg(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class dte{constructor(e,n){Lg(this,"editor",null),Lg(this,"md",null);let{html:r,linkify:s,breaks:i}=n;this.editor=e,this.md=this.withPatchedRenderer(cr({html:r,linkify:s,breaks:i}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(i=>{var o;return(o=Fg(i))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:i.options},this.md)});const r=this.md.render(e),s=ox(r);return this.editor.extensionManager.extensions.forEach(i=>{var o;return(o=Fg(i))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:i.options},s)}),this.normalizeDOM(s,{inline:n,content:e}),s.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:s}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(i=>{var o;((o=i.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!i.closest("pre")&&(i.nextSibling.textContent=i.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,s),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(s=>s.isBlock).map(s=>{var i;return(i=s.spec.parseDOM)===null||i===void 0?void 0:i.map(o=>o.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(s=>{s.parentElement.matches("p")&&Uee(s)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var s,i,o,a;const l=e.firstElementChild,{nextElementSibling:u}=l,c=(s=(i=n.match(/^\s+/))===null||i===void 0?void 0:i[0])!==null&&s!==void 0?s:"",f=u?"":(o=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){l.innerHTML=`${l.innerHTML}${f}`;return}Hee(l),e.innerHTML=`${c}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=r=>function(){const s=r(...arguments);return s===`
|
482
482
|
`?s:s[s.length-1]===`
|
483
|
-
`?s.slice(0,-1):s};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const hte=wt.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new bt({key:new Mt("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return jp.fromSchema(this.editor.schema).parseSlice(ox(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),pte=wt.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=m7.Commands.config.addCommands();return{setContent:(e,n,r)=>s=>t.setContent(s.editor.storage.markdown.parser.parse(e),n,r)(s),insertContentAt:(e,n,r)=>s=>t.insertContentAt(e,s.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(s)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new dte(this.editor,this.options),serializer:new fte(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[Pee.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),hte.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),mte=[tq,ZK.configure({strike:{HTMLAttributes:{class:"select-text pointer-events-auto"}},bold:{HTMLAttributes:{class:"select-text pointer-events-auto"}},italic:{HTMLAttributes:{class:"select-text pointer-events-auto"}},heading:{HTMLAttributes:{class:"select-text pointer-events-auto"}},paragraph:{HTMLAttributes:{class:"select-text pointer-events-auto"}},orderedList:{HTMLAttributes:{class:"flex flex-col items-start list-decimal list-outside space-y-4 ml-6"}},blockquote:{HTMLAttributes:{class:"rounded-lg bg-[#E8EBEC] p-5 font-serif italic text-black"}},codeBlock:{HTMLAttributes:{class:"rounded-lg bg-transparent border border-[#DDE2E4] p-5 font-mono font-medium text-black"},exitOnArrowDown:!0},code:{HTMLAttributes:{class:"rounded bg-transparent p-1.5 font-mono font-medium text-black text-sm",spellcheck:"false"}},history:!1,gapcursor:!1,dropcursor:!1,document:!1,horizontalRule:!1,bulletList:!1,listItem:!1}),QM.configure({depth:10,newGroupDelay:100}),nq.configure({types:["heading","paragraph"]}),Pq,Eq.extend({exitable:!0}).configure({HTMLAttributes:{class:"text-blue-500 font-bold transition-colors cursor-pointer select-text pointer-events-auto"},openOnClick:!0,autolink:!1}),Sq.configure({placeholder:()=>"",includeChildren:!0,showOnlyCurrent:!0}),Oq.configure({multicolor:!0}),Rq.configure({HTMLAttributes:{class:"select-text pointer-events-auto"}}),eq,Bq,Mq.configure({HTMLAttributes:{class:"not-prose space-y-4 !ml-0"}}),_q.configure({HTMLAttributes:{class:"flex items-start"},nested:!0}),jM.configure({HTMLAttributes:{class:"space-y-4 !ml-6"}}),YM.configure({HTMLAttributes:{class:"leading-normal"}}),HM.configure({width:3,color:"#d1d5db"}),VM,gJ,RY,_Y,...NY,Wq.configure({uploadFn:HU}),Lq,Fq,Vq,IY,Iq,pte.configure({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!0,breaks:!0,transformPastedText:!0,transformCopiedText:!1})],gte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAE/SURBVHgBhVJBTsJQEH3zMcElR+gRuIF6gwYPAOwkLoQTUE6ArEA3xbWJ4gnQE8gNwBuwhMR2fPNLk9o0ZZImM/P/e39e3wgqojPXXiPFJnFovw1kWT53xSKca3C70LXlr/eySYFdZ6Fb61eCePnBCb6VF3P21UA+WX+wv+086fgfyMbh4aPlqWJSZH2/k6EINlBEJI6tdxHG2tIDrsUqxYzsO5Qi+UXfNfwUPT7w49wRU1EyZWNFqIgV9REw84Wga+P1Uj7PsW5QE9pEZMT8Aq+JQmNcYl8HwgEtEvf9fc3RR4zrMCRe84WA6dJRz8upPwyftV0FOP3ugHqu0iZGzsSbF3bYUMRlgDdWMcyE4WvVl73XRC9CNiaqaHMDpkUQrYh8kmKUmy5lVpvdBNs2mOk0tptk9a5AVKHhzML+AZaSjR/r++n9AAAAAElFTkSuQmCC",yte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEjSURBVHgBjZJBToNQEIb/NzTeoMbGjTeoN5Au1S7wBrqwyk5OoD1B46pRF9UbsEBc9nmEHsI08QhGZnxMpaGUEv4EwoP/mxnyj0GNTp++AoPORA+Gx+mo91r1mOJh+LL0WYwDqC8i/obJGCuSfRJ1bHLdtWtQIaY5WoiYBknYtZQfmOGjpTIvC7TAahTvpMksmUQCvK0A6itzNl1egmi2k2K+2gPsD+mvHGkh4MIVoPuSLYbIYxOk3YAJVRuktwd3DhjvggqRB0Slc3D+/D1Lw95DE5Rnq3E487ySXeyu4zooz/R9tD/QUYV5Ufke1HbKvW4RdFS9icRoKeKO1c7Fi+HUbQ/BzzPdXjmxDCy8TOIk7G2CZf1nqzEJfqOPm8Otif4AFnp3K1F5HHAAAAAASUVORK5CYII=",bte=t=>{const e=document.createElement("span");e.classList.add("collaboration-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");return n.classList.add("collaboration-cursor__label"),n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null),e.insertBefore(n,null),e},wte=t=>{const e=document.createElement("span");e.classList.add("custom-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.classList.add("custom-cursor__label-container"),n.setAttribute("style",`border: 1px solid ${t.color}`);const r=document.createElement("img");r.src=gte,r.classList.add("custom-cursor__icon");const s=document.createElement("div");s.classList.add("custom-cursor__label");const i=document.createElement("span");i.classList.add("custom-cursor__text"),i.textContent=t.name;const o=document.createElement("img");return o.src=yte,o.classList.add("custom-cursor__badge"),s.appendChild(i),n.appendChild(r),n.appendChild(s),n.appendChild(o),e.appendChild(n),e},Ate=t=>t.isEns?wte(t):bte(t),vte="6.13.1";function xte(t,e,n){const r=e.split("|").map(i=>i.trim());for(let i=0;i<r.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${n}`,s.value=t,s}async function _n(t){const e=Object.keys(t);return(await Promise.all(e.map(r=>Promise.resolve(t[r])))).reduce((r,s,i)=>(r[e[i]]=s,r),{})}function Me(t,e,n){for(let r in e){let s=e[r];const i=n?n[r]:null;i&&xte(s,i,r),Object.defineProperty(t,r,{enumerable:!0,value:s,writable:!1})}}function kc(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(kc).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r<t.length;r++)n+=e[t[r]>>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return kc(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${kc(n)}: ${kc(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function gn(t,e){return t&&t.code===e}function lx(t){return gn(t,"CALL_EXCEPTION")}function _t(t,e,n){let r=t;{const i=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${kc(n)}`);for(const o in n){if(o==="shortMessage")continue;const a=n[o];i.push(o+"="+kc(a))}}i.push(`code=${e}`),i.push(`version=${vte}`),i.length&&(t+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(t);break;default:s=new Error(t)}return Me(s,{code:e}),n&&Object.assign(s,n),s.shortMessage==null&&Me(s,{shortMessage:r}),s}function ee(t,e,n,r){if(!t)throw _t(e,n,r)}function G(t,e,n,r){ee(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function j6(t,e,n){n==null&&(n=""),n&&(n=": "+n),ee(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ee(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function jg(t,e,n){if(n==null&&(n=""),t!==e){let r=n,s="new";n&&(r+=".",s+=" "+n),ee(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function U6(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let s=2;for(let i=0;i<r.length;i++)r[i]=parseInt(t.substring(s,s+2),16),s+=2;return r}G(!1,"invalid BytesLike value",e||"value",t)}function ct(t,e){return U6(t,e,!1)}function Gn(t,e){return U6(t,e,!0)}function St(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function ux(t){return St(t,!0)||t instanceof Uint8Array}const H6="0123456789abcdef";function we(t){const e=ct(t);let n="0x";for(let r=0;r<e.length;r++){const s=e[r];n+=H6[(s&240)>>4]+H6[s&15]}return n}function $t(t){return"0x"+t.map(e=>we(e).substring(2)).join("")}function Cc(t){return St(t,!0)?(t.length-2)/2:ct(t).length}function Vt(t,e,n){const r=ct(t);return n!=null&&n>r.length&&ee(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),we(r.slice(e??0,n??r.length))}function V6(t,e,n){const r=ct(t);ee(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),n?s.set(r,e-r.length):s.set(r,0),we(s)}function xl(t,e){return V6(t,e,!0)}function kte(t,e){return V6(t,e,!1)}const Ug=BigInt(0),Cs=BigInt(1),Ec=9007199254740991;function Cte(t,e){const n=Hg(t,"value"),r=BigInt(Qe(e,"width"));if(ee(n>>r===Ug,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-Cs){const s=(Cs<<r)-Cs;return-((~n&s)+Cs)}return n}function z6(t,e){let n=Ee(t,"value");const r=BigInt(Qe(e,"width")),s=Cs<<r-Cs;if(n<Ug){n=-n,ee(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const i=(Cs<<r)-Cs;return(~n&i)+Cs}else ee(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return n}function Dh(t,e){const n=Hg(t,"value"),r=BigInt(Qe(e,"bits"));return n&(Cs<<r)-Cs}function Ee(t,e){switch(typeof t){case"bigint":return t;case"number":return G(Number.isInteger(t),"underflow",e||"value",t),G(t>=-Ec&&t<=Ec,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){G(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}G(!1,"invalid BigNumberish value",e||"value",t)}function Hg(t,e){const n=Ee(t,e);return ee(n>=Ug,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const $6="0123456789abcdef";function cx(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=$6[n>>4],e+=$6[n&15];return BigInt(e)}return Ee(t)}function Qe(t,e){switch(typeof t){case"bigint":return G(t>=-Ec&&t<=Ec,"overflow",e||"value",t),Number(t);case"number":return G(Number.isInteger(t),"underflow",e||"value",t),G(t>=-Ec&&t<=Ec,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Qe(BigInt(t),e)}catch(n){G(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}G(!1,"invalid numeric value",e||"value",t)}function Ete(t){return Qe(cx(t))}function Zo(t,e){let r=Hg(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const s=Qe(e,"width");for(ee(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<s*2;)r="0"+r}return"0x"+r}function Wn(t){const e=Hg(t,"value");if(e===Ug)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let s=0;s<r.length;s++){const i=s*2;r[s]=parseInt(n.substring(i,i+2),16)}return r}function kl(t){let e=we(ux(t)?t:Wn(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const G6="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const W6=BigInt(58);function Ste(t){const e=ct(t);let n=cx(e),r="";for(;n;)r=G6[Number(n%W6)]+r,n/=W6;for(let s=0;s<e.length&&!e[s];s++)r=G6[0]+r;return r}function Tte(t){t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return ct(e)}function Dte(t){const e=ct(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}class K6{constructor(e,n,r){W(this,"filter");W(this,"emitter");J(this,Zc);I(this,Zc,n),Me(this,{emitter:e,filter:r})}async removeListener(){T(this,Zc)!=null&&await this.emitter.off(this.filter,T(this,Zc))}}Zc=new WeakMap;function Ote(t,e,n,r,s){G(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function q6(t,e,n,r,s){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let i=0;for(let o=e+1;o<n.length&&n[o]>>6===2;o++)i++;return i}return t==="OVERRUN"?n.length-e-1:0}function Mte(t,e,n,r,s){return t==="OVERLONG"?(G(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),q6(t,e,n))}const Nte=Object.freeze({error:Ote,ignore:q6,replace:Mte});function _te(t,e){e==null&&(e=Nte.error);const n=ct(t,"bytes"),r=[];let s=0;for(;s<n.length;){const i=n[s++];if(!(i>>7)){r.push(i);continue}let o=null,a=null;if((i&224)===192)o=1,a=127;else if((i&240)===224)o=2,a=2047;else if((i&248)===240)o=3,a=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,n,r):s+=e("BAD_PREFIX",s-1,n,r);continue}if(s-1+o>=n.length){s+=e("OVERRUN",s-1,n,r);continue}let l=i&(1<<8-o-1)-1;for(let u=0;u<o;u++){let c=n[s];if((c&192)!=128){s+=e("MISSING_CONTINUE",s,n,r),l=null;break}l=l<<6|c&63,s++}if(l!==null){if(l>1114111){s+=e("OUT_OF_RANGE",s-1-o,n,r,l);continue}if(l>=55296&&l<=57343){s+=e("UTF16_SURROGATE",s-1-o,n,r,l);continue}if(l<=a){s+=e("OVERLONG",s-1-o,n,r,l);continue}r.push(l)}}return r}function Vi(t,e){G(typeof t=="string","invalid string value","str",t);let n=[];for(let r=0;r<t.length;r++){const s=t.charCodeAt(r);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){r++;const i=t.charCodeAt(r);G(r<t.length&&(i&64512)===56320,"invalid surrogate pair","str",t);const o=65536+((s&1023)<<10)+(i&1023);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return new Uint8Array(n)}function Rte(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Sc(t,e){return Rte(_te(t,e))}function Q6(t){async function e(n,r){ee(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=n.url.split(":")[0].toLowerCase();ee(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),ee(s==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null;const o=new AbortController,a=setTimeout(()=>{i=_t("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{i=_t("request cancelled","CANCELLED"),o.abort()});const l={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:o.signal};let u;try{u=await fetch(n.url,l)}catch(h){throw clearTimeout(a),i||h}clearTimeout(a);const c={};u.headers.forEach((h,p)=>{c[p.toLowerCase()]=h});const f=await u.arrayBuffer(),d=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:c,body:d}}return e}const Pte=12,Ite=250;let J6=Q6();const Lte=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Bte=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let fx=!1;async function Y6(t,e){try{const n=t.match(Lte);if(!n)throw new Error("invalid data");return new ea(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Tte(n[3]):jte(n[3]))}catch{return new ea(599,"BAD REQUEST (invalid data: URI)",{},null,new Kn(t))}}function X6(t){async function e(n,r){try{const s=n.match(Bte);if(!s)throw new Error("invalid link");return new Kn(`${t}${s[2]}`)}catch{return new ea(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Kn(n))}}return e}const Vg={data:Y6,ipfs:X6("https://gateway.ipfs.io/ipfs/")},Z6=new WeakMap;class Fte{constructor(e){J(this,$l);J(this,pa);I(this,$l,[]),I(this,pa,!1),Z6.set(e,()=>{if(!T(this,pa)){I(this,pa,!0);for(const n of T(this,$l))setTimeout(()=>{n()},0);I(this,$l,[])}})}addListener(e){ee(!T(this,pa),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),T(this,$l).push(e)}get cancelled(){return T(this,pa)}checkSignal(){ee(!this.cancelled,"cancelled","CANCELLED",{})}}$l=new WeakMap,pa=new WeakMap;function zg(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}const Zy=class Zy{constructor(e){J(this,ql);J(this,ef);J(this,tf);J(this,Os);J(this,so);J(this,nf);J(this,rf);J(this,wn);J(this,Ir);J(this,io);J(this,Gl);J(this,Wl);J(this,Kl);J(this,pi);J(this,Ms);J(this,ma);I(this,rf,String(e)),I(this,ef,!1),I(this,tf,!0),I(this,Os,{}),I(this,so,""),I(this,nf,3e5),I(this,Ms,{slotInterval:Ite,maxAttempts:Pte}),I(this,ma,null)}get url(){return T(this,rf)}set url(e){I(this,rf,String(e))}get body(){return T(this,wn)==null?null:new Uint8Array(T(this,wn))}set body(e){if(e==null)I(this,wn,void 0),I(this,Ir,void 0);else if(typeof e=="string")I(this,wn,Vi(e)),I(this,Ir,"text/plain");else if(e instanceof Uint8Array)I(this,wn,e),I(this,Ir,"application/octet-stream");else if(typeof e=="object")I(this,wn,Vi(JSON.stringify(e))),I(this,Ir,"application/json");else throw new Error("invalid body")}hasBody(){return T(this,wn)!=null}get method(){return T(this,so)?T(this,so):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),I(this,so,String(e).toUpperCase())}get headers(){const e=Object.assign({},T(this,Os));return T(this,io)&&(e.authorization=`Basic ${Dte(Vi(T(this,io)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&T(this,Ir)&&(e["content-type"]=T(this,Ir)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){T(this,Os)[String(e).toLowerCase()]=String(n)}clearHeaders(){I(this,Os,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return T(this,io)||null}setCredentials(e,n){G(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),I(this,io,`${e}:${n}`)}get allowGzip(){return T(this,tf)}set allowGzip(e){I(this,tf,!!e)}get allowInsecureAuthentication(){return!!T(this,ef)}set allowInsecureAuthentication(e){I(this,ef,!!e)}get timeout(){return T(this,nf)}set timeout(e){G(e>=0,"timeout must be non-zero","timeout",e),I(this,nf,e)}get preflightFunc(){return T(this,Gl)||null}set preflightFunc(e){I(this,Gl,e)}get processFunc(){return T(this,Wl)||null}set processFunc(e){I(this,Wl,e)}get retryFunc(){return T(this,Kl)||null}set retryFunc(e){I(this,Kl,e)}get getUrlFunc(){return T(this,ma)||J6}set getUrlFunc(e){I(this,ma,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${T(this,wn)?we(T(this,wn)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(T(this,Ms).slotInterval=e.slotInterval),e.maxAttempts!=null&&(T(this,Ms).maxAttempts=e.maxAttempts)}send(){return ee(T(this,pi)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),I(this,pi,new Fte(this)),fe(this,ql,Dp).call(this,0,e4()+this.timeout,0,this,new ea(0,"",{},null,this))}cancel(){ee(T(this,pi)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=Z6.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ee(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const s=new Zy(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,I(s,Os,Object.assign({},T(this,Os))),T(this,wn)&&I(s,wn,new Uint8Array(T(this,wn))),I(s,Ir,T(this,Ir)),s}clone(){const e=new Zy(this.url);return I(e,so,T(this,so)),T(this,wn)&&I(e,wn,T(this,wn)),I(e,Ir,T(this,Ir)),I(e,Os,Object.assign({},T(this,Os))),I(e,io,T(this,io)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),I(e,Gl,T(this,Gl)),I(e,Wl,T(this,Wl)),I(e,Kl,T(this,Kl)),I(e,Ms,Object.assign({},T(this,Ms))),I(e,ma,T(this,ma)),e}static lockConfig(){fx=!0}static getGateway(e){return Vg[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(fx)throw new Error("gateways locked");Vg[e]=n}static registerGetUrl(e){if(fx)throw new Error("gateways locked");J6=e}static createGetUrlFunc(e){return Q6()}static createDataGateway(){return Y6}static createIpfsGatewayFunc(e){return X6(e)}};ef=new WeakMap,tf=new WeakMap,Os=new WeakMap,so=new WeakMap,nf=new WeakMap,rf=new WeakMap,wn=new WeakMap,Ir=new WeakMap,io=new WeakMap,Gl=new WeakMap,Wl=new WeakMap,Kl=new WeakMap,pi=new WeakMap,Ms=new WeakMap,ma=new WeakMap,ql=new WeakSet,Dp=async function(e,n,r,s,i){var c,f,d;if(e>=T(this,Ms).maxAttempts)return i.makeServerError("exceeded maximum retry limit");ee(e4()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await Ute(r);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in Vg){const h=await Vg[a](o.url,zg(T(s,pi)));if(h instanceof ea){let p=h;if(this.processFunc){zg(T(s,pi));try{p=await this.processFunc(o,p)}catch(m){(m.throttle==null||typeof m.stall!="number")&&p.makeServerError("error in post-processing function",m).assertOk()}}return p}o=h}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,zg(T(s,pi)));let u=new ea(l.statusCode,l.statusMessage,l.headers,l.body,s);if(u.statusCode===301||u.statusCode===302){try{const h=u.headers.location||"";return fe(c=o.redirect(h),ql,Dp).call(c,e+1,n,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const h=u.headers["retry-after"];let p=T(this,Ms).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(p=parseInt(h)),fe(f=o.clone(),ql,Dp).call(f,e+1,n,p,s,u)}if(this.processFunc){zg(T(s,pi));try{u=await this.processFunc(o,u)}catch(h){(h.throttle==null||typeof h.stall!="number")&&u.makeServerError("error in post-processing function",h).assertOk();let p=T(this,Ms).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(p=h.stall),fe(d=o.clone(),ql,Dp).call(d,e+1,n,p,s,u)}}return u};let Kn=Zy;const Mk=class Mk{constructor(e,n,r,s,i){J(this,dp);J(this,hp);J(this,pp);J(this,Lr);J(this,sf);J(this,Ql);I(this,dp,e),I(this,hp,n),I(this,pp,Object.keys(r).reduce((o,a)=>(o[a.toLowerCase()]=String(r[a]),o),{})),I(this,Lr,s==null?null:new Uint8Array(s)),I(this,sf,i||null),I(this,Ql,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${T(this,Lr)?we(T(this,Lr)):"null"}>`}get statusCode(){return T(this,dp)}get statusMessage(){return T(this,hp)}get headers(){return Object.assign({},T(this,pp))}get body(){return T(this,Lr)==null?null:new Uint8Array(T(this,Lr))}get bodyText(){try{return T(this,Lr)==null?"":Sc(T(this,Lr))}catch{ee(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ee(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,n){let r;e?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${e})`);const s=new Mk(599,r,this.headers,this.body,T(this,sf)||void 0);return I(s,Ql,{message:e,error:n}),s}throwThrottleError(e,n){n==null?n=-1:G(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw Me(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return T(this,Lr)!=null}get request(){return T(this,sf)}ok(){return T(this,Ql).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=T(this,Ql);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{T(this,Lr)&&(s=Sc(T(this,Lr)))}catch{}ee(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};dp=new WeakMap,hp=new WeakMap,pp=new WeakMap,Lr=new WeakMap,sf=new WeakMap,Ql=new WeakMap;let ea=Mk;function e4(){return new Date().getTime()}function jte(t){return Vi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function Ute(t){return new Promise(e=>setTimeout(e,t))}function Hte(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function t4(t,e,n){let r=0;for(let s=0;s<n;s++)r=r*256+t[e+s];return r}function n4(t,e,n,r){const s=[];for(;n<e+1+r;){const i=r4(t,n);s.push(i.result),n+=i.consumed,ee(n<=e+1+r,"child data too short","BUFFER_OVERRUN",{buffer:t,length:r,offset:e})}return{consumed:1+r,result:s}}function r4(t,e){ee(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const n=r=>{ee(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const s=t4(t,e+1,r);return n(e+1+r+s),n4(t,e,e+1+r,r+s)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),n4(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const s=t4(t,e+1,r);n(e+1+r+s);const i=we(t.slice(e+1+r,e+1+r+s));return{consumed:1+r+s,result:i}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const s=we(t.slice(e+1,e+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:Hte(t[e])}}function $g(t){const e=ct(t,"data"),n=r4(e,0);return G(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function s4(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function i4(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(i){r=r.concat(i4(i))}),r.length<=55)return r.unshift(192+r.length),r;const s=s4(r.length);return s.unshift(247+s.length),s.concat(r)}const e=Array.prototype.slice.call(ct(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=s4(e.length);return n.unshift(183+n.length),n.concat(e)}const o4="0123456789abcdef";function Cl(t){let e="0x";for(const n of i4(t))e+=o4[n>>4],e+=o4[n&15];return e}const qn=32,dx=new Uint8Array(qn),Vte=["then"],Gg={},a4=new WeakMap;function El(t){return a4.get(t)}function l4(t,e){a4.set(t,e)}function Oh(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}function hx(t,e,n){return t.indexOf(null)>=0?e.map((r,s)=>r instanceof Tc?hx(El(r),r,n):r):t.reduce((r,s,i)=>{let o=e.getValue(s);return s in r||(n&&o instanceof Tc&&(o=hx(El(o),o,n)),r[s]=o),r},{})}const af=class af extends Array{constructor(...n){const r=n[0];let s=n[1],i=(n[2]||[]).slice(),o=!0;r!==Gg&&(s=n,i=[],o=!1);super(s.length);J(this,of);s.forEach((u,c)=>{this[c]=u});const a=i.reduce((u,c)=>(typeof c=="string"&&u.set(c,(u.get(c)||0)+1),u),new Map);if(l4(this,Object.freeze(s.map((u,c)=>{const f=i[c];return f!=null&&a.get(f)===1?f:null}))),I(this,of,[]),T(this,of)==null&&T(this,of),!o)return;Object.freeze(this);const l=new Proxy(this,{get:(u,c,f)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Qe(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const p=u[h];return p instanceof Error&&Oh(`index ${h}`,p),p}if(Vte.indexOf(c)>=0)return Reflect.get(u,c,f);const d=u[c];if(d instanceof Function)return function(...h){return d.apply(this===f?u:this,h)};if(!(c in u))return u.getValue.apply(this===f?u:this,[c])}return Reflect.get(u,c,f)}});return l4(l,El(this)),l}toArray(n){const r=[];return this.forEach((s,i)=>{s instanceof Error&&Oh(`index ${i}`,s),n&&s instanceof af&&(s=s.toArray(n)),r.push(s)}),r}toObject(n){const r=El(this);return r.reduce((s,i,o)=>(ee(i!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),hx(r,this,n)),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const s=El(this),i=[],o=[];for(let a=n;a<r;a++)i.push(this[a]),o.push(s[a]);return new af(Gg,i,o)}filter(n,r){const s=El(this),i=[],o=[];for(let a=0;a<this.length;a++){const l=this[a];l instanceof Error&&Oh(`index ${a}`,l),n.call(r,l,a,this)&&(i.push(l),o.push(s[a]))}return new af(Gg,i,o)}map(n,r){const s=[];for(let i=0;i<this.length;i++){const o=this[i];o instanceof Error&&Oh(`index ${i}`,o),s.push(n.call(r,o,i,this))}return s}getValue(n){const r=El(this).indexOf(n);if(r===-1)return;const s=this[r];return s instanceof Error&&Oh(`property ${JSON.stringify(n)}`,s.error),s}static fromItems(n,r){return new af(Gg,n,r)}};of=new WeakMap;let Tc=af;function u4(t){let e=Wn(t);return ee(e.length<=qn,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:qn,offset:e.length}),e.length!==qn&&(e=Gn($t([dx.slice(e.length%qn),e]))),e}class zi{constructor(e,n,r,s){W(this,"name");W(this,"type");W(this,"localName");W(this,"dynamic");Me(this,{name:e,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,n){G(!1,e,this.localName,n)}}class px{constructor(){J(this,lf);J(this,oo);J(this,Jl);I(this,oo,[]),I(this,Jl,0)}get data(){return $t(T(this,oo))}get length(){return T(this,Jl)}appendWriter(e){return fe(this,lf,ob).call(this,Gn(e.data))}writeBytes(e){let n=Gn(e);const r=n.length%qn;return r&&(n=Gn($t([n,dx.slice(r)]))),fe(this,lf,ob).call(this,n)}writeValue(e){return fe(this,lf,ob).call(this,u4(e))}writeUpdatableValue(){const e=T(this,oo).length;return T(this,oo).push(dx),I(this,Jl,T(this,Jl)+qn),n=>{T(this,oo)[e]=u4(n)}}}oo=new WeakMap,Jl=new WeakMap,lf=new WeakSet,ob=function(e){return T(this,oo).push(e),I(this,Jl,T(this,Jl)+e.length),e.length};const Nk=class Nk{constructor(e,n,r){J(this,Zl);W(this,"allowLoose");J(this,pr);J(this,Br);J(this,Yl);J(this,Xl);J(this,ga);Me(this,{allowLoose:!!n}),I(this,pr,Gn(e)),I(this,Yl,0),I(this,Xl,null),I(this,ga,r??1024),I(this,Br,0)}get data(){return we(T(this,pr))}get dataLength(){return T(this,pr).length}get consumed(){return T(this,Br)}get bytes(){return new Uint8Array(T(this,pr))}subReader(e){const n=new Nk(T(this,pr).slice(T(this,Br)+e),this.allowLoose,T(this,ga));return I(n,Xl,this),n}readBytes(e,n){let r=fe(this,Zl,OL).call(this,0,e,!!n);return fe(this,Zl,Uk).call(this,e),I(this,Br,T(this,Br)+r.length),r.slice(0,e)}readValue(){return cx(this.readBytes(qn))}readIndex(){return Ete(this.readBytes(qn))}};pr=new WeakMap,Br=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,ga=new WeakMap,Zl=new WeakSet,Uk=function(e){var n;if(T(this,Xl))return fe(n=T(this,Xl),Zl,Uk).call(n,e);I(this,Yl,T(this,Yl)+e),ee(T(this,ga)<1||T(this,Yl)<=T(this,ga)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${T(this,ga)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Gn(T(this,pr)),offset:T(this,Br),length:e,info:{bytesRead:T(this,Yl),dataLength:this.dataLength}})},OL=function(e,n,r){let s=Math.ceil(n/qn)*qn;return T(this,Br)+s>T(this,pr).length&&(this.allowLoose&&r&&T(this,Br)+n<=T(this,pr).length?s=n:ee(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Gn(T(this,pr)),length:T(this,pr).length,offset:T(this,Br)+s})),T(this,pr).slice(T(this,Br),T(this,Br)+s)};let mx=Nk;function Wg(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function gx(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function zte(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Wg(t.outputLen),Wg(t.blockLen)}function Dc(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function c4(t,e){gx(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const yx=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const f4=t=>t instanceof Uint8Array,$te=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),bx=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ci=(t,e)=>t<<32-e|t>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function Gte(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Kg(t){if(typeof t=="string"&&(t=Gte(t)),!f4(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Wte(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!f4(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class wx{clone(){return this._cloneInto()}}function Ax(t){const e=r=>t().update(Kg(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Kte(t=32){if(yx&&typeof yx.getRandomValues=="function")return yx.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class d4 extends wx{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,zte(e);const r=Kg(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return Dc(this),this.iHash.update(e),this}digestInto(e){Dc(this),gx(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const h4=(t,e,n)=>new d4(t,e).update(n).digest();h4.create=(t,e)=>new d4(t,e);function qte(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),l=r?4:0,u=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+u,a,r)}class p4 extends wx{constructor(e,n,r,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=bx(this.buffer)}update(e){Dc(this);const{view:n,buffer:r,blockLen:s}=this;e=Kg(e);const i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const l=bx(e);for(;s<=i-o;o+=s)this.process(l,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Dc(this),c4(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;qte(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=bx(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,c[f],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%n&&e.buffer.set(r),e}}const Qte=(t,e,n)=>t&e^~t&n,Jte=(t,e,n)=>t&e^t&n^e&n,Yte=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ta=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),na=new Uint32Array(64);class Xte extends p4{constructor(){super(64,32,8,!1),this.A=ta[0]|0,this.B=ta[1]|0,this.C=ta[2]|0,this.D=ta[3]|0,this.E=ta[4]|0,this.F=ta[5]|0,this.G=ta[6]|0,this.H=ta[7]|0}get(){const{A:e,B:n,C:r,D:s,E:i,F:o,G:a,H:l}=this;return[e,n,r,s,i,o,a,l]}set(e,n,r,s,i,o,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)na[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=na[f-15],h=na[f-2],p=ci(d,7)^ci(d,18)^d>>>3,m=ci(h,17)^ci(h,19)^h>>>10;na[f]=m+na[f-7]+p+na[f-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=ci(a,6)^ci(a,11)^ci(a,25),h=c+d+Qte(a,l,u)+Yte[f]+na[f]|0,m=(ci(r,2)^ci(r,13)^ci(r,22))+Jte(r,s,i)|0;c=u,u=l,l=a,a=o+h|0,o=i,i=s,s=r,r=h+m|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,s,i,o,a,l,u,c)}roundClean(){na.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const m4=Ax(()=>new Xte),qg=BigInt(2**32-1),vx=BigInt(32);function g4(t,e=!1){return e?{h:Number(t&qg),l:Number(t>>vx&qg)}:{h:Number(t>>vx&qg)|0,l:Number(t&qg)|0}}function y4(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:i,l:o}=g4(t[s],e);[n[s],r[s]]=[i,o]}return[n,r]}const Zte=(t,e)=>BigInt(t>>>0)<<vx|BigInt(e>>>0),ene=(t,e,n)=>t>>>n,tne=(t,e,n)=>t<<32-n|e>>>n,nne=(t,e,n)=>t>>>n|e<<32-n,rne=(t,e,n)=>t<<32-n|e>>>n,sne=(t,e,n)=>t<<64-n|e>>>n-32,ine=(t,e,n)=>t>>>n-32|e<<64-n,one=(t,e)=>e,ane=(t,e)=>t,b4=(t,e,n)=>t<<n|e>>>32-n,w4=(t,e,n)=>e<<n|t>>>32-n,A4=(t,e,n)=>e<<n-32|t>>>64-n,v4=(t,e,n)=>t<<n-32|e>>>64-n;function lne(t,e,n,r){const s=(e>>>0)+(r>>>0);return{h:t+n+(s/2**32|0)|0,l:s|0}}const et={fromBig:g4,split:y4,toBig:Zte,shrSH:ene,shrSL:tne,rotrSH:nne,rotrSL:rne,rotrBH:sne,rotrBL:ine,rotr32H:one,rotr32L:ane,rotlSH:b4,rotlSL:w4,rotlBH:A4,rotlBL:v4,add:lne,add3L:(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H:(t,e,n,r)=>e+n+r+(t/2**32|0)|0,add4L:(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),add4H:(t,e,n,r,s)=>e+n+r+s+(t/2**32|0)|0,add5H:(t,e,n,r,s,i)=>e+n+r+s+i+(t/2**32|0)|0,add5L:(t,e,n,r,s)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},[une,cne]=et.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),ra=new Uint32Array(80),sa=new Uint32Array(80);class fne extends p4{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:s,Ch:i,Cl:o,Dh:a,Dl:l,Eh:u,El:c,Fh:f,Fl:d,Gh:h,Gl:p,Hh:m,Hl:g}=this;return[e,n,r,s,i,o,a,l,u,c,f,d,h,p,m,g]}set(e,n,r,s,i,o,a,l,u,c,f,d,h,p,m,g){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=l|0,this.Eh=u|0,this.El=c|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=p|0,this.Hh=m|0,this.Hl=g|0}process(e,n){for(let A=0;A<16;A++,n+=4)ra[A]=e.getUint32(n),sa[A]=e.getUint32(n+=4);for(let A=16;A<80;A++){const w=ra[A-15]|0,x=sa[A-15]|0,k=et.rotrSH(w,x,1)^et.rotrSH(w,x,8)^et.shrSH(w,x,7),E=et.rotrSL(w,x,1)^et.rotrSL(w,x,8)^et.shrSL(w,x,7),O=ra[A-2]|0,M=sa[A-2]|0,D=et.rotrSH(O,M,19)^et.rotrBH(O,M,61)^et.shrSH(O,M,6),R=et.rotrSL(O,M,19)^et.rotrBL(O,M,61)^et.shrSL(O,M,6),B=et.add4L(E,R,sa[A-7],sa[A-16]),F=et.add4H(B,k,D,ra[A-7],ra[A-16]);ra[A]=F|0,sa[A]=B|0}let{Ah:r,Al:s,Bh:i,Bl:o,Ch:a,Cl:l,Dh:u,Dl:c,Eh:f,El:d,Fh:h,Fl:p,Gh:m,Gl:g,Hh:y,Hl:v}=this;for(let A=0;A<80;A++){const w=et.rotrSH(f,d,14)^et.rotrSH(f,d,18)^et.rotrBH(f,d,41),x=et.rotrSL(f,d,14)^et.rotrSL(f,d,18)^et.rotrBL(f,d,41),k=f&h^~f&m,E=d&p^~d&g,O=et.add5L(v,x,E,cne[A],sa[A]),M=et.add5H(O,y,w,k,une[A],ra[A]),D=O|0,R=et.rotrSH(r,s,28)^et.rotrBH(r,s,34)^et.rotrBH(r,s,39),B=et.rotrSL(r,s,28)^et.rotrBL(r,s,34)^et.rotrBL(r,s,39),F=r&i^r&a^i&a,V=s&o^s&l^o&l;y=m|0,v=g|0,m=h|0,g=p|0,h=f|0,p=d|0,{h:f,l:d}=et.add(u|0,c|0,M|0,D|0),u=a|0,c=l|0,a=i|0,l=o|0,i=r|0,o=s|0;const L=et.add3L(D,B,V);r=et.add3H(L,M,R,F),s=L|0}({h:r,l:s}=et.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=et.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l}=et.add(this.Ch|0,this.Cl|0,a|0,l|0),{h:u,l:c}=et.add(this.Dh|0,this.Dl|0,u|0,c|0),{h:f,l:d}=et.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:p}=et.add(this.Fh|0,this.Fl|0,h|0,p|0),{h:m,l:g}=et.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:v}=et.add(this.Hh|0,this.Hl|0,y|0,v|0),this.set(r,s,i,o,a,l,u,c,f,d,h,p,m,g,y,v)}roundClean(){ra.fill(0),sa.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const dne=Ax(()=>new fne);function hne(){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 x4=hne();x4.crypto||x4.msCrypto;function pne(t){switch(t){case"sha256":return m4.create();case"sha512":return dne.create()}G(!1,"invalid hashing algorithm name","algorithm",t)}const[k4,C4,E4]=[[],[],[]],mne=BigInt(0),Mh=BigInt(1),gne=BigInt(2),yne=BigInt(7),bne=BigInt(256),wne=BigInt(113);for(let t=0,e=Mh,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],k4.push(2*(5*r+n)),C4.push((t+1)*(t+2)/2%64);let s=mne;for(let i=0;i<7;i++)e=(e<<Mh^(e>>yne)*wne)%bne,e&gne&&(s^=Mh<<(Mh<<BigInt(i))-Mh);E4.push(s)}const[Ane,vne]=y4(E4,!0),S4=(t,e,n)=>n>32?A4(t,e,n):b4(t,e,n),T4=(t,e,n)=>n>32?v4(t,e,n):w4(t,e,n);function xne(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,u=n[l],c=n[l+1],f=S4(u,c,1)^n[a],d=T4(u,c,1)^n[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let s=t[2],i=t[3];for(let o=0;o<24;o++){const a=C4[o],l=S4(s,i,a),u=T4(s,i,a),c=k4[o];s=t[c],i=t[c+1],t[c]=l,t[c+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=Ane[r],t[1]^=vne[r]}n.fill(0)}class xx extends wx{constructor(e,n,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Wg(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=$te(this.state)}keccak(){xne(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Dc(this);const{blockLen:n,state:r}=this;e=Kg(e);const s=e.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:s}=this;e[r]^=n,n&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Dc(this,!1),gx(e),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Wg(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(c4(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new xx(n,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const kne=((t,e,n)=>Ax(()=>new xx(e,t,n)))(1,136,256/8);let D4=!1;const O4=function(t){return kne(t)};let M4=O4;function en(t){const e=ct(t,"data");return we(M4(e))}en._=O4,en.lock=function(){D4=!0},en.register=function(t){if(D4)throw new TypeError("keccak256 is locked");M4=t},Object.freeze(en);const N4=function(t){return pne("sha256").update(t).digest()};let _4=N4,R4=!1;function Oc(t){const e=ct(t,"data");return we(_4(e))}Oc._=N4,Oc.lock=function(){R4=!0},Oc.register=function(t){if(R4)throw new Error("sha256 is locked");_4=t},Object.freeze(Oc),Object.freeze(Oc);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const P4=BigInt(0),Qg=BigInt(1),Cne=BigInt(2),Jg=t=>t instanceof Uint8Array,Ene=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Mc(t){if(!Jg(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=Ene[t[n]];return e}function I4(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function kx(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Nc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let r=0;r<n.length;r++){const s=r*2,i=t.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function Sl(t){return kx(Mc(t))}function Cx(t){if(!Jg(t))throw new Error("Uint8Array expected");return kx(Mc(Uint8Array.from(t).reverse()))}function _c(t,e){return Nc(t.toString(16).padStart(e*2,"0"))}function Ex(t,e){return _c(t,e).reverse()}function Sne(t){return Nc(I4(t))}function Es(t,e,n){let r;if(typeof e=="string")try{r=Nc(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(Jg(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${t} expected ${n} bytes, got ${s}`);return r}function Nh(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!Jg(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function Tne(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Dne(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function One(t){let e;for(e=0;t>P4;t>>=Qg,e+=1);return e}function Mne(t,e){return t>>BigInt(e)&Qg}const Nne=(t,e,n)=>t|(n?Qg:P4)<<BigInt(e),Sx=t=>(Cne<<BigInt(t-1))-Qg,Tx=t=>new Uint8Array(t),L4=t=>Uint8Array.from(t);function B4(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Tx(t),s=Tx(t),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...f)=>n(s,r,...f),l=(f=Tx())=>{s=a(L4([0]),f),r=a(),f.length!==0&&(s=a(L4([1]),f),r=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f<e;){r=a();const h=r.slice();d.push(h),f+=r.length}return Nh(...d)};return(f,d)=>{o(),l(f);let h;for(;!(h=d(u()));)l();return o(),h}}const _ne={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function _h(t,e,n={}){const r=(s,i,o)=>{const a=_ne[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=t[s];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${i}`)};for(const[s,i]of Object.entries(e))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return t}const Rne=Object.freeze(Object.defineProperty({__proto__:null,bitGet:Mne,bitLen:One,bitMask:Sx,bitSet:Nne,bytesToHex:Mc,bytesToNumberBE:Sl,bytesToNumberLE:Cx,concatBytes:Nh,createHmacDrbg:B4,ensureBytes:Es,equalBytes:Tne,hexToBytes:Nc,hexToNumber:kx,numberToBytesBE:_c,numberToBytesLE:Ex,numberToHexUnpadded:I4,numberToVarBytesBE:Sne,utf8ToBytes:Dne,validateObject:_h},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const yn=BigInt(0),Gt=BigInt(1),Tl=BigInt(2),Pne=BigInt(3),Dx=BigInt(4),F4=BigInt(5),j4=BigInt(8);BigInt(9),BigInt(16);function fr(t,e){const n=t%e;return n>=yn?n:e+n}function Ine(t,e,n){if(n<=yn||e<yn)throw new Error("Expected power/modulo > 0");if(n===Gt)return yn;let r=Gt;for(;e>yn;)e&Gt&&(r=r*t%n),t=t*t%n,e>>=Gt;return r}function Xr(t,e,n){let r=t;for(;e-- >yn;)r*=r,r%=n;return r}function Ox(t,e){if(t===yn||e<=yn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=fr(t,e),r=e,s=yn,i=Gt;for(;n!==yn;){const a=r/n,l=r%n,u=s-i*a;r=n,n=l,s=i,i=u}if(r!==Gt)throw new Error("invert: does not exist");return fr(s,e)}function Lne(t){const e=(t-Gt)/Tl;let n,r,s;for(n=t-Gt,r=0;n%Tl===yn;n/=Tl,r++);for(s=Tl;s<t&&Ine(s,e,t)!==t-Gt;s++);if(r===1){const o=(t+Gt)/Dx;return function(l,u){const c=l.pow(u,o);if(!l.eql(l.sqr(c),u))throw new Error("Cannot find square root");return c}}const i=(n+Gt)/Tl;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=r,c=a.pow(a.mul(a.ONE,s),n),f=a.pow(l,i),d=a.pow(l,n);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let h=1;for(let m=a.sqr(d);h<u&&!a.eql(m,a.ONE);h++)m=a.sqr(m);const p=a.pow(c,Gt<<BigInt(u-h-1));c=a.sqr(p),f=a.mul(f,p),d=a.mul(d,c),u=h}return f}}function Bne(t){if(t%Dx===Pne){const e=(t+Gt)/Dx;return function(r,s){const i=r.pow(s,e);if(!r.eql(r.sqr(i),s))throw new Error("Cannot find square root");return i}}if(t%j4===F4){const e=(t-F4)/j4;return function(r,s){const i=r.mul(s,Tl),o=r.pow(i,e),a=r.mul(s,o),l=r.mul(r.mul(a,Tl),o),u=r.mul(a,r.sub(l,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return Lne(t)}const Fne=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function jne(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Fne.reduce((r,s)=>(r[s]="function",r),e);return _h(t,n)}function Une(t,e,n){if(n<yn)throw new Error("Expected power > 0");if(n===yn)return t.ONE;if(n===Gt)return e;let r=t.ONE,s=e;for(;n>yn;)n&Gt&&(r=t.mul(r,s)),s=t.sqr(s),n>>=Gt;return r}function Hne(t,e){const n=new Array(e.length),r=e.reduce((i,o,a)=>t.is0(o)?i:(n[a]=i,t.mul(i,o)),t.ONE),s=t.inv(r);return e.reduceRight((i,o,a)=>t.is0(o)?i:(n[a]=t.mul(i,n[a]),t.mul(i,o)),s),n}function U4(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Vne(t,e,n=!1,r={}){if(t<=yn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:s,nByteLength:i}=U4(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Bne(t),a=Object.freeze({ORDER:t,BITS:s,BYTES:i,MASK:Sx(s),ZERO:yn,ONE:Gt,create:l=>fr(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return yn<=l&&l<t},is0:l=>l===yn,isOdd:l=>(l&Gt)===Gt,neg:l=>fr(-l,t),eql:(l,u)=>l===u,sqr:l=>fr(l*l,t),add:(l,u)=>fr(l+u,t),sub:(l,u)=>fr(l-u,t),mul:(l,u)=>fr(l*u,t),pow:(l,u)=>Une(a,l,u),div:(l,u)=>fr(l*Ox(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Ox(l,t),sqrt:r.sqrt||(l=>o(a,l)),invertBatch:l=>Hne(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?Ex(l,i):_c(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?Cx(l):Sl(l)}});return Object.freeze(a)}function H4(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function V4(t){const e=H4(t);return e+Math.ceil(e/2)}function zne(t,e,n=!1){const r=t.length,s=H4(e),i=V4(e);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const o=n?Sl(t):Cx(t),a=fr(o,e-Gt)+Gt;return n?Ex(a,s):_c(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $ne=BigInt(0),Mx=BigInt(1);function Gne(t,e){const n=(s,i)=>{const o=i.negate();return s?o:i},r=s=>{const i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,i){let o=t.ZERO,a=s;for(;i>$ne;)i&Mx&&(o=o.add(a)),a=a.double(),i>>=Mx;return o},precomputeWindow(s,i){const{windows:o,windowSize:a}=r(i),l=[];let u=s,c=u;for(let f=0;f<o;f++){c=u,l.push(c);for(let d=1;d<a;d++)c=c.add(u),l.push(c);u=c.double()}return l},wNAF(s,i,o){const{windows:a,windowSize:l}=r(s);let u=t.ZERO,c=t.BASE;const f=BigInt(2**s-1),d=2**s,h=BigInt(s);for(let p=0;p<a;p++){const m=p*l;let g=Number(o&f);o>>=h,g>l&&(g-=d,o+=Mx);const y=m,v=m+Math.abs(g)-1,A=p%2!==0,w=g<0;g===0?c=c.add(n(A,i[y])):u=u.add(n(w,i[v]))}return{p:u,f:c}},wNAFCached(s,i,o,a){const l=s._WINDOW_SIZE||1;let u=i.get(s);return u||(u=this.precomputeWindow(s,l),l!==1&&i.set(s,a(u))),this.wNAF(l,u,o)}}}function z4(t){return jne(t.Fp),_h(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...U4(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Wne(t){const e=z4(t);_h(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=e;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Kne,hexToBytes:qne}=Rne,Dl={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Dl;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Kne(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Dl,n=typeof t=="string"?qne(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:s,l:i}=Dl._parseInt(n.subarray(2)),{d:o,l:a}=Dl._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),s=e(n(t.r)),i=r.length/2,o=s.length/2,a=n(i),l=n(o);return`30${n(o+i+4)}02${l}${s}02${a}${r}`}},$i=BigInt(0),Zr=BigInt(1);BigInt(2);const $4=BigInt(3);BigInt(4);function Qne(t){const e=Wne(t),{Fp:n}=e,r=e.toBytes||((p,m,g)=>{const y=m.toAffine();return Nh(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),s=e.fromBytes||(p=>{const m=p.subarray(1),g=n.fromBytes(m.subarray(0,n.BYTES)),y=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:g,y}});function i(p){const{a:m,b:g}=e,y=n.sqr(p),v=n.mul(y,p);return n.add(n.add(v,n.mul(p,m)),g)}if(!n.eql(n.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(p){return typeof p=="bigint"&&$i<p&&p<e.n}function a(p){if(!o(p))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(p){const{allowedPrivateKeyLengths:m,nByteLength:g,wrapPrivateKey:y,n:v}=e;if(m&&typeof p!="bigint"){if(p instanceof Uint8Array&&(p=Mc(p)),typeof p!="string"||!m.includes(p.length))throw new Error("Invalid key");p=p.padStart(g*2,"0")}let A;try{A=typeof p=="bigint"?p:Sl(Es("private key",p,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof p}`)}return y&&(A=fr(A,v)),a(A),A}const u=new Map;function c(p){if(!(p instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(m,g,y){if(this.px=m,this.py=g,this.pz=y,m==null||!n.isValid(m))throw new Error("x required");if(g==null||!n.isValid(g))throw new Error("y required");if(y==null||!n.isValid(y))throw new Error("z required")}static fromAffine(m){const{x:g,y}=m||{};if(!m||!n.isValid(g)||!n.isValid(y))throw new Error("invalid affine point");if(m instanceof f)throw new Error("projective point not allowed");const v=A=>n.eql(A,n.ZERO);return v(g)&&v(y)?f.ZERO:new f(g,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const g=n.invertBatch(m.map(y=>y.pz));return m.map((y,v)=>y.toAffine(g[v])).map(f.fromAffine)}static fromHex(m){const g=f.fromAffine(s(Es("pointHex",m)));return g.assertValidity(),g}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:g}=this.toAffine();if(!n.isValid(m)||!n.isValid(g))throw new Error("bad point: x or y not FE");const y=n.sqr(g),v=i(m);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:g,py:y,pz:v}=this,{px:A,py:w,pz:x}=m,k=n.eql(n.mul(g,x),n.mul(A,v)),E=n.eql(n.mul(y,x),n.mul(w,v));return k&&E}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:g}=e,y=n.mul(g,$4),{px:v,py:A,pz:w}=this;let x=n.ZERO,k=n.ZERO,E=n.ZERO,O=n.mul(v,v),M=n.mul(A,A),D=n.mul(w,w),R=n.mul(v,A);return R=n.add(R,R),E=n.mul(v,w),E=n.add(E,E),x=n.mul(m,E),k=n.mul(y,D),k=n.add(x,k),x=n.sub(M,k),k=n.add(M,k),k=n.mul(x,k),x=n.mul(R,x),E=n.mul(y,E),D=n.mul(m,D),R=n.sub(O,D),R=n.mul(m,R),R=n.add(R,E),E=n.add(O,O),O=n.add(E,O),O=n.add(O,D),O=n.mul(O,R),k=n.add(k,O),D=n.mul(A,w),D=n.add(D,D),O=n.mul(D,R),x=n.sub(x,O),E=n.mul(D,M),E=n.add(E,E),E=n.add(E,E),new f(x,k,E)}add(m){c(m);const{px:g,py:y,pz:v}=this,{px:A,py:w,pz:x}=m;let k=n.ZERO,E=n.ZERO,O=n.ZERO;const M=e.a,D=n.mul(e.b,$4);let R=n.mul(g,A),B=n.mul(y,w),F=n.mul(v,x),V=n.add(g,y),L=n.add(A,w);V=n.mul(V,L),L=n.add(R,B),V=n.sub(V,L),L=n.add(g,v);let H=n.add(A,x);return L=n.mul(L,H),H=n.add(R,F),L=n.sub(L,H),H=n.add(y,v),k=n.add(w,x),H=n.mul(H,k),k=n.add(B,F),H=n.sub(H,k),O=n.mul(M,L),k=n.mul(D,F),O=n.add(k,O),k=n.sub(B,O),O=n.add(B,O),E=n.mul(k,O),B=n.add(R,R),B=n.add(B,R),F=n.mul(M,F),L=n.mul(D,L),B=n.add(B,F),F=n.sub(R,F),F=n.mul(M,F),L=n.add(L,F),R=n.mul(B,L),E=n.add(E,R),R=n.mul(H,L),k=n.mul(V,k),k=n.sub(k,R),R=n.mul(V,B),O=n.mul(H,O),O=n.add(O,R),new f(k,E,O)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,g=>{const y=n.invertBatch(g.map(v=>v.pz));return g.map((v,A)=>v.toAffine(y[A])).map(f.fromAffine)})}multiplyUnsafe(m){const g=f.ZERO;if(m===$i)return g;if(a(m),m===Zr)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:A,k2neg:w,k2:x}=y.splitScalar(m),k=g,E=g,O=this;for(;A>$i||x>$i;)A&Zr&&(k=k.add(O)),x&Zr&&(E=E.add(O)),O=O.double(),A>>=Zr,x>>=Zr;return v&&(k=k.negate()),w&&(E=E.negate()),E=new f(n.mul(E.px,y.beta),E.py,E.pz),k.add(E)}multiply(m){a(m);let g=m,y,v;const{endo:A}=e;if(A){const{k1neg:w,k1:x,k2neg:k,k2:E}=A.splitScalar(g);let{p:O,f:M}=this.wNAF(x),{p:D,f:R}=this.wNAF(E);O=h.constTimeNegate(w,O),D=h.constTimeNegate(k,D),D=new f(n.mul(D.px,A.beta),D.py,D.pz),y=O.add(D),v=M.add(R)}else{const{p:w,f:x}=this.wNAF(g);y=w,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,g,y){const v=f.BASE,A=(x,k)=>k===$i||k===Zr||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),w=A(this,g).add(A(m,y));return w.is0()?void 0:w}toAffine(m){const{px:g,py:y,pz:v}=this,A=this.is0();m==null&&(m=A?n.ONE:n.inv(v));const w=n.mul(g,m),x=n.mul(y,m),k=n.mul(v,m);if(A)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:w,y:x}}isTorsionFree(){const{h:m,isTorsionFree:g}=e;if(m===Zr)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:g}=e;return m===Zr?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return Mc(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=e.nBitLength,h=Gne(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:o}}function Jne(t){const e=z4(t);return _h(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Yne(t){const e=Jne(t),{Fp:n,n:r}=e,s=n.BYTES+1,i=2*n.BYTES+1;function o(L){return $i<L&&L<n.ORDER}function a(L){return fr(L,r)}function l(L){return Ox(L,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:f,isWithinCurveOrder:d}=Qne({...e,toBytes(L,H,q){const te=H.toAffine(),Z=n.toBytes(te.x),pe=Nh;return q?pe(Uint8Array.from([H.hasEvenY()?2:3]),Z):pe(Uint8Array.from([4]),Z,n.toBytes(te.y))},fromBytes(L){const H=L.length,q=L[0],te=L.subarray(1);if(H===s&&(q===2||q===3)){const Z=Sl(te);if(!o(Z))throw new Error("Point is not on curve");const pe=f(Z);let Ce=n.sqrt(pe);const Se=(Ce&Zr)===Zr;return(q&1)===1!==Se&&(Ce=n.neg(Ce)),{x:Z,y:Ce}}else if(H===i&&q===4){const Z=n.fromBytes(te.subarray(0,n.BYTES)),pe=n.fromBytes(te.subarray(n.BYTES,2*n.BYTES));return{x:Z,y:pe}}else throw new Error(`Point of length ${H} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=L=>Mc(_c(L,e.nByteLength));function p(L){const H=r>>Zr;return L>H}function m(L){return p(L)?a(-L):L}const g=(L,H,q)=>Sl(L.slice(H,q));class y{constructor(H,q,te){this.r=H,this.s=q,this.recovery=te,this.assertValidity()}static fromCompact(H){const q=e.nByteLength;return H=Es("compactSignature",H,q*2),new y(g(H,0,q),g(H,q,2*q))}static fromDER(H){const{r:q,s:te}=Dl.toSig(Es("DER",H));return new y(q,te)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(H){return new y(this.r,this.s,H)}recoverPublicKey(H){const{r:q,s:te,recovery:Z}=this,pe=E(Es("msgHash",H));if(Z==null||![0,1,2,3].includes(Z))throw new Error("recovery id invalid");const Ce=Z===2||Z===3?q+e.n:q;if(Ce>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Se=Z&1?"03":"02",ve=u.fromHex(Se+h(Ce)),xe=l(Ce),Fe=a(-pe*xe),He=a(te*xe),ze=u.BASE.multiplyAndAddUnsafe(ve,Fe,He);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Nc(this.toDERHex())}toDERHex(){return Dl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Nc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(L){try{return c(L),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const L=V4(e.n);return zne(e.randomBytes(L),e.n)},precompute(L=8,H=u.BASE){return H._setWindowSize(L),H.multiply(BigInt(3)),H}};function A(L,H=!0){return u.fromPrivateKey(L).toRawBytes(H)}function w(L){const H=L instanceof Uint8Array,q=typeof L=="string",te=(H||q)&&L.length;return H?te===s||te===i:q?te===2*s||te===2*i:L instanceof u}function x(L,H,q=!0){if(w(L))throw new Error("first arg must be private key");if(!w(H))throw new Error("second arg must be public key");return u.fromHex(H).multiply(c(L)).toRawBytes(q)}const k=e.bits2int||function(L){const H=Sl(L),q=L.length*8-e.nBitLength;return q>0?H>>BigInt(q):H},E=e.bits2int_modN||function(L){return a(k(L))},O=Sx(e.nBitLength);function M(L){if(typeof L!="bigint")throw new Error("bigint expected");if(!($i<=L&&L<O))throw new Error(`bigint expected < 2^${e.nBitLength}`);return _c(L,e.nByteLength)}function D(L,H,q=R){if(["recovered","canonical"].some(tt=>tt in q))throw new Error("sign() legacy options not supported");const{hash:te,randomBytes:Z}=e;let{lowS:pe,prehash:Ce,extraEntropy:Se}=q;pe==null&&(pe=!0),L=Es("msgHash",L),Ce&&(L=Es("prehashed msgHash",te(L)));const ve=E(L),xe=c(H),Fe=[M(xe),M(ve)];if(Se!=null){const tt=Se===!0?Z(n.BYTES):Se;Fe.push(Es("extraEntropy",tt))}const He=Nh(...Fe),ze=ve;function Le(tt){const le=k(tt);if(!d(le))return;const $e=l(le),ae=u.BASE.multiply(le).toAffine(),be=a(ae.x);if(be===$i)return;const Be=a($e*a(ze+be*xe));if(Be===$i)return;let $=(ae.x===be?0:2)|Number(ae.y&Zr),Q=Be;return pe&&p(Be)&&(Q=m(Be),$^=1),new y(be,Q,$)}return{seed:He,k2sig:Le}}const R={lowS:e.lowS,prehash:!1},B={lowS:e.lowS,prehash:!1};function F(L,H,q=R){const{seed:te,k2sig:Z}=D(L,H,q),pe=e;return B4(pe.hash.outputLen,pe.nByteLength,pe.hmac)(te,Z)}u.BASE._setWindowSize(8);function V(L,H,q,te=B){var ae;const Z=L;if(H=Es("msgHash",H),q=Es("publicKey",q),"strict"in te)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ce}=te;let Se,ve;try{if(typeof Z=="string"||Z instanceof Uint8Array)try{Se=y.fromDER(Z)}catch(be){if(!(be instanceof Dl.Err))throw be;Se=y.fromCompact(Z)}else if(typeof Z=="object"&&typeof Z.r=="bigint"&&typeof Z.s=="bigint"){const{r:be,s:Be}=Z;Se=new y(be,Be)}else throw new Error("PARSE");ve=u.fromHex(q)}catch(be){if(be.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(pe&&Se.hasHighS())return!1;Ce&&(H=e.hash(H));const{r:xe,s:Fe}=Se,He=E(H),ze=l(Fe),Le=a(He*ze),tt=a(xe*ze),le=(ae=u.BASE.multiplyAndAddUnsafe(ve,Le,tt))==null?void 0:ae.toAffine();return le?a(le.x)===xe:!1}return{CURVE:e,getPublicKey:A,getSharedSecret:x,sign:F,verify:V,ProjectivePoint:u,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xne(t){return{hash:t,hmac:(e,...n)=>h4(t,e,Wte(...n)),randomBytes:Kte}}function Zne(t,e){const n=r=>Yne({...t,...Xne(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const G4=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),W4=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ere=BigInt(1),Nx=BigInt(2),K4=(t,e)=>(t+e/Nx)/e;function tre(t){const e=G4,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,f=Xr(c,n,e)*c%e,d=Xr(f,n,e)*c%e,h=Xr(d,Nx,e)*u%e,p=Xr(h,s,e)*h%e,m=Xr(p,i,e)*p%e,g=Xr(m,a,e)*m%e,y=Xr(g,l,e)*g%e,v=Xr(y,a,e)*m%e,A=Xr(v,n,e)*c%e,w=Xr(A,o,e)*p%e,x=Xr(w,r,e)*u%e,k=Xr(x,Nx,e);if(!_x.eql(_x.sqr(k),t))throw new Error("Cannot find square root");return k}const _x=Vne(G4,void 0,void 0,{sqrt:tre}),ia=Zne({a:BigInt(0),b:BigInt(7),Fp:_x,n:W4,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=W4,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ere*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,o=BigInt("0x100000000000000000000000000000000"),a=K4(i*t,e),l=K4(-r*t,e);let u=fr(t-a*n-l*s,e),c=fr(-a*r-l*i,e);const f=u>o,d=c>o;if(f&&(u=e-u),d&&(c=e-c),u>o||c>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},m4);BigInt(0),ia.ProjectivePoint;const Rh="0x0000000000000000000000000000000000000000",q4="0x0000000000000000000000000000000000000000000000000000000000000000",Q4=BigInt(0),J4=BigInt(1),Y4=BigInt(2),X4=BigInt(27),Z4=BigInt(28),Yg=BigInt(35),Rc={};function eR(t){return xl(Wn(t),32)}const Ns=class Ns{constructor(e,n,r,s){J(this,uf);J(this,cf);J(this,ff);J(this,eu);jg(e,Rc,"Signature"),I(this,uf,n),I(this,cf,r),I(this,ff,s),I(this,eu,null)}get r(){return T(this,uf)}set r(e){G(Cc(e)===32,"invalid r","value",e),I(this,uf,we(e))}get s(){return T(this,cf)}set s(e){G(Cc(e)===32,"invalid s","value",e);const n=we(e);G(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),I(this,cf,n)}get v(){return T(this,ff)}set v(e){const n=Qe(e,"value");G(n===27||n===28,"invalid v","v",e),I(this,ff,n)}get networkV(){return T(this,eu)}get legacyChainId(){const e=this.networkV;return e==null?null:Ns.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=ct(this.s);return this.yParity&&(e[0]|=128),we(e)}get compactSerialized(){return $t([this.r,this.yParityAndS])}get serialized(){return $t([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Ns(Rc,this.r,this.s,this.v);return this.networkV&&I(e,eu,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=Ee(e,"v");return n==X4||n==Z4?Q4:(G(n>=Yg,"invalid EIP-155 v","v",e),(n-Yg)/Y4)}static getChainIdV(e,n){return Ee(e)*Y4+BigInt(35+n-27)}static getNormalizedV(e){const n=Ee(e);return n===Q4||n===X4?27:n===J4||n===Z4?28:(G(n>=Yg,"invalid v","v",e),n&J4?27:28)}static from(e){function n(u,c){G(u,c,"signature",e)}if(e==null)return new Ns(Rc,q4,q4,27);if(typeof e=="string"){const u=ct(e,"signature");if(u.length===64){const c=we(u.slice(0,32)),f=u.slice(32,64),d=f[0]&128?28:27;return f[0]&=127,new Ns(Rc,c,we(f),d)}if(u.length===65){const c=we(u.slice(0,32)),f=u.slice(32,64);n((f[0]&128)===0,"non-canonical s");const d=Ns.getNormalizedV(u[64]);return new Ns(Rc,c,we(f),d)}n(!1,"invalid raw signature length")}if(e instanceof Ns)return e.clone();const r=e.r;n(r!=null,"missing r");const s=eR(r),i=function(u,c){if(u!=null)return eR(u);if(c!=null){n(St(c,32),"invalid yParityAndS");const f=ct(c);return f[0]&=127,we(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((ct(i)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,c,f){if(u!=null){const d=Ee(u);return{networkV:d>=Yg?d:void 0,v:Ns.getNormalizedV(d)}}if(c!=null)return n(St(c,32),"invalid yParityAndS"),{v:ct(c)[0]&128?28:27};if(f!=null){switch(Qe(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new Ns(Rc,s,i,a);return o&&I(l,eu,o),n(e.yParity==null||Qe(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};uf=new WeakMap,cf=new WeakMap,ff=new WeakMap,eu=new WeakMap;let Ss=Ns;const tu=class tu{constructor(e){J(this,ao);G(Cc(e)===32,"invalid private key","privateKey","[REDACTED]"),I(this,ao,we(e))}get privateKey(){return T(this,ao)}get publicKey(){return tu.computePublicKey(T(this,ao))}get compressedPublicKey(){return tu.computePublicKey(T(this,ao),!0)}sign(e){G(Cc(e)===32,"invalid digest length","digest",e);const n=ia.sign(Gn(e),Gn(T(this,ao)),{lowS:!0});return Ss.from({r:Zo(n.r,32),s:Zo(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=tu.computePublicKey(e);return we(ia.getSharedSecret(Gn(T(this,ao)),ct(n),!1))}static computePublicKey(e,n){let r=ct(e,"key");if(r.length===32){const i=ia.getPublicKey(r,!!n);return we(i)}if(r.length===64){const i=new Uint8Array(65);i[0]=4,i.set(r,1),r=i}const s=ia.ProjectivePoint.fromHex(r);return we(s.toRawBytes(n))}static recoverPublicKey(e,n){G(Cc(e)===32,"invalid digest length","digest",e);const r=Ss.from(n);let s=ia.Signature.fromCompact(Gn($t([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const i=s.recoverPublicKey(Gn(e));return G(i!=null,"invalid signautre for digest","signature",n),"0x"+i.toHex(!1)}static addPoints(e,n,r){const s=ia.ProjectivePoint.fromHex(tu.computePublicKey(e).substring(2)),i=ia.ProjectivePoint.fromHex(tu.computePublicKey(n).substring(2));return"0x"+s.add(i).toHex(!!r)}};ao=new WeakMap;let Ph=tu;const nre=BigInt(0),rre=BigInt(36);function tR(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=e[s].charCodeAt(0);const r=ct(en(n));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(r[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const Rx={};for(let t=0;t<10;t++)Rx[String(t)]=String(t);for(let t=0;t<26;t++)Rx[String.fromCharCode(65+t)]=String(10+t);const nR=15;function sre(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>Rx[r]).join("");for(;e.length>=nR;){let r=e.substring(0,nR);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const ire=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function ore(t){t=t.toLowerCase();let e=nre;for(let n=0;n<t.length;n++)e=e*rre+ire[t[n]];return e}function gt(t){if(G(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=tR(t);return G(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){G(t.substring(2,4)===sre(t),"bad icap checksum","address",t);let e=ore(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return tR("0x"+e)}G(!1,"invalid address","address",t)}function are(t){const e=gt(t.from);let r=Ee(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,gt(Vt(en(Cl([e,r])),12))}function rR(t){return t&&typeof t.getAddress=="function"}function lre(t){try{return gt(t),!0}catch{}return!1}async function Px(t,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(ee(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),G(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),gt(n)}function Qn(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?gt(t):(ee(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Px(t,e.resolveName(t)));if(rR(t))return Px(t,t.getAddress());if(t&&typeof t.then=="function")return Px(t,t);G(!1,"unsupported addressable value","target",t)}const Gi={};function Ae(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new Rn(Gi,`${n?"":"u"}int${e}`,t,{signed:n,width:e})}function dt(t,e){return new Rn(Gi,`bytes${e||""}`,t,{size:e})}const sR=Symbol.for("_ethers_typed"),lo=class lo{constructor(e,n,r,s){W(this,"type");W(this,"value");J(this,nu);W(this,"_typedSymbol");s==null&&(s=null),jg(Gi,e,"Typed"),Me(this,{_typedSymbol:sR,type:n,value:r}),I(this,nu,s),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return T(this,nu)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return T(this,nu)===!0?-1:T(this,nu)===!1?this.value.length:null}static from(e,n){return new lo(Gi,e,n)}static uint8(e){return Ae(e,8)}static uint16(e){return Ae(e,16)}static uint24(e){return Ae(e,24)}static uint32(e){return Ae(e,32)}static uint40(e){return Ae(e,40)}static uint48(e){return Ae(e,48)}static uint56(e){return Ae(e,56)}static uint64(e){return Ae(e,64)}static uint72(e){return Ae(e,72)}static uint80(e){return Ae(e,80)}static uint88(e){return Ae(e,88)}static uint96(e){return Ae(e,96)}static uint104(e){return Ae(e,104)}static uint112(e){return Ae(e,112)}static uint120(e){return Ae(e,120)}static uint128(e){return Ae(e,128)}static uint136(e){return Ae(e,136)}static uint144(e){return Ae(e,144)}static uint152(e){return Ae(e,152)}static uint160(e){return Ae(e,160)}static uint168(e){return Ae(e,168)}static uint176(e){return Ae(e,176)}static uint184(e){return Ae(e,184)}static uint192(e){return Ae(e,192)}static uint200(e){return Ae(e,200)}static uint208(e){return Ae(e,208)}static uint216(e){return Ae(e,216)}static uint224(e){return Ae(e,224)}static uint232(e){return Ae(e,232)}static uint240(e){return Ae(e,240)}static uint248(e){return Ae(e,248)}static uint256(e){return Ae(e,256)}static uint(e){return Ae(e,256)}static int8(e){return Ae(e,-8)}static int16(e){return Ae(e,-16)}static int24(e){return Ae(e,-24)}static int32(e){return Ae(e,-32)}static int40(e){return Ae(e,-40)}static int48(e){return Ae(e,-48)}static int56(e){return Ae(e,-56)}static int64(e){return Ae(e,-64)}static int72(e){return Ae(e,-72)}static int80(e){return Ae(e,-80)}static int88(e){return Ae(e,-88)}static int96(e){return Ae(e,-96)}static int104(e){return Ae(e,-104)}static int112(e){return Ae(e,-112)}static int120(e){return Ae(e,-120)}static int128(e){return Ae(e,-128)}static int136(e){return Ae(e,-136)}static int144(e){return Ae(e,-144)}static int152(e){return Ae(e,-152)}static int160(e){return Ae(e,-160)}static int168(e){return Ae(e,-168)}static int176(e){return Ae(e,-176)}static int184(e){return Ae(e,-184)}static int192(e){return Ae(e,-192)}static int200(e){return Ae(e,-200)}static int208(e){return Ae(e,-208)}static int216(e){return Ae(e,-216)}static int224(e){return Ae(e,-224)}static int232(e){return Ae(e,-232)}static int240(e){return Ae(e,-240)}static int248(e){return Ae(e,-248)}static int256(e){return Ae(e,-256)}static int(e){return Ae(e,-256)}static bytes1(e){return dt(e,1)}static bytes2(e){return dt(e,2)}static bytes3(e){return dt(e,3)}static bytes4(e){return dt(e,4)}static bytes5(e){return dt(e,5)}static bytes6(e){return dt(e,6)}static bytes7(e){return dt(e,7)}static bytes8(e){return dt(e,8)}static bytes9(e){return dt(e,9)}static bytes10(e){return dt(e,10)}static bytes11(e){return dt(e,11)}static bytes12(e){return dt(e,12)}static bytes13(e){return dt(e,13)}static bytes14(e){return dt(e,14)}static bytes15(e){return dt(e,15)}static bytes16(e){return dt(e,16)}static bytes17(e){return dt(e,17)}static bytes18(e){return dt(e,18)}static bytes19(e){return dt(e,19)}static bytes20(e){return dt(e,20)}static bytes21(e){return dt(e,21)}static bytes22(e){return dt(e,22)}static bytes23(e){return dt(e,23)}static bytes24(e){return dt(e,24)}static bytes25(e){return dt(e,25)}static bytes26(e){return dt(e,26)}static bytes27(e){return dt(e,27)}static bytes28(e){return dt(e,28)}static bytes29(e){return dt(e,29)}static bytes30(e){return dt(e,30)}static bytes31(e){return dt(e,31)}static bytes32(e){return dt(e,32)}static address(e){return new lo(Gi,"address",e)}static bool(e){return new lo(Gi,"bool",!!e)}static bytes(e){return new lo(Gi,"bytes",e)}static string(e){return new lo(Gi,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new lo(Gi,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===sR}static dereference(e,n){if(lo.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};nu=new WeakMap;let Rn=lo;class ure extends zi{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Rn.dereference(n,"string");try{r=gt(r)}catch(s){return this._throwError(s.message,n)}return e.writeValue(r)}decode(e){return gt(Zo(e.readValue(),20))}}class cre extends zi{constructor(n){super(n.name,n.type,"_",n.dynamic);W(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function iR(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(u=>{const c=u.localName;return ee(c,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),ee(!l[c],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),l[c]=!0,n[c]})}else G(!1,"invalid tuple value","tuple",n);G(e.length===r.length,"types/value length mismatch","tuple",n);let s=new px,i=new px,o=[];e.forEach((l,u)=>{let c=r[u];if(l.dynamic){let f=i.length;l.encode(i,c);let d=s.writeUpdatableValue();o.push(h=>{d(h+f)})}else l.encode(s,c)}),o.forEach(l=>{l(s.length)});let a=t.appendWriter(s);return a+=t.appendWriter(i),a}function oR(t,e){let n=[],r=[],s=t.subReader(0);return e.forEach(i=>{let o=null;if(i.dynamic){let a=t.readIndex(),l=s.subReader(a);try{o=i.decode(l)}catch(u){if(gn(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=i.name,o.name=i.localName,o.type=i.type}}else try{o=i.decode(t)}catch(a){if(gn(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=i.name,o.name=i.localName,o.type=i.type}if(o==null)throw new Error("investigate");n.push(o),r.push(i.localName||null)}),Tc.fromItems(n,r)}class fre extends zi{constructor(n,r,s){const i=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",i,s,o);W(this,"coder");W(this,"length");Me(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let s=0;s<this.length;s++)r.push(n);return r}encode(n,r){const s=Rn.dereference(r,"array");Array.isArray(s)||this._throwError("expected array value",s);let i=this.length;i===-1&&(i=s.length,n.writeValue(s.length)),j6(s.length,i,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<s.length;a++)o.push(this.coder);return iR(n,o,s)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),ee(r*qn<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*qn,length:n.dataLength}));let s=[];for(let i=0;i<r;i++)s.push(new cre(this.coder));return oR(n,s)}}class dre extends zi{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,n){const r=Rn.dereference(n,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}class aR extends zi{constructor(e,n){super(e,e,n,!0)}defaultValue(){return"0x"}encode(e,n){n=Gn(n);let r=e.writeValue(n.length);return r+=e.writeBytes(n),r}decode(e){return e.readBytes(e.readIndex(),!0)}}class hre extends aR{constructor(e){super("bytes",e)}decode(e){return we(super.decode(e))}}class pre extends zi{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);W(this,"size");Me(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let s=Gn(Rn.dereference(r,this.type));return s.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(s)}decode(n){return we(n.readBytes(this.size))}}const mre=new Uint8Array([]);class gre extends zi{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes(mre)}decode(e){return e.readBytes(0),null}}const yre=BigInt(0),bre=BigInt(1),wre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Are extends zi{constructor(n,r,s){const i=(r?"int":"uint")+n*8;super(i,i,s,!1);W(this,"size");W(this,"signed");Me(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=Ee(Rn.dereference(r,this.type)),i=Dh(wre,qn*8);if(this.signed){let o=Dh(i,this.size*8-1);(s>o||s<-(o+bre))&&this._throwError("value out-of-bounds",r),s=z6(s,8*qn)}else(s<yre||s>Dh(i,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(s)}decode(n){let r=Dh(n.readValue(),this.size*8);return this.signed&&(r=Cte(r,this.size*8)),r}}class vre extends aR{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,Vi(Rn.dereference(n,"string")))}decode(e){return Sc(super.decode(e))}}class Xg extends zi{constructor(n,r){let s=!1;const i=[];n.forEach(a=>{a.dynamic&&(s=!0),i.push(a.type)});const o="tuple("+i.join(",")+")";super("tuple",o,r,s);W(this,"coders");Me(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(s=>{n.push(s.defaultValue())});const r=this.coders.reduce((s,i)=>{const o=i.localName;return o&&(s[o]||(s[o]=0),s[o]++),s},{});return this.coders.forEach((s,i)=>{let o=s.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[i]))}),Object.freeze(n)}encode(n,r){const s=Rn.dereference(r,"tuple");return iR(n,this.coders,s)}decode(n){return oR(n,this.coders)}}function Ol(t){return en(Vi(t))}var xre="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";const lR=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),uR=4;function kre(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),s=1,i=[0,1];for(let x=1;x<r;x++)i.push(s+=n());let o=n(),a=e;e+=o;let l=0,u=0;function c(){return l==0&&(u=u<<8|t[e++],l=8),u>>--l&1}const f=31,d=2**f,h=d>>>1,p=h>>1,m=d-1;let g=0;for(let x=0;x<f;x++)g=g<<1|c();let y=[],v=0,A=d;for(;;){let x=Math.floor(((g-v+1)*s-1)/A),k=0,E=r;for(;E-k>1;){let D=k+E>>>1;x<i[D]?E=D:k=D}if(k==0)break;y.push(k);let O=v+Math.floor(A*i[k]/s),M=v+Math.floor(A*i[k+1]/s)-1;for(;!((O^M)&h);)g=g<<1&m|c(),O=O<<1&m,M=M<<1&m|1;for(;O&~M&p;)g=g&h|g<<1&m>>>1|c(),O=O<<1^h,M=(M^h)<<1|h|1;v=O,A=1+M-O}let w=r-4;return y.map(x=>{switch(x-w){case 3:return w+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return w+256+(t[a++]<<8|t[a++]);case 1:return w+t[a++];default:return x-1}})}function Cre(t){let e=0;return()=>t[e++]}function cR(t){return Cre(kre(Ere(t)))}function Ere(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let n=t.length,r=new Uint8Array(6*n>>3);for(let s=0,i=0,o=0,a=0;s<n;s++)a=a<<6|e[t.charCodeAt(s)],o+=6,o>=8&&(r[i++]=a>>(o-=8));return r}function Sre(t){return t&1?~t>>1:t>>1}function Tre(t,e){let n=Array(t);for(let r=0,s=0;r<t;r++)n[r]=s+=Sre(e());return n}function Ih(t,e=0){let n=[];for(;;){let r=t(),s=t();if(!s)break;e+=r;for(let i=0;i<s;i++)n.push(e+i);e+=s+1}return n}function fR(t){return Lh(()=>{let e=Ih(t);if(e.length)return e})}function dR(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(Dre(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(Ore(n,t))}return e.flat()}function Lh(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function hR(t,e,n){let r=Array(t).fill().map(()=>[]);for(let s=0;s<e;s++)Tre(t,n).forEach((i,o)=>r[o].push(i));return r}function Dre(t,e){let n=1+e(),r=e(),s=Lh(e);return hR(s.length,1+t,e).flatMap((o,a)=>{let[l,...u]=o;return Array(s[a]).fill().map((c,f)=>{let d=f*r;return[l+f*n,u.map(h=>h+d)]})})}function Ore(t,e){let n=1+e();return hR(n,1+t,e).map(s=>[s[0],s.slice(1)])}function Mre(t){let e=[],n=Ih(t);return s(r([]),[]),e;function r(i){let o=t(),a=Lh(()=>{let l=Ih(t).map(u=>n[u]);if(l.length)return r(l)});return{S:o,B:a,Q:i}}function s({S:i,B:o},a,l){if(!(i&4&&l===a[a.length-1])){i&2&&(l=a[a.length-1]),i&1&&e.push(a);for(let u of o)for(let c of u.Q)s(u,[...a,c],l)}}}function Nre(t){return t.toString(16).toUpperCase().padStart(2,"0")}function pR(t){return`{${Nre(t)}}`}function _re(t){let e=[];for(let n=0,r=t.length;n<r;){let s=t.codePointAt(n);n+=s<65536?1:2,e.push(s)}return e}function Pc(t){let n=t.length;if(n<4096)return String.fromCodePoint(...t);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...t.slice(s,s+=4096)));return r.join("")}function Rre(t,e){let n=t.length,r=n-e.length;for(let s=0;r==0&&s<n;s++)r=t[s]-e[s];return r}var Pre="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";const Bh=44032,Zg=4352,ey=4449,ty=4519,mR=19,gR=21,Ic=28,ny=gR*Ic,Ire=mR*ny,Lre=Bh+Ire,Bre=Zg+mR,Fre=ey+gR,jre=ty+Ic;function Fh(t){return t>>24&255}function yR(t){return t&16777215}let Ix,bR,Lx,ry;function Ure(){let t=cR(Pre);Ix=new Map(fR(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),bR=new Set(Ih(t)),Lx=new Map,ry=new Map;for(let[e,n]of dR(t)){if(!bR.has(e)&&n.length==2){let[r,s]=n,i=ry.get(r);i||(i=new Map,ry.set(r,i)),i.set(s,e)}Lx.set(e,n.reverse())}}function wR(t){return t>=Bh&&t<Lre}function Hre(t,e){if(t>=Zg&&t<Bre&&e>=ey&&e<Fre)return Bh+(t-Zg)*ny+(e-ey)*Ic;if(wR(t)&&e>ty&&e<jre&&(t-Bh)%Ic==0)return t+(e-ty);{let n=ry.get(t);return n&&(n=n.get(e),n)?n:-1}}function AR(t){Ix||Ure();let e=[],n=[],r=!1;function s(i){let o=Ix.get(i);o&&(r=!0,i|=o),e.push(i)}for(let i of t)for(;;){if(i<128)e.push(i);else if(wR(i)){let o=i-Bh,a=o/ny|0,l=o%ny/Ic|0,u=o%Ic;s(Zg+a),s(ey+l),u>0&&s(ty+u)}else{let o=Lx.get(i);o?n.push(...o):s(i)}if(!n.length)break;i=n.pop()}if(r&&e.length>1){let i=Fh(e[0]);for(let o=1;o<e.length;o++){let a=Fh(e[o]);if(a==0||i<=a){i=a;continue}let l=o-1;for(;;){let u=e[l+1];if(e[l+1]=e[l],e[l]=u,!l||(i=Fh(e[--l]),i<=a))break}i=Fh(e[o])}}return e}function Vre(t){let e=[],n=[],r=-1,s=0;for(let i of t){let o=Fh(i),a=yR(i);if(r==-1)o==0?r=a:e.push(a);else if(s>0&&s>=o)o==0?(e.push(r,...n),n.length=0,r=a):n.push(a),s=o;else{let l=Hre(r,a);l>=0?r=l:s==0&&o==0?(e.push(r),r=a):(n.push(a),s=o)}}return r>=0&&e.push(r,...n),e}function vR(t){return AR(t).map(yR)}function zre(t){return Vre(AR(t))}const xR=45,kR=".",CR=65039,ER=1,sy=t=>Array.from(t);function jh(t,e){return t.P.has(e)||t.Q.has(e)}class $re extends Array{get is_emoji(){return!0}}let Bx,SR,Ml,Fx,TR,Lc,jx,Bc,Nl,DR,Ux;function Hx(){if(Bx)return;let t=cR(xre);const e=()=>Ih(t),n=()=>new Set(e()),r=(c,f)=>f.forEach(d=>c.add(d));Bx=new Map(dR(t)),SR=n(),Ml=e(),Fx=new Set(e().map(c=>Ml[c])),Ml=new Set(Ml),TR=n(),n();let s=fR(t),i=t();const o=()=>{let c=new Set;return e().forEach(f=>r(c,s[f])),r(c,e()),c};Lc=Lh(c=>{let f=Lh(t).map(d=>d+96);if(f.length){let d=c>=i;f[0]-=32,f=Pc(f),d&&(f=`Restricted[${f}]`);let h=o(),p=o(),m=!t();return{N:f,P:h,Q:p,M:m,R:d}}}),jx=n(),Bc=new Map;let a=e().concat(sy(jx)).sort((c,f)=>c-f);a.forEach((c,f)=>{let d=t(),h=a[f]=d?a[f-d]:{V:[],M:new Map};h.V.push(c),jx.has(c)||Bc.set(c,h)});for(let{V:c,M:f}of new Set(Bc.values())){let d=[];for(let p of c){let m=Lc.filter(y=>jh(y,p)),g=d.find(({G:y})=>m.some(v=>y.has(v)));g||(g={G:new Set,V:[]},d.push(g)),g.V.push(p),r(g.G,m)}let h=d.flatMap(p=>sy(p.G));for(let{G:p,V:m}of d){let g=new Set(h.filter(y=>!p.has(y)));for(let y of m)f.set(y,g)}}Nl=new Set;let l=new Set;const u=c=>Nl.has(c)?l.add(c):Nl.add(c);for(let c of Lc){for(let f of c.P)u(f);for(let f of c.Q)u(f)}for(let c of Nl)!Bc.has(c)&&!l.has(c)&&Bc.set(c,ER);r(Nl,vR(Nl)),DR=Mre(t).map(c=>$re.from(c)).sort(Rre),Ux=new Map;for(let c of DR){let f=[Ux];for(let d of c){let h=f.map(p=>{let m=p.get(d);return m||(m=new Map,p.set(d,m)),m});d===CR?f.push(...h):f=h}for(let d of f)d.V=c}}function Vx(t){return(OR(t)?"":`${zx(iy([t]))} `)+pR(t)}function zx(t){return`"${t}"`}function Gre(t){if(t.length>=4&&t[2]==xR&&t[3]==xR)throw new Error(`invalid label extension: "${Pc(t.slice(0,4))}"`)}function Wre(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Kre(t){let e=t[0],n=lR.get(e);if(n)throw Uh(`leading ${n}`);let r=t.length,s=-1;for(let i=1;i<r;i++){e=t[i];let o=lR.get(e);if(o){if(s==i)throw Uh(`${n} + ${o}`);s=i+1,n=o}}if(s==r)throw Uh(`trailing ${n}`)}function iy(t,e=1/0,n=pR){let r=[];qre(t[0])&&r.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let s=0,i=t.length;for(let o=0;o<i;o++){let a=t[o];OR(a)&&(r.push(Pc(t.slice(s,o))),r.push(n(a)),s=o+1)}return r.push(Pc(t.slice(s,i))),r.join("")}function qre(t){return Hx(),Ml.has(t)}function OR(t){return Hx(),TR.has(t)}function Qre(t){return Zre(Jre(t,zre,nse))}function Jre(t,e,n){if(!t)return[];Hx();let r=0;return t.split(kR).map(s=>{let i=_re(s),o={input:i,offset:r};r+=i.length+1;try{let a=o.tokens=tse(i,e,n),l=a.length,u;if(!l)throw new Error("empty label");let c=o.output=a.flat();if(Wre(c),!(o.emoji=l>1||a[0].is_emoji)&&c.every(d=>d<128))Gre(c),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(Ml.has(c[0]))throw Uh("leading combining mark");for(let m=1;m<l;m++){let g=a[m];if(!g.is_emoji&&Ml.has(g[0]))throw Uh(`emoji + combining mark: "${Pc(a[m-1])} + ${iy([g[0]])}"`)}Kre(c);let h=sy(new Set(d)),[p]=Xre(h);ese(p,d),Yre(p,h),u=p.N}}o.type=u}catch(a){o.error=a}return o})}function Yre(t,e){let n,r=[];for(let s of e){let i=Bc.get(s);if(i===ER)return;if(i){let o=i.M.get(s);if(n=n?n.filter(a=>o.has(a)):sy(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(i=>jh(s,i)))throw new Error(`whole-script confusable: ${t.N}/${s.N}`)}}function Xre(t){let e=Lc;for(let n of t){let r=e.filter(s=>jh(s,n));if(!r.length)throw Lc.some(s=>jh(s,n))?NR(e[0],n):MR(n);if(e=r,r.length==1)break}return e}function Zre(t){return t.map(({input:e,error:n,output:r})=>{if(n){let s=n.message;throw new Error(t.length==1?s:`Invalid label ${zx(iy(e,63))}: ${s}`)}return Pc(r)}).join(kR)}function MR(t){return new Error(`disallowed character: ${Vx(t)}`)}function NR(t,e){let n=Vx(e),r=Lc.find(s=>s.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Uh(t){return new Error(`illegal placement: ${t}`)}function ese(t,e){for(let n of e)if(!jh(t,n))throw NR(t,n);if(t.M){let n=vR(e);for(let r=1,s=n.length;r<s;r++)if(Fx.has(n[r])){let i=r+1;for(let o;i<s&&Fx.has(o=n[i]);i++)for(let a=r;a<i;a++)if(n[a]==o)throw new Error(`duplicate non-spacing marks: ${Vx(o)}`);if(i-r>uR)throw new Error(`excessive non-spacing marks: ${zx(iy(n.slice(r-1,i)))} (${i-r}/${uR})`);r=i}}}function tse(t,e,n){let r=[],s=[];for(t=t.slice().reverse();t.length;){let i=rse(t);if(i)s.length&&(r.push(e(s)),s=[]),r.push(n(i));else{let o=t.pop();if(Nl.has(o))s.push(o);else{let a=Bx.get(o);if(a)s.push(...a);else if(!SR.has(o))throw MR(o)}}}return s.length&&r.push(e(s)),r}function nse(t){return t.filter(e=>e!=CR)}function rse(t,e){let n=Ux,r,s=t.length;for(;s&&(n=n.get(t[--s]),!!n);){let{V:i}=n;i&&(r=i,t.length=s)}return r}const _R=new Uint8Array(32);_R.fill(0);function RR(t){return G(t.length!==0,"invalid ENS name; empty component","comp",t),t}function PR(t){const e=Vi(sse(t)),n=[];if(t.length===0)return n;let r=0;for(let s=0;s<e.length;s++)e[s]===46&&(n.push(RR(e.slice(r,s))),r=s+1);return G(r<e.length,"invalid ENS name; empty component","name",t),n.push(RR(e.slice(r))),n}function sse(t){try{if(t.length===0)throw new Error("empty label");return Qre(t)}catch(e){G(!1,`invalid ENS name (${e.message})`,"name",t)}}function $x(t){G(typeof t=="string","invalid ENS name; not a string","name",t),G(t.length,"invalid ENS name (empty label)","name",t);let e=_R;const n=PR(t);for(;n.length;)e=en($t([e,en(n.pop())]));return we(e)}function ise(t,e){const n=e;return G(n<=255,"DNS encoded label cannot exceed 255","length",n),we($t(PR(t).map(r=>{G(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const s=new Uint8Array(r.length+1);return s.set(r,1),s[0]=s.length-1,s})))+"00"}function Gx(t,e){return{address:gt(t),storageKeys:e.map((n,r)=>(G(St(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function oa(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(G(n.length===2,"invalid slot set",`value[${r}]`,n),Gx(n[0],n[1])):(G(n!=null&&typeof n=="object","invalid address-slot set","value",t),Gx(n.address,n.storageKeys)));G(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((s,i)=>(s[i]=!0,s),{});return Gx(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function ose(t){let e;return typeof t=="string"?e=Ph.computePublicKey(t,!1):e=t.publicKey,gt(en("0x"+e.substring(4)).substring(26))}function ase(t,e){return ose(Ph.recoverPublicKey(t,e))}const bn=BigInt(0),lse=BigInt(2),use=BigInt(27),cse=BigInt(28),fse=BigInt(35),dse=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Wx=4096*32;function IR(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=Oc(e).substring(4),"0x"+n}function oy(t){return t==="0x"?null:gt(t)}function Kx(t,e){try{return oa(t)}catch(n){G(!1,n.message,e,t)}}function Hh(t,e){return t==="0x"?0:Qe(t,e)}function Wt(t,e){if(t==="0x")return bn;const n=Ee(t,e);return G(n<=dse,"value exceeds uint size",e,n),n}function Ot(t,e){const n=Ee(t,"value"),r=Wn(n);return G(r.length<=32,"value too large",`tx.${e}`,n),r}function qx(t){return oa(t).map(e=>[e.address,e.storageKeys])}function hse(t,e){G(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n<t.length;n++)G(St(t[n],32),"invalid ${ param } hash",`value[${n}]`,t[n]);return t}function pse(t){const e=$g(t);G(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:Hh(e[0],"nonce"),gasPrice:Wt(e[1],"gasPrice"),gasLimit:Wt(e[2],"gasLimit"),to:oy(e[3]),value:Wt(e[4],"value"),data:we(e[5]),chainId:bn};if(e.length===6)return n;const r=Wt(e[6],"v"),s=Wt(e[7],"r"),i=Wt(e[8],"s");if(s===bn&&i===bn)n.chainId=r;else{let o=(r-fse)/lse;o<bn&&(o=bn),n.chainId=o,G(o!==bn||r===use||r===cse,"non-canonical legacy v","v",e[6]),n.signature=Ss.from({r:xl(e[7],32),s:xl(e[8],32),v:r})}return n}function mse(t,e){const n=[Ot(t.nonce,"nonce"),Ot(t.gasPrice||0,"gasPrice"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data];let r=bn;if(t.chainId!=bn)r=Ee(t.chainId,"tx.chainId"),G(!e||e.networkV==null||e.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const i=t.signature.legacyChainId;i!=null&&(r=i)}if(!e)return r!==bn&&(n.push(Wn(r)),n.push("0x"),n.push("0x")),Cl(n);let s=BigInt(27+e.yParity);return r!==bn?s=Ss.getChainIdV(r,e.v):BigInt(e.v)!==s&&G(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(Wn(s)),n.push(Wn(e.r)),n.push(Wn(e.s)),Cl(n)}function Qx(t,e){let n;try{if(n=Hh(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{G(!1,"invalid yParity","yParity",e[0])}const r=xl(e[1],32),s=xl(e[2],32),i=Ss.from({r,s,yParity:n});t.signature=i}function gse(t){const e=$g(ct(t).slice(1));G(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",we(t));const n={type:2,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:oy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:Kx(e[8],"accessList")};return e.length===9||Qx(n,e.slice(9)),n}function yse(t,e){const n=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ot(t.maxFeePerGas||0,"maxFeePerGas"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data,qx(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"yParity")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x02",Cl(n)])}function bse(t){const e=$g(ct(t).slice(1));G(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",we(t));const n={type:1,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),gasPrice:Wt(e[2],"gasPrice"),gasLimit:Wt(e[3],"gasLimit"),to:oy(e[4]),value:Wt(e[5],"value"),data:we(e[6]),accessList:Kx(e[7],"accessList")};return e.length===8||Qx(n,e.slice(8)),n}function wse(t,e){const n=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.gasPrice||0,"gasPrice"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data,qx(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"recoveryParam")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x01",Cl(n)])}function Ase(t){let e=$g(ct(t).slice(1)),n="3",r=null;if(e.length===4&&Array.isArray(e[0])){n="3 (network format)";const i=e[1],o=e[2],a=e[3];G(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),G(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),G(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),G(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),G(i.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),r=[];for(let l=0;l<e[1].length;l++)r.push({data:i[l],commitment:o[l],proof:a[l]});e=e[0]}G(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${n}`,"data",we(t));const s={type:3,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:oy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:Kx(e[8],"accessList"),maxFeePerBlobGas:Wt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};r&&(s.blobs=r),G(s.to!=null,`invalid address for transaction type: ${n}`,"data",t),G(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let i=0;i<s.blobVersionedHashes.length;i++)G(St(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",t);return e.length===11||Qx(s,e.slice(11)),s}function vse(t,e,n){const r=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ot(t.maxFeePerGas||0,"maxFeePerGas"),Ot(t.gasLimit,"gasLimit"),t.to||Rh,Ot(t.value,"value"),t.data,qx(t.accessList||[]),Ot(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),hse(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(r.push(Ot(e.yParity,"yParity")),r.push(Wn(e.r)),r.push(Wn(e.s)),n)?$t(["0x03",Cl([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):$t(["0x03",Cl(r)])}const co=class co{constructor(){J(this,kf);J(this,mi);J(this,df);J(this,hf);J(this,pf);J(this,mf);J(this,gf);J(this,yf);J(this,bf);J(this,wf);J(this,Af);J(this,vf);J(this,xf);J(this,ru);J(this,ya);J(this,uo);J(this,ba);I(this,mi,null),I(this,df,null),I(this,pf,0),I(this,mf,bn),I(this,gf,null),I(this,yf,null),I(this,bf,null),I(this,hf,"0x"),I(this,wf,bn),I(this,Af,bn),I(this,vf,null),I(this,xf,null),I(this,ru,null),I(this,ya,null),I(this,ba,null),I(this,uo,null)}get type(){return T(this,mi)}set type(e){switch(e){case null:I(this,mi,null);break;case 0:case"legacy":I(this,mi,0);break;case 1:case"berlin":case"eip-2930":I(this,mi,1);break;case 2:case"london":case"eip-1559":I(this,mi,2);break;case 3:case"cancun":case"eip-4844":I(this,mi,3);break;default:G(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=T(this,df);return e==null&&this.type===3?Rh:e}set to(e){I(this,df,e==null?null:gt(e))}get nonce(){return T(this,pf)}set nonce(e){I(this,pf,Qe(e,"value"))}get gasLimit(){return T(this,mf)}set gasLimit(e){I(this,mf,Ee(e))}get gasPrice(){const e=T(this,gf);return e==null&&(this.type===0||this.type===1)?bn:e}set gasPrice(e){I(this,gf,e==null?null:Ee(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=T(this,yf);return e??(this.type===2||this.type===3?bn:null)}set maxPriorityFeePerGas(e){I(this,yf,e==null?null:Ee(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=T(this,bf);return e??(this.type===2||this.type===3?bn:null)}set maxFeePerGas(e){I(this,bf,e==null?null:Ee(e,"maxFeePerGas"))}get data(){return T(this,hf)}set data(e){I(this,hf,we(e))}get value(){return T(this,wf)}set value(e){I(this,wf,Ee(e,"value"))}get chainId(){return T(this,Af)}set chainId(e){I(this,Af,Ee(e))}get signature(){return T(this,vf)||null}set signature(e){I(this,vf,e==null?null:Ss.from(e))}get accessList(){const e=T(this,xf)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){I(this,xf,e==null?null:oa(e))}get maxFeePerBlobGas(){const e=T(this,ru);return e==null&&this.type===3?bn:e}set maxFeePerBlobGas(e){I(this,ru,e==null?null:Ee(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=T(this,ya);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){G(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)G(St(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}I(this,ya,e)}get blobs(){return T(this,ba)==null?null:T(this,ba).map(e=>Object.assign({},e))}set blobs(e){if(e==null){I(this,ba,null);return}const n=[],r=[];for(let s=0;s<e.length;s++){const i=e[s];if(ux(i)){ee(T(this,uo),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ct(i);if(G(o.length<=Wx,"blob is too large",`blobs[${s}]`,i),o.length!==Wx){const u=new Uint8Array(Wx);u.set(o),o=u}const a=T(this,uo).blobToKzgCommitment(o),l=we(T(this,uo).computeBlobKzgProof(o,a));n.push({data:we(o),commitment:we(a),proof:l}),r.push(IR(1,a))}else{const o=we(i.commitment);n.push({data:we(i.data),commitment:o,proof:we(i.proof)}),r.push(IR(1,o))}}I(this,ba,n),I(this,ya,r)}get kzg(){return T(this,uo)}set kzg(e){I(this,uo,e)}get hash(){return this.signature==null?null:en(fe(this,kf,ab).call(this,!0,!1))}get unsignedHash(){return en(this.unsignedSerialized)}get from(){return this.signature==null?null:ase(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Ph.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return fe(this,kf,ab).call(this,!0,!0)}get unsignedSerialized(){return fe(this,kf,ab).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,s=T(this,ru)!=null||T(this,ya);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ee(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ee(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ee(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return co.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new co;if(typeof e=="string"){const r=ct(e);if(r[0]>=127)return co.from(pse(r));switch(r[0]){case 1:return co.from(bse(r));case 2:return co.from(gse(r));case 3:return co.from(Ase(r))}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new co;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Ss.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(n.kzg=e.kzg),e.blobs!=null&&(n.blobs=e.blobs),e.hash!=null&&(G(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),G(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(G(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),G(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};mi=new WeakMap,df=new WeakMap,hf=new WeakMap,pf=new WeakMap,mf=new WeakMap,gf=new WeakMap,yf=new WeakMap,bf=new WeakMap,wf=new WeakMap,Af=new WeakMap,vf=new WeakMap,xf=new WeakMap,ru=new WeakMap,ya=new WeakMap,uo=new WeakMap,ba=new WeakMap,kf=new WeakSet,ab=function(e,n){ee(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return mse(this,r);case 1:return wse(this,r);case 2:return yse(this,r);case 3:return vse(this,r,n?this.blobs:null)}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let Vh=co;const LR=new Uint8Array(32);LR.fill(0);const xse=BigInt(-1),BR=BigInt(0),FR=BigInt(1),kse=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Cse(t){const e=ct(t),n=e.length%32;return n?$t([e,LR.slice(n)]):we(e)}const Ese=Zo(FR,32),Sse=Zo(BR,32),jR={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Jx=["name","version","chainId","verifyingContract","salt"];function UR(t){return function(e){return G(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Tse={name:UR("name"),version:UR("version"),chainId:function(t){const e=Ee(t,"domain.chainId");return G(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):kl(e)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}G(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=ct(t,"domain.salt");return G(e.length===32,'invalid domain value "salt"',"domain.salt",t),we(e)}};function Yx(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);G(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const s=Dh(kse,n?r-1:r),i=n?(s+FR)*xse:BR;return function(o){const a=Ee(o,"value");return G(a>=i&&a<=s,`value out-of-bounds for ${t}`,"value",a),Zo(n?z6(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return G(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const s=ct(r);return G(s.length===n,`invalid length for ${t}`,"value",r),Cse(r)}}}switch(t){case"address":return function(e){return xl(gt(e),32)};case"bool":return function(e){return e?Ese:Sse};case"bytes":return function(e){return en(e)};case"string":return function(e){return Ol(e)}}return null}function HR(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function ay(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}const ns=class ns{constructor(e){J(this,eb);W(this,"primaryType");J(this,mp);J(this,fo);J(this,Cf);I(this,fo,new Map),I(this,Cf,new Map);const n=new Map,r=new Map,s=new Map,i={};Object.keys(e).forEach(l=>{i[l]=e[l].map(({name:u,type:c})=>{let{base:f,index:d}=ay(c);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:u,type:f+(d||"")}}),n.set(l,new Set),r.set(l,[]),s.set(l,new Set)}),I(this,mp,JSON.stringify(i));for(const l in i){const u=new Set;for(const c of i[l]){G(!u.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(l)}`,"types",e),u.add(c.name);const f=ay(c.type).base;G(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!Yx(f)&&(G(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);G(o.length!==0,"missing primary type","types",e),G(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Me(this,{primaryType:o[0]});function a(l,u){G(!u.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),u.add(l);for(const c of n.get(l))if(r.has(c)){a(c,u);for(const f of u)s.get(f).add(c)}u.delete(l)}a(this.primaryType,new Set);for(const[l,u]of s){const c=Array.from(u);c.sort(),T(this,fo).set(l,HR(l,i[l])+c.map(f=>HR(f,i[f])).join(""))}}get types(){return JSON.parse(T(this,mp))}getEncoder(e){let n=T(this,Cf).get(e);return n||(n=fe(this,eb,ML).call(this,e),T(this,Cf).set(e,n)),n}encodeType(e){const n=T(this,fo).get(e);return G(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return en(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(Yx(e))return r(e,n);const s=ay(e).array;if(s)return G(s.count===-1||s.count===n.length,`array length mismatch; expected length ${s.count}`,"value",n),n.map(o=>this._visit(s.prefix,o,r));const i=this.types[e];if(i)return i.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,n[a],r),o),{});G(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new ns(e)}static getPrimaryType(e){return ns.from(e).primaryType}static hashStruct(e,n,r){return ns.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const s=jR[r];G(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:s})}return n.sort((r,s)=>Jx.indexOf(r.name)-Jx.indexOf(s.name)),ns.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return $t(["0x1901",ns.hashDomain(e),ns.from(n).hash(r)])}static hash(e,n,r){return en(ns.encode(e,n,r))}static async resolveNames(e,n,r,s){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const i={};e.verifyingContract&&!St(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=ns.from(n);o.visit(r,(a,l)=>(a==="address"&&!St(l,20)&&(i[l]="0x"),l));for(const a in i)i[a]=await s(a);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,(a,l)=>a==="address"&&i[l]?i[l]:l),{domain:e,value:r}}static getPayload(e,n,r){ns.hashDomain(e);const s={},i=[];Jx.forEach(l=>{const u=e[l];u!=null&&(s[l]=Tse[l](u),i.push({name:l,type:jR[l]}))});const o=ns.from(n);n=o.types;const a=Object.assign({},n);return G(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),a.EIP712Domain=i,o.encode(r),{types:a,domain:s,primaryType:o.primaryType,message:o.visit(r,(l,u)=>{if(l.match(/^bytes(\d*)/))return we(ct(u));if(l.match(/^u?int/))return Ee(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return G(typeof u=="string","invalid string","value",u),u}G(!1,"unsupported type","type",l)})}}};mp=new WeakMap,fo=new WeakMap,Cf=new WeakMap,eb=new WeakSet,ML=function(e){{const s=Yx(e);if(s)return s}const n=ay(e).array;if(n){const s=n.prefix,i=this.getEncoder(s);return o=>{G(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let a=o.map(i);return T(this,fo).has(s)&&(a=a.map(en)),en($t(a))}}const r=this.types[e];if(r){const s=Ol(T(this,fo).get(e));return i=>{const o=r.map(({name:a,type:l})=>{const u=this.getEncoder(l)(i[a]);return T(this,fo).has(l)?en(u):u});return o.unshift(s),$t(o)}}G(!1,`unknown type: ${e}`,"type",e)};let ly=ns;function Jn(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const Dse=Jn("external public payable override".split(" ")),VR="constant external internal payable private public pure view override",Ose=Jn(VR.split(" ")),zR="constructor error event fallback function receive struct",$R=Jn(zR.split(" ")),GR="calldata memory storage payable indexed",Mse=Jn(GR.split(" ")),Nse=[zR,GR,"tuple returns",VR].join(" "),_se=Jn(Nse.split(" ")),Rse={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Pse=new RegExp("^(\\s*)"),Ise=new RegExp("^([0-9]+)"),Lse=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),WR=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),KR=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),tb=class tb{constructor(e){J(this,gp);J(this,Dn);J(this,_s);I(this,Dn,0),I(this,_s,e.slice())}get offset(){return T(this,Dn)}get length(){return T(this,_s).length-T(this,Dn)}clone(){return new tb(T(this,_s))}reset(){I(this,Dn,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=fe(this,gp,Hk).call(this,T(this,Dn)+1,e.match+1);return I(this,Dn,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;T(this,Dn)<e.match-1;){const r=this.peek().linkNext;n.push(fe(this,gp,Hk).call(this,T(this,Dn)+1,r)),I(this,Dn,r)}return I(this,Dn,e.match+1),n}peek(){if(T(this,Dn)>=T(this,_s).length)throw new Error("out-of-bounds");return T(this,_s)[T(this,Dn)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return Tp(this,Dn)._++,e}toString(){const e=[];for(let n=T(this,Dn);n<T(this,_s).length;n++){const r=T(this,_s)[n];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}};Dn=new WeakMap,_s=new WeakMap,gp=new WeakSet,Hk=function(e=0,n=0){return new tb(T(this,_s).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Ts=tb;function aa(t){const e=[],n=o=>{const a=i<t.length?JSON.stringify(t[i]):"$EOI";throw new Error(`invalid token ${a} at ${i}: ${o}`)};let r=[],s=[],i=0;for(;i<t.length;){let o=t.substring(i),a=o.match(Pse);a&&(i+=a[1].length,o=t.substring(i));const l={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(l);let u=Rse[o[0]]||"";if(u){if(l.type=u,l.text=o[0],i++,u==="OPEN_PAREN")r.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),l.match=r.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1;else if(u==="COMMA")l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(u==="OPEN_BRACKET")l.type="BRACKET";else if(u==="CLOSE_BRACKET"){let c=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;c=f+c,e[e.length-1].value=Qe(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=c}continue}if(a=o.match(Lse),a){if(l.text=a[1],i+=l.text.length,_se.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(KR)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(Ise),a){l.text=a[1],l.type="NUMBER",i+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${i}`)}return new Ts(e.map(o=>Object.freeze(o)))}function qR(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function uy(t,e){if(e.peekKeyword($R)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Wi(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function QR(t){let e=Wi(t,Ose);return qR(e,Jn("constant payable nonpayable".split(" "))),qR(e,Jn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Ki(t,e){return t.popParams().map(n=>Cn.from(n,e))}function JR(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Ee(t.pop().text);throw new Error("invalid gas")}return null}function _l(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const Bse=new RegExp(/^(.*)\[([0-9]*)\]$/);function YR(t){const e=t.match(KR);if(G(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);G(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);G(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const Lt={},dr=Symbol.for("_ethers_internal"),XR="_ParamTypeInternal",ZR="_ErrorInternal",eP="_EventInternal",tP="_ConstructorInternal",nP="_FallbackInternal",rP="_FunctionInternal",sP="_StructInternal",rs=class rs{constructor(e,n,r,s,i,o,a,l){J(this,Ef);W(this,"name");W(this,"type");W(this,"baseType");W(this,"indexed");W(this,"components");W(this,"arrayLength");W(this,"arrayChildren");if(jg(e,Lt,"ParamType"),Object.defineProperty(this,dr,{value:XR}),o&&(o=Object.freeze(o.slice())),s==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Me(this,{name:n,type:r,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=r,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(s=>r.arrayChildren.walk(s,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((s,i)=>r.components[i].walk(s,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],s=[e];return fe(this,Ef,lb).call(this,r,e,n,i=>{s[0]=i}),r.length&&await Promise.all(r),s[0]}static from(e,n){if(rs.isParamType(e))return e;if(typeof e=="string")try{return rs.from(aa(e),n)}catch{G(!1,"invalid param type","obj",e)}else if(e instanceof Ts){let a="",l="",u=null;Wi(e,Jn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(m=>rs.from(m)),a=`tuple(${u.map(m=>m.format()).join(",")})`):(a=YR(e.popType("TYPE")),l=a);let c=null,f=null;for(;e.length&&e.peekType("BRACKET");){const m=e.pop();c=new rs(Lt,"",a,l,null,u,f,c),f=m.value,a+=m.text,l="array",u=null}let d=null;if(Wi(e,Mse).has("indexed")){if(!n)throw new Error("");d=!0}const p=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new rs(Lt,p,a,l,d,u,f,c)}const r=e.name;G(!r||typeof r=="string"&&r.match(WR),"invalid name","obj.name",r);let s=e.indexed;s!=null&&(G(n,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(Bse);if(o){const a=parseInt(o[2]||"-1"),l=rs.from({type:o[1],components:e.components});return new rs(Lt,r||"",i,"array",s,null,a,l)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const a=e.components!=null?e.components.map(u=>rs.from(u)):null;return new rs(Lt,r||"",i,"tuple",s,a,null,null)}return i=YR(e.type),new rs(Lt,r||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[dr]===XR}};Ef=new WeakSet,lb=function(e,n,r,s){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=n.slice();a.forEach((l,u)=>{var c;fe(c=o,Ef,lb).call(c,e,l,r,f=>{a[u]=f})}),s(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(n))a=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");a=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,u)=>{var c;fe(c=o[u],Ef,lb).call(c,e,l,r,f=>{a[u]=f})}),s(a);return}const i=r(this.type,n);i.then?e.push(async function(){s(await i)}()):s(i)};let Cn=rs;class Rl{constructor(e,n,r){W(this,"type");W(this,"inputs");jg(e,Lt,"Fragment"),r=Object.freeze(r.slice()),Me(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{Rl.from(JSON.parse(e))}catch{}return Rl.from(aa(e))}if(e instanceof Ts)switch(e.peekKeyword($R)){case"constructor":return qi.from(e);case"error":return hr.from(e);case"event":return fi.from(e);case"fallback":case"receive":return Qi.from(e);case"function":return di.from(e);case"struct":return Pl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return qi.from(e);case"error":return hr.from(e);case"event":return fi.from(e);case"fallback":case"receive":return Qi.from(e);case"function":return di.from(e);case"struct":return Pl.from(e)}ee(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}G(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return qi.isFragment(e)}static isError(e){return hr.isFragment(e)}static isEvent(e){return fi.isFragment(e)}static isFunction(e){return di.isFragment(e)}static isStruct(e){return Pl.isFragment(e)}}class cy extends Rl{constructor(n,r,s,i){super(n,r,i);W(this,"name");G(typeof s=="string"&&s.match(WR),"invalid identifier","name",s),i=Object.freeze(i.slice()),Me(this,{name:s})}}function zh(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class hr extends cy{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,dr,{value:ZR})}get selector(){return Ol(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+zh(e,this.inputs)),n.join(" ")}static from(e){if(hr.isFragment(e))return e;if(typeof e=="string")return hr.from(aa(e));if(e instanceof Ts){const n=uy("error",e),r=Ki(e);return _l(e),new hr(Lt,n,r)}return new hr(Lt,e.name,e.inputs?e.inputs.map(Cn.from):[])}static isFragment(e){return e&&e[dr]===ZR}}class fi extends cy{constructor(n,r,s,i){super(n,"event",r,s);W(this,"anonymous");Object.defineProperty(this,dr,{value:eP}),Me(this,{anonymous:i})}get topicHash(){return Ol(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+zh(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(i=>Cn.from(i)),new fi(Lt,n,r,!1).topicHash}static from(n){if(fi.isFragment(n))return n;if(typeof n=="string")try{return fi.from(aa(n))}catch{G(!1,"invalid event fragment","obj",n)}else if(n instanceof Ts){const r=uy("event",n),s=Ki(n,!0),i=!!Wi(n,Jn(["anonymous"])).has("anonymous");return _l(n),new fi(Lt,r,s,i)}return new fi(Lt,n.name,n.inputs?n.inputs.map(r=>Cn.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[dr]===eP}}class qi extends Rl{constructor(n,r,s,i,o){super(n,r,s);W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:tP}),Me(this,{payable:i,gas:o})}format(n){if(ee(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[`constructor${zh(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(qi.isFragment(n))return n;if(typeof n=="string")try{return qi.from(aa(n))}catch{G(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Ts){Wi(n,Jn(["constructor"]));const r=Ki(n),s=!!Wi(n,Dse).has("payable"),i=JR(n);return _l(n),new qi(Lt,"constructor",r,s,i)}return new qi(Lt,"constructor",n.inputs?n.inputs.map(Cn.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===tP}}class Qi extends Rl{constructor(n,r,s){super(n,"fallback",r);W(this,"payable");Object.defineProperty(this,dr,{value:nP}),Me(this,{payable:s})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(n){if(Qi.isFragment(n))return n;if(typeof n=="string")try{return Qi.from(aa(n))}catch{G(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Ts){const r=n.toString(),s=n.peekKeyword(Jn(["fallback","receive"]));if(G(s,"type must be fallback or receive","obj",r),n.popKeyword(Jn(["fallback","receive"]))==="receive"){const l=Ki(n);return G(l.length===0,"receive cannot have arguments","obj.inputs",l),Wi(n,Jn(["payable"])),_l(n),new Qi(Lt,[],!0)}let o=Ki(n);o.length?G(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[Cn.from("bytes")];const a=QR(n);if(G(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Wi(n,Jn(["returns"])).has("returns")){const l=Ki(n);G(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return _l(n),new Qi(Lt,o,a==="payable")}if(n.type==="receive")return new Qi(Lt,[],!0);if(n.type==="fallback"){const r=[Cn.from("bytes")],s=n.stateMutability==="payable";return new Qi(Lt,r,s)}G(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[dr]===nP}}class di extends cy{constructor(n,r,s,i,o,a){super(n,"function",r,i);W(this,"constant");W(this,"outputs");W(this,"stateMutability");W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:rP}),o=Object.freeze(o.slice()),Me(this,{constant:s==="view"||s==="pure",gas:a,outputs:o,payable:s==="payable",stateMutability:s})}get selector(){return Ol(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="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!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n))),outputs:this.outputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+zh(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(zh(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(i=>Cn.from(i)),new di(Lt,n,"view",r,[],null).selector}static from(n){if(di.isFragment(n))return n;if(typeof n=="string")try{return di.from(aa(n))}catch{G(!1,"invalid function fragment","obj",n)}else if(n instanceof Ts){const s=uy("function",n),i=Ki(n),o=QR(n);let a=[];Wi(n,Jn(["returns"])).has("returns")&&(a=Ki(n));const l=JR(n);return _l(n),new di(Lt,s,o,i,a,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new di(Lt,n.name,r,n.inputs?n.inputs.map(Cn.from):[],n.outputs?n.outputs.map(Cn.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===rP}}class Pl extends cy{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,dr,{value:sP})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Pl.from(aa(e))}catch{G(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ts){const n=uy("struct",e),r=Ki(e);return _l(e),new Pl(Lt,n,r)}return new Pl(Lt,e.name,e.inputs?e.inputs.map(Cn.from):[])}static isFragment(e){return e&&e[dr]===sP}}const Ds=new Map;Ds.set(0,"GENERIC_PANIC"),Ds.set(1,"ASSERT_FALSE"),Ds.set(17,"OVERFLOW"),Ds.set(18,"DIVIDE_BY_ZERO"),Ds.set(33,"ENUM_RANGE_ERROR"),Ds.set(34,"BAD_STORAGE_DATA"),Ds.set(49,"STACK_UNDERFLOW"),Ds.set(50,"ARRAY_RANGE_ERROR"),Ds.set(65,"OUT_OF_MEMORY"),Ds.set(81,"UNINITIALIZED_FUNCTION_CALL");const Fse=new RegExp(/^bytes([0-9]*)$/),jse=new RegExp(/^(u?int)([0-9]*)$/);let Xx=null,iP=1024;function Use(t,e,n,r){let s="missing revert data",i=null;const o=null;let a=null;if(n){s="execution reverted";const u=ct(n);if(n=we(n),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(we(u.slice(0,4))==="0x08c379a0")try{i=r.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(we(u.slice(0,4))==="0x4e487b71")try{const c=Number(r.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[c]},i=`Panic due to ${Ds.get(c)||"UNKNOWN"}(${c})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const l={to:e.to?gt(e.to):null,data:e.data||"0x"};return e.from&&(l.from=gt(e.from)),_t(s,"CALL_EXCEPTION",{action:t,data:n,reason:i,transaction:l,invocation:o,revert:a})}const nb=class nb{constructor(){J(this,wa)}getDefaultValue(e){const n=e.map(s=>fe(this,wa,qf).call(this,Cn.from(s)));return new Xg(n,"_").defaultValue()}encode(e,n){j6(n.length,e.length,"types/values length mismatch");const r=e.map(o=>fe(this,wa,qf).call(this,Cn.from(o))),s=new Xg(r,"_"),i=new px;return s.encode(i,n),i.data}decode(e,n,r){const s=e.map(o=>fe(this,wa,qf).call(this,Cn.from(o)));return new Xg(s,"_").decode(new mx(n,r,iP))}static _setDefaultMaxInflation(e){G(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),iP=e}static defaultAbiCoder(){return Xx==null&&(Xx=new nb),Xx}static getBuiltinCallException(e,n,r){return Use(e,n,r,nb.defaultAbiCoder())}};wa=new WeakSet,qf=function(e){if(e.isArray())return new fre(fe(this,wa,qf).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Xg(e.components.map(r=>fe(this,wa,qf).call(this,r)),e.name);switch(e.baseType){case"address":return new ure(e.name);case"bool":return new dre(e.name);case"string":return new vre(e.name);case"bytes":return new hre(e.name);case"":return new gre(e.name)}let n=e.type.match(jse);if(n){let r=parseInt(n[2]||"256");return G(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Are(r/8,n[1]==="int",e.name)}if(n=e.type.match(Fse),n){let r=parseInt(n[1]);return G(r!==0&&r<=32,"invalid bytes length","param",e),new pre(r,e.name)}G(!1,"invalid type","type",e.type)};let Fc=nb;class Hse{constructor(e,n,r){W(this,"fragment");W(this,"name");W(this,"signature");W(this,"topic");W(this,"args");const s=e.name,i=e.format();Me(this,{fragment:e,name:s,signature:i,topic:n,args:r})}}class Vse{constructor(e,n,r,s){W(this,"fragment");W(this,"name");W(this,"args");W(this,"signature");W(this,"selector");W(this,"value");const i=e.name,o=e.format();Me(this,{fragment:e,name:i,args:r,signature:o,selector:n,value:s})}}class zse{constructor(e,n,r){W(this,"fragment");W(this,"name");W(this,"args");W(this,"signature");W(this,"selector");const s=e.name,i=e.format();Me(this,{fragment:e,name:s,args:r,signature:i,selector:n})}}class oP{constructor(e){W(this,"hash");W(this,"_isIndexed");Me(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const aP={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},lP={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&aP[t.toString()]&&(e=aP[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}},su=class su{constructor(e){J(this,wi);W(this,"fragments");W(this,"deploy");W(this,"fallback");W(this,"receive");J(this,gi);J(this,yi);J(this,bi);J(this,Ln);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,I(this,bi,new Map),I(this,gi,new Map),I(this,yi,new Map);const r=[];for(const o of n)try{r.push(Rl.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Me(this,{fragments:Object.freeze(r)});let s=null,i=!1;I(this,Ln,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Me(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:(G(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":l=T(this,bi);break;case"event":l=T(this,yi);break;case"error":l=T(this,gi);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Me(this,{deploy:qi.from("constructor()")}),Me(this,{fallback:s,receive:i})}format(e){const n=e?"minimal":"full";return this.fragments.map(s=>s.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return Fc.defaultAbiCoder()}getFunctionName(e){const n=fe(this,wi,ub).call(this,e,null,!1);return G(n,"no matching function","key",e),n.name}hasFunction(e){return!!fe(this,wi,ub).call(this,e,null,!1)}getFunction(e,n){return fe(this,wi,ub).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(T(this,bi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,bi).get(s),r)}}getEventName(e){const n=fe(this,wi,cb).call(this,e,null,!1);return G(n,"no matching event","key",e),n.name}hasEvent(e){return!!fe(this,wi,cb).call(this,e,null,!1)}getEvent(e,n){return fe(this,wi,cb).call(this,e,n||null,!0)}forEachEvent(e){const n=Array.from(T(this,yi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,yi).get(s),r)}}getError(e,n){if(St(e)){const s=e.toLowerCase();if(lP[s])return hr.from(lP[s].signature);for(const i of T(this,gi).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){const s=[];for(const[i,o]of T(this,gi))i.split("(")[0]===e&&s.push(o);if(s.length===0)return e==="Error"?hr.from("error Error(string)"):e==="Panic"?hr.from("error Panic(uint256)"):null;if(s.length>1){const i=s.map(o=>JSON.stringify(o.format())).join(", ");G(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=hr.from(e).format(),e==="Error(string)")return hr.from("error Error(string)");if(e==="Panic(uint256)")return hr.from("error Panic(uint256)");const r=T(this,gi).get(e);return r||null}forEachError(e){const n=Array.from(T(this,gi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,gi).get(s),r)}}_decodeParams(e,n){return T(this,Ln).decode(e,n)}_encodeParams(e,n){return T(this,Ln).encode(e,n)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);G(r,"unknown error","fragment",e),e=r}return G(Vt(n,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",n),this._decodeParams(e.inputs,Vt(n,4))}encodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);G(r,"unknown error","fragment",e),e=r}return $t([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);G(r,"unknown function","fragment",e),e=r}return G(Vt(n,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",n),this._decodeParams(e.inputs,Vt(n,4))}encodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);G(r,"unknown function","fragment",e),e=r}return $t([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionResult(e,n){if(typeof e=="string"){const i=this.getFunction(e);G(i,"unknown function","fragment",e),e=i}let r="invalid length for result data";const s=Gn(n);if(s.length%32===0)try{return T(this,Ln).decode(e.outputs,s)}catch{r="could not decode result data"}ee(!1,r,"BAD_DATA",{value:we(s),info:{method:e.name,signature:e.format()}})}makeError(e,n){const r=ct(e,"data"),s=Fc.getBuiltinCallException("call",n,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const a=we(r.slice(0,4)),l=this.getError(a);if(l)try{const u=T(this,Ln).decode(l.inputs,r.slice(4));s.revert={name:l.name,signature:l.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(n);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(e,n){if(typeof e=="string"){const r=this.getFunction(e);G(r,"unknown function","fragment",e),e=r}return we(T(this,Ln).encode(e.outputs,n||[]))}encodeFilterTopics(e,n){if(typeof e=="string"){const i=this.getEvent(e);G(i,"unknown event","eventFragment",e),e=i}ee(n.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const s=(i,o)=>i.type==="string"?Ol(o):i.type==="bytes"?en(we(o)):(i.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":i.type.match(/^u?int/)?o=Zo(o):i.type.match(/^bytes/)?o=kte(o,32):i.type==="address"&&T(this,Ln).encode(["address"],[o]),xl(we(o),32));for(n.forEach((i,o)=>{const a=e.inputs[o];if(!a.indexed){G(i==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,i);return}i==null?r.push(null):a.baseType==="array"||a.baseType==="tuple"?G(!1,"filtering with tuples or arrays not supported","contract."+a.name,i):Array.isArray(i)?r.push(i.map(l=>s(a,l))):r.push(s(a,i))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);G(o,"unknown event","eventFragment",e),e=o}const r=[],s=[],i=[];return e.anonymous||r.push(e.topicHash),G(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,a)=>{const l=n[a];if(o.indexed)if(o.type==="string")r.push(Ol(l));else if(o.type==="bytes")r.push(en(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(T(this,Ln).encode([o.type],[l]))}else s.push(o),i.push(l)}),{data:T(this,Ln).encode(s,i),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const h=this.getEvent(e);G(h,"unknown event","eventFragment",e),e=h}if(r!=null&&!e.anonymous){const h=e.topicHash;G(St(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],i=[],o=[];e.inputs.forEach((h,p)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(Cn.from({type:"bytes32",name:h.name})),o.push(!0)):(s.push(h),o.push(!1)):(i.push(h),o.push(!1))});const a=r!=null?T(this,Ln).decode(s,$t(r)):null,l=T(this,Ln).decode(i,n,!0),u=[],c=[];let f=0,d=0;return e.inputs.forEach((h,p)=>{let m=null;if(h.indexed)if(a==null)m=new oP(null);else if(o[p])m=new oP(a[d++]);else try{m=a[d++]}catch(g){m=g}else try{m=l[f++]}catch(g){m=g}u.push(m),c.push(h.name||null)}),Tc.fromItems(u,c)}parseTransaction(e){const n=ct(e.data,"tx.data"),r=Ee(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(we(n.slice(0,4)));if(!s)return null;const i=T(this,Ln).decode(s.inputs,n.slice(4));return new Vse(s,s.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Hse(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=we(e),r=this.getError(Vt(n,0,4));if(!r)return null;const s=T(this,Ln).decode(r.inputs,Vt(n,4));return new zse(r,r.selector,s)}static from(e){return e instanceof su?e:typeof e=="string"?new su(JSON.parse(e)):typeof e.formatJson=="function"?new su(e.formatJson()):typeof e.format=="function"?new su(e.format("json")):new su(e)}};gi=new WeakMap,yi=new WeakMap,bi=new WeakMap,Ln=new WeakMap,wi=new WeakSet,ub=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,bi).values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,bi))o.split("(")[0]===e&&i.push(a);if(n){const o=n.length>0?n[n.length-1]:null;let a=n.length,l=!0;Rn.isTyped(o)&&o.type==="overrides"&&(l=!1,a--);for(let u=i.length-1;u>=0;u--){const c=i[u].inputs.length;c!==a&&(!l||c!==a-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){const c=i[u].inputs;for(let f=0;f<n.length;f++)if(Rn.isTyped(n[f])){if(f>=c.length){if(n[f].type==="overrides")continue;i.splice(u,1);break}if(n[f].type!==c[f].baseType){i.splice(u,1);break}}}}if(i.length===1&&n&&n.length!==i[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&r){const o=i.map(a=>JSON.stringify(a.format())).join(", ");G(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,bi).get(di.from(e).format());return s||null},cb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,yi).values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,yi))o.split("(")[0]===e&&i.push(a);if(n){for(let o=i.length-1;o>=0;o--)i[o].inputs.length<n.length&&i.splice(o,1);for(let o=i.length-1;o>=0;o--){const a=i[o].inputs;for(let l=0;l<n.length;l++)if(Rn.isTyped(n[l])&&n[l].type!==a[l].baseType){i.splice(o,1);break}}}if(i.length===0)return null;if(i.length>1&&r){const o=i.map(a=>JSON.stringify(a.format())).join(", ");G(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,yi).get(fi.from(e).format());return s||null};let Zx=su;const uP=BigInt(0);function jc(t){return t??null}function Kt(t){return t==null?null:t.toString()}class cP{constructor(e,n,r){W(this,"gasPrice");W(this,"maxFeePerGas");W(this,"maxPriorityFeePerGas");Me(this,{gasPrice:jc(e),maxFeePerGas:jc(n),maxPriorityFeePerGas:jc(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Kt(e),maxFeePerGas:Kt(n),maxPriorityFeePerGas:Kt(r)}}}function fy(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=we(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of n)!(s in t)||t[s]==null||(e[s]=Ee(t[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in t)||t[s]==null||(e[s]=Qe(t[s],`request.${s}`));return t.accessList&&(e.accessList=oa(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(s=>ux(s)?we(s):Object.assign({},s))),e}class $se{constructor(e,n){W(this,"provider");W(this,"number");W(this,"hash");W(this,"timestamp");W(this,"parentHash");W(this,"parentBeaconBlockRoot");W(this,"nonce");W(this,"difficulty");W(this,"gasLimit");W(this,"gasUsed");W(this,"stateRoot");W(this,"receiptsRoot");W(this,"blobGasUsed");W(this,"excessBlobGas");W(this,"miner");W(this,"prevRandao");W(this,"extraData");W(this,"baseFeePerGas");J(this,ho);I(this,ho,e.transactions.map(r=>typeof r!="string"?new Gh(r,n):r)),Me(this,{provider:n,hash:jc(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:jc(e.prevRandao),extraData:e.extraData,baseFeePerGas:jc(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return T(this,ho).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=T(this,ho).slice();return e.length===0?[]:(ee(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:s,gasUsed:i,hash:o,miner:a,prevRandao:l,nonce:u,number:c,parentHash:f,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,timestamp:m,transactions:g}=this;return{_type:"Block",baseFeePerGas:Kt(e),difficulty:Kt(n),extraData:r,gasLimit:Kt(s),gasUsed:Kt(i),blobGasUsed:Kt(this.blobGasUsed),excessBlobGas:Kt(this.excessBlobGas),hash:o,miner:a,prevRandao:l,nonce:u,number:c,parentHash:f,timestamp:m,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,transactions:g}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>e<this.length?{value:n[e++],done:!1}:{value:void 0,done:!0}}}get length(){return T(this,ho).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let n;if(typeof e=="number")n=T(this,ho)[e];else{const r=e.toLowerCase();for(const s of T(this,ho))if(typeof s=="string"){if(s!==r)continue;n=s;break}else{if(s.hash===r)continue;n=s;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(e){const n=this.prefetchedTransactions;if(typeof e=="number")return n[e];e=e.toLowerCase();for(const r of n)if(r.hash===e)return r;G(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Gse(this)}}ho=new WeakMap;class $h{constructor(e,n){W(this,"provider");W(this,"transactionHash");W(this,"blockHash");W(this,"blockNumber");W(this,"removed");W(this,"address");W(this,"data");W(this,"topics");W(this,"index");W(this,"transactionIndex");this.provider=n;const r=Object.freeze(e.topics.slice());Me(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:n,blockNumber:r,data:s,index:i,removed:o,topics:a,transactionHash:l,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:n,blockNumber:r,data:s,index:i,removed:o,topics:a,transactionHash:l,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return ee(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return Wse(this)}}class fP{constructor(e,n){W(this,"provider");W(this,"to");W(this,"from");W(this,"contractAddress");W(this,"hash");W(this,"index");W(this,"blockHash");W(this,"blockNumber");W(this,"logsBloom");W(this,"gasUsed");W(this,"blobGasUsed");W(this,"cumulativeGasUsed");W(this,"gasPrice");W(this,"blobGasPrice");W(this,"type");W(this,"status");W(this,"root");J(this,yp);I(this,yp,Object.freeze(e.logs.map(s=>new $h(s,n))));let r=uP;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Me(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return T(this,yp)}toJSON(){const{to:e,from:n,contractAddress:r,hash:s,index:i,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:c,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:r,cumulativeGasUsed:Kt(this.cumulativeGasUsed),from:n,gasPrice:Kt(this.gasPrice),blobGasUsed:Kt(this.blobGasUsed),blobGasPrice:Kt(this.blobGasPrice),gasUsed:Kt(this.gasUsed),hash:s,index:i,logs:u,logsBloom:l,root:f,status:c,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return hP(this)}reorderedEvent(e){return ee(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),dP(this,e)}}yp=new WeakMap;const _k=class _k{constructor(e,n){W(this,"provider");W(this,"blockNumber");W(this,"blockHash");W(this,"index");W(this,"hash");W(this,"type");W(this,"to");W(this,"from");W(this,"nonce");W(this,"gasLimit");W(this,"gasPrice");W(this,"maxPriorityFeePerGas");W(this,"maxFeePerGas");W(this,"maxFeePerBlobGas");W(this,"data");W(this,"value");W(this,"chainId");W(this,"signature");W(this,"accessList");W(this,"blobVersionedHashes");J(this,Aa);this.provider=n,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,I(this,Aa,-1)}toJSON(){const{blockNumber:e,blockHash:n,index:r,hash:s,type:i,to:o,from:a,nonce:l,data:u,signature:c,accessList:f,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:e,blockHash:n,blobVersionedHashes:d,chainId:Kt(this.chainId),data:u,from:a,gasLimit:Kt(this.gasLimit),gasPrice:Kt(this.gasPrice),hash:s,maxFeePerGas:Kt(this.maxFeePerGas),maxPriorityFeePerGas:Kt(this.maxPriorityFeePerGas),maxFeePerBlobGas:Kt(this.maxFeePerBlobGas),nonce:l,signature:c,to:o,index:r,type:i,value:Kt(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const r=await this.getTransaction();r&&(e=r.blockNumber)}if(e==null)return null;const n=this.provider.getBlock(e);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:r}=await _n({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,n){const r=e??1,s=n??0;let i=T(this,Aa),o=-1,a=i===-1;const l=async()=>{if(a)return null;const{blockNumber:d,nonce:h}=await _n({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){i=d;return}if(a)return null;const p=await this.getTransaction();if(!(p&&p.blockNumber!=null))for(o===-1&&(o=i-3,o<T(this,Aa)&&(o=T(this,Aa)));o<=d;){if(a)return null;const m=await this.provider.getBlock(o,!0);if(m==null)return;for(const g of m)if(g===this.hash)return;for(let g=0;g<m.length;g++){const y=await m.getTransaction(g);if(y.from===this.from&&y.nonce===this.nonce){if(a)return null;const v=await this.provider.getTransactionReceipt(y.hash);if(v==null||d-v.blockNumber+1<r)return;let A="replaced";y.data===this.data&&y.to===this.to&&y.value===this.value?A="repriced":y.data==="0x"&&y.from===y.to&&y.value===uP&&(A="cancelled"),ee(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:A==="replaced"||A==="cancelled",reason:A,replacement:y.replaceableTransaction(i),hash:y.hash,receipt:v})}}o++}},u=d=>{if(d==null||d.status!==0)return d;ee(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},c=await this.provider.getTransactionReceipt(this.hash);if(r===0)return u(c);if(c){if(await c.confirmations()>=r)return u(c)}else if(await l(),r===0)return null;return await new Promise((d,h)=>{const p=[],m=()=>{p.forEach(y=>y())};if(p.push(()=>{a=!0}),s>0){const y=setTimeout(()=>{m(),h(_t("wait for transaction timeout","TIMEOUT"))},s);p.push(()=>{clearTimeout(y)})}const g=async y=>{if(await y.confirmations()>=r){m();try{d(u(y))}catch(v){h(v)}}};if(p.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),i>=0){const y=async()=>{try{await l()}catch(v){if(gn(v,"TRANSACTION_REPLACED")){m(),h(v);return}}a||this.provider.once("block",y)};p.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),hP(this)}reorderedEvent(e){return ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ee(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),dP(this,e)}replaceableTransaction(e){G(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new _k(this,this.provider);return I(n,Aa,e),n}};Aa=new WeakMap;let Gh=_k;function Gse(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function dP(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function hP(t){return{orphan:"drop-transaction",tx:t}}function Wse(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class e2 extends $h{constructor(n,r,s){super(n,n.provider);W(this,"interface");W(this,"fragment");W(this,"args");const i=r.decodeEventLog(s,n.data,n.topics);Me(this,{args:i,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class pP extends $h{constructor(n,r){super(n,n.provider);W(this,"error");Me(this,{error:r})}}class Kse extends fP{constructor(n,r,s){super(s,r);J(this,Sf);I(this,Sf,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?T(this,Sf).getEvent(n.topics[0]):null;if(r)try{return new e2(n,T(this,Sf),r)}catch(s){return new pP(n,s)}return n})}}Sf=new WeakMap;class t2 extends Gh{constructor(n,r,s){super(s,r);J(this,bp);I(this,bp,n)}async wait(n,r){const s=await super.wait(n,r);return s==null?null:new Kse(T(this,bp),this.provider,s)}}bp=new WeakMap;class mP extends K6{constructor(n,r,s,i){super(n,r,s);W(this,"log");Me(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class qse extends mP{constructor(e,n,r,s,i){super(e,n,r,new e2(i,e.interface,s));const o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Me(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const gP=BigInt(0);function yP(t){return t&&typeof t.call=="function"}function bP(t){return t&&typeof t.estimateGas=="function"}function dy(t){return t&&typeof t.resolveName=="function"}function wP(t){return t&&typeof t.sendTransaction=="function"}function AP(t){if(t!=null){if(dy(t))return t;if(t.provider)return t.provider}}class Qse{constructor(e,n,r){J(this,wp);W(this,"fragment");if(Me(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=Il(e.runner,"resolveName"),i=dy(s)?s:null;I(this,wp,async function(){const o=await Promise.all(n.inputs.map((a,l)=>r[l]==null?null:a.walkAsync(r[l],(c,f)=>c==="address"?Array.isArray(f)?Promise.all(f.map(d=>Qn(d,i))):Qn(f,i):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return T(this,wp)}}wp=new WeakMap;function Il(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Ll(t){return t==null?null:t.provider||null}async function vP(t,e){const n=Rn.dereference(t,"overrides");G(typeof n=="object","invalid overrides parameter","overrides",t);const r=fy(n);return G(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),G(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Jse(t,e,n){const r=Il(t,"resolveName"),s=dy(r)?r:null;return await Promise.all(e.map((i,o)=>i.walkAsync(n[o],(a,l)=>(l=Rn.dereference(l,a),a==="address"?Qn(l,s):l))))}function Yse(t){const e=async function(o){const a=await vP(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await Qn(a.from,AP(t.runner)));const l=t.interface,u=Ee(a.value||gP,"overrides.value")===gP,c=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!c&&!u&&G(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),G(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data);const f=l.receive||l.fallback&&l.fallback.payable;return G(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),G(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data),a},n=async function(o){const a=Il(t.runner,"call");ee(yP(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw lx(u)&&u.data?t.interface.makeError(u.data,l):u}},r=async function(o){const a=t.runner;ee(wP(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=Ll(t.runner);return new t2(t.interface,u,l)},s=async function(o){const a=Il(t.runner,"estimateGas");return ee(bP(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},i=async o=>await r(o);return Me(i,{_contract:t,estimateGas:s,populateTransaction:e,send:r,staticCall:n}),i}function Xse(t,e){const n=function(...u){const c=t.interface.getFunction(e,u);return ee(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),c},r=async function(...u){const c=n(...u);let f={};if(c.inputs.length+1===u.length&&(f=await vP(u.pop()),f.from&&(f.from=await Qn(f.from,AP(t.runner)))),c.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await Jse(t.runner,c.inputs,u);return Object.assign({},f,await _n({to:t.getAddress(),data:t.interface.encodeFunctionData(c,d)}))},s=async function(...u){const c=await a(...u);return c.length===1?c[0]:c},i=async function(...u){const c=t.runner;ee(wP(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await c.sendTransaction(await r(...u)),d=Ll(t.runner);return new t2(t.interface,d,f)},o=async function(...u){const c=Il(t.runner,"estimateGas");return ee(bP(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await r(...u))},a=async function(...u){const c=Il(t.runner,"call");ee(yP(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...u);let d="0x";try{d=await c.call(f)}catch(p){throw lx(p)&&p.data?t.interface.makeError(p.data,f):p}const h=n(...u);return t.interface.decodeFunctionResult(h,d)},l=async(...u)=>n(...u).constant?await s(...u):await i(...u);return Me(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:i,staticCall:s,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return ee(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function Zse(t,e){const n=function(...s){const i=t.interface.getEvent(e,s);return ee(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},r=function(...s){return new Qse(t,n(...s),s)};return Me(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=t.interface.getEvent(e);return ee(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),r}const hy=Symbol.for("_ethersInternal_contract"),xP=new WeakMap;function eie(t,e){xP.set(t[hy],e)}function Rr(t){return xP.get(t[hy])}function tie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function n2(t,e){let n,r=null;if(Array.isArray(e)){const i=function(o){if(St(o,32))return o;const a=t.interface.getEvent(o);return G(a,"unknown fragment","name",o),a.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(i):i(o))}else e==="*"?n=[null]:typeof e=="string"?St(e,32)?n=[e]:(r=t.interface.getEvent(e),G(r,"unknown fragment","event",e),n=[r.topicHash]):tie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):G(!1,"unknown event name","event",e);n=n.map(i=>{if(i==null)return null;if(Array.isArray(i)){const o=Array.from(new Set(i.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return i.toLowerCase()});const s=n.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:r,tag:s,topics:n}}async function Wh(t,e){const{subs:n}=Rr(t);return n.get((await n2(t,e)).tag)||null}async function kP(t,e,n){const r=Ll(t.runner);ee(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:s,tag:i,topics:o}=await n2(t,n),{addr:a,subs:l}=Rr(t);let u=l.get(i);if(!u){const f={address:a||t,topics:o},d=g=>{let y=s;if(y==null)try{y=t.interface.getEvent(g.topics[0])}catch{}if(y){const v=y,A=s?t.interface.decodeEventLog(s,g.data,g.topics):[];s2(t,n,A,w=>new qse(t,w,n,v,g))}else s2(t,n,[],v=>new mP(t,v,n,g))};let h=[];u={tag:i,listeners:[],start:()=>{h.length||h.push(r.on(f,d))},stop:async()=>{if(h.length==0)return;let g=h;h=[],await Promise.all(g),r.off(f,d)}},l.set(i,u)}return u}let r2=Promise.resolve();async function nie(t,e,n,r){await r2;const s=await Wh(t,e);if(!s)return!1;const i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:a})=>{const l=Array.from(n);r&&l.push(r(a?null:o));try{o.call(t,...l)}catch{}return!a}),s.listeners.length===0&&(s.stop(),Rr(t).subs.delete(s.tag)),i>0}async function s2(t,e,n,r){try{await r2}catch{}const s=nie(t,e,n,r);return r2=s,await s}const py=["then"];CL=hy;const Ap=class Ap{constructor(e,n,r,s){W(this,"target");W(this,"interface");W(this,"runner");W(this,"filters");W(this,CL);W(this,"fallback");G(typeof e=="string"||rR(e),"invalid value for Contract target","target",e),r==null&&(r=null);const i=Zx.from(n);Me(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,hy,{value:{}});let o,a=null,l=null;if(s){const f=Ll(r);l=new t2(this.interface,f,s)}let u=new Map;if(typeof e=="string")if(St(e))a=e,o=Promise.resolve(e);else{const f=Il(r,"resolveName");if(!dy(f))throw _t("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(d=>{if(d==null)throw _t("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Rr(this).addr=d,d})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Rr(this).addr=f,f});eie(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const c=new Proxy({},{get:(f,d,h)=>{if(typeof d=="symbol"||py.indexOf(d)>=0)return Reflect.get(f,d,h);try{return this.getEvent(d)}catch(p){if(!gn(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(f,d)=>py.indexOf(d)>=0?Reflect.has(f,d):Reflect.has(f,d)||this.interface.hasEvent(String(d))});return Me(this,{filters:c}),Me(this,{fallback:i.receive||i.fallback?Yse(this):null}),new Proxy(this,{get:(f,d,h)=>{if(typeof d=="symbol"||d in f||py.indexOf(d)>=0)return Reflect.get(f,d,h);try{return f.getFunction(d)}catch(p){if(!gn(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(f,d)=>typeof d=="symbol"||d in f||py.indexOf(d)>=0?Reflect.has(f,d):f.interface.hasFunction(d)})}connect(e){return new Ap(this.target,this.interface,e)}attach(e){return new Ap(e,this.interface,this.runner)}async getAddress(){return await Rr(this).addrPromise}async getDeployedCode(){const e=Ll(this.runner);ee(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Ll(this.runner);return ee(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",o)}catch(a){i(a)}};o()})}deploymentTransaction(){return Rr(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Xse(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Zse(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:s,addrPromise:i}=Rr(this),o=s||await i,{fragment:a,topics:l}=await n2(this,e),u={address:o,topics:l,fromBlock:n,toBlock:r},c=Ll(this.runner);return ee(c,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await c.getLogs(u)).map(f=>{let d=a;if(d==null)try{d=this.interface.getEvent(f.topics[0])}catch{}if(d)try{return new e2(f,this.interface,d)}catch(h){return new pP(f,h)}return new $h(f,c)})}async on(e,n){const r=await kP(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await kP(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await s2(this,e,n,null)}async listenerCount(e){if(e){const s=await Wh(this,e);return s?s.listeners.length:0}const{subs:n}=Rr(this);let r=0;for(const{listeners:s}of n.values())r+=s.length;return r}async listeners(e){if(e){const s=await Wh(this,e);return s?s.listeners.map(({listener:i})=>i):[]}const{subs:n}=Rr(this);let r=[];for(const{listeners:s}of n.values())r=r.concat(s.map(({listener:i})=>i));return r}async off(e,n){const r=await Wh(this,e);if(!r)return this;if(n){const s=r.listeners.map(({listener:i})=>i).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Rr(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await Wh(this,e);if(!n)return this;n.stop(),Rr(this).subs.delete(n.tag)}else{const{subs:n}=Rr(this);for(const{tag:r,stop:s}of n.values())s(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Ap{constructor(s,i=null){super(s,e,i)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};let i2=Ap;function rie(){return i2}class Uc extends rie(){}function o2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):G(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class sie{constructor(e){W(this,"name");Me(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const CP=new RegExp("^(ipfs)://(.*)$","i"),EP=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),CP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],Tf=class Tf{constructor(e,n,r){J(this,xa);W(this,"provider");W(this,"address");W(this,"name");J(this,va);J(this,iu);Me(this,{provider:e,address:n,name:r}),I(this,va,null),I(this,iu,new Uc(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return T(this,va)==null&&I(this,va,(async()=>{try{return await T(this,iu).supportsInterface("0x9061b923")}catch(e){if(gn(e,"CALL_EXCEPTION"))return!1;throw I(this,va,null),e}})()),await T(this,va)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await fe(this,xa,Qf).call(this,"addr(bytes32)");return i==null||i===Rh?null:i}catch(i){if(gn(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648;const o=await fe(this,xa,Qf).call(this,"addr(bytes32,uint)",[i]);if(St(o,20))return gt(o)}let n=null;for(const i of this.provider.plugins)if(i instanceof sie&&i.supportsCoinType(e)){n=i;break}if(n==null)return null;const r=await fe(this,xa,Qf).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const s=await n.decodeAddress(e,r);if(s!=null)return s;ee(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await fe(this,xa,Qf).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await fe(this,xa,Qf).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const s=n[1]==="e3010170"?"ipfs":"ipns",i=parseInt(n[4],16);if(n[5].length===i*2)return`${s}://${Ste("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ee(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r<EP.length;r++){const s=n.match(EP[r]);if(s==null)continue;const i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:n}),{linkage:e,url:n};case"ipfs":{const o=o2(n);return e.push({type:"ipfs",value:n}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{const o=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:n});const a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(s[2]||"").split("/");if(l.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};const u=l[1],c=new Uc(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(i==="erc721"){const m=await c.ownerOf(u);if(a!==m)return e.push({type:"!owner",value:m}),{url:null,linkage:e};e.push({type:"owner",value:m})}else if(i==="erc1155"){const m=await c.balanceOf(a,u);if(!m)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:m.toString()})}let f=await c[o](u);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),i==="erc1155"&&(f=f.replace("{id}",Zo(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=o2(f)),e.push({type:"metadata-url",value:f});let d={};const h=await new Kn(f).send();h.assertOk();try{d=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{const y=h.body;return y&&e.push({type:"!metadata",value:we(y)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let p=d.image;if(typeof p!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!p.match(/^(https:\/\/|data:)/i)){if(p.match(CP)==null)return e.push({type:"!imageUrl-ipfs",value:p}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:p}),p=o2(p)}return e.push({type:"url",value:p}),{linkage:e,url:p}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const n=await e.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return ee(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(e,n){var s;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const i=await fe(s=Tf,rb,NL).call(s,e,r);if(i!=null){const o=new Tf(e,i,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};va=new WeakMap,iu=new WeakMap,xa=new WeakSet,Qf=async function(e,n){n=(n||[]).slice();const r=T(this,iu).interface;n.unshift($x(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(e),ee(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),n=[ise(this.name,255),r.encodeFunctionData(s,n)],e="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const i=await T(this,iu)[e](...n);return s?r.decodeFunctionResult(s,i)[0]:i}catch(i){if(!gn(i,"CALL_EXCEPTION"))throw i}return null},rb=new WeakSet,NL=async function(e,n){const r=await Tf.getEnsAddress(e);try{const i=await new Uc(r,["function resolver(bytes32) view returns (address)"],e).resolver($x(n),{enableCcipRead:!0});return i===Rh?null:i}catch(s){throw s}return null},J(Tf,rb);let my=Tf;const SP=BigInt(0);function lt(t,e){return function(n){return n==null?e:t(n)}}function gy(t,e){return n=>{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function Kh(t,e){return n=>{const r={};for(const s in t){let i=s;if(e&&s in e&&!(i in n)){for(const o of e[s])if(o in n){i=o;break}}try{const o=t[s](n[i]);o!==void 0&&(r[s]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";ee(!1,`invalid value for value.${s} (${a})`,"BAD_DATA",{value:n})}}return r}}function iie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}G(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Hc(t){return G(St(t,!0),"invalid data","value",t),t}function En(t){return G(St(t,32),"invalid hash","value",t),t}const oie=Kh({address:gt,blockHash:En,blockNumber:Qe,data:Hc,index:Qe,removed:lt(iie,!1),topics:gy(En),transactionHash:En,transactionIndex:Qe},{index:["logIndex"]});function aie(t){return oie(t)}const lie=Kh({hash:lt(En),parentHash:En,parentBeaconBlockRoot:lt(En,null),number:Qe,timestamp:Qe,nonce:lt(Hc),difficulty:Ee,gasLimit:Ee,gasUsed:Ee,stateRoot:lt(En,null),receiptsRoot:lt(En,null),blobGasUsed:lt(Ee,null),excessBlobGas:lt(Ee,null),miner:lt(gt),prevRandao:lt(En,null),extraData:Hc,baseFeePerGas:lt(Ee)},{prevRandao:["mixHash"]});function uie(t){const e=lie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:TP(n)),e}const cie=Kh({transactionIndex:Qe,blockNumber:Qe,transactionHash:En,address:gt,topics:gy(En),data:Hc,index:Qe,blockHash:En},{index:["logIndex"]});function fie(t){return cie(t)}const die=Kh({to:lt(gt,null),from:lt(gt,null),contractAddress:lt(gt,null),index:Qe,root:lt(we),gasUsed:Ee,blobGasUsed:lt(Ee,null),logsBloom:lt(Hc),blockHash:En,hash:En,logs:gy(fie),blockNumber:Qe,cumulativeGasUsed:Ee,effectiveGasPrice:lt(Ee),blobGasPrice:lt(Ee,null),status:lt(Qe),type:lt(Qe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function hie(t){return die(t)}function TP(t){t.to&&Ee(t.to)===SP&&(t.to="0x0000000000000000000000000000000000000000");const e=Kh({hash:En,index:lt(Qe,void 0),type:n=>n==="0x"||n==null?0:Qe(n),accessList:lt(oa,null),blobVersionedHashes:lt(gy(En,!0),null),blockHash:lt(En,null),blockNumber:lt(Qe,null),transactionIndex:lt(Qe,null),from:gt,gasPrice:lt(Ee),maxPriorityFeePerGas:lt(Ee),maxFeePerGas:lt(Ee),maxFeePerBlobGas:lt(Ee,null),gasLimit:Ee,to:lt(gt,null),value:Ee,nonce:Qe,data:Hc,creates:lt(gt,null),chainId:lt(Ee,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=are(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Ss.from(t.signature):e.signature=Ss.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&Ee(e.blockHash)===SP&&(e.blockHash=null),e}const pie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class qh{constructor(e){W(this,"name");Me(this,{name:e})}clone(){return new qh(this.name)}}class yy extends qh{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);W(this,"effectiveBlock");W(this,"txBase");W(this,"txCreate");W(this,"txDataZero");W(this,"txDataNonzero");W(this,"txAccessListStorageKey");W(this,"txAccessListAddress");const s={effectiveBlock:n};function i(o,a){let l=(r||{})[o];l==null&&(l=a),G(typeof l=="number",`invalud value for ${o}`,"costs",r),s[o]=l}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Me(this,s)}clone(){return new yy(this.effectiveBlock,this)}}class by extends qh{constructor(n,r){super("org.ethers.plugins.network.Ens");W(this,"address");W(this,"targetNetwork");Me(this,{address:n||pie,targetNetwork:r??1})}clone(){return new by(this.address,this.targetNetwork)}}class mie extends qh{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");J(this,vp);J(this,xp);I(this,vp,n),I(this,xp,r)}get url(){return T(this,vp)}get processFunc(){return T(this,xp)}clone(){return this}}vp=new WeakMap,xp=new WeakMap;const a2=new Map,Mf=class Mf{constructor(e,n){J(this,Df);J(this,Of);J(this,ka);I(this,Df,e),I(this,Of,Ee(n)),I(this,ka,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return T(this,Df)}set name(e){I(this,Df,e)}get chainId(){return T(this,Of)}set chainId(e){I(this,Of,Ee(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Ee(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Ee(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Ee(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(T(this,ka).values())}attachPlugin(e){if(T(this,ka).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,ka).set(e.name,e.clone()),this}getPlugin(e){return T(this,ka).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Mf(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new yy;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(e.accessList){const s=oa(e.accessList);for(const i in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[i].storageKeys.length}return r}static from(e){if(gie(),e==null)return Mf.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const n=a2.get(e);if(n)return n();if(typeof e=="bigint")return new Mf("unknown",e);G(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){G(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const n=new Mf(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&n.attachPlugin(new by(e.ensAddress,e.ensNetwork)),n}G(!1,"invalid network","network",e)}static register(e,n){typeof e=="number"&&(e=BigInt(e));const r=a2.get(e);r&&G(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),a2.set(e,n)}};Df=new WeakMap,Of=new WeakMap,ka=new WeakMap;let rn=Mf;function DP(t,e){const n=String(t);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;r[1].length<e;)r[1]+="0";if(r[1].length>9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function OP(t){return new mie(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let s;try{const[i,o]=await Promise.all([r.send(),e()]);s=i;const a=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:DP(a.maxFee,9),maxPriorityFeePerGas:DP(a.maxPriorityFee,9)}}catch(i){ee(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:i})}})}let MP=!1;function gie(){if(MP)return;MP=!0;function t(e,n,r){const s=function(){const i=new rn(e,n);return r.ensNetwork!=null&&i.attachPlugin(new by(null,r.ensNetwork)),i.attachPlugin(new yy),(r.plugins||[]).forEach(o=>{i.attachPlugin(o)}),i};rn.register(e,s),rn.register(n,s),r.altNames&&r.altNames.forEach(i=>{rn.register(i,s)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[OP("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[OP("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function l2(t){return JSON.parse(JSON.stringify(t))}class yie{constructor(e){J(this,Nf);J(this,po);J(this,ss);J(this,Ca);J(this,Ai);I(this,po,e),I(this,ss,null),I(this,Ca,4e3),I(this,Ai,-2)}get pollingInterval(){return T(this,Ca)}set pollingInterval(e){I(this,Ca,e)}start(){T(this,ss)||(I(this,ss,T(this,po)._setTimeout(fe(this,Nf,fb).bind(this),T(this,Ca))),fe(this,Nf,fb).call(this))}stop(){T(this,ss)&&(T(this,po)._clearTimeout(T(this,ss)),I(this,ss,null))}pause(e){this.stop(),e&&I(this,Ai,-2)}resume(){this.start()}}po=new WeakMap,ss=new WeakMap,Ca=new WeakMap,Ai=new WeakMap,Nf=new WeakSet,fb=async function(){try{const e=await T(this,po).getBlockNumber();if(T(this,Ai)===-2){I(this,Ai,e);return}if(e!==T(this,Ai)){for(let n=T(this,Ai)+1;n<=e;n++){if(T(this,ss)==null)return;await T(this,po).emit("block",n)}I(this,Ai,e)}}catch{}T(this,ss)!=null&&I(this,ss,T(this,po)._setTimeout(fe(this,Nf,fb).bind(this),T(this,Ca)))};class u2{constructor(e){J(this,ou);J(this,au);J(this,Ea);I(this,ou,e),I(this,Ea,!1),I(this,au,n=>{this._poll(n,T(this,ou))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){T(this,Ea)||(I(this,Ea,!0),T(this,au).call(this,-2),T(this,ou).on("block",T(this,au)))}stop(){T(this,Ea)&&(I(this,Ea,!1),T(this,ou).off("block",T(this,au)))}pause(e){this.stop()}resume(){this.start()}}ou=new WeakMap,au=new WeakMap,Ea=new WeakMap;class bie extends u2{constructor(n,r){super(n);J(this,_f);J(this,mo);I(this,_f,r),I(this,mo,-2)}pause(n){n&&I(this,mo,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(T(this,_f));s!=null&&(T(this,mo)===-2?I(this,mo,s.number):s.number>T(this,mo)&&(r.emit(T(this,_f),s.number),I(this,mo,s.number)))}}_f=new WeakMap,mo=new WeakMap;class wie extends u2{constructor(n,r){super(n);J(this,sb);I(this,sb,l2(r))}async _poll(n,r){throw new Error("@TODO")}}sb=new WeakMap;class Aie extends u2{constructor(n,r){super(n);J(this,Rf);I(this,Rf,r)}async _poll(n,r){const s=await r.getTransactionReceipt(T(this,Rf));s&&r.emit(T(this,Rf),s)}}Rf=new WeakMap;class c2{constructor(e,n){J(this,ib);J(this,go);J(this,Pf);J(this,If);J(this,Sa);J(this,is);I(this,go,e),I(this,Pf,l2(n)),I(this,If,fe(this,ib,_L).bind(this)),I(this,Sa,!1),I(this,is,-2)}start(){T(this,Sa)||(I(this,Sa,!0),T(this,is)===-2&&T(this,go).getBlockNumber().then(e=>{I(this,is,e)}),T(this,go).on("block",T(this,If)))}stop(){T(this,Sa)&&(I(this,Sa,!1),T(this,go).off("block",T(this,If)))}pause(e){this.stop(),e&&I(this,is,-2)}resume(){this.start()}}go=new WeakMap,Pf=new WeakMap,If=new WeakMap,Sa=new WeakMap,is=new WeakMap,ib=new WeakSet,_L=async function(e){if(T(this,is)===-2)return;const n=l2(T(this,Pf));n.fromBlock=T(this,is)+1,n.toBlock=e;const r=await T(this,go).getLogs(n);if(r.length===0){T(this,is)<e-60&&I(this,is,e-60);return}for(const s of r)T(this,go).emit(T(this,Pf),s),I(this,is,s.blockNumber)};const vie=BigInt(2),xie=10;function wy(t){return t&&typeof t.then=="function"}function Ay(t,e){return t+":"+JSON.stringify(e,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const s=Object.keys(r);return s.sort(),s.reduce((i,o)=>(i[o]=r[o],i),{})}return r})}class vy{constructor(e){W(this,"name");Me(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function kie(t){return JSON.parse(JSON.stringify(t))}function f2(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function d2(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(St(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Ay("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Ay("orphan",n),filter:kie(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?f2(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(n.address){const s=[],i=[],o=a=>{St(a)?s.push(a):i.push((async()=>{s.push(await Qn(a,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),i.length&&await Promise.all(i),r.address=f2(s.map(a=>a.toLowerCase()))}return{filter:r,tag:Ay("event",r),type:"event"}}G(!1,"unknown ProviderEvent","event",t)}function h2(){return new Date().getTime()}const Cie={cacheTimeout:250,pollingInterval:4e3};class xy{constructor(e,n){J(this,st);J(this,Bn);J(this,Ta);J(this,Fn);J(this,Lf);J(this,Fr);J(this,lu);J(this,Da);J(this,yo);J(this,kp);J(this,as);J(this,Bf);J(this,Ff);if(I(this,Ff,Object.assign({},Cie,n||{})),e==="any")I(this,lu,!0),I(this,Fr,null);else if(e){const r=rn.from(e);I(this,lu,!1),I(this,Fr,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else I(this,lu,!1),I(this,Fr,null);I(this,yo,-1),I(this,Da,new Map),I(this,Bn,new Map),I(this,Ta,new Map),I(this,Fn,null),I(this,Lf,!1),I(this,kp,1),I(this,as,new Map),I(this,Bf,!1)}get pollingInterval(){return T(this,Ff).pollingInterval}get provider(){return this}get plugins(){return Array.from(T(this,Ta).values())}attachPlugin(e){if(T(this,Ta).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,Ta).set(e.name,e.connect(this)),this}getPlugin(e){return T(this,Ta).get(e)||null}get disableCcipRead(){return T(this,Bf)}set disableCcipRead(e){I(this,Bf,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const s=e.to.toLowerCase(),i=n.toLowerCase(),o=[];for(let a=0;a<r.length;a++){const l=r[a],u=l.replace("{sender}",s).replace("{data}",i),c=new Kn(u);l.indexOf("{data}")===-1&&(c.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:c,index:a,urls:r});let f="unknown error";const d=await c.send();try{const h=d.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:c,result:h}),h.data;h.message&&(f=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:c,result:h})}catch{}ee(d.statusCode<400||d.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ee(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new $se(uie(e),this)}_wrapLog(e,n){return new $h(aie(e),this)}_wrapTransactionReceipt(e,n){return new fP(hie(e),this)}_wrapTransactionResponse(e,n){return new Gh(TP(e),this)}_detectNetwork(){ee(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ee(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Qe(await fe(this,st,jr).call(this,{method:"getBlockNumber"}),"%response");return T(this,yo)>=0&&I(this,yo,e),e}_getAddress(e){return Qn(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(St(e))return St(e,32)?e:kl(e);if(typeof e=="bigint"&&(e=Qe(e,"blockTag")),typeof e=="number")return e>=0?kl(e):T(this,yo)>=0?kl(T(this,yo)+e):this.getBlockNumber().then(n=>kl(n+e));G(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?f2(l.map(u=>u.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,s=(l,u,c)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(u!=null||c!=null))throw new Error("invalid filter");const d={};return f&&(d.address=f),n.length&&(d.topics=n),u&&(d.fromBlock=u),c&&(d.toBlock=c),r&&(d.blockHash=r),d};let i=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)i.push(this._getAddress(l));else i.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),i.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(i),o,a]).then(l=>s(l[0],l[1],l[2])):s(i,o,a)}_getTransactionRequest(e){const n=fy(e),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const i=Qn(n[s],this);wy(i)?r.push(async function(){n[s]=await i}()):n[s]=i}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);wy(s)?r.push(async function(){n.blockTag=await s}()):n.blockTag=s}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(T(this,Fr)==null){const s=(async()=>{try{const i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw T(this,Fr)===s&&I(this,Fr,null),i}})();return I(this,Fr,s),(await s).clone()}const e=T(this,Fr),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(T(this,lu)?(this.emit("network",r,n),T(this,Fr)===e&&I(this,Fr,Promise.resolve(r))):ee(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:s,gasPrice:i,priorityFee:o}=await _n({_block:fe(this,st,$k).call(this,"latest",!1),gasPrice:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getGasPrice"});return Ee(c,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getPriorityFee"});return Ee(c,"%response")}catch{}return null})()});let a=null,l=null;const u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(l=o??BigInt("1000000000"),a=u.baseFeePerGas*vie+l),new cP(i,a,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new Kn(r.url),i=await r.processFunc(n,this,s);return new cP(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return wy(n)&&(n=await n),Ee(await fe(this,st,jr).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await _n({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await fe(this,st,zk).call(this,fe(this,st,Vk).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return Ee(await fe(this,st,Op).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Qe(await fe(this,st,Op).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return we(await fe(this,st,Op).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const s=Ee(n,"position");return we(await fe(this,st,Op).call(this,{method:"getStorage",position:s},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:s}=await _n({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=Vh.from(e);if(i.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:s}=await _n({network:this.getNetwork(),params:fe(this,st,$k).call(this,e,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(e){const{network:n,params:r}=await _n({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await _n({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await fe(this,st,jr).call(this,{method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await _n({network:this.getNetwork(),result:fe(this,st,jr).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:we(n)}async getLogs(e){let n=this._getFilter(e);wy(n)&&(n=await n);const{network:r,params:s}=await _n({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getLogs",filter:n})});return s.map(i=>this._wrapLog(i,r))}_getProvider(e){ee(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await my.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=gt(e);const n=$x(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await my.getEnsAddress(this),i=await new Uc(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(i==null||i===Rh)return null;const a=await new Uc(i,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(a)!==e?null:a}catch(r){if(gn(r,"BAD_DATA")&&r.value==="0x"||gn(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const s=n??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,o)=>{let a=null;const l=async u=>{try{const c=await this.getTransactionReceipt(e);if(c!=null&&u-c.blockNumber+1>=s){i(c),a&&(clearTimeout(a),a=null);return}}catch(c){console.log("EEE",c)}this.once("block",l)};r!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o(_t("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ee(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=T(this,as).get(e);n&&(n.timer&&clearTimeout(n.timer),T(this,as).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=Tp(this,kp)._++,s=()=>{T(this,as).delete(r),e()};if(this.paused)T(this,as).set(r,{timer:null,func:s,time:n});else{const i=setTimeout(s,n);T(this,as).set(r,{timer:i,func:s,time:h2()})}return r}_forEachSubscriber(e){for(const n of T(this,Bn).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new vy(e.type);case"block":{const n=new yie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new bie(this,e.type);case"event":return new c2(this,e.filter);case"transaction":return new Aie(this,e.hash);case"orphan":return new wie(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of T(this,Bn).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),T(this,Fn)!=null&&n.pause(T(this,Fn));break}}async on(e,n){const r=await fe(this,st,db).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,T(this,Fn)!=null&&r.subscriber.pause(T(this,Fn))),this}async once(e,n){const r=await fe(this,st,db).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,T(this,Fn)!=null&&r.subscriber.pause(T(this,Fn))),this}async emit(e,...n){const r=await fe(this,st,Mp).call(this,e,n);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:i,once:o})=>{const a=new K6(this,o?null:i,e);try{i.call(this,...n,a)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),T(this,Bn).delete(r.tag)),s>0}async listenerCount(e){if(e){const r=await fe(this,st,Mp).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of T(this,Bn).values())n+=r.length;return n}async listeners(e){if(e){const r=await fe(this,st,Mp).call(this,e);return r?r.listeners.map(({listener:s})=>s):[]}let n=[];for(const{listeners:r}of T(this,Bn).values())n=n.concat(r.map(({listener:s})=>s));return n}async off(e,n){const r=await fe(this,st,Mp).call(this,e);if(!r)return this;if(n){const s=r.listeners.map(({listener:i})=>i).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),T(this,Bn).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:s}=await fe(this,st,db).call(this,e);r&&s.stop(),T(this,Bn).delete(n)}else for(const[n,{started:r,subscriber:s}]of T(this,Bn))r&&s.stop(),T(this,Bn).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return T(this,Lf)}destroy(){this.removeAllListeners();for(const e of T(this,as).keys())this._clearTimeout(e);I(this,Lf,!0)}get paused(){return T(this,Fn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(I(this,yo,-1),T(this,Fn)!=null){if(T(this,Fn)==!!e)return;ee(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),I(this,Fn,!!e);for(const n of T(this,as).values())n.timer&&clearTimeout(n.timer),n.time=h2()-n.time}resume(){if(T(this,Fn)!=null){this._forEachSubscriber(e=>e.resume()),I(this,Fn,null);for(const e of T(this,as).values()){let n=e.time;n<0&&(n=0),e.time=h2(),setTimeout(e.func,n)}}}}Bn=new WeakMap,Ta=new WeakMap,Fn=new WeakMap,Lf=new WeakMap,Fr=new WeakMap,lu=new WeakMap,Da=new WeakMap,yo=new WeakMap,kp=new WeakMap,as=new WeakMap,Bf=new WeakMap,Ff=new WeakMap,st=new WeakSet,jr=async function(e){const n=T(this,Ff).cacheTimeout;if(n<0)return await this._perform(e);const r=Ay(e.method,e);let s=T(this,Da).get(r);return s||(s=this._perform(e),T(this,Da).set(r,s),setTimeout(()=>{T(this,Da).get(r)===s&&T(this,Da).delete(r)},n)),await s},Vk=async function(e,n,r){ee(r<xie,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:n,enableCcipRead:!0})});const s=fy(e);try{return we(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(i){if(!this.disableCcipRead&&lx(i)&&i.data&&r>=0&&n==="latest"&&s.to!=null&&Vt(i.data,0,4)==="0x556f1830"){const o=i.data,a=await Qn(s.to,this);let l;try{l=Oie(Vt(i.data,4))}catch(f){ee(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}ee(l.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const u=await this.ccipReadFetch(s,l.calldata,l.urls);ee(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:l.errorArgs}});const c={to:a,data:$t([l.selector,Die([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const f=await fe(this,st,Vk).call(this,c,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:f}),f}}throw i}},zk=async function(e){const{value:n}=await _n({network:this.getNetwork(),value:e});return n},Op=async function(e,n,r){let s=this._getAddress(n),i=this._getBlockTag(r);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await fe(this,st,zk).call(this,fe(this,st,jr).call(this,Object.assign(e,{address:s,blockTag:i})))},$k=async function(e,n){if(St(e,32))return await fe(this,st,jr).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await fe(this,st,jr).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},Mp=async function(e,n){let r=await d2(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await d2({orphan:"drop-log",log:n[0]},this)),T(this,Bn).get(r.tag)||null},db=async function(e){const n=await d2(e,this),r=n.tag;let s=T(this,Bn).get(r);return s||(s={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},T(this,Bn).set(r,s)),s};function Eie(t,e){try{const n=p2(t,e);if(n)return Sc(n)}catch{}return null}function p2(t,e){if(t==="0x")return null;try{const n=Qe(Vt(t,e,e+32)),r=Qe(Vt(t,n,n+32));return Vt(t,n+32,n+32+r)}catch{}return null}function NP(t){const e=Wn(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function Sie(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Tie=new Uint8Array([]);function Die(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(Tie),n+=32;for(let r=0;r<t.length;r++){const s=ct(t[r]);e[r]=NP(n),e.push(NP(s.length)),e.push(Sie(s)),n+=32+Math.ceil(s.length/32)*32}return $t(e)}const _P="0x0000000000000000000000000000000000000000000000000000000000000000";function Oie(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};ee(Cc(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Vt(t,0,32);ee(Vt(n,0,12)===Vt(_P,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Vt(n,12);try{const r=[],s=Qe(Vt(t,32,64)),i=Qe(Vt(t,s,s+32)),o=Vt(t,s+32);for(let a=0;a<i;a++){const l=Eie(o,a*32);if(l==null)throw new Error("abort");r.push(l)}e.urls=r}catch{ee(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=p2(t,64);if(r==null)throw new Error("abort");e.calldata=r}catch{ee(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}ee(Vt(t,100,128)===Vt(_P,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Vt(t,96,100);try{const r=p2(t,128);if(r==null)throw new Error("abort");e.extraData=r}catch{ee(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>e[r]),e}function Vc(t,e){if(t.provider)return t.provider;ee(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function RP(t,e){let n=fy(e);if(n.to!=null&&(n.to=Qn(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),Qn(r,t)]).then(([s,i])=>(G(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else n.from=t.getAddress();return await _n(n)}class Mie{constructor(e){W(this,"provider");Me(this,{provider:e||null})}async getNonce(e){return Vc(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await RP(this,e)}async populateTransaction(e){const n=Vc(this,"populateTransaction"),r=await RP(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const o=Ee(r.chainId);G(o===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=s.chainId;const i=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||i)?G(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&i&&G(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ee(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ee(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ee(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await _n(r)}async estimateGas(e){return Vc(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Vc(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Vc(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Vc(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const s=Vh.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}}const PP=new Set;function zc(t){PP.has(t)||(PP.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}function Nie(t){return JSON.parse(JSON.stringify(t))}class IP{constructor(e){J(this,Ma);J(this,Yn);J(this,vi);J(this,uu);J(this,Oa);J(this,cu);J(this,jf);I(this,Yn,e),I(this,vi,null),I(this,uu,fe(this,Ma,Gk).bind(this)),I(this,Oa,!1),I(this,cu,null),I(this,jf,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){T(this,Oa)||(I(this,Oa,!0),fe(this,Ma,Gk).call(this,-2))}stop(){T(this,Oa)&&(I(this,Oa,!1),I(this,jf,!0),fe(this,Ma,Wk).call(this),T(this,Yn).off("block",T(this,uu)))}pause(e){e&&fe(this,Ma,Wk).call(this),T(this,Yn).off("block",T(this,uu))}resume(){this.start()}}Yn=new WeakMap,vi=new WeakMap,uu=new WeakMap,Oa=new WeakMap,cu=new WeakMap,jf=new WeakMap,Ma=new WeakSet,Gk=async function(e){try{T(this,vi)==null&&I(this,vi,this._subscribe(T(this,Yn)));let n=null;try{n=await T(this,vi)}catch(i){if(!gn(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(n==null){I(this,vi,null),T(this,Yn)._recoverSubscriber(this,this._recover(T(this,Yn)));return}const r=await T(this,Yn).getNetwork();if(T(this,cu)||I(this,cu,r),T(this,cu).chainId!==r.chainId)throw new Error("chaid changed");if(T(this,jf))return;const s=await T(this,Yn).send("eth_getFilterChanges",[n]);await this._emitResults(T(this,Yn),s)}catch(n){console.log("@TODO",n)}T(this,Yn).once("block",T(this,uu))},Wk=function(){const e=T(this,vi);e&&(I(this,vi,null),e.then(n=>{T(this,Yn).destroyed||T(this,Yn).send("eth_uninstallFilter",[n])}))};class _ie extends IP{constructor(n,r){super(n);J(this,fu);I(this,fu,Nie(r))}_recover(n){return new c2(n,T(this,fu))}async _subscribe(n){return await n.send("eth_newFilter",[T(this,fu)])}async _emitResults(n,r){for(const s of r)n.emit(T(this,fu),n._wrapLog(s,n._network))}}fu=new WeakMap;class Rie extends IP{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const Pie="bigint,boolean,function,number,string,symbol".split(/,/g);function ky(t){if(t==null||Pie.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(ky);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Iie(t){return new Promise(e=>{setTimeout(e,t)})}function $c(t){return t&&t.toLowerCase()}function LP(t){return t&&typeof t.pollingInterval=="number"}const BP={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class m2 extends Mie{constructor(n,r){super(n);W(this,"address");r=gt(r),Me(this,{address:r})}connect(n){ee(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=ky(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const a=await Qn(o,this.provider);G(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a})())}else r.from=this.address;if(r.gasLimit==null&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;s.push((async()=>{r.to=await Qn(o,this.provider)})())}s.length&&await Promise.all(s);const i=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(n);return await new Promise((i,o)=>{const a=[1e3,100];let l=0;const u=async()=>{try{const c=await this.provider.getTransaction(s);if(c!=null){i(c.replaceableTransaction(r));return}}catch(c){if(gn(c,"CANCELLED")||gn(c,"BAD_DATA")||gn(c,"NETWORK_ERROR")){c.info==null&&(c.info={}),c.info.sendTransactionHash=s,o(c);return}if(gn(c,"INVALID_ARGUMENT")&&(l++,c.info==null&&(c.info={}),c.info.sendTransactionHash=s,l>10)){o(c);return}this.provider.emit("error",_t("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:c}))}this.provider._setTimeout(()=>{u()},a.pop()||4e3)};u()})}async signTransaction(n){const r=ky(n);if(r.from){const i=await Qn(r.from,this.provider);G(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=i}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(n){const r=typeof n=="string"?Vi(n):n;return await this.provider.send("personal_sign",[we(r),this.address.toLowerCase()])}async signTypedData(n,r,s){const i=ky(s),o=await ly.resolveNames(n,r,i,async a=>{const l=await Qn(a);return G(l!=null,"TypedData does not support null address","value",a),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(ly.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?Vi(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),we(r)])}}class FP extends xy{constructor(n,r){super(n,r);J(this,Cp);J(this,du);J(this,Uf);J(this,bo);J(this,xi);J(this,Rs);J(this,ls);J(this,mr);I(this,Uf,1),I(this,du,Object.assign({},BP,r||{})),I(this,bo,[]),I(this,xi,null),I(this,ls,null),I(this,mr,null);{let i=null;const o=new Promise(a=>{i=a});I(this,Rs,{promise:o,resolve:i})}const s=this._getOption("staticNetwork");typeof s=="boolean"?(G(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&I(this,ls,rn.from(n))):s&&(G(n==null||s.matches(n),"staticNetwork MUST match network object","options",r),I(this,ls,s))}_getOption(n){return T(this,du)[n]}get _network(){return ee(T(this,ls),"network is not available yet","NETWORK_ERROR"),T(this,ls)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let s=n.transaction;if(s&&s.type!=null&&Ee(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},s,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(T(this,ls))return T(this,ls)}else return n;return T(this,mr)?await T(this,mr):this.ready?(I(this,mr,(async()=>{try{const r=rn.from(Ee(await this.send("eth_chainId",[])));return I(this,mr,null),r}catch(r){throw I(this,mr,null),r}})()),await T(this,mr)):(I(this,mr,(async()=>{const r={id:Tp(this,Uf)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let s;try{s=(await this._send(r))[0],I(this,mr,null)}catch(i){throw I(this,mr,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return rn.from(Ee(s.result));throw this.getRpcError(r,s)})()),await T(this,mr))}_start(){T(this,Rs)==null||T(this,Rs).resolve==null||(T(this,Rs).resolve(),I(this,Rs,null),(async()=>{for(;T(this,ls)==null&&!this.destroyed;)try{I(this,ls,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",_t("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Iie(1e3)}fe(this,Cp,Kk).call(this)})())}async _waitUntilReady(){if(T(this,Rs)!=null)return await T(this,Rs).promise}_getSubscriber(n){return n.type==="pending"?new Rie(this):n.type==="event"?this._getOption("polling")?new c2(this,n.filter):new _ie(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new vy("orphan"):super._getSubscriber(n)}get ready(){return T(this,Rs)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(n[s]==null)return;let i=s;s==="gasLimit"&&(i="gas"),r[i]=kl(Ee(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=we(n[s]))}),n.accessList&&(r.accessList=oa(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(s=>s.toLowerCase())),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[$c(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[$c(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[$c(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[$c(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map($c):n.filter.address=$c(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:s}=n,{error:i}=r;if(s==="eth_estimateGas"&&i.message){const l=i.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return _t("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){const l=g2(i),u=Fc.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return u.info={error:i,payload:n},u}const o=JSON.stringify(Bie(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return _t("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[s]||"unknown",reason:"rejected",info:{payload:n,error:i}});if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return _t("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return _t("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return _t("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:i}});if(o.match(/only replay-protected/i))return _t("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:l,info:{error:i}}})}let a=!!o.match(/the method .* does not exist/i);return a||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(a=!0),a?_t("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:i,payload:n}}):_t("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=Tp(this,Uf)._++,i=new Promise((o,a)=>{T(this,bo).push({resolve:o,reject:a,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return fe(this,Cp,Kk).call(this),i}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const i=await r;if(n>=i.length)throw new Error("no such account");return new m2(this,i[n])}const{accounts:s}=await _n({network:this.getNetwork(),accounts:r});n=gt(n);for(const i of s)if(gt(i)===n)return new m2(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new m2(this,r))}destroy(){T(this,xi)&&(clearTimeout(T(this,xi)),I(this,xi,null));for(const{payload:n,reject:r}of T(this,bo))r(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));I(this,bo,[]),super.destroy()}}du=new WeakMap,Uf=new WeakMap,bo=new WeakMap,xi=new WeakMap,Rs=new WeakMap,ls=new WeakMap,mr=new WeakMap,Cp=new WeakSet,Kk=function(){if(T(this,xi))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");I(this,xi,setTimeout(()=>{I(this,xi,null);const r=T(this,bo);for(I(this,bo,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==T(this,du).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(o=>o.payload)).length>T(this,du).batchMaxSize){r.unshift(s.pop());break}(async()=>{const i=s.length===1?s[0].payload:s.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const o=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:l,payload:u}of s){if(this.destroyed){l(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const c=o.filter(f=>f.id===u.id)[0];if(c==null){const f=_t("missing response for request","BAD_DATA",{value:o,info:{payload:u}});this.emit("error",f),l(f);continue}if("error"in c){l(this.getRpcError(u,c));continue}a(c.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of s)a(o)}})()}},n))};class Lie extends FP{constructor(n,r){super(n,r);J(this,Na);let s=this._getOption("pollingInterval");s==null&&(s=BP.pollingInterval),I(this,Na,s)}_getSubscriber(n){const r=super._getSubscriber(n);return LP(r)&&(r.pollingInterval=T(this,Na)),r}get pollingInterval(){return T(this,Na)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");I(this,Na,n),this._forEachSubscriber(r=>{LP(r)&&(r.pollingInterval=T(this,Na))})}}Na=new WeakMap;class Ji extends Lie{constructor(n,r,s){n==null&&(n="http://localhost:8545");super(r,s);J(this,Hf);typeof n=="string"?I(this,Hf,new Kn(n)):I(this,Hf,n.clone())}_getConnection(){return T(this,Hf).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const s=await r.send();s.assertOk();let i=s.bodyJson;return Array.isArray(i)||(i=[i]),i}}Hf=new WeakMap;function g2(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&St(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=g2(t[e]);if(n)return n}return null}if(typeof t=="string")try{return g2(JSON.parse(t))}catch{}return null}function y2(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)y2(t[n],e);if(typeof t=="string")try{return y2(JSON.parse(t),e)}catch{}}}function Bie(t){const e=[];return y2(t,e),e}const Cy="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Fie(t){switch(t){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}G(!1,"unsupported network","network",t)}class Ey extends Ji{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Cy);const i={polling:!0,staticNetwork:s},o=Ey.getRequest(s,r);super(o,s,i);W(this,"apiKey");Me(this,{apiKey:r})}_getProvider(n){try{return new Ey(n,this.apiKey)}catch{}return super._getProvider(n)}static getRequest(n,r){r==null&&(r=Cy);const s=new Kn(`https://${Fie(n.name)}/${r}`);return s.allowGzip=!0,r===Cy&&(s.retryFunc=async(i,o,a)=>(zc("AnkrProvider"),!0)),s}getRpcError(n,r){return n.method==="eth_sendRawTransaction"&&r&&r.error&&r.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(r.error.message="replacement transaction underpriced"),super.getRpcError(n,r)}isCommunityResource(){return this.apiKey===Cy}}const Sy="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function jie(t){switch(t){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}G(!1,"unsupported network","network",t)}class Ty extends Ji{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Sy);const i=Ty.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Me(this,{apiKey:r})}_getProvider(n){try{return new Ty(n,this.apiKey)}catch{}return super._getProvider(n)}async _perform(n){if(n.method==="getTransactionResult"){const{trace:r,tx:s}=await _n({trace:this.send("trace_transaction",[n.hash]),tx:this.getTransaction(n.hash)});if(r==null||s==null)return null;let i,o=!1;try{i=r[0].result.output,o=r[0].error==="Reverted"}catch{}if(i)return ee(!o,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:s,invocation:null,revert:null}),i;ee(!1,"could not parse trace result","BAD_DATA",{value:r})}return await super._perform(n)}isCommunityResource(){return this.apiKey===Sy}static getRequest(n,r){r==null&&(r=Sy);const s=new Kn(`https://${jie(n.name)}/v2/${r}`);return s.allowGzip=!0,r===Sy&&(s.retryFunc=async(i,o,a)=>(zc("alchemy"),!0)),s}}function Dy(t){switch(t){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}G(!1,"unsupported network","network",t)}function Uie(t){switch(t){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}G(!1,"unsupported network","network",t)}class Oy extends Ji{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Dy(s.name));const i=Oy.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Me(this,{apiKey:r})}_getProvider(n){try{return new Oy(n,this.apiKey)}catch{}return super._getProvider(n)}isCommunityResource(){return this.apiKey===Dy(this._network.name)}static getRequest(n,r){r==null&&(r=Dy(n.name));const s=new Kn(`https://${Uie(n.name)}/${r}`);return s.allowGzip=!0,r===Dy(n.name)&&(s.retryFunc=async(i,o,a)=>(zc("ChainstackProvider"),!0)),s}}class Hie extends Ji{constructor(e){e==null&&(e="mainnet");const n=rn.from(e);G(n.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",n,{staticNetwork:n})}}const jP=2e3;function Vie(t){return t&&typeof t.then=="function"}const zie="org.ethers.plugins.provider.Etherscan",$ie=["enableCcipRead"];let Gie=1;class Wie extends xy{constructor(n,r){const s=r??null;super();W(this,"network");W(this,"apiKey");J(this,Vf);const i=rn.from(n);I(this,Vf,i.getPlugin(zie)),Me(this,{apiKey:s,network:i}),this.getBaseUrl()}getBaseUrl(){if(T(this,Vf))return T(this,Vf).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}G(!1,"unsupported network","network",this.network)}getUrl(n,r){const s=Object.keys(r).reduce((o,a)=>{const l=r[a];return l!=null&&(o+=`&${a}=${l}`),o},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${n}${s}${i}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(n,r){return r.module=n,r.apikey=this.apiKey,r}async detectNetwork(){return this.network}async fetch(n,r,s){const i=Gie++,o=s?this.getPostUrl():this.getUrl(n,r),a=s?this.getPostData(n,r):null;this.emit("debug",{action:"sendRequest",id:i,url:o,payload:a});const l=new Kn(o);l.setThrottleParams({slotInterval:1e3}),l.retryFunc=(f,d,h)=>(this.isCommunityResource()&&zc("Etherscan"),Promise.resolve(!0)),l.processFunc=async(f,d)=>{const h=d.hasBody()?JSON.parse(Sc(d.body)):{},p=(typeof h.result=="string"?h.result:"").toLowerCase().indexOf("rate limit")>=0;return n==="proxy"?h&&h.status==0&&h.message=="NOTOK"&&p&&(this.emit("debug",{action:"receiveError",id:i,reason:"proxy-NOTOK",error:h}),d.throwThrottleError(h.result,jP)):p&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),d.throwThrottleError(h.result,jP)),d},a&&(l.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),l.body=Object.keys(a).map(f=>`${f}=${a[f]}`).join("&"));const u=await l.send();try{u.assertOk()}catch(f){this.emit("debug",{action:"receiveError",id:i,error:f,reason:"assertOk"}),ee(!1,"response error","SERVER_ERROR",{request:l,response:u})}u.hasBody()||(this.emit("debug",{action:"receiveError",id:i,error:"missing body",reason:"null body"}),ee(!1,"missing response","SERVER_ERROR",{request:l,response:u}));const c=JSON.parse(Sc(u.body));return n==="proxy"?(c.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:i,result:c,reason:"invalid JSON-RPC"}),ee(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:l,response:u,info:{result:c}})),c.error&&(this.emit("debug",{action:"receiveError",id:i,result:c,reason:"JSON-RPC error"}),ee(!1,"error response","SERVER_ERROR",{request:l,response:u,info:{result:c}})),this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result):c.status==0&&(c.message==="No records found"||c.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result):((c.status!=1||typeof c.message=="string"&&!c.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:i,result:c}),ee(!1,"error response","SERVER_ERROR",{request:l,response:u,info:{result:c}})),this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result)}_getTransactionPostData(n){const r={};for(let s in n){if($ie.indexOf(s)>=0||n[s]==null)continue;let i=n[s];if(!(s==="type"&&i===0)&&!(s==="blockTag"&&i==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[s])i=kl(i);else if(s==="accessList")i="["+oa(i).map(o=>`{address:"${o.address}",storageKeys:["${o.storageKeys.join('","')}"]}`).join(",")+"]";else if(s==="blobVersionedHashes"){if(i.length===0)continue;ee(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:n}})}else i=we(i);r[s]=i}}return r}_checkError(n,r,s){let i="";if(gn(r,"SERVER_ERROR")){try{i=r.info.result.error.message}catch{}if(!i)try{i=r.info.message}catch{}}if(n.method==="estimateGas"&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&ee(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.transaction}),(n.method==="call"||n.method==="estimateGas")&&i.match(/execution reverted/i)){let o="";try{o=r.info.result.error.data}catch{}const a=Fc.getBuiltinCallException(n.method,n.transaction,o);throw a.info={request:n,error:r},a}if(i&&n.method==="broadcastTransaction"){const o=Vh.from(n.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&ee(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:o}),i.match(/insufficient funds/)&&ee(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:o}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ee(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:o})}throw r}async _detectNetwork(){return this.network}async _perform(n){switch(n.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:n.address,tag:n.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:n.address,tag:n.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:n.address,tag:n.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:n.address,position:n.position,tag:n.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:n.signedTransaction},!0).catch(r=>this._checkError(n,r,n.signedTransaction));case"getBlock":if("blockTag"in n)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:n.blockTag,boolean:n.includeTransactions?"true":"false"});ee(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:n.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:n.hash});case"call":{if(n.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const r=this._getTransactionPostData(n.transaction);r.module="proxy",r.action="eth_call";try{return await this.fetch("proxy",r,!0)}catch(s){return this._checkError(n,s,n.transaction)}}case"estimateGas":{const r=this._getTransactionPostData(n.transaction);r.module="proxy",r.action="eth_estimateGas";try{return await this.fetch("proxy",r,!0)}catch(s){return this._checkError(n,s,n.transaction)}}}return super._perform(n)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(n){let r=this._getAddress(n);Vie(r)&&(r=await r);try{const s=await this.fetch("contract",{action:"getabi",address:r}),i=JSON.parse(s);return new Uc(r,i,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}}Vf=new WeakMap;function Kie(){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 qie=Kie().WebSocket;class b2{constructor(e,n){J(this,ki);J(this,Ep);J(this,_a);J(this,hu);J(this,Ra);I(this,ki,e),I(this,Ep,JSON.stringify(n)),I(this,_a,null),I(this,hu,null),I(this,Ra,null)}get filter(){return JSON.parse(T(this,Ep))}start(){I(this,_a,T(this,ki).send("eth_subscribe",this.filter).then(e=>(T(this,ki)._register(e,this),e)))}stop(){T(this,_a).then(e=>{T(this,ki).destroyed||T(this,ki).send("eth_unsubscribe",[e])}),I(this,_a,null)}pause(e){ee(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),I(this,hu,!!e)}resume(){I(this,hu,null)}_handleMessage(e){if(T(this,_a)!=null&&T(this,hu)===null){let n=T(this,Ra);n==null?n=this._emit(T(this,ki),e):n=n.then(async()=>{await this._emit(T(this,ki),e)}),I(this,Ra,n.then(()=>{T(this,Ra)===n&&I(this,Ra,null)}))}}async _emit(e,n){throw new Error("sub-classes must implemente this; _emit")}}ki=new WeakMap,Ep=new WeakMap,_a=new WeakMap,hu=new WeakMap,Ra=new WeakMap;class Qie extends b2{constructor(e){super(e,["newHeads"])}async _emit(e,n){e.emit("block",parseInt(n.number))}}class Jie extends b2{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,n){e.emit("pending",n)}}class Yie extends b2{constructor(n,r){super(n,["logs",r]);J(this,Sp);I(this,Sp,JSON.stringify(r))}get logFilter(){return JSON.parse(T(this,Sp))}async _emit(n,r){n.emit(this.logFilter,n._wrapLog(r,n._network))}}Sp=new WeakMap;class Xie extends FP{constructor(n,r){const s=Object.assign({},r??{});G(s.batchMaxCount==null||s.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",r),s.batchMaxCount=1,s.staticNetwork==null&&(s.staticNetwork=!0);super(n,s);J(this,pu);J(this,zf);J(this,Pa);I(this,pu,new Map),I(this,zf,new Map),I(this,Pa,new Map)}_getSubscriber(n){switch(n.type){case"close":return new vy("close");case"block":return new Qie(this);case"pending":return new Jie(this);case"event":return new Yie(this,n.filter);case"orphan":if(n.filter.orphan==="drop-log")return new vy("drop-log")}return super._getSubscriber(n)}_register(n,r){T(this,zf).set(n,r);const s=T(this,Pa).get(n);if(s){for(const i of s)r._handleMessage(i);T(this,Pa).delete(n)}}async _send(n){G(!Array.isArray(n),"WebSocket does not support batch send","payload",n);const r=new Promise((s,i)=>{T(this,pu).set(n.id,{payload:n,resolve:s,reject:i})});return await this._waitUntilReady(),await this._write(JSON.stringify(n)),[await r]}async _processMessage(n){const r=JSON.parse(n);if(r&&typeof r=="object"&&"id"in r){const s=T(this,pu).get(r.id);if(s==null){this.emit("error",_t("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:r}));return}T(this,pu).delete(r.id),s.resolve(r)}else if(r&&r.method==="eth_subscription"){const s=r.params.subscription,i=T(this,zf).get(s);if(i)i._handleMessage(r.params.result);else{let o=T(this,Pa).get(s);o==null&&(o=[],T(this,Pa).set(s,o)),o.push(r.params.result)}}else{this.emit("error",_t("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:r}));return}}async _write(n){throw new Error("sub-classes must override this")}}pu=new WeakMap,zf=new WeakMap,Pa=new WeakMap;class UP extends Xie{constructor(n,r,s){super(r,s);J(this,mu);J(this,Ps);typeof n=="string"?(I(this,mu,()=>new qie(n)),I(this,Ps,T(this,mu).call(this))):typeof n=="function"?(I(this,mu,n),I(this,Ps,n())):(I(this,mu,null),I(this,Ps,n)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(i){console.log("failed to start WebsocketProvider",i)}},this.websocket.onmessage=i=>{this._processMessage(i.data)}}get websocket(){if(T(this,Ps)==null)throw new Error("websocket closed");return T(this,Ps)}async _write(n){this.websocket.send(n)}async destroy(){T(this,Ps)!=null&&(T(this,Ps).close(),I(this,Ps,null)),super.destroy()}}mu=new WeakMap,Ps=new WeakMap;const Qh="84842078b09946638c03157f83405213";function Zie(t){switch(t){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}G(!1,"unsupported network","network",t)}class eoe extends UP{constructor(n,r){const s=new Jh(n,r),i=s._getConnection();ee(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const o=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,s._network);W(this,"projectId");W(this,"projectSecret");Me(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===Qh}}class Jh extends Ji{constructor(n,r,s){n==null&&(n="mainnet");const i=rn.from(n);r==null&&(r=Qh),s==null&&(s=null);const o=Jh.getRequest(i,r,s);super(o,i,{staticNetwork:i});W(this,"projectId");W(this,"projectSecret");Me(this,{projectId:r,projectSecret:s})}_getProvider(n){try{return new Jh(n,this.projectId,this.projectSecret)}catch{}return super._getProvider(n)}isCommunityResource(){return this.projectId===Qh}static getWebSocketProvider(n,r){return new eoe(n,r)}static getRequest(n,r,s){r==null&&(r=Qh),s==null&&(s=null);const i=new Kn(`https://${Zie(n.name)}/v3/${r}`);return i.allowGzip=!0,s&&i.setCredentials("",s),r===Qh&&(i.retryFunc=async(o,a,l)=>(zc("InfuraProvider"),!0)),i}}const My="919b412a057b5e9c9b6dce193c5a60242d6efadb";function toe(t){switch(t){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}G(!1,"unsupported network","network",t)}class Ny extends Ji{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=My);const i=Ny.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"token");Me(this,{token:r})}_getProvider(n){try{return new Ny(n,this.token)}catch{}return super._getProvider(n)}isCommunityResource(){return this.token===My}static getRequest(n,r){r==null&&(r=My);const s=new Kn(`https://${toe(n.name)}/${r}`);return s.allowGzip=!0,r===My&&(s.retryFunc=async(i,o,a)=>(zc("QuickNodeProvider"),!0)),s}}const noe=BigInt("1"),roe=BigInt("2");function soe(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}}function ioe(t){return new Promise(e=>{setTimeout(e,t)})}function w2(){return new Date().getTime()}function A2(t){return JSON.stringify(t,(e,n)=>typeof n=="bigint"?{type:"bigint",value:n.toString()}:n)}const HP={stallTimeout:400,priority:1,weight:1},VP={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function ooe(t,e){for(;(t.blockNumber<0||t.blockNumber<e)&&(t._updateNumber||(t._updateNumber=(async()=>{try{const n=await t.provider.getBlockNumber();n>t.blockNumber&&(t.blockNumber=n)}catch(n){t.blockNumber=-2,t._lastFatalError=n,t._lastFatalErrorTimestamp=w2()}t._updateNumber=null})()),await t._updateNumber,t.outOfSync++,!t._lastFatalError););}function Yh(t){if(t==null)return"null";if(Array.isArray(t))return"["+t.map(Yh).join(",")+"]";if(typeof t=="object"&&typeof t.toJSON=="function")return Yh(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":case"number":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{"+e.map(n=>`${JSON.stringify(n)}:${Yh(t[n])}`).join(",")+"}"}}throw console.log("Could not serialize",t),new Error("Hmm...")}function v2(t){if("error"in t){const n=t.error;return{tag:Yh(n),value:n}}const e=t.result;return{tag:Yh(e),value:e}}function _y(t,e){const n=new Map;for(const{value:s,tag:i,weight:o}of e){const a=n.get(i)||{value:s,weight:0};a.weight+=o,n.set(i,a)}let r=null;for(const s of n.values())s.weight>=t&&(!r||s.weight>r.weight)&&(r=s);if(r)return r.value}function x2(t,e){let n=0;const r=new Map;let s=null;const i=[];for(const{value:a,tag:l,weight:u}of e)if(a instanceof Error){const c=r.get(l)||{value:a,weight:0};c.weight+=u,r.set(l,c),(s==null||c.weight>s.weight)&&(s=c)}else i.push(BigInt(a)),n+=u;if(n<t)return s&&s.weight>=t?s.value:void 0;i.sort((a,l)=>a<l?-1:l>a?1:0);const o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o]+noe)/roe}function k2(t,e){const n=_y(t,e);if(n!==void 0)return n;for(const r of e)if(r.value)return r.value}function aoe(t,e){if(t===1)return Qe(x2(t,e),"%internal");const n=new Map,r=(o,a)=>{const l=n.get(o)||{result:o,weight:0};l.weight+=a,n.set(o,l)};for(const{weight:o,value:a}of e){const l=Qe(a);r(l-1,o),r(l,o),r(l+1,o)}let s=0,i;for(const{weight:o,result:a}of n.values())o>=t&&(o>s||i!=null&&o===s&&a>i)&&(s=o,i=a);return i}class loe extends xy{constructor(n,r,s){super(r,s);J(this,yr);W(this,"quorum");W(this,"eventQuorum");W(this,"eventWorkers");J(this,gr);J(this,wo);J(this,$f);I(this,gr,n.map(i=>i instanceof xy?Object.assign({provider:i},HP,VP):Object.assign({},HP,i,VP))),I(this,wo,-2),I(this,$f,null),s&&s.quorum!=null?this.quorum=s.quorum:this.quorum=Math.ceil(T(this,gr).reduce((i,o)=>(i+=o.weight,i),0)/2),this.eventQuorum=1,this.eventWorkers=1,G(this.quorum<=T(this,gr).reduce((i,o)=>i+o.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return T(this,gr).map(n=>{const r=Object.assign({},n);for(const s in r)s[0]==="_"&&delete r[s];return r})}async _detectNetwork(){return rn.from(Ee(await this._perform({method:"chainId"})))}async _translatePerform(n,r){switch(r.method){case"broadcastTransaction":return await n.broadcastTransaction(r.signedTransaction);case"call":return await n.call(Object.assign({},r.transaction,{blockTag:r.blockTag}));case"chainId":return(await n.getNetwork()).chainId;case"estimateGas":return await n.estimateGas(r.transaction);case"getBalance":return await n.getBalance(r.address,r.blockTag);case"getBlock":{const s="blockHash"in r?r.blockHash:r.blockTag;return await n.getBlock(s,r.includeTransactions)}case"getBlockNumber":return await n.getBlockNumber();case"getCode":return await n.getCode(r.address,r.blockTag);case"getGasPrice":return(await n.getFeeData()).gasPrice;case"getPriorityFee":return(await n.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await n.getLogs(r.filter);case"getStorage":return await n.getStorage(r.address,r.position,r.blockTag);case"getTransaction":return await n.getTransaction(r.hash);case"getTransactionCount":return await n.getTransactionCount(r.address,r.blockTag);case"getTransactionReceipt":return await n.getTransactionReceipt(r.hash);case"getTransactionResult":return await n.getTransactionResult(r.hash)}}async _perform(n){if(n.method==="broadcastTransaction"){const o=T(this,gr).map(u=>null),a=T(this,gr).map(async({provider:u,weight:c},f)=>{try{const d=await u._perform(n);o[f]=Object.assign(v2({result:d}),{weight:c})}catch(d){o[f]=Object.assign(v2({error:d}),{weight:c})}});for(;;){const u=o.filter(d=>d!=null);for(const{value:d}of u)if(!(d instanceof Error))return d;const c=_y(this.quorum,o.filter(d=>d!=null));if(gn(c,"INSUFFICIENT_FUNDS"))throw c;const f=a.filter((d,h)=>o[h]==null);if(f.length===0)break;await Promise.race(f)}const l=k2(this.quorum,o);if(ee(l!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:n,results:o.map(A2)}}),l instanceof Error)throw l;return l}await fe(this,yr,PL).call(this);const r=new Set;let s=0;for(;;){const o=fe(this,yr,qk).call(this,r,n);if(o==null||(s+=o.config.weight,s>=this.quorum))break}const i=await fe(this,yr,Qk).call(this,r,n);for(const o of r)o.perform&&o.result==null&&o.config.lateResponses++;return i}async destroy(){for(const{provider:n}of T(this,gr))n.destroy();super.destroy()}}gr=new WeakMap,wo=new WeakMap,$f=new WeakMap,yr=new WeakSet,RL=function(n){const r=Array.from(n).map(i=>i.config),s=T(this,gr).slice();soe(s),s.sort((i,o)=>i.priority-o.priority);for(const i of s)if(!i._lastFatalError&&r.indexOf(i)===-1)return i;return null},qk=function(n,r){const s=fe(this,yr,RL).call(this,n);if(s==null)return null;const i={config:s,result:null,didBump:!1,perform:null,staller:null},o=w2();return i.perform=(async()=>{try{s.requests++;const l=await this._translatePerform(s.provider,r);i.result={result:l}}catch(l){s.errorResponses++,i.result={error:l}}const a=w2()-o;s._totalTime+=a,s.rollingDuration=.95*s.rollingDuration+.05*a,i.perform=null})(),i.staller=(async()=>{await ioe(s.stallTimeout),i.staller=null})(),n.add(i),i},PL=async function(){let n=T(this,$f);if(!n){const r=[];T(this,gr).forEach(s=>{r.push((async()=>{await ooe(s,0),s._lastFatalError||(s._network=await s.provider.getNetwork())})())}),I(this,$f,n=(async()=>{await Promise.all(r);let s=null;for(const i of T(this,gr)){if(i._lastFatalError)continue;const o=i._network;s==null?s=o.chainId:o.chainId!==s&&ee(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await n},IL=async function(n,r){const s=[];for(const i of n)if(i.result!=null){const{tag:o,value:a}=v2(i.result);s.push({tag:o,value:a,weight:i.config.weight})}if(!(s.reduce((i,o)=>i+o.weight,0)<this.quorum)){switch(r.method){case"getBlockNumber":{T(this,wo)===-2&&I(this,wo,Math.ceil(Qe(x2(this.quorum,T(this,gr).filter(o=>!o._lastFatalError).map(o=>({value:o.blockNumber,tag:Qe(o.blockNumber).toString(),weight:o.weight}))))));const i=aoe(this.quorum,s);return i===void 0?void 0:(i>T(this,wo)&&I(this,wo,i),T(this,wo))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return x2(this.quorum,s);case"getBlock":return"blockTag"in r&&r.blockTag==="pending"?k2(this.quorum,s):_y(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return _y(this.quorum,s);case"broadcastTransaction":return k2(this.quorum,s)}ee(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${A2(r.method)})`})}},Qk=async function(n,r){if(n.size===0)throw new Error("no runners?!");const s=[];let i=0;for(const a of n){if(a.perform&&s.push(a.perform),a.staller){s.push(a.staller);continue}a.didBump||(a.didBump=!0,i++)}const o=await fe(this,yr,IL).call(this,n,r);if(o!==void 0){if(o instanceof Error)throw o;return o}for(let a=0;a<i;a++)fe(this,yr,qk).call(this,n,r);return ee(s.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:r,results:Array.from(n).map(a=>A2(a.result))}}),await Promise.race(s),await fe(this,yr,Qk).call(this,n,r)};function uoe(t){return t&&typeof t.send=="function"&&typeof t.close=="function"}const coe="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function foe(t,e){e==null&&(e={});const n=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof t=="string"&&t.match(/^https?:/))return new Ji(t);if(typeof t=="string"&&t.match(/^wss?:/)||uoe(t))return new UP(t);let r=null;try{r=rn.from(t)}catch{}const s=[];if(n("publicPolygon")&&r&&(r.name==="matic"?s.push(new Ji("https://polygon-rpc.com/",r,{staticNetwork:r})):r.name==="matic-amoy"&&s.push(new Ji("https://rpc-amoy.polygon.technology/",r,{staticNetwork:r}))),n("alchemy"))try{s.push(new Ty(t,e.alchemy))}catch{}if(n("ankr")&&e.ankr!=null)try{s.push(new Ey(t,e.ankr))}catch{}if(n("chainstack"))try{s.push(new Oy(t,e.chainstack))}catch{}if(n("cloudflare"))try{s.push(new Hie(t))}catch{}if(n("etherscan"))try{s.push(new Wie(t,e.etherscan))}catch{}if(n("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),s.push(new Jh(t,o,a))}catch{}if(n("quicknode"))try{let o=e.quicknode;s.push(new Ny(t,o))}catch{}if(ee(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),r&&coe.indexOf(r.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new loe(s,void 0,{quorum:i})}const doe=async(t,e)=>{const n={name:t,isEns:!1};if(!e)throw new Error("cannot fetch ens name without a provider url");if(!lre(t))return n;try{const r=await hoe(t,e);r&&(n.name=r,n.isEns=!0)}catch(r){console.log(r)}return n},hoe=async(t,e)=>await poe(e).lookupAddress(t),poe=t=>foe(t),moe=(t,e,n)=>{if((t==null?void 0:t.length)>n){const r=t.substring(0,e),s=t.substring((t==null?void 0:t.length)-e);return`${r}...${s}`}return t};function goe(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:s,startOfLine:i,$position:o}=t,a=v7(n),l=new RegExp(`\\s${a}$`),u=i?"^":"",c=r?new RegExp(`${u}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${u}(?:^)?${a}[^\\s${a}]*`,"gm"),f=((e=o.nodeBefore)===null||e===void 0?void 0:e.isText)&&o.nodeBefore.text;if(!f)return null;const d=o.pos-f.length,h=Array.from(f.matchAll(c)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(p);if(s!==null&&!m)return null;const g=d+h.index;let y=g+h[0].length;return r&&l.test(f.slice(y-1,y+1))&&(h[0]+=" ",y+=1),g<o.pos&&y>=o.pos?{range:{from:g,to:y},query:h[0].slice(n.length),text:h[0]}:null}const yoe=new Mt("suggestion");function boe({pluginKey:t=yoe,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:s=[" "],startOfLine:i=!1,decorationTag:o="span",decorationClass:a="suggestion",command:l=()=>null,items:u=()=>[],render:c=()=>({}),allow:f=()=>!0,findSuggestionMatch:d=goe}){let h;const p=c==null?void 0:c(),m=new bt({key:t,view(){return{update:async(g,y)=>{var v,A,w,x,k,E,O;const M=(v=this.key)===null||v===void 0?void 0:v.getState(y),D=(A=this.key)===null||A===void 0?void 0:A.getState(g.state),R=M.active&&D.active&&M.range.from!==D.range.from,B=!M.active&&D.active,F=M.active&&!D.active,V=!B&&!F&&M.query!==D.query,L=B||R,H=V&&!R,q=F||R;if(!L&&!H&&!q)return;const te=q&&!L?M:D,Z=g.dom.querySelector(`[data-decoration-id="${te.decorationId}"]`);h={editor:e,range:te.range,query:te.query,text:te.text,items:[],command:pe=>l({editor:e,range:te.range,props:pe}),decorationNode:Z,clientRect:Z?()=>{var pe;const{decorationId:Ce}=(pe=this.key)===null||pe===void 0?void 0:pe.getState(e.state),Se=g.dom.querySelector(`[data-decoration-id="${Ce}"]`);return(Se==null?void 0:Se.getBoundingClientRect())||null}:null},L&&((w=p==null?void 0:p.onBeforeStart)===null||w===void 0||w.call(p,h)),H&&((x=p==null?void 0:p.onBeforeUpdate)===null||x===void 0||x.call(p,h)),(H||L)&&(h.items=await u({editor:e,query:te.query})),q&&((k=p==null?void 0:p.onExit)===null||k===void 0||k.call(p,h)),H&&((E=p==null?void 0:p.onUpdate)===null||E===void 0||E.call(p,h)),L&&((O=p==null?void 0:p.onStart)===null||O===void 0||O.call(p,h))},destroy:()=>{var g;h&&((g=p==null?void 0:p.onExit)===null||g===void 0||g.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,v,A){const{isEditable:w}=e,{composing:x}=e.view,{selection:k}=g,{empty:E,from:O}=k,M={...y};if(M.composing=x,w&&(E||e.view.composing)){(O<y.range.from||O>y.range.to)&&!x&&!y.composing&&(M.active=!1);const D=d({char:n,allowSpaces:r,allowedPrefixes:s,startOfLine:i,$position:k.$from}),R=`id_${Math.floor(Math.random()*4294967295)}`;D&&f({editor:e,state:A,range:D.range})?(M.active=!0,M.decorationId=y.decorationId?y.decorationId:R,M.range=D.range,M.query=D.query,M.text=D.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(g,y){var v;const{active:A,range:w}=m.getState(g.state);return A&&((v=p==null?void 0:p.onKeyDown)===null||v===void 0?void 0:v.call(p,{view:g,event:y,range:w}))||!1},decorations(g){const{active:y,range:v,decorationId:A}=m.getState(g);return y?kt.create(g.doc,[nn.inline(v.from,v.to,{nodeName:o,class:a,"data-decoration-id":A})]):null}}});return m}var woe=typeof tr=="object"&&tr&&tr.Object===Object&&tr,Aoe=typeof self=="object"&&self&&self.Object===Object&&self;woe||Aoe||Function("return this")();var voe=typeof window<"u"?_.useLayoutEffect:_.useEffect,xoe=typeof window>"u";function C2(t,{defaultValue:e=!1,initializeWithValue:n=!0}={}){const r=a=>xoe?e:window.matchMedia(a).matches,[s,i]=_.useState(()=>n?r(t):e);function o(){i(r(t))}return voe(()=>{const a=window.matchMedia(t);return o(),a.addListener?a.addListener(o):a.addEventListener("change",o),()=>{a.removeListener?a.removeListener(o):a.removeEventListener("change",o)}},[t]),s}const koe=wt.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[boe({editor:this.editor,...this.options.suggestion})]}}),Coe=({query:t,uploadToIpfs:e})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:S.jsx(RT,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleNode("paragraph","paragraph").run()}},{title:"To-do List",description:"Track tasks with a to-do list.",searchTerms:["todo","task","list","check","checkbox"],icon:S.jsx(_T,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleTaskList().run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:S.jsx(A0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:S.jsx(v0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:S.jsx(x0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:S.jsx(k0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:S.jsx(Uu,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleOrderedList().run()}},{title:"Divider",description:"Visually divide content.",searchTerms:["hr","divider","break","line","delimiter"],icon:S.jsx(SU,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setHorizontalRule().run()}},{title:"Quote",description:"Capture a quote.",searchTerms:["blockquote"],icon:S.jsx(C0,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).toggleNode("paragraph","paragraph").toggleBlockquote().run()},{title:"Code",description:"Capture a code snippet.",searchTerms:["codeblock"],icon:S.jsx(Md,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).toggleCodeBlock().run()},{title:"Table",description:"Create a table.",searchTerms:["table"],icon:S.jsx(q1,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).insertTable({rows:3,cols:2,withHeaderRow:!0}).run()},{title:"Image",description:"Upload an image from your computer.",searchTerms:["photo","picture","media"],icon:S.jsx(kU,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).run();const s=document.createElement("input");s.type="file",s.accept="image/*",s.onchange=async()=>{var i;if((i=s.files)!=null&&i.length){const o=s.files[0],a=n.view.state.selection.from;X1(o,n.view,a,e)}},s.click()}},{title:"Video Embed",description:"Embed a video from YouTube, Vimeo, etc.",searchTerms:["iframe","embed","video","youtube"],icon:S.jsx(IT,{}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setActionButton("iframe").run()}},{title:"Twitter",description:"Embed a Twitter tweet.",searchTerms:["embed","twitter","tweet"],icon:S.jsx(PT,{}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setActionButton("twitter").run()}},{title:"2 Columns",description:"Create 2 columns of block",searchTerms:["col","column","2","layout"],icon:S.jsx(OT,{}),image:"",command:({editor:n})=>{n.chain().focus().setColumns(2).focus(n.state.selection.head-1).run()}},{title:"3 Columns",description:"Create 3 columns of block",searchTerms:["col","column","3","layout"],icon:S.jsx(wU,{}),image:"",command:({editor:n})=>{n.chain().focus().setColumns(3).focus(n.state.selection.head-1).run()}}].filter(n=>{if(typeof t=="string"&&t.length>0){const r=t.toLowerCase();return n.title.toLowerCase().includes(r)||n.description.toLowerCase().includes(r)||n.searchTerms&&n.searchTerms.some(s=>s.includes(r))}return!0}),Eoe=(t,e)=>{const n=t.offsetHeight,r=e?e.offsetHeight:0,s=e.offsetTop,i=s+r;s<t.scrollTop?t.scrollTop-=t.scrollTop-s+5:i>n+t.scrollTop&&(t.scrollTop+=i-n-t.scrollTop+5)},Soe=({items:t,command:e,editor:n})=>{const[r,s]=_.useState(0),[i,o]=_.useState(t),a=C2("(max-width: 640px)"),l=_.useCallback(c=>{const f=i[c];f&&(f.title==="Continue writing"||e(f))},[e,n,i]);_.useEffect(()=>{if(a){const c=t.filter(f=>!["2 Columns","3 Columns","Twitter","Video Embed"].includes(f.title));o(c)}else o(t)},[t,a]),_.useEffect(()=>{const c=["ArrowUp","ArrowDown","Enter"],f=d=>{if(c.includes(d.key))return d.preventDefault(),d.key==="ArrowUp"?(s((r+i.length-1)%i.length),!0):d.key==="ArrowDown"?(s((r+1)%i.length),!0):d.key==="Enter"?(l(r),!0):!1};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[i,r,s,l]),_.useEffect(()=>{s(0)},[i]);const u=_.useRef(null);return _.useLayoutEffect(()=>{const c=u==null?void 0:u.current,f=c==null?void 0:c.children[r];f&&c&&Eoe(c,f)},[r]),i.length>0?S.jsx("div",{id:"slash-command",ref:u,className:"z-50 h-auto max-h-[330px] w-72 overflow-y-auto scroll-smooth rounded-md border border-[#DDD] bg-white px-1 py-2 shadow-md transition-all",children:i.map((c,f)=>S.jsxs("button",{className:`flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm text-neutral-500 hover:bg-neutral-100 hover:border-neutral-200 border border-transparent transition-all ${f===r?"bg-neutral-200 text-neutral-800":""}`,onClick:()=>l(f),children:[S.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-md border border-neutral-200 bg-white",children:c.icon}),S.jsxs("div",{children:[S.jsx("p",{className:"font-medium",children:c.title}),S.jsx("p",{className:"text-xs text-neutral-500",children:c.description})]})]},f))}):null},Toe=()=>{let t=null,e=null;return{onStart:n=>{t=new ST(Soe,{props:n,editor:n.editor}),e=Xa("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:n=>{t==null||t.updateProps(n),e&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:n=>{var r;return n.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t==null?void 0:t.ref)==null?void 0:r.onKeyDown(n)},onExit:()=>{e==null||e[0].destroy(),t==null||t.destroy()}}},Doe=t=>{const e=({query:n})=>Coe({query:n,uploadToIpfs:t});return koe.configure({suggestion:{items:e,render:Toe}})},zP=["#30bced","#6eeb83","#fa69d1","#ecd444","#ee6352","#db3041","#0ad7f2","#1bff39"],Ooe=({isPreviewMode:t,initialContent:e,enableCollaboration:n,collaborationId:r,walletAddress:s,username:i,onChange:o,onCollaboratorChange:a,onCommentInteraction:l,onTextSelection:u,ensResolutionUrl:c,handleImageUploadToIpfs:f})=>{var B,F;const[d]=_.useState(new ul),[h,p]=_.useState(!1),[m,g]=_.useState([...mte,Doe(f)]),y=_.useRef(!1),v=(V,L,H)=>{let q=!1;return V.doc.nodesBetween(L,H,te=>{te.marks&&te.marks.some(Z=>Z.type.name==="highlight"&&Z.attrs.color==="yellow")&&(q=!0)}),q},A=(V,L)=>{var q;const H=L.target;if(H&&H.nodeName==="MARK"&&H.dataset.color&&((q=H==null?void 0:H.dataset)==null?void 0:q.color)==="yellow"){const te=H.textContent,Z=V.posAtCoords({left:L.clientX,top:L.clientY});if(Z){const{state:pe}=V;let Ce=Z.pos,Se=Z.pos;if(pe.doc.nodesBetween(Ce,Se,(ve,xe)=>{ve.marks&&ve.marks.length&&ve.marks.forEach(Fe=>{Fe.type.name==="highlight"&&(Ce=xe,Se=xe+ve.nodeSize)})}),Ce!==Se){const ve={text:te,from:Ce,to:Se,isHighlightedYellow:v(pe,Ce,Se)};l==null||l(ve)}}}},w=(V,L,H)=>{A(V,H)},x=AT({extensions:m,editorProps:{...TM,handleDOMEvents:{mouseover:A,keydown:(V,L)=>{if(["ArrowUp","ArrowDown","Enter"].includes(L.key)&&document.querySelector("#slash-command"))return!0}},handleClick:w},autofocus:"start",onUpdate:V=>{D!=null&&D.isEmpty||o==null||o(V.editor.getJSON())}},[m]),k=AT({extensions:m,editorProps:{...TM,handleDOMEvents:{mouseover:A,keydown:(V,L)=>{if(["ArrowUp","ArrowDown","Enter"].includes(L.key)&&document.querySelector("#slash-command"))return!0}},handleClick:w},autofocus:"start",onUpdate:V=>{D!=null&&D.isEmpty||o==null||o(V.editor.getJSON())}}),E=_.useRef(()=>{}),O=(V,L=!1)=>{if(!n||!r)throw new Error("docId or username is not provided");p(!0);const H=new RW(r,d,{signaling:["wss://fileverse-signaling-server-0529292ff51c.herokuapp.com/"]});g([...m,iK.configure({document:d}),oK.configure({provider:H,user:{name:V&&V.length>20?moe(V,7,15):V,color:zP[Math.floor(Math.random()*zP.length)],isEns:L},render:Ate})]);const q=setTimeout(()=>{p(!1)},100);return E.current=()=>{clearTimeout(q),H.destroy(),d.destroy(),p(!1)},E.current},M=_.useRef(null),D=_.useMemo(()=>n&&r&&x&&!h?x:k,[x,k,h]);_.useEffect(()=>{D==null||D.setEditable(!t)},[t,D]),_.useEffect(()=>{e&&D&&!y.current&&(D.commands.setContent(e),y.current=!0),setTimeout(()=>{y.current=!1})},[e,D]),_.useEffect(()=>{if(!D)return;const V=()=>{const{state:L}=D,{from:H,to:q}=L.selection;if(H!==q){const te=L.doc.textBetween(H,q," ");u==null||u({text:te,from:H,to:q,isHighlightedYellow:v(L,H,q)})}};return D.on("selectionUpdate",V),()=>{D.off("selectionUpdate",V)}},[D]);const R=async()=>{let V=i,L=!1;if(s&&c){const{name:H,isEns:q}=await doe(s,c);V=H,L=q}if(!V)throw new Error("Cannot start collaboration without a username");O(V,L)};return _.useEffect(()=>{n?R():E.current()},[n]),_.useEffect(()=>{var V,L;a==null||a((L=(V=D==null?void 0:D.storage)==null?void 0:V.collaborationCursor)==null?void 0:L.users)},[(F=(B=D==null?void 0:D.storage)==null?void 0:B.collaborationCursor)==null?void 0:F.users]),{editor:D,ref:M,loading:h,connect:O,ydoc:d}},Moe=({title:t,content:e,contentClassName:n,open:r,onOpenChange:s,primaryAction:i,secondaryAction:o})=>S.jsx(LV,{open:r,onOpenChange:s,children:S.jsxs(Z3,{className:"max-w-md sm:w-full w-[90%] z-20",children:[S.jsx(eD,{className:"px-4 pt-0 border-b-[1px]",children:S.jsx(nD,{className:"text-left text-base",children:t})}),S.jsx("div",{className:he("flex flex-col gap-4 w-full h-full pb-4 text-base text-black",n),children:e&&e}),S.jsxs(tD,{className:"px-5 pb-5 justify-end sm:",children:[o&&S.jsx(jV,{asChild:!0,children:S.jsx(sl,{disabled:o==null?void 0:o.isLoading,isLoading:o==null?void 0:o.isLoading,className:o==null?void 0:o.className,variant:(o==null?void 0:o.variant)||"ghost",onClick:o==null?void 0:o.onClick,children:o==null?void 0:o.label})}),i&&S.jsx(sl,{disabled:i==null?void 0:i.isLoading,isLoading:i==null?void 0:i.isLoading,className:i==null?void 0:i.className,variant:(i==null?void 0:i.variant)||"primary",onClick:i==null?void 0:i.onClick,children:i==null?void 0:i.label})]})]})}),Noe=({editor:t,uploadToIpfs:e})=>{const{toolVisibilty:n,setToolVisibility:r,bottomToolbar:s}=Lw({editor:t,uploadToIpfs:e}),i=C2("(max-width: 1023px)"),[o,a]=_.useState(""),[l,u]=_.useState(""),[c,f]=_.useState(!0),d=()=>{if(o===null){f(!1);return}if(o===""){t.chain().focus().extendMarkRange("link").unsetLink().run(),f(!1);return}let m=o;!o.startsWith("http://")&&!o.startsWith("https://")&&(m="https://"+o);try{m.match(/^((http|https):\/\/)?([w|W]{3}\.)+[a-zA-Z0-9\-\.]{3,}\.[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?$/)&&t.chain().focus().extendMarkRange("link").setLink({href:m}).command(({tr:g})=>(g.insertText(l),!0)).run(),f(!0)}catch{console.error("Invalid URL"),f(!1);return}t.chain().focus().extendMarkRange("link").setLink({href:m}).command(({tr:g})=>(g.insertText(l),!0)).run(),f(!0),r(_e.NONE)},h=m=>{const{from:g,to:y}=m.state.selection,v=m.state.doc.textBetween(g,y);return u(v),v},p=_.useRef(null);return _.useEffect(()=>{let m=0;const g=()=>{m=Date.now()},y=()=>{var w;if(Date.now()-m>500){const{selection:x}=t.state;x.from!==x.to&&((w=p.current)==null||w.click())}},v=()=>{var x;if(!i)return;const{selection:A}=t.state;A.from!==A.to&&((x=p.current)==null||x.click())};return i?(document.addEventListener("touchstart",g),document.addEventListener("touchend",y)):document.addEventListener("mouseup",v),()=>{i?(document.removeEventListener("touchstart",g),document.removeEventListener("touchend",y)):document.removeEventListener("mouseup",v)}},[t,i]),_.useEffect(()=>{h(t)},[t]),_.useEffect(()=>{const m=g=>{g.key==="k"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),n!==_e.LINK_POPUP?r(_e.LINK_POPUP):r(_e.NONE))};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[t,n]),S.jsxs(W3,{children:[S.jsx("div",{className:"flex w-full justify-between sm:justify-evenly select-none",children:s.map(m=>{if(m)return S.jsx("div",{className:"flex items-center",children:m.title==="Text formating"?S.jsx(K3,{asChild:!0,children:S.jsx("button",{ref:p,onClick:()=>m.onClick(),children:m.icon})}):m.title==="Text color"?S.jsx(K3,{asChild:!0,children:S.jsx("button",{onClick:()=>m.onClick(),children:m.icon})}):S.jsx("button",{className:he("flex items-center rounded px-2 py-1 transition",{"text-black":m.isActive,"text-[#A1AAB1]":!m.isActive}),onClick:()=>m.onClick(),disabled:!m.isActive,children:m.icon})},m.title)})}),n===_e.TEXT_FORMATING&&S.jsx(Sz,{editor:t,setToolVisibility:r}),n===_e.LINK_POPUP&&S.jsx(Moe,{open:n===_e.LINK_POPUP,onOpenChange:()=>r(_e.NONE),title:"Link",content:S.jsxs("div",{className:"flex flex-col gap-4 w-full h-full px-4",children:[S.jsx(z0,{label:"Text",placeholder:"Link text",className:"w-full",defaultValue:l,onChange:m=>{m.preventDefault(),u(m.target.value)}}),S.jsx(z0,{label:"Link",placeholder:"Paste URL",className:"w-full",defaultValue:t.getAttributes("link").href,onChange:m=>{m.preventDefault(),a(m.target.value)},isValid:c,message:c?"":"Invalid URL"})]}),primaryAction:{label:"Save",onClick:()=>d(),isLoading:!1,className:"w-auto min-w-[80px]"},secondaryAction:{label:"Cancel",variant:"secondary",onClick:()=>r(_e.NONE),className:"w-auto min-w-[80px]"}})]})},E2=_.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Ry=_.createContext({}),Py=_.createContext(null),S2=typeof document<"u",T2=S2?_.useLayoutEffect:_.useEffect,$P=_.createContext({strict:!1}),D2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),GP="data-"+D2("framerAppearId"),_oe={skipAnimations:!1,useManualTiming:!1};class WP{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function Roe(t){let e=new WP,n=new WP,r=0,s=!1,i=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const f=c&&s,d=f?e:n;return u&&o.add(l),d.add(l)&&f&&s&&(r=e.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){i=!0;return}if(s=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let u=0;u<r;u++){const c=e.order[u];o.has(c)&&(a.schedule(c),t()),c(l)}s=!1,i&&(i=!1,a.process(l))}};return a}const Iy=["read","resolveKeyframes","update","preRender","render","postRender"],Poe=40;function KP(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=Iy.reduce((f,d)=>(f[d]=Roe(()=>n=!0),f),{}),o=f=>{i[f].process(s)},a=()=>{const f=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(f-s.timestamp,Poe),1),s.timestamp=f,s.isProcessing=!0,Iy.forEach(o),s.isProcessing=!1,n&&e&&(r=!1,t(a))},l=()=>{n=!0,r=!0,s.isProcessing||t(a)};return{schedule:Iy.reduce((f,d)=>{const h=i[d];return f[d]=(p,m=!1,g=!1)=>(n||l(),h.schedule(p,m,g)),f},{}),cancel:f=>Iy.forEach(d=>i[d].cancel(f)),state:s,steps:i}}const{schedule:O2,cancel:bde}=KP(queueMicrotask,!1);function Gc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const qP=_.createContext({});let QP=!1;function Ioe(t,e,n,r,s){const{visualElement:i}=_.useContext(Ry),o=_.useContext($P),a=_.useContext(Py),l=_.useContext(E2).reducedMotion,u=_.useRef();r=r||o.renderer,!u.current&&r&&(u.current=r(t,{visualState:e,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,f=_.useContext(qP);c&&!c.projection&&s&&(c.type==="html"||c.type==="svg")&&Boe(u.current,n,s,f),_.useInsertionEffect(()=>{c&&c.update(n,a)});const d=_.useRef(!!(n[GP]&&!window.HandoffComplete));return T2(()=>{c&&(c.updateFeatures(),O2.render(c.render),d.current&&c.animationState&&c.animationState.animateChanges())}),_.useEffect(()=>{c&&(!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,QP||(QP=!0,queueMicrotask(Loe))))}),c}function Loe(){window.HandoffComplete=!0}function Boe(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:JP(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Gc(a),visualElement:t,scheduleRender:()=>t.scheduleRender(),animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function JP(t){if(t)return t.options.allowProjection!==!1?t.projection:JP(t.parent)}function Foe(t,e,n){return _.useCallback(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):Gc(n)&&(n.current=r))},[e])}function Xh(t){return typeof t=="string"||Array.isArray(t)}function Ly(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const M2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],N2=["initial",...M2];function By(t){return Ly(t.animate)||N2.some(e=>Xh(t[e]))}function YP(t){return!!(By(t)||t.variants)}function joe(t,e){if(By(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Xh(n)?n:void 0,animate:Xh(r)?r:void 0}}return t.inherit!==!1?e:{}}function Uoe(t){const{initial:e,animate:n}=joe(t,_.useContext(Ry));return _.useMemo(()=>({initial:e,animate:n}),[XP(e),XP(n)])}function XP(t){return Array.isArray(t)?t.join(" "):t}const ZP={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Wc={};for(const t in ZP)Wc[t]={isEnabled:e=>ZP[t].some(n=>!!e[n])};function Hoe(t){for(const e in t)Wc[e]={...Wc[e],...t[e]}}const _2=_.createContext({}),Voe=Symbol.for("motionComponentSymbol"),Sn=t=>t;let Kc=Sn,Yi=Sn;process.env.NODE_ENV!=="production"&&(Kc=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Yi=(t,e)=>{if(!t)throw new Error(e)});function zoe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&Hoe(t);function i(a,l){let u;const c={..._.useContext(E2),...a,layoutId:$oe(a)},{isStatic:f}=c,d=Uoe(a),h=r(a,f);if(!f&&S2){Goe(c,t);const p=Woe(c);u=p.MeasureLayout,d.visualElement=Ioe(s,h,c,e,p.ProjectionNode)}return S.jsxs(Ry.Provider,{value:d,children:[u&&d.visualElement?S.jsx(u,{visualElement:d.visualElement,...c}):null,n(s,a,Foe(h,d.visualElement,l),h,f,d.visualElement)]})}const o=_.forwardRef(i);return o[Voe]=s,o}function $oe({layoutId:t}){const e=_.useContext(_2).id;return e&&t!==void 0?e+"-"+t:t}function Goe(t,e){const n=_.useContext($P).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Kc(!1,r):Yi(!1,r)}}function Woe(t){const{drag:e,layout:n}=Wc;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Koe(t){function e(r,s={}){return zoe(t(r,s))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(r,s)=>(n.has(s)||n.set(s,e(s)),n.get(s))})}const qoe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function R2(t){return typeof t!="string"||t.includes("-")?!1:!!(qoe.indexOf(t)>-1||/[A-Z]/u.test(t))}const Fy={};function Qoe(t){Object.assign(Fy,t)}const Zh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bl=new Set(Zh);function e8(t,{layout:e,layoutId:n}){return Bl.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Fy[t]||t==="opacity")}const Pn=t=>!!(t&&t.getVelocity),Joe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Yoe=Zh.length;function Xoe(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,s){let i="";for(let o=0;o<Yoe;o++){const a=Zh[o];if(t[a]!==void 0){const l=Joe[a]||a;i+=`${l}(${t[a]}) `}}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),s?i=s(t,r?"":i):n&&r&&(i="none"),i}const t8=t=>e=>typeof e=="string"&&e.startsWith(t),n8=t8("--"),Zoe=t8("var(--"),P2=t=>Zoe(t)?eae.test(t.split("/*")[0].trim()):!1,eae=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,tae=(t,e)=>e&&typeof t=="number"?e.transform(t):t,la=(t,e,n)=>n>e?e:n<t?t:n,qc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ep={...qc,transform:t=>la(0,1,t)},jy={...qc,default:1},tp=t=>Math.round(t*1e5)/1e5,I2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,nae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,rae=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function np(t){return typeof t=="string"}const rp=t=>({test:e=>np(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ua=rp("deg"),hi=rp("%"),Ie=rp("px"),sae=rp("vh"),iae=rp("vw"),r8={...hi,parse:t=>hi.parse(t)/100,transform:t=>hi.transform(t*100)},s8={...qc,transform:Math.round},i8={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,radius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,size:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,rotate:ua,rotateX:ua,rotateY:ua,rotateZ:ua,scale:jy,scaleX:jy,scaleY:jy,scaleZ:jy,skew:ua,skewX:ua,skewY:ua,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:ep,originX:r8,originY:r8,originZ:Ie,zIndex:s8,backgroundPositionX:Ie,backgroundPositionY:Ie,fillOpacity:ep,strokeOpacity:ep,numOctaves:s8};function L2(t,e,n,r){const{style:s,vars:i,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const f in e){const d=e[f];if(n8(f)){i[f]=d;continue}const h=i8[f],p=tae(d,h);if(Bl.has(f)){if(l=!0,o[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,a[f]=p):s[f]=p}if(e.transform||(l||r?s.transform=Xoe(t.transform,n,c,r):s.transform&&(s.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=a;s.transformOrigin=`${f} ${d} ${h}`}}const B2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function o8(t,e,n){for(const r in e)!Pn(e[r])&&!e8(r,n)&&(t[r]=e[r])}function oae({transformTemplate:t},e,n){return _.useMemo(()=>{const r=B2();return L2(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}function aae(t,e,n){const r=t.style||{},s={};return o8(s,r,t),Object.assign(s,oae(t,e,n)),s}function lae(t,e,n){const r={},s=aae(t,e,n);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=s,r}const uae=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Uy(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||uae.has(t)}let a8=t=>!Uy(t);function cae(t){t&&(a8=e=>e.startsWith("on")?!Uy(e):t(e))}try{cae(require("@emotion/is-prop-valid").default)}catch{}function fae(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(a8(s)||n===!0&&Uy(s)||!e&&!Uy(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function l8(t,e,n){return typeof t=="string"?t:Ie.transform(e+n*t)}function dae(t,e,n){const r=l8(e,t.x,t.width),s=l8(n,t.y,t.height);return`${r} ${s}`}const hae={offset:"stroke-dashoffset",array:"stroke-dasharray"},pae={offset:"strokeDashoffset",array:"strokeDasharray"};function mae(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?hae:pae;t[i.offset]=Ie.transform(-r);const o=Ie.transform(e),a=Ie.transform(n);t[i.array]=`${o} ${a}`}function F2(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f,d){if(L2(t,u,c,d),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:p,dimensions:m}=t;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(s!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=dae(m,s!==void 0?s:.5,i!==void 0?i:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&mae(h,o,a,l,!1)}const u8=()=>({...B2(),attrs:{}}),j2=t=>typeof t=="string"&&t.toLowerCase()==="svg";function gae(t,e,n,r){const s=_.useMemo(()=>{const i=u8();return F2(i,e,{enableHardwareAcceleration:!1},j2(r),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};o8(i,t.style,t),s.style={...i,...s.style}}return s}function yae(t=!1){return(n,r,s,{latestValues:i},o)=>{const l=(R2(n)?gae:lae)(r,i,o,n),u=fae(r,typeof n=="string",t),c=n!==_.Fragment?{...u,...l,ref:s}:{},{children:f}=r,d=_.useMemo(()=>Pn(f)?f.get():f,[f]);return _.createElement(n,{...c,children:d})}}function c8(t,{style:e,vars:n},r,s){Object.assign(t.style,e,s&&s.getProjectionStyles(r));for(const i in n)t.style.setProperty(i,n[i])}const f8=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function d8(t,e,n,r){c8(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(f8.has(s)?s:D2(s),e.attrs[s])}function U2(t,e,n){var r;const{style:s}=t,i={};for(const o in s)(Pn(s[o])||e.style&&Pn(e.style[o])||e8(o,t)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}function h8(t,e,n){const r=U2(t,e,n);for(const s in t)if(Pn(t[s])||Pn(e[s])){const i=Zh.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}function p8(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function H2(t,e,n,r){if(typeof e=="function"){const[s,i]=p8(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=p8(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function m8(t){const e=_.useRef(null);return e.current===null&&(e.current=t()),e.current}const V2=t=>Array.isArray(t),bae=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),wae=t=>V2(t)?t[t.length-1]||0:t;function Hy(t){const e=Pn(t)?t.get():t;return bae(e)?e.toValue():e}function Aae({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,s,i){const o={latestValues:vae(r,s,i,t),renderState:e()};return n&&(o.mount=a=>n(r,a,o)),o}const g8=t=>(e,n)=>{const r=_.useContext(Ry),s=_.useContext(Py),i=()=>Aae(t,e,r,s);return n?i():m8(i)};function vae(t,e,n,r){const s={},i=r(t,{});for(const d in i)s[d]=Hy(i[d]);let{initial:o,animate:a}=t;const l=By(t),u=YP(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;return f&&typeof f!="boolean"&&!Ly(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=H2(t,h);if(!p)return;const{transitionEnd:m,transition:g,...y}=p;for(const v in y){let A=y[v];if(Array.isArray(A)){const w=c?A.length-1:0;A=A[w]}A!==null&&(s[v]=A)}for(const v in m)s[v]=m[v]}),s}const{schedule:pt,cancel:Xi,state:Tn,steps:z2}=KP(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0),xae={useVisualState:g8({scrapeMotionValuesFromProps:h8,createRenderState:u8,onMount:(t,e,{renderState:n,latestValues:r})=>{pt.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),pt.render(()=>{F2(n,r,{enableHardwareAcceleration:!1},j2(e.tagName),t.transformTemplate),d8(e,n)})}})},kae={useVisualState:g8({scrapeMotionValuesFromProps:U2,createRenderState:B2})};function Cae(t,{forwardMotionProps:e=!1},n,r){return{...R2(t)?xae:kae,preloadedFeatures:n,useRender:yae(e),createVisualElement:r,Component:t}}function Zi(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const y8=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function Vy(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const Eae=t=>e=>y8(e)&&t(e,Vy(e));function eo(t,e,n,r){return Zi(t,e,Eae(n),r)}const Sae=(t,e)=>n=>e(t(n)),to=(...t)=>t.reduce(Sae);function b8(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const w8=b8("dragHorizontal"),A8=b8("dragVertical");function v8(t){let e=!1;if(t==="y")e=A8();else if(t==="x")e=w8();else{const n=w8(),r=A8();n&&r?e=()=>{n(),r()}:(n&&n(),r&&r())}return e}function x8(){const t=v8(!0);return t?(t(),!1):!0}class ca{constructor(e){this.isMounted=!1,this.node=e}update(){}}function k8(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd",s=(i,o)=>{if(i.pointerType==="touch"||x8())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const l=a[r];l&&pt.postRender(()=>l(i,o))};return eo(t.current,n,s,{passive:!t.getProps()[r]})}class Tae extends ca{mount(){this.unmount=to(k8(this.node,!0),k8(this.node,!1))}unmount(){}}class Dae extends ca{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=to(Zi(this.node.current,"focus",()=>this.onFocus()),Zi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const C8=(t,e)=>e?t===e?!0:C8(t,e.parentElement):!1;function $2(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,Vy(n))}class Oae extends ca{constructor(){super(...arguments),this.removeStartListeners=Sn,this.removeEndListeners=Sn,this.removeAccessibleListeners=Sn,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),i=eo(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:f}=this.node.getProps(),d=!f&&!C8(this.node.current,a.target)?c:u;d&&pt.update(()=>d(a,l))},{passive:!(r.onTap||r.onPointerUp)}),o=eo(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=to(i,o),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=i=>{if(i.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||$2("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&pt.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Zi(this.node.current,"keyup",o),$2("down",(a,l)=>{this.startPress(a,l)})},n=Zi(this.node.current,"keydown",e),r=()=>{this.isPressing&&$2("cancel",(i,o)=>this.cancelPress(i,o))},s=Zi(this.node.current,"blur",r);this.removeAccessibleListeners=to(n,s)}}startPress(e,n){this.isPressing=!0;const{onTapStart:r,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&pt.postRender(()=>r(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!x8()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&pt.postRender(()=>r(e,n))}mount(){const e=this.node.getProps(),n=eo(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=Zi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=to(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const G2=new WeakMap,W2=new WeakMap,Mae=t=>{const e=G2.get(t.target);e&&e(t)},Nae=t=>{t.forEach(Mae)};function _ae({root:t,...e}){const n=t||document;W2.has(n)||W2.set(n,{});const r=W2.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(Nae,{root:t,...e})),r[s]}function Rae(t,e,n){const r=_ae(e);return G2.set(t,n),r.observe(t),()=>{G2.delete(t),r.unobserve(t)}}const Pae={some:0,all:1};class Iae extends ca{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Pae[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return Rae(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Lae(e,n))&&this.startObserver()}unmount(){}}function Lae({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Bae={inView:{Feature:Iae},tap:{Feature:Oae},focus:{Feature:Dae},hover:{Feature:Tae}};function E8(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function zy(t,e,n){const r=t.getProps();return H2(r,e,n!==void 0?n:r.custom,t)}const no=t=>t*1e3,ro=t=>t/1e3,Fae={type:"spring",stiffness:500,damping:25,restSpeed:10},jae=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Uae={type:"keyframes",duration:.8},Hae={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Vae=(t,{keyframes:e})=>e.length>2?Uae:Bl.has(t)?t.startsWith("scale")?jae(e[1]):Fae:Hae;function zae({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function K2(t,e){return t[e]||t.default||t}const $ae=t=>t!==null;function $y(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter($ae),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}let Gy;function Gae(){Gy=void 0}const fa={now:()=>(Gy===void 0&&fa.set(Tn.isProcessing||_oe.useManualTiming?Tn.timestamp:performance.now()),Gy),set:t=>{Gy=t,queueMicrotask(Gae)}},S8=t=>/^0[^.\s]+$/u.test(t);function Wae(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||S8(t):!0}const T8=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Kae=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function qae(t){const e=Kae.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}const Qae=4;function D8(t,e,n=1){Yi(n<=Qae,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,s]=qae(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return T8(o)?parseFloat(o):o}return P2(s)?D8(s,e,n+1):s}const Jae=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),O8=t=>t===qc||t===Ie,M8=(t,e)=>parseFloat(t.split(", ")[e]),N8=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return M8(s[1],e);{const i=r.match(/^matrix\((.+)\)$/u);return i?M8(i[1],t):0}},Yae=new Set(["x","y","z"]),Xae=Zh.filter(t=>!Yae.has(t));function Zae(t){const e=[];return Xae.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Qc={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:N8(4,13),y:N8(5,14)};Qc.translateX=Qc.x,Qc.translateY=Qc.y;const _8=t=>e=>e.test(t),R8=[qc,Ie,hi,ua,iae,sae,{test:t=>t==="auto",parse:t=>t}],P8=t=>R8.find(_8(t)),Fl=new Set;let q2=!1,Q2=!1;function I8(){if(Q2){const t=Array.from(Fl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Zae(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Q2=!1,q2=!1,Fl.forEach(t=>t.complete()),Fl.clear()}function L8(){Fl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Q2=!0)})}function ele(){L8(),I8()}class J2{constructor(e,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Fl.add(this),q2||(q2=!0,pt.read(L8),pt.resolveKeyframes(I8))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),s&&o===void 0&&s.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Fl.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Fl.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Y2=(t,e)=>n=>!!(np(n)&&rae.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),B8=(t,e,n)=>r=>{if(!np(r))return r;const[s,i,o,a]=r.match(I2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},tle=t=>la(0,255,t),X2={...qc,transform:t=>Math.round(tle(t))},jl={test:Y2("rgb","red"),parse:B8("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+X2.transform(t)+", "+X2.transform(e)+", "+X2.transform(n)+", "+tp(ep.transform(r))+")"};function nle(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Z2={test:Y2("#"),parse:nle,transform:jl.transform},Jc={test:Y2("hsl","hue"),parse:B8("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+hi.transform(tp(e))+", "+hi.transform(tp(n))+", "+tp(ep.transform(r))+")"},In={test:t=>jl.test(t)||Z2.test(t)||Jc.test(t),parse:t=>jl.test(t)?jl.parse(t):Jc.test(t)?Jc.parse(t):Z2.parse(t),transform:t=>np(t)?t:t.hasOwnProperty("red")?jl.transform(t):Jc.transform(t)};function rle(t){var e,n;return isNaN(t)&&np(t)&&(((e=t.match(I2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(nae))===null||n===void 0?void 0:n.length)||0)>0}const F8="number",j8="color",sle="var",ile="var(",U8="${}",ole=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function sp(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(ole,l=>(In.test(l)?(r.color.push(i),s.push(j8),n.push(In.parse(l))):l.startsWith(ile)?(r.var.push(i),s.push(sle),n.push(l)):(r.number.push(i),s.push(F8),n.push(parseFloat(l))),++i,U8)).split(U8);return{values:n,split:a,indexes:r,types:s}}function H8(t){return sp(t).values}function V8(t){const{split:e,types:n}=sp(t),r=e.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=e[o],s[o]!==void 0){const a=n[o];a===F8?i+=tp(s[o]):a===j8?i+=In.transform(s[o]):i+=s[o]}return i}}const ale=t=>typeof t=="number"?0:t;function lle(t){const e=H8(t);return V8(t)(e.map(ale))}const da={test:rle,parse:H8,createTransformer:V8,getAnimatableNone:lle},ule=new Set(["brightness","contrast","saturate","opacity"]);function cle(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(I2)||[];if(!r)return t;const s=n.replace(r,"");let i=ule.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const fle=/\b([a-z-]*)\(.*?\)/gu,ek={...da,getAnimatableNone:t=>{const e=t.match(fle);return e?e.map(cle).join(" "):t}},dle={...i8,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:ek,WebkitFilter:ek},tk=t=>dle[t];function z8(t,e){let n=tk(t);return n!==ek&&(n=da),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const hle=new Set(["auto","none","0"]);function ple(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!hle.has(i)&&sp(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=z8(n,s)}class $8 extends J2{constructor(e,n,r,s){super(e,n,r,s,s==null?void 0:s.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),P2(u))){const c=D8(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Jae.has(r)||e.length!==2)return;const[s,i]=e,o=P8(s),a=P8(i);if(o!==a)if(O8(o)&&O8(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)Wae(e[s])&&r.push(s);r.length&&ple(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qc[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=Qc[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function G8(t){let e;return()=>(e===void 0&&(e=t()),e)}const W8=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(da.test(t)||t==="0")&&!t.startsWith("url("));function mle(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function gle(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=W8(s,e),a=W8(i,e);return Kc(o===a,`You are trying to animate ${e} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:mle(t)||n==="spring"&&r}class K8{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&ele(),this._resolved}onKeyframesResolved(e,n){this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!gle(e,r,s,i))if(o)this.options.duration=0;else{l==null||l($y(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function q8(t,e){return e?t*(1e3/e):0}const yle=5;function Q8(t,e,n){const r=Math.max(e-yle,0);return q8(n-t(r),e-r)}const nk=.001,ble=.01,J8=10,wle=.05,Ale=1;function vle({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,i;Kc(t<=no(J8),"Spring duration must be 10 seconds or less");let o=1-e;o=la(wle,Ale,o),t=la(ble,J8,ro(t)),o<1?(s=u=>{const c=u*o,f=c*t,d=c-n,h=rk(u,o),p=Math.exp(-f);return nk-d/h*p},i=u=>{const f=u*o*t,d=f*n+n,h=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-f),m=rk(Math.pow(u,2),o);return(-s(u)+nk>0?-1:1)*((d-h)*p)/m}):(s=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-nk+c*f},i=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=kle(s,i,a);if(t=no(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const xle=12;function kle(t,e,n){let r=n;for(let s=1;s<xle;s++)r=r-t(r)/e(r);return r}function rk(t,e){return t*Math.sqrt(1-e*e)}const Cle=["duration","bounce"],Ele=["stiffness","damping","mass"];function Y8(t,e){return e.some(n=>t[n]!==void 0)}function Sle(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Y8(t,Ele)&&Y8(t,Cle)){const n=vle(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function X8({keyframes:t,restDelta:e,restSpeed:n,...r}){const s=t[0],i=t[t.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:u,duration:c,velocity:f,isResolvedFromDuration:d}=Sle({...r,velocity:-ro(r.velocity||0)}),h=f||0,p=l/(2*Math.sqrt(a*u)),m=i-s,g=ro(Math.sqrt(a/u)),y=Math.abs(m)<5;n||(n=y?.01:2),e||(e=y?.005:.5);let v;if(p<1){const A=rk(g,p);v=w=>{const x=Math.exp(-p*g*w);return i-x*((h+p*g*m)/A*Math.sin(A*w)+m*Math.cos(A*w))}}else if(p===1)v=A=>i-Math.exp(-g*A)*(m+(h+g*m)*A);else{const A=g*Math.sqrt(p*p-1);v=w=>{const x=Math.exp(-p*g*w),k=Math.min(A*w,300);return i-x*((h+p*g*m)*Math.sinh(k)+A*m*Math.cosh(k))/A}}return{calculatedDuration:d&&c||null,next:A=>{const w=v(A);if(d)o.done=A>=c;else{let x=h;A!==0&&(p<1?x=Q8(v,A,w):x=0);const k=Math.abs(x)<=n,E=Math.abs(i-w)<=e;o.done=k&&E}return o.value=o.done?i:w,o}}}function Z8({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},h=O=>a!==void 0&&O<a||l!==void 0&&O>l,p=O=>a===void 0?l:l===void 0||Math.abs(a-O)<Math.abs(l-O)?a:l;let m=n*e;const g=f+m,y=o===void 0?g:o(g);y!==g&&(m=y-f);const v=O=>-m*Math.exp(-O/r),A=O=>y+v(O),w=O=>{const M=v(O),D=A(O);d.done=Math.abs(M)<=u,d.value=d.done?y:D};let x,k;const E=O=>{h(d.value)&&(x=O,k=X8({keyframes:[d.value,p(d.value)],velocity:Q8(A,O,d.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:O=>{let M=!1;return!k&&x===void 0&&(M=!0,w(O),E(O)),x!==void 0&&O>=x?k.next(O-x):(!M&&w(O),d)}}}const eI=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Tle=1e-7,Dle=12;function Ole(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=eI(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>Tle&&++a<Dle);return o}function ip(t,e,n,r){if(t===e&&n===r)return Sn;const s=i=>Ole(i,0,1,t,n);return i=>i===0||i===1?i:eI(s(i),e,r)}const Mle=ip(.42,0,1,1),Nle=ip(0,0,.58,1),tI=ip(.42,0,.58,1),_le=t=>Array.isArray(t)&&typeof t[0]!="number",nI=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,rI=t=>e=>1-t(1-e),sk=t=>1-Math.sin(Math.acos(t)),sI=rI(sk),Rle=nI(sk),iI=ip(.33,1.53,.69,.99),ik=rI(iI),Ple=nI(ik),oI={linear:Sn,easeIn:Mle,easeInOut:tI,easeOut:Nle,circIn:sk,circInOut:Rle,circOut:sI,backIn:ik,backInOut:Ple,backOut:iI,anticipate:t=>(t*=2)<1?.5*ik(t):.5*(2-Math.pow(2,-10*(t-1)))},aI=t=>{if(Array.isArray(t)){Yi(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,s]=t;return ip(e,n,r,s)}else if(typeof t=="string")return Yi(oI[t]!==void 0,`Invalid easing type '${t}'`),oI[t];return t},op=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},Bt=(t,e,n)=>t+(e-t)*n;function ok(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ile({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=ok(l,a,t+1/3),i=ok(l,a,t),o=ok(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Wy(t,e){return n=>n>0?e:t}const ak=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},Lle=[Z2,jl,Jc],Ble=t=>Lle.find(e=>e.test(t));function lI(t){const e=Ble(t);if(Kc(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Jc&&(n=Ile(n)),n}const uI=(t,e)=>{const n=lI(t),r=lI(e);if(!n||!r)return Wy(t,e);const s={...n};return i=>(s.red=ak(n.red,r.red,i),s.green=ak(n.green,r.green,i),s.blue=ak(n.blue,r.blue,i),s.alpha=Bt(n.alpha,r.alpha,i),jl.transform(s))},lk=new Set(["none","hidden"]);function Fle(t,e){return lk.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function jle(t,e){return n=>Bt(t,e,n)}function uk(t){return typeof t=="number"?jle:typeof t=="string"?P2(t)?Wy:In.test(t)?uI:Vle:Array.isArray(t)?cI:typeof t=="object"?In.test(t)?uI:Ule:Wy}function cI(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>uk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function Ule(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=uk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function Hle(t,e){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],a=t.indexes[o][s[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const Vle=(t,e)=>{const n=da.createTransformer(e),r=sp(t),s=sp(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?lk.has(t)&&!s.values.length||lk.has(e)&&!r.values.length?Fle(t,e):to(cI(Hle(r,s),s.values),n):(Kc(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Wy(t,e))};function fI(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Bt(t,e,n):uk(t)(t,e)}function zle(t,e,n){const r=[],s=n||fI,i=t.length-1;for(let o=0;o<i;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||Sn:e;a=to(l,a)}r.push(a)}return r}function $le(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Yi(i===e.length,"Both input and output ranges must be the same length"),i===1)return()=>e[0];if(i===2&&t[0]===t[1])return()=>e[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=zle(e,r,s),a=o.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const f=op(t[c],t[c+1],u);return o[c](f)};return n?u=>l(la(t[0],t[i-1],u)):l}function Gle(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=op(0,e,r);t.push(Bt(n,1,s))}}function Wle(t){const e=[0];return Gle(e,t.length-1),e}function Kle(t,e){return t.map(n=>n*e)}function qle(t,e){return t.map(()=>e||tI).splice(0,t.length-1)}function Ky({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=_le(r)?r.map(aI):aI(r),i={done:!1,value:e[0]},o=Kle(n&&n.length===e.length?n:Wle(e),t),a=$le(o,e,{ease:Array.isArray(s)?s:qle(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const dI=2e4;function Qle(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<dI;)e+=n,r=t.next(e);return e>=dI?1/0:e}const Jle=t=>{const e=({timestamp:n})=>t(n);return{start:()=>pt.update(e,!0),stop:()=>Xi(e),now:()=>Tn.isProcessing?Tn.timestamp:fa.now()}},Yle={decay:Z8,inertia:Z8,tween:Ky,keyframes:Ky,spring:X8},Xle=t=>t/100;class ck extends K8{constructor({KeyframeResolver:e=J2,...n}){super(n),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:a}=this.options;a&&a()};const{name:r,motionValue:s,keyframes:i}=this.options,o=(a,l)=>this.onKeyframesResolved(a,l);r&&s&&s.owner?this.resolver=s.owner.resolveKeyframes(i,o,r,s):this.resolver=new e(i,o,r,s),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=Yle[n]||Ky;let l,u;a!==Ky&&typeof e[0]!="number"&&(process.env.NODE_ENV!=="production"&&Yi(e.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),l=to(Xle,fI(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});i==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Qle(c));const{calculatedDuration:f}=c,d=f+s,h=d*(r+1)-s;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:d,totalDuration:h}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:d,repeat:h,repeatType:p,repeatDelay:m,onUpdate:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?y<0:y>c;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let A=this.currentTime,w=i;if(h){const O=Math.min(this.currentTime,c)/f;let M=Math.floor(O),D=O%1;!D&&O>=1&&(D=1),D===1&&M--,M=Math.min(M,h+1),!!(M%2)&&(p==="reverse"?(D=1-D,m&&(D-=m/f)):p==="mirror"&&(w=o)),A=la(0,1,D)*f}const x=v?{done:!1,value:l[0]}:w.next(A);a&&(x.value=a(x.value));let{done:k}=x;!v&&u!==null&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return E&&s!==void 0&&(x.value=$y(l,this.options,s)),g&&g(x.value),E&&this.finish(),x}get duration(){const{resolved:e}=this;return e?ro(e.calculatedDuration):0}get time(){return ro(this.currentTime)}set time(e){e=no(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=ro(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Jle,onPlay:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=r),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const hI=t=>Array.isArray(t)&&typeof t[0]=="number";function pI(t){return!!(!t||typeof t=="string"&&t in fk||hI(t)||Array.isArray(t)&&t.every(pI))}const ap=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,fk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ap([0,.65,.55,1]),circOut:ap([.55,0,1,.45]),backIn:ap([.31,.01,.66,-.59]),backOut:ap([.33,1.53,.69,.99])};function Zle(t){return mI(t)||fk.easeOut}function mI(t){if(t)return hI(t)?ap(t):Array.isArray(t)?t.map(Zle):fk[t]}function eue(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=mI(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const tue=G8(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),nue=new Set(["opacity","clipPath","filter","transform"]),qy=10,rue=2e4;function sue(t){return t.type==="spring"||t.name==="backgroundColor"||!pI(t.ease)}function iue(t,e){const n=new ck({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const s=[];let i=0;for(;!r.done&&i<rue;)r=n.sample(i),s.push(r.value),i+=qy;return{times:void 0,keyframes:s,duration:i-qy,ease:"linear"}}class gI extends K8{constructor(e){super(e);const{name:n,motionValue:r,keyframes:s}=this.options;this.resolver=new $8(s,(i,o)=>this.onKeyframesResolved(i,o),n,r),this.resolver.scheduleResolve()}initPlayback(e,n){var r;let{duration:s=300,times:i,ease:o,type:a,motionValue:l,name:u}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(sue(this.options)){const{onComplete:f,onUpdate:d,motionValue:h,...p}=this.options,m=iue(e,p);e=m.keyframes,e.length===1&&(e[1]=e[0]),s=m.duration,i=m.times,o=m.ease,a="keyframes"}const c=eue(l.owner.current,u,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=fa.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;l.set($y(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:i,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return ro(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return ro(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=no(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return Sn;const{animation:r}=n;r.timeline=e,r.onfinish=null}return Sn}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=e;if(!(n.playState==="idle"||n.playState==="finished")){if(this.time){const{motionValue:l,onUpdate:u,onComplete:c,...f}=this.options,d=new ck({...f,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),h=no(this.time);l.setWithVelocity(d.sample(h-qy).value,d.sample(h).value,qy)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=e;return tue()&&r&&nue.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}function oue(t,e){let n;const r=()=>{const{currentTime:s}=e,o=(s===null?0:s.value)/100;n!==o&&t(o),n=o};return pt.update(r,!0),()=>Xi(r)}const aue=G8(()=>window.ScrollTimeline!==void 0);class lue{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e){const n=this.animations.map(r=>{if(aue()&&r.attachTimeline)r.attachTimeline(e);else return r.pause(),oue(s=>{r.time=r.duration*s},e)});return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const dk=(t,e,n,r={},s,i)=>o=>{const a=K2(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-no(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};zae(a)||(c={...c,...Vae(t,c)}),c.duration&&(c.duration=no(c.duration)),c.repeatDelay&&(c.repeatDelay=no(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),f&&!i&&e.get()!==void 0){const d=$y(c.keyframes,a);if(d!==void 0)return pt.update(()=>{c.onUpdate(d),c.onComplete()}),new lue([])}return!i&&gI.supports(c)?new gI(c):new ck(c)};function Qy(t){return!!(Pn(t)&&t.add)}function hk(t,e){t.indexOf(e)===-1&&t.push(e)}function pk(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class mk{constructor(){this.subscriptions=[]}add(e){return hk(this.subscriptions,e),()=>pk(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const yI=new Set;function gk(t,e,n){t||yI.has(e)||(console.warn(e),yI.add(e))}const bI=30,uue=t=>!isNaN(parseFloat(t));class cue{constructor(e,n={}){this.version="11.2.12",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=fa.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=fa.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uue(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&gk(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new mk);const r=this.events[e].add(n);return e==="change"?()=>{r(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=fa.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>bI)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,bI);return q8(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function lp(t,e){return new cue(t,e)}function fue(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,lp(n))}function due(t,e){const n=zy(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=wae(i[o]);fue(t,o,a)}}function wI(t){return t.getProps()[GP]}function hue({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function AI(t,e,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;const u=t.getValue("willChange");r&&(o=r);const c=[],f=s&&t.animationState&&t.animationState.getState()[s];for(const d in l){const h=t.getValue(d,(i=t.latestValues[d])!==null&&i!==void 0?i:null),p=l[d];if(p===void 0||f&&hue(f,d))continue;const m={delay:n,elapsed:0,...K2(o||{},d)};let g=!1;if(window.HandoffAppearAnimations){const v=wI(t);if(v){const A=window.HandoffAppearAnimations(v,d,h,pt);A!==null&&(m.elapsed=A,g=!0)}}h.start(dk(d,h,p,t.shouldReduceMotion&&Bl.has(d)?{type:!1}:m,t,g));const y=h.animation;y&&(Qy(u)&&(u.add(d),y.then(()=>u.remove(d))),c.push(y))}return a&&Promise.all(c).then(()=>{pt.update(()=>{a&&due(t,a)})}),c}function yk(t,e,n={}){var r;const s=zy(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(AI(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:d}=i;return pue(t,e,c+u,f,d,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function pue(t,e,n=0,r=0,s=1,i){const o=[],a=(t.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(t.variantChildren).sort(mue).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(yk(u,e,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function mue(t,e){return t.sortNodePosition(e)}function gue(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>yk(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=yk(t,e,n);else{const s=typeof e=="function"?zy(t,e,n.custom):e;r=Promise.all(AI(t,s,n))}return r.then(()=>{pt.postRender(()=>{t.notify("AnimationComplete",e)})})}const yue=[...M2].reverse(),bue=M2.length;function wue(t){return e=>Promise.all(e.map(({animation:n,options:r})=>gue(t,n,r)))}function Aue(t){let e=wue(t),n=vI(),r=!0;const s=l=>(u,c)=>{var f;const d=zy(t,c,l==="exit"?(f=t.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:p,...m}=d;u={...u,...m,...p}}return u};function i(l){e=l(t)}function o(l){const u=t.getProps(),c=t.getVariantContext(!0)||{},f=[],d=new Set;let h={},p=1/0;for(let g=0;g<bue;g++){const y=yue[g],v=n[y],A=u[y]!==void 0?u[y]:c[y],w=Xh(A),x=y===l?v.isActive:null;x===!1&&(p=g);let k=A===c[y]&&A!==u[y]&&w;if(k&&r&&t.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...h},!v.isActive&&x===null||!A&&!v.prevProp||Ly(A)||typeof A=="boolean")continue;let O=vue(v.prevProp,A)||y===l&&v.isActive&&!k&&w||g>p&&w,M=!1;const D=Array.isArray(A)?A:[A];let R=D.reduce(s(y),{});x===!1&&(R={});const{prevResolvedValues:B={}}=v,F={...B,...R},V=L=>{O=!0,d.has(L)&&(M=!0,d.delete(L)),v.needsAnimating[L]=!0;const H=t.getValue(L);H&&(H.liveStyle=!1)};for(const L in F){const H=R[L],q=B[L];if(h.hasOwnProperty(L))continue;let te=!1;V2(H)&&V2(q)?te=!E8(H,q):te=H!==q,te?H!=null?V(L):d.add(L):H!==void 0&&d.has(L)?V(L):v.protectedKeys[L]=!0}v.prevProp=A,v.prevResolvedValues=R,v.isActive&&(h={...h,...R}),r&&t.blockInitialAnimation&&(O=!1),O&&(!k||M)&&f.push(...D.map(L=>({animation:L,options:{type:y}})))}if(d.size){const g={};d.forEach(y=>{const v=t.getBaseTarget(y),A=t.getValue(y);A&&(A.liveStyle=!0),g[y]=v??null}),f.push({animation:g})}let m=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),r=!1,m?e(f):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(d=>{var h;return(h=d.animationState)===null||h===void 0?void 0:h.setActive(l,u)}),n[l].isActive=u;const f=o(l);for(const d in n)n[d].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=vI(),r=!0}}}function vue(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!E8(e,t):!1}function Ul(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vI(){return{animate:Ul(!0),whileInView:Ul(),whileHover:Ul(),whileTap:Ul(),whileDrag:Ul(),whileFocus:Ul(),exit:Ul()}}class xue extends ca{constructor(e){super(e),e.animationState||(e.animationState=Aue(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ly(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let kue=0;class Cue extends ca{constructor(){super(...arguments),this.id=kue++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Eue={animation:{Feature:xue},exit:{Feature:Cue}},xI=(t,e)=>Math.abs(t-e);function Sue(t,e){const n=xI(t.x,e.x),r=xI(t.y,e.y);return Math.sqrt(n**2+r**2)}class kI{constructor(e,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=wk(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=Sue(f.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:p}=f,{timestamp:m}=Tn;this.history.push({...p,timestamp:m});const{onStart:g,onMove:y}=this.handlers;d||(g&&g(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,d)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=bk(d,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(f,d)=>{this.end();const{onEnd:h,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=wk(f.type==="pointercancel"?this.lastMoveEventInfo:bk(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,g),p&&p(f,g)},!y8(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Vy(e),a=bk(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=Tn;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,wk(a,this.history)),this.removeListeners=to(eo(this.contextWindow,"pointermove",this.handlePointerMove),eo(this.contextWindow,"pointerup",this.handlePointerUp),eo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Xi(this.updatePoint)}}function bk(t,e){return e?{point:e(t.point)}:t}function CI(t,e){return{x:t.x-e.x,y:t.y-e.y}}function wk({point:t},e){return{point:t,delta:CI(t,EI(e)),offset:CI(t,Tue(e)),velocity:Due(e,.1)}}function Tue(t){return t[0]}function EI(t){return t[t.length-1]}function Due(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=EI(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>no(e)));)n--;if(!r)return{x:0,y:0};const i=ro(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Pr(t){return t.max-t.min}function Ak(t,e=0,n=.01){return Math.abs(t-e)<=n}function SI(t,e,n,r=.5){t.origin=r,t.originPoint=Bt(e.min,e.max,t.origin),t.scale=Pr(n)/Pr(e),(Ak(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Bt(n.min,n.max,t.origin)-t.originPoint,(Ak(t.translate)||isNaN(t.translate))&&(t.translate=0)}function up(t,e,n,r){SI(t.x,e.x,n.x,r?r.originX:void 0),SI(t.y,e.y,n.y,r?r.originY:void 0)}function TI(t,e,n){t.min=n.min+e.min,t.max=t.min+Pr(e)}function Oue(t,e,n){TI(t.x,e.x,n.x),TI(t.y,e.y,n.y)}function DI(t,e,n){t.min=e.min-n.min,t.max=t.min+Pr(e)}function cp(t,e,n){DI(t.x,e.x,n.x),DI(t.y,e.y,n.y)}function Mue(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Bt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Bt(n,t,r.max):Math.min(t,n)),t}function OI(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Nue(t,{top:e,left:n,bottom:r,right:s}){return{x:OI(t.x,n,s),y:OI(t.y,e,r)}}function MI(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function _ue(t,e){return{x:MI(t.x,e.x),y:MI(t.y,e.y)}}function Rue(t,e){let n=.5;const r=Pr(t),s=Pr(e);return s>r?n=op(e.min,e.max-r,t.min):r>s&&(n=op(t.min,t.max-s,e.min)),la(0,1,n)}function Pue(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const vk=.35;function Iue(t=vk){return t===!1?t=0:t===!0&&(t=vk),{x:NI(t,"left","right"),y:NI(t,"top","bottom")}}function NI(t,e,n){return{min:_I(t,e),max:_I(t,n)}}function _I(t,e){return typeof t=="number"?t:t[e]||0}const RI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yc=()=>({x:RI(),y:RI()}),PI=()=>({min:0,max:0}),qt=()=>({x:PI(),y:PI()});function es(t){return[t("x"),t("y")]}function II({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Lue({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Bue(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function xk(t){return t===void 0||t===1}function kk({scale:t,scaleX:e,scaleY:n}){return!xk(t)||!xk(e)||!xk(n)}function Hl(t){return kk(t)||LI(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function LI(t){return BI(t.x)||BI(t.y)}function BI(t){return t&&t!=="0%"}function Jy(t,e,n){const r=t-n,s=e*r;return n+s}function FI(t,e,n,r,s){return s!==void 0&&(t=Jy(t,s,r)),Jy(t,n,r)+e}function Ck(t,e=0,n=1,r,s){t.min=FI(t.min,e,n,r,s),t.max=FI(t.max,e,n,r,s)}function jI(t,{x:e,y:n}){Ck(t.x,e.translate,e.scale,e.originPoint),Ck(t.y,n.translate,n.scale,n.originPoint)}function Fue(t,e,n,r=!1){const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const l=i.instance;l&&l.style&&l.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Xc(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,jI(t,o)),r&&Hl(i.latestValues)&&Xc(t,i.latestValues))}e.x=UI(e.x),e.y=UI(e.y)}function UI(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function ha(t,e){t.min=t.min+e,t.max=t.max+e}function HI(t,e,[n,r,s]){const i=e[s]!==void 0?e[s]:.5,o=Bt(t.min,t.max,i);Ck(t,e[n],e[r],o,e.scale)}const jue=["x","scaleX","originX"],Uue=["y","scaleY","originY"];function Xc(t,e){HI(t.x,e,jue),HI(t.y,e,Uue)}function VI(t,e){return II(Bue(t.getBoundingClientRect(),e))}function Hue(t,e,n){const r=VI(t,n),{scroll:s}=e;return s&&(ha(r.x,s.offset.x),ha(r.y,s.offset.y)),r}const zI=({current:t})=>t?t.ownerDocument.defaultView:null,Vue=new WeakMap;class zue{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=qt(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Vy(c,"page").point)},i=(c,f)=>{const{drag:d,dragPropagation:h,onDragStart:p}=this.getProps();if(d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=v8(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),es(g=>{let y=this.getAxisMotionValue(g).get()||0;if(hi.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const A=v.layout.layoutBox[g];A&&(y=Pr(A)*(parseFloat(y)/100))}}this.originPoint[g]=y}),p&&pt.postRender(()=>p(c,f));const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(c,f)=>{const{dragPropagation:d,dragDirectionLock:h,onDirectionLock:p,onDrag:m}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:g}=f;if(h&&this.currentDirection===null){this.currentDirection=$ue(g),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),m&&m(c,f)},a=(c,f)=>this.stop(c,f),l=()=>es(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new kI(e,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:zI(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&pt.postRender(()=>i(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!Yy(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Mue(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,i=this.constraints;n&&Gc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=Nue(s.layoutBox,n):this.constraints=!1,this.elastic=Iue(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Pue(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Gc(e))return!1;const r=e.current;Yi(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Hue(r,s.root,this.visualElement.getTransformPagePoint());let o=_ue(s.layout.layoutBox,i);if(n){const a=n(Lue(o));this.hasMutatedConstraints=!!a,a&&(o=II(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=es(c=>{if(!Yy(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const d=s?200:1e6,h=s?40:1e7,p={type:"inertia",velocity:r?e[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return r.start(dk(e,r,0,n,this.visualElement))}stopAnimation(){es(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){es(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){es(n=>{const{drag:r}=this.getProps();if(!Yy(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(e[n]-Bt(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Gc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};es(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=Rue({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),es(o=>{if(!Yy(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Bt(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Vue.set(this.visualElement,this);const e=this.visualElement.current,n=eo(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Gc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pt.read(r);const o=Zi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(es(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=vk,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Yy(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function $ue(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Gue extends ca{constructor(e){super(e),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new zue(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const $I=t=>(e,n)=>{t&&pt.postRender(()=>t(e,n))};class Wue extends ca{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(e){this.session=new kI(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zI(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:$I(e),onStart:$I(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&pt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=eo(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Kue(){const t=_.useContext(Py);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,s=_.useId();return _.useEffect(()=>r(s),[]),!e&&n?[!1,()=>n&&n(s)]:[!0]}const Xy={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function GI(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fp={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ie.test(t))t=parseFloat(t);else return t;const n=GI(t,e.target.x),r=GI(t,e.target.y);return`${n}% ${r}%`}},que={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=da.parse(t);if(s.length>5)return r;const i=da.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=Bt(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};class Que extends _.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;Qoe(Jue),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Xy.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||pt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),O2.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function WI(t){const[e,n]=Kue(),r=_.useContext(_2);return S.jsx(Que,{...t,layoutGroup:r,switchLayoutGroup:_.useContext(qP),isPresent:e,safeToRemove:n})}const Jue={borderRadius:{...fp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fp,borderTopRightRadius:fp,borderBottomLeftRadius:fp,borderBottomRightRadius:fp,boxShadow:que},KI=["TopLeft","TopRight","BottomLeft","BottomRight"],Yue=KI.length,qI=t=>typeof t=="string"?parseFloat(t):t,QI=t=>typeof t=="number"||Ie.test(t);function Xue(t,e,n,r,s,i){s?(t.opacity=Bt(0,n.opacity!==void 0?n.opacity:1,Zue(r)),t.opacityExit=Bt(e.opacity!==void 0?e.opacity:1,0,ece(r))):i&&(t.opacity=Bt(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Yue;o++){const a=`border${KI[o]}Radius`;let l=JI(e,a),u=JI(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||QI(l)===QI(u)?(t[a]=Math.max(Bt(qI(l),qI(u),r),0),(hi.test(u)||hi.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=Bt(e.rotate||0,n.rotate||0,r))}function JI(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Zue=YI(0,.5,sI),ece=YI(.5,.95,Sn);function YI(t,e,n){return r=>r<t?0:r>e?1:n(op(t,e,r))}function XI(t,e){t.min=e.min,t.max=e.max}function ts(t,e){XI(t.x,e.x),XI(t.y,e.y)}function ZI(t,e,n,r,s){return t-=e,t=Jy(t,1/n,r),s!==void 0&&(t=Jy(t,1/s,r)),t}function tce(t,e=0,n=1,r=.5,s,i=t,o=t){if(hi.test(e)&&(e=parseFloat(e),e=Bt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Bt(i.min,i.max,r);t===i&&(a-=e),t.min=ZI(t.min,e,n,a,s),t.max=ZI(t.max,e,n,a,s)}function eL(t,e,[n,r,s],i,o){tce(t,e[n],e[r],e[s],e.scale,i,o)}const nce=["x","scaleX","originX"],rce=["y","scaleY","originY"];function tL(t,e,n,r){eL(t.x,e,nce,n?n.x:void 0,r?r.x:void 0),eL(t.y,e,rce,n?n.y:void 0,r?r.y:void 0)}function nL(t){return t.translate===0&&t.scale===1}function rL(t){return nL(t.x)&&nL(t.y)}function sce(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function sL(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function iL(t){return Pr(t.x)/Pr(t.y)}class ice{constructor(){this.members=[]}add(e){hk(this.members,e),e.scheduleRender()}remove(e){if(pk(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function oL(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:d,skewX:h,skewY:p}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const oce=(t,e)=>t.depth-e.depth;class ace{constructor(){this.children=[],this.isDirty=!1}add(e){hk(this.children,e),this.isDirty=!0}remove(e){pk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(oce),this.isDirty=!1,this.children.forEach(e)}}function lce(t,e){const n=fa.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Xi(r),t(i-e))};return pt.read(r,!0),()=>Xi(r)}function uce(t){window.MotionDebug&&window.MotionDebug.record(t)}function cce(t){return t instanceof SVGElement&&t.tagName!=="svg"}function fce(t,e,n){const r=Pn(t)?t:lp(t);return r.start(dk("",r,e,n)),r.animation}const Ek=["","X","Y","Z"],dce={visibility:"hidden"},aL=1e3;let hce=0;const Vl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Sk(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function lL(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;const{visualElement:e}=t.options;return e?wI(e)?!0:t.parent&&!t.parent.hasCheckedOptimisedAppear?lL(t.parent):!1:!1}function uL({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=hce++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Vl.totalNodes=Vl.resolvedTargetDeltas=Vl.recalculatedProjection=0,this.nodes.forEach(gce),this.nodes.forEach(vce),this.nodes.forEach(xce),this.nodes.forEach(yce),uce(Vl)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new ace)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new mk),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=cce(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let f;const d=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=lce(d,250),Xy.hasAnimatedSinceResize&&(Xy.hasAnimatedSinceResize=!1,this.nodes.forEach(fL))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Tce,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!sL(this.targetLayout,p)||h,A=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,A);const w={...K2(m,"layout"),onPlay:g,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else d||fL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Xi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(kce),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.HandoffCancelAllAnimations&&lL(this)&&window.HandoffCancelAllAnimations(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(cL);return}this.isUpdating||this.nodes.forEach(wce),this.isUpdating=!1,this.nodes.forEach(Ace),this.nodes.forEach(pce),this.nodes.forEach(mce),this.clearAllSnapshots();const a=fa.now();Tn.delta=la(0,1e3/60,a-Tn.timestamp),Tn.timestamp=a,Tn.isProcessing=!0,z2.update.process(Tn),z2.preRender.process(Tn),z2.render.process(Tn),Tn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,O2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(bce),this.sharedNodes.forEach(Cce)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=qt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:o,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!rL(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Hl(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Dce(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return qt();const a=o.measureViewportBox(),{scroll:l}=this.root;return l&&(ha(a.x,l.offset.x),ha(a.y,l.offset.y)),a}removeElementScroll(o){const a=qt();ts(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:f}=u;if(u!==this.root&&c&&f.layoutScroll){if(c.isRoot){ts(a,o);const{scroll:d}=this.root;d&&(ha(a.x,-d.offset.x),ha(a.y,-d.offset.y))}ha(a.x,c.offset.x),ha(a.y,c.offset.y)}}return a}applyTransform(o,a=!1){const l=qt();ts(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Xc(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Hl(c.latestValues)&&Xc(l,c.latestValues)}return Hl(this.latestValues)&&Xc(l,this.latestValues),l}removeTransform(o){const a=qt();ts(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Hl(u.latestValues))continue;kk(u.latestValues)&&u.updateSnapshot();const c=qt(),f=u.measurePageBox();ts(c,f),tL(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Hl(this.latestValues)&&tL(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Tn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:f,layoutId:d}=this.options;if(!(!this.layout||!(f||d))){if(this.resolvedRelativeTargetAt=Tn.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),cp(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),ts(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=qt(),this.targetWithTransforms=qt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Oue(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ts(this.target,this.layout.layoutBox),jI(this.target,this.targetDelta)):ts(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),cp(this.relativeTargetOrigin,this.target,h.target),ts(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Vl.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||kk(this.parent.latestValues)||LI(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Tn.timestamp&&(u=!1),u)return;const{layout:c,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||f))return;ts(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;Fue(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=qt());const{target:p}=a;if(!p){this.projectionTransform&&(this.projectionDelta=Yc(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Yc(),this.projectionDeltaWithTransform=Yc());const m=this.projectionTransform;up(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=oL(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==d||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Vl.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=Yc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=qt(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,g=this.getStack(),y=!g||g.members.length<=1,v=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(Sce));this.animationProgress=0;let A;this.mixTargetDelta=w=>{const x=w/1e3;dL(f.x,o.x,x),dL(f.y,o.y,x),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cp(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ece(this.relativeTarget,this.relativeTargetOrigin,d,x),A&&sce(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=qt()),ts(A,this.relativeTarget)),m&&(this.animationValues=c,Xue(c,u,this.latestValues,x,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Xi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{Xy.hasAnimatedSinceResize=!0,this.currentAnimation=fce(0,aL,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(aL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&yL(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||qt();const f=Pr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const d=Pr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}ts(a,l),Xc(a,c),up(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ice),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Sk("z",o,u,this.animationValues);for(let c=0;c<Ek.length;c++)Sk(`rotate${Ek[c]}`,o,u,this.animationValues),Sk(`skew${Ek[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return dce;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Hy(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Hy(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Hl(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=oL(this.projectionDeltaWithTransform,this.treeScale,d),c&&(u.transform=c(d,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=d.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:u.opacity=f===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in Fy){if(d[m]===void 0)continue;const{correct:g,applyTo:y}=Fy[m],v=u.transform==="none"?d[m]:g(d[m],f);if(y){const A=y.length;for(let w=0;w<A;w++)u[y[w]]=v}else u[m]=v}return this.options.layoutId&&(u.pointerEvents=f===this?Hy(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(cL),this.root.sharedNodes.clear()}}}function pce(t){t.updateLayout()}function mce(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;i==="size"?es(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Pr(d);d.min=r[f].min,d.max=d.min+h}):yL(i,n.layoutBox,r)&&es(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Pr(r[f]);d.max=d.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+h)});const a=Yc();up(a,r,n.layoutBox);const l=Yc();o?up(l,t.applyTransform(s,!0),n.measuredBox):up(l,r,n.layoutBox);const u=!rL(a);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=qt();cp(p,n.layoutBox,d.layoutBox);const m=qt();cp(m,r,h.layoutBox),sL(p,m)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function gce(t){Vl.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function yce(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function bce(t){t.clearSnapshot()}function cL(t){t.clearMeasurements()}function wce(t){t.isLayoutDirty=!1}function Ace(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function fL(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function vce(t){t.resolveTargetDelta()}function xce(t){t.calcProjection()}function kce(t){t.resetSkewAndRotation()}function Cce(t){t.removeLeadSnapshot()}function dL(t,e,n){t.translate=Bt(e.translate,0,n),t.scale=Bt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function hL(t,e,n,r){t.min=Bt(e.min,n.min,r),t.max=Bt(e.max,n.max,r)}function Ece(t,e,n,r){hL(t.x,e.x,n.x,r),hL(t.y,e.y,n.y,r)}function Sce(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Tce={duration:.45,ease:[.4,0,.1,1]},pL=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),mL=pL("applewebkit/")&&!pL("chrome/")?Math.round:Sn;function gL(t){t.min=mL(t.min),t.max=mL(t.max)}function Dce(t){gL(t.x),gL(t.y)}function yL(t,e,n){return t==="position"||t==="preserve-aspect"&&!Ak(iL(e),iL(n),.2)}const Oce=uL({attachResizeListener:(t,e)=>Zi(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Tk={current:void 0},bL=uL({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Tk.current){const t=new Oce({});t.mount(window),t.setOptions({layoutScroll:!0}),Tk.current=t}return Tk.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Mce={pan:{Feature:Wue},drag:{Feature:Gue,ProjectionNode:bL,MeasureLayout:WI}},Dk={current:null},wL={current:!1};function Nce(){if(wL.current=!0,!!S2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Dk.current=t.matches;t.addListener(e),e()}else Dk.current=!1}function _ce(t,e,n){const{willChange:r}=e;for(const s in e){const i=e[s],o=n[s];if(Pn(i))t.addValue(s,i),Qy(r)&&r.add(s),process.env.NODE_ENV==="development"&&gk(i.version==="11.2.12",`Attempting to mix Framer Motion versions ${i.version} with 11.2.12 may not work as expected.`);else if(Pn(o))t.addValue(s,lp(i,{owner:t})),Qy(r)&&r.remove(s);else if(o!==i)if(t.hasValue(s)){const a=t.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(s);t.addValue(s,lp(a!==void 0?a:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const AL=new WeakMap,Rce=[...R8,In,da],Pce=t=>Rce.find(_8(t)),vL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ice=N2.length;class Lce{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.resolveKeyframes=(d,h,p,m)=>new this.KeyframeResolver(d,h,p,m,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=J2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>pt.render(this.render,!1,!0);const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=By(n),this.isVariantNode=YP(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&Pn(h)&&(h.set(l[d],!1),Qy(c)&&c.add(d))}}mount(e){this.current=e,AL.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),wL.current||Nce(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Dk.current,process.env.NODE_ENV!=="production"&&gk(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){AL.delete(this.current),this.projection&&this.projection.unmount(),Xi(this.notifyUpdate),Xi(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){const r=Bl.has(e),s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&pt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{s(),i(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Wc){const n=Wc[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<vL.length;r++){const s=vL[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=_ce(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<Ice;r++){const s=N2[r],i=this.props[s];(Xh(i)||i===!1)&&(n[s]=i)}return n}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=lp(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(T8(s)||S8(s))?s=parseFloat(s):!Pce(s)&&da.test(n)&&(s=z8(e,n)),this.setBaseTarget(e,Pn(s)?s.get():s)),Pn(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=H2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[e])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Pn(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new mk),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class xL extends Lce{constructor(){super(...arguments),this.KeyframeResolver=$8}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}}function Bce(t){return window.getComputedStyle(t)}class Fce extends xL{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(Bl.has(n)){const r=tk(n);return r&&r.default||0}else{const r=Bce(e),s=(n8(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return VI(e,n)}build(e,n,r,s){L2(e,n,r,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return U2(e,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Pn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,r,s){c8(e,n,r,s)}}class jce extends xL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Bl.has(n)){const r=tk(n);return r&&r.default||0}return n=f8.has(n)?n:D2(n),e.getAttribute(n)}measureInstanceViewportBox(){return qt()}scrapeMotionValuesFromProps(e,n,r){return h8(e,n,r)}build(e,n,r,s){F2(e,n,r,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,r,s){d8(e,n,r,s)}mount(e){this.isSVGTag=j2(e.tagName),super.mount(e)}}const Uce=(t,e)=>R2(t)?new jce(e,{enableHardwareAcceleration:!1}):new Fce(e,{allowProjection:t!==_.Fragment,enableHardwareAcceleration:!0}),Hce={...Eue,...Bae,...Mce,...{layout:{ProjectionNode:bL,MeasureLayout:WI}}},Vce=Koe((t,e)=>Cae(t,e,Hce,Uce));function kL(){const t=_.useRef(!1);return T2(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function zce(){const t=kL(),[e,n]=_.useState(0),r=_.useCallback(()=>{t.current&&n(e+1)},[e]);return[_.useCallback(()=>pt.postRender(r),[r]),e]}class $ce extends z.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Gce({children:t,isPresent:e}){const n=_.useId(),r=_.useRef(null),s=_.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=_.useContext(E2);return _.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:u}=s.current;if(e||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
483
|
+
`?s.slice(0,-1):s};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const hte=wt.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new bt({key:new Mt("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return jp.fromSchema(this.editor.schema).parseSlice(ox(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),pte=wt.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=m7.Commands.config.addCommands();return{setContent:(e,n,r)=>s=>t.setContent(s.editor.storage.markdown.parser.parse(e),n,r)(s),insertContentAt:(e,n,r)=>s=>t.insertContentAt(e,s.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(s)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new dte(this.editor,this.options),serializer:new fte(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[Pee.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),hte.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),mte=[tq,ZK.configure({strike:{HTMLAttributes:{class:"select-text pointer-events-auto"}},bold:{HTMLAttributes:{class:"select-text pointer-events-auto"}},italic:{HTMLAttributes:{class:"select-text pointer-events-auto"}},heading:{HTMLAttributes:{class:"select-text pointer-events-auto"}},paragraph:{HTMLAttributes:{class:"select-text pointer-events-auto"}},orderedList:{HTMLAttributes:{class:"flex flex-col items-start list-decimal list-outside space-y-4 ml-6"}},blockquote:{HTMLAttributes:{class:"rounded-lg bg-[#E8EBEC] p-5 font-serif italic text-black"}},codeBlock:{HTMLAttributes:{class:"rounded-lg bg-transparent border border-[#DDE2E4] p-5 font-mono font-medium text-black"},exitOnArrowDown:!0},code:{HTMLAttributes:{class:"rounded bg-transparent p-1.5 font-mono font-medium text-black text-sm",spellcheck:"false"}},history:!1,gapcursor:!1,dropcursor:!1,document:!1,horizontalRule:!1,bulletList:!1,listItem:!1}),QM.configure({depth:10,newGroupDelay:100}),nq.configure({types:["heading","paragraph"]}),Pq,Eq.extend({exitable:!0}).configure({HTMLAttributes:{class:"text-blue-500 font-bold transition-colors cursor-pointer select-text pointer-events-auto"},openOnClick:!0,autolink:!1}),Sq.configure({placeholder:()=>"",includeChildren:!0,showOnlyCurrent:!0}),Oq.configure({multicolor:!0}),Rq.configure({HTMLAttributes:{class:"select-text pointer-events-auto"}}),eq,Bq,Mq.configure({HTMLAttributes:{class:"not-prose space-y-4 !ml-0"}}),_q.configure({HTMLAttributes:{class:"flex items-start"},nested:!0}),jM.configure({HTMLAttributes:{class:"space-y-4 !ml-6"}}),YM.configure({HTMLAttributes:{class:"leading-normal"}}),HM.configure({width:3,color:"#d1d5db"}),VM,gJ,RY,_Y,...NY,Wq.configure({uploadFn:HU}),Lq,Fq,Vq,IY,Iq,pte.configure({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!0,breaks:!0,transformPastedText:!0,transformCopiedText:!1})],gte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAE/SURBVHgBhVJBTsJQEH3zMcElR+gRuIF6gwYPAOwkLoQTUE6ArEA3xbWJ4gnQE8gNwBuwhMR2fPNLk9o0ZZImM/P/e39e3wgqojPXXiPFJnFovw1kWT53xSKca3C70LXlr/eySYFdZ6Fb61eCePnBCb6VF3P21UA+WX+wv+086fgfyMbh4aPlqWJSZH2/k6EINlBEJI6tdxHG2tIDrsUqxYzsO5Qi+UXfNfwUPT7w49wRU1EyZWNFqIgV9REw84Wga+P1Uj7PsW5QE9pEZMT8Aq+JQmNcYl8HwgEtEvf9fc3RR4zrMCRe84WA6dJRz8upPwyftV0FOP3ugHqu0iZGzsSbF3bYUMRlgDdWMcyE4WvVl73XRC9CNiaqaHMDpkUQrYh8kmKUmy5lVpvdBNs2mOk0tptk9a5AVKHhzML+AZaSjR/r++n9AAAAAElFTkSuQmCC",yte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEjSURBVHgBjZJBToNQEIb/NzTeoMbGjTeoN5Au1S7wBrqwyk5OoD1B46pRF9UbsEBc9nmEHsI08QhGZnxMpaGUEv4EwoP/mxnyj0GNTp++AoPORA+Gx+mo91r1mOJh+LL0WYwDqC8i/obJGCuSfRJ1bHLdtWtQIaY5WoiYBknYtZQfmOGjpTIvC7TAahTvpMksmUQCvK0A6itzNl1egmi2k2K+2gPsD+mvHGkh4MIVoPuSLYbIYxOk3YAJVRuktwd3DhjvggqRB0Slc3D+/D1Lw95DE5Rnq3E487ySXeyu4zooz/R9tD/QUYV5Ufke1HbKvW4RdFS9icRoKeKO1c7Fi+HUbQ/BzzPdXjmxDCy8TOIk7G2CZf1nqzEJfqOPm8Otif4AFnp3K1F5HHAAAAAASUVORK5CYII=",bte=t=>{const e=document.createElement("span");e.classList.add("collaboration-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");return n.classList.add("collaboration-cursor__label"),n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null),e.insertBefore(n,null),e},wte=t=>{const e=document.createElement("span");e.classList.add("custom-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.classList.add("custom-cursor__label-container"),n.setAttribute("style",`border: 1px solid ${t.color}`);const r=document.createElement("img");r.src=gte,r.classList.add("custom-cursor__icon");const s=document.createElement("div");s.classList.add("custom-cursor__label");const i=document.createElement("span");i.classList.add("custom-cursor__text"),i.textContent=t.name;const o=document.createElement("img");return o.src=yte,o.classList.add("custom-cursor__badge"),s.appendChild(i),n.appendChild(r),n.appendChild(s),n.appendChild(o),e.appendChild(n),e},Ate=t=>t.isEns?wte(t):bte(t),vte="6.13.1";function xte(t,e,n){const r=e.split("|").map(i=>i.trim());for(let i=0;i<r.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${n}`,s.value=t,s}async function _n(t){const e=Object.keys(t);return(await Promise.all(e.map(r=>Promise.resolve(t[r])))).reduce((r,s,i)=>(r[e[i]]=s,r),{})}function Me(t,e,n){for(let r in e){let s=e[r];const i=n?n[r]:null;i&&xte(s,i,r),Object.defineProperty(t,r,{enumerable:!0,value:s,writable:!1})}}function kc(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(kc).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r<t.length;r++)n+=e[t[r]>>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return kc(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${kc(n)}: ${kc(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function gn(t,e){return t&&t.code===e}function lx(t){return gn(t,"CALL_EXCEPTION")}function _t(t,e,n){let r=t;{const i=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${kc(n)}`);for(const o in n){if(o==="shortMessage")continue;const a=n[o];i.push(o+"="+kc(a))}}i.push(`code=${e}`),i.push(`version=${vte}`),i.length&&(t+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(t);break;default:s=new Error(t)}return Me(s,{code:e}),n&&Object.assign(s,n),s.shortMessage==null&&Me(s,{shortMessage:r}),s}function ee(t,e,n,r){if(!t)throw _t(e,n,r)}function G(t,e,n,r){ee(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function j6(t,e,n){n==null&&(n=""),n&&(n=": "+n),ee(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ee(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function jg(t,e,n){if(n==null&&(n=""),t!==e){let r=n,s="new";n&&(r+=".",s+=" "+n),ee(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function U6(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let s=2;for(let i=0;i<r.length;i++)r[i]=parseInt(t.substring(s,s+2),16),s+=2;return r}G(!1,"invalid BytesLike value",e||"value",t)}function ct(t,e){return U6(t,e,!1)}function Gn(t,e){return U6(t,e,!0)}function St(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function ux(t){return St(t,!0)||t instanceof Uint8Array}const H6="0123456789abcdef";function we(t){const e=ct(t);let n="0x";for(let r=0;r<e.length;r++){const s=e[r];n+=H6[(s&240)>>4]+H6[s&15]}return n}function $t(t){return"0x"+t.map(e=>we(e).substring(2)).join("")}function Cc(t){return St(t,!0)?(t.length-2)/2:ct(t).length}function Vt(t,e,n){const r=ct(t);return n!=null&&n>r.length&&ee(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),we(r.slice(e??0,n??r.length))}function V6(t,e,n){const r=ct(t);ee(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),n?s.set(r,e-r.length):s.set(r,0),we(s)}function xl(t,e){return V6(t,e,!0)}function kte(t,e){return V6(t,e,!1)}const Ug=BigInt(0),Cs=BigInt(1),Ec=9007199254740991;function Cte(t,e){const n=Hg(t,"value"),r=BigInt(Qe(e,"width"));if(ee(n>>r===Ug,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-Cs){const s=(Cs<<r)-Cs;return-((~n&s)+Cs)}return n}function z6(t,e){let n=Ee(t,"value");const r=BigInt(Qe(e,"width")),s=Cs<<r-Cs;if(n<Ug){n=-n,ee(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const i=(Cs<<r)-Cs;return(~n&i)+Cs}else ee(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return n}function Dh(t,e){const n=Hg(t,"value"),r=BigInt(Qe(e,"bits"));return n&(Cs<<r)-Cs}function Ee(t,e){switch(typeof t){case"bigint":return t;case"number":return G(Number.isInteger(t),"underflow",e||"value",t),G(t>=-Ec&&t<=Ec,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){G(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}G(!1,"invalid BigNumberish value",e||"value",t)}function Hg(t,e){const n=Ee(t,e);return ee(n>=Ug,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const $6="0123456789abcdef";function cx(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=$6[n>>4],e+=$6[n&15];return BigInt(e)}return Ee(t)}function Qe(t,e){switch(typeof t){case"bigint":return G(t>=-Ec&&t<=Ec,"overflow",e||"value",t),Number(t);case"number":return G(Number.isInteger(t),"underflow",e||"value",t),G(t>=-Ec&&t<=Ec,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Qe(BigInt(t),e)}catch(n){G(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}G(!1,"invalid numeric value",e||"value",t)}function Ete(t){return Qe(cx(t))}function Zo(t,e){let r=Hg(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const s=Qe(e,"width");for(ee(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<s*2;)r="0"+r}return"0x"+r}function Wn(t){const e=Hg(t,"value");if(e===Ug)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let s=0;s<r.length;s++){const i=s*2;r[s]=parseInt(n.substring(i,i+2),16)}return r}function kl(t){let e=we(ux(t)?t:Wn(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const G6="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const W6=BigInt(58);function Ste(t){const e=ct(t);let n=cx(e),r="";for(;n;)r=G6[Number(n%W6)]+r,n/=W6;for(let s=0;s<e.length&&!e[s];s++)r=G6[0]+r;return r}function Tte(t){t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return ct(e)}function Dte(t){const e=ct(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}class K6{constructor(e,n,r){W(this,"filter");W(this,"emitter");J(this,Zc);I(this,Zc,n),Me(this,{emitter:e,filter:r})}async removeListener(){T(this,Zc)!=null&&await this.emitter.off(this.filter,T(this,Zc))}}Zc=new WeakMap;function Ote(t,e,n,r,s){G(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function q6(t,e,n,r,s){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let i=0;for(let o=e+1;o<n.length&&n[o]>>6===2;o++)i++;return i}return t==="OVERRUN"?n.length-e-1:0}function Mte(t,e,n,r,s){return t==="OVERLONG"?(G(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),q6(t,e,n))}const Nte=Object.freeze({error:Ote,ignore:q6,replace:Mte});function _te(t,e){e==null&&(e=Nte.error);const n=ct(t,"bytes"),r=[];let s=0;for(;s<n.length;){const i=n[s++];if(!(i>>7)){r.push(i);continue}let o=null,a=null;if((i&224)===192)o=1,a=127;else if((i&240)===224)o=2,a=2047;else if((i&248)===240)o=3,a=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,n,r):s+=e("BAD_PREFIX",s-1,n,r);continue}if(s-1+o>=n.length){s+=e("OVERRUN",s-1,n,r);continue}let l=i&(1<<8-o-1)-1;for(let u=0;u<o;u++){let c=n[s];if((c&192)!=128){s+=e("MISSING_CONTINUE",s,n,r),l=null;break}l=l<<6|c&63,s++}if(l!==null){if(l>1114111){s+=e("OUT_OF_RANGE",s-1-o,n,r,l);continue}if(l>=55296&&l<=57343){s+=e("UTF16_SURROGATE",s-1-o,n,r,l);continue}if(l<=a){s+=e("OVERLONG",s-1-o,n,r,l);continue}r.push(l)}}return r}function Vi(t,e){G(typeof t=="string","invalid string value","str",t);let n=[];for(let r=0;r<t.length;r++){const s=t.charCodeAt(r);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){r++;const i=t.charCodeAt(r);G(r<t.length&&(i&64512)===56320,"invalid surrogate pair","str",t);const o=65536+((s&1023)<<10)+(i&1023);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return new Uint8Array(n)}function Rte(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Sc(t,e){return Rte(_te(t,e))}function Q6(t){async function e(n,r){ee(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=n.url.split(":")[0].toLowerCase();ee(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),ee(s==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null;const o=new AbortController,a=setTimeout(()=>{i=_t("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{i=_t("request cancelled","CANCELLED"),o.abort()});const l={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:o.signal};let u;try{u=await fetch(n.url,l)}catch(h){throw clearTimeout(a),i||h}clearTimeout(a);const c={};u.headers.forEach((h,p)=>{c[p.toLowerCase()]=h});const f=await u.arrayBuffer(),d=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:c,body:d}}return e}const Pte=12,Ite=250;let J6=Q6();const Lte=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Bte=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let fx=!1;async function Y6(t,e){try{const n=t.match(Lte);if(!n)throw new Error("invalid data");return new ea(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Tte(n[3]):jte(n[3]))}catch{return new ea(599,"BAD REQUEST (invalid data: URI)",{},null,new Kn(t))}}function X6(t){async function e(n,r){try{const s=n.match(Bte);if(!s)throw new Error("invalid link");return new Kn(`${t}${s[2]}`)}catch{return new ea(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Kn(n))}}return e}const Vg={data:Y6,ipfs:X6("https://gateway.ipfs.io/ipfs/")},Z6=new WeakMap;class Fte{constructor(e){J(this,$l);J(this,pa);I(this,$l,[]),I(this,pa,!1),Z6.set(e,()=>{if(!T(this,pa)){I(this,pa,!0);for(const n of T(this,$l))setTimeout(()=>{n()},0);I(this,$l,[])}})}addListener(e){ee(!T(this,pa),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),T(this,$l).push(e)}get cancelled(){return T(this,pa)}checkSignal(){ee(!this.cancelled,"cancelled","CANCELLED",{})}}$l=new WeakMap,pa=new WeakMap;function zg(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}const Zy=class Zy{constructor(e){J(this,ql);J(this,ef);J(this,tf);J(this,Os);J(this,so);J(this,nf);J(this,rf);J(this,wn);J(this,Ir);J(this,io);J(this,Gl);J(this,Wl);J(this,Kl);J(this,pi);J(this,Ms);J(this,ma);I(this,rf,String(e)),I(this,ef,!1),I(this,tf,!0),I(this,Os,{}),I(this,so,""),I(this,nf,3e5),I(this,Ms,{slotInterval:Ite,maxAttempts:Pte}),I(this,ma,null)}get url(){return T(this,rf)}set url(e){I(this,rf,String(e))}get body(){return T(this,wn)==null?null:new Uint8Array(T(this,wn))}set body(e){if(e==null)I(this,wn,void 0),I(this,Ir,void 0);else if(typeof e=="string")I(this,wn,Vi(e)),I(this,Ir,"text/plain");else if(e instanceof Uint8Array)I(this,wn,e),I(this,Ir,"application/octet-stream");else if(typeof e=="object")I(this,wn,Vi(JSON.stringify(e))),I(this,Ir,"application/json");else throw new Error("invalid body")}hasBody(){return T(this,wn)!=null}get method(){return T(this,so)?T(this,so):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),I(this,so,String(e).toUpperCase())}get headers(){const e=Object.assign({},T(this,Os));return T(this,io)&&(e.authorization=`Basic ${Dte(Vi(T(this,io)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&T(this,Ir)&&(e["content-type"]=T(this,Ir)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){T(this,Os)[String(e).toLowerCase()]=String(n)}clearHeaders(){I(this,Os,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return T(this,io)||null}setCredentials(e,n){G(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),I(this,io,`${e}:${n}`)}get allowGzip(){return T(this,tf)}set allowGzip(e){I(this,tf,!!e)}get allowInsecureAuthentication(){return!!T(this,ef)}set allowInsecureAuthentication(e){I(this,ef,!!e)}get timeout(){return T(this,nf)}set timeout(e){G(e>=0,"timeout must be non-zero","timeout",e),I(this,nf,e)}get preflightFunc(){return T(this,Gl)||null}set preflightFunc(e){I(this,Gl,e)}get processFunc(){return T(this,Wl)||null}set processFunc(e){I(this,Wl,e)}get retryFunc(){return T(this,Kl)||null}set retryFunc(e){I(this,Kl,e)}get getUrlFunc(){return T(this,ma)||J6}set getUrlFunc(e){I(this,ma,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${T(this,wn)?we(T(this,wn)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(T(this,Ms).slotInterval=e.slotInterval),e.maxAttempts!=null&&(T(this,Ms).maxAttempts=e.maxAttempts)}send(){return ee(T(this,pi)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),I(this,pi,new Fte(this)),fe(this,ql,Dp).call(this,0,e4()+this.timeout,0,this,new ea(0,"",{},null,this))}cancel(){ee(T(this,pi)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=Z6.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ee(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const s=new Zy(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,I(s,Os,Object.assign({},T(this,Os))),T(this,wn)&&I(s,wn,new Uint8Array(T(this,wn))),I(s,Ir,T(this,Ir)),s}clone(){const e=new Zy(this.url);return I(e,so,T(this,so)),T(this,wn)&&I(e,wn,T(this,wn)),I(e,Ir,T(this,Ir)),I(e,Os,Object.assign({},T(this,Os))),I(e,io,T(this,io)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),I(e,Gl,T(this,Gl)),I(e,Wl,T(this,Wl)),I(e,Kl,T(this,Kl)),I(e,Ms,Object.assign({},T(this,Ms))),I(e,ma,T(this,ma)),e}static lockConfig(){fx=!0}static getGateway(e){return Vg[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(fx)throw new Error("gateways locked");Vg[e]=n}static registerGetUrl(e){if(fx)throw new Error("gateways locked");J6=e}static createGetUrlFunc(e){return Q6()}static createDataGateway(){return Y6}static createIpfsGatewayFunc(e){return X6(e)}};ef=new WeakMap,tf=new WeakMap,Os=new WeakMap,so=new WeakMap,nf=new WeakMap,rf=new WeakMap,wn=new WeakMap,Ir=new WeakMap,io=new WeakMap,Gl=new WeakMap,Wl=new WeakMap,Kl=new WeakMap,pi=new WeakMap,Ms=new WeakMap,ma=new WeakMap,ql=new WeakSet,Dp=async function(e,n,r,s,i){var c,f,d;if(e>=T(this,Ms).maxAttempts)return i.makeServerError("exceeded maximum retry limit");ee(e4()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await Ute(r);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in Vg){const h=await Vg[a](o.url,zg(T(s,pi)));if(h instanceof ea){let p=h;if(this.processFunc){zg(T(s,pi));try{p=await this.processFunc(o,p)}catch(m){(m.throttle==null||typeof m.stall!="number")&&p.makeServerError("error in post-processing function",m).assertOk()}}return p}o=h}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,zg(T(s,pi)));let u=new ea(l.statusCode,l.statusMessage,l.headers,l.body,s);if(u.statusCode===301||u.statusCode===302){try{const h=u.headers.location||"";return fe(c=o.redirect(h),ql,Dp).call(c,e+1,n,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const h=u.headers["retry-after"];let p=T(this,Ms).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(p=parseInt(h)),fe(f=o.clone(),ql,Dp).call(f,e+1,n,p,s,u)}if(this.processFunc){zg(T(s,pi));try{u=await this.processFunc(o,u)}catch(h){(h.throttle==null||typeof h.stall!="number")&&u.makeServerError("error in post-processing function",h).assertOk();let p=T(this,Ms).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(p=h.stall),fe(d=o.clone(),ql,Dp).call(d,e+1,n,p,s,u)}}return u};let Kn=Zy;const Mk=class Mk{constructor(e,n,r,s,i){J(this,dp);J(this,hp);J(this,pp);J(this,Lr);J(this,sf);J(this,Ql);I(this,dp,e),I(this,hp,n),I(this,pp,Object.keys(r).reduce((o,a)=>(o[a.toLowerCase()]=String(r[a]),o),{})),I(this,Lr,s==null?null:new Uint8Array(s)),I(this,sf,i||null),I(this,Ql,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${T(this,Lr)?we(T(this,Lr)):"null"}>`}get statusCode(){return T(this,dp)}get statusMessage(){return T(this,hp)}get headers(){return Object.assign({},T(this,pp))}get body(){return T(this,Lr)==null?null:new Uint8Array(T(this,Lr))}get bodyText(){try{return T(this,Lr)==null?"":Sc(T(this,Lr))}catch{ee(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ee(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,n){let r;e?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${e})`);const s=new Mk(599,r,this.headers,this.body,T(this,sf)||void 0);return I(s,Ql,{message:e,error:n}),s}throwThrottleError(e,n){n==null?n=-1:G(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw Me(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return T(this,Lr)!=null}get request(){return T(this,sf)}ok(){return T(this,Ql).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=T(this,Ql);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{T(this,Lr)&&(s=Sc(T(this,Lr)))}catch{}ee(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};dp=new WeakMap,hp=new WeakMap,pp=new WeakMap,Lr=new WeakMap,sf=new WeakMap,Ql=new WeakMap;let ea=Mk;function e4(){return new Date().getTime()}function jte(t){return Vi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function Ute(t){return new Promise(e=>setTimeout(e,t))}function Hte(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function t4(t,e,n){let r=0;for(let s=0;s<n;s++)r=r*256+t[e+s];return r}function n4(t,e,n,r){const s=[];for(;n<e+1+r;){const i=r4(t,n);s.push(i.result),n+=i.consumed,ee(n<=e+1+r,"child data too short","BUFFER_OVERRUN",{buffer:t,length:r,offset:e})}return{consumed:1+r,result:s}}function r4(t,e){ee(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const n=r=>{ee(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const s=t4(t,e+1,r);return n(e+1+r+s),n4(t,e,e+1+r,r+s)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),n4(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const s=t4(t,e+1,r);n(e+1+r+s);const i=we(t.slice(e+1+r,e+1+r+s));return{consumed:1+r+s,result:i}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const s=we(t.slice(e+1,e+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:Hte(t[e])}}function $g(t){const e=ct(t,"data"),n=r4(e,0);return G(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function s4(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function i4(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(i){r=r.concat(i4(i))}),r.length<=55)return r.unshift(192+r.length),r;const s=s4(r.length);return s.unshift(247+s.length),s.concat(r)}const e=Array.prototype.slice.call(ct(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=s4(e.length);return n.unshift(183+n.length),n.concat(e)}const o4="0123456789abcdef";function Cl(t){let e="0x";for(const n of i4(t))e+=o4[n>>4],e+=o4[n&15];return e}const qn=32,dx=new Uint8Array(qn),Vte=["then"],Gg={},a4=new WeakMap;function El(t){return a4.get(t)}function l4(t,e){a4.set(t,e)}function Oh(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}function hx(t,e,n){return t.indexOf(null)>=0?e.map((r,s)=>r instanceof Tc?hx(El(r),r,n):r):t.reduce((r,s,i)=>{let o=e.getValue(s);return s in r||(n&&o instanceof Tc&&(o=hx(El(o),o,n)),r[s]=o),r},{})}const af=class af extends Array{constructor(...n){const r=n[0];let s=n[1],i=(n[2]||[]).slice(),o=!0;r!==Gg&&(s=n,i=[],o=!1);super(s.length);J(this,of);s.forEach((u,c)=>{this[c]=u});const a=i.reduce((u,c)=>(typeof c=="string"&&u.set(c,(u.get(c)||0)+1),u),new Map);if(l4(this,Object.freeze(s.map((u,c)=>{const f=i[c];return f!=null&&a.get(f)===1?f:null}))),I(this,of,[]),T(this,of)==null&&T(this,of),!o)return;Object.freeze(this);const l=new Proxy(this,{get:(u,c,f)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Qe(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const p=u[h];return p instanceof Error&&Oh(`index ${h}`,p),p}if(Vte.indexOf(c)>=0)return Reflect.get(u,c,f);const d=u[c];if(d instanceof Function)return function(...h){return d.apply(this===f?u:this,h)};if(!(c in u))return u.getValue.apply(this===f?u:this,[c])}return Reflect.get(u,c,f)}});return l4(l,El(this)),l}toArray(n){const r=[];return this.forEach((s,i)=>{s instanceof Error&&Oh(`index ${i}`,s),n&&s instanceof af&&(s=s.toArray(n)),r.push(s)}),r}toObject(n){const r=El(this);return r.reduce((s,i,o)=>(ee(i!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),hx(r,this,n)),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const s=El(this),i=[],o=[];for(let a=n;a<r;a++)i.push(this[a]),o.push(s[a]);return new af(Gg,i,o)}filter(n,r){const s=El(this),i=[],o=[];for(let a=0;a<this.length;a++){const l=this[a];l instanceof Error&&Oh(`index ${a}`,l),n.call(r,l,a,this)&&(i.push(l),o.push(s[a]))}return new af(Gg,i,o)}map(n,r){const s=[];for(let i=0;i<this.length;i++){const o=this[i];o instanceof Error&&Oh(`index ${i}`,o),s.push(n.call(r,o,i,this))}return s}getValue(n){const r=El(this).indexOf(n);if(r===-1)return;const s=this[r];return s instanceof Error&&Oh(`property ${JSON.stringify(n)}`,s.error),s}static fromItems(n,r){return new af(Gg,n,r)}};of=new WeakMap;let Tc=af;function u4(t){let e=Wn(t);return ee(e.length<=qn,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:qn,offset:e.length}),e.length!==qn&&(e=Gn($t([dx.slice(e.length%qn),e]))),e}class zi{constructor(e,n,r,s){W(this,"name");W(this,"type");W(this,"localName");W(this,"dynamic");Me(this,{name:e,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,n){G(!1,e,this.localName,n)}}class px{constructor(){J(this,lf);J(this,oo);J(this,Jl);I(this,oo,[]),I(this,Jl,0)}get data(){return $t(T(this,oo))}get length(){return T(this,Jl)}appendWriter(e){return fe(this,lf,ob).call(this,Gn(e.data))}writeBytes(e){let n=Gn(e);const r=n.length%qn;return r&&(n=Gn($t([n,dx.slice(r)]))),fe(this,lf,ob).call(this,n)}writeValue(e){return fe(this,lf,ob).call(this,u4(e))}writeUpdatableValue(){const e=T(this,oo).length;return T(this,oo).push(dx),I(this,Jl,T(this,Jl)+qn),n=>{T(this,oo)[e]=u4(n)}}}oo=new WeakMap,Jl=new WeakMap,lf=new WeakSet,ob=function(e){return T(this,oo).push(e),I(this,Jl,T(this,Jl)+e.length),e.length};const Nk=class Nk{constructor(e,n,r){J(this,Zl);W(this,"allowLoose");J(this,pr);J(this,Br);J(this,Yl);J(this,Xl);J(this,ga);Me(this,{allowLoose:!!n}),I(this,pr,Gn(e)),I(this,Yl,0),I(this,Xl,null),I(this,ga,r??1024),I(this,Br,0)}get data(){return we(T(this,pr))}get dataLength(){return T(this,pr).length}get consumed(){return T(this,Br)}get bytes(){return new Uint8Array(T(this,pr))}subReader(e){const n=new Nk(T(this,pr).slice(T(this,Br)+e),this.allowLoose,T(this,ga));return I(n,Xl,this),n}readBytes(e,n){let r=fe(this,Zl,OL).call(this,0,e,!!n);return fe(this,Zl,Uk).call(this,e),I(this,Br,T(this,Br)+r.length),r.slice(0,e)}readValue(){return cx(this.readBytes(qn))}readIndex(){return Ete(this.readBytes(qn))}};pr=new WeakMap,Br=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,ga=new WeakMap,Zl=new WeakSet,Uk=function(e){var n;if(T(this,Xl))return fe(n=T(this,Xl),Zl,Uk).call(n,e);I(this,Yl,T(this,Yl)+e),ee(T(this,ga)<1||T(this,Yl)<=T(this,ga)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${T(this,ga)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Gn(T(this,pr)),offset:T(this,Br),length:e,info:{bytesRead:T(this,Yl),dataLength:this.dataLength}})},OL=function(e,n,r){let s=Math.ceil(n/qn)*qn;return T(this,Br)+s>T(this,pr).length&&(this.allowLoose&&r&&T(this,Br)+n<=T(this,pr).length?s=n:ee(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Gn(T(this,pr)),length:T(this,pr).length,offset:T(this,Br)+s})),T(this,pr).slice(T(this,Br),T(this,Br)+s)};let mx=Nk;function Wg(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function gx(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function zte(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Wg(t.outputLen),Wg(t.blockLen)}function Dc(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function c4(t,e){gx(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const yx=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const f4=t=>t instanceof Uint8Array,$te=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),bx=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ci=(t,e)=>t<<32-e|t>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function Gte(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Kg(t){if(typeof t=="string"&&(t=Gte(t)),!f4(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Wte(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!f4(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class wx{clone(){return this._cloneInto()}}function Ax(t){const e=r=>t().update(Kg(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Kte(t=32){if(yx&&typeof yx.getRandomValues=="function")return yx.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class d4 extends wx{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,zte(e);const r=Kg(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return Dc(this),this.iHash.update(e),this}digestInto(e){Dc(this),gx(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const h4=(t,e,n)=>new d4(t,e).update(n).digest();h4.create=(t,e)=>new d4(t,e);function qte(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),l=r?4:0,u=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+u,a,r)}class p4 extends wx{constructor(e,n,r,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=bx(this.buffer)}update(e){Dc(this);const{view:n,buffer:r,blockLen:s}=this;e=Kg(e);const i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const l=bx(e);for(;s<=i-o;o+=s)this.process(l,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Dc(this),c4(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;qte(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=bx(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,c[f],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%n&&e.buffer.set(r),e}}const Qte=(t,e,n)=>t&e^~t&n,Jte=(t,e,n)=>t&e^t&n^e&n,Yte=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ta=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),na=new Uint32Array(64);class Xte extends p4{constructor(){super(64,32,8,!1),this.A=ta[0]|0,this.B=ta[1]|0,this.C=ta[2]|0,this.D=ta[3]|0,this.E=ta[4]|0,this.F=ta[5]|0,this.G=ta[6]|0,this.H=ta[7]|0}get(){const{A:e,B:n,C:r,D:s,E:i,F:o,G:a,H:l}=this;return[e,n,r,s,i,o,a,l]}set(e,n,r,s,i,o,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)na[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=na[f-15],h=na[f-2],p=ci(d,7)^ci(d,18)^d>>>3,m=ci(h,17)^ci(h,19)^h>>>10;na[f]=m+na[f-7]+p+na[f-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=ci(a,6)^ci(a,11)^ci(a,25),h=c+d+Qte(a,l,u)+Yte[f]+na[f]|0,m=(ci(r,2)^ci(r,13)^ci(r,22))+Jte(r,s,i)|0;c=u,u=l,l=a,a=o+h|0,o=i,i=s,s=r,r=h+m|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,s,i,o,a,l,u,c)}roundClean(){na.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const m4=Ax(()=>new Xte),qg=BigInt(2**32-1),vx=BigInt(32);function g4(t,e=!1){return e?{h:Number(t&qg),l:Number(t>>vx&qg)}:{h:Number(t>>vx&qg)|0,l:Number(t&qg)|0}}function y4(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:i,l:o}=g4(t[s],e);[n[s],r[s]]=[i,o]}return[n,r]}const Zte=(t,e)=>BigInt(t>>>0)<<vx|BigInt(e>>>0),ene=(t,e,n)=>t>>>n,tne=(t,e,n)=>t<<32-n|e>>>n,nne=(t,e,n)=>t>>>n|e<<32-n,rne=(t,e,n)=>t<<32-n|e>>>n,sne=(t,e,n)=>t<<64-n|e>>>n-32,ine=(t,e,n)=>t>>>n-32|e<<64-n,one=(t,e)=>e,ane=(t,e)=>t,b4=(t,e,n)=>t<<n|e>>>32-n,w4=(t,e,n)=>e<<n|t>>>32-n,A4=(t,e,n)=>e<<n-32|t>>>64-n,v4=(t,e,n)=>t<<n-32|e>>>64-n;function lne(t,e,n,r){const s=(e>>>0)+(r>>>0);return{h:t+n+(s/2**32|0)|0,l:s|0}}const et={fromBig:g4,split:y4,toBig:Zte,shrSH:ene,shrSL:tne,rotrSH:nne,rotrSL:rne,rotrBH:sne,rotrBL:ine,rotr32H:one,rotr32L:ane,rotlSH:b4,rotlSL:w4,rotlBH:A4,rotlBL:v4,add:lne,add3L:(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H:(t,e,n,r)=>e+n+r+(t/2**32|0)|0,add4L:(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),add4H:(t,e,n,r,s)=>e+n+r+s+(t/2**32|0)|0,add5H:(t,e,n,r,s,i)=>e+n+r+s+i+(t/2**32|0)|0,add5L:(t,e,n,r,s)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},[une,cne]=et.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),ra=new Uint32Array(80),sa=new Uint32Array(80);class fne extends p4{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:s,Ch:i,Cl:o,Dh:a,Dl:l,Eh:u,El:c,Fh:f,Fl:d,Gh:h,Gl:p,Hh:m,Hl:g}=this;return[e,n,r,s,i,o,a,l,u,c,f,d,h,p,m,g]}set(e,n,r,s,i,o,a,l,u,c,f,d,h,p,m,g){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=l|0,this.Eh=u|0,this.El=c|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=p|0,this.Hh=m|0,this.Hl=g|0}process(e,n){for(let A=0;A<16;A++,n+=4)ra[A]=e.getUint32(n),sa[A]=e.getUint32(n+=4);for(let A=16;A<80;A++){const w=ra[A-15]|0,x=sa[A-15]|0,k=et.rotrSH(w,x,1)^et.rotrSH(w,x,8)^et.shrSH(w,x,7),E=et.rotrSL(w,x,1)^et.rotrSL(w,x,8)^et.shrSL(w,x,7),O=ra[A-2]|0,M=sa[A-2]|0,D=et.rotrSH(O,M,19)^et.rotrBH(O,M,61)^et.shrSH(O,M,6),R=et.rotrSL(O,M,19)^et.rotrBL(O,M,61)^et.shrSL(O,M,6),B=et.add4L(E,R,sa[A-7],sa[A-16]),F=et.add4H(B,k,D,ra[A-7],ra[A-16]);ra[A]=F|0,sa[A]=B|0}let{Ah:r,Al:s,Bh:i,Bl:o,Ch:a,Cl:l,Dh:u,Dl:c,Eh:f,El:d,Fh:h,Fl:p,Gh:m,Gl:g,Hh:y,Hl:v}=this;for(let A=0;A<80;A++){const w=et.rotrSH(f,d,14)^et.rotrSH(f,d,18)^et.rotrBH(f,d,41),x=et.rotrSL(f,d,14)^et.rotrSL(f,d,18)^et.rotrBL(f,d,41),k=f&h^~f&m,E=d&p^~d&g,O=et.add5L(v,x,E,cne[A],sa[A]),M=et.add5H(O,y,w,k,une[A],ra[A]),D=O|0,R=et.rotrSH(r,s,28)^et.rotrBH(r,s,34)^et.rotrBH(r,s,39),B=et.rotrSL(r,s,28)^et.rotrBL(r,s,34)^et.rotrBL(r,s,39),F=r&i^r&a^i&a,V=s&o^s&l^o&l;y=m|0,v=g|0,m=h|0,g=p|0,h=f|0,p=d|0,{h:f,l:d}=et.add(u|0,c|0,M|0,D|0),u=a|0,c=l|0,a=i|0,l=o|0,i=r|0,o=s|0;const L=et.add3L(D,B,V);r=et.add3H(L,M,R,F),s=L|0}({h:r,l:s}=et.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=et.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l}=et.add(this.Ch|0,this.Cl|0,a|0,l|0),{h:u,l:c}=et.add(this.Dh|0,this.Dl|0,u|0,c|0),{h:f,l:d}=et.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:p}=et.add(this.Fh|0,this.Fl|0,h|0,p|0),{h:m,l:g}=et.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:v}=et.add(this.Hh|0,this.Hl|0,y|0,v|0),this.set(r,s,i,o,a,l,u,c,f,d,h,p,m,g,y,v)}roundClean(){ra.fill(0),sa.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const dne=Ax(()=>new fne);function hne(){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 x4=hne();x4.crypto||x4.msCrypto;function pne(t){switch(t){case"sha256":return m4.create();case"sha512":return dne.create()}G(!1,"invalid hashing algorithm name","algorithm",t)}const[k4,C4,E4]=[[],[],[]],mne=BigInt(0),Mh=BigInt(1),gne=BigInt(2),yne=BigInt(7),bne=BigInt(256),wne=BigInt(113);for(let t=0,e=Mh,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],k4.push(2*(5*r+n)),C4.push((t+1)*(t+2)/2%64);let s=mne;for(let i=0;i<7;i++)e=(e<<Mh^(e>>yne)*wne)%bne,e&gne&&(s^=Mh<<(Mh<<BigInt(i))-Mh);E4.push(s)}const[Ane,vne]=y4(E4,!0),S4=(t,e,n)=>n>32?A4(t,e,n):b4(t,e,n),T4=(t,e,n)=>n>32?v4(t,e,n):w4(t,e,n);function xne(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,u=n[l],c=n[l+1],f=S4(u,c,1)^n[a],d=T4(u,c,1)^n[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let s=t[2],i=t[3];for(let o=0;o<24;o++){const a=C4[o],l=S4(s,i,a),u=T4(s,i,a),c=k4[o];s=t[c],i=t[c+1],t[c]=l,t[c+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=Ane[r],t[1]^=vne[r]}n.fill(0)}class xx extends wx{constructor(e,n,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Wg(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=$te(this.state)}keccak(){xne(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Dc(this);const{blockLen:n,state:r}=this;e=Kg(e);const s=e.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:s}=this;e[r]^=n,n&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Dc(this,!1),gx(e),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Wg(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(c4(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new xx(n,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const kne=((t,e,n)=>Ax(()=>new xx(e,t,n)))(1,136,256/8);let D4=!1;const O4=function(t){return kne(t)};let M4=O4;function en(t){const e=ct(t,"data");return we(M4(e))}en._=O4,en.lock=function(){D4=!0},en.register=function(t){if(D4)throw new TypeError("keccak256 is locked");M4=t},Object.freeze(en);const N4=function(t){return pne("sha256").update(t).digest()};let _4=N4,R4=!1;function Oc(t){const e=ct(t,"data");return we(_4(e))}Oc._=N4,Oc.lock=function(){R4=!0},Oc.register=function(t){if(R4)throw new Error("sha256 is locked");_4=t},Object.freeze(Oc),Object.freeze(Oc);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const P4=BigInt(0),Qg=BigInt(1),Cne=BigInt(2),Jg=t=>t instanceof Uint8Array,Ene=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Mc(t){if(!Jg(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=Ene[t[n]];return e}function I4(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function kx(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Nc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let r=0;r<n.length;r++){const s=r*2,i=t.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function Sl(t){return kx(Mc(t))}function Cx(t){if(!Jg(t))throw new Error("Uint8Array expected");return kx(Mc(Uint8Array.from(t).reverse()))}function _c(t,e){return Nc(t.toString(16).padStart(e*2,"0"))}function Ex(t,e){return _c(t,e).reverse()}function Sne(t){return Nc(I4(t))}function Es(t,e,n){let r;if(typeof e=="string")try{r=Nc(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(Jg(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${t} expected ${n} bytes, got ${s}`);return r}function Nh(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!Jg(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function Tne(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Dne(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function One(t){let e;for(e=0;t>P4;t>>=Qg,e+=1);return e}function Mne(t,e){return t>>BigInt(e)&Qg}const Nne=(t,e,n)=>t|(n?Qg:P4)<<BigInt(e),Sx=t=>(Cne<<BigInt(t-1))-Qg,Tx=t=>new Uint8Array(t),L4=t=>Uint8Array.from(t);function B4(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Tx(t),s=Tx(t),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...f)=>n(s,r,...f),l=(f=Tx())=>{s=a(L4([0]),f),r=a(),f.length!==0&&(s=a(L4([1]),f),r=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f<e;){r=a();const h=r.slice();d.push(h),f+=r.length}return Nh(...d)};return(f,d)=>{o(),l(f);let h;for(;!(h=d(u()));)l();return o(),h}}const _ne={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function _h(t,e,n={}){const r=(s,i,o)=>{const a=_ne[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=t[s];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${i}`)};for(const[s,i]of Object.entries(e))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return t}const Rne=Object.freeze(Object.defineProperty({__proto__:null,bitGet:Mne,bitLen:One,bitMask:Sx,bitSet:Nne,bytesToHex:Mc,bytesToNumberBE:Sl,bytesToNumberLE:Cx,concatBytes:Nh,createHmacDrbg:B4,ensureBytes:Es,equalBytes:Tne,hexToBytes:Nc,hexToNumber:kx,numberToBytesBE:_c,numberToBytesLE:Ex,numberToHexUnpadded:I4,numberToVarBytesBE:Sne,utf8ToBytes:Dne,validateObject:_h},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const yn=BigInt(0),Gt=BigInt(1),Tl=BigInt(2),Pne=BigInt(3),Dx=BigInt(4),F4=BigInt(5),j4=BigInt(8);BigInt(9),BigInt(16);function fr(t,e){const n=t%e;return n>=yn?n:e+n}function Ine(t,e,n){if(n<=yn||e<yn)throw new Error("Expected power/modulo > 0");if(n===Gt)return yn;let r=Gt;for(;e>yn;)e&Gt&&(r=r*t%n),t=t*t%n,e>>=Gt;return r}function Xr(t,e,n){let r=t;for(;e-- >yn;)r*=r,r%=n;return r}function Ox(t,e){if(t===yn||e<=yn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=fr(t,e),r=e,s=yn,i=Gt;for(;n!==yn;){const a=r/n,l=r%n,u=s-i*a;r=n,n=l,s=i,i=u}if(r!==Gt)throw new Error("invert: does not exist");return fr(s,e)}function Lne(t){const e=(t-Gt)/Tl;let n,r,s;for(n=t-Gt,r=0;n%Tl===yn;n/=Tl,r++);for(s=Tl;s<t&&Ine(s,e,t)!==t-Gt;s++);if(r===1){const o=(t+Gt)/Dx;return function(l,u){const c=l.pow(u,o);if(!l.eql(l.sqr(c),u))throw new Error("Cannot find square root");return c}}const i=(n+Gt)/Tl;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=r,c=a.pow(a.mul(a.ONE,s),n),f=a.pow(l,i),d=a.pow(l,n);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let h=1;for(let m=a.sqr(d);h<u&&!a.eql(m,a.ONE);h++)m=a.sqr(m);const p=a.pow(c,Gt<<BigInt(u-h-1));c=a.sqr(p),f=a.mul(f,p),d=a.mul(d,c),u=h}return f}}function Bne(t){if(t%Dx===Pne){const e=(t+Gt)/Dx;return function(r,s){const i=r.pow(s,e);if(!r.eql(r.sqr(i),s))throw new Error("Cannot find square root");return i}}if(t%j4===F4){const e=(t-F4)/j4;return function(r,s){const i=r.mul(s,Tl),o=r.pow(i,e),a=r.mul(s,o),l=r.mul(r.mul(a,Tl),o),u=r.mul(a,r.sub(l,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return Lne(t)}const Fne=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function jne(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Fne.reduce((r,s)=>(r[s]="function",r),e);return _h(t,n)}function Une(t,e,n){if(n<yn)throw new Error("Expected power > 0");if(n===yn)return t.ONE;if(n===Gt)return e;let r=t.ONE,s=e;for(;n>yn;)n&Gt&&(r=t.mul(r,s)),s=t.sqr(s),n>>=Gt;return r}function Hne(t,e){const n=new Array(e.length),r=e.reduce((i,o,a)=>t.is0(o)?i:(n[a]=i,t.mul(i,o)),t.ONE),s=t.inv(r);return e.reduceRight((i,o,a)=>t.is0(o)?i:(n[a]=t.mul(i,n[a]),t.mul(i,o)),s),n}function U4(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Vne(t,e,n=!1,r={}){if(t<=yn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:s,nByteLength:i}=U4(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Bne(t),a=Object.freeze({ORDER:t,BITS:s,BYTES:i,MASK:Sx(s),ZERO:yn,ONE:Gt,create:l=>fr(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return yn<=l&&l<t},is0:l=>l===yn,isOdd:l=>(l&Gt)===Gt,neg:l=>fr(-l,t),eql:(l,u)=>l===u,sqr:l=>fr(l*l,t),add:(l,u)=>fr(l+u,t),sub:(l,u)=>fr(l-u,t),mul:(l,u)=>fr(l*u,t),pow:(l,u)=>Une(a,l,u),div:(l,u)=>fr(l*Ox(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Ox(l,t),sqrt:r.sqrt||(l=>o(a,l)),invertBatch:l=>Hne(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?Ex(l,i):_c(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?Cx(l):Sl(l)}});return Object.freeze(a)}function H4(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function V4(t){const e=H4(t);return e+Math.ceil(e/2)}function zne(t,e,n=!1){const r=t.length,s=H4(e),i=V4(e);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const o=n?Sl(t):Cx(t),a=fr(o,e-Gt)+Gt;return n?Ex(a,s):_c(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $ne=BigInt(0),Mx=BigInt(1);function Gne(t,e){const n=(s,i)=>{const o=i.negate();return s?o:i},r=s=>{const i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,i){let o=t.ZERO,a=s;for(;i>$ne;)i&Mx&&(o=o.add(a)),a=a.double(),i>>=Mx;return o},precomputeWindow(s,i){const{windows:o,windowSize:a}=r(i),l=[];let u=s,c=u;for(let f=0;f<o;f++){c=u,l.push(c);for(let d=1;d<a;d++)c=c.add(u),l.push(c);u=c.double()}return l},wNAF(s,i,o){const{windows:a,windowSize:l}=r(s);let u=t.ZERO,c=t.BASE;const f=BigInt(2**s-1),d=2**s,h=BigInt(s);for(let p=0;p<a;p++){const m=p*l;let g=Number(o&f);o>>=h,g>l&&(g-=d,o+=Mx);const y=m,v=m+Math.abs(g)-1,A=p%2!==0,w=g<0;g===0?c=c.add(n(A,i[y])):u=u.add(n(w,i[v]))}return{p:u,f:c}},wNAFCached(s,i,o,a){const l=s._WINDOW_SIZE||1;let u=i.get(s);return u||(u=this.precomputeWindow(s,l),l!==1&&i.set(s,a(u))),this.wNAF(l,u,o)}}}function z4(t){return jne(t.Fp),_h(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...U4(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Wne(t){const e=z4(t);_h(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=e;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Kne,hexToBytes:qne}=Rne,Dl={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Dl;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Kne(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Dl,n=typeof t=="string"?qne(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:s,l:i}=Dl._parseInt(n.subarray(2)),{d:o,l:a}=Dl._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),s=e(n(t.r)),i=r.length/2,o=s.length/2,a=n(i),l=n(o);return`30${n(o+i+4)}02${l}${s}02${a}${r}`}},$i=BigInt(0),Zr=BigInt(1);BigInt(2);const $4=BigInt(3);BigInt(4);function Qne(t){const e=Wne(t),{Fp:n}=e,r=e.toBytes||((p,m,g)=>{const y=m.toAffine();return Nh(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),s=e.fromBytes||(p=>{const m=p.subarray(1),g=n.fromBytes(m.subarray(0,n.BYTES)),y=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:g,y}});function i(p){const{a:m,b:g}=e,y=n.sqr(p),v=n.mul(y,p);return n.add(n.add(v,n.mul(p,m)),g)}if(!n.eql(n.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(p){return typeof p=="bigint"&&$i<p&&p<e.n}function a(p){if(!o(p))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(p){const{allowedPrivateKeyLengths:m,nByteLength:g,wrapPrivateKey:y,n:v}=e;if(m&&typeof p!="bigint"){if(p instanceof Uint8Array&&(p=Mc(p)),typeof p!="string"||!m.includes(p.length))throw new Error("Invalid key");p=p.padStart(g*2,"0")}let A;try{A=typeof p=="bigint"?p:Sl(Es("private key",p,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof p}`)}return y&&(A=fr(A,v)),a(A),A}const u=new Map;function c(p){if(!(p instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(m,g,y){if(this.px=m,this.py=g,this.pz=y,m==null||!n.isValid(m))throw new Error("x required");if(g==null||!n.isValid(g))throw new Error("y required");if(y==null||!n.isValid(y))throw new Error("z required")}static fromAffine(m){const{x:g,y}=m||{};if(!m||!n.isValid(g)||!n.isValid(y))throw new Error("invalid affine point");if(m instanceof f)throw new Error("projective point not allowed");const v=A=>n.eql(A,n.ZERO);return v(g)&&v(y)?f.ZERO:new f(g,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const g=n.invertBatch(m.map(y=>y.pz));return m.map((y,v)=>y.toAffine(g[v])).map(f.fromAffine)}static fromHex(m){const g=f.fromAffine(s(Es("pointHex",m)));return g.assertValidity(),g}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:g}=this.toAffine();if(!n.isValid(m)||!n.isValid(g))throw new Error("bad point: x or y not FE");const y=n.sqr(g),v=i(m);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:g,py:y,pz:v}=this,{px:A,py:w,pz:x}=m,k=n.eql(n.mul(g,x),n.mul(A,v)),E=n.eql(n.mul(y,x),n.mul(w,v));return k&&E}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:g}=e,y=n.mul(g,$4),{px:v,py:A,pz:w}=this;let x=n.ZERO,k=n.ZERO,E=n.ZERO,O=n.mul(v,v),M=n.mul(A,A),D=n.mul(w,w),R=n.mul(v,A);return R=n.add(R,R),E=n.mul(v,w),E=n.add(E,E),x=n.mul(m,E),k=n.mul(y,D),k=n.add(x,k),x=n.sub(M,k),k=n.add(M,k),k=n.mul(x,k),x=n.mul(R,x),E=n.mul(y,E),D=n.mul(m,D),R=n.sub(O,D),R=n.mul(m,R),R=n.add(R,E),E=n.add(O,O),O=n.add(E,O),O=n.add(O,D),O=n.mul(O,R),k=n.add(k,O),D=n.mul(A,w),D=n.add(D,D),O=n.mul(D,R),x=n.sub(x,O),E=n.mul(D,M),E=n.add(E,E),E=n.add(E,E),new f(x,k,E)}add(m){c(m);const{px:g,py:y,pz:v}=this,{px:A,py:w,pz:x}=m;let k=n.ZERO,E=n.ZERO,O=n.ZERO;const M=e.a,D=n.mul(e.b,$4);let R=n.mul(g,A),B=n.mul(y,w),F=n.mul(v,x),V=n.add(g,y),L=n.add(A,w);V=n.mul(V,L),L=n.add(R,B),V=n.sub(V,L),L=n.add(g,v);let H=n.add(A,x);return L=n.mul(L,H),H=n.add(R,F),L=n.sub(L,H),H=n.add(y,v),k=n.add(w,x),H=n.mul(H,k),k=n.add(B,F),H=n.sub(H,k),O=n.mul(M,L),k=n.mul(D,F),O=n.add(k,O),k=n.sub(B,O),O=n.add(B,O),E=n.mul(k,O),B=n.add(R,R),B=n.add(B,R),F=n.mul(M,F),L=n.mul(D,L),B=n.add(B,F),F=n.sub(R,F),F=n.mul(M,F),L=n.add(L,F),R=n.mul(B,L),E=n.add(E,R),R=n.mul(H,L),k=n.mul(V,k),k=n.sub(k,R),R=n.mul(V,B),O=n.mul(H,O),O=n.add(O,R),new f(k,E,O)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,g=>{const y=n.invertBatch(g.map(v=>v.pz));return g.map((v,A)=>v.toAffine(y[A])).map(f.fromAffine)})}multiplyUnsafe(m){const g=f.ZERO;if(m===$i)return g;if(a(m),m===Zr)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:A,k2neg:w,k2:x}=y.splitScalar(m),k=g,E=g,O=this;for(;A>$i||x>$i;)A&Zr&&(k=k.add(O)),x&Zr&&(E=E.add(O)),O=O.double(),A>>=Zr,x>>=Zr;return v&&(k=k.negate()),w&&(E=E.negate()),E=new f(n.mul(E.px,y.beta),E.py,E.pz),k.add(E)}multiply(m){a(m);let g=m,y,v;const{endo:A}=e;if(A){const{k1neg:w,k1:x,k2neg:k,k2:E}=A.splitScalar(g);let{p:O,f:M}=this.wNAF(x),{p:D,f:R}=this.wNAF(E);O=h.constTimeNegate(w,O),D=h.constTimeNegate(k,D),D=new f(n.mul(D.px,A.beta),D.py,D.pz),y=O.add(D),v=M.add(R)}else{const{p:w,f:x}=this.wNAF(g);y=w,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,g,y){const v=f.BASE,A=(x,k)=>k===$i||k===Zr||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),w=A(this,g).add(A(m,y));return w.is0()?void 0:w}toAffine(m){const{px:g,py:y,pz:v}=this,A=this.is0();m==null&&(m=A?n.ONE:n.inv(v));const w=n.mul(g,m),x=n.mul(y,m),k=n.mul(v,m);if(A)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:w,y:x}}isTorsionFree(){const{h:m,isTorsionFree:g}=e;if(m===Zr)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:g}=e;return m===Zr?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return Mc(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=e.nBitLength,h=Gne(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:o}}function Jne(t){const e=z4(t);return _h(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Yne(t){const e=Jne(t),{Fp:n,n:r}=e,s=n.BYTES+1,i=2*n.BYTES+1;function o(L){return $i<L&&L<n.ORDER}function a(L){return fr(L,r)}function l(L){return Ox(L,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:f,isWithinCurveOrder:d}=Qne({...e,toBytes(L,H,q){const te=H.toAffine(),Z=n.toBytes(te.x),pe=Nh;return q?pe(Uint8Array.from([H.hasEvenY()?2:3]),Z):pe(Uint8Array.from([4]),Z,n.toBytes(te.y))},fromBytes(L){const H=L.length,q=L[0],te=L.subarray(1);if(H===s&&(q===2||q===3)){const Z=Sl(te);if(!o(Z))throw new Error("Point is not on curve");const pe=f(Z);let Ce=n.sqrt(pe);const Se=(Ce&Zr)===Zr;return(q&1)===1!==Se&&(Ce=n.neg(Ce)),{x:Z,y:Ce}}else if(H===i&&q===4){const Z=n.fromBytes(te.subarray(0,n.BYTES)),pe=n.fromBytes(te.subarray(n.BYTES,2*n.BYTES));return{x:Z,y:pe}}else throw new Error(`Point of length ${H} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=L=>Mc(_c(L,e.nByteLength));function p(L){const H=r>>Zr;return L>H}function m(L){return p(L)?a(-L):L}const g=(L,H,q)=>Sl(L.slice(H,q));class y{constructor(H,q,te){this.r=H,this.s=q,this.recovery=te,this.assertValidity()}static fromCompact(H){const q=e.nByteLength;return H=Es("compactSignature",H,q*2),new y(g(H,0,q),g(H,q,2*q))}static fromDER(H){const{r:q,s:te}=Dl.toSig(Es("DER",H));return new y(q,te)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(H){return new y(this.r,this.s,H)}recoverPublicKey(H){const{r:q,s:te,recovery:Z}=this,pe=E(Es("msgHash",H));if(Z==null||![0,1,2,3].includes(Z))throw new Error("recovery id invalid");const Ce=Z===2||Z===3?q+e.n:q;if(Ce>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Se=Z&1?"03":"02",ve=u.fromHex(Se+h(Ce)),xe=l(Ce),Fe=a(-pe*xe),He=a(te*xe),ze=u.BASE.multiplyAndAddUnsafe(ve,Fe,He);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Nc(this.toDERHex())}toDERHex(){return Dl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Nc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(L){try{return c(L),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const L=V4(e.n);return zne(e.randomBytes(L),e.n)},precompute(L=8,H=u.BASE){return H._setWindowSize(L),H.multiply(BigInt(3)),H}};function A(L,H=!0){return u.fromPrivateKey(L).toRawBytes(H)}function w(L){const H=L instanceof Uint8Array,q=typeof L=="string",te=(H||q)&&L.length;return H?te===s||te===i:q?te===2*s||te===2*i:L instanceof u}function x(L,H,q=!0){if(w(L))throw new Error("first arg must be private key");if(!w(H))throw new Error("second arg must be public key");return u.fromHex(H).multiply(c(L)).toRawBytes(q)}const k=e.bits2int||function(L){const H=Sl(L),q=L.length*8-e.nBitLength;return q>0?H>>BigInt(q):H},E=e.bits2int_modN||function(L){return a(k(L))},O=Sx(e.nBitLength);function M(L){if(typeof L!="bigint")throw new Error("bigint expected");if(!($i<=L&&L<O))throw new Error(`bigint expected < 2^${e.nBitLength}`);return _c(L,e.nByteLength)}function D(L,H,q=R){if(["recovered","canonical"].some(tt=>tt in q))throw new Error("sign() legacy options not supported");const{hash:te,randomBytes:Z}=e;let{lowS:pe,prehash:Ce,extraEntropy:Se}=q;pe==null&&(pe=!0),L=Es("msgHash",L),Ce&&(L=Es("prehashed msgHash",te(L)));const ve=E(L),xe=c(H),Fe=[M(xe),M(ve)];if(Se!=null){const tt=Se===!0?Z(n.BYTES):Se;Fe.push(Es("extraEntropy",tt))}const He=Nh(...Fe),ze=ve;function Le(tt){const le=k(tt);if(!d(le))return;const $e=l(le),ae=u.BASE.multiply(le).toAffine(),be=a(ae.x);if(be===$i)return;const Be=a($e*a(ze+be*xe));if(Be===$i)return;let $=(ae.x===be?0:2)|Number(ae.y&Zr),Q=Be;return pe&&p(Be)&&(Q=m(Be),$^=1),new y(be,Q,$)}return{seed:He,k2sig:Le}}const R={lowS:e.lowS,prehash:!1},B={lowS:e.lowS,prehash:!1};function F(L,H,q=R){const{seed:te,k2sig:Z}=D(L,H,q),pe=e;return B4(pe.hash.outputLen,pe.nByteLength,pe.hmac)(te,Z)}u.BASE._setWindowSize(8);function V(L,H,q,te=B){var ae;const Z=L;if(H=Es("msgHash",H),q=Es("publicKey",q),"strict"in te)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ce}=te;let Se,ve;try{if(typeof Z=="string"||Z instanceof Uint8Array)try{Se=y.fromDER(Z)}catch(be){if(!(be instanceof Dl.Err))throw be;Se=y.fromCompact(Z)}else if(typeof Z=="object"&&typeof Z.r=="bigint"&&typeof Z.s=="bigint"){const{r:be,s:Be}=Z;Se=new y(be,Be)}else throw new Error("PARSE");ve=u.fromHex(q)}catch(be){if(be.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(pe&&Se.hasHighS())return!1;Ce&&(H=e.hash(H));const{r:xe,s:Fe}=Se,He=E(H),ze=l(Fe),Le=a(He*ze),tt=a(xe*ze),le=(ae=u.BASE.multiplyAndAddUnsafe(ve,Le,tt))==null?void 0:ae.toAffine();return le?a(le.x)===xe:!1}return{CURVE:e,getPublicKey:A,getSharedSecret:x,sign:F,verify:V,ProjectivePoint:u,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xne(t){return{hash:t,hmac:(e,...n)=>h4(t,e,Wte(...n)),randomBytes:Kte}}function Zne(t,e){const n=r=>Yne({...t,...Xne(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const G4=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),W4=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ere=BigInt(1),Nx=BigInt(2),K4=(t,e)=>(t+e/Nx)/e;function tre(t){const e=G4,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,f=Xr(c,n,e)*c%e,d=Xr(f,n,e)*c%e,h=Xr(d,Nx,e)*u%e,p=Xr(h,s,e)*h%e,m=Xr(p,i,e)*p%e,g=Xr(m,a,e)*m%e,y=Xr(g,l,e)*g%e,v=Xr(y,a,e)*m%e,A=Xr(v,n,e)*c%e,w=Xr(A,o,e)*p%e,x=Xr(w,r,e)*u%e,k=Xr(x,Nx,e);if(!_x.eql(_x.sqr(k),t))throw new Error("Cannot find square root");return k}const _x=Vne(G4,void 0,void 0,{sqrt:tre}),ia=Zne({a:BigInt(0),b:BigInt(7),Fp:_x,n:W4,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=W4,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ere*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,o=BigInt("0x100000000000000000000000000000000"),a=K4(i*t,e),l=K4(-r*t,e);let u=fr(t-a*n-l*s,e),c=fr(-a*r-l*i,e);const f=u>o,d=c>o;if(f&&(u=e-u),d&&(c=e-c),u>o||c>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},m4);BigInt(0),ia.ProjectivePoint;const Rh="0x0000000000000000000000000000000000000000",q4="0x0000000000000000000000000000000000000000000000000000000000000000",Q4=BigInt(0),J4=BigInt(1),Y4=BigInt(2),X4=BigInt(27),Z4=BigInt(28),Yg=BigInt(35),Rc={};function eR(t){return xl(Wn(t),32)}const Ns=class Ns{constructor(e,n,r,s){J(this,uf);J(this,cf);J(this,ff);J(this,eu);jg(e,Rc,"Signature"),I(this,uf,n),I(this,cf,r),I(this,ff,s),I(this,eu,null)}get r(){return T(this,uf)}set r(e){G(Cc(e)===32,"invalid r","value",e),I(this,uf,we(e))}get s(){return T(this,cf)}set s(e){G(Cc(e)===32,"invalid s","value",e);const n=we(e);G(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),I(this,cf,n)}get v(){return T(this,ff)}set v(e){const n=Qe(e,"value");G(n===27||n===28,"invalid v","v",e),I(this,ff,n)}get networkV(){return T(this,eu)}get legacyChainId(){const e=this.networkV;return e==null?null:Ns.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=ct(this.s);return this.yParity&&(e[0]|=128),we(e)}get compactSerialized(){return $t([this.r,this.yParityAndS])}get serialized(){return $t([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Ns(Rc,this.r,this.s,this.v);return this.networkV&&I(e,eu,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=Ee(e,"v");return n==X4||n==Z4?Q4:(G(n>=Yg,"invalid EIP-155 v","v",e),(n-Yg)/Y4)}static getChainIdV(e,n){return Ee(e)*Y4+BigInt(35+n-27)}static getNormalizedV(e){const n=Ee(e);return n===Q4||n===X4?27:n===J4||n===Z4?28:(G(n>=Yg,"invalid v","v",e),n&J4?27:28)}static from(e){function n(u,c){G(u,c,"signature",e)}if(e==null)return new Ns(Rc,q4,q4,27);if(typeof e=="string"){const u=ct(e,"signature");if(u.length===64){const c=we(u.slice(0,32)),f=u.slice(32,64),d=f[0]&128?28:27;return f[0]&=127,new Ns(Rc,c,we(f),d)}if(u.length===65){const c=we(u.slice(0,32)),f=u.slice(32,64);n((f[0]&128)===0,"non-canonical s");const d=Ns.getNormalizedV(u[64]);return new Ns(Rc,c,we(f),d)}n(!1,"invalid raw signature length")}if(e instanceof Ns)return e.clone();const r=e.r;n(r!=null,"missing r");const s=eR(r),i=function(u,c){if(u!=null)return eR(u);if(c!=null){n(St(c,32),"invalid yParityAndS");const f=ct(c);return f[0]&=127,we(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((ct(i)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,c,f){if(u!=null){const d=Ee(u);return{networkV:d>=Yg?d:void 0,v:Ns.getNormalizedV(d)}}if(c!=null)return n(St(c,32),"invalid yParityAndS"),{v:ct(c)[0]&128?28:27};if(f!=null){switch(Qe(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new Ns(Rc,s,i,a);return o&&I(l,eu,o),n(e.yParity==null||Qe(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};uf=new WeakMap,cf=new WeakMap,ff=new WeakMap,eu=new WeakMap;let Ss=Ns;const tu=class tu{constructor(e){J(this,ao);G(Cc(e)===32,"invalid private key","privateKey","[REDACTED]"),I(this,ao,we(e))}get privateKey(){return T(this,ao)}get publicKey(){return tu.computePublicKey(T(this,ao))}get compressedPublicKey(){return tu.computePublicKey(T(this,ao),!0)}sign(e){G(Cc(e)===32,"invalid digest length","digest",e);const n=ia.sign(Gn(e),Gn(T(this,ao)),{lowS:!0});return Ss.from({r:Zo(n.r,32),s:Zo(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=tu.computePublicKey(e);return we(ia.getSharedSecret(Gn(T(this,ao)),ct(n),!1))}static computePublicKey(e,n){let r=ct(e,"key");if(r.length===32){const i=ia.getPublicKey(r,!!n);return we(i)}if(r.length===64){const i=new Uint8Array(65);i[0]=4,i.set(r,1),r=i}const s=ia.ProjectivePoint.fromHex(r);return we(s.toRawBytes(n))}static recoverPublicKey(e,n){G(Cc(e)===32,"invalid digest length","digest",e);const r=Ss.from(n);let s=ia.Signature.fromCompact(Gn($t([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const i=s.recoverPublicKey(Gn(e));return G(i!=null,"invalid signautre for digest","signature",n),"0x"+i.toHex(!1)}static addPoints(e,n,r){const s=ia.ProjectivePoint.fromHex(tu.computePublicKey(e).substring(2)),i=ia.ProjectivePoint.fromHex(tu.computePublicKey(n).substring(2));return"0x"+s.add(i).toHex(!!r)}};ao=new WeakMap;let Ph=tu;const nre=BigInt(0),rre=BigInt(36);function tR(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=e[s].charCodeAt(0);const r=ct(en(n));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(r[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const Rx={};for(let t=0;t<10;t++)Rx[String(t)]=String(t);for(let t=0;t<26;t++)Rx[String.fromCharCode(65+t)]=String(10+t);const nR=15;function sre(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>Rx[r]).join("");for(;e.length>=nR;){let r=e.substring(0,nR);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const ire=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function ore(t){t=t.toLowerCase();let e=nre;for(let n=0;n<t.length;n++)e=e*rre+ire[t[n]];return e}function gt(t){if(G(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=tR(t);return G(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){G(t.substring(2,4)===sre(t),"bad icap checksum","address",t);let e=ore(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return tR("0x"+e)}G(!1,"invalid address","address",t)}function are(t){const e=gt(t.from);let r=Ee(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,gt(Vt(en(Cl([e,r])),12))}function rR(t){return t&&typeof t.getAddress=="function"}function lre(t){try{return gt(t),!0}catch{}return!1}async function Px(t,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(ee(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),G(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),gt(n)}function Qn(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?gt(t):(ee(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Px(t,e.resolveName(t)));if(rR(t))return Px(t,t.getAddress());if(t&&typeof t.then=="function")return Px(t,t);G(!1,"unsupported addressable value","target",t)}const Gi={};function Ae(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new Rn(Gi,`${n?"":"u"}int${e}`,t,{signed:n,width:e})}function dt(t,e){return new Rn(Gi,`bytes${e||""}`,t,{size:e})}const sR=Symbol.for("_ethers_typed"),lo=class lo{constructor(e,n,r,s){W(this,"type");W(this,"value");J(this,nu);W(this,"_typedSymbol");s==null&&(s=null),jg(Gi,e,"Typed"),Me(this,{_typedSymbol:sR,type:n,value:r}),I(this,nu,s),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return T(this,nu)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return T(this,nu)===!0?-1:T(this,nu)===!1?this.value.length:null}static from(e,n){return new lo(Gi,e,n)}static uint8(e){return Ae(e,8)}static uint16(e){return Ae(e,16)}static uint24(e){return Ae(e,24)}static uint32(e){return Ae(e,32)}static uint40(e){return Ae(e,40)}static uint48(e){return Ae(e,48)}static uint56(e){return Ae(e,56)}static uint64(e){return Ae(e,64)}static uint72(e){return Ae(e,72)}static uint80(e){return Ae(e,80)}static uint88(e){return Ae(e,88)}static uint96(e){return Ae(e,96)}static uint104(e){return Ae(e,104)}static uint112(e){return Ae(e,112)}static uint120(e){return Ae(e,120)}static uint128(e){return Ae(e,128)}static uint136(e){return Ae(e,136)}static uint144(e){return Ae(e,144)}static uint152(e){return Ae(e,152)}static uint160(e){return Ae(e,160)}static uint168(e){return Ae(e,168)}static uint176(e){return Ae(e,176)}static uint184(e){return Ae(e,184)}static uint192(e){return Ae(e,192)}static uint200(e){return Ae(e,200)}static uint208(e){return Ae(e,208)}static uint216(e){return Ae(e,216)}static uint224(e){return Ae(e,224)}static uint232(e){return Ae(e,232)}static uint240(e){return Ae(e,240)}static uint248(e){return Ae(e,248)}static uint256(e){return Ae(e,256)}static uint(e){return Ae(e,256)}static int8(e){return Ae(e,-8)}static int16(e){return Ae(e,-16)}static int24(e){return Ae(e,-24)}static int32(e){return Ae(e,-32)}static int40(e){return Ae(e,-40)}static int48(e){return Ae(e,-48)}static int56(e){return Ae(e,-56)}static int64(e){return Ae(e,-64)}static int72(e){return Ae(e,-72)}static int80(e){return Ae(e,-80)}static int88(e){return Ae(e,-88)}static int96(e){return Ae(e,-96)}static int104(e){return Ae(e,-104)}static int112(e){return Ae(e,-112)}static int120(e){return Ae(e,-120)}static int128(e){return Ae(e,-128)}static int136(e){return Ae(e,-136)}static int144(e){return Ae(e,-144)}static int152(e){return Ae(e,-152)}static int160(e){return Ae(e,-160)}static int168(e){return Ae(e,-168)}static int176(e){return Ae(e,-176)}static int184(e){return Ae(e,-184)}static int192(e){return Ae(e,-192)}static int200(e){return Ae(e,-200)}static int208(e){return Ae(e,-208)}static int216(e){return Ae(e,-216)}static int224(e){return Ae(e,-224)}static int232(e){return Ae(e,-232)}static int240(e){return Ae(e,-240)}static int248(e){return Ae(e,-248)}static int256(e){return Ae(e,-256)}static int(e){return Ae(e,-256)}static bytes1(e){return dt(e,1)}static bytes2(e){return dt(e,2)}static bytes3(e){return dt(e,3)}static bytes4(e){return dt(e,4)}static bytes5(e){return dt(e,5)}static bytes6(e){return dt(e,6)}static bytes7(e){return dt(e,7)}static bytes8(e){return dt(e,8)}static bytes9(e){return dt(e,9)}static bytes10(e){return dt(e,10)}static bytes11(e){return dt(e,11)}static bytes12(e){return dt(e,12)}static bytes13(e){return dt(e,13)}static bytes14(e){return dt(e,14)}static bytes15(e){return dt(e,15)}static bytes16(e){return dt(e,16)}static bytes17(e){return dt(e,17)}static bytes18(e){return dt(e,18)}static bytes19(e){return dt(e,19)}static bytes20(e){return dt(e,20)}static bytes21(e){return dt(e,21)}static bytes22(e){return dt(e,22)}static bytes23(e){return dt(e,23)}static bytes24(e){return dt(e,24)}static bytes25(e){return dt(e,25)}static bytes26(e){return dt(e,26)}static bytes27(e){return dt(e,27)}static bytes28(e){return dt(e,28)}static bytes29(e){return dt(e,29)}static bytes30(e){return dt(e,30)}static bytes31(e){return dt(e,31)}static bytes32(e){return dt(e,32)}static address(e){return new lo(Gi,"address",e)}static bool(e){return new lo(Gi,"bool",!!e)}static bytes(e){return new lo(Gi,"bytes",e)}static string(e){return new lo(Gi,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new lo(Gi,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===sR}static dereference(e,n){if(lo.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};nu=new WeakMap;let Rn=lo;class ure extends zi{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Rn.dereference(n,"string");try{r=gt(r)}catch(s){return this._throwError(s.message,n)}return e.writeValue(r)}decode(e){return gt(Zo(e.readValue(),20))}}class cre extends zi{constructor(n){super(n.name,n.type,"_",n.dynamic);W(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function iR(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(u=>{const c=u.localName;return ee(c,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),ee(!l[c],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),l[c]=!0,n[c]})}else G(!1,"invalid tuple value","tuple",n);G(e.length===r.length,"types/value length mismatch","tuple",n);let s=new px,i=new px,o=[];e.forEach((l,u)=>{let c=r[u];if(l.dynamic){let f=i.length;l.encode(i,c);let d=s.writeUpdatableValue();o.push(h=>{d(h+f)})}else l.encode(s,c)}),o.forEach(l=>{l(s.length)});let a=t.appendWriter(s);return a+=t.appendWriter(i),a}function oR(t,e){let n=[],r=[],s=t.subReader(0);return e.forEach(i=>{let o=null;if(i.dynamic){let a=t.readIndex(),l=s.subReader(a);try{o=i.decode(l)}catch(u){if(gn(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=i.name,o.name=i.localName,o.type=i.type}}else try{o=i.decode(t)}catch(a){if(gn(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=i.name,o.name=i.localName,o.type=i.type}if(o==null)throw new Error("investigate");n.push(o),r.push(i.localName||null)}),Tc.fromItems(n,r)}class fre extends zi{constructor(n,r,s){const i=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",i,s,o);W(this,"coder");W(this,"length");Me(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let s=0;s<this.length;s++)r.push(n);return r}encode(n,r){const s=Rn.dereference(r,"array");Array.isArray(s)||this._throwError("expected array value",s);let i=this.length;i===-1&&(i=s.length,n.writeValue(s.length)),j6(s.length,i,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<s.length;a++)o.push(this.coder);return iR(n,o,s)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),ee(r*qn<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*qn,length:n.dataLength}));let s=[];for(let i=0;i<r;i++)s.push(new cre(this.coder));return oR(n,s)}}class dre extends zi{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,n){const r=Rn.dereference(n,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}class aR extends zi{constructor(e,n){super(e,e,n,!0)}defaultValue(){return"0x"}encode(e,n){n=Gn(n);let r=e.writeValue(n.length);return r+=e.writeBytes(n),r}decode(e){return e.readBytes(e.readIndex(),!0)}}class hre extends aR{constructor(e){super("bytes",e)}decode(e){return we(super.decode(e))}}class pre extends zi{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);W(this,"size");Me(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let s=Gn(Rn.dereference(r,this.type));return s.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(s)}decode(n){return we(n.readBytes(this.size))}}const mre=new Uint8Array([]);class gre extends zi{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes(mre)}decode(e){return e.readBytes(0),null}}const yre=BigInt(0),bre=BigInt(1),wre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Are extends zi{constructor(n,r,s){const i=(r?"int":"uint")+n*8;super(i,i,s,!1);W(this,"size");W(this,"signed");Me(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=Ee(Rn.dereference(r,this.type)),i=Dh(wre,qn*8);if(this.signed){let o=Dh(i,this.size*8-1);(s>o||s<-(o+bre))&&this._throwError("value out-of-bounds",r),s=z6(s,8*qn)}else(s<yre||s>Dh(i,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(s)}decode(n){let r=Dh(n.readValue(),this.size*8);return this.signed&&(r=Cte(r,this.size*8)),r}}class vre extends aR{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,Vi(Rn.dereference(n,"string")))}decode(e){return Sc(super.decode(e))}}class Xg extends zi{constructor(n,r){let s=!1;const i=[];n.forEach(a=>{a.dynamic&&(s=!0),i.push(a.type)});const o="tuple("+i.join(",")+")";super("tuple",o,r,s);W(this,"coders");Me(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(s=>{n.push(s.defaultValue())});const r=this.coders.reduce((s,i)=>{const o=i.localName;return o&&(s[o]||(s[o]=0),s[o]++),s},{});return this.coders.forEach((s,i)=>{let o=s.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[i]))}),Object.freeze(n)}encode(n,r){const s=Rn.dereference(r,"tuple");return iR(n,this.coders,s)}decode(n){return oR(n,this.coders)}}function Ol(t){return en(Vi(t))}var xre="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";const lR=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),uR=4;function kre(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),s=1,i=[0,1];for(let x=1;x<r;x++)i.push(s+=n());let o=n(),a=e;e+=o;let l=0,u=0;function c(){return l==0&&(u=u<<8|t[e++],l=8),u>>--l&1}const f=31,d=2**f,h=d>>>1,p=h>>1,m=d-1;let g=0;for(let x=0;x<f;x++)g=g<<1|c();let y=[],v=0,A=d;for(;;){let x=Math.floor(((g-v+1)*s-1)/A),k=0,E=r;for(;E-k>1;){let D=k+E>>>1;x<i[D]?E=D:k=D}if(k==0)break;y.push(k);let O=v+Math.floor(A*i[k]/s),M=v+Math.floor(A*i[k+1]/s)-1;for(;!((O^M)&h);)g=g<<1&m|c(),O=O<<1&m,M=M<<1&m|1;for(;O&~M&p;)g=g&h|g<<1&m>>>1|c(),O=O<<1^h,M=(M^h)<<1|h|1;v=O,A=1+M-O}let w=r-4;return y.map(x=>{switch(x-w){case 3:return w+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return w+256+(t[a++]<<8|t[a++]);case 1:return w+t[a++];default:return x-1}})}function Cre(t){let e=0;return()=>t[e++]}function cR(t){return Cre(kre(Ere(t)))}function Ere(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let n=t.length,r=new Uint8Array(6*n>>3);for(let s=0,i=0,o=0,a=0;s<n;s++)a=a<<6|e[t.charCodeAt(s)],o+=6,o>=8&&(r[i++]=a>>(o-=8));return r}function Sre(t){return t&1?~t>>1:t>>1}function Tre(t,e){let n=Array(t);for(let r=0,s=0;r<t;r++)n[r]=s+=Sre(e());return n}function Ih(t,e=0){let n=[];for(;;){let r=t(),s=t();if(!s)break;e+=r;for(let i=0;i<s;i++)n.push(e+i);e+=s+1}return n}function fR(t){return Lh(()=>{let e=Ih(t);if(e.length)return e})}function dR(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(Dre(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(Ore(n,t))}return e.flat()}function Lh(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function hR(t,e,n){let r=Array(t).fill().map(()=>[]);for(let s=0;s<e;s++)Tre(t,n).forEach((i,o)=>r[o].push(i));return r}function Dre(t,e){let n=1+e(),r=e(),s=Lh(e);return hR(s.length,1+t,e).flatMap((o,a)=>{let[l,...u]=o;return Array(s[a]).fill().map((c,f)=>{let d=f*r;return[l+f*n,u.map(h=>h+d)]})})}function Ore(t,e){let n=1+e();return hR(n,1+t,e).map(s=>[s[0],s.slice(1)])}function Mre(t){let e=[],n=Ih(t);return s(r([]),[]),e;function r(i){let o=t(),a=Lh(()=>{let l=Ih(t).map(u=>n[u]);if(l.length)return r(l)});return{S:o,B:a,Q:i}}function s({S:i,B:o},a,l){if(!(i&4&&l===a[a.length-1])){i&2&&(l=a[a.length-1]),i&1&&e.push(a);for(let u of o)for(let c of u.Q)s(u,[...a,c],l)}}}function Nre(t){return t.toString(16).toUpperCase().padStart(2,"0")}function pR(t){return`{${Nre(t)}}`}function _re(t){let e=[];for(let n=0,r=t.length;n<r;){let s=t.codePointAt(n);n+=s<65536?1:2,e.push(s)}return e}function Pc(t){let n=t.length;if(n<4096)return String.fromCodePoint(...t);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...t.slice(s,s+=4096)));return r.join("")}function Rre(t,e){let n=t.length,r=n-e.length;for(let s=0;r==0&&s<n;s++)r=t[s]-e[s];return r}var Pre="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";const Bh=44032,Zg=4352,ey=4449,ty=4519,mR=19,gR=21,Ic=28,ny=gR*Ic,Ire=mR*ny,Lre=Bh+Ire,Bre=Zg+mR,Fre=ey+gR,jre=ty+Ic;function Fh(t){return t>>24&255}function yR(t){return t&16777215}let Ix,bR,Lx,ry;function Ure(){let t=cR(Pre);Ix=new Map(fR(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),bR=new Set(Ih(t)),Lx=new Map,ry=new Map;for(let[e,n]of dR(t)){if(!bR.has(e)&&n.length==2){let[r,s]=n,i=ry.get(r);i||(i=new Map,ry.set(r,i)),i.set(s,e)}Lx.set(e,n.reverse())}}function wR(t){return t>=Bh&&t<Lre}function Hre(t,e){if(t>=Zg&&t<Bre&&e>=ey&&e<Fre)return Bh+(t-Zg)*ny+(e-ey)*Ic;if(wR(t)&&e>ty&&e<jre&&(t-Bh)%Ic==0)return t+(e-ty);{let n=ry.get(t);return n&&(n=n.get(e),n)?n:-1}}function AR(t){Ix||Ure();let e=[],n=[],r=!1;function s(i){let o=Ix.get(i);o&&(r=!0,i|=o),e.push(i)}for(let i of t)for(;;){if(i<128)e.push(i);else if(wR(i)){let o=i-Bh,a=o/ny|0,l=o%ny/Ic|0,u=o%Ic;s(Zg+a),s(ey+l),u>0&&s(ty+u)}else{let o=Lx.get(i);o?n.push(...o):s(i)}if(!n.length)break;i=n.pop()}if(r&&e.length>1){let i=Fh(e[0]);for(let o=1;o<e.length;o++){let a=Fh(e[o]);if(a==0||i<=a){i=a;continue}let l=o-1;for(;;){let u=e[l+1];if(e[l+1]=e[l],e[l]=u,!l||(i=Fh(e[--l]),i<=a))break}i=Fh(e[o])}}return e}function Vre(t){let e=[],n=[],r=-1,s=0;for(let i of t){let o=Fh(i),a=yR(i);if(r==-1)o==0?r=a:e.push(a);else if(s>0&&s>=o)o==0?(e.push(r,...n),n.length=0,r=a):n.push(a),s=o;else{let l=Hre(r,a);l>=0?r=l:s==0&&o==0?(e.push(r),r=a):(n.push(a),s=o)}}return r>=0&&e.push(r,...n),e}function vR(t){return AR(t).map(yR)}function zre(t){return Vre(AR(t))}const xR=45,kR=".",CR=65039,ER=1,sy=t=>Array.from(t);function jh(t,e){return t.P.has(e)||t.Q.has(e)}class $re extends Array{get is_emoji(){return!0}}let Bx,SR,Ml,Fx,TR,Lc,jx,Bc,Nl,DR,Ux;function Hx(){if(Bx)return;let t=cR(xre);const e=()=>Ih(t),n=()=>new Set(e()),r=(c,f)=>f.forEach(d=>c.add(d));Bx=new Map(dR(t)),SR=n(),Ml=e(),Fx=new Set(e().map(c=>Ml[c])),Ml=new Set(Ml),TR=n(),n();let s=fR(t),i=t();const o=()=>{let c=new Set;return e().forEach(f=>r(c,s[f])),r(c,e()),c};Lc=Lh(c=>{let f=Lh(t).map(d=>d+96);if(f.length){let d=c>=i;f[0]-=32,f=Pc(f),d&&(f=`Restricted[${f}]`);let h=o(),p=o(),m=!t();return{N:f,P:h,Q:p,M:m,R:d}}}),jx=n(),Bc=new Map;let a=e().concat(sy(jx)).sort((c,f)=>c-f);a.forEach((c,f)=>{let d=t(),h=a[f]=d?a[f-d]:{V:[],M:new Map};h.V.push(c),jx.has(c)||Bc.set(c,h)});for(let{V:c,M:f}of new Set(Bc.values())){let d=[];for(let p of c){let m=Lc.filter(y=>jh(y,p)),g=d.find(({G:y})=>m.some(v=>y.has(v)));g||(g={G:new Set,V:[]},d.push(g)),g.V.push(p),r(g.G,m)}let h=d.flatMap(p=>sy(p.G));for(let{G:p,V:m}of d){let g=new Set(h.filter(y=>!p.has(y)));for(let y of m)f.set(y,g)}}Nl=new Set;let l=new Set;const u=c=>Nl.has(c)?l.add(c):Nl.add(c);for(let c of Lc){for(let f of c.P)u(f);for(let f of c.Q)u(f)}for(let c of Nl)!Bc.has(c)&&!l.has(c)&&Bc.set(c,ER);r(Nl,vR(Nl)),DR=Mre(t).map(c=>$re.from(c)).sort(Rre),Ux=new Map;for(let c of DR){let f=[Ux];for(let d of c){let h=f.map(p=>{let m=p.get(d);return m||(m=new Map,p.set(d,m)),m});d===CR?f.push(...h):f=h}for(let d of f)d.V=c}}function Vx(t){return(OR(t)?"":`${zx(iy([t]))} `)+pR(t)}function zx(t){return`"${t}"`}function Gre(t){if(t.length>=4&&t[2]==xR&&t[3]==xR)throw new Error(`invalid label extension: "${Pc(t.slice(0,4))}"`)}function Wre(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Kre(t){let e=t[0],n=lR.get(e);if(n)throw Uh(`leading ${n}`);let r=t.length,s=-1;for(let i=1;i<r;i++){e=t[i];let o=lR.get(e);if(o){if(s==i)throw Uh(`${n} + ${o}`);s=i+1,n=o}}if(s==r)throw Uh(`trailing ${n}`)}function iy(t,e=1/0,n=pR){let r=[];qre(t[0])&&r.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let s=0,i=t.length;for(let o=0;o<i;o++){let a=t[o];OR(a)&&(r.push(Pc(t.slice(s,o))),r.push(n(a)),s=o+1)}return r.push(Pc(t.slice(s,i))),r.join("")}function qre(t){return Hx(),Ml.has(t)}function OR(t){return Hx(),TR.has(t)}function Qre(t){return Zre(Jre(t,zre,nse))}function Jre(t,e,n){if(!t)return[];Hx();let r=0;return t.split(kR).map(s=>{let i=_re(s),o={input:i,offset:r};r+=i.length+1;try{let a=o.tokens=tse(i,e,n),l=a.length,u;if(!l)throw new Error("empty label");let c=o.output=a.flat();if(Wre(c),!(o.emoji=l>1||a[0].is_emoji)&&c.every(d=>d<128))Gre(c),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(Ml.has(c[0]))throw Uh("leading combining mark");for(let m=1;m<l;m++){let g=a[m];if(!g.is_emoji&&Ml.has(g[0]))throw Uh(`emoji + combining mark: "${Pc(a[m-1])} + ${iy([g[0]])}"`)}Kre(c);let h=sy(new Set(d)),[p]=Xre(h);ese(p,d),Yre(p,h),u=p.N}}o.type=u}catch(a){o.error=a}return o})}function Yre(t,e){let n,r=[];for(let s of e){let i=Bc.get(s);if(i===ER)return;if(i){let o=i.M.get(s);if(n=n?n.filter(a=>o.has(a)):sy(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(i=>jh(s,i)))throw new Error(`whole-script confusable: ${t.N}/${s.N}`)}}function Xre(t){let e=Lc;for(let n of t){let r=e.filter(s=>jh(s,n));if(!r.length)throw Lc.some(s=>jh(s,n))?NR(e[0],n):MR(n);if(e=r,r.length==1)break}return e}function Zre(t){return t.map(({input:e,error:n,output:r})=>{if(n){let s=n.message;throw new Error(t.length==1?s:`Invalid label ${zx(iy(e,63))}: ${s}`)}return Pc(r)}).join(kR)}function MR(t){return new Error(`disallowed character: ${Vx(t)}`)}function NR(t,e){let n=Vx(e),r=Lc.find(s=>s.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Uh(t){return new Error(`illegal placement: ${t}`)}function ese(t,e){for(let n of e)if(!jh(t,n))throw NR(t,n);if(t.M){let n=vR(e);for(let r=1,s=n.length;r<s;r++)if(Fx.has(n[r])){let i=r+1;for(let o;i<s&&Fx.has(o=n[i]);i++)for(let a=r;a<i;a++)if(n[a]==o)throw new Error(`duplicate non-spacing marks: ${Vx(o)}`);if(i-r>uR)throw new Error(`excessive non-spacing marks: ${zx(iy(n.slice(r-1,i)))} (${i-r}/${uR})`);r=i}}}function tse(t,e,n){let r=[],s=[];for(t=t.slice().reverse();t.length;){let i=rse(t);if(i)s.length&&(r.push(e(s)),s=[]),r.push(n(i));else{let o=t.pop();if(Nl.has(o))s.push(o);else{let a=Bx.get(o);if(a)s.push(...a);else if(!SR.has(o))throw MR(o)}}}return s.length&&r.push(e(s)),r}function nse(t){return t.filter(e=>e!=CR)}function rse(t,e){let n=Ux,r,s=t.length;for(;s&&(n=n.get(t[--s]),!!n);){let{V:i}=n;i&&(r=i,t.length=s)}return r}const _R=new Uint8Array(32);_R.fill(0);function RR(t){return G(t.length!==0,"invalid ENS name; empty component","comp",t),t}function PR(t){const e=Vi(sse(t)),n=[];if(t.length===0)return n;let r=0;for(let s=0;s<e.length;s++)e[s]===46&&(n.push(RR(e.slice(r,s))),r=s+1);return G(r<e.length,"invalid ENS name; empty component","name",t),n.push(RR(e.slice(r))),n}function sse(t){try{if(t.length===0)throw new Error("empty label");return Qre(t)}catch(e){G(!1,`invalid ENS name (${e.message})`,"name",t)}}function $x(t){G(typeof t=="string","invalid ENS name; not a string","name",t),G(t.length,"invalid ENS name (empty label)","name",t);let e=_R;const n=PR(t);for(;n.length;)e=en($t([e,en(n.pop())]));return we(e)}function ise(t,e){const n=e;return G(n<=255,"DNS encoded label cannot exceed 255","length",n),we($t(PR(t).map(r=>{G(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const s=new Uint8Array(r.length+1);return s.set(r,1),s[0]=s.length-1,s})))+"00"}function Gx(t,e){return{address:gt(t),storageKeys:e.map((n,r)=>(G(St(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function oa(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(G(n.length===2,"invalid slot set",`value[${r}]`,n),Gx(n[0],n[1])):(G(n!=null&&typeof n=="object","invalid address-slot set","value",t),Gx(n.address,n.storageKeys)));G(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((s,i)=>(s[i]=!0,s),{});return Gx(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function ose(t){let e;return typeof t=="string"?e=Ph.computePublicKey(t,!1):e=t.publicKey,gt(en("0x"+e.substring(4)).substring(26))}function ase(t,e){return ose(Ph.recoverPublicKey(t,e))}const bn=BigInt(0),lse=BigInt(2),use=BigInt(27),cse=BigInt(28),fse=BigInt(35),dse=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Wx=4096*32;function IR(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=Oc(e).substring(4),"0x"+n}function oy(t){return t==="0x"?null:gt(t)}function Kx(t,e){try{return oa(t)}catch(n){G(!1,n.message,e,t)}}function Hh(t,e){return t==="0x"?0:Qe(t,e)}function Wt(t,e){if(t==="0x")return bn;const n=Ee(t,e);return G(n<=dse,"value exceeds uint size",e,n),n}function Ot(t,e){const n=Ee(t,"value"),r=Wn(n);return G(r.length<=32,"value too large",`tx.${e}`,n),r}function qx(t){return oa(t).map(e=>[e.address,e.storageKeys])}function hse(t,e){G(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n<t.length;n++)G(St(t[n],32),"invalid ${ param } hash",`value[${n}]`,t[n]);return t}function pse(t){const e=$g(t);G(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:Hh(e[0],"nonce"),gasPrice:Wt(e[1],"gasPrice"),gasLimit:Wt(e[2],"gasLimit"),to:oy(e[3]),value:Wt(e[4],"value"),data:we(e[5]),chainId:bn};if(e.length===6)return n;const r=Wt(e[6],"v"),s=Wt(e[7],"r"),i=Wt(e[8],"s");if(s===bn&&i===bn)n.chainId=r;else{let o=(r-fse)/lse;o<bn&&(o=bn),n.chainId=o,G(o!==bn||r===use||r===cse,"non-canonical legacy v","v",e[6]),n.signature=Ss.from({r:xl(e[7],32),s:xl(e[8],32),v:r})}return n}function mse(t,e){const n=[Ot(t.nonce,"nonce"),Ot(t.gasPrice||0,"gasPrice"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data];let r=bn;if(t.chainId!=bn)r=Ee(t.chainId,"tx.chainId"),G(!e||e.networkV==null||e.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const i=t.signature.legacyChainId;i!=null&&(r=i)}if(!e)return r!==bn&&(n.push(Wn(r)),n.push("0x"),n.push("0x")),Cl(n);let s=BigInt(27+e.yParity);return r!==bn?s=Ss.getChainIdV(r,e.v):BigInt(e.v)!==s&&G(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(Wn(s)),n.push(Wn(e.r)),n.push(Wn(e.s)),Cl(n)}function Qx(t,e){let n;try{if(n=Hh(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{G(!1,"invalid yParity","yParity",e[0])}const r=xl(e[1],32),s=xl(e[2],32),i=Ss.from({r,s,yParity:n});t.signature=i}function gse(t){const e=$g(ct(t).slice(1));G(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",we(t));const n={type:2,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:oy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:Kx(e[8],"accessList")};return e.length===9||Qx(n,e.slice(9)),n}function yse(t,e){const n=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ot(t.maxFeePerGas||0,"maxFeePerGas"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data,qx(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"yParity")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x02",Cl(n)])}function bse(t){const e=$g(ct(t).slice(1));G(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",we(t));const n={type:1,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),gasPrice:Wt(e[2],"gasPrice"),gasLimit:Wt(e[3],"gasLimit"),to:oy(e[4]),value:Wt(e[5],"value"),data:we(e[6]),accessList:Kx(e[7],"accessList")};return e.length===8||Qx(n,e.slice(8)),n}function wse(t,e){const n=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.gasPrice||0,"gasPrice"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data,qx(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"recoveryParam")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x01",Cl(n)])}function Ase(t){let e=$g(ct(t).slice(1)),n="3",r=null;if(e.length===4&&Array.isArray(e[0])){n="3 (network format)";const i=e[1],o=e[2],a=e[3];G(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),G(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),G(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),G(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),G(i.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),r=[];for(let l=0;l<e[1].length;l++)r.push({data:i[l],commitment:o[l],proof:a[l]});e=e[0]}G(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${n}`,"data",we(t));const s={type:3,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:oy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:Kx(e[8],"accessList"),maxFeePerBlobGas:Wt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};r&&(s.blobs=r),G(s.to!=null,`invalid address for transaction type: ${n}`,"data",t),G(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let i=0;i<s.blobVersionedHashes.length;i++)G(St(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",t);return e.length===11||Qx(s,e.slice(11)),s}function vse(t,e,n){const r=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ot(t.maxFeePerGas||0,"maxFeePerGas"),Ot(t.gasLimit,"gasLimit"),t.to||Rh,Ot(t.value,"value"),t.data,qx(t.accessList||[]),Ot(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),hse(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(r.push(Ot(e.yParity,"yParity")),r.push(Wn(e.r)),r.push(Wn(e.s)),n)?$t(["0x03",Cl([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):$t(["0x03",Cl(r)])}const co=class co{constructor(){J(this,kf);J(this,mi);J(this,df);J(this,hf);J(this,pf);J(this,mf);J(this,gf);J(this,yf);J(this,bf);J(this,wf);J(this,Af);J(this,vf);J(this,xf);J(this,ru);J(this,ya);J(this,uo);J(this,ba);I(this,mi,null),I(this,df,null),I(this,pf,0),I(this,mf,bn),I(this,gf,null),I(this,yf,null),I(this,bf,null),I(this,hf,"0x"),I(this,wf,bn),I(this,Af,bn),I(this,vf,null),I(this,xf,null),I(this,ru,null),I(this,ya,null),I(this,ba,null),I(this,uo,null)}get type(){return T(this,mi)}set type(e){switch(e){case null:I(this,mi,null);break;case 0:case"legacy":I(this,mi,0);break;case 1:case"berlin":case"eip-2930":I(this,mi,1);break;case 2:case"london":case"eip-1559":I(this,mi,2);break;case 3:case"cancun":case"eip-4844":I(this,mi,3);break;default:G(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=T(this,df);return e==null&&this.type===3?Rh:e}set to(e){I(this,df,e==null?null:gt(e))}get nonce(){return T(this,pf)}set nonce(e){I(this,pf,Qe(e,"value"))}get gasLimit(){return T(this,mf)}set gasLimit(e){I(this,mf,Ee(e))}get gasPrice(){const e=T(this,gf);return e==null&&(this.type===0||this.type===1)?bn:e}set gasPrice(e){I(this,gf,e==null?null:Ee(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=T(this,yf);return e??(this.type===2||this.type===3?bn:null)}set maxPriorityFeePerGas(e){I(this,yf,e==null?null:Ee(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=T(this,bf);return e??(this.type===2||this.type===3?bn:null)}set maxFeePerGas(e){I(this,bf,e==null?null:Ee(e,"maxFeePerGas"))}get data(){return T(this,hf)}set data(e){I(this,hf,we(e))}get value(){return T(this,wf)}set value(e){I(this,wf,Ee(e,"value"))}get chainId(){return T(this,Af)}set chainId(e){I(this,Af,Ee(e))}get signature(){return T(this,vf)||null}set signature(e){I(this,vf,e==null?null:Ss.from(e))}get accessList(){const e=T(this,xf)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){I(this,xf,e==null?null:oa(e))}get maxFeePerBlobGas(){const e=T(this,ru);return e==null&&this.type===3?bn:e}set maxFeePerBlobGas(e){I(this,ru,e==null?null:Ee(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=T(this,ya);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){G(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)G(St(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}I(this,ya,e)}get blobs(){return T(this,ba)==null?null:T(this,ba).map(e=>Object.assign({},e))}set blobs(e){if(e==null){I(this,ba,null);return}const n=[],r=[];for(let s=0;s<e.length;s++){const i=e[s];if(ux(i)){ee(T(this,uo),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ct(i);if(G(o.length<=Wx,"blob is too large",`blobs[${s}]`,i),o.length!==Wx){const u=new Uint8Array(Wx);u.set(o),o=u}const a=T(this,uo).blobToKzgCommitment(o),l=we(T(this,uo).computeBlobKzgProof(o,a));n.push({data:we(o),commitment:we(a),proof:l}),r.push(IR(1,a))}else{const o=we(i.commitment);n.push({data:we(i.data),commitment:o,proof:we(i.proof)}),r.push(IR(1,o))}}I(this,ba,n),I(this,ya,r)}get kzg(){return T(this,uo)}set kzg(e){I(this,uo,e)}get hash(){return this.signature==null?null:en(fe(this,kf,ab).call(this,!0,!1))}get unsignedHash(){return en(this.unsignedSerialized)}get from(){return this.signature==null?null:ase(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Ph.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return fe(this,kf,ab).call(this,!0,!0)}get unsignedSerialized(){return fe(this,kf,ab).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,s=T(this,ru)!=null||T(this,ya);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ee(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ee(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ee(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return co.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new co;if(typeof e=="string"){const r=ct(e);if(r[0]>=127)return co.from(pse(r));switch(r[0]){case 1:return co.from(bse(r));case 2:return co.from(gse(r));case 3:return co.from(Ase(r))}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new co;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Ss.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(n.kzg=e.kzg),e.blobs!=null&&(n.blobs=e.blobs),e.hash!=null&&(G(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),G(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(G(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),G(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};mi=new WeakMap,df=new WeakMap,hf=new WeakMap,pf=new WeakMap,mf=new WeakMap,gf=new WeakMap,yf=new WeakMap,bf=new WeakMap,wf=new WeakMap,Af=new WeakMap,vf=new WeakMap,xf=new WeakMap,ru=new WeakMap,ya=new WeakMap,uo=new WeakMap,ba=new WeakMap,kf=new WeakSet,ab=function(e,n){ee(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return mse(this,r);case 1:return wse(this,r);case 2:return yse(this,r);case 3:return vse(this,r,n?this.blobs:null)}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let Vh=co;const LR=new Uint8Array(32);LR.fill(0);const xse=BigInt(-1),BR=BigInt(0),FR=BigInt(1),kse=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Cse(t){const e=ct(t),n=e.length%32;return n?$t([e,LR.slice(n)]):we(e)}const Ese=Zo(FR,32),Sse=Zo(BR,32),jR={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Jx=["name","version","chainId","verifyingContract","salt"];function UR(t){return function(e){return G(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Tse={name:UR("name"),version:UR("version"),chainId:function(t){const e=Ee(t,"domain.chainId");return G(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):kl(e)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}G(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=ct(t,"domain.salt");return G(e.length===32,'invalid domain value "salt"',"domain.salt",t),we(e)}};function Yx(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);G(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const s=Dh(kse,n?r-1:r),i=n?(s+FR)*xse:BR;return function(o){const a=Ee(o,"value");return G(a>=i&&a<=s,`value out-of-bounds for ${t}`,"value",a),Zo(n?z6(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return G(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const s=ct(r);return G(s.length===n,`invalid length for ${t}`,"value",r),Cse(r)}}}switch(t){case"address":return function(e){return xl(gt(e),32)};case"bool":return function(e){return e?Ese:Sse};case"bytes":return function(e){return en(e)};case"string":return function(e){return Ol(e)}}return null}function HR(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function ay(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}const ns=class ns{constructor(e){J(this,eb);W(this,"primaryType");J(this,mp);J(this,fo);J(this,Cf);I(this,fo,new Map),I(this,Cf,new Map);const n=new Map,r=new Map,s=new Map,i={};Object.keys(e).forEach(l=>{i[l]=e[l].map(({name:u,type:c})=>{let{base:f,index:d}=ay(c);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:u,type:f+(d||"")}}),n.set(l,new Set),r.set(l,[]),s.set(l,new Set)}),I(this,mp,JSON.stringify(i));for(const l in i){const u=new Set;for(const c of i[l]){G(!u.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(l)}`,"types",e),u.add(c.name);const f=ay(c.type).base;G(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!Yx(f)&&(G(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);G(o.length!==0,"missing primary type","types",e),G(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Me(this,{primaryType:o[0]});function a(l,u){G(!u.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),u.add(l);for(const c of n.get(l))if(r.has(c)){a(c,u);for(const f of u)s.get(f).add(c)}u.delete(l)}a(this.primaryType,new Set);for(const[l,u]of s){const c=Array.from(u);c.sort(),T(this,fo).set(l,HR(l,i[l])+c.map(f=>HR(f,i[f])).join(""))}}get types(){return JSON.parse(T(this,mp))}getEncoder(e){let n=T(this,Cf).get(e);return n||(n=fe(this,eb,ML).call(this,e),T(this,Cf).set(e,n)),n}encodeType(e){const n=T(this,fo).get(e);return G(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return en(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(Yx(e))return r(e,n);const s=ay(e).array;if(s)return G(s.count===-1||s.count===n.length,`array length mismatch; expected length ${s.count}`,"value",n),n.map(o=>this._visit(s.prefix,o,r));const i=this.types[e];if(i)return i.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,n[a],r),o),{});G(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new ns(e)}static getPrimaryType(e){return ns.from(e).primaryType}static hashStruct(e,n,r){return ns.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const s=jR[r];G(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:s})}return n.sort((r,s)=>Jx.indexOf(r.name)-Jx.indexOf(s.name)),ns.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return $t(["0x1901",ns.hashDomain(e),ns.from(n).hash(r)])}static hash(e,n,r){return en(ns.encode(e,n,r))}static async resolveNames(e,n,r,s){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const i={};e.verifyingContract&&!St(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=ns.from(n);o.visit(r,(a,l)=>(a==="address"&&!St(l,20)&&(i[l]="0x"),l));for(const a in i)i[a]=await s(a);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,(a,l)=>a==="address"&&i[l]?i[l]:l),{domain:e,value:r}}static getPayload(e,n,r){ns.hashDomain(e);const s={},i=[];Jx.forEach(l=>{const u=e[l];u!=null&&(s[l]=Tse[l](u),i.push({name:l,type:jR[l]}))});const o=ns.from(n);n=o.types;const a=Object.assign({},n);return G(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),a.EIP712Domain=i,o.encode(r),{types:a,domain:s,primaryType:o.primaryType,message:o.visit(r,(l,u)=>{if(l.match(/^bytes(\d*)/))return we(ct(u));if(l.match(/^u?int/))return Ee(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return G(typeof u=="string","invalid string","value",u),u}G(!1,"unsupported type","type",l)})}}};mp=new WeakMap,fo=new WeakMap,Cf=new WeakMap,eb=new WeakSet,ML=function(e){{const s=Yx(e);if(s)return s}const n=ay(e).array;if(n){const s=n.prefix,i=this.getEncoder(s);return o=>{G(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let a=o.map(i);return T(this,fo).has(s)&&(a=a.map(en)),en($t(a))}}const r=this.types[e];if(r){const s=Ol(T(this,fo).get(e));return i=>{const o=r.map(({name:a,type:l})=>{const u=this.getEncoder(l)(i[a]);return T(this,fo).has(l)?en(u):u});return o.unshift(s),$t(o)}}G(!1,`unknown type: ${e}`,"type",e)};let ly=ns;function Jn(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const Dse=Jn("external public payable override".split(" ")),VR="constant external internal payable private public pure view override",Ose=Jn(VR.split(" ")),zR="constructor error event fallback function receive struct",$R=Jn(zR.split(" ")),GR="calldata memory storage payable indexed",Mse=Jn(GR.split(" ")),Nse=[zR,GR,"tuple returns",VR].join(" "),_se=Jn(Nse.split(" ")),Rse={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Pse=new RegExp("^(\\s*)"),Ise=new RegExp("^([0-9]+)"),Lse=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),WR=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),KR=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),tb=class tb{constructor(e){J(this,gp);J(this,Dn);J(this,_s);I(this,Dn,0),I(this,_s,e.slice())}get offset(){return T(this,Dn)}get length(){return T(this,_s).length-T(this,Dn)}clone(){return new tb(T(this,_s))}reset(){I(this,Dn,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=fe(this,gp,Hk).call(this,T(this,Dn)+1,e.match+1);return I(this,Dn,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;T(this,Dn)<e.match-1;){const r=this.peek().linkNext;n.push(fe(this,gp,Hk).call(this,T(this,Dn)+1,r)),I(this,Dn,r)}return I(this,Dn,e.match+1),n}peek(){if(T(this,Dn)>=T(this,_s).length)throw new Error("out-of-bounds");return T(this,_s)[T(this,Dn)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return Tp(this,Dn)._++,e}toString(){const e=[];for(let n=T(this,Dn);n<T(this,_s).length;n++){const r=T(this,_s)[n];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}};Dn=new WeakMap,_s=new WeakMap,gp=new WeakSet,Hk=function(e=0,n=0){return new tb(T(this,_s).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Ts=tb;function aa(t){const e=[],n=o=>{const a=i<t.length?JSON.stringify(t[i]):"$EOI";throw new Error(`invalid token ${a} at ${i}: ${o}`)};let r=[],s=[],i=0;for(;i<t.length;){let o=t.substring(i),a=o.match(Pse);a&&(i+=a[1].length,o=t.substring(i));const l={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(l);let u=Rse[o[0]]||"";if(u){if(l.type=u,l.text=o[0],i++,u==="OPEN_PAREN")r.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),l.match=r.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1;else if(u==="COMMA")l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(u==="OPEN_BRACKET")l.type="BRACKET";else if(u==="CLOSE_BRACKET"){let c=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;c=f+c,e[e.length-1].value=Qe(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=c}continue}if(a=o.match(Lse),a){if(l.text=a[1],i+=l.text.length,_se.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(KR)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(Ise),a){l.text=a[1],l.type="NUMBER",i+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${i}`)}return new Ts(e.map(o=>Object.freeze(o)))}function qR(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function uy(t,e){if(e.peekKeyword($R)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Wi(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function QR(t){let e=Wi(t,Ose);return qR(e,Jn("constant payable nonpayable".split(" "))),qR(e,Jn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Ki(t,e){return t.popParams().map(n=>Cn.from(n,e))}function JR(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Ee(t.pop().text);throw new Error("invalid gas")}return null}function _l(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const Bse=new RegExp(/^(.*)\[([0-9]*)\]$/);function YR(t){const e=t.match(KR);if(G(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);G(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);G(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const Lt={},dr=Symbol.for("_ethers_internal"),XR="_ParamTypeInternal",ZR="_ErrorInternal",eP="_EventInternal",tP="_ConstructorInternal",nP="_FallbackInternal",rP="_FunctionInternal",sP="_StructInternal",rs=class rs{constructor(e,n,r,s,i,o,a,l){J(this,Ef);W(this,"name");W(this,"type");W(this,"baseType");W(this,"indexed");W(this,"components");W(this,"arrayLength");W(this,"arrayChildren");if(jg(e,Lt,"ParamType"),Object.defineProperty(this,dr,{value:XR}),o&&(o=Object.freeze(o.slice())),s==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Me(this,{name:n,type:r,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=r,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(s=>r.arrayChildren.walk(s,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((s,i)=>r.components[i].walk(s,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],s=[e];return fe(this,Ef,lb).call(this,r,e,n,i=>{s[0]=i}),r.length&&await Promise.all(r),s[0]}static from(e,n){if(rs.isParamType(e))return e;if(typeof e=="string")try{return rs.from(aa(e),n)}catch{G(!1,"invalid param type","obj",e)}else if(e instanceof Ts){let a="",l="",u=null;Wi(e,Jn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(m=>rs.from(m)),a=`tuple(${u.map(m=>m.format()).join(",")})`):(a=YR(e.popType("TYPE")),l=a);let c=null,f=null;for(;e.length&&e.peekType("BRACKET");){const m=e.pop();c=new rs(Lt,"",a,l,null,u,f,c),f=m.value,a+=m.text,l="array",u=null}let d=null;if(Wi(e,Mse).has("indexed")){if(!n)throw new Error("");d=!0}const p=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new rs(Lt,p,a,l,d,u,f,c)}const r=e.name;G(!r||typeof r=="string"&&r.match(WR),"invalid name","obj.name",r);let s=e.indexed;s!=null&&(G(n,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(Bse);if(o){const a=parseInt(o[2]||"-1"),l=rs.from({type:o[1],components:e.components});return new rs(Lt,r||"",i,"array",s,null,a,l)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const a=e.components!=null?e.components.map(u=>rs.from(u)):null;return new rs(Lt,r||"",i,"tuple",s,a,null,null)}return i=YR(e.type),new rs(Lt,r||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[dr]===XR}};Ef=new WeakSet,lb=function(e,n,r,s){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=n.slice();a.forEach((l,u)=>{var c;fe(c=o,Ef,lb).call(c,e,l,r,f=>{a[u]=f})}),s(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(n))a=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");a=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,u)=>{var c;fe(c=o[u],Ef,lb).call(c,e,l,r,f=>{a[u]=f})}),s(a);return}const i=r(this.type,n);i.then?e.push(async function(){s(await i)}()):s(i)};let Cn=rs;class Rl{constructor(e,n,r){W(this,"type");W(this,"inputs");jg(e,Lt,"Fragment"),r=Object.freeze(r.slice()),Me(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{Rl.from(JSON.parse(e))}catch{}return Rl.from(aa(e))}if(e instanceof Ts)switch(e.peekKeyword($R)){case"constructor":return qi.from(e);case"error":return hr.from(e);case"event":return fi.from(e);case"fallback":case"receive":return Qi.from(e);case"function":return di.from(e);case"struct":return Pl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return qi.from(e);case"error":return hr.from(e);case"event":return fi.from(e);case"fallback":case"receive":return Qi.from(e);case"function":return di.from(e);case"struct":return Pl.from(e)}ee(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}G(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return qi.isFragment(e)}static isError(e){return hr.isFragment(e)}static isEvent(e){return fi.isFragment(e)}static isFunction(e){return di.isFragment(e)}static isStruct(e){return Pl.isFragment(e)}}class cy extends Rl{constructor(n,r,s,i){super(n,r,i);W(this,"name");G(typeof s=="string"&&s.match(WR),"invalid identifier","name",s),i=Object.freeze(i.slice()),Me(this,{name:s})}}function zh(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class hr extends cy{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,dr,{value:ZR})}get selector(){return Ol(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+zh(e,this.inputs)),n.join(" ")}static from(e){if(hr.isFragment(e))return e;if(typeof e=="string")return hr.from(aa(e));if(e instanceof Ts){const n=uy("error",e),r=Ki(e);return _l(e),new hr(Lt,n,r)}return new hr(Lt,e.name,e.inputs?e.inputs.map(Cn.from):[])}static isFragment(e){return e&&e[dr]===ZR}}class fi extends cy{constructor(n,r,s,i){super(n,"event",r,s);W(this,"anonymous");Object.defineProperty(this,dr,{value:eP}),Me(this,{anonymous:i})}get topicHash(){return Ol(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+zh(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(i=>Cn.from(i)),new fi(Lt,n,r,!1).topicHash}static from(n){if(fi.isFragment(n))return n;if(typeof n=="string")try{return fi.from(aa(n))}catch{G(!1,"invalid event fragment","obj",n)}else if(n instanceof Ts){const r=uy("event",n),s=Ki(n,!0),i=!!Wi(n,Jn(["anonymous"])).has("anonymous");return _l(n),new fi(Lt,r,s,i)}return new fi(Lt,n.name,n.inputs?n.inputs.map(r=>Cn.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[dr]===eP}}class qi extends Rl{constructor(n,r,s,i,o){super(n,r,s);W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:tP}),Me(this,{payable:i,gas:o})}format(n){if(ee(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[`constructor${zh(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(qi.isFragment(n))return n;if(typeof n=="string")try{return qi.from(aa(n))}catch{G(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Ts){Wi(n,Jn(["constructor"]));const r=Ki(n),s=!!Wi(n,Dse).has("payable"),i=JR(n);return _l(n),new qi(Lt,"constructor",r,s,i)}return new qi(Lt,"constructor",n.inputs?n.inputs.map(Cn.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===tP}}class Qi extends Rl{constructor(n,r,s){super(n,"fallback",r);W(this,"payable");Object.defineProperty(this,dr,{value:nP}),Me(this,{payable:s})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(n){if(Qi.isFragment(n))return n;if(typeof n=="string")try{return Qi.from(aa(n))}catch{G(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Ts){const r=n.toString(),s=n.peekKeyword(Jn(["fallback","receive"]));if(G(s,"type must be fallback or receive","obj",r),n.popKeyword(Jn(["fallback","receive"]))==="receive"){const l=Ki(n);return G(l.length===0,"receive cannot have arguments","obj.inputs",l),Wi(n,Jn(["payable"])),_l(n),new Qi(Lt,[],!0)}let o=Ki(n);o.length?G(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[Cn.from("bytes")];const a=QR(n);if(G(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Wi(n,Jn(["returns"])).has("returns")){const l=Ki(n);G(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return _l(n),new Qi(Lt,o,a==="payable")}if(n.type==="receive")return new Qi(Lt,[],!0);if(n.type==="fallback"){const r=[Cn.from("bytes")],s=n.stateMutability==="payable";return new Qi(Lt,r,s)}G(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[dr]===nP}}class di extends cy{constructor(n,r,s,i,o,a){super(n,"function",r,i);W(this,"constant");W(this,"outputs");W(this,"stateMutability");W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:rP}),o=Object.freeze(o.slice()),Me(this,{constant:s==="view"||s==="pure",gas:a,outputs:o,payable:s==="payable",stateMutability:s})}get selector(){return Ol(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="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!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n))),outputs:this.outputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+zh(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(zh(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(i=>Cn.from(i)),new di(Lt,n,"view",r,[],null).selector}static from(n){if(di.isFragment(n))return n;if(typeof n=="string")try{return di.from(aa(n))}catch{G(!1,"invalid function fragment","obj",n)}else if(n instanceof Ts){const s=uy("function",n),i=Ki(n),o=QR(n);let a=[];Wi(n,Jn(["returns"])).has("returns")&&(a=Ki(n));const l=JR(n);return _l(n),new di(Lt,s,o,i,a,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new di(Lt,n.name,r,n.inputs?n.inputs.map(Cn.from):[],n.outputs?n.outputs.map(Cn.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===rP}}class Pl extends cy{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,dr,{value:sP})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Pl.from(aa(e))}catch{G(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ts){const n=uy("struct",e),r=Ki(e);return _l(e),new Pl(Lt,n,r)}return new Pl(Lt,e.name,e.inputs?e.inputs.map(Cn.from):[])}static isFragment(e){return e&&e[dr]===sP}}const Ds=new Map;Ds.set(0,"GENERIC_PANIC"),Ds.set(1,"ASSERT_FALSE"),Ds.set(17,"OVERFLOW"),Ds.set(18,"DIVIDE_BY_ZERO"),Ds.set(33,"ENUM_RANGE_ERROR"),Ds.set(34,"BAD_STORAGE_DATA"),Ds.set(49,"STACK_UNDERFLOW"),Ds.set(50,"ARRAY_RANGE_ERROR"),Ds.set(65,"OUT_OF_MEMORY"),Ds.set(81,"UNINITIALIZED_FUNCTION_CALL");const Fse=new RegExp(/^bytes([0-9]*)$/),jse=new RegExp(/^(u?int)([0-9]*)$/);let Xx=null,iP=1024;function Use(t,e,n,r){let s="missing revert data",i=null;const o=null;let a=null;if(n){s="execution reverted";const u=ct(n);if(n=we(n),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(we(u.slice(0,4))==="0x08c379a0")try{i=r.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(we(u.slice(0,4))==="0x4e487b71")try{const c=Number(r.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[c]},i=`Panic due to ${Ds.get(c)||"UNKNOWN"}(${c})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const l={to:e.to?gt(e.to):null,data:e.data||"0x"};return e.from&&(l.from=gt(e.from)),_t(s,"CALL_EXCEPTION",{action:t,data:n,reason:i,transaction:l,invocation:o,revert:a})}const nb=class nb{constructor(){J(this,wa)}getDefaultValue(e){const n=e.map(s=>fe(this,wa,qf).call(this,Cn.from(s)));return new Xg(n,"_").defaultValue()}encode(e,n){j6(n.length,e.length,"types/values length mismatch");const r=e.map(o=>fe(this,wa,qf).call(this,Cn.from(o))),s=new Xg(r,"_"),i=new px;return s.encode(i,n),i.data}decode(e,n,r){const s=e.map(o=>fe(this,wa,qf).call(this,Cn.from(o)));return new Xg(s,"_").decode(new mx(n,r,iP))}static _setDefaultMaxInflation(e){G(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),iP=e}static defaultAbiCoder(){return Xx==null&&(Xx=new nb),Xx}static getBuiltinCallException(e,n,r){return Use(e,n,r,nb.defaultAbiCoder())}};wa=new WeakSet,qf=function(e){if(e.isArray())return new fre(fe(this,wa,qf).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Xg(e.components.map(r=>fe(this,wa,qf).call(this,r)),e.name);switch(e.baseType){case"address":return new ure(e.name);case"bool":return new dre(e.name);case"string":return new vre(e.name);case"bytes":return new hre(e.name);case"":return new gre(e.name)}let n=e.type.match(jse);if(n){let r=parseInt(n[2]||"256");return G(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Are(r/8,n[1]==="int",e.name)}if(n=e.type.match(Fse),n){let r=parseInt(n[1]);return G(r!==0&&r<=32,"invalid bytes length","param",e),new pre(r,e.name)}G(!1,"invalid type","type",e.type)};let Fc=nb;class Hse{constructor(e,n,r){W(this,"fragment");W(this,"name");W(this,"signature");W(this,"topic");W(this,"args");const s=e.name,i=e.format();Me(this,{fragment:e,name:s,signature:i,topic:n,args:r})}}class Vse{constructor(e,n,r,s){W(this,"fragment");W(this,"name");W(this,"args");W(this,"signature");W(this,"selector");W(this,"value");const i=e.name,o=e.format();Me(this,{fragment:e,name:i,args:r,signature:o,selector:n,value:s})}}class zse{constructor(e,n,r){W(this,"fragment");W(this,"name");W(this,"args");W(this,"signature");W(this,"selector");const s=e.name,i=e.format();Me(this,{fragment:e,name:s,args:r,signature:i,selector:n})}}class oP{constructor(e){W(this,"hash");W(this,"_isIndexed");Me(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const aP={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},lP={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&aP[t.toString()]&&(e=aP[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}},su=class su{constructor(e){J(this,wi);W(this,"fragments");W(this,"deploy");W(this,"fallback");W(this,"receive");J(this,gi);J(this,yi);J(this,bi);J(this,Ln);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,I(this,bi,new Map),I(this,gi,new Map),I(this,yi,new Map);const r=[];for(const o of n)try{r.push(Rl.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Me(this,{fragments:Object.freeze(r)});let s=null,i=!1;I(this,Ln,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Me(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:(G(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":l=T(this,bi);break;case"event":l=T(this,yi);break;case"error":l=T(this,gi);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Me(this,{deploy:qi.from("constructor()")}),Me(this,{fallback:s,receive:i})}format(e){const n=e?"minimal":"full";return this.fragments.map(s=>s.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return Fc.defaultAbiCoder()}getFunctionName(e){const n=fe(this,wi,ub).call(this,e,null,!1);return G(n,"no matching function","key",e),n.name}hasFunction(e){return!!fe(this,wi,ub).call(this,e,null,!1)}getFunction(e,n){return fe(this,wi,ub).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(T(this,bi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,bi).get(s),r)}}getEventName(e){const n=fe(this,wi,cb).call(this,e,null,!1);return G(n,"no matching event","key",e),n.name}hasEvent(e){return!!fe(this,wi,cb).call(this,e,null,!1)}getEvent(e,n){return fe(this,wi,cb).call(this,e,n||null,!0)}forEachEvent(e){const n=Array.from(T(this,yi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,yi).get(s),r)}}getError(e,n){if(St(e)){const s=e.toLowerCase();if(lP[s])return hr.from(lP[s].signature);for(const i of T(this,gi).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){const s=[];for(const[i,o]of T(this,gi))i.split("(")[0]===e&&s.push(o);if(s.length===0)return e==="Error"?hr.from("error Error(string)"):e==="Panic"?hr.from("error Panic(uint256)"):null;if(s.length>1){const i=s.map(o=>JSON.stringify(o.format())).join(", ");G(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=hr.from(e).format(),e==="Error(string)")return hr.from("error Error(string)");if(e==="Panic(uint256)")return hr.from("error Panic(uint256)");const r=T(this,gi).get(e);return r||null}forEachError(e){const n=Array.from(T(this,gi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,gi).get(s),r)}}_decodeParams(e,n){return T(this,Ln).decode(e,n)}_encodeParams(e,n){return T(this,Ln).encode(e,n)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);G(r,"unknown error","fragment",e),e=r}return G(Vt(n,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",n),this._decodeParams(e.inputs,Vt(n,4))}encodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);G(r,"unknown error","fragment",e),e=r}return $t([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);G(r,"unknown function","fragment",e),e=r}return G(Vt(n,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",n),this._decodeParams(e.inputs,Vt(n,4))}encodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);G(r,"unknown function","fragment",e),e=r}return $t([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionResult(e,n){if(typeof e=="string"){const i=this.getFunction(e);G(i,"unknown function","fragment",e),e=i}let r="invalid length for result data";const s=Gn(n);if(s.length%32===0)try{return T(this,Ln).decode(e.outputs,s)}catch{r="could not decode result data"}ee(!1,r,"BAD_DATA",{value:we(s),info:{method:e.name,signature:e.format()}})}makeError(e,n){const r=ct(e,"data"),s=Fc.getBuiltinCallException("call",n,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const a=we(r.slice(0,4)),l=this.getError(a);if(l)try{const u=T(this,Ln).decode(l.inputs,r.slice(4));s.revert={name:l.name,signature:l.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(n);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(e,n){if(typeof e=="string"){const r=this.getFunction(e);G(r,"unknown function","fragment",e),e=r}return we(T(this,Ln).encode(e.outputs,n||[]))}encodeFilterTopics(e,n){if(typeof e=="string"){const i=this.getEvent(e);G(i,"unknown event","eventFragment",e),e=i}ee(n.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const s=(i,o)=>i.type==="string"?Ol(o):i.type==="bytes"?en(we(o)):(i.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":i.type.match(/^u?int/)?o=Zo(o):i.type.match(/^bytes/)?o=kte(o,32):i.type==="address"&&T(this,Ln).encode(["address"],[o]),xl(we(o),32));for(n.forEach((i,o)=>{const a=e.inputs[o];if(!a.indexed){G(i==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,i);return}i==null?r.push(null):a.baseType==="array"||a.baseType==="tuple"?G(!1,"filtering with tuples or arrays not supported","contract."+a.name,i):Array.isArray(i)?r.push(i.map(l=>s(a,l))):r.push(s(a,i))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);G(o,"unknown event","eventFragment",e),e=o}const r=[],s=[],i=[];return e.anonymous||r.push(e.topicHash),G(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,a)=>{const l=n[a];if(o.indexed)if(o.type==="string")r.push(Ol(l));else if(o.type==="bytes")r.push(en(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(T(this,Ln).encode([o.type],[l]))}else s.push(o),i.push(l)}),{data:T(this,Ln).encode(s,i),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const h=this.getEvent(e);G(h,"unknown event","eventFragment",e),e=h}if(r!=null&&!e.anonymous){const h=e.topicHash;G(St(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],i=[],o=[];e.inputs.forEach((h,p)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(Cn.from({type:"bytes32",name:h.name})),o.push(!0)):(s.push(h),o.push(!1)):(i.push(h),o.push(!1))});const a=r!=null?T(this,Ln).decode(s,$t(r)):null,l=T(this,Ln).decode(i,n,!0),u=[],c=[];let f=0,d=0;return e.inputs.forEach((h,p)=>{let m=null;if(h.indexed)if(a==null)m=new oP(null);else if(o[p])m=new oP(a[d++]);else try{m=a[d++]}catch(g){m=g}else try{m=l[f++]}catch(g){m=g}u.push(m),c.push(h.name||null)}),Tc.fromItems(u,c)}parseTransaction(e){const n=ct(e.data,"tx.data"),r=Ee(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(we(n.slice(0,4)));if(!s)return null;const i=T(this,Ln).decode(s.inputs,n.slice(4));return new Vse(s,s.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Hse(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=we(e),r=this.getError(Vt(n,0,4));if(!r)return null;const s=T(this,Ln).decode(r.inputs,Vt(n,4));return new zse(r,r.selector,s)}static from(e){return e instanceof su?e:typeof e=="string"?new su(JSON.parse(e)):typeof e.formatJson=="function"?new su(e.formatJson()):typeof e.format=="function"?new su(e.format("json")):new su(e)}};gi=new WeakMap,yi=new WeakMap,bi=new WeakMap,Ln=new WeakMap,wi=new WeakSet,ub=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,bi).values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,bi))o.split("(")[0]===e&&i.push(a);if(n){const o=n.length>0?n[n.length-1]:null;let a=n.length,l=!0;Rn.isTyped(o)&&o.type==="overrides"&&(l=!1,a--);for(let u=i.length-1;u>=0;u--){const c=i[u].inputs.length;c!==a&&(!l||c!==a-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){const c=i[u].inputs;for(let f=0;f<n.length;f++)if(Rn.isTyped(n[f])){if(f>=c.length){if(n[f].type==="overrides")continue;i.splice(u,1);break}if(n[f].type!==c[f].baseType){i.splice(u,1);break}}}}if(i.length===1&&n&&n.length!==i[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&r){const o=i.map(a=>JSON.stringify(a.format())).join(", ");G(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,bi).get(di.from(e).format());return s||null},cb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,yi).values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,yi))o.split("(")[0]===e&&i.push(a);if(n){for(let o=i.length-1;o>=0;o--)i[o].inputs.length<n.length&&i.splice(o,1);for(let o=i.length-1;o>=0;o--){const a=i[o].inputs;for(let l=0;l<n.length;l++)if(Rn.isTyped(n[l])&&n[l].type!==a[l].baseType){i.splice(o,1);break}}}if(i.length===0)return null;if(i.length>1&&r){const o=i.map(a=>JSON.stringify(a.format())).join(", ");G(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,yi).get(fi.from(e).format());return s||null};let Zx=su;const uP=BigInt(0);function jc(t){return t??null}function Kt(t){return t==null?null:t.toString()}class cP{constructor(e,n,r){W(this,"gasPrice");W(this,"maxFeePerGas");W(this,"maxPriorityFeePerGas");Me(this,{gasPrice:jc(e),maxFeePerGas:jc(n),maxPriorityFeePerGas:jc(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Kt(e),maxFeePerGas:Kt(n),maxPriorityFeePerGas:Kt(r)}}}function fy(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=we(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of n)!(s in t)||t[s]==null||(e[s]=Ee(t[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in t)||t[s]==null||(e[s]=Qe(t[s],`request.${s}`));return t.accessList&&(e.accessList=oa(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(s=>ux(s)?we(s):Object.assign({},s))),e}class $se{constructor(e,n){W(this,"provider");W(this,"number");W(this,"hash");W(this,"timestamp");W(this,"parentHash");W(this,"parentBeaconBlockRoot");W(this,"nonce");W(this,"difficulty");W(this,"gasLimit");W(this,"gasUsed");W(this,"stateRoot");W(this,"receiptsRoot");W(this,"blobGasUsed");W(this,"excessBlobGas");W(this,"miner");W(this,"prevRandao");W(this,"extraData");W(this,"baseFeePerGas");J(this,ho);I(this,ho,e.transactions.map(r=>typeof r!="string"?new Gh(r,n):r)),Me(this,{provider:n,hash:jc(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:jc(e.prevRandao),extraData:e.extraData,baseFeePerGas:jc(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return T(this,ho).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=T(this,ho).slice();return e.length===0?[]:(ee(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:s,gasUsed:i,hash:o,miner:a,prevRandao:l,nonce:u,number:c,parentHash:f,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,timestamp:m,transactions:g}=this;return{_type:"Block",baseFeePerGas:Kt(e),difficulty:Kt(n),extraData:r,gasLimit:Kt(s),gasUsed:Kt(i),blobGasUsed:Kt(this.blobGasUsed),excessBlobGas:Kt(this.excessBlobGas),hash:o,miner:a,prevRandao:l,nonce:u,number:c,parentHash:f,timestamp:m,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,transactions:g}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>e<this.length?{value:n[e++],done:!1}:{value:void 0,done:!0}}}get length(){return T(this,ho).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let n;if(typeof e=="number")n=T(this,ho)[e];else{const r=e.toLowerCase();for(const s of T(this,ho))if(typeof s=="string"){if(s!==r)continue;n=s;break}else{if(s.hash===r)continue;n=s;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(e){const n=this.prefetchedTransactions;if(typeof e=="number")return n[e];e=e.toLowerCase();for(const r of n)if(r.hash===e)return r;G(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Gse(this)}}ho=new WeakMap;class $h{constructor(e,n){W(this,"provider");W(this,"transactionHash");W(this,"blockHash");W(this,"blockNumber");W(this,"removed");W(this,"address");W(this,"data");W(this,"topics");W(this,"index");W(this,"transactionIndex");this.provider=n;const r=Object.freeze(e.topics.slice());Me(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:n,blockNumber:r,data:s,index:i,removed:o,topics:a,transactionHash:l,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:n,blockNumber:r,data:s,index:i,removed:o,topics:a,transactionHash:l,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return ee(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return Wse(this)}}class fP{constructor(e,n){W(this,"provider");W(this,"to");W(this,"from");W(this,"contractAddress");W(this,"hash");W(this,"index");W(this,"blockHash");W(this,"blockNumber");W(this,"logsBloom");W(this,"gasUsed");W(this,"blobGasUsed");W(this,"cumulativeGasUsed");W(this,"gasPrice");W(this,"blobGasPrice");W(this,"type");W(this,"status");W(this,"root");J(this,yp);I(this,yp,Object.freeze(e.logs.map(s=>new $h(s,n))));let r=uP;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Me(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return T(this,yp)}toJSON(){const{to:e,from:n,contractAddress:r,hash:s,index:i,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:c,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:r,cumulativeGasUsed:Kt(this.cumulativeGasUsed),from:n,gasPrice:Kt(this.gasPrice),blobGasUsed:Kt(this.blobGasUsed),blobGasPrice:Kt(this.blobGasPrice),gasUsed:Kt(this.gasUsed),hash:s,index:i,logs:u,logsBloom:l,root:f,status:c,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return hP(this)}reorderedEvent(e){return ee(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),dP(this,e)}}yp=new WeakMap;const _k=class _k{constructor(e,n){W(this,"provider");W(this,"blockNumber");W(this,"blockHash");W(this,"index");W(this,"hash");W(this,"type");W(this,"to");W(this,"from");W(this,"nonce");W(this,"gasLimit");W(this,"gasPrice");W(this,"maxPriorityFeePerGas");W(this,"maxFeePerGas");W(this,"maxFeePerBlobGas");W(this,"data");W(this,"value");W(this,"chainId");W(this,"signature");W(this,"accessList");W(this,"blobVersionedHashes");J(this,Aa);this.provider=n,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,I(this,Aa,-1)}toJSON(){const{blockNumber:e,blockHash:n,index:r,hash:s,type:i,to:o,from:a,nonce:l,data:u,signature:c,accessList:f,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:e,blockHash:n,blobVersionedHashes:d,chainId:Kt(this.chainId),data:u,from:a,gasLimit:Kt(this.gasLimit),gasPrice:Kt(this.gasPrice),hash:s,maxFeePerGas:Kt(this.maxFeePerGas),maxPriorityFeePerGas:Kt(this.maxPriorityFeePerGas),maxFeePerBlobGas:Kt(this.maxFeePerBlobGas),nonce:l,signature:c,to:o,index:r,type:i,value:Kt(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const r=await this.getTransaction();r&&(e=r.blockNumber)}if(e==null)return null;const n=this.provider.getBlock(e);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:r}=await _n({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,n){const r=e??1,s=n??0;let i=T(this,Aa),o=-1,a=i===-1;const l=async()=>{if(a)return null;const{blockNumber:d,nonce:h}=await _n({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){i=d;return}if(a)return null;const p=await this.getTransaction();if(!(p&&p.blockNumber!=null))for(o===-1&&(o=i-3,o<T(this,Aa)&&(o=T(this,Aa)));o<=d;){if(a)return null;const m=await this.provider.getBlock(o,!0);if(m==null)return;for(const g of m)if(g===this.hash)return;for(let g=0;g<m.length;g++){const y=await m.getTransaction(g);if(y.from===this.from&&y.nonce===this.nonce){if(a)return null;const v=await this.provider.getTransactionReceipt(y.hash);if(v==null||d-v.blockNumber+1<r)return;let A="replaced";y.data===this.data&&y.to===this.to&&y.value===this.value?A="repriced":y.data==="0x"&&y.from===y.to&&y.value===uP&&(A="cancelled"),ee(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:A==="replaced"||A==="cancelled",reason:A,replacement:y.replaceableTransaction(i),hash:y.hash,receipt:v})}}o++}},u=d=>{if(d==null||d.status!==0)return d;ee(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},c=await this.provider.getTransactionReceipt(this.hash);if(r===0)return u(c);if(c){if(await c.confirmations()>=r)return u(c)}else if(await l(),r===0)return null;return await new Promise((d,h)=>{const p=[],m=()=>{p.forEach(y=>y())};if(p.push(()=>{a=!0}),s>0){const y=setTimeout(()=>{m(),h(_t("wait for transaction timeout","TIMEOUT"))},s);p.push(()=>{clearTimeout(y)})}const g=async y=>{if(await y.confirmations()>=r){m();try{d(u(y))}catch(v){h(v)}}};if(p.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),i>=0){const y=async()=>{try{await l()}catch(v){if(gn(v,"TRANSACTION_REPLACED")){m(),h(v);return}}a||this.provider.once("block",y)};p.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),hP(this)}reorderedEvent(e){return ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ee(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),dP(this,e)}replaceableTransaction(e){G(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new _k(this,this.provider);return I(n,Aa,e),n}};Aa=new WeakMap;let Gh=_k;function Gse(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function dP(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function hP(t){return{orphan:"drop-transaction",tx:t}}function Wse(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class e2 extends $h{constructor(n,r,s){super(n,n.provider);W(this,"interface");W(this,"fragment");W(this,"args");const i=r.decodeEventLog(s,n.data,n.topics);Me(this,{args:i,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class pP extends $h{constructor(n,r){super(n,n.provider);W(this,"error");Me(this,{error:r})}}class Kse extends fP{constructor(n,r,s){super(s,r);J(this,Sf);I(this,Sf,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?T(this,Sf).getEvent(n.topics[0]):null;if(r)try{return new e2(n,T(this,Sf),r)}catch(s){return new pP(n,s)}return n})}}Sf=new WeakMap;class t2 extends Gh{constructor(n,r,s){super(s,r);J(this,bp);I(this,bp,n)}async wait(n,r){const s=await super.wait(n,r);return s==null?null:new Kse(T(this,bp),this.provider,s)}}bp=new WeakMap;class mP extends K6{constructor(n,r,s,i){super(n,r,s);W(this,"log");Me(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class qse extends mP{constructor(e,n,r,s,i){super(e,n,r,new e2(i,e.interface,s));const o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Me(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const gP=BigInt(0);function yP(t){return t&&typeof t.call=="function"}function bP(t){return t&&typeof t.estimateGas=="function"}function dy(t){return t&&typeof t.resolveName=="function"}function wP(t){return t&&typeof t.sendTransaction=="function"}function AP(t){if(t!=null){if(dy(t))return t;if(t.provider)return t.provider}}class Qse{constructor(e,n,r){J(this,wp);W(this,"fragment");if(Me(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=Il(e.runner,"resolveName"),i=dy(s)?s:null;I(this,wp,async function(){const o=await Promise.all(n.inputs.map((a,l)=>r[l]==null?null:a.walkAsync(r[l],(c,f)=>c==="address"?Array.isArray(f)?Promise.all(f.map(d=>Qn(d,i))):Qn(f,i):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return T(this,wp)}}wp=new WeakMap;function Il(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Ll(t){return t==null?null:t.provider||null}async function vP(t,e){const n=Rn.dereference(t,"overrides");G(typeof n=="object","invalid overrides parameter","overrides",t);const r=fy(n);return G(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),G(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Jse(t,e,n){const r=Il(t,"resolveName"),s=dy(r)?r:null;return await Promise.all(e.map((i,o)=>i.walkAsync(n[o],(a,l)=>(l=Rn.dereference(l,a),a==="address"?Qn(l,s):l))))}function Yse(t){const e=async function(o){const a=await vP(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await Qn(a.from,AP(t.runner)));const l=t.interface,u=Ee(a.value||gP,"overrides.value")===gP,c=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!c&&!u&&G(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),G(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data);const f=l.receive||l.fallback&&l.fallback.payable;return G(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),G(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data),a},n=async function(o){const a=Il(t.runner,"call");ee(yP(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw lx(u)&&u.data?t.interface.makeError(u.data,l):u}},r=async function(o){const a=t.runner;ee(wP(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=Ll(t.runner);return new t2(t.interface,u,l)},s=async function(o){const a=Il(t.runner,"estimateGas");return ee(bP(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},i=async o=>await r(o);return Me(i,{_contract:t,estimateGas:s,populateTransaction:e,send:r,staticCall:n}),i}function Xse(t,e){const n=function(...u){const c=t.interface.getFunction(e,u);return ee(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),c},r=async function(...u){const c=n(...u);let f={};if(c.inputs.length+1===u.length&&(f=await vP(u.pop()),f.from&&(f.from=await Qn(f.from,AP(t.runner)))),c.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await Jse(t.runner,c.inputs,u);return Object.assign({},f,await _n({to:t.getAddress(),data:t.interface.encodeFunctionData(c,d)}))},s=async function(...u){const c=await a(...u);return c.length===1?c[0]:c},i=async function(...u){const c=t.runner;ee(wP(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await c.sendTransaction(await r(...u)),d=Ll(t.runner);return new t2(t.interface,d,f)},o=async function(...u){const c=Il(t.runner,"estimateGas");return ee(bP(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await r(...u))},a=async function(...u){const c=Il(t.runner,"call");ee(yP(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...u);let d="0x";try{d=await c.call(f)}catch(p){throw lx(p)&&p.data?t.interface.makeError(p.data,f):p}const h=n(...u);return t.interface.decodeFunctionResult(h,d)},l=async(...u)=>n(...u).constant?await s(...u):await i(...u);return Me(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:i,staticCall:s,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return ee(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function Zse(t,e){const n=function(...s){const i=t.interface.getEvent(e,s);return ee(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},r=function(...s){return new Qse(t,n(...s),s)};return Me(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=t.interface.getEvent(e);return ee(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),r}const hy=Symbol.for("_ethersInternal_contract"),xP=new WeakMap;function eie(t,e){xP.set(t[hy],e)}function Rr(t){return xP.get(t[hy])}function tie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function n2(t,e){let n,r=null;if(Array.isArray(e)){const i=function(o){if(St(o,32))return o;const a=t.interface.getEvent(o);return G(a,"unknown fragment","name",o),a.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(i):i(o))}else e==="*"?n=[null]:typeof e=="string"?St(e,32)?n=[e]:(r=t.interface.getEvent(e),G(r,"unknown fragment","event",e),n=[r.topicHash]):tie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):G(!1,"unknown event name","event",e);n=n.map(i=>{if(i==null)return null;if(Array.isArray(i)){const o=Array.from(new Set(i.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return i.toLowerCase()});const s=n.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:r,tag:s,topics:n}}async function Wh(t,e){const{subs:n}=Rr(t);return n.get((await n2(t,e)).tag)||null}async function kP(t,e,n){const r=Ll(t.runner);ee(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:s,tag:i,topics:o}=await n2(t,n),{addr:a,subs:l}=Rr(t);let u=l.get(i);if(!u){const f={address:a||t,topics:o},d=g=>{let y=s;if(y==null)try{y=t.interface.getEvent(g.topics[0])}catch{}if(y){const v=y,A=s?t.interface.decodeEventLog(s,g.data,g.topics):[];s2(t,n,A,w=>new qse(t,w,n,v,g))}else s2(t,n,[],v=>new mP(t,v,n,g))};let h=[];u={tag:i,listeners:[],start:()=>{h.length||h.push(r.on(f,d))},stop:async()=>{if(h.length==0)return;let g=h;h=[],await Promise.all(g),r.off(f,d)}},l.set(i,u)}return u}let r2=Promise.resolve();async function nie(t,e,n,r){await r2;const s=await Wh(t,e);if(!s)return!1;const i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:a})=>{const l=Array.from(n);r&&l.push(r(a?null:o));try{o.call(t,...l)}catch{}return!a}),s.listeners.length===0&&(s.stop(),Rr(t).subs.delete(s.tag)),i>0}async function s2(t,e,n,r){try{await r2}catch{}const s=nie(t,e,n,r);return r2=s,await s}const py=["then"];CL=hy;const Ap=class Ap{constructor(e,n,r,s){W(this,"target");W(this,"interface");W(this,"runner");W(this,"filters");W(this,CL);W(this,"fallback");G(typeof e=="string"||rR(e),"invalid value for Contract target","target",e),r==null&&(r=null);const i=Zx.from(n);Me(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,hy,{value:{}});let o,a=null,l=null;if(s){const f=Ll(r);l=new t2(this.interface,f,s)}let u=new Map;if(typeof e=="string")if(St(e))a=e,o=Promise.resolve(e);else{const f=Il(r,"resolveName");if(!dy(f))throw _t("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(d=>{if(d==null)throw _t("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Rr(this).addr=d,d})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Rr(this).addr=f,f});eie(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const c=new Proxy({},{get:(f,d,h)=>{if(typeof d=="symbol"||py.indexOf(d)>=0)return Reflect.get(f,d,h);try{return this.getEvent(d)}catch(p){if(!gn(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(f,d)=>py.indexOf(d)>=0?Reflect.has(f,d):Reflect.has(f,d)||this.interface.hasEvent(String(d))});return Me(this,{filters:c}),Me(this,{fallback:i.receive||i.fallback?Yse(this):null}),new Proxy(this,{get:(f,d,h)=>{if(typeof d=="symbol"||d in f||py.indexOf(d)>=0)return Reflect.get(f,d,h);try{return f.getFunction(d)}catch(p){if(!gn(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(f,d)=>typeof d=="symbol"||d in f||py.indexOf(d)>=0?Reflect.has(f,d):f.interface.hasFunction(d)})}connect(e){return new Ap(this.target,this.interface,e)}attach(e){return new Ap(e,this.interface,this.runner)}async getAddress(){return await Rr(this).addrPromise}async getDeployedCode(){const e=Ll(this.runner);ee(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Ll(this.runner);return ee(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",o)}catch(a){i(a)}};o()})}deploymentTransaction(){return Rr(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Xse(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Zse(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:s,addrPromise:i}=Rr(this),o=s||await i,{fragment:a,topics:l}=await n2(this,e),u={address:o,topics:l,fromBlock:n,toBlock:r},c=Ll(this.runner);return ee(c,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await c.getLogs(u)).map(f=>{let d=a;if(d==null)try{d=this.interface.getEvent(f.topics[0])}catch{}if(d)try{return new e2(f,this.interface,d)}catch(h){return new pP(f,h)}return new $h(f,c)})}async on(e,n){const r=await kP(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await kP(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await s2(this,e,n,null)}async listenerCount(e){if(e){const s=await Wh(this,e);return s?s.listeners.length:0}const{subs:n}=Rr(this);let r=0;for(const{listeners:s}of n.values())r+=s.length;return r}async listeners(e){if(e){const s=await Wh(this,e);return s?s.listeners.map(({listener:i})=>i):[]}const{subs:n}=Rr(this);let r=[];for(const{listeners:s}of n.values())r=r.concat(s.map(({listener:i})=>i));return r}async off(e,n){const r=await Wh(this,e);if(!r)return this;if(n){const s=r.listeners.map(({listener:i})=>i).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Rr(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await Wh(this,e);if(!n)return this;n.stop(),Rr(this).subs.delete(n.tag)}else{const{subs:n}=Rr(this);for(const{tag:r,stop:s}of n.values())s(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Ap{constructor(s,i=null){super(s,e,i)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};let i2=Ap;function rie(){return i2}class Uc extends rie(){}function o2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):G(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class sie{constructor(e){W(this,"name");Me(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const CP=new RegExp("^(ipfs)://(.*)$","i"),EP=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),CP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],Tf=class Tf{constructor(e,n,r){J(this,xa);W(this,"provider");W(this,"address");W(this,"name");J(this,va);J(this,iu);Me(this,{provider:e,address:n,name:r}),I(this,va,null),I(this,iu,new Uc(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return T(this,va)==null&&I(this,va,(async()=>{try{return await T(this,iu).supportsInterface("0x9061b923")}catch(e){if(gn(e,"CALL_EXCEPTION"))return!1;throw I(this,va,null),e}})()),await T(this,va)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await fe(this,xa,Qf).call(this,"addr(bytes32)");return i==null||i===Rh?null:i}catch(i){if(gn(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648;const o=await fe(this,xa,Qf).call(this,"addr(bytes32,uint)",[i]);if(St(o,20))return gt(o)}let n=null;for(const i of this.provider.plugins)if(i instanceof sie&&i.supportsCoinType(e)){n=i;break}if(n==null)return null;const r=await fe(this,xa,Qf).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const s=await n.decodeAddress(e,r);if(s!=null)return s;ee(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await fe(this,xa,Qf).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await fe(this,xa,Qf).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const s=n[1]==="e3010170"?"ipfs":"ipns",i=parseInt(n[4],16);if(n[5].length===i*2)return`${s}://${Ste("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ee(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r<EP.length;r++){const s=n.match(EP[r]);if(s==null)continue;const i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:n}),{linkage:e,url:n};case"ipfs":{const o=o2(n);return e.push({type:"ipfs",value:n}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{const o=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:n});const a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(s[2]||"").split("/");if(l.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};const u=l[1],c=new Uc(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(i==="erc721"){const m=await c.ownerOf(u);if(a!==m)return e.push({type:"!owner",value:m}),{url:null,linkage:e};e.push({type:"owner",value:m})}else if(i==="erc1155"){const m=await c.balanceOf(a,u);if(!m)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:m.toString()})}let f=await c[o](u);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),i==="erc1155"&&(f=f.replace("{id}",Zo(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=o2(f)),e.push({type:"metadata-url",value:f});let d={};const h=await new Kn(f).send();h.assertOk();try{d=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{const y=h.body;return y&&e.push({type:"!metadata",value:we(y)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let p=d.image;if(typeof p!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!p.match(/^(https:\/\/|data:)/i)){if(p.match(CP)==null)return e.push({type:"!imageUrl-ipfs",value:p}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:p}),p=o2(p)}return e.push({type:"url",value:p}),{linkage:e,url:p}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const n=await e.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return ee(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(e,n){var s;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const i=await fe(s=Tf,rb,NL).call(s,e,r);if(i!=null){const o=new Tf(e,i,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};va=new WeakMap,iu=new WeakMap,xa=new WeakSet,Qf=async function(e,n){n=(n||[]).slice();const r=T(this,iu).interface;n.unshift($x(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(e),ee(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),n=[ise(this.name,255),r.encodeFunctionData(s,n)],e="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const i=await T(this,iu)[e](...n);return s?r.decodeFunctionResult(s,i)[0]:i}catch(i){if(!gn(i,"CALL_EXCEPTION"))throw i}return null},rb=new WeakSet,NL=async function(e,n){const r=await Tf.getEnsAddress(e);try{const i=await new Uc(r,["function resolver(bytes32) view returns (address)"],e).resolver($x(n),{enableCcipRead:!0});return i===Rh?null:i}catch(s){throw s}return null},J(Tf,rb);let my=Tf;const SP=BigInt(0);function lt(t,e){return function(n){return n==null?e:t(n)}}function gy(t,e){return n=>{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function Kh(t,e){return n=>{const r={};for(const s in t){let i=s;if(e&&s in e&&!(i in n)){for(const o of e[s])if(o in n){i=o;break}}try{const o=t[s](n[i]);o!==void 0&&(r[s]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";ee(!1,`invalid value for value.${s} (${a})`,"BAD_DATA",{value:n})}}return r}}function iie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}G(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Hc(t){return G(St(t,!0),"invalid data","value",t),t}function En(t){return G(St(t,32),"invalid hash","value",t),t}const oie=Kh({address:gt,blockHash:En,blockNumber:Qe,data:Hc,index:Qe,removed:lt(iie,!1),topics:gy(En),transactionHash:En,transactionIndex:Qe},{index:["logIndex"]});function aie(t){return oie(t)}const lie=Kh({hash:lt(En),parentHash:En,parentBeaconBlockRoot:lt(En,null),number:Qe,timestamp:Qe,nonce:lt(Hc),difficulty:Ee,gasLimit:Ee,gasUsed:Ee,stateRoot:lt(En,null),receiptsRoot:lt(En,null),blobGasUsed:lt(Ee,null),excessBlobGas:lt(Ee,null),miner:lt(gt),prevRandao:lt(En,null),extraData:Hc,baseFeePerGas:lt(Ee)},{prevRandao:["mixHash"]});function uie(t){const e=lie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:TP(n)),e}const cie=Kh({transactionIndex:Qe,blockNumber:Qe,transactionHash:En,address:gt,topics:gy(En),data:Hc,index:Qe,blockHash:En},{index:["logIndex"]});function fie(t){return cie(t)}const die=Kh({to:lt(gt,null),from:lt(gt,null),contractAddress:lt(gt,null),index:Qe,root:lt(we),gasUsed:Ee,blobGasUsed:lt(Ee,null),logsBloom:lt(Hc),blockHash:En,hash:En,logs:gy(fie),blockNumber:Qe,cumulativeGasUsed:Ee,effectiveGasPrice:lt(Ee),blobGasPrice:lt(Ee,null),status:lt(Qe),type:lt(Qe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function hie(t){return die(t)}function TP(t){t.to&&Ee(t.to)===SP&&(t.to="0x0000000000000000000000000000000000000000");const e=Kh({hash:En,index:lt(Qe,void 0),type:n=>n==="0x"||n==null?0:Qe(n),accessList:lt(oa,null),blobVersionedHashes:lt(gy(En,!0),null),blockHash:lt(En,null),blockNumber:lt(Qe,null),transactionIndex:lt(Qe,null),from:gt,gasPrice:lt(Ee),maxPriorityFeePerGas:lt(Ee),maxFeePerGas:lt(Ee),maxFeePerBlobGas:lt(Ee,null),gasLimit:Ee,to:lt(gt,null),value:Ee,nonce:Qe,data:Hc,creates:lt(gt,null),chainId:lt(Ee,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=are(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Ss.from(t.signature):e.signature=Ss.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&Ee(e.blockHash)===SP&&(e.blockHash=null),e}const pie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class qh{constructor(e){W(this,"name");Me(this,{name:e})}clone(){return new qh(this.name)}}class yy extends qh{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);W(this,"effectiveBlock");W(this,"txBase");W(this,"txCreate");W(this,"txDataZero");W(this,"txDataNonzero");W(this,"txAccessListStorageKey");W(this,"txAccessListAddress");const s={effectiveBlock:n};function i(o,a){let l=(r||{})[o];l==null&&(l=a),G(typeof l=="number",`invalud value for ${o}`,"costs",r),s[o]=l}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Me(this,s)}clone(){return new yy(this.effectiveBlock,this)}}class by extends qh{constructor(n,r){super("org.ethers.plugins.network.Ens");W(this,"address");W(this,"targetNetwork");Me(this,{address:n||pie,targetNetwork:r??1})}clone(){return new by(this.address,this.targetNetwork)}}class mie extends qh{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");J(this,vp);J(this,xp);I(this,vp,n),I(this,xp,r)}get url(){return T(this,vp)}get processFunc(){return T(this,xp)}clone(){return this}}vp=new WeakMap,xp=new WeakMap;const a2=new Map,Mf=class Mf{constructor(e,n){J(this,Df);J(this,Of);J(this,ka);I(this,Df,e),I(this,Of,Ee(n)),I(this,ka,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return T(this,Df)}set name(e){I(this,Df,e)}get chainId(){return T(this,Of)}set chainId(e){I(this,Of,Ee(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Ee(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Ee(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Ee(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(T(this,ka).values())}attachPlugin(e){if(T(this,ka).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,ka).set(e.name,e.clone()),this}getPlugin(e){return T(this,ka).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Mf(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new yy;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(e.accessList){const s=oa(e.accessList);for(const i in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[i].storageKeys.length}return r}static from(e){if(gie(),e==null)return Mf.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const n=a2.get(e);if(n)return n();if(typeof e=="bigint")return new Mf("unknown",e);G(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){G(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const n=new Mf(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&n.attachPlugin(new by(e.ensAddress,e.ensNetwork)),n}G(!1,"invalid network","network",e)}static register(e,n){typeof e=="number"&&(e=BigInt(e));const r=a2.get(e);r&&G(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),a2.set(e,n)}};Df=new WeakMap,Of=new WeakMap,ka=new WeakMap;let rn=Mf;function DP(t,e){const n=String(t);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;r[1].length<e;)r[1]+="0";if(r[1].length>9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function OP(t){return new mie(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let s;try{const[i,o]=await Promise.all([r.send(),e()]);s=i;const a=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:DP(a.maxFee,9),maxPriorityFeePerGas:DP(a.maxPriorityFee,9)}}catch(i){ee(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:i})}})}let MP=!1;function gie(){if(MP)return;MP=!0;function t(e,n,r){const s=function(){const i=new rn(e,n);return r.ensNetwork!=null&&i.attachPlugin(new by(null,r.ensNetwork)),i.attachPlugin(new yy),(r.plugins||[]).forEach(o=>{i.attachPlugin(o)}),i};rn.register(e,s),rn.register(n,s),r.altNames&&r.altNames.forEach(i=>{rn.register(i,s)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[OP("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[OP("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function l2(t){return JSON.parse(JSON.stringify(t))}class yie{constructor(e){J(this,Nf);J(this,po);J(this,ss);J(this,Ca);J(this,Ai);I(this,po,e),I(this,ss,null),I(this,Ca,4e3),I(this,Ai,-2)}get pollingInterval(){return T(this,Ca)}set pollingInterval(e){I(this,Ca,e)}start(){T(this,ss)||(I(this,ss,T(this,po)._setTimeout(fe(this,Nf,fb).bind(this),T(this,Ca))),fe(this,Nf,fb).call(this))}stop(){T(this,ss)&&(T(this,po)._clearTimeout(T(this,ss)),I(this,ss,null))}pause(e){this.stop(),e&&I(this,Ai,-2)}resume(){this.start()}}po=new WeakMap,ss=new WeakMap,Ca=new WeakMap,Ai=new WeakMap,Nf=new WeakSet,fb=async function(){try{const e=await T(this,po).getBlockNumber();if(T(this,Ai)===-2){I(this,Ai,e);return}if(e!==T(this,Ai)){for(let n=T(this,Ai)+1;n<=e;n++){if(T(this,ss)==null)return;await T(this,po).emit("block",n)}I(this,Ai,e)}}catch{}T(this,ss)!=null&&I(this,ss,T(this,po)._setTimeout(fe(this,Nf,fb).bind(this),T(this,Ca)))};class u2{constructor(e){J(this,ou);J(this,au);J(this,Ea);I(this,ou,e),I(this,Ea,!1),I(this,au,n=>{this._poll(n,T(this,ou))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){T(this,Ea)||(I(this,Ea,!0),T(this,au).call(this,-2),T(this,ou).on("block",T(this,au)))}stop(){T(this,Ea)&&(I(this,Ea,!1),T(this,ou).off("block",T(this,au)))}pause(e){this.stop()}resume(){this.start()}}ou=new WeakMap,au=new WeakMap,Ea=new WeakMap;class bie extends u2{constructor(n,r){super(n);J(this,_f);J(this,mo);I(this,_f,r),I(this,mo,-2)}pause(n){n&&I(this,mo,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(T(this,_f));s!=null&&(T(this,mo)===-2?I(this,mo,s.number):s.number>T(this,mo)&&(r.emit(T(this,_f),s.number),I(this,mo,s.number)))}}_f=new WeakMap,mo=new WeakMap;class wie extends u2{constructor(n,r){super(n);J(this,sb);I(this,sb,l2(r))}async _poll(n,r){throw new Error("@TODO")}}sb=new WeakMap;class Aie extends u2{constructor(n,r){super(n);J(this,Rf);I(this,Rf,r)}async _poll(n,r){const s=await r.getTransactionReceipt(T(this,Rf));s&&r.emit(T(this,Rf),s)}}Rf=new WeakMap;class c2{constructor(e,n){J(this,ib);J(this,go);J(this,Pf);J(this,If);J(this,Sa);J(this,is);I(this,go,e),I(this,Pf,l2(n)),I(this,If,fe(this,ib,_L).bind(this)),I(this,Sa,!1),I(this,is,-2)}start(){T(this,Sa)||(I(this,Sa,!0),T(this,is)===-2&&T(this,go).getBlockNumber().then(e=>{I(this,is,e)}),T(this,go).on("block",T(this,If)))}stop(){T(this,Sa)&&(I(this,Sa,!1),T(this,go).off("block",T(this,If)))}pause(e){this.stop(),e&&I(this,is,-2)}resume(){this.start()}}go=new WeakMap,Pf=new WeakMap,If=new WeakMap,Sa=new WeakMap,is=new WeakMap,ib=new WeakSet,_L=async function(e){if(T(this,is)===-2)return;const n=l2(T(this,Pf));n.fromBlock=T(this,is)+1,n.toBlock=e;const r=await T(this,go).getLogs(n);if(r.length===0){T(this,is)<e-60&&I(this,is,e-60);return}for(const s of r)T(this,go).emit(T(this,Pf),s),I(this,is,s.blockNumber)};const vie=BigInt(2),xie=10;function wy(t){return t&&typeof t.then=="function"}function Ay(t,e){return t+":"+JSON.stringify(e,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const s=Object.keys(r);return s.sort(),s.reduce((i,o)=>(i[o]=r[o],i),{})}return r})}class vy{constructor(e){W(this,"name");Me(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function kie(t){return JSON.parse(JSON.stringify(t))}function f2(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function d2(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(St(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Ay("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Ay("orphan",n),filter:kie(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?f2(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(n.address){const s=[],i=[],o=a=>{St(a)?s.push(a):i.push((async()=>{s.push(await Qn(a,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),i.length&&await Promise.all(i),r.address=f2(s.map(a=>a.toLowerCase()))}return{filter:r,tag:Ay("event",r),type:"event"}}G(!1,"unknown ProviderEvent","event",t)}function h2(){return new Date().getTime()}const Cie={cacheTimeout:250,pollingInterval:4e3};class xy{constructor(e,n){J(this,st);J(this,Bn);J(this,Ta);J(this,Fn);J(this,Lf);J(this,Fr);J(this,lu);J(this,Da);J(this,yo);J(this,kp);J(this,as);J(this,Bf);J(this,Ff);if(I(this,Ff,Object.assign({},Cie,n||{})),e==="any")I(this,lu,!0),I(this,Fr,null);else if(e){const r=rn.from(e);I(this,lu,!1),I(this,Fr,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else I(this,lu,!1),I(this,Fr,null);I(this,yo,-1),I(this,Da,new Map),I(this,Bn,new Map),I(this,Ta,new Map),I(this,Fn,null),I(this,Lf,!1),I(this,kp,1),I(this,as,new Map),I(this,Bf,!1)}get pollingInterval(){return T(this,Ff).pollingInterval}get provider(){return this}get plugins(){return Array.from(T(this,Ta).values())}attachPlugin(e){if(T(this,Ta).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,Ta).set(e.name,e.connect(this)),this}getPlugin(e){return T(this,Ta).get(e)||null}get disableCcipRead(){return T(this,Bf)}set disableCcipRead(e){I(this,Bf,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const s=e.to.toLowerCase(),i=n.toLowerCase(),o=[];for(let a=0;a<r.length;a++){const l=r[a],u=l.replace("{sender}",s).replace("{data}",i),c=new Kn(u);l.indexOf("{data}")===-1&&(c.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:c,index:a,urls:r});let f="unknown error";const d=await c.send();try{const h=d.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:c,result:h}),h.data;h.message&&(f=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:c,result:h})}catch{}ee(d.statusCode<400||d.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ee(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new $se(uie(e),this)}_wrapLog(e,n){return new $h(aie(e),this)}_wrapTransactionReceipt(e,n){return new fP(hie(e),this)}_wrapTransactionResponse(e,n){return new Gh(TP(e),this)}_detectNetwork(){ee(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ee(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Qe(await fe(this,st,jr).call(this,{method:"getBlockNumber"}),"%response");return T(this,yo)>=0&&I(this,yo,e),e}_getAddress(e){return Qn(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(St(e))return St(e,32)?e:kl(e);if(typeof e=="bigint"&&(e=Qe(e,"blockTag")),typeof e=="number")return e>=0?kl(e):T(this,yo)>=0?kl(T(this,yo)+e):this.getBlockNumber().then(n=>kl(n+e));G(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?f2(l.map(u=>u.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,s=(l,u,c)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(u!=null||c!=null))throw new Error("invalid filter");const d={};return f&&(d.address=f),n.length&&(d.topics=n),u&&(d.fromBlock=u),c&&(d.toBlock=c),r&&(d.blockHash=r),d};let i=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)i.push(this._getAddress(l));else i.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),i.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(i),o,a]).then(l=>s(l[0],l[1],l[2])):s(i,o,a)}_getTransactionRequest(e){const n=fy(e),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const i=Qn(n[s],this);wy(i)?r.push(async function(){n[s]=await i}()):n[s]=i}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);wy(s)?r.push(async function(){n.blockTag=await s}()):n.blockTag=s}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(T(this,Fr)==null){const s=(async()=>{try{const i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw T(this,Fr)===s&&I(this,Fr,null),i}})();return I(this,Fr,s),(await s).clone()}const e=T(this,Fr),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(T(this,lu)?(this.emit("network",r,n),T(this,Fr)===e&&I(this,Fr,Promise.resolve(r))):ee(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:s,gasPrice:i,priorityFee:o}=await _n({_block:fe(this,st,$k).call(this,"latest",!1),gasPrice:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getGasPrice"});return Ee(c,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getPriorityFee"});return Ee(c,"%response")}catch{}return null})()});let a=null,l=null;const u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(l=o??BigInt("1000000000"),a=u.baseFeePerGas*vie+l),new cP(i,a,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new Kn(r.url),i=await r.processFunc(n,this,s);return new cP(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return wy(n)&&(n=await n),Ee(await fe(this,st,jr).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await _n({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await fe(this,st,zk).call(this,fe(this,st,Vk).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return Ee(await fe(this,st,Op).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Qe(await fe(this,st,Op).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return we(await fe(this,st,Op).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const s=Ee(n,"position");return we(await fe(this,st,Op).call(this,{method:"getStorage",position:s},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:s}=await _n({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=Vh.from(e);if(i.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:s}=await _n({network:this.getNetwork(),params:fe(this,st,$k).call(this,e,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(e){const{network:n,params:r}=await _n({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await _n({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await fe(this,st,jr).call(this,{method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await _n({network:this.getNetwork(),result:fe(this,st,jr).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:we(n)}async getLogs(e){let n=this._getFilter(e);wy(n)&&(n=await n);const{network:r,params:s}=await _n({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getLogs",filter:n})});return s.map(i=>this._wrapLog(i,r))}_getProvider(e){ee(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await my.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=gt(e);const n=$x(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await my.getEnsAddress(this),i=await new Uc(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(i==null||i===Rh)return null;const a=await new Uc(i,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(a)!==e?null:a}catch(r){if(gn(r,"BAD_DATA")&&r.value==="0x"||gn(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const s=n??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,o)=>{let a=null;const l=async u=>{try{const c=await this.getTransactionReceipt(e);if(c!=null&&u-c.blockNumber+1>=s){i(c),a&&(clearTimeout(a),a=null);return}}catch(c){console.log("EEE",c)}this.once("block",l)};r!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o(_t("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ee(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=T(this,as).get(e);n&&(n.timer&&clearTimeout(n.timer),T(this,as).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=Tp(this,kp)._++,s=()=>{T(this,as).delete(r),e()};if(this.paused)T(this,as).set(r,{timer:null,func:s,time:n});else{const i=setTimeout(s,n);T(this,as).set(r,{timer:i,func:s,time:h2()})}return r}_forEachSubscriber(e){for(const n of T(this,Bn).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new vy(e.type);case"block":{const n=new yie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new bie(this,e.type);case"event":return new c2(this,e.filter);case"transaction":return new Aie(this,e.hash);case"orphan":return new wie(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of T(this,Bn).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),T(this,Fn)!=null&&n.pause(T(this,Fn));break}}async on(e,n){const r=await fe(this,st,db).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,T(this,Fn)!=null&&r.subscriber.pause(T(this,Fn))),this}async once(e,n){const r=await fe(this,st,db).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,T(this,Fn)!=null&&r.subscriber.pause(T(this,Fn))),this}async emit(e,...n){const r=await fe(this,st,Mp).call(this,e,n);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:i,once:o})=>{const a=new K6(this,o?null:i,e);try{i.call(this,...n,a)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),T(this,Bn).delete(r.tag)),s>0}async listenerCount(e){if(e){const r=await fe(this,st,Mp).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of T(this,Bn).values())n+=r.length;return n}async listeners(e){if(e){const r=await fe(this,st,Mp).call(this,e);return r?r.listeners.map(({listener:s})=>s):[]}let n=[];for(const{listeners:r}of T(this,Bn).values())n=n.concat(r.map(({listener:s})=>s));return n}async off(e,n){const r=await fe(this,st,Mp).call(this,e);if(!r)return this;if(n){const s=r.listeners.map(({listener:i})=>i).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),T(this,Bn).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:s}=await fe(this,st,db).call(this,e);r&&s.stop(),T(this,Bn).delete(n)}else for(const[n,{started:r,subscriber:s}]of T(this,Bn))r&&s.stop(),T(this,Bn).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return T(this,Lf)}destroy(){this.removeAllListeners();for(const e of T(this,as).keys())this._clearTimeout(e);I(this,Lf,!0)}get paused(){return T(this,Fn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(I(this,yo,-1),T(this,Fn)!=null){if(T(this,Fn)==!!e)return;ee(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),I(this,Fn,!!e);for(const n of T(this,as).values())n.timer&&clearTimeout(n.timer),n.time=h2()-n.time}resume(){if(T(this,Fn)!=null){this._forEachSubscriber(e=>e.resume()),I(this,Fn,null);for(const e of T(this,as).values()){let n=e.time;n<0&&(n=0),e.time=h2(),setTimeout(e.func,n)}}}}Bn=new WeakMap,Ta=new WeakMap,Fn=new WeakMap,Lf=new WeakMap,Fr=new WeakMap,lu=new WeakMap,Da=new WeakMap,yo=new WeakMap,kp=new WeakMap,as=new WeakMap,Bf=new WeakMap,Ff=new WeakMap,st=new WeakSet,jr=async function(e){const n=T(this,Ff).cacheTimeout;if(n<0)return await this._perform(e);const r=Ay(e.method,e);let s=T(this,Da).get(r);return s||(s=this._perform(e),T(this,Da).set(r,s),setTimeout(()=>{T(this,Da).get(r)===s&&T(this,Da).delete(r)},n)),await s},Vk=async function(e,n,r){ee(r<xie,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:n,enableCcipRead:!0})});const s=fy(e);try{return we(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(i){if(!this.disableCcipRead&&lx(i)&&i.data&&r>=0&&n==="latest"&&s.to!=null&&Vt(i.data,0,4)==="0x556f1830"){const o=i.data,a=await Qn(s.to,this);let l;try{l=Oie(Vt(i.data,4))}catch(f){ee(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}ee(l.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const u=await this.ccipReadFetch(s,l.calldata,l.urls);ee(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:l.errorArgs}});const c={to:a,data:$t([l.selector,Die([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const f=await fe(this,st,Vk).call(this,c,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:f}),f}}throw i}},zk=async function(e){const{value:n}=await _n({network:this.getNetwork(),value:e});return n},Op=async function(e,n,r){let s=this._getAddress(n),i=this._getBlockTag(r);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await fe(this,st,zk).call(this,fe(this,st,jr).call(this,Object.assign(e,{address:s,blockTag:i})))},$k=async function(e,n){if(St(e,32))return await fe(this,st,jr).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await fe(this,st,jr).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},Mp=async function(e,n){let r=await d2(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await d2({orphan:"drop-log",log:n[0]},this)),T(this,Bn).get(r.tag)||null},db=async function(e){const n=await d2(e,this),r=n.tag;let s=T(this,Bn).get(r);return s||(s={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},T(this,Bn).set(r,s)),s};function Eie(t,e){try{const n=p2(t,e);if(n)return Sc(n)}catch{}return null}function p2(t,e){if(t==="0x")return null;try{const n=Qe(Vt(t,e,e+32)),r=Qe(Vt(t,n,n+32));return Vt(t,n+32,n+32+r)}catch{}return null}function NP(t){const e=Wn(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function Sie(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Tie=new Uint8Array([]);function Die(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(Tie),n+=32;for(let r=0;r<t.length;r++){const s=ct(t[r]);e[r]=NP(n),e.push(NP(s.length)),e.push(Sie(s)),n+=32+Math.ceil(s.length/32)*32}return $t(e)}const _P="0x0000000000000000000000000000000000000000000000000000000000000000";function Oie(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};ee(Cc(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Vt(t,0,32);ee(Vt(n,0,12)===Vt(_P,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Vt(n,12);try{const r=[],s=Qe(Vt(t,32,64)),i=Qe(Vt(t,s,s+32)),o=Vt(t,s+32);for(let a=0;a<i;a++){const l=Eie(o,a*32);if(l==null)throw new Error("abort");r.push(l)}e.urls=r}catch{ee(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=p2(t,64);if(r==null)throw new Error("abort");e.calldata=r}catch{ee(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}ee(Vt(t,100,128)===Vt(_P,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Vt(t,96,100);try{const r=p2(t,128);if(r==null)throw new Error("abort");e.extraData=r}catch{ee(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>e[r]),e}function Vc(t,e){if(t.provider)return t.provider;ee(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function RP(t,e){let n=fy(e);if(n.to!=null&&(n.to=Qn(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),Qn(r,t)]).then(([s,i])=>(G(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else n.from=t.getAddress();return await _n(n)}class Mie{constructor(e){W(this,"provider");Me(this,{provider:e||null})}async getNonce(e){return Vc(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await RP(this,e)}async populateTransaction(e){const n=Vc(this,"populateTransaction"),r=await RP(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const o=Ee(r.chainId);G(o===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=s.chainId;const i=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||i)?G(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&i&&G(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ee(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ee(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ee(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await _n(r)}async estimateGas(e){return Vc(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Vc(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Vc(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Vc(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const s=Vh.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}}const PP=new Set;function zc(t){PP.has(t)||(PP.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}function Nie(t){return JSON.parse(JSON.stringify(t))}class IP{constructor(e){J(this,Ma);J(this,Yn);J(this,vi);J(this,uu);J(this,Oa);J(this,cu);J(this,jf);I(this,Yn,e),I(this,vi,null),I(this,uu,fe(this,Ma,Gk).bind(this)),I(this,Oa,!1),I(this,cu,null),I(this,jf,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){T(this,Oa)||(I(this,Oa,!0),fe(this,Ma,Gk).call(this,-2))}stop(){T(this,Oa)&&(I(this,Oa,!1),I(this,jf,!0),fe(this,Ma,Wk).call(this),T(this,Yn).off("block",T(this,uu)))}pause(e){e&&fe(this,Ma,Wk).call(this),T(this,Yn).off("block",T(this,uu))}resume(){this.start()}}Yn=new WeakMap,vi=new WeakMap,uu=new WeakMap,Oa=new WeakMap,cu=new WeakMap,jf=new WeakMap,Ma=new WeakSet,Gk=async function(e){try{T(this,vi)==null&&I(this,vi,this._subscribe(T(this,Yn)));let n=null;try{n=await T(this,vi)}catch(i){if(!gn(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(n==null){I(this,vi,null),T(this,Yn)._recoverSubscriber(this,this._recover(T(this,Yn)));return}const r=await T(this,Yn).getNetwork();if(T(this,cu)||I(this,cu,r),T(this,cu).chainId!==r.chainId)throw new Error("chaid changed");if(T(this,jf))return;const s=await T(this,Yn).send("eth_getFilterChanges",[n]);await this._emitResults(T(this,Yn),s)}catch(n){console.log("@TODO",n)}T(this,Yn).once("block",T(this,uu))},Wk=function(){const e=T(this,vi);e&&(I(this,vi,null),e.then(n=>{T(this,Yn).destroyed||T(this,Yn).send("eth_uninstallFilter",[n])}))};class _ie extends IP{constructor(n,r){super(n);J(this,fu);I(this,fu,Nie(r))}_recover(n){return new c2(n,T(this,fu))}async _subscribe(n){return await n.send("eth_newFilter",[T(this,fu)])}async _emitResults(n,r){for(const s of r)n.emit(T(this,fu),n._wrapLog(s,n._network))}}fu=new WeakMap;class Rie extends IP{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const Pie="bigint,boolean,function,number,string,symbol".split(/,/g);function ky(t){if(t==null||Pie.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(ky);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Iie(t){return new Promise(e=>{setTimeout(e,t)})}function $c(t){return t&&t.toLowerCase()}function LP(t){return t&&typeof t.pollingInterval=="number"}const BP={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class m2 extends Mie{constructor(n,r){super(n);W(this,"address");r=gt(r),Me(this,{address:r})}connect(n){ee(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=ky(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const a=await Qn(o,this.provider);G(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a})())}else r.from=this.address;if(r.gasLimit==null&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;s.push((async()=>{r.to=await Qn(o,this.provider)})())}s.length&&await Promise.all(s);const i=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(n);return await new Promise((i,o)=>{const a=[1e3,100];let l=0;const u=async()=>{try{const c=await this.provider.getTransaction(s);if(c!=null){i(c.replaceableTransaction(r));return}}catch(c){if(gn(c,"CANCELLED")||gn(c,"BAD_DATA")||gn(c,"NETWORK_ERROR")){c.info==null&&(c.info={}),c.info.sendTransactionHash=s,o(c);return}if(gn(c,"INVALID_ARGUMENT")&&(l++,c.info==null&&(c.info={}),c.info.sendTransactionHash=s,l>10)){o(c);return}this.provider.emit("error",_t("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:c}))}this.provider._setTimeout(()=>{u()},a.pop()||4e3)};u()})}async signTransaction(n){const r=ky(n);if(r.from){const i=await Qn(r.from,this.provider);G(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=i}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(n){const r=typeof n=="string"?Vi(n):n;return await this.provider.send("personal_sign",[we(r),this.address.toLowerCase()])}async signTypedData(n,r,s){const i=ky(s),o=await ly.resolveNames(n,r,i,async a=>{const l=await Qn(a);return G(l!=null,"TypedData does not support null address","value",a),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(ly.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?Vi(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),we(r)])}}class FP extends xy{constructor(n,r){super(n,r);J(this,Cp);J(this,du);J(this,Uf);J(this,bo);J(this,xi);J(this,Rs);J(this,ls);J(this,mr);I(this,Uf,1),I(this,du,Object.assign({},BP,r||{})),I(this,bo,[]),I(this,xi,null),I(this,ls,null),I(this,mr,null);{let i=null;const o=new Promise(a=>{i=a});I(this,Rs,{promise:o,resolve:i})}const s=this._getOption("staticNetwork");typeof s=="boolean"?(G(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&I(this,ls,rn.from(n))):s&&(G(n==null||s.matches(n),"staticNetwork MUST match network object","options",r),I(this,ls,s))}_getOption(n){return T(this,du)[n]}get _network(){return ee(T(this,ls),"network is not available yet","NETWORK_ERROR"),T(this,ls)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let s=n.transaction;if(s&&s.type!=null&&Ee(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},s,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(T(this,ls))return T(this,ls)}else return n;return T(this,mr)?await T(this,mr):this.ready?(I(this,mr,(async()=>{try{const r=rn.from(Ee(await this.send("eth_chainId",[])));return I(this,mr,null),r}catch(r){throw I(this,mr,null),r}})()),await T(this,mr)):(I(this,mr,(async()=>{const r={id:Tp(this,Uf)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let s;try{s=(await this._send(r))[0],I(this,mr,null)}catch(i){throw I(this,mr,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return rn.from(Ee(s.result));throw this.getRpcError(r,s)})()),await T(this,mr))}_start(){T(this,Rs)==null||T(this,Rs).resolve==null||(T(this,Rs).resolve(),I(this,Rs,null),(async()=>{for(;T(this,ls)==null&&!this.destroyed;)try{I(this,ls,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",_t("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Iie(1e3)}fe(this,Cp,Kk).call(this)})())}async _waitUntilReady(){if(T(this,Rs)!=null)return await T(this,Rs).promise}_getSubscriber(n){return n.type==="pending"?new Rie(this):n.type==="event"?this._getOption("polling")?new c2(this,n.filter):new _ie(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new vy("orphan"):super._getSubscriber(n)}get ready(){return T(this,Rs)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(n[s]==null)return;let i=s;s==="gasLimit"&&(i="gas"),r[i]=kl(Ee(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=we(n[s]))}),n.accessList&&(r.accessList=oa(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(s=>s.toLowerCase())),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[$c(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[$c(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[$c(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[$c(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map($c):n.filter.address=$c(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:s}=n,{error:i}=r;if(s==="eth_estimateGas"&&i.message){const l=i.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return _t("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){const l=g2(i),u=Fc.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return u.info={error:i,payload:n},u}const o=JSON.stringify(Bie(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return _t("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[s]||"unknown",reason:"rejected",info:{payload:n,error:i}});if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return _t("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return _t("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return _t("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:i}});if(o.match(/only replay-protected/i))return _t("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:l,info:{error:i}}})}let a=!!o.match(/the method .* does not exist/i);return a||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(a=!0),a?_t("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:i,payload:n}}):_t("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=Tp(this,Uf)._++,i=new Promise((o,a)=>{T(this,bo).push({resolve:o,reject:a,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return fe(this,Cp,Kk).call(this),i}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const i=await r;if(n>=i.length)throw new Error("no such account");return new m2(this,i[n])}const{accounts:s}=await _n({network:this.getNetwork(),accounts:r});n=gt(n);for(const i of s)if(gt(i)===n)return new m2(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new m2(this,r))}destroy(){T(this,xi)&&(clearTimeout(T(this,xi)),I(this,xi,null));for(const{payload:n,reject:r}of T(this,bo))r(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));I(this,bo,[]),super.destroy()}}du=new WeakMap,Uf=new WeakMap,bo=new WeakMap,xi=new WeakMap,Rs=new WeakMap,ls=new WeakMap,mr=new WeakMap,Cp=new WeakSet,Kk=function(){if(T(this,xi))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");I(this,xi,setTimeout(()=>{I(this,xi,null);const r=T(this,bo);for(I(this,bo,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==T(this,du).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(o=>o.payload)).length>T(this,du).batchMaxSize){r.unshift(s.pop());break}(async()=>{const i=s.length===1?s[0].payload:s.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const o=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:l,payload:u}of s){if(this.destroyed){l(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const c=o.filter(f=>f.id===u.id)[0];if(c==null){const f=_t("missing response for request","BAD_DATA",{value:o,info:{payload:u}});this.emit("error",f),l(f);continue}if("error"in c){l(this.getRpcError(u,c));continue}a(c.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of s)a(o)}})()}},n))};class Lie extends FP{constructor(n,r){super(n,r);J(this,Na);let s=this._getOption("pollingInterval");s==null&&(s=BP.pollingInterval),I(this,Na,s)}_getSubscriber(n){const r=super._getSubscriber(n);return LP(r)&&(r.pollingInterval=T(this,Na)),r}get pollingInterval(){return T(this,Na)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");I(this,Na,n),this._forEachSubscriber(r=>{LP(r)&&(r.pollingInterval=T(this,Na))})}}Na=new WeakMap;class Ji extends Lie{constructor(n,r,s){n==null&&(n="http://localhost:8545");super(r,s);J(this,Hf);typeof n=="string"?I(this,Hf,new Kn(n)):I(this,Hf,n.clone())}_getConnection(){return T(this,Hf).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const s=await r.send();s.assertOk();let i=s.bodyJson;return Array.isArray(i)||(i=[i]),i}}Hf=new WeakMap;function g2(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&St(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=g2(t[e]);if(n)return n}return null}if(typeof t=="string")try{return g2(JSON.parse(t))}catch{}return null}function y2(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)y2(t[n],e);if(typeof t=="string")try{return y2(JSON.parse(t),e)}catch{}}}function Bie(t){const e=[];return y2(t,e),e}const Cy="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Fie(t){switch(t){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}G(!1,"unsupported network","network",t)}class Ey extends Ji{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Cy);const i={polling:!0,staticNetwork:s},o=Ey.getRequest(s,r);super(o,s,i);W(this,"apiKey");Me(this,{apiKey:r})}_getProvider(n){try{return new Ey(n,this.apiKey)}catch{}return super._getProvider(n)}static getRequest(n,r){r==null&&(r=Cy);const s=new Kn(`https://${Fie(n.name)}/${r}`);return s.allowGzip=!0,r===Cy&&(s.retryFunc=async(i,o,a)=>(zc("AnkrProvider"),!0)),s}getRpcError(n,r){return n.method==="eth_sendRawTransaction"&&r&&r.error&&r.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(r.error.message="replacement transaction underpriced"),super.getRpcError(n,r)}isCommunityResource(){return this.apiKey===Cy}}const Sy="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function jie(t){switch(t){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}G(!1,"unsupported network","network",t)}class Ty extends Ji{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Sy);const i=Ty.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Me(this,{apiKey:r})}_getProvider(n){try{return new Ty(n,this.apiKey)}catch{}return super._getProvider(n)}async _perform(n){if(n.method==="getTransactionResult"){const{trace:r,tx:s}=await _n({trace:this.send("trace_transaction",[n.hash]),tx:this.getTransaction(n.hash)});if(r==null||s==null)return null;let i,o=!1;try{i=r[0].result.output,o=r[0].error==="Reverted"}catch{}if(i)return ee(!o,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:s,invocation:null,revert:null}),i;ee(!1,"could not parse trace result","BAD_DATA",{value:r})}return await super._perform(n)}isCommunityResource(){return this.apiKey===Sy}static getRequest(n,r){r==null&&(r=Sy);const s=new Kn(`https://${jie(n.name)}/v2/${r}`);return s.allowGzip=!0,r===Sy&&(s.retryFunc=async(i,o,a)=>(zc("alchemy"),!0)),s}}function Dy(t){switch(t){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}G(!1,"unsupported network","network",t)}function Uie(t){switch(t){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}G(!1,"unsupported network","network",t)}class Oy extends Ji{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Dy(s.name));const i=Oy.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Me(this,{apiKey:r})}_getProvider(n){try{return new Oy(n,this.apiKey)}catch{}return super._getProvider(n)}isCommunityResource(){return this.apiKey===Dy(this._network.name)}static getRequest(n,r){r==null&&(r=Dy(n.name));const s=new Kn(`https://${Uie(n.name)}/${r}`);return s.allowGzip=!0,r===Dy(n.name)&&(s.retryFunc=async(i,o,a)=>(zc("ChainstackProvider"),!0)),s}}class Hie extends Ji{constructor(e){e==null&&(e="mainnet");const n=rn.from(e);G(n.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",n,{staticNetwork:n})}}const jP=2e3;function Vie(t){return t&&typeof t.then=="function"}const zie="org.ethers.plugins.provider.Etherscan",$ie=["enableCcipRead"];let Gie=1;class Wie extends xy{constructor(n,r){const s=r??null;super();W(this,"network");W(this,"apiKey");J(this,Vf);const i=rn.from(n);I(this,Vf,i.getPlugin(zie)),Me(this,{apiKey:s,network:i}),this.getBaseUrl()}getBaseUrl(){if(T(this,Vf))return T(this,Vf).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}G(!1,"unsupported network","network",this.network)}getUrl(n,r){const s=Object.keys(r).reduce((o,a)=>{const l=r[a];return l!=null&&(o+=`&${a}=${l}`),o},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${n}${s}${i}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(n,r){return r.module=n,r.apikey=this.apiKey,r}async detectNetwork(){return this.network}async fetch(n,r,s){const i=Gie++,o=s?this.getPostUrl():this.getUrl(n,r),a=s?this.getPostData(n,r):null;this.emit("debug",{action:"sendRequest",id:i,url:o,payload:a});const l=new Kn(o);l.setThrottleParams({slotInterval:1e3}),l.retryFunc=(f,d,h)=>(this.isCommunityResource()&&zc("Etherscan"),Promise.resolve(!0)),l.processFunc=async(f,d)=>{const h=d.hasBody()?JSON.parse(Sc(d.body)):{},p=(typeof h.result=="string"?h.result:"").toLowerCase().indexOf("rate limit")>=0;return n==="proxy"?h&&h.status==0&&h.message=="NOTOK"&&p&&(this.emit("debug",{action:"receiveError",id:i,reason:"proxy-NOTOK",error:h}),d.throwThrottleError(h.result,jP)):p&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),d.throwThrottleError(h.result,jP)),d},a&&(l.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),l.body=Object.keys(a).map(f=>`${f}=${a[f]}`).join("&"));const u=await l.send();try{u.assertOk()}catch(f){this.emit("debug",{action:"receiveError",id:i,error:f,reason:"assertOk"}),ee(!1,"response error","SERVER_ERROR",{request:l,response:u})}u.hasBody()||(this.emit("debug",{action:"receiveError",id:i,error:"missing body",reason:"null body"}),ee(!1,"missing response","SERVER_ERROR",{request:l,response:u}));const c=JSON.parse(Sc(u.body));return n==="proxy"?(c.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:i,result:c,reason:"invalid JSON-RPC"}),ee(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:l,response:u,info:{result:c}})),c.error&&(this.emit("debug",{action:"receiveError",id:i,result:c,reason:"JSON-RPC error"}),ee(!1,"error response","SERVER_ERROR",{request:l,response:u,info:{result:c}})),this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result):c.status==0&&(c.message==="No records found"||c.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result):((c.status!=1||typeof c.message=="string"&&!c.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:i,result:c}),ee(!1,"error response","SERVER_ERROR",{request:l,response:u,info:{result:c}})),this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result)}_getTransactionPostData(n){const r={};for(let s in n){if($ie.indexOf(s)>=0||n[s]==null)continue;let i=n[s];if(!(s==="type"&&i===0)&&!(s==="blockTag"&&i==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[s])i=kl(i);else if(s==="accessList")i="["+oa(i).map(o=>`{address:"${o.address}",storageKeys:["${o.storageKeys.join('","')}"]}`).join(",")+"]";else if(s==="blobVersionedHashes"){if(i.length===0)continue;ee(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:n}})}else i=we(i);r[s]=i}}return r}_checkError(n,r,s){let i="";if(gn(r,"SERVER_ERROR")){try{i=r.info.result.error.message}catch{}if(!i)try{i=r.info.message}catch{}}if(n.method==="estimateGas"&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&ee(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.transaction}),(n.method==="call"||n.method==="estimateGas")&&i.match(/execution reverted/i)){let o="";try{o=r.info.result.error.data}catch{}const a=Fc.getBuiltinCallException(n.method,n.transaction,o);throw a.info={request:n,error:r},a}if(i&&n.method==="broadcastTransaction"){const o=Vh.from(n.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&ee(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:o}),i.match(/insufficient funds/)&&ee(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:o}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ee(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:o})}throw r}async _detectNetwork(){return this.network}async _perform(n){switch(n.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:n.address,tag:n.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:n.address,tag:n.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:n.address,tag:n.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:n.address,position:n.position,tag:n.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:n.signedTransaction},!0).catch(r=>this._checkError(n,r,n.signedTransaction));case"getBlock":if("blockTag"in n)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:n.blockTag,boolean:n.includeTransactions?"true":"false"});ee(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:n.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:n.hash});case"call":{if(n.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const r=this._getTransactionPostData(n.transaction);r.module="proxy",r.action="eth_call";try{return await this.fetch("proxy",r,!0)}catch(s){return this._checkError(n,s,n.transaction)}}case"estimateGas":{const r=this._getTransactionPostData(n.transaction);r.module="proxy",r.action="eth_estimateGas";try{return await this.fetch("proxy",r,!0)}catch(s){return this._checkError(n,s,n.transaction)}}}return super._perform(n)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(n){let r=this._getAddress(n);Vie(r)&&(r=await r);try{const s=await this.fetch("contract",{action:"getabi",address:r}),i=JSON.parse(s);return new Uc(r,i,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}}Vf=new WeakMap;function Kie(){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 qie=Kie().WebSocket;class b2{constructor(e,n){J(this,ki);J(this,Ep);J(this,_a);J(this,hu);J(this,Ra);I(this,ki,e),I(this,Ep,JSON.stringify(n)),I(this,_a,null),I(this,hu,null),I(this,Ra,null)}get filter(){return JSON.parse(T(this,Ep))}start(){I(this,_a,T(this,ki).send("eth_subscribe",this.filter).then(e=>(T(this,ki)._register(e,this),e)))}stop(){T(this,_a).then(e=>{T(this,ki).destroyed||T(this,ki).send("eth_unsubscribe",[e])}),I(this,_a,null)}pause(e){ee(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),I(this,hu,!!e)}resume(){I(this,hu,null)}_handleMessage(e){if(T(this,_a)!=null&&T(this,hu)===null){let n=T(this,Ra);n==null?n=this._emit(T(this,ki),e):n=n.then(async()=>{await this._emit(T(this,ki),e)}),I(this,Ra,n.then(()=>{T(this,Ra)===n&&I(this,Ra,null)}))}}async _emit(e,n){throw new Error("sub-classes must implemente this; _emit")}}ki=new WeakMap,Ep=new WeakMap,_a=new WeakMap,hu=new WeakMap,Ra=new WeakMap;class Qie extends b2{constructor(e){super(e,["newHeads"])}async _emit(e,n){e.emit("block",parseInt(n.number))}}class Jie extends b2{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,n){e.emit("pending",n)}}class Yie extends b2{constructor(n,r){super(n,["logs",r]);J(this,Sp);I(this,Sp,JSON.stringify(r))}get logFilter(){return JSON.parse(T(this,Sp))}async _emit(n,r){n.emit(this.logFilter,n._wrapLog(r,n._network))}}Sp=new WeakMap;class Xie extends FP{constructor(n,r){const s=Object.assign({},r??{});G(s.batchMaxCount==null||s.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",r),s.batchMaxCount=1,s.staticNetwork==null&&(s.staticNetwork=!0);super(n,s);J(this,pu);J(this,zf);J(this,Pa);I(this,pu,new Map),I(this,zf,new Map),I(this,Pa,new Map)}_getSubscriber(n){switch(n.type){case"close":return new vy("close");case"block":return new Qie(this);case"pending":return new Jie(this);case"event":return new Yie(this,n.filter);case"orphan":if(n.filter.orphan==="drop-log")return new vy("drop-log")}return super._getSubscriber(n)}_register(n,r){T(this,zf).set(n,r);const s=T(this,Pa).get(n);if(s){for(const i of s)r._handleMessage(i);T(this,Pa).delete(n)}}async _send(n){G(!Array.isArray(n),"WebSocket does not support batch send","payload",n);const r=new Promise((s,i)=>{T(this,pu).set(n.id,{payload:n,resolve:s,reject:i})});return await this._waitUntilReady(),await this._write(JSON.stringify(n)),[await r]}async _processMessage(n){const r=JSON.parse(n);if(r&&typeof r=="object"&&"id"in r){const s=T(this,pu).get(r.id);if(s==null){this.emit("error",_t("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:r}));return}T(this,pu).delete(r.id),s.resolve(r)}else if(r&&r.method==="eth_subscription"){const s=r.params.subscription,i=T(this,zf).get(s);if(i)i._handleMessage(r.params.result);else{let o=T(this,Pa).get(s);o==null&&(o=[],T(this,Pa).set(s,o)),o.push(r.params.result)}}else{this.emit("error",_t("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:r}));return}}async _write(n){throw new Error("sub-classes must override this")}}pu=new WeakMap,zf=new WeakMap,Pa=new WeakMap;class UP extends Xie{constructor(n,r,s){super(r,s);J(this,mu);J(this,Ps);typeof n=="string"?(I(this,mu,()=>new qie(n)),I(this,Ps,T(this,mu).call(this))):typeof n=="function"?(I(this,mu,n),I(this,Ps,n())):(I(this,mu,null),I(this,Ps,n)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(i){console.log("failed to start WebsocketProvider",i)}},this.websocket.onmessage=i=>{this._processMessage(i.data)}}get websocket(){if(T(this,Ps)==null)throw new Error("websocket closed");return T(this,Ps)}async _write(n){this.websocket.send(n)}async destroy(){T(this,Ps)!=null&&(T(this,Ps).close(),I(this,Ps,null)),super.destroy()}}mu=new WeakMap,Ps=new WeakMap;const Qh="84842078b09946638c03157f83405213";function Zie(t){switch(t){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}G(!1,"unsupported network","network",t)}class eoe extends UP{constructor(n,r){const s=new Jh(n,r),i=s._getConnection();ee(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const o=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,s._network);W(this,"projectId");W(this,"projectSecret");Me(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===Qh}}class Jh extends Ji{constructor(n,r,s){n==null&&(n="mainnet");const i=rn.from(n);r==null&&(r=Qh),s==null&&(s=null);const o=Jh.getRequest(i,r,s);super(o,i,{staticNetwork:i});W(this,"projectId");W(this,"projectSecret");Me(this,{projectId:r,projectSecret:s})}_getProvider(n){try{return new Jh(n,this.projectId,this.projectSecret)}catch{}return super._getProvider(n)}isCommunityResource(){return this.projectId===Qh}static getWebSocketProvider(n,r){return new eoe(n,r)}static getRequest(n,r,s){r==null&&(r=Qh),s==null&&(s=null);const i=new Kn(`https://${Zie(n.name)}/v3/${r}`);return i.allowGzip=!0,s&&i.setCredentials("",s),r===Qh&&(i.retryFunc=async(o,a,l)=>(zc("InfuraProvider"),!0)),i}}const My="919b412a057b5e9c9b6dce193c5a60242d6efadb";function toe(t){switch(t){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}G(!1,"unsupported network","network",t)}class Ny extends Ji{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=My);const i=Ny.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"token");Me(this,{token:r})}_getProvider(n){try{return new Ny(n,this.token)}catch{}return super._getProvider(n)}isCommunityResource(){return this.token===My}static getRequest(n,r){r==null&&(r=My);const s=new Kn(`https://${toe(n.name)}/${r}`);return s.allowGzip=!0,r===My&&(s.retryFunc=async(i,o,a)=>(zc("QuickNodeProvider"),!0)),s}}const noe=BigInt("1"),roe=BigInt("2");function soe(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}}function ioe(t){return new Promise(e=>{setTimeout(e,t)})}function w2(){return new Date().getTime()}function A2(t){return JSON.stringify(t,(e,n)=>typeof n=="bigint"?{type:"bigint",value:n.toString()}:n)}const HP={stallTimeout:400,priority:1,weight:1},VP={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function ooe(t,e){for(;(t.blockNumber<0||t.blockNumber<e)&&(t._updateNumber||(t._updateNumber=(async()=>{try{const n=await t.provider.getBlockNumber();n>t.blockNumber&&(t.blockNumber=n)}catch(n){t.blockNumber=-2,t._lastFatalError=n,t._lastFatalErrorTimestamp=w2()}t._updateNumber=null})()),await t._updateNumber,t.outOfSync++,!t._lastFatalError););}function Yh(t){if(t==null)return"null";if(Array.isArray(t))return"["+t.map(Yh).join(",")+"]";if(typeof t=="object"&&typeof t.toJSON=="function")return Yh(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":case"number":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{"+e.map(n=>`${JSON.stringify(n)}:${Yh(t[n])}`).join(",")+"}"}}throw console.log("Could not serialize",t),new Error("Hmm...")}function v2(t){if("error"in t){const n=t.error;return{tag:Yh(n),value:n}}const e=t.result;return{tag:Yh(e),value:e}}function _y(t,e){const n=new Map;for(const{value:s,tag:i,weight:o}of e){const a=n.get(i)||{value:s,weight:0};a.weight+=o,n.set(i,a)}let r=null;for(const s of n.values())s.weight>=t&&(!r||s.weight>r.weight)&&(r=s);if(r)return r.value}function x2(t,e){let n=0;const r=new Map;let s=null;const i=[];for(const{value:a,tag:l,weight:u}of e)if(a instanceof Error){const c=r.get(l)||{value:a,weight:0};c.weight+=u,r.set(l,c),(s==null||c.weight>s.weight)&&(s=c)}else i.push(BigInt(a)),n+=u;if(n<t)return s&&s.weight>=t?s.value:void 0;i.sort((a,l)=>a<l?-1:l>a?1:0);const o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o]+noe)/roe}function k2(t,e){const n=_y(t,e);if(n!==void 0)return n;for(const r of e)if(r.value)return r.value}function aoe(t,e){if(t===1)return Qe(x2(t,e),"%internal");const n=new Map,r=(o,a)=>{const l=n.get(o)||{result:o,weight:0};l.weight+=a,n.set(o,l)};for(const{weight:o,value:a}of e){const l=Qe(a);r(l-1,o),r(l,o),r(l+1,o)}let s=0,i;for(const{weight:o,result:a}of n.values())o>=t&&(o>s||i!=null&&o===s&&a>i)&&(s=o,i=a);return i}class loe extends xy{constructor(n,r,s){super(r,s);J(this,yr);W(this,"quorum");W(this,"eventQuorum");W(this,"eventWorkers");J(this,gr);J(this,wo);J(this,$f);I(this,gr,n.map(i=>i instanceof xy?Object.assign({provider:i},HP,VP):Object.assign({},HP,i,VP))),I(this,wo,-2),I(this,$f,null),s&&s.quorum!=null?this.quorum=s.quorum:this.quorum=Math.ceil(T(this,gr).reduce((i,o)=>(i+=o.weight,i),0)/2),this.eventQuorum=1,this.eventWorkers=1,G(this.quorum<=T(this,gr).reduce((i,o)=>i+o.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return T(this,gr).map(n=>{const r=Object.assign({},n);for(const s in r)s[0]==="_"&&delete r[s];return r})}async _detectNetwork(){return rn.from(Ee(await this._perform({method:"chainId"})))}async _translatePerform(n,r){switch(r.method){case"broadcastTransaction":return await n.broadcastTransaction(r.signedTransaction);case"call":return await n.call(Object.assign({},r.transaction,{blockTag:r.blockTag}));case"chainId":return(await n.getNetwork()).chainId;case"estimateGas":return await n.estimateGas(r.transaction);case"getBalance":return await n.getBalance(r.address,r.blockTag);case"getBlock":{const s="blockHash"in r?r.blockHash:r.blockTag;return await n.getBlock(s,r.includeTransactions)}case"getBlockNumber":return await n.getBlockNumber();case"getCode":return await n.getCode(r.address,r.blockTag);case"getGasPrice":return(await n.getFeeData()).gasPrice;case"getPriorityFee":return(await n.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await n.getLogs(r.filter);case"getStorage":return await n.getStorage(r.address,r.position,r.blockTag);case"getTransaction":return await n.getTransaction(r.hash);case"getTransactionCount":return await n.getTransactionCount(r.address,r.blockTag);case"getTransactionReceipt":return await n.getTransactionReceipt(r.hash);case"getTransactionResult":return await n.getTransactionResult(r.hash)}}async _perform(n){if(n.method==="broadcastTransaction"){const o=T(this,gr).map(u=>null),a=T(this,gr).map(async({provider:u,weight:c},f)=>{try{const d=await u._perform(n);o[f]=Object.assign(v2({result:d}),{weight:c})}catch(d){o[f]=Object.assign(v2({error:d}),{weight:c})}});for(;;){const u=o.filter(d=>d!=null);for(const{value:d}of u)if(!(d instanceof Error))return d;const c=_y(this.quorum,o.filter(d=>d!=null));if(gn(c,"INSUFFICIENT_FUNDS"))throw c;const f=a.filter((d,h)=>o[h]==null);if(f.length===0)break;await Promise.race(f)}const l=k2(this.quorum,o);if(ee(l!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:n,results:o.map(A2)}}),l instanceof Error)throw l;return l}await fe(this,yr,PL).call(this);const r=new Set;let s=0;for(;;){const o=fe(this,yr,qk).call(this,r,n);if(o==null||(s+=o.config.weight,s>=this.quorum))break}const i=await fe(this,yr,Qk).call(this,r,n);for(const o of r)o.perform&&o.result==null&&o.config.lateResponses++;return i}async destroy(){for(const{provider:n}of T(this,gr))n.destroy();super.destroy()}}gr=new WeakMap,wo=new WeakMap,$f=new WeakMap,yr=new WeakSet,RL=function(n){const r=Array.from(n).map(i=>i.config),s=T(this,gr).slice();soe(s),s.sort((i,o)=>i.priority-o.priority);for(const i of s)if(!i._lastFatalError&&r.indexOf(i)===-1)return i;return null},qk=function(n,r){const s=fe(this,yr,RL).call(this,n);if(s==null)return null;const i={config:s,result:null,didBump:!1,perform:null,staller:null},o=w2();return i.perform=(async()=>{try{s.requests++;const l=await this._translatePerform(s.provider,r);i.result={result:l}}catch(l){s.errorResponses++,i.result={error:l}}const a=w2()-o;s._totalTime+=a,s.rollingDuration=.95*s.rollingDuration+.05*a,i.perform=null})(),i.staller=(async()=>{await ioe(s.stallTimeout),i.staller=null})(),n.add(i),i},PL=async function(){let n=T(this,$f);if(!n){const r=[];T(this,gr).forEach(s=>{r.push((async()=>{await ooe(s,0),s._lastFatalError||(s._network=await s.provider.getNetwork())})())}),I(this,$f,n=(async()=>{await Promise.all(r);let s=null;for(const i of T(this,gr)){if(i._lastFatalError)continue;const o=i._network;s==null?s=o.chainId:o.chainId!==s&&ee(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await n},IL=async function(n,r){const s=[];for(const i of n)if(i.result!=null){const{tag:o,value:a}=v2(i.result);s.push({tag:o,value:a,weight:i.config.weight})}if(!(s.reduce((i,o)=>i+o.weight,0)<this.quorum)){switch(r.method){case"getBlockNumber":{T(this,wo)===-2&&I(this,wo,Math.ceil(Qe(x2(this.quorum,T(this,gr).filter(o=>!o._lastFatalError).map(o=>({value:o.blockNumber,tag:Qe(o.blockNumber).toString(),weight:o.weight}))))));const i=aoe(this.quorum,s);return i===void 0?void 0:(i>T(this,wo)&&I(this,wo,i),T(this,wo))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return x2(this.quorum,s);case"getBlock":return"blockTag"in r&&r.blockTag==="pending"?k2(this.quorum,s):_y(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return _y(this.quorum,s);case"broadcastTransaction":return k2(this.quorum,s)}ee(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${A2(r.method)})`})}},Qk=async function(n,r){if(n.size===0)throw new Error("no runners?!");const s=[];let i=0;for(const a of n){if(a.perform&&s.push(a.perform),a.staller){s.push(a.staller);continue}a.didBump||(a.didBump=!0,i++)}const o=await fe(this,yr,IL).call(this,n,r);if(o!==void 0){if(o instanceof Error)throw o;return o}for(let a=0;a<i;a++)fe(this,yr,qk).call(this,n,r);return ee(s.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:r,results:Array.from(n).map(a=>A2(a.result))}}),await Promise.race(s),await fe(this,yr,Qk).call(this,n,r)};function uoe(t){return t&&typeof t.send=="function"&&typeof t.close=="function"}const coe="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function foe(t,e){e==null&&(e={});const n=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof t=="string"&&t.match(/^https?:/))return new Ji(t);if(typeof t=="string"&&t.match(/^wss?:/)||uoe(t))return new UP(t);let r=null;try{r=rn.from(t)}catch{}const s=[];if(n("publicPolygon")&&r&&(r.name==="matic"?s.push(new Ji("https://polygon-rpc.com/",r,{staticNetwork:r})):r.name==="matic-amoy"&&s.push(new Ji("https://rpc-amoy.polygon.technology/",r,{staticNetwork:r}))),n("alchemy"))try{s.push(new Ty(t,e.alchemy))}catch{}if(n("ankr")&&e.ankr!=null)try{s.push(new Ey(t,e.ankr))}catch{}if(n("chainstack"))try{s.push(new Oy(t,e.chainstack))}catch{}if(n("cloudflare"))try{s.push(new Hie(t))}catch{}if(n("etherscan"))try{s.push(new Wie(t,e.etherscan))}catch{}if(n("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),s.push(new Jh(t,o,a))}catch{}if(n("quicknode"))try{let o=e.quicknode;s.push(new Ny(t,o))}catch{}if(ee(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),r&&coe.indexOf(r.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new loe(s,void 0,{quorum:i})}const doe=async(t,e)=>{const n={name:t,isEns:!1};if(!e)throw new Error("cannot fetch ens name without a provider url");if(!lre(t))return n;try{const r=await hoe(t,e);r&&(n.name=r,n.isEns=!0)}catch(r){console.log(r)}return n},hoe=async(t,e)=>await poe(e).lookupAddress(t),poe=t=>foe(t),moe=(t,e,n)=>{if((t==null?void 0:t.length)>n){const r=t.substring(0,e),s=t.substring((t==null?void 0:t.length)-e);return`${r}...${s}`}return t};function goe(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:s,startOfLine:i,$position:o}=t,a=v7(n),l=new RegExp(`\\s${a}$`),u=i?"^":"",c=r?new RegExp(`${u}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${u}(?:^)?${a}[^\\s${a}]*`,"gm"),f=((e=o.nodeBefore)===null||e===void 0?void 0:e.isText)&&o.nodeBefore.text;if(!f)return null;const d=o.pos-f.length,h=Array.from(f.matchAll(c)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(p);if(s!==null&&!m)return null;const g=d+h.index;let y=g+h[0].length;return r&&l.test(f.slice(y-1,y+1))&&(h[0]+=" ",y+=1),g<o.pos&&y>=o.pos?{range:{from:g,to:y},query:h[0].slice(n.length),text:h[0]}:null}const yoe=new Mt("suggestion");function boe({pluginKey:t=yoe,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:s=[" "],startOfLine:i=!1,decorationTag:o="span",decorationClass:a="suggestion",command:l=()=>null,items:u=()=>[],render:c=()=>({}),allow:f=()=>!0,findSuggestionMatch:d=goe}){let h;const p=c==null?void 0:c(),m=new bt({key:t,view(){return{update:async(g,y)=>{var v,A,w,x,k,E,O;const M=(v=this.key)===null||v===void 0?void 0:v.getState(y),D=(A=this.key)===null||A===void 0?void 0:A.getState(g.state),R=M.active&&D.active&&M.range.from!==D.range.from,B=!M.active&&D.active,F=M.active&&!D.active,V=!B&&!F&&M.query!==D.query,L=B||R,H=V&&!R,q=F||R;if(!L&&!H&&!q)return;const te=q&&!L?M:D,Z=g.dom.querySelector(`[data-decoration-id="${te.decorationId}"]`);h={editor:e,range:te.range,query:te.query,text:te.text,items:[],command:pe=>l({editor:e,range:te.range,props:pe}),decorationNode:Z,clientRect:Z?()=>{var pe;const{decorationId:Ce}=(pe=this.key)===null||pe===void 0?void 0:pe.getState(e.state),Se=g.dom.querySelector(`[data-decoration-id="${Ce}"]`);return(Se==null?void 0:Se.getBoundingClientRect())||null}:null},L&&((w=p==null?void 0:p.onBeforeStart)===null||w===void 0||w.call(p,h)),H&&((x=p==null?void 0:p.onBeforeUpdate)===null||x===void 0||x.call(p,h)),(H||L)&&(h.items=await u({editor:e,query:te.query})),q&&((k=p==null?void 0:p.onExit)===null||k===void 0||k.call(p,h)),H&&((E=p==null?void 0:p.onUpdate)===null||E===void 0||E.call(p,h)),L&&((O=p==null?void 0:p.onStart)===null||O===void 0||O.call(p,h))},destroy:()=>{var g;h&&((g=p==null?void 0:p.onExit)===null||g===void 0||g.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,v,A){const{isEditable:w}=e,{composing:x}=e.view,{selection:k}=g,{empty:E,from:O}=k,M={...y};if(M.composing=x,w&&(E||e.view.composing)){(O<y.range.from||O>y.range.to)&&!x&&!y.composing&&(M.active=!1);const D=d({char:n,allowSpaces:r,allowedPrefixes:s,startOfLine:i,$position:k.$from}),R=`id_${Math.floor(Math.random()*4294967295)}`;D&&f({editor:e,state:A,range:D.range})?(M.active=!0,M.decorationId=y.decorationId?y.decorationId:R,M.range=D.range,M.query=D.query,M.text=D.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(g,y){var v;const{active:A,range:w}=m.getState(g.state);return A&&((v=p==null?void 0:p.onKeyDown)===null||v===void 0?void 0:v.call(p,{view:g,event:y,range:w}))||!1},decorations(g){const{active:y,range:v,decorationId:A}=m.getState(g);return y?kt.create(g.doc,[nn.inline(v.from,v.to,{nodeName:o,class:a,"data-decoration-id":A})]):null}}});return m}var woe=typeof tr=="object"&&tr&&tr.Object===Object&&tr,Aoe=typeof self=="object"&&self&&self.Object===Object&&self;woe||Aoe||Function("return this")();var voe=typeof window<"u"?_.useLayoutEffect:_.useEffect,xoe=typeof window>"u";function C2(t,{defaultValue:e=!1,initializeWithValue:n=!0}={}){const r=a=>xoe?e:window.matchMedia(a).matches,[s,i]=_.useState(()=>n?r(t):e);function o(){i(r(t))}return voe(()=>{const a=window.matchMedia(t);return o(),a.addListener?a.addListener(o):a.addEventListener("change",o),()=>{a.removeListener?a.removeListener(o):a.removeEventListener("change",o)}},[t]),s}const koe=wt.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[boe({editor:this.editor,...this.options.suggestion})]}}),Coe=({query:t,uploadToIpfs:e})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:S.jsx(RT,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleNode("paragraph","paragraph").run()}},{title:"To-do List",description:"Track tasks with a to-do list.",searchTerms:["todo","task","list","check","checkbox"],icon:S.jsx(_T,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleTaskList().run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:S.jsx(A0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:S.jsx(v0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:S.jsx(x0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:S.jsx(k0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:S.jsx(Uu,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleOrderedList().run()}},{title:"Divider",description:"Visually divide content.",searchTerms:["hr","divider","break","line","delimiter"],icon:S.jsx(SU,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setHorizontalRule().run()}},{title:"Quote",description:"Capture a quote.",searchTerms:["blockquote"],icon:S.jsx(C0,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).toggleNode("paragraph","paragraph").toggleBlockquote().run()},{title:"Code",description:"Capture a code snippet.",searchTerms:["codeblock"],icon:S.jsx(Md,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).toggleCodeBlock().run()},{title:"Table",description:"Create a table.",searchTerms:["table"],icon:S.jsx(q1,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).insertTable({rows:3,cols:2,withHeaderRow:!0}).run()},{title:"Image",description:"Upload an image from your computer.",searchTerms:["photo","picture","media"],icon:S.jsx(kU,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).run();const s=document.createElement("input");s.type="file",s.accept="image/*",s.onchange=async()=>{var i;if((i=s.files)!=null&&i.length){const o=s.files[0],a=n.view.state.selection.from;X1(o,n.view,a,e)}},s.click()}},{title:"Video Embed",description:"Embed a video from YouTube, Vimeo, etc.",searchTerms:["iframe","embed","video","youtube"],icon:S.jsx(IT,{}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setActionButton("iframe").run()}},{title:"Twitter",description:"Embed a Twitter tweet.",searchTerms:["embed","twitter","tweet"],icon:S.jsx(PT,{}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setActionButton("twitter").run()}},{title:"2 Columns",description:"Create 2 columns of block",searchTerms:["col","column","2","layout"],icon:S.jsx(OT,{}),image:"",command:({editor:n})=>{n.chain().focus().setColumns(2).focus(n.state.selection.head-1).run()}},{title:"3 Columns",description:"Create 3 columns of block",searchTerms:["col","column","3","layout"],icon:S.jsx(wU,{}),image:"",command:({editor:n})=>{n.chain().focus().setColumns(3).focus(n.state.selection.head-1).run()}}].filter(n=>{if(typeof t=="string"&&t.length>0){const r=t.toLowerCase();return n.title.toLowerCase().includes(r)||n.description.toLowerCase().includes(r)||n.searchTerms&&n.searchTerms.some(s=>s.includes(r))}return!0}),Eoe=(t,e)=>{const n=t.offsetHeight,r=e?e.offsetHeight:0,s=e.offsetTop,i=s+r;s<t.scrollTop?t.scrollTop-=t.scrollTop-s+5:i>n+t.scrollTop&&(t.scrollTop+=i-n-t.scrollTop+5)},Soe=({items:t,command:e,editor:n})=>{const[r,s]=_.useState(0),[i,o]=_.useState(t),a=C2("(max-width: 640px)"),l=_.useCallback(c=>{const f=i[c];f&&(f.title==="Continue writing"||e(f))},[e,n,i]);_.useEffect(()=>{if(a){const c=t.filter(f=>!["2 Columns","3 Columns","Twitter","Video Embed"].includes(f.title));o(c)}else o(t)},[t,a]),_.useEffect(()=>{const c=["ArrowUp","ArrowDown","Enter"],f=d=>{if(c.includes(d.key))return d.preventDefault(),d.key==="ArrowUp"?(s((r+i.length-1)%i.length),!0):d.key==="ArrowDown"?(s((r+1)%i.length),!0):d.key==="Enter"?(l(r),!0):!1};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[i,r,s,l]),_.useEffect(()=>{s(0)},[i]);const u=_.useRef(null);return _.useLayoutEffect(()=>{const c=u==null?void 0:u.current,f=c==null?void 0:c.children[r];f&&c&&Eoe(c,f)},[r]),i.length>0?S.jsx("div",{id:"slash-command",ref:u,className:"z-50 h-auto max-h-[330px] w-72 overflow-y-auto scroll-smooth rounded-md border border-[#DDD] bg-white px-1 py-2 shadow-md transition-all",children:i.map((c,f)=>S.jsxs("button",{className:`flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm text-neutral-500 hover:bg-neutral-100 hover:border-neutral-200 border border-transparent transition-all ${f===r?"bg-neutral-200 text-neutral-800":""}`,onClick:()=>l(f),children:[S.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-md border border-neutral-200 bg-white",children:c.icon}),S.jsxs("div",{children:[S.jsx("p",{className:"font-medium",children:c.title}),S.jsx("p",{className:"text-xs text-neutral-500",children:c.description})]})]},f))}):null},Toe=()=>{let t=null,e=null;return{onStart:n=>{t=new ST(Soe,{props:n,editor:n.editor}),e=Xa("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:n=>{t==null||t.updateProps(n),e&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:n=>{var r;return n.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t==null?void 0:t.ref)==null?void 0:r.onKeyDown(n)},onExit:()=>{e==null||e[0].destroy(),t==null||t.destroy()}}},Doe=t=>{const e=({query:n})=>Coe({query:n,uploadToIpfs:t});return koe.configure({suggestion:{items:e,render:Toe}})},zP=["#30bced","#6eeb83","#fa69d1","#ecd444","#ee6352","#db3041","#0ad7f2","#1bff39"],Ooe=({isPreviewMode:t,initialContent:e,enableCollaboration:n,collaborationId:r,walletAddress:s,username:i,onChange:o,onCollaboratorChange:a,onCommentInteraction:l,onTextSelection:u,ensResolutionUrl:c,handleImageUploadToIpfs:f})=>{var B,F;const[d]=_.useState(new ul),[h,p]=_.useState(!1),[m,g]=_.useState([...mte,Doe(f)]),y=_.useRef(!1),v=(V,L,H)=>{let q=!1;return V.doc.nodesBetween(L,H,te=>{te.marks&&te.marks.some(Z=>Z.type.name==="highlight"&&Z.attrs.color==="yellow")&&(q=!0)}),q},A=(V,L)=>{var q;const H=L.target;if(H&&H.nodeName==="MARK"&&H.dataset.color&&((q=H==null?void 0:H.dataset)==null?void 0:q.color)==="yellow"){const te=H.textContent,Z=V.posAtCoords({left:L.clientX,top:L.clientY});if(Z){const{state:pe}=V;let Ce=Z.pos,Se=Z.pos;if(pe.doc.nodesBetween(Ce,Se,(ve,xe)=>{ve.marks&&ve.marks.length&&ve.marks.forEach(Fe=>{Fe.type.name==="highlight"&&(Ce=xe,Se=xe+ve.nodeSize)})}),Ce!==Se){const ve={text:te,from:Ce,to:Se,isHighlightedYellow:v(pe,Ce,Se)};l==null||l(ve)}}}},w=(V,L,H)=>{A(V,H)},x=AT({extensions:m,editorProps:{...TM,handleDOMEvents:{mouseover:A,keydown:(V,L)=>{if(["ArrowUp","ArrowDown","Enter"].includes(L.key)&&document.querySelector("#slash-command"))return!0}},handleClick:w},autofocus:"start",onUpdate:V=>{D!=null&&D.isEmpty||o==null||o(V.editor.getJSON())}},[m]),k=AT({extensions:m,editorProps:{...TM,handleDOMEvents:{mouseover:A,keydown:(V,L)=>{if(["ArrowUp","ArrowDown","Enter"].includes(L.key)&&document.querySelector("#slash-command"))return!0}},handleClick:w},autofocus:"start",onUpdate:V=>{D!=null&&D.isEmpty||o==null||o(V.editor.getJSON())}}),E=_.useRef(()=>{}),O=(V,L=!1)=>{if(!n||!r)throw new Error("docId or username is not provided");p(!0);const H=new RW(r,d,{signaling:["wss://fileverse-signaling-server-0529292ff51c.herokuapp.com/"]});g([...m,iK.configure({document:d}),oK.configure({provider:H,user:{name:V&&V.length>20?moe(V,7,15):V,color:zP[Math.floor(Math.random()*zP.length)],isEns:L},render:Ate})]);const q=setTimeout(()=>{p(!1)},100);return E.current=()=>{clearTimeout(q),H.destroy(),d.destroy(),p(!1)},E.current},M=_.useRef(null),D=_.useMemo(()=>n&&r&&x&&!h?x:k,[x,k,h]);_.useEffect(()=>{D==null||D.setEditable(!t)},[t,D]),_.useEffect(()=>{e&&D&&!y.current&&(D.commands.setContent(e),y.current=!0),setTimeout(()=>{y.current=!1})},[e,D]),_.useEffect(()=>{if(!D)return;const V=()=>{const{state:L}=D,{from:H,to:q}=L.selection,te=L.doc.textBetween(H,q," ");u==null||u({text:te,from:H,to:q,isHighlightedYellow:v(L,H,q)})};return D.on("selectionUpdate",V),()=>{D.off("selectionUpdate",V)}},[D]);const R=async()=>{let V=i,L=!1;if(s&&c){const{name:H,isEns:q}=await doe(s,c);V=H,L=q}if(!V)throw new Error("Cannot start collaboration without a username");O(V,L)};return _.useEffect(()=>{n?R():E.current()},[n]),_.useEffect(()=>{var V,L;a==null||a((L=(V=D==null?void 0:D.storage)==null?void 0:V.collaborationCursor)==null?void 0:L.users)},[(F=(B=D==null?void 0:D.storage)==null?void 0:B.collaborationCursor)==null?void 0:F.users]),{editor:D,ref:M,loading:h,connect:O,ydoc:d}},Moe=({title:t,content:e,contentClassName:n,open:r,onOpenChange:s,primaryAction:i,secondaryAction:o})=>S.jsx(LV,{open:r,onOpenChange:s,children:S.jsxs(Z3,{className:"max-w-md sm:w-full w-[90%] z-20",children:[S.jsx(eD,{className:"px-4 pt-0 border-b-[1px]",children:S.jsx(nD,{className:"text-left text-base",children:t})}),S.jsx("div",{className:he("flex flex-col gap-4 w-full h-full pb-4 text-base text-black",n),children:e&&e}),S.jsxs(tD,{className:"px-5 pb-5 justify-end sm:",children:[o&&S.jsx(jV,{asChild:!0,children:S.jsx(sl,{disabled:o==null?void 0:o.isLoading,isLoading:o==null?void 0:o.isLoading,className:o==null?void 0:o.className,variant:(o==null?void 0:o.variant)||"ghost",onClick:o==null?void 0:o.onClick,children:o==null?void 0:o.label})}),i&&S.jsx(sl,{disabled:i==null?void 0:i.isLoading,isLoading:i==null?void 0:i.isLoading,className:i==null?void 0:i.className,variant:(i==null?void 0:i.variant)||"primary",onClick:i==null?void 0:i.onClick,children:i==null?void 0:i.label})]})]})}),Noe=({editor:t,uploadToIpfs:e})=>{const{toolVisibilty:n,setToolVisibility:r,bottomToolbar:s}=Lw({editor:t,uploadToIpfs:e}),i=C2("(max-width: 1023px)"),[o,a]=_.useState(""),[l,u]=_.useState(""),[c,f]=_.useState(!0),d=()=>{if(o===null){f(!1);return}if(o===""){t.chain().focus().extendMarkRange("link").unsetLink().run(),f(!1);return}let m=o;!o.startsWith("http://")&&!o.startsWith("https://")&&(m="https://"+o);try{m.match(/^((http|https):\/\/)?([w|W]{3}\.)+[a-zA-Z0-9\-\.]{3,}\.[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?$/)&&t.chain().focus().extendMarkRange("link").setLink({href:m}).command(({tr:g})=>(g.insertText(l),!0)).run(),f(!0)}catch{console.error("Invalid URL"),f(!1);return}t.chain().focus().extendMarkRange("link").setLink({href:m}).command(({tr:g})=>(g.insertText(l),!0)).run(),f(!0),r(_e.NONE)},h=m=>{const{from:g,to:y}=m.state.selection,v=m.state.doc.textBetween(g,y);return u(v),v},p=_.useRef(null);return _.useEffect(()=>{let m=0;const g=()=>{m=Date.now()},y=()=>{var w;if(Date.now()-m>500){const{selection:x}=t.state;x.from!==x.to&&((w=p.current)==null||w.click())}},v=()=>{var x;if(!i)return;const{selection:A}=t.state;A.from!==A.to&&((x=p.current)==null||x.click())};return i?(document.addEventListener("touchstart",g),document.addEventListener("touchend",y)):document.addEventListener("mouseup",v),()=>{i?(document.removeEventListener("touchstart",g),document.removeEventListener("touchend",y)):document.removeEventListener("mouseup",v)}},[t,i]),_.useEffect(()=>{h(t)},[t]),_.useEffect(()=>{const m=g=>{g.key==="k"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),n!==_e.LINK_POPUP?r(_e.LINK_POPUP):r(_e.NONE))};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[t,n]),S.jsxs(W3,{children:[S.jsx("div",{className:"flex w-full justify-between sm:justify-evenly select-none",children:s.map(m=>{if(m)return S.jsx("div",{className:"flex items-center",children:m.title==="Text formating"?S.jsx(K3,{asChild:!0,children:S.jsx("button",{ref:p,onClick:()=>m.onClick(),children:m.icon})}):m.title==="Text color"?S.jsx(K3,{asChild:!0,children:S.jsx("button",{onClick:()=>m.onClick(),children:m.icon})}):S.jsx("button",{className:he("flex items-center rounded px-2 py-1 transition",{"text-black":m.isActive,"text-[#A1AAB1]":!m.isActive}),onClick:()=>m.onClick(),disabled:!m.isActive,children:m.icon})},m.title)})}),n===_e.TEXT_FORMATING&&S.jsx(Sz,{editor:t,setToolVisibility:r}),n===_e.LINK_POPUP&&S.jsx(Moe,{open:n===_e.LINK_POPUP,onOpenChange:()=>r(_e.NONE),title:"Link",content:S.jsxs("div",{className:"flex flex-col gap-4 w-full h-full px-4",children:[S.jsx(z0,{label:"Text",placeholder:"Link text",className:"w-full",defaultValue:l,onChange:m=>{m.preventDefault(),u(m.target.value)}}),S.jsx(z0,{label:"Link",placeholder:"Paste URL",className:"w-full",defaultValue:t.getAttributes("link").href,onChange:m=>{m.preventDefault(),a(m.target.value)},isValid:c,message:c?"":"Invalid URL"})]}),primaryAction:{label:"Save",onClick:()=>d(),isLoading:!1,className:"w-auto min-w-[80px]"},secondaryAction:{label:"Cancel",variant:"secondary",onClick:()=>r(_e.NONE),className:"w-auto min-w-[80px]"}})]})},E2=_.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Ry=_.createContext({}),Py=_.createContext(null),S2=typeof document<"u",T2=S2?_.useLayoutEffect:_.useEffect,$P=_.createContext({strict:!1}),D2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),GP="data-"+D2("framerAppearId"),_oe={skipAnimations:!1,useManualTiming:!1};class WP{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function Roe(t){let e=new WP,n=new WP,r=0,s=!1,i=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const f=c&&s,d=f?e:n;return u&&o.add(l),d.add(l)&&f&&s&&(r=e.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){i=!0;return}if(s=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let u=0;u<r;u++){const c=e.order[u];o.has(c)&&(a.schedule(c),t()),c(l)}s=!1,i&&(i=!1,a.process(l))}};return a}const Iy=["read","resolveKeyframes","update","preRender","render","postRender"],Poe=40;function KP(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=Iy.reduce((f,d)=>(f[d]=Roe(()=>n=!0),f),{}),o=f=>{i[f].process(s)},a=()=>{const f=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(f-s.timestamp,Poe),1),s.timestamp=f,s.isProcessing=!0,Iy.forEach(o),s.isProcessing=!1,n&&e&&(r=!1,t(a))},l=()=>{n=!0,r=!0,s.isProcessing||t(a)};return{schedule:Iy.reduce((f,d)=>{const h=i[d];return f[d]=(p,m=!1,g=!1)=>(n||l(),h.schedule(p,m,g)),f},{}),cancel:f=>Iy.forEach(d=>i[d].cancel(f)),state:s,steps:i}}const{schedule:O2,cancel:bde}=KP(queueMicrotask,!1);function Gc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const qP=_.createContext({});let QP=!1;function Ioe(t,e,n,r,s){const{visualElement:i}=_.useContext(Ry),o=_.useContext($P),a=_.useContext(Py),l=_.useContext(E2).reducedMotion,u=_.useRef();r=r||o.renderer,!u.current&&r&&(u.current=r(t,{visualState:e,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,f=_.useContext(qP);c&&!c.projection&&s&&(c.type==="html"||c.type==="svg")&&Boe(u.current,n,s,f),_.useInsertionEffect(()=>{c&&c.update(n,a)});const d=_.useRef(!!(n[GP]&&!window.HandoffComplete));return T2(()=>{c&&(c.updateFeatures(),O2.render(c.render),d.current&&c.animationState&&c.animationState.animateChanges())}),_.useEffect(()=>{c&&(!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,QP||(QP=!0,queueMicrotask(Loe))))}),c}function Loe(){window.HandoffComplete=!0}function Boe(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:JP(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Gc(a),visualElement:t,scheduleRender:()=>t.scheduleRender(),animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function JP(t){if(t)return t.options.allowProjection!==!1?t.projection:JP(t.parent)}function Foe(t,e,n){return _.useCallback(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):Gc(n)&&(n.current=r))},[e])}function Xh(t){return typeof t=="string"||Array.isArray(t)}function Ly(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const M2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],N2=["initial",...M2];function By(t){return Ly(t.animate)||N2.some(e=>Xh(t[e]))}function YP(t){return!!(By(t)||t.variants)}function joe(t,e){if(By(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Xh(n)?n:void 0,animate:Xh(r)?r:void 0}}return t.inherit!==!1?e:{}}function Uoe(t){const{initial:e,animate:n}=joe(t,_.useContext(Ry));return _.useMemo(()=>({initial:e,animate:n}),[XP(e),XP(n)])}function XP(t){return Array.isArray(t)?t.join(" "):t}const ZP={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Wc={};for(const t in ZP)Wc[t]={isEnabled:e=>ZP[t].some(n=>!!e[n])};function Hoe(t){for(const e in t)Wc[e]={...Wc[e],...t[e]}}const _2=_.createContext({}),Voe=Symbol.for("motionComponentSymbol"),Sn=t=>t;let Kc=Sn,Yi=Sn;process.env.NODE_ENV!=="production"&&(Kc=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Yi=(t,e)=>{if(!t)throw new Error(e)});function zoe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&Hoe(t);function i(a,l){let u;const c={..._.useContext(E2),...a,layoutId:$oe(a)},{isStatic:f}=c,d=Uoe(a),h=r(a,f);if(!f&&S2){Goe(c,t);const p=Woe(c);u=p.MeasureLayout,d.visualElement=Ioe(s,h,c,e,p.ProjectionNode)}return S.jsxs(Ry.Provider,{value:d,children:[u&&d.visualElement?S.jsx(u,{visualElement:d.visualElement,...c}):null,n(s,a,Foe(h,d.visualElement,l),h,f,d.visualElement)]})}const o=_.forwardRef(i);return o[Voe]=s,o}function $oe({layoutId:t}){const e=_.useContext(_2).id;return e&&t!==void 0?e+"-"+t:t}function Goe(t,e){const n=_.useContext($P).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Kc(!1,r):Yi(!1,r)}}function Woe(t){const{drag:e,layout:n}=Wc;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Koe(t){function e(r,s={}){return zoe(t(r,s))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(r,s)=>(n.has(s)||n.set(s,e(s)),n.get(s))})}const qoe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function R2(t){return typeof t!="string"||t.includes("-")?!1:!!(qoe.indexOf(t)>-1||/[A-Z]/u.test(t))}const Fy={};function Qoe(t){Object.assign(Fy,t)}const Zh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bl=new Set(Zh);function e8(t,{layout:e,layoutId:n}){return Bl.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Fy[t]||t==="opacity")}const Pn=t=>!!(t&&t.getVelocity),Joe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Yoe=Zh.length;function Xoe(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,s){let i="";for(let o=0;o<Yoe;o++){const a=Zh[o];if(t[a]!==void 0){const l=Joe[a]||a;i+=`${l}(${t[a]}) `}}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),s?i=s(t,r?"":i):n&&r&&(i="none"),i}const t8=t=>e=>typeof e=="string"&&e.startsWith(t),n8=t8("--"),Zoe=t8("var(--"),P2=t=>Zoe(t)?eae.test(t.split("/*")[0].trim()):!1,eae=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,tae=(t,e)=>e&&typeof t=="number"?e.transform(t):t,la=(t,e,n)=>n>e?e:n<t?t:n,qc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ep={...qc,transform:t=>la(0,1,t)},jy={...qc,default:1},tp=t=>Math.round(t*1e5)/1e5,I2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,nae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,rae=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function np(t){return typeof t=="string"}const rp=t=>({test:e=>np(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ua=rp("deg"),hi=rp("%"),Ie=rp("px"),sae=rp("vh"),iae=rp("vw"),r8={...hi,parse:t=>hi.parse(t)/100,transform:t=>hi.transform(t*100)},s8={...qc,transform:Math.round},i8={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,radius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,size:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,rotate:ua,rotateX:ua,rotateY:ua,rotateZ:ua,scale:jy,scaleX:jy,scaleY:jy,scaleZ:jy,skew:ua,skewX:ua,skewY:ua,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:ep,originX:r8,originY:r8,originZ:Ie,zIndex:s8,backgroundPositionX:Ie,backgroundPositionY:Ie,fillOpacity:ep,strokeOpacity:ep,numOctaves:s8};function L2(t,e,n,r){const{style:s,vars:i,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const f in e){const d=e[f];if(n8(f)){i[f]=d;continue}const h=i8[f],p=tae(d,h);if(Bl.has(f)){if(l=!0,o[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,a[f]=p):s[f]=p}if(e.transform||(l||r?s.transform=Xoe(t.transform,n,c,r):s.transform&&(s.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=a;s.transformOrigin=`${f} ${d} ${h}`}}const B2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function o8(t,e,n){for(const r in e)!Pn(e[r])&&!e8(r,n)&&(t[r]=e[r])}function oae({transformTemplate:t},e,n){return _.useMemo(()=>{const r=B2();return L2(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}function aae(t,e,n){const r=t.style||{},s={};return o8(s,r,t),Object.assign(s,oae(t,e,n)),s}function lae(t,e,n){const r={},s=aae(t,e,n);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=s,r}const uae=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Uy(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||uae.has(t)}let a8=t=>!Uy(t);function cae(t){t&&(a8=e=>e.startsWith("on")?!Uy(e):t(e))}try{cae(require("@emotion/is-prop-valid").default)}catch{}function fae(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(a8(s)||n===!0&&Uy(s)||!e&&!Uy(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function l8(t,e,n){return typeof t=="string"?t:Ie.transform(e+n*t)}function dae(t,e,n){const r=l8(e,t.x,t.width),s=l8(n,t.y,t.height);return`${r} ${s}`}const hae={offset:"stroke-dashoffset",array:"stroke-dasharray"},pae={offset:"strokeDashoffset",array:"strokeDasharray"};function mae(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?hae:pae;t[i.offset]=Ie.transform(-r);const o=Ie.transform(e),a=Ie.transform(n);t[i.array]=`${o} ${a}`}function F2(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f,d){if(L2(t,u,c,d),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:p,dimensions:m}=t;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(s!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=dae(m,s!==void 0?s:.5,i!==void 0?i:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&mae(h,o,a,l,!1)}const u8=()=>({...B2(),attrs:{}}),j2=t=>typeof t=="string"&&t.toLowerCase()==="svg";function gae(t,e,n,r){const s=_.useMemo(()=>{const i=u8();return F2(i,e,{enableHardwareAcceleration:!1},j2(r),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};o8(i,t.style,t),s.style={...i,...s.style}}return s}function yae(t=!1){return(n,r,s,{latestValues:i},o)=>{const l=(R2(n)?gae:lae)(r,i,o,n),u=fae(r,typeof n=="string",t),c=n!==_.Fragment?{...u,...l,ref:s}:{},{children:f}=r,d=_.useMemo(()=>Pn(f)?f.get():f,[f]);return _.createElement(n,{...c,children:d})}}function c8(t,{style:e,vars:n},r,s){Object.assign(t.style,e,s&&s.getProjectionStyles(r));for(const i in n)t.style.setProperty(i,n[i])}const f8=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function d8(t,e,n,r){c8(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(f8.has(s)?s:D2(s),e.attrs[s])}function U2(t,e,n){var r;const{style:s}=t,i={};for(const o in s)(Pn(s[o])||e.style&&Pn(e.style[o])||e8(o,t)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}function h8(t,e,n){const r=U2(t,e,n);for(const s in t)if(Pn(t[s])||Pn(e[s])){const i=Zh.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}function p8(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function H2(t,e,n,r){if(typeof e=="function"){const[s,i]=p8(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=p8(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function m8(t){const e=_.useRef(null);return e.current===null&&(e.current=t()),e.current}const V2=t=>Array.isArray(t),bae=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),wae=t=>V2(t)?t[t.length-1]||0:t;function Hy(t){const e=Pn(t)?t.get():t;return bae(e)?e.toValue():e}function Aae({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,s,i){const o={latestValues:vae(r,s,i,t),renderState:e()};return n&&(o.mount=a=>n(r,a,o)),o}const g8=t=>(e,n)=>{const r=_.useContext(Ry),s=_.useContext(Py),i=()=>Aae(t,e,r,s);return n?i():m8(i)};function vae(t,e,n,r){const s={},i=r(t,{});for(const d in i)s[d]=Hy(i[d]);let{initial:o,animate:a}=t;const l=By(t),u=YP(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;return f&&typeof f!="boolean"&&!Ly(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=H2(t,h);if(!p)return;const{transitionEnd:m,transition:g,...y}=p;for(const v in y){let A=y[v];if(Array.isArray(A)){const w=c?A.length-1:0;A=A[w]}A!==null&&(s[v]=A)}for(const v in m)s[v]=m[v]}),s}const{schedule:pt,cancel:Xi,state:Tn,steps:z2}=KP(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0),xae={useVisualState:g8({scrapeMotionValuesFromProps:h8,createRenderState:u8,onMount:(t,e,{renderState:n,latestValues:r})=>{pt.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),pt.render(()=>{F2(n,r,{enableHardwareAcceleration:!1},j2(e.tagName),t.transformTemplate),d8(e,n)})}})},kae={useVisualState:g8({scrapeMotionValuesFromProps:U2,createRenderState:B2})};function Cae(t,{forwardMotionProps:e=!1},n,r){return{...R2(t)?xae:kae,preloadedFeatures:n,useRender:yae(e),createVisualElement:r,Component:t}}function Zi(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const y8=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function Vy(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const Eae=t=>e=>y8(e)&&t(e,Vy(e));function eo(t,e,n,r){return Zi(t,e,Eae(n),r)}const Sae=(t,e)=>n=>e(t(n)),to=(...t)=>t.reduce(Sae);function b8(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const w8=b8("dragHorizontal"),A8=b8("dragVertical");function v8(t){let e=!1;if(t==="y")e=A8();else if(t==="x")e=w8();else{const n=w8(),r=A8();n&&r?e=()=>{n(),r()}:(n&&n(),r&&r())}return e}function x8(){const t=v8(!0);return t?(t(),!1):!0}class ca{constructor(e){this.isMounted=!1,this.node=e}update(){}}function k8(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd",s=(i,o)=>{if(i.pointerType==="touch"||x8())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const l=a[r];l&&pt.postRender(()=>l(i,o))};return eo(t.current,n,s,{passive:!t.getProps()[r]})}class Tae extends ca{mount(){this.unmount=to(k8(this.node,!0),k8(this.node,!1))}unmount(){}}class Dae extends ca{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=to(Zi(this.node.current,"focus",()=>this.onFocus()),Zi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const C8=(t,e)=>e?t===e?!0:C8(t,e.parentElement):!1;function $2(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,Vy(n))}class Oae extends ca{constructor(){super(...arguments),this.removeStartListeners=Sn,this.removeEndListeners=Sn,this.removeAccessibleListeners=Sn,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),i=eo(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:f}=this.node.getProps(),d=!f&&!C8(this.node.current,a.target)?c:u;d&&pt.update(()=>d(a,l))},{passive:!(r.onTap||r.onPointerUp)}),o=eo(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=to(i,o),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=i=>{if(i.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||$2("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&pt.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Zi(this.node.current,"keyup",o),$2("down",(a,l)=>{this.startPress(a,l)})},n=Zi(this.node.current,"keydown",e),r=()=>{this.isPressing&&$2("cancel",(i,o)=>this.cancelPress(i,o))},s=Zi(this.node.current,"blur",r);this.removeAccessibleListeners=to(n,s)}}startPress(e,n){this.isPressing=!0;const{onTapStart:r,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&pt.postRender(()=>r(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!x8()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&pt.postRender(()=>r(e,n))}mount(){const e=this.node.getProps(),n=eo(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=Zi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=to(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const G2=new WeakMap,W2=new WeakMap,Mae=t=>{const e=G2.get(t.target);e&&e(t)},Nae=t=>{t.forEach(Mae)};function _ae({root:t,...e}){const n=t||document;W2.has(n)||W2.set(n,{});const r=W2.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(Nae,{root:t,...e})),r[s]}function Rae(t,e,n){const r=_ae(e);return G2.set(t,n),r.observe(t),()=>{G2.delete(t),r.unobserve(t)}}const Pae={some:0,all:1};class Iae extends ca{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Pae[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return Rae(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Lae(e,n))&&this.startObserver()}unmount(){}}function Lae({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Bae={inView:{Feature:Iae},tap:{Feature:Oae},focus:{Feature:Dae},hover:{Feature:Tae}};function E8(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function zy(t,e,n){const r=t.getProps();return H2(r,e,n!==void 0?n:r.custom,t)}const no=t=>t*1e3,ro=t=>t/1e3,Fae={type:"spring",stiffness:500,damping:25,restSpeed:10},jae=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Uae={type:"keyframes",duration:.8},Hae={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Vae=(t,{keyframes:e})=>e.length>2?Uae:Bl.has(t)?t.startsWith("scale")?jae(e[1]):Fae:Hae;function zae({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function K2(t,e){return t[e]||t.default||t}const $ae=t=>t!==null;function $y(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter($ae),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}let Gy;function Gae(){Gy=void 0}const fa={now:()=>(Gy===void 0&&fa.set(Tn.isProcessing||_oe.useManualTiming?Tn.timestamp:performance.now()),Gy),set:t=>{Gy=t,queueMicrotask(Gae)}},S8=t=>/^0[^.\s]+$/u.test(t);function Wae(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||S8(t):!0}const T8=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Kae=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function qae(t){const e=Kae.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}const Qae=4;function D8(t,e,n=1){Yi(n<=Qae,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,s]=qae(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return T8(o)?parseFloat(o):o}return P2(s)?D8(s,e,n+1):s}const Jae=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),O8=t=>t===qc||t===Ie,M8=(t,e)=>parseFloat(t.split(", ")[e]),N8=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return M8(s[1],e);{const i=r.match(/^matrix\((.+)\)$/u);return i?M8(i[1],t):0}},Yae=new Set(["x","y","z"]),Xae=Zh.filter(t=>!Yae.has(t));function Zae(t){const e=[];return Xae.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Qc={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:N8(4,13),y:N8(5,14)};Qc.translateX=Qc.x,Qc.translateY=Qc.y;const _8=t=>e=>e.test(t),R8=[qc,Ie,hi,ua,iae,sae,{test:t=>t==="auto",parse:t=>t}],P8=t=>R8.find(_8(t)),Fl=new Set;let q2=!1,Q2=!1;function I8(){if(Q2){const t=Array.from(Fl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Zae(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Q2=!1,q2=!1,Fl.forEach(t=>t.complete()),Fl.clear()}function L8(){Fl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Q2=!0)})}function ele(){L8(),I8()}class J2{constructor(e,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Fl.add(this),q2||(q2=!0,pt.read(L8),pt.resolveKeyframes(I8))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),s&&o===void 0&&s.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Fl.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Fl.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Y2=(t,e)=>n=>!!(np(n)&&rae.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),B8=(t,e,n)=>r=>{if(!np(r))return r;const[s,i,o,a]=r.match(I2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},tle=t=>la(0,255,t),X2={...qc,transform:t=>Math.round(tle(t))},jl={test:Y2("rgb","red"),parse:B8("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+X2.transform(t)+", "+X2.transform(e)+", "+X2.transform(n)+", "+tp(ep.transform(r))+")"};function nle(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Z2={test:Y2("#"),parse:nle,transform:jl.transform},Jc={test:Y2("hsl","hue"),parse:B8("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+hi.transform(tp(e))+", "+hi.transform(tp(n))+", "+tp(ep.transform(r))+")"},In={test:t=>jl.test(t)||Z2.test(t)||Jc.test(t),parse:t=>jl.test(t)?jl.parse(t):Jc.test(t)?Jc.parse(t):Z2.parse(t),transform:t=>np(t)?t:t.hasOwnProperty("red")?jl.transform(t):Jc.transform(t)};function rle(t){var e,n;return isNaN(t)&&np(t)&&(((e=t.match(I2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(nae))===null||n===void 0?void 0:n.length)||0)>0}const F8="number",j8="color",sle="var",ile="var(",U8="${}",ole=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function sp(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(ole,l=>(In.test(l)?(r.color.push(i),s.push(j8),n.push(In.parse(l))):l.startsWith(ile)?(r.var.push(i),s.push(sle),n.push(l)):(r.number.push(i),s.push(F8),n.push(parseFloat(l))),++i,U8)).split(U8);return{values:n,split:a,indexes:r,types:s}}function H8(t){return sp(t).values}function V8(t){const{split:e,types:n}=sp(t),r=e.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=e[o],s[o]!==void 0){const a=n[o];a===F8?i+=tp(s[o]):a===j8?i+=In.transform(s[o]):i+=s[o]}return i}}const ale=t=>typeof t=="number"?0:t;function lle(t){const e=H8(t);return V8(t)(e.map(ale))}const da={test:rle,parse:H8,createTransformer:V8,getAnimatableNone:lle},ule=new Set(["brightness","contrast","saturate","opacity"]);function cle(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(I2)||[];if(!r)return t;const s=n.replace(r,"");let i=ule.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const fle=/\b([a-z-]*)\(.*?\)/gu,ek={...da,getAnimatableNone:t=>{const e=t.match(fle);return e?e.map(cle).join(" "):t}},dle={...i8,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:ek,WebkitFilter:ek},tk=t=>dle[t];function z8(t,e){let n=tk(t);return n!==ek&&(n=da),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const hle=new Set(["auto","none","0"]);function ple(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!hle.has(i)&&sp(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=z8(n,s)}class $8 extends J2{constructor(e,n,r,s){super(e,n,r,s,s==null?void 0:s.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),P2(u))){const c=D8(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Jae.has(r)||e.length!==2)return;const[s,i]=e,o=P8(s),a=P8(i);if(o!==a)if(O8(o)&&O8(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)Wae(e[s])&&r.push(s);r.length&&ple(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qc[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=Qc[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function G8(t){let e;return()=>(e===void 0&&(e=t()),e)}const W8=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(da.test(t)||t==="0")&&!t.startsWith("url("));function mle(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function gle(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=W8(s,e),a=W8(i,e);return Kc(o===a,`You are trying to animate ${e} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:mle(t)||n==="spring"&&r}class K8{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&ele(),this._resolved}onKeyframesResolved(e,n){this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!gle(e,r,s,i))if(o)this.options.duration=0;else{l==null||l($y(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function q8(t,e){return e?t*(1e3/e):0}const yle=5;function Q8(t,e,n){const r=Math.max(e-yle,0);return q8(n-t(r),e-r)}const nk=.001,ble=.01,J8=10,wle=.05,Ale=1;function vle({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,i;Kc(t<=no(J8),"Spring duration must be 10 seconds or less");let o=1-e;o=la(wle,Ale,o),t=la(ble,J8,ro(t)),o<1?(s=u=>{const c=u*o,f=c*t,d=c-n,h=rk(u,o),p=Math.exp(-f);return nk-d/h*p},i=u=>{const f=u*o*t,d=f*n+n,h=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-f),m=rk(Math.pow(u,2),o);return(-s(u)+nk>0?-1:1)*((d-h)*p)/m}):(s=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-nk+c*f},i=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=kle(s,i,a);if(t=no(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const xle=12;function kle(t,e,n){let r=n;for(let s=1;s<xle;s++)r=r-t(r)/e(r);return r}function rk(t,e){return t*Math.sqrt(1-e*e)}const Cle=["duration","bounce"],Ele=["stiffness","damping","mass"];function Y8(t,e){return e.some(n=>t[n]!==void 0)}function Sle(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Y8(t,Ele)&&Y8(t,Cle)){const n=vle(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function X8({keyframes:t,restDelta:e,restSpeed:n,...r}){const s=t[0],i=t[t.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:u,duration:c,velocity:f,isResolvedFromDuration:d}=Sle({...r,velocity:-ro(r.velocity||0)}),h=f||0,p=l/(2*Math.sqrt(a*u)),m=i-s,g=ro(Math.sqrt(a/u)),y=Math.abs(m)<5;n||(n=y?.01:2),e||(e=y?.005:.5);let v;if(p<1){const A=rk(g,p);v=w=>{const x=Math.exp(-p*g*w);return i-x*((h+p*g*m)/A*Math.sin(A*w)+m*Math.cos(A*w))}}else if(p===1)v=A=>i-Math.exp(-g*A)*(m+(h+g*m)*A);else{const A=g*Math.sqrt(p*p-1);v=w=>{const x=Math.exp(-p*g*w),k=Math.min(A*w,300);return i-x*((h+p*g*m)*Math.sinh(k)+A*m*Math.cosh(k))/A}}return{calculatedDuration:d&&c||null,next:A=>{const w=v(A);if(d)o.done=A>=c;else{let x=h;A!==0&&(p<1?x=Q8(v,A,w):x=0);const k=Math.abs(x)<=n,E=Math.abs(i-w)<=e;o.done=k&&E}return o.value=o.done?i:w,o}}}function Z8({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},h=O=>a!==void 0&&O<a||l!==void 0&&O>l,p=O=>a===void 0?l:l===void 0||Math.abs(a-O)<Math.abs(l-O)?a:l;let m=n*e;const g=f+m,y=o===void 0?g:o(g);y!==g&&(m=y-f);const v=O=>-m*Math.exp(-O/r),A=O=>y+v(O),w=O=>{const M=v(O),D=A(O);d.done=Math.abs(M)<=u,d.value=d.done?y:D};let x,k;const E=O=>{h(d.value)&&(x=O,k=X8({keyframes:[d.value,p(d.value)],velocity:Q8(A,O,d.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:O=>{let M=!1;return!k&&x===void 0&&(M=!0,w(O),E(O)),x!==void 0&&O>=x?k.next(O-x):(!M&&w(O),d)}}}const eI=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Tle=1e-7,Dle=12;function Ole(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=eI(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>Tle&&++a<Dle);return o}function ip(t,e,n,r){if(t===e&&n===r)return Sn;const s=i=>Ole(i,0,1,t,n);return i=>i===0||i===1?i:eI(s(i),e,r)}const Mle=ip(.42,0,1,1),Nle=ip(0,0,.58,1),tI=ip(.42,0,.58,1),_le=t=>Array.isArray(t)&&typeof t[0]!="number",nI=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,rI=t=>e=>1-t(1-e),sk=t=>1-Math.sin(Math.acos(t)),sI=rI(sk),Rle=nI(sk),iI=ip(.33,1.53,.69,.99),ik=rI(iI),Ple=nI(ik),oI={linear:Sn,easeIn:Mle,easeInOut:tI,easeOut:Nle,circIn:sk,circInOut:Rle,circOut:sI,backIn:ik,backInOut:Ple,backOut:iI,anticipate:t=>(t*=2)<1?.5*ik(t):.5*(2-Math.pow(2,-10*(t-1)))},aI=t=>{if(Array.isArray(t)){Yi(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,s]=t;return ip(e,n,r,s)}else if(typeof t=="string")return Yi(oI[t]!==void 0,`Invalid easing type '${t}'`),oI[t];return t},op=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},Bt=(t,e,n)=>t+(e-t)*n;function ok(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ile({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=ok(l,a,t+1/3),i=ok(l,a,t),o=ok(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Wy(t,e){return n=>n>0?e:t}const ak=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},Lle=[Z2,jl,Jc],Ble=t=>Lle.find(e=>e.test(t));function lI(t){const e=Ble(t);if(Kc(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Jc&&(n=Ile(n)),n}const uI=(t,e)=>{const n=lI(t),r=lI(e);if(!n||!r)return Wy(t,e);const s={...n};return i=>(s.red=ak(n.red,r.red,i),s.green=ak(n.green,r.green,i),s.blue=ak(n.blue,r.blue,i),s.alpha=Bt(n.alpha,r.alpha,i),jl.transform(s))},lk=new Set(["none","hidden"]);function Fle(t,e){return lk.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function jle(t,e){return n=>Bt(t,e,n)}function uk(t){return typeof t=="number"?jle:typeof t=="string"?P2(t)?Wy:In.test(t)?uI:Vle:Array.isArray(t)?cI:typeof t=="object"?In.test(t)?uI:Ule:Wy}function cI(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>uk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function Ule(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=uk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function Hle(t,e){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],a=t.indexes[o][s[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const Vle=(t,e)=>{const n=da.createTransformer(e),r=sp(t),s=sp(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?lk.has(t)&&!s.values.length||lk.has(e)&&!r.values.length?Fle(t,e):to(cI(Hle(r,s),s.values),n):(Kc(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Wy(t,e))};function fI(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Bt(t,e,n):uk(t)(t,e)}function zle(t,e,n){const r=[],s=n||fI,i=t.length-1;for(let o=0;o<i;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||Sn:e;a=to(l,a)}r.push(a)}return r}function $le(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Yi(i===e.length,"Both input and output ranges must be the same length"),i===1)return()=>e[0];if(i===2&&t[0]===t[1])return()=>e[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=zle(e,r,s),a=o.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const f=op(t[c],t[c+1],u);return o[c](f)};return n?u=>l(la(t[0],t[i-1],u)):l}function Gle(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=op(0,e,r);t.push(Bt(n,1,s))}}function Wle(t){const e=[0];return Gle(e,t.length-1),e}function Kle(t,e){return t.map(n=>n*e)}function qle(t,e){return t.map(()=>e||tI).splice(0,t.length-1)}function Ky({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=_le(r)?r.map(aI):aI(r),i={done:!1,value:e[0]},o=Kle(n&&n.length===e.length?n:Wle(e),t),a=$le(o,e,{ease:Array.isArray(s)?s:qle(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const dI=2e4;function Qle(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<dI;)e+=n,r=t.next(e);return e>=dI?1/0:e}const Jle=t=>{const e=({timestamp:n})=>t(n);return{start:()=>pt.update(e,!0),stop:()=>Xi(e),now:()=>Tn.isProcessing?Tn.timestamp:fa.now()}},Yle={decay:Z8,inertia:Z8,tween:Ky,keyframes:Ky,spring:X8},Xle=t=>t/100;class ck extends K8{constructor({KeyframeResolver:e=J2,...n}){super(n),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:a}=this.options;a&&a()};const{name:r,motionValue:s,keyframes:i}=this.options,o=(a,l)=>this.onKeyframesResolved(a,l);r&&s&&s.owner?this.resolver=s.owner.resolveKeyframes(i,o,r,s):this.resolver=new e(i,o,r,s),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=Yle[n]||Ky;let l,u;a!==Ky&&typeof e[0]!="number"&&(process.env.NODE_ENV!=="production"&&Yi(e.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),l=to(Xle,fI(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});i==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Qle(c));const{calculatedDuration:f}=c,d=f+s,h=d*(r+1)-s;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:d,totalDuration:h}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:d,repeat:h,repeatType:p,repeatDelay:m,onUpdate:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?y<0:y>c;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let A=this.currentTime,w=i;if(h){const O=Math.min(this.currentTime,c)/f;let M=Math.floor(O),D=O%1;!D&&O>=1&&(D=1),D===1&&M--,M=Math.min(M,h+1),!!(M%2)&&(p==="reverse"?(D=1-D,m&&(D-=m/f)):p==="mirror"&&(w=o)),A=la(0,1,D)*f}const x=v?{done:!1,value:l[0]}:w.next(A);a&&(x.value=a(x.value));let{done:k}=x;!v&&u!==null&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return E&&s!==void 0&&(x.value=$y(l,this.options,s)),g&&g(x.value),E&&this.finish(),x}get duration(){const{resolved:e}=this;return e?ro(e.calculatedDuration):0}get time(){return ro(this.currentTime)}set time(e){e=no(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=ro(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Jle,onPlay:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=r),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const hI=t=>Array.isArray(t)&&typeof t[0]=="number";function pI(t){return!!(!t||typeof t=="string"&&t in fk||hI(t)||Array.isArray(t)&&t.every(pI))}const ap=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,fk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ap([0,.65,.55,1]),circOut:ap([.55,0,1,.45]),backIn:ap([.31,.01,.66,-.59]),backOut:ap([.33,1.53,.69,.99])};function Zle(t){return mI(t)||fk.easeOut}function mI(t){if(t)return hI(t)?ap(t):Array.isArray(t)?t.map(Zle):fk[t]}function eue(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=mI(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const tue=G8(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),nue=new Set(["opacity","clipPath","filter","transform"]),qy=10,rue=2e4;function sue(t){return t.type==="spring"||t.name==="backgroundColor"||!pI(t.ease)}function iue(t,e){const n=new ck({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const s=[];let i=0;for(;!r.done&&i<rue;)r=n.sample(i),s.push(r.value),i+=qy;return{times:void 0,keyframes:s,duration:i-qy,ease:"linear"}}class gI extends K8{constructor(e){super(e);const{name:n,motionValue:r,keyframes:s}=this.options;this.resolver=new $8(s,(i,o)=>this.onKeyframesResolved(i,o),n,r),this.resolver.scheduleResolve()}initPlayback(e,n){var r;let{duration:s=300,times:i,ease:o,type:a,motionValue:l,name:u}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(sue(this.options)){const{onComplete:f,onUpdate:d,motionValue:h,...p}=this.options,m=iue(e,p);e=m.keyframes,e.length===1&&(e[1]=e[0]),s=m.duration,i=m.times,o=m.ease,a="keyframes"}const c=eue(l.owner.current,u,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=fa.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;l.set($y(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:i,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return ro(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return ro(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=no(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return Sn;const{animation:r}=n;r.timeline=e,r.onfinish=null}return Sn}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=e;if(!(n.playState==="idle"||n.playState==="finished")){if(this.time){const{motionValue:l,onUpdate:u,onComplete:c,...f}=this.options,d=new ck({...f,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),h=no(this.time);l.setWithVelocity(d.sample(h-qy).value,d.sample(h).value,qy)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=e;return tue()&&r&&nue.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}function oue(t,e){let n;const r=()=>{const{currentTime:s}=e,o=(s===null?0:s.value)/100;n!==o&&t(o),n=o};return pt.update(r,!0),()=>Xi(r)}const aue=G8(()=>window.ScrollTimeline!==void 0);class lue{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e){const n=this.animations.map(r=>{if(aue()&&r.attachTimeline)r.attachTimeline(e);else return r.pause(),oue(s=>{r.time=r.duration*s},e)});return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const dk=(t,e,n,r={},s,i)=>o=>{const a=K2(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-no(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};zae(a)||(c={...c,...Vae(t,c)}),c.duration&&(c.duration=no(c.duration)),c.repeatDelay&&(c.repeatDelay=no(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),f&&!i&&e.get()!==void 0){const d=$y(c.keyframes,a);if(d!==void 0)return pt.update(()=>{c.onUpdate(d),c.onComplete()}),new lue([])}return!i&&gI.supports(c)?new gI(c):new ck(c)};function Qy(t){return!!(Pn(t)&&t.add)}function hk(t,e){t.indexOf(e)===-1&&t.push(e)}function pk(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class mk{constructor(){this.subscriptions=[]}add(e){return hk(this.subscriptions,e),()=>pk(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const yI=new Set;function gk(t,e,n){t||yI.has(e)||(console.warn(e),yI.add(e))}const bI=30,uue=t=>!isNaN(parseFloat(t));class cue{constructor(e,n={}){this.version="11.2.12",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=fa.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=fa.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uue(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&gk(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new mk);const r=this.events[e].add(n);return e==="change"?()=>{r(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=fa.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>bI)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,bI);return q8(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function lp(t,e){return new cue(t,e)}function fue(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,lp(n))}function due(t,e){const n=zy(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=wae(i[o]);fue(t,o,a)}}function wI(t){return t.getProps()[GP]}function hue({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function AI(t,e,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;const u=t.getValue("willChange");r&&(o=r);const c=[],f=s&&t.animationState&&t.animationState.getState()[s];for(const d in l){const h=t.getValue(d,(i=t.latestValues[d])!==null&&i!==void 0?i:null),p=l[d];if(p===void 0||f&&hue(f,d))continue;const m={delay:n,elapsed:0,...K2(o||{},d)};let g=!1;if(window.HandoffAppearAnimations){const v=wI(t);if(v){const A=window.HandoffAppearAnimations(v,d,h,pt);A!==null&&(m.elapsed=A,g=!0)}}h.start(dk(d,h,p,t.shouldReduceMotion&&Bl.has(d)?{type:!1}:m,t,g));const y=h.animation;y&&(Qy(u)&&(u.add(d),y.then(()=>u.remove(d))),c.push(y))}return a&&Promise.all(c).then(()=>{pt.update(()=>{a&&due(t,a)})}),c}function yk(t,e,n={}){var r;const s=zy(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(AI(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:d}=i;return pue(t,e,c+u,f,d,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function pue(t,e,n=0,r=0,s=1,i){const o=[],a=(t.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(t.variantChildren).sort(mue).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(yk(u,e,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function mue(t,e){return t.sortNodePosition(e)}function gue(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>yk(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=yk(t,e,n);else{const s=typeof e=="function"?zy(t,e,n.custom):e;r=Promise.all(AI(t,s,n))}return r.then(()=>{pt.postRender(()=>{t.notify("AnimationComplete",e)})})}const yue=[...M2].reverse(),bue=M2.length;function wue(t){return e=>Promise.all(e.map(({animation:n,options:r})=>gue(t,n,r)))}function Aue(t){let e=wue(t),n=vI(),r=!0;const s=l=>(u,c)=>{var f;const d=zy(t,c,l==="exit"?(f=t.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:p,...m}=d;u={...u,...m,...p}}return u};function i(l){e=l(t)}function o(l){const u=t.getProps(),c=t.getVariantContext(!0)||{},f=[],d=new Set;let h={},p=1/0;for(let g=0;g<bue;g++){const y=yue[g],v=n[y],A=u[y]!==void 0?u[y]:c[y],w=Xh(A),x=y===l?v.isActive:null;x===!1&&(p=g);let k=A===c[y]&&A!==u[y]&&w;if(k&&r&&t.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...h},!v.isActive&&x===null||!A&&!v.prevProp||Ly(A)||typeof A=="boolean")continue;let O=vue(v.prevProp,A)||y===l&&v.isActive&&!k&&w||g>p&&w,M=!1;const D=Array.isArray(A)?A:[A];let R=D.reduce(s(y),{});x===!1&&(R={});const{prevResolvedValues:B={}}=v,F={...B,...R},V=L=>{O=!0,d.has(L)&&(M=!0,d.delete(L)),v.needsAnimating[L]=!0;const H=t.getValue(L);H&&(H.liveStyle=!1)};for(const L in F){const H=R[L],q=B[L];if(h.hasOwnProperty(L))continue;let te=!1;V2(H)&&V2(q)?te=!E8(H,q):te=H!==q,te?H!=null?V(L):d.add(L):H!==void 0&&d.has(L)?V(L):v.protectedKeys[L]=!0}v.prevProp=A,v.prevResolvedValues=R,v.isActive&&(h={...h,...R}),r&&t.blockInitialAnimation&&(O=!1),O&&(!k||M)&&f.push(...D.map(L=>({animation:L,options:{type:y}})))}if(d.size){const g={};d.forEach(y=>{const v=t.getBaseTarget(y),A=t.getValue(y);A&&(A.liveStyle=!0),g[y]=v??null}),f.push({animation:g})}let m=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),r=!1,m?e(f):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(d=>{var h;return(h=d.animationState)===null||h===void 0?void 0:h.setActive(l,u)}),n[l].isActive=u;const f=o(l);for(const d in n)n[d].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=vI(),r=!0}}}function vue(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!E8(e,t):!1}function Ul(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vI(){return{animate:Ul(!0),whileInView:Ul(),whileHover:Ul(),whileTap:Ul(),whileDrag:Ul(),whileFocus:Ul(),exit:Ul()}}class xue extends ca{constructor(e){super(e),e.animationState||(e.animationState=Aue(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ly(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let kue=0;class Cue extends ca{constructor(){super(...arguments),this.id=kue++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Eue={animation:{Feature:xue},exit:{Feature:Cue}},xI=(t,e)=>Math.abs(t-e);function Sue(t,e){const n=xI(t.x,e.x),r=xI(t.y,e.y);return Math.sqrt(n**2+r**2)}class kI{constructor(e,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=wk(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=Sue(f.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:p}=f,{timestamp:m}=Tn;this.history.push({...p,timestamp:m});const{onStart:g,onMove:y}=this.handlers;d||(g&&g(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,d)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=bk(d,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(f,d)=>{this.end();const{onEnd:h,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=wk(f.type==="pointercancel"?this.lastMoveEventInfo:bk(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,g),p&&p(f,g)},!y8(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Vy(e),a=bk(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=Tn;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,wk(a,this.history)),this.removeListeners=to(eo(this.contextWindow,"pointermove",this.handlePointerMove),eo(this.contextWindow,"pointerup",this.handlePointerUp),eo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Xi(this.updatePoint)}}function bk(t,e){return e?{point:e(t.point)}:t}function CI(t,e){return{x:t.x-e.x,y:t.y-e.y}}function wk({point:t},e){return{point:t,delta:CI(t,EI(e)),offset:CI(t,Tue(e)),velocity:Due(e,.1)}}function Tue(t){return t[0]}function EI(t){return t[t.length-1]}function Due(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=EI(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>no(e)));)n--;if(!r)return{x:0,y:0};const i=ro(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Pr(t){return t.max-t.min}function Ak(t,e=0,n=.01){return Math.abs(t-e)<=n}function SI(t,e,n,r=.5){t.origin=r,t.originPoint=Bt(e.min,e.max,t.origin),t.scale=Pr(n)/Pr(e),(Ak(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Bt(n.min,n.max,t.origin)-t.originPoint,(Ak(t.translate)||isNaN(t.translate))&&(t.translate=0)}function up(t,e,n,r){SI(t.x,e.x,n.x,r?r.originX:void 0),SI(t.y,e.y,n.y,r?r.originY:void 0)}function TI(t,e,n){t.min=n.min+e.min,t.max=t.min+Pr(e)}function Oue(t,e,n){TI(t.x,e.x,n.x),TI(t.y,e.y,n.y)}function DI(t,e,n){t.min=e.min-n.min,t.max=t.min+Pr(e)}function cp(t,e,n){DI(t.x,e.x,n.x),DI(t.y,e.y,n.y)}function Mue(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Bt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Bt(n,t,r.max):Math.min(t,n)),t}function OI(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Nue(t,{top:e,left:n,bottom:r,right:s}){return{x:OI(t.x,n,s),y:OI(t.y,e,r)}}function MI(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function _ue(t,e){return{x:MI(t.x,e.x),y:MI(t.y,e.y)}}function Rue(t,e){let n=.5;const r=Pr(t),s=Pr(e);return s>r?n=op(e.min,e.max-r,t.min):r>s&&(n=op(t.min,t.max-s,e.min)),la(0,1,n)}function Pue(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const vk=.35;function Iue(t=vk){return t===!1?t=0:t===!0&&(t=vk),{x:NI(t,"left","right"),y:NI(t,"top","bottom")}}function NI(t,e,n){return{min:_I(t,e),max:_I(t,n)}}function _I(t,e){return typeof t=="number"?t:t[e]||0}const RI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yc=()=>({x:RI(),y:RI()}),PI=()=>({min:0,max:0}),qt=()=>({x:PI(),y:PI()});function es(t){return[t("x"),t("y")]}function II({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Lue({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Bue(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function xk(t){return t===void 0||t===1}function kk({scale:t,scaleX:e,scaleY:n}){return!xk(t)||!xk(e)||!xk(n)}function Hl(t){return kk(t)||LI(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function LI(t){return BI(t.x)||BI(t.y)}function BI(t){return t&&t!=="0%"}function Jy(t,e,n){const r=t-n,s=e*r;return n+s}function FI(t,e,n,r,s){return s!==void 0&&(t=Jy(t,s,r)),Jy(t,n,r)+e}function Ck(t,e=0,n=1,r,s){t.min=FI(t.min,e,n,r,s),t.max=FI(t.max,e,n,r,s)}function jI(t,{x:e,y:n}){Ck(t.x,e.translate,e.scale,e.originPoint),Ck(t.y,n.translate,n.scale,n.originPoint)}function Fue(t,e,n,r=!1){const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const l=i.instance;l&&l.style&&l.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Xc(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,jI(t,o)),r&&Hl(i.latestValues)&&Xc(t,i.latestValues))}e.x=UI(e.x),e.y=UI(e.y)}function UI(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function ha(t,e){t.min=t.min+e,t.max=t.max+e}function HI(t,e,[n,r,s]){const i=e[s]!==void 0?e[s]:.5,o=Bt(t.min,t.max,i);Ck(t,e[n],e[r],o,e.scale)}const jue=["x","scaleX","originX"],Uue=["y","scaleY","originY"];function Xc(t,e){HI(t.x,e,jue),HI(t.y,e,Uue)}function VI(t,e){return II(Bue(t.getBoundingClientRect(),e))}function Hue(t,e,n){const r=VI(t,n),{scroll:s}=e;return s&&(ha(r.x,s.offset.x),ha(r.y,s.offset.y)),r}const zI=({current:t})=>t?t.ownerDocument.defaultView:null,Vue=new WeakMap;class zue{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=qt(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Vy(c,"page").point)},i=(c,f)=>{const{drag:d,dragPropagation:h,onDragStart:p}=this.getProps();if(d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=v8(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),es(g=>{let y=this.getAxisMotionValue(g).get()||0;if(hi.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const A=v.layout.layoutBox[g];A&&(y=Pr(A)*(parseFloat(y)/100))}}this.originPoint[g]=y}),p&&pt.postRender(()=>p(c,f));const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(c,f)=>{const{dragPropagation:d,dragDirectionLock:h,onDirectionLock:p,onDrag:m}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:g}=f;if(h&&this.currentDirection===null){this.currentDirection=$ue(g),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),m&&m(c,f)},a=(c,f)=>this.stop(c,f),l=()=>es(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new kI(e,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:zI(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&pt.postRender(()=>i(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!Yy(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Mue(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,i=this.constraints;n&&Gc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=Nue(s.layoutBox,n):this.constraints=!1,this.elastic=Iue(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Pue(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Gc(e))return!1;const r=e.current;Yi(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Hue(r,s.root,this.visualElement.getTransformPagePoint());let o=_ue(s.layout.layoutBox,i);if(n){const a=n(Lue(o));this.hasMutatedConstraints=!!a,a&&(o=II(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=es(c=>{if(!Yy(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const d=s?200:1e6,h=s?40:1e7,p={type:"inertia",velocity:r?e[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return r.start(dk(e,r,0,n,this.visualElement))}stopAnimation(){es(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){es(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){es(n=>{const{drag:r}=this.getProps();if(!Yy(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(e[n]-Bt(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Gc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};es(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=Rue({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),es(o=>{if(!Yy(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Bt(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Vue.set(this.visualElement,this);const e=this.visualElement.current,n=eo(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Gc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pt.read(r);const o=Zi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(es(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=vk,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Yy(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function $ue(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Gue extends ca{constructor(e){super(e),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new zue(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const $I=t=>(e,n)=>{t&&pt.postRender(()=>t(e,n))};class Wue extends ca{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(e){this.session=new kI(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zI(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:$I(e),onStart:$I(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&pt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=eo(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Kue(){const t=_.useContext(Py);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,s=_.useId();return _.useEffect(()=>r(s),[]),!e&&n?[!1,()=>n&&n(s)]:[!0]}const Xy={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function GI(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fp={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ie.test(t))t=parseFloat(t);else return t;const n=GI(t,e.target.x),r=GI(t,e.target.y);return`${n}% ${r}%`}},que={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=da.parse(t);if(s.length>5)return r;const i=da.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=Bt(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};class Que extends _.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;Qoe(Jue),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Xy.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||pt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),O2.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function WI(t){const[e,n]=Kue(),r=_.useContext(_2);return S.jsx(Que,{...t,layoutGroup:r,switchLayoutGroup:_.useContext(qP),isPresent:e,safeToRemove:n})}const Jue={borderRadius:{...fp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fp,borderTopRightRadius:fp,borderBottomLeftRadius:fp,borderBottomRightRadius:fp,boxShadow:que},KI=["TopLeft","TopRight","BottomLeft","BottomRight"],Yue=KI.length,qI=t=>typeof t=="string"?parseFloat(t):t,QI=t=>typeof t=="number"||Ie.test(t);function Xue(t,e,n,r,s,i){s?(t.opacity=Bt(0,n.opacity!==void 0?n.opacity:1,Zue(r)),t.opacityExit=Bt(e.opacity!==void 0?e.opacity:1,0,ece(r))):i&&(t.opacity=Bt(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Yue;o++){const a=`border${KI[o]}Radius`;let l=JI(e,a),u=JI(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||QI(l)===QI(u)?(t[a]=Math.max(Bt(qI(l),qI(u),r),0),(hi.test(u)||hi.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=Bt(e.rotate||0,n.rotate||0,r))}function JI(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Zue=YI(0,.5,sI),ece=YI(.5,.95,Sn);function YI(t,e,n){return r=>r<t?0:r>e?1:n(op(t,e,r))}function XI(t,e){t.min=e.min,t.max=e.max}function ts(t,e){XI(t.x,e.x),XI(t.y,e.y)}function ZI(t,e,n,r,s){return t-=e,t=Jy(t,1/n,r),s!==void 0&&(t=Jy(t,1/s,r)),t}function tce(t,e=0,n=1,r=.5,s,i=t,o=t){if(hi.test(e)&&(e=parseFloat(e),e=Bt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Bt(i.min,i.max,r);t===i&&(a-=e),t.min=ZI(t.min,e,n,a,s),t.max=ZI(t.max,e,n,a,s)}function eL(t,e,[n,r,s],i,o){tce(t,e[n],e[r],e[s],e.scale,i,o)}const nce=["x","scaleX","originX"],rce=["y","scaleY","originY"];function tL(t,e,n,r){eL(t.x,e,nce,n?n.x:void 0,r?r.x:void 0),eL(t.y,e,rce,n?n.y:void 0,r?r.y:void 0)}function nL(t){return t.translate===0&&t.scale===1}function rL(t){return nL(t.x)&&nL(t.y)}function sce(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function sL(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function iL(t){return Pr(t.x)/Pr(t.y)}class ice{constructor(){this.members=[]}add(e){hk(this.members,e),e.scheduleRender()}remove(e){if(pk(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function oL(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:d,skewX:h,skewY:p}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const oce=(t,e)=>t.depth-e.depth;class ace{constructor(){this.children=[],this.isDirty=!1}add(e){hk(this.children,e),this.isDirty=!0}remove(e){pk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(oce),this.isDirty=!1,this.children.forEach(e)}}function lce(t,e){const n=fa.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Xi(r),t(i-e))};return pt.read(r,!0),()=>Xi(r)}function uce(t){window.MotionDebug&&window.MotionDebug.record(t)}function cce(t){return t instanceof SVGElement&&t.tagName!=="svg"}function fce(t,e,n){const r=Pn(t)?t:lp(t);return r.start(dk("",r,e,n)),r.animation}const Ek=["","X","Y","Z"],dce={visibility:"hidden"},aL=1e3;let hce=0;const Vl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Sk(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function lL(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;const{visualElement:e}=t.options;return e?wI(e)?!0:t.parent&&!t.parent.hasCheckedOptimisedAppear?lL(t.parent):!1:!1}function uL({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=hce++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Vl.totalNodes=Vl.resolvedTargetDeltas=Vl.recalculatedProjection=0,this.nodes.forEach(gce),this.nodes.forEach(vce),this.nodes.forEach(xce),this.nodes.forEach(yce),uce(Vl)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new ace)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new mk),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=cce(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let f;const d=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=lce(d,250),Xy.hasAnimatedSinceResize&&(Xy.hasAnimatedSinceResize=!1,this.nodes.forEach(fL))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Tce,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!sL(this.targetLayout,p)||h,A=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,A);const w={...K2(m,"layout"),onPlay:g,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else d||fL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Xi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(kce),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.HandoffCancelAllAnimations&&lL(this)&&window.HandoffCancelAllAnimations(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(cL);return}this.isUpdating||this.nodes.forEach(wce),this.isUpdating=!1,this.nodes.forEach(Ace),this.nodes.forEach(pce),this.nodes.forEach(mce),this.clearAllSnapshots();const a=fa.now();Tn.delta=la(0,1e3/60,a-Tn.timestamp),Tn.timestamp=a,Tn.isProcessing=!0,z2.update.process(Tn),z2.preRender.process(Tn),z2.render.process(Tn),Tn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,O2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(bce),this.sharedNodes.forEach(Cce)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=qt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:o,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!rL(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Hl(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Dce(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return qt();const a=o.measureViewportBox(),{scroll:l}=this.root;return l&&(ha(a.x,l.offset.x),ha(a.y,l.offset.y)),a}removeElementScroll(o){const a=qt();ts(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:f}=u;if(u!==this.root&&c&&f.layoutScroll){if(c.isRoot){ts(a,o);const{scroll:d}=this.root;d&&(ha(a.x,-d.offset.x),ha(a.y,-d.offset.y))}ha(a.x,c.offset.x),ha(a.y,c.offset.y)}}return a}applyTransform(o,a=!1){const l=qt();ts(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Xc(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Hl(c.latestValues)&&Xc(l,c.latestValues)}return Hl(this.latestValues)&&Xc(l,this.latestValues),l}removeTransform(o){const a=qt();ts(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Hl(u.latestValues))continue;kk(u.latestValues)&&u.updateSnapshot();const c=qt(),f=u.measurePageBox();ts(c,f),tL(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Hl(this.latestValues)&&tL(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Tn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:f,layoutId:d}=this.options;if(!(!this.layout||!(f||d))){if(this.resolvedRelativeTargetAt=Tn.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),cp(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),ts(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=qt(),this.targetWithTransforms=qt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Oue(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ts(this.target,this.layout.layoutBox),jI(this.target,this.targetDelta)):ts(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),cp(this.relativeTargetOrigin,this.target,h.target),ts(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Vl.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||kk(this.parent.latestValues)||LI(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Tn.timestamp&&(u=!1),u)return;const{layout:c,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||f))return;ts(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;Fue(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=qt());const{target:p}=a;if(!p){this.projectionTransform&&(this.projectionDelta=Yc(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Yc(),this.projectionDeltaWithTransform=Yc());const m=this.projectionTransform;up(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=oL(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==d||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Vl.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=Yc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=qt(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,g=this.getStack(),y=!g||g.members.length<=1,v=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(Sce));this.animationProgress=0;let A;this.mixTargetDelta=w=>{const x=w/1e3;dL(f.x,o.x,x),dL(f.y,o.y,x),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cp(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ece(this.relativeTarget,this.relativeTargetOrigin,d,x),A&&sce(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=qt()),ts(A,this.relativeTarget)),m&&(this.animationValues=c,Xue(c,u,this.latestValues,x,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Xi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{Xy.hasAnimatedSinceResize=!0,this.currentAnimation=fce(0,aL,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(aL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&yL(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||qt();const f=Pr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const d=Pr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}ts(a,l),Xc(a,c),up(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ice),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Sk("z",o,u,this.animationValues);for(let c=0;c<Ek.length;c++)Sk(`rotate${Ek[c]}`,o,u,this.animationValues),Sk(`skew${Ek[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return dce;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Hy(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Hy(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Hl(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=oL(this.projectionDeltaWithTransform,this.treeScale,d),c&&(u.transform=c(d,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=d.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:u.opacity=f===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in Fy){if(d[m]===void 0)continue;const{correct:g,applyTo:y}=Fy[m],v=u.transform==="none"?d[m]:g(d[m],f);if(y){const A=y.length;for(let w=0;w<A;w++)u[y[w]]=v}else u[m]=v}return this.options.layoutId&&(u.pointerEvents=f===this?Hy(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(cL),this.root.sharedNodes.clear()}}}function pce(t){t.updateLayout()}function mce(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;i==="size"?es(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Pr(d);d.min=r[f].min,d.max=d.min+h}):yL(i,n.layoutBox,r)&&es(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Pr(r[f]);d.max=d.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+h)});const a=Yc();up(a,r,n.layoutBox);const l=Yc();o?up(l,t.applyTransform(s,!0),n.measuredBox):up(l,r,n.layoutBox);const u=!rL(a);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=qt();cp(p,n.layoutBox,d.layoutBox);const m=qt();cp(m,r,h.layoutBox),sL(p,m)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function gce(t){Vl.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function yce(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function bce(t){t.clearSnapshot()}function cL(t){t.clearMeasurements()}function wce(t){t.isLayoutDirty=!1}function Ace(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function fL(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function vce(t){t.resolveTargetDelta()}function xce(t){t.calcProjection()}function kce(t){t.resetSkewAndRotation()}function Cce(t){t.removeLeadSnapshot()}function dL(t,e,n){t.translate=Bt(e.translate,0,n),t.scale=Bt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function hL(t,e,n,r){t.min=Bt(e.min,n.min,r),t.max=Bt(e.max,n.max,r)}function Ece(t,e,n,r){hL(t.x,e.x,n.x,r),hL(t.y,e.y,n.y,r)}function Sce(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Tce={duration:.45,ease:[.4,0,.1,1]},pL=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),mL=pL("applewebkit/")&&!pL("chrome/")?Math.round:Sn;function gL(t){t.min=mL(t.min),t.max=mL(t.max)}function Dce(t){gL(t.x),gL(t.y)}function yL(t,e,n){return t==="position"||t==="preserve-aspect"&&!Ak(iL(e),iL(n),.2)}const Oce=uL({attachResizeListener:(t,e)=>Zi(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Tk={current:void 0},bL=uL({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Tk.current){const t=new Oce({});t.mount(window),t.setOptions({layoutScroll:!0}),Tk.current=t}return Tk.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Mce={pan:{Feature:Wue},drag:{Feature:Gue,ProjectionNode:bL,MeasureLayout:WI}},Dk={current:null},wL={current:!1};function Nce(){if(wL.current=!0,!!S2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Dk.current=t.matches;t.addListener(e),e()}else Dk.current=!1}function _ce(t,e,n){const{willChange:r}=e;for(const s in e){const i=e[s],o=n[s];if(Pn(i))t.addValue(s,i),Qy(r)&&r.add(s),process.env.NODE_ENV==="development"&&gk(i.version==="11.2.12",`Attempting to mix Framer Motion versions ${i.version} with 11.2.12 may not work as expected.`);else if(Pn(o))t.addValue(s,lp(i,{owner:t})),Qy(r)&&r.remove(s);else if(o!==i)if(t.hasValue(s)){const a=t.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(s);t.addValue(s,lp(a!==void 0?a:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const AL=new WeakMap,Rce=[...R8,In,da],Pce=t=>Rce.find(_8(t)),vL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ice=N2.length;class Lce{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.resolveKeyframes=(d,h,p,m)=>new this.KeyframeResolver(d,h,p,m,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=J2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>pt.render(this.render,!1,!0);const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=By(n),this.isVariantNode=YP(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&Pn(h)&&(h.set(l[d],!1),Qy(c)&&c.add(d))}}mount(e){this.current=e,AL.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),wL.current||Nce(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Dk.current,process.env.NODE_ENV!=="production"&&gk(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){AL.delete(this.current),this.projection&&this.projection.unmount(),Xi(this.notifyUpdate),Xi(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){const r=Bl.has(e),s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&pt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{s(),i(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Wc){const n=Wc[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<vL.length;r++){const s=vL[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=_ce(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<Ice;r++){const s=N2[r],i=this.props[s];(Xh(i)||i===!1)&&(n[s]=i)}return n}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=lp(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(T8(s)||S8(s))?s=parseFloat(s):!Pce(s)&&da.test(n)&&(s=z8(e,n)),this.setBaseTarget(e,Pn(s)?s.get():s)),Pn(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=H2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[e])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Pn(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new mk),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class xL extends Lce{constructor(){super(...arguments),this.KeyframeResolver=$8}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}}function Bce(t){return window.getComputedStyle(t)}class Fce extends xL{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(Bl.has(n)){const r=tk(n);return r&&r.default||0}else{const r=Bce(e),s=(n8(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return VI(e,n)}build(e,n,r,s){L2(e,n,r,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return U2(e,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Pn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,r,s){c8(e,n,r,s)}}class jce extends xL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Bl.has(n)){const r=tk(n);return r&&r.default||0}return n=f8.has(n)?n:D2(n),e.getAttribute(n)}measureInstanceViewportBox(){return qt()}scrapeMotionValuesFromProps(e,n,r){return h8(e,n,r)}build(e,n,r,s){F2(e,n,r,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,r,s){d8(e,n,r,s)}mount(e){this.isSVGTag=j2(e.tagName),super.mount(e)}}const Uce=(t,e)=>R2(t)?new jce(e,{enableHardwareAcceleration:!1}):new Fce(e,{allowProjection:t!==_.Fragment,enableHardwareAcceleration:!0}),Hce={...Eue,...Bae,...Mce,...{layout:{ProjectionNode:bL,MeasureLayout:WI}}},Vce=Koe((t,e)=>Cae(t,e,Hce,Uce));function kL(){const t=_.useRef(!1);return T2(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function zce(){const t=kL(),[e,n]=_.useState(0),r=_.useCallback(()=>{t.current&&n(e+1)},[e]);return[_.useCallback(()=>pt.postRender(r),[r]),e]}class $ce extends z.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Gce({children:t,isPresent:e}){const n=_.useId(),r=_.useRef(null),s=_.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=_.useContext(E2);return _.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:u}=s.current;if(e||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
484
484
|
[data-motion-pop-id="${n}"] {
|
485
485
|
position: absolute !important;
|
486
486
|
width: ${o}px !important;
|