import{s as g}from"./chunk-BT7H_Nq3.js";const l=new URLSearchParams(location.search),t=l.get("name")??"",w=l.get("error")??"Unknown error",r=l.get("path")??"/",$=l.get("search")??"",y=l.get("hash")??"",E=/^0x[a-f0-9]{40}$/i,b=document.getElementById("reason"),u=document.getElementById("urlinput");b.textContent=w;const d=document.getElementById("ensHistory");t&&/^(?:[a-z0-9-]+\.)+eth$/.test(t)&&(d.href=`https://ens.eth.sh/history/${t}`,d.hidden=!1);document.title=t?`${t} · resolution failed`:"dapp3.eth · resolution failed";function k(){const n=`${r.startsWith("/")?r:`/${r}`}${$}${y}`;return E.test(t)?{url:`https://${t.toLowerCase()}.w3eth.io${n}`,gateway:"w3eth",label:"Open on w3eth.io →",description:"Open this contract on the public w3eth.io gateway instead. The content is fetched without local trust-minimized verification."}:/^(?:[a-z0-9-]+\.)+eth$/.test(t)?{url:`https://${t}.limo${n}`,gateway:"eth-limo",label:"Open on eth.limo →"}:/^(?:[a-z0-9-]+\.)+gwei$/.test(t)?{url:`https://${t}.domains${n}`,gateway:"gwei-domains",label:"Open on gwei.domains →",description:"Open this name on the public gwei.domains gateway instead. The content is fetched without local trust-minimized verification."}:null}const m=document.getElementById("fallback"),v=m.querySelector(".fallback-desc"),c=document.getElementById("ethlimo-link"),s=k();if(s){const e=s.url;c.href=e,c.textContent=s.label,s.description&&(v.textContent=s.description),m.hidden=!1,c.addEventListener("click",n=>{n.preventDefault();const o=s.gateway==="w3eth"?"open-on-w3eth":s.gateway==="gwei-domains"?"open-on-gwei-domains":"open-on-eth-limo";chrome.runtime.sendMessage({type:o,url:e}).catch(()=>{location.assign(e)})})}function p(e){const n=e.trim().replace(/^https?:\/\//i,"");if(!n)return null;const o=n.match(/^([^\/\?#]+)(.*)$/);if(!o||!o[1])return null;const h=o[1].toLowerCase(),a=o[2]||"/";if(!/^(?:[a-z0-9-]+\.)+(?:eth|gwei)$/.test(h))return null;const f=a.startsWith("/")||a.startsWith("?")||a.startsWith("#")?a:`/${a}`;return`http://${h}${f}`}const i=g(u,{placeholder:"name.eth or name.gwei",onSubmit:e=>{const n=p(e);if(!n){i.shake();return}location.assign(n)},onEscape:()=>{i.setValue(t),u.blur()}});i.setValue(t);document.getElementById("retry")?.addEventListener("click",()=>{const e=p(i.getValue());if(!e){i.shake();return}location.assign(e)});document.getElementById("settings")?.addEventListener("click",()=>{chrome.runtime.openOptionsPage()});
//# sourceMappingURL=error-CPh4Qio7.js.map
