extension-develop 2.0.0-rc.11 → 2.0.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.js +2 -2
- package/dist/run-chrome-profile/Default/Bookmarks +47 -0
- package/dist/run-chrome-profile/Default/BrowsingTopicsState +1 -1
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/0aec0caf66c01b86_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/15145040f7f12f31_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/6995a7c799490d3d_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/93d81321f8c35eab_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/e85ac8952d7783d7_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/index-dir/the-real-index +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/c9a2d8e6c9cf4f2e_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/index-dir/the-real-index +0 -0
- package/dist/run-chrome-profile/Default/Cookies +0 -0
- package/dist/run-chrome-profile/Default/DIPS +0 -0
- package/dist/run-chrome-profile/Default/DIPS-shm +0 -0
- package/dist/run-chrome-profile/Default/DIPS-wal +0 -0
- package/dist/run-chrome-profile/Default/DawnGraphiteCache/data_1 +0 -0
- package/dist/run-chrome-profile/Default/DawnGraphiteCache/index +0 -0
- package/dist/run-chrome-profile/Default/DawnWebGPUCache/data_1 +0 -0
- package/dist/run-chrome-profile/Default/DawnWebGPUCache/index +0 -0
- package/dist/run-chrome-profile/Default/Extension Rules/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Extension Rules/LOG +3 -3
- package/dist/run-chrome-profile/Default/Extension Rules/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/Extension Scripts/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Extension Scripts/LOG +3 -3
- package/dist/run-chrome-profile/Default/Extension Scripts/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/Extension State/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Extension State/LOG +3 -3
- package/dist/run-chrome-profile/Default/Extension State/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/GPUCache/data_1 +0 -0
- package/dist/run-chrome-profile/Default/GPUCache/index +0 -0
- package/dist/run-chrome-profile/Default/History +0 -0
- package/dist/run-chrome-profile/Default/Local Extension Settings/lbffejbpcfhhlobfihahkjacidchbokb/LOG +3 -2
- package/dist/run-chrome-profile/Default/Local Extension Settings/lbffejbpcfhhlobfihahkjacidchbokb/LOG.old +3 -2
- package/dist/run-chrome-profile/Default/Local Extension Settings/pbpgonifamlpcahjkkkfelffkegofkgg/LOG +3 -3
- package/dist/run-chrome-profile/Default/Local Extension Settings/pbpgonifamlpcahjkkkfelffkegofkgg/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/000004.log +0 -0
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/LOG +3 -3
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/Network Persistent State +1 -1
- package/dist/run-chrome-profile/Default/Platform Notifications/LOG +3 -3
- package/dist/run-chrome-profile/Default/Platform Notifications/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/Preferences +1 -1
- package/dist/run-chrome-profile/Default/Reporting and NEL and b/package/dist/run-chrome-profile/Default/Reporting → NEL +0 -0
- package/dist/run-chrome-profile/Default/Secure Preferences +1 -1
- package/dist/run-chrome-profile/Default/Service Worker/Database/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/Database/LOG +3 -3
- package/dist/run-chrome-profile/Default/Service Worker/Database/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/{f0de8c2de34c385b_0 → a3a9a1aacbefa878_0} +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/{d0757ff92c7cde0a_1 → a3a9a1aacbefa878_1} +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/index-dir/the-real-index +0 -0
- package/dist/run-chrome-profile/Default/Session Storage/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Session Storage/LOG +3 -3
- package/dist/run-chrome-profile/Default/Session Storage/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/Sessions/Session_13388427877535872 +0 -0
- package/dist/run-chrome-profile/Default/Sessions/Session_13388431596515267 +0 -0
- package/dist/run-chrome-profile/Default/Sessions/{Tabs_13388398308445577 → Tabs_13388427877745836} +0 -0
- package/dist/run-chrome-profile/Default/Sessions/{Tabs_13388399452120535 → Tabs_13388431596727425} +0 -0
- package/dist/run-chrome-profile/Default/SharedStorage-wal +0 -0
- package/dist/run-chrome-profile/Default/Site Characteristics Database/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Site Characteristics Database/LOG +3 -3
- package/dist/run-chrome-profile/Default/Site Characteristics Database/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/Sync Data/LevelDB/LOG +3 -3
- package/dist/run-chrome-profile/Default/Sync Data/LevelDB/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/TransportSecurity +1 -1
- package/dist/run-chrome-profile/Default/WebStorage/QuotaManager +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/000005.log +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/LOG +3 -3
- package/dist/run-chrome-profile/Default/shared_proto_db/LOG.old +3 -3
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/000003.log +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/LOG +3 -3
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/LOG.old +3 -3
- package/dist/run-chrome-profile/GrShaderCache/data_1 +0 -0
- package/dist/run-chrome-profile/GrShaderCache/index +0 -0
- package/dist/run-chrome-profile/GraphiteDawnCache/data_0 +0 -0
- package/dist/run-chrome-profile/GraphiteDawnCache/data_1 +0 -0
- package/dist/run-chrome-profile/GraphiteDawnCache/data_2 +0 -0
- package/dist/run-chrome-profile/GraphiteDawnCache/data_3 +0 -0
- package/dist/run-chrome-profile/GraphiteDawnCache/index +0 -0
- package/dist/run-chrome-profile/Local State +1 -1
- package/dist/run-chrome-profile/ShaderCache/data_1 +0 -0
- package/dist/run-chrome-profile/ShaderCache/index +0 -0
- package/dist/run-chrome-profile/Variations +1 -1
- package/dist/run-chrome-profile/first_party_sets.db +0 -0
- package/dist/run-chrome-profile/segmentation_platform/ukm_db +0 -0
- package/package.json +1 -1
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/035aa9dff41235ca_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/035aa9dff41235ca_1 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/12cdfa32ed4ab86f_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/12cdfa32ed4ab86f_1 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/3611322d56d42e81_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/3611322d56d42e81_1 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/7b4fd8111178d5b1_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/7b4fd8111178d5b1_1 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/d0757ff92c7cde0a_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/f0de8c2de34c385b_1 +0 -0
- package/dist/run-chrome-profile/Default/Sessions/Session_13388398308262463 +0 -0
- package/dist/run-chrome-profile/Default/Sessions/Session_13388399451909448 +0 -0
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Kc=Object.create;var Ke=Object.defineProperty;var Yc=Object.getOwnPropertyDescriptor;var Qc=Object.getOwnPropertyNames;var el=Object.getPrototypeOf,tl=Object.prototype.hasOwnProperty;var sl=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rl=(t,e)=>{for(var s in e)Ke(t,s,{get:e[s],enumerable:!0})},Cr=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Qc(e))!tl.call(t,n)&&n!==s&&Ke(t,n,{get:()=>e[n],enumerable:!(r=Yc(e,n))||r.enumerable});return t};var a=(t,e,s)=>(s=t!=null?Kc(el(t)):{},Cr(e||!t||!t.__esModule?Ke(s,"default",{value:t,enumerable:!0}):s,t)),nl=t=>Cr(Ke({},"__esModule",{value:!0}),t);var Os=sl((ip,il)=>{il.exports={license:"MIT",repository:{type:"git",url:"https://github.com/cezaraugusto/extension.git",directory:"programs/develop"},engines:{node:">=18"},name:"extension-develop",version:"2.0.0-rc.
|
|
1
|
+
"use strict";var Kc=Object.create;var Ke=Object.defineProperty;var Yc=Object.getOwnPropertyDescriptor;var Qc=Object.getOwnPropertyNames;var el=Object.getPrototypeOf,tl=Object.prototype.hasOwnProperty;var sl=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rl=(t,e)=>{for(var s in e)Ke(t,s,{get:e[s],enumerable:!0})},Cr=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Qc(e))!tl.call(t,n)&&n!==s&&Ke(t,n,{get:()=>e[n],enumerable:!(r=Yc(e,n))||r.enumerable});return t};var a=(t,e,s)=>(s=t!=null?Kc(el(t)):{},Cr(e||!t||!t.__esModule?Ke(s,"default",{value:t,enumerable:!0}):s,t)),nl=t=>Cr(Ke({},"__esModule",{value:!0}),t);var Os=sl((ip,il)=>{il.exports={license:"MIT",repository:{type:"git",url:"https://github.com/cezaraugusto/extension.git",directory:"programs/develop"},engines:{node:">=18"},name:"extension-develop",version:"2.0.0-rc.13",description:"The develop step of Extension.js",main:"./dist/module.js",types:"./dist/module.d.ts",files:["dist"],author:{name:"Cezar Augusto",email:"boss@cezaraugusto.net",url:"https://cezaraugusto.com"},scripts:{clean:"rm -rf dist",watch:"tsup-node ./module.ts --format cjs --dts --target=node18 --watch",compile:"tsup-node ./module.ts --format cjs --dts --target=node18 --minify && bash install_scripts.sh",test:"jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.*'","test:coverage":"jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.ts' --coverage","test:build":"jest ./build.spec.ts --no-cache --detectOpenHandles --forceExit"},dependencies:{"@colors/colors":"^1.6.0","@rspack/core":"^1.2.8","@rspack/dev-server":"^1.1.0","@swc/helpers":"^0.5.15","@types/firefox-webext-browser":"^120.0.4","@vue/compiler-sfc":"^3.5.13","adm-zip":"^0.5.16",axios:"^1.7.9","case-sensitive-paths-webpack-plugin":"^2.4.0",chokidar:"^4.0.1","chrome-location":"^1.2.1","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","csv-loader":"^3.0.5",dotenv:"^16.4.7","dotenv-webpack":"^8.1.0","edge-location":"^1.0.0","firefox-profile":"^4.7.0","fx-runner":"^1.4.0","go-git-it":"2.0.4",ignore:"^6.0.2","loader-utils":"^3.3.1",micromatch:"^4.0.8","package-manager-detector":"^0.2.7",parse5:"^7.2.1","parse5-utils":"^2.0.0",postcss:"^8.4.49",preact:"^10.22.0",progress:"^2.0.3","schema-utils":"^4.2.0",slugify:"^1.6.6","tiny-glob":"^0.2.9","vue-template-compiler":"^2.7.16","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3",which:"^5.0.0",ws:"^8.18.0"},devDependencies:{"@types/adm-zip":"^0.5.7","@types/case-sensitive-paths-webpack-plugin":"^2.1.9","@types/chrome":"^0.0.287","@types/cross-spawn":"^6.0.6","@types/dotenv-webpack":"^7.0.8","@types/jest":"^29.5.14","@types/loader-utils":"^2.0.6","@types/node":"^22.10.1","@types/webextension-polyfill":"^0.12.1","@types/ws":"^8.5.13",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^8.3.5",typescript:"5.7.2"},optionalDependencies:{"@prefresh/core":"^1.5.2","@prefresh/utils":"^1.2.0","@prefresh/webpack":"^4.0.1","@rspack/plugin-preact-refresh":"^1.1.2","@rspack/plugin-react-refresh":"^1.0.1","babel-loader":"^9.2.1","less-loader":"^12.2.0","postcss-loader":"^8.1.1","postcss-preset-env":"^10.1.1","react-refresh":"^0.14.2","sass-loader":"^16.0.4","svelte-loader":"^3.2.4","svelte-preprocess":"^6.0.3","vue-loader":"^17.4.2","vue-style-loader":"^4.1.3","vue-template-compiler":"^2.7.16"}}});var Ql={};rl(Ql,{extensionBuild:()=>ks,extensionDev:()=>zc,extensionPreview:()=>Cs,extensionStart:()=>Zc});module.exports=nl(Ql);var Dc=a(require("fs")),_r=a(require("path")),Lc=require("@rspack/core"),Oc=require("webpack-merge");var Ge=a(require("path"));var Kr=a(require("case-sensitive-paths-webpack-plugin"));var js=a(require("fs")),Ye=a(require("path")),ne=require("@rspack/core"),Ds=a(require("dotenv")),Qe=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){let s=Ye.default.dirname(this.manifestPath),r=e.options.mode||"development",n=[`.env.${this.browser}.${r}`,`.env.${this.browser}`,`.env.${r}`,".env.local",".env",".env.example"],o="";for(let m of n){let g=Ye.default.join(s,m);if(js.default.existsSync(g)){o=g;break}}let i=o?Ds.default.config({path:o}).parsed||{}:{},c=Ye.default.join(s,".env.defaults"),p={...js.default.existsSync(c)?Ds.default.config({path:c}).parsed||{}:{},...i,...process.env},u=Object.keys(p).filter(m=>m.startsWith("EXTENSION_PUBLIC_")).reduce((m,g)=>(m[`process.env.${g}`]=JSON.stringify(p[g]),m[`import.meta.env.${g}`]=JSON.stringify(p[g]),m),{});u["process.env.EXTENSION_PUBLIC_BROWSER"]=JSON.stringify(this.browser),u["import.meta.env.EXTENSION_PUBLIC_BROWSER"]=JSON.stringify(this.browser),u["process.env.EXTENSION_PUBLIC_MODE"]=JSON.stringify(r),u["import.meta.env.EXTENSION_PUBLIC_MODE"]=JSON.stringify(r),u["process.env.EXTENSION_BROWSER"]=JSON.stringify(this.browser),u["import.meta.env.EXTENSION_BROWSER"]=JSON.stringify(this.browser),u["process.env.EXTENSION_MODE"]=JSON.stringify(r),u["import.meta.env.EXTENSION_MODE"]=JSON.stringify(r),new ne.DefinePlugin(u).apply(e),e.hooks.thisCompilation.tap("manifest:update-manifest",m=>{m.hooks.processAssets.tap({name:"env:module",stage:ne.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},g=>{Object.keys(g).forEach(_=>{if(_.endsWith(".json")||_.endsWith(".html")){let S=m.assets[_].source().toString();S=S.replace(/\$EXTENSION_PUBLIC_[A-Z_]+/g,E=>{let A=E.slice(1);return p[A]||E}),S=S.replace(/\$EXTENSION_[A-Z_]+/g,E=>{let A=E.slice(1);return p[A]||E}),m.updateAsset(_,new ne.sources.RawSource(S))}})})})}};var Ls=a(require("fs")),jr=a(require("path")),et=class{apply(e){let s=jr.default.join(e.options.output.path||"");if(Ls.default.existsSync(s))try{Ls.default.rmSync(s,{recursive:!0,force:!0}),process.env.EXTENSION_ENV==="development"&&console.log("[CleanDistFolderPlugin] Removed old hot-update files before compilation.")}catch(r){console.error(`[CleanDistFolderPlugin] Failed to remove hot-update files: ${r.message}`)}}};var Is=a(require("path")),f=require("@colors/colors/safe");var Dr=a(require("path")),tt=Dr.default.join(process.cwd(),"node_modules/extension-develop/dist/certs"),Z=["chrome","edge"],ol=["firefox"],np=[...Z,...ol];var Lr=require("console");function F(t,e){return e==="error"?`${(0,f.bold)((0,f.red)("ERROR"))} in ${t} ${(0,f.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:e==="warn"?`${t} ${(0,f.brightYellow)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:`${e==="info"?(0,f.cyan)("\u25BA\u25BA\u25BA"):(0,f.brightGreen)("\u25BA\u25BA\u25BA")} ${(0,f.cyan)(t)}`}function Or(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Ir(t,e,s){if(!!1)return`${s.hasErrors()?(0,f.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E"):(0,f.brightGreen)("\u25BA\u25BA\u25BA")} ${(0,f.cyan)(t)} compiled ${s.hasErrors()?(0,f.red)("with errors"):(0,f.brightGreen)("successfully")} in ${e} ms.`}function Mr(t,e){return`${(0,Lr.info)("\u25BA\u25BA\u25BA")} Using ${(0,f.magenta)(t)}. Installing required dependencies via ${(0,f.brightYellow)(e)}...`}function v(t){return`${(0,f.cyan)("\u25BA\u25BA\u25BA")} Using ${(0,f.magenta)(t)}...`}function L(t){return`${F(t,"success")} installation completed. Run the program again and happy hacking.`}function Ar(t){return`${F(t,"info")} dependencies are being installed. This only happens for core contributors...`}function Rr(t){return`${F(t,"success")} dependencies installed ${(0,f.brightGreen)("successfully")}.`}function Nr(t,e){return`${F("Integration","error")} ${t} Installation Error
|
|
2
2
|
|
|
3
3
|
Failed to detect package manager or install ${t} dependencies:
|
|
4
4
|
${(0,f.red)(e?.toString()||"")}`}function st(t,e){if(!t)throw new Error("This operation is impossible. Please report a bug.");switch(Is.default.extname(e)){case".js":case".ts":case".jsx":case".tsx":return al(t,e);case".css":case".scss":case".sass":case".less":return cl(t,e);default:return ll(t,e)}}function oe(t,e,s){let r=e.startsWith("content_scripts")?"content_scripts":e.replace("/","."),n=e.split("-")[1],o=e.startsWith("pages"),i=t.includes("content_scripts")?`(index ${n})
|
|
@@ -71,7 +71,7 @@ Learn more about ${(0,f.bold)("mkcert")}: ${(0,f.underline)("https://github.com/
|
|
|
71
71
|
|
|
72
72
|
For MAIN world content_scripts, the extension ID must be specified.
|
|
73
73
|
Ensure your extension have a fixed ID and that the ${(0,f.brightYellow)("publicPath")}
|
|
74
|
-
of your ${(0,f.brightYellow)("extension.config.js")} is defined as your extension URL.`}var nt=class{static name="plugin-compilation";manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){new Kr.default().apply(e),new Qe({manifestPath:this.manifestPath,browser:this.browser}).apply(e),new et().apply(e),e.hooks.done.tapAsync("develop:brand",(s,r)=>{s.compilation.name=void 0;let n=s.compilation.endTime-s.compilation.startTime,o=require(this.manifestPath).name;console.log(Ir(o,n,s)),r()})}};var Pn=a(require("path"));var nn=a(require("path")),on=a(require("fs"));var ie=a(require("path")),ot=a(require("fs")),As=require("child_process"),Qr=require("package-manager-detector");function en(t,e){return Object.values(e||{}).some(s=>s===t)}function h(t,e,s){let r=ie.default.extname(e),o=$(e,s)?ie.default.normalize(e):t;return[".js",".jsx",".tsx",".ts"].includes(r)&&(o=o.replace(r,".js")),[".html",".njk",".nunjucks"].includes(r)&&(o=o.replace(r,".html")),[".css",".scss",".sass",".less"].includes(r)&&(o=o.replace(r,".css")),Rs(o||"")}function Rs(t){return t.replace(/\\/g,"/")}function $(t,e={}){if(!e)return!1;let s=ie.default.normalize(Rs(t));return Object.values(e).some(n=>typeof n!="string"?!1:Rs(n).includes(s))}function W(t,e){if(t.getAsset("manifest.json")||t.assets["manifest.json"]){let s=t.assets["manifest.json"].source().toString();return JSON.parse(s||"{}")}return require(e)}function ae(){return process.env.npm_config_user_agent&&process.env.npm_config_user_agent.includes("pnpm")?"pnpm":!1}function Yr(){return process.env.npm_execpath?"npm":!1}async function j(t,e){try{let s=await(0,Qr.detect)();console.log(Mr(t,s?.name||"unknown"));let r="";s?.name==="yarn"?r=`yarn --silent add ${e.join(" ")} --cwd ${__dirname} --optional`:s?.name==="npm"||Yr()?r=`npm --silent install ${e.join(" ")} --prefix ${__dirname} --save-optional`:ae()?r=`pnpm --silent add ${e.join(" ")} --prefix ${__dirname} --save-optional`:r=`${s} --silent install ${e.join(" ")} --cwd ${__dirname} --optional`,(0,As.execSync)(r,{stdio:"inherit"}),await new Promise(n=>setTimeout(n,2e3)),process.env.EXTENSION_ENV==="development"&&(console.log(Ar(t)),s?.name==="yarn"?r="yarn install --silent > /dev/null 2>&1":s?.name==="npm"||Yr()?r="npm install --silent > /dev/null 2>&1":ae()?r="pnpm install --silent > /dev/null 2>&1":r=`${s} install --silent > /dev/null 2>&1`,(0,As.execSync)(r,{stdio:"inherit"})),console.log(Rr(t))}catch(s){console.error(Nr(t,s))}}function it(t){let e=ie.default.join(t,"package.json");if(!ot.default.existsSync(e))return!1;let s=JSON.parse(ot.default.readFileSync(e,"utf-8")),r=["react","vue","@angular/core","svelte","solid-js","preact"],n=s.dependencies||{},o=s.devDependencies||{};for(let i of r)if(n[i]||o[i])return!0;return!1}function tn(t){return!ot.default.existsSync(ie.default.resolve(__dirname,`run-${t}-profile`))}function sn(t){let e=t.name?.replace(/ /g,"-").toLowerCase();return{data:{id:`${e}@extension-js`,manifest:t,management:{id:`${e}@extension-js`,mayDisable:!0,optionsUrl:"",installType:"development",type:"extension",enabled:!0,name:t.name||"",description:t.description||"",version:t.version||"",hostPermissions:t.host_permissions||[],permissions:t.permissions||[],offlineEnabled:t.offline_enabled||!1,shortName:t.short_name||"",isApp:t.app&&t.app.background&&t.app.background.scripts}}}}function P(t,e){return JSON.parse(JSON.stringify(t),function(n,o){let i=n.indexOf(":");if(i===-1)return o;let c=n.substring(0,i);(c===e||c==="chromium"&&Z.includes(e)||c==="chromium"&&e.includes("chromium")||c==="gecko"&&e.includes("gecko"))&&(this[n.substring(i+1)]=o)})}var rn=!1;function Pe(t){let e=nn.default.join(t,"package.json");if(!on.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.sass,n=s.dependencies&&s.dependencies.sass;return r||n?(rn||(process.env.EXTENSION_ENV==="development"&&console.log(v("SASS")),rn=!0),!0):!1}async function an(t){if(!Pe(t))return[];try{require.resolve("sass-loader")}catch{await j("PostCSS",["postcss-loader","postcss-scss","postcss-preset-env"]),await j("SASS",["sass","sass-loader"]),console.log(L("SASS")),process.exit(0)}return[{test:/\.(sass|scss)$/,exclude:/\.module\.(sass|scss)$/,type:"css",use:[{loader:require.resolve("sass-loader"),options:{sourceMap:!0,sassOptions:{outputStyle:"expanded"}}}]},{test:/\.module\.(sass|scss)$/,type:"css/module",use:[{loader:require.resolve("sass-loader"),options:{sourceMap:!0,sassOptions:{outputStyle:"expanded"}}}]}]}var ln=a(require("path")),pn=a(require("fs"));var cn=!1;function Ee(t){let e=ln.default.join(t,"package.json");if(!pn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.less,n=s.dependencies&&s.dependencies.less;return r||n?(cn||(process.env.EXTENSION_ENV==="development"&&console.log(v("LESS")),cn=!0),!0):!1}async function fn(t){if(!Ee(t))return[];try{require.resolve("less-loader")}catch{await j("LESS",["less","less-loader"]),console.log(L("LESS")),process.exit(0)}return[{test:/\.less$/,exclude:/\.module\.less$/,type:"css",use:[{loader:require.resolve("less-loader"),options:{sourceMap:!0}}]},{test:/\.module\.less$/,type:"css/module",use:[{loader:require.resolve("less-loader"),options:{sourceMap:!0}}]}]}var R=a(require("path")),N=a(require("fs"));function pl(t){let e=R.default.join(t,"stylelint.config.json"),s=R.default.join(t,".stylelintrc.js file"),r=R.default.join(t,"stylelint.config.mjs"),n=R.default.join(t,".stylelintrc.mjs"),o=R.default.join(t,"stylelint.config.cjs"),i=R.default.join(t,".stylelintrc.cjs"),c=R.default.join(t,".stylelintrc.json"),l=R.default.join(t,".stylelintrc"),p=R.default.join(t,".stylelintrc.yml"),u=R.default.join(t,".stylelintrc.yaml");if(N.default.existsSync(e))return e;if(N.default.existsSync(s))return s;if(N.default.existsSync(r))return r;if(N.default.existsSync(n))return n;if(N.default.existsSync(o))return o;if(N.default.existsSync(i))return i;if(N.default.existsSync(c))return c;if(N.default.existsSync(l))return l;if(N.default.existsSync(p))return p;if(N.default.existsSync(u))return u}var un=!1;function fl(t){let e=R.default.join(t,"package.json");if(!N.default.existsSync(e))return!1;let r=!!pl(t);return r&&(un||(process.env.EXTENSION_ENV==="development"&&console.log(v("Stylelint")),un=!0)),r}async function mn(t){return fl(t),[]}var wn=a(require("path"));var gn=a(require("path")),hn=a(require("fs"));var dn=!1;function at(t){let e=gn.default.join(t,"package.json");if(!hn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.tailwindcss,n=s.dependencies&&s.dependencies.tailwindcss,o=!!(r||n);return o&&(dn||(process.env.EXTENSION_ENV==="development"&&console.log(v("Tailwind")),dn=!0)),o}var Ns=a(require("path")),ct=a(require("fs"));var ce=!1,ul=[".postcssrc",".postcssrc.json",".postcssrc.yaml",".postcssrc.yml",".postcssrc.js",".postcssrc.cjs","postcss.config.js","postcss.config.cjs"];function yn(t){for(let e of ul){let s=Ns.default.join(t,e);if(ct.default.existsSync(s))return s}}function ml(t){let e=Ns.default.join(t,"package.json");if(!ct.default.existsSync(e))return!1;if(ct.default.existsSync(e)){let s=require(e);if(s.dependencies&&s.dependencies.postcss||s.devDependencies&&s.devDependencies.postcss)return ce||(process.env.EXTENSION_ENV==="development"&&console.log(v("PostCSS")),ce=!0),!0}return yn(t)?(ce||(process.env.EXTENSION_ENV==="development"&&console.log(v("PostCSS")),ce=!0),!0):at(t)?(ce||(process.env.EXTENSION_ENV==="development"&&console.log(v("PostCSS")),ce=!0),!0):!1}async function bn(t,e){if(!ml(t))return{};try{require.resolve("postcss-loader")}catch{!Pe(t)&&!Ee(t)&&await j("PostCSS",["postcss","postcss-loader","postcss-preset-env"]),console.log(L("PostCSS")),process.exit(0)}return{test:/\.css$/,type:"css",loader:require.resolve("postcss-loader"),options:{postcssOptions:{ident:"postcss",config:yn(t),plugins:[[require.resolve("postcss-preset-env"),{autoprefixer:{flexbox:"no-2009"},stage:3}]].filter(Boolean)},sourceMap:e.mode==="development"}}}async function lt(t,e){let s=[];if(at(t)||Pe(t)||Ee(t)){let r=await bn(t,e);r.loader&&s.push(r)}return e.loader&&s.push({loader:e.loader.startsWith("builtin:")?e.loader:require.resolve(e.loader),options:{...e.loaderOptions,sourceMap:e.mode==="development"}}),s.filter(Boolean)}var Ts=a(require("path")),xn=a(require("fs"));function pt(t,e){if(!t||!e)return!1;let s=JSON.parse(xn.default.readFileSync(e,"utf8"));for(let r of s.content_scripts||[])if(r.js?.length){for(let n of r.js)if(Ts.default.resolve(Ts.default.dirname(e),n)===t)return!0}return!1}async function vn(t,e){let s=wn.default.join(t,"manifest.json");return[{test:/\.css$/,type:"asset",generator:{filename:"content_scripts/[name].[contenthash:8].css"},issuer:r=>pt(r,s),use:await lt(t,{mode:e})}]}var Sn=a(require("path"));async function _n(t,e){let s=Sn.default.join(t,"manifest.json");return[{test:/\.css$/,type:"css",issuer:r=>!pt(r,s),use:await lt(t,{mode:e})}]}var ft=class t{static name="plugin-css";manifestPath;constructor(e){this.manifestPath=e.manifestPath}async configureOptions(e){let s=e.options.mode||"development",r=Pn.default.dirname(this.manifestPath),n=[],o=await mn(r);n.push(...o);let i=[...await vn(r,s),...await _n(r,s)],c=await an(r),l=await fn(r);c.length&&i.push(...c),l.length&&i.push(...l),e.options.plugins=[...e.options.plugins,...n].filter(Boolean),e.options.module.rules=[...e.options.module.rules,...i].filter(Boolean)}async apply(e){if((e.options.mode||"development")==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var ut=class{static name="plugin-static-assets";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async apply(e){let s={test:/\.svg$/i,type:"asset",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2048}}},n=[...e.options.module.rules.some(o=>o&&o.test instanceof RegExp&&o.test.test(".svg")&&o.use!==void 0)?[]:[s],{test:/\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$/i,type:"asset",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(woff|woff2|eot|ttf|otf)$/i,type:"asset",generator:{filename:"assets/[name][ext]"}},{test:/\.(txt|md|csv|tsv|xml|pdf|docx|doc|xls|xlsx|ppt|pptx|zip|gz|gzip|tgz)$/i,type:"asset",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(csv|tsv)$/i,use:[require.resolve("csv-loader")],generator:{filename:"assets/[name][ext]"}}];e.options.module.rules=[...e.options.module.rules,...n].filter(o=>!!o)}};var $e=a(require("path"));var Us=a(require("path")),Bs=a(require("fs"));var En=!1,dl=[".babelrc",".babelrc.json",".babelrc.js",".babelrc.cjs","babel.config.json","babel.config.js","babel.config.cjs"];function gl(t){let e=Us.default.join(t,"package.json");if(!Bs.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies["babel-core"],n=s.dependencies&&s.dependencies["babel-core"],o=dl.some(i=>Bs.default.existsSync(Us.default.join(t,i)))||!!r||!!n;return o&&(En||(process.env.EXTENSION_ENV==="development"&&process.env.EXTENSION_ENV==="development"&&console.log(v("Babel")),En=!0)),o}async function kn(t,e){gl(e)}var Fn=a(require("path")),Cn=a(require("fs"));var $n=!1;function ke(t){let e=Fn.default.join(t,"package.json");if(!Cn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.preact,n=s.dependencies&&s.dependencies.preact;return(r||n)&&($n||(process.env.EXTENSION_ENV==="development"&&console.log(v("Preact")),$n=!0)),!!r||!!n}async function jn(t){if(!ke(t))return;try{require.resolve("@rspack/plugin-preact-refresh")}catch{await j("Preact",["@prefresh/core","@prefresh/utils","@rspack/plugin-preact-refresh","preact"]),console.log(L("Preact")),process.exit(0)}return{plugins:[new(require("@rspack/plugin-preact-refresh"))],loaders:void 0,alias:{react:"preact/compat","react-dom/test-utils":"preact/test-utils","react-dom":"preact/compat","react/jsx-runtime":"preact/jsx-runtime"}}}var Ln=a(require("path")),On=a(require("fs"));var Dn=!1;function mt(t){let e=Ln.default.join(t,"package.json");if(!On.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.react,n=s.dependencies&&s.dependencies.react;return(r||n)&&(Dn||(process.env.EXTENSION_ENV==="development"&&console.log(v("React")),Dn=!0)),!!r||!!n}async function In(t){if(!mt(t))return;try{require.resolve("react-refresh")}catch{await j("React",["react-refresh","@rspack/plugin-react-refresh"]),console.log(L("React")),process.exit(0)}return{plugins:[new(require("@rspack/plugin-react-refresh"))({overlay:!1})],loaders:void 0,alias:void 0}}var An=a(require("path")),Rn=a(require("fs")),Nn=require("vue-loader");var Mn=!1;function hl(t){let e=An.default.join(t,"package.json");if(!Rn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.vue,n=s.dependencies&&s.dependencies.vue;return(r||n)&&(Mn||(process.env.EXTENSION_ENV==="development"&&console.log(v("Vue")),Mn=!0)),!!r||!!n}async function Tn(t){if(!hl(t))return;try{require.resolve("vue-loader")}catch{await j("Vue",["vue-loader","vue-template-compiler","@vue/compiler-sfc"]),console.log(L("Vue")),process.exit(0)}let e=[{test:/\.vue$/,loader:require.resolve("vue-loader"),options:{experimentalInlineMatchResource:!0},include:t,exclude:/node_modules/}];return{plugins:[new Nn.VueLoaderPlugin],loaders:e,alias:void 0}}var dt=a(require("path")),gt=a(require("fs"));var Un=!1;function K(t){let e=dt.default.join(t,"package.json");if(!gt.default.existsSync(e))return!1;let s=bl(t),r=require(e),n=r.devDependencies&&r.devDependencies.typescript,o=r.dependencies&&r.dependencies.typescript;return Un||((n||o)&&(s?process.env.EXTENSION_ENV==="development"&&console.log(v("TypeScript")):(console.log(Wr()),xl(t))),Un=!0),!!s&&!!(n||o)}function yl(t,e){return{compilerOptions:{allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,jsx:it(t)?"react-jsx":"preserve",lib:["dom","dom.iterable","esnext"],moduleResolution:"node",module:"esnext",resolveJsonModule:!0,strict:!0,target:"esnext",isolatedModules:!1,skipLibCheck:!0},exclude:["node_modules","dist"]}}function bl(t){let e=dt.default.join(t,"tsconfig.json");if(gt.default.existsSync(e))return e}function xl(t){gt.default.writeFileSync(dt.default.join(t,"tsconfig.json"),JSON.stringify(yl(t,{mode:"development"}),null,2))}var qn=a(require("path")),Wn=a(require("fs")),Jn=require("svelte-preprocess");var Bn=!1;function wl(t){let e=qn.default.join(t,"package.json");if(!Wn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies?.svelte,n=s.dependencies&&s.dependencies.svelte;return(r||n)&&(Bn||(process.env.EXTENSION_ENV==="development"&&console.log(v("Svelte")),Bn=!0)),!!r||!!n}async function zn(t,e){if(!wl(t))return;try{require.resolve("svelte-loader")}catch{await j("TypeScript",["typescript"]),await j("Svelte",["svelte-loader","svelte-preprocess"]),console.log(L("Svelte")),process.exit(0)}return{plugins:void 0,loaders:[{test:/\.svelte\.ts$/,use:[require.resolve("svelte-loader")],include:t,exclude:/node_modules/},{test:/\.(svelte|svelte\.js)$/,use:{loader:require.resolve("svelte-loader"),options:{preprocess:(0,Jn.sveltePreprocess)({typescript:!0}),emitCss:!0,compilerOptions:{dev:e==="development",css:"injected"},hotReload:e==="development"}},include:t,exclude:/node_modules/},{test:/node_modules\/svelte\/.*\.mjs$/,resolve:{fullySpecified:!1}}],alias:void 0}}var ht=class t{static name="plugin-js-frameworks";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=e.options.mode||"development",r=$e.default.dirname(this.manifestPath),n=await kn(e,r),o=await In(r),i=await jn(r),c=await Tn(r),l=await zn(r,s);e.options.resolve.alias={...n?.alias||{},...o?.alias||{},...i?.alias||{},...c?.alias||{},...l?.alias||{},...e.options.resolve.alias},e.options.module.rules=[{test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[$e.default.dirname(this.manifestPath)],exclude:[/[\\/]node_modules[\\/]/],use:{loader:"builtin:swc-loader",options:{sync:!0,module:{type:"es6"},minify:s==="production",isModule:!0,sourceMap:this.mode==="development",env:{targets:["chrome >= 100"]},jsc:{parser:{syntax:K(r)?"typescript":"ecmascript",tsx:K(r)&&(mt(r)||ke(r)),jsx:!K(r)&&(mt(r)||ke(r)),dynamicImport:!0},transform:{react:{development:s==="development",refresh:s==="development",runtime:"automatic",importSource:"react",...ke(r)?{pragma:"h",pragmaFrag:"Fragment",throwIfNamespace:!0,useBuiltins:!1}:{}}}}}}},...n?.loaders||[],...o?.loaders||[],...i?.loaders||[],...c?.loaders||[],...l?.loaders||[],...e.options.module.rules].filter(Boolean),o?.plugins?.forEach(p=>p.apply(e)),i?.plugins?.forEach(p=>p.apply(e)),c?.plugins?.forEach(p=>p.apply(e)),l?.plugins?.forEach(p=>p.apply(e)),K(r)&&(e.options.resolve.tsConfig={configFile:$e.default.resolve($e.default.dirname(this.manifestPath),"tsconfig.json")})}async apply(e){if((e.options.mode||"development")==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var Lo=a(require("path"));var Hn=a(require("path"));function Vn(t,e){if(!e||!e.action||!e.action.default_popup)return;let s=e.action.default_popup;return Hn.default.join(t,s)}var Xn=a(require("path"));function Gn(t,e){if(!e||!e.browser_action||!e.browser_action.default_popup)return;let s=e.browser_action.default_popup;return Xn.default.join(t,s)}var yt=a(require("path"));function Zn(t,e){let s={newtab:void 0};if(!e||!e.chrome_url_overrides)return{"chrome_url_overrides/newtab":void 0};if(e.chrome_url_overrides.history){let r=e.chrome_url_overrides.history;s={"chrome_url_overrides/history":yt.default.join(t,r)}}if(e.chrome_url_overrides.newtab){let r=e.chrome_url_overrides.newtab;s={"chrome_url_overrides/newtab":yt.default.join(t,r)}}if(e.chrome_url_overrides.bookmarks){let r=e.chrome_url_overrides.bookmarks;s={"chrome_url_overrides/bookmarks":yt.default.join(t,r)}}return s}var Kn=a(require("path"));function Yn(t,e){if(!e||!e.devtools_page)return;let s=e.devtools_page;return Kn.default.join(t,s)}var qs=a(require("path"));function Qn(t,e){if(e.options_page){let r=e.options_page;return qs.default.join(t,r)}if(!e||!e.options_ui||!e.options_ui.page)return;let s=e.options_ui.page;return qs.default.join(t,s)}var eo=a(require("path"));function to(t,e){if(!e||!e.page_action||!e.page_action.default_popup)return;let s=e.page_action.default_popup;return eo.default.join(t,s)}var so=a(require("path"));function ro(t,e){if(!e||!e.sandbox||!e.sandbox.pages)return{"sandbox/page-0":void 0};let s=e.sandbox.pages,r={};for(let[n,o]of s.entries())r[`sandbox/page-${n}`]=so.default.join(t,o);return r}var no=a(require("path"));function oo(t,e){if(!e||!e.side_panel||!e.side_panel.default_path)return;let s=e.side_panel.default_path;return no.default.join(t,s)}var io=a(require("path"));function ao(t,e){if(!e||!e.sidebar_action||!e.sidebar_action.default_panel)return;let s=e.sidebar_action.default_panel;return io.default.join(t,s)}function Fe(t,e){return{"action/default_popup":Vn(t,e),"browser_action/default_popup":Gn(t,e),...Zn(t,e),devtools_page:Yn(t,e),"options_ui/page":Qn(t,e),"page_action/default_popup":to(t,e),...ro(t,e),"side_panel/default_path":oo(t,e),"sidebar_action/default_panel":ao(t,e)}}var Ws=a(require("path"));function co(t,e){if(!e||!e.action||!e.action.default_icon)return;if(typeof e.action.default_icon=="string")return Ws.default.join(t,e.action.default_icon);let s=[];for(let r in e.action.default_icon)s.push(Ws.default.join(t,e.action.default_icon[r]));return s}var Js=a(require("path"));function lo(t,e){if(!e||!e.browser_action||!e.browser_action.default_icon)return;let s=[];if(typeof e.browser_action.default_icon=="string")return Js.default.join(t,e.browser_action.default_icon);for(let r in e.browser_action.default_icon){let n=e.browser_action.default_icon[r]=Js.default.join(t,e.browser_action.default_icon[r]);s.push(n)}return s}var zs=a(require("path"));function po(t,e){if(!(!e||!e.browser_action||!e.browser_action.theme_icons)){for(let s of e.browser_action.theme_icons)s.light&&(s.light=zs.default.join(t,s.light)),s.dark&&(s.dark=zs.default.join(t,s.dark)),s.size&&delete s.size;return e.browser_action.theme_icons}}var fo=a(require("path"));function uo(t,e){if(!e||!e.icons)return;let s=[];for(let r in e.icons){let n=fo.default.join(t,e.icons[r]);s.push(n)}return s}var Hs=a(require("path"));function mo(t,e){if(!e||!e.page_action||!e.page_action.default_icon)return;if(typeof e.page_action.default_icon=="string")return Hs.default.join(t,e.page_action.default_icon);let s=[];for(let r in e.page_action.default_icon){let n=Hs.default.join(t,e.page_action.default_icon[r]);s.push(n)}return s}var go=a(require("path"));function ho(t,e){return!e||!e.sidebar_action||!e.sidebar_action.default_icon?void 0:go.default.join(t,e.sidebar_action.default_icon)}function yo(t,e){return{action:co(t,e),browser_action:lo(t,e),"browser_action/theme_icons":po(t,e),icons:uo(t,e),page_action:mo(t,e),sidebar_action:ho(t,e)}}var bo=a(require("path"));function xo(t,e){let s={};return!e||!e.declarative_net_request||!e.declarative_net_request.rule_resources?{"declarative_net_request/rule_resources-0":void 0}:(e.declarative_net_request.rule_resources.forEach(n=>{s[`declarative_net_request/${n.id}`]=bo.default.join(t,n.path)}),s)}var wo=a(require("path"));function vo(t,e){if(!e||!e.storage||!e.storage.managed_schema)return;let s=e.storage.managed_schema;return wo.default.join(t,s)}function So(t,e){return{...xo(t,e),"storage/managed_schema":vo(t,e)}}var Ce=a(require("path")),je=a(require("fs"));function _o(t,e){let s=Ce.default.join(Ce.default.dirname(e),"_locales"),r=[];if(je.default.existsSync(s))for(let n of je.default.readdirSync(s)){let o=Ce.default.join(s,n);if(o&&je.default.statSync(o).isDirectory())for(let i of je.default.readdirSync(o))r.push(Ce.default.join(t,"_locales",n,i))}return r}var Po=a(require("path"));function Eo(t,e){if(!e||!e.background)return;let s=e.background.scripts;if(s)return s.map(r=>Po.default.join(t,r))}var ko=a(require("path"));function $o(t,e){if(!e||!e.background)return;let s=e.background.service_worker;if(s)return ko.default.join(t,s)}var Vs=a(require("path"));function Fo(t,e){if(!e||!e.content_scripts)return{"content_scripts/content-0":void 0};let s=o=>{if(o.js?.length!==0)return o.js?.map(i=>Vs.default.join(t,i))},r=o=>{if(o.css?.length!==0)return o.css?.map(i=>Vs.default.join(t,i))},n={};for(let[o,i]of e.content_scripts.entries()){let c=s(i),l=r(i);n[`content_scripts/content-${o}`]=[...(c||[]).filter(p=>p!=null),...(l||[]).filter(p=>p!=null)]}return n}var Co=a(require("path"));function jo(t,e){if(!e||!e.user_scripts||!e.user_scripts.api_script)return;let s=e.user_scripts.api_script;return Co.default.join(t,s)}function De(t,e){return{"background/scripts":Eo(t,e),"background/service_worker":$o(t,e),...Fo(t,e),"user_scripts/api_script":jo(t,e)}}function Do(t){if(!(!t||!t.web_accessible_resources||!t.web_accessible_resources.length))return t.web_accessible_resources}function le({manifestPath:t,browser:e}){let s=Lo.default.dirname(t),r=require(t),n=P(r,e||"chrome");return{html:Fe(s,n),icons:yo(s,n),json:So(s,n),locales:_o(s,t),scripts:De(s,n),web_accessible_resources:Do(n)}}var pe=a(require("path"));var bt=a(require("fs")),Le=a(require("path"));function xt(t,e){if(!bt.default.existsSync(t)||!bt.default.statSync(t).isDirectory())return[];let s=[];function r(n){let o=bt.default.readdirSync(n,{withFileTypes:!0});for(let i of o){let c=Le.default.join(n,i.name);i.isDirectory()?r(c):i.isFile()&&e(i.name)&&s.push(c)}}return r(t),s}function wt(t,e,s=""){return!e||!e.length?{}:e.reduce((r,n)=>{let o=Le.default.extname(n),i=Le.default.basename(n,o),c=s?`${s}/${i}`:Le.default.relative(t,n);return{...r,[c]:n}},{})}function Oo({manifestPath:t}){let e=pe.default.dirname(t),s={public:pe.default.join(e,"public"),pages:pe.default.join(e,"pages"),scripts:pe.default.join(e,"scripts")},r={public:xt(s.public,()=>!0),pages:xt(s.pages,o=>o.endsWith(".html")),scripts:xt(s.scripts,o=>[".js",".mjs",".jsx",".mjsx",".ts",".mts",".tsx",".mtsx"].includes(pe.default.extname(o)))};return{public:wt(e,r.public),pages:wt(e,r.pages,"pages"),scripts:wt(e,r.scripts,"scripts")}}var Io=a(require("fs")),fe=a(require("@rspack/core"));var vt=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){e.hooks.thisCompilation.tap("manifest:emit-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:emit-manifest",stage:fe.Compilation.PROCESS_ASSETS_STAGE_PRE_PROCESS},()=>{let r=this.manifestPath,n;try{let c=Io.default.readFileSync(r,"utf-8");n=JSON.parse(c),"$schema"in n&&delete n.$schema}catch(c){s.errors.push(new fe.default.WebpackError(Ur(c)));return}let o=JSON.stringify(n,null,2);s.emitAsset("manifest.json",new fe.sources.RawSource(o))})})}};var Oe=require("@rspack/core");function Mo(t,e){return t.background&&t.background.scripts&&{background:{...t.background,...t.background.scripts&&{scripts:[...t.background.scripts.map(s=>h("background/scripts.js",s,e))]}}}}var Ao=a(require("path"));var St=t=>Ao.default.basename(t);function Ro(t,e){return t.browser_action&&{browser_action:{...t.browser_action,...t.browser_action.default_popup&&{default_popup:h("browser_action/default_popup.html",t.browser_action.default_popup,e)},...t.browser_action.default_icon&&{default_icon:typeof t.browser_action.default_icon=="string"?h(`icons/${St(t.browser_action.default_icon)}`,t.browser_action.default_icon,e):Object.fromEntries(Object.entries(t.browser_action.default_icon).map(([s,r])=>[s,h(`icons/${St(r)}`,r,e)]))},...t.browser_action.theme_icons&&{theme_icons:t.browser_action.theme_icons.map(s=>({...s,...s.light&&{light:h(`browser_action/${St(s.light)}`,s.light,e)},...s.dark&&{dark:h(`browser_action/${St(s.dark)}`,s.dark,e)}}))}}}}function No(t,e){return t.declarative_net_request&&{declarative_net_request:{...t.declarative_net_request,rule_resources:t.declarative_net_request.rule_resources.map(s=>({...s,path:s.path&&h(`declarative_net_request/${s.id}.json`,s.path,e)}))}}}function To(t,e){return{...Mo(t,e),...Ro(t,e),...No(t,e)}}var Bo=a(require("path"));var Uo=t=>Bo.default.basename(t);function qo(t,e){return t.action&&{action:{...t.action,...t.action.default_popup&&{default_popup:h("action/default_popup.html",t.action.default_popup,e)},...t.action.default_icon&&{default_icon:typeof t.action.default_icon=="string"?h(`action/${Uo(t.action.default_icon)}`,t.action.default_icon,e):Object.fromEntries(Object.entries(t.action.default_icon).map(([s,r])=>[s,h(`action/${Uo(r)}`,r,e)]))}}}}function Wo(t,e){return t.background&&t.background.service_worker&&{background:{...t.background,...t.background.service_worker&&{service_worker:h("background/service_worker.js",t.background.service_worker,e)}}}}function _t(t,e){return t.side_panel&&{side_panel:{...t.side_panel.default_path&&{default_path:h("side_panel/default_path.html",t.side_panel.default_path,e)}}}}function Jo(t,e){return{...qo(t,e),...Wo(t,e),..._t(t,e)}}function zo(t,e){return t.background&&t.background.page&&{background:{...t.background,...t.background.page&&{page:h("background/page.html",t.background.page,e)}}}}function Ho(t,e){return t.chrome_url_overrides&&{chrome_url_overrides:{...t.chrome_url_overrides.bookmarks&&{bookmarks:h("chrome_url_overrides/bookmarks.html",t.chrome_url_overrides.bookmarks,e)},...t.chrome_url_overrides.history&&{history:h("chrome_url_overrides/history.html",t.chrome_url_overrides.history,e)},...t.chrome_url_overrides.newtab&&{newtab:h("chrome_url_overrides/newtab.html",t.chrome_url_overrides.newtab,e)}}}}function Vo(t,e){return t.content_scripts&&{content_scripts:t.content_scripts.map((s,r)=>{let n=[...new Set(s.js)],o=[...new Set(s.css)];return{...s,js:[...n.map(i=>h(`content_scripts/content-${r}.js`,i,e))],css:[...o.map(i=>h(`content_scripts/content-${r}.css`,i,e))]}})}}function Xo(t,e){return t.devtools_page&&{devtools_page:h("devtools_page.html",t.devtools_page,e)}}var Go=a(require("path"));var vl=t=>Go.default.basename(t);function Zo(t,e){return t.icons&&{icons:Object.fromEntries(Object.entries(t.icons).map(([s,r])=>[s,h(`icons/${vl(r)}`,r,e)]))}}function Ko(t,e){return t.options_page&&{options_page:h("options_ui/page.html",t.options_page,e)}}function Yo(t,e){return t.options_ui&&{options_ui:{...t.options_ui,...t.options_ui.page&&{page:h("options_ui/page.html",t.options_ui.page,e)}}}}var ei=a(require("path"));var Qo=t=>ei.default.basename(t);function ti(t,e){return t.page_action&&{page_action:{...t.page_action,...t.page_action.default_popup&&{default_popup:h("page_action/default_popup.html",t.page_action.default_popup,e)},...t.page_action.default_icon&&{default_icon:typeof t.page_action.default_icon=="string"?h(`icons/${Qo(t.page_action.default_icon)}`,t.page_action.default_icon,e):Object.fromEntries(Object.entries(t.page_action.default_icon).map(([s,r])=>[s,h(`icons/${Qo(r)}`,r,e)]))}}}}function si(t,e){return t.sandbox&&{sandbox:{...t.sandbox,...t.sandbox.pages&&{pages:t.sandbox.pages.map((s,r)=>h(`sandbox/page-${r}.html`,s,e))}}}}var ri=a(require("path"));var Sl=t=>ri.default.basename(t);function ni(t,e){return t.sidebar_action&&{sidebar_action:{...t.sidebar_action,...t.sidebar_action.default_panel&&{default_panel:h("sidebar_action/default_panel.html",t.sidebar_action.default_panel,e)},...t.sidebar_action.default_icon&&{default_icon:h(`icons/${Sl(t.sidebar_action.default_icon)}`,t.sidebar_action.default_icon,e)}}}}function oi(t,e){return t.storage&&{storage:{...t.storage.managed_schema&&{managed_schema:h("storage/managed_schema.json",t.storage.managed_schema,e)}}}}var ii=a(require("path"));var _l=t=>ii.default.basename(t);function ai(t,e){return t.theme&&{theme:{...t.theme,...t.theme.images&&{images:{...t.theme.images,theme_frame:h(`theme/images/${_l(t.theme.images.theme_frame)}`,t.theme.images.theme_frame,e)}}}}}function ci(t,e){return t.user_scripts&&{user_scripts:{...t.user_scripts,...t.user_scripts.api_script&&{api_script:h("user_scripts/api_script.js",t.user_scripts.api_script,e)}}}}function li(t){return t.web_accessible_resources&&t.web_accessible_resources.length&&{web_accessible_resources:t.web_accessible_resources}}function pi(t,e){return{...zo(t,e),...Ho(t,e),...Vo(t,e),...Xo(t,e),...Zo(t,e),...Ko(t,e),...Yo(t,e),...ti(t,e),...si(t,e),..._t(t,e),...ni(t,e),...oi(t,e),...ai(t,e),...ci(t,e),...li(t)}}function Xs(t,e,s){let r=e||require(t);return JSON.stringify({...r,...pi(r,s),...To(r,s),...Jo(r,s)},null,2)}var Pt=class{manifestPath;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.excludeList=e.excludeList}applyDevOverrides(e){return e.content_scripts?e.content_scripts.map((s,r)=>(s.css.length&&!s.js.length&&(s.js=[h(`content_scripts-${r}`,"dev.js",{})]),s)):{}}apply(e){e.hooks.thisCompilation.tap("manifest:update-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:update-manifest",stage:Oe.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},()=>{if(s.errors.length>0)return;let r=W(s,this.manifestPath),n=Xs(this.manifestPath,r,this.excludeList||{}),o={...r,...JSON.parse(n)};e.options.mode==="development"&&o.content_scripts&&(o.content_scripts=this.applyDevOverrides(o));let i=JSON.stringify(o,null,2),c=new Oe.sources.RawSource(i);s.updateAsset("manifest.json",c)}),e.options.mode==="production"&&s.hooks.processAssets.tap("manifest:update-manifest",()=>{if(s.errors.length>0)return;let r=W(s,this.manifestPath),n=Xs(this.manifestPath,r,this.excludeList||{}),o={...r,...JSON.parse(n)},i=JSON.stringify(o,null,2),c=new Oe.sources.RawSource(i);s.updateAsset("manifest.json",c)})})}};var fi=a(require("fs")),Et=class{dependencyList;constructor(e){this.dependencyList=e}apply(e){e.hooks.afterCompile.tap("manifest:add-dependency",s=>{if(s.errors?.length)return;let r=new Set(s.fileDependencies);this.dependencyList&&this.dependencyList.forEach(n=>{fi.default.existsSync(n)&&(r.has(n)||(r.add(n),s.fileDependencies.add(n)))})})}};var ui=a(require("fs")),mi=a(require("path")),$t=a(require("@rspack/core"));var kt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}extractPaths(e){let s=Array.isArray(e)?e:[e];if(typeof s[0]=="string")return s;let r=[];if(typeof e=="object"&&!Array.isArray(e)){let n=e;n.light&&r.push(n.light),n.dark&&r.push(n.dark)}return r}handleErrors(e,s){let r=[".png",".jpg",".jpeg",".svg",".gif",".webp"],n=[".json"],o=[".js",".ts",".jsx",".tsx",".mjs",".cjs"],i=".html",c=Object.entries(this.includeList||{});for(let[l,p]of c)if(p){let u=this.extractPaths(p);for(let m of u){let g=mi.default.extname(m),b=require(this.manifestPath),S=P(b,"chrome").name||"Extension.js";if(!ui.default.existsSync(m)){if(m.startsWith("/"))return;let E=oe(S,l,m);r.includes(g)?e.errors.push(new s(E)):n.includes(g)?e.errors.push(new s(E)):o.includes(g)?e.errors.push(new s(E)):g===i?e.errors.push(new s(E)):e.errors.push(new s(E))}}}}apply(e){e.hooks.compilation.tap("manifest:check-manifest-files",s=>{s.hooks.processAssets.tap({name:"compatibility:check-manifest-files",stage:$t.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT},()=>{let r=$t.default.WebpackError;this.handleErrors(s,r)})})}};var di=a(require("fs")),Ct=a(require("@rspack/core"));var Ft=class{manifestPath;browser;includeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList}flattenAndSort(e){return e.flat(1/0).sort()}apply(e){e.hooks.watchRun.tapAsync("manifest:throw-if-recompile-is-needed",(s,r)=>{if((s.modifiedFiles||new Set).has(this.manifestPath)){let o=s.options.context||"",i=`${o}/package.json`;if(!di.default.existsSync(i)){r();return}let c=require(this.manifestPath),l=P(c,this.browser),p=this.flattenAndSort(Object.values(Fe(o,l))),u=this.flattenAndSort(Object.values(De(o,l)));s.hooks.thisCompilation.tap("manifest:throw-if-recompile-is-needed",m=>{m.hooks.processAssets.tap({name:"manifest:check-manifest-files",stage:Ct.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY},()=>{let b=m.getAsset("manifest.json")?.source.source().toString(),_=JSON.parse(b||"{}"),S=this.flattenAndSort(Object.values(Fe(o,_))),E=this.flattenAndSort(Object.values(De(o,_)));if(u.toString()!==E.toString()||p.toString()!==S.toString()){let A=p.filter(q=>!S.includes(q))[0],T=S.filter(q=>!p.includes(q))[0],_e=Br(T,A);m.errors.push(new Ct.default.WebpackError(_e))}})})}r()})}};var jt=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new vt({manifestPath:this.manifestPath}).apply(e),new kt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Pt({manifestPath:this.manifestPath,excludeList:this.excludeList}).apply(e),new Et([this.manifestPath]).apply(e),new Ft({manifestPath:this.manifestPath,browser:this.browser,includeList:this.includeList}).apply(e)}};var Qs=a(require("path"));var Zs=a(require("fs")),Ot=a(require("@rspack/core")),xi=require("@rspack/core");var gi=a(require("fs")),me=a(require("path")),hi=a(require("parse5-utils"));var ue=a(require("parse5-utils"));function Dt(t){try{return new URL(t),!0}catch{return!1}}function Ie(t,e){let{childNodes:s=[]}=t;for(let r of s)if(r.nodeName==="script"){let n=ue.default.getAttribute(r,"src");if(!n||Dt(n))continue;e({filePath:n,childNode:r,assetType:"script"})}else if(r.nodeName==="link"){let n=ue.default.getAttribute(r,"href"),o=ue.default.getAttribute(r,"rel");if(!n||Dt(n))continue;e(o==="dns-prefetch"||o==="icon"||o==="manifest"||o==="modulepreload"||o==="preconnect"||o==="prefetch"||o==="preload"||o==="prerender"?{filePath:n,childNode:r,assetType:"staticHref"}:{filePath:n,childNode:r,assetType:"css"})}else if(r.nodeName==="a"||r.nodeName==="area"){let n=ue.default.getAttribute(r,"href");if(!n||Dt(n))continue;e({filePath:n,childNode:r,assetType:"staticHref"})}else if(r.nodeName==="audio"||r.nodeName==="embed"||r.nodeName==="iframe"||r.nodeName==="img"||r.nodeName==="input"||r.nodeName==="source"||r.nodeName==="track"||r.nodeName==="video"){let n=ue.default.getAttribute(r,"src");if(!n||Dt(n))continue;e({filePath:n,childNode:r,assetType:"staticSrc"})}else Ie(r,e)}function D(t,e){let s={css:[],js:[],static:[]};if(!t)return s;let r=e||gi.default.readFileSync(t,{encoding:"utf8"}),n=hi.default.parse(r),o=(i,c)=>me.default.join(me.default.dirname(i),c.startsWith("/")?me.default.relative(me.default.dirname(i),c):c);for(let i of n.childNodes)if(i.nodeName==="html"){for(let c of i.childNodes)(c.nodeName==="head"||c.nodeName==="body")&&Ie(c,({filePath:l,assetType:p})=>{let u=o(t,l);switch(p){case"script":s.js?.push(u);break;case"css":s.css?.push(u);break;case"staticSrc":case"staticHref":if(l.startsWith("#"))break;s.static?.push(u);break;default:break}});return{css:s.css,js:s.js,static:s.static}}}function yi(t,e,s){let r=Object.keys(t).find(o=>{let i=t[o];return t[o]===e||D(i)?.js?.includes(e)||D(i)?.css?.includes(e)})||"",n=Gs(e);return r?`/${r.replace(n,"")}${s}`:`${e.replace(n,"")}${s}`}function Gs(t){switch(me.default.extname(t)){case".js":case".mjs":case".ts":case".tsx":return".js";case".css":case".scss":case".sass":case".less":return".css";case".html":return".html";default:return".js"}}function z(t,e,s){return s?`/${t}${e}`:`${t}${e}`}function bi(t,e){return Object.values(e||{}).some(s=>s===t)}var Lt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let s=require(this.manifestPath),n=P(s,"chrome").name||"Extension.js";e.hooks.thisCompilation.tap("html:emit-html-file",o=>{o.hooks.processAssets.tap({name:"AddAssetsToCompilationPlugin",stage:Ot.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let i=Object.entries(this.includeList||{});for(let c of i){let[l,p]=c;if(p){if(!Zs.default.existsSync(p)){let m=oe(n,l,p);o.warnings.push(new Ot.default.WebpackError(m));return}let u=Zs.default.readFileSync(p,"utf8");if(!$(p,this.excludeList)){let m=new xi.sources.RawSource(u),g=z(l,".html");o.emitAsset(g,m)}}}})})}};var It=a(require("fs")),de=a(require("path")),Y=a(require("@rspack/core"));var Mt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.thisCompilation.tap("html:add-assets-to-compilation",s=>{s.hooks.processAssets.tap({name:"html:add-assets-to-compilation",stage:Y.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{if(s.errors.length>0)return;let r=Object.entries(this.includeList||{});for(let n of r){let[o,i]=n,c=o+".html";if(i){let l=s.getAsset(c);if(l){let p=l.source.source().toString(),u=D(i,p)?.static,m=[...new Set(u)];for(let g of m)if(!g.startsWith("/")){if(!It.default.existsSync(g)&&!bi(g,this.includeList)&&!de.default.basename(g).startsWith("#")){let A=st(i,g);g.startsWith("/")||s.warnings.push(new Y.default.WebpackError(A));return}let b=It.default.readFileSync(g),_=new Y.sources.RawSource(b),S=de.default.join("assets",de.default.basename(g));if(!s.getAsset(S))if(g.endsWith(".html")){let E=D(g),A=[...E?.js||[],...E?.css||[],...E?.static||[]];s.emitAsset(S,_),A.forEach(T=>{let _e=It.default.readFileSync(T),q=new Y.sources.RawSource(_e),Fr=de.default.join("assets",de.default.basename(T));s.getAsset(Fr)||s.emitAsset(Fr,q)})}else s.emitAsset(S,_)}}}}})})}};var wi=a(require("path")),Ks=a(require("fs"));var At=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let s=this.includeList||{};for(let r of Object.entries(s)){let[n,o]=r;if(o){if(!Ks.default.existsSync(o))return;let i=D(o),c=i?.js||[],l=i?.css||[],p=[...c,...l].filter(u=>!$(u,this.excludeList));if(e.options.mode==="development"){let u=wi.default.resolve(__dirname,"minimum-script-file.mjs");p.push(u)}Ks.default.existsSync(o)&&($(o,this.excludeList)||(e.options.entry={...e.options.entry,[n]:{import:p}}))}}}};var Nt=require("@rspack/core");var Ys=a(require("fs")),H=a(require("path")),O=a(require("parse5-utils"));function vi(t,e,s,r,n){let o=Ys.default.readFileSync(s,{encoding:"utf8"}),i=O.default.parse(o),c=!!t.getAsset(e+".css"),l=!1;for(let p of i.childNodes)if(p.nodeName==="html"){for(let u of p.childNodes){if((u.nodeName==="head"||u.nodeName==="body")&&Ie(u,({filePath:m,childNode:g,assetType:b})=>{let _=H.default.dirname(s),S=H.default.resolve(_,m),E=Gs(S),A=$(H.default.resolve(_,m),n),T=H.default.join("/",H.default.normalize(m)),_e=en(S,r);switch(b){case"script":{A?p=O.default.setAttribute(g,"src",T):(p=O.default.remove(g),l=!0);break}case"css":{A?p=O.default.setAttribute(g,"href",T):(p=O.default.remove(g),c=!0);break}case"staticHref":case"staticSrc":{if(A)p=O.default.setAttribute(g,b==="staticSrc"?"src":"href",T);else if(_e){let q=yi(r,S,E);p=O.default.setAttribute(g,b==="staticSrc"?"src":"href",q)}else{let q=H.default.join("assets",H.default.basename(S,E));Ys.default.existsSync(S)&&(p=O.default.setAttribute(g,b==="staticSrc"?"src":"href",z(q,"",!0)))}break}default:break}}),u.nodeName==="head"&&c){let m=O.default.createNode("link");m.attrs=[{name:"rel",value:"stylesheet"},{name:"href",value:z(e,".css",!0)}],O.default.append(u,m)}if(u.nodeName==="body"&&(l||t.options.mode!=="production")){let m=O.default.createNode("script");m.attrs=[{name:"src",value:z(e,".js",!0)}],O.default.append(u,m)}}return O.default.serialize(i)}}var Rt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("html:update-html-file",s=>{s.hooks.processAssets.tap({name:"html:update-html-file",stage:Nt.Compilation.PROCESS_ASSETS_STAGE_DERIVED},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[o,i]=n;if(i){let c=vi(s,o,i,r,this.excludeList||{});if(!$(i,this.excludeList)&&c){let l=new Nt.sources.RawSource(c),p=z(o,".html");s.updateAsset(p,l)}}}})})}};var Si=a(require("fs")),_i=require("@rspack/core");var Tt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.thisCompilation.tap("html:add-to-file-dependencies",s=>{s.hooks.processAssets.tap({name:"html:add-to-file-dependencies",stage:_i.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,o]=n;if(o){let i=D(o),c=new Set(s.fileDependencies);if(Si.default.existsSync(o)){let l=[o,...i?.static||[]];for(let p of l)c.has(p)||(c.add(p),p===o&&s.fileDependencies.add(p))}}}})})}};var Pi=a(require("fs"));var Ut=class{manifestPath;includeList;initialHtmlAssets={};constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}hasEntriesChanged(e,s){if(!s||!e||e.length!==s.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==s[r])return!0;return!1}storeInitialHtmlAssets(e){Object.entries(e).forEach(([s,r])=>{let n=r;if(n){if(!Pi.default.existsSync(n)){let o=require(this.manifestPath),c=P(o,"chrome").name||"Extension.js";console.error(oe(c,s,n)),process.exit(1)}this.initialHtmlAssets[n]={js:D(n)?.js||[],css:D(n)?.css||[]}}})}apply(e){let s=this.includeList||{};this.storeInitialHtmlAssets(s),e.hooks.make.tapAsync("html:throw-if-recompile-is-needed",(r,n)=>{let o=e.modifiedFiles||new Set,i=Array.from(o)[0];if(i&&this.initialHtmlAssets[i]){let c=D(i)?.js||[],l=D(i)?.css||[],{js:p,css:u}=this.initialHtmlAssets[i];(this.hasEntriesChanged(l,u)||this.hasEntriesChanged(c,p))&&console.log(Vr(i))}n()})}};var Ei=a(require("fs")),ki=require("@rspack/core");function El(t,e){let s="Module not found: Error: Can't resolve ",n=e.message.replace(s,"").split("'")[1];if(e.message.includes(s))for(let o of Object.entries(t)){let[,i]=o;if(i){if(!Ei.default.existsSync(i))return null;let c=D(i),l=c?.js?.filter(u=>!u.startsWith("/"))||[],p=c?.css?.filter(u=>!u.startsWith("/"))||[];if(l.includes(n)||p.includes(n)){let u=st(i,n);return new ki.WebpackError(u)}}}return null}var Bt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.compilation.tap("html:handle-common-errors",s=>{s.hooks.afterSeal.tapPromise("html:handle-common-errors",async()=>{s.errors.forEach((r,n)=>{let o=El(this.includeList||{},r);o&&(s.errors[n]=o)})})})}};var qt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Lt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Mt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new At({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Rt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Qs.default.dirname(this.manifestPath)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:require.resolve(Qs.default.join(__dirname,"ensure-hmr-for-scripts.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}}]}),new Tt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Ut({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Bt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var Me=a(require("path"));var er=a(require("fs")),$i=a(require("path"));function Fi(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(n=>{let o=er.default.existsSync(n)&&!$(n,e),i=$i.default.extname(n);return o&&(i===".js"||i===".mjs"||i===".jsx"||i===".ts"||i===".tsx")})}function Ci(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(n=>er.default.existsSync(n)&&!$(n,e)&&(n.endsWith(".css")||n.endsWith(".scss")||n.endsWith(".sass")||n.endsWith(".less")))}var Wt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList||{},this.excludeList=e.excludeList||{}}apply(e){let s=this.includeList||{},r={};for(let[n,o]of Object.entries(s)){let i=Fi(o,this.excludeList),c=Ci(o,this.excludeList),l=[...i,...c];(c.length||i.length)&&(r[n]={import:l})}e.options.entry={...e.options.entry,...r}}};var Q=require("@rspack/core"),kl=['var isBrowser = !!(() => { try { return browser.runtime.getURL("/") } catch(e) {} })()','var isChrome = !!(() => { try { return chrome.runtime.getURL("/") } catch(e) {} })()'],$l=[...kl,`var runtime = isBrowser ? browser : isChrome ? chrome : (typeof self === 'object' && self.addEventListener) ? { get runtime() { throw new Error("No chrome or browser runtime found") } } : { runtime: { getURL: x => x } }`],Jt=class t{apply(e){let{RuntimeGlobals:s}=e.webpack;e.hooks.compilation.tap("PublicPathRuntimeModule",r=>{r.hooks.runtimeRequirementInTree.for(s.publicPath).tap(t.name,n=>{let o=Fl();return r.addRuntimeModule(n,o),!0})})}};function Fl(){class t extends Q.RuntimeModule{constructor(){super("publicPath",Q.RuntimeModule.STAGE_BASIC)}generate(){let s=this.compilation?.outputOptions.publicPath;return Q.Template.asString([...$l,`var path = ${JSON.stringify(this.compilation?.getPath(s||"",{hash:this.compilation.hash||"XXXX"}))}`,`${Q.RuntimeGlobals.publicPath} = typeof importScripts === 'function' || !(isBrowser || isChrome) ? path : runtime.runtime.getURL(path);`])}}return new t}var zt=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList||{},this.excludeList=e.excludeList||{}}apply(e){let s=require(this.manifestPath),r=P(s,this.browser);r.content_scripts?.some(n=>n.world&&n.world.toLowerCase()==="main")&&Z.includes(this.browser)&&!r.key&&(console.error(Zr()),process.exit(1))}};var Ht=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Wt({manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Me.default.dirname(this.manifestPath)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:require.resolve(Me.default.join(__dirname,"add-hmr-accept-code.js")),options:{manifestPath:this.manifestPath,mode:e.options.mode,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="production"&&new Jt().apply(e),new zt({manifestPath:this.manifestPath,browser:this.browser||"chrome",includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Me.default.dirname(this.manifestPath)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:require.resolve(Me.default.join(__dirname,"deprecated-shadow-root.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]})}};var Re=a(require("path")),Ne=a(require("fs")),V=a(require("@rspack/core"));var ge=a(require("path")),Ae=a(require("fs"));function tr(t){let e=ge.default.join(ge.default.dirname(t),"_locales"),s=[];if(Ae.default.existsSync(e))for(let r of Ae.default.readdirSync(e)){let n=ge.default.join(e,r);if(n&&Ae.default.statSync(n).isDirectory())for(let o of Ae.default.readdirSync(n))s.push(ge.default.join(ge.default.dirname(t),"_locales",r,o))}return s}var Vt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:V.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(!Ne.default.existsSync(this.manifestPath)){let n=require(this.manifestPath),i=P(n,"chrome").name||"Extension.js";s.errors.push(new V.default.WebpackError(Tr(i,this.manifestPath)));return}if(s.errors.length>0)return;let r=tr(this.manifestPath);for(let n of Object.entries(r||[])){let[o,i]=n,c=i;if(c){if(Re.default.extname(c)!==".json")continue;if(!Ne.default.existsSync(c)){s.warnings.push(new V.default.WebpackError(rt(o,c)));return}let l=Ne.default.readFileSync(c),p=new V.sources.RawSource(l),u=e.options.context||Re.default.dirname(this.manifestPath);if(!$(c,this.excludeList)){let m=Re.default.relative(u,c);s.emitAsset(m,p)}}}})}),e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:V.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=tr(this.manifestPath);for(let n of Object.entries(r||[])){let[,o]=n;if(o){let i=new Set(s.fileDependencies),c=r||[];for(let l of c)Ne.default.existsSync(l)&&Re.default.extname(l)===".json"&&(i.has(l)||(i.add(l),s.fileDependencies.add(l)))}}})})}};var Xt=a(require("fs")),ee=a(require("@rspack/core"));var Gt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:ee.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[o,i]=n,c=Array.isArray(i)?i:[i];for(let l of c)if(l&&!$(l,this.excludeList)){if(!Xt.default.existsSync(l)){s.warnings.push(new ee.default.WebpackError(rt(o,l)));return}let p=Xt.default.readFileSync(l),u=new ee.sources.RawSource(p);s.emitAsset(o+".json",u)}}})}),e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:ee.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,o]=n,i=Array.isArray(o)?o:[o];for(let c of i)if(c){let l=new Set(s.fileDependencies);$(c,this.excludeList)||Xt.default.existsSync(c)&&(l.has(c)||(l.add(c),s.fileDependencies.add(c)))}}})})}};var sr=a(require("fs")),ji=a(require("path")),Kt=require("@rspack/core");var Zt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("icons:emit-file",s=>{s.hooks.processAssets.tap({name:"icons:emit-file",stage:Kt.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[o,i]=n;if(i===void 0)continue;let c=Array.isArray(i)?typeof i[0]=="string"?i:i.map(Object.values).flat():[i];for(let l of c)if(l){if(!sr.default.existsSync(l))continue;if(!$(l,this.excludeList)){let p=sr.default.readFileSync(l),u=new Kt.sources.RawSource(p),m=ji.default.basename(l),b=`${o.endsWith("theme_icons")?o.replace("theme_icons",""):o}/${m}`;s.emitAsset(b,u)}}}})})}};var Di=a(require("fs")),Li=require("@rspack/core"),Yt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("icons:add-to-file-dependencies",s=>{s.hooks.processAssets.tap({name:"icons:add-to-file-dependencies",stage:Li.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,o]=n,i=Array.isArray(o)?typeof o[0]=="string"?o:o.map(Object.values).flat():[o];for(let c of i)if(c){let l=new Set(s.fileDependencies);Di.default.existsSync(c)&&(l.has(c)||(l.add(c),s.fileDependencies.add(c)))}}})})}};var Qt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Zt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Yt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var ts=require("@rspack/core");function Oi(t){return t.map(e=>{try{let s=new URL(e.replace(/^\*:\/\//,"https://"));return e.endsWith(s.pathname)?`${e.substring(0,e.length-s.pathname.length)}/*`:s.pathname==="/"?`${e}/*`:e}catch{return e}})}var es=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}generateManifestPatches(e,s){let r=W(e,this.manifestPath),n=r.web_accessible_resources||[],o=r.web_accessible_resources||[];for(let[l,p]of Object.entries(s)){let u=r.content_scripts?.find(m=>m.js?.some(g=>g.includes(l)));if(u){let m=u.matches||[],g=p.filter(b=>!b.endsWith(".map")&&!b.endsWith(".js"));if(g.length===0)continue;if(r.manifest_version===3){let b=n.find(_=>_.matches.some(S=>m.includes(S)));b?g.forEach(_=>{b.resources.includes(_)||b.resources.push(_)}):n.push({resources:g,matches:Oi(m)})}else g.forEach(b=>{o.includes(b)||o.push(b)})}}r.manifest_version===3?n.length>0&&(r.web_accessible_resources=n):o.length>0&&(r.web_accessible_resources=Array.from(new Set(o)));let i=JSON.stringify(r,null,2),c=new ts.sources.RawSource(i);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",c)}apply(e){e.hooks.thisCompilation.tap("plugin-extension:feature-web-resources",s=>{s.hooks.processAssets.tap({name:"plugin-extension:feature-web-resources",stage:ts.Compilation.PROCESS_ASSETS_STAGE_ANALYSE},()=>{let r=[],n=Object.keys(this.includeList||{});for(let c of n.filter(Boolean))c.startsWith("content_scripts")&&(Array.isArray(c)?r.push(...c):typeof c=="string"&&r.push(c));let o=s.chunkGraph,i={};s.entrypoints.forEach((c,l)=>{if(r.includes(l)){let p=[];c.chunks.forEach(u=>{Array.from(o.getChunkModulesIterable(u)).forEach(g=>{o.getModuleChunks(g).forEach(b=>{b.auxiliaryFiles.forEach(_=>{p.includes(_)||p.push(_)})})})}),i[l]=p}}),this.generateManifestPatches(s,i)})})}};var I=a(require("fs")),M=a(require("path")),Ii=a(require("chokidar")),ss=class{options;constructor(e){this.options=e}ensureDirectoryExistence(e){let s=M.default.dirname(e);if(I.default.existsSync(s))return!0;I.default.mkdirSync(s,{recursive:!0})}copyFile(e,s){this.ensureDirectoryExistence(s),I.default.copyFileSync(e,s)}copyFolder(e,s){I.default.existsSync(s)||I.default.mkdirSync(s,{recursive:!0}),I.default.readdirSync(e).forEach(n=>{let o=M.default.join(e,n),i=M.default.join(s,n);I.default.statSync(o).isDirectory()?this.copyFolder(o,i):this.copyFile(o,i)})}apply(e){let s=M.default.dirname(this.options.manifestPath),r=M.default.join(s,"public"),n=e.options.output?.path||"";I.default.existsSync(r)&&(e.hooks.afterEmit.tap("special-folders:copy-public-folder",()=>{let o=M.default.join(n,"/");I.default.existsSync(o)||I.default.mkdirSync(o,{recursive:!0}),I.default.existsSync(r)&&this.copyFolder(r,o)}),e.options.mode!=="production"&&e.hooks.afterPlugins.tap("special-folders:copy-public-folder",()=>{let o=M.default.join(s,"public"),i=Ii.default.watch(o,{ignoreInitial:!0});i.on("add",c=>{let l=M.default.join(n,M.default.relative(s,c));this.copyFile(c,l)}),i.on("change",c=>{let l=M.default.join(n,M.default.relative(s,c));this.copyFile(c,l)}),i.on("unlink",c=>{let l=M.default.join(n,M.default.relative(s,c));I.default.existsSync(l)&&I.default.unlinkSync(l)}),e.hooks.watchClose.tap("special-folders:copy-public-folder",()=>{i.close().catch(console.error)})}))}};var U=a(require("path")),rr=a(require("chokidar"));var rs=class{manifestPath;constructor(e){this.manifestPath=e}throwCompilationError(e,s,r){let n=U.relative(process.cwd(),s),c=qr(r?"Adding":"Removing",e,e==="pages"?"HTML pages":"script files",n);if(r){console.warn(c);return}console.error(c),process.exit(1)}apply(e){e.hooks.afterPlugins.tap("special-folders:warn-upon-folder-changes",()=>{let s=U.dirname(this.manifestPath),r=U.join(s,"pages"),n=U.join(s,"scripts"),o=rr.watch(r,{ignoreInitial:!0}),i=rr.watch(n,{ignoreInitial:!0}),c=e.options.resolve?.extensions;o.on("add",l=>{l.endsWith(".html")&&this.throwCompilationError("pages",l,!0)}),o.on("unlink",l=>{l.endsWith(".html")&&this.throwCompilationError("pages",l)}),i.on("add",l=>{c?.includes(U.extname(l))&&this.throwCompilationError("scripts",l,!0)}),i.on("unlink",l=>{c?.includes(U.extname(l))&&this.throwCompilationError("scripts",l)}),e.hooks.watchClose.tap("WarnUponFolderChanges",()=>{o.close().catch(console.error),i.close().catch(console.error)})})}};var ns=class{static name="plugin-special-folders";options;constructor(e){this.options=e}apply(e){let{manifestPath:s}=this.options;new ss({manifestPath:s}).apply(e),e.options.mode==="development"&&e.options.watchOptions&&new rs(s).apply(e)}};var os=class{static name="plugin-extension";manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){let s=this.manifestPath,r=le({manifestPath:s,browser:this.browser}),n=Oo({manifestPath:s,browser:this.browser});new jt({browser:this.browser,manifestPath:s,includeList:{...r.html,...r.icons,...r.json,...r.scripts},excludeList:n.public}).apply(e),new qt({manifestPath:s,includeList:{...r.html,...n.pages},excludeList:{...n.public,...n.scripts}}).apply(e),new Ht({manifestPath:s,browser:this.browser,includeList:{...r.scripts,...n.scripts},excludeList:{...n.public,...n.pages}}).apply(e),new Vt({manifestPath:s}).apply(e),new Gt({manifestPath:s,includeList:r.json,excludeList:n.public}).apply(e),new Qt({manifestPath:s,includeList:r.icons,excludeList:n.public}).apply(e),new es({manifestPath:s,includeList:{...r.scripts,...n.scripts},excludeList:n.public}).apply(e),new ns({manifestPath:s}).apply(e)}};var Be=a(require("path"));var Mi=a(require("path")),Ai=a(require("ws"));function is(t,e){t.clients.forEach(s=>{s.readyState===Ai.default.OPEN&&s.send(JSON.stringify(e))})}function Ri(t,e,s){if(!s||!e)return;let r=le({manifestPath:e}).locales,n=le({manifestPath:e}).scripts,o=le({manifestPath:e}).json;if(!t){process.env.EXTENSION_ENV==="development"&&console.error("WebSocket server is not running.");return}Mi.default.basename(s)==="manifest.json"&&is(t,{changedFile:"manifest.json"}),r?.forEach(i=>{i.includes(s)&&is(t,{changedFile:"_locales"})}),Object.entries(n).forEach(([i,c])=>{let l=Array.isArray(c)?c:[c];Object.values(l).flatMap(u=>u).includes(s)&&i==="background/service_worker"&&is(t,{changedFile:"service_worker"})}),Object.entries(o).forEach(([i,c])=>{c?.includes(s)&&i==="declarative_net_request"&&is(t,{changedFile:"declarative_net_request"})})}var or=a(require("path")),Bi=a(require("fs")),Ue=a(require("ws"));var Te=a(require("path")),Cl=a(require("http")),Ti=a(require("https")),nr=a(require("fs"));var Ni=t=>{if(!nr.default.existsSync(t))return;let e=Te.default.basename(t);return nr.default.readFileSync(Te.default.join(__dirname,"certs",e))};function Ui(t){let e={key:Ni(Te.default.join(__dirname,"certs","localhost.key")),cert:Ni(Te.default.join(__dirname,"certs","localhost.cert"))},s=Ti.default.createServer(e,(r,n)=>{n.writeHead(200),n.end()});return s.on("error",r=>{throw console.error(Gr(t)),new Error(r.message)}),{server:s,port:t}}function jl(t,e){switch(e){case"chrome":return new Ue.default.Server({host:"localhost",port:t});case"edge":return new Ue.default.Server({host:"localhost",port:t+1});case"firefox":return new Ue.default.Server({server:Ui(t+2).server});default:return new Ue.default.Server({host:"localhost",port:8888})}}async function qi(t,e){let s=t.options.context||"",r=require(or.default.join(s,"manifest.json")),o=jl(8e3,e.browser);if(o.on("connection",i=>{i.send(JSON.stringify({status:"serverReady"})),i.on("error",c=>{console.log(zr(c))}),i.on("message",c=>{let l=JSON.parse(c.toString());if(l.status==="clientReady"){let p=require(or.default.join(s,"manifest.json"));setTimeout(()=>{console.log(Ms(p,e.browser,l)),console.log("")},2500),tn(e.browser)&&setTimeout(()=>{console.log(Jr(e.browser))},5e3)}})}),e.browser==="firefox"||e.browser==="gecko-based"){let i=sn(r);console.log(Ms(r,e.browser,i)),console.log(""),Bi.default.existsSync(tt)||(console.log(Xr()),console.log(""))}return o}var Wi=a(require("path")),ir=a(require("fs"));function Ji(t,e){let s=Wi.default.resolve(__dirname,`./extensions/${t}-manager-extension/reload-service.js`);try{let r=ir.default.readFileSync(s,"utf8"),n=r.replace(/__RELOAD_PORT__/g,e.toString());n!==r&&ir.default.writeFileSync(s,n,"utf8")}catch(r){console.error(`Error processing file: ${r.message}`)}}process.on("SIGINT",()=>{process.exit()});process.on("SIGTERM",()=>{process.exit()});var qe=class{manifestPath;port;browser;stats;constructor(e){this.manifestPath=e.manifestPath,this.port=e.port||8e3,this.browser=e.browser||"chrome",this.stats=e.stats}async apply(e){if(!this.manifestPath)return;Ji(this.browser,this.port);let s=await qi(e,{...this,mode:e.options.mode,browser:this.browser,stats:this.stats,port:this.port});e.hooks.watchRun.tapAsync("reload:create-web-socket-server",(r,n)=>{let i=(r.modifiedFiles||new Set).values().next().value;if(!i){n();return}let c=Be.default.relative(Be.default.dirname(this.manifestPath),i),l=Be.default.relative(process.cwd(),Be.default.dirname(i));process.env.EXTENSION_ENV==="development"&&console.info(`\u25BA\u25BA Updated file \`${c}\` (relative to ${l})`),this.manifestPath&&Ri(s,this.manifestPath,i),n()})}};var ar=a(require("path"));function zi(t,e,s){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[ar.default.dirname(s)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:ar.default.resolve(__dirname,"./inject-chromium-client-loader"),options:{manifestPath:s,browser:e}}]})}var cr=a(require("path"));function Hi(t,e,s){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[cr.default.dirname(s)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:cr.default.resolve(__dirname,"./inject-firefox-client-loader"),options:{manifestPath:s,browser:e}}]})}var cs=require("@rspack/core");var lr=a(require("content-security-policy-parser"));function Vi(t){let e="";for(let s in t)e+=`${s} ${t[s].join(" ")}; `;return e.trim()}function Xi(t){let e=t.content_security_policy;if(!e)return"script-src 'self' 'unsafe-eval' blob: filesystem:; object-src 'self' blob: filesystem:; ";let s=(0,lr.default)(e);if(!s.get("script-src"))s.set("script-src",["'self'","'unsafe-eval'","blob:","filesystem:"]);else{let n=s.get("script-src")||[];n.includes("'unsafe-eval'")||n.push("'unsafe-eval'"),n.includes("blob:")||n.push("blob:"),n.includes("filesystem:")||n.push("filesystem:"),s.set("script-src",n)}s.get("object-src")||s.set("object-src",["'self'","blob:","filesystem:"]);let r=Object.fromEntries(s.entries());return Vi(r)}function Gi(t){let e=t.content_security_policy;if(!e)return{extension_pages:"script-src 'self'; object-src 'self';"};let s=(0,lr.default)(e.extension_pages||""),r={};for(let i in r)s.get(i)||s.set(i,r[i]);let n=Object.fromEntries(s.entries());return{extension_pages:Vi(n)}}function Zi(t){let e=["/*.json","/*.js","/*.css"],s=t.web_accessible_resources;if(!s||s.length===0)return e;let r=new Set(s);for(let n of e)r.has(n)||r.add(n);return Array.from(r)}function Ki(t){let e=["/*.json","/*.js","/*.css"];return[...t.web_accessible_resources||[],{resources:e,matches:["<all_urls>"]}]}function pr(t,e){return t.background?{background:{...t.background}}:e==="firefox"||e==="gecko-based"?{background:{...t.background||{},scripts:["background/script.js"]}}:t.manifest_version===2?{background:{...t.background||{},scripts:["background/script.js"]}}:{background:{...t.background||{},service_worker:"background/service_worker.js"}}}function fr(t){return t.externally_connectable&&!t.externally_connectable.ids?{externally_connectable:{...t.externally_connectable,ids:[...new Set(t.externally_connectable.ids||[]),"*"]}}:t.externally_connectable&&!t.externally_connectable.ids?{externally_connectable:{...t.externally_connectable,ids:["*"]}}:{}}var as=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}generateManifestPatches(e){let s=W(e,this.manifestPath),r={...s,content_security_policy:s.manifest_version===3?Gi(s):Xi(s),...s.manifest_version===3?s.permissions?{permissions:[...new Set(["scripting",...s.permissions])]}:{permissions:["scripting"]}:{},...pr(s,this.browser),...fr(s),web_accessible_resources:s.manifest_version===3?Ki(s):Zi(s)},n=JSON.stringify(r,null,2),o=new cs.sources.RawSource(n);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",o)}apply(e){e.hooks.thisCompilation.tap("run-chromium:apply-manifest-dev-defaults",s=>{s.hooks.processAssets.tap({name:"run-chromium:apply-manifest-dev-defaults",stage:cs.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},r=>{if(!this.manifestPath){let n="No manifest.json found in your extension bundle. Unable to patch manifest.json.";s&&e.rspack.WebpackError&&s.errors.push(new e.rspack.WebpackError(`run-chromium: ${n}`));return}this.generateManifestPatches(s)})})}};var ur=a(require("fs")),he=a(require("path")),Yi=a(require("webpack-target-webextension"));var ls=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}handleBackground(e,s,r){let n=he.default.resolve(__dirname,s==="firefox"||s==="gecko-based"?"minimum-firefox-file.mjs":"minimum-chromium-file.mjs"),o=he.default.dirname(this.manifestPath),i=P(r,s);if(s==="firefox"||s==="gecko-based"){i=r.background;let c=i?.scripts;if(c&&c.length>0){let l=he.default.join(o,c[0]);this.ensureFileExists(l)}else this.addDefaultEntry(e,"background/script",n)}else if(i=r.background,r.manifest_version===3){let c=i?.service_worker;if(c){let l=he.default.join(o,c);this.ensureFileExists(l)}else this.addDefaultEntry(e,"background/service_worker",n)}else if(r.manifest_version===2){let c=i?.scripts;if(c&&c.length>0){let l=he.default.join(o,c[0]);this.ensureFileExists(l)}else this.addDefaultEntry(e,"background/script",n)}}ensureFileExists(e){if(!ur.default.existsSync(e)&&this.manifestPath){let s=require(this.manifestPath),n=P(s,"chrome").name||"Extension.js",o=Hr(n,e);throw console.error(o),new Error(o)}}addDefaultEntry(e,s,r){e.options.entry={...e.options.entry,[s]:{import:[r]}}}getEntryName(e){if(e.background){if(this.browser==="firefox"||this.browser==="gecko-based")return{pageEntry:"background/script"};if(e.manifest_version===3)return{serviceWorkerEntry:"background/service_worker"};if(e.manifest_version===2)return{pageEntry:"background/script"}}return{pageEntry:"background"}}apply(e){if(!this.manifestPath||!ur.default.lstatSync(this.manifestPath).isFile())return;let s=require(this.manifestPath),r=P(s,this.browser);this.handleBackground(e,this.browser,r),new Yi.default({background:this.getEntryName(r),weakRuntimeCheck:!0}).apply(e)}};var mr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){(Z.includes(this.browser)||this.browser==="chromium-based")&&zi(e,this.browser,this.manifestPath),(this.browser==="firefox"||this.browser==="gecko-based")&&Hi(e,this.browser,this.manifestPath),new as({manifestPath:this.manifestPath,browser:this.browser}).apply(e),new ls({manifestPath:this.manifestPath,browser:this.browser}).apply(e)}},Qi=mr;var ps=class{static name="plugin-reload";manifestPath;browser;port;stats;autoReload;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.port=e.port,this.stats=e.stats,this.autoReload=e.autoReload}apply(e){e.options.mode==="development"&&new qe({manifestPath:this.manifestPath,browser:this.browser,port:this.port,stats:this.stats}).apply(e),e.options.mode==="development"&&new Qi({manifestPath:this.manifestPath,browser:this.browser,autoReload:this.autoReload,stats:this.stats}).apply(e)}};var ea=a(require("@rspack/core")),fs=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser}apply(e){new ea.default.ProvidePlugin({browser:require.resolve("webextension-polyfill")}).apply(e)}};var ms=require("@rspack/core");var us=class{browser;manifestPath;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}patchManifest(e){let s=P(e,this.browser);return JSON.stringify(s,null,2)}apply(e){e.hooks.compilation.tap("compatibility:browser-specific-fields",s=>{s.hooks.processAssets.tap({name:"compatibility:browser-specific-fields",stage:ms.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE},()=>{let r=W(s,this.manifestPath),n=this.patchManifest(r),o=new ms.sources.RawSource(n);s.updateAsset("manifest.json",o)})})}};var ds=class{static name="plugin-compatibility";manifestPath;browser;polyfill;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.polyfill=e.polyfill||!1}async apply(e){this.polyfill&&this.browser!=="firefox"&&new fs({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new us({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e)}};var wc=a(require("os")),wr=a(require("path"));var Fa=a(require("fs")),Ca=a(require("path")),ja=require("child_process");var be=a(require("path")),Je=a(require("fs"));var ta={alternate_error_pages:{enabled:!1},autofill:{enabled:!1},browser:{check_default_browser:!1,default_browser_setting_enabled:!1},default_apps:"install",distribution:{alternate_shortcut_text:!1,auto_launch_chrome:!1,import_bookmarks:!1,import_history:!1,import_home_page:!1,import_search_engine:!1,suppress_first_run_bubble:!0,do_not_register_for_update_launch:!0,make_chrome_default:!1,make_chrome_default_for_user:!1,require_eula:!1,suppress_first_run_default_browser_prompt:!0},dns_prefetching:{enabled:!1},download:{default_directory:"/tmp/",directory_upgrade:!0,open_pdf_in_adobe_reader:!1,prompt_for_download:!0},enable_do_not_track:!0,extensions:{theme:{use_system:!1},toolbarsize:-1,ui:{developer_mode:!0}},plugins:{plugins_list:[{enabled:!1,name:"Java(TM)"}],show_details:!0},profile:{password_manager_enabled:!1},safebrowsing:{enabled:!1,safebrowsingextended_reporting_enabled:!1},savefile:{default_directory:"/tmp",type:0},search:{suggest_enabled:!1},session:{restore_on_startup:1},sync:{suppress_start:!0},sync_promo:{show_on_first_run_allowed:!1,show_ntp_bubble:!1},translate:{enabled:!1}},sa={...ta},ra={...ta};var y=require("@colors/colors/safe");function w(t,e){let s=e==="warn"?(0,y.brightYellow)("\u25BA\u25BA\u25BA"):e==="info"?(0,y.cyan)("\u25BA\u25BA\u25BA"):e==="error"?`${(0,y.bold)((0,y.red)("ERROR"))} in ${ye(t)} ${(0,y.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:(0,y.brightGreen)("\u25BA\u25BA\u25BA");return`${(0,y.gray)("")}${s}`}function ye(t){return t.charAt(0).toUpperCase()+t.slice(1)}function gs(t){let e=ye(t);return`${w(t,"info")} Creating new ${e} user profile...`}function na(t){return`${w(t,"success")} Instance already running.`}function oa(t){return`${w(t,"info")} Instance exited.`}function hs(t,e){let s=t==="firefox"||t==="gecko-based"?"Add-on":"Extension";return`${w(t,"success")} ${ye(t)} ${s} running in ${(0,y.brightBlue)(e||"unknown")} mode.`}function We(t,e){let s=e=="null"?`Browser is not installed
|
|
74
|
+
of your ${(0,f.brightYellow)("extension.config.js")} is defined as your extension URL.`}var nt=class{static name="plugin-compilation";manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){new Kr.default().apply(e),new Qe({manifestPath:this.manifestPath,browser:this.browser}).apply(e),new et().apply(e),e.hooks.done.tapAsync("develop:brand",(s,r)=>{s.compilation.name=void 0;let n=s.compilation.endTime-s.compilation.startTime,o=require(this.manifestPath).name;console.log(Ir(o,n,s)),r()})}};var Pn=a(require("path"));var nn=a(require("path")),on=a(require("fs"));var ie=a(require("path")),ot=a(require("fs")),As=require("child_process"),Qr=require("package-manager-detector");function en(t,e){return Object.values(e||{}).some(s=>s===t)}function h(t,e,s){let r=ie.default.extname(e),o=$(e,s)?ie.default.normalize(e):t;return[".js",".jsx",".tsx",".ts"].includes(r)&&(o=o.replace(r,".js")),[".html",".njk",".nunjucks"].includes(r)&&(o=o.replace(r,".html")),[".css",".scss",".sass",".less"].includes(r)&&(o=o.replace(r,".css")),Rs(o||"")}function Rs(t){return t.replace(/\\/g,"/")}function $(t,e={}){if(!e)return!1;let s=ie.default.normalize(Rs(t));return Object.values(e).some(n=>typeof n!="string"?!1:Rs(n).includes(s))}function W(t,e){if(t.getAsset("manifest.json")||t.assets["manifest.json"]){let s=t.assets["manifest.json"].source().toString();return JSON.parse(s||"{}")}return require(e)}function ae(){return process.env.npm_config_user_agent&&process.env.npm_config_user_agent.includes("pnpm")?"pnpm":!1}function Yr(){return process.env.npm_execpath?"npm":!1}async function j(t,e){try{let s=await(0,Qr.detect)();console.log(Mr(t,s?.name||"unknown"));let r="";s?.name==="yarn"?r=`yarn --silent add ${e.join(" ")} --cwd ${__dirname} --optional`:s?.name==="npm"||Yr()?r=`npm --silent install ${e.join(" ")} --prefix ${__dirname} --save-optional`:ae()?r=`pnpm --silent add ${e.join(" ")} --prefix ${__dirname} --save-optional`:r=`${s} --silent install ${e.join(" ")} --cwd ${__dirname} --optional`,(0,As.execSync)(r,{stdio:"inherit"}),await new Promise(n=>setTimeout(n,2e3)),process.env.EXTENSION_ENV==="development"&&(console.log(Ar(t)),s?.name==="yarn"?r="yarn install --silent > /dev/null 2>&1":s?.name==="npm"||Yr()?r="npm install --silent > /dev/null 2>&1":ae()?r="pnpm install --silent > /dev/null 2>&1":r=`${s} install --silent > /dev/null 2>&1`,(0,As.execSync)(r,{stdio:"inherit"})),console.log(Rr(t))}catch(s){console.error(Nr(t,s))}}function it(t){let e=ie.default.join(t,"package.json");if(!ot.default.existsSync(e))return!1;let s=JSON.parse(ot.default.readFileSync(e,"utf-8")),r=["react","vue","@angular/core","svelte","solid-js","preact"],n=s.dependencies||{},o=s.devDependencies||{};for(let i of r)if(n[i]||o[i])return!0;return!1}function tn(t){return!ot.default.existsSync(ie.default.resolve(__dirname,`run-${t}-profile`))}function sn(t){let e=t.name?.replace(/ /g,"-").toLowerCase();return{data:{id:`${e}@extension-js`,manifest:t,management:{id:`${e}@extension-js`,mayDisable:!0,optionsUrl:"",installType:"development",type:"extension",enabled:!0,name:t.name||"",description:t.description||"",version:t.version||"",hostPermissions:t.host_permissions||[],permissions:t.permissions||[],offlineEnabled:t.offline_enabled||!1,shortName:t.short_name||"",isApp:t.app&&t.app.background&&t.app.background.scripts}}}}function P(t,e){return JSON.parse(JSON.stringify(t),function(n,o){let i=n.indexOf(":");if(i===-1)return o;let c=n.substring(0,i);(c===e||c==="chromium"&&Z.includes(e)||c==="chromium"&&e.includes("chromium")||c==="gecko"&&e.includes("gecko"))&&(this[n.substring(i+1)]=o)})}var rn=!1;function Pe(t){let e=nn.default.join(t,"package.json");if(!on.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.sass,n=s.dependencies&&s.dependencies.sass;return r||n?(rn||(process.env.EXTENSION_ENV==="development"&&console.log(v("SASS")),rn=!0),!0):!1}async function an(t){if(!Pe(t))return[];try{require.resolve("sass-loader")}catch{await j("PostCSS",["postcss-loader","postcss-scss","postcss-preset-env"]),await j("SASS",["sass","sass-loader"]),console.log(L("SASS")),process.exit(0)}return[{test:/\.(sass|scss)$/,exclude:/\.module\.(sass|scss)$/,type:"css",use:[{loader:require.resolve("sass-loader"),options:{sourceMap:!0,sassOptions:{outputStyle:"expanded"}}}]},{test:/\.module\.(sass|scss)$/,type:"css/module",use:[{loader:require.resolve("sass-loader"),options:{sourceMap:!0,sassOptions:{outputStyle:"expanded"}}}]}]}var ln=a(require("path")),pn=a(require("fs"));var cn=!1;function Ee(t){let e=ln.default.join(t,"package.json");if(!pn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.less,n=s.dependencies&&s.dependencies.less;return r||n?(cn||(process.env.EXTENSION_ENV==="development"&&console.log(v("LESS")),cn=!0),!0):!1}async function fn(t){if(!Ee(t))return[];try{require.resolve("less-loader")}catch{await j("LESS",["less","less-loader"]),console.log(L("LESS")),process.exit(0)}return[{test:/\.less$/,exclude:/\.module\.less$/,type:"css",use:[{loader:require.resolve("less-loader"),options:{sourceMap:!0}}]},{test:/\.module\.less$/,type:"css/module",use:[{loader:require.resolve("less-loader"),options:{sourceMap:!0}}]}]}var R=a(require("path")),N=a(require("fs"));function pl(t){let e=R.default.join(t,"stylelint.config.json"),s=R.default.join(t,".stylelintrc.js file"),r=R.default.join(t,"stylelint.config.mjs"),n=R.default.join(t,".stylelintrc.mjs"),o=R.default.join(t,"stylelint.config.cjs"),i=R.default.join(t,".stylelintrc.cjs"),c=R.default.join(t,".stylelintrc.json"),l=R.default.join(t,".stylelintrc"),p=R.default.join(t,".stylelintrc.yml"),u=R.default.join(t,".stylelintrc.yaml");if(N.default.existsSync(e))return e;if(N.default.existsSync(s))return s;if(N.default.existsSync(r))return r;if(N.default.existsSync(n))return n;if(N.default.existsSync(o))return o;if(N.default.existsSync(i))return i;if(N.default.existsSync(c))return c;if(N.default.existsSync(l))return l;if(N.default.existsSync(p))return p;if(N.default.existsSync(u))return u}var un=!1;function fl(t){let e=R.default.join(t,"package.json");if(!N.default.existsSync(e))return!1;let r=!!pl(t);return r&&(un||(process.env.EXTENSION_ENV==="development"&&console.log(v("Stylelint")),un=!0)),r}async function mn(t){return fl(t),[]}var wn=a(require("path"));var gn=a(require("path")),hn=a(require("fs"));var dn=!1;function at(t){let e=gn.default.join(t,"package.json");if(!hn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.tailwindcss,n=s.dependencies&&s.dependencies.tailwindcss,o=!!(r||n);return o&&(dn||(process.env.EXTENSION_ENV==="development"&&console.log(v("Tailwind")),dn=!0)),o}var Ns=a(require("path")),ct=a(require("fs"));var ce=!1,ul=[".postcssrc",".postcssrc.json",".postcssrc.yaml",".postcssrc.yml",".postcssrc.js",".postcssrc.cjs","postcss.config.js","postcss.config.cjs"];function yn(t){for(let e of ul){let s=Ns.default.join(t,e);if(ct.default.existsSync(s))return s}}function ml(t){let e=Ns.default.join(t,"package.json");if(!ct.default.existsSync(e))return!1;if(ct.default.existsSync(e)){let s=require(e);if(s.dependencies&&s.dependencies.postcss||s.devDependencies&&s.devDependencies.postcss)return ce||(process.env.EXTENSION_ENV==="development"&&console.log(v("PostCSS")),ce=!0),!0}return yn(t)?(ce||(process.env.EXTENSION_ENV==="development"&&console.log(v("PostCSS")),ce=!0),!0):at(t)?(ce||(process.env.EXTENSION_ENV==="development"&&console.log(v("PostCSS")),ce=!0),!0):!1}async function bn(t,e){if(!ml(t))return{};try{require.resolve("postcss-loader")}catch{!Pe(t)&&!Ee(t)&&await j("PostCSS",["postcss","postcss-loader","postcss-preset-env"]),console.log(L("PostCSS")),process.exit(0)}return{test:/\.css$/,type:"css",loader:require.resolve("postcss-loader"),options:{postcssOptions:{ident:"postcss",config:yn(t),plugins:[[require.resolve("postcss-preset-env"),{autoprefixer:{flexbox:"no-2009"},stage:3}]].filter(Boolean)},sourceMap:e.mode==="development"}}}async function lt(t,e){let s=[];if(at(t)||Pe(t)||Ee(t)){let r=await bn(t,e);r.loader&&s.push(r)}return e.loader&&s.push({loader:e.loader.startsWith("builtin:")?e.loader:require.resolve(e.loader),options:{...e.loaderOptions,sourceMap:e.mode==="development"}}),s.filter(Boolean)}var Ts=a(require("path")),xn=a(require("fs"));function pt(t,e){if(!t||!e)return!1;let s=JSON.parse(xn.default.readFileSync(e,"utf8"));for(let r of s.content_scripts||[])if(r.js?.length){for(let n of r.js)if(Ts.default.resolve(Ts.default.dirname(e),n)===t)return!0}return!1}async function vn(t,e){let s=wn.default.join(t,"manifest.json");return[{test:/\.css$/,type:"asset",generator:{filename:"content_scripts/[name].[contenthash:8].css"},issuer:r=>pt(r,s),use:await lt(t,{mode:e})}]}var Sn=a(require("path"));async function _n(t,e){let s=Sn.default.join(t,"manifest.json");return[{test:/\.css$/,type:"css",issuer:r=>!pt(r,s),use:await lt(t,{mode:e})}]}var ft=class t{static name="plugin-css";manifestPath;constructor(e){this.manifestPath=e.manifestPath}async configureOptions(e){let s=e.options.mode||"development",r=Pn.default.dirname(this.manifestPath),n=[],o=await mn(r);n.push(...o);let i=[...await vn(r,s),...await _n(r,s)],c=await an(r),l=await fn(r);c.length&&i.push(...c),l.length&&i.push(...l),e.options.plugins=[...e.options.plugins,...n].filter(Boolean),e.options.module.rules=[...e.options.module.rules,...i].filter(Boolean)}async apply(e){if((e.options.mode||"development")==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var ut=class{static name="plugin-static-assets";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async apply(e){let s={test:/\.svg$/i,type:"asset",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2048}}},n=[...e.options.module.rules.some(o=>o&&o.test instanceof RegExp&&o.test.test(".svg")&&o.use!==void 0)?[]:[s],{test:/\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$/i,type:"asset",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(woff|woff2|eot|ttf|otf)$/i,type:"asset",generator:{filename:"assets/[name][ext]"}},{test:/\.(txt|md|csv|tsv|xml|pdf|docx|doc|xls|xlsx|ppt|pptx|zip|gz|gzip|tgz)$/i,type:"asset",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(csv|tsv)$/i,use:[require.resolve("csv-loader")],generator:{filename:"assets/[name][ext]"}}];e.options.module.rules=[...e.options.module.rules,...n].filter(o=>!!o)}};var $e=a(require("path"));var Us=a(require("path")),Bs=a(require("fs"));var En=!1,dl=[".babelrc",".babelrc.json",".babelrc.js",".babelrc.cjs","babel.config.json","babel.config.js","babel.config.cjs"];function gl(t){let e=Us.default.join(t,"package.json");if(!Bs.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies["babel-core"],n=s.dependencies&&s.dependencies["babel-core"],o=dl.some(i=>Bs.default.existsSync(Us.default.join(t,i)))||!!r||!!n;return o&&(En||(process.env.EXTENSION_ENV==="development"&&process.env.EXTENSION_ENV==="development"&&console.log(v("Babel")),En=!0)),o}async function kn(t,e){gl(e)}var Fn=a(require("path")),Cn=a(require("fs"));var $n=!1;function ke(t){let e=Fn.default.join(t,"package.json");if(!Cn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.preact,n=s.dependencies&&s.dependencies.preact;return(r||n)&&($n||(process.env.EXTENSION_ENV==="development"&&console.log(v("Preact")),$n=!0)),!!r||!!n}async function jn(t){if(!ke(t))return;try{require.resolve("@rspack/plugin-preact-refresh")}catch{await j("Preact",["@prefresh/core","@prefresh/utils","@rspack/plugin-preact-refresh","preact"]),console.log(L("Preact")),process.exit(0)}return{plugins:[new(require("@rspack/plugin-preact-refresh"))],loaders:void 0,alias:{react:"preact/compat","react-dom/test-utils":"preact/test-utils","react-dom":"preact/compat","react/jsx-runtime":"preact/jsx-runtime"}}}var Ln=a(require("path")),On=a(require("fs"));var Dn=!1;function mt(t){let e=Ln.default.join(t,"package.json");if(!On.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.react,n=s.dependencies&&s.dependencies.react;return(r||n)&&(Dn||(process.env.EXTENSION_ENV==="development"&&console.log(v("React")),Dn=!0)),!!r||!!n}async function In(t){if(!mt(t))return;try{require.resolve("react-refresh")}catch{await j("React",["react-refresh","@rspack/plugin-react-refresh"]),console.log(L("React")),process.exit(0)}return{plugins:[new(require("@rspack/plugin-react-refresh"))({overlay:!1})],loaders:void 0,alias:void 0}}var An=a(require("path")),Rn=a(require("fs")),Nn=require("vue-loader");var Mn=!1;function hl(t){let e=An.default.join(t,"package.json");if(!Rn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies.vue,n=s.dependencies&&s.dependencies.vue;return(r||n)&&(Mn||(process.env.EXTENSION_ENV==="development"&&console.log(v("Vue")),Mn=!0)),!!r||!!n}async function Tn(t){if(!hl(t))return;try{require.resolve("vue-loader")}catch{await j("Vue",["vue-loader","vue-template-compiler","@vue/compiler-sfc"]),console.log(L("Vue")),process.exit(0)}let e=[{test:/\.vue$/,loader:require.resolve("vue-loader"),options:{experimentalInlineMatchResource:!0},include:t,exclude:/node_modules/}];return{plugins:[new Nn.VueLoaderPlugin],loaders:e,alias:void 0}}var dt=a(require("path")),gt=a(require("fs"));var Un=!1;function K(t){let e=dt.default.join(t,"package.json");if(!gt.default.existsSync(e))return!1;let s=bl(t),r=require(e),n=r.devDependencies&&r.devDependencies.typescript,o=r.dependencies&&r.dependencies.typescript;return Un||((n||o)&&(s?process.env.EXTENSION_ENV==="development"&&console.log(v("TypeScript")):(console.log(Wr()),xl(t))),Un=!0),!!s&&!!(n||o)}function yl(t,e){return{compilerOptions:{allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,jsx:it(t)?"react-jsx":"preserve",lib:["dom","dom.iterable","esnext"],moduleResolution:"node",module:"esnext",resolveJsonModule:!0,strict:!0,target:"esnext",isolatedModules:!1,skipLibCheck:!0},exclude:["node_modules","dist"]}}function bl(t){let e=dt.default.join(t,"tsconfig.json");if(gt.default.existsSync(e))return e}function xl(t){gt.default.writeFileSync(dt.default.join(t,"tsconfig.json"),JSON.stringify(yl(t,{mode:"development"}),null,2))}var qn=a(require("path")),Wn=a(require("fs")),Jn=require("svelte-preprocess");var Bn=!1;function wl(t){let e=qn.default.join(t,"package.json");if(!Wn.default.existsSync(e))return!1;let s=require(e),r=s.devDependencies&&s.devDependencies?.svelte,n=s.dependencies&&s.dependencies.svelte;return(r||n)&&(Bn||(process.env.EXTENSION_ENV==="development"&&console.log(v("Svelte")),Bn=!0)),!!r||!!n}async function zn(t,e){if(!wl(t))return;try{require.resolve("svelte-loader")}catch{await j("TypeScript",["typescript"]),await j("Svelte",["svelte-loader","svelte-preprocess"]),console.log(L("Svelte")),process.exit(0)}return{plugins:void 0,loaders:[{test:/\.svelte\.ts$/,use:[require.resolve("svelte-loader")],include:t,exclude:/node_modules/},{test:/\.(svelte|svelte\.js)$/,use:{loader:require.resolve("svelte-loader"),options:{preprocess:(0,Jn.sveltePreprocess)({typescript:!0}),emitCss:!0,compilerOptions:{dev:e==="development",css:"injected"},hotReload:e==="development"}},include:t,exclude:/node_modules/},{test:/node_modules\/svelte\/.*\.mjs$/,resolve:{fullySpecified:!1}}],alias:void 0}}var ht=class t{static name="plugin-js-frameworks";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=e.options.mode||"development",r=$e.default.dirname(this.manifestPath),n=await kn(e,r),o=await In(r),i=await jn(r),c=await Tn(r),l=await zn(r,s);e.options.resolve.alias={...n?.alias||{},...o?.alias||{},...i?.alias||{},...c?.alias||{},...l?.alias||{},...e.options.resolve.alias},e.options.module.rules=[{test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[$e.default.dirname(this.manifestPath)],exclude:[/[\\/]node_modules[\\/]/],use:{loader:"builtin:swc-loader",options:{sync:!0,module:{type:"es6"},minify:s==="production",isModule:!0,sourceMap:this.mode==="development",env:{targets:["chrome >= 100"]},jsc:{parser:{syntax:K(r)?"typescript":"ecmascript",tsx:K(r)&&(mt(r)||ke(r)),jsx:!K(r)&&(mt(r)||ke(r)),dynamicImport:!0},transform:{react:{development:s==="development",refresh:s==="development",runtime:"automatic",importSource:"react",...ke(r)?{pragma:"h",pragmaFrag:"Fragment",throwIfNamespace:!0,useBuiltins:!1}:{}}}}}}},...n?.loaders||[],...o?.loaders||[],...i?.loaders||[],...c?.loaders||[],...l?.loaders||[],...e.options.module.rules].filter(Boolean),o?.plugins?.forEach(p=>p.apply(e)),i?.plugins?.forEach(p=>p.apply(e)),c?.plugins?.forEach(p=>p.apply(e)),l?.plugins?.forEach(p=>p.apply(e)),K(r)&&(e.options.resolve.tsConfig={configFile:$e.default.resolve($e.default.dirname(this.manifestPath),"tsconfig.json")})}async apply(e){if((e.options.mode||"development")==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var Lo=a(require("path"));var Hn=a(require("path"));function Vn(t,e){if(!e||!e.action||!e.action.default_popup)return;let s=e.action.default_popup;return Hn.default.join(t,s)}var Xn=a(require("path"));function Gn(t,e){if(!e||!e.browser_action||!e.browser_action.default_popup)return;let s=e.browser_action.default_popup;return Xn.default.join(t,s)}var yt=a(require("path"));function Zn(t,e){let s={newtab:void 0};if(!e||!e.chrome_url_overrides)return{"chrome_url_overrides/newtab":void 0};if(e.chrome_url_overrides.history){let r=e.chrome_url_overrides.history;s={"chrome_url_overrides/history":yt.default.join(t,r)}}if(e.chrome_url_overrides.newtab){let r=e.chrome_url_overrides.newtab;s={"chrome_url_overrides/newtab":yt.default.join(t,r)}}if(e.chrome_url_overrides.bookmarks){let r=e.chrome_url_overrides.bookmarks;s={"chrome_url_overrides/bookmarks":yt.default.join(t,r)}}return s}var Kn=a(require("path"));function Yn(t,e){if(!e||!e.devtools_page)return;let s=e.devtools_page;return Kn.default.join(t,s)}var qs=a(require("path"));function Qn(t,e){if(e.options_page){let r=e.options_page;return qs.default.join(t,r)}if(!e||!e.options_ui||!e.options_ui.page)return;let s=e.options_ui.page;return qs.default.join(t,s)}var eo=a(require("path"));function to(t,e){if(!e||!e.page_action||!e.page_action.default_popup)return;let s=e.page_action.default_popup;return eo.default.join(t,s)}var so=a(require("path"));function ro(t,e){if(!e||!e.sandbox||!e.sandbox.pages)return{"sandbox/page-0":void 0};let s=e.sandbox.pages,r={};for(let[n,o]of s.entries())r[`sandbox/page-${n}`]=so.default.join(t,o);return r}var no=a(require("path"));function oo(t,e){if(!e||!e.side_panel||!e.side_panel.default_path)return;let s=e.side_panel.default_path;return no.default.join(t,s)}var io=a(require("path"));function ao(t,e){if(!e||!e.sidebar_action||!e.sidebar_action.default_panel)return;let s=e.sidebar_action.default_panel;return io.default.join(t,s)}function Fe(t,e){return{"action/default_popup":Vn(t,e),"browser_action/default_popup":Gn(t,e),...Zn(t,e),devtools_page:Yn(t,e),"options_ui/page":Qn(t,e),"page_action/default_popup":to(t,e),...ro(t,e),"side_panel/default_path":oo(t,e),"sidebar_action/default_panel":ao(t,e)}}var Ws=a(require("path"));function co(t,e){if(!e||!e.action||!e.action.default_icon)return;if(typeof e.action.default_icon=="string")return Ws.default.join(t,e.action.default_icon);let s=[];for(let r in e.action.default_icon)s.push(Ws.default.join(t,e.action.default_icon[r]));return s}var Js=a(require("path"));function lo(t,e){if(!e||!e.browser_action||!e.browser_action.default_icon)return;let s=[];if(typeof e.browser_action.default_icon=="string")return Js.default.join(t,e.browser_action.default_icon);for(let r in e.browser_action.default_icon){let n=e.browser_action.default_icon[r]=Js.default.join(t,e.browser_action.default_icon[r]);s.push(n)}return s}var zs=a(require("path"));function po(t,e){if(!(!e||!e.browser_action||!e.browser_action.theme_icons)){for(let s of e.browser_action.theme_icons)s.light&&(s.light=zs.default.join(t,s.light)),s.dark&&(s.dark=zs.default.join(t,s.dark)),s.size&&delete s.size;return e.browser_action.theme_icons}}var fo=a(require("path"));function uo(t,e){if(!e||!e.icons)return;let s=[];for(let r in e.icons){let n=fo.default.join(t,e.icons[r]);s.push(n)}return s}var Hs=a(require("path"));function mo(t,e){if(!e||!e.page_action||!e.page_action.default_icon)return;if(typeof e.page_action.default_icon=="string")return Hs.default.join(t,e.page_action.default_icon);let s=[];for(let r in e.page_action.default_icon){let n=Hs.default.join(t,e.page_action.default_icon[r]);s.push(n)}return s}var go=a(require("path"));function ho(t,e){return!e||!e.sidebar_action||!e.sidebar_action.default_icon?void 0:go.default.join(t,e.sidebar_action.default_icon)}function yo(t,e){return{action:co(t,e),browser_action:lo(t,e),"browser_action/theme_icons":po(t,e),icons:uo(t,e),page_action:mo(t,e),sidebar_action:ho(t,e)}}var bo=a(require("path"));function xo(t,e){let s={};return!e||!e.declarative_net_request||!e.declarative_net_request.rule_resources?{"declarative_net_request/rule_resources-0":void 0}:(e.declarative_net_request.rule_resources.forEach(n=>{s[`declarative_net_request/${n.id}`]=bo.default.join(t,n.path)}),s)}var wo=a(require("path"));function vo(t,e){if(!e||!e.storage||!e.storage.managed_schema)return;let s=e.storage.managed_schema;return wo.default.join(t,s)}function So(t,e){return{...xo(t,e),"storage/managed_schema":vo(t,e)}}var Ce=a(require("path")),je=a(require("fs"));function _o(t,e){let s=Ce.default.join(Ce.default.dirname(e),"_locales"),r=[];if(je.default.existsSync(s))for(let n of je.default.readdirSync(s)){let o=Ce.default.join(s,n);if(o&&je.default.statSync(o).isDirectory())for(let i of je.default.readdirSync(o))r.push(Ce.default.join(t,"_locales",n,i))}return r}var Po=a(require("path"));function Eo(t,e){if(!e||!e.background)return;let s=e.background.scripts;if(s)return s.map(r=>Po.default.join(t,r))}var ko=a(require("path"));function $o(t,e){if(!e||!e.background)return;let s=e.background.service_worker;if(s)return ko.default.join(t,s)}var Vs=a(require("path"));function Fo(t,e){if(!e||!e.content_scripts)return{"content_scripts/content-0":void 0};let s=o=>{if(o.js?.length!==0)return o.js?.map(i=>Vs.default.join(t,i))},r=o=>{if(o.css?.length!==0)return o.css?.map(i=>Vs.default.join(t,i))},n={};for(let[o,i]of e.content_scripts.entries()){let c=s(i),l=r(i);n[`content_scripts/content-${o}`]=[...(c||[]).filter(p=>p!=null),...(l||[]).filter(p=>p!=null)]}return n}var Co=a(require("path"));function jo(t,e){if(!e||!e.user_scripts||!e.user_scripts.api_script)return;let s=e.user_scripts.api_script;return Co.default.join(t,s)}function De(t,e){return{"background/scripts":Eo(t,e),"background/service_worker":$o(t,e),...Fo(t,e),"user_scripts/api_script":jo(t,e)}}function Do(t){if(!(!t||!t.web_accessible_resources||!t.web_accessible_resources.length))return t.web_accessible_resources}function le({manifestPath:t,browser:e}){let s=Lo.default.dirname(t),r=require(t),n=P(r,e||"chrome");return{html:Fe(s,n),icons:yo(s,n),json:So(s,n),locales:_o(s,t),scripts:De(s,n),web_accessible_resources:Do(n)}}var pe=a(require("path"));var bt=a(require("fs")),Le=a(require("path"));function xt(t,e){if(!bt.default.existsSync(t)||!bt.default.statSync(t).isDirectory())return[];let s=[];function r(n){let o=bt.default.readdirSync(n,{withFileTypes:!0});for(let i of o){let c=Le.default.join(n,i.name);i.isDirectory()?r(c):i.isFile()&&e(i.name)&&s.push(c)}}return r(t),s}function wt(t,e,s=""){return!e||!e.length?{}:e.reduce((r,n)=>{let o=Le.default.extname(n),i=Le.default.basename(n,o),c=s?`${s}/${i}`:Le.default.relative(t,n);return{...r,[c]:n}},{})}function Oo({manifestPath:t}){let e=pe.default.dirname(t),s={public:pe.default.join(e,"public"),pages:pe.default.join(e,"pages"),scripts:pe.default.join(e,"scripts")},r={public:xt(s.public,()=>!0),pages:xt(s.pages,o=>o.endsWith(".html")),scripts:xt(s.scripts,o=>[".js",".mjs",".jsx",".mjsx",".ts",".mts",".tsx",".mtsx"].includes(pe.default.extname(o)))};return{public:wt(e,r.public),pages:wt(e,r.pages,"pages"),scripts:wt(e,r.scripts,"scripts")}}var Io=a(require("fs")),fe=a(require("@rspack/core"));var vt=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){e.hooks.thisCompilation.tap("manifest:emit-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:emit-manifest",stage:fe.Compilation.PROCESS_ASSETS_STAGE_PRE_PROCESS},()=>{let r=this.manifestPath,n;try{let c=Io.default.readFileSync(r,"utf-8");n=JSON.parse(c),"$schema"in n&&delete n.$schema}catch(c){s.errors.push(new fe.default.WebpackError(Ur(c)));return}let o=JSON.stringify(n,null,2);s.emitAsset("manifest.json",new fe.sources.RawSource(o))})})}};var Oe=require("@rspack/core");function Mo(t,e){return t.background&&t.background.scripts&&{background:{...t.background,...t.background.scripts&&{scripts:[...t.background.scripts.map(s=>h("background/scripts.js",s,e))]}}}}var Ao=a(require("path"));var St=t=>Ao.default.basename(t);function Ro(t,e){return t.browser_action&&{browser_action:{...t.browser_action,...t.browser_action.default_popup&&{default_popup:h("browser_action/default_popup.html",t.browser_action.default_popup,e)},...t.browser_action.default_icon&&{default_icon:typeof t.browser_action.default_icon=="string"?h(`icons/${St(t.browser_action.default_icon)}`,t.browser_action.default_icon,e):Object.fromEntries(Object.entries(t.browser_action.default_icon).map(([s,r])=>[s,h(`icons/${St(r)}`,r,e)]))},...t.browser_action.theme_icons&&{theme_icons:t.browser_action.theme_icons.map(s=>({...s,...s.light&&{light:h(`browser_action/${St(s.light)}`,s.light,e)},...s.dark&&{dark:h(`browser_action/${St(s.dark)}`,s.dark,e)}}))}}}}function No(t,e){return t.declarative_net_request&&{declarative_net_request:{...t.declarative_net_request,rule_resources:t.declarative_net_request.rule_resources.map(s=>({...s,path:s.path&&h(`declarative_net_request/${s.id}.json`,s.path,e)}))}}}function To(t,e){return{...Mo(t,e),...Ro(t,e),...No(t,e)}}var Bo=a(require("path"));var Uo=t=>Bo.default.basename(t);function qo(t,e){return t.action&&{action:{...t.action,...t.action.default_popup&&{default_popup:h("action/default_popup.html",t.action.default_popup,e)},...t.action.default_icon&&{default_icon:typeof t.action.default_icon=="string"?h(`action/${Uo(t.action.default_icon)}`,t.action.default_icon,e):Object.fromEntries(Object.entries(t.action.default_icon).map(([s,r])=>[s,h(`action/${Uo(r)}`,r,e)]))}}}}function Wo(t,e){return t.background&&t.background.service_worker&&{background:{...t.background,...t.background.service_worker&&{service_worker:h("background/service_worker.js",t.background.service_worker,e)}}}}function _t(t,e){return t.side_panel&&{side_panel:{...t.side_panel.default_path&&{default_path:h("side_panel/default_path.html",t.side_panel.default_path,e)}}}}function Jo(t,e){return{...qo(t,e),...Wo(t,e),..._t(t,e)}}function zo(t,e){return t.background&&t.background.page&&{background:{...t.background,...t.background.page&&{page:h("background/page.html",t.background.page,e)}}}}function Ho(t,e){return t.chrome_url_overrides&&{chrome_url_overrides:{...t.chrome_url_overrides.bookmarks&&{bookmarks:h("chrome_url_overrides/bookmarks.html",t.chrome_url_overrides.bookmarks,e)},...t.chrome_url_overrides.history&&{history:h("chrome_url_overrides/history.html",t.chrome_url_overrides.history,e)},...t.chrome_url_overrides.newtab&&{newtab:h("chrome_url_overrides/newtab.html",t.chrome_url_overrides.newtab,e)}}}}function Vo(t,e){return t.content_scripts&&{content_scripts:t.content_scripts.map((s,r)=>{let n=[...new Set(s.js)],o=[...new Set(s.css)];return{...s,js:[...n.map(i=>h(`content_scripts/content-${r}.js`,i,e))],css:[...o.map(i=>h(`content_scripts/content-${r}.css`,i,e))]}})}}function Xo(t,e){return t.devtools_page&&{devtools_page:h("devtools_page.html",t.devtools_page,e)}}var Go=a(require("path"));var vl=t=>Go.default.basename(t);function Zo(t,e){return t.icons&&{icons:Object.fromEntries(Object.entries(t.icons).map(([s,r])=>[s,h(`icons/${vl(r)}`,r,e)]))}}function Ko(t,e){return t.options_page&&{options_page:h("options_ui/page.html",t.options_page,e)}}function Yo(t,e){return t.options_ui&&{options_ui:{...t.options_ui,...t.options_ui.page&&{page:h("options_ui/page.html",t.options_ui.page,e)}}}}var ei=a(require("path"));var Qo=t=>ei.default.basename(t);function ti(t,e){return t.page_action&&{page_action:{...t.page_action,...t.page_action.default_popup&&{default_popup:h("page_action/default_popup.html",t.page_action.default_popup,e)},...t.page_action.default_icon&&{default_icon:typeof t.page_action.default_icon=="string"?h(`icons/${Qo(t.page_action.default_icon)}`,t.page_action.default_icon,e):Object.fromEntries(Object.entries(t.page_action.default_icon).map(([s,r])=>[s,h(`icons/${Qo(r)}`,r,e)]))}}}}function si(t,e){return t.sandbox&&{sandbox:{...t.sandbox,...t.sandbox.pages&&{pages:t.sandbox.pages.map((s,r)=>h(`sandbox/page-${r}.html`,s,e))}}}}var ri=a(require("path"));var Sl=t=>ri.default.basename(t);function ni(t,e){return t.sidebar_action&&{sidebar_action:{...t.sidebar_action,...t.sidebar_action.default_panel&&{default_panel:h("sidebar_action/default_panel.html",t.sidebar_action.default_panel,e)},...t.sidebar_action.default_icon&&{default_icon:h(`icons/${Sl(t.sidebar_action.default_icon)}`,t.sidebar_action.default_icon,e)}}}}function oi(t,e){return t.storage&&{storage:{...t.storage.managed_schema&&{managed_schema:h("storage/managed_schema.json",t.storage.managed_schema,e)}}}}var ii=a(require("path"));var _l=t=>ii.default.basename(t);function ai(t,e){return t.theme&&{theme:{...t.theme,...t.theme.images&&{images:{...t.theme.images,theme_frame:h(`theme/images/${_l(t.theme.images.theme_frame)}`,t.theme.images.theme_frame,e)}}}}}function ci(t,e){return t.user_scripts&&{user_scripts:{...t.user_scripts,...t.user_scripts.api_script&&{api_script:h("user_scripts/api_script.js",t.user_scripts.api_script,e)}}}}function li(t){return t.web_accessible_resources&&t.web_accessible_resources.length&&{web_accessible_resources:t.web_accessible_resources}}function pi(t,e){return{...zo(t,e),...Ho(t,e),...Vo(t,e),...Xo(t,e),...Zo(t,e),...Ko(t,e),...Yo(t,e),...ti(t,e),...si(t,e),..._t(t,e),...ni(t,e),...oi(t,e),...ai(t,e),...ci(t,e),...li(t)}}function Xs(t,e,s){let r=e||require(t);return JSON.stringify({...r,...pi(r,s),...To(r,s),...Jo(r,s)},null,2)}var Pt=class{manifestPath;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.excludeList=e.excludeList}applyDevOverrides(e){return e.content_scripts?e.content_scripts.map((s,r)=>(s.css.length&&!s.js.length&&(s.js=[h(`content_scripts-${r}`,"dev.js",{})]),s)):{}}apply(e){e.hooks.thisCompilation.tap("manifest:update-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:update-manifest",stage:Oe.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},()=>{if(s.errors.length>0)return;let r=W(s,this.manifestPath),n=Xs(this.manifestPath,r,this.excludeList||{}),o={...r,...JSON.parse(n)};e.options.mode==="development"&&o.content_scripts&&(o.content_scripts=this.applyDevOverrides(o));let i=JSON.stringify(o,null,2),c=new Oe.sources.RawSource(i);s.updateAsset("manifest.json",c)}),e.options.mode==="production"&&s.hooks.processAssets.tap("manifest:update-manifest",()=>{if(s.errors.length>0)return;let r=W(s,this.manifestPath),n=Xs(this.manifestPath,r,this.excludeList||{}),o={...r,...JSON.parse(n)},i=JSON.stringify(o,null,2),c=new Oe.sources.RawSource(i);s.updateAsset("manifest.json",c)})})}};var fi=a(require("fs")),Et=class{dependencyList;constructor(e){this.dependencyList=e}apply(e){e.hooks.afterCompile.tap("manifest:add-dependency",s=>{if(s.errors?.length)return;let r=new Set(s.fileDependencies);this.dependencyList&&this.dependencyList.forEach(n=>{fi.default.existsSync(n)&&(r.has(n)||(r.add(n),s.fileDependencies.add(n)))})})}};var ui=a(require("fs")),mi=a(require("path")),$t=a(require("@rspack/core"));var kt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}extractPaths(e){let s=Array.isArray(e)?e:[e];if(typeof s[0]=="string")return s;let r=[];if(typeof e=="object"&&!Array.isArray(e)){let n=e;n.light&&r.push(n.light),n.dark&&r.push(n.dark)}return r}handleErrors(e,s){let r=[".png",".jpg",".jpeg",".svg",".gif",".webp"],n=[".json"],o=[".js",".ts",".jsx",".tsx",".mjs",".cjs"],i=".html",c=Object.entries(this.includeList||{});for(let[l,p]of c)if(p){let u=this.extractPaths(p);for(let m of u){let g=mi.default.extname(m),b=require(this.manifestPath),S=P(b,"chrome").name||"Extension.js";if(!ui.default.existsSync(m)){if(m.startsWith("/"))return;let E=oe(S,l,m);r.includes(g)?e.errors.push(new s(E)):n.includes(g)?e.errors.push(new s(E)):o.includes(g)?e.errors.push(new s(E)):g===i?e.errors.push(new s(E)):e.errors.push(new s(E))}}}}apply(e){e.hooks.compilation.tap("manifest:check-manifest-files",s=>{s.hooks.processAssets.tap({name:"compatibility:check-manifest-files",stage:$t.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT},()=>{let r=$t.default.WebpackError;this.handleErrors(s,r)})})}};var di=a(require("fs")),Ct=a(require("@rspack/core"));var Ft=class{manifestPath;browser;includeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList}flattenAndSort(e){return e.flat(1/0).sort()}apply(e){e.hooks.watchRun.tapAsync("manifest:throw-if-recompile-is-needed",(s,r)=>{if((s.modifiedFiles||new Set).has(this.manifestPath)){let o=s.options.context||"",i=`${o}/package.json`;if(!di.default.existsSync(i)){r();return}let c=require(this.manifestPath),l=P(c,this.browser),p=this.flattenAndSort(Object.values(Fe(o,l))),u=this.flattenAndSort(Object.values(De(o,l)));s.hooks.thisCompilation.tap("manifest:throw-if-recompile-is-needed",m=>{m.hooks.processAssets.tap({name:"manifest:check-manifest-files",stage:Ct.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY},()=>{let b=m.getAsset("manifest.json")?.source.source().toString(),_=JSON.parse(b||"{}"),S=this.flattenAndSort(Object.values(Fe(o,_))),E=this.flattenAndSort(Object.values(De(o,_)));if(u.toString()!==E.toString()||p.toString()!==S.toString()){let A=p.filter(q=>!S.includes(q))[0],T=S.filter(q=>!p.includes(q))[0],_e=Br(T,A);m.errors.push(new Ct.default.WebpackError(_e))}})})}r()})}};var jt=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new vt({manifestPath:this.manifestPath}).apply(e),new kt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Pt({manifestPath:this.manifestPath,excludeList:this.excludeList}).apply(e),new Et([this.manifestPath]).apply(e),new Ft({manifestPath:this.manifestPath,browser:this.browser,includeList:this.includeList}).apply(e)}};var Qs=a(require("path"));var Zs=a(require("fs")),Ot=a(require("@rspack/core")),xi=require("@rspack/core");var gi=a(require("fs")),me=a(require("path")),hi=a(require("parse5-utils"));var ue=a(require("parse5-utils"));function Dt(t){try{return new URL(t),!0}catch{return!1}}function Ie(t,e){let{childNodes:s=[]}=t;for(let r of s)if(r.nodeName==="script"){let n=ue.default.getAttribute(r,"src");if(!n||Dt(n))continue;e({filePath:n,childNode:r,assetType:"script"})}else if(r.nodeName==="link"){let n=ue.default.getAttribute(r,"href"),o=ue.default.getAttribute(r,"rel");if(!n||Dt(n))continue;e(o==="dns-prefetch"||o==="icon"||o==="manifest"||o==="modulepreload"||o==="preconnect"||o==="prefetch"||o==="preload"||o==="prerender"?{filePath:n,childNode:r,assetType:"staticHref"}:{filePath:n,childNode:r,assetType:"css"})}else if(r.nodeName==="a"||r.nodeName==="area"){let n=ue.default.getAttribute(r,"href");if(!n||Dt(n))continue;e({filePath:n,childNode:r,assetType:"staticHref"})}else if(r.nodeName==="audio"||r.nodeName==="embed"||r.nodeName==="iframe"||r.nodeName==="img"||r.nodeName==="input"||r.nodeName==="source"||r.nodeName==="track"||r.nodeName==="video"){let n=ue.default.getAttribute(r,"src");if(!n||Dt(n))continue;e({filePath:n,childNode:r,assetType:"staticSrc"})}else Ie(r,e)}function D(t,e){let s={css:[],js:[],static:[]};if(!t)return s;let r=e||gi.default.readFileSync(t,{encoding:"utf8"}),n=hi.default.parse(r),o=(i,c)=>me.default.join(me.default.dirname(i),c.startsWith("/")?me.default.relative(me.default.dirname(i),c):c);for(let i of n.childNodes)if(i.nodeName==="html"){for(let c of i.childNodes)(c.nodeName==="head"||c.nodeName==="body")&&Ie(c,({filePath:l,assetType:p})=>{let u=o(t,l);switch(p){case"script":s.js?.push(u);break;case"css":s.css?.push(u);break;case"staticSrc":case"staticHref":if(l.startsWith("#"))break;s.static?.push(u);break;default:break}});return{css:s.css,js:s.js,static:s.static}}}function yi(t,e,s){let r=Object.keys(t).find(o=>{let i=t[o];return t[o]===e||D(i)?.js?.includes(e)||D(i)?.css?.includes(e)})||"",n=Gs(e);return r?`/${r.replace(n,"")}${s}`:`${e.replace(n,"")}${s}`}function Gs(t){switch(me.default.extname(t)){case".js":case".mjs":case".ts":case".tsx":return".js";case".css":case".scss":case".sass":case".less":return".css";case".html":return".html";default:return".js"}}function z(t,e,s){return s?`/${t}${e}`:`${t}${e}`}function bi(t,e){return Object.values(e||{}).some(s=>s===t)}var Lt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let s=require(this.manifestPath),n=P(s,"chrome").name||"Extension.js";e.hooks.thisCompilation.tap("html:emit-html-file",o=>{o.hooks.processAssets.tap({name:"AddAssetsToCompilationPlugin",stage:Ot.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let i=Object.entries(this.includeList||{});for(let c of i){let[l,p]=c;if(p){if(!Zs.default.existsSync(p)){let m=oe(n,l,p);o.warnings.push(new Ot.default.WebpackError(m));return}let u=Zs.default.readFileSync(p,"utf8");if(!$(p,this.excludeList)){let m=new xi.sources.RawSource(u),g=z(l,".html");o.emitAsset(g,m)}}}})})}};var It=a(require("fs")),de=a(require("path")),Y=a(require("@rspack/core"));var Mt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.thisCompilation.tap("html:add-assets-to-compilation",s=>{s.hooks.processAssets.tap({name:"html:add-assets-to-compilation",stage:Y.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{if(s.errors.length>0)return;let r=Object.entries(this.includeList||{});for(let n of r){let[o,i]=n,c=o+".html";if(i){let l=s.getAsset(c);if(l){let p=l.source.source().toString(),u=D(i,p)?.static,m=[...new Set(u)];for(let g of m)if(!g.startsWith("/")){if(!It.default.existsSync(g)&&!bi(g,this.includeList)&&!de.default.basename(g).startsWith("#")){let A=st(i,g);g.startsWith("/")||s.warnings.push(new Y.default.WebpackError(A));return}let b=It.default.readFileSync(g),_=new Y.sources.RawSource(b),S=de.default.join("assets",de.default.basename(g));if(!s.getAsset(S))if(g.endsWith(".html")){let E=D(g),A=[...E?.js||[],...E?.css||[],...E?.static||[]];s.emitAsset(S,_),A.forEach(T=>{let _e=It.default.readFileSync(T),q=new Y.sources.RawSource(_e),Fr=de.default.join("assets",de.default.basename(T));s.getAsset(Fr)||s.emitAsset(Fr,q)})}else s.emitAsset(S,_)}}}}})})}};var wi=a(require("path")),Ks=a(require("fs"));var At=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let s=this.includeList||{};for(let r of Object.entries(s)){let[n,o]=r;if(o){if(!Ks.default.existsSync(o))return;let i=D(o),c=i?.js||[],l=i?.css||[],p=[...c,...l].filter(u=>!$(u,this.excludeList));if(e.options.mode==="development"){let u=wi.default.resolve(__dirname,"minimum-script-file.mjs");p.push(u)}Ks.default.existsSync(o)&&($(o,this.excludeList)||(e.options.entry={...e.options.entry,[n]:{import:p}}))}}}};var Nt=require("@rspack/core");var Ys=a(require("fs")),H=a(require("path")),O=a(require("parse5-utils"));function vi(t,e,s,r,n){let o=Ys.default.readFileSync(s,{encoding:"utf8"}),i=O.default.parse(o),c=!!t.getAsset(e+".css"),l=!1;for(let p of i.childNodes)if(p.nodeName==="html"){for(let u of p.childNodes){if((u.nodeName==="head"||u.nodeName==="body")&&Ie(u,({filePath:m,childNode:g,assetType:b})=>{let _=H.default.dirname(s),S=H.default.resolve(_,m),E=Gs(S),A=$(H.default.resolve(_,m),n),T=H.default.join("/",H.default.normalize(m)),_e=en(S,r);switch(b){case"script":{A?p=O.default.setAttribute(g,"src",T):(p=O.default.remove(g),l=!0);break}case"css":{A?p=O.default.setAttribute(g,"href",T):(p=O.default.remove(g),c=!0);break}case"staticHref":case"staticSrc":{if(A)p=O.default.setAttribute(g,b==="staticSrc"?"src":"href",T);else if(_e){let q=yi(r,S,E);p=O.default.setAttribute(g,b==="staticSrc"?"src":"href",q)}else{let q=H.default.join("assets",H.default.basename(S,E));Ys.default.existsSync(S)&&(p=O.default.setAttribute(g,b==="staticSrc"?"src":"href",z(q,"",!0)))}break}default:break}}),u.nodeName==="head"&&c){let m=O.default.createNode("link");m.attrs=[{name:"rel",value:"stylesheet"},{name:"href",value:z(e,".css",!0)}],O.default.append(u,m)}if(u.nodeName==="body"&&(l||t.options.mode!=="production")){let m=O.default.createNode("script");m.attrs=[{name:"src",value:z(e,".js",!0)}],O.default.append(u,m)}}return O.default.serialize(i)}}var Rt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("html:update-html-file",s=>{s.hooks.processAssets.tap({name:"html:update-html-file",stage:Nt.Compilation.PROCESS_ASSETS_STAGE_DERIVED},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[o,i]=n;if(i){let c=vi(s,o,i,r,this.excludeList||{});if(!$(i,this.excludeList)&&c){let l=new Nt.sources.RawSource(c),p=z(o,".html");s.updateAsset(p,l)}}}})})}};var Si=a(require("fs")),_i=require("@rspack/core");var Tt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.thisCompilation.tap("html:add-to-file-dependencies",s=>{s.hooks.processAssets.tap({name:"html:add-to-file-dependencies",stage:_i.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,o]=n;if(o){let i=D(o),c=new Set(s.fileDependencies);if(Si.default.existsSync(o)){let l=[o,...i?.static||[]];for(let p of l)c.has(p)||(c.add(p),p===o&&s.fileDependencies.add(p))}}}})})}};var Pi=a(require("fs"));var Ut=class{manifestPath;includeList;initialHtmlAssets={};constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}hasEntriesChanged(e,s){if(!s||!e||e.length!==s.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==s[r])return!0;return!1}storeInitialHtmlAssets(e){Object.entries(e).forEach(([s,r])=>{let n=r;if(n){if(!Pi.default.existsSync(n)){let o=require(this.manifestPath),c=P(o,"chrome").name||"Extension.js";console.error(oe(c,s,n)),process.exit(1)}this.initialHtmlAssets[n]={js:D(n)?.js||[],css:D(n)?.css||[]}}})}apply(e){let s=this.includeList||{};this.storeInitialHtmlAssets(s),e.hooks.make.tapAsync("html:throw-if-recompile-is-needed",(r,n)=>{let o=e.modifiedFiles||new Set,i=Array.from(o)[0];if(i&&this.initialHtmlAssets[i]){let c=D(i)?.js||[],l=D(i)?.css||[],{js:p,css:u}=this.initialHtmlAssets[i];(this.hasEntriesChanged(l,u)||this.hasEntriesChanged(c,p))&&console.log(Vr(i))}n()})}};var Ei=a(require("fs")),ki=require("@rspack/core");function El(t,e){let s="Module not found: Error: Can't resolve ",n=e.message.replace(s,"").split("'")[1];if(e.message.includes(s))for(let o of Object.entries(t)){let[,i]=o;if(i){if(!Ei.default.existsSync(i))return null;let c=D(i),l=c?.js?.filter(u=>!u.startsWith("/"))||[],p=c?.css?.filter(u=>!u.startsWith("/"))||[];if(l.includes(n)||p.includes(n)){let u=st(i,n);return new ki.WebpackError(u)}}}return null}var Bt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.compilation.tap("html:handle-common-errors",s=>{s.hooks.afterSeal.tapPromise("html:handle-common-errors",async()=>{s.errors.forEach((r,n)=>{let o=El(this.includeList||{},r);o&&(s.errors[n]=o)})})})}};var qt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Lt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Mt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new At({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Rt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Qs.default.dirname(this.manifestPath)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:require.resolve(Qs.default.join(__dirname,"ensure-hmr-for-scripts.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}}]}),new Tt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Ut({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Bt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var Me=a(require("path"));var er=a(require("fs")),$i=a(require("path"));function Fi(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(n=>{let o=er.default.existsSync(n)&&!$(n,e),i=$i.default.extname(n);return o&&(i===".js"||i===".mjs"||i===".jsx"||i===".ts"||i===".tsx")})}function Ci(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(n=>er.default.existsSync(n)&&!$(n,e)&&(n.endsWith(".css")||n.endsWith(".scss")||n.endsWith(".sass")||n.endsWith(".less")))}var Wt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList||{},this.excludeList=e.excludeList||{}}apply(e){let s=this.includeList||{},r={};for(let[n,o]of Object.entries(s)){let i=Fi(o,this.excludeList),c=Ci(o,this.excludeList),l=[...i,...c];(c.length||i.length)&&(r[n]={import:l})}e.options.entry={...e.options.entry,...r}}};var Q=require("@rspack/core"),kl=['var isBrowser = !!(() => { try { return browser.runtime.getURL("/") } catch(e) {} })()','var isChrome = !!(() => { try { return chrome.runtime.getURL("/") } catch(e) {} })()'],$l=[...kl,`var runtime = isBrowser ? browser : isChrome ? chrome : (typeof self === 'object' && self.addEventListener) ? { get runtime() { throw new Error("No chrome or browser runtime found") } } : { runtime: { getURL: x => x } }`],Jt=class t{apply(e){let{RuntimeGlobals:s}=e.webpack;e.hooks.compilation.tap("PublicPathRuntimeModule",r=>{r.hooks.runtimeRequirementInTree.for(s.publicPath).tap(t.name,n=>{let o=Fl();return r.addRuntimeModule(n,o),!0})})}};function Fl(){class t extends Q.RuntimeModule{constructor(){super("publicPath",Q.RuntimeModule.STAGE_BASIC)}generate(){let s=this.compilation?.outputOptions.publicPath;return Q.Template.asString([...$l,`var path = ${JSON.stringify(this.compilation?.getPath(s||"",{hash:this.compilation.hash||"XXXX"}))}`,`${Q.RuntimeGlobals.publicPath} = typeof importScripts === 'function' || !(isBrowser || isChrome) ? path : runtime.runtime.getURL(path);`])}}return new t}var zt=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList||{},this.excludeList=e.excludeList||{}}apply(e){let s=require(this.manifestPath),r=P(s,this.browser);r.content_scripts?.some(n=>n.world&&n.world.toLowerCase()==="main")&&Z.includes(this.browser)&&!r.key&&(console.error(Zr()),process.exit(1))}};var Ht=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Wt({manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Me.default.dirname(this.manifestPath)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:require.resolve(Me.default.join(__dirname,"add-hmr-accept-code.js")),options:{manifestPath:this.manifestPath,mode:e.options.mode,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="production"&&new Jt().apply(e),new zt({manifestPath:this.manifestPath,browser:this.browser||"chrome",includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Me.default.dirname(this.manifestPath)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:require.resolve(Me.default.join(__dirname,"deprecated-shadow-root.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]})}};var Re=a(require("path")),Ne=a(require("fs")),V=a(require("@rspack/core"));var ge=a(require("path")),Ae=a(require("fs"));function tr(t){let e=ge.default.join(ge.default.dirname(t),"_locales"),s=[];if(Ae.default.existsSync(e))for(let r of Ae.default.readdirSync(e)){let n=ge.default.join(e,r);if(n&&Ae.default.statSync(n).isDirectory())for(let o of Ae.default.readdirSync(n))s.push(ge.default.join(ge.default.dirname(t),"_locales",r,o))}return s}var Vt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:V.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(!Ne.default.existsSync(this.manifestPath)){let n=require(this.manifestPath),i=P(n,"chrome").name||"Extension.js";s.errors.push(new V.default.WebpackError(Tr(i,this.manifestPath)));return}if(s.errors.length>0)return;let r=tr(this.manifestPath);for(let n of Object.entries(r||[])){let[o,i]=n,c=i;if(c){if(Re.default.extname(c)!==".json")continue;if(!Ne.default.existsSync(c)){s.warnings.push(new V.default.WebpackError(rt(o,c)));return}let l=Ne.default.readFileSync(c),p=new V.sources.RawSource(l),u=e.options.context||Re.default.dirname(this.manifestPath);if(!$(c,this.excludeList)){let m=Re.default.relative(u,c);s.emitAsset(m,p)}}}})}),e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:V.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=tr(this.manifestPath);for(let n of Object.entries(r||[])){let[,o]=n;if(o){let i=new Set(s.fileDependencies),c=r||[];for(let l of c)Ne.default.existsSync(l)&&Re.default.extname(l)===".json"&&(i.has(l)||(i.add(l),s.fileDependencies.add(l)))}}})})}};var Xt=a(require("fs")),ee=a(require("@rspack/core"));var Gt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:ee.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[o,i]=n,c=Array.isArray(i)?i:[i];for(let l of c)if(l&&!$(l,this.excludeList)){if(!Xt.default.existsSync(l)){s.warnings.push(new ee.default.WebpackError(rt(o,l)));return}let p=Xt.default.readFileSync(l),u=new ee.sources.RawSource(p);s.emitAsset(o+".json",u)}}})}),e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:ee.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,o]=n,i=Array.isArray(o)?o:[o];for(let c of i)if(c){let l=new Set(s.fileDependencies);$(c,this.excludeList)||Xt.default.existsSync(c)&&(l.has(c)||(l.add(c),s.fileDependencies.add(c)))}}})})}};var sr=a(require("fs")),ji=a(require("path")),Kt=require("@rspack/core");var Zt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("icons:emit-file",s=>{s.hooks.processAssets.tap({name:"icons:emit-file",stage:Kt.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[o,i]=n;if(i===void 0)continue;let c=Array.isArray(i)?typeof i[0]=="string"?i:i.map(Object.values).flat():[i];for(let l of c)if(l){if(!sr.default.existsSync(l))continue;if(!$(l,this.excludeList)){let p=sr.default.readFileSync(l),u=new Kt.sources.RawSource(p),m=ji.default.basename(l),b=`${o.endsWith("theme_icons")?o.replace("theme_icons",""):o}/${m}`;s.emitAsset(b,u)}}}})})}};var Di=a(require("fs")),Li=require("@rspack/core"),Yt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("icons:add-to-file-dependencies",s=>{s.hooks.processAssets.tap({name:"icons:add-to-file-dependencies",stage:Li.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,o]=n,i=Array.isArray(o)?typeof o[0]=="string"?o:o.map(Object.values).flat():[o];for(let c of i)if(c){let l=new Set(s.fileDependencies);Di.default.existsSync(c)&&(l.has(c)||(l.add(c),s.fileDependencies.add(c)))}}})})}};var Qt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Zt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Yt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var ts=require("@rspack/core");function Oi(t){return t.map(e=>{try{let s=new URL(e.replace(/^\*:\/\//,"https://"));return e.endsWith(s.pathname)?`${e.substring(0,e.length-s.pathname.length)}/*`:s.pathname==="/"?`${e}/*`:e}catch{return e}})}var es=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}generateManifestPatches(e,s){let r=W(e,this.manifestPath),n=r.web_accessible_resources||[],o=r.web_accessible_resources||[];for(let[l,p]of Object.entries(s)){let u=r.content_scripts?.find(m=>m.js?.some(g=>g.includes(l)));if(u){let m=u.matches||[],g=p.filter(b=>!b.endsWith(".map")&&!b.endsWith(".js"));if(g.length===0)continue;if(r.manifest_version===3){let b=n.find(_=>_.matches.some(S=>m.includes(S)));b?g.forEach(_=>{b.resources.includes(_)||b.resources.push(_)}):n.push({resources:g,matches:Oi(m)})}else g.forEach(b=>{o.includes(b)||o.push(b)})}}r.manifest_version===3?n.length>0&&(r.web_accessible_resources=n):o.length>0&&(r.web_accessible_resources=Array.from(new Set(o)));let i=JSON.stringify(r,null,2),c=new ts.sources.RawSource(i);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",c)}apply(e){e.hooks.thisCompilation.tap("plugin-extension:feature-web-resources",s=>{s.hooks.processAssets.tap({name:"plugin-extension:feature-web-resources",stage:ts.Compilation.PROCESS_ASSETS_STAGE_ANALYSE},()=>{let r=[],n=Object.keys(this.includeList||{});for(let c of n.filter(Boolean))c.startsWith("content_scripts")&&(Array.isArray(c)?r.push(...c):typeof c=="string"&&r.push(c));let o=s.chunkGraph,i={};s.entrypoints.forEach((c,l)=>{if(r.includes(l)){let p=[];c.chunks.forEach(u=>{Array.from(o.getChunkModulesIterable(u)).forEach(g=>{o.getModuleChunks(g).forEach(b=>{b.auxiliaryFiles.forEach(_=>{p.includes(_)||p.push(_)})})})}),i[l]=p}}),this.generateManifestPatches(s,i)})})}};var I=a(require("fs")),M=a(require("path")),Ii=a(require("chokidar")),ss=class{options;constructor(e){this.options=e}ensureDirectoryExistence(e){let s=M.default.dirname(e);if(I.default.existsSync(s))return!0;I.default.mkdirSync(s,{recursive:!0})}copyFile(e,s){this.ensureDirectoryExistence(s),I.default.copyFileSync(e,s)}copyFolder(e,s){I.default.existsSync(s)||I.default.mkdirSync(s,{recursive:!0}),I.default.readdirSync(e).forEach(n=>{let o=M.default.join(e,n),i=M.default.join(s,n);I.default.statSync(o).isDirectory()?this.copyFolder(o,i):this.copyFile(o,i)})}apply(e){let s=M.default.dirname(this.options.manifestPath),r=M.default.join(s,"public"),n=e.options.output?.path||"";I.default.existsSync(r)&&(e.hooks.afterEmit.tap("special-folders:copy-public-folder",()=>{let o=M.default.join(n,"/");I.default.existsSync(o)||I.default.mkdirSync(o,{recursive:!0}),I.default.existsSync(r)&&this.copyFolder(r,o)}),e.options.mode!=="production"&&e.hooks.afterPlugins.tap("special-folders:copy-public-folder",()=>{let o=M.default.join(s,"public"),i=Ii.default.watch(o,{ignoreInitial:!0});i.on("add",c=>{let l=M.default.join(n,M.default.relative(s,c));this.copyFile(c,l)}),i.on("change",c=>{let l=M.default.join(n,M.default.relative(s,c));this.copyFile(c,l)}),i.on("unlink",c=>{let l=M.default.join(n,M.default.relative(s,c));I.default.existsSync(l)&&I.default.unlinkSync(l)}),e.hooks.watchClose.tap("special-folders:copy-public-folder",()=>{i.close().catch(console.error)})}))}};var U=a(require("path")),rr=a(require("chokidar"));var rs=class{manifestPath;constructor(e){this.manifestPath=e}throwCompilationError(e,s,r){let n=U.relative(process.cwd(),s),c=qr(r?"Adding":"Removing",e,e==="pages"?"HTML pages":"script files",n);if(r){console.warn(c);return}console.error(c),process.exit(1)}apply(e){e.hooks.afterPlugins.tap("special-folders:warn-upon-folder-changes",()=>{let s=U.dirname(this.manifestPath),r=U.join(s,"pages"),n=U.join(s,"scripts"),o=rr.watch(r,{ignoreInitial:!0}),i=rr.watch(n,{ignoreInitial:!0}),c=e.options.resolve?.extensions;o.on("add",l=>{l.endsWith(".html")&&this.throwCompilationError("pages",l,!0)}),o.on("unlink",l=>{l.endsWith(".html")&&this.throwCompilationError("pages",l)}),i.on("add",l=>{c?.includes(U.extname(l))&&this.throwCompilationError("scripts",l,!0)}),i.on("unlink",l=>{c?.includes(U.extname(l))&&this.throwCompilationError("scripts",l)}),e.hooks.watchClose.tap("WarnUponFolderChanges",()=>{o.close().catch(console.error),i.close().catch(console.error)})})}};var ns=class{static name="plugin-special-folders";options;constructor(e){this.options=e}apply(e){let{manifestPath:s}=this.options;new ss({manifestPath:s}).apply(e),e.options.mode==="development"&&e.options.watchOptions&&new rs(s).apply(e)}};var os=class{static name="plugin-extension";manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){let s=this.manifestPath,r=le({manifestPath:s,browser:this.browser}),n=Oo({manifestPath:s,browser:this.browser});new jt({browser:this.browser,manifestPath:s,includeList:{...r.html,...r.icons,...r.json,...r.scripts},excludeList:n.public}).apply(e),new qt({manifestPath:s,includeList:{...r.html,...n.pages},excludeList:{...n.public,...n.scripts}}).apply(e),new Ht({manifestPath:s,browser:this.browser,includeList:{...r.scripts,...n.scripts},excludeList:{...n.public,...n.pages}}).apply(e),new Vt({manifestPath:s}).apply(e),new Gt({manifestPath:s,includeList:r.json,excludeList:n.public}).apply(e),new Qt({manifestPath:s,includeList:r.icons,excludeList:n.public}).apply(e),new es({manifestPath:s,includeList:{...r.scripts,...n.scripts},excludeList:n.public}).apply(e),new ns({manifestPath:s}).apply(e)}};var Be=a(require("path"));var Mi=a(require("path")),Ai=a(require("ws"));function is(t,e){t.clients.forEach(s=>{s.readyState===Ai.default.OPEN&&s.send(JSON.stringify(e))})}function Ri(t,e,s){if(!s||!e)return;let r=le({manifestPath:e}).locales,n=le({manifestPath:e}).scripts,o=le({manifestPath:e}).json;if(!t){process.env.EXTENSION_ENV==="development"&&console.error("WebSocket server is not running.");return}Mi.default.basename(s)==="manifest.json"&&is(t,{changedFile:"manifest.json"}),r?.forEach(i=>{i.includes(s)&&is(t,{changedFile:"_locales"})}),Object.entries(n).forEach(([i,c])=>{let l=Array.isArray(c)?c:[c];Object.values(l).flatMap(u=>u).includes(s)&&i==="background/service_worker"&&is(t,{changedFile:"service_worker"})}),Object.entries(o).forEach(([i,c])=>{c?.includes(s)&&i==="declarative_net_request"&&is(t,{changedFile:"declarative_net_request"})})}var or=a(require("path")),Bi=a(require("fs")),Ue=a(require("ws"));var Te=a(require("path")),Cl=a(require("http")),Ti=a(require("https")),nr=a(require("fs"));var Ni=t=>{if(!nr.default.existsSync(t))return;let e=Te.default.basename(t);return nr.default.readFileSync(Te.default.join(__dirname,"certs",e))};function Ui(t){let e={key:Ni(Te.default.join(__dirname,"certs","localhost.key")),cert:Ni(Te.default.join(__dirname,"certs","localhost.cert"))},s=Ti.default.createServer(e,(r,n)=>{n.writeHead(200),n.end()});return s.on("error",r=>{throw console.error(Gr(t)),new Error(r.message)}),{server:s,port:t}}function jl(t,e){switch(e){case"chrome":return new Ue.default.Server({host:"localhost",port:t});case"edge":return new Ue.default.Server({host:"localhost",port:t+1});case"firefox":return new Ue.default.Server({server:Ui(t+2).server});default:return new Ue.default.Server({host:"localhost",port:8888})}}async function qi(t,e){let s=t.options.context||"",r=require(or.default.join(s,"manifest.json")),o=jl(8e3,e.browser);if(o.on("connection",i=>{i.send(JSON.stringify({status:"serverReady"})),i.on("error",c=>{console.log(zr(c))}),i.on("message",c=>{let l=JSON.parse(c.toString());if(l.status==="clientReady"){let p=require(or.default.join(s,"manifest.json"));setTimeout(()=>{console.log(Ms(p,e.browser,l)),console.log("")},2500),tn(e.browser)&&setTimeout(()=>{console.log(Jr(e.browser))},5e3)}})}),e.browser==="firefox"||e.browser==="gecko-based"){let i=sn(r);console.log(Ms(r,e.browser,i)),console.log(""),Bi.default.existsSync(tt)||(console.log(Xr()),console.log(""))}return o}var Wi=a(require("path")),ir=a(require("fs"));function Ji(t,e){let s=Wi.default.resolve(__dirname,`./extensions/${t}-manager-extension/reload-service.js`);try{let r=ir.default.readFileSync(s,"utf8"),n=r.replace(/__RELOAD_PORT__/g,e.toString());n!==r&&ir.default.writeFileSync(s,n,"utf8")}catch(r){console.error(`Error processing file: ${r.message}`)}}process.on("SIGINT",()=>{process.exit()});process.on("SIGTERM",()=>{process.exit()});var qe=class{manifestPath;port;browser;stats;constructor(e){this.manifestPath=e.manifestPath,this.port=e.port||8e3,this.browser=e.browser||"chrome",this.stats=e.stats}async apply(e){if(!this.manifestPath)return;Ji(this.browser,this.port);let s=await qi(e,{...this,mode:e.options.mode,browser:this.browser,stats:this.stats,port:this.port});e.hooks.watchRun.tapAsync("reload:create-web-socket-server",(r,n)=>{let i=(r.modifiedFiles||new Set).values().next().value;if(!i){n();return}let c=Be.default.relative(Be.default.dirname(this.manifestPath),i),l=Be.default.relative(process.cwd(),Be.default.dirname(i));process.env.EXTENSION_ENV==="development"&&console.info(`\u25BA\u25BA Updated file \`${c}\` (relative to ${l})`),this.manifestPath&&Ri(s,this.manifestPath,i),n()})}};var ar=a(require("path"));function zi(t,e,s){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[ar.default.dirname(s)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:ar.default.resolve(__dirname,"./inject-chromium-client-loader"),options:{manifestPath:s,browser:e}}]})}var cr=a(require("path"));function Hi(t,e,s){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[cr.default.dirname(s)],exclude:[/[\\/]node_modules[\\/]/],use:[{loader:cr.default.resolve(__dirname,"./inject-firefox-client-loader"),options:{manifestPath:s,browser:e}}]})}var cs=require("@rspack/core");var lr=a(require("content-security-policy-parser"));function Vi(t){let e="";for(let s in t)e+=`${s} ${t[s].join(" ")}; `;return e.trim()}function Xi(t){let e=t.content_security_policy;if(!e)return"script-src 'self' 'unsafe-eval' blob: filesystem:; object-src 'self' blob: filesystem:; ";let s=(0,lr.default)(e);if(!s.get("script-src"))s.set("script-src",["'self'","'unsafe-eval'","blob:","filesystem:"]);else{let n=s.get("script-src")||[];n.includes("'unsafe-eval'")||n.push("'unsafe-eval'"),n.includes("blob:")||n.push("blob:"),n.includes("filesystem:")||n.push("filesystem:"),s.set("script-src",n)}s.get("object-src")||s.set("object-src",["'self'","blob:","filesystem:"]);let r=Object.fromEntries(s.entries());return Vi(r)}function Gi(t){let e=t.content_security_policy;if(!e)return{extension_pages:"script-src 'self'; object-src 'self';"};let s=(0,lr.default)(e.extension_pages||""),r={};for(let i in r)s.get(i)||s.set(i,r[i]);let n=Object.fromEntries(s.entries());return{extension_pages:Vi(n)}}function Zi(t){let e=["/*.json","/*.js","/*.css"],s=t.web_accessible_resources;if(!s||s.length===0)return e;let r=new Set(s);for(let n of e)r.has(n)||r.add(n);return Array.from(r)}function Ki(t){let e=["/*.json","/*.js","/*.css"];return[...t.web_accessible_resources||[],{resources:e,matches:["<all_urls>"]}]}function pr(t,e){return t.background?{background:{...t.background}}:e==="firefox"||e==="gecko-based"?{background:{...t.background||{},scripts:["background/script.js"]}}:t.manifest_version===2?{background:{...t.background||{},scripts:["background/script.js"]}}:{background:{...t.background||{},service_worker:"background/service_worker.js"}}}function fr(t){return t.externally_connectable&&!t.externally_connectable.ids?{externally_connectable:{...t.externally_connectable,ids:[...new Set(t.externally_connectable.ids||[]),"*"]}}:t.externally_connectable&&!t.externally_connectable.ids?{externally_connectable:{...t.externally_connectable,ids:["*"]}}:{}}var as=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}generateManifestPatches(e){let s=W(e,this.manifestPath),r={...s,content_security_policy:s.manifest_version===3?Gi(s):Xi(s),...s.manifest_version===3?s.permissions?{permissions:[...new Set(["scripting",...s.permissions])]}:{permissions:["scripting"]}:{},...pr(s,this.browser),...fr(s),web_accessible_resources:s.manifest_version===3?Ki(s):Zi(s)},n=JSON.stringify(r,null,2),o=new cs.sources.RawSource(n);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",o)}apply(e){e.hooks.thisCompilation.tap("run-chromium:apply-manifest-dev-defaults",s=>{s.hooks.processAssets.tap({name:"run-chromium:apply-manifest-dev-defaults",stage:cs.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},r=>{if(!this.manifestPath){let n="No manifest.json found in your extension bundle. Unable to patch manifest.json.";s&&e.rspack.WebpackError&&s.errors.push(new e.rspack.WebpackError(`run-chromium: ${n}`));return}this.generateManifestPatches(s)})})}};var ur=a(require("fs")),he=a(require("path")),Yi=a(require("webpack-target-webextension"));var ls=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}handleBackground(e,s,r){let n=he.default.resolve(__dirname,s==="firefox"||s==="gecko-based"?"minimum-firefox-file.mjs":"minimum-chromium-file.mjs"),o=he.default.dirname(this.manifestPath),i=P(r,s);if(s==="firefox"||s==="gecko-based"){i=r.background;let c=i?.scripts;if(c&&c.length>0){let l=he.default.join(o,c[0]);this.ensureFileExists(l)}else this.addDefaultEntry(e,"background/script",n)}else if(i=r.background,r.manifest_version===3){let c=i?.service_worker;if(c){let l=he.default.join(o,c);this.ensureFileExists(l)}else this.addDefaultEntry(e,"background/service_worker",n)}else if(r.manifest_version===2){let c=i?.scripts;if(c&&c.length>0){let l=he.default.join(o,c[0]);this.ensureFileExists(l)}else this.addDefaultEntry(e,"background/script",n)}}ensureFileExists(e){if(!ur.default.existsSync(e)&&this.manifestPath){let s=require(this.manifestPath),n=P(s,"chrome").name||"Extension.js",o=Hr(n,e);throw console.error(o),new Error(o)}}addDefaultEntry(e,s,r){e.options.entry={...e.options.entry,[s]:{import:[r]}}}getEntryName(e){if(e.background){if(this.browser==="firefox"||this.browser==="gecko-based")return{pageEntry:"background/script"};if(e.manifest_version===3)return{serviceWorkerEntry:"background/service_worker"};if(e.manifest_version===2)return{pageEntry:"background/script"}}return{pageEntry:"background"}}convertToWebpackCompiler(e){return{...e,options:{...e.options,mode:"development"}}}apply(e){if(!this.manifestPath||!ur.default.lstatSync(this.manifestPath).isFile())return;let s=require(this.manifestPath),r=P(s,this.browser);this.handleBackground(e,this.browser,r),new Yi.default({background:this.getEntryName(r),weakRuntimeCheck:!0}).apply(this.convertToWebpackCompiler(e))}};var mr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){(Z.includes(this.browser)||this.browser==="chromium-based")&&zi(e,this.browser,this.manifestPath),(this.browser==="firefox"||this.browser==="gecko-based")&&Hi(e,this.browser,this.manifestPath),new as({manifestPath:this.manifestPath,browser:this.browser}).apply(e),new ls({manifestPath:this.manifestPath,browser:this.browser}).apply(e)}},Qi=mr;var ps=class{static name="plugin-reload";manifestPath;browser;port;stats;autoReload;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.port=e.port,this.stats=e.stats,this.autoReload=e.autoReload}apply(e){e.options.mode==="development"&&new qe({manifestPath:this.manifestPath,browser:this.browser,port:this.port,stats:this.stats}).apply(e),e.options.mode==="development"&&new Qi({manifestPath:this.manifestPath,browser:this.browser,autoReload:this.autoReload,stats:this.stats}).apply(e)}};var ea=a(require("@rspack/core")),fs=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser}apply(e){new ea.default.ProvidePlugin({browser:require.resolve("webextension-polyfill")}).apply(e)}};var ms=require("@rspack/core");var us=class{browser;manifestPath;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}patchManifest(e){let s=P(e,this.browser);return JSON.stringify(s,null,2)}apply(e){e.hooks.compilation.tap("compatibility:browser-specific-fields",s=>{s.hooks.processAssets.tap({name:"compatibility:browser-specific-fields",stage:ms.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE},()=>{let r=W(s,this.manifestPath),n=this.patchManifest(r),o=new ms.sources.RawSource(n);s.updateAsset("manifest.json",o)})})}};var ds=class{static name="plugin-compatibility";manifestPath;browser;polyfill;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.polyfill=e.polyfill||!1}async apply(e){this.polyfill&&this.browser!=="firefox"&&new fs({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new us({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e)}};var wc=a(require("os")),wr=a(require("path"));var Fa=a(require("fs")),Ca=a(require("path")),ja=require("child_process");var be=a(require("path")),Je=a(require("fs"));var ta={alternate_error_pages:{enabled:!1},autofill:{enabled:!1},browser:{check_default_browser:!1,default_browser_setting_enabled:!1},default_apps:"install",distribution:{alternate_shortcut_text:!1,auto_launch_chrome:!1,import_bookmarks:!1,import_history:!1,import_home_page:!1,import_search_engine:!1,suppress_first_run_bubble:!0,do_not_register_for_update_launch:!0,make_chrome_default:!1,make_chrome_default_for_user:!1,require_eula:!1,suppress_first_run_default_browser_prompt:!0},dns_prefetching:{enabled:!1},download:{default_directory:"/tmp/",directory_upgrade:!0,open_pdf_in_adobe_reader:!1,prompt_for_download:!0},enable_do_not_track:!0,extensions:{theme:{use_system:!1},toolbarsize:-1,ui:{developer_mode:!0}},plugins:{plugins_list:[{enabled:!1,name:"Java(TM)"}],show_details:!0},profile:{password_manager_enabled:!1},safebrowsing:{enabled:!1,safebrowsingextended_reporting_enabled:!1},savefile:{default_directory:"/tmp",type:0},search:{suggest_enabled:!1},session:{restore_on_startup:1},sync:{suppress_start:!0},sync_promo:{show_on_first_run_allowed:!1,show_ntp_bubble:!1},translate:{enabled:!1}},sa={...ta},ra={...ta};var y=require("@colors/colors/safe");function w(t,e){let s=e==="warn"?(0,y.brightYellow)("\u25BA\u25BA\u25BA"):e==="info"?(0,y.cyan)("\u25BA\u25BA\u25BA"):e==="error"?`${(0,y.bold)((0,y.red)("ERROR"))} in ${ye(t)} ${(0,y.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:(0,y.brightGreen)("\u25BA\u25BA\u25BA");return`${(0,y.gray)("")}${s}`}function ye(t){return t.charAt(0).toUpperCase()+t.slice(1)}function gs(t){let e=ye(t);return`${w(t,"info")} Creating new ${e} user profile...`}function na(t){return`${w(t,"success")} Instance already running.`}function oa(t){return`${w(t,"info")} Instance exited.`}function hs(t,e){let s=t==="firefox"||t==="gecko-based"?"Add-on":"Extension";return`${w(t,"success")} ${ye(t)} ${s} running in ${(0,y.brightBlue)(e||"unknown")} mode.`}function We(t,e){let s=e=="null"?`Browser is not installed
|
|
75
75
|
|
|
76
76
|
`:`Can't find the browser path
|
|
77
77
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"checksum": "fa334372e21dd67384196f0a5f06646c",
|
|
3
|
+
"roots": {
|
|
4
|
+
"bookmark_bar": {
|
|
5
|
+
"children": [ ],
|
|
6
|
+
"date_added": "13388427875030405",
|
|
7
|
+
"date_last_used": "0",
|
|
8
|
+
"date_modified": "0",
|
|
9
|
+
"guid": "0bc5d13f-2cba-5d74-951f-3f233fe6c908",
|
|
10
|
+
"id": "1",
|
|
11
|
+
"name": "Bookmarks Bar",
|
|
12
|
+
"type": "folder"
|
|
13
|
+
},
|
|
14
|
+
"other": {
|
|
15
|
+
"children": [ {
|
|
16
|
+
"date_added": "13388427966454372",
|
|
17
|
+
"date_last_used": "0",
|
|
18
|
+
"guid": "3b20a1fe-ef0d-4fd4-857b-afaaa9ca02d6",
|
|
19
|
+
"id": "5",
|
|
20
|
+
"meta_info": {
|
|
21
|
+
"power_bookmark_meta": ""
|
|
22
|
+
},
|
|
23
|
+
"name": "chrome://serviceworker-internals",
|
|
24
|
+
"type": "url",
|
|
25
|
+
"url": "chrome://serviceworker-internals/?devtools"
|
|
26
|
+
} ],
|
|
27
|
+
"date_added": "13388427875030412",
|
|
28
|
+
"date_last_used": "0",
|
|
29
|
+
"date_modified": "13388427966454372",
|
|
30
|
+
"guid": "82b081ec-3dd3-529c-8475-ab6c344590dd",
|
|
31
|
+
"id": "2",
|
|
32
|
+
"name": "Other Bookmarks",
|
|
33
|
+
"type": "folder"
|
|
34
|
+
},
|
|
35
|
+
"synced": {
|
|
36
|
+
"children": [ ],
|
|
37
|
+
"date_added": "13388427875030413",
|
|
38
|
+
"date_last_used": "0",
|
|
39
|
+
"date_modified": "0",
|
|
40
|
+
"guid": "4cf2e351-0e85-532b-bb37-df045d8f8d0f",
|
|
41
|
+
"id": "3",
|
|
42
|
+
"name": "Mobile Bookmarks",
|
|
43
|
+
"type": "folder"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"version": 1
|
|
47
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
2025/04/06-
|
|
2
|
-
2025/04/06-
|
|
3
|
-
2025/04/06-
|
|
1
|
+
2025/04/06-13:46:34.226 ae9516 Reusing MANIFEST /Users/cezaraugusto/local/extension-land/extension.js/programs/develop/dist/run-chrome-profile/Default/Extension Rules/MANIFEST-000001
|
|
2
|
+
2025/04/06-13:46:34.226 ae9516 Recovering log #3
|
|
3
|
+
2025/04/06-13:46:34.226 ae9516 Reusing old log /Users/cezaraugusto/local/extension-land/extension.js/programs/develop/dist/run-chrome-profile/Default/Extension Rules/000003.log
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
2025/04/06-
|
|
2
|
-
2025/04/06-
|
|
3
|
-
2025/04/06-
|
|
1
|
+
2025/04/06-12:44:35.244 adebbf Reusing MANIFEST /Users/cezaraugusto/local/extension-land/extension.js/programs/develop/dist/run-chrome-profile/Default/Extension Rules/MANIFEST-000001
|
|
2
|
+
2025/04/06-12:44:35.244 adebbf Recovering log #3
|
|
3
|
+
2025/04/06-12:44:35.244 adebbf Reusing old log /Users/cezaraugusto/local/extension-land/extension.js/programs/develop/dist/run-chrome-profile/Default/Extension Rules/000003.log
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
2025/04/06-
|
|
2
|
-
2025/04/06-
|
|
3
|
-
2025/04/06-
|
|
1
|
+
2025/04/06-13:46:34.227 ae9516 Reusing MANIFEST /Users/cezaraugusto/local/extension-land/extension.js/programs/develop/dist/run-chrome-profile/Default/Extension Scripts/MANIFEST-000001
|
|
2
|
+
2025/04/06-13:46:34.227 ae9516 Recovering log #3
|
|
3
|
+
2025/04/06-13:46:34.228 ae9516 Reusing old log /Users/cezaraugusto/local/extension-land/extension.js/programs/develop/dist/run-chrome-profile/Default/Extension Scripts/000003.log
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
2025/04/06-
|
|
2
|
-
2025/04/06-
|
|
3
|
-
2025/04/06-
|
|
1
|
+
2025/04/06-12:44:35.245 adebbf Reusing MANIFEST /Users/cezaraugusto/local/extension-land/extension.js/programs/develop/dist/run-chrome-profile/Default/Extension Scripts/MANIFEST-000001
|
|
2
|
+
2025/04/06-12:44:35.245 adebbf Recovering log #3
|
|
3
|
+
2025/04/06-12:44:35.245 adebbf Reusing old log /Users/cezaraugusto/local/extension-land/extension.js/programs/develop/dist/run-chrome-profile/Default/Extension Scripts/000003.log
|
|
Binary file
|