(()=>{const e="worldland-wallet-content-script",o="provider-request",r="provider-response",t="provider-event";!function(){try{const e=document.createElement("script");e.src=chrome.runtime.getURL("inpage.js"),e.onload=()=>e.remove(),(document.head||document.documentElement).appendChild(e)}catch(e){console.error("[WorldLand Wallet] Failed to inject inpage script:",e)}}(),window.addEventListener("message",t=>{if(t.source!==window)return;if(!t.data||"worldland-wallet-inpage"!==t.data.source)return;const{type:n,payload:a}=t.data;n===o&&chrome.runtime.sendMessage({source:e,type:o,payload:a,origin:window.location.origin}).then(o=>{window.postMessage({source:e,type:r,payload:{id:a.id,result:o.result,error:o.error}},"*")}).catch(o=>{window.postMessage({source:e,type:r,payload:{id:a.id,error:{code:-32603,message:o.message||"Internal error"}}},"*")})}),chrome.runtime.onMessage.addListener((o,r,n)=>{"worldland-wallet-background"===o.source&&o.type===t&&window.postMessage({source:e,type:t,payload:o.payload},"*")}),console.log("[WorldLand Wallet] Content script loaded")})();