"use strict";var pe=Object.create;var x=Object.defineProperty;var ce=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var me=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var he=(r,e)=>{for(var s in e)x(r,s,{get:e[s],enumerable:!0})},z=(r,e,s,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fe(e))!de.call(r,i)&&i!==s&&x(r,i,{get:()=>e[i],enumerable:!(t=ce(e,i))||t.enumerable});return r};var f=(r,e,s)=>(s=r!=null?pe(me(r)):{},z(e||!r||!r.__esModule?x(s,"default",{value:r,enumerable:!0}):s,r)),ge=r=>z(x({},"__esModule",{value:!0}),r);var Se={};he(Se,{default:()=>ue});module.exports=ge(Se);var J=require("crypto"),K=require("fs"),I=f(require("path")),H=require("vite");function d(...r){let e=r.join("/"),s=(0,H.normalizePath)(I.default.normalize(e)),{dir:t="",name:i,ext:n}=I.default.parse(s),o=`${t}/${i}`.replace(/^\/+/,"");return{name:o,path:o+n}}function U(r,e=!1){if(r&&(e||(0,K.existsSync)(r)))return r}function u(r,e,s=!1){r=(0,H.normalizePath)(r);let t=d(r).name,i={S:e?.root&&d(e.root,r).path,P:e?.publicDir&&d(e.publicDir,r).path};return{inputFile:U(i.S,s),publicFile:U(i.P,s),outputFile:t}}function O(r){return/[^*]+.html$/.test(r)}function Y(r,e=8){return(0,J.createHash)("sha256").update(r).digest("hex").substring(0,e)}function G(r,e){let s=e.map(t=>``).join("");return{fileName:`${r}.html`,source:`
${s}`}}function m(r,e){let s=Y(r,6),t=e.startsWith("http")?`'${e}'`:`(chrome??browser).runtime.getURL("${e}")`;return{fileName:`assets/js/_cs.${s}.js`,source:`(async()=>{await import(${t})})();`}}function E(r){return{fileName:"assets/js/_sw.js",source:`import "${r.startsWith("http")?`${r}`:`/${r}`}";`}}function Q(r,e){return!e.imports.length&&!e.dynamicImports.length?{fileName:e.fileName}:m(r,e.fileName)}function X(r,e){return!e.imports.length&&!e.dynamicImports.length?{fileName:r,source:e.code}:m(r,e.fileName)}function q(r,e){let s=we(e);return r.forEach(([t,i])=>s[t]=i),s}function we(r){if(typeof r=="string")return r.trim()?{[r]:r}:{};if(r instanceof Array){if(!r.length)return{};let e={};return r.forEach(s=>e[s]=s),e}return r??{}}function v(r,e){let s=d(e).path;return Object.values(r).find(t=>t.type==="asset"?!1:t.facadeModuleId?.endsWith(s)||t.fileName.endsWith(s))}function Z(r,e){let s=d(e).name+".css";return Object.values(r).find(t=>{if(t.type==="chunk")return;let i=t.name??t.fileName;return/\.(s?[ca]ss)$/.test(i)?s.endsWith(t.name??t.fileName):!1})}var W=f(require("path"));var ee=require("vite");function te(r,e){let{manifest:s,useHashedFileName:t}=e,i=s.manifest_version;r.build??={},r.build.target||(i===2&&(r.build.target=["chrome64","firefox89"]),i===3&&(r.build.target=["chrome91"])),r.build.outDir??=W.default.resolve(process.cwd(),".extension");let n=r.build.outDir;r.build.minify??=!0,r.build.emptyOutDir??=!0,r.build.modulePreload??=!1,r.build.rollupOptions??={},r.build.rollupOptions.input??={},r.optimizeDeps??={},r.optimizeDeps.exclude??=[],r.optimizeDeps.exclude?.push("/@vite/client"),r.build.rollupOptions.output??={},r.server??={},(r.server.hmr===!0||!r.server.hmr)&&(r.server.hmr={}),r.server.hmr.protocol="ws",r.server.hmr.host="localhost";let o=r.build.rollupOptions.output;function a(l){let{name:p,type:S}=l;if(!p)return;let k=W.default.parse(p).name;return S==="chunk"?`assets/js/${k}.[hash:6].js`:`assets/[ext]/${k}.[hash:6].[ext]`}return t&&!Array.isArray(o)&&(o.assetFileNames??=a,o.chunkFileNames??=a,o.entryFileNames??=a),r}function N(r){return(0,ee.createFilter)(r?.include||/\.(([cem]?js|ts)|(s?[ca]ss))$/,r?.exclude||"",r?.options)}var se=new Map;function re(r,e){se.set(r,e)}function b(r){return se.get(r)??null}var h=class{constructor(e,s){this.options=e;this.viteConfig=s;if(this.options.manifest.version==="DATE"){let t=new Date,i=[t.getFullYear().toString().slice(2),t.getMonth()+1,t.getDate()].join(".");this.options.manifest.version=i}this.inputManifest=JSON.parse(JSON.stringify(this.options.manifest)),this.WasFilter=N(this.options.webAccessibleScripts)}inputManifest;WasFilter;devServer;parseChunkIds=new Set;async parseInput(){let e={manifest:this.inputManifest,inputScripts:[],emitFiles:[]};return this.pipe(e,this.parseInputHtml,this.parseInputCs,this.parseInputWas,this.parseInputSw,...this.getParseInputMethods())}async writeDevBuild(e){await this.createDevBuilder().writeBuild({devServerPort:e,htmlFiles:this.getHtmlFiles(this.inputManifest)})}async parseOutput(e){let s={inputScripts:[],emitFiles:[],manifest:this.inputManifest};s=await this.parseOutputWas(s,e),s=await this.parseOutputCs(s,e);for(let t of this.getParseOutputMethods())s=await t(s,e);return s.emitFiles.push({type:"asset",fileName:"manifest.json",source:JSON.stringify(s.manifest,null,2)}),s}setDevServer(e){this.devServer=e}parseInputHtml(e){return this.getHtmlFiles(e.manifest).forEach(s=>this.parseInputHtmlFile(s,e)),e}parseInputCs(e){return e.manifest.content_scripts?.forEach(s=>{[...s.js??[],...s.css??[]]?.forEach(i=>{let{inputFile:n,outputFile:o}=u(i,this.viteConfig);n&&e.inputScripts.push([o,n])})}),e}parseInputHtmlFile(e,s){if(!e)return s;let{inputFile:t,outputFile:i}=u(e,this.viteConfig);return t&&s.inputScripts.push([i,t]),s}parseOutputCss(e,s){let t=Z(s,e);if(!t)throw new Error(`Failed to find CSS asset info for ${e}`);return{file:t.fileName}}parseOutputJs(e,s,t){let{inputFile:i,publicFile:n}=u(e,this.viteConfig);if(!i)return;if(n)return{waFiles:new Set([n])};let o=v(t,i);if(!o)throw new Error(`Failed to find chunk info for ${i}`);let a=Q(e,o);a.source&&s.emitFiles.push({type:"asset",fileName:a.fileName,source:a.source});let l=this.getMetadata(o.fileName,t,!!a.source);return o.code=o.code.replace(new RegExp("import.meta.CURRENT_CHUNK_CSS_PATHS","g"),`[${[...l.css].map(p=>JSON.stringify(p)).join(",")}]`),{fileName:a.fileName,waFiles:new Set([...l.assets,...l.css])}}parseOutputWaScript(e,s,t){let i=v(t,e);if(console.log({chunkInfo:i,file:e}),!i)throw new Error(`Failed to find chunk info for ${e}`);let n=X(e,i);s.emitFiles.push({type:"asset",fileName:n.fileName,source:n.source});let o=this.getMetadata(i.fileName,t,!!n.source);return i.code=i.code.replace(new RegExp("import.meta.CURRENT_CHUNK_CSS_PATHS","g"),`[${[...o.css].map(a=>`"${a}"`).join(",")}]`),{scriptFileName:n.fileName,webAccessibleFiles:new Set([...o.assets,...o.css])}}pipe(e,...s){return s.reduce((t,i)=>i.call(this,t),e)}getMetadata(e,s,t,i=null){if(i===null&&(this.parseChunkIds.clear(),i={css:new Set,assets:new Set}),this.parseChunkIds.has(e))return i;let n=v(s,e);return n&&(t&&i.assets.add(n.fileName),n.viteMetadata.importedCss.forEach(i.css.add,i.css),n.viteMetadata.importedAssets.forEach(i.assets.add,i.assets),this.parseChunkIds.add(e),n.imports.forEach(o=>{i=this.getMetadata(o,s,!0,i)}),n.dynamicImports.forEach(o=>{i=this.getMetadata(o,s,!0,i)})),i}parseInputSw(e){if(!e.manifest.background?.scripts)return e;let s=G("background",e.manifest.background.scripts.map(o=>o.replace(/^\.\//,"/"))),t=s.fileName,{inputFile:i,outputFile:n}=u(t,this.viteConfig,!0);return i&&(e.inputScripts.push([n,i]),re(i,s.source)),delete e.manifest.background.scripts,e.manifest.background.page=s.fileName,e}};var ne=f(require("crypto")),oe=require("fs/promises"),ae=f(require("path"));var w=require("fs/promises"),g=f(require("path"));var c=require("fs-extra"),T=require("vite"),y=class{constructor(e,s,t,i){this.viteConfig=e;this.options=s;this.devServer=t;this.manifest=i;this.outDir=g.default.resolve(process.cwd(),this.viteConfig.root,this.viteConfig.build.outDir),this.WasFilter=N(this.options.webAccessibleScripts)}hmrServer="";hmrViteClient="";scriptHashes=new Set;outDir;WasFilter;async writeBuild({devServerPort:e,htmlFiles:s}){this.hmrServer=this.getHmrServer(e),this.hmrViteClient=`${this.hmrServer}/@vite/client`,await(0,c.emptyDir)(this.outDir);let t=g.default.resolve(process.cwd(),this.viteConfig.root,this.viteConfig.publicDir);await(0,c.pathExists)(t)&&await(0,c.copy)(t,this.outDir),await this.writeOutputHtml(s),await this.writeOutputScripts(),await this.writeOutputCss(),await this.writeOutputWas(this.WasFilter),await this.writeBuildFiles(s),this.updateCSP(),await(0,w.writeFile)(`${this.outDir}/manifest.json`,JSON.stringify(this.manifest,null,2))}async writeBuildFiles(e){}async writeOutputHtml(e){for(let s of e){let{inputFile:t}=u(s,this.viteConfig);t&&(await this.writeManifestHtmlFile(s,t),this.devServer.watcher.on("change",async i=>{(0,T.normalizePath)(i)===t&&await this.writeManifestHtmlFile(s,t)}))}}async writeManifestHtmlFile(e,s){let t=b(s);t??=await(0,w.readFile)(s,{encoding:"utf-8"}),t=await this.devServer.transformIndexHtml(e,t);let n=``,o=//ims;t=t.match(o)?t.replace(o,`$&${n}`):t.replace(//ims,`$&${n}`),this.parseScriptHashes(t);let a=`${this.outDir}/${e}`,l=g.default.dirname(a);return await(0,c.ensureDir)(l),await(0,w.writeFile)(a,t),e}parseScriptHashes(e){}async writeOutputScripts(){let e=this.manifest.content_scripts;if(e){for(let[s,t]of e.entries())if(t.js)for(let[i,n]of t.js.entries()){let{outputFile:o}=u(n),a=m(o,`${this.hmrServer}/${n}`);e[s].js[i]=a.fileName;let l=`${this.outDir}/${a.fileName}`,p=g.default.dirname(l);await(0,c.ensureDir)(p),await(0,w.writeFile)(l,a.source)}}}async writeOutputCss(){let e=this.manifest.content_scripts;if(e){for(let[s,t]of e.entries())if(t.css)for(let[i,n]of t.css.entries()){let{inputFile:o,outputFile:a}=u(n,this.viteConfig),l=a+".css";o&&(e[s].css[i]=l,await this.writeManifestCssFile(l,o),this.devServer.watcher.on("change",async p=>{(0,T.normalizePath)(p)===o&&await this.writeManifestCssFile(l,n)}))}}}async writeManifestCssFile(e,s){let i=(await this.devServer.ssrLoadModule(s)).default,n={fileName:e,source:i},o=`${this.outDir}/${n.fileName}`,a=g.default.dirname(o);await(0,c.ensureDir)(a),await(0,w.writeFile)(o,n.source)}getHmrServer(e){if(typeof this.viteConfig.server.hmr=="boolean")throw new Error("Vite HMR is misconfigured");return`http://${this.viteConfig.server.hmr.host}:${e}`}};var D=class r{static DIRECTIVE_ORDER={"default-src":0,"script-src":1,"object-src":2};data={};constructor(e){if(e){let s=e.split(";").map(t=>t.trim());this.data=s.reduce((t,i)=>{let[n,...o]=i.split(" ").map(a=>a.trim());return n&&(t[n]=o),t},{})}}add(e,...s){let t=this.data[e]??[];return s.forEach(i=>{t.includes(i)||t.push(i)}),this.data[e]=t,this}toString(){return Object.entries(this.data).sort(([s],[t])=>{let i=r.DIRECTIVE_ORDER[s]??2,n=r.DIRECTIVE_ORDER[t]??2;return i-n}).map(s=>s.flat().join(" ")).join("; ")+";"}};var B=f(require("etag"));function ie(r,e,s){let t=e.end;e.end=function(n,...o){if(r.url==="/@vite/client"&&typeof n=="string"){if(!/const sheetsMap/.test(n)||!/document\.head\.appendChild\(style\)/.test(n)||!/document\.head\.removeChild\(style\)/.test(n)||!/style\.textContent = content/.test(n)&&!/style\.innerHTML = content/.test(n))return console.error("Content script HMR style support disabled -- failed to rewrite vite client"),e.setHeader("Etag",(0,B.default)(n,{weak:!0})),t.call(this,n,...o);n=n.replace("const sheetsMap","const styleTargets = new Set(); const styleTargetsStyleMap = new Map(); const sheetsMap"),n=n.replace("export {","export { addStyleTarget, "),n=n.replace("document.head.appendChild(style)","styleTargets.size ? styleTargets.forEach(target => addStyleToTarget(style, target)) : document.head.appendChild(style)"),n=n.replace("document.head.removeChild(style)","styleTargetsStyleMap.get(style) ? styleTargetsStyleMap.get(style).forEach(style => style.parentNode.removeChild(style)) : document.head.removeChild(style)");let a=/style\.textContent = content/.test(n)?"style.textContent":"style.innerHTML",l=n.lastIndexOf(`${a} = content`);n=n.slice(0,l)+n.slice(l).replace(`${a} = content`,`${a} = content; styleTargetsStyleMap.get(style)?.forEach(style => ${a} = content)`),n+=`
function addStyleTarget(newStyleTarget) {
for (const [, style] of sheetsMap.entries()) {
addStyleToTarget(style, newStyleTarget, styleTargets.size !== 0);
}
styleTargets.add(newStyleTarget);
}
function addStyleToTarget(style, target, cloneStyle = true) {
const addedStyle = cloneStyle ? style.cloneNode(true) : style;
target.appendChild(addedStyle);
styleTargetsStyleMap.set(style, [...(styleTargetsStyleMap.get(style) ?? []), addedStyle]);
}
`,e.setHeader("Etag",(0,B.default)(n,{weak:!0}))}return t.call(this,n,...o)},s()}var $=r=>{let e=new D(r);return e.add("object-src","'self'"),e.add("script-src","'self'","http://localhost:*","http://127.0.0.1:*"),e.toString()};var le=require("fs-extra"),M=class extends y{updateCSP(){let e=this.manifest.content_security_policy;this.manifest.content_security_policy=$(e)}parseScriptHashes(e){let s=e.matchAll(/([^<]+)<\/script>/gis);for(let t of s){let i=ne.default.createHash("sha256");i.update(t[1]),this.scriptHashes.add(`'sha256-${i.digest("base64")}'`)}}async writeOutputWas(e){if(this.manifest.web_accessible_resources)for(let[s,t]of this.manifest.web_accessible_resources.entries()){if(!t||!e(t))continue;let{outputFile:i}=u(t),n=m(i,`${this.hmrServer}/${t}`);this.manifest.web_accessible_resources[s]=n.fileName;let o=`${this.outDir}/${n.fileName}`,a=ae.default.dirname(o);await(0,le.ensureDir)(a),await(0,oe.writeFile)(o,n.source)}}};var R=class extends h{createDevBuilder(){return new M(this.viteConfig,this.options,this.devServer,this.inputManifest)}getHtmlFiles(e){let s=[e.background?.page,e.browser_action?.default_popup,e.options_ui?.page,e.devtools_page,e.chrome_url_overrides?.newtab,e.chrome_url_overrides?.history,e.chrome_url_overrides?.bookmarks];return e.web_accessible_resources?.filter(O).forEach(t=>{s.push(t)}),s.filter(t=>typeof t=="string")}getParseInputMethods(){return[]}getParseOutputMethods(){return[this.parseWatchMode.bind(this)]}parseInputWas(e){return e.manifest.web_accessible_resources?.forEach(s=>{if(s.includes("*"))return;let{inputFile:t,outputFile:i}=u(s,this.viteConfig);t&&this.WasFilter(t)&&e.inputScripts.push([i,t])}),e}async parseOutputCs(e,s){let t=new Set(e.manifest.web_accessible_resources??[]);return e.manifest.content_scripts?.forEach(i=>{i.js?.forEach((n,o)=>{let a=this.parseOutputJs(n,e,s);a?.fileName&&(i.js[o]=a.fileName),a?.waFiles.forEach(t.add,t)}),i.css?.forEach((n,o)=>{let a=this.parseOutputCss(n,s);i.css[o]=a.file,t.add(a.file)})}),t.size>0&&(e.manifest.web_accessible_resources=Array.from(t)),e}async parseOutputWas(e,s){if(!e.manifest.web_accessible_resources)return e;for(let t of e.manifest.web_accessible_resources){if(t.includes("*")||!this.WasFilter(t))continue;let i=this.parseOutputWaScript(t,e,s);e.manifest.web_accessible_resources=[...e.manifest.web_accessible_resources,...i.webAccessibleFiles]}return e}async parseWatchMode(e){return e.manifest.web_accessible_resources&&e.manifest.web_accessible_resources.length>0&&this.viteConfig.build.watch&&e.manifest.web_accessible_resources.push("*.js"),e}};var V=require("fs/promises"),j=f(require("path"));var A=require("fs-extra"),F=class extends y{updateCSP(){this.manifest.content_security_policy??={};let e=this.manifest.content_security_policy.extension_pages;this.manifest.content_security_policy.extension_pages=$(e)}async writeBuildFiles(){await this.writeManifestSW(this.manifest)}async writeManifestSW(e){if(!e.background?.service_worker)return;let s=e.background?.service_worker,t=E(`${this.hmrServer}/${s}`);e.background.service_worker=t.fileName;let i=`${this.outDir}/${t.fileName}`,n=j.default.dirname(i);await(0,A.ensureDir)(n),await(0,V.writeFile)(i,t.source)}async writeOutputWas(e){let s=this.manifest.web_accessible_resources;if(s){for(let[t,i]of s.entries())if(!(!i||!i.resources.length))for(let[n,o]of i.resources.entries()){if(!e(o))continue;let{outputFile:a}=u(o),l=m(a,`${this.hmrServer}/${o}`);s[t].resources[n]=l.fileName;let p=`${this.outDir}/${l.fileName}`,S=j.default.dirname(p);await(0,A.ensureDir)(S),await(0,V.writeFile)(p,l.source)}}}};var C=class extends h{createDevBuilder(){return new F(this.viteConfig,this.options,this.devServer,this.inputManifest)}getHtmlFiles(e){let s=[e.action?.default_popup,e.options_ui?.page,e.devtools_page,e.chrome_url_overrides?.newtab,e.chrome_url_overrides?.history,e.chrome_url_overrides?.bookmarks];return e.web_accessible_resources?.forEach(({resources:t})=>{t.filter(O).forEach(i=>s.push(i))}),s.filter(t=>typeof t=="string")}getParseInputMethods(){return[this.parseInputBackground]}getParseOutputMethods(){return[this.parseOutputSw]}parseInputBackground(e){if(!e.manifest.background?.service_worker)return e;let s=e.manifest.background?.service_worker,{inputFile:t,outputFile:i}=u(s,this.viteConfig);return t&&(e.inputScripts.push([i,t]),e.manifest.background.type="module"),e}parseInputWas(e){return e.manifest.web_accessible_resources?.forEach(s=>{s.resources.forEach(t=>{if(t.includes("*"))return;let{inputFile:i,outputFile:n}=u(t,this.viteConfig);i&&this.WasFilter(i)&&e.inputScripts.push([n,i])})}),e}async parseOutputCs(e,s){let t=new Set(e.manifest.web_accessible_resources??[]);return e.manifest.content_scripts?.forEach(i=>{let n=new Set([]);i.js?.forEach((o,a)=>{let l=this.parseOutputJs(o,e,s);l?.fileName&&(i.js[a]=l.fileName),l?.waFiles.forEach(n.add,n)}),i.css?.forEach((o,a)=>{let l=this.parseOutputCss(o,s);i.css[a]=l.file,n.add(l.file)}),n.size>0&&t.add({matches:i.matches.map(o=>{let a=/[^:\/]\//.exec(o);if(!a)return o;let l=o.slice(a.index+1);return["/","/*"].includes(l)?o:o.replace(l,"/*")}),resources:Array.from(n),use_dynamic_url:this.options.useDynamicUrl||void 0})}),t.size>0&&(e.manifest.web_accessible_resources=Array.from(t)),e}async parseOutputWas(e,s){if(!e.manifest.web_accessible_resources)return e;for(let t of e.manifest.web_accessible_resources)if(t.resources)for(let i of t.resources){if(i.includes("*")||!this.WasFilter(i))continue;let n=this.parseOutputWaScript(i,e,s);n.webAccessibleFiles.size&&(t.resources=[...t.resources,...n.webAccessibleFiles])}return e}async parseOutputSw(e,s){let t=e.manifest.background?.service_worker;if(!t)return e;let i=v(s,t);if(!i)throw new Error(`Failed to find chunk info for ${t}`);let n=E(i.fileName);return e.manifest.background.service_worker=n.fileName,e.emitFiles.push({type:"asset",fileName:n.fileName,source:n.source}),e}};var _=class{static getParser(e,s){switch(e.manifest.manifest_version){case 2:return new R(e,s);case 3:return new C(e,s);default:throw new Error(`No parser available for manifest_version ${manifest.manifest_version??0}`)}}};var L=f(require("magic-string"));function ye(r){let e=r.includes("new URL"),s=r.includes("self.location");if(!e||!s)return null;let t=null,i=/\bnew\s+URL\s*\(\s*('[^']+'|"[^"]+"|`[^`]+`)\s*,\s*self\.location\s*\)/g,n;for(;n=i.exec(r);){let{0:o,index:a}=n;t||(t=new L.default(r));let l=a,p=a+o.length,S=o.replace("self.location","import.meta.url");t.overwrite(l,p,S)}return t}function ve(r,e){let s=e?.endsWith("tsx")||e?.endsWith("jsx"),t=r?.includes('RefreshRuntime from "/@react-refresh"');return!r||!s&&!t?null:(r=`try {
RefreshRuntime.injectIntoGlobalHook(window);
window.$RefreshReg$ = () => {};
window.$RefreshSig$ = () => (type) => type;
window.__vite_plugin_react_preamble_installed__ = true;
} catch {}`+r,new L.default(r))}var P=class{file;code;updatedCode=null;map;constructor(e,s){this.code=e,this.file=s?.toLowerCase(),this.map=null}convertImports(){return this.updatedCode=ye(this.code),this}enableReactHMR(e,s){return s==="DEV"&&e.useDynamicUrl&&(this.updatedCode=ve(this.code,this.file)),this}run(e){if(!this.updatedCode)return null;let s=e.build.sourcemap;return{code:this.updatedCode.toString(),map:s?this.updatedCode.generateMap({hires:!0}):null}}};function ue(r){if(r.useReactHMR??=!0,r.useDynamicUrl??=!0,r.useHashedFileName??=!0,!r.manifest)throw new Error("Missing manifest definition");let e="BUILD",s,t=[],i;return{name:"webExtension",enforce:"post",config:(n,o)=>(o.command==="serve"?e="DEV":n.build?.watch&&(e="WATCH"),te(n,r)),configResolved:n=>{s=n},configureServer:n=>{n.middlewares.use(ie),n.httpServer.once("listening",()=>{i.setDevServer(n),i.writeDevBuild(n.config.server.port)})},async options(n){i=_.getParser(r,s);let{inputScripts:o,emitFiles:a}=await i.parseInput();return n.input=q(o,n.input),t=t.concat(a),n},buildStart:function(){t.forEach(n=>{this.emitFile(n),n.fileName&&this.addWatchFile(n.fileName)}),t=[]},load:b,resolveId:n=>b(n)?n:null,transform:(n,o)=>new P(n,o).convertImports().enableReactHMR(r,e).run(s),generateBundle:async function(n,o){let{emitFiles:a}=await i.parseOutput(o);a.forEach(this.emitFile)}}}