var e,t;"function"==typeof(e=globalThis.define)&&(t=e,e=null),function(t,n,r,o,a){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof l[o]&&l[o],s=i.cache||{},u="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(e,n){if(!s[e]){if(!t[e]){var r="function"==typeof l[o]&&l[o];if(!n&&r)return r(e,!0);if(i)return i(e,!0);if(u&&"string"==typeof e)return u(e);var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}c.resolve=function(n){var r=t[e][1][n];return null!=r?r:n},c.cache={};var d=s[e]=new f.Module(e);t[e][0].call(d.exports,c,d,d.exports,this)}return s[e].exports;function c(e){var t=c.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=t,f.cache=s,f.parent=i,f.register=function(e,n){t[e]=[function(e,t){t.exports=n},{}]},Object.defineProperty(f,"root",{get:function(){return l[o]}}),l[o]=f;for(var d=0;d<n.length;d++)f(n[d]);if(r){var c=f(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof e&&e.amd?e(function(){return c}):a&&(this[a]=c)}}({"6H374":[function(e,t,n){e("@parcel/transformer-js/src/esmodule-helpers.js").defineInteropFlag(n),console.log("Offscreen script loaded");let r={deepl:{url:"https://www.deepl.com/translator",iframe:null,tasks:{}},papago:{url:"https://papago.naver.com",iframe:null,tasks:{}}};chrome.runtime.onMessage.addListener((e,t,n)=>{if("offscreen"!==e.target&&"translateInOffscreen"!==e.name)return;console.log("Offscreen script received message:",e);let o=e.body,a=o.vendor;if(!r[a]){console.log("vendor invalid",a);return}null==r[a].iframe&&function(e){let t=document.createElement("iframe");t.referrerPolicy="no-referrer",t.src=r[e].url,t.width="800px",t.height="400px",document.body.appendChild(t),r[e].iframe=t}(a);let l=Math.floor(1e5+9e5*Math.random()),i=setInterval(()=>{r[a].iframe.contentWindow.postMessage({name:"startTranslate",id:l,text:o.text,sourceLanguage:o.sourceLanguage,targetLanguage:o.targetLanguage},"*")},200);return r[a].tasks[l]={intervalId:i,sendReponseFun:n},!0}),window.addEventListener("message",function(e){if(console.log("content script recieve postMessage",e),null!=e.data&&void 0!=e.data&&"translateResult"===e.data.name){let t=e.data.body,n=r[t.vendor].tasks[t.id];if(n){console.log("\u7ffb\u8bd1\u7ed3\u679cddd",t.text),clearInterval(n.intervalId);let e=n.sendReponseFun;e({code:0,body:{text:t.text}}),delete r[t.vendor].tasks[t.id]}}})},{"@parcel/transformer-js/src/esmodule-helpers.js":"hbR2Q"}],hbR2Q:[function(e,t,n){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||t.hasOwnProperty(n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["6H374"],"6H374","parcelRequireefb9"),globalThis.define=t;