self.proxy=(()=>{const r={};return chrome.runtime.onMessage.addListener(((e,o,n)=>(Promise.resolve().then((()=>{const{command:o,params:n}=e,t=r[o];if("function"!=typeof t)throw new Error("handler not found for command: "+o);return t(n)})).then((r=>n(r))).catch((r=>{n({errmsg:r})})),!0))),{invoke:(r,e)=>new Promise(((o,n)=>{chrome.runtime.sendMessage({command:r,params:e},(r=>{r&&r.error?n(r.error):o(r)}))})),on:(e,o)=>{if("function"!=typeof o)throw new Error("callback should be function");r[e]=o}}})();