@fileverse-dev/ddoc 1.6.8 → 1.6.9
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.umd.js
CHANGED
@@ -512,7 +512,7 @@ ${n.innerHTML}
|
|
512
512
|
`),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>")}}}}}}),e4=Ye.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?Vg.storage.markdown.serialize.call(this,t,e,n):`\\
|
513
513
|
`);return}},parse:{}}}}}),kte=Ye.create({name:"heading"}).extend({addStorage(){return{markdown:{serialize:li.nodes.heading,parse:{}}}}}),Ete=Ye.create({name:"horizontalRule"}).extend({addStorage(){return{markdown:{serialize:li.nodes.horizontal_rule,parse:{}}}}}),Cte=Ye.create({name:"image"}).extend({addStorage(){return{markdown:{serialize:li.nodes.image,parse:{}}}}}),Ste=Ye.create({name:"listItem"}).extend({addStorage(){return{markdown:{serialize:li.nodes.list_item,parse:{}}}}}),Tte=Ye.create({name:"orderedList"});function Dte(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const Ote=Tte.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=Dte(e,n,r)%2?") ":". ";t.renderList(e,o,u=>{const c=String(s+u);return t.repeat(" ",i-c.length)+c+l})},parse:{}}}}}),_te=Ye.create({name:"paragraph"}).extend({addStorage(){return{markdown:{serialize:li.nodes.paragraph,parse:{}}}}});function yx(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 Mte=Ye.create({name:"table"}).extend({addStorage(){return{markdown:{serialize(t,e,n){if(!Nte(e)){Vg.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 t4(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function Nte(t){const e=yx(t),n=e[0],r=e.slice(1);return!(yx(n).some(s=>s.type.name!=="tableHeader"||t4(s)||s.childCount>1)||r.some(s=>yx(s).some(i=>i.type.name==="tableHeader"||t4(i)||i.childCount>1)))}const Rte=Ye.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())})}}}}}}),Pte=Ye.create({name:"taskList"}).extend({addStorage(){return{markdown:{serialize:Z6.storage.markdown.serialize,parse:{setup(t){t.use(lte)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),Ite=Ye.create({name:"text"}).extend({addStorage(){return{markdown:{serialize(t,e){t.text(gte(e.text))},parse:{}}}}}),Lte=Yt.create({name:"bold"}).extend({addStorage(){return{markdown:{serialize:li.marks.strong,parse:{}}}}}),Bte=Yt.create({name:"code"}).extend({addStorage(){return{markdown:{serialize:li.marks.code,parse:{}}}}}),Fte=Yt.create({name:"italic"}).extend({addStorage(){return{markdown:{serialize:li.marks.em,parse:{}}}}}),jte=Yt.create({name:"link"}).extend({addStorage(){return{markdown:{serialize:li.marks.link,parse:{}}}}}),Ute=Yt.create({name:"strike"}).extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),Vte=[vte,Z6,xte,e4,kte,Ete,Vg,Cte,Ste,Ote,_te,Mte,Rte,Pte,Ite,Lte,Bte,Y6,Fte,jte,Ute];function Hg(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,s=(n=Vte.find(i=>i.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||s?{...s,...r}:null}class Hte{constructor(e){Ug(this,"editor",null),this.editor=e}serialize(e){const n=new mte(this.nodes,this.marks,{hardBreakNodeName:e4.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(Vg)])),...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(Y6)])),...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=Hg(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=Hg(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 zte{constructor(e,n){Ug(this,"editor",null),Ug(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=Hg(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=gx(r);return this.editor.extensionManager.extensions.forEach(i=>{var o;return(o=Hg(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")&&yte(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}bte(l),e.innerHTML=`${c}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=r=>function(){const s=r(...arguments);return s===`
|
514
514
|
`?s:s[s.length-1]===`
|
515
|
-
`?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 $te=wt.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new bt({key:new _t("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(gx(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),Gte=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=I7.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 zte(this.editor,this.options),serializer:new Hte(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[fte.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),$te.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),Wte=[_q,Dq.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}),fM.configure({depth:10,newGroupDelay:100}),Mq.configure({types:["heading","paragraph"]}),fQ,nQ.extend({exitable:!0}).configure({HTMLAttributes:{class:"text-blue-500 font-bold transition-colors cursor-pointer select-text pointer-events-auto"},openOnClick:!0,autolink:!1}),rQ.configure({placeholder:()=>"",includeChildren:!0,showOnlyCurrent:!0}),oQ.configure({multicolor:!0}),cQ.configure({HTMLAttributes:{class:"select-text pointer-events-auto"}}),Oq,pQ,aQ.configure({HTMLAttributes:{class:"not-prose space-y-4 !ml-0"}}),uQ.configure({HTMLAttributes:{class:"flex items-start"},nested:!0}),tM.configure({HTMLAttributes:{class:"space-y-4 !ml-6"}}),hM.configure({HTMLAttributes:{class:"leading-normal"}}),rM.configure({width:3,color:"#d1d5db"}),sM,KJ,cX,uX,...lX,kQ.configure({uploadFn:mV}),hQ,mQ,wQ,dX,dQ,Gte.configure({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!0,breaks:!0,transformPastedText:!0,transformCopiedText:!1})],Kte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAE/SURBVHgBhVJBTsJQEH3zMcElR+gRuIF6gwYPAOwkLoQTUE6ArEA3xbWJ4gnQE8gNwBuwhMR2fPNLk9o0ZZImM/P/e39e3wgqojPXXiPFJnFovw1kWT53xSKca3C70LXlr/eySYFdZ6Fb61eCePnBCb6VF3P21UA+WX+wv+086fgfyMbh4aPlqWJSZH2/k6EINlBEJI6tdxHG2tIDrsUqxYzsO5Qi+UXfNfwUPT7w49wRU1EyZWNFqIgV9REw84Wga+P1Uj7PsW5QE9pEZMT8Aq+JQmNcYl8HwgEtEvf9fc3RR4zrMCRe84WA6dJRz8upPwyftV0FOP3ugHqu0iZGzsSbF3bYUMRlgDdWMcyE4WvVl73XRC9CNiaqaHMDpkUQrYh8kmKUmy5lVpvdBNs2mOk0tptk9a5AVKHhzML+AZaSjR/r++n9AAAAAElFTkSuQmCC",qte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEjSURBVHgBjZJBToNQEIb/NzTeoMbGjTeoN5Au1S7wBrqwyk5OoD1B46pRF9UbsEBc9nmEHsI08QhGZnxMpaGUEv4EwoP/mxnyj0GNTp++AoPORA+Gx+mo91r1mOJh+LL0WYwDqC8i/obJGCuSfRJ1bHLdtWtQIaY5WoiYBknYtZQfmOGjpTIvC7TAahTvpMksmUQCvK0A6itzNl1egmi2k2K+2gPsD+mvHGkh4MIVoPuSLYbIYxOk3YAJVRuktwd3DhjvggqRB0Slc3D+/D1Lw95DE5Rnq3E487ySXeyu4zooz/R9tD/QUYV5Ufke1HbKvW4RdFS9icRoKeKO1c7Fi+HUbQ/BzzPdXjmxDCy8TOIk7G2CZf1nqzEJfqOPm8Otif4AFnp3K1F5HHAAAAAASUVORK5CYII=",Qte=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},Jte=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=Kte,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=qte,o.classList.add("custom-cursor__badge"),s.appendChild(i),n.appendChild(r),n.appendChild(s),n.appendChild(o),e.appendChild(n),e},Yte=t=>t.isEns?Jte(t):Qte(t),Xte="6.13.1";function Zte(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 Nn(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 Oe(t,e,n){for(let r in e){let s=e[r];const i=n?n[r]:null;i&&Zte(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 bx(t){return gn(t,"CALL_EXCEPTION")}function Nt(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=${Xte}`),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 Oe(s,{code:e}),n&&Object.assign(s,n),s.shortMessage==null&&Oe(s,{shortMessage:r}),s}function ee(t,e,n,r){if(!t)throw Nt(e,n,r)}function $(t,e,n,r){ee(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function n4(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 zg(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 r4(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}$(!1,"invalid BytesLike value",e||"value",t)}function ct(t,e){return r4(t,e,!1)}function Gn(t,e){return r4(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 wx(t){return St(t,!0)||t instanceof Uint8Array}const s4="0123456789abcdef";function we(t){const e=ct(t);let n="0x";for(let r=0;r<e.length;r++){const s=e[r];n+=s4[(s&240)>>4]+s4[s&15]}return n}function $t(t){return"0x"+t.map(e=>we(e).substring(2)).join("")}function Ec(t){return St(t,!0)?(t.length-2)/2:ct(t).length}function Ht(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 i4(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 i4(t,e,!0)}function ene(t,e){return i4(t,e,!1)}const $g=BigInt(0),Es=BigInt(1),Cc=9007199254740991;function tne(t,e){const n=Gg(t,"value"),r=BigInt(Qe(e,"width"));if(ee(n>>r===$g,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-Es){const s=(Es<<r)-Es;return-((~n&s)+Es)}return n}function o4(t,e){let n=xe(t,"value");const r=BigInt(Qe(e,"width")),s=Es<<r-Es;if(n<$g){n=-n,ee(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const i=(Es<<r)-Es;return(~n&i)+Es}else ee(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return n}function Dh(t,e){const n=Gg(t,"value"),r=BigInt(Qe(e,"bits"));return n&(Es<<r)-Es}function xe(t,e){switch(typeof t){case"bigint":return t;case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-Cc&&t<=Cc,"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){$(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}$(!1,"invalid BigNumberish value",e||"value",t)}function Gg(t,e){const n=xe(t,e);return ee(n>=$g,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const a4="0123456789abcdef";function Ax(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=a4[n>>4],e+=a4[n&15];return BigInt(e)}return xe(t)}function Qe(t,e){switch(typeof t){case"bigint":return $(t>=-Cc&&t<=Cc,"overflow",e||"value",t),Number(t);case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-Cc&&t<=Cc,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Qe(BigInt(t),e)}catch(n){$(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}$(!1,"invalid numeric value",e||"value",t)}function nne(t){return Qe(Ax(t))}function Xo(t,e){let r=Gg(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=Gg(t,"value");if(e===$g)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(wx(t)?t:Wn(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const l4="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const u4=BigInt(58);function rne(t){const e=ct(t);let n=Ax(e),r="";for(;n;)r=l4[Number(n%u4)]+r,n/=u4;for(let s=0;s<e.length&&!e[s];s++)r=l4[0]+r;return r}function sne(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 ine(t){const e=ct(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}class c4{constructor(e,n,r){W(this,"filter");W(this,"emitter");J(this,Zc);I(this,Zc,n),Oe(this,{emitter:e,filter:r})}async removeListener(){T(this,Zc)!=null&&await this.emitter.off(this.filter,T(this,Zc))}}Zc=new WeakMap;function one(t,e,n,r,s){$(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function f4(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 ane(t,e,n,r,s){return t==="OVERLONG"?($(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),f4(t,e,n))}const lne=Object.freeze({error:one,ignore:f4,replace:ane});function une(t,e){e==null&&(e=lne.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){$(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);$(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 cne(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 cne(une(t,e))}function d4(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=Nt("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{i=Nt("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 fne=12,dne=250;let h4=d4();const hne=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),pne=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let vx=!1;async function p4(t,e){try{const n=t.match(hne);if(!n)throw new Error("invalid data");return new Zo(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?sne(n[3]):gne(n[3]))}catch{return new Zo(599,"BAD REQUEST (invalid data: URI)",{},null,new Kn(t))}}function m4(t){async function e(n,r){try{const s=n.match(pne);if(!s)throw new Error("invalid link");return new Kn(`${t}${s[2]}`)}catch{return new Zo(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Kn(n))}}return e}const Wg={data:p4,ipfs:m4("https://gateway.ipfs.io/ipfs/")},g4=new WeakMap;class mne{constructor(e){J(this,$l);J(this,ha);I(this,$l,[]),I(this,ha,!1),g4.set(e,()=>{if(!T(this,ha)){I(this,ha,!0);for(const n of T(this,$l))setTimeout(()=>{n()},0);I(this,$l,[])}})}addListener(e){ee(!T(this,ha),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),T(this,$l).push(e)}get cancelled(){return T(this,ha)}checkSignal(){ee(!this.cancelled,"cancelled","CANCELLED",{})}}$l=new WeakMap,ha=new WeakMap;function Kg(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}const rb=class rb{constructor(e){J(this,ql);J(this,ef);J(this,tf);J(this,Os);J(this,ro);J(this,nf);J(this,rf);J(this,wn);J(this,Ir);J(this,so);J(this,Gl);J(this,Wl);J(this,Kl);J(this,hi);J(this,_s);J(this,pa);I(this,rf,String(e)),I(this,ef,!1),I(this,tf,!0),I(this,Os,{}),I(this,ro,""),I(this,nf,3e5),I(this,_s,{slotInterval:dne,maxAttempts:fne}),I(this,pa,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,ro)?T(this,ro):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),I(this,ro,String(e).toUpperCase())}get headers(){const e=Object.assign({},T(this,Os));return T(this,so)&&(e.authorization=`Basic ${ine(Vi(T(this,so)))}`),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,so)||null}setCredentials(e,n){$(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),I(this,so,`${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){$(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,pa)||h4}set getUrlFunc(e){I(this,pa,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,_s).slotInterval=e.slotInterval),e.maxAttempts!=null&&(T(this,_s).maxAttempts=e.maxAttempts)}send(){return ee(T(this,hi)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),I(this,hi,new mne(this)),fe(this,ql,Dp).call(this,0,y4()+this.timeout,0,this,new Zo(0,"",{},null,this))}cancel(){ee(T(this,hi)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=g4.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 rb(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 rb(this.url);return I(e,ro,T(this,ro)),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,so,T(this,so)),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,_s,Object.assign({},T(this,_s))),I(e,pa,T(this,pa)),e}static lockConfig(){vx=!0}static getGateway(e){return Wg[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(vx)throw new Error("gateways locked");Wg[e]=n}static registerGetUrl(e){if(vx)throw new Error("gateways locked");h4=e}static createGetUrlFunc(e){return d4()}static createDataGateway(){return p4}static createIpfsGatewayFunc(e){return m4(e)}};ef=new WeakMap,tf=new WeakMap,Os=new WeakMap,ro=new WeakMap,nf=new WeakMap,rf=new WeakMap,wn=new WeakMap,Ir=new WeakMap,so=new WeakMap,Gl=new WeakMap,Wl=new WeakMap,Kl=new WeakMap,hi=new WeakMap,_s=new WeakMap,pa=new WeakMap,ql=new WeakSet,Dp=async function(e,n,r,s,i){var c,f,d;if(e>=T(this,_s).maxAttempts)return i.makeServerError("exceeded maximum retry limit");ee(y4()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await yne(r);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in Wg){const h=await Wg[a](o.url,Kg(T(s,hi)));if(h instanceof Zo){let p=h;if(this.processFunc){Kg(T(s,hi));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,Kg(T(s,hi)));let u=new Zo(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,_s).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){Kg(T(s,hi));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,_s).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=rb;const Uk=class Uk{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 Uk(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:$(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw Oe(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 Zo=Uk;function y4(){return new Date().getTime()}function gne(t){return Vi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function yne(t){return new Promise(e=>setTimeout(e,t))}function bne(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function b4(t,e,n){let r=0;for(let s=0;s<n;s++)r=r*256+t[e+s];return r}function w4(t,e,n,r){const s=[];for(;n<e+1+r;){const i=A4(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 A4(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=b4(t,e+1,r);return n(e+1+r+s),w4(t,e,e+1+r,r+s)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),w4(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const s=b4(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:bne(t[e])}}function qg(t){const e=ct(t,"data"),n=A4(e,0);return $(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function v4(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function x4(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(i){r=r.concat(x4(i))}),r.length<=55)return r.unshift(192+r.length),r;const s=v4(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=v4(e.length);return n.unshift(183+n.length),n.concat(e)}const k4="0123456789abcdef";function El(t){let e="0x";for(const n of x4(t))e+=k4[n>>4],e+=k4[n&15];return e}const qn=32,xx=new Uint8Array(qn),wne=["then"],Qg={},E4=new WeakMap;function Cl(t){return E4.get(t)}function C4(t,e){E4.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 kx(t,e,n){return t.indexOf(null)>=0?e.map((r,s)=>r instanceof Tc?kx(Cl(r),r,n):r):t.reduce((r,s,i)=>{let o=e.getValue(s);return s in r||(n&&o instanceof Tc&&(o=kx(Cl(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!==Qg&&(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(C4(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(wne.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 C4(l,Cl(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=Cl(this);return r.reduce((s,i,o)=>(ee(i!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),kx(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=Cl(this),i=[],o=[];for(let a=n;a<r;a++)i.push(this[a]),o.push(s[a]);return new af(Qg,i,o)}filter(n,r){const s=Cl(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(Qg,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=Cl(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(Qg,n,r)}};of=new WeakMap;let Tc=af;function S4(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([xx.slice(e.length%qn),e]))),e}class Hi{constructor(e,n,r,s){W(this,"name");W(this,"type");W(this,"localName");W(this,"dynamic");Oe(this,{name:e,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,n){$(!1,e,this.localName,n)}}class Ex{constructor(){J(this,lf);J(this,io);J(this,Jl);I(this,io,[]),I(this,Jl,0)}get data(){return $t(T(this,io))}get length(){return T(this,Jl)}appendWriter(e){return fe(this,lf,cb).call(this,Gn(e.data))}writeBytes(e){let n=Gn(e);const r=n.length%qn;return r&&(n=Gn($t([n,xx.slice(r)]))),fe(this,lf,cb).call(this,n)}writeValue(e){return fe(this,lf,cb).call(this,S4(e))}writeUpdatableValue(){const e=T(this,io).length;return T(this,io).push(xx),I(this,Jl,T(this,Jl)+qn),n=>{T(this,io)[e]=S4(n)}}}io=new WeakMap,Jl=new WeakMap,lf=new WeakSet,cb=function(e){return T(this,io).push(e),I(this,Jl,T(this,Jl)+e.length),e.length};const Vk=class Vk{constructor(e,n,r){J(this,Zl);W(this,"allowLoose");J(this,pr);J(this,Br);J(this,Yl);J(this,Xl);J(this,ma);Oe(this,{allowLoose:!!n}),I(this,pr,Gn(e)),I(this,Yl,0),I(this,Xl,null),I(this,ma,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 Vk(T(this,pr).slice(T(this,Br)+e),this.allowLoose,T(this,ma));return I(n,Xl,this),n}readBytes(e,n){let r=fe(this,Zl,WL).call(this,0,e,!!n);return fe(this,Zl,Jk).call(this,e),I(this,Br,T(this,Br)+r.length),r.slice(0,e)}readValue(){return Ax(this.readBytes(qn))}readIndex(){return nne(this.readBytes(qn))}};pr=new WeakMap,Br=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,ma=new WeakMap,Zl=new WeakSet,Jk=function(e){var n;if(T(this,Xl))return fe(n=T(this,Xl),Zl,Jk).call(n,e);I(this,Yl,T(this,Yl)+e),ee(T(this,ma)<1||T(this,Yl)<=T(this,ma)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${T(this,ma)} ( 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}})},WL=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 Cx=Vk;function Jg(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Sx(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 Ane(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jg(t.outputLen),Jg(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 T4(t,e){Sx(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Tx=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const D4=t=>t instanceof Uint8Array,vne=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Dx=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ui=(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 xne(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Yg(t){if(typeof t=="string"&&(t=xne(t)),!D4(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function kne(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!D4(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class Ox{clone(){return this._cloneInto()}}function _x(t){const e=r=>t().update(Yg(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Ene(t=32){if(Tx&&typeof Tx.getRandomValues=="function")return Tx.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class O4 extends Ox{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,Ane(e);const r=Yg(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),Sx(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 _4=(t,e,n)=>new O4(t,e).update(n).digest();_4.create=(t,e)=>new O4(t,e);function Cne(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 M4 extends Ox{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=Dx(this.buffer)}update(e){Dc(this);const{view:n,buffer:r,blockLen:s}=this;e=Yg(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=Dx(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),T4(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;Cne(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=Dx(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 Sne=(t,e,n)=>t&e^~t&n,Tne=(t,e,n)=>t&e^t&n^e&n,Dne=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]),ea=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ta=new Uint32Array(64);class One extends M4{constructor(){super(64,32,8,!1),this.A=ea[0]|0,this.B=ea[1]|0,this.C=ea[2]|0,this.D=ea[3]|0,this.E=ea[4]|0,this.F=ea[5]|0,this.G=ea[6]|0,this.H=ea[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)ta[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=ta[f-15],h=ta[f-2],p=ui(d,7)^ui(d,18)^d>>>3,m=ui(h,17)^ui(h,19)^h>>>10;ta[f]=m+ta[f-7]+p+ta[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=ui(a,6)^ui(a,11)^ui(a,25),h=c+d+Sne(a,l,u)+Dne[f]+ta[f]|0,m=(ui(r,2)^ui(r,13)^ui(r,22))+Tne(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(){ta.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const N4=_x(()=>new One),Xg=BigInt(2**32-1),Mx=BigInt(32);function R4(t,e=!1){return e?{h:Number(t&Xg),l:Number(t>>Mx&Xg)}:{h:Number(t>>Mx&Xg)|0,l:Number(t&Xg)|0}}function P4(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}=R4(t[s],e);[n[s],r[s]]=[i,o]}return[n,r]}const _ne=(t,e)=>BigInt(t>>>0)<<Mx|BigInt(e>>>0),Mne=(t,e,n)=>t>>>n,Nne=(t,e,n)=>t<<32-n|e>>>n,Rne=(t,e,n)=>t>>>n|e<<32-n,Pne=(t,e,n)=>t<<32-n|e>>>n,Ine=(t,e,n)=>t<<64-n|e>>>n-32,Lne=(t,e,n)=>t>>>n-32|e<<64-n,Bne=(t,e)=>e,Fne=(t,e)=>t,I4=(t,e,n)=>t<<n|e>>>32-n,L4=(t,e,n)=>e<<n|t>>>32-n,B4=(t,e,n)=>e<<n-32|t>>>64-n,F4=(t,e,n)=>t<<n-32|e>>>64-n;function jne(t,e,n,r){const s=(e>>>0)+(r>>>0);return{h:t+n+(s/2**32|0)|0,l:s|0}}const Ze={fromBig:R4,split:P4,toBig:_ne,shrSH:Mne,shrSL:Nne,rotrSH:Rne,rotrSL:Pne,rotrBH:Ine,rotrBL:Lne,rotr32H:Bne,rotr32L:Fne,rotlSH:I4,rotlSL:L4,rotlBH:B4,rotlBL:F4,add:jne,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,Vne]=Ze.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))),na=new Uint32Array(80),ra=new Uint32Array(80);class Hne extends M4{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 w=0;w<16;w++,n+=4)na[w]=e.getUint32(n),ra[w]=e.getUint32(n+=4);for(let w=16;w<80;w++){const A=na[w-15]|0,x=ra[w-15]|0,k=Ze.rotrSH(A,x,1)^Ze.rotrSH(A,x,8)^Ze.shrSH(A,x,7),C=Ze.rotrSL(A,x,1)^Ze.rotrSL(A,x,8)^Ze.shrSL(A,x,7),O=na[w-2]|0,_=ra[w-2]|0,D=Ze.rotrSH(O,_,19)^Ze.rotrBH(O,_,61)^Ze.shrSH(O,_,6),R=Ze.rotrSL(O,_,19)^Ze.rotrBL(O,_,61)^Ze.shrSL(O,_,6),L=Ze.add4L(C,R,ra[w-7],ra[w-16]),F=Ze.add4H(L,k,D,na[w-7],na[w-16]);na[w]=F|0,ra[w]=L|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 w=0;w<80;w++){const A=Ze.rotrSH(f,d,14)^Ze.rotrSH(f,d,18)^Ze.rotrBH(f,d,41),x=Ze.rotrSL(f,d,14)^Ze.rotrSL(f,d,18)^Ze.rotrBL(f,d,41),k=f&h^~f&m,C=d&p^~d&g,O=Ze.add5L(v,x,C,Vne[w],ra[w]),_=Ze.add5H(O,y,A,k,Une[w],na[w]),D=O|0,R=Ze.rotrSH(r,s,28)^Ze.rotrBH(r,s,34)^Ze.rotrBH(r,s,39),L=Ze.rotrSL(r,s,28)^Ze.rotrBL(r,s,34)^Ze.rotrBL(r,s,39),F=r&i^r&a^i&a,G=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}=Ze.add(u|0,c|0,_|0,D|0),u=a|0,c=l|0,a=i|0,l=o|0,i=r|0,o=s|0;const B=Ze.add3L(D,L,G);r=Ze.add3H(B,_,R,F),s=B|0}({h:r,l:s}=Ze.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=Ze.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l}=Ze.add(this.Ch|0,this.Cl|0,a|0,l|0),{h:u,l:c}=Ze.add(this.Dh|0,this.Dl|0,u|0,c|0),{h:f,l:d}=Ze.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:p}=Ze.add(this.Fh|0,this.Fl|0,h|0,p|0),{h:m,l:g}=Ze.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:v}=Ze.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(){na.fill(0),ra.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 zne=_x(()=>new Hne);function $ne(){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 j4=$ne();j4.crypto||j4.msCrypto;function Gne(t){switch(t){case"sha256":return N4.create();case"sha512":return zne.create()}$(!1,"invalid hashing algorithm name","algorithm",t)}const[U4,V4,H4]=[[],[],[]],Wne=BigInt(0),_h=BigInt(1),Kne=BigInt(2),qne=BigInt(7),Qne=BigInt(256),Jne=BigInt(113);for(let t=0,e=_h,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],U4.push(2*(5*r+n)),V4.push((t+1)*(t+2)/2%64);let s=Wne;for(let i=0;i<7;i++)e=(e<<_h^(e>>qne)*Jne)%Qne,e&Kne&&(s^=_h<<(_h<<BigInt(i))-_h);H4.push(s)}const[Yne,Xne]=P4(H4,!0),z4=(t,e,n)=>n>32?B4(t,e,n):I4(t,e,n),$4=(t,e,n)=>n>32?F4(t,e,n):L4(t,e,n);function Zne(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=z4(u,c,1)^n[a],d=$4(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=V4[o],l=z4(s,i,a),u=$4(s,i,a),c=U4[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]^=Yne[r],t[1]^=Xne[r]}n.fill(0)}class Nx extends Ox{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,Jg(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=vne(this.state)}keccak(){Zne(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Dc(this);const{blockLen:n,state:r}=this;e=Yg(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),Sx(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 Jg(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(T4(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 Nx(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 ere=((t,e,n)=>_x(()=>new Nx(e,t,n)))(1,136,256/8);let G4=!1;const W4=function(t){return ere(t)};let K4=W4;function en(t){const e=ct(t,"data");return we(K4(e))}en._=W4,en.lock=function(){G4=!0},en.register=function(t){if(G4)throw new TypeError("keccak256 is locked");K4=t},Object.freeze(en);const q4=function(t){return Gne("sha256").update(t).digest()};let Q4=q4,J4=!1;function Oc(t){const e=ct(t,"data");return we(Q4(e))}Oc._=q4,Oc.lock=function(){J4=!0},Oc.register=function(t){if(J4)throw new Error("sha256 is locked");Q4=t},Object.freeze(Oc),Object.freeze(Oc);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Y4=BigInt(0),Zg=BigInt(1),tre=BigInt(2),ey=t=>t instanceof Uint8Array,nre=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function _c(t){if(!ey(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=nre[t[n]];return e}function X4(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function Rx(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Mc(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 Rx(_c(t))}function Px(t){if(!ey(t))throw new Error("Uint8Array expected");return Rx(_c(Uint8Array.from(t).reverse()))}function Nc(t,e){return Mc(t.toString(16).padStart(e*2,"0"))}function Ix(t,e){return Nc(t,e).reverse()}function rre(t){return Mc(X4(t))}function Cs(t,e,n){let r;if(typeof e=="string")try{r=Mc(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(ey(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 Mh(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!ey(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function sre(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 ire(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function ore(t){let e;for(e=0;t>Y4;t>>=Zg,e+=1);return e}function are(t,e){return t>>BigInt(e)&Zg}const lre=(t,e,n)=>t|(n?Zg:Y4)<<BigInt(e),Lx=t=>(tre<<BigInt(t-1))-Zg,Bx=t=>new Uint8Array(t),Z4=t=>Uint8Array.from(t);function eR(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=Bx(t),s=Bx(t),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...f)=>n(s,r,...f),l=(f=Bx())=>{s=a(Z4([0]),f),r=a(),f.length!==0&&(s=a(Z4([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 Mh(...d)};return(f,d)=>{o(),l(f);let h;for(;!(h=d(u()));)l();return o(),h}}const ure={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 Nh(t,e,n={}){const r=(s,i,o)=>{const a=ure[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 cre=Object.freeze(Object.defineProperty({__proto__:null,bitGet:are,bitLen:ore,bitMask:Lx,bitSet:lre,bytesToHex:_c,bytesToNumberBE:Sl,bytesToNumberLE:Px,concatBytes:Mh,createHmacDrbg:eR,ensureBytes:Cs,equalBytes:sre,hexToBytes:Mc,hexToNumber:Rx,numberToBytesBE:Nc,numberToBytesLE:Ix,numberToHexUnpadded:X4,numberToVarBytesBE:rre,utf8ToBytes:ire,validateObject:Nh},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const yn=BigInt(0),Gt=BigInt(1),Tl=BigInt(2),fre=BigInt(3),Fx=BigInt(4),tR=BigInt(5),nR=BigInt(8);BigInt(9),BigInt(16);function fr(t,e){const n=t%e;return n>=yn?n:e+n}function dre(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 jx(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 hre(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&&dre(s,e,t)!==t-Gt;s++);if(r===1){const o=(t+Gt)/Fx;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 pre(t){if(t%Fx===fre){const e=(t+Gt)/Fx;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%nR===tR){const e=(t-tR)/nR;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 hre(t)}const mre=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function gre(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=mre.reduce((r,s)=>(r[s]="function",r),e);return Nh(t,n)}function yre(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 bre(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 rR(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function wre(t,e,n=!1,r={}){if(t<=yn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:s,nByteLength:i}=rR(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=pre(t),a=Object.freeze({ORDER:t,BITS:s,BYTES:i,MASK:Lx(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)=>yre(a,l,u),div:(l,u)=>fr(l*jx(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>jx(l,t),sqrt:r.sqrt||(l=>o(a,l)),invertBatch:l=>bre(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?Ix(l,i):Nc(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?Px(l):Sl(l)}});return Object.freeze(a)}function sR(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 iR(t){const e=sR(t);return e+Math.ceil(e/2)}function Are(t,e,n=!1){const r=t.length,s=sR(e),i=iR(e);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const o=n?Sl(t):Px(t),a=fr(o,e-Gt)+Gt;return n?Ix(a,s):Nc(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const vre=BigInt(0),Ux=BigInt(1);function xre(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>vre;)i&Ux&&(o=o.add(a)),a=a.double(),i>>=Ux;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+=Ux);const y=m,v=m+Math.abs(g)-1,w=p%2!==0,A=g<0;g===0?c=c.add(n(w,i[y])):u=u.add(n(A,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 oR(t){return gre(t.Fp),Nh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rR(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function kre(t){const e=oR(t);Nh(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:Ere,hexToBytes:Cre}=cre,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:Ere(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Dl,n=typeof t=="string"?Cre(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}`}},zi=BigInt(0),Zr=BigInt(1);BigInt(2);const aR=BigInt(3);BigInt(4);function Sre(t){const e=kre(t),{Fp:n}=e,r=e.toBytes||((p,m,g)=>{const y=m.toAffine();return Mh(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"&&zi<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=_c(p)),typeof p!="string"||!m.includes(p.length))throw new Error("Invalid key");p=p.padStart(g*2,"0")}let w;try{w=typeof p=="bigint"?p:Sl(Cs("private key",p,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof p}`)}return y&&(w=fr(w,v)),a(w),w}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=w=>n.eql(w,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(Cs("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:w,py:A,pz:x}=m,k=n.eql(n.mul(g,x),n.mul(w,v)),C=n.eql(n.mul(y,x),n.mul(A,v));return k&&C}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:g}=e,y=n.mul(g,aR),{px:v,py:w,pz:A}=this;let x=n.ZERO,k=n.ZERO,C=n.ZERO,O=n.mul(v,v),_=n.mul(w,w),D=n.mul(A,A),R=n.mul(v,w);return R=n.add(R,R),C=n.mul(v,A),C=n.add(C,C),x=n.mul(m,C),k=n.mul(y,D),k=n.add(x,k),x=n.sub(_,k),k=n.add(_,k),k=n.mul(x,k),x=n.mul(R,x),C=n.mul(y,C),D=n.mul(m,D),R=n.sub(O,D),R=n.mul(m,R),R=n.add(R,C),C=n.add(O,O),O=n.add(C,O),O=n.add(O,D),O=n.mul(O,R),k=n.add(k,O),D=n.mul(w,A),D=n.add(D,D),O=n.mul(D,R),x=n.sub(x,O),C=n.mul(D,_),C=n.add(C,C),C=n.add(C,C),new f(x,k,C)}add(m){c(m);const{px:g,py:y,pz:v}=this,{px:w,py:A,pz:x}=m;let k=n.ZERO,C=n.ZERO,O=n.ZERO;const _=e.a,D=n.mul(e.b,aR);let R=n.mul(g,w),L=n.mul(y,A),F=n.mul(v,x),G=n.add(g,y),B=n.add(w,A);G=n.mul(G,B),B=n.add(R,L),G=n.sub(G,B),B=n.add(g,v);let H=n.add(w,x);return B=n.mul(B,H),H=n.add(R,F),B=n.sub(B,H),H=n.add(y,v),k=n.add(A,x),H=n.mul(H,k),k=n.add(L,F),H=n.sub(H,k),O=n.mul(_,B),k=n.mul(D,F),O=n.add(k,O),k=n.sub(L,O),O=n.add(L,O),C=n.mul(k,O),L=n.add(R,R),L=n.add(L,R),F=n.mul(_,F),B=n.mul(D,B),L=n.add(L,F),F=n.sub(R,F),F=n.mul(_,F),B=n.add(B,F),R=n.mul(L,B),C=n.add(C,R),R=n.mul(H,B),k=n.mul(G,k),k=n.sub(k,R),R=n.mul(G,L),O=n.mul(H,O),O=n.add(O,R),new f(k,C,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,w)=>v.toAffine(y[w])).map(f.fromAffine)})}multiplyUnsafe(m){const g=f.ZERO;if(m===zi)return g;if(a(m),m===Zr)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:A,k2:x}=y.splitScalar(m),k=g,C=g,O=this;for(;w>zi||x>zi;)w&Zr&&(k=k.add(O)),x&Zr&&(C=C.add(O)),O=O.double(),w>>=Zr,x>>=Zr;return v&&(k=k.negate()),A&&(C=C.negate()),C=new f(n.mul(C.px,y.beta),C.py,C.pz),k.add(C)}multiply(m){a(m);let g=m,y,v;const{endo:w}=e;if(w){const{k1neg:A,k1:x,k2neg:k,k2:C}=w.splitScalar(g);let{p:O,f:_}=this.wNAF(x),{p:D,f:R}=this.wNAF(C);O=h.constTimeNegate(A,O),D=h.constTimeNegate(k,D),D=new f(n.mul(D.px,w.beta),D.py,D.pz),y=O.add(D),v=_.add(R)}else{const{p:A,f:x}=this.wNAF(g);y=A,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,g,y){const v=f.BASE,w=(x,k)=>k===zi||k===Zr||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),A=w(this,g).add(w(m,y));return A.is0()?void 0:A}toAffine(m){const{px:g,py:y,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const A=n.mul(g,m),x=n.mul(y,m),k=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:A,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 _c(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=xre(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:o}}function Tre(t){const e=oR(t);return Nh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Dre(t){const e=Tre(t),{Fp:n,n:r}=e,s=n.BYTES+1,i=2*n.BYTES+1;function o(B){return zi<B&&B<n.ORDER}function a(B){return fr(B,r)}function l(B){return jx(B,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:f,isWithinCurveOrder:d}=Sre({...e,toBytes(B,H,Q){const te=H.toAffine(),Z=n.toBytes(te.x),pe=Mh;return Q?pe(Uint8Array.from([H.hasEvenY()?2:3]),Z):pe(Uint8Array.from([4]),Z,n.toBytes(te.y))},fromBytes(B){const H=B.length,Q=B[0],te=B.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 Ee=n.sqrt(pe);const Re=(Ee&Zr)===Zr;return(Q&1)===1!==Re&&(Ee=n.neg(Ee)),{x:Z,y:Ee}}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=B=>_c(Nc(B,e.nByteLength));function p(B){const H=r>>Zr;return B>H}function m(B){return p(B)?a(-B):B}const g=(B,H,Q)=>Sl(B.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=Cs("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(Cs("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=C(Cs("msgHash",H));if(Z==null||![0,1,2,3].includes(Z))throw new Error("recovery id invalid");const Ee=Z===2||Z===3?Q+e.n:Q;if(Ee>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Re=Z&1?"03":"02",Ce=u.fromHex(Re+h(Ee)),ke=l(Ee),He=a(-pe*ke),Ue=a(te*ke),ze=u.BASE.multiplyAndAddUnsafe(Ce,He,Ue);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 Mc(this.toDERHex())}toDERHex(){return Dl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Mc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(B){try{return c(B),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const B=iR(e.n);return Are(e.randomBytes(B),e.n)},precompute(B=8,H=u.BASE){return H._setWindowSize(B),H.multiply(BigInt(3)),H}};function w(B,H=!0){return u.fromPrivateKey(B).toRawBytes(H)}function A(B){const H=B instanceof Uint8Array,Q=typeof B=="string",te=(H||Q)&&B.length;return H?te===s||te===i:Q?te===2*s||te===2*i:B instanceof u}function x(B,H,Q=!0){if(A(B))throw new Error("first arg must be private key");if(!A(H))throw new Error("second arg must be public key");return u.fromHex(H).multiply(c(B)).toRawBytes(Q)}const k=e.bits2int||function(B){const H=Sl(B),Q=B.length*8-e.nBitLength;return Q>0?H>>BigInt(Q):H},C=e.bits2int_modN||function(B){return a(k(B))},O=Lx(e.nBitLength);function _(B){if(typeof B!="bigint")throw new Error("bigint expected");if(!(zi<=B&&B<O))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Nc(B,e.nByteLength)}function D(B,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:Ee,extraEntropy:Re}=Q;pe==null&&(pe=!0),B=Cs("msgHash",B),Ee&&(B=Cs("prehashed msgHash",te(B)));const Ce=C(B),ke=c(H),He=[_(ke),_(Ce)];if(Re!=null){const tt=Re===!0?Z(n.BYTES):Re;He.push(Cs("extraEntropy",tt))}const Ue=Mh(...He),ze=Ce;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===zi)return;const Be=a($e*a(ze+be*ke));if(Be===zi)return;let z=(ae.x===be?0:2)|Number(ae.y&Zr),q=Be;return pe&&p(Be)&&(q=m(Be),z^=1),new y(be,q,z)}return{seed:Ue,k2sig:Le}}const R={lowS:e.lowS,prehash:!1},L={lowS:e.lowS,prehash:!1};function F(B,H,Q=R){const{seed:te,k2sig:Z}=D(B,H,Q),pe=e;return eR(pe.hash.outputLen,pe.nByteLength,pe.hmac)(te,Z)}u.BASE._setWindowSize(8);function G(B,H,Q,te=L){var ae;const Z=B;if(H=Cs("msgHash",H),Q=Cs("publicKey",Q),"strict"in te)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ee}=te;let Re,Ce;try{if(typeof Z=="string"||Z instanceof Uint8Array)try{Re=y.fromDER(Z)}catch(be){if(!(be instanceof Dl.Err))throw be;Re=y.fromCompact(Z)}else if(typeof Z=="object"&&typeof Z.r=="bigint"&&typeof Z.s=="bigint"){const{r:be,s:Be}=Z;Re=new y(be,Be)}else throw new Error("PARSE");Ce=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&&Re.hasHighS())return!1;Ee&&(H=e.hash(H));const{r:ke,s:He}=Re,Ue=C(H),ze=l(He),Le=a(Ue*ze),tt=a(ke*ze),le=(ae=u.BASE.multiplyAndAddUnsafe(Ce,Le,tt))==null?void 0:ae.toAffine();return le?a(le.x)===ke:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:F,verify:G,ProjectivePoint:u,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ore(t){return{hash:t,hmac:(e,...n)=>_4(t,e,kne(...n)),randomBytes:Ene}}function _re(t,e){const n=r=>Dre({...t,...Ore(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const lR=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),uR=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Mre=BigInt(1),Vx=BigInt(2),cR=(t,e)=>(t+e/Vx)/e;function Nre(t){const e=lR,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,Vx,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,w=Xr(v,n,e)*c%e,A=Xr(w,o,e)*p%e,x=Xr(A,r,e)*u%e,k=Xr(x,Vx,e);if(!Hx.eql(Hx.sqr(k),t))throw new Error("Cannot find square root");return k}const Hx=wre(lR,void 0,void 0,{sqrt:Nre}),sa=_re({a:BigInt(0),b:BigInt(7),Fp:Hx,n:uR,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=uR,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Mre*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,o=BigInt("0x100000000000000000000000000000000"),a=cR(i*t,e),l=cR(-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}}}},N4);BigInt(0),sa.ProjectivePoint;const Rh="0x0000000000000000000000000000000000000000",fR="0x0000000000000000000000000000000000000000000000000000000000000000",dR=BigInt(0),hR=BigInt(1),pR=BigInt(2),mR=BigInt(27),gR=BigInt(28),ty=BigInt(35),Rc={};function yR(t){return xl(Wn(t),32)}const Ms=class Ms{constructor(e,n,r,s){J(this,uf);J(this,cf);J(this,ff);J(this,eu);zg(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){$(Ec(e)===32,"invalid r","value",e),I(this,uf,we(e))}get s(){return T(this,cf)}set s(e){$(Ec(e)===32,"invalid s","value",e);const n=we(e);$(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");$(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:Ms.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 Ms(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=xe(e,"v");return n==mR||n==gR?dR:($(n>=ty,"invalid EIP-155 v","v",e),(n-ty)/pR)}static getChainIdV(e,n){return xe(e)*pR+BigInt(35+n-27)}static getNormalizedV(e){const n=xe(e);return n===dR||n===mR?27:n===hR||n===gR?28:($(n>=ty,"invalid v","v",e),n&hR?27:28)}static from(e){function n(u,c){$(u,c,"signature",e)}if(e==null)return new Ms(Rc,fR,fR,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 Ms(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=Ms.getNormalizedV(u[64]);return new Ms(Rc,c,we(f),d)}n(!1,"invalid raw signature length")}if(e instanceof Ms)return e.clone();const r=e.r;n(r!=null,"missing r");const s=yR(r),i=function(u,c){if(u!=null)return yR(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=xe(u);return{networkV:d>=ty?d:void 0,v:Ms.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 Ms(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=Ms;const tu=class tu{constructor(e){J(this,oo);$(Ec(e)===32,"invalid private key","privateKey","[REDACTED]"),I(this,oo,we(e))}get privateKey(){return T(this,oo)}get publicKey(){return tu.computePublicKey(T(this,oo))}get compressedPublicKey(){return tu.computePublicKey(T(this,oo),!0)}sign(e){$(Ec(e)===32,"invalid digest length","digest",e);const n=sa.sign(Gn(e),Gn(T(this,oo)),{lowS:!0});return Ss.from({r:Xo(n.r,32),s:Xo(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=tu.computePublicKey(e);return we(sa.getSharedSecret(Gn(T(this,oo)),ct(n),!1))}static computePublicKey(e,n){let r=ct(e,"key");if(r.length===32){const i=sa.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=sa.ProjectivePoint.fromHex(r);return we(s.toRawBytes(n))}static recoverPublicKey(e,n){$(Ec(e)===32,"invalid digest length","digest",e);const r=Ss.from(n);let s=sa.Signature.fromCompact(Gn($t([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const i=s.recoverPublicKey(Gn(e));return $(i!=null,"invalid signautre for digest","signature",n),"0x"+i.toHex(!1)}static addPoints(e,n,r){const s=sa.ProjectivePoint.fromHex(tu.computePublicKey(e).substring(2)),i=sa.ProjectivePoint.fromHex(tu.computePublicKey(n).substring(2));return"0x"+s.add(i).toHex(!!r)}};oo=new WeakMap;let Ph=tu;const Rre=BigInt(0),Pre=BigInt(36);function bR(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 zx={};for(let t=0;t<10;t++)zx[String(t)]=String(t);for(let t=0;t<26;t++)zx[String.fromCharCode(65+t)]=String(10+t);const wR=15;function Ire(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>zx[r]).join("");for(;e.length>=wR;){let r=e.substring(0,wR);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 Lre=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function Bre(t){t=t.toLowerCase();let e=Rre;for(let n=0;n<t.length;n++)e=e*Pre+Lre[t[n]];return e}function gt(t){if($(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=bR(t);return $(!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}$/)){$(t.substring(2,4)===Ire(t),"bad icap checksum","address",t);let e=Bre(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return bR("0x"+e)}$(!1,"invalid address","address",t)}function Fre(t){const e=gt(t.from);let r=xe(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,gt(Ht(en(El([e,r])),12))}function AR(t){return t&&typeof t.getAddress=="function"}function jre(t){try{return gt(t),!0}catch{}return!1}async function $x(t,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(ee(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),$(!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"}),$x(t,e.resolveName(t)));if(AR(t))return $x(t,t.getAddress());if(t&&typeof t.then=="function")return $x(t,t);$(!1,"unsupported addressable value","target",t)}const $i={};function Ae(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new Rn($i,`${n?"":"u"}int${e}`,t,{signed:n,width:e})}function dt(t,e){return new Rn($i,`bytes${e||""}`,t,{size:e})}const vR=Symbol.for("_ethers_typed"),ao=class ao{constructor(e,n,r,s){W(this,"type");W(this,"value");J(this,nu);W(this,"_typedSymbol");s==null&&(s=null),zg($i,e,"Typed"),Oe(this,{_typedSymbol:vR,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 ao($i,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 ao($i,"address",e)}static bool(e){return new ao($i,"bool",!!e)}static bytes(e){return new ao($i,"bytes",e)}static string(e){return new ao($i,"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 ao($i,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===vR}static dereference(e,n){if(ao.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=ao;class Ure extends Hi{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(Xo(e.readValue(),20))}}class Vre extends Hi{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 xR(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 $(!1,"invalid tuple value","tuple",n);$(e.length===r.length,"types/value length mismatch","tuple",n);let s=new Ex,i=new Ex,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 kR(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 Hre extends Hi{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");Oe(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)),n4(s.length,i,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<s.length;a++)o.push(this.coder);return xR(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 Vre(this.coder));return kR(n,s)}}class zre extends Hi{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 ER extends Hi{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 $re extends ER{constructor(e){super("bytes",e)}decode(e){return we(super.decode(e))}}class Gre extends Hi{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);W(this,"size");Oe(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 Wre=new Uint8Array([]);class Kre extends Hi{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes(Wre)}decode(e){return e.readBytes(0),null}}const qre=BigInt(0),Qre=BigInt(1),Jre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Yre extends Hi{constructor(n,r,s){const i=(r?"int":"uint")+n*8;super(i,i,s,!1);W(this,"size");W(this,"signed");Oe(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=xe(Rn.dereference(r,this.type)),i=Dh(Jre,qn*8);if(this.signed){let o=Dh(i,this.size*8-1);(s>o||s<-(o+Qre))&&this._throwError("value out-of-bounds",r),s=o4(s,8*qn)}else(s<qre||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=tne(r,this.size*8)),r}}class Xre extends ER{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 ny extends Hi{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");Oe(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 xR(n,this.coders,s)}decode(n){return kR(n,this.coders)}}function Ol(t){return en(Vi(t))}var Zre="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";const CR=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),SR=4;function ese(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,w=d;for(;;){let x=Math.floor(((g-v+1)*s-1)/w),k=0,C=r;for(;C-k>1;){let D=k+C>>>1;x<i[D]?C=D:k=D}if(k==0)break;y.push(k);let O=v+Math.floor(w*i[k]/s),_=v+Math.floor(w*i[k+1]/s)-1;for(;!((O^_)&h);)g=g<<1&m|c(),O=O<<1&m,_=_<<1&m|1;for(;O&~_&p;)g=g&h|g<<1&m>>>1|c(),O=O<<1^h,_=(_^h)<<1|h|1;v=O,w=1+_-O}let A=r-4;return y.map(x=>{switch(x-A){case 3:return A+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return A+256+(t[a++]<<8|t[a++]);case 1:return A+t[a++];default:return x-1}})}function tse(t){let e=0;return()=>t[e++]}function TR(t){return tse(ese(nse(t)))}function nse(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 rse(t){return t&1?~t>>1:t>>1}function sse(t,e){let n=Array(t);for(let r=0,s=0;r<t;r++)n[r]=s+=rse(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 DR(t){return Lh(()=>{let e=Ih(t);if(e.length)return e})}function OR(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(ise(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(ose(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 _R(t,e,n){let r=Array(t).fill().map(()=>[]);for(let s=0;s<e;s++)sse(t,n).forEach((i,o)=>r[o].push(i));return r}function ise(t,e){let n=1+e(),r=e(),s=Lh(e);return _R(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 ose(t,e){let n=1+e();return _R(n,1+t,e).map(s=>[s[0],s.slice(1)])}function ase(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 lse(t){return t.toString(16).toUpperCase().padStart(2,"0")}function MR(t){return`{${lse(t)}}`}function use(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 cse(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 fse="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";const Bh=44032,ry=4352,sy=4449,iy=4519,NR=19,RR=21,Ic=28,oy=RR*Ic,dse=NR*oy,hse=Bh+dse,pse=ry+NR,mse=sy+RR,gse=iy+Ic;function Fh(t){return t>>24&255}function PR(t){return t&16777215}let Gx,IR,Wx,ay;function yse(){let t=TR(fse);Gx=new Map(DR(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),IR=new Set(Ih(t)),Wx=new Map,ay=new Map;for(let[e,n]of OR(t)){if(!IR.has(e)&&n.length==2){let[r,s]=n,i=ay.get(r);i||(i=new Map,ay.set(r,i)),i.set(s,e)}Wx.set(e,n.reverse())}}function LR(t){return t>=Bh&&t<hse}function bse(t,e){if(t>=ry&&t<pse&&e>=sy&&e<mse)return Bh+(t-ry)*oy+(e-sy)*Ic;if(LR(t)&&e>iy&&e<gse&&(t-Bh)%Ic==0)return t+(e-iy);{let n=ay.get(t);return n&&(n=n.get(e),n)?n:-1}}function BR(t){Gx||yse();let e=[],n=[],r=!1;function s(i){let o=Gx.get(i);o&&(r=!0,i|=o),e.push(i)}for(let i of t)for(;;){if(i<128)e.push(i);else if(LR(i)){let o=i-Bh,a=o/oy|0,l=o%oy/Ic|0,u=o%Ic;s(ry+a),s(sy+l),u>0&&s(iy+u)}else{let o=Wx.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 wse(t){let e=[],n=[],r=-1,s=0;for(let i of t){let o=Fh(i),a=PR(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=bse(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 FR(t){return BR(t).map(PR)}function Ase(t){return wse(BR(t))}const jR=45,UR=".",VR=65039,HR=1,ly=t=>Array.from(t);function jh(t,e){return t.P.has(e)||t.Q.has(e)}class vse extends Array{get is_emoji(){return!0}}let Kx,zR,_l,qx,$R,Lc,Qx,Bc,Ml,GR,Jx;function Yx(){if(Kx)return;let t=TR(Zre);const e=()=>Ih(t),n=()=>new Set(e()),r=(c,f)=>f.forEach(d=>c.add(d));Kx=new Map(OR(t)),zR=n(),_l=e(),qx=new Set(e().map(c=>_l[c])),_l=new Set(_l),$R=n(),n();let s=DR(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}}}),Qx=n(),Bc=new Map;let a=e().concat(ly(Qx)).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),Qx.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=>ly(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)}}Ml=new Set;let l=new Set;const u=c=>Ml.has(c)?l.add(c):Ml.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 Ml)!Bc.has(c)&&!l.has(c)&&Bc.set(c,HR);r(Ml,FR(Ml)),GR=ase(t).map(c=>vse.from(c)).sort(cse),Jx=new Map;for(let c of GR){let f=[Jx];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===VR?f.push(...h):f=h}for(let d of f)d.V=c}}function Xx(t){return(WR(t)?"":`${Zx(uy([t]))} `)+MR(t)}function Zx(t){return`"${t}"`}function xse(t){if(t.length>=4&&t[2]==jR&&t[3]==jR)throw new Error(`invalid label extension: "${Pc(t.slice(0,4))}"`)}function kse(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Ese(t){let e=t[0],n=CR.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=CR.get(e);if(o){if(s==i)throw Uh(`${n} + ${o}`);s=i+1,n=o}}if(s==r)throw Uh(`trailing ${n}`)}function uy(t,e=1/0,n=MR){let r=[];Cse(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];WR(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 Cse(t){return Yx(),_l.has(t)}function WR(t){return Yx(),$R.has(t)}function Sse(t){return _se(Tse(t,Ase,Rse))}function Tse(t,e,n){if(!t)return[];Yx();let r=0;return t.split(UR).map(s=>{let i=use(s),o={input:i,offset:r};r+=i.length+1;try{let a=o.tokens=Nse(i,e,n),l=a.length,u;if(!l)throw new Error("empty label");let c=o.output=a.flat();if(kse(c),!(o.emoji=l>1||a[0].is_emoji)&&c.every(d=>d<128))xse(c),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(_l.has(c[0]))throw Uh("leading combining mark");for(let m=1;m<l;m++){let g=a[m];if(!g.is_emoji&&_l.has(g[0]))throw Uh(`emoji + combining mark: "${Pc(a[m-1])} + ${uy([g[0]])}"`)}Ese(c);let h=ly(new Set(d)),[p]=Ose(h);Mse(p,d),Dse(p,h),u=p.N}}o.type=u}catch(a){o.error=a}return o})}function Dse(t,e){let n,r=[];for(let s of e){let i=Bc.get(s);if(i===HR)return;if(i){let o=i.M.get(s);if(n=n?n.filter(a=>o.has(a)):ly(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 Ose(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))?qR(e[0],n):KR(n);if(e=r,r.length==1)break}return e}function _se(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(uy(e,63))}: ${s}`)}return Pc(r)}).join(UR)}function KR(t){return new Error(`disallowed character: ${Xx(t)}`)}function qR(t,e){let n=Xx(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 Mse(t,e){for(let n of e)if(!jh(t,n))throw qR(t,n);if(t.M){let n=FR(e);for(let r=1,s=n.length;r<s;r++)if(qx.has(n[r])){let i=r+1;for(let o;i<s&&qx.has(o=n[i]);i++)for(let a=r;a<i;a++)if(n[a]==o)throw new Error(`duplicate non-spacing marks: ${Xx(o)}`);if(i-r>SR)throw new Error(`excessive non-spacing marks: ${Zx(uy(n.slice(r-1,i)))} (${i-r}/${SR})`);r=i}}}function Nse(t,e,n){let r=[],s=[];for(t=t.slice().reverse();t.length;){let i=Pse(t);if(i)s.length&&(r.push(e(s)),s=[]),r.push(n(i));else{let o=t.pop();if(Ml.has(o))s.push(o);else{let a=Kx.get(o);if(a)s.push(...a);else if(!zR.has(o))throw KR(o)}}}return s.length&&r.push(e(s)),r}function Rse(t){return t.filter(e=>e!=VR)}function Pse(t,e){let n=Jx,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 QR=new Uint8Array(32);QR.fill(0);function JR(t){return $(t.length!==0,"invalid ENS name; empty component","comp",t),t}function YR(t){const e=Vi(Ise(t)),n=[];if(t.length===0)return n;let r=0;for(let s=0;s<e.length;s++)e[s]===46&&(n.push(JR(e.slice(r,s))),r=s+1);return $(r<e.length,"invalid ENS name; empty component","name",t),n.push(JR(e.slice(r))),n}function Ise(t){try{if(t.length===0)throw new Error("empty label");return Sse(t)}catch(e){$(!1,`invalid ENS name (${e.message})`,"name",t)}}function e2(t){$(typeof t=="string","invalid ENS name; not a string","name",t),$(t.length,"invalid ENS name (empty label)","name",t);let e=QR;const n=YR(t);for(;n.length;)e=en($t([e,en(n.pop())]));return we(e)}function Lse(t,e){const n=e;return $(n<=255,"DNS encoded label cannot exceed 255","length",n),we($t(YR(t).map(r=>{$(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 t2(t,e){return{address:gt(t),storageKeys:e.map((n,r)=>($(St(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function ia(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?($(n.length===2,"invalid slot set",`value[${r}]`,n),t2(n[0],n[1])):($(n!=null&&typeof n=="object","invalid address-slot set","value",t),t2(n.address,n.storageKeys)));$(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 t2(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function Bse(t){let e;return typeof t=="string"?e=Ph.computePublicKey(t,!1):e=t.publicKey,gt(en("0x"+e.substring(4)).substring(26))}function Fse(t,e){return Bse(Ph.recoverPublicKey(t,e))}const bn=BigInt(0),jse=BigInt(2),Use=BigInt(27),Vse=BigInt(28),Hse=BigInt(35),zse=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n2=4096*32;function XR(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=Oc(e).substring(4),"0x"+n}function cy(t){return t==="0x"?null:gt(t)}function r2(t,e){try{return ia(t)}catch(n){$(!1,n.message,e,t)}}function Vh(t,e){return t==="0x"?0:Qe(t,e)}function Wt(t,e){if(t==="0x")return bn;const n=xe(t,e);return $(n<=zse,"value exceeds uint size",e,n),n}function Ot(t,e){const n=xe(t,"value"),r=Wn(n);return $(r.length<=32,"value too large",`tx.${e}`,n),r}function s2(t){return ia(t).map(e=>[e.address,e.storageKeys])}function $se(t,e){$(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n<t.length;n++)$(St(t[n],32),"invalid ${ param } hash",`value[${n}]`,t[n]);return t}function Gse(t){const e=qg(t);$(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:Vh(e[0],"nonce"),gasPrice:Wt(e[1],"gasPrice"),gasLimit:Wt(e[2],"gasLimit"),to:cy(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-Hse)/jse;o<bn&&(o=bn),n.chainId=o,$(o!==bn||r===Use||r===Vse,"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 Wse(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=xe(t.chainId,"tx.chainId"),$(!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")),El(n);let s=BigInt(27+e.yParity);return r!==bn?s=Ss.getChainIdV(r,e.v):BigInt(e.v)!==s&&$(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(Wn(s)),n.push(Wn(e.r)),n.push(Wn(e.s)),El(n)}function i2(t,e){let n;try{if(n=Vh(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{$(!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 Kse(t){const e=qg(ct(t).slice(1));$(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:Vh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:cy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:r2(e[8],"accessList")};return e.length===9||i2(n,e.slice(9)),n}function qse(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,s2(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"yParity")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x02",El(n)])}function Qse(t){const e=qg(ct(t).slice(1));$(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:Vh(e[1],"nonce"),gasPrice:Wt(e[2],"gasPrice"),gasLimit:Wt(e[3],"gasLimit"),to:cy(e[4]),value:Wt(e[5],"value"),data:we(e[6]),accessList:r2(e[7],"accessList")};return e.length===8||i2(n,e.slice(8)),n}function Jse(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,s2(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"recoveryParam")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x01",El(n)])}function Yse(t){let e=qg(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];$(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),$(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),$(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),$(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),$(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]}$(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:Vh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:cy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:r2(e[8],"accessList"),maxFeePerBlobGas:Wt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};r&&(s.blobs=r),$(s.to!=null,`invalid address for transaction type: ${n}`,"data",t),$(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let i=0;i<s.blobVersionedHashes.length;i++)$(St(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",t);return e.length===11||i2(s,e.slice(11)),s}function Xse(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,s2(t.accessList||[]),Ot(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),$se(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(r.push(Ot(e.yParity,"yParity")),r.push(Wn(e.r)),r.push(Wn(e.s)),n)?$t(["0x03",El([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):$t(["0x03",El(r)])}const uo=class uo{constructor(){J(this,kf);J(this,pi);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,ga);J(this,lo);J(this,ya);I(this,pi,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,ga,null),I(this,ya,null),I(this,lo,null)}get type(){return T(this,pi)}set type(e){switch(e){case null:I(this,pi,null);break;case 0:case"legacy":I(this,pi,0);break;case 1:case"berlin":case"eip-2930":I(this,pi,1);break;case 2:case"london":case"eip-1559":I(this,pi,2);break;case 3:case"cancun":case"eip-4844":I(this,pi,3);break;default:$(!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,xe(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:xe(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:xe(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:xe(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,xe(e,"value"))}get chainId(){return T(this,Af)}set chainId(e){I(this,Af,xe(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:ia(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:xe(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=T(this,ga);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){$(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)$(St(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}I(this,ga,e)}get blobs(){return T(this,ya)==null?null:T(this,ya).map(e=>Object.assign({},e))}set blobs(e){if(e==null){I(this,ya,null);return}const n=[],r=[];for(let s=0;s<e.length;s++){const i=e[s];if(wx(i)){ee(T(this,lo),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ct(i);if($(o.length<=n2,"blob is too large",`blobs[${s}]`,i),o.length!==n2){const u=new Uint8Array(n2);u.set(o),o=u}const a=T(this,lo).blobToKzgCommitment(o),l=we(T(this,lo).computeBlobKzgProof(o,a));n.push({data:we(o),commitment:we(a),proof:l}),r.push(XR(1,a))}else{const o=we(i.commitment);n.push({data:we(i.data),commitment:o,proof:we(i.proof)}),r.push(XR(1,o))}}I(this,ya,n),I(this,ga,r)}get kzg(){return T(this,lo)}set kzg(e){I(this,lo,e)}get hash(){return this.signature==null?null:en(fe(this,kf,fb).call(this,!0,!1))}get unsignedHash(){return en(this.unsignedSerialized)}get from(){return this.signature==null?null:Fse(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,fb).call(this,!0,!0)}get unsignedSerialized(){return fe(this,kf,fb).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,ga);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 uo.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 uo;if(typeof e=="string"){const r=ct(e);if(r[0]>=127)return uo.from(Gse(r));switch(r[0]){case 1:return uo.from(Qse(r));case 2:return uo.from(Kse(r));case 3:return uo.from(Yse(r))}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new uo;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&&($(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),$(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&($(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),$(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};pi=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,ga=new WeakMap,lo=new WeakMap,ya=new WeakMap,kf=new WeakSet,fb=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 Wse(this,r);case 1:return Jse(this,r);case 2:return qse(this,r);case 3:return Xse(this,r,n?this.blobs:null)}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let Hh=uo;const ZR=new Uint8Array(32);ZR.fill(0);const Zse=BigInt(-1),eP=BigInt(0),tP=BigInt(1),eie=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function tie(t){const e=ct(t),n=e.length%32;return n?$t([e,ZR.slice(n)]):we(e)}const nie=Xo(tP,32),rie=Xo(eP,32),nP={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o2=["name","version","chainId","verifyingContract","salt"];function rP(t){return function(e){return $(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const sie={name:rP("name"),version:rP("version"),chainId:function(t){const e=xe(t,"domain.chainId");return $(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):kl(e)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}$(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=ct(t,"domain.salt");return $(e.length===32,'invalid domain value "salt"',"domain.salt",t),we(e)}};function a2(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);$(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const s=Dh(eie,n?r-1:r),i=n?(s+tP)*Zse:eP;return function(o){const a=xe(o,"value");return $(a>=i&&a<=s,`value out-of-bounds for ${t}`,"value",a),Xo(n?o4(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return $(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const s=ct(r);return $(s.length===n,`invalid length for ${t}`,"value",r),tie(r)}}}switch(t){case"address":return function(e){return xl(gt(e),32)};case"bool":return function(e){return e?nie:rie};case"bytes":return function(e){return en(e)};case"string":return function(e){return Ol(e)}}return null}function sP(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function fy(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,sb);W(this,"primaryType");J(this,mp);J(this,co);J(this,Ef);I(this,co,new Map),I(this,Ef,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}=fy(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]){$(!u.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(l)}`,"types",e),u.add(c.name);const f=fy(c.type).base;$(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!a2(f)&&($(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);$(o.length!==0,"missing primary type","types",e),$(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Oe(this,{primaryType:o[0]});function a(l,u){$(!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,co).set(l,sP(l,i[l])+c.map(f=>sP(f,i[f])).join(""))}}get types(){return JSON.parse(T(this,mp))}getEncoder(e){let n=T(this,Ef).get(e);return n||(n=fe(this,sb,KL).call(this,e),T(this,Ef).set(e,n)),n}encodeType(e){const n=T(this,co).get(e);return $(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(a2(e))return r(e,n);const s=fy(e).array;if(s)return $(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),{});$(!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=nP[r];$(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:s})}return n.sort((r,s)=>o2.indexOf(r.name)-o2.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=[];o2.forEach(l=>{const u=e[l];u!=null&&(s[l]=sie[l](u),i.push({name:l,type:nP[l]}))});const o=ns.from(n);n=o.types;const a=Object.assign({},n);return $(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 xe(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return $(typeof u=="string","invalid string","value",u),u}$(!1,"unsupported type","type",l)})}}};mp=new WeakMap,co=new WeakMap,Ef=new WeakMap,sb=new WeakSet,KL=function(e){{const s=a2(e);if(s)return s}const n=fy(e).array;if(n){const s=n.prefix,i=this.getEncoder(s);return o=>{$(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let a=o.map(i);return T(this,co).has(s)&&(a=a.map(en)),en($t(a))}}const r=this.types[e];if(r){const s=Ol(T(this,co).get(e));return i=>{const o=r.map(({name:a,type:l})=>{const u=this.getEncoder(l)(i[a]);return T(this,co).has(l)?en(u):u});return o.unshift(s),$t(o)}}$(!1,`unknown type: ${e}`,"type",e)};let dy=ns;function Jn(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const iie=Jn("external public payable override".split(" ")),iP="constant external internal payable private public pure view override",oie=Jn(iP.split(" ")),oP="constructor error event fallback function receive struct",aP=Jn(oP.split(" ")),lP="calldata memory storage payable indexed",aie=Jn(lP.split(" ")),lie=[oP,lP,"tuple returns",iP].join(" "),uie=Jn(lie.split(" ")),cie={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},fie=new RegExp("^(\\s*)"),die=new RegExp("^([0-9]+)"),hie=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),uP=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),cP=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),ib=class ib{constructor(e){J(this,gp);J(this,Dn);J(this,Ns);I(this,Dn,0),I(this,Ns,e.slice())}get offset(){return T(this,Dn)}get length(){return T(this,Ns).length-T(this,Dn)}clone(){return new ib(T(this,Ns))}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,Yk).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,Yk).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,Ns).length)throw new Error("out-of-bounds");return T(this,Ns)[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,Ns).length;n++){const r=T(this,Ns)[n];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}};Dn=new WeakMap,Ns=new WeakMap,gp=new WeakSet,Yk=function(e=0,n=0){return new ib(T(this,Ns).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Ts=ib;function oa(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(fie);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=cie[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(hie),a){if(l.text=a[1],i+=l.text.length,uie.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(cP)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(die),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 fP(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 hy(t,e){if(e.peekKeyword(aP)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Gi(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 dP(t){let e=Gi(t,oie);return fP(e,Jn("constant payable nonpayable".split(" "))),fP(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 Wi(t,e){return t.popParams().map(n=>En.from(n,e))}function hP(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return xe(t.pop().text);throw new Error("invalid gas")}return null}function Nl(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const pie=new RegExp(/^(.*)\[([0-9]*)\]$/);function pP(t){const e=t.match(cP);if($(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);$(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);$(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const Lt={},dr=Symbol.for("_ethers_internal"),mP="_ParamTypeInternal",gP="_ErrorInternal",yP="_EventInternal",bP="_ConstructorInternal",wP="_FallbackInternal",AP="_FunctionInternal",vP="_StructInternal",rs=class rs{constructor(e,n,r,s,i,o,a,l){J(this,Cf);W(this,"name");W(this,"type");W(this,"baseType");W(this,"indexed");W(this,"components");W(this,"arrayLength");W(this,"arrayChildren");if(zg(e,Lt,"ParamType"),Object.defineProperty(this,dr,{value:mP}),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("");Oe(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,Cf,db).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(oa(e),n)}catch{$(!1,"invalid param type","obj",e)}else if(e instanceof Ts){let a="",l="",u=null;Gi(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=pP(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(Gi(e,aie).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;$(!r||typeof r=="string"&&r.match(uP),"invalid name","obj.name",r);let s=e.indexed;s!=null&&($(n,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(pie);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=pP(e.type),new rs(Lt,r||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[dr]===mP}};Cf=new WeakSet,db=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,Cf,db).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],Cf,db).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 En=rs;class Rl{constructor(e,n,r){W(this,"type");W(this,"inputs");zg(e,Lt,"Fragment"),r=Object.freeze(r.slice()),Oe(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{Rl.from(JSON.parse(e))}catch{}return Rl.from(oa(e))}if(e instanceof Ts)switch(e.peekKeyword(aP)){case"constructor":return Ki.from(e);case"error":return hr.from(e);case"event":return ci.from(e);case"fallback":case"receive":return qi.from(e);case"function":return fi.from(e);case"struct":return Pl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Ki.from(e);case"error":return hr.from(e);case"event":return ci.from(e);case"fallback":case"receive":return qi.from(e);case"function":return fi.from(e);case"struct":return Pl.from(e)}ee(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}$(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Ki.isFragment(e)}static isError(e){return hr.isFragment(e)}static isEvent(e){return ci.isFragment(e)}static isFunction(e){return fi.isFragment(e)}static isStruct(e){return Pl.isFragment(e)}}class py extends Rl{constructor(n,r,s,i){super(n,r,i);W(this,"name");$(typeof s=="string"&&s.match(uP),"invalid identifier","name",s),i=Object.freeze(i.slice()),Oe(this,{name:s})}}function zh(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class hr extends py{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,dr,{value:gP})}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(oa(e));if(e instanceof Ts){const n=hy("error",e),r=Wi(e);return Nl(e),new hr(Lt,n,r)}return new hr(Lt,e.name,e.inputs?e.inputs.map(En.from):[])}static isFragment(e){return e&&e[dr]===gP}}class ci extends py{constructor(n,r,s,i){super(n,"event",r,s);W(this,"anonymous");Object.defineProperty(this,dr,{value:yP}),Oe(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=>En.from(i)),new ci(Lt,n,r,!1).topicHash}static from(n){if(ci.isFragment(n))return n;if(typeof n=="string")try{return ci.from(oa(n))}catch{$(!1,"invalid event fragment","obj",n)}else if(n instanceof Ts){const r=hy("event",n),s=Wi(n,!0),i=!!Gi(n,Jn(["anonymous"])).has("anonymous");return Nl(n),new ci(Lt,r,s,i)}return new ci(Lt,n.name,n.inputs?n.inputs.map(r=>En.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[dr]===yP}}class Ki extends Rl{constructor(n,r,s,i,o){super(n,r,s);W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:bP}),Oe(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(Ki.isFragment(n))return n;if(typeof n=="string")try{return Ki.from(oa(n))}catch{$(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Ts){Gi(n,Jn(["constructor"]));const r=Wi(n),s=!!Gi(n,iie).has("payable"),i=hP(n);return Nl(n),new Ki(Lt,"constructor",r,s,i)}return new Ki(Lt,"constructor",n.inputs?n.inputs.map(En.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===bP}}class qi extends Rl{constructor(n,r,s){super(n,"fallback",r);W(this,"payable");Object.defineProperty(this,dr,{value:wP}),Oe(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(oa(n))}catch{$(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Ts){const r=n.toString(),s=n.peekKeyword(Jn(["fallback","receive"]));if($(s,"type must be fallback or receive","obj",r),n.popKeyword(Jn(["fallback","receive"]))==="receive"){const l=Wi(n);return $(l.length===0,"receive cannot have arguments","obj.inputs",l),Gi(n,Jn(["payable"])),Nl(n),new qi(Lt,[],!0)}let o=Wi(n);o.length?$(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[En.from("bytes")];const a=dP(n);if($(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Gi(n,Jn(["returns"])).has("returns")){const l=Wi(n);$(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return Nl(n),new qi(Lt,o,a==="payable")}if(n.type==="receive")return new qi(Lt,[],!0);if(n.type==="fallback"){const r=[En.from("bytes")],s=n.stateMutability==="payable";return new qi(Lt,r,s)}$(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[dr]===wP}}class fi extends py{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:AP}),o=Object.freeze(o.slice()),Oe(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=>En.from(i)),new fi(Lt,n,"view",r,[],null).selector}static from(n){if(fi.isFragment(n))return n;if(typeof n=="string")try{return fi.from(oa(n))}catch{$(!1,"invalid function fragment","obj",n)}else if(n instanceof Ts){const s=hy("function",n),i=Wi(n),o=dP(n);let a=[];Gi(n,Jn(["returns"])).has("returns")&&(a=Wi(n));const l=hP(n);return Nl(n),new fi(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 fi(Lt,n.name,r,n.inputs?n.inputs.map(En.from):[],n.outputs?n.outputs.map(En.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===AP}}class Pl extends py{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,dr,{value:vP})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Pl.from(oa(e))}catch{$(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ts){const n=hy("struct",e),r=Wi(e);return Nl(e),new Pl(Lt,n,r)}return new Pl(Lt,e.name,e.inputs?e.inputs.map(En.from):[])}static isFragment(e){return e&&e[dr]===vP}}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 mie=new RegExp(/^bytes([0-9]*)$/),gie=new RegExp(/^(u?int)([0-9]*)$/);let l2=null,xP=1024;function yie(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)),Nt(s,"CALL_EXCEPTION",{action:t,data:n,reason:i,transaction:l,invocation:o,revert:a})}const ob=class ob{constructor(){J(this,ba)}getDefaultValue(e){const n=e.map(s=>fe(this,ba,qf).call(this,En.from(s)));return new ny(n,"_").defaultValue()}encode(e,n){n4(n.length,e.length,"types/values length mismatch");const r=e.map(o=>fe(this,ba,qf).call(this,En.from(o))),s=new ny(r,"_"),i=new Ex;return s.encode(i,n),i.data}decode(e,n,r){const s=e.map(o=>fe(this,ba,qf).call(this,En.from(o)));return new ny(s,"_").decode(new Cx(n,r,xP))}static _setDefaultMaxInflation(e){$(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),xP=e}static defaultAbiCoder(){return l2==null&&(l2=new ob),l2}static getBuiltinCallException(e,n,r){return yie(e,n,r,ob.defaultAbiCoder())}};ba=new WeakSet,qf=function(e){if(e.isArray())return new Hre(fe(this,ba,qf).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new ny(e.components.map(r=>fe(this,ba,qf).call(this,r)),e.name);switch(e.baseType){case"address":return new Ure(e.name);case"bool":return new zre(e.name);case"string":return new Xre(e.name);case"bytes":return new $re(e.name);case"":return new Kre(e.name)}let n=e.type.match(gie);if(n){let r=parseInt(n[2]||"256");return $(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Yre(r/8,n[1]==="int",e.name)}if(n=e.type.match(mie),n){let r=parseInt(n[1]);return $(r!==0&&r<=32,"invalid bytes length","param",e),new Gre(r,e.name)}$(!1,"invalid type","type",e.type)};let Fc=ob;class bie{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();Oe(this,{fragment:e,name:s,signature:i,topic:n,args:r})}}class wie{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();Oe(this,{fragment:e,name:i,args:r,signature:o,selector:n,value:s})}}class Aie{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();Oe(this,{fragment:e,name:s,args:r,signature:i,selector:n})}}class kP{constructor(e){W(this,"hash");W(this,"_isIndexed");Oe(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const EP={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"},CP={"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&&EP[t.toString()]&&(e=EP[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}},su=class su{constructor(e){J(this,bi);W(this,"fragments");W(this,"deploy");W(this,"fallback");W(this,"receive");J(this,mi);J(this,gi);J(this,yi);J(this,Ln);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,I(this,yi,new Map),I(this,mi,new Map),I(this,gi,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)}Oe(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}Oe(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:($(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":l=T(this,yi);break;case"event":l=T(this,gi);break;case"error":l=T(this,mi);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Oe(this,{deploy:Ki.from("constructor()")}),Oe(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,bi,hb).call(this,e,null,!1);return $(n,"no matching function","key",e),n.name}hasFunction(e){return!!fe(this,bi,hb).call(this,e,null,!1)}getFunction(e,n){return fe(this,bi,hb).call(this,e,n||null,!0)}forEachFunction(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)}}getEventName(e){const n=fe(this,bi,pb).call(this,e,null,!1);return $(n,"no matching event","key",e),n.name}hasEvent(e){return!!fe(this,bi,pb).call(this,e,null,!1)}getEvent(e,n){return fe(this,bi,pb).call(this,e,n||null,!0)}forEachEvent(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)}}getError(e,n){if(St(e)){const s=e.toLowerCase();if(CP[s])return hr.from(CP[s].signature);for(const i of T(this,mi).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){const s=[];for(const[i,o]of T(this,mi))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(", ");$(!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,mi).get(e);return r||null}forEachError(e){const n=Array.from(T(this,mi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,mi).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);$(r,"unknown error","fragment",e),e=r}return $(Ht(n,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",n),this._decodeParams(e.inputs,Ht(n,4))}encodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);$(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);$(r,"unknown function","fragment",e),e=r}return $(Ht(n,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",n),this._decodeParams(e.inputs,Ht(n,4))}encodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);$(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);$(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);$(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);$(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=Xo(o):i.type.match(/^bytes/)?o=ene(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){$(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"?$(!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);$(o,"unknown event","eventFragment",e),e=o}const r=[],s=[],i=[];return e.anonymous||r.push(e.topicHash),$(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);$(h,"unknown event","eventFragment",e),e=h}if(r!=null&&!e.anonymous){const h=e.topicHash;$(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(En.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 kP(null);else if(o[p])m=new kP(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=xe(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 wie(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 bie(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=we(e),r=this.getError(Ht(n,0,4));if(!r)return null;const s=T(this,Ln).decode(r.inputs,Ht(n,4));return new Aie(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)}};mi=new WeakMap,gi=new WeakMap,yi=new WeakMap,Ln=new WeakMap,bi=new WeakSet,hb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,yi).values())if(i===o.selector)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){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(", ");$(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,yi).get(fi.from(e).format());return s||null},pb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,gi).values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,gi))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(", ");$(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,gi).get(ci.from(e).format());return s||null};let u2=su;const SP=BigInt(0);function jc(t){return t??null}function Kt(t){return t==null?null:t.toString()}class TP{constructor(e,n,r){W(this,"gasPrice");W(this,"maxFeePerGas");W(this,"maxPriorityFeePerGas");Oe(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 my(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]=xe(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=ia(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=>wx(s)?we(s):Object.assign({},s))),e}class vie{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,fo);I(this,fo,e.transactions.map(r=>typeof r!="string"?new Gh(r,n):r)),Oe(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,fo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=T(this,fo).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,fo).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,fo)[e];else{const r=e.toLowerCase();for(const s of T(this,fo))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;$(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return xie(this)}}fo=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());Oe(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 kie(this)}}class DP{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=SP;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Oe(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 _P(this)}reorderedEvent(e){return ee(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),OP(this,e)}}yp=new WeakMap;const Hk=class Hk{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,wa);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,wa,-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 Nn({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,wa),o=-1,a=i===-1;const l=async()=>{if(a)return null;const{blockNumber:d,nonce:h}=await Nn({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,wa)&&(o=T(this,wa)));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 w="replaced";y.data===this.data&&y.to===this.to&&y.value===this.value?w="repriced":y.data==="0x"&&y.from===y.to&&y.value===SP&&(w="cancelled"),ee(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:w==="replaced"||w==="cancelled",reason:w,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(Nt("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()"}),_P(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()"}),OP(this,e)}replaceableTransaction(e){$(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new Hk(this,this.provider);return I(n,wa,e),n}};wa=new WeakMap;let Gh=Hk;function xie(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function OP(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function _P(t){return{orphan:"drop-transaction",tx:t}}function kie(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 c2 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);Oe(this,{args:i,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class MP extends $h{constructor(n,r){super(n,n.provider);W(this,"error");Oe(this,{error:r})}}class Eie extends DP{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 c2(n,T(this,Sf),r)}catch(s){return new MP(n,s)}return n})}}Sf=new WeakMap;class f2 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 Eie(T(this,bp),this.provider,s)}}bp=new WeakMap;class NP extends c4{constructor(n,r,s,i){super(n,r,s);W(this,"log");Oe(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 Cie extends NP{constructor(e,n,r,s,i){super(e,n,r,new c2(i,e.interface,s));const o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Oe(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const RP=BigInt(0);function PP(t){return t&&typeof t.call=="function"}function IP(t){return t&&typeof t.estimateGas=="function"}function gy(t){return t&&typeof t.resolveName=="function"}function LP(t){return t&&typeof t.sendTransaction=="function"}function BP(t){if(t!=null){if(gy(t))return t;if(t.provider)return t.provider}}class Sie{constructor(e,n,r){J(this,wp);W(this,"fragment");if(Oe(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=Il(e.runner,"resolveName"),i=gy(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 FP(t,e){const n=Rn.dereference(t,"overrides");$(typeof n=="object","invalid overrides parameter","overrides",t);const r=my(n);return $(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),$(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Tie(t,e,n){const r=Il(t,"resolveName"),s=gy(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 Die(t){const e=async function(o){const a=await FP(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await Qn(a.from,BP(t.runner)));const l=t.interface,u=xe(a.value||RP,"overrides.value")===RP,c=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!c&&!u&&$(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),$(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data);const f=l.receive||l.fallback&&l.fallback.payable;return $(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),$(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(PP(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 bx(u)&&u.data?t.interface.makeError(u.data,l):u}},r=async function(o){const a=t.runner;ee(LP(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 f2(t.interface,u,l)},s=async function(o){const a=Il(t.runner,"estimateGas");return ee(IP(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 Oe(i,{_contract:t,estimateGas:s,populateTransaction:e,send:r,staticCall:n}),i}function Oie(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 FP(u.pop()),f.from&&(f.from=await Qn(f.from,BP(t.runner)))),c.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await Tie(t.runner,c.inputs,u);return Object.assign({},f,await Nn({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(LP(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 f2(t.interface,d,f)},o=async function(...u){const c=Il(t.runner,"estimateGas");return ee(IP(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(PP(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 bx(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 Oe(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 _ie(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 Sie(t,n(...s),s)};return Oe(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 yy=Symbol.for("_ethersInternal_contract"),jP=new WeakMap;function Mie(t,e){jP.set(t[yy],e)}function Rr(t){return jP.get(t[yy])}function Nie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function d2(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 $(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),$(r,"unknown fragment","event",e),n=[r.topicHash]):Nie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):$(!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 d2(t,e)).tag)||null}async function UP(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 d2(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,w=s?t.interface.decodeEventLog(s,g.data,g.topics):[];p2(t,n,w,A=>new Cie(t,A,n,v,g))}else p2(t,n,[],v=>new NP(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 h2=Promise.resolve();async function Rie(t,e,n,r){await h2;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 p2(t,e,n,r){try{await h2}catch{}const s=Rie(t,e,n,r);return h2=s,await s}const by=["then"];VL=yy;const Ap=class Ap{constructor(e,n,r,s){W(this,"target");W(this,"interface");W(this,"runner");W(this,"filters");W(this,VL);W(this,"fallback");$(typeof e=="string"||AR(e),"invalid value for Contract target","target",e),r==null&&(r=null);const i=u2.from(n);Oe(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,yy,{value:{}});let o,a=null,l=null;if(s){const f=Ll(r);l=new f2(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(!gy(f))throw Nt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(d=>{if(d==null)throw Nt("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});Mie(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const c=new Proxy({},{get:(f,d,h)=>{if(typeof d=="symbol"||by.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)=>by.indexOf(d)>=0?Reflect.has(f,d):Reflect.has(f,d)||this.interface.hasEvent(String(d))});return Oe(this,{filters:c}),Oe(this,{fallback:i.receive||i.fallback?Die(this):null}),new Proxy(this,{get:(f,d,h)=>{if(typeof d=="symbol"||d in f||by.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||by.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()),Oie(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),_ie(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 d2(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 c2(f,this.interface,d)}catch(h){return new MP(f,h)}return new $h(f,c)})}async on(e,n){const r=await UP(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await UP(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await p2(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 m2=Ap;function Pie(){return m2}class Uc extends Pie(){}function g2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):$(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class Iie{constructor(e){W(this,"name");Oe(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 VP=new RegExp("^(ipfs)://(.*)$","i"),HP=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),VP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],Tf=class Tf{constructor(e,n,r){J(this,va);W(this,"provider");W(this,"address");W(this,"name");J(this,Aa);J(this,iu);Oe(this,{provider:e,address:n,name:r}),I(this,Aa,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,Aa)==null&&I(this,Aa,(async()=>{try{return await T(this,iu).supportsInterface("0x9061b923")}catch(e){if(gn(e,"CALL_EXCEPTION"))return!1;throw I(this,Aa,null),e}})()),await T(this,Aa)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await fe(this,va,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,va,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 Iie&&i.supportsCoinType(e)){n=i;break}if(n==null)return null;const r=await fe(this,va,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,va,Qf).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await fe(this,va,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}://${rne("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<HP.length;r++){const s=n.match(HP[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=g2(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}",Xo(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=g2(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(VP)==null)return e.push({type:"!imageUrl-ipfs",value:p}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:p}),p=g2(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,ab,qL).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(".")}}};Aa=new WeakMap,iu=new WeakMap,va=new WeakSet,Qf=async function(e,n){n=(n||[]).slice();const r=T(this,iu).interface;n.unshift(e2(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(e),ee(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),n=[Lse(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},ab=new WeakSet,qL=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(e2(n),{enableCcipRead:!0});return i===Rh?null:i}catch(s){throw s}return null},J(Tf,ab);let wy=Tf;const zP=BigInt(0);function lt(t,e){return function(n){return n==null?e:t(n)}}function Ay(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 Lie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}$(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Vc(t){return $(St(t,!0),"invalid data","value",t),t}function Cn(t){return $(St(t,32),"invalid hash","value",t),t}const Bie=Kh({address:gt,blockHash:Cn,blockNumber:Qe,data:Vc,index:Qe,removed:lt(Lie,!1),topics:Ay(Cn),transactionHash:Cn,transactionIndex:Qe},{index:["logIndex"]});function Fie(t){return Bie(t)}const jie=Kh({hash:lt(Cn),parentHash:Cn,parentBeaconBlockRoot:lt(Cn,null),number:Qe,timestamp:Qe,nonce:lt(Vc),difficulty:xe,gasLimit:xe,gasUsed:xe,stateRoot:lt(Cn,null),receiptsRoot:lt(Cn,null),blobGasUsed:lt(xe,null),excessBlobGas:lt(xe,null),miner:lt(gt),prevRandao:lt(Cn,null),extraData:Vc,baseFeePerGas:lt(xe)},{prevRandao:["mixHash"]});function Uie(t){const e=jie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:$P(n)),e}const Vie=Kh({transactionIndex:Qe,blockNumber:Qe,transactionHash:Cn,address:gt,topics:Ay(Cn),data:Vc,index:Qe,blockHash:Cn},{index:["logIndex"]});function Hie(t){return Vie(t)}const zie=Kh({to:lt(gt,null),from:lt(gt,null),contractAddress:lt(gt,null),index:Qe,root:lt(we),gasUsed:xe,blobGasUsed:lt(xe,null),logsBloom:lt(Vc),blockHash:Cn,hash:Cn,logs:Ay(Hie),blockNumber:Qe,cumulativeGasUsed:xe,effectiveGasPrice:lt(xe),blobGasPrice:lt(xe,null),status:lt(Qe),type:lt(Qe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function $ie(t){return zie(t)}function $P(t){t.to&&xe(t.to)===zP&&(t.to="0x0000000000000000000000000000000000000000");const e=Kh({hash:Cn,index:lt(Qe,void 0),type:n=>n==="0x"||n==null?0:Qe(n),accessList:lt(ia,null),blobVersionedHashes:lt(Ay(Cn,!0),null),blockHash:lt(Cn,null),blockNumber:lt(Qe,null),transactionIndex:lt(Qe,null),from:gt,gasPrice:lt(xe),maxPriorityFeePerGas:lt(xe),maxFeePerGas:lt(xe),maxFeePerBlobGas:lt(xe,null),gasLimit:xe,to:lt(gt,null),value:xe,nonce:Qe,data:Vc,creates:lt(gt,null),chainId:lt(xe,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=Fre(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&&xe(e.blockHash)===zP&&(e.blockHash=null),e}const Gie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class qh{constructor(e){W(this,"name");Oe(this,{name:e})}clone(){return new qh(this.name)}}class vy 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),$(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),Oe(this,s)}clone(){return new vy(this.effectiveBlock,this)}}class xy extends qh{constructor(n,r){super("org.ethers.plugins.network.Ens");W(this,"address");W(this,"targetNetwork");Oe(this,{address:n||Gie,targetNetwork:r??1})}clone(){return new xy(this.address,this.targetNetwork)}}class Wie 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 y2=new Map,_f=class _f{constructor(e,n){J(this,Df);J(this,Of);J(this,xa);I(this,Df,e),I(this,Of,xe(n)),I(this,xa,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,xe(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===xe(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===xe(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===xe(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(T(this,xa).values())}attachPlugin(e){if(T(this,xa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,xa).set(e.name,e.clone()),this}getPlugin(e){return T(this,xa).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new _f(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 vy;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=ia(e.accessList);for(const i in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[i].storageKeys.length}return r}static from(e){if(Kie(),e==null)return _f.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const n=y2.get(e);if(n)return n();if(typeof e=="bigint")return new _f("unknown",e);$(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){$(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const n=new _f(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&n.attachPlugin(new xy(e.ensAddress,e.ensNetwork)),n}$(!1,"invalid network","network",e)}static register(e,n){typeof e=="number"&&(e=BigInt(e));const r=y2.get(e);r&&$(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),y2.set(e,n)}};Df=new WeakMap,Of=new WeakMap,xa=new WeakMap;let rn=_f;function GP(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 WP(t){return new Wie(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:GP(a.maxFee,9),maxPriorityFeePerGas:GP(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 KP=!1;function Kie(){if(KP)return;KP=!0;function t(e,n,r){const s=function(){const i=new rn(e,n);return r.ensNetwork!=null&&i.attachPlugin(new xy(null,r.ensNetwork)),i.attachPlugin(new vy),(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:[WP("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[WP("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 b2(t){return JSON.parse(JSON.stringify(t))}class qie{constructor(e){J(this,Mf);J(this,ho);J(this,ss);J(this,ka);J(this,wi);I(this,ho,e),I(this,ss,null),I(this,ka,4e3),I(this,wi,-2)}get pollingInterval(){return T(this,ka)}set pollingInterval(e){I(this,ka,e)}start(){T(this,ss)||(I(this,ss,T(this,ho)._setTimeout(fe(this,Mf,mb).bind(this),T(this,ka))),fe(this,Mf,mb).call(this))}stop(){T(this,ss)&&(T(this,ho)._clearTimeout(T(this,ss)),I(this,ss,null))}pause(e){this.stop(),e&&I(this,wi,-2)}resume(){this.start()}}ho=new WeakMap,ss=new WeakMap,ka=new WeakMap,wi=new WeakMap,Mf=new WeakSet,mb=async function(){try{const e=await T(this,ho).getBlockNumber();if(T(this,wi)===-2){I(this,wi,e);return}if(e!==T(this,wi)){for(let n=T(this,wi)+1;n<=e;n++){if(T(this,ss)==null)return;await T(this,ho).emit("block",n)}I(this,wi,e)}}catch{}T(this,ss)!=null&&I(this,ss,T(this,ho)._setTimeout(fe(this,Mf,mb).bind(this),T(this,ka)))};class w2{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 Qie extends w2{constructor(n,r){super(n);J(this,Nf);J(this,po);I(this,Nf,r),I(this,po,-2)}pause(n){n&&I(this,po,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(T(this,Nf));s!=null&&(T(this,po)===-2?I(this,po,s.number):s.number>T(this,po)&&(r.emit(T(this,Nf),s.number),I(this,po,s.number)))}}Nf=new WeakMap,po=new WeakMap;class Jie extends w2{constructor(n,r){super(n);J(this,lb);I(this,lb,b2(r))}async _poll(n,r){throw new Error("@TODO")}}lb=new WeakMap;class Yie extends w2{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 A2{constructor(e,n){J(this,ub);J(this,mo);J(this,Pf);J(this,If);J(this,Ca);J(this,is);I(this,mo,e),I(this,Pf,b2(n)),I(this,If,fe(this,ub,QL).bind(this)),I(this,Ca,!1),I(this,is,-2)}start(){T(this,Ca)||(I(this,Ca,!0),T(this,is)===-2&&T(this,mo).getBlockNumber().then(e=>{I(this,is,e)}),T(this,mo).on("block",T(this,If)))}stop(){T(this,Ca)&&(I(this,Ca,!1),T(this,mo).off("block",T(this,If)))}pause(e){this.stop(),e&&I(this,is,-2)}resume(){this.start()}}mo=new WeakMap,Pf=new WeakMap,If=new WeakMap,Ca=new WeakMap,is=new WeakMap,ub=new WeakSet,QL=async function(e){if(T(this,is)===-2)return;const n=b2(T(this,Pf));n.fromBlock=T(this,is)+1,n.toBlock=e;const r=await T(this,mo).getLogs(n);if(r.length===0){T(this,is)<e-60&&I(this,is,e-60);return}for(const s of r)T(this,mo).emit(T(this,Pf),s),I(this,is,s.blockNumber)};const Xie=BigInt(2),Zie=10;function ky(t){return t&&typeof t.then=="function"}function Ey(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 Cy{constructor(e){W(this,"name");Oe(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function eoe(t){return JSON.parse(JSON.stringify(t))}function v2(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function x2(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:Ey("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Ey("orphan",n),filter:eoe(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?v2(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=v2(s.map(a=>a.toLowerCase()))}return{filter:r,tag:Ey("event",r),type:"event"}}$(!1,"unknown ProviderEvent","event",t)}function k2(){return new Date().getTime()}const toe={cacheTimeout:250,pollingInterval:4e3};class Sy{constructor(e,n){J(this,st);J(this,Bn);J(this,Sa);J(this,Fn);J(this,Lf);J(this,Fr);J(this,lu);J(this,Ta);J(this,go);J(this,kp);J(this,as);J(this,Bf);J(this,Ff);if(I(this,Ff,Object.assign({},toe,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,go,-1),I(this,Ta,new Map),I(this,Bn,new Map),I(this,Sa,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,Sa).values())}attachPlugin(e){if(T(this,Sa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,Sa).set(e.name,e.connect(this)),this}getPlugin(e){return T(this,Sa).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 vie(Uie(e),this)}_wrapLog(e,n){return new $h(Fie(e),this)}_wrapTransactionReceipt(e,n){return new DP($ie(e),this)}_wrapTransactionResponse(e,n){return new Gh($P(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,go)>=0&&I(this,go,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,go)>=0?kl(T(this,go)+e):this.getBlockNumber().then(n=>kl(n+e));$(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?v2(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=my(e),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const i=Qn(n[s],this);ky(i)?r.push(async function(){n[s]=await i}()):n[s]=i}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);ky(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 Nn({_block:fe(this,st,eE).call(this,"latest",!1),gasPrice:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getGasPrice"});return xe(c,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getPriorityFee"});return xe(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*Xie+l),new TP(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 TP(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return ky(n)&&(n=await n),xe(await fe(this,st,jr).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await Nn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await fe(this,st,Zk).call(this,fe(this,st,Xk).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return xe(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=xe(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 Nn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=Hh.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 Nn({network:this.getNetwork(),params:fe(this,st,eE).call(this,e,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(e){const{network:n,params:r}=await Nn({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 Nn({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 Nn({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);ky(n)&&(n=await n);const{network:r,params:s}=await Nn({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 wy.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=e2(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await wy.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(Nt("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:k2()})}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 Cy(e.type);case"block":{const n=new qie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Qie(this,e.type);case"event":return new A2(this,e.filter);case"transaction":return new Yie(this,e.hash);case"orphan":return new Jie(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,gb).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,gb).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,_p).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 c4(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,_p).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,_p).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,_p).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,gb).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,go,-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=k2()-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=k2(),setTimeout(e.func,n)}}}}Bn=new WeakMap,Sa=new WeakMap,Fn=new WeakMap,Lf=new WeakMap,Fr=new WeakMap,lu=new WeakMap,Ta=new WeakMap,go=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=Ey(e.method,e);let s=T(this,Ta).get(r);return s||(s=this._perform(e),T(this,Ta).set(r,s),setTimeout(()=>{T(this,Ta).get(r)===s&&T(this,Ta).delete(r)},n)),await s},Xk=async function(e,n,r){ee(r<Zie,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:n,enableCcipRead:!0})});const s=my(e);try{return we(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(i){if(!this.disableCcipRead&&bx(i)&&i.data&&r>=0&&n==="latest"&&s.to!=null&&Ht(i.data,0,4)==="0x556f1830"){const o=i.data,a=await Qn(s.to,this);let l;try{l=ooe(Ht(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,ioe([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const f=await fe(this,st,Xk).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 Nn({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})))},eE=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})},_p=async function(e,n){let r=await x2(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await x2({orphan:"drop-log",log:n[0]},this)),T(this,Bn).get(r.tag)||null},gb=async function(e){const n=await x2(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 noe(t,e){try{const n=E2(t,e);if(n)return Sc(n)}catch{}return null}function E2(t,e){if(t==="0x")return null;try{const n=Qe(Ht(t,e,e+32)),r=Qe(Ht(t,n,n+32));return Ht(t,n+32,n+32+r)}catch{}return null}function qP(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 roe(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const soe=new Uint8Array([]);function ioe(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(soe),n+=32;for(let r=0;r<t.length;r++){const s=ct(t[r]);e[r]=qP(n),e.push(qP(s.length)),e.push(roe(s)),n+=32+Math.ceil(s.length/32)*32}return $t(e)}const QP="0x0000000000000000000000000000000000000000000000000000000000000000";function ooe(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};ee(Ec(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Ht(t,0,32);ee(Ht(n,0,12)===Ht(QP,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Ht(n,12);try{const r=[],s=Qe(Ht(t,32,64)),i=Qe(Ht(t,s,s+32)),o=Ht(t,s+32);for(let a=0;a<i;a++){const l=noe(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=E2(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(Ht(t,100,128)===Ht(QP,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Ht(t,96,100);try{const r=E2(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 Hc(t,e){if(t.provider)return t.provider;ee(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function JP(t,e){let n=my(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])=>($(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else n.from=t.getAddress();return await Nn(n)}class aoe{constructor(e){W(this,"provider");Oe(this,{provider:e||null})}async getNonce(e){return Hc(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await JP(this,e)}async populateTransaction(e){const n=Hc(this,"populateTransaction"),r=await JP(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=xe(r.chainId);$(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)?$(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&i&&$(!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 Nn(r)}async estimateGas(e){return Hc(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Hc(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Hc(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Hc(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const s=Hh.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}}const YP=new Set;function zc(t){YP.has(t)||(YP.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 loe(t){return JSON.parse(JSON.stringify(t))}class XP{constructor(e){J(this,Oa);J(this,Yn);J(this,Ai);J(this,uu);J(this,Da);J(this,cu);J(this,jf);I(this,Yn,e),I(this,Ai,null),I(this,uu,fe(this,Oa,tE).bind(this)),I(this,Da,!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,Da)||(I(this,Da,!0),fe(this,Oa,tE).call(this,-2))}stop(){T(this,Da)&&(I(this,Da,!1),I(this,jf,!0),fe(this,Oa,nE).call(this),T(this,Yn).off("block",T(this,uu)))}pause(e){e&&fe(this,Oa,nE).call(this),T(this,Yn).off("block",T(this,uu))}resume(){this.start()}}Yn=new WeakMap,Ai=new WeakMap,uu=new WeakMap,Da=new WeakMap,cu=new WeakMap,jf=new WeakMap,Oa=new WeakSet,tE=async function(e){try{T(this,Ai)==null&&I(this,Ai,this._subscribe(T(this,Yn)));let n=null;try{n=await T(this,Ai)}catch(i){if(!gn(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(n==null){I(this,Ai,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))},nE=function(){const e=T(this,Ai);e&&(I(this,Ai,null),e.then(n=>{T(this,Yn).destroyed||T(this,Yn).send("eth_uninstallFilter",[n])}))};class uoe extends XP{constructor(n,r){super(n);J(this,fu);I(this,fu,loe(r))}_recover(n){return new A2(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 coe extends XP{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const foe="bigint,boolean,function,number,string,symbol".split(/,/g);function Ty(t){if(t==null||foe.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(Ty);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 doe(t){return new Promise(e=>{setTimeout(e,t)})}function $c(t){return t&&t.toLowerCase()}function ZP(t){return t&&typeof t.pollingInterval=="number"}const e8={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class C2 extends aoe{constructor(n,r){super(n);W(this,"address");r=gt(r),Oe(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=Ty(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const a=await Qn(o,this.provider);$(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",Nt("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=Ty(n);if(r.from){const i=await Qn(r.from,this.provider);$(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=Ty(s),o=await dy.resolveNames(n,r,i,async a=>{const l=await Qn(a);return $(l!=null,"TypedData does not support null address","value",a),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(dy.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 t8 extends Sy{constructor(n,r){super(n,r);J(this,Ep);J(this,du);J(this,Uf);J(this,yo);J(this,vi);J(this,Rs);J(this,ls);J(this,mr);I(this,Uf,1),I(this,du,Object.assign({},e8,r||{})),I(this,yo,[]),I(this,vi,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"?($(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&I(this,ls,rn.from(n))):s&&($(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&&xe(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(xe(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(xe(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",Nt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await doe(1e3)}fe(this,Ep,rE).call(this)})())}async _waitUntilReady(){if(T(this,Rs)!=null)return await T(this,Rs).promise}_getSubscriber(n){return n.type==="pending"?new coe(this):n.type==="event"?this._getOption("polling")?new A2(this,n.filter):new uoe(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new Cy("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(xe(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=we(n[s]))}),n.accessList&&(r.accessList=ia(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 Nt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){const l=S2(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(poe(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return Nt("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 Nt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return Nt("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Nt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:i}});if(o.match(/only replay-protected/i))return Nt("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?Nt("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:i,payload:n}}):Nt("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=Tp(this,Uf)._++,i=new Promise((o,a)=>{T(this,yo).push({resolve:o,reject:a,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return fe(this,Ep,rE).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 C2(this,i[n])}const{accounts:s}=await Nn({network:this.getNetwork(),accounts:r});n=gt(n);for(const i of s)if(gt(i)===n)return new C2(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new C2(this,r))}destroy(){T(this,vi)&&(clearTimeout(T(this,vi)),I(this,vi,null));for(const{payload:n,reject:r}of T(this,yo))r(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));I(this,yo,[]),super.destroy()}}du=new WeakMap,Uf=new WeakMap,yo=new WeakMap,vi=new WeakMap,Rs=new WeakMap,ls=new WeakMap,mr=new WeakMap,Ep=new WeakSet,rE=function(){if(T(this,vi))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");I(this,vi,setTimeout(()=>{I(this,vi,null);const r=T(this,yo);for(I(this,yo,[]);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(Nt("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=Nt("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 hoe extends t8{constructor(n,r){super(n,r);J(this,_a);let s=this._getOption("pollingInterval");s==null&&(s=e8.pollingInterval),I(this,_a,s)}_getSubscriber(n){const r=super._getSubscriber(n);return ZP(r)&&(r.pollingInterval=T(this,_a)),r}get pollingInterval(){return T(this,_a)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");I(this,_a,n),this._forEachSubscriber(r=>{ZP(r)&&(r.pollingInterval=T(this,_a))})}}_a=new WeakMap;class Qi extends hoe{constructor(n,r,s){n==null&&(n="http://localhost:8545");super(r,s);J(this,Vf);typeof n=="string"?I(this,Vf,new Kn(n)):I(this,Vf,n.clone())}_getConnection(){return T(this,Vf).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}}Vf=new WeakMap;function S2(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=S2(t[e]);if(n)return n}return null}if(typeof t=="string")try{return S2(JSON.parse(t))}catch{}return null}function T2(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)T2(t[n],e);if(typeof t=="string")try{return T2(JSON.parse(t),e)}catch{}}}function poe(t){const e=[];return T2(t,e),e}const Dy="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function moe(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"}$(!1,"unsupported network","network",t)}class Oy extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Dy);const i={polling:!0,staticNetwork:s},o=Oy.getRequest(s,r);super(o,s,i);W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new Oy(n,this.apiKey)}catch{}return super._getProvider(n)}static getRequest(n,r){r==null&&(r=Dy);const s=new Kn(`https://${moe(n.name)}/${r}`);return s.allowGzip=!0,r===Dy&&(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===Dy}}const _y="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function goe(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"}$(!1,"unsupported network","network",t)}class My extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=_y);const i=My.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new My(n,this.apiKey)}catch{}return super._getProvider(n)}async _perform(n){if(n.method==="getTransactionResult"){const{trace:r,tx:s}=await Nn({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===_y}static getRequest(n,r){r==null&&(r=_y);const s=new Kn(`https://${goe(n.name)}/v2/${r}`);return s.allowGzip=!0,r===_y&&(s.retryFunc=async(i,o,a)=>(zc("alchemy"),!0)),s}}function Ny(t){switch(t){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}$(!1,"unsupported network","network",t)}function yoe(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"}$(!1,"unsupported network","network",t)}class Ry extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Ny(s.name));const i=Ry.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new Ry(n,this.apiKey)}catch{}return super._getProvider(n)}isCommunityResource(){return this.apiKey===Ny(this._network.name)}static getRequest(n,r){r==null&&(r=Ny(n.name));const s=new Kn(`https://${yoe(n.name)}/${r}`);return s.allowGzip=!0,r===Ny(n.name)&&(s.retryFunc=async(i,o,a)=>(zc("ChainstackProvider"),!0)),s}}class boe extends Qi{constructor(e){e==null&&(e="mainnet");const n=rn.from(e);$(n.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",n,{staticNetwork:n})}}const n8=2e3;function woe(t){return t&&typeof t.then=="function"}const Aoe="org.ethers.plugins.provider.Etherscan",voe=["enableCcipRead"];let xoe=1;class koe extends Sy{constructor(n,r){const s=r??null;super();W(this,"network");W(this,"apiKey");J(this,Hf);const i=rn.from(n);I(this,Hf,i.getPlugin(Aoe)),Oe(this,{apiKey:s,network:i}),this.getBaseUrl()}getBaseUrl(){if(T(this,Hf))return T(this,Hf).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"}$(!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=xoe++,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,n8)):p&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),d.throwThrottleError(h.result,n8)),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(voe.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="["+ia(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=Hh.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);woe(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}}Hf=new WeakMap;function Eoe(){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 Coe=Eoe().WebSocket;class D2{constructor(e,n){J(this,xi);J(this,Cp);J(this,Ma);J(this,hu);J(this,Na);I(this,xi,e),I(this,Cp,JSON.stringify(n)),I(this,Ma,null),I(this,hu,null),I(this,Na,null)}get filter(){return JSON.parse(T(this,Cp))}start(){I(this,Ma,T(this,xi).send("eth_subscribe",this.filter).then(e=>(T(this,xi)._register(e,this),e)))}stop(){T(this,Ma).then(e=>{T(this,xi).destroyed||T(this,xi).send("eth_unsubscribe",[e])}),I(this,Ma,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,Ma)!=null&&T(this,hu)===null){let n=T(this,Na);n==null?n=this._emit(T(this,xi),e):n=n.then(async()=>{await this._emit(T(this,xi),e)}),I(this,Na,n.then(()=>{T(this,Na)===n&&I(this,Na,null)}))}}async _emit(e,n){throw new Error("sub-classes must implemente this; _emit")}}xi=new WeakMap,Cp=new WeakMap,Ma=new WeakMap,hu=new WeakMap,Na=new WeakMap;class Soe extends D2{constructor(e){super(e,["newHeads"])}async _emit(e,n){e.emit("block",parseInt(n.number))}}class Toe extends D2{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,n){e.emit("pending",n)}}class Doe extends D2{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 Ooe extends t8{constructor(n,r){const s=Object.assign({},r??{});$(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,Ra);I(this,pu,new Map),I(this,zf,new Map),I(this,Ra,new Map)}_getSubscriber(n){switch(n.type){case"close":return new Cy("close");case"block":return new Soe(this);case"pending":return new Toe(this);case"event":return new Doe(this,n.filter);case"orphan":if(n.filter.orphan==="drop-log")return new Cy("drop-log")}return super._getSubscriber(n)}_register(n,r){T(this,zf).set(n,r);const s=T(this,Ra).get(n);if(s){for(const i of s)r._handleMessage(i);T(this,Ra).delete(n)}}async _send(n){$(!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",Nt("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,Ra).get(s);o==null&&(o=[],T(this,Ra).set(s,o)),o.push(r.params.result)}}else{this.emit("error",Nt("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,Ra=new WeakMap;class r8 extends Ooe{constructor(n,r,s){super(r,s);J(this,mu);J(this,Ps);typeof n=="string"?(I(this,mu,()=>new Coe(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 _oe(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"}$(!1,"unsupported network","network",t)}class Moe extends r8{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");Oe(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===Qh}}class Jh extends Qi{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");Oe(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 Moe(n,r)}static getRequest(n,r,s){r==null&&(r=Qh),s==null&&(s=null);const i=new Kn(`https://${_oe(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 Py="919b412a057b5e9c9b6dce193c5a60242d6efadb";function Noe(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"}$(!1,"unsupported network","network",t)}class Iy extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Py);const i=Iy.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"token");Oe(this,{token:r})}_getProvider(n){try{return new Iy(n,this.token)}catch{}return super._getProvider(n)}isCommunityResource(){return this.token===Py}static getRequest(n,r){r==null&&(r=Py);const s=new Kn(`https://${Noe(n.name)}/${r}`);return s.allowGzip=!0,r===Py&&(s.retryFunc=async(i,o,a)=>(zc("QuickNodeProvider"),!0)),s}}const Roe=BigInt("1"),Poe=BigInt("2");function Ioe(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 Loe(t){return new Promise(e=>{setTimeout(e,t)})}function O2(){return new Date().getTime()}function _2(t){return JSON.stringify(t,(e,n)=>typeof n=="bigint"?{type:"bigint",value:n.toString()}:n)}const s8={stallTimeout:400,priority:1,weight:1},i8={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 Boe(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=O2()}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 M2(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 Ly(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 N2(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]+Roe)/Poe}function R2(t,e){const n=Ly(t,e);if(n!==void 0)return n;for(const r of e)if(r.value)return r.value}function Foe(t,e){if(t===1)return Qe(N2(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 joe extends Sy{constructor(n,r,s){super(r,s);J(this,yr);W(this,"quorum");W(this,"eventQuorum");W(this,"eventWorkers");J(this,gr);J(this,bo);J(this,$f);I(this,gr,n.map(i=>i instanceof Sy?Object.assign({provider:i},s8,i8):Object.assign({},s8,i,i8))),I(this,bo,-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,$(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(xe(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(M2({result:d}),{weight:c})}catch(d){o[f]=Object.assign(M2({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=Ly(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=R2(this.quorum,o);if(ee(l!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:n,results:o.map(_2)}}),l instanceof Error)throw l;return l}await fe(this,yr,YL).call(this);const r=new Set;let s=0;for(;;){const o=fe(this,yr,sE).call(this,r,n);if(o==null||(s+=o.config.weight,s>=this.quorum))break}const i=await fe(this,yr,iE).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,bo=new WeakMap,$f=new WeakMap,yr=new WeakSet,JL=function(n){const r=Array.from(n).map(i=>i.config),s=T(this,gr).slice();Ioe(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},sE=function(n,r){const s=fe(this,yr,JL).call(this,n);if(s==null)return null;const i={config:s,result:null,didBump:!1,perform:null,staller:null},o=O2();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=O2()-o;s._totalTime+=a,s.rollingDuration=.95*s.rollingDuration+.05*a,i.perform=null})(),i.staller=(async()=>{await Loe(s.stallTimeout),i.staller=null})(),n.add(i),i},YL=async function(){let n=T(this,$f);if(!n){const r=[];T(this,gr).forEach(s=>{r.push((async()=>{await Boe(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},XL=async function(n,r){const s=[];for(const i of n)if(i.result!=null){const{tag:o,value:a}=M2(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,bo)===-2&&I(this,bo,Math.ceil(Qe(N2(this.quorum,T(this,gr).filter(o=>!o._lastFatalError).map(o=>({value:o.blockNumber,tag:Qe(o.blockNumber).toString(),weight:o.weight}))))));const i=Foe(this.quorum,s);return i===void 0?void 0:(i>T(this,bo)&&I(this,bo,i),T(this,bo))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return N2(this.quorum,s);case"getBlock":return"blockTag"in r&&r.blockTag==="pending"?R2(this.quorum,s):Ly(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return Ly(this.quorum,s);case"broadcastTransaction":return R2(this.quorum,s)}ee(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${_2(r.method)})`})}},iE=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,XL).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,sE).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=>_2(a.result))}}),await Promise.race(s),await fe(this,yr,iE).call(this,n,r)};function Uoe(t){return t&&typeof t.send=="function"&&typeof t.close=="function"}const Voe="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function Hoe(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 Qi(t);if(typeof t=="string"&&t.match(/^wss?:/)||Uoe(t))return new r8(t);let r=null;try{r=rn.from(t)}catch{}const s=[];if(n("publicPolygon")&&r&&(r.name==="matic"?s.push(new Qi("https://polygon-rpc.com/",r,{staticNetwork:r})):r.name==="matic-amoy"&&s.push(new Qi("https://rpc-amoy.polygon.technology/",r,{staticNetwork:r}))),n("alchemy"))try{s.push(new My(t,e.alchemy))}catch{}if(n("ankr")&&e.ankr!=null)try{s.push(new Oy(t,e.ankr))}catch{}if(n("chainstack"))try{s.push(new Ry(t,e.chainstack))}catch{}if(n("cloudflare"))try{s.push(new boe(t))}catch{}if(n("etherscan"))try{s.push(new koe(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 Iy(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&&Voe.indexOf(r.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new joe(s,void 0,{quorum:i})}const zoe=async(t,e)=>{const n={name:t,isEns:!1};if(!e)throw new Error("cannot fetch ens name without a provider url");if(!jre(t))return n;try{const r=await $oe(t,e);r&&(n.name=r,n.isEns=!0)}catch(r){console.log(r)}return n},$oe=async(t,e)=>await Goe(e).lookupAddress(t),Goe=t=>Hoe(t),Woe=(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 Koe(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 qoe=new _t("suggestion");function Qoe({pluginKey:t=qoe,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=Koe}){let h;const p=c==null?void 0:c(),m=new bt({key:t,view(){return{update:async(g,y)=>{var v,w,A,x,k,C,O;const _=(v=this.key)===null||v===void 0?void 0:v.getState(y),D=(w=this.key)===null||w===void 0?void 0:w.getState(g.state),R=_.active&&D.active&&_.range.from!==D.range.from,L=!_.active&&D.active,F=_.active&&!D.active,G=!L&&!F&&_.query!==D.query,B=L,H=G||R,Q=F;if(!B&&!H&&!Q)return;const te=Q&&!B?_: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:Ee}=(pe=this.key)===null||pe===void 0?void 0:pe.getState(e.state),Re=g.dom.querySelector(`[data-decoration-id="${Ee}"]`);return(Re==null?void 0:Re.getBoundingClientRect())||null}:null},B&&((A=p==null?void 0:p.onBeforeStart)===null||A===void 0||A.call(p,h)),H&&((x=p==null?void 0:p.onBeforeUpdate)===null||x===void 0||x.call(p,h)),(H||B)&&(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&&((C=p==null?void 0:p.onUpdate)===null||C===void 0||C.call(p,h)),B&&((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,w){const{isEditable:A}=e,{composing:x}=e.view,{selection:k}=g,{empty:C,from:O}=k,_={...y};if(_.composing=x,A&&(C||e.view.composing)){(O<y.range.from||O>y.range.to)&&!x&&!y.composing&&(_.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:w,range:D.range,isActive:y.active})?(_.active=!0,_.decorationId=y.decorationId?y.decorationId:R,_.range=D.range,_.query=D.query,_.text=D.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null),_}},props:{handleKeyDown(g,y){var v;const{active:w,range:A}=m.getState(g.state);return w&&((v=p==null?void 0:p.onKeyDown)===null||v===void 0?void 0:v.call(p,{view:g,event:y,range:A}))||!1},decorations(g){const{active:y,range:v,decorationId:w}=m.getState(g);return y?kt.create(g.doc,[nn.inline(v.from,v.to,{nodeName:o,class:a,"data-decoration-id":w})]):null}}});return m}var Joe=typeof tr=="object"&&tr&&tr.Object===Object&&tr,Yoe=typeof self=="object"&&self&&self.Object===Object&&self;Joe||Yoe||Function("return this")();var Xoe=typeof window<"u"?N.useLayoutEffect:N.useEffect,Zoe=typeof window>"u";function P2(t,{defaultValue:e=!1,initializeWithValue:n=!0}={}){const r=a=>Zoe?e:window.matchMedia(a).matches,[s,i]=N.useState(()=>n?r(t):e);function o(){i(r(t))}return Xoe(()=>{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 eae=wt.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Qoe({editor:this.editor,...this.options.suggestion})]}}),tae=({query:t,uploadToIpfs:e})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:S.jsx(JT,{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(QT,{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(E0,{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(C0,{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(S0,{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(T0,{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(eV,{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(D0,{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(_d,{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(sw,{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(YU,{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;lw(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(XT,{}),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(YT,{}),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(WT,{}),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(KU,{}),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}),nae=(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)},rae=({items:t,command:e,editor:n})=>{const[r,s]=N.useState(0),[i,o]=N.useState(t),a=P2("(max-width: 640px)"),l=N.useCallback(c=>{const f=i[c];f&&(f.title==="Continue writing"||e(f))},[e,n,i]);N.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]),N.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]),N.useEffect(()=>{s(0)},[i]);const u=N.useRef(null);return N.useLayoutEffect(()=>{const c=u==null?void 0:u.current,f=c==null?void 0:c.children[r];f&&c&&nae(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},sae=()=>{let t=null,e=null;return{onStart:n=>{t=new zT(rae,{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()}}},iae=t=>{const e=({query:n})=>tae({query:n,uploadToIpfs:t});return eae.configure({suggestion:{items:e,render:sae}})},o8=["#30bced","#6eeb83","#fa69d1","#ecd444","#ee6352","#db3041","#0ad7f2","#1bff39"],oae=({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 O,_;const[d]=N.useState(new ul),[h,p]=N.useState([...Wte,iae(f)]),m=N.useRef(!1),g=(D,R,L)=>{let F=!1;return D.doc.nodesBetween(R,L,G=>{G.marks&&G.marks.some(B=>B.type.name==="highlight"&&B.attrs.color==="yellow")&&(F=!0)}),F},y=(D,R)=>{var F;const L=R.target;if(L&&L.nodeName==="MARK"&&L.dataset.color&&((F=L==null?void 0:L.dataset)==null?void 0:F.color)==="yellow"){const G=L.textContent,B=D.posAtCoords({left:R.clientX,top:R.clientY});if(B){const{state:H}=D;let Q=B.pos,te=B.pos;if(H.doc.nodesBetween(Q,te,(Z,pe)=>{Z.marks&&Z.marks.length&&Z.marks.forEach(Ee=>{Ee.type.name==="highlight"&&(Q=pe,te=pe+Z.nodeSize)})}),Q!==te){const Z={text:G,from:Q,to:te,isHighlightedYellow:g(H,Q,te)};l==null||l(Z)}}}},w=LU({extensions:h,editorProps:{...lK,handleDOMEvents:{mouseover:y,keydown:(D,R)=>{if(["ArrowUp","ArrowDown","Enter"].includes(R.key)&&document.querySelector("#slash-command"))return!0}},handleClick:(D,R,L)=>{y(D,L)}},autofocus:"start",onUpdate:D=>{w!=null&&w.isEmpty||o==null||o(D.editor.getJSON())},shouldRerenderOnTransaction:!!n,immediatelyRender:!0},[h]),A=N.useRef(()=>{}),x=(D,R=!1)=>{if(!n||!r)throw new Error("docId or username is not provided");const L=new aK(r,d,{signaling:["wss://fileverse-signaling-server-0529292ff51c.herokuapp.com/"]});return p([...h,PK.configure({document:d}),IK.configure({provider:L,user:{name:D&&D.length>20?Woe(D,7,15):D,color:o8[Math.floor(Math.random()*o8.length)],isEns:R},render:Yte})]),A.current=()=>{L.destroy(),d.destroy()},A.current},k=N.useRef(null);N.useEffect(()=>{w==null||w.setEditable(!t)},[t,w]),N.useEffect(()=>{e&&w&&!m.current&&(w.commands.setContent(e),m.current=!0),setTimeout(()=>{m.current=!1})},[e,w]),N.useEffect(()=>{if(!w)return;const D=()=>{const{state:R}=w,{from:L,to:F}=R.selection,G=R.doc.textBetween(L,F," ");u==null||u({text:G,from:L,to:F,isHighlightedYellow:g(R,L,F)})};return w.on("selectionUpdate",D),()=>{w.off("selectionUpdate",D)}},[w]);const C=async()=>{let D=i,R=!1;if(s&&c){const{name:L,isEns:F}=await zoe(s,c);D=L,R=F}if(!D)throw new Error("Cannot start collaboration without a username");x(D,R)};return N.useEffect(()=>{n?C():A.current()},[n]),N.useEffect(()=>{var D,R;a==null||a((R=(D=w==null?void 0:w.storage)==null?void 0:D.collaborationCursor)==null?void 0:R.users)},[(_=(O=w==null?void 0:w.storage)==null?void 0:O.collaborationCursor)==null?void 0:_.users]),{editor:w,ref:k,connect:x,ydoc:d}},aae=({title:t,content:e,contentClassName:n,open:r,onOpenChange:s,primaryAction:i,secondaryAction:o})=>S.jsx(cz,{open:r,onOpenChange:s,children:S.jsxs(gD,{className:"max-w-md sm:w-full w-[90%] z-20",children:[S.jsx(yD,{className:"px-4 pt-0 border-b-[1px]",children:S.jsx(wD,{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(bD,{className:"px-5 pb-5 justify-end sm:",children:[o&&S.jsx(hz,{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})]})]})}),lae=({editor:t,uploadToIpfs:e})=>{const{toolVisibilty:n,setToolVisibility:r,bottomToolbar:s}=Ww({editor:t,uploadToIpfs:e}),i=P2("(max-width: 1023px)"),[o,a]=N.useState(""),[l,u]=N.useState(""),[c,f]=N.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(Me.NONE)},h=m=>{const{from:g,to:y}=m.state.selection,v=m.state.doc.textBetween(g,y);return u(v),v},p=N.useRef(null);return N.useEffect(()=>{let m=0;const g=()=>{m=Date.now()},y=()=>{var A;if(Date.now()-m>500){const{selection:x}=t.state;x.from!==x.to&&((A=p.current)==null||A.click())}},v=()=>{var x;if(!i)return;const{selection:w}=t.state;w.from!==w.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]),N.useEffect(()=>{h(t)},[t]),N.useEffect(()=>{const m=g=>{g.key==="k"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),n!==Me.LINK_POPUP?r(Me.LINK_POPUP):r(Me.NONE))};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[t,n]),S.jsxs(uD,{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(cD,{asChild:!0,children:S.jsx("button",{ref:p,onClick:()=>m.onClick(),children:m.icon})}):m.title==="Text color"?S.jsx(cD,{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===Me.TEXT_FORMATING&&S.jsx(e$,{editor:t,setToolVisibility:r}),n===Me.LINK_POPUP&&S.jsx(aae,{open:n===Me.LINK_POPUP,onOpenChange:()=>r(Me.NONE),title:"Link",content:S.jsxs("div",{className:"flex flex-col gap-4 w-full h-full px-4",children:[S.jsx(K0,{label:"Text",placeholder:"Link text",className:"w-full",defaultValue:l,onChange:m=>{m.preventDefault(),u(m.target.value)}}),S.jsx(K0,{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(Me.NONE),className:"w-auto min-w-[80px]"}})]})},I2=N.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),By=N.createContext({}),Fy=N.createContext(null),L2=typeof document<"u",B2=L2?N.useLayoutEffect:N.useEffect,a8=N.createContext({strict:!1}),F2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),l8="data-"+F2("framerAppearId"),uae={skipAnimations:!1,useManualTiming:!1};class u8{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 cae(t){let e=new u8,n=new u8,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 jy=["read","resolveKeyframes","update","preRender","render","postRender"],fae=40;function c8(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=jy.reduce((f,d)=>(f[d]=cae(()=>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,fae),1),s.timestamp=f,s.isProcessing=!0,jy.forEach(o),s.isProcessing=!1,n&&e&&(r=!1,t(a))},l=()=>{n=!0,r=!0,s.isProcessing||t(a)};return{schedule:jy.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=>jy.forEach(d=>i[d].cancel(f)),state:s,steps:i}}const{schedule:j2,cancel:Qde}=c8(queueMicrotask,!1);function Gc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const f8=N.createContext({});let d8=!1;function dae(t,e,n,r,s){const{visualElement:i}=N.useContext(By),o=N.useContext(a8),a=N.useContext(Fy),l=N.useContext(I2).reducedMotion,u=N.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=N.useContext(f8);c&&!c.projection&&s&&(c.type==="html"||c.type==="svg")&&pae(u.current,n,s,f),N.useInsertionEffect(()=>{c&&c.update(n,a)});const d=N.useRef(!!(n[l8]&&!window.HandoffComplete));return B2(()=>{c&&(c.updateFeatures(),j2.render(c.render),d.current&&c.animationState&&c.animationState.animateChanges())}),N.useEffect(()=>{c&&(!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,d8||(d8=!0,queueMicrotask(hae))))}),c}function hae(){window.HandoffComplete=!0}function pae(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:h8(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 h8(t){if(t)return t.options.allowProjection!==!1?t.projection:h8(t.parent)}function mae(t,e,n){return N.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 Uy(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const U2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],V2=["initial",...U2];function Vy(t){return Uy(t.animate)||V2.some(e=>Xh(t[e]))}function p8(t){return!!(Vy(t)||t.variants)}function gae(t,e){if(Vy(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 yae(t){const{initial:e,animate:n}=gae(t,N.useContext(By));return N.useMemo(()=>({initial:e,animate:n}),[m8(e),m8(n)])}function m8(t){return Array.isArray(t)?t.join(" "):t}const g8={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 g8)Wc[t]={isEnabled:e=>g8[t].some(n=>!!e[n])};function bae(t){for(const e in t)Wc[e]={...Wc[e],...t[e]}}const H2=N.createContext({}),wae=Symbol.for("motionComponentSymbol"),Sn=t=>t;let Kc=Sn,Ji=Sn;process.env.NODE_ENV!=="production"&&(Kc=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Ji=(t,e)=>{if(!t)throw new Error(e)});function Aae({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&bae(t);function i(a,l){let u;const c={...N.useContext(I2),...a,layoutId:vae(a)},{isStatic:f}=c,d=yae(a),h=r(a,f);if(!f&&L2){xae(c,t);const p=kae(c);u=p.MeasureLayout,d.visualElement=dae(s,h,c,e,p.ProjectionNode)}return S.jsxs(By.Provider,{value:d,children:[u&&d.visualElement?S.jsx(u,{visualElement:d.visualElement,...c}):null,n(s,a,mae(h,d.visualElement,l),h,f,d.visualElement)]})}const o=N.forwardRef(i);return o[wae]=s,o}function vae({layoutId:t}){const e=N.useContext(H2).id;return e&&t!==void 0?e+"-"+t:t}function xae(t,e){const n=N.useContext(a8).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):Ji(!1,r)}}function kae(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 Eae(t){function e(r,s={}){return Aae(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 Cae=["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 z2(t){return typeof t!="string"||t.includes("-")?!1:!!(Cae.indexOf(t)>-1||/[A-Z]/u.test(t))}const Hy={};function Sae(t){Object.assign(Hy,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 y8(t,{layout:e,layoutId:n}){return Bl.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Hy[t]||t==="opacity")}const Pn=t=>!!(t&&t.getVelocity),Tae={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Dae=Zh.length;function Oae(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,s){let i="";for(let o=0;o<Dae;o++){const a=Zh[o];if(t[a]!==void 0){const l=Tae[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 b8=t=>e=>typeof e=="string"&&e.startsWith(t),w8=b8("--"),_ae=b8("var(--"),$2=t=>_ae(t)?Mae.test(t.split("/*")[0].trim()):!1,Mae=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Nae=(t,e)=>e&&typeof t=="number"?e.transform(t):t,aa=(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=>aa(0,1,t)},zy={...qc,default:1},tp=t=>Math.round(t*1e5)/1e5,G2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Rae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Pae=/^(?:#[\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}`}),la=rp("deg"),di=rp("%"),Ie=rp("px"),Iae=rp("vh"),Lae=rp("vw"),A8={...di,parse:t=>di.parse(t)/100,transform:t=>di.transform(t*100)},v8={...qc,transform:Math.round},x8={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:la,rotateX:la,rotateY:la,rotateZ:la,scale:zy,scaleX:zy,scaleY:zy,scaleZ:zy,skew:la,skewX:la,skewY:la,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:ep,originX:A8,originY:A8,originZ:Ie,zIndex:v8,backgroundPositionX:Ie,backgroundPositionY:Ie,fillOpacity:ep,strokeOpacity:ep,numOctaves:v8};function W2(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(w8(f)){i[f]=d;continue}const h=x8[f],p=Nae(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=Oae(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 K2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function k8(t,e,n){for(const r in e)!Pn(e[r])&&!y8(r,n)&&(t[r]=e[r])}function Bae({transformTemplate:t},e,n){return N.useMemo(()=>{const r=K2();return W2(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}function Fae(t,e,n){const r=t.style||{},s={};return k8(s,r,t),Object.assign(s,Bae(t,e,n)),s}function jae(t,e,n){const r={},s=Fae(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 $y(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 E8=t=>!$y(t);function Vae(t){t&&(E8=e=>e.startsWith("on")?!$y(e):t(e))}try{Vae(require("@emotion/is-prop-valid").default)}catch{}function Hae(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(E8(s)||n===!0&&$y(s)||!e&&!$y(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function C8(t,e,n){return typeof t=="string"?t:Ie.transform(e+n*t)}function zae(t,e,n){const r=C8(e,t.x,t.width),s=C8(n,t.y,t.height);return`${r} ${s}`}const $ae={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gae={offset:"strokeDashoffset",array:"strokeDasharray"};function Wae(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?$ae:Gae;t[i.offset]=Ie.transform(-r);const o=Ie.transform(e),a=Ie.transform(n);t[i.array]=`${o} ${a}`}function q2(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f,d){if(W2(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=zae(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&&Wae(h,o,a,l,!1)}const S8=()=>({...K2(),attrs:{}}),Q2=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Kae(t,e,n,r){const s=N.useMemo(()=>{const i=S8();return q2(i,e,{enableHardwareAcceleration:!1},Q2(r),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};k8(i,t.style,t),s.style={...i,...s.style}}return s}function qae(t=!1){return(n,r,s,{latestValues:i},o)=>{const l=(z2(n)?Kae:jae)(r,i,o,n),u=Hae(r,typeof n=="string",t),c=n!==N.Fragment?{...u,...l,ref:s}:{},{children:f}=r,d=N.useMemo(()=>Pn(f)?f.get():f,[f]);return N.createElement(n,{...c,children:d})}}function T8(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 D8=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 O8(t,e,n,r){T8(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(D8.has(s)?s:F2(s),e.attrs[s])}function J2(t,e,n){var r;const{style:s}=t,i={};for(const o in s)(Pn(s[o])||e.style&&Pn(e.style[o])||y8(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 _8(t,e,n){const r=J2(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 M8(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Y2(t,e,n,r){if(typeof e=="function"){const[s,i]=M8(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]=M8(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function N8(t){const e=N.useRef(null);return e.current===null&&(e.current=t()),e.current}const X2=t=>Array.isArray(t),Qae=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Jae=t=>X2(t)?t[t.length-1]||0:t;function Gy(t){const e=Pn(t)?t.get():t;return Qae(e)?e.toValue():e}function Yae({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,s,i){const o={latestValues:Xae(r,s,i,t),renderState:e()};return n&&(o.mount=a=>n(r,a,o)),o}const R8=t=>(e,n)=>{const r=N.useContext(By),s=N.useContext(Fy),i=()=>Yae(t,e,r,s);return n?i():N8(i)};function Xae(t,e,n,r){const s={},i=r(t,{});for(const d in i)s[d]=Gy(i[d]);let{initial:o,animate:a}=t;const l=Vy(t),u=p8(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"&&!Uy(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=Y2(t,h);if(!p)return;const{transitionEnd:m,transition:g,...y}=p;for(const v in y){let w=y[v];if(Array.isArray(w)){const A=c?w.length-1:0;w=w[A]}w!==null&&(s[v]=w)}for(const v in m)s[v]=m[v]}),s}const{schedule:pt,cancel:Yi,state:Tn,steps:Z2}=c8(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0),Zae={useVisualState:R8({scrapeMotionValuesFromProps:_8,createRenderState:S8,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(()=>{q2(n,r,{enableHardwareAcceleration:!1},Q2(e.tagName),t.transformTemplate),O8(e,n)})}})},ele={useVisualState:R8({scrapeMotionValuesFromProps:J2,createRenderState:K2})};function tle(t,{forwardMotionProps:e=!1},n,r){return{...z2(t)?Zae:ele,preloadedFeatures:n,useRender:qae(e),createVisualElement:r,Component:t}}function Xi(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const P8=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function Wy(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const nle=t=>e=>P8(e)&&t(e,Wy(e));function Zi(t,e,n,r){return Xi(t,e,nle(n),r)}const rle=(t,e)=>n=>e(t(n)),eo=(...t)=>t.reduce(rle);function I8(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const L8=I8("dragHorizontal"),B8=I8("dragVertical");function F8(t){let e=!1;if(t==="y")e=B8();else if(t==="x")e=L8();else{const n=L8(),r=B8();n&&r?e=()=>{n(),r()}:(n&&n(),r&&r())}return e}function j8(){const t=F8(!0);return t?(t(),!1):!0}class ua{constructor(e){this.isMounted=!1,this.node=e}update(){}}function U8(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd",s=(i,o)=>{if(i.pointerType==="touch"||j8())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 Zi(t.current,n,s,{passive:!t.getProps()[r]})}class sle extends ua{mount(){this.unmount=eo(U8(this.node,!0),U8(this.node,!1))}unmount(){}}class ile extends ua{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=eo(Xi(this.node.current,"focus",()=>this.onFocus()),Xi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const V8=(t,e)=>e?t===e?!0:V8(t,e.parentElement):!1;function ek(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,Wy(n))}class ole extends ua{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=Zi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:f}=this.node.getProps(),d=!f&&!V8(this.node.current,a.target)?c:u;d&&pt.update(()=>d(a,l))},{passive:!(r.onTap||r.onPointerUp)}),o=Zi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=eo(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()||ek("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&pt.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Xi(this.node.current,"keyup",o),ek("down",(a,l)=>{this.startPress(a,l)})},n=Xi(this.node.current,"keydown",e),r=()=>{this.isPressing&&ek("cancel",(i,o)=>this.cancelPress(i,o))},s=Xi(this.node.current,"blur",r);this.removeAccessibleListeners=eo(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),!j8()}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=Zi(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=Xi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=eo(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const tk=new WeakMap,nk=new WeakMap,ale=t=>{const e=tk.get(t.target);e&&e(t)},lle=t=>{t.forEach(ale)};function ule({root:t,...e}){const n=t||document;nk.has(n)||nk.set(n,{});const r=nk.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(lle,{root:t,...e})),r[s]}function cle(t,e,n){const r=ule(e);return tk.set(t,n),r.observe(t),()=>{tk.delete(t),r.unobserve(t)}}const fle={some:0,all:1};class dle extends ua{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:fle[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 cle(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(hle(e,n))&&this.startObserver()}unmount(){}}function hle({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ple={inView:{Feature:dle},tap:{Feature:ole},focus:{Feature:ile},hover:{Feature:sle}};function H8(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 Ky(t,e,n){const r=t.getProps();return Y2(r,e,n!==void 0?n:r.custom,t)}const to=t=>t*1e3,no=t=>t/1e3,mle={type:"spring",stiffness:500,damping:25,restSpeed:10},gle=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),yle={type:"keyframes",duration:.8},ble={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wle=(t,{keyframes:e})=>e.length>2?yle:Bl.has(t)?t.startsWith("scale")?gle(e[1]):mle:ble;function Ale({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 rk(t,e){return t[e]||t.default||t}const vle=t=>t!==null;function qy(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter(vle),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}let Qy;function xle(){Qy=void 0}const ca={now:()=>(Qy===void 0&&ca.set(Tn.isProcessing||uae.useManualTiming?Tn.timestamp:performance.now()),Qy),set:t=>{Qy=t,queueMicrotask(xle)}},z8=t=>/^0[^.\s]+$/u.test(t);function kle(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||z8(t):!0}const $8=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ele=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Cle(t){const e=Ele.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}const Sle=4;function G8(t,e,n=1){Ji(n<=Sle,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,s]=Cle(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return $8(o)?parseFloat(o):o}return $2(s)?G8(s,e,n+1):s}const Tle=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),W8=t=>t===qc||t===Ie,K8=(t,e)=>parseFloat(t.split(", ")[e]),q8=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return K8(s[1],e);{const i=r.match(/^matrix\((.+)\)$/u);return i?K8(i[1],t):0}},Dle=new Set(["x","y","z"]),Ole=Zh.filter(t=>!Dle.has(t));function _le(t){const e=[];return Ole.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:q8(4,13),y:q8(5,14)};Qc.translateX=Qc.x,Qc.translateY=Qc.y;const Q8=t=>e=>e.test(t),J8=[qc,Ie,di,la,Lae,Iae,{test:t=>t==="auto",parse:t=>t}],Y8=t=>J8.find(Q8(t)),Fl=new Set;let sk=!1,ik=!1;function X8(){if(ik){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=_le(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)})}ik=!1,sk=!1,Fl.forEach(t=>t.complete()),Fl.clear()}function Z8(){Fl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ik=!0)})}function Mle(){Z8(),X8()}class ok{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),sk||(sk=!0,pt.read(Z8),pt.resolveKeyframes(X8))):(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 ak=(t,e)=>n=>!!(np(n)&&Pae.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),eI=(t,e,n)=>r=>{if(!np(r))return r;const[s,i,o,a]=r.match(G2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Nle=t=>aa(0,255,t),lk={...qc,transform:t=>Math.round(Nle(t))},jl={test:ak("rgb","red"),parse:eI("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+lk.transform(t)+", "+lk.transform(e)+", "+lk.transform(n)+", "+tp(ep.transform(r))+")"};function Rle(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 uk={test:ak("#"),parse:Rle,transform:jl.transform},Jc={test:ak("hsl","hue"),parse:eI("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+di.transform(tp(e))+", "+di.transform(tp(n))+", "+tp(ep.transform(r))+")"},In={test:t=>jl.test(t)||uk.test(t)||Jc.test(t),parse:t=>jl.test(t)?jl.parse(t):Jc.test(t)?Jc.parse(t):uk.parse(t),transform:t=>np(t)?t:t.hasOwnProperty("red")?jl.transform(t):Jc.transform(t)};function Ple(t){var e,n;return isNaN(t)&&np(t)&&(((e=t.match(G2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Rae))===null||n===void 0?void 0:n.length)||0)>0}const tI="number",nI="color",Ile="var",Lle="var(",rI="${}",Ble=/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(Ble,l=>(In.test(l)?(r.color.push(i),s.push(nI),n.push(In.parse(l))):l.startsWith(Lle)?(r.var.push(i),s.push(Ile),n.push(l)):(r.number.push(i),s.push(tI),n.push(parseFloat(l))),++i,rI)).split(rI);return{values:n,split:a,indexes:r,types:s}}function sI(t){return sp(t).values}function iI(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===tI?i+=tp(s[o]):a===nI?i+=In.transform(s[o]):i+=s[o]}return i}}const Fle=t=>typeof t=="number"?0:t;function jle(t){const e=sI(t);return iI(t)(e.map(Fle))}const fa={test:Ple,parse:sI,createTransformer:iI,getAnimatableNone:jle},Ule=new Set(["brightness","contrast","saturate","opacity"]);function Vle(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(G2)||[];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 Hle=/\b([a-z-]*)\(.*?\)/gu,ck={...fa,getAnimatableNone:t=>{const e=t.match(Hle);return e?e.map(Vle).join(" "):t}},zle={...x8,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:ck,WebkitFilter:ck},fk=t=>zle[t];function oI(t,e){let n=fk(t);return n!==ck&&(n=fa),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const $le=new Set(["auto","none","0"]);function Gle(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!$le.has(i)&&sp(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=oI(n,s)}class aI extends ok{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(),$2(u))){const c=G8(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Tle.has(r)||e.length!==2)return;const[s,i]=e,o=Y8(s),a=Y8(i);if(o!==a)if(W8(o)&&W8(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++)kle(e[s])&&r.push(s);r.length&&Gle(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 lI(t){let e;return()=>(e===void 0&&(e=t()),e)}const uI=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(fa.test(t)||t==="0")&&!t.startsWith("url("));function Wle(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 Kle(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=uI(s,e),a=uI(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:Wle(t)||n==="spring"&&r}class cI{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&&Mle(),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&&!Kle(e,r,s,i))if(o)this.options.duration=0;else{l==null||l(qy(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 fI(t,e){return e?t*(1e3/e):0}const qle=5;function dI(t,e,n){const r=Math.max(e-qle,0);return fI(n-t(r),e-r)}const dk=.001,Qle=.01,hI=10,Jle=.05,Yle=1;function Xle({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,i;Kc(t<=to(hI),"Spring duration must be 10 seconds or less");let o=1-e;o=aa(Jle,Yle,o),t=aa(Qle,hI,no(t)),o<1?(s=u=>{const c=u*o,f=c*t,d=c-n,h=hk(u,o),p=Math.exp(-f);return dk-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=hk(Math.pow(u,2),o);return(-s(u)+dk>0?-1:1)*((d-h)*p)/m}):(s=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-dk+c*f},i=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=eue(s,i,a);if(t=to(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 Zle=12;function eue(t,e,n){let r=n;for(let s=1;s<Zle;s++)r=r-t(r)/e(r);return r}function hk(t,e){return t*Math.sqrt(1-e*e)}const tue=["duration","bounce"],nue=["stiffness","damping","mass"];function pI(t,e){return e.some(n=>t[n]!==void 0)}function rue(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!pI(t,nue)&&pI(t,tue)){const n=Xle(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function mI({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}=rue({...r,velocity:-no(r.velocity||0)}),h=f||0,p=l/(2*Math.sqrt(a*u)),m=i-s,g=no(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 w=hk(g,p);v=A=>{const x=Math.exp(-p*g*A);return i-x*((h+p*g*m)/w*Math.sin(w*A)+m*Math.cos(w*A))}}else if(p===1)v=w=>i-Math.exp(-g*w)*(m+(h+g*m)*w);else{const w=g*Math.sqrt(p*p-1);v=A=>{const x=Math.exp(-p*g*A),k=Math.min(w*A,300);return i-x*((h+p*g*m)*Math.sinh(k)+w*m*Math.cosh(k))/w}}return{calculatedDuration:d&&c||null,next:w=>{const A=v(w);if(d)o.done=w>=c;else{let x=h;w!==0&&(p<1?x=dI(v,w,A):x=0);const k=Math.abs(x)<=n,C=Math.abs(i-A)<=e;o.done=k&&C}return o.value=o.done?i:A,o}}}function gI({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),w=O=>y+v(O),A=O=>{const _=v(O),D=w(O);d.done=Math.abs(_)<=u,d.value=d.done?y:D};let x,k;const C=O=>{h(d.value)&&(x=O,k=mI({keyframes:[d.value,p(d.value)],velocity:dI(w,O,d.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:O=>{let _=!1;return!k&&x===void 0&&(_=!0,A(O),C(O)),x!==void 0&&O>=x?k.next(O-x):(!_&&A(O),d)}}}const yI=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,sue=1e-7,iue=12;function oue(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=yI(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>sue&&++a<iue);return o}function ip(t,e,n,r){if(t===e&&n===r)return Sn;const s=i=>oue(i,0,1,t,n);return i=>i===0||i===1?i:yI(s(i),e,r)}const aue=ip(.42,0,1,1),lue=ip(0,0,.58,1),bI=ip(.42,0,.58,1),uue=t=>Array.isArray(t)&&typeof t[0]!="number",wI=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,AI=t=>e=>1-t(1-e),pk=t=>1-Math.sin(Math.acos(t)),vI=AI(pk),cue=wI(pk),xI=ip(.33,1.53,.69,.99),mk=AI(xI),fue=wI(mk),kI={linear:Sn,easeIn:aue,easeInOut:bI,easeOut:lue,circIn:pk,circInOut:cue,circOut:vI,backIn:mk,backInOut:fue,backOut:xI,anticipate:t=>(t*=2)<1?.5*mk(t):.5*(2-Math.pow(2,-10*(t-1)))},EI=t=>{if(Array.isArray(t)){Ji(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 Ji(kI[t]!==void 0,`Invalid easing type '${t}'`),kI[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 gk(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 due({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=gk(l,a,t+1/3),i=gk(l,a,t),o=gk(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Jy(t,e){return n=>n>0?e:t}const yk=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},hue=[uk,jl,Jc],pue=t=>hue.find(e=>e.test(t));function CI(t){const e=pue(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=due(n)),n}const SI=(t,e)=>{const n=CI(t),r=CI(e);if(!n||!r)return Jy(t,e);const s={...n};return i=>(s.red=yk(n.red,r.red,i),s.green=yk(n.green,r.green,i),s.blue=yk(n.blue,r.blue,i),s.alpha=Bt(n.alpha,r.alpha,i),jl.transform(s))},bk=new Set(["none","hidden"]);function mue(t,e){return bk.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function gue(t,e){return n=>Bt(t,e,n)}function wk(t){return typeof t=="number"?gue:typeof t=="string"?$2(t)?Jy:In.test(t)?SI:wue:Array.isArray(t)?TI:typeof t=="object"?In.test(t)?SI:yue:Jy}function TI(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>wk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function yue(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=wk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function bue(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 wue=(t,e)=>{const n=fa.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?bk.has(t)&&!s.values.length||bk.has(e)&&!r.values.length?mue(t,e):eo(TI(bue(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.`),Jy(t,e))};function DI(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Bt(t,e,n):wk(t)(t,e)}function Aue(t,e,n){const r=[],s=n||DI,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=eo(l,a)}r.push(a)}return r}function vue(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Ji(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=Aue(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(aa(t[0],t[i-1],u)):l}function xue(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 kue(t){const e=[0];return xue(e,t.length-1),e}function Eue(t,e){return t.map(n=>n*e)}function Cue(t,e){return t.map(()=>e||bI).splice(0,t.length-1)}function Yy({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=uue(r)?r.map(EI):EI(r),i={done:!1,value:e[0]},o=Eue(n&&n.length===e.length?n:kue(e),t),a=vue(o,e,{ease:Array.isArray(s)?s:Cue(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const OI=2e4;function Sue(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<OI;)e+=n,r=t.next(e);return e>=OI?1/0:e}const Tue=t=>{const e=({timestamp:n})=>t(n);return{start:()=>pt.update(e,!0),stop:()=>Yi(e),now:()=>Tn.isProcessing?Tn.timestamp:ca.now()}},Due={decay:gI,inertia:gI,tween:Yy,keyframes:Yy,spring:mI},Oue=t=>t/100;class Ak extends cI{constructor({KeyframeResolver:e=ok,...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=Due[n]||Yy;let l,u;a!==Yy&&typeof e[0]!="number"&&(process.env.NODE_ENV!=="production"&&Ji(e.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),l=eo(Oue,DI(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=Sue(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 w=this.currentTime,A=i;if(h){const O=Math.min(this.currentTime,c)/f;let _=Math.floor(O),D=O%1;!D&&O>=1&&(D=1),D===1&&_--,_=Math.min(_,h+1),!!(_%2)&&(p==="reverse"?(D=1-D,m&&(D-=m/f)):p==="mirror"&&(A=o)),w=aa(0,1,D)*f}const x=v?{done:!1,value:l[0]}:A.next(w);a&&(x.value=a(x.value));let{done:k}=x;!v&&u!==null&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return C&&s!==void 0&&(x.value=qy(l,this.options,s)),g&&g(x.value),C&&this.finish(),x}get duration(){const{resolved:e}=this;return e?no(e.calculatedDuration):0}get time(){return no(this.currentTime)}set time(e){e=to(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=no(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Tue,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 _I=t=>Array.isArray(t)&&typeof t[0]=="number";function MI(t){return!!(!t||typeof t=="string"&&t in vk||_I(t)||Array.isArray(t)&&t.every(MI))}const ap=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,vk={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 _ue(t){return NI(t)||vk.easeOut}function NI(t){if(t)return _I(t)?ap(t):Array.isArray(t)?t.map(_ue):vk[t]}function Mue(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=NI(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 Nue=lI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Rue=new Set(["opacity","clipPath","filter","transform"]),Xy=10,Pue=2e4;function Iue(t){return t.type==="spring"||t.name==="backgroundColor"||!MI(t.ease)}function Lue(t,e){const n=new Ak({...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<Pue;)r=n.sample(i),s.push(r.value),i+=Xy;return{times:void 0,keyframes:s,duration:i-Xy,ease:"linear"}}class RI extends cI{constructor(e){super(e);const{name:n,motionValue:r,keyframes:s}=this.options;this.resolver=new aI(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(Iue(this.options)){const{onComplete:f,onUpdate:d,motionValue:h,...p}=this.options,m=Lue(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=Mue(l.owner.current,u,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=ca.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;l.set(qy(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 no(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return no(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=to(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 Ak({...f,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),h=to(this.time);l.setWithVelocity(d.sample(h-Xy).value,d.sample(h).value,Xy)}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 Nue()&&r&&Rue.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}function Bue(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),()=>Yi(r)}const Fue=lI(()=>window.ScrollTimeline!==void 0);class jue{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(Fue()&&r.attachTimeline)r.attachTimeline(e);else return r.pause(),Bue(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 xk=(t,e,n,r={},s,i)=>o=>{const a=rk(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-to(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};Ale(a)||(c={...c,...wle(t,c)}),c.duration&&(c.duration=to(c.duration)),c.repeatDelay&&(c.repeatDelay=to(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=qy(c.keyframes,a);if(d!==void 0)return pt.update(()=>{c.onUpdate(d),c.onComplete()}),new jue([])}return!i&&RI.supports(c)?new RI(c):new Ak(c)};function Zy(t){return!!(Pn(t)&&t.add)}function kk(t,e){t.indexOf(e)===-1&&t.push(e)}function Ek(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Ck{constructor(){this.subscriptions=[]}add(e){return kk(this.subscriptions,e),()=>Ek(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 PI=new Set;function Sk(t,e,n){t||PI.has(e)||(console.warn(e),PI.add(e))}const II=30,Uue=t=>!isNaN(parseFloat(t));class Vue{constructor(e,n={}){this.version="11.2.12",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=ca.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=ca.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"&&Sk(!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 Ck);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=ca.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>II)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,II);return fI(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 Vue(t,e)}function Hue(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,lp(n))}function zue(t,e){const n=Ky(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Jae(i[o]);Hue(t,o,a)}}function LI(t){return t.getProps()[l8]}function $ue({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function BI(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&&$ue(f,d))continue;const m={delay:n,elapsed:0,...rk(o||{},d)};let g=!1;if(window.HandoffAppearAnimations){const v=LI(t);if(v){const w=window.HandoffAppearAnimations(v,d,h,pt);w!==null&&(m.elapsed=w,g=!0)}}h.start(xk(d,h,p,t.shouldReduceMotion&&Bl.has(d)?{type:!1}:m,t,g));const y=h.animation;y&&(Zy(u)&&(u.add(d),y.then(()=>u.remove(d))),c.push(y))}return a&&Promise.all(c).then(()=>{pt.update(()=>{a&&zue(t,a)})}),c}function Tk(t,e,n={}){var r;const s=Ky(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(BI(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:d}=i;return Gue(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 Gue(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(Wue).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Tk(u,e,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function Wue(t,e){return t.sortNodePosition(e)}function Kue(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Tk(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Tk(t,e,n);else{const s=typeof e=="function"?Ky(t,e,n.custom):e;r=Promise.all(BI(t,s,n))}return r.then(()=>{pt.postRender(()=>{t.notify("AnimationComplete",e)})})}const que=[...U2].reverse(),Que=U2.length;function Jue(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Kue(t,n,r)))}function Yue(t){let e=Jue(t),n=FI(),r=!0;const s=l=>(u,c)=>{var f;const d=Ky(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<Que;g++){const y=que[g],v=n[y],w=u[y]!==void 0?u[y]:c[y],A=Xh(w),x=y===l?v.isActive:null;x===!1&&(p=g);let k=w===c[y]&&w!==u[y]&&A;if(k&&r&&t.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...h},!v.isActive&&x===null||!w&&!v.prevProp||Uy(w)||typeof w=="boolean")continue;let O=Xue(v.prevProp,w)||y===l&&v.isActive&&!k&&A||g>p&&A,_=!1;const D=Array.isArray(w)?w:[w];let R=D.reduce(s(y),{});x===!1&&(R={});const{prevResolvedValues:L={}}=v,F={...L,...R},G=B=>{O=!0,d.has(B)&&(_=!0,d.delete(B)),v.needsAnimating[B]=!0;const H=t.getValue(B);H&&(H.liveStyle=!1)};for(const B in F){const H=R[B],Q=L[B];if(h.hasOwnProperty(B))continue;let te=!1;X2(H)&&X2(Q)?te=!H8(H,Q):te=H!==Q,te?H!=null?G(B):d.add(B):H!==void 0&&d.has(B)?G(B):v.protectedKeys[B]=!0}v.prevProp=w,v.prevResolvedValues=R,v.isActive&&(h={...h,...R}),r&&t.blockInitialAnimation&&(O=!1),O&&(!k||_)&&f.push(...D.map(B=>({animation:B,options:{type:y}})))}if(d.size){const g={};d.forEach(y=>{const v=t.getBaseTarget(y),w=t.getValue(y);w&&(w.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=FI(),r=!0}}}function Xue(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!H8(e,t):!1}function Ul(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function FI(){return{animate:Ul(!0),whileInView:Ul(),whileHover:Ul(),whileTap:Ul(),whileDrag:Ul(),whileFocus:Ul(),exit:Ul()}}class Zue extends ua{constructor(e){super(e),e.animationState||(e.animationState=Yue(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Uy(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 ece=0;class tce extends ua{constructor(){super(...arguments),this.id=ece++}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 nce={animation:{Feature:Zue},exit:{Feature:tce}},jI=(t,e)=>Math.abs(t-e);function rce(t,e){const n=jI(t.x,e.x),r=jI(t.y,e.y);return Math.sqrt(n**2+r**2)}class UI{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=Ok(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=rce(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=Dk(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=Ok(f.type==="pointercancel"?this.lastMoveEventInfo:Dk(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,g),p&&p(f,g)},!P8(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Wy(e),a=Dk(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=Tn;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,Ok(a,this.history)),this.removeListeners=eo(Zi(this.contextWindow,"pointermove",this.handlePointerMove),Zi(this.contextWindow,"pointerup",this.handlePointerUp),Zi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Yi(this.updatePoint)}}function Dk(t,e){return e?{point:e(t.point)}:t}function VI(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ok({point:t},e){return{point:t,delta:VI(t,HI(e)),offset:VI(t,sce(e)),velocity:ice(e,.1)}}function sce(t){return t[0]}function HI(t){return t[t.length-1]}function ice(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=HI(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>to(e)));)n--;if(!r)return{x:0,y:0};const i=no(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 _k(t,e=0,n=.01){return Math.abs(t-e)<=n}function zI(t,e,n,r=.5){t.origin=r,t.originPoint=Bt(e.min,e.max,t.origin),t.scale=Pr(n)/Pr(e),(_k(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Bt(n.min,n.max,t.origin)-t.originPoint,(_k(t.translate)||isNaN(t.translate))&&(t.translate=0)}function up(t,e,n,r){zI(t.x,e.x,n.x,r?r.originX:void 0),zI(t.y,e.y,n.y,r?r.originY:void 0)}function $I(t,e,n){t.min=n.min+e.min,t.max=t.min+Pr(e)}function oce(t,e,n){$I(t.x,e.x,n.x),$I(t.y,e.y,n.y)}function GI(t,e,n){t.min=e.min-n.min,t.max=t.min+Pr(e)}function cp(t,e,n){GI(t.x,e.x,n.x),GI(t.y,e.y,n.y)}function ace(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 WI(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 lce(t,{top:e,left:n,bottom:r,right:s}){return{x:WI(t.x,n,s),y:WI(t.y,e,r)}}function KI(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 uce(t,e){return{x:KI(t.x,e.x),y:KI(t.y,e.y)}}function cce(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)),aa(0,1,n)}function fce(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 Mk=.35;function dce(t=Mk){return t===!1?t=0:t===!0&&(t=Mk),{x:qI(t,"left","right"),y:qI(t,"top","bottom")}}function qI(t,e,n){return{min:QI(t,e),max:QI(t,n)}}function QI(t,e){return typeof t=="number"?t:t[e]||0}const JI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yc=()=>({x:JI(),y:JI()}),YI=()=>({min:0,max:0}),qt=()=>({x:YI(),y:YI()});function es(t){return[t("x"),t("y")]}function XI({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function hce({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function pce(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 Nk(t){return t===void 0||t===1}function Rk({scale:t,scaleX:e,scaleY:n}){return!Nk(t)||!Nk(e)||!Nk(n)}function Vl(t){return Rk(t)||ZI(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ZI(t){return eL(t.x)||eL(t.y)}function eL(t){return t&&t!=="0%"}function eb(t,e,n){const r=t-n,s=e*r;return n+s}function tL(t,e,n,r,s){return s!==void 0&&(t=eb(t,s,r)),eb(t,n,r)+e}function Pk(t,e=0,n=1,r,s){t.min=tL(t.min,e,n,r,s),t.max=tL(t.max,e,n,r,s)}function nL(t,{x:e,y:n}){Pk(t.x,e.translate,e.scale,e.originPoint),Pk(t.y,n.translate,n.scale,n.originPoint)}function mce(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,nL(t,o)),r&&Vl(i.latestValues)&&Xc(t,i.latestValues))}e.x=rL(e.x),e.y=rL(e.y)}function rL(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function da(t,e){t.min=t.min+e,t.max=t.max+e}function sL(t,e,[n,r,s]){const i=e[s]!==void 0?e[s]:.5,o=Bt(t.min,t.max,i);Pk(t,e[n],e[r],o,e.scale)}const gce=["x","scaleX","originX"],yce=["y","scaleY","originY"];function Xc(t,e){sL(t.x,e,gce),sL(t.y,e,yce)}function iL(t,e){return XI(pce(t.getBoundingClientRect(),e))}function bce(t,e,n){const r=iL(t,n),{scroll:s}=e;return s&&(da(r.x,s.offset.x),da(r.y,s.offset.y)),r}const oL=({current:t})=>t?t.ownerDocument.defaultView:null,wce=new WeakMap;class Ace{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(Wy(c,"page").point)},i=(c,f)=>{const{drag:d,dragPropagation:h,onDragStart:p}=this.getProps();if(d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=F8(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(di.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[g];w&&(y=Pr(w)*(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=vce(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 UI(e,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:oL(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||!tb(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=ace(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=lce(s.layoutBox,n):this.constraints=!1,this.elastic=dce(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=fce(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Gc(e))return!1;const r=e.current;Ji(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=bce(r,s.root,this.visualElement.getTransformPagePoint());let o=uce(s.layout.layoutBox,i);if(n){const a=n(hce(o));this.hasMutatedConstraints=!!a,a&&(o=XI(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(!tb(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(xk(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(!tb(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]=cce({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(!tb(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;wce.set(this.visualElement,this);const e=this.visualElement.current,n=Zi(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=Xi(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=Mk,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function tb(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function vce(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class xce extends ua{constructor(e){super(e),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new Ace(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 aL=t=>(e,n)=>{t&&pt.postRender(()=>t(e,n))};class kce extends ua{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(e){this.session=new UI(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oL(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:aL(e),onStart:aL(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&pt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Zi(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 Ece(){const t=N.useContext(Fy);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,s=N.useId();return N.useEffect(()=>r(s),[]),!e&&n?[!1,()=>n&&n(s)]:[!0]}const nb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function lL(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=lL(t,e.target.x),r=lL(t,e.target.y);return`${n}% ${r}%`}},Cce={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=fa.parse(t);if(s.length>5)return r;const i=fa.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 Sce extends N.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;Sae(Tce),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()})),nb.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(),j2.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 uL(t){const[e,n]=Ece(),r=N.useContext(H2);return S.jsx(Sce,{...t,layoutGroup:r,switchLayoutGroup:N.useContext(f8),isPresent:e,safeToRemove:n})}const Tce={borderRadius:{...fp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fp,borderTopRightRadius:fp,borderBottomLeftRadius:fp,borderBottomRightRadius:fp,boxShadow:Cce},cL=["TopLeft","TopRight","BottomLeft","BottomRight"],Dce=cL.length,fL=t=>typeof t=="string"?parseFloat(t):t,dL=t=>typeof t=="number"||Ie.test(t);function Oce(t,e,n,r,s,i){s?(t.opacity=Bt(0,n.opacity!==void 0?n.opacity:1,_ce(r)),t.opacityExit=Bt(e.opacity!==void 0?e.opacity:1,0,Mce(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<Dce;o++){const a=`border${cL[o]}Radius`;let l=hL(e,a),u=hL(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||dL(l)===dL(u)?(t[a]=Math.max(Bt(fL(l),fL(u),r),0),(di.test(u)||di.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=Bt(e.rotate||0,n.rotate||0,r))}function hL(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const _ce=pL(0,.5,vI),Mce=pL(.5,.95,Sn);function pL(t,e,n){return r=>r<t?0:r>e?1:n(op(t,e,r))}function mL(t,e){t.min=e.min,t.max=e.max}function ts(t,e){mL(t.x,e.x),mL(t.y,e.y)}function gL(t,e,n,r,s){return t-=e,t=eb(t,1/n,r),s!==void 0&&(t=eb(t,1/s,r)),t}function Nce(t,e=0,n=1,r=.5,s,i=t,o=t){if(di.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=gL(t.min,e,n,a,s),t.max=gL(t.max,e,n,a,s)}function yL(t,e,[n,r,s],i,o){Nce(t,e[n],e[r],e[s],e.scale,i,o)}const Rce=["x","scaleX","originX"],Pce=["y","scaleY","originY"];function bL(t,e,n,r){yL(t.x,e,Rce,n?n.x:void 0,r?r.x:void 0),yL(t.y,e,Pce,n?n.y:void 0,r?r.y:void 0)}function wL(t){return t.translate===0&&t.scale===1}function AL(t){return wL(t.x)&&wL(t.y)}function Ice(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 vL(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 xL(t){return Pr(t.x)/Pr(t.y)}class Lce{constructor(){this.members=[]}add(e){kk(this.members,e),e.scheduleRender()}remove(e){if(Ek(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 kL(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 Bce=(t,e)=>t.depth-e.depth;class Fce{constructor(){this.children=[],this.isDirty=!1}add(e){kk(this.children,e),this.isDirty=!0}remove(e){Ek(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Bce),this.isDirty=!1,this.children.forEach(e)}}function jce(t,e){const n=ca.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Yi(r),t(i-e))};return pt.read(r,!0),()=>Yi(r)}function Uce(t){window.MotionDebug&&window.MotionDebug.record(t)}function Vce(t){return t instanceof SVGElement&&t.tagName!=="svg"}function Hce(t,e,n){const r=Pn(t)?t:lp(t);return r.start(xk("",r,e,n)),r.animation}const Ik=["","X","Y","Z"],zce={visibility:"hidden"},EL=1e3;let $ce=0;const Hl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Lk(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function CL(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;const{visualElement:e}=t.options;return e?LI(e)?!0:t.parent&&!t.parent.hasCheckedOptimisedAppear?CL(t.parent):!1:!1}function SL({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=$ce++,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,Hl.totalNodes=Hl.resolvedTargetDeltas=Hl.recalculatedProjection=0,this.nodes.forEach(Kce),this.nodes.forEach(Xce),this.nodes.forEach(Zce),this.nodes.forEach(qce),Uce(Hl)},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 Fce)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ck),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=Vce(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=jce(d,250),nb.hasAnimatedSinceResize&&(nb.hasAnimatedSinceResize=!1,this.nodes.forEach(DL))})}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()||sfe,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!vL(this.targetLayout,p)||h,w=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const A={...rk(m,"layout"),onPlay:g,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||DL(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,Yi(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(efe),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&&CL(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(TL);return}this.isUpdating||this.nodes.forEach(Jce),this.isUpdating=!1,this.nodes.forEach(Yce),this.nodes.forEach(Gce),this.nodes.forEach(Wce),this.clearAllSnapshots();const a=ca.now();Tn.delta=aa(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,j2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Qce),this.sharedNodes.forEach(tfe)}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&&!AL(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Vl(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)),ife(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&&(da(a.x,l.offset.x),da(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&&(da(a.x,-d.offset.x),da(a.y,-d.offset.y))}da(a.x,c.offset.x),da(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}),Vl(c.latestValues)&&Xc(l,c.latestValues)}return Vl(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||!Vl(u.latestValues))continue;Rk(u.latestValues)&&u.updateSnapshot();const c=qt(),f=u.measurePageBox();ts(c,f),bL(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Vl(this.latestValues)&&bL(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(),oce(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ts(this.target,this.layout.layoutBox),nL(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}Hl.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Rk(this.parent.latestValues)||ZI(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;mce(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=kL(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==d||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Hl.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(rfe));this.animationProgress=0;let w;this.mixTargetDelta=A=>{const x=A/1e3;OL(f.x,o.x,x),OL(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),nfe(this.relativeTarget,this.relativeTargetOrigin,d,x),w&&Ice(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=qt()),ts(w,this.relativeTarget)),m&&(this.animationValues=c,Oce(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&&(Yi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{nb.hasAnimatedSinceResize=!0,this.currentAnimation=Hce(0,EL,{...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(EL),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&&PL(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 Lce),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&&Lk("z",o,u,this.animationValues);for(let c=0;c<Ik.length;c++)Lk(`rotate${Ik[c]}`,o,u,this.animationValues),Lk(`skew${Ik[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 zce;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Gy(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=Gy(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Vl(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=kL(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 Hy){if(d[m]===void 0)continue;const{correct:g,applyTo:y}=Hy[m],v=u.transform==="none"?d[m]:g(d[m],f);if(y){const w=y.length;for(let A=0;A<w;A++)u[y[A]]=v}else u[m]=v}return this.options.layoutId&&(u.pointerEvents=f===this?Gy(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(TL),this.root.sharedNodes.clear()}}}function Gce(t){t.updateLayout()}function Wce(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}):PL(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=!AL(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),vL(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 Kce(t){Hl.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 qce(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Qce(t){t.clearSnapshot()}function TL(t){t.clearMeasurements()}function Jce(t){t.isLayoutDirty=!1}function Yce(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function DL(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Xce(t){t.resolveTargetDelta()}function Zce(t){t.calcProjection()}function efe(t){t.resetSkewAndRotation()}function tfe(t){t.removeLeadSnapshot()}function OL(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 _L(t,e,n,r){t.min=Bt(e.min,n.min,r),t.max=Bt(e.max,n.max,r)}function nfe(t,e,n,r){_L(t.x,e.x,n.x,r),_L(t.y,e.y,n.y,r)}function rfe(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const sfe={duration:.45,ease:[.4,0,.1,1]},ML=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),NL=ML("applewebkit/")&&!ML("chrome/")?Math.round:Sn;function RL(t){t.min=NL(t.min),t.max=NL(t.max)}function ife(t){RL(t.x),RL(t.y)}function PL(t,e,n){return t==="position"||t==="preserve-aspect"&&!_k(xL(e),xL(n),.2)}const ofe=SL({attachResizeListener:(t,e)=>Xi(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Bk={current:void 0},IL=SL({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Bk.current){const t=new ofe({});t.mount(window),t.setOptions({layoutScroll:!0}),Bk.current=t}return Bk.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),afe={pan:{Feature:kce},drag:{Feature:xce,ProjectionNode:IL,MeasureLayout:uL}},Fk={current:null},LL={current:!1};function lfe(){if(LL.current=!0,!!L2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fk.current=t.matches;t.addListener(e),e()}else Fk.current=!1}function ufe(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),Zy(r)&&r.add(s),process.env.NODE_ENV==="development"&&Sk(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})),Zy(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 BL=new WeakMap,cfe=[...J8,In,fa],ffe=t=>cfe.find(Q8(t)),FL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],dfe=V2.length;class hfe{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=ok,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=Vy(n),this.isVariantNode=p8(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),Zy(c)&&c.add(d))}}mount(e){this.current=e,BL.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)),LL.current||lfe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Fk.current,process.env.NODE_ENV!=="production"&&Sk(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(){BL.delete(this.current),this.projection&&this.projection.unmount(),Yi(this.notifyUpdate),Yi(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<FL.length;r++){const s=FL[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=ufe(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<dfe;r++){const s=V2[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"&&($8(s)||z8(s))?s=parseFloat(s):!ffe(s)&&fa.test(n)&&(s=oI(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=Y2(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 Ck),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class jL extends hfe{constructor(){super(...arguments),this.KeyframeResolver=aI}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 pfe(t){return window.getComputedStyle(t)}class mfe extends jL{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(Bl.has(n)){const r=fk(n);return r&&r.default||0}else{const r=pfe(e),s=(w8(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return iL(e,n)}build(e,n,r,s){W2(e,n,r,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return J2(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){T8(e,n,r,s)}}class gfe extends jL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Bl.has(n)){const r=fk(n);return r&&r.default||0}return n=D8.has(n)?n:F2(n),e.getAttribute(n)}measureInstanceViewportBox(){return qt()}scrapeMotionValuesFromProps(e,n,r){return _8(e,n,r)}build(e,n,r,s){q2(e,n,r,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,r,s){O8(e,n,r,s)}mount(e){this.isSVGTag=Q2(e.tagName),super.mount(e)}}const yfe=(t,e)=>z2(t)?new gfe(e,{enableHardwareAcceleration:!1}):new mfe(e,{allowProjection:t!==N.Fragment,enableHardwareAcceleration:!0}),bfe={...nce,...ple,...afe,...{layout:{ProjectionNode:IL,MeasureLayout:uL}}},wfe=Eae((t,e)=>tle(t,e,bfe,yfe));function UL(){const t=N.useRef(!1);return B2(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Afe(){const t=UL(),[e,n]=N.useState(0),r=N.useCallback(()=>{t.current&&n(e+1)},[e]);return[N.useCallback(()=>pt.postRender(r),[r]),e]}class vfe extends V.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 xfe({children:t,isPresent:e}){const n=N.useId(),r=N.useRef(null),s=N.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=N.useContext(I2);return N.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(`
|
515
|
+
`?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 $te=wt.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new bt({key:new _t("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(gx(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),Gte=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=I7.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 zte(this.editor,this.options),serializer:new Hte(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[fte.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),$te.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),Wte=[_q,Dq.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}),fM.configure({depth:10,newGroupDelay:100}),Mq.configure({types:["heading","paragraph"]}),fQ,nQ.extend({exitable:!0}).configure({HTMLAttributes:{class:"text-blue-500 font-bold transition-colors cursor-pointer select-text pointer-events-auto"},openOnClick:!0,autolink:!1}),rQ.configure({placeholder:()=>"",includeChildren:!0,showOnlyCurrent:!0}),oQ.configure({multicolor:!0}),cQ.configure({HTMLAttributes:{class:"select-text pointer-events-auto"}}),Oq,pQ,aQ.configure({HTMLAttributes:{class:"not-prose space-y-4 !ml-0"}}),uQ.configure({HTMLAttributes:{class:"flex items-start"},nested:!0}),tM.configure({HTMLAttributes:{class:"space-y-4 !ml-6"}}),hM.configure({HTMLAttributes:{class:"leading-normal"}}),rM.configure({width:3,color:"#d1d5db"}),sM,KJ,cX,uX,...lX,kQ.configure({uploadFn:mV}),hQ,mQ,wQ,dX,dQ,Gte.configure({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!0,breaks:!0,transformPastedText:!0,transformCopiedText:!1})],Kte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAE/SURBVHgBhVJBTsJQEH3zMcElR+gRuIF6gwYPAOwkLoQTUE6ArEA3xbWJ4gnQE8gNwBuwhMR2fPNLk9o0ZZImM/P/e39e3wgqojPXXiPFJnFovw1kWT53xSKca3C70LXlr/eySYFdZ6Fb61eCePnBCb6VF3P21UA+WX+wv+086fgfyMbh4aPlqWJSZH2/k6EINlBEJI6tdxHG2tIDrsUqxYzsO5Qi+UXfNfwUPT7w49wRU1EyZWNFqIgV9REw84Wga+P1Uj7PsW5QE9pEZMT8Aq+JQmNcYl8HwgEtEvf9fc3RR4zrMCRe84WA6dJRz8upPwyftV0FOP3ugHqu0iZGzsSbF3bYUMRlgDdWMcyE4WvVl73XRC9CNiaqaHMDpkUQrYh8kmKUmy5lVpvdBNs2mOk0tptk9a5AVKHhzML+AZaSjR/r++n9AAAAAElFTkSuQmCC",qte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEjSURBVHgBjZJBToNQEIb/NzTeoMbGjTeoN5Au1S7wBrqwyk5OoD1B46pRF9UbsEBc9nmEHsI08QhGZnxMpaGUEv4EwoP/mxnyj0GNTp++AoPORA+Gx+mo91r1mOJh+LL0WYwDqC8i/obJGCuSfRJ1bHLdtWtQIaY5WoiYBknYtZQfmOGjpTIvC7TAahTvpMksmUQCvK0A6itzNl1egmi2k2K+2gPsD+mvHGkh4MIVoPuSLYbIYxOk3YAJVRuktwd3DhjvggqRB0Slc3D+/D1Lw95DE5Rnq3E487ySXeyu4zooz/R9tD/QUYV5Ufke1HbKvW4RdFS9icRoKeKO1c7Fi+HUbQ/BzzPdXjmxDCy8TOIk7G2CZf1nqzEJfqOPm8Otif4AFnp3K1F5HHAAAAAASUVORK5CYII=",Qte=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},Jte=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=Kte,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=qte,o.classList.add("custom-cursor__badge"),s.appendChild(i),n.appendChild(r),n.appendChild(s),n.appendChild(o),e.appendChild(n),e},Yte=t=>t.isEns?Jte(t):Qte(t),Xte="6.13.1";function Zte(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 Nn(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 Oe(t,e,n){for(let r in e){let s=e[r];const i=n?n[r]:null;i&&Zte(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 bx(t){return gn(t,"CALL_EXCEPTION")}function Nt(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=${Xte}`),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 Oe(s,{code:e}),n&&Object.assign(s,n),s.shortMessage==null&&Oe(s,{shortMessage:r}),s}function ee(t,e,n,r){if(!t)throw Nt(e,n,r)}function $(t,e,n,r){ee(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function n4(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 zg(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 r4(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}$(!1,"invalid BytesLike value",e||"value",t)}function ct(t,e){return r4(t,e,!1)}function Gn(t,e){return r4(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 wx(t){return St(t,!0)||t instanceof Uint8Array}const s4="0123456789abcdef";function we(t){const e=ct(t);let n="0x";for(let r=0;r<e.length;r++){const s=e[r];n+=s4[(s&240)>>4]+s4[s&15]}return n}function $t(t){return"0x"+t.map(e=>we(e).substring(2)).join("")}function Ec(t){return St(t,!0)?(t.length-2)/2:ct(t).length}function Ht(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 i4(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 i4(t,e,!0)}function ene(t,e){return i4(t,e,!1)}const $g=BigInt(0),Es=BigInt(1),Cc=9007199254740991;function tne(t,e){const n=Gg(t,"value"),r=BigInt(Qe(e,"width"));if(ee(n>>r===$g,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-Es){const s=(Es<<r)-Es;return-((~n&s)+Es)}return n}function o4(t,e){let n=xe(t,"value");const r=BigInt(Qe(e,"width")),s=Es<<r-Es;if(n<$g){n=-n,ee(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const i=(Es<<r)-Es;return(~n&i)+Es}else ee(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return n}function Dh(t,e){const n=Gg(t,"value"),r=BigInt(Qe(e,"bits"));return n&(Es<<r)-Es}function xe(t,e){switch(typeof t){case"bigint":return t;case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-Cc&&t<=Cc,"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){$(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}$(!1,"invalid BigNumberish value",e||"value",t)}function Gg(t,e){const n=xe(t,e);return ee(n>=$g,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const a4="0123456789abcdef";function Ax(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=a4[n>>4],e+=a4[n&15];return BigInt(e)}return xe(t)}function Qe(t,e){switch(typeof t){case"bigint":return $(t>=-Cc&&t<=Cc,"overflow",e||"value",t),Number(t);case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-Cc&&t<=Cc,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Qe(BigInt(t),e)}catch(n){$(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}$(!1,"invalid numeric value",e||"value",t)}function nne(t){return Qe(Ax(t))}function Xo(t,e){let r=Gg(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=Gg(t,"value");if(e===$g)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(wx(t)?t:Wn(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const l4="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const u4=BigInt(58);function rne(t){const e=ct(t);let n=Ax(e),r="";for(;n;)r=l4[Number(n%u4)]+r,n/=u4;for(let s=0;s<e.length&&!e[s];s++)r=l4[0]+r;return r}function sne(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 ine(t){const e=ct(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}class c4{constructor(e,n,r){W(this,"filter");W(this,"emitter");J(this,Zc);I(this,Zc,n),Oe(this,{emitter:e,filter:r})}async removeListener(){T(this,Zc)!=null&&await this.emitter.off(this.filter,T(this,Zc))}}Zc=new WeakMap;function one(t,e,n,r,s){$(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function f4(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 ane(t,e,n,r,s){return t==="OVERLONG"?($(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),f4(t,e,n))}const lne=Object.freeze({error:one,ignore:f4,replace:ane});function une(t,e){e==null&&(e=lne.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){$(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);$(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 cne(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 cne(une(t,e))}function d4(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=Nt("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{i=Nt("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 fne=12,dne=250;let h4=d4();const hne=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),pne=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let vx=!1;async function p4(t,e){try{const n=t.match(hne);if(!n)throw new Error("invalid data");return new Zo(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?sne(n[3]):gne(n[3]))}catch{return new Zo(599,"BAD REQUEST (invalid data: URI)",{},null,new Kn(t))}}function m4(t){async function e(n,r){try{const s=n.match(pne);if(!s)throw new Error("invalid link");return new Kn(`${t}${s[2]}`)}catch{return new Zo(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Kn(n))}}return e}const Wg={data:p4,ipfs:m4("https://gateway.ipfs.io/ipfs/")},g4=new WeakMap;class mne{constructor(e){J(this,$l);J(this,ha);I(this,$l,[]),I(this,ha,!1),g4.set(e,()=>{if(!T(this,ha)){I(this,ha,!0);for(const n of T(this,$l))setTimeout(()=>{n()},0);I(this,$l,[])}})}addListener(e){ee(!T(this,ha),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),T(this,$l).push(e)}get cancelled(){return T(this,ha)}checkSignal(){ee(!this.cancelled,"cancelled","CANCELLED",{})}}$l=new WeakMap,ha=new WeakMap;function Kg(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}const rb=class rb{constructor(e){J(this,ql);J(this,ef);J(this,tf);J(this,Os);J(this,ro);J(this,nf);J(this,rf);J(this,wn);J(this,Ir);J(this,so);J(this,Gl);J(this,Wl);J(this,Kl);J(this,hi);J(this,_s);J(this,pa);I(this,rf,String(e)),I(this,ef,!1),I(this,tf,!0),I(this,Os,{}),I(this,ro,""),I(this,nf,3e5),I(this,_s,{slotInterval:dne,maxAttempts:fne}),I(this,pa,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,ro)?T(this,ro):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),I(this,ro,String(e).toUpperCase())}get headers(){const e=Object.assign({},T(this,Os));return T(this,so)&&(e.authorization=`Basic ${ine(Vi(T(this,so)))}`),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,so)||null}setCredentials(e,n){$(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),I(this,so,`${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){$(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,pa)||h4}set getUrlFunc(e){I(this,pa,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,_s).slotInterval=e.slotInterval),e.maxAttempts!=null&&(T(this,_s).maxAttempts=e.maxAttempts)}send(){return ee(T(this,hi)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),I(this,hi,new mne(this)),fe(this,ql,Dp).call(this,0,y4()+this.timeout,0,this,new Zo(0,"",{},null,this))}cancel(){ee(T(this,hi)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=g4.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 rb(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 rb(this.url);return I(e,ro,T(this,ro)),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,so,T(this,so)),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,_s,Object.assign({},T(this,_s))),I(e,pa,T(this,pa)),e}static lockConfig(){vx=!0}static getGateway(e){return Wg[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(vx)throw new Error("gateways locked");Wg[e]=n}static registerGetUrl(e){if(vx)throw new Error("gateways locked");h4=e}static createGetUrlFunc(e){return d4()}static createDataGateway(){return p4}static createIpfsGatewayFunc(e){return m4(e)}};ef=new WeakMap,tf=new WeakMap,Os=new WeakMap,ro=new WeakMap,nf=new WeakMap,rf=new WeakMap,wn=new WeakMap,Ir=new WeakMap,so=new WeakMap,Gl=new WeakMap,Wl=new WeakMap,Kl=new WeakMap,hi=new WeakMap,_s=new WeakMap,pa=new WeakMap,ql=new WeakSet,Dp=async function(e,n,r,s,i){var c,f,d;if(e>=T(this,_s).maxAttempts)return i.makeServerError("exceeded maximum retry limit");ee(y4()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await yne(r);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in Wg){const h=await Wg[a](o.url,Kg(T(s,hi)));if(h instanceof Zo){let p=h;if(this.processFunc){Kg(T(s,hi));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,Kg(T(s,hi)));let u=new Zo(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,_s).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){Kg(T(s,hi));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,_s).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=rb;const Uk=class Uk{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 Uk(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:$(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw Oe(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 Zo=Uk;function y4(){return new Date().getTime()}function gne(t){return Vi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function yne(t){return new Promise(e=>setTimeout(e,t))}function bne(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function b4(t,e,n){let r=0;for(let s=0;s<n;s++)r=r*256+t[e+s];return r}function w4(t,e,n,r){const s=[];for(;n<e+1+r;){const i=A4(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 A4(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=b4(t,e+1,r);return n(e+1+r+s),w4(t,e,e+1+r,r+s)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),w4(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const s=b4(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:bne(t[e])}}function qg(t){const e=ct(t,"data"),n=A4(e,0);return $(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function v4(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function x4(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(i){r=r.concat(x4(i))}),r.length<=55)return r.unshift(192+r.length),r;const s=v4(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=v4(e.length);return n.unshift(183+n.length),n.concat(e)}const k4="0123456789abcdef";function El(t){let e="0x";for(const n of x4(t))e+=k4[n>>4],e+=k4[n&15];return e}const qn=32,xx=new Uint8Array(qn),wne=["then"],Qg={},E4=new WeakMap;function Cl(t){return E4.get(t)}function C4(t,e){E4.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 kx(t,e,n){return t.indexOf(null)>=0?e.map((r,s)=>r instanceof Tc?kx(Cl(r),r,n):r):t.reduce((r,s,i)=>{let o=e.getValue(s);return s in r||(n&&o instanceof Tc&&(o=kx(Cl(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!==Qg&&(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(C4(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(wne.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 C4(l,Cl(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=Cl(this);return r.reduce((s,i,o)=>(ee(i!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),kx(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=Cl(this),i=[],o=[];for(let a=n;a<r;a++)i.push(this[a]),o.push(s[a]);return new af(Qg,i,o)}filter(n,r){const s=Cl(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(Qg,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=Cl(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(Qg,n,r)}};of=new WeakMap;let Tc=af;function S4(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([xx.slice(e.length%qn),e]))),e}class Hi{constructor(e,n,r,s){W(this,"name");W(this,"type");W(this,"localName");W(this,"dynamic");Oe(this,{name:e,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,n){$(!1,e,this.localName,n)}}class Ex{constructor(){J(this,lf);J(this,io);J(this,Jl);I(this,io,[]),I(this,Jl,0)}get data(){return $t(T(this,io))}get length(){return T(this,Jl)}appendWriter(e){return fe(this,lf,cb).call(this,Gn(e.data))}writeBytes(e){let n=Gn(e);const r=n.length%qn;return r&&(n=Gn($t([n,xx.slice(r)]))),fe(this,lf,cb).call(this,n)}writeValue(e){return fe(this,lf,cb).call(this,S4(e))}writeUpdatableValue(){const e=T(this,io).length;return T(this,io).push(xx),I(this,Jl,T(this,Jl)+qn),n=>{T(this,io)[e]=S4(n)}}}io=new WeakMap,Jl=new WeakMap,lf=new WeakSet,cb=function(e){return T(this,io).push(e),I(this,Jl,T(this,Jl)+e.length),e.length};const Vk=class Vk{constructor(e,n,r){J(this,Zl);W(this,"allowLoose");J(this,pr);J(this,Br);J(this,Yl);J(this,Xl);J(this,ma);Oe(this,{allowLoose:!!n}),I(this,pr,Gn(e)),I(this,Yl,0),I(this,Xl,null),I(this,ma,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 Vk(T(this,pr).slice(T(this,Br)+e),this.allowLoose,T(this,ma));return I(n,Xl,this),n}readBytes(e,n){let r=fe(this,Zl,WL).call(this,0,e,!!n);return fe(this,Zl,Jk).call(this,e),I(this,Br,T(this,Br)+r.length),r.slice(0,e)}readValue(){return Ax(this.readBytes(qn))}readIndex(){return nne(this.readBytes(qn))}};pr=new WeakMap,Br=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,ma=new WeakMap,Zl=new WeakSet,Jk=function(e){var n;if(T(this,Xl))return fe(n=T(this,Xl),Zl,Jk).call(n,e);I(this,Yl,T(this,Yl)+e),ee(T(this,ma)<1||T(this,Yl)<=T(this,ma)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${T(this,ma)} ( 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}})},WL=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 Cx=Vk;function Jg(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Sx(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 Ane(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jg(t.outputLen),Jg(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 T4(t,e){Sx(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Tx=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const D4=t=>t instanceof Uint8Array,vne=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Dx=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ui=(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 xne(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Yg(t){if(typeof t=="string"&&(t=xne(t)),!D4(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function kne(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!D4(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class Ox{clone(){return this._cloneInto()}}function _x(t){const e=r=>t().update(Yg(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Ene(t=32){if(Tx&&typeof Tx.getRandomValues=="function")return Tx.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class O4 extends Ox{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,Ane(e);const r=Yg(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),Sx(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 _4=(t,e,n)=>new O4(t,e).update(n).digest();_4.create=(t,e)=>new O4(t,e);function Cne(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 M4 extends Ox{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=Dx(this.buffer)}update(e){Dc(this);const{view:n,buffer:r,blockLen:s}=this;e=Yg(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=Dx(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),T4(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;Cne(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=Dx(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 Sne=(t,e,n)=>t&e^~t&n,Tne=(t,e,n)=>t&e^t&n^e&n,Dne=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]),ea=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ta=new Uint32Array(64);class One extends M4{constructor(){super(64,32,8,!1),this.A=ea[0]|0,this.B=ea[1]|0,this.C=ea[2]|0,this.D=ea[3]|0,this.E=ea[4]|0,this.F=ea[5]|0,this.G=ea[6]|0,this.H=ea[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)ta[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=ta[f-15],h=ta[f-2],p=ui(d,7)^ui(d,18)^d>>>3,m=ui(h,17)^ui(h,19)^h>>>10;ta[f]=m+ta[f-7]+p+ta[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=ui(a,6)^ui(a,11)^ui(a,25),h=c+d+Sne(a,l,u)+Dne[f]+ta[f]|0,m=(ui(r,2)^ui(r,13)^ui(r,22))+Tne(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(){ta.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const N4=_x(()=>new One),Xg=BigInt(2**32-1),Mx=BigInt(32);function R4(t,e=!1){return e?{h:Number(t&Xg),l:Number(t>>Mx&Xg)}:{h:Number(t>>Mx&Xg)|0,l:Number(t&Xg)|0}}function P4(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}=R4(t[s],e);[n[s],r[s]]=[i,o]}return[n,r]}const _ne=(t,e)=>BigInt(t>>>0)<<Mx|BigInt(e>>>0),Mne=(t,e,n)=>t>>>n,Nne=(t,e,n)=>t<<32-n|e>>>n,Rne=(t,e,n)=>t>>>n|e<<32-n,Pne=(t,e,n)=>t<<32-n|e>>>n,Ine=(t,e,n)=>t<<64-n|e>>>n-32,Lne=(t,e,n)=>t>>>n-32|e<<64-n,Bne=(t,e)=>e,Fne=(t,e)=>t,I4=(t,e,n)=>t<<n|e>>>32-n,L4=(t,e,n)=>e<<n|t>>>32-n,B4=(t,e,n)=>e<<n-32|t>>>64-n,F4=(t,e,n)=>t<<n-32|e>>>64-n;function jne(t,e,n,r){const s=(e>>>0)+(r>>>0);return{h:t+n+(s/2**32|0)|0,l:s|0}}const Ze={fromBig:R4,split:P4,toBig:_ne,shrSH:Mne,shrSL:Nne,rotrSH:Rne,rotrSL:Pne,rotrBH:Ine,rotrBL:Lne,rotr32H:Bne,rotr32L:Fne,rotlSH:I4,rotlSL:L4,rotlBH:B4,rotlBL:F4,add:jne,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,Vne]=Ze.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))),na=new Uint32Array(80),ra=new Uint32Array(80);class Hne extends M4{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 w=0;w<16;w++,n+=4)na[w]=e.getUint32(n),ra[w]=e.getUint32(n+=4);for(let w=16;w<80;w++){const A=na[w-15]|0,x=ra[w-15]|0,k=Ze.rotrSH(A,x,1)^Ze.rotrSH(A,x,8)^Ze.shrSH(A,x,7),C=Ze.rotrSL(A,x,1)^Ze.rotrSL(A,x,8)^Ze.shrSL(A,x,7),O=na[w-2]|0,_=ra[w-2]|0,D=Ze.rotrSH(O,_,19)^Ze.rotrBH(O,_,61)^Ze.shrSH(O,_,6),R=Ze.rotrSL(O,_,19)^Ze.rotrBL(O,_,61)^Ze.shrSL(O,_,6),L=Ze.add4L(C,R,ra[w-7],ra[w-16]),F=Ze.add4H(L,k,D,na[w-7],na[w-16]);na[w]=F|0,ra[w]=L|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 w=0;w<80;w++){const A=Ze.rotrSH(f,d,14)^Ze.rotrSH(f,d,18)^Ze.rotrBH(f,d,41),x=Ze.rotrSL(f,d,14)^Ze.rotrSL(f,d,18)^Ze.rotrBL(f,d,41),k=f&h^~f&m,C=d&p^~d&g,O=Ze.add5L(v,x,C,Vne[w],ra[w]),_=Ze.add5H(O,y,A,k,Une[w],na[w]),D=O|0,R=Ze.rotrSH(r,s,28)^Ze.rotrBH(r,s,34)^Ze.rotrBH(r,s,39),L=Ze.rotrSL(r,s,28)^Ze.rotrBL(r,s,34)^Ze.rotrBL(r,s,39),F=r&i^r&a^i&a,G=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}=Ze.add(u|0,c|0,_|0,D|0),u=a|0,c=l|0,a=i|0,l=o|0,i=r|0,o=s|0;const B=Ze.add3L(D,L,G);r=Ze.add3H(B,_,R,F),s=B|0}({h:r,l:s}=Ze.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=Ze.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l}=Ze.add(this.Ch|0,this.Cl|0,a|0,l|0),{h:u,l:c}=Ze.add(this.Dh|0,this.Dl|0,u|0,c|0),{h:f,l:d}=Ze.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:p}=Ze.add(this.Fh|0,this.Fl|0,h|0,p|0),{h:m,l:g}=Ze.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:v}=Ze.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(){na.fill(0),ra.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 zne=_x(()=>new Hne);function $ne(){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 j4=$ne();j4.crypto||j4.msCrypto;function Gne(t){switch(t){case"sha256":return N4.create();case"sha512":return zne.create()}$(!1,"invalid hashing algorithm name","algorithm",t)}const[U4,V4,H4]=[[],[],[]],Wne=BigInt(0),_h=BigInt(1),Kne=BigInt(2),qne=BigInt(7),Qne=BigInt(256),Jne=BigInt(113);for(let t=0,e=_h,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],U4.push(2*(5*r+n)),V4.push((t+1)*(t+2)/2%64);let s=Wne;for(let i=0;i<7;i++)e=(e<<_h^(e>>qne)*Jne)%Qne,e&Kne&&(s^=_h<<(_h<<BigInt(i))-_h);H4.push(s)}const[Yne,Xne]=P4(H4,!0),z4=(t,e,n)=>n>32?B4(t,e,n):I4(t,e,n),$4=(t,e,n)=>n>32?F4(t,e,n):L4(t,e,n);function Zne(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=z4(u,c,1)^n[a],d=$4(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=V4[o],l=z4(s,i,a),u=$4(s,i,a),c=U4[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]^=Yne[r],t[1]^=Xne[r]}n.fill(0)}class Nx extends Ox{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,Jg(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=vne(this.state)}keccak(){Zne(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Dc(this);const{blockLen:n,state:r}=this;e=Yg(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),Sx(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 Jg(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(T4(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 Nx(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 ere=((t,e,n)=>_x(()=>new Nx(e,t,n)))(1,136,256/8);let G4=!1;const W4=function(t){return ere(t)};let K4=W4;function en(t){const e=ct(t,"data");return we(K4(e))}en._=W4,en.lock=function(){G4=!0},en.register=function(t){if(G4)throw new TypeError("keccak256 is locked");K4=t},Object.freeze(en);const q4=function(t){return Gne("sha256").update(t).digest()};let Q4=q4,J4=!1;function Oc(t){const e=ct(t,"data");return we(Q4(e))}Oc._=q4,Oc.lock=function(){J4=!0},Oc.register=function(t){if(J4)throw new Error("sha256 is locked");Q4=t},Object.freeze(Oc),Object.freeze(Oc);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Y4=BigInt(0),Zg=BigInt(1),tre=BigInt(2),ey=t=>t instanceof Uint8Array,nre=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function _c(t){if(!ey(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=nre[t[n]];return e}function X4(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function Rx(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Mc(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 Rx(_c(t))}function Px(t){if(!ey(t))throw new Error("Uint8Array expected");return Rx(_c(Uint8Array.from(t).reverse()))}function Nc(t,e){return Mc(t.toString(16).padStart(e*2,"0"))}function Ix(t,e){return Nc(t,e).reverse()}function rre(t){return Mc(X4(t))}function Cs(t,e,n){let r;if(typeof e=="string")try{r=Mc(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(ey(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 Mh(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!ey(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function sre(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 ire(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function ore(t){let e;for(e=0;t>Y4;t>>=Zg,e+=1);return e}function are(t,e){return t>>BigInt(e)&Zg}const lre=(t,e,n)=>t|(n?Zg:Y4)<<BigInt(e),Lx=t=>(tre<<BigInt(t-1))-Zg,Bx=t=>new Uint8Array(t),Z4=t=>Uint8Array.from(t);function eR(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=Bx(t),s=Bx(t),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...f)=>n(s,r,...f),l=(f=Bx())=>{s=a(Z4([0]),f),r=a(),f.length!==0&&(s=a(Z4([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 Mh(...d)};return(f,d)=>{o(),l(f);let h;for(;!(h=d(u()));)l();return o(),h}}const ure={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 Nh(t,e,n={}){const r=(s,i,o)=>{const a=ure[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 cre=Object.freeze(Object.defineProperty({__proto__:null,bitGet:are,bitLen:ore,bitMask:Lx,bitSet:lre,bytesToHex:_c,bytesToNumberBE:Sl,bytesToNumberLE:Px,concatBytes:Mh,createHmacDrbg:eR,ensureBytes:Cs,equalBytes:sre,hexToBytes:Mc,hexToNumber:Rx,numberToBytesBE:Nc,numberToBytesLE:Ix,numberToHexUnpadded:X4,numberToVarBytesBE:rre,utf8ToBytes:ire,validateObject:Nh},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const yn=BigInt(0),Gt=BigInt(1),Tl=BigInt(2),fre=BigInt(3),Fx=BigInt(4),tR=BigInt(5),nR=BigInt(8);BigInt(9),BigInt(16);function fr(t,e){const n=t%e;return n>=yn?n:e+n}function dre(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 jx(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 hre(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&&dre(s,e,t)!==t-Gt;s++);if(r===1){const o=(t+Gt)/Fx;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 pre(t){if(t%Fx===fre){const e=(t+Gt)/Fx;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%nR===tR){const e=(t-tR)/nR;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 hre(t)}const mre=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function gre(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=mre.reduce((r,s)=>(r[s]="function",r),e);return Nh(t,n)}function yre(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 bre(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 rR(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function wre(t,e,n=!1,r={}){if(t<=yn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:s,nByteLength:i}=rR(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=pre(t),a=Object.freeze({ORDER:t,BITS:s,BYTES:i,MASK:Lx(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)=>yre(a,l,u),div:(l,u)=>fr(l*jx(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>jx(l,t),sqrt:r.sqrt||(l=>o(a,l)),invertBatch:l=>bre(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?Ix(l,i):Nc(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?Px(l):Sl(l)}});return Object.freeze(a)}function sR(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 iR(t){const e=sR(t);return e+Math.ceil(e/2)}function Are(t,e,n=!1){const r=t.length,s=sR(e),i=iR(e);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const o=n?Sl(t):Px(t),a=fr(o,e-Gt)+Gt;return n?Ix(a,s):Nc(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const vre=BigInt(0),Ux=BigInt(1);function xre(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>vre;)i&Ux&&(o=o.add(a)),a=a.double(),i>>=Ux;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+=Ux);const y=m,v=m+Math.abs(g)-1,w=p%2!==0,A=g<0;g===0?c=c.add(n(w,i[y])):u=u.add(n(A,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 oR(t){return gre(t.Fp),Nh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rR(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function kre(t){const e=oR(t);Nh(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:Ere,hexToBytes:Cre}=cre,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:Ere(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Dl,n=typeof t=="string"?Cre(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}`}},zi=BigInt(0),Zr=BigInt(1);BigInt(2);const aR=BigInt(3);BigInt(4);function Sre(t){const e=kre(t),{Fp:n}=e,r=e.toBytes||((p,m,g)=>{const y=m.toAffine();return Mh(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"&&zi<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=_c(p)),typeof p!="string"||!m.includes(p.length))throw new Error("Invalid key");p=p.padStart(g*2,"0")}let w;try{w=typeof p=="bigint"?p:Sl(Cs("private key",p,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof p}`)}return y&&(w=fr(w,v)),a(w),w}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=w=>n.eql(w,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(Cs("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:w,py:A,pz:x}=m,k=n.eql(n.mul(g,x),n.mul(w,v)),C=n.eql(n.mul(y,x),n.mul(A,v));return k&&C}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:g}=e,y=n.mul(g,aR),{px:v,py:w,pz:A}=this;let x=n.ZERO,k=n.ZERO,C=n.ZERO,O=n.mul(v,v),_=n.mul(w,w),D=n.mul(A,A),R=n.mul(v,w);return R=n.add(R,R),C=n.mul(v,A),C=n.add(C,C),x=n.mul(m,C),k=n.mul(y,D),k=n.add(x,k),x=n.sub(_,k),k=n.add(_,k),k=n.mul(x,k),x=n.mul(R,x),C=n.mul(y,C),D=n.mul(m,D),R=n.sub(O,D),R=n.mul(m,R),R=n.add(R,C),C=n.add(O,O),O=n.add(C,O),O=n.add(O,D),O=n.mul(O,R),k=n.add(k,O),D=n.mul(w,A),D=n.add(D,D),O=n.mul(D,R),x=n.sub(x,O),C=n.mul(D,_),C=n.add(C,C),C=n.add(C,C),new f(x,k,C)}add(m){c(m);const{px:g,py:y,pz:v}=this,{px:w,py:A,pz:x}=m;let k=n.ZERO,C=n.ZERO,O=n.ZERO;const _=e.a,D=n.mul(e.b,aR);let R=n.mul(g,w),L=n.mul(y,A),F=n.mul(v,x),G=n.add(g,y),B=n.add(w,A);G=n.mul(G,B),B=n.add(R,L),G=n.sub(G,B),B=n.add(g,v);let H=n.add(w,x);return B=n.mul(B,H),H=n.add(R,F),B=n.sub(B,H),H=n.add(y,v),k=n.add(A,x),H=n.mul(H,k),k=n.add(L,F),H=n.sub(H,k),O=n.mul(_,B),k=n.mul(D,F),O=n.add(k,O),k=n.sub(L,O),O=n.add(L,O),C=n.mul(k,O),L=n.add(R,R),L=n.add(L,R),F=n.mul(_,F),B=n.mul(D,B),L=n.add(L,F),F=n.sub(R,F),F=n.mul(_,F),B=n.add(B,F),R=n.mul(L,B),C=n.add(C,R),R=n.mul(H,B),k=n.mul(G,k),k=n.sub(k,R),R=n.mul(G,L),O=n.mul(H,O),O=n.add(O,R),new f(k,C,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,w)=>v.toAffine(y[w])).map(f.fromAffine)})}multiplyUnsafe(m){const g=f.ZERO;if(m===zi)return g;if(a(m),m===Zr)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:A,k2:x}=y.splitScalar(m),k=g,C=g,O=this;for(;w>zi||x>zi;)w&Zr&&(k=k.add(O)),x&Zr&&(C=C.add(O)),O=O.double(),w>>=Zr,x>>=Zr;return v&&(k=k.negate()),A&&(C=C.negate()),C=new f(n.mul(C.px,y.beta),C.py,C.pz),k.add(C)}multiply(m){a(m);let g=m,y,v;const{endo:w}=e;if(w){const{k1neg:A,k1:x,k2neg:k,k2:C}=w.splitScalar(g);let{p:O,f:_}=this.wNAF(x),{p:D,f:R}=this.wNAF(C);O=h.constTimeNegate(A,O),D=h.constTimeNegate(k,D),D=new f(n.mul(D.px,w.beta),D.py,D.pz),y=O.add(D),v=_.add(R)}else{const{p:A,f:x}=this.wNAF(g);y=A,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,g,y){const v=f.BASE,w=(x,k)=>k===zi||k===Zr||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),A=w(this,g).add(w(m,y));return A.is0()?void 0:A}toAffine(m){const{px:g,py:y,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const A=n.mul(g,m),x=n.mul(y,m),k=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:A,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 _c(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=xre(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:o}}function Tre(t){const e=oR(t);return Nh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Dre(t){const e=Tre(t),{Fp:n,n:r}=e,s=n.BYTES+1,i=2*n.BYTES+1;function o(B){return zi<B&&B<n.ORDER}function a(B){return fr(B,r)}function l(B){return jx(B,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:f,isWithinCurveOrder:d}=Sre({...e,toBytes(B,H,Q){const te=H.toAffine(),Z=n.toBytes(te.x),pe=Mh;return Q?pe(Uint8Array.from([H.hasEvenY()?2:3]),Z):pe(Uint8Array.from([4]),Z,n.toBytes(te.y))},fromBytes(B){const H=B.length,Q=B[0],te=B.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 Ee=n.sqrt(pe);const Re=(Ee&Zr)===Zr;return(Q&1)===1!==Re&&(Ee=n.neg(Ee)),{x:Z,y:Ee}}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=B=>_c(Nc(B,e.nByteLength));function p(B){const H=r>>Zr;return B>H}function m(B){return p(B)?a(-B):B}const g=(B,H,Q)=>Sl(B.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=Cs("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(Cs("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=C(Cs("msgHash",H));if(Z==null||![0,1,2,3].includes(Z))throw new Error("recovery id invalid");const Ee=Z===2||Z===3?Q+e.n:Q;if(Ee>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Re=Z&1?"03":"02",Ce=u.fromHex(Re+h(Ee)),ke=l(Ee),He=a(-pe*ke),Ue=a(te*ke),ze=u.BASE.multiplyAndAddUnsafe(Ce,He,Ue);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 Mc(this.toDERHex())}toDERHex(){return Dl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Mc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(B){try{return c(B),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const B=iR(e.n);return Are(e.randomBytes(B),e.n)},precompute(B=8,H=u.BASE){return H._setWindowSize(B),H.multiply(BigInt(3)),H}};function w(B,H=!0){return u.fromPrivateKey(B).toRawBytes(H)}function A(B){const H=B instanceof Uint8Array,Q=typeof B=="string",te=(H||Q)&&B.length;return H?te===s||te===i:Q?te===2*s||te===2*i:B instanceof u}function x(B,H,Q=!0){if(A(B))throw new Error("first arg must be private key");if(!A(H))throw new Error("second arg must be public key");return u.fromHex(H).multiply(c(B)).toRawBytes(Q)}const k=e.bits2int||function(B){const H=Sl(B),Q=B.length*8-e.nBitLength;return Q>0?H>>BigInt(Q):H},C=e.bits2int_modN||function(B){return a(k(B))},O=Lx(e.nBitLength);function _(B){if(typeof B!="bigint")throw new Error("bigint expected");if(!(zi<=B&&B<O))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Nc(B,e.nByteLength)}function D(B,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:Ee,extraEntropy:Re}=Q;pe==null&&(pe=!0),B=Cs("msgHash",B),Ee&&(B=Cs("prehashed msgHash",te(B)));const Ce=C(B),ke=c(H),He=[_(ke),_(Ce)];if(Re!=null){const tt=Re===!0?Z(n.BYTES):Re;He.push(Cs("extraEntropy",tt))}const Ue=Mh(...He),ze=Ce;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===zi)return;const Be=a($e*a(ze+be*ke));if(Be===zi)return;let z=(ae.x===be?0:2)|Number(ae.y&Zr),q=Be;return pe&&p(Be)&&(q=m(Be),z^=1),new y(be,q,z)}return{seed:Ue,k2sig:Le}}const R={lowS:e.lowS,prehash:!1},L={lowS:e.lowS,prehash:!1};function F(B,H,Q=R){const{seed:te,k2sig:Z}=D(B,H,Q),pe=e;return eR(pe.hash.outputLen,pe.nByteLength,pe.hmac)(te,Z)}u.BASE._setWindowSize(8);function G(B,H,Q,te=L){var ae;const Z=B;if(H=Cs("msgHash",H),Q=Cs("publicKey",Q),"strict"in te)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ee}=te;let Re,Ce;try{if(typeof Z=="string"||Z instanceof Uint8Array)try{Re=y.fromDER(Z)}catch(be){if(!(be instanceof Dl.Err))throw be;Re=y.fromCompact(Z)}else if(typeof Z=="object"&&typeof Z.r=="bigint"&&typeof Z.s=="bigint"){const{r:be,s:Be}=Z;Re=new y(be,Be)}else throw new Error("PARSE");Ce=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&&Re.hasHighS())return!1;Ee&&(H=e.hash(H));const{r:ke,s:He}=Re,Ue=C(H),ze=l(He),Le=a(Ue*ze),tt=a(ke*ze),le=(ae=u.BASE.multiplyAndAddUnsafe(Ce,Le,tt))==null?void 0:ae.toAffine();return le?a(le.x)===ke:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:F,verify:G,ProjectivePoint:u,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ore(t){return{hash:t,hmac:(e,...n)=>_4(t,e,kne(...n)),randomBytes:Ene}}function _re(t,e){const n=r=>Dre({...t,...Ore(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const lR=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),uR=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Mre=BigInt(1),Vx=BigInt(2),cR=(t,e)=>(t+e/Vx)/e;function Nre(t){const e=lR,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,Vx,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,w=Xr(v,n,e)*c%e,A=Xr(w,o,e)*p%e,x=Xr(A,r,e)*u%e,k=Xr(x,Vx,e);if(!Hx.eql(Hx.sqr(k),t))throw new Error("Cannot find square root");return k}const Hx=wre(lR,void 0,void 0,{sqrt:Nre}),sa=_re({a:BigInt(0),b:BigInt(7),Fp:Hx,n:uR,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=uR,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Mre*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,o=BigInt("0x100000000000000000000000000000000"),a=cR(i*t,e),l=cR(-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}}}},N4);BigInt(0),sa.ProjectivePoint;const Rh="0x0000000000000000000000000000000000000000",fR="0x0000000000000000000000000000000000000000000000000000000000000000",dR=BigInt(0),hR=BigInt(1),pR=BigInt(2),mR=BigInt(27),gR=BigInt(28),ty=BigInt(35),Rc={};function yR(t){return xl(Wn(t),32)}const Ms=class Ms{constructor(e,n,r,s){J(this,uf);J(this,cf);J(this,ff);J(this,eu);zg(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){$(Ec(e)===32,"invalid r","value",e),I(this,uf,we(e))}get s(){return T(this,cf)}set s(e){$(Ec(e)===32,"invalid s","value",e);const n=we(e);$(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");$(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:Ms.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 Ms(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=xe(e,"v");return n==mR||n==gR?dR:($(n>=ty,"invalid EIP-155 v","v",e),(n-ty)/pR)}static getChainIdV(e,n){return xe(e)*pR+BigInt(35+n-27)}static getNormalizedV(e){const n=xe(e);return n===dR||n===mR?27:n===hR||n===gR?28:($(n>=ty,"invalid v","v",e),n&hR?27:28)}static from(e){function n(u,c){$(u,c,"signature",e)}if(e==null)return new Ms(Rc,fR,fR,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 Ms(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=Ms.getNormalizedV(u[64]);return new Ms(Rc,c,we(f),d)}n(!1,"invalid raw signature length")}if(e instanceof Ms)return e.clone();const r=e.r;n(r!=null,"missing r");const s=yR(r),i=function(u,c){if(u!=null)return yR(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=xe(u);return{networkV:d>=ty?d:void 0,v:Ms.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 Ms(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=Ms;const tu=class tu{constructor(e){J(this,oo);$(Ec(e)===32,"invalid private key","privateKey","[REDACTED]"),I(this,oo,we(e))}get privateKey(){return T(this,oo)}get publicKey(){return tu.computePublicKey(T(this,oo))}get compressedPublicKey(){return tu.computePublicKey(T(this,oo),!0)}sign(e){$(Ec(e)===32,"invalid digest length","digest",e);const n=sa.sign(Gn(e),Gn(T(this,oo)),{lowS:!0});return Ss.from({r:Xo(n.r,32),s:Xo(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=tu.computePublicKey(e);return we(sa.getSharedSecret(Gn(T(this,oo)),ct(n),!1))}static computePublicKey(e,n){let r=ct(e,"key");if(r.length===32){const i=sa.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=sa.ProjectivePoint.fromHex(r);return we(s.toRawBytes(n))}static recoverPublicKey(e,n){$(Ec(e)===32,"invalid digest length","digest",e);const r=Ss.from(n);let s=sa.Signature.fromCompact(Gn($t([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const i=s.recoverPublicKey(Gn(e));return $(i!=null,"invalid signautre for digest","signature",n),"0x"+i.toHex(!1)}static addPoints(e,n,r){const s=sa.ProjectivePoint.fromHex(tu.computePublicKey(e).substring(2)),i=sa.ProjectivePoint.fromHex(tu.computePublicKey(n).substring(2));return"0x"+s.add(i).toHex(!!r)}};oo=new WeakMap;let Ph=tu;const Rre=BigInt(0),Pre=BigInt(36);function bR(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 zx={};for(let t=0;t<10;t++)zx[String(t)]=String(t);for(let t=0;t<26;t++)zx[String.fromCharCode(65+t)]=String(10+t);const wR=15;function Ire(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>zx[r]).join("");for(;e.length>=wR;){let r=e.substring(0,wR);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 Lre=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function Bre(t){t=t.toLowerCase();let e=Rre;for(let n=0;n<t.length;n++)e=e*Pre+Lre[t[n]];return e}function gt(t){if($(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=bR(t);return $(!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}$/)){$(t.substring(2,4)===Ire(t),"bad icap checksum","address",t);let e=Bre(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return bR("0x"+e)}$(!1,"invalid address","address",t)}function Fre(t){const e=gt(t.from);let r=xe(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,gt(Ht(en(El([e,r])),12))}function AR(t){return t&&typeof t.getAddress=="function"}function jre(t){try{return gt(t),!0}catch{}return!1}async function $x(t,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(ee(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),$(!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"}),$x(t,e.resolveName(t)));if(AR(t))return $x(t,t.getAddress());if(t&&typeof t.then=="function")return $x(t,t);$(!1,"unsupported addressable value","target",t)}const $i={};function Ae(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new Rn($i,`${n?"":"u"}int${e}`,t,{signed:n,width:e})}function dt(t,e){return new Rn($i,`bytes${e||""}`,t,{size:e})}const vR=Symbol.for("_ethers_typed"),ao=class ao{constructor(e,n,r,s){W(this,"type");W(this,"value");J(this,nu);W(this,"_typedSymbol");s==null&&(s=null),zg($i,e,"Typed"),Oe(this,{_typedSymbol:vR,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 ao($i,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 ao($i,"address",e)}static bool(e){return new ao($i,"bool",!!e)}static bytes(e){return new ao($i,"bytes",e)}static string(e){return new ao($i,"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 ao($i,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===vR}static dereference(e,n){if(ao.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=ao;class Ure extends Hi{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(Xo(e.readValue(),20))}}class Vre extends Hi{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 xR(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 $(!1,"invalid tuple value","tuple",n);$(e.length===r.length,"types/value length mismatch","tuple",n);let s=new Ex,i=new Ex,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 kR(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 Hre extends Hi{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");Oe(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)),n4(s.length,i,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<s.length;a++)o.push(this.coder);return xR(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 Vre(this.coder));return kR(n,s)}}class zre extends Hi{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 ER extends Hi{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 $re extends ER{constructor(e){super("bytes",e)}decode(e){return we(super.decode(e))}}class Gre extends Hi{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);W(this,"size");Oe(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 Wre=new Uint8Array([]);class Kre extends Hi{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes(Wre)}decode(e){return e.readBytes(0),null}}const qre=BigInt(0),Qre=BigInt(1),Jre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Yre extends Hi{constructor(n,r,s){const i=(r?"int":"uint")+n*8;super(i,i,s,!1);W(this,"size");W(this,"signed");Oe(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=xe(Rn.dereference(r,this.type)),i=Dh(Jre,qn*8);if(this.signed){let o=Dh(i,this.size*8-1);(s>o||s<-(o+Qre))&&this._throwError("value out-of-bounds",r),s=o4(s,8*qn)}else(s<qre||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=tne(r,this.size*8)),r}}class Xre extends ER{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 ny extends Hi{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");Oe(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 xR(n,this.coders,s)}decode(n){return kR(n,this.coders)}}function Ol(t){return en(Vi(t))}var Zre="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";const CR=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),SR=4;function ese(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,w=d;for(;;){let x=Math.floor(((g-v+1)*s-1)/w),k=0,C=r;for(;C-k>1;){let D=k+C>>>1;x<i[D]?C=D:k=D}if(k==0)break;y.push(k);let O=v+Math.floor(w*i[k]/s),_=v+Math.floor(w*i[k+1]/s)-1;for(;!((O^_)&h);)g=g<<1&m|c(),O=O<<1&m,_=_<<1&m|1;for(;O&~_&p;)g=g&h|g<<1&m>>>1|c(),O=O<<1^h,_=(_^h)<<1|h|1;v=O,w=1+_-O}let A=r-4;return y.map(x=>{switch(x-A){case 3:return A+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return A+256+(t[a++]<<8|t[a++]);case 1:return A+t[a++];default:return x-1}})}function tse(t){let e=0;return()=>t[e++]}function TR(t){return tse(ese(nse(t)))}function nse(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 rse(t){return t&1?~t>>1:t>>1}function sse(t,e){let n=Array(t);for(let r=0,s=0;r<t;r++)n[r]=s+=rse(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 DR(t){return Lh(()=>{let e=Ih(t);if(e.length)return e})}function OR(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(ise(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(ose(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 _R(t,e,n){let r=Array(t).fill().map(()=>[]);for(let s=0;s<e;s++)sse(t,n).forEach((i,o)=>r[o].push(i));return r}function ise(t,e){let n=1+e(),r=e(),s=Lh(e);return _R(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 ose(t,e){let n=1+e();return _R(n,1+t,e).map(s=>[s[0],s.slice(1)])}function ase(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 lse(t){return t.toString(16).toUpperCase().padStart(2,"0")}function MR(t){return`{${lse(t)}}`}function use(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 cse(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 fse="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";const Bh=44032,ry=4352,sy=4449,iy=4519,NR=19,RR=21,Ic=28,oy=RR*Ic,dse=NR*oy,hse=Bh+dse,pse=ry+NR,mse=sy+RR,gse=iy+Ic;function Fh(t){return t>>24&255}function PR(t){return t&16777215}let Gx,IR,Wx,ay;function yse(){let t=TR(fse);Gx=new Map(DR(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),IR=new Set(Ih(t)),Wx=new Map,ay=new Map;for(let[e,n]of OR(t)){if(!IR.has(e)&&n.length==2){let[r,s]=n,i=ay.get(r);i||(i=new Map,ay.set(r,i)),i.set(s,e)}Wx.set(e,n.reverse())}}function LR(t){return t>=Bh&&t<hse}function bse(t,e){if(t>=ry&&t<pse&&e>=sy&&e<mse)return Bh+(t-ry)*oy+(e-sy)*Ic;if(LR(t)&&e>iy&&e<gse&&(t-Bh)%Ic==0)return t+(e-iy);{let n=ay.get(t);return n&&(n=n.get(e),n)?n:-1}}function BR(t){Gx||yse();let e=[],n=[],r=!1;function s(i){let o=Gx.get(i);o&&(r=!0,i|=o),e.push(i)}for(let i of t)for(;;){if(i<128)e.push(i);else if(LR(i)){let o=i-Bh,a=o/oy|0,l=o%oy/Ic|0,u=o%Ic;s(ry+a),s(sy+l),u>0&&s(iy+u)}else{let o=Wx.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 wse(t){let e=[],n=[],r=-1,s=0;for(let i of t){let o=Fh(i),a=PR(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=bse(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 FR(t){return BR(t).map(PR)}function Ase(t){return wse(BR(t))}const jR=45,UR=".",VR=65039,HR=1,ly=t=>Array.from(t);function jh(t,e){return t.P.has(e)||t.Q.has(e)}class vse extends Array{get is_emoji(){return!0}}let Kx,zR,_l,qx,$R,Lc,Qx,Bc,Ml,GR,Jx;function Yx(){if(Kx)return;let t=TR(Zre);const e=()=>Ih(t),n=()=>new Set(e()),r=(c,f)=>f.forEach(d=>c.add(d));Kx=new Map(OR(t)),zR=n(),_l=e(),qx=new Set(e().map(c=>_l[c])),_l=new Set(_l),$R=n(),n();let s=DR(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}}}),Qx=n(),Bc=new Map;let a=e().concat(ly(Qx)).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),Qx.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=>ly(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)}}Ml=new Set;let l=new Set;const u=c=>Ml.has(c)?l.add(c):Ml.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 Ml)!Bc.has(c)&&!l.has(c)&&Bc.set(c,HR);r(Ml,FR(Ml)),GR=ase(t).map(c=>vse.from(c)).sort(cse),Jx=new Map;for(let c of GR){let f=[Jx];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===VR?f.push(...h):f=h}for(let d of f)d.V=c}}function Xx(t){return(WR(t)?"":`${Zx(uy([t]))} `)+MR(t)}function Zx(t){return`"${t}"`}function xse(t){if(t.length>=4&&t[2]==jR&&t[3]==jR)throw new Error(`invalid label extension: "${Pc(t.slice(0,4))}"`)}function kse(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Ese(t){let e=t[0],n=CR.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=CR.get(e);if(o){if(s==i)throw Uh(`${n} + ${o}`);s=i+1,n=o}}if(s==r)throw Uh(`trailing ${n}`)}function uy(t,e=1/0,n=MR){let r=[];Cse(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];WR(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 Cse(t){return Yx(),_l.has(t)}function WR(t){return Yx(),$R.has(t)}function Sse(t){return _se(Tse(t,Ase,Rse))}function Tse(t,e,n){if(!t)return[];Yx();let r=0;return t.split(UR).map(s=>{let i=use(s),o={input:i,offset:r};r+=i.length+1;try{let a=o.tokens=Nse(i,e,n),l=a.length,u;if(!l)throw new Error("empty label");let c=o.output=a.flat();if(kse(c),!(o.emoji=l>1||a[0].is_emoji)&&c.every(d=>d<128))xse(c),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(_l.has(c[0]))throw Uh("leading combining mark");for(let m=1;m<l;m++){let g=a[m];if(!g.is_emoji&&_l.has(g[0]))throw Uh(`emoji + combining mark: "${Pc(a[m-1])} + ${uy([g[0]])}"`)}Ese(c);let h=ly(new Set(d)),[p]=Ose(h);Mse(p,d),Dse(p,h),u=p.N}}o.type=u}catch(a){o.error=a}return o})}function Dse(t,e){let n,r=[];for(let s of e){let i=Bc.get(s);if(i===HR)return;if(i){let o=i.M.get(s);if(n=n?n.filter(a=>o.has(a)):ly(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 Ose(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))?qR(e[0],n):KR(n);if(e=r,r.length==1)break}return e}function _se(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(uy(e,63))}: ${s}`)}return Pc(r)}).join(UR)}function KR(t){return new Error(`disallowed character: ${Xx(t)}`)}function qR(t,e){let n=Xx(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 Mse(t,e){for(let n of e)if(!jh(t,n))throw qR(t,n);if(t.M){let n=FR(e);for(let r=1,s=n.length;r<s;r++)if(qx.has(n[r])){let i=r+1;for(let o;i<s&&qx.has(o=n[i]);i++)for(let a=r;a<i;a++)if(n[a]==o)throw new Error(`duplicate non-spacing marks: ${Xx(o)}`);if(i-r>SR)throw new Error(`excessive non-spacing marks: ${Zx(uy(n.slice(r-1,i)))} (${i-r}/${SR})`);r=i}}}function Nse(t,e,n){let r=[],s=[];for(t=t.slice().reverse();t.length;){let i=Pse(t);if(i)s.length&&(r.push(e(s)),s=[]),r.push(n(i));else{let o=t.pop();if(Ml.has(o))s.push(o);else{let a=Kx.get(o);if(a)s.push(...a);else if(!zR.has(o))throw KR(o)}}}return s.length&&r.push(e(s)),r}function Rse(t){return t.filter(e=>e!=VR)}function Pse(t,e){let n=Jx,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 QR=new Uint8Array(32);QR.fill(0);function JR(t){return $(t.length!==0,"invalid ENS name; empty component","comp",t),t}function YR(t){const e=Vi(Ise(t)),n=[];if(t.length===0)return n;let r=0;for(let s=0;s<e.length;s++)e[s]===46&&(n.push(JR(e.slice(r,s))),r=s+1);return $(r<e.length,"invalid ENS name; empty component","name",t),n.push(JR(e.slice(r))),n}function Ise(t){try{if(t.length===0)throw new Error("empty label");return Sse(t)}catch(e){$(!1,`invalid ENS name (${e.message})`,"name",t)}}function e2(t){$(typeof t=="string","invalid ENS name; not a string","name",t),$(t.length,"invalid ENS name (empty label)","name",t);let e=QR;const n=YR(t);for(;n.length;)e=en($t([e,en(n.pop())]));return we(e)}function Lse(t,e){const n=e;return $(n<=255,"DNS encoded label cannot exceed 255","length",n),we($t(YR(t).map(r=>{$(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 t2(t,e){return{address:gt(t),storageKeys:e.map((n,r)=>($(St(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function ia(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?($(n.length===2,"invalid slot set",`value[${r}]`,n),t2(n[0],n[1])):($(n!=null&&typeof n=="object","invalid address-slot set","value",t),t2(n.address,n.storageKeys)));$(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 t2(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function Bse(t){let e;return typeof t=="string"?e=Ph.computePublicKey(t,!1):e=t.publicKey,gt(en("0x"+e.substring(4)).substring(26))}function Fse(t,e){return Bse(Ph.recoverPublicKey(t,e))}const bn=BigInt(0),jse=BigInt(2),Use=BigInt(27),Vse=BigInt(28),Hse=BigInt(35),zse=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n2=4096*32;function XR(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=Oc(e).substring(4),"0x"+n}function cy(t){return t==="0x"?null:gt(t)}function r2(t,e){try{return ia(t)}catch(n){$(!1,n.message,e,t)}}function Vh(t,e){return t==="0x"?0:Qe(t,e)}function Wt(t,e){if(t==="0x")return bn;const n=xe(t,e);return $(n<=zse,"value exceeds uint size",e,n),n}function Ot(t,e){const n=xe(t,"value"),r=Wn(n);return $(r.length<=32,"value too large",`tx.${e}`,n),r}function s2(t){return ia(t).map(e=>[e.address,e.storageKeys])}function $se(t,e){$(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n<t.length;n++)$(St(t[n],32),"invalid ${ param } hash",`value[${n}]`,t[n]);return t}function Gse(t){const e=qg(t);$(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:Vh(e[0],"nonce"),gasPrice:Wt(e[1],"gasPrice"),gasLimit:Wt(e[2],"gasLimit"),to:cy(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-Hse)/jse;o<bn&&(o=bn),n.chainId=o,$(o!==bn||r===Use||r===Vse,"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 Wse(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=xe(t.chainId,"tx.chainId"),$(!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")),El(n);let s=BigInt(27+e.yParity);return r!==bn?s=Ss.getChainIdV(r,e.v):BigInt(e.v)!==s&&$(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(Wn(s)),n.push(Wn(e.r)),n.push(Wn(e.s)),El(n)}function i2(t,e){let n;try{if(n=Vh(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{$(!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 Kse(t){const e=qg(ct(t).slice(1));$(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:Vh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:cy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:r2(e[8],"accessList")};return e.length===9||i2(n,e.slice(9)),n}function qse(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,s2(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"yParity")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x02",El(n)])}function Qse(t){const e=qg(ct(t).slice(1));$(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:Vh(e[1],"nonce"),gasPrice:Wt(e[2],"gasPrice"),gasLimit:Wt(e[3],"gasLimit"),to:cy(e[4]),value:Wt(e[5],"value"),data:we(e[6]),accessList:r2(e[7],"accessList")};return e.length===8||i2(n,e.slice(8)),n}function Jse(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,s2(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"recoveryParam")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x01",El(n)])}function Yse(t){let e=qg(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];$(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),$(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),$(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),$(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),$(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]}$(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:Vh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:cy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:r2(e[8],"accessList"),maxFeePerBlobGas:Wt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};r&&(s.blobs=r),$(s.to!=null,`invalid address for transaction type: ${n}`,"data",t),$(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let i=0;i<s.blobVersionedHashes.length;i++)$(St(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",t);return e.length===11||i2(s,e.slice(11)),s}function Xse(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,s2(t.accessList||[]),Ot(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),$se(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(r.push(Ot(e.yParity,"yParity")),r.push(Wn(e.r)),r.push(Wn(e.s)),n)?$t(["0x03",El([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):$t(["0x03",El(r)])}const uo=class uo{constructor(){J(this,kf);J(this,pi);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,ga);J(this,lo);J(this,ya);I(this,pi,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,ga,null),I(this,ya,null),I(this,lo,null)}get type(){return T(this,pi)}set type(e){switch(e){case null:I(this,pi,null);break;case 0:case"legacy":I(this,pi,0);break;case 1:case"berlin":case"eip-2930":I(this,pi,1);break;case 2:case"london":case"eip-1559":I(this,pi,2);break;case 3:case"cancun":case"eip-4844":I(this,pi,3);break;default:$(!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,xe(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:xe(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:xe(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:xe(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,xe(e,"value"))}get chainId(){return T(this,Af)}set chainId(e){I(this,Af,xe(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:ia(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:xe(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=T(this,ga);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){$(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)$(St(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}I(this,ga,e)}get blobs(){return T(this,ya)==null?null:T(this,ya).map(e=>Object.assign({},e))}set blobs(e){if(e==null){I(this,ya,null);return}const n=[],r=[];for(let s=0;s<e.length;s++){const i=e[s];if(wx(i)){ee(T(this,lo),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ct(i);if($(o.length<=n2,"blob is too large",`blobs[${s}]`,i),o.length!==n2){const u=new Uint8Array(n2);u.set(o),o=u}const a=T(this,lo).blobToKzgCommitment(o),l=we(T(this,lo).computeBlobKzgProof(o,a));n.push({data:we(o),commitment:we(a),proof:l}),r.push(XR(1,a))}else{const o=we(i.commitment);n.push({data:we(i.data),commitment:o,proof:we(i.proof)}),r.push(XR(1,o))}}I(this,ya,n),I(this,ga,r)}get kzg(){return T(this,lo)}set kzg(e){I(this,lo,e)}get hash(){return this.signature==null?null:en(fe(this,kf,fb).call(this,!0,!1))}get unsignedHash(){return en(this.unsignedSerialized)}get from(){return this.signature==null?null:Fse(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,fb).call(this,!0,!0)}get unsignedSerialized(){return fe(this,kf,fb).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,ga);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 uo.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 uo;if(typeof e=="string"){const r=ct(e);if(r[0]>=127)return uo.from(Gse(r));switch(r[0]){case 1:return uo.from(Qse(r));case 2:return uo.from(Kse(r));case 3:return uo.from(Yse(r))}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new uo;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&&($(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),$(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&($(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),$(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};pi=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,ga=new WeakMap,lo=new WeakMap,ya=new WeakMap,kf=new WeakSet,fb=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 Wse(this,r);case 1:return Jse(this,r);case 2:return qse(this,r);case 3:return Xse(this,r,n?this.blobs:null)}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let Hh=uo;const ZR=new Uint8Array(32);ZR.fill(0);const Zse=BigInt(-1),eP=BigInt(0),tP=BigInt(1),eie=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function tie(t){const e=ct(t),n=e.length%32;return n?$t([e,ZR.slice(n)]):we(e)}const nie=Xo(tP,32),rie=Xo(eP,32),nP={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o2=["name","version","chainId","verifyingContract","salt"];function rP(t){return function(e){return $(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const sie={name:rP("name"),version:rP("version"),chainId:function(t){const e=xe(t,"domain.chainId");return $(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):kl(e)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}$(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=ct(t,"domain.salt");return $(e.length===32,'invalid domain value "salt"',"domain.salt",t),we(e)}};function a2(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);$(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const s=Dh(eie,n?r-1:r),i=n?(s+tP)*Zse:eP;return function(o){const a=xe(o,"value");return $(a>=i&&a<=s,`value out-of-bounds for ${t}`,"value",a),Xo(n?o4(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return $(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const s=ct(r);return $(s.length===n,`invalid length for ${t}`,"value",r),tie(r)}}}switch(t){case"address":return function(e){return xl(gt(e),32)};case"bool":return function(e){return e?nie:rie};case"bytes":return function(e){return en(e)};case"string":return function(e){return Ol(e)}}return null}function sP(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function fy(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,sb);W(this,"primaryType");J(this,mp);J(this,co);J(this,Ef);I(this,co,new Map),I(this,Ef,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}=fy(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]){$(!u.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(l)}`,"types",e),u.add(c.name);const f=fy(c.type).base;$(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!a2(f)&&($(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);$(o.length!==0,"missing primary type","types",e),$(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Oe(this,{primaryType:o[0]});function a(l,u){$(!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,co).set(l,sP(l,i[l])+c.map(f=>sP(f,i[f])).join(""))}}get types(){return JSON.parse(T(this,mp))}getEncoder(e){let n=T(this,Ef).get(e);return n||(n=fe(this,sb,KL).call(this,e),T(this,Ef).set(e,n)),n}encodeType(e){const n=T(this,co).get(e);return $(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(a2(e))return r(e,n);const s=fy(e).array;if(s)return $(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),{});$(!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=nP[r];$(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:s})}return n.sort((r,s)=>o2.indexOf(r.name)-o2.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=[];o2.forEach(l=>{const u=e[l];u!=null&&(s[l]=sie[l](u),i.push({name:l,type:nP[l]}))});const o=ns.from(n);n=o.types;const a=Object.assign({},n);return $(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 xe(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return $(typeof u=="string","invalid string","value",u),u}$(!1,"unsupported type","type",l)})}}};mp=new WeakMap,co=new WeakMap,Ef=new WeakMap,sb=new WeakSet,KL=function(e){{const s=a2(e);if(s)return s}const n=fy(e).array;if(n){const s=n.prefix,i=this.getEncoder(s);return o=>{$(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let a=o.map(i);return T(this,co).has(s)&&(a=a.map(en)),en($t(a))}}const r=this.types[e];if(r){const s=Ol(T(this,co).get(e));return i=>{const o=r.map(({name:a,type:l})=>{const u=this.getEncoder(l)(i[a]);return T(this,co).has(l)?en(u):u});return o.unshift(s),$t(o)}}$(!1,`unknown type: ${e}`,"type",e)};let dy=ns;function Jn(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const iie=Jn("external public payable override".split(" ")),iP="constant external internal payable private public pure view override",oie=Jn(iP.split(" ")),oP="constructor error event fallback function receive struct",aP=Jn(oP.split(" ")),lP="calldata memory storage payable indexed",aie=Jn(lP.split(" ")),lie=[oP,lP,"tuple returns",iP].join(" "),uie=Jn(lie.split(" ")),cie={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},fie=new RegExp("^(\\s*)"),die=new RegExp("^([0-9]+)"),hie=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),uP=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),cP=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),ib=class ib{constructor(e){J(this,gp);J(this,Dn);J(this,Ns);I(this,Dn,0),I(this,Ns,e.slice())}get offset(){return T(this,Dn)}get length(){return T(this,Ns).length-T(this,Dn)}clone(){return new ib(T(this,Ns))}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,Yk).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,Yk).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,Ns).length)throw new Error("out-of-bounds");return T(this,Ns)[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,Ns).length;n++){const r=T(this,Ns)[n];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}};Dn=new WeakMap,Ns=new WeakMap,gp=new WeakSet,Yk=function(e=0,n=0){return new ib(T(this,Ns).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Ts=ib;function oa(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(fie);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=cie[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(hie),a){if(l.text=a[1],i+=l.text.length,uie.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(cP)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(die),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 fP(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 hy(t,e){if(e.peekKeyword(aP)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Gi(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 dP(t){let e=Gi(t,oie);return fP(e,Jn("constant payable nonpayable".split(" "))),fP(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 Wi(t,e){return t.popParams().map(n=>En.from(n,e))}function hP(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return xe(t.pop().text);throw new Error("invalid gas")}return null}function Nl(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const pie=new RegExp(/^(.*)\[([0-9]*)\]$/);function pP(t){const e=t.match(cP);if($(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);$(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);$(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const Lt={},dr=Symbol.for("_ethers_internal"),mP="_ParamTypeInternal",gP="_ErrorInternal",yP="_EventInternal",bP="_ConstructorInternal",wP="_FallbackInternal",AP="_FunctionInternal",vP="_StructInternal",rs=class rs{constructor(e,n,r,s,i,o,a,l){J(this,Cf);W(this,"name");W(this,"type");W(this,"baseType");W(this,"indexed");W(this,"components");W(this,"arrayLength");W(this,"arrayChildren");if(zg(e,Lt,"ParamType"),Object.defineProperty(this,dr,{value:mP}),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("");Oe(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,Cf,db).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(oa(e),n)}catch{$(!1,"invalid param type","obj",e)}else if(e instanceof Ts){let a="",l="",u=null;Gi(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=pP(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(Gi(e,aie).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;$(!r||typeof r=="string"&&r.match(uP),"invalid name","obj.name",r);let s=e.indexed;s!=null&&($(n,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(pie);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=pP(e.type),new rs(Lt,r||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[dr]===mP}};Cf=new WeakSet,db=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,Cf,db).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],Cf,db).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 En=rs;class Rl{constructor(e,n,r){W(this,"type");W(this,"inputs");zg(e,Lt,"Fragment"),r=Object.freeze(r.slice()),Oe(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{Rl.from(JSON.parse(e))}catch{}return Rl.from(oa(e))}if(e instanceof Ts)switch(e.peekKeyword(aP)){case"constructor":return Ki.from(e);case"error":return hr.from(e);case"event":return ci.from(e);case"fallback":case"receive":return qi.from(e);case"function":return fi.from(e);case"struct":return Pl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Ki.from(e);case"error":return hr.from(e);case"event":return ci.from(e);case"fallback":case"receive":return qi.from(e);case"function":return fi.from(e);case"struct":return Pl.from(e)}ee(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}$(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Ki.isFragment(e)}static isError(e){return hr.isFragment(e)}static isEvent(e){return ci.isFragment(e)}static isFunction(e){return fi.isFragment(e)}static isStruct(e){return Pl.isFragment(e)}}class py extends Rl{constructor(n,r,s,i){super(n,r,i);W(this,"name");$(typeof s=="string"&&s.match(uP),"invalid identifier","name",s),i=Object.freeze(i.slice()),Oe(this,{name:s})}}function zh(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class hr extends py{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,dr,{value:gP})}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(oa(e));if(e instanceof Ts){const n=hy("error",e),r=Wi(e);return Nl(e),new hr(Lt,n,r)}return new hr(Lt,e.name,e.inputs?e.inputs.map(En.from):[])}static isFragment(e){return e&&e[dr]===gP}}class ci extends py{constructor(n,r,s,i){super(n,"event",r,s);W(this,"anonymous");Object.defineProperty(this,dr,{value:yP}),Oe(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=>En.from(i)),new ci(Lt,n,r,!1).topicHash}static from(n){if(ci.isFragment(n))return n;if(typeof n=="string")try{return ci.from(oa(n))}catch{$(!1,"invalid event fragment","obj",n)}else if(n instanceof Ts){const r=hy("event",n),s=Wi(n,!0),i=!!Gi(n,Jn(["anonymous"])).has("anonymous");return Nl(n),new ci(Lt,r,s,i)}return new ci(Lt,n.name,n.inputs?n.inputs.map(r=>En.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[dr]===yP}}class Ki extends Rl{constructor(n,r,s,i,o){super(n,r,s);W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:bP}),Oe(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(Ki.isFragment(n))return n;if(typeof n=="string")try{return Ki.from(oa(n))}catch{$(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Ts){Gi(n,Jn(["constructor"]));const r=Wi(n),s=!!Gi(n,iie).has("payable"),i=hP(n);return Nl(n),new Ki(Lt,"constructor",r,s,i)}return new Ki(Lt,"constructor",n.inputs?n.inputs.map(En.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===bP}}class qi extends Rl{constructor(n,r,s){super(n,"fallback",r);W(this,"payable");Object.defineProperty(this,dr,{value:wP}),Oe(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(oa(n))}catch{$(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Ts){const r=n.toString(),s=n.peekKeyword(Jn(["fallback","receive"]));if($(s,"type must be fallback or receive","obj",r),n.popKeyword(Jn(["fallback","receive"]))==="receive"){const l=Wi(n);return $(l.length===0,"receive cannot have arguments","obj.inputs",l),Gi(n,Jn(["payable"])),Nl(n),new qi(Lt,[],!0)}let o=Wi(n);o.length?$(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[En.from("bytes")];const a=dP(n);if($(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Gi(n,Jn(["returns"])).has("returns")){const l=Wi(n);$(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return Nl(n),new qi(Lt,o,a==="payable")}if(n.type==="receive")return new qi(Lt,[],!0);if(n.type==="fallback"){const r=[En.from("bytes")],s=n.stateMutability==="payable";return new qi(Lt,r,s)}$(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[dr]===wP}}class fi extends py{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:AP}),o=Object.freeze(o.slice()),Oe(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=>En.from(i)),new fi(Lt,n,"view",r,[],null).selector}static from(n){if(fi.isFragment(n))return n;if(typeof n=="string")try{return fi.from(oa(n))}catch{$(!1,"invalid function fragment","obj",n)}else if(n instanceof Ts){const s=hy("function",n),i=Wi(n),o=dP(n);let a=[];Gi(n,Jn(["returns"])).has("returns")&&(a=Wi(n));const l=hP(n);return Nl(n),new fi(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 fi(Lt,n.name,r,n.inputs?n.inputs.map(En.from):[],n.outputs?n.outputs.map(En.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===AP}}class Pl extends py{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,dr,{value:vP})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Pl.from(oa(e))}catch{$(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ts){const n=hy("struct",e),r=Wi(e);return Nl(e),new Pl(Lt,n,r)}return new Pl(Lt,e.name,e.inputs?e.inputs.map(En.from):[])}static isFragment(e){return e&&e[dr]===vP}}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 mie=new RegExp(/^bytes([0-9]*)$/),gie=new RegExp(/^(u?int)([0-9]*)$/);let l2=null,xP=1024;function yie(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)),Nt(s,"CALL_EXCEPTION",{action:t,data:n,reason:i,transaction:l,invocation:o,revert:a})}const ob=class ob{constructor(){J(this,ba)}getDefaultValue(e){const n=e.map(s=>fe(this,ba,qf).call(this,En.from(s)));return new ny(n,"_").defaultValue()}encode(e,n){n4(n.length,e.length,"types/values length mismatch");const r=e.map(o=>fe(this,ba,qf).call(this,En.from(o))),s=new ny(r,"_"),i=new Ex;return s.encode(i,n),i.data}decode(e,n,r){const s=e.map(o=>fe(this,ba,qf).call(this,En.from(o)));return new ny(s,"_").decode(new Cx(n,r,xP))}static _setDefaultMaxInflation(e){$(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),xP=e}static defaultAbiCoder(){return l2==null&&(l2=new ob),l2}static getBuiltinCallException(e,n,r){return yie(e,n,r,ob.defaultAbiCoder())}};ba=new WeakSet,qf=function(e){if(e.isArray())return new Hre(fe(this,ba,qf).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new ny(e.components.map(r=>fe(this,ba,qf).call(this,r)),e.name);switch(e.baseType){case"address":return new Ure(e.name);case"bool":return new zre(e.name);case"string":return new Xre(e.name);case"bytes":return new $re(e.name);case"":return new Kre(e.name)}let n=e.type.match(gie);if(n){let r=parseInt(n[2]||"256");return $(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Yre(r/8,n[1]==="int",e.name)}if(n=e.type.match(mie),n){let r=parseInt(n[1]);return $(r!==0&&r<=32,"invalid bytes length","param",e),new Gre(r,e.name)}$(!1,"invalid type","type",e.type)};let Fc=ob;class bie{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();Oe(this,{fragment:e,name:s,signature:i,topic:n,args:r})}}class wie{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();Oe(this,{fragment:e,name:i,args:r,signature:o,selector:n,value:s})}}class Aie{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();Oe(this,{fragment:e,name:s,args:r,signature:i,selector:n})}}class kP{constructor(e){W(this,"hash");W(this,"_isIndexed");Oe(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const EP={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"},CP={"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&&EP[t.toString()]&&(e=EP[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}},su=class su{constructor(e){J(this,bi);W(this,"fragments");W(this,"deploy");W(this,"fallback");W(this,"receive");J(this,mi);J(this,gi);J(this,yi);J(this,Ln);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,I(this,yi,new Map),I(this,mi,new Map),I(this,gi,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)}Oe(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}Oe(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:($(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":l=T(this,yi);break;case"event":l=T(this,gi);break;case"error":l=T(this,mi);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Oe(this,{deploy:Ki.from("constructor()")}),Oe(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,bi,hb).call(this,e,null,!1);return $(n,"no matching function","key",e),n.name}hasFunction(e){return!!fe(this,bi,hb).call(this,e,null,!1)}getFunction(e,n){return fe(this,bi,hb).call(this,e,n||null,!0)}forEachFunction(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)}}getEventName(e){const n=fe(this,bi,pb).call(this,e,null,!1);return $(n,"no matching event","key",e),n.name}hasEvent(e){return!!fe(this,bi,pb).call(this,e,null,!1)}getEvent(e,n){return fe(this,bi,pb).call(this,e,n||null,!0)}forEachEvent(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)}}getError(e,n){if(St(e)){const s=e.toLowerCase();if(CP[s])return hr.from(CP[s].signature);for(const i of T(this,mi).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){const s=[];for(const[i,o]of T(this,mi))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(", ");$(!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,mi).get(e);return r||null}forEachError(e){const n=Array.from(T(this,mi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,mi).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);$(r,"unknown error","fragment",e),e=r}return $(Ht(n,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",n),this._decodeParams(e.inputs,Ht(n,4))}encodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);$(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);$(r,"unknown function","fragment",e),e=r}return $(Ht(n,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",n),this._decodeParams(e.inputs,Ht(n,4))}encodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);$(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);$(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);$(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);$(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=Xo(o):i.type.match(/^bytes/)?o=ene(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){$(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"?$(!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);$(o,"unknown event","eventFragment",e),e=o}const r=[],s=[],i=[];return e.anonymous||r.push(e.topicHash),$(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);$(h,"unknown event","eventFragment",e),e=h}if(r!=null&&!e.anonymous){const h=e.topicHash;$(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(En.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 kP(null);else if(o[p])m=new kP(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=xe(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 wie(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 bie(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=we(e),r=this.getError(Ht(n,0,4));if(!r)return null;const s=T(this,Ln).decode(r.inputs,Ht(n,4));return new Aie(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)}};mi=new WeakMap,gi=new WeakMap,yi=new WeakMap,Ln=new WeakMap,bi=new WeakSet,hb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,yi).values())if(i===o.selector)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){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(", ");$(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,yi).get(fi.from(e).format());return s||null},pb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,gi).values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,gi))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(", ");$(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,gi).get(ci.from(e).format());return s||null};let u2=su;const SP=BigInt(0);function jc(t){return t??null}function Kt(t){return t==null?null:t.toString()}class TP{constructor(e,n,r){W(this,"gasPrice");W(this,"maxFeePerGas");W(this,"maxPriorityFeePerGas");Oe(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 my(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]=xe(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=ia(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=>wx(s)?we(s):Object.assign({},s))),e}class vie{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,fo);I(this,fo,e.transactions.map(r=>typeof r!="string"?new Gh(r,n):r)),Oe(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,fo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=T(this,fo).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,fo).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,fo)[e];else{const r=e.toLowerCase();for(const s of T(this,fo))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;$(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return xie(this)}}fo=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());Oe(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 kie(this)}}class DP{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=SP;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Oe(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 _P(this)}reorderedEvent(e){return ee(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),OP(this,e)}}yp=new WeakMap;const Hk=class Hk{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,wa);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,wa,-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 Nn({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,wa),o=-1,a=i===-1;const l=async()=>{if(a)return null;const{blockNumber:d,nonce:h}=await Nn({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,wa)&&(o=T(this,wa)));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 w="replaced";y.data===this.data&&y.to===this.to&&y.value===this.value?w="repriced":y.data==="0x"&&y.from===y.to&&y.value===SP&&(w="cancelled"),ee(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:w==="replaced"||w==="cancelled",reason:w,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(Nt("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()"}),_P(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()"}),OP(this,e)}replaceableTransaction(e){$(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new Hk(this,this.provider);return I(n,wa,e),n}};wa=new WeakMap;let Gh=Hk;function xie(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function OP(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function _P(t){return{orphan:"drop-transaction",tx:t}}function kie(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 c2 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);Oe(this,{args:i,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class MP extends $h{constructor(n,r){super(n,n.provider);W(this,"error");Oe(this,{error:r})}}class Eie extends DP{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 c2(n,T(this,Sf),r)}catch(s){return new MP(n,s)}return n})}}Sf=new WeakMap;class f2 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 Eie(T(this,bp),this.provider,s)}}bp=new WeakMap;class NP extends c4{constructor(n,r,s,i){super(n,r,s);W(this,"log");Oe(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 Cie extends NP{constructor(e,n,r,s,i){super(e,n,r,new c2(i,e.interface,s));const o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Oe(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const RP=BigInt(0);function PP(t){return t&&typeof t.call=="function"}function IP(t){return t&&typeof t.estimateGas=="function"}function gy(t){return t&&typeof t.resolveName=="function"}function LP(t){return t&&typeof t.sendTransaction=="function"}function BP(t){if(t!=null){if(gy(t))return t;if(t.provider)return t.provider}}class Sie{constructor(e,n,r){J(this,wp);W(this,"fragment");if(Oe(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=Il(e.runner,"resolveName"),i=gy(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 FP(t,e){const n=Rn.dereference(t,"overrides");$(typeof n=="object","invalid overrides parameter","overrides",t);const r=my(n);return $(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),$(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Tie(t,e,n){const r=Il(t,"resolveName"),s=gy(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 Die(t){const e=async function(o){const a=await FP(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await Qn(a.from,BP(t.runner)));const l=t.interface,u=xe(a.value||RP,"overrides.value")===RP,c=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!c&&!u&&$(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),$(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data);const f=l.receive||l.fallback&&l.fallback.payable;return $(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),$(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(PP(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 bx(u)&&u.data?t.interface.makeError(u.data,l):u}},r=async function(o){const a=t.runner;ee(LP(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 f2(t.interface,u,l)},s=async function(o){const a=Il(t.runner,"estimateGas");return ee(IP(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 Oe(i,{_contract:t,estimateGas:s,populateTransaction:e,send:r,staticCall:n}),i}function Oie(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 FP(u.pop()),f.from&&(f.from=await Qn(f.from,BP(t.runner)))),c.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await Tie(t.runner,c.inputs,u);return Object.assign({},f,await Nn({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(LP(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 f2(t.interface,d,f)},o=async function(...u){const c=Il(t.runner,"estimateGas");return ee(IP(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(PP(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 bx(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 Oe(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 _ie(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 Sie(t,n(...s),s)};return Oe(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 yy=Symbol.for("_ethersInternal_contract"),jP=new WeakMap;function Mie(t,e){jP.set(t[yy],e)}function Rr(t){return jP.get(t[yy])}function Nie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function d2(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 $(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),$(r,"unknown fragment","event",e),n=[r.topicHash]):Nie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):$(!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 d2(t,e)).tag)||null}async function UP(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 d2(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,w=s?t.interface.decodeEventLog(s,g.data,g.topics):[];p2(t,n,w,A=>new Cie(t,A,n,v,g))}else p2(t,n,[],v=>new NP(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 h2=Promise.resolve();async function Rie(t,e,n,r){await h2;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 p2(t,e,n,r){try{await h2}catch{}const s=Rie(t,e,n,r);return h2=s,await s}const by=["then"];VL=yy;const Ap=class Ap{constructor(e,n,r,s){W(this,"target");W(this,"interface");W(this,"runner");W(this,"filters");W(this,VL);W(this,"fallback");$(typeof e=="string"||AR(e),"invalid value for Contract target","target",e),r==null&&(r=null);const i=u2.from(n);Oe(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,yy,{value:{}});let o,a=null,l=null;if(s){const f=Ll(r);l=new f2(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(!gy(f))throw Nt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(d=>{if(d==null)throw Nt("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});Mie(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const c=new Proxy({},{get:(f,d,h)=>{if(typeof d=="symbol"||by.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)=>by.indexOf(d)>=0?Reflect.has(f,d):Reflect.has(f,d)||this.interface.hasEvent(String(d))});return Oe(this,{filters:c}),Oe(this,{fallback:i.receive||i.fallback?Die(this):null}),new Proxy(this,{get:(f,d,h)=>{if(typeof d=="symbol"||d in f||by.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||by.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()),Oie(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),_ie(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 d2(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 c2(f,this.interface,d)}catch(h){return new MP(f,h)}return new $h(f,c)})}async on(e,n){const r=await UP(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await UP(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await p2(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 m2=Ap;function Pie(){return m2}class Uc extends Pie(){}function g2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):$(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class Iie{constructor(e){W(this,"name");Oe(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 VP=new RegExp("^(ipfs)://(.*)$","i"),HP=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),VP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],Tf=class Tf{constructor(e,n,r){J(this,va);W(this,"provider");W(this,"address");W(this,"name");J(this,Aa);J(this,iu);Oe(this,{provider:e,address:n,name:r}),I(this,Aa,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,Aa)==null&&I(this,Aa,(async()=>{try{return await T(this,iu).supportsInterface("0x9061b923")}catch(e){if(gn(e,"CALL_EXCEPTION"))return!1;throw I(this,Aa,null),e}})()),await T(this,Aa)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await fe(this,va,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,va,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 Iie&&i.supportsCoinType(e)){n=i;break}if(n==null)return null;const r=await fe(this,va,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,va,Qf).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await fe(this,va,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}://${rne("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<HP.length;r++){const s=n.match(HP[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=g2(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}",Xo(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=g2(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(VP)==null)return e.push({type:"!imageUrl-ipfs",value:p}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:p}),p=g2(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,ab,qL).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(".")}}};Aa=new WeakMap,iu=new WeakMap,va=new WeakSet,Qf=async function(e,n){n=(n||[]).slice();const r=T(this,iu).interface;n.unshift(e2(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(e),ee(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),n=[Lse(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},ab=new WeakSet,qL=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(e2(n),{enableCcipRead:!0});return i===Rh?null:i}catch(s){throw s}return null},J(Tf,ab);let wy=Tf;const zP=BigInt(0);function lt(t,e){return function(n){return n==null?e:t(n)}}function Ay(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 Lie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}$(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Vc(t){return $(St(t,!0),"invalid data","value",t),t}function Cn(t){return $(St(t,32),"invalid hash","value",t),t}const Bie=Kh({address:gt,blockHash:Cn,blockNumber:Qe,data:Vc,index:Qe,removed:lt(Lie,!1),topics:Ay(Cn),transactionHash:Cn,transactionIndex:Qe},{index:["logIndex"]});function Fie(t){return Bie(t)}const jie=Kh({hash:lt(Cn),parentHash:Cn,parentBeaconBlockRoot:lt(Cn,null),number:Qe,timestamp:Qe,nonce:lt(Vc),difficulty:xe,gasLimit:xe,gasUsed:xe,stateRoot:lt(Cn,null),receiptsRoot:lt(Cn,null),blobGasUsed:lt(xe,null),excessBlobGas:lt(xe,null),miner:lt(gt),prevRandao:lt(Cn,null),extraData:Vc,baseFeePerGas:lt(xe)},{prevRandao:["mixHash"]});function Uie(t){const e=jie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:$P(n)),e}const Vie=Kh({transactionIndex:Qe,blockNumber:Qe,transactionHash:Cn,address:gt,topics:Ay(Cn),data:Vc,index:Qe,blockHash:Cn},{index:["logIndex"]});function Hie(t){return Vie(t)}const zie=Kh({to:lt(gt,null),from:lt(gt,null),contractAddress:lt(gt,null),index:Qe,root:lt(we),gasUsed:xe,blobGasUsed:lt(xe,null),logsBloom:lt(Vc),blockHash:Cn,hash:Cn,logs:Ay(Hie),blockNumber:Qe,cumulativeGasUsed:xe,effectiveGasPrice:lt(xe),blobGasPrice:lt(xe,null),status:lt(Qe),type:lt(Qe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function $ie(t){return zie(t)}function $P(t){t.to&&xe(t.to)===zP&&(t.to="0x0000000000000000000000000000000000000000");const e=Kh({hash:Cn,index:lt(Qe,void 0),type:n=>n==="0x"||n==null?0:Qe(n),accessList:lt(ia,null),blobVersionedHashes:lt(Ay(Cn,!0),null),blockHash:lt(Cn,null),blockNumber:lt(Qe,null),transactionIndex:lt(Qe,null),from:gt,gasPrice:lt(xe),maxPriorityFeePerGas:lt(xe),maxFeePerGas:lt(xe),maxFeePerBlobGas:lt(xe,null),gasLimit:xe,to:lt(gt,null),value:xe,nonce:Qe,data:Vc,creates:lt(gt,null),chainId:lt(xe,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=Fre(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&&xe(e.blockHash)===zP&&(e.blockHash=null),e}const Gie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class qh{constructor(e){W(this,"name");Oe(this,{name:e})}clone(){return new qh(this.name)}}class vy 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),$(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),Oe(this,s)}clone(){return new vy(this.effectiveBlock,this)}}class xy extends qh{constructor(n,r){super("org.ethers.plugins.network.Ens");W(this,"address");W(this,"targetNetwork");Oe(this,{address:n||Gie,targetNetwork:r??1})}clone(){return new xy(this.address,this.targetNetwork)}}class Wie 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 y2=new Map,_f=class _f{constructor(e,n){J(this,Df);J(this,Of);J(this,xa);I(this,Df,e),I(this,Of,xe(n)),I(this,xa,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,xe(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===xe(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===xe(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===xe(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(T(this,xa).values())}attachPlugin(e){if(T(this,xa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,xa).set(e.name,e.clone()),this}getPlugin(e){return T(this,xa).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new _f(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 vy;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=ia(e.accessList);for(const i in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[i].storageKeys.length}return r}static from(e){if(Kie(),e==null)return _f.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const n=y2.get(e);if(n)return n();if(typeof e=="bigint")return new _f("unknown",e);$(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){$(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const n=new _f(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&n.attachPlugin(new xy(e.ensAddress,e.ensNetwork)),n}$(!1,"invalid network","network",e)}static register(e,n){typeof e=="number"&&(e=BigInt(e));const r=y2.get(e);r&&$(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),y2.set(e,n)}};Df=new WeakMap,Of=new WeakMap,xa=new WeakMap;let rn=_f;function GP(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 WP(t){return new Wie(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:GP(a.maxFee,9),maxPriorityFeePerGas:GP(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 KP=!1;function Kie(){if(KP)return;KP=!0;function t(e,n,r){const s=function(){const i=new rn(e,n);return r.ensNetwork!=null&&i.attachPlugin(new xy(null,r.ensNetwork)),i.attachPlugin(new vy),(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:[WP("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[WP("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 b2(t){return JSON.parse(JSON.stringify(t))}class qie{constructor(e){J(this,Mf);J(this,ho);J(this,ss);J(this,ka);J(this,wi);I(this,ho,e),I(this,ss,null),I(this,ka,4e3),I(this,wi,-2)}get pollingInterval(){return T(this,ka)}set pollingInterval(e){I(this,ka,e)}start(){T(this,ss)||(I(this,ss,T(this,ho)._setTimeout(fe(this,Mf,mb).bind(this),T(this,ka))),fe(this,Mf,mb).call(this))}stop(){T(this,ss)&&(T(this,ho)._clearTimeout(T(this,ss)),I(this,ss,null))}pause(e){this.stop(),e&&I(this,wi,-2)}resume(){this.start()}}ho=new WeakMap,ss=new WeakMap,ka=new WeakMap,wi=new WeakMap,Mf=new WeakSet,mb=async function(){try{const e=await T(this,ho).getBlockNumber();if(T(this,wi)===-2){I(this,wi,e);return}if(e!==T(this,wi)){for(let n=T(this,wi)+1;n<=e;n++){if(T(this,ss)==null)return;await T(this,ho).emit("block",n)}I(this,wi,e)}}catch{}T(this,ss)!=null&&I(this,ss,T(this,ho)._setTimeout(fe(this,Mf,mb).bind(this),T(this,ka)))};class w2{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 Qie extends w2{constructor(n,r){super(n);J(this,Nf);J(this,po);I(this,Nf,r),I(this,po,-2)}pause(n){n&&I(this,po,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(T(this,Nf));s!=null&&(T(this,po)===-2?I(this,po,s.number):s.number>T(this,po)&&(r.emit(T(this,Nf),s.number),I(this,po,s.number)))}}Nf=new WeakMap,po=new WeakMap;class Jie extends w2{constructor(n,r){super(n);J(this,lb);I(this,lb,b2(r))}async _poll(n,r){throw new Error("@TODO")}}lb=new WeakMap;class Yie extends w2{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 A2{constructor(e,n){J(this,ub);J(this,mo);J(this,Pf);J(this,If);J(this,Ca);J(this,is);I(this,mo,e),I(this,Pf,b2(n)),I(this,If,fe(this,ub,QL).bind(this)),I(this,Ca,!1),I(this,is,-2)}start(){T(this,Ca)||(I(this,Ca,!0),T(this,is)===-2&&T(this,mo).getBlockNumber().then(e=>{I(this,is,e)}),T(this,mo).on("block",T(this,If)))}stop(){T(this,Ca)&&(I(this,Ca,!1),T(this,mo).off("block",T(this,If)))}pause(e){this.stop(),e&&I(this,is,-2)}resume(){this.start()}}mo=new WeakMap,Pf=new WeakMap,If=new WeakMap,Ca=new WeakMap,is=new WeakMap,ub=new WeakSet,QL=async function(e){if(T(this,is)===-2)return;const n=b2(T(this,Pf));n.fromBlock=T(this,is)+1,n.toBlock=e;const r=await T(this,mo).getLogs(n);if(r.length===0){T(this,is)<e-60&&I(this,is,e-60);return}for(const s of r)T(this,mo).emit(T(this,Pf),s),I(this,is,s.blockNumber)};const Xie=BigInt(2),Zie=10;function ky(t){return t&&typeof t.then=="function"}function Ey(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 Cy{constructor(e){W(this,"name");Oe(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function eoe(t){return JSON.parse(JSON.stringify(t))}function v2(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function x2(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:Ey("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Ey("orphan",n),filter:eoe(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?v2(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=v2(s.map(a=>a.toLowerCase()))}return{filter:r,tag:Ey("event",r),type:"event"}}$(!1,"unknown ProviderEvent","event",t)}function k2(){return new Date().getTime()}const toe={cacheTimeout:250,pollingInterval:4e3};class Sy{constructor(e,n){J(this,st);J(this,Bn);J(this,Sa);J(this,Fn);J(this,Lf);J(this,Fr);J(this,lu);J(this,Ta);J(this,go);J(this,kp);J(this,as);J(this,Bf);J(this,Ff);if(I(this,Ff,Object.assign({},toe,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,go,-1),I(this,Ta,new Map),I(this,Bn,new Map),I(this,Sa,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,Sa).values())}attachPlugin(e){if(T(this,Sa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,Sa).set(e.name,e.connect(this)),this}getPlugin(e){return T(this,Sa).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 vie(Uie(e),this)}_wrapLog(e,n){return new $h(Fie(e),this)}_wrapTransactionReceipt(e,n){return new DP($ie(e),this)}_wrapTransactionResponse(e,n){return new Gh($P(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,go)>=0&&I(this,go,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,go)>=0?kl(T(this,go)+e):this.getBlockNumber().then(n=>kl(n+e));$(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?v2(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=my(e),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const i=Qn(n[s],this);ky(i)?r.push(async function(){n[s]=await i}()):n[s]=i}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);ky(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 Nn({_block:fe(this,st,eE).call(this,"latest",!1),gasPrice:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getGasPrice"});return xe(c,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getPriorityFee"});return xe(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*Xie+l),new TP(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 TP(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return ky(n)&&(n=await n),xe(await fe(this,st,jr).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await Nn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await fe(this,st,Zk).call(this,fe(this,st,Xk).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return xe(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=xe(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 Nn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=Hh.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 Nn({network:this.getNetwork(),params:fe(this,st,eE).call(this,e,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(e){const{network:n,params:r}=await Nn({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 Nn({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 Nn({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);ky(n)&&(n=await n);const{network:r,params:s}=await Nn({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 wy.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=e2(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await wy.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(Nt("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:k2()})}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 Cy(e.type);case"block":{const n=new qie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Qie(this,e.type);case"event":return new A2(this,e.filter);case"transaction":return new Yie(this,e.hash);case"orphan":return new Jie(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,gb).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,gb).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,_p).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 c4(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,_p).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,_p).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,_p).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,gb).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,go,-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=k2()-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=k2(),setTimeout(e.func,n)}}}}Bn=new WeakMap,Sa=new WeakMap,Fn=new WeakMap,Lf=new WeakMap,Fr=new WeakMap,lu=new WeakMap,Ta=new WeakMap,go=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=Ey(e.method,e);let s=T(this,Ta).get(r);return s||(s=this._perform(e),T(this,Ta).set(r,s),setTimeout(()=>{T(this,Ta).get(r)===s&&T(this,Ta).delete(r)},n)),await s},Xk=async function(e,n,r){ee(r<Zie,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:n,enableCcipRead:!0})});const s=my(e);try{return we(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(i){if(!this.disableCcipRead&&bx(i)&&i.data&&r>=0&&n==="latest"&&s.to!=null&&Ht(i.data,0,4)==="0x556f1830"){const o=i.data,a=await Qn(s.to,this);let l;try{l=ooe(Ht(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,ioe([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const f=await fe(this,st,Xk).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 Nn({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})))},eE=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})},_p=async function(e,n){let r=await x2(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await x2({orphan:"drop-log",log:n[0]},this)),T(this,Bn).get(r.tag)||null},gb=async function(e){const n=await x2(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 noe(t,e){try{const n=E2(t,e);if(n)return Sc(n)}catch{}return null}function E2(t,e){if(t==="0x")return null;try{const n=Qe(Ht(t,e,e+32)),r=Qe(Ht(t,n,n+32));return Ht(t,n+32,n+32+r)}catch{}return null}function qP(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 roe(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const soe=new Uint8Array([]);function ioe(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(soe),n+=32;for(let r=0;r<t.length;r++){const s=ct(t[r]);e[r]=qP(n),e.push(qP(s.length)),e.push(roe(s)),n+=32+Math.ceil(s.length/32)*32}return $t(e)}const QP="0x0000000000000000000000000000000000000000000000000000000000000000";function ooe(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};ee(Ec(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Ht(t,0,32);ee(Ht(n,0,12)===Ht(QP,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Ht(n,12);try{const r=[],s=Qe(Ht(t,32,64)),i=Qe(Ht(t,s,s+32)),o=Ht(t,s+32);for(let a=0;a<i;a++){const l=noe(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=E2(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(Ht(t,100,128)===Ht(QP,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Ht(t,96,100);try{const r=E2(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 Hc(t,e){if(t.provider)return t.provider;ee(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function JP(t,e){let n=my(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])=>($(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else n.from=t.getAddress();return await Nn(n)}class aoe{constructor(e){W(this,"provider");Oe(this,{provider:e||null})}async getNonce(e){return Hc(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await JP(this,e)}async populateTransaction(e){const n=Hc(this,"populateTransaction"),r=await JP(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=xe(r.chainId);$(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)?$(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&i&&$(!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 Nn(r)}async estimateGas(e){return Hc(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Hc(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Hc(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Hc(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const s=Hh.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}}const YP=new Set;function zc(t){YP.has(t)||(YP.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 loe(t){return JSON.parse(JSON.stringify(t))}class XP{constructor(e){J(this,Oa);J(this,Yn);J(this,Ai);J(this,uu);J(this,Da);J(this,cu);J(this,jf);I(this,Yn,e),I(this,Ai,null),I(this,uu,fe(this,Oa,tE).bind(this)),I(this,Da,!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,Da)||(I(this,Da,!0),fe(this,Oa,tE).call(this,-2))}stop(){T(this,Da)&&(I(this,Da,!1),I(this,jf,!0),fe(this,Oa,nE).call(this),T(this,Yn).off("block",T(this,uu)))}pause(e){e&&fe(this,Oa,nE).call(this),T(this,Yn).off("block",T(this,uu))}resume(){this.start()}}Yn=new WeakMap,Ai=new WeakMap,uu=new WeakMap,Da=new WeakMap,cu=new WeakMap,jf=new WeakMap,Oa=new WeakSet,tE=async function(e){try{T(this,Ai)==null&&I(this,Ai,this._subscribe(T(this,Yn)));let n=null;try{n=await T(this,Ai)}catch(i){if(!gn(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(n==null){I(this,Ai,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))},nE=function(){const e=T(this,Ai);e&&(I(this,Ai,null),e.then(n=>{T(this,Yn).destroyed||T(this,Yn).send("eth_uninstallFilter",[n])}))};class uoe extends XP{constructor(n,r){super(n);J(this,fu);I(this,fu,loe(r))}_recover(n){return new A2(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 coe extends XP{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const foe="bigint,boolean,function,number,string,symbol".split(/,/g);function Ty(t){if(t==null||foe.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(Ty);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 doe(t){return new Promise(e=>{setTimeout(e,t)})}function $c(t){return t&&t.toLowerCase()}function ZP(t){return t&&typeof t.pollingInterval=="number"}const e8={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class C2 extends aoe{constructor(n,r){super(n);W(this,"address");r=gt(r),Oe(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=Ty(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const a=await Qn(o,this.provider);$(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",Nt("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=Ty(n);if(r.from){const i=await Qn(r.from,this.provider);$(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=Ty(s),o=await dy.resolveNames(n,r,i,async a=>{const l=await Qn(a);return $(l!=null,"TypedData does not support null address","value",a),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(dy.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 t8 extends Sy{constructor(n,r){super(n,r);J(this,Ep);J(this,du);J(this,Uf);J(this,yo);J(this,vi);J(this,Rs);J(this,ls);J(this,mr);I(this,Uf,1),I(this,du,Object.assign({},e8,r||{})),I(this,yo,[]),I(this,vi,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"?($(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&I(this,ls,rn.from(n))):s&&($(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&&xe(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(xe(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(xe(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",Nt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await doe(1e3)}fe(this,Ep,rE).call(this)})())}async _waitUntilReady(){if(T(this,Rs)!=null)return await T(this,Rs).promise}_getSubscriber(n){return n.type==="pending"?new coe(this):n.type==="event"?this._getOption("polling")?new A2(this,n.filter):new uoe(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new Cy("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(xe(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=we(n[s]))}),n.accessList&&(r.accessList=ia(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 Nt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){const l=S2(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(poe(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return Nt("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 Nt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return Nt("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Nt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:i}});if(o.match(/only replay-protected/i))return Nt("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?Nt("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:i,payload:n}}):Nt("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=Tp(this,Uf)._++,i=new Promise((o,a)=>{T(this,yo).push({resolve:o,reject:a,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return fe(this,Ep,rE).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 C2(this,i[n])}const{accounts:s}=await Nn({network:this.getNetwork(),accounts:r});n=gt(n);for(const i of s)if(gt(i)===n)return new C2(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new C2(this,r))}destroy(){T(this,vi)&&(clearTimeout(T(this,vi)),I(this,vi,null));for(const{payload:n,reject:r}of T(this,yo))r(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));I(this,yo,[]),super.destroy()}}du=new WeakMap,Uf=new WeakMap,yo=new WeakMap,vi=new WeakMap,Rs=new WeakMap,ls=new WeakMap,mr=new WeakMap,Ep=new WeakSet,rE=function(){if(T(this,vi))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");I(this,vi,setTimeout(()=>{I(this,vi,null);const r=T(this,yo);for(I(this,yo,[]);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(Nt("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=Nt("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 hoe extends t8{constructor(n,r){super(n,r);J(this,_a);let s=this._getOption("pollingInterval");s==null&&(s=e8.pollingInterval),I(this,_a,s)}_getSubscriber(n){const r=super._getSubscriber(n);return ZP(r)&&(r.pollingInterval=T(this,_a)),r}get pollingInterval(){return T(this,_a)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");I(this,_a,n),this._forEachSubscriber(r=>{ZP(r)&&(r.pollingInterval=T(this,_a))})}}_a=new WeakMap;class Qi extends hoe{constructor(n,r,s){n==null&&(n="http://localhost:8545");super(r,s);J(this,Vf);typeof n=="string"?I(this,Vf,new Kn(n)):I(this,Vf,n.clone())}_getConnection(){return T(this,Vf).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}}Vf=new WeakMap;function S2(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=S2(t[e]);if(n)return n}return null}if(typeof t=="string")try{return S2(JSON.parse(t))}catch{}return null}function T2(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)T2(t[n],e);if(typeof t=="string")try{return T2(JSON.parse(t),e)}catch{}}}function poe(t){const e=[];return T2(t,e),e}const Dy="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function moe(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"}$(!1,"unsupported network","network",t)}class Oy extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Dy);const i={polling:!0,staticNetwork:s},o=Oy.getRequest(s,r);super(o,s,i);W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new Oy(n,this.apiKey)}catch{}return super._getProvider(n)}static getRequest(n,r){r==null&&(r=Dy);const s=new Kn(`https://${moe(n.name)}/${r}`);return s.allowGzip=!0,r===Dy&&(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===Dy}}const _y="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function goe(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"}$(!1,"unsupported network","network",t)}class My extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=_y);const i=My.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new My(n,this.apiKey)}catch{}return super._getProvider(n)}async _perform(n){if(n.method==="getTransactionResult"){const{trace:r,tx:s}=await Nn({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===_y}static getRequest(n,r){r==null&&(r=_y);const s=new Kn(`https://${goe(n.name)}/v2/${r}`);return s.allowGzip=!0,r===_y&&(s.retryFunc=async(i,o,a)=>(zc("alchemy"),!0)),s}}function Ny(t){switch(t){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}$(!1,"unsupported network","network",t)}function yoe(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"}$(!1,"unsupported network","network",t)}class Ry extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Ny(s.name));const i=Ry.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new Ry(n,this.apiKey)}catch{}return super._getProvider(n)}isCommunityResource(){return this.apiKey===Ny(this._network.name)}static getRequest(n,r){r==null&&(r=Ny(n.name));const s=new Kn(`https://${yoe(n.name)}/${r}`);return s.allowGzip=!0,r===Ny(n.name)&&(s.retryFunc=async(i,o,a)=>(zc("ChainstackProvider"),!0)),s}}class boe extends Qi{constructor(e){e==null&&(e="mainnet");const n=rn.from(e);$(n.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",n,{staticNetwork:n})}}const n8=2e3;function woe(t){return t&&typeof t.then=="function"}const Aoe="org.ethers.plugins.provider.Etherscan",voe=["enableCcipRead"];let xoe=1;class koe extends Sy{constructor(n,r){const s=r??null;super();W(this,"network");W(this,"apiKey");J(this,Hf);const i=rn.from(n);I(this,Hf,i.getPlugin(Aoe)),Oe(this,{apiKey:s,network:i}),this.getBaseUrl()}getBaseUrl(){if(T(this,Hf))return T(this,Hf).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"}$(!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=xoe++,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,n8)):p&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),d.throwThrottleError(h.result,n8)),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(voe.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="["+ia(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=Hh.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);woe(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}}Hf=new WeakMap;function Eoe(){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 Coe=Eoe().WebSocket;class D2{constructor(e,n){J(this,xi);J(this,Cp);J(this,Ma);J(this,hu);J(this,Na);I(this,xi,e),I(this,Cp,JSON.stringify(n)),I(this,Ma,null),I(this,hu,null),I(this,Na,null)}get filter(){return JSON.parse(T(this,Cp))}start(){I(this,Ma,T(this,xi).send("eth_subscribe",this.filter).then(e=>(T(this,xi)._register(e,this),e)))}stop(){T(this,Ma).then(e=>{T(this,xi).destroyed||T(this,xi).send("eth_unsubscribe",[e])}),I(this,Ma,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,Ma)!=null&&T(this,hu)===null){let n=T(this,Na);n==null?n=this._emit(T(this,xi),e):n=n.then(async()=>{await this._emit(T(this,xi),e)}),I(this,Na,n.then(()=>{T(this,Na)===n&&I(this,Na,null)}))}}async _emit(e,n){throw new Error("sub-classes must implemente this; _emit")}}xi=new WeakMap,Cp=new WeakMap,Ma=new WeakMap,hu=new WeakMap,Na=new WeakMap;class Soe extends D2{constructor(e){super(e,["newHeads"])}async _emit(e,n){e.emit("block",parseInt(n.number))}}class Toe extends D2{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,n){e.emit("pending",n)}}class Doe extends D2{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 Ooe extends t8{constructor(n,r){const s=Object.assign({},r??{});$(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,Ra);I(this,pu,new Map),I(this,zf,new Map),I(this,Ra,new Map)}_getSubscriber(n){switch(n.type){case"close":return new Cy("close");case"block":return new Soe(this);case"pending":return new Toe(this);case"event":return new Doe(this,n.filter);case"orphan":if(n.filter.orphan==="drop-log")return new Cy("drop-log")}return super._getSubscriber(n)}_register(n,r){T(this,zf).set(n,r);const s=T(this,Ra).get(n);if(s){for(const i of s)r._handleMessage(i);T(this,Ra).delete(n)}}async _send(n){$(!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",Nt("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,Ra).get(s);o==null&&(o=[],T(this,Ra).set(s,o)),o.push(r.params.result)}}else{this.emit("error",Nt("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,Ra=new WeakMap;class r8 extends Ooe{constructor(n,r,s){super(r,s);J(this,mu);J(this,Ps);typeof n=="string"?(I(this,mu,()=>new Coe(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 _oe(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"}$(!1,"unsupported network","network",t)}class Moe extends r8{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");Oe(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===Qh}}class Jh extends Qi{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");Oe(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 Moe(n,r)}static getRequest(n,r,s){r==null&&(r=Qh),s==null&&(s=null);const i=new Kn(`https://${_oe(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 Py="919b412a057b5e9c9b6dce193c5a60242d6efadb";function Noe(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"}$(!1,"unsupported network","network",t)}class Iy extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Py);const i=Iy.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"token");Oe(this,{token:r})}_getProvider(n){try{return new Iy(n,this.token)}catch{}return super._getProvider(n)}isCommunityResource(){return this.token===Py}static getRequest(n,r){r==null&&(r=Py);const s=new Kn(`https://${Noe(n.name)}/${r}`);return s.allowGzip=!0,r===Py&&(s.retryFunc=async(i,o,a)=>(zc("QuickNodeProvider"),!0)),s}}const Roe=BigInt("1"),Poe=BigInt("2");function Ioe(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 Loe(t){return new Promise(e=>{setTimeout(e,t)})}function O2(){return new Date().getTime()}function _2(t){return JSON.stringify(t,(e,n)=>typeof n=="bigint"?{type:"bigint",value:n.toString()}:n)}const s8={stallTimeout:400,priority:1,weight:1},i8={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 Boe(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=O2()}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 M2(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 Ly(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 N2(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]+Roe)/Poe}function R2(t,e){const n=Ly(t,e);if(n!==void 0)return n;for(const r of e)if(r.value)return r.value}function Foe(t,e){if(t===1)return Qe(N2(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 joe extends Sy{constructor(n,r,s){super(r,s);J(this,yr);W(this,"quorum");W(this,"eventQuorum");W(this,"eventWorkers");J(this,gr);J(this,bo);J(this,$f);I(this,gr,n.map(i=>i instanceof Sy?Object.assign({provider:i},s8,i8):Object.assign({},s8,i,i8))),I(this,bo,-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,$(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(xe(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(M2({result:d}),{weight:c})}catch(d){o[f]=Object.assign(M2({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=Ly(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=R2(this.quorum,o);if(ee(l!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:n,results:o.map(_2)}}),l instanceof Error)throw l;return l}await fe(this,yr,YL).call(this);const r=new Set;let s=0;for(;;){const o=fe(this,yr,sE).call(this,r,n);if(o==null||(s+=o.config.weight,s>=this.quorum))break}const i=await fe(this,yr,iE).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,bo=new WeakMap,$f=new WeakMap,yr=new WeakSet,JL=function(n){const r=Array.from(n).map(i=>i.config),s=T(this,gr).slice();Ioe(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},sE=function(n,r){const s=fe(this,yr,JL).call(this,n);if(s==null)return null;const i={config:s,result:null,didBump:!1,perform:null,staller:null},o=O2();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=O2()-o;s._totalTime+=a,s.rollingDuration=.95*s.rollingDuration+.05*a,i.perform=null})(),i.staller=(async()=>{await Loe(s.stallTimeout),i.staller=null})(),n.add(i),i},YL=async function(){let n=T(this,$f);if(!n){const r=[];T(this,gr).forEach(s=>{r.push((async()=>{await Boe(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},XL=async function(n,r){const s=[];for(const i of n)if(i.result!=null){const{tag:o,value:a}=M2(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,bo)===-2&&I(this,bo,Math.ceil(Qe(N2(this.quorum,T(this,gr).filter(o=>!o._lastFatalError).map(o=>({value:o.blockNumber,tag:Qe(o.blockNumber).toString(),weight:o.weight}))))));const i=Foe(this.quorum,s);return i===void 0?void 0:(i>T(this,bo)&&I(this,bo,i),T(this,bo))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return N2(this.quorum,s);case"getBlock":return"blockTag"in r&&r.blockTag==="pending"?R2(this.quorum,s):Ly(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return Ly(this.quorum,s);case"broadcastTransaction":return R2(this.quorum,s)}ee(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${_2(r.method)})`})}},iE=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,XL).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,sE).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=>_2(a.result))}}),await Promise.race(s),await fe(this,yr,iE).call(this,n,r)};function Uoe(t){return t&&typeof t.send=="function"&&typeof t.close=="function"}const Voe="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function Hoe(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 Qi(t);if(typeof t=="string"&&t.match(/^wss?:/)||Uoe(t))return new r8(t);let r=null;try{r=rn.from(t)}catch{}const s=[];if(n("publicPolygon")&&r&&(r.name==="matic"?s.push(new Qi("https://polygon-rpc.com/",r,{staticNetwork:r})):r.name==="matic-amoy"&&s.push(new Qi("https://rpc-amoy.polygon.technology/",r,{staticNetwork:r}))),n("alchemy"))try{s.push(new My(t,e.alchemy))}catch{}if(n("ankr")&&e.ankr!=null)try{s.push(new Oy(t,e.ankr))}catch{}if(n("chainstack"))try{s.push(new Ry(t,e.chainstack))}catch{}if(n("cloudflare"))try{s.push(new boe(t))}catch{}if(n("etherscan"))try{s.push(new koe(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 Iy(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&&Voe.indexOf(r.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new joe(s,void 0,{quorum:i})}const zoe=async(t,e)=>{const n={name:t,isEns:!1};if(!e)throw new Error("cannot fetch ens name without a provider url");if(!jre(t))return n;try{const r=await $oe(t,e);r&&(n.name=r,n.isEns=!0)}catch(r){console.log(r)}return n},$oe=async(t,e)=>await Goe(e).lookupAddress(t),Goe=t=>Hoe(t),Woe=(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 Koe(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 qoe=new _t("suggestion");function Qoe({pluginKey:t=qoe,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=Koe}){let h;const p=c==null?void 0:c(),m=new bt({key:t,view(){return{update:async(g,y)=>{var v,w,A,x,k,C,O;const _=(v=this.key)===null||v===void 0?void 0:v.getState(y),D=(w=this.key)===null||w===void 0?void 0:w.getState(g.state),R=_.active&&D.active&&_.range.from!==D.range.from,L=!_.active&&D.active,F=_.active&&!D.active,G=!L&&!F&&_.query!==D.query,B=L,H=G||R,Q=F;if(!B&&!H&&!Q)return;const te=Q&&!B?_: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:Ee}=(pe=this.key)===null||pe===void 0?void 0:pe.getState(e.state),Re=g.dom.querySelector(`[data-decoration-id="${Ee}"]`);return(Re==null?void 0:Re.getBoundingClientRect())||null}:null},B&&((A=p==null?void 0:p.onBeforeStart)===null||A===void 0||A.call(p,h)),H&&((x=p==null?void 0:p.onBeforeUpdate)===null||x===void 0||x.call(p,h)),(H||B)&&(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&&((C=p==null?void 0:p.onUpdate)===null||C===void 0||C.call(p,h)),B&&((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,w){const{isEditable:A}=e,{composing:x}=e.view,{selection:k}=g,{empty:C,from:O}=k,_={...y};if(_.composing=x,A&&(C||e.view.composing)){(O<y.range.from||O>y.range.to)&&!x&&!y.composing&&(_.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:w,range:D.range,isActive:y.active})?(_.active=!0,_.decorationId=y.decorationId?y.decorationId:R,_.range=D.range,_.query=D.query,_.text=D.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null),_}},props:{handleKeyDown(g,y){var v;const{active:w,range:A}=m.getState(g.state);return w&&((v=p==null?void 0:p.onKeyDown)===null||v===void 0?void 0:v.call(p,{view:g,event:y,range:A}))||!1},decorations(g){const{active:y,range:v,decorationId:w}=m.getState(g);return y?kt.create(g.doc,[nn.inline(v.from,v.to,{nodeName:o,class:a,"data-decoration-id":w})]):null}}});return m}var Joe=typeof tr=="object"&&tr&&tr.Object===Object&&tr,Yoe=typeof self=="object"&&self&&self.Object===Object&&self;Joe||Yoe||Function("return this")();var Xoe=typeof window<"u"?N.useLayoutEffect:N.useEffect,Zoe=typeof window>"u";function P2(t,{defaultValue:e=!1,initializeWithValue:n=!0}={}){const r=a=>Zoe?e:window.matchMedia(a).matches,[s,i]=N.useState(()=>n?r(t):e);function o(){i(r(t))}return Xoe(()=>{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 eae=wt.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Qoe({editor:this.editor,...this.options.suggestion})]}}),tae=({query:t,uploadToIpfs:e})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:S.jsx(JT,{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(QT,{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(E0,{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(C0,{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(S0,{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(T0,{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(eV,{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(D0,{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(_d,{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(sw,{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(YU,{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;lw(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(XT,{}),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(YT,{}),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(WT,{}),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(KU,{}),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}),nae=(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)},rae=({items:t,command:e,editor:n})=>{const[r,s]=N.useState(0),[i,o]=N.useState(t),a=P2("(max-width: 640px)"),l=N.useCallback(c=>{const f=i[c];f&&(f.title==="Continue writing"||e(f))},[e,n,i]);N.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]),N.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]),N.useEffect(()=>{s(0)},[i]);const u=N.useRef(null);return N.useLayoutEffect(()=>{const c=u==null?void 0:u.current,f=c==null?void 0:c.children[r];f&&c&&nae(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},sae=()=>{let t=null,e=null;return{onStart:n=>{t=new zT(rae,{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()}}},iae=t=>{const e=({query:n})=>tae({query:n,uploadToIpfs:t});return eae.configure({suggestion:{items:e,render:sae}})},o8=["#30bced","#6eeb83","#fa69d1","#ecd444","#ee6352","#db3041","#0ad7f2","#1bff39"],oae=({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 O,_;const[d]=N.useState(new ul),[h,p]=N.useState([...Wte,iae(f)]),m=N.useRef(!1),g=(D,R,L)=>{let F=!1;return D.doc.nodesBetween(R,L,G=>{G.marks&&G.marks.some(B=>B.type.name==="highlight"&&B.attrs.color==="yellow")&&(F=!0)}),F},y=(D,R)=>{var F;const L=R.target;if(L&&L.nodeName==="MARK"&&L.dataset.color&&((F=L==null?void 0:L.dataset)==null?void 0:F.color)==="yellow"){const G=L.textContent,B=D.posAtCoords({left:R.clientX,top:R.clientY});if(B){const{state:H}=D;let Q=B.pos,te=B.pos;if(H.doc.nodesBetween(Q,te,(Z,pe)=>{Z.marks&&Z.marks.length&&Z.marks.forEach(Ee=>{Ee.type.name==="highlight"&&(Q=pe,te=pe+Z.nodeSize)})}),Q!==te){const Z={text:G,from:Q,to:te,isHighlightedYellow:g(H,Q,te)};l==null||l(Z)}}}},w=LU({extensions:h,editorProps:{...lK,handleDOMEvents:{mouseover:y,keydown:(D,R)=>{if(["ArrowUp","ArrowDown","Enter"].includes(R.key)&&document.querySelector("#slash-command"))return!0}},handleClick:(D,R,L)=>{y(D,L)}},autofocus:"start",onTransaction:D=>{w!=null&&w.isEmpty||o==null||o(D.editor.getJSON())},shouldRerenderOnTransaction:!0,immediatelyRender:!1},[h]),A=N.useRef(()=>{}),x=(D,R=!1)=>{if(!n||!r)throw new Error("docId or username is not provided");const L=new aK(r,d,{signaling:["wss://fileverse-signaling-server-0529292ff51c.herokuapp.com/"]});return p([...h,PK.configure({document:d}),IK.configure({provider:L,user:{name:D&&D.length>20?Woe(D,7,15):D,color:o8[Math.floor(Math.random()*o8.length)],isEns:R},render:Yte})]),A.current=()=>{L.destroy(),d.destroy()},A.current},k=N.useRef(null);N.useEffect(()=>{w==null||w.setEditable(!t)},[t,w]),N.useEffect(()=>{console.log("helo world"),e&&w&&!m.current&&(console.log(e),w.commands.setContent(e),m.current=!0),setTimeout(()=>{m.current=!1})},[e,w]),N.useEffect(()=>{if(!w)return;const D=()=>{const{state:R}=w,{from:L,to:F}=R.selection,G=R.doc.textBetween(L,F," ");u==null||u({text:G,from:L,to:F,isHighlightedYellow:g(R,L,F)})};return w.on("selectionUpdate",D),()=>{w.off("selectionUpdate",D)}},[w]);const C=async()=>{let D=i,R=!1;if(s&&c){const{name:L,isEns:F}=await zoe(s,c);D=L,R=F}if(!D)throw new Error("Cannot start collaboration without a username");x(D,R)};return N.useEffect(()=>{n?C():A.current()},[n]),N.useEffect(()=>{var D,R;a==null||a((R=(D=w==null?void 0:w.storage)==null?void 0:D.collaborationCursor)==null?void 0:R.users)},[(_=(O=w==null?void 0:w.storage)==null?void 0:O.collaborationCursor)==null?void 0:_.users]),{editor:w,ref:k,connect:x,ydoc:d}},aae=({title:t,content:e,contentClassName:n,open:r,onOpenChange:s,primaryAction:i,secondaryAction:o})=>S.jsx(cz,{open:r,onOpenChange:s,children:S.jsxs(gD,{className:"max-w-md sm:w-full w-[90%] z-20",children:[S.jsx(yD,{className:"px-4 pt-0 border-b-[1px]",children:S.jsx(wD,{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(bD,{className:"px-5 pb-5 justify-end sm:",children:[o&&S.jsx(hz,{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})]})]})}),lae=({editor:t,uploadToIpfs:e})=>{const{toolVisibilty:n,setToolVisibility:r,bottomToolbar:s}=Ww({editor:t,uploadToIpfs:e}),i=P2("(max-width: 1023px)"),[o,a]=N.useState(""),[l,u]=N.useState(""),[c,f]=N.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(Me.NONE)},h=m=>{const{from:g,to:y}=m.state.selection,v=m.state.doc.textBetween(g,y);return u(v),v},p=N.useRef(null);return N.useEffect(()=>{let m=0;const g=()=>{m=Date.now()},y=()=>{var A;if(Date.now()-m>500){const{selection:x}=t.state;x.from!==x.to&&((A=p.current)==null||A.click())}},v=()=>{var x;if(!i)return;const{selection:w}=t.state;w.from!==w.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]),N.useEffect(()=>{h(t)},[t]),N.useEffect(()=>{const m=g=>{g.key==="k"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),n!==Me.LINK_POPUP?r(Me.LINK_POPUP):r(Me.NONE))};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[t,n]),S.jsxs(uD,{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(cD,{asChild:!0,children:S.jsx("button",{ref:p,onClick:()=>m.onClick(),children:m.icon})}):m.title==="Text color"?S.jsx(cD,{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===Me.TEXT_FORMATING&&S.jsx(e$,{editor:t,setToolVisibility:r}),n===Me.LINK_POPUP&&S.jsx(aae,{open:n===Me.LINK_POPUP,onOpenChange:()=>r(Me.NONE),title:"Link",content:S.jsxs("div",{className:"flex flex-col gap-4 w-full h-full px-4",children:[S.jsx(K0,{label:"Text",placeholder:"Link text",className:"w-full",defaultValue:l,onChange:m=>{m.preventDefault(),u(m.target.value)}}),S.jsx(K0,{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(Me.NONE),className:"w-auto min-w-[80px]"}})]})},I2=N.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),By=N.createContext({}),Fy=N.createContext(null),L2=typeof document<"u",B2=L2?N.useLayoutEffect:N.useEffect,a8=N.createContext({strict:!1}),F2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),l8="data-"+F2("framerAppearId"),uae={skipAnimations:!1,useManualTiming:!1};class u8{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 cae(t){let e=new u8,n=new u8,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 jy=["read","resolveKeyframes","update","preRender","render","postRender"],fae=40;function c8(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=jy.reduce((f,d)=>(f[d]=cae(()=>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,fae),1),s.timestamp=f,s.isProcessing=!0,jy.forEach(o),s.isProcessing=!1,n&&e&&(r=!1,t(a))},l=()=>{n=!0,r=!0,s.isProcessing||t(a)};return{schedule:jy.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=>jy.forEach(d=>i[d].cancel(f)),state:s,steps:i}}const{schedule:j2,cancel:Qde}=c8(queueMicrotask,!1);function Gc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const f8=N.createContext({});let d8=!1;function dae(t,e,n,r,s){const{visualElement:i}=N.useContext(By),o=N.useContext(a8),a=N.useContext(Fy),l=N.useContext(I2).reducedMotion,u=N.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=N.useContext(f8);c&&!c.projection&&s&&(c.type==="html"||c.type==="svg")&&pae(u.current,n,s,f),N.useInsertionEffect(()=>{c&&c.update(n,a)});const d=N.useRef(!!(n[l8]&&!window.HandoffComplete));return B2(()=>{c&&(c.updateFeatures(),j2.render(c.render),d.current&&c.animationState&&c.animationState.animateChanges())}),N.useEffect(()=>{c&&(!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,d8||(d8=!0,queueMicrotask(hae))))}),c}function hae(){window.HandoffComplete=!0}function pae(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:h8(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 h8(t){if(t)return t.options.allowProjection!==!1?t.projection:h8(t.parent)}function mae(t,e,n){return N.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 Uy(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const U2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],V2=["initial",...U2];function Vy(t){return Uy(t.animate)||V2.some(e=>Xh(t[e]))}function p8(t){return!!(Vy(t)||t.variants)}function gae(t,e){if(Vy(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 yae(t){const{initial:e,animate:n}=gae(t,N.useContext(By));return N.useMemo(()=>({initial:e,animate:n}),[m8(e),m8(n)])}function m8(t){return Array.isArray(t)?t.join(" "):t}const g8={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 g8)Wc[t]={isEnabled:e=>g8[t].some(n=>!!e[n])};function bae(t){for(const e in t)Wc[e]={...Wc[e],...t[e]}}const H2=N.createContext({}),wae=Symbol.for("motionComponentSymbol"),Sn=t=>t;let Kc=Sn,Ji=Sn;process.env.NODE_ENV!=="production"&&(Kc=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Ji=(t,e)=>{if(!t)throw new Error(e)});function Aae({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&bae(t);function i(a,l){let u;const c={...N.useContext(I2),...a,layoutId:vae(a)},{isStatic:f}=c,d=yae(a),h=r(a,f);if(!f&&L2){xae(c,t);const p=kae(c);u=p.MeasureLayout,d.visualElement=dae(s,h,c,e,p.ProjectionNode)}return S.jsxs(By.Provider,{value:d,children:[u&&d.visualElement?S.jsx(u,{visualElement:d.visualElement,...c}):null,n(s,a,mae(h,d.visualElement,l),h,f,d.visualElement)]})}const o=N.forwardRef(i);return o[wae]=s,o}function vae({layoutId:t}){const e=N.useContext(H2).id;return e&&t!==void 0?e+"-"+t:t}function xae(t,e){const n=N.useContext(a8).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):Ji(!1,r)}}function kae(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 Eae(t){function e(r,s={}){return Aae(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 Cae=["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 z2(t){return typeof t!="string"||t.includes("-")?!1:!!(Cae.indexOf(t)>-1||/[A-Z]/u.test(t))}const Hy={};function Sae(t){Object.assign(Hy,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 y8(t,{layout:e,layoutId:n}){return Bl.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Hy[t]||t==="opacity")}const Pn=t=>!!(t&&t.getVelocity),Tae={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Dae=Zh.length;function Oae(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,s){let i="";for(let o=0;o<Dae;o++){const a=Zh[o];if(t[a]!==void 0){const l=Tae[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 b8=t=>e=>typeof e=="string"&&e.startsWith(t),w8=b8("--"),_ae=b8("var(--"),$2=t=>_ae(t)?Mae.test(t.split("/*")[0].trim()):!1,Mae=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Nae=(t,e)=>e&&typeof t=="number"?e.transform(t):t,aa=(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=>aa(0,1,t)},zy={...qc,default:1},tp=t=>Math.round(t*1e5)/1e5,G2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Rae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Pae=/^(?:#[\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}`}),la=rp("deg"),di=rp("%"),Ie=rp("px"),Iae=rp("vh"),Lae=rp("vw"),A8={...di,parse:t=>di.parse(t)/100,transform:t=>di.transform(t*100)},v8={...qc,transform:Math.round},x8={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:la,rotateX:la,rotateY:la,rotateZ:la,scale:zy,scaleX:zy,scaleY:zy,scaleZ:zy,skew:la,skewX:la,skewY:la,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:ep,originX:A8,originY:A8,originZ:Ie,zIndex:v8,backgroundPositionX:Ie,backgroundPositionY:Ie,fillOpacity:ep,strokeOpacity:ep,numOctaves:v8};function W2(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(w8(f)){i[f]=d;continue}const h=x8[f],p=Nae(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=Oae(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 K2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function k8(t,e,n){for(const r in e)!Pn(e[r])&&!y8(r,n)&&(t[r]=e[r])}function Bae({transformTemplate:t},e,n){return N.useMemo(()=>{const r=K2();return W2(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}function Fae(t,e,n){const r=t.style||{},s={};return k8(s,r,t),Object.assign(s,Bae(t,e,n)),s}function jae(t,e,n){const r={},s=Fae(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 $y(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 E8=t=>!$y(t);function Vae(t){t&&(E8=e=>e.startsWith("on")?!$y(e):t(e))}try{Vae(require("@emotion/is-prop-valid").default)}catch{}function Hae(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(E8(s)||n===!0&&$y(s)||!e&&!$y(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function C8(t,e,n){return typeof t=="string"?t:Ie.transform(e+n*t)}function zae(t,e,n){const r=C8(e,t.x,t.width),s=C8(n,t.y,t.height);return`${r} ${s}`}const $ae={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gae={offset:"strokeDashoffset",array:"strokeDasharray"};function Wae(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?$ae:Gae;t[i.offset]=Ie.transform(-r);const o=Ie.transform(e),a=Ie.transform(n);t[i.array]=`${o} ${a}`}function q2(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f,d){if(W2(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=zae(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&&Wae(h,o,a,l,!1)}const S8=()=>({...K2(),attrs:{}}),Q2=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Kae(t,e,n,r){const s=N.useMemo(()=>{const i=S8();return q2(i,e,{enableHardwareAcceleration:!1},Q2(r),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};k8(i,t.style,t),s.style={...i,...s.style}}return s}function qae(t=!1){return(n,r,s,{latestValues:i},o)=>{const l=(z2(n)?Kae:jae)(r,i,o,n),u=Hae(r,typeof n=="string",t),c=n!==N.Fragment?{...u,...l,ref:s}:{},{children:f}=r,d=N.useMemo(()=>Pn(f)?f.get():f,[f]);return N.createElement(n,{...c,children:d})}}function T8(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 D8=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 O8(t,e,n,r){T8(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(D8.has(s)?s:F2(s),e.attrs[s])}function J2(t,e,n){var r;const{style:s}=t,i={};for(const o in s)(Pn(s[o])||e.style&&Pn(e.style[o])||y8(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 _8(t,e,n){const r=J2(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 M8(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Y2(t,e,n,r){if(typeof e=="function"){const[s,i]=M8(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]=M8(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function N8(t){const e=N.useRef(null);return e.current===null&&(e.current=t()),e.current}const X2=t=>Array.isArray(t),Qae=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Jae=t=>X2(t)?t[t.length-1]||0:t;function Gy(t){const e=Pn(t)?t.get():t;return Qae(e)?e.toValue():e}function Yae({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,s,i){const o={latestValues:Xae(r,s,i,t),renderState:e()};return n&&(o.mount=a=>n(r,a,o)),o}const R8=t=>(e,n)=>{const r=N.useContext(By),s=N.useContext(Fy),i=()=>Yae(t,e,r,s);return n?i():N8(i)};function Xae(t,e,n,r){const s={},i=r(t,{});for(const d in i)s[d]=Gy(i[d]);let{initial:o,animate:a}=t;const l=Vy(t),u=p8(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"&&!Uy(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=Y2(t,h);if(!p)return;const{transitionEnd:m,transition:g,...y}=p;for(const v in y){let w=y[v];if(Array.isArray(w)){const A=c?w.length-1:0;w=w[A]}w!==null&&(s[v]=w)}for(const v in m)s[v]=m[v]}),s}const{schedule:pt,cancel:Yi,state:Tn,steps:Z2}=c8(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0),Zae={useVisualState:R8({scrapeMotionValuesFromProps:_8,createRenderState:S8,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(()=>{q2(n,r,{enableHardwareAcceleration:!1},Q2(e.tagName),t.transformTemplate),O8(e,n)})}})},ele={useVisualState:R8({scrapeMotionValuesFromProps:J2,createRenderState:K2})};function tle(t,{forwardMotionProps:e=!1},n,r){return{...z2(t)?Zae:ele,preloadedFeatures:n,useRender:qae(e),createVisualElement:r,Component:t}}function Xi(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const P8=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function Wy(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const nle=t=>e=>P8(e)&&t(e,Wy(e));function Zi(t,e,n,r){return Xi(t,e,nle(n),r)}const rle=(t,e)=>n=>e(t(n)),eo=(...t)=>t.reduce(rle);function I8(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const L8=I8("dragHorizontal"),B8=I8("dragVertical");function F8(t){let e=!1;if(t==="y")e=B8();else if(t==="x")e=L8();else{const n=L8(),r=B8();n&&r?e=()=>{n(),r()}:(n&&n(),r&&r())}return e}function j8(){const t=F8(!0);return t?(t(),!1):!0}class ua{constructor(e){this.isMounted=!1,this.node=e}update(){}}function U8(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd",s=(i,o)=>{if(i.pointerType==="touch"||j8())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 Zi(t.current,n,s,{passive:!t.getProps()[r]})}class sle extends ua{mount(){this.unmount=eo(U8(this.node,!0),U8(this.node,!1))}unmount(){}}class ile extends ua{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=eo(Xi(this.node.current,"focus",()=>this.onFocus()),Xi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const V8=(t,e)=>e?t===e?!0:V8(t,e.parentElement):!1;function ek(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,Wy(n))}class ole extends ua{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=Zi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:f}=this.node.getProps(),d=!f&&!V8(this.node.current,a.target)?c:u;d&&pt.update(()=>d(a,l))},{passive:!(r.onTap||r.onPointerUp)}),o=Zi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=eo(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()||ek("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&pt.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Xi(this.node.current,"keyup",o),ek("down",(a,l)=>{this.startPress(a,l)})},n=Xi(this.node.current,"keydown",e),r=()=>{this.isPressing&&ek("cancel",(i,o)=>this.cancelPress(i,o))},s=Xi(this.node.current,"blur",r);this.removeAccessibleListeners=eo(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),!j8()}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=Zi(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=Xi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=eo(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const tk=new WeakMap,nk=new WeakMap,ale=t=>{const e=tk.get(t.target);e&&e(t)},lle=t=>{t.forEach(ale)};function ule({root:t,...e}){const n=t||document;nk.has(n)||nk.set(n,{});const r=nk.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(lle,{root:t,...e})),r[s]}function cle(t,e,n){const r=ule(e);return tk.set(t,n),r.observe(t),()=>{tk.delete(t),r.unobserve(t)}}const fle={some:0,all:1};class dle extends ua{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:fle[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 cle(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(hle(e,n))&&this.startObserver()}unmount(){}}function hle({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ple={inView:{Feature:dle},tap:{Feature:ole},focus:{Feature:ile},hover:{Feature:sle}};function H8(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 Ky(t,e,n){const r=t.getProps();return Y2(r,e,n!==void 0?n:r.custom,t)}const to=t=>t*1e3,no=t=>t/1e3,mle={type:"spring",stiffness:500,damping:25,restSpeed:10},gle=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),yle={type:"keyframes",duration:.8},ble={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wle=(t,{keyframes:e})=>e.length>2?yle:Bl.has(t)?t.startsWith("scale")?gle(e[1]):mle:ble;function Ale({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 rk(t,e){return t[e]||t.default||t}const vle=t=>t!==null;function qy(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter(vle),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}let Qy;function xle(){Qy=void 0}const ca={now:()=>(Qy===void 0&&ca.set(Tn.isProcessing||uae.useManualTiming?Tn.timestamp:performance.now()),Qy),set:t=>{Qy=t,queueMicrotask(xle)}},z8=t=>/^0[^.\s]+$/u.test(t);function kle(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||z8(t):!0}const $8=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ele=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Cle(t){const e=Ele.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}const Sle=4;function G8(t,e,n=1){Ji(n<=Sle,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,s]=Cle(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return $8(o)?parseFloat(o):o}return $2(s)?G8(s,e,n+1):s}const Tle=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),W8=t=>t===qc||t===Ie,K8=(t,e)=>parseFloat(t.split(", ")[e]),q8=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return K8(s[1],e);{const i=r.match(/^matrix\((.+)\)$/u);return i?K8(i[1],t):0}},Dle=new Set(["x","y","z"]),Ole=Zh.filter(t=>!Dle.has(t));function _le(t){const e=[];return Ole.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:q8(4,13),y:q8(5,14)};Qc.translateX=Qc.x,Qc.translateY=Qc.y;const Q8=t=>e=>e.test(t),J8=[qc,Ie,di,la,Lae,Iae,{test:t=>t==="auto",parse:t=>t}],Y8=t=>J8.find(Q8(t)),Fl=new Set;let sk=!1,ik=!1;function X8(){if(ik){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=_le(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)})}ik=!1,sk=!1,Fl.forEach(t=>t.complete()),Fl.clear()}function Z8(){Fl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ik=!0)})}function Mle(){Z8(),X8()}class ok{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),sk||(sk=!0,pt.read(Z8),pt.resolveKeyframes(X8))):(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 ak=(t,e)=>n=>!!(np(n)&&Pae.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),eI=(t,e,n)=>r=>{if(!np(r))return r;const[s,i,o,a]=r.match(G2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Nle=t=>aa(0,255,t),lk={...qc,transform:t=>Math.round(Nle(t))},jl={test:ak("rgb","red"),parse:eI("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+lk.transform(t)+", "+lk.transform(e)+", "+lk.transform(n)+", "+tp(ep.transform(r))+")"};function Rle(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 uk={test:ak("#"),parse:Rle,transform:jl.transform},Jc={test:ak("hsl","hue"),parse:eI("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+di.transform(tp(e))+", "+di.transform(tp(n))+", "+tp(ep.transform(r))+")"},In={test:t=>jl.test(t)||uk.test(t)||Jc.test(t),parse:t=>jl.test(t)?jl.parse(t):Jc.test(t)?Jc.parse(t):uk.parse(t),transform:t=>np(t)?t:t.hasOwnProperty("red")?jl.transform(t):Jc.transform(t)};function Ple(t){var e,n;return isNaN(t)&&np(t)&&(((e=t.match(G2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Rae))===null||n===void 0?void 0:n.length)||0)>0}const tI="number",nI="color",Ile="var",Lle="var(",rI="${}",Ble=/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(Ble,l=>(In.test(l)?(r.color.push(i),s.push(nI),n.push(In.parse(l))):l.startsWith(Lle)?(r.var.push(i),s.push(Ile),n.push(l)):(r.number.push(i),s.push(tI),n.push(parseFloat(l))),++i,rI)).split(rI);return{values:n,split:a,indexes:r,types:s}}function sI(t){return sp(t).values}function iI(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===tI?i+=tp(s[o]):a===nI?i+=In.transform(s[o]):i+=s[o]}return i}}const Fle=t=>typeof t=="number"?0:t;function jle(t){const e=sI(t);return iI(t)(e.map(Fle))}const fa={test:Ple,parse:sI,createTransformer:iI,getAnimatableNone:jle},Ule=new Set(["brightness","contrast","saturate","opacity"]);function Vle(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(G2)||[];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 Hle=/\b([a-z-]*)\(.*?\)/gu,ck={...fa,getAnimatableNone:t=>{const e=t.match(Hle);return e?e.map(Vle).join(" "):t}},zle={...x8,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:ck,WebkitFilter:ck},fk=t=>zle[t];function oI(t,e){let n=fk(t);return n!==ck&&(n=fa),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const $le=new Set(["auto","none","0"]);function Gle(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!$le.has(i)&&sp(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=oI(n,s)}class aI extends ok{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(),$2(u))){const c=G8(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Tle.has(r)||e.length!==2)return;const[s,i]=e,o=Y8(s),a=Y8(i);if(o!==a)if(W8(o)&&W8(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++)kle(e[s])&&r.push(s);r.length&&Gle(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 lI(t){let e;return()=>(e===void 0&&(e=t()),e)}const uI=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(fa.test(t)||t==="0")&&!t.startsWith("url("));function Wle(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 Kle(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=uI(s,e),a=uI(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:Wle(t)||n==="spring"&&r}class cI{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&&Mle(),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&&!Kle(e,r,s,i))if(o)this.options.duration=0;else{l==null||l(qy(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 fI(t,e){return e?t*(1e3/e):0}const qle=5;function dI(t,e,n){const r=Math.max(e-qle,0);return fI(n-t(r),e-r)}const dk=.001,Qle=.01,hI=10,Jle=.05,Yle=1;function Xle({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,i;Kc(t<=to(hI),"Spring duration must be 10 seconds or less");let o=1-e;o=aa(Jle,Yle,o),t=aa(Qle,hI,no(t)),o<1?(s=u=>{const c=u*o,f=c*t,d=c-n,h=hk(u,o),p=Math.exp(-f);return dk-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=hk(Math.pow(u,2),o);return(-s(u)+dk>0?-1:1)*((d-h)*p)/m}):(s=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-dk+c*f},i=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=eue(s,i,a);if(t=to(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 Zle=12;function eue(t,e,n){let r=n;for(let s=1;s<Zle;s++)r=r-t(r)/e(r);return r}function hk(t,e){return t*Math.sqrt(1-e*e)}const tue=["duration","bounce"],nue=["stiffness","damping","mass"];function pI(t,e){return e.some(n=>t[n]!==void 0)}function rue(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!pI(t,nue)&&pI(t,tue)){const n=Xle(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function mI({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}=rue({...r,velocity:-no(r.velocity||0)}),h=f||0,p=l/(2*Math.sqrt(a*u)),m=i-s,g=no(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 w=hk(g,p);v=A=>{const x=Math.exp(-p*g*A);return i-x*((h+p*g*m)/w*Math.sin(w*A)+m*Math.cos(w*A))}}else if(p===1)v=w=>i-Math.exp(-g*w)*(m+(h+g*m)*w);else{const w=g*Math.sqrt(p*p-1);v=A=>{const x=Math.exp(-p*g*A),k=Math.min(w*A,300);return i-x*((h+p*g*m)*Math.sinh(k)+w*m*Math.cosh(k))/w}}return{calculatedDuration:d&&c||null,next:w=>{const A=v(w);if(d)o.done=w>=c;else{let x=h;w!==0&&(p<1?x=dI(v,w,A):x=0);const k=Math.abs(x)<=n,C=Math.abs(i-A)<=e;o.done=k&&C}return o.value=o.done?i:A,o}}}function gI({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),w=O=>y+v(O),A=O=>{const _=v(O),D=w(O);d.done=Math.abs(_)<=u,d.value=d.done?y:D};let x,k;const C=O=>{h(d.value)&&(x=O,k=mI({keyframes:[d.value,p(d.value)],velocity:dI(w,O,d.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:O=>{let _=!1;return!k&&x===void 0&&(_=!0,A(O),C(O)),x!==void 0&&O>=x?k.next(O-x):(!_&&A(O),d)}}}const yI=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,sue=1e-7,iue=12;function oue(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=yI(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>sue&&++a<iue);return o}function ip(t,e,n,r){if(t===e&&n===r)return Sn;const s=i=>oue(i,0,1,t,n);return i=>i===0||i===1?i:yI(s(i),e,r)}const aue=ip(.42,0,1,1),lue=ip(0,0,.58,1),bI=ip(.42,0,.58,1),uue=t=>Array.isArray(t)&&typeof t[0]!="number",wI=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,AI=t=>e=>1-t(1-e),pk=t=>1-Math.sin(Math.acos(t)),vI=AI(pk),cue=wI(pk),xI=ip(.33,1.53,.69,.99),mk=AI(xI),fue=wI(mk),kI={linear:Sn,easeIn:aue,easeInOut:bI,easeOut:lue,circIn:pk,circInOut:cue,circOut:vI,backIn:mk,backInOut:fue,backOut:xI,anticipate:t=>(t*=2)<1?.5*mk(t):.5*(2-Math.pow(2,-10*(t-1)))},EI=t=>{if(Array.isArray(t)){Ji(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 Ji(kI[t]!==void 0,`Invalid easing type '${t}'`),kI[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 gk(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 due({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=gk(l,a,t+1/3),i=gk(l,a,t),o=gk(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Jy(t,e){return n=>n>0?e:t}const yk=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},hue=[uk,jl,Jc],pue=t=>hue.find(e=>e.test(t));function CI(t){const e=pue(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=due(n)),n}const SI=(t,e)=>{const n=CI(t),r=CI(e);if(!n||!r)return Jy(t,e);const s={...n};return i=>(s.red=yk(n.red,r.red,i),s.green=yk(n.green,r.green,i),s.blue=yk(n.blue,r.blue,i),s.alpha=Bt(n.alpha,r.alpha,i),jl.transform(s))},bk=new Set(["none","hidden"]);function mue(t,e){return bk.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function gue(t,e){return n=>Bt(t,e,n)}function wk(t){return typeof t=="number"?gue:typeof t=="string"?$2(t)?Jy:In.test(t)?SI:wue:Array.isArray(t)?TI:typeof t=="object"?In.test(t)?SI:yue:Jy}function TI(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>wk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function yue(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=wk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function bue(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 wue=(t,e)=>{const n=fa.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?bk.has(t)&&!s.values.length||bk.has(e)&&!r.values.length?mue(t,e):eo(TI(bue(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.`),Jy(t,e))};function DI(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Bt(t,e,n):wk(t)(t,e)}function Aue(t,e,n){const r=[],s=n||DI,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=eo(l,a)}r.push(a)}return r}function vue(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Ji(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=Aue(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(aa(t[0],t[i-1],u)):l}function xue(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 kue(t){const e=[0];return xue(e,t.length-1),e}function Eue(t,e){return t.map(n=>n*e)}function Cue(t,e){return t.map(()=>e||bI).splice(0,t.length-1)}function Yy({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=uue(r)?r.map(EI):EI(r),i={done:!1,value:e[0]},o=Eue(n&&n.length===e.length?n:kue(e),t),a=vue(o,e,{ease:Array.isArray(s)?s:Cue(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const OI=2e4;function Sue(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<OI;)e+=n,r=t.next(e);return e>=OI?1/0:e}const Tue=t=>{const e=({timestamp:n})=>t(n);return{start:()=>pt.update(e,!0),stop:()=>Yi(e),now:()=>Tn.isProcessing?Tn.timestamp:ca.now()}},Due={decay:gI,inertia:gI,tween:Yy,keyframes:Yy,spring:mI},Oue=t=>t/100;class Ak extends cI{constructor({KeyframeResolver:e=ok,...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=Due[n]||Yy;let l,u;a!==Yy&&typeof e[0]!="number"&&(process.env.NODE_ENV!=="production"&&Ji(e.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),l=eo(Oue,DI(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=Sue(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 w=this.currentTime,A=i;if(h){const O=Math.min(this.currentTime,c)/f;let _=Math.floor(O),D=O%1;!D&&O>=1&&(D=1),D===1&&_--,_=Math.min(_,h+1),!!(_%2)&&(p==="reverse"?(D=1-D,m&&(D-=m/f)):p==="mirror"&&(A=o)),w=aa(0,1,D)*f}const x=v?{done:!1,value:l[0]}:A.next(w);a&&(x.value=a(x.value));let{done:k}=x;!v&&u!==null&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return C&&s!==void 0&&(x.value=qy(l,this.options,s)),g&&g(x.value),C&&this.finish(),x}get duration(){const{resolved:e}=this;return e?no(e.calculatedDuration):0}get time(){return no(this.currentTime)}set time(e){e=to(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=no(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Tue,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 _I=t=>Array.isArray(t)&&typeof t[0]=="number";function MI(t){return!!(!t||typeof t=="string"&&t in vk||_I(t)||Array.isArray(t)&&t.every(MI))}const ap=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,vk={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 _ue(t){return NI(t)||vk.easeOut}function NI(t){if(t)return _I(t)?ap(t):Array.isArray(t)?t.map(_ue):vk[t]}function Mue(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=NI(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 Nue=lI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Rue=new Set(["opacity","clipPath","filter","transform"]),Xy=10,Pue=2e4;function Iue(t){return t.type==="spring"||t.name==="backgroundColor"||!MI(t.ease)}function Lue(t,e){const n=new Ak({...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<Pue;)r=n.sample(i),s.push(r.value),i+=Xy;return{times:void 0,keyframes:s,duration:i-Xy,ease:"linear"}}class RI extends cI{constructor(e){super(e);const{name:n,motionValue:r,keyframes:s}=this.options;this.resolver=new aI(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(Iue(this.options)){const{onComplete:f,onUpdate:d,motionValue:h,...p}=this.options,m=Lue(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=Mue(l.owner.current,u,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=ca.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;l.set(qy(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 no(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return no(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=to(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 Ak({...f,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),h=to(this.time);l.setWithVelocity(d.sample(h-Xy).value,d.sample(h).value,Xy)}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 Nue()&&r&&Rue.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}function Bue(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),()=>Yi(r)}const Fue=lI(()=>window.ScrollTimeline!==void 0);class jue{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(Fue()&&r.attachTimeline)r.attachTimeline(e);else return r.pause(),Bue(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 xk=(t,e,n,r={},s,i)=>o=>{const a=rk(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-to(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};Ale(a)||(c={...c,...wle(t,c)}),c.duration&&(c.duration=to(c.duration)),c.repeatDelay&&(c.repeatDelay=to(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=qy(c.keyframes,a);if(d!==void 0)return pt.update(()=>{c.onUpdate(d),c.onComplete()}),new jue([])}return!i&&RI.supports(c)?new RI(c):new Ak(c)};function Zy(t){return!!(Pn(t)&&t.add)}function kk(t,e){t.indexOf(e)===-1&&t.push(e)}function Ek(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Ck{constructor(){this.subscriptions=[]}add(e){return kk(this.subscriptions,e),()=>Ek(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 PI=new Set;function Sk(t,e,n){t||PI.has(e)||(console.warn(e),PI.add(e))}const II=30,Uue=t=>!isNaN(parseFloat(t));class Vue{constructor(e,n={}){this.version="11.2.12",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=ca.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=ca.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"&&Sk(!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 Ck);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=ca.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>II)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,II);return fI(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 Vue(t,e)}function Hue(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,lp(n))}function zue(t,e){const n=Ky(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Jae(i[o]);Hue(t,o,a)}}function LI(t){return t.getProps()[l8]}function $ue({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function BI(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&&$ue(f,d))continue;const m={delay:n,elapsed:0,...rk(o||{},d)};let g=!1;if(window.HandoffAppearAnimations){const v=LI(t);if(v){const w=window.HandoffAppearAnimations(v,d,h,pt);w!==null&&(m.elapsed=w,g=!0)}}h.start(xk(d,h,p,t.shouldReduceMotion&&Bl.has(d)?{type:!1}:m,t,g));const y=h.animation;y&&(Zy(u)&&(u.add(d),y.then(()=>u.remove(d))),c.push(y))}return a&&Promise.all(c).then(()=>{pt.update(()=>{a&&zue(t,a)})}),c}function Tk(t,e,n={}){var r;const s=Ky(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(BI(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:d}=i;return Gue(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 Gue(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(Wue).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Tk(u,e,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function Wue(t,e){return t.sortNodePosition(e)}function Kue(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Tk(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Tk(t,e,n);else{const s=typeof e=="function"?Ky(t,e,n.custom):e;r=Promise.all(BI(t,s,n))}return r.then(()=>{pt.postRender(()=>{t.notify("AnimationComplete",e)})})}const que=[...U2].reverse(),Que=U2.length;function Jue(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Kue(t,n,r)))}function Yue(t){let e=Jue(t),n=FI(),r=!0;const s=l=>(u,c)=>{var f;const d=Ky(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<Que;g++){const y=que[g],v=n[y],w=u[y]!==void 0?u[y]:c[y],A=Xh(w),x=y===l?v.isActive:null;x===!1&&(p=g);let k=w===c[y]&&w!==u[y]&&A;if(k&&r&&t.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...h},!v.isActive&&x===null||!w&&!v.prevProp||Uy(w)||typeof w=="boolean")continue;let O=Xue(v.prevProp,w)||y===l&&v.isActive&&!k&&A||g>p&&A,_=!1;const D=Array.isArray(w)?w:[w];let R=D.reduce(s(y),{});x===!1&&(R={});const{prevResolvedValues:L={}}=v,F={...L,...R},G=B=>{O=!0,d.has(B)&&(_=!0,d.delete(B)),v.needsAnimating[B]=!0;const H=t.getValue(B);H&&(H.liveStyle=!1)};for(const B in F){const H=R[B],Q=L[B];if(h.hasOwnProperty(B))continue;let te=!1;X2(H)&&X2(Q)?te=!H8(H,Q):te=H!==Q,te?H!=null?G(B):d.add(B):H!==void 0&&d.has(B)?G(B):v.protectedKeys[B]=!0}v.prevProp=w,v.prevResolvedValues=R,v.isActive&&(h={...h,...R}),r&&t.blockInitialAnimation&&(O=!1),O&&(!k||_)&&f.push(...D.map(B=>({animation:B,options:{type:y}})))}if(d.size){const g={};d.forEach(y=>{const v=t.getBaseTarget(y),w=t.getValue(y);w&&(w.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=FI(),r=!0}}}function Xue(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!H8(e,t):!1}function Ul(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function FI(){return{animate:Ul(!0),whileInView:Ul(),whileHover:Ul(),whileTap:Ul(),whileDrag:Ul(),whileFocus:Ul(),exit:Ul()}}class Zue extends ua{constructor(e){super(e),e.animationState||(e.animationState=Yue(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Uy(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 ece=0;class tce extends ua{constructor(){super(...arguments),this.id=ece++}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 nce={animation:{Feature:Zue},exit:{Feature:tce}},jI=(t,e)=>Math.abs(t-e);function rce(t,e){const n=jI(t.x,e.x),r=jI(t.y,e.y);return Math.sqrt(n**2+r**2)}class UI{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=Ok(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=rce(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=Dk(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=Ok(f.type==="pointercancel"?this.lastMoveEventInfo:Dk(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,g),p&&p(f,g)},!P8(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Wy(e),a=Dk(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=Tn;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,Ok(a,this.history)),this.removeListeners=eo(Zi(this.contextWindow,"pointermove",this.handlePointerMove),Zi(this.contextWindow,"pointerup",this.handlePointerUp),Zi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Yi(this.updatePoint)}}function Dk(t,e){return e?{point:e(t.point)}:t}function VI(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ok({point:t},e){return{point:t,delta:VI(t,HI(e)),offset:VI(t,sce(e)),velocity:ice(e,.1)}}function sce(t){return t[0]}function HI(t){return t[t.length-1]}function ice(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=HI(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>to(e)));)n--;if(!r)return{x:0,y:0};const i=no(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 _k(t,e=0,n=.01){return Math.abs(t-e)<=n}function zI(t,e,n,r=.5){t.origin=r,t.originPoint=Bt(e.min,e.max,t.origin),t.scale=Pr(n)/Pr(e),(_k(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Bt(n.min,n.max,t.origin)-t.originPoint,(_k(t.translate)||isNaN(t.translate))&&(t.translate=0)}function up(t,e,n,r){zI(t.x,e.x,n.x,r?r.originX:void 0),zI(t.y,e.y,n.y,r?r.originY:void 0)}function $I(t,e,n){t.min=n.min+e.min,t.max=t.min+Pr(e)}function oce(t,e,n){$I(t.x,e.x,n.x),$I(t.y,e.y,n.y)}function GI(t,e,n){t.min=e.min-n.min,t.max=t.min+Pr(e)}function cp(t,e,n){GI(t.x,e.x,n.x),GI(t.y,e.y,n.y)}function ace(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 WI(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 lce(t,{top:e,left:n,bottom:r,right:s}){return{x:WI(t.x,n,s),y:WI(t.y,e,r)}}function KI(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 uce(t,e){return{x:KI(t.x,e.x),y:KI(t.y,e.y)}}function cce(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)),aa(0,1,n)}function fce(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 Mk=.35;function dce(t=Mk){return t===!1?t=0:t===!0&&(t=Mk),{x:qI(t,"left","right"),y:qI(t,"top","bottom")}}function qI(t,e,n){return{min:QI(t,e),max:QI(t,n)}}function QI(t,e){return typeof t=="number"?t:t[e]||0}const JI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yc=()=>({x:JI(),y:JI()}),YI=()=>({min:0,max:0}),qt=()=>({x:YI(),y:YI()});function es(t){return[t("x"),t("y")]}function XI({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function hce({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function pce(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 Nk(t){return t===void 0||t===1}function Rk({scale:t,scaleX:e,scaleY:n}){return!Nk(t)||!Nk(e)||!Nk(n)}function Vl(t){return Rk(t)||ZI(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ZI(t){return eL(t.x)||eL(t.y)}function eL(t){return t&&t!=="0%"}function eb(t,e,n){const r=t-n,s=e*r;return n+s}function tL(t,e,n,r,s){return s!==void 0&&(t=eb(t,s,r)),eb(t,n,r)+e}function Pk(t,e=0,n=1,r,s){t.min=tL(t.min,e,n,r,s),t.max=tL(t.max,e,n,r,s)}function nL(t,{x:e,y:n}){Pk(t.x,e.translate,e.scale,e.originPoint),Pk(t.y,n.translate,n.scale,n.originPoint)}function mce(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,nL(t,o)),r&&Vl(i.latestValues)&&Xc(t,i.latestValues))}e.x=rL(e.x),e.y=rL(e.y)}function rL(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function da(t,e){t.min=t.min+e,t.max=t.max+e}function sL(t,e,[n,r,s]){const i=e[s]!==void 0?e[s]:.5,o=Bt(t.min,t.max,i);Pk(t,e[n],e[r],o,e.scale)}const gce=["x","scaleX","originX"],yce=["y","scaleY","originY"];function Xc(t,e){sL(t.x,e,gce),sL(t.y,e,yce)}function iL(t,e){return XI(pce(t.getBoundingClientRect(),e))}function bce(t,e,n){const r=iL(t,n),{scroll:s}=e;return s&&(da(r.x,s.offset.x),da(r.y,s.offset.y)),r}const oL=({current:t})=>t?t.ownerDocument.defaultView:null,wce=new WeakMap;class Ace{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(Wy(c,"page").point)},i=(c,f)=>{const{drag:d,dragPropagation:h,onDragStart:p}=this.getProps();if(d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=F8(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(di.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[g];w&&(y=Pr(w)*(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=vce(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 UI(e,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:oL(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||!tb(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=ace(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=lce(s.layoutBox,n):this.constraints=!1,this.elastic=dce(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=fce(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Gc(e))return!1;const r=e.current;Ji(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=bce(r,s.root,this.visualElement.getTransformPagePoint());let o=uce(s.layout.layoutBox,i);if(n){const a=n(hce(o));this.hasMutatedConstraints=!!a,a&&(o=XI(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(!tb(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(xk(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(!tb(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]=cce({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(!tb(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;wce.set(this.visualElement,this);const e=this.visualElement.current,n=Zi(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=Xi(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=Mk,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function tb(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function vce(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class xce extends ua{constructor(e){super(e),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new Ace(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 aL=t=>(e,n)=>{t&&pt.postRender(()=>t(e,n))};class kce extends ua{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(e){this.session=new UI(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oL(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:aL(e),onStart:aL(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&pt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Zi(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 Ece(){const t=N.useContext(Fy);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,s=N.useId();return N.useEffect(()=>r(s),[]),!e&&n?[!1,()=>n&&n(s)]:[!0]}const nb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function lL(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=lL(t,e.target.x),r=lL(t,e.target.y);return`${n}% ${r}%`}},Cce={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=fa.parse(t);if(s.length>5)return r;const i=fa.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 Sce extends N.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;Sae(Tce),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()})),nb.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(),j2.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 uL(t){const[e,n]=Ece(),r=N.useContext(H2);return S.jsx(Sce,{...t,layoutGroup:r,switchLayoutGroup:N.useContext(f8),isPresent:e,safeToRemove:n})}const Tce={borderRadius:{...fp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fp,borderTopRightRadius:fp,borderBottomLeftRadius:fp,borderBottomRightRadius:fp,boxShadow:Cce},cL=["TopLeft","TopRight","BottomLeft","BottomRight"],Dce=cL.length,fL=t=>typeof t=="string"?parseFloat(t):t,dL=t=>typeof t=="number"||Ie.test(t);function Oce(t,e,n,r,s,i){s?(t.opacity=Bt(0,n.opacity!==void 0?n.opacity:1,_ce(r)),t.opacityExit=Bt(e.opacity!==void 0?e.opacity:1,0,Mce(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<Dce;o++){const a=`border${cL[o]}Radius`;let l=hL(e,a),u=hL(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||dL(l)===dL(u)?(t[a]=Math.max(Bt(fL(l),fL(u),r),0),(di.test(u)||di.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=Bt(e.rotate||0,n.rotate||0,r))}function hL(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const _ce=pL(0,.5,vI),Mce=pL(.5,.95,Sn);function pL(t,e,n){return r=>r<t?0:r>e?1:n(op(t,e,r))}function mL(t,e){t.min=e.min,t.max=e.max}function ts(t,e){mL(t.x,e.x),mL(t.y,e.y)}function gL(t,e,n,r,s){return t-=e,t=eb(t,1/n,r),s!==void 0&&(t=eb(t,1/s,r)),t}function Nce(t,e=0,n=1,r=.5,s,i=t,o=t){if(di.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=gL(t.min,e,n,a,s),t.max=gL(t.max,e,n,a,s)}function yL(t,e,[n,r,s],i,o){Nce(t,e[n],e[r],e[s],e.scale,i,o)}const Rce=["x","scaleX","originX"],Pce=["y","scaleY","originY"];function bL(t,e,n,r){yL(t.x,e,Rce,n?n.x:void 0,r?r.x:void 0),yL(t.y,e,Pce,n?n.y:void 0,r?r.y:void 0)}function wL(t){return t.translate===0&&t.scale===1}function AL(t){return wL(t.x)&&wL(t.y)}function Ice(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 vL(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 xL(t){return Pr(t.x)/Pr(t.y)}class Lce{constructor(){this.members=[]}add(e){kk(this.members,e),e.scheduleRender()}remove(e){if(Ek(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 kL(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 Bce=(t,e)=>t.depth-e.depth;class Fce{constructor(){this.children=[],this.isDirty=!1}add(e){kk(this.children,e),this.isDirty=!0}remove(e){Ek(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Bce),this.isDirty=!1,this.children.forEach(e)}}function jce(t,e){const n=ca.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Yi(r),t(i-e))};return pt.read(r,!0),()=>Yi(r)}function Uce(t){window.MotionDebug&&window.MotionDebug.record(t)}function Vce(t){return t instanceof SVGElement&&t.tagName!=="svg"}function Hce(t,e,n){const r=Pn(t)?t:lp(t);return r.start(xk("",r,e,n)),r.animation}const Ik=["","X","Y","Z"],zce={visibility:"hidden"},EL=1e3;let $ce=0;const Hl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Lk(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function CL(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;const{visualElement:e}=t.options;return e?LI(e)?!0:t.parent&&!t.parent.hasCheckedOptimisedAppear?CL(t.parent):!1:!1}function SL({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=$ce++,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,Hl.totalNodes=Hl.resolvedTargetDeltas=Hl.recalculatedProjection=0,this.nodes.forEach(Kce),this.nodes.forEach(Xce),this.nodes.forEach(Zce),this.nodes.forEach(qce),Uce(Hl)},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 Fce)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ck),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=Vce(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=jce(d,250),nb.hasAnimatedSinceResize&&(nb.hasAnimatedSinceResize=!1,this.nodes.forEach(DL))})}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()||sfe,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!vL(this.targetLayout,p)||h,w=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const A={...rk(m,"layout"),onPlay:g,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||DL(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,Yi(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(efe),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&&CL(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(TL);return}this.isUpdating||this.nodes.forEach(Jce),this.isUpdating=!1,this.nodes.forEach(Yce),this.nodes.forEach(Gce),this.nodes.forEach(Wce),this.clearAllSnapshots();const a=ca.now();Tn.delta=aa(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,j2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Qce),this.sharedNodes.forEach(tfe)}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&&!AL(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Vl(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)),ife(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&&(da(a.x,l.offset.x),da(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&&(da(a.x,-d.offset.x),da(a.y,-d.offset.y))}da(a.x,c.offset.x),da(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}),Vl(c.latestValues)&&Xc(l,c.latestValues)}return Vl(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||!Vl(u.latestValues))continue;Rk(u.latestValues)&&u.updateSnapshot();const c=qt(),f=u.measurePageBox();ts(c,f),bL(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Vl(this.latestValues)&&bL(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(),oce(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ts(this.target,this.layout.layoutBox),nL(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}Hl.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Rk(this.parent.latestValues)||ZI(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;mce(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=kL(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==d||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Hl.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(rfe));this.animationProgress=0;let w;this.mixTargetDelta=A=>{const x=A/1e3;OL(f.x,o.x,x),OL(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),nfe(this.relativeTarget,this.relativeTargetOrigin,d,x),w&&Ice(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=qt()),ts(w,this.relativeTarget)),m&&(this.animationValues=c,Oce(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&&(Yi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{nb.hasAnimatedSinceResize=!0,this.currentAnimation=Hce(0,EL,{...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(EL),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&&PL(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 Lce),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&&Lk("z",o,u,this.animationValues);for(let c=0;c<Ik.length;c++)Lk(`rotate${Ik[c]}`,o,u,this.animationValues),Lk(`skew${Ik[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 zce;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Gy(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=Gy(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Vl(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=kL(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 Hy){if(d[m]===void 0)continue;const{correct:g,applyTo:y}=Hy[m],v=u.transform==="none"?d[m]:g(d[m],f);if(y){const w=y.length;for(let A=0;A<w;A++)u[y[A]]=v}else u[m]=v}return this.options.layoutId&&(u.pointerEvents=f===this?Gy(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(TL),this.root.sharedNodes.clear()}}}function Gce(t){t.updateLayout()}function Wce(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}):PL(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=!AL(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),vL(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 Kce(t){Hl.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 qce(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Qce(t){t.clearSnapshot()}function TL(t){t.clearMeasurements()}function Jce(t){t.isLayoutDirty=!1}function Yce(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function DL(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Xce(t){t.resolveTargetDelta()}function Zce(t){t.calcProjection()}function efe(t){t.resetSkewAndRotation()}function tfe(t){t.removeLeadSnapshot()}function OL(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 _L(t,e,n,r){t.min=Bt(e.min,n.min,r),t.max=Bt(e.max,n.max,r)}function nfe(t,e,n,r){_L(t.x,e.x,n.x,r),_L(t.y,e.y,n.y,r)}function rfe(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const sfe={duration:.45,ease:[.4,0,.1,1]},ML=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),NL=ML("applewebkit/")&&!ML("chrome/")?Math.round:Sn;function RL(t){t.min=NL(t.min),t.max=NL(t.max)}function ife(t){RL(t.x),RL(t.y)}function PL(t,e,n){return t==="position"||t==="preserve-aspect"&&!_k(xL(e),xL(n),.2)}const ofe=SL({attachResizeListener:(t,e)=>Xi(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Bk={current:void 0},IL=SL({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Bk.current){const t=new ofe({});t.mount(window),t.setOptions({layoutScroll:!0}),Bk.current=t}return Bk.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),afe={pan:{Feature:kce},drag:{Feature:xce,ProjectionNode:IL,MeasureLayout:uL}},Fk={current:null},LL={current:!1};function lfe(){if(LL.current=!0,!!L2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fk.current=t.matches;t.addListener(e),e()}else Fk.current=!1}function ufe(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),Zy(r)&&r.add(s),process.env.NODE_ENV==="development"&&Sk(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})),Zy(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 BL=new WeakMap,cfe=[...J8,In,fa],ffe=t=>cfe.find(Q8(t)),FL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],dfe=V2.length;class hfe{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=ok,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=Vy(n),this.isVariantNode=p8(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),Zy(c)&&c.add(d))}}mount(e){this.current=e,BL.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)),LL.current||lfe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Fk.current,process.env.NODE_ENV!=="production"&&Sk(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(){BL.delete(this.current),this.projection&&this.projection.unmount(),Yi(this.notifyUpdate),Yi(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<FL.length;r++){const s=FL[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=ufe(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<dfe;r++){const s=V2[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"&&($8(s)||z8(s))?s=parseFloat(s):!ffe(s)&&fa.test(n)&&(s=oI(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=Y2(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 Ck),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class jL extends hfe{constructor(){super(...arguments),this.KeyframeResolver=aI}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 pfe(t){return window.getComputedStyle(t)}class mfe extends jL{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(Bl.has(n)){const r=fk(n);return r&&r.default||0}else{const r=pfe(e),s=(w8(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return iL(e,n)}build(e,n,r,s){W2(e,n,r,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return J2(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){T8(e,n,r,s)}}class gfe extends jL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Bl.has(n)){const r=fk(n);return r&&r.default||0}return n=D8.has(n)?n:F2(n),e.getAttribute(n)}measureInstanceViewportBox(){return qt()}scrapeMotionValuesFromProps(e,n,r){return _8(e,n,r)}build(e,n,r,s){q2(e,n,r,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,r,s){O8(e,n,r,s)}mount(e){this.isSVGTag=Q2(e.tagName),super.mount(e)}}const yfe=(t,e)=>z2(t)?new gfe(e,{enableHardwareAcceleration:!1}):new mfe(e,{allowProjection:t!==N.Fragment,enableHardwareAcceleration:!0}),bfe={...nce,...ple,...afe,...{layout:{ProjectionNode:IL,MeasureLayout:uL}}},wfe=Eae((t,e)=>tle(t,e,bfe,yfe));function UL(){const t=N.useRef(!1);return B2(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Afe(){const t=UL(),[e,n]=N.useState(0),r=N.useCallback(()=>{t.current&&n(e+1)},[e]);return[N.useCallback(()=>pt.postRender(r),[r]),e]}class vfe extends V.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 xfe({children:t,isPresent:e}){const n=N.useId(),r=N.useRef(null),s=N.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=N.useContext(I2);return N.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(`
|
516
516
|
[data-motion-pop-id="${n}"] {
|
517
517
|
position: absolute !important;
|
518
518
|
width: ${o}px !important;
|