extension-develop 2.0.0-alpha.26 → 2.0.0-alpha.28
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 +34 -34
- package/dist/resolver-module.js +1 -1
- package/package.json +2 -1
- package/dist/add-query-param-to-imported-css.js +0 -1
- package/dist/run-chrome-profile/ChromeFeatureState +0 -6
- package/dist/run-chrome-profile/Default/Affiliation Database +0 -0
- package/dist/run-chrome-profile/Default/Affiliation Database-journal +0 -0
- package/dist/run-chrome-profile/Default/AutofillStrikeDatabase/LOCK +0 -0
- package/dist/run-chrome-profile/Default/AutofillStrikeDatabase/LOG +0 -0
- package/dist/run-chrome-profile/Default/AutofillStrikeDatabase/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/BrowsingTopicsSiteData +0 -0
- package/dist/run-chrome-profile/Default/BrowsingTopicsSiteData-journal +0 -0
- package/dist/run-chrome-profile/Default/BrowsingTopicsState +0 -12
- package/dist/run-chrome-profile/Default/BudgetDatabase/LOCK +0 -0
- package/dist/run-chrome-profile/Default/BudgetDatabase/LOG +0 -0
- package/dist/run-chrome-profile/Default/BudgetDatabase/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/03ada532059b8034_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/07fe48e48012f5d4_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/0975d188a5a104f6_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/0c5d733307b5cb25_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/0ea2c96059a665f6_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/0ea3b4f0e5162928_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/0f83630fe5c08523_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/12ef1faa6ef6be0a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/145f227183d831da_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/14bacf34bcb4d5c4_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/18a6eaf2b8d9fbc0_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/1b11f5e85606c381_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/1ebd72816b0318a4_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/1f51e51f7996f15c_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/2238abf5762da3dc_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/2489a6e5fef8aaf5_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/257b9ada9582cd59_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/2801bdb9a57cff49_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/285886eefd1c066c_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/2990d4ed71357caa_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/2c8a7228e0e70e66_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/2e1b9c8a11107ee6_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/2f3eb5d2d4a2ba05_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/33ce9c12870d4d23_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/3432d5676097c5a4_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/34889a9162e05731_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/348fb371b598ad8a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/350415634e9b147e_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/3754df2089a6f98b_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/391767af871c7832_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/3af7b7d3103f4ace_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/3b442ce473a38989_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/41dd74be7e4d556e_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/42bf217bf0a7e353_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/465712846aea785a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/4a313ad8e61ec9dd_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/4be487cb8feb90ff_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/4f8260f76e9756ed_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/4f86dd60b1006aa6_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/4fcac79a0c1e1209_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/5022ba46ba8daa8f_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/503b71587262c19a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/54643ac0185b7776_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/54843c16a8099926_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/57ee31f65792ee6f_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/5938220d111d3af6_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/5971fd089d205048_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/59d24cf735db6f76_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/5f4eef4545461991_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/61db93a3cb56b88e_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/629ab9be1dc019bb_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/62cb3ef393ff8d26_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/682976dc8929dd6d_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/69468b81146c7327_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/6bc68d2e236f96ae_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/6c53d9f7f750a482_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/6d4c2ade9755855d_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/75ab22151891a422_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/76b768fac1dc203a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/78ed79bc5487503a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/798c81766b4178b6_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/7a7c4b374713c348_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/7bf1a9bcdeb4a7c3_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/7e9121ac9923ad80_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/84b039c3dce94d8f_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/85ac7f16275a80b2_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/8652112b6b47c8b6_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/878b0f723bb46fc9_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/89a5d515e2ccedc8_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/8c254b6cc2f9386c_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/8c254b6cc2f9386c_s +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/8cd491e55ec2145c_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/8d664b746d6de0c4_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/8f36a688ff40d631_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/8ff0f7118aebe80a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/93b57958efb5aa68_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/947852a2db86e83c_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/9669ea8a3f42aa8d_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/99a9192c7da3fbc5_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/99e52c51723f6677_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/a122405e9d8df54d_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/a668aabbaa0c7a63_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/aaecd2bfb27bd90a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/b3f912c99cfd095e_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/b4429245444d798f_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/b4d7a9ccda716cbf_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/b78e34266a3d86fb_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/bd47e3de76bb850d_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/bea8189ecfd05a6e_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/bf0553a1813399ee_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/bf492fe053cbbad9_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/c0bd7a8135ab5427_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/c1eac51e21ad7087_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/c1eac51e21ad7087_s +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/c614294e9598e972_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/c8348e944358674d_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/c946e07ac7aca023_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/ccf38f84460e1b44_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/dc39ad8e2048f3db_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/e29044b2ba3d151c_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/e3bf694b1a455196_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/e3f3325e8cb32728_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/e905c341575145b8_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/ea002b3ad1e1dac9_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/ee78b6ff81595a2e_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/efea9cc276fd30fa_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/f74b5cd0282fd81f_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/fc33d55f53e3840a_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/fec787df53d1fc90_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/index +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/index-dir/the-real-index +0 -0
- package/dist/run-chrome-profile/Default/ClientCertificates/LOCK +0 -0
- package/dist/run-chrome-profile/Default/ClientCertificates/LOG +0 -0
- package/dist/run-chrome-profile/Default/ClientCertificates/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/067673da229925b1_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/074a1ab2bfa02f5c_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/0861135386d2c738_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/0a8ff373976a81f8_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/1220344c82d6e4a9_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/12cac7e4326b5061_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/1927a140ab6b3bf0_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/1928f4afea852bf7_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/218fe828c74bdb99_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/2265af44069323e5_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/2290104c219b710e_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/2cc254dd22e72e7f_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/3032ae959113cef9_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/32205809d2db82fc_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/3641b3a1972d5585_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/3ab5cfc161dd9d59_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/46bc3d6d95719c44_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/50e812c864e921e8_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/646b4abc4d2cb194_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/67dbabb644d2e8ea_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/701aeeb23987a09f_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/74aa2a778d4f560e_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/76daca9c4adf11b0_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/7f22313d4c1575dd_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/86a1e305a40b55e8_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/872deb1cf45191ee_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/8746c7a361028fbd_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/9194d3e1404356a0_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/957c573f0ec0d051_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/9a9299ecfcf06184_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/9d15e209f9b5dff9_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/9d5444cccaaad4a0_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/a0c243538f6dac4a_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/a475220d34fb49fa_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/a8461c1da16110cc_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/a8bfd7ab3bf7adbd_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/ab111c103a093afe_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/ab6a1b85cb3e3e18_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/aded9cecdad563a8_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/b09a7279f3c055b7_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/b6911f2a21e78f5f_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/b94ece003d1655ef_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/b9e93b46383d04a9_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/bbfb6b3668c1cc4e_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/c1b8316d46c52290_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/c507467488260492_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/c90703cdd5c1e252_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/cc92de16a209a21a_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/cca4b2d6f9a75bd5_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/d00e6e070fdd58b4_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/d0b93b0aea20a2ce_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/d8422ce5022907b1_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/da02ae54bcd495a9_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/dc5b579ea39c3a9d_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/e9cbe518f3e3f4c9_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/ea12d9bacfdec6c0_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/eeae49e861534f87_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/f33ab412cf9dd421_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/f4741c2f2373503b_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/fe65a248595f38e9_0 +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/index +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/js/index-dir/the-real-index +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/wasm/index +0 -0
- package/dist/run-chrome-profile/Default/Code Cache/wasm/index-dir/the-real-index +0 -0
- package/dist/run-chrome-profile/Default/Cookies +0 -0
- package/dist/run-chrome-profile/Default/Cookies-journal +0 -0
- package/dist/run-chrome-profile/Default/DIPS +0 -0
- package/dist/run-chrome-profile/Default/DIPS-journal +0 -0
- package/dist/run-chrome-profile/Default/DawnGraphiteCache/data_0 +0 -0
- package/dist/run-chrome-profile/Default/DawnGraphiteCache/data_1 +0 -0
- package/dist/run-chrome-profile/Default/DawnGraphiteCache/data_2 +0 -0
- package/dist/run-chrome-profile/Default/DawnGraphiteCache/data_3 +0 -0
- package/dist/run-chrome-profile/Default/DawnGraphiteCache/index +0 -0
- package/dist/run-chrome-profile/Default/DawnWebGPUCache/data_0 +0 -0
- package/dist/run-chrome-profile/Default/DawnWebGPUCache/data_1 +0 -0
- package/dist/run-chrome-profile/Default/DawnWebGPUCache/data_2 +0 -0
- package/dist/run-chrome-profile/Default/DawnWebGPUCache/data_3 +0 -0
- package/dist/run-chrome-profile/Default/DawnWebGPUCache/index +0 -0
- package/dist/run-chrome-profile/Default/Download Service/EntryDB/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Download Service/EntryDB/LOG +0 -0
- package/dist/run-chrome-profile/Default/Download Service/EntryDB/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Extension Cookies +0 -0
- package/dist/run-chrome-profile/Default/Extension Cookies-journal +0 -0
- package/dist/run-chrome-profile/Default/Extension Rules/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Extension Rules/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Extension Rules/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Extension Rules/LOG +0 -3
- package/dist/run-chrome-profile/Default/Extension Rules/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Extension Rules/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Extension Scripts/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Extension Scripts/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Extension Scripts/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Extension Scripts/LOG +0 -3
- package/dist/run-chrome-profile/Default/Extension Scripts/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Extension Scripts/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Extension State/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Extension State/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Extension State/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Extension State/LOG +0 -3
- package/dist/run-chrome-profile/Default/Extension State/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Extension State/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Favicons +0 -0
- package/dist/run-chrome-profile/Default/Favicons-journal +0 -0
- package/dist/run-chrome-profile/Default/Feature Engagement Tracker/AvailabilityDB/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Feature Engagement Tracker/AvailabilityDB/LOG +0 -0
- package/dist/run-chrome-profile/Default/Feature Engagement Tracker/AvailabilityDB/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Feature Engagement Tracker/EventDB/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Feature Engagement Tracker/EventDB/LOG +0 -0
- package/dist/run-chrome-profile/Default/Feature Engagement Tracker/EventDB/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/GPUCache/data_0 +0 -0
- package/dist/run-chrome-profile/Default/GPUCache/data_1 +0 -0
- package/dist/run-chrome-profile/Default/GPUCache/data_2 +0 -0
- package/dist/run-chrome-profile/Default/GPUCache/data_3 +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/History-journal +0 -0
- package/dist/run-chrome-profile/Default/InterestGroups +0 -0
- package/dist/run-chrome-profile/Default/LOCK +0 -0
- package/dist/run-chrome-profile/Default/LOG +0 -0
- package/dist/run-chrome-profile/Default/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Local Extension Settings/pbpgonifamlpcahjkkkfelffkegofkgg/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Local Extension Settings/pbpgonifamlpcahjkkkfelffkegofkgg/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Local Extension Settings/pbpgonifamlpcahjkkkfelffkegofkgg/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Local Extension Settings/pbpgonifamlpcahjkkkfelffkegofkgg/LOG +0 -3
- package/dist/run-chrome-profile/Default/Local Extension Settings/pbpgonifamlpcahjkkkfelffkegofkgg/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Local Extension Settings/pbpgonifamlpcahjkkkfelffkegofkgg/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/LOG +0 -3
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Local Storage/leveldb/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Login Data +0 -0
- package/dist/run-chrome-profile/Default/Login Data For Account +0 -0
- package/dist/run-chrome-profile/Default/Login Data For Account-journal +0 -0
- package/dist/run-chrome-profile/Default/Login Data-journal +0 -0
- package/dist/run-chrome-profile/Default/Network Action Predictor +0 -0
- package/dist/run-chrome-profile/Default/Network Action Predictor-journal +0 -0
- package/dist/run-chrome-profile/Default/Network Persistent State +0 -1
- package/dist/run-chrome-profile/Default/PersistentOriginTrials/LOCK +0 -0
- package/dist/run-chrome-profile/Default/PersistentOriginTrials/LOG +0 -0
- package/dist/run-chrome-profile/Default/PersistentOriginTrials/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Platform Notifications/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Platform Notifications/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Platform Notifications/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Platform Notifications/LOG +0 -3
- package/dist/run-chrome-profile/Default/Platform Notifications/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Platform Notifications/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Preferences +0 -1
- package/dist/run-chrome-profile/Default/PreferredApps +0 -1
- package/dist/run-chrome-profile/Default/PrivateAggregation +0 -0
- package/dist/run-chrome-profile/Default/PrivateAggregation-journal +0 -0
- package/dist/run-chrome-profile/Default/README +0 -1
- package/dist/run-chrome-profile/Default/Reporting and NEL +0 -0
- package/dist/run-chrome-profile/Default/Reporting and NEL-journal +0 -0
- package/dist/run-chrome-profile/Default/Safe Browsing Cookies +0 -0
- package/dist/run-chrome-profile/Default/Safe Browsing Cookies-journal +0 -0
- package/dist/run-chrome-profile/Default/Secure Preferences +0 -1
- package/dist/run-chrome-profile/Default/Segmentation Platform/SegmentInfoDB/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Segmentation Platform/SegmentInfoDB/LOG +0 -0
- package/dist/run-chrome-profile/Default/Segmentation Platform/SegmentInfoDB/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Segmentation Platform/SignalDB/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Segmentation Platform/SignalDB/LOG +0 -0
- package/dist/run-chrome-profile/Default/Segmentation Platform/SignalDB/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Segmentation Platform/SignalStorageConfigDB/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Segmentation Platform/SignalStorageConfigDB/LOG +0 -0
- package/dist/run-chrome-profile/Default/Segmentation Platform/SignalStorageConfigDB/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/Database/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/Database/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Service Worker/Database/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/Database/LOG +0 -3
- package/dist/run-chrome-profile/Default/Service Worker/Database/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Service Worker/Database/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/013888a1cda32b90_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/013888a1cda32b90_1 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/4cb013792b196a35_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/b6c28cea6ed9dfc1_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/b6c28cea6ed9dfc1_1 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/ba23d8ecda68de77_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/f1cdccba37924bda_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/fa813c9ad67834ac_0 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/fa813c9ad67834ac_1 +0 -0
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/index +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/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Session Storage/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Session Storage/LOG +0 -3
- package/dist/run-chrome-profile/Default/Session Storage/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Session Storage/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Sessions/Session_13370111792542869 +0 -0
- package/dist/run-chrome-profile/Default/Sessions/Session_13370111975518880 +0 -0
- package/dist/run-chrome-profile/Default/Sessions/Tabs_13370111793075988 +0 -0
- package/dist/run-chrome-profile/Default/Sessions/Tabs_13370111976109525 +0 -0
- package/dist/run-chrome-profile/Default/Shared Dictionary/cache/index +0 -0
- package/dist/run-chrome-profile/Default/Shared Dictionary/cache/index-dir/the-real-index +0 -0
- package/dist/run-chrome-profile/Default/Shared Dictionary/db +0 -0
- package/dist/run-chrome-profile/Default/Shared Dictionary/db-journal +0 -0
- package/dist/run-chrome-profile/Default/SharedStorage +0 -0
- package/dist/run-chrome-profile/Default/Shortcuts +0 -0
- package/dist/run-chrome-profile/Default/Shortcuts-journal +0 -0
- package/dist/run-chrome-profile/Default/Site Characteristics Database/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Site Characteristics Database/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Site Characteristics Database/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Site Characteristics Database/LOG +0 -3
- package/dist/run-chrome-profile/Default/Site Characteristics Database/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Site Characteristics Database/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Sync Data/LevelDB/000003.log +0 -0
- package/dist/run-chrome-profile/Default/Sync Data/LevelDB/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/Sync Data/LevelDB/LOCK +0 -0
- package/dist/run-chrome-profile/Default/Sync Data/LevelDB/LOG +0 -3
- package/dist/run-chrome-profile/Default/Sync Data/LevelDB/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/Sync Data/LevelDB/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/Top Sites +0 -0
- package/dist/run-chrome-profile/Default/Top Sites-journal +0 -0
- package/dist/run-chrome-profile/Default/TransportSecurity +0 -1
- package/dist/run-chrome-profile/Default/Trust Tokens +0 -0
- package/dist/run-chrome-profile/Default/Trust Tokens-journal +0 -0
- package/dist/run-chrome-profile/Default/VideoDecodeStats/LOCK +0 -0
- package/dist/run-chrome-profile/Default/VideoDecodeStats/LOG +0 -0
- package/dist/run-chrome-profile/Default/Visited Links +0 -0
- package/dist/run-chrome-profile/Default/Web Data +0 -0
- package/dist/run-chrome-profile/Default/Web Data-journal +0 -0
- package/dist/run-chrome-profile/Default/WebStorage/4/IndexedDB/indexeddb.leveldb/000003.log +0 -0
- package/dist/run-chrome-profile/Default/WebStorage/4/IndexedDB/indexeddb.leveldb/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/WebStorage/4/IndexedDB/indexeddb.leveldb/LOCK +0 -0
- package/dist/run-chrome-profile/Default/WebStorage/4/IndexedDB/indexeddb.leveldb/LOG +0 -2
- package/dist/run-chrome-profile/Default/WebStorage/4/IndexedDB/indexeddb.leveldb/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/WebStorage/4/IndexedDB/indexeddb.leveldb/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/WebStorage/QuotaManager +0 -0
- package/dist/run-chrome-profile/Default/WebStorage/QuotaManager-journal +0 -0
- package/dist/run-chrome-profile/Default/chrome_cart_db/LOCK +0 -0
- package/dist/run-chrome-profile/Default/chrome_cart_db/LOG +0 -0
- package/dist/run-chrome-profile/Default/chrome_cart_db/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/commerce_subscription_db/LOCK +0 -0
- package/dist/run-chrome-profile/Default/commerce_subscription_db/LOG +0 -0
- package/dist/run-chrome-profile/Default/commerce_subscription_db/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/coupon_db/LOCK +0 -0
- package/dist/run-chrome-profile/Default/coupon_db/LOG +0 -0
- package/dist/run-chrome-profile/Default/coupon_db/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/discounts_db/LOCK +0 -0
- package/dist/run-chrome-profile/Default/discounts_db/LOG +0 -0
- package/dist/run-chrome-profile/Default/discounts_db/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/heavy_ad_intervention_opt_out.db +0 -0
- package/dist/run-chrome-profile/Default/heavy_ad_intervention_opt_out.db-journal +0 -0
- package/dist/run-chrome-profile/Default/optimization_guide_hint_cache_store/LOCK +0 -0
- package/dist/run-chrome-profile/Default/optimization_guide_hint_cache_store/LOG +0 -0
- package/dist/run-chrome-profile/Default/optimization_guide_hint_cache_store/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/parcel_tracking_db/LOCK +0 -0
- package/dist/run-chrome-profile/Default/parcel_tracking_db/LOG +0 -0
- package/dist/run-chrome-profile/Default/parcel_tracking_db/LOG.old +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/000003.log +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/shared_proto_db/LOCK +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/LOG +0 -3
- package/dist/run-chrome-profile/Default/shared_proto_db/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/shared_proto_db/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/000003.log +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/CURRENT +0 -1
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/LOCK +0 -0
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/LOG +0 -3
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/LOG.old +0 -3
- package/dist/run-chrome-profile/Default/shared_proto_db/metadata/MANIFEST-000001 +0 -0
- package/dist/run-chrome-profile/Default/trusted_vault.pb +0 -2
- package/dist/run-chrome-profile/GrShaderCache/data_0 +0 -0
- package/dist/run-chrome-profile/GrShaderCache/data_1 +0 -0
- package/dist/run-chrome-profile/GrShaderCache/data_2 +0 -0
- package/dist/run-chrome-profile/GrShaderCache/data_3 +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/Last Version +0 -1
- package/dist/run-chrome-profile/Local State +0 -1
- package/dist/run-chrome-profile/ShaderCache/data_0 +0 -0
- package/dist/run-chrome-profile/ShaderCache/data_1 +0 -0
- package/dist/run-chrome-profile/ShaderCache/data_2 +0 -0
- package/dist/run-chrome-profile/ShaderCache/data_3 +0 -0
- package/dist/run-chrome-profile/ShaderCache/index +0 -0
- package/dist/run-chrome-profile/Variations +0 -1
- package/dist/run-chrome-profile/first_party_sets.db +0 -0
- package/dist/run-chrome-profile/first_party_sets.db-journal +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/13/E6DC4029A1E4B4C1/B7B2CB33FB1C0544/model-info.pb +0 -1
- package/dist/run-chrome-profile/optimization_guide_model_store/13/E6DC4029A1E4B4C1/B7B2CB33FB1C0544/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/15/E6DC4029A1E4B4C1/FD24A906753F3ACF/VERSION.txt +0 -4
- package/dist/run-chrome-profile/optimization_guide_model_store/15/E6DC4029A1E4B4C1/FD24A906753F3ACF/model-info.pb +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/15/E6DC4029A1E4B4C1/FD24A906753F3ACF/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/15/E6DC4029A1E4B4C1/FD24A906753F3ACF/override_list.pb.gz +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/2/E6DC4029A1E4B4C1/6A697F44778AF6FA/model-info.pb +0 -1
- package/dist/run-chrome-profile/optimization_guide_model_store/2/E6DC4029A1E4B4C1/6A697F44778AF6FA/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/20/E6DC4029A1E4B4C1/D3EE40827D3901D9/model-info.pb +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/20/E6DC4029A1E4B4C1/D3EE40827D3901D9/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/25/E6DC4029A1E4B4C1/DA1F927AD8322FF2/model-info.pb +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/25/E6DC4029A1E4B4C1/DA1F927AD8322FF2/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/25/E6DC4029A1E4B4C1/DA1F927AD8322FF2/visual_model_desktop.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/26/E6DC4029A1E4B4C1/5B9BEAC49A3433D5/model-info.pb +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/26/E6DC4029A1E4B4C1/5B9BEAC49A3433D5/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/31/E6DC4029A1E4B4C1/D28A23E50E11CAE3/model-info.pb +0 -3
- package/dist/run-chrome-profile/optimization_guide_model_store/31/E6DC4029A1E4B4C1/D28A23E50E11CAE3/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/32/E6DC4029A1E4B4C1/2D9D1CDE6B6208FC/model-info.pb +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/32/E6DC4029A1E4B4C1/2D9D1CDE6B6208FC/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/34/E6DC4029A1E4B4C1/C9723807457918E8/model-info.pb +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/34/E6DC4029A1E4B4C1/C9723807457918E8/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/40/E6DC4029A1E4B4C1/4C46BD3862FCFE47/model-info.pb +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/40/E6DC4029A1E4B4C1/4C46BD3862FCFE47/model.tflite +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/40/E6DC4029A1E4B4C1/4C46BD3862FCFE47/ts.bin +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/40/E6DC4029A1E4B4C1/4C46BD3862FCFE47/ts_spm.model +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/9/E6DC4029A1E4B4C1/D68CDBCCC3A5E87C/model-info.pb +0 -0
- package/dist/run-chrome-profile/optimization_guide_model_store/9/E6DC4029A1E4B4C1/D68CDBCCC3A5E87C/model.tflite +0 -0
- package/dist/run-chrome-profile/segmentation_platform/ukm_db +0 -0
- package/dist/run-chrome-profile/segmentation_platform/ukm_db-journal +0 -0
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Dp=Object.create;var et=Object.defineProperty;var Lp=Object.getOwnPropertyDescriptor;var Ip=Object.getOwnPropertyNames;var Op=Object.getPrototypeOf,Mp=Object.prototype.hasOwnProperty;var Ap=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Rp=(t,e)=>{for(var s in e)et(t,s,{get:e[s],enumerable:!0})},zr=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ip(e))!Mp.call(t,n)&&n!==s&&et(t,n,{get:()=>e[n],enumerable:!(r=Lp(e,n))||r.enumerable});return t};var a=(t,e,s)=>(s=t!=null?Dp(Op(t)):{},zr(e||!t||!t.__esModule?et(s,"default",{value:t,enumerable:!0}):s,t)),Np=t=>zr(et({},"__esModule",{value:!0}),t);var Js=Ap((Rl,qp)=>{qp.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-alpha.28",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\\.ts'","test:coverage":"jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.ts' --coverage","test:build":"jest ./build.spec.ts --no-cache"},dependencies:{"@colors/colors":"^1.6.0","@swc/core":"^1.7.3","@types/firefox-webext-browser":"^120.0.4",acorn:"^8.12.1","acorn-walk":"^8.3.3","adm-zip":"^0.5.12",ajv:"^8.17.1",astring:"^1.8.6",axios:"^1.6.8","case-sensitive-paths-webpack-plugin":"^2.4.0",chokidar:"^3.6.0","chrome-location":"^1.2.1","content-security-policy-parser":"^0.6.0","css-loader":"^6.10.0","csv-loader":"^3.0.5","dotenv-webpack":"^8.0.1","edge-location":"^1.0.0","firefox-profile":"^4.6.0","fx-runner":"^1.4.0","go-git-it":"2.0.4",ignore:"^5.3.1","loader-utils":"^3.3.1",micromatch:"^4.0.7","mini-css-extract-plugin":"^2.8.1","package-manager-detector":"^0.2.0",parse5:"^7.1.2","parse5-utils":"^2.0.0",postcss:"^8.4.45",progress:"^2.0.3","schema-utils":"^4.2.0",slugify:"^1.6.6","style-loader":"^3.3.4","swc-loader":"^0.2.6","tiny-glob":"^0.2.9","vue-template-compiler":"^2.7.16","webextension-polyfill":"^0.12.0",webpack:"~5.92.0","webpack-dev-server":"^5.0.2","webpack-merge":"^6.0.1","webpack-target-webextension":"^1.1.2"},devDependencies:{"@types/adm-zip":"^0.5.5","@types/case-sensitive-paths-webpack-plugin":"^2.1.9","@types/chrome":"^0.0.270","@types/cross-spawn":"^6.0.6","@types/dotenv-webpack":"^7.0.7","@types/jest":"^29.5.12","@types/loader-utils":"^2.0.6","@types/node":"^22.5.3","@types/webextension-polyfill":"^0.10.7","@types/ws":"^8.5.12",jest:"^29.7.0","ts-jest":"^29.1.2",tsup:"^8.0.1",typescript:"5.3.3"},optionalDependencies:{"@pmmmwh/react-refresh-webpack-plugin":"^0.5.15","@prefresh/webpack":"^4.0.1","babel-loader":"^9.1.3","less-loader":"^12.2.0","postcss-flexbugs-fixes":"^5.0.2","postcss-loader":"^8.1.1","postcss-normalize":"^10.0.1","postcss-preset-env":"^9.6.0","postcss-scss":"^4.0.9","react-refresh":"^0.14.2","react-refresh-typescript":"^2.0.9","resolve-url-loader":"^5.0.0","sass-loader":"^16.0.0","vue-loader":"^17.4.2","vue-style-loader":"^4.1.3","vue-template-compiler":"^2.7.16"}}});var Il={};Rp(Il,{extensionBuild:()=>fp,extensionDev:()=>_p,extensionPreview:()=>Ep,extensionStart:()=>Fp});module.exports=Np(Il);var cp=a(require("fs")),Nr=a(require("path")),pp=a(require("webpack")),lp=require("webpack-merge");var Ye=a(require("path"));var kn=a(require("case-sensitive-paths-webpack-plugin"));var V=a(require("fs")),M=a(require("path")),Sn=a(require("dotenv-webpack"));var zs=a(require("path")),f=require("@colors/colors/safe");var Hr=a(require("path")),tt=Hr.default.join(process.cwd(),"node_modules/extension-develop/dist/certs"),ee=["chrome","edge"],Tp=["firefox"],Ml=[...ee,...Tp];function x(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"?(0,f.brightYellow)("\u25BA\u25BA\u25BA"):e==="info"?(0,f.cyan)("\u25BA\u25BA\u25BA"):(0,f.brightGreen)("\u25BA\u25BA\u25BA")} ${t}`}function Vr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Gr(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 Xr(t,e,s){return`${x(e,"info")} is using ${e}. Installing required dependencies via ${(0,f.brightYellow)(s)}...`}function Zr(t){return`${x("env","success")} file loaded ${(0,f.brightGreen)("successfully")}.`}function v(t,e){return`${x(e,"info")}-based extension...`}function C(t,e){return`${x(e,"success")} installation completed. Run the program again and happy hacking.`}function Yr(t,e){return`${x(e,"info")} dependencies are being installed. This only happens for core contributors...`}function Kr(t,e){return`${x(e,"success")} dependencies installed ${(0,f.brightGreen)("successfully")}.`}function Qr(t,e,s){return`${x(t,"error")} ${e} Installation Error
|
|
2
2
|
|
|
3
3
|
Failed to detect package manager or install ${e} dependencies:
|
|
4
4
|
${(0,f.red)(s?.toString()||"")}`}function en(t){return`${x("Firefox runner","error")} No Service Worker Support
|
|
@@ -37,13 +37,13 @@ Remove the duplicate entry and try again.`;if(e.startsWith("content_scripts"))re
|
|
|
37
37
|
|
|
38
38
|
Top-level await is only supported in ECMAScript modules.
|
|
39
39
|
To use it in your extension, make sure to set ${(0,f.brightYellow)('"type": "module"')}
|
|
40
|
-
in your package.json or use the ${(0,f.brightYellow)(".mjs")} extension for your script files.`}function
|
|
40
|
+
in your package.json or use the ${(0,f.brightYellow)(".mjs")} extension for your script files.`}function st(t,e,s){if(!e)throw new Error("This operation is impossible. Please report a bug.");switch(zs.default.extname(s)){case".js":case".ts":case".jsx":case".tsx":return Up(t,e,s);case".css":case".scss":case".sass":case".less":return Wp(t,e,s);default:return Bp(t,e,s)}}function ie(t,e,s){let r=e.startsWith("content_scripts")?"content_scripts":e.replace("/","."),n=e.split("-")[1],i=e.startsWith("pages"),o=t.includes("content_scripts")?`(index ${n})
|
|
41
41
|
|
|
42
42
|
`:r;return`${x("manifest.json","error")} File Not Found
|
|
43
43
|
|
|
44
44
|
${i?`Check the ${(0,f.brightYellow)("pages")} folder in your project root directory.
|
|
45
45
|
`:`Check the ${(0,f.brightYellow)(o)} field in your manifest.json file.
|
|
46
|
-
`}${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function
|
|
46
|
+
`}${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function rt(t,e,s){return`${x("manifest.json","error")} File Not Found
|
|
47
47
|
|
|
48
48
|
Check the ${(0,f.brightYellow)(e)} field in your manifest.json file.
|
|
49
49
|
${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function fn(t,e){return`${x(t,"error")} Manifest Not Found
|
|
@@ -84,20 +84,20 @@ Check the ${(0,f.brightYellow)(e.replace("/","."))} field in your manifest.json
|
|
|
84
84
|
${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function wn(t,e){return`${x("HTML","error")} Entry Point Modification
|
|
85
85
|
|
|
86
86
|
Changing the path of ${(0,f.brightYellow)("<script>")} or ${(0,f.brightYellow)('<link rel="stylesheet">')} files after compilation requires a server restart.
|
|
87
|
-
${(0,f.gray)("PATH")} ${(0,f.underline)(e)}`}function
|
|
87
|
+
${(0,f.gray)("PATH")} ${(0,f.underline)(e)}`}function Up(t,e,s){return`${x("HTML","error")} File Not Found
|
|
88
88
|
|
|
89
89
|
Check your ${(0,f.brightYellow)("<script>")} tags in ${(0,f.underline)(e)}.
|
|
90
|
-
${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function
|
|
90
|
+
${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function Wp(t,e,s){return`${x("HTML","error")} File Not Found
|
|
91
91
|
|
|
92
92
|
Check your ${(0,f.brightYellow)("<link>")} tags in ${(0,f.underline)(e)}.
|
|
93
|
-
${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function
|
|
93
|
+
${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function Bp(t,e,s){let r=zs.default.extname(s);return`${x("HTML","error")} File Not Found
|
|
94
94
|
|
|
95
95
|
Check your ${(0,f.brightYellow)("*"+r)} assets in ${(0,f.underline)(e)}.
|
|
96
96
|
${(0,f.red)("NOT FOUND")} ${(0,f.underline)(s)}`}function xn(){return`${(0,f.brightYellow)("Note")}: Firefox requires a secure certificate for localhost connections, needed for the reloader to work.
|
|
97
97
|
By default, your manifest.json file is not being watched. To enable this feature, run:
|
|
98
98
|
|
|
99
99
|
npx -y mkcert-cli \\
|
|
100
|
-
${(0,f.brightGreen)("--outDir")} ${(0,f.underline)(
|
|
100
|
+
${(0,f.brightGreen)("--outDir")} ${(0,f.underline)(tt)} \\
|
|
101
101
|
${(0,f.brightGreen)("--cert")} ${(0,f.brightYellow)("localhost.cert")} \\
|
|
102
102
|
${(0,f.brightGreen)("--key")} ${(0,f.brightYellow)("localhost.key")}
|
|
103
103
|
|
|
@@ -107,58 +107,58 @@ Learn more about ${(0,f.bold)("mkcert")}: ${(0,f.underline)("https://github.com/
|
|
|
107
107
|
|
|
108
108
|
For MAIN world content_scripts, the extension ID must be specified.
|
|
109
109
|
Ensure your extension have a fixed ID and that the ${(0,f.brightYellow)("publicPath")}
|
|
110
|
-
of your ${(0,f.brightYellow)("extension.config.js")} is defined as your extension URL.`}var rt=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){let s=M.default.dirname(this.manifestPath),n=require(this.manifestPath).name||"Extension.js";(V.default.existsSync(M.default.join(s,".env"))||V.default.existsSync(M.default.join(s,".env.example"))||V.default.existsSync(M.default.join(s,".env.local"))||V.default.existsSync(M.default.join(s,".env.defaults")))&&(console.log(Zr(n)),new Sn.default({path:V.default.existsSync(M.default.join(s,".env"))?M.default.join(s,".env"):V.default.existsSync(M.default.join(s,".env.local"))?M.default.join(s,".env.local"):M.default.join(s,".env.example"),allowEmptyValues:!0,defaults:V.default.existsSync(M.default.join(s,".env.defaults")),systemvars:!0}).apply(e))}};var Vs=a(require("fs")),Pn=a(require("path")),nt=class{apply(e){let s=Pn.default.join(e.options.output.path||"","hot");Vs.default.existsSync(s)&&(Vs.default.rmSync(s,{recursive:!0,force:!0}),process.env.EXTENSION_ENV==="development"&&console.log("[CleanHotUpdatesPlugin] Removed old hot-update files before compilation."))}};var it=class{static name="plugin-compilation";manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){new kn.default().apply(e),new rt({manifestPath:this.manifestPath}).apply(e),new nt().apply(e),e.hooks.done.tap("develop:brand",s=>{s.compilation.name=void 0;let r=s.endTime-s.startTime,n=require(this.manifestPath).name;console.log(Gr(n,r,s))})}};var zn=a(require("path")),Hn=a(require("mini-css-extract-plugin"));var Wn=a(require("mini-css-extract-plugin"));var pe=a(require("path")),Ee=a(require("fs"));var oe=a(require("path")),ot=a(require("fs")),Gs=require("child_process"),jn=require("package-manager-detector");function $n(t,e){return Object.values(e||{}).some(s=>s===t)}function h(t,e,s){let r=oe.default.extname(e),i=S(e,s)?oe.default.normalize(e):t;return[".js",".jsx",".tsx",".ts"].includes(r)&&(i=i.replace(r,".js")),[".html",".njk",".nunjucks"].includes(r)&&(i=i.replace(r,".html")),[".css",".scss",".sass",".less"].includes(r)&&(i=i.replace(r,".css")),Xs(i||"")}function Xs(t){return t.replace(/\\/g,"/")}function S(t,e={}){if(!e)return!1;let s=oe.default.normalize(Xs(t));return Object.values(e).some(n=>typeof n!="string"?!1:Xs(n).includes(s))}function B(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 En(){return process.env.npm_execpath?"npm":!1}async function j(t,e,s){try{let r=await(0,jn.detect)();console.log(Xr(t,e,r?.name||"unknown"));let n="";r?.name==="yarn"?n=`yarn --silent add ${s.join(" ")} --cwd ${__dirname} --optional`:r?.name==="npm"||En()?n=`npm --silent install ${s.join(" ")} --prefix ${__dirname} --save-optional`:ae()?n=`pnpm --silent add ${s.join(" ")} --prefix ${__dirname} --save-optional`:n=`${r} --silent install ${s.join(" ")} --cwd ${__dirname} --optional`,(0,Gs.execSync)(n,{stdio:"inherit"}),await new Promise(i=>setTimeout(i,2e3)),process.env.EXTENSION_ENV==="development"&&(console.log(Yr(t,e)),r?.name==="yarn"?n="yarn install --silent > /dev/null 2>&1":r?.name==="npm"||En()?n="npm install --silent > /dev/null 2>&1":ae()?n="pnpm install --silent > /dev/null 2>&1":n=`${r} install --silent > /dev/null 2>&1`,(0,Gs.execSync)(n,{stdio:"inherit"})),console.log(Kr(t,e))}catch(r){console.error(Qr(t,e,r))}}function at(t){let e=oe.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||{},i=s.devDependencies||{};for(let o of r)if(n[o]||i[o])return!0;return!1}function Cn(t){return!ot.default.existsSync(oe.default.resolve(__dirname,`run-${t}-profile`))}function Fn(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 ce(t,e){return JSON.parse(JSON.stringify(t),function(n,i){let o=n.indexOf(":");if(o===-1)return i;let c=n.substring(0,o);(c===e||c==="chromium"&&ee.includes(e))&&(this[n.substring(o+1)]=i)})}var Dn=!1;function ct(t){let e=pe.default.join(t,"package.json"),s=pe.default.join(t,"manifest.json");if(!Ee.default.existsSync(e))return!1;let r=Bp(t),n=require(e),i=n.devDependencies&&n.devDependencies.tailwindcss,o=n.dependencies&&n.dependencies.tailwindcss,c=!!r&&!!(i||o);if(c&&!Dn){let l=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(l,"Tailwind")),Dn=!0}return c}function Bp(t){let e=pe.default.join(t,"tailwind.config.mjs"),s=pe.default.join(t,"tailwind.config.cjs"),r=pe.default.join(t,"tailwind.config.js");if(Ee.default.existsSync(e))return e;if(Ee.default.existsSync(s))return s;if(Ee.default.existsSync(r))return r}var pt=a(require("path")),In=a(require("fs"));var Ln=!1;function je(t){let e=pt.default.join(t,"package.json"),s=pt.default.join(t,"manifest.json");if(!In.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies.sass,i=r.dependencies&&r.dependencies.sass;if(n||i){if(!Ln){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"SASS")),Ln=!0}return!0}return!1}async function On(t,e){if(!je(t))return[];try{require.resolve("sass-loader")}catch{let r=["postcss-loader","postcss-scss","postcss-flexbugs-fixes","postcss-preset-env","postcss-normalize"],n=require(pt.default.join(t,"package.json")).name;await j(n,"PostCSS",r),await j(n,"SASS",["sass","sass-loader","resolve-url-loader"]),console.log(C(n,"SASS")),process.exit(0)}return[{test:/\.(s(a|c)ss)$/,exclude:/\.module\.(s(a|c)ss)$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await R(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await R(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:e==="production"})}]},{test:/\.module\.(s(a|c)ss)$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await R(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await R(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!0})}]}]}var lt=a(require("path")),An=a(require("fs"));var Mn=!1;function $e(t){let e=lt.default.join(t,"package.json"),s=lt.default.join(t,"manifest.json"),n=require(s).name||"Extension.js";if(!An.default.existsSync(e))return!1;let i=require(e),o=i.devDependencies&&i.devDependencies.less,c=i.dependencies&&i.dependencies.less;return o||c?(Mn||(process.env.EXTENSION_ENV==="development"&&console.log(v(n,"LESS")),Mn=!0),!0):!1}async function Rn(t,e){if(!$e(t))return[];try{require.resolve("less-loader")}catch{let r=require(lt.default.join(t,"package.json")).name;await j(r,"LESS",["less","less-loader","resolve-url-loader"]),console.log(C(r,"LESS")),process.exit(0)}return[{test:/\.less$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await R(t,{loader:"less-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await R(t,{loader:"less-loader",mode:e,useMiniCssExtractPlugin:e==="production"})}]}]}var fe=a(require("path")),ft=a(require("fs"));var le=!1;function Jp(t){let e=fe.default.join(t,"package.json"),s=fe.default.join(t,"manifest.json");if(!ft.default.existsSync(e))return!1;let r=[".postcssrc",".postcssrc.json",".postcssrc.yaml",".postcssrc.yml",".postcssrc.js",".postcssrc.cjs","postcss.config.js","postcss.config.cjs"],i=require(s).name||"Extension.js";if(ft.default.existsSync(e)){let o=require(e);if(o.dependencies&&o.dependencies.postcss||o.devDependencies&&o.devDependencies.postcss)return le||(process.env.EXTENSION_ENV==="development"&&console.log(v(i,"PostCSS")),le=!0),!0}for(let o of r)if(ft.default.existsSync(fe.default.join(t,o)))return le||(process.env.EXTENSION_ENV==="development"&&console.log(v(i,"PostCSS")),le=!0),!0;return ct(t)?(le||(process.env.EXTENSION_ENV==="development"&&console.log(v(i,"PostCSS")),le=!0),!0):!1}async function Nn(t,e){if(!Jp(t))return{};try{require.resolve("postcss-loader")}catch{let r=require(fe.default.join(t,"package.json")).name;!je(t)&&!$e(t)&&await j(r,"PostCSS",["postcss","postcss-loader","postcss-scss","postcss-flexbugs-fixes","postcss-preset-env","postcss-normalize"]),console.log(C(r,"PostCSS")),process.exit(0)}return{loader:require.resolve("postcss-loader"),options:{postcssOptions:{parser:require.resolve("postcss-scss"),ident:"postcss",config:fe.default.resolve(t,"postcss.config.js"),plugins:[require.resolve("postcss-flexbugs-fixes"),[require.resolve("postcss-preset-env"),{autoprefixer:{flexbox:"no-2009"},stage:3}].filter(Boolean),require.resolve("postcss-normalize")].filter(Boolean)},sourceMap:e.mode==="development"}}}var mt=a(require("path")),qn=a(require("fs"));var Tn=!1;function Ce(t){let e=mt.default.join(t,"package.json"),s=mt.default.join(t,"manifest.json");if(!qn.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies.vue,i=r.dependencies&&r.dependencies.vue;if((n||i)&&!Tn){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"Vue")),Tn=!0}return!!n||!!i}async function Un(t){if(!Ce(t))return;try{require.resolve("vue-loader")}catch{let n=["typescript"],o=require(mt.default.join(t,"manifest.json")).name||"Extension.js";await j(o,"TypeScript",n),await j(o,"Vue",["vue-loader","vue-template-compiler","vue-style-loader"]),console.log(C(o,"Vue")),process.exit(0)}let e=[{test:/\.vue$/,loader:require.resolve("vue-loader"),include:t,exclude:/node_modules/}];return{plugins:[new(require("vue-loader")).VueLoaderPlugin],loaders:e,alias:void 0}}async function R(t,e){let s=Wn.default.loader,r=[e.useMiniCssExtractPlugin?s:Ce(t)?require.resolve("vue-style-loader"):require.resolve("style-loader"),{loader:require.resolve("css-loader"),options:{sourceMap:e.mode==="development"}}].filter(Boolean);if(ct(t)||je(t)||$e(t)){let n=await Nn(t,e);n.loader&&r.push(n)}return e.loader&&r.push({loader:require.resolve("resolve-url-loader"),options:{sourceMap:e.mode==="development",root:t}},{loader:require.resolve(e.loader),options:{sourceMap:e.mode==="development"}}),r.filter(Boolean)}var O=a(require("path")),A=a(require("fs"));function zp(t){let e=O.default.join(t,"stylelint.config.json"),s=O.default.join(t,".stylelintrc.js file"),r=O.default.join(t,"stylelint.config.mjs"),n=O.default.join(t,".stylelintrc.mjs"),i=O.default.join(t,"stylelint.config.cjs"),o=O.default.join(t,".stylelintrc.cjs"),c=O.default.join(t,".stylelintrc.json"),p=O.default.join(t,".stylelintrc"),l=O.default.join(t,".stylelintrc.yml"),m=O.default.join(t,".stylelintrc.yaml");if(A.default.existsSync(e))return e;if(A.default.existsSync(s))return s;if(A.default.existsSync(r))return r;if(A.default.existsSync(n))return n;if(A.default.existsSync(i))return i;if(A.default.existsSync(o))return o;if(A.default.existsSync(c))return c;if(A.default.existsSync(p))return p;if(A.default.existsSync(l))return l;if(A.default.existsSync(m))return m}var Bn=!1;function Hp(t){let e=O.default.join(t,"package.json"),s=O.default.join(t,"manifest.json");if(!A.default.existsSync(e))return!1;let n=!!zp(t);if(n&&!Bn){let o=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(o,"Stylelint")),Bn=!0}return n}async function Jn(t){return Hp(t),[]}var ut=class t{static name="plugin-css";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=zn.default.dirname(this.manifestPath),r=[new Hn.default];r.forEach(p=>p.apply(e));let n=await Jn(s);r.push(...n);let i=[{test:/\.css$/,exclude:/\.module\.css$/,oneOf:[{use:await R(s,{mode:this.mode,useMiniCssExtractPlugin:this.mode==="production"})}]},{test:/\.module\.css$/,oneOf:[{use:await R(s,{mode:this.mode,useMiniCssExtractPlugin:this.mode==="production"})}]}];e.options.plugins=[...e.options.plugins,...r].filter(Boolean);let o=await On(s,this.mode),c=await Rn(s,this.mode);i.push(...o),i.push(...c),e.options.module.rules=[...e.options.module.rules,...i].filter(Boolean)}async apply(e){if(this.mode==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var dt=class{static name="plugin-css";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async apply(e){let s={test:/\.svg$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2048}}},n=[...e.options.module.rules.some(i=>i&&i.test instanceof RegExp&&i.test.test(".svg")&&i.use!==void 0)?[]:[s],{test:/\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",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/resource",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(Boolean)}};var Ys=a(require("path"));var gt=a(require("path")),Zs=a(require("fs"));var Vn=!1,Vp=[".babelrc",".babelrc.json",".babelrc.js",".babelrc.cjs","babel.config.json","babel.config.js","babel.config.cjs"];function Gp(t){let e=gt.default.join(t,"package.json"),s=gt.default.join(t,"manifest.json");if(!Zs.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies["babel-core"],i=r.dependencies&&r.dependencies["babel-core"],o=Vp.some(c=>Zs.default.existsSync(gt.default.join(t,c)))||!!n||!!i;if(o&&!Vn){let p=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&process.env.EXTENSION_ENV==="development"&&console.log(v(p,"Babel")),Vn=!0}return o}async function Gn(t,e){Gp(e)}var ht=a(require("path")),Zn=a(require("fs"));var Xn=!1;function me(t){let e=ht.default.join(t,"package.json"),s=ht.default.join(t,"manifest.json");if(!Zn.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies.preact,i=r.dependencies&&r.dependencies.preact;if((n||i)&&!Xn){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"Preact")),Xn=!0}return!!n||!!i}async function Yn(t){if(!me(t))return;try{require.resolve("@prefresh/webpack")}catch{let r=["@prefresh/webpack"],i=require(ht.default.join(t,"manifest.json")).name||"Extension.js";await j(i,"Preact",r),console.log(C(i,"Preact")),process.exit(0)}return{plugins:[new(require("@prefresh/webpack"))],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 yt=a(require("path")),Qn=a(require("fs"));var Kn=!1;function ue(t){let e=yt.default.join(t,"package.json"),s=yt.default.join(t,"manifest.json");if(!Qn.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies.react,i=r.dependencies&&r.dependencies.react;if((n||i)&&!Kn){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"React")),Kn=!0}return!!n||!!i}async function ei(t){if(!ue(t))return;try{require.resolve("@pmmmwh/react-refresh-webpack-plugin")}catch{let r=["react-refresh","@pmmmwh/react-refresh-webpack-plugin","react-refresh-typescript"],i=require(yt.default.join(t,"manifest.json")).name||"Extension.js";await j(i,"React",r),console.log(C(i,"React")),process.exit(0)}return{plugins:[new(require("@pmmmwh/react-refresh-webpack-plugin"))({overlay:!1})],loaders:void 0,alias:void 0}}var Fe=a(require("path")),bt=a(require("fs"));var ti=!1;function G(t){let e=Fe.default.join(t,"package.json");if(!bt.default.existsSync(e))return!1;let s=Zp(t),r=require(e),n=require(Fe.default.join(t,"manifest.json")),i=n.name||"Extension.js",o=r.devDependencies&&r.devDependencies.typescript,c=r.dependencies&&r.dependencies.typescript;return ti||((o||c)&&(s?process.env.EXTENSION_ENV==="development"&&console.log(v(i,"TypeScript")):(console.log(gn(n)),Yp(t))),ti=!0),!!s&&!!(o||c)}function Xp(t,e){return{compilerOptions:{allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,jsx:at(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 Zp(t){let e=Fe.default.join(t,"tsconfig.json");if(bt.default.existsSync(e))return e}function Yp(t){bt.default.writeFileSync(Fe.default.join(t,"tsconfig.json"),JSON.stringify(Xp(t,{mode:"development"}),null,2))}var wt=class t{static name="plugin-js-frameworks";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=Ys.default.dirname(this.manifestPath),r=await Gn(e,s),n=await ei(s),i=await Yn(s),o=await Un(s);e.options.resolve.alias={...r?.alias||{},...n?.alias||{},...i?.alias||{},...o?.alias||{},...e.options.resolve.alias},e.options.module.rules=[{test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Ys.default.dirname(this.manifestPath)],exclude:/node_modules/,use:{loader:require.resolve("swc-loader"),options:{sync:!0,module:{type:"es6"},minify:this.mode==="production",isModule:!0,jsc:{target:"es2016",parser:{syntax:G(s)?"typescript":"ecmascript",tsx:G(s)&&(ue(s)||me(s)),jsx:!G(s)&&(ue(s)||me(s)),dynamicImport:!0},transform:{react:{development:this.mode==="development",refresh:this.mode==="development",runtime:"automatic",importSource:"react"}}}}}},...r?.loaders||[],...n?.loaders||[],...i?.loaders||[],...o?.loaders||[],...e.options.module.rules].filter(Boolean),n?.plugins?.forEach(c=>c.apply(e)),i?.plugins?.forEach(c=>c.apply(e)),o?.plugins?.forEach(c=>c.apply(e))}async apply(e){if(this.mode==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var We=a(require("path"));var Ui=a(require("path"));var si=a(require("path"));function ri(t,e){if(!e||!e.action||!e.action.default_popup)return;let s=e.action.default_popup;return si.default.join(t,s)}var ni=a(require("path"));function ii(t,e){if(!e||!e.browser_action||!e.browser_action.default_popup)return;let s=e.browser_action.default_popup;return ni.default.join(t,s)}var xt=a(require("path"));function oi(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":xt.default.join(t,r)}}if(e.chrome_url_overrides.newtab){let r=e.chrome_url_overrides.newtab;s={"chrome_url_overrides/newtab":xt.default.join(t,r)}}if(e.chrome_url_overrides.bookmarks){let r=e.chrome_url_overrides.bookmarks;s={"chrome_url_overrides/bookmarks":xt.default.join(t,r)}}return s}var ai=a(require("path"));function ci(t,e){if(!e||!e.devtools_page)return;let s=e.devtools_page;return ai.default.join(t,s)}var Ks=a(require("path"));function pi(t,e){if(e.options_page){let r=e.options_page;return Ks.default.join(t,r)}if(!e||!e.options_ui||!e.options_ui.page)return;let s=e.options_ui.page;return Ks.default.join(t,s)}var li=a(require("path"));function fi(t,e){if(!e||!e.page_action||!e.page_action.default_popup)return;let s=e.page_action.default_popup;return li.default.join(t,s)}var mi=a(require("path"));function ui(t,e){if(!e||!e.sandbox||!e.sandbox.pages)return{"sandbox/page-0":void 0};let s=e.sandbox.pages,r={};for(let[n,i]of s.entries())r[`sandbox/page-${n}`]=mi.default.join(t,i);return r}var di=a(require("path"));function gi(t,e){if(!e||!e.side_panel||!e.side_panel.default_path)return;let s=e.side_panel.default_path;return di.default.join(t,s)}var hi=a(require("path"));function yi(t,e){if(!e||!e.sidebar_action||!e.sidebar_action.default_panel)return;let s=e.sidebar_action.default_panel;return hi.default.join(t,s)}function De(t,e){return{"action/default_popup":ri(t,e),"browser_action/default_popup":ii(t,e),...oi(t,e),devtools_page:ci(t,e),"options_ui/page":pi(t,e),"page_action/default_popup":fi(t,e),...ui(t,e),"side_panel/default_path":gi(t,e),"sidebar_action/default_panel":yi(t,e)}}var Qs=a(require("path"));function bi(t,e){if(!e||!e.action||!e.action.default_icon)return;if(typeof e.action.default_icon=="string")return Qs.default.join(t,e.action.default_icon);let s=[];for(let r in e.action.default_icon)s.push(Qs.default.join(t,e.action.default_icon[r]));return s}var er=a(require("path"));function wi(t,e){if(!e||!e.browser_action||!e.browser_action.default_icon)return;let s=[];if(typeof e.browser_action.default_icon=="string")return er.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]=er.default.join(t,e.browser_action.default_icon[r]);s.push(n)}return s}var tr=a(require("path"));function xi(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=tr.default.join(t,s.light)),s.dark&&(s.dark=tr.default.join(t,s.dark)),s.size&&delete s.size;return e.browser_action.theme_icons}}var vi=a(require("path"));function _i(t,e){if(!e||!e.icons)return;let s=[];for(let r in e.icons){let n=vi.default.join(t,e.icons[r]);s.push(n)}return s}var sr=a(require("path"));function Si(t,e){if(!e||!e.page_action||!e.page_action.default_icon)return;if(typeof e.page_action.default_icon=="string")return sr.default.join(t,e.page_action.default_icon);let s=[];for(let r in e.page_action.default_icon){let n=sr.default.join(t,e.page_action.default_icon[r]);s.push(n)}return s}var Pi=a(require("path"));function ki(t,e){return!e||!e.sidebar_action||!e.sidebar_action.default_icon?void 0:Pi.default.join(t,e.sidebar_action.default_icon)}function Ei(t,e){return{action:bi(t,e),browser_action:wi(t,e),"browser_action/theme_icons":xi(t,e),icons:_i(t,e),page_action:Si(t,e),sidebar_action:ki(t,e)}}var ji=a(require("path"));function $i(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}`]=ji.default.join(t,n.path)}),s)}var Ci=a(require("path"));function Fi(t,e){if(!e||!e.storage||!e.storage.managed_schema)return;let s=e.storage.managed_schema;return Ci.default.join(t,s)}function Di(t,e){return{...$i(t,e),"storage/managed_schema":Fi(t,e)}}var Le=a(require("path")),vt=a(require("fs"));function Li(t,e){let s=Le.default.join(Le.default.dirname(e),"_locales"),r=[];if(vt.default.existsSync(s))for(let n of vt.default.readdirSync(s)){let i=Le.default.join(s,n);for(let o of vt.default.readdirSync(i))r.push(Le.default.join(t,"_locales",n,o))}return r}var Ii=a(require("path"));function Oi(t,e){if(!e||!e.background)return;let s=e.background.scripts;if(s)return s.map(r=>Ii.default.join(t,r))}var Mi=a(require("path"));function Ai(t,e){if(!e||!e.background)return;let s=e.background.service_worker;if(s)return Mi.default.join(t,s)}var rr=a(require("path"));function Ri(t,e){if(!e||!e.content_scripts)return{"content_scripts/content-0":void 0};let s=i=>{if(i.js?.length!==0)return i.js?.map(o=>rr.default.join(t,o))},r=i=>{if(i.css?.length!==0)return i.css?.map(o=>rr.default.join(t,o))},n={};for(let[i,o]of e.content_scripts.entries()){let c=s(o),p=r(o);n[`content_scripts/content-${i}`]=[...(c||[]).filter(l=>l!=null),...(p||[]).filter(l=>l!=null)]}return n}var Ni=a(require("path"));function Ti(t,e){if(!e||!e.user_scripts||!e.user_scripts.api_script)return;let s=e.user_scripts.api_script;return Ni.default.join(t,s)}function Ie(t,e){return{"background/scripts":Oi(t,e),"background/service_worker":Ai(t,e),...Ri(t,e),"user_scripts/api_script":Ti(t,e)}}function qi(t){if(!(!t||!t.web_accessible_resources||!t.web_accessible_resources.length))return t.web_accessible_resources}function de({manifestPath:t,browser:e}){let s=Ui.default.dirname(t),r=require(t),n=ce(r,e||"chrome");return{html:De(s,n),icons:Ei(s,n),json:Di(s,n),locales:Li(s,t),scripts:Ie(s,n),web_accessible_resources:qi(n)}}var ge=a(require("path"));var _t=a(require("fs")),Oe=a(require("path"));function St(t,e){if(!_t.default.existsSync(t)||!_t.default.statSync(t).isDirectory())return[];let s=[];function r(n){let i=_t.default.readdirSync(n,{withFileTypes:!0});for(let o of i){let c=Oe.default.join(n,o.name);o.isDirectory()?r(c):o.isFile()&&e(o.name)&&s.push(c)}}return r(t),s}function Pt(t,e,s=""){return!e||!e.length?{}:e.reduce((r,n)=>{let i=Oe.default.extname(n),o=Oe.default.basename(n,i),c=s?`${s}/${o}`:Oe.default.relative(t,n);return{...r,[c]:n}},{})}function Wi({manifestPath:t}){let e=ge.default.dirname(t),s={public:ge.default.join(e,"public"),pages:ge.default.join(e,"pages"),scripts:ge.default.join(e,"scripts")},r={public:St(s.public,()=>!0),pages:St(s.pages,i=>i.endsWith(".html")),scripts:St(s.scripts,i=>[".js",".mjs",".jsx",".mjsx",".ts",".mts",".tsx",".mtsx"].includes(ge.default.extname(i)))};return{public:Pt(e,r.public),pages:Pt(e,r.pages,"pages"),scripts:Pt(e,r.scripts,"scripts")}}var kt=a(require("path")),Bi=a(require("webpack")),Et=class{manifestPath;includeList;excludeList;loaderOptions;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList,this.loaderOptions=e.loaderOptions}apply(e){new Bi.default.ProvidePlugin({r:[kt.default.resolve(__dirname,"./resolver-module.js"),"default"]}).apply(e),e.options.module?.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,loader:require.resolve(kt.default.resolve(__dirname,"./resolver-loader.js")),include:[kt.default.dirname(this.manifestPath)],exclude:/node_modules/,options:{manifestPath:this.manifestPath,includeList:this.includeList,jsx:this.loaderOptions?this.loaderOptions.jsx:!1,typescript:this.loaderOptions?this.loaderOptions.typescript:!1,minify:this.loaderOptions?this.loaderOptions.minify:!1}})}};var Ji=a(require("fs")),$t=a(require("webpack")),zi=require("webpack");var jt=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){e.hooks.compilation.tap("manifest:emit-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:emit-manifest",stage:$t.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{let r=this.manifestPath,n;try{let c=Ji.default.readFileSync(r,"utf-8");n=JSON.parse(c)}catch(c){let l=require(this.manifestPath).name||"Extension.js";s.errors.push(new $t.default.WebpackError(mn(l,c)));return}let i=JSON.stringify(n,null,2);s.emitAsset("manifest.json",new zi.sources.RawSource(i))})})}};var So=a(require("path")),Me=require("webpack");function Hi(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 Vi=a(require("path"));var Ct=t=>Vi.default.basename(t);function Gi(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/${Ct(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/${Ct(r)}`,r,e)]))},...t.browser_action.theme_icons&&{theme_icons:t.browser_action.theme_icons.map(s=>({...s,...s.light&&{light:h(`browser_action/${Ct(s.light)}`,s.light,e)},...s.dark&&{dark:h(`browser_action/${Ct(s.dark)}`,s.dark,e)}}))}}}}function Xi(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 Zi(t,e){return{...Hi(t,e),...Gi(t,e),...Xi(t,e)}}var Ki=a(require("path"));var Yi=t=>Ki.default.basename(t);function Qi(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/${Yi(t.action.default_icon)}`,t.action.default_icon,e):Object.fromEntries(Object.entries(t.action.default_icon).map(([s,r])=>[s,h(`action/${Yi(r)}`,r,e)]))}}}}function eo(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 Ft(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 to(t,e){return{...Qi(t,e),...eo(t,e),...Ft(t,e)}}function so(t,e){return t.background&&t.background.page&&{background:{...t.background,...t.background.page&&{page:h("background/page.html",t.background.page,e)}}}}function ro(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 no(t,e){return t.content_scripts&&{content_scripts:t.content_scripts.map((s,r)=>{let n=[...new Set(s.js)],i=[...new Set(s.css)];return{...s,js:[...n.map(o=>h(`content_scripts/content-${r}.js`,o,e))],css:[...i.map(o=>h(`content_scripts/content-${r}.css`,o,e))]}})}}function io(t,e){return t.devtools_page&&{devtools_page:h("devtools_page.html",t.devtools_page,e)}}var oo=a(require("path"));var Kp=t=>oo.default.basename(t);function ao(t,e){return t.icons&&{icons:Object.fromEntries(Object.entries(t.icons).map(([s,r])=>[s,h(`icons/${Kp(r)}`,r,e)]))}}function co(t,e){return t.options_page&&{options_page:h("options_ui/page.html",t.options_page,e)}}function po(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 fo=a(require("path"));var lo=t=>fo.default.basename(t);function mo(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/${lo(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/${lo(r)}`,r,e)]))}}}}function uo(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 go=a(require("path"));var Qp=t=>go.default.basename(t);function ho(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/${Qp(t.sidebar_action.default_icon)}`,t.sidebar_action.default_icon,e)}}}}function yo(t,e){return t.storage&&{storage:{...t.storage.managed_schema&&{managed_schema:h("storage/managed_schema.json",t.storage.managed_schema,e)}}}}var bo=a(require("path"));var el=t=>bo.default.basename(t);function wo(t,e){return t.theme&&{theme:{...t.theme,...t.theme.images&&{images:{...t.theme.images,theme_frame:h(`theme/images/${el(t.theme.images.theme_frame)}`,t.theme.images.theme_frame,e)}}}}}function xo(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 vo(t){return t.web_accessible_resources&&t.web_accessible_resources.length&&{web_accessible_resources:t.web_accessible_resources}}function _o(t,e){return{...so(t,e),...ro(t,e),...no(t,e),...io(t,e),...ao(t,e),...co(t,e),...po(t,e),...mo(t,e),...uo(t,e),...Ft(t,e),...ho(t,e),...yo(t,e),...wo(t,e),...xo(t,e),...vo(t)}}function nr(t,e,s){let r=e||require(t);return JSON.stringify({...r,..._o(r,s),...Zi(r,s),...to(r,s)},null,2)}var Dt=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)):{}}applyProdOverrides(e,s){return s.content_scripts?s.content_scripts.map((r,n)=>{if(r.js.length&&!r.css.length){let i=e.options.output?.path||"";r.css=r.js.map(o=>{let c=So.default.join(i,o.replace(".js",".css"));return h(`content_scripts/content-${n}.css`,c,{})})}return r}):{}}apply(e){e.hooks.thisCompilation.tap("manifest:update-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:update-manifest",stage:Me.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},()=>{if(s.errors.length>0)return;let r=B(s,this.manifestPath),n=nr(this.manifestPath,r,this.excludeList||{}),i={...r,...JSON.parse(n)};e.options.mode==="development"&&i.content_scripts&&(i.content_scripts=this.applyDevOverrides(i)),e.options.mode==="development"&&i.content_scripts&&(i.content_scripts=this.applyDevOverrides(i));let o=JSON.stringify(i,null,2),c=new Me.sources.RawSource(o);s.updateAsset("manifest.json",c)}),e.options.mode==="production"&&s.hooks.afterProcessAssets.tap("manifest:update-manifest",()=>{if(s.errors.length>0)return;let r=B(s,this.manifestPath),n=nr(this.manifestPath,r,this.excludeList||{}),i={...r,...JSON.parse(n)};i.content_scripts&&(i.content_scripts=this.applyProdOverrides(e,i));let o=JSON.stringify(i,null,2),c=new Me.sources.RawSource(o);s.updateAsset("manifest.json",c)})})}};var Po=a(require("fs")),Lt=class{dependencyList;constructor(e){this.dependencyList=e}apply(e){e.hooks.afterCompile.tap("ManifestPlugin (AddDependenciesPlugin)",s=>{if(s.errors?.length)return;let r=new Set(s.fileDependencies);this.dependencyList&&this.dependencyList.forEach(n=>{Po.default.existsSync(n)&&(r.has(n)||(r.add(n),s.fileDependencies.add(n)))})})}};var ko=a(require("fs")),Eo=a(require("path")),Ot=a(require("webpack"));var It=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"],i=[".js",".ts",".jsx",".tsx",".mjs",".cjs"],o=".html",c=Object.entries(this.includeList||{});for(let[p,l]of c)if(l){let m=this.extractPaths(l);for(let d of m){let g=Eo.default.extname(d),E=require(this.manifestPath).name||"Extension.js";if(!ko.default.existsSync(d)){let P=ie(E,p,d);r.includes(g)?e.errors.push(new s(P)):n.includes(g)?e.errors.push(new s(P)):i.includes(g)?e.errors.push(new s(P)):g===o?e.errors.push(new s(P)):e.errors.push(new s(P))}}}}apply(e){e.hooks.compilation.tap("manifest:check-manifest-files",s=>{s.hooks.processAssets.tap({name:"compatibility:check-manifest-files",stage:Ot.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT},()=>{let r=Ot.default.WebpackError;this.handleErrors(s,r)})})}};var jo=a(require("fs")),At=a(require("webpack"));var Mt=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 i=s.options.context||"",o=`${i}/package.json`;if(!jo.default.existsSync(o)){r();return}let c=require(this.manifestPath),p=ce(c,this.browser),l=this.flattenAndSort(Object.values(De(i,p))),m=this.flattenAndSort(Object.values(Ie(i,p)));s.hooks.thisCompilation.tap("manifest:throw-if-recompile-is-needed",d=>{d.hooks.processAssets.tap({name:"manifest:check-manifest-files",stage:At.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY},()=>{let y=d.getAsset("manifest.json")?.source.source().toString(),E=JSON.parse(y||"{}"),P=this.flattenAndSort(Object.values(De(i,E))),q=this.flattenAndSort(Object.values(Ie(i,E)));if(m.toString()!==q.toString()||l.toString()!==P.toString()){let U=l.filter(W=>!P.includes(W))[0],H=P.filter(W=>!l.includes(W))[0],Pe=un(H,U);d.errors.push(new At.default.WebpackError(Pe))}})})}r()})}};var Rt=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 jt({manifestPath:this.manifestPath}).apply(e),new It({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Dt({manifestPath:this.manifestPath,excludeList:this.excludeList}).apply(e),new Lt([this.manifestPath]).apply(e),new Mt({manifestPath:this.manifestPath,browser:this.browser,includeList:this.includeList}).apply(e)}};var pr=a(require("path"));var or=a(require("fs")),qt=a(require("webpack")),Lo=require("webpack");var $o=a(require("fs")),ye=a(require("path")),Co=a(require("parse5-utils"));var he=a(require("parse5-utils"));function Nt(t){try{return new URL(t),!0}catch{return!1}}function Ae(t,e){let{childNodes:s=[]}=t;for(let r of s)if(r.nodeName==="script"){let n=he.default.getAttribute(r,"src");if(!n||Nt(n))continue;e({filePath:n,childNode:r,assetType:"script"})}else if(r.nodeName==="link"){let n=he.default.getAttribute(r,"href"),i=he.default.getAttribute(r,"rel");if(!n||Nt(n))continue;e(i==="dns-prefetch"||i==="icon"||i==="manifest"||i==="modulepreload"||i==="preconnect"||i==="prefetch"||i==="preload"||i==="prerender"?{filePath:n,childNode:r,assetType:"staticHref"}:{filePath:n,childNode:r,assetType:"css"})}else if(r.nodeName==="a"||r.nodeName==="area"){let n=he.default.getAttribute(r,"href");if(!n||Nt(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=he.default.getAttribute(r,"src");if(!n||Nt(n))continue;e({filePath:n,childNode:r,assetType:"staticSrc"})}else Ae(r,e)}function $(t,e){let s={css:[],js:[],static:[]};if(!t)return s;let r=e||$o.default.readFileSync(t,{encoding:"utf8"}),n=Co.default.parse(r),i=(o,c)=>ye.default.join(ye.default.dirname(o),c.startsWith("/")?ye.default.relative(ye.default.dirname(o),c):c);for(let o of n.childNodes)if(o.nodeName==="html"){for(let c of o.childNodes)(c.nodeName==="head"||c.nodeName==="body")&&Ae(c,({filePath:p,assetType:l})=>{let m=i(t,p);switch(l){case"script":s.js?.push(m);break;case"css":s.css?.push(m);break;case"staticSrc":case"staticHref":if(p.startsWith("#"))break;s.static?.push(m);break;default:break}});return{css:s.css,js:s.js,static:s.static}}}function Fo(t,e,s){let r=Object.keys(t).find(i=>{let o=t[i];return t[i]===e||$(o)?.js?.includes(e)||$(o)?.css?.includes(e)})||"",n=ir(e);return r?`/${r.replace(n,"")}${s}`:`${e.replace(n,"")}${s}`}function ir(t){switch(ye.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 X(t,e,s){return s?`/${t}${e}`:`${t}${e}`}function Do(t,e){return Object.values(e||{}).some(s=>s===t)}var Tt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let r=require(this.manifestPath).name||"Extension.js";e.hooks.thisCompilation.tap("html:emit-html-file",n=>{n.hooks.processAssets.tap({name:"AddAssetsToCompilationPlugin",stage:qt.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let i=Object.entries(this.includeList||{});for(let o of i){let[c,p]=o;if(p){if(!or.default.existsSync(p)){let m=ie(r,c,p);n.warnings.push(new qt.default.WebpackError(m));return}let l=or.default.readFileSync(p,"utf8");if(!S(p,this.excludeList)){let m=new Lo.sources.RawSource(l),d=X(c,".html");n.emitAsset(d,m)}}}})})}};var Ut=a(require("fs")),be=a(require("path")),Io=a(require("webpack")),Re=require("webpack");var Wt=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:Re.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{if(s.errors.length>0)return;let r=Object.entries(this.includeList||{});for(let n of r){let[i,o]=n,c=i+".html";if(o){let p=s.getAsset(c);if(p){let l=p.source.source().toString(),m=$(o,l)?.static,d=[...new Set(m)];for(let g of d)if(!g.includes("public/")){if(!Ut.default.existsSync(g)&&!Do(g,this.includeList)&&!be.default.basename(g).startsWith("#")){let U=tt(require(this.manifestPath).name,o,g);s.warnings.push(new Io.default.WebpackError(U));return}let y=Ut.default.readFileSync(g),E=new Re.sources.RawSource(y),P=be.default.join("assets",be.default.basename(g));if(!s.getAsset(P))if(g.endsWith(".html")){let q=$(g),U=[...q?.js||[],...q?.css||[],...q?.static||[]];s.emitAsset(P,E),U.forEach(H=>{let Pe=Ut.default.readFileSync(H),W=new Re.sources.RawSource(Pe),Jr=be.default.join("assets",be.default.basename(H));s.getAsset(Jr)||s.emitAsset(Jr,W)})}else s.emitAsset(P,E)}}}}})})}};var Oo=a(require("path")),ar=a(require("fs"));var Bt=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,i]=r;if(i){if(!ar.default.existsSync(i))return;let o=$(i),c=o?.js||[],p=o?.css||[],l=[...c,...p].filter(m=>!S(m,this.excludeList));if(e.options.mode==="development"){let m=Oo.default.resolve(__dirname,"minimum-script-file.mjs");l.push(m)}ar.default.existsSync(i)&&(S(i,this.excludeList)||(e.options.entry={...e.options.entry,[n]:{import:l}}))}}}};var zt=require("webpack");var cr=a(require("fs")),Z=a(require("path")),D=a(require("parse5-utils"));function Mo(t,e,s,r,n){let i=cr.default.readFileSync(s,{encoding:"utf8"}),o=D.default.parse(i),c=!!t.getAsset(e+".css"),p=!1;for(let l of o.childNodes)if(l.nodeName==="html"){for(let m of l.childNodes){if((m.nodeName==="head"||m.nodeName==="body")&&Ae(m,({filePath:d,childNode:g,assetType:y})=>{let E=Z.default.dirname(s),P=Z.default.resolve(E,d),q=ir(P),U=S(Z.default.resolve(E,d),n),H=Z.default.join("/",Z.default.normalize(d)),Pe=$n(P,r);switch(y){case"script":{U?l=D.default.setAttribute(g,"src",H):(l=D.default.remove(g),p=!0);break}case"css":{U?l=D.default.setAttribute(g,"href",H):(l=D.default.remove(g),c=!0);break}case"staticHref":case"staticSrc":{if(U)l=D.default.setAttribute(g,y==="staticSrc"?"src":"href",H);else if(Pe){let W=Fo(r,P,q);l=D.default.setAttribute(g,y==="staticSrc"?"src":"href",W)}else{let W=Z.default.join("assets",Z.default.basename(P,q));cr.default.existsSync(P)&&(l=D.default.setAttribute(g,y==="staticSrc"?"src":"href",X(W,"",!0)))}break}default:break}}),m.nodeName==="head"&&c&&t.options.mode==="production"){let d=D.default.createNode("link");d.attrs=[{name:"rel",value:"stylesheet"},{name:"href",value:X(e,".css",!0)}],D.default.append(m,d)}if(m.nodeName==="body"&&(p||t.options.mode!=="production")){let d=D.default.createNode("script");d.attrs=[{name:"src",value:X(e,".js",!0)}],D.default.append(m,d)}}return D.default.serialize(o)}}var Jt=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:zt.Compilation.PROCESS_ASSETS_STAGE_DERIVED},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[i,o]=n;if(o){let c=Mo(s,i,o,r,this.excludeList||{});if(!S(o,this.excludeList)&&c){let p=new zt.sources.RawSource(c),l=X(i,".html");s.updateAsset(l,p)}}}})})}};var Ao=a(require("fs")),Ro=require("webpack");var Ht=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:Ro.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,i]=n;if(i){let o=$(i),c=new Set(s.fileDependencies);if(Ao.default.existsSync(i)){let p=[i,...o?.static||[]];for(let l of p)c.has(l)||(c.add(l),l===i&&s.fileDependencies.add(l))}}}})})}};var No=a(require("fs"));var Vt=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(!No.default.existsSync(n)){let o=require(this.manifestPath).name||"Extension.js";console.error(ie(o,s,n)),process.exit(1)}this.initialHtmlAssets[n]={js:$(n)?.js||[],css:$(n)?.css||[]}}})}apply(e){let s=this.includeList||{};this.storeInitialHtmlAssets(s),e.hooks.make.tapAsync("html:throw-if-recompile-is-needed",(r,n)=>{let i=e.modifiedFiles||new Set,o=Array.from(i)[0];if(o&&this.initialHtmlAssets[o]){let c=$(o)?.js||[],p=$(o)?.css||[],{js:l,css:m}=this.initialHtmlAssets[o];if(this.hasEntriesChanged(p,m)||this.hasEntriesChanged(c,l)){let d=require(this.manifestPath).name;console.log(wn(d,o))}}n()})}};var To=a(require("fs")),qo=require("webpack");function sl(t,e,s){let r="Module not found: Error: Can't resolve ",i=s.message.replace(r,"").split("'")[1];if(s.message.includes(r))for(let o of Object.entries(e)){let[,c]=o;if(c){if(!To.default.existsSync(c))return null;let p=$(c),l=p?.js||[],m=p?.css||[];if(l.includes(i)||m.includes(i)){let d=tt(require(t).name,c,i);return new qo.WebpackError(d)}}}return null}var Gt=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 i=sl(this.manifestPath,this.includeList||{},r);i&&(s.errors[n]=i)})})})}};var Xt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Tt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Wt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Bt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Jt({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:[pr.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(pr.default.join(__dirname,"ensure-hmr-for-scripts.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}}]}),new Ht({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Vt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Gt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var Ne=a(require("path"));var lr=a(require("fs")),Uo=a(require("path"));function Wo(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(n=>{let i=lr.default.existsSync(n)&&!S(n,e),o=Uo.default.extname(n);return i&&(o===".js"||o===".mjs"||o===".jsx"||o===".ts"||o===".tsx")})}function Bo(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(n=>lr.default.existsSync(n)&&!S(n,e)&&(n.endsWith(".css")||n.endsWith(".scss")||n.endsWith(".sass")||n.endsWith(".less")))}var Zt=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,i]of Object.entries(s)){let o=Wo(i,this.excludeList),c=Bo(i,this.excludeList),p=[...o];e.options.mode==="production"&&p.push(...c),(c.length||o.length)&&(r[n]={import:p})}e.options.entry={...e.options.entry,...r}}};var te=require("webpack"),rl=['var isBrowser = !!(() => { try { return browser.runtime.getURL("/") } catch(e) {} })()','var isChrome = !!(() => { try { return chrome.runtime.getURL("/") } catch(e) {} })()'],nl=[...rl,`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 } }`],Yt=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 i=il();return r.addRuntimeModule(n,i),!0})})}};function il(){class t extends te.RuntimeModule{constructor(){super("publicPath",te.RuntimeModule.STAGE_BASIC)}generate(){let s=this.compilation?.outputOptions.publicPath;return te.Template.asString([...nl,`var path = ${JSON.stringify(this.compilation?.getPath(s||"",{hash:this.compilation.hash||"XXXX"}))}`,`${te.RuntimeGlobals.publicPath} = typeof importScripts === 'function' || !(isBrowser || isChrome) ? path : runtime.runtime.getURL(path);`])}}return new t}var Kt=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);s.content_scripts?.some(r=>r.world&&r.world.toLowerCase()==="main")&&ee.includes(this.browser)&&!s.key&&(console.error(_n(s.name||"")),process.exit(1))}};var Qt=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 Zt({manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Ne.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(Ne.default.join(__dirname,"inject-content-css-during-dev.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Ne.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(Ne.default.join(__dirname,"add-hmr-accept-code.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="production"&&new Yt().apply(e),new Kt({manifestPath:this.manifestPath,browser:this.browser||"chrome",includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e)}};var mr=a(require("path")),Te=a(require("fs")),ur=a(require("webpack")),qe=require("webpack");var we=a(require("path")),es=a(require("fs"));function fr(t){let e=we.default.join(we.default.dirname(t),"_locales"),s=[];if(es.default.existsSync(e))for(let r of es.default.readdirSync(e)){let n=we.default.join(e,r);for(let i of es.default.readdirSync(n))s.push(we.default.join(we.default.dirname(t),"_locales",r,i))}return s}var ts=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:qe.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{let n=require(this.manifestPath).name||"Extension.js";if(!Te.default.existsSync(this.manifestPath)){s.errors.push(new ur.default.WebpackError(fn(n,this.manifestPath)));return}if(s.errors.length>0)return;let i=fr(this.manifestPath);for(let o of Object.entries(i||[])){let[c,p]=o,l=p;if(l){if(!Te.default.existsSync(l)){s.warnings.push(new ur.default.WebpackError(st(n,c,l)));return}let m=Te.default.readFileSync(l),d=new qe.sources.RawSource(m),g=e.options.context||mr.default.dirname(this.manifestPath);if(!S(l,this.excludeList)){let y=mr.default.relative(g,l);s.emitAsset(y,d)}}}})}),e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:qe.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=fr(this.manifestPath);for(let n of Object.entries(r||[])){let[,i]=n;if(i){let o=new Set(s.fileDependencies),c=r||[];for(let p of c)Te.default.existsSync(p)&&(o.has(p)||(o.add(p),s.fileDependencies.add(p)))}}})})}};var ss=a(require("fs")),Jo=a(require("webpack")),Ue=require("webpack");var rs=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:Ue.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[i,o]=n,c=Array.isArray(o)?o:[o];for(let p of c)if(p&&!S(p,this.excludeList)){if(!ss.default.existsSync(p)){let g=require(this.manifestPath).name||"Extension.js";s.warnings.push(new Jo.default.WebpackError(st(g,i,p)));return}let l=ss.default.readFileSync(p),m=new Ue.sources.RawSource(l);s.emitAsset(i+".json",m)}}})}),e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:Ue.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,i]=n,o=Array.isArray(i)?i:[i];for(let c of o)if(c){let p=new Set(s.fileDependencies);S(c,this.excludeList)||ss.default.existsSync(c)&&(p.has(c)||(p.add(c),s.fileDependencies.add(c)))}}})})}};var dr=a(require("fs")),zo=a(require("path")),is=require("webpack");var ns=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:is.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[i,o]=n;if(o===void 0)continue;let c=Array.isArray(o)?typeof o[0]=="string"?o:o.map(Object.values).flat():[o];for(let p of c)if(p){if(!dr.default.existsSync(p))continue;if(!S(p,this.excludeList)){let l=dr.default.readFileSync(p),m=new is.sources.RawSource(l),d=zo.default.basename(p),y=`${i.endsWith("theme_icons")?i.replace("theme_icons",""):i}/${d}`;s.emitAsset(y,m)}}}})})}};var Ho=a(require("fs")),Vo=require("webpack"),os=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:Vo.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,i]=n,o=Array.isArray(i)?typeof i[0]=="string"?i:i.map(Object.values).flat():[i];for(let c of o)if(c){let p=new Set(s.fileDependencies);Ho.default.existsSync(c)&&(p.has(c)||(p.add(c),s.fileDependencies.add(c)))}}})})}};var as=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new ns({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new os({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var ps=require("webpack");var cs=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}generateManifestPatches(e,s){let r=B(e,this.manifestPath),n=r.web_accessible_resources||[],i=r.web_accessible_resources||[];for(let[p,l]of Object.entries(s)){let m=r.content_scripts?.find(d=>d.js&&d.js.some(g=>g.includes(p)));if(m){let d=m.matches||[];if(r.manifest_version===3){let g=n.find(y=>y.matches.some(E=>d.includes(E)));g?l.forEach(y=>{g.resources.includes(y)||g.resources.push(y)}):n.push({resources:l.filter(y=>!y.endsWith(".map")),matches:d})}else l.forEach(g=>{i.includes(g)||i.push(g)})}}r.manifest_version===3?r.web_accessible_resources=n:r.web_accessible_resources=Array.from(new Set(i));let o=JSON.stringify(r,null,2),c=new ps.sources.RawSource(o);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:ps.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 i=s.chunkGraph,o={};s.entrypoints.forEach((c,p)=>{if(r.includes(p)){let l=[];c.chunks.forEach(m=>{Array.from(i.getChunkModulesIterable(m)).forEach(g=>{i.getModuleChunks(g).forEach(y=>{y.auxiliaryFiles.forEach(E=>{l.includes(E)||l.push(E)})})})}),o[p]=l}}),this.generateManifestPatches(s,o)})})}};var L=a(require("fs")),I=a(require("path")),Go=a(require("chokidar")),ls=class{options;constructor(e){this.options=e}ensureDirectoryExistence(e){let s=I.default.dirname(e);if(L.default.existsSync(s))return!0;L.default.mkdirSync(s,{recursive:!0})}copyFile(e,s){this.ensureDirectoryExistence(s),L.default.copyFileSync(e,s)}copyFolder(e,s){L.default.existsSync(s)||L.default.mkdirSync(s,{recursive:!0}),L.default.readdirSync(e).forEach(n=>{let i=I.default.join(e,n),o=I.default.join(s,n);L.default.statSync(i).isDirectory()?this.copyFolder(i,o):this.copyFile(i,o)})}apply(e){let s=I.default.dirname(this.options.manifestPath),r=I.default.join(s,"public"),n=e.options.output?.path||"";L.default.existsSync(r)&&(e.hooks.afterEmit.tap("special-folders:copy-public-folder",()=>{let i=I.default.join(n,"public");L.default.existsSync(i)||L.default.mkdirSync(i,{recursive:!0}),L.default.existsSync(r)&&this.copyFolder(r,i)}),e.options.mode!=="production"&&e.hooks.afterPlugins.tap("special-folders:copy-public-folder",()=>{let i=I.default.join(s,"public"),o=Go.default.watch(i,{ignoreInitial:!0});o.on("add",c=>{let p=I.default.join(n,I.default.relative(s,c));this.copyFile(c,p)}),o.on("change",c=>{let p=I.default.join(n,I.default.relative(s,c));this.copyFile(c,p)}),o.on("unlink",c=>{let p=I.default.join(n,I.default.relative(s,c));L.default.existsSync(p)&&L.default.unlinkSync(p)}),e.hooks.watchClose.tap("special-folders:copy-public-folder",()=>{o.close().catch(console.error)})}))}};var N=a(require("path")),gr=a(require("chokidar"));var fs=class{manifestPath;constructor(e){this.manifestPath=e}throwCompilationError(e,s,r){let n=N.relative(process.cwd(),s),p=dn(r?"Adding":"Removing",r?"added":"removed",e,e==="pages"?"HTML pages":"script files",n);if(r){console.warn(p);return}console.error(p),process.exit(1)}apply(e){e.hooks.afterPlugins.tap("special-folders:warn-upon-folder-changes",()=>{let s=N.dirname(this.manifestPath),r=N.join(s,"pages"),n=N.join(s,"scripts"),i=gr.watch(r,{ignoreInitial:!0}),o=gr.watch(n,{ignoreInitial:!0}),c=e.options.resolve?.extensions;i.on("add",p=>{p.endsWith(".html")&&this.throwCompilationError("pages",p,!0)}),i.on("unlink",p=>{p.endsWith(".html")&&this.throwCompilationError("pages",p)}),o.on("add",p=>{c?.includes(N.extname(p))&&this.throwCompilationError("scripts",p,!0)}),o.on("unlink",p=>{c?.includes(N.extname(p))&&this.throwCompilationError("scripts",p)}),e.hooks.watchClose.tap("WarnUponFolderChanges",()=>{i.close().catch(console.error),o.close().catch(console.error)})})}};var ms=class{static name="plugin-special-folders";options;constructor(e){this.options=e}apply(e){let{manifestPath:s}=this.options;new ls({manifestPath:s}).apply(e),e.options.mode==="development"&&e.options.watchOptions&&new fs(s).apply(e)}};var us=class{static name="plugin-extension";manifestPath;browser;mode;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.mode=e.mode}apply(e){let s=this.manifestPath,r=de({manifestPath:s}),n=Wi({manifestPath:s});new Et({manifestPath:s,includeList:{...n?.pages||{},...n?.scripts||{}},excludeList:n.public,loaderOptions:{jsx:ue(We.default.dirname(this.manifestPath))||me(We.default.dirname(this.manifestPath))||Ce(We.default.dirname(this.manifestPath)),typescript:G(We.default.dirname(this.manifestPath)),minify:this.mode==="production"}}).apply(e),new Rt({browser:this.browser,manifestPath:s,includeList:{...r.html,...r.icons,...r.json,...r.scripts},excludeList:n.public}).apply(e),new Xt({manifestPath:s,includeList:{...r.html,...n.pages},excludeList:{...n.public,...n.scripts}}).apply(e),new Qt({manifestPath:s,browser:this.browser,includeList:{...r.scripts,...n.scripts},excludeList:{...n.public,...n.pages}}).apply(e),new ts({manifestPath:s}).apply(e),new rs({manifestPath:s,includeList:r.json,excludeList:n.public}).apply(e),new as({manifestPath:s,includeList:r.icons,excludeList:n.public}).apply(e),new cs({manifestPath:s,includeList:{...r.scripts,...n.scripts},excludeList:n.public}).apply(e),new ms({manifestPath:s}).apply(e)}};var ze=a(require("path"));var Xo=a(require("path")),Zo=a(require("ws"));function ds(t,e){t.clients.forEach(s=>{s.readyState===Zo.default.OPEN&&s.send(JSON.stringify(e))})}function Yo(t,e,s){if(!s||!e)return;let r=de({manifestPath:e}).locales,n=de({manifestPath:e}).scripts,i=de({manifestPath:e}).json;if(!t){process.env.EXTENSION_ENV==="development"&&console.error("WebSocket server is not running.");return}Xo.default.basename(s)==="manifest.json"&&ds(t,{changedFile:"manifest.json"}),r?.forEach(o=>{o.includes(s)&&ds(t,{changedFile:"_locales"})}),Object.entries(n).forEach(([o,c])=>{let p=Array.isArray(c)?c:[c];Object.values(p).flatMap(m=>m).includes(s)&&o==="background/service_worker"&&ds(t,{changedFile:"service_worker"})}),Object.entries(i).forEach(([o,c])=>{c?.includes(s)&&o==="declarative_net_request"&&ds(t,{changedFile:"declarative_net_request"})})}var yr=a(require("path")),ta=a(require("fs")),Je=a(require("ws"));var Be=a(require("path")),ol=a(require("http")),Qo=a(require("https")),hr=a(require("fs"));var Ko=t=>{if(!hr.default.existsSync(t))return;let e=Be.default.basename(t);return hr.default.readFileSync(Be.default.join(__dirname,"certs",e))};function ea(t,e){let s={key:Ko(Be.default.join(__dirname,"certs","localhost.key")),cert:Ko(Be.default.join(__dirname,"certs","localhost.cert"))},r=Qo.default.createServer(s,(n,i)=>{i.writeHead(200),i.end()});return r.on("error",n=>{throw console.error(vn(t,e)),new Error(n.message)}),{server:r,port:e}}function al(t,e,s){switch(s){case"chrome":return new Je.default.Server({host:"localhost",port:e});case"edge":return new Je.default.Server({host:"localhost",port:e+1});case"firefox":return new Je.default.Server({server:ea(t,e+2).server});default:return new Je.default.Server({host:"localhost",port:8888})}}async function sa(t,e){let s=t.options.context||"",r=require(yr.default.join(s,"manifest.json")),n=r.name||"Extension.js",i=e.port||8e3,o=al(n,i,e.browser);if(o.on("connection",c=>{c.send(JSON.stringify({status:"serverReady"})),c.on("error",p=>{console.log(yn(n,p))}),c.on("message",p=>{let l=JSON.parse(p.toString());if(l.status==="clientReady"){let m=require(yr.default.join(s,"manifest.json"));setTimeout(()=>{console.log(Hs(m,e.browser,l)),console.log("")},2500),Cn(e.browser)&&setTimeout(()=>{console.log(hn(e.browser))},5e3)}})}),e.browser==="firefox"&&!ta.default.existsSync(et)){let c=Fn(r);console.log(Hs(r,e.browser,c)),console.log(""),console.log(xn()),console.log("")}return o}var ra=a(require("path")),br=a(require("fs"));function na(t,e){let s=ra.default.resolve(__dirname,`./extensions/${t}-manager-extension/reload-service.js`);try{let r=br.default.readFileSync(s,"utf8"),n=r.replace(/__RELOAD_PORT__/g,e.toString());n!==r&&br.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 He=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;na(this.browser,this.port);let s=await sa(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 o=(r.modifiedFiles||new Set).values().next().value;if(!o){n();return}let c=ze.default.relative(ze.default.dirname(this.manifestPath),o),p=ze.default.relative(process.cwd(),ze.default.dirname(o));process.env.EXTENSION_ENV==="development"&&console.info(`\u25BA\u25BA Updated file \`${c}\` (relative to ${p})`),this.manifestPath&&Yo(s,this.manifestPath,o),n()})}};var wr=a(require("path"));function ia(t,e,s){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[wr.default.dirname(s)],exclude:/node_modules/,use:[{loader:wr.default.resolve(__dirname,"./inject-chromium-client-loader"),options:{manifestPath:s,browser:e}}]})}var xr=a(require("path"));function oa(t,e,s){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[xr.default.dirname(s)],exclude:/node_modules/,use:[{loader:xr.default.resolve(__dirname,"./inject-firefox-client-loader"),options:{manifestPath:s,browser:e}}]})}var hs=require("webpack");var vr=a(require("content-security-policy-parser"));function aa(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,vr.default)(e);e="",s.get("script-src")||s.set("script-src",["'self' 'unsafe-eval' blob: filesystem:"]),s.get("script-src")?.includes("'unsafe-eval'")||s.set("script-src",["unsafe-eval"]);for(let r in s)e+=`${r} ${s.get(r)?.join(" ")};`;return e}function ca(t){let e=t.content_security_policy;if(!e)return{extension_pages:"script-src 'self'; object-src 'self'; "};let s=(0,vr.default)(e.extension_pages||""),r="";for(let n in s)r+=`${n} ${s.get(n)?.join(" ")}; `;return{extension_pages:r.trim()}}function pa(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 la(t){let e=["/*.json","/*.js","/*.css"];return[...t.web_accessible_resources||[],{resources:e,matches:["<all_urls>"]}]}function _r(t,e){return t.background?{background:{...t.background}}:e==="firefox"?{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 Sr(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 gs=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}generateManifestPatches(e){let s=B(e,this.manifestPath),r={...s,content_security_policy:s.manifest_version===3?ca(s):aa(s),...s.manifest_version===3?s.permissions?{permissions:[...new Set(["scripting",...s.permissions])]}:{permissions:["scripting"]}:{},..._r(s,this.browser),...Sr(s),web_accessible_resources:s.manifest_version===3?la(s):pa(s)},n=JSON.stringify(r,null,2),i=new hs.sources.RawSource(n);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",i)}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:hs.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.webpack.WebpackError&&s.errors.push(new e.webpack.WebpackError(`run-chromium: ${n}`));return}this.generateManifestPatches(s)})})}};var Pr=a(require("fs")),xe=a(require("path")),fa=a(require("webpack-target-webextension"));var ys=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}handleBackground(e,s,r){let n=xe.default.resolve(__dirname,s==="firefox"?"minimum-firefox-file.mjs":"minimum-chromium-file.mjs"),i=xe.default.dirname(this.manifestPath),o=r.background;if(s==="firefox"){o=r["gecko:background"]||r["firefox:background"]||o;let c=o?.scripts||o?.["gecko:scripts"]||o?.["firefox:scripts"];if(c&&c.length>0){let p=xe.default.join(i,c[0]);this.ensureFileExists(p,"background.scripts")}else this.addDefaultEntry(e,"background/script",n)}else if(o=r["chromium:background"]||r["chrome:background"]||r["edge:background"]||o,r.manifest_version===3){let c=o?.service_worker||o?.["chromium:service_worker"]||o?.["chrome:service_worker"]||o?.["edge:service_worker"];if(c){let p=xe.default.join(i,c);this.ensureFileExists(p,"background.service_worker")}else this.addDefaultEntry(e,"background/service_worker",n)}else if(r.manifest_version===2){let c=o?.scripts||o?.["chromium:scripts"]||o?.["chrome:scripts"]||o?.["edge:scripts"];if(c&&c.length>0){let p=xe.default.join(i,c[0]);this.ensureFileExists(p,"background.scripts")}else this.addDefaultEntry(e,"background/script",n)}}ensureFileExists(e,s){if(!Pr.default.existsSync(e)&&this.manifestPath){let n=require(this.manifestPath).name||"Extension.js",i=bn(n,s,e);throw console.error(i),new Error(i)}}addDefaultEntry(e,s,r){e.options.entry={...e.options.entry,[s]:{import:[r]}}}getEntryName(e){if(e.background){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||!Pr.default.lstatSync(this.manifestPath).isFile())return;let s=require(this.manifestPath);this.handleBackground(e,this.browser,s),new fa.default({background:this.getEntryName(s),weakRuntimeCheck:!0}).apply(e)}};var kr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){ee.includes(this.browser)&&ia(e,this.browser,this.manifestPath),this.browser==="firefox"&&oa(e,this.browser,this.manifestPath),new gs({manifestPath:this.manifestPath,browser:this.browser}).apply(e),new ys({manifestPath:this.manifestPath,browser:this.browser}).apply(e)}},ma=kr;var bs=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 He({manifestPath:this.manifestPath,browser:this.browser,port:this.port,stats:this.stats}).apply(e),e.options.mode==="development"&&new ma({manifestPath:this.manifestPath,browser:this.browser,autoReload:this.autoReload,stats:this.stats}).apply(e)}};var ua=a(require("webpack")),ws=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser}apply(e){new ua.default.ProvidePlugin({browser:require.resolve("webextension-polyfill")}).apply(e)}};var vs=require("webpack");var xs=class{browser;manifestPath;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}patchManifest(e){let s=ce(e,this.browser);return JSON.stringify(s,null,2)}apply(e){e.hooks.compilation.tap("compatibility:browser-fields",s=>{s.hooks.processAssets.tap({name:"compatibility:browser-fields",stage:vs.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE},()=>{let r=B(s,this.manifestPath),n=this.patchManifest(r),i=new vs.sources.RawSource(n);s.updateAsset("manifest.json",i)})})}};var _s=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 ws({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new xs({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e)}};var Pa=a(require("fs"));var da=a(require("webpack")),ga=a(require("content-security-policy-parser"));function ha(t){let e=t.content_security_policy,s=t.content_security_policy?.extension_pages,r=n=>{if(!n)return;let i=(0,ga.default)(n);if(i.get("script-src")&&i.get("script-src")?.includes("'unsafe-eval'")){let o=t.name||"Extension.js";return tn(o)}};if(t.manifest_version===3){let n=e?r(s):void 0;if(n)return new da.default.WebpackError(n)}return null}var Er=a(require("webpack"));function ya(t,e){let s=t.web_accessible_resources;if(s){let r=s.some(o=>typeof o=="string"),n=s.some(o=>typeof o=="object"||o.resources||o.matches),i=t.name||"Extension.js";if(t.manifest_version===2&&!r)return new Er.default.WebpackError(rn(i,e));if(t.manifest_version===3&&!n)return new Er.default.WebpackError(nn(i,e))}return null}var ba=a(require("webpack"));function wa(t,e){if(e==="firefox"&&t.background?.service_worker){let s=t.name||"Extension.js";return new ba.default.WebpackError(en(s))}return null}var xa=a(require("path")),va=a(require("fs")),_a=a(require("webpack"));function Sa(t,e){let s=xa.default.join(e.options.context||"","_locales"),r=t.name||"Extension.js";return va.default.existsSync(s)&&!t.default_locale?new _a.default.WebpackError(sn(r)):null}var Ss=class{options;constructor(e){this.options=e}handleRuntimeErrors(e,s,r){let n=ha(s),i=ya(s,r),o=wa(s,r),c=Sa(s,e);n&&e.errors.push(n),i&&e.errors.push(i),o&&e.options.mode==="production"&&e.errors.push(o),c&&e.errors.push(c)}apply(e){e.hooks.afterCompile.tapAsync("CompatPlugin (module)",(s,r)=>{let n=this.options.manifestPath,i=JSON.parse(Pa.default.readFileSync(n,"utf-8")),o=this.options.browser||"chrome";this.handleRuntimeErrors(s,i,o),r()})}};var Ma=a(require("fs")),Aa=a(require("ajv"));var ka={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://json.schemastore.org/chrome-manifest.json",additionalProperties:!0,definitions:{action_v2:{type:"object",properties:{default_title:{type:"string",description:"Tooltip for the main toolbar icon."},default_popup:{$ref:"#/definitions/uri",description:"The popup appears when the user clicks the icon."},default_icon:{anyOf:[{type:"string",description:"FIXME: String form is deprecated."},{type:"object",description:"Icon for the main toolbar.",properties:{"19":{$ref:"#/definitions/icon"},"38":{$ref:"#/definitions/icon"}}}]}},dependencies:{name:{not:{required:["name"]}},icons:{not:{required:["icons"]}},popup:{not:{required:["popup"]}}}},action_v3:{type:"object",properties:{default_title:{type:"string",description:"Tooltip for the main toolbar icon."},default_popup:{$ref:"#/definitions/uri",description:"The popup appears when the user clicks the icon."},default_icon:{type:"object",properties:{"16":{$ref:"#/definitions/icon"},"24":{$ref:"#/definitions/icon"},"32":{$ref:"#/definitions/icon"}}}},dependencies:{name:{not:{required:["name"]}},icons:{not:{required:["icons"]}},popup:{not:{required:["popup"]}}}},command:{type:"object",if:{$comment:"Global shortcuts change the acceptable pattern for the suggested_key.",properties:{global:{const:!0}},required:["global"]},then:{additionalProperties:!1,properties:{description:{type:"string"},global:{type:"boolean",description:"Whether this command should work while Chrome does not have focus. Keyboard shortcut suggestions for global commands are limited to Ctrl+Shift+[0..9]"},suggested_key:{type:"object",additionalProperties:!1,patternProperties:{"^(default|mac|windows|linux|chromeos)$":{type:"string",pattern:"^(Ctrl|Command|MacCtrl)\\+Shift\\+[0-9]"}}}}},else:{additionalProperties:!1,properties:{description:{type:"string"},global:{type:"boolean",description:"Whether this command should work while Chrome does not have focus. Keyboard shortcut suggestions for global commands are limited to Ctrl+Shift+[0..9]"},suggested_key:{type:"object",additionalProperties:!1,patternProperties:{"^(default|mac|windows|linux|chromeos)$":{type:"string",pattern:"^(Ctrl|Command|MacCtrl|Alt|Option)\\+(Shift\\+)?[A-Z]"}}}}}},content_security_policy:{type:"string",description:"This introduces some fairly strict policies that will make extensions more secure by default, and provides you with the ability to create and enforce rules governing the types of content that can be loaded and executed by your extensions and applications.",format:"content-security-policy",default:"script-src 'self'; object-src 'self'"},glob_pattern:{type:"string",format:"glob-pattern"},icon:{$ref:"#/definitions/uri"},match_pattern:{type:"string",format:"match-pattern",pattern:"^((\\*|http|https|file|ftp|chrome-extension):\\/\\/(\\*|\\*\\.[^\\/\\*]+|[^\\/\\*]+)?(\\/.*))|urn:(\\*|.*)|<all_urls>$"},mime_type:{type:"string",format:"mime-type",pattern:"^(?:application|audio|image|message|model|multipart|text|video)\\/[-+.\\w]+$"},page:{$ref:"#/definitions/uri"},permissions:{type:"array",uniqueItems:!0,items:{type:"string",format:"permission"}},scripts:{type:"array",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/uri"}},uri:{type:"string"},version_string:{type:"string",pattern:"^(?:\\d{1,5}\\.){0,3}\\d{1,5}$"},web_resource:{type:"object",required:["resources"],properties:{resources:{type:"array",description:`An array of resources to be exposed. Resources are specified as strings and may contain * for wildcard matches. For example, "/images/*" exposes everything in the extension's /images directory recursively while "*.png" exposes all PNG files.`,items:{$ref:"#/definitions/glob_pattern"}},matches:{type:"array",description:"A list of URL match patterns specifying which pages can access the resources. Only the origin is used to match URLs; subdomains patterns (*.google.com) and paths are ignored.",items:{$ref:"#/definitions/match_pattern"}},extension_ids:{type:"array",description:"A list of extension IDs, specifying which extensions can access the resources.",items:{type:"string"}},use_dynamic_url:{type:"boolean",description:"If true, only allow resources to be accessible through dynamic ID. The dynamic ID is generated per session. It's regenerated on browser restart or extension reload."}}}},dependencies:{content_scripts:{not:{required:["script_badge"]}},script_badge:{not:{required:["content_scripts"]}}},else:{properties:{background:{type:"object",description:"The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.",properties:{persistent:{type:"boolean",description:"When false, makes the background page an event page (loaded only when needed).",default:!0},page:{$ref:"#/definitions/page",description:"Specify the HTML of the background page.",default:"background.html"},scripts:{$ref:"#/definitions/scripts",description:"A background page will be generated by the extension system that includes each of the files listed in the scripts property.",default:["background.js"]}},dependencies:{page:{not:{required:["scripts"]}},scripts:{not:{required:["page"]}}}},browser_action:{$ref:"#/definitions/action_v2",description:"Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup."},page_action:{$ref:"#/definitions/action_v2",description:"Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages."},content_security_policy:{$ref:"#/definitions/content_security_policy"},web_accessible_resources:{type:"array",description:"An array of strings specifying the paths (relative to the package root) of packaged resources that are expected to be usable in the context of a web page.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/uri"}}},dependencies:{page_action:{not:{required:["browser_action"]}},browser_action:{not:{required:["page_action"]}}}},if:{properties:{manifest_version:{const:3}}},properties:{manifest_version:{type:"number",description:"One integer specifying the version of the manifest file format your package requires.",enum:[2,3]},name:{type:"string",description:"The name of the extension",maxLength:45},version:{$ref:"#/definitions/version_string",description:"One to four dot-separated integers identifying the version of this extension."},default_locale:{type:"string",description:"Specifies the subdirectory of _locales that contains the default strings for this extension.",default:"en"},description:{type:"string",description:"A plain text description of the extension",maxLength:132},icons:{type:"object",description:"One or more icons that represent the extension, app, or theme. Recommended format: PNG; also BMP, GIF, ICO, JPEG.",minProperties:1,properties:{"16":{$ref:"#/definitions/icon",description:"Used as the favicon for an extension's pages and infobar."},"48":{$ref:"#/definitions/icon",description:"Used on the extension management page (chrome://extensions)."},"128":{$ref:"#/definitions/icon",description:"Used during installation and in the Chrome Web Store."},"256":{$ref:"#/definitions/icon",description:"Used during installation and in the Chrome Web Store."}}},chrome_url_overrides:{type:"object",description:"Override pages are a way to substitute an HTML file from your extension for a page that Google Chrome normally provides.",additionalProperties:!1,maxProperties:1,properties:{bookmarks:{$ref:"#/definitions/page",description:"The page that appears when the user chooses the Bookmark Manager menu item from the Chrome menu or, on Mac, the Bookmark Manager item from the Bookmarks menu. You can also get to this page by entering the URL chrome://bookmarks.",default:"bookmarks.html"},history:{$ref:"#/definitions/page",description:"The page that appears when the user chooses the History menu item from the Chrome menu or, on Mac, the Show Full History item from the History menu. You can also get to this page by entering the URL chrome://history.",default:"history.html"},newtab:{$ref:"#/definitions/page",description:"The page that appears when the user creates a new tab or window. You can also get to this page by entering the URL chrome://newtab.",default:"newtab.html"}}},commands:{type:"object",description:"Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.",patternProperties:{".*":{$ref:"#/definitions/command"},"^_execute_browser_action$":{$ref:"#/definitions/command"},"^_execute_page_action$":{$ref:"#/definitions/command"}}},content_scripts:{type:"array",description:"Content scripts are JavaScript files that run in the context of web pages.",minItems:1,uniqueItems:!0,items:{type:"object",required:["matches"],additionalProperties:!1,properties:{matches:{type:"array",description:"Specifies which pages this content script will be injected into.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/match_pattern"}},exclude_matches:{type:"array",description:"Excludes pages that this content script would otherwise be injected into.",uniqueItems:!0,items:{$ref:"#/definitions/match_pattern"}},css:{type:"array",description:"The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.",uniqueItems:!0,items:{$ref:"#/definitions/uri"}},js:{$ref:"#/definitions/scripts",description:"The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array."},world:{type:"string",description:"The JavaScript world for a script to execute within.",enum:["ISOLATED","MAIN"],default:"ISOLATED"},run_at:{type:"string",description:"Controls when the files in js are injected.",enum:["document_start","document_end","document_idle"],default:"document_idle"},all_frames:{type:"boolean",description:"Controls whether the content script runs in all frames of the matching page, or only the top frame.",default:!1},include_globs:{type:"array",description:"Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword.",uniqueItems:!0,items:{$ref:"#/definitions/glob_pattern"}},exclude_globs:{type:"array",description:"Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword.",uniqueItems:!0,items:{$ref:"#/definitions/glob_pattern"}},match_about_blank:{type:"boolean",description:"Whether to insert the content script on about:blank and about:srcdoc.",default:!1}}}},devtools_page:{$ref:"#/definitions/page",description:"A DevTools extension adds functionality to the Chrome DevTools. It can add new UI panels and sidebars, interact with the inspected page, get information about network requests, and more."},externally_connectable:{description:"Declares which extensions, apps, and web pages can connect to your extension via runtime.connect and runtime.sendMessage.",type:"object",additionalProperties:!1,properties:{ids:{type:"array",items:{type:"string",description:"The IDs of extensions or apps that are allowed to connect. If left empty or unspecified, no extensions or apps can connect."}},matches:{type:"array",items:{type:"string",description:"The URL patterns for web pages that are allowed to connect. This does not affect content scripts. If left empty or unspecified, no web pages can connect."}},accepts_tls_channel_id:{type:"boolean",default:!1,description:"Indicates that the extension would like to make use of the TLS channel ID of the web page connecting to it. The web page must also opt to send the TLS channel ID to the extension via setting includeTlsChannelId to true in runtime.connect's connectInfo or runtime.sendMessage's options."}}},file_browser_handlers:{type:"array",description:"You can use this API to enable users to upload files to your website.",minItems:1,items:{type:"object",required:["id","default_title","file_filters"],additionalProperties:!1,properties:{id:{type:"string",description:"Used by event handling code to differentiate between multiple file handlers"},default_title:{type:"string",description:"What the button will display."},file_filters:{type:"array",description:"Filetypes to match.",minItems:1,items:{type:"string"}}}}},homepage_url:{$ref:"#/definitions/uri",description:"The URL of the homepage for this extension."},incognito:{type:"string",description:"Specify how this extension will behave if allowed to run in incognito mode.",enum:["spanning","split","not_allowed"],default:"spanning"},input_components:{type:"array",description:"Allows your extension to handle keystrokes, set the composition, and manage the candidate window.",items:{type:"object",required:["name","type","id","description","language","layouts"],additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"},id:{type:"string"},description:{type:"string"},language:{type:"string"},layouts:{type:"array"}}}},key:{type:"string",description:"This value can be used to control the unique ID of an extension, app, or theme when it is loaded during development."},minimum_chrome_version:{$ref:"#/definitions/version_string",description:"The version of Chrome that your extension, app, or theme requires, if any."},nacl_modules:{type:"array",description:"One or more mappings from MIME types to the Native Client module that handles each type.",minItems:1,uniqueItems:!0,items:{type:"object",required:["path","mime_type"],additionalProperties:!1,properties:{path:{$ref:"#/definitions/uri",description:"The location of a Native Client manifest (a .nmf file) within the extension directory."},mime_type:{$ref:"#/definitions/mime_type",description:"The MIME type for which the Native Client module will be registered as content handler."}}}},oauth2:{type:"object",description:"Use the Chrome Identity API to authenticate users: the getAuthToken for users logged into their Google Account and the launchWebAuthFlow for users logged into a non-Google account.",required:["client_id","scopes"],additionalProperties:!1,properties:{client_id:{type:"string",description:"You need to register your app in the Google APIs Console to get the client ID."},scopes:{type:"array",minItems:1,items:{type:"string"}}}},offline_enabled:{type:"boolean",description:"Whether the app or extension is expected to work offline. When Chrome detects that it is offline, apps with this field set to true will be highlighted on the New Tab page."},omnibox:{type:"object",description:"The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.",required:["keyword"],additionalProperties:!1,properties:{keyword:{type:"string",description:"The keyword that will trigger your extension."}}},optional_permissions:{$ref:"#/definitions/permissions",description:"Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary."},options_page:{$ref:"#/definitions/page",description:"To allow users to customize the behavior of your extension, you may wish to provide an options page. If you do, a link to it will be provided from the extensions management page at chrome://extensions. Clicking the Options link opens a new tab pointing at your options page.",default:"options.html"},options_ui:{type:"object",description:"To allow users to customize the behavior of your extension, you may wish to provide an options page. If you do, an Options link will be shown on the extensions management page at chrome://extensions which opens a dialogue containing your options page.",required:["page"],properties:{page:{type:"string",description:"The path to your options page, relative to your extension's root."},chrome_style:{type:"boolean",default:!0,description:"If true, a Chrome user agent stylesheet will be applied to your options page. The default value is false, but we recommend you enable it for a consistent UI with Chrome."},open_in_tab:{type:"boolean",default:!1,description:"If true, your extension's options page will be opened in a new tab rather than embedded in chrome://extensions. The default is false, and we recommend that you don't change it. This is only useful to delay the inevitable deprecation of the old options UI! It will be removed soon, so try not to use it. It will break."}}},permissions:{$ref:"#/definitions/permissions",description:"Permissions help to limit damage if your extension or app is compromised by malware. Some permissions are also displayed to users before installation, as detailed in Permission Warnings."},requirements:{type:"object",description:"Technologies required by the app or extension. Hosting sites such as the Chrome Web Store may use this list to dissuade users from installing apps or extensions that will not work on their computer.",additionalProperties:!1,properties:{plugins:{type:"object",description:"Indicates if an app or extension requires NPAPI to run. This requirement is enabled by default when the manifest includes the 'plugins' field.",required:["npapi"],additionalProperties:!1,properties:{npapi:{type:"boolean",default:!0}}},"3D":{type:"object",description:"The '3D' requirement denotes GPU hardware acceleration.",required:["features"],additionalProperties:!1,properties:{features:{type:"array",description:"List of the 3D-related features your app requires.",minItems:1,uniqueItems:!0,items:{type:"string",enum:["webgl"]}}}}}},sandbox:{type:"object",description:"Defines an collection of app or extension pages that are to be served in a sandboxed unique origin, and optionally a Content Security Policy to use with them.",required:["pages"],additionalProperties:!1,properties:{pages:{type:"array",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/page"}},content_security_policy:{$ref:"#/definitions/content_security_policy",default:"sandbox allow-scripts allow-forms"}}},short_name:{type:"string",description:"The short name is typically used where there is insufficient space to display the full name.",maxLength:12},update_url:{$ref:"#/definitions/uri",description:"If you publish using the Chrome Developer Dashboard, ignore this field. If you host your own extension or app: URL to an update manifest XML file."},tts_engine:{type:"object",description:"Register itself as a speech engine.",required:["voices"],additionalProperties:!1,properties:{voices:{type:"array",description:"Voices the extension can synthesize.",minItems:1,uniqueItems:!0,items:{type:"object",required:["voice_name","event_types"],additionalProperties:!1,properties:{voice_name:{type:"string",description:"Identifies the name of the voice and the engine used."},lang:{type:"string",description:"Almost always, a voice can synthesize speech in just a single language. When an engine supports more than one language, it can easily register a separate voice for each language."},gender:{type:"string",description:"If your voice corresponds to a male or female voice, you can use this parameter to help clients choose the most appropriate voice for their application."},event_types:{type:"array",description:"Events sent to update the client on the progress of speech synthesis.",minItems:1,uniqueItems:!0,items:{type:"string",description:"",enum:["start","word","sentence","marker","end","error"]}}}}}}},version_name:{type:"string",description:"In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version string and will be used for display purposes if present."},chrome_settings_overrides:{},content_pack:{},current_locale:{},import:{},platforms:{},signature:{},spellcheck:{},storage:{},system_indicator:{}},required:["manifest_version","name","version"],then:{$comment:"browser_action and page_action are no longer present in v3",properties:{background:{type:"object",description:"The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.",properties:{service_worker:{type:"string",description:"The service worker js file."},type:{type:"string",enum:["module"]}},dependencies:{page:{not:{required:["scripts"]}},scripts:{not:{required:["page"]}}}},host_permissions:{$ref:"#/definitions/permissions"},action:{$ref:"#/definitions/action_v3",description:"Used to control the toolbar button for your extension in Chrome's UI."},content_security_policy:{type:"object",properties:{extension_pages:{$ref:"#/definitions/content_security_policy",description:"This policy covers pages in your extension, including html files and service workers."},sandbox:{$ref:"#/definitions/content_security_policy",description:"This policy covers any sandboxed extension pages that your extension uses."}}},web_accessible_resources:{type:"array",description:"An array of objects that declare resource access rules. Each object maps an array of extension resources to an array of URLs and/or extension IDs that can access those resources.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/web_resource"}}},dependencies:{browser_action:{not:{required:["browser_action"]}},page_action:{not:{required:["page_action"]}}}},title:"JSON schema for Google Chrome extension manifest files",type:"object"};function Ea(t){t.addFormat("permission",{type:"string",validate:e=>typeof e=="string"&&e.trim()!==""}),t.addFormat("content-security-policy",{type:"string",validate:e=>typeof e=="string"}),t.addFormat("glob-pattern",{type:"string",validate:e=>typeof e=="string"&&/[\*\?\[\]]/.test(e)}),t.addFormat("match-pattern",{type:"string",validate:e=>e==="<all_urls>"||e==="file:///"||e.startsWith("http://localhost")||e.startsWith("http:// ")||e.startsWith("http://*:*/*")?!0:typeof e=="string"&&/^(\*|http|https|file|ftp):\/\//.test(e)}),t.addFormat("uri",{type:"string",validate:e=>typeof e=="string"&&/^(\w+:)?\/\//.test(e)}),t.addFormat("mime-type",{type:"string",validate:e=>typeof e=="string"&&/^[a-z]+\/[a-z0-9\-\+]+$/.test(e)})}var ja=a(require("path")),$a=require("webpack");function Ca(t,e,s){let r=t.options.context||"",n=ja.default.join(r,"manifest.json"),o=require(n).name||"Extension.js",c=e?.params.missingProperty;t.errors.push(new $a.WebpackError(cn(o,s,c)))}var Fa=a(require("path")),Da=require("webpack");function La(t,e,s){let r=t.options.context||"",n=Fa.default.join(r,"manifest.json"),o=require(n).name||"Extension.js";t.warnings.push(new Da.WebpackError(an(o,e,s)))}var Ia=a(require("path")),Oa=require("webpack");function jr(t,e,s){let r=t.options.context||"",n=Ia.default.join(r,"manifest.json"),o=require(n).name||"Extension.js";t.warnings.push(new Oa.WebpackError(on(o,s,e)))}var Ps=class{options;constructor(e){this.options=e}handleSchemaErrors(e,s,r){let n=new Aa.default;Ea(n);let i={allOf:[ka]},o=n.compile(i),c=o(s),p=s.manifest_version===3;if(!c&&o.errors){let l=o.errors[0];if(l?.keyword==="required"){Ca(e,l,r);return}p&&(l?.keyword==="type"&&La(e,l,r),l?.keyword==="not"&&jr(e,l,r))}}apply(e){e.hooks.afterCompile.tapAsync("CompatPlugin (module)",(s,r)=>{let n=this.options.manifestPath,i=JSON.parse(Ma.default.readFileSync(n,"utf-8")),o=this.options.browser||"chrome";this.handleSchemaErrors(s,i,o),r()})}};var Ta=a(require("fs")),Cr=a(require("path"));var $r=a(require("webpack"));function Ra(t,e){let s="Conflict: Multiple assets emit different content to the same filename ";if(e.message.includes(s)){let r=e.message.replace(s,"");if(r.startsWith("content_scripts"))return new $r.default.WebpackError(pn(t,r))}return null}function Na(t,e){let s=require(t);return e.message.includes("Top-level-await is only supported in EcmaScript Modules")?new $r.default.WebpackError(ln(s.name)):null}var ks=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){let s=Cr.default.join(Cr.default.dirname(this.manifestPath),"package.json");if(!Ta.default.existsSync(s))return;let r=require(s).name;e.hooks.compilation.tap("develop:common-errors",n=>{n.hooks.afterSeal.tapAsync("develop:common-errors",i=>{n.errors.forEach((o,c)=>{let p=Ra(r,o),l=Na(r,o);p&&(n.errors[c]=p),l&&(n.errors[c]=l)}),i()})})}};var Es=class{static name="plugin-errors";manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){new Ss({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new Ps({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new ks({manifestPath:this.manifestPath}).apply(e)}};var Pc=a(require("os")),Ir=a(require("path"));var cc=a(require("fs")),pc=require("child_process");var se=a(require("path")),Fs=a(require("fs"));var qa={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}},Ua={...qa},Wa={...qa};var b=require("@colors/colors/safe");function k(t,e){let s=e==="warn"?(0,b.brightYellow)("\u25BA\u25BA\u25BA"):e==="info"?(0,b.cyan)("\u25BA\u25BA\u25BA"):e==="error"?`${(0,b.bold)((0,b.red)("ERROR"))} in ${Ve(t)} ${(0,b.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:(0,b.brightGreen)("\u25BA\u25BA\u25BA");return`${(0,b.gray)("")}${s}`}function Ve(t){return t.charAt(0).toUpperCase()+t.slice(1)}function js(t){let e=Ve(t);return`${k(t,"info")} Creating new ${e} user profile...`}function Ba(t){return`${k(t,"success")} Instance already running.`}function Ja(t){return`${k(t,"info")} Instance exited.`}function $s(t,e){let s=t==="firefox"?"Add-on":"Extension";return`${k(t,"success")} ${Ve(t)} ${s} running in ${(0,b.brightBlue)(e||"unknown")} mode.`}function Ge(t,e){let s=e=="null"?`Browser is not installed
|
|
110
|
+
of your ${(0,f.brightYellow)("extension.config.js")} is defined as your extension URL.`}var nt=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){let s=M.default.dirname(this.manifestPath),n=require(this.manifestPath).name||"Extension.js";(V.default.existsSync(M.default.join(s,".env"))||V.default.existsSync(M.default.join(s,".env.example"))||V.default.existsSync(M.default.join(s,".env.local"))||V.default.existsSync(M.default.join(s,".env.defaults")))&&(console.log(Zr(n)),new Sn.default({path:V.default.existsSync(M.default.join(s,".env"))?M.default.join(s,".env"):V.default.existsSync(M.default.join(s,".env.local"))?M.default.join(s,".env.local"):M.default.join(s,".env.example"),allowEmptyValues:!0,defaults:V.default.existsSync(M.default.join(s,".env.defaults")),systemvars:!0}).apply(e))}};var Vs=a(require("fs")),Pn=a(require("path")),it=class{apply(e){let s=Pn.default.join(e.options.output.path||"","hot");Vs.default.existsSync(s)&&(Vs.default.rmSync(s,{recursive:!0,force:!0}),process.env.EXTENSION_ENV==="development"&&console.log("[CleanHotUpdatesPlugin] Removed old hot-update files before compilation."))}};var ot=class{static name="plugin-compilation";manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){new kn.default().apply(e),new nt({manifestPath:this.manifestPath}).apply(e),new it().apply(e),e.hooks.done.tap("develop:brand",s=>{s.compilation.name=void 0;let r=s.endTime-s.startTime,n=require(this.manifestPath).name;console.log(Gr(n,r,s))})}};var zn=a(require("path")),Hn=a(require("mini-css-extract-plugin"));var Wn=a(require("mini-css-extract-plugin"));var pe=a(require("path")),Ee=a(require("fs"));var oe=a(require("path")),at=a(require("fs")),Gs=require("child_process"),jn=require("package-manager-detector");function $n(t,e){return Object.values(e||{}).some(s=>s===t)}function h(t,e,s){let r=oe.default.extname(e),i=S(e,s)?oe.default.normalize(e):t;return[".js",".jsx",".tsx",".ts"].includes(r)&&(i=i.replace(r,".js")),[".html",".njk",".nunjucks"].includes(r)&&(i=i.replace(r,".html")),[".css",".scss",".sass",".less"].includes(r)&&(i=i.replace(r,".css")),Xs(i||"")}function Xs(t){return t.replace(/\\/g,"/")}function S(t,e={}){if(!e)return!1;let s=oe.default.normalize(Xs(t));return Object.values(e).some(n=>typeof n!="string"?!1:Xs(n).includes(s))}function B(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 En(){return process.env.npm_execpath?"npm":!1}async function j(t,e,s){try{let r=await(0,jn.detect)();console.log(Xr(t,e,r?.name||"unknown"));let n="";r?.name==="yarn"?n=`yarn --silent add ${s.join(" ")} --cwd ${__dirname} --optional`:r?.name==="npm"||En()?n=`npm --silent install ${s.join(" ")} --prefix ${__dirname} --save-optional`:ae()?n=`pnpm --silent add ${s.join(" ")} --prefix ${__dirname} --save-optional`:n=`${r} --silent install ${s.join(" ")} --cwd ${__dirname} --optional`,(0,Gs.execSync)(n,{stdio:"inherit"}),await new Promise(i=>setTimeout(i,2e3)),process.env.EXTENSION_ENV==="development"&&(console.log(Yr(t,e)),r?.name==="yarn"?n="yarn install --silent > /dev/null 2>&1":r?.name==="npm"||En()?n="npm install --silent > /dev/null 2>&1":ae()?n="pnpm install --silent > /dev/null 2>&1":n=`${r} install --silent > /dev/null 2>&1`,(0,Gs.execSync)(n,{stdio:"inherit"})),console.log(Kr(t,e))}catch(r){console.error(Qr(t,e,r))}}function ct(t){let e=oe.default.join(t,"package.json");if(!at.default.existsSync(e))return!1;let s=JSON.parse(at.default.readFileSync(e,"utf-8")),r=["react","vue","@angular/core","svelte","solid-js","preact"],n=s.dependencies||{},i=s.devDependencies||{};for(let o of r)if(n[o]||i[o])return!0;return!1}function Cn(t){return!at.default.existsSync(oe.default.resolve(__dirname,`run-${t}-profile`))}function Fn(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 ce(t,e){return JSON.parse(JSON.stringify(t),function(n,i){let o=n.indexOf(":");if(o===-1)return i;let c=n.substring(0,o);(c===e||c==="chromium"&&ee.includes(e))&&(this[n.substring(o+1)]=i)})}var Dn=!1;function pt(t){let e=pe.default.join(t,"package.json"),s=pe.default.join(t,"manifest.json");if(!Ee.default.existsSync(e))return!1;let r=Jp(t),n=require(e),i=n.devDependencies&&n.devDependencies.tailwindcss,o=n.dependencies&&n.dependencies.tailwindcss,c=!!r&&!!(i||o);if(c&&!Dn){let l=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(l,"Tailwind")),Dn=!0}return c}function Jp(t){let e=pe.default.join(t,"tailwind.config.mjs"),s=pe.default.join(t,"tailwind.config.cjs"),r=pe.default.join(t,"tailwind.config.js");if(Ee.default.existsSync(e))return e;if(Ee.default.existsSync(s))return s;if(Ee.default.existsSync(r))return r}var lt=a(require("path")),In=a(require("fs"));var Ln=!1;function je(t){let e=lt.default.join(t,"package.json"),s=lt.default.join(t,"manifest.json");if(!In.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies.sass,i=r.dependencies&&r.dependencies.sass;if(n||i){if(!Ln){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"SASS")),Ln=!0}return!0}return!1}async function On(t,e){if(!je(t))return[];try{require.resolve("sass-loader")}catch{let r=["postcss-loader","postcss-scss","postcss-flexbugs-fixes","postcss-preset-env","postcss-normalize"],n=require(lt.default.join(t,"package.json")).name;await j(n,"PostCSS",r),await j(n,"SASS",["sass","sass-loader","resolve-url-loader"]),console.log(C(n,"SASS")),process.exit(0)}return[{test:/\.(s(a|c)ss)$/,exclude:/\.module\.(s(a|c)ss)$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await R(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await R(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:e==="production"})}]},{test:/\.module\.(s(a|c)ss)$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await R(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await R(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!0})}]}]}var ft=a(require("path")),An=a(require("fs"));var Mn=!1;function $e(t){let e=ft.default.join(t,"package.json"),s=ft.default.join(t,"manifest.json"),n=require(s).name||"Extension.js";if(!An.default.existsSync(e))return!1;let i=require(e),o=i.devDependencies&&i.devDependencies.less,c=i.dependencies&&i.dependencies.less;return o||c?(Mn||(process.env.EXTENSION_ENV==="development"&&console.log(v(n,"LESS")),Mn=!0),!0):!1}async function Rn(t,e){if(!$e(t))return[];try{require.resolve("less-loader")}catch{let r=require(ft.default.join(t,"package.json")).name;await j(r,"LESS",["less","less-loader","resolve-url-loader"]),console.log(C(r,"LESS")),process.exit(0)}return[{test:/\.less$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await R(t,{loader:"less-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await R(t,{loader:"less-loader",mode:e,useMiniCssExtractPlugin:e==="production"})}]}]}var fe=a(require("path")),mt=a(require("fs"));var le=!1;function zp(t){let e=fe.default.join(t,"package.json"),s=fe.default.join(t,"manifest.json");if(!mt.default.existsSync(e))return!1;let r=[".postcssrc",".postcssrc.json",".postcssrc.yaml",".postcssrc.yml",".postcssrc.js",".postcssrc.cjs","postcss.config.js","postcss.config.cjs"],i=require(s).name||"Extension.js";if(mt.default.existsSync(e)){let o=require(e);if(o.dependencies&&o.dependencies.postcss||o.devDependencies&&o.devDependencies.postcss)return le||(process.env.EXTENSION_ENV==="development"&&console.log(v(i,"PostCSS")),le=!0),!0}for(let o of r)if(mt.default.existsSync(fe.default.join(t,o)))return le||(process.env.EXTENSION_ENV==="development"&&console.log(v(i,"PostCSS")),le=!0),!0;return pt(t)?(le||(process.env.EXTENSION_ENV==="development"&&console.log(v(i,"PostCSS")),le=!0),!0):!1}async function Nn(t,e){if(!zp(t))return{};try{require.resolve("postcss-loader")}catch{let r=require(fe.default.join(t,"package.json")).name;!je(t)&&!$e(t)&&await j(r,"PostCSS",["postcss","postcss-loader","postcss-scss","postcss-flexbugs-fixes","postcss-preset-env","postcss-normalize"]),console.log(C(r,"PostCSS")),process.exit(0)}return{loader:require.resolve("postcss-loader"),options:{postcssOptions:{parser:require.resolve("postcss-scss"),ident:"postcss",config:fe.default.resolve(t,"postcss.config.js"),plugins:[require.resolve("postcss-flexbugs-fixes"),[require.resolve("postcss-preset-env"),{autoprefixer:{flexbox:"no-2009"},stage:3}].filter(Boolean),require.resolve("postcss-normalize")].filter(Boolean)},sourceMap:e.mode==="development"}}}var ut=a(require("path")),qn=a(require("fs"));var Tn=!1;function Ce(t){let e=ut.default.join(t,"package.json"),s=ut.default.join(t,"manifest.json");if(!qn.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies.vue,i=r.dependencies&&r.dependencies.vue;if((n||i)&&!Tn){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"Vue")),Tn=!0}return!!n||!!i}async function Un(t){if(!Ce(t))return;try{require.resolve("vue-loader")}catch{let n=["typescript"],o=require(ut.default.join(t,"manifest.json")).name||"Extension.js";await j(o,"TypeScript",n),await j(o,"Vue",["vue-loader","vue-template-compiler","vue-style-loader"]),console.log(C(o,"Vue")),process.exit(0)}let e=[{test:/\.vue$/,loader:require.resolve("vue-loader"),include:t,exclude:/node_modules/}];return{plugins:[new(require("vue-loader")).VueLoaderPlugin],loaders:e,alias:void 0}}async function R(t,e){let s=Wn.default.loader,r=[e.useMiniCssExtractPlugin?s:Ce(t)?require.resolve("vue-style-loader"):require.resolve("style-loader"),{loader:require.resolve("css-loader"),options:{sourceMap:e.mode==="development"}}].filter(Boolean);if(pt(t)||je(t)||$e(t)){let n=await Nn(t,e);n.loader&&r.push(n)}return e.loader&&r.push({loader:require.resolve("resolve-url-loader"),options:{sourceMap:e.mode==="development",root:t}},{loader:require.resolve(e.loader),options:{sourceMap:e.mode==="development"}}),r.filter(Boolean)}var O=a(require("path")),A=a(require("fs"));function Hp(t){let e=O.default.join(t,"stylelint.config.json"),s=O.default.join(t,".stylelintrc.js file"),r=O.default.join(t,"stylelint.config.mjs"),n=O.default.join(t,".stylelintrc.mjs"),i=O.default.join(t,"stylelint.config.cjs"),o=O.default.join(t,".stylelintrc.cjs"),c=O.default.join(t,".stylelintrc.json"),p=O.default.join(t,".stylelintrc"),l=O.default.join(t,".stylelintrc.yml"),m=O.default.join(t,".stylelintrc.yaml");if(A.default.existsSync(e))return e;if(A.default.existsSync(s))return s;if(A.default.existsSync(r))return r;if(A.default.existsSync(n))return n;if(A.default.existsSync(i))return i;if(A.default.existsSync(o))return o;if(A.default.existsSync(c))return c;if(A.default.existsSync(p))return p;if(A.default.existsSync(l))return l;if(A.default.existsSync(m))return m}var Bn=!1;function Vp(t){let e=O.default.join(t,"package.json"),s=O.default.join(t,"manifest.json");if(!A.default.existsSync(e))return!1;let n=!!Hp(t);if(n&&!Bn){let o=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(o,"Stylelint")),Bn=!0}return n}async function Jn(t){return Vp(t),[]}var dt=class t{static name="plugin-css";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=zn.default.dirname(this.manifestPath),r=[new Hn.default];r.forEach(p=>p.apply(e));let n=await Jn(s);r.push(...n);let i=[{test:/\.css$/,exclude:/\.module\.css$/,oneOf:[{use:await R(s,{mode:this.mode,useMiniCssExtractPlugin:this.mode==="production"})}]},{test:/\.module\.css$/,oneOf:[{use:await R(s,{mode:this.mode,useMiniCssExtractPlugin:this.mode==="production"})}]}];e.options.plugins=[...e.options.plugins,...r].filter(Boolean);let o=await On(s,this.mode),c=await Rn(s,this.mode);i.push(...o),i.push(...c),e.options.module.rules=[...e.options.module.rules,...i].filter(Boolean)}async apply(e){if(this.mode==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var gt=class{static name="plugin-css";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async apply(e){let s={test:/\.svg$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2048}}},n=[...e.options.module.rules.some(i=>i&&i.test instanceof RegExp&&i.test.test(".svg")&&i.use!==void 0)?[]:[s],{test:/\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",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/resource",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(Boolean)}};var Ys=a(require("path"));var ht=a(require("path")),Zs=a(require("fs"));var Vn=!1,Gp=[".babelrc",".babelrc.json",".babelrc.js",".babelrc.cjs","babel.config.json","babel.config.js","babel.config.cjs"];function Xp(t){let e=ht.default.join(t,"package.json"),s=ht.default.join(t,"manifest.json");if(!Zs.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies["babel-core"],i=r.dependencies&&r.dependencies["babel-core"],o=Gp.some(c=>Zs.default.existsSync(ht.default.join(t,c)))||!!n||!!i;if(o&&!Vn){let p=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&process.env.EXTENSION_ENV==="development"&&console.log(v(p,"Babel")),Vn=!0}return o}async function Gn(t,e){Xp(e)}var yt=a(require("path")),Zn=a(require("fs"));var Xn=!1;function me(t){let e=yt.default.join(t,"package.json"),s=yt.default.join(t,"manifest.json");if(!Zn.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies.preact,i=r.dependencies&&r.dependencies.preact;if((n||i)&&!Xn){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"Preact")),Xn=!0}return!!n||!!i}async function Yn(t){if(!me(t))return;try{require.resolve("@prefresh/webpack")}catch{let r=["@prefresh/webpack"],i=require(yt.default.join(t,"manifest.json")).name||"Extension.js";await j(i,"Preact",r),console.log(C(i,"Preact")),process.exit(0)}return{plugins:[new(require("@prefresh/webpack"))],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 bt=a(require("path")),Qn=a(require("fs"));var Kn=!1;function ue(t){let e=bt.default.join(t,"package.json"),s=bt.default.join(t,"manifest.json");if(!Qn.default.existsSync(e))return!1;let r=require(e),n=r.devDependencies&&r.devDependencies.react,i=r.dependencies&&r.dependencies.react;if((n||i)&&!Kn){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"React")),Kn=!0}return!!n||!!i}async function ei(t){if(!ue(t))return;try{require.resolve("@pmmmwh/react-refresh-webpack-plugin")}catch{let r=["react-refresh","@pmmmwh/react-refresh-webpack-plugin","react-refresh-typescript"],i=require(bt.default.join(t,"manifest.json")).name||"Extension.js";await j(i,"React",r),console.log(C(i,"React")),process.exit(0)}return{plugins:[new(require("@pmmmwh/react-refresh-webpack-plugin"))({overlay:!1})],loaders:void 0,alias:void 0}}var Fe=a(require("path")),wt=a(require("fs"));var ti=!1;function G(t){let e=Fe.default.join(t,"package.json");if(!wt.default.existsSync(e))return!1;let s=Yp(t),r=require(e),n=require(Fe.default.join(t,"manifest.json")),i=n.name||"Extension.js",o=r.devDependencies&&r.devDependencies.typescript,c=r.dependencies&&r.dependencies.typescript;return ti||((o||c)&&(s?process.env.EXTENSION_ENV==="development"&&console.log(v(i,"TypeScript")):(console.log(gn(n)),Kp(t))),ti=!0),!!s&&!!(o||c)}function Zp(t,e){return{compilerOptions:{allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,jsx:ct(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 Yp(t){let e=Fe.default.join(t,"tsconfig.json");if(wt.default.existsSync(e))return e}function Kp(t){wt.default.writeFileSync(Fe.default.join(t,"tsconfig.json"),JSON.stringify(Zp(t,{mode:"development"}),null,2))}var xt=class t{static name="plugin-js-frameworks";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=Ys.default.dirname(this.manifestPath),r=await Gn(e,s),n=await ei(s),i=await Yn(s),o=await Un(s);e.options.resolve.alias={...r?.alias||{},...n?.alias||{},...i?.alias||{},...o?.alias||{},...e.options.resolve.alias},e.options.module.rules=[{test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Ys.default.dirname(this.manifestPath)],exclude:/node_modules/,use:{loader:require.resolve("swc-loader"),options:{sync:!0,module:{type:"es6"},minify:this.mode==="production",isModule:!0,jsc:{target:"es2016",parser:{syntax:G(s)?"typescript":"ecmascript",tsx:G(s)&&(ue(s)||me(s)),jsx:!G(s)&&(ue(s)||me(s)),dynamicImport:!0},transform:{react:{development:this.mode==="development",refresh:this.mode==="development",runtime:"automatic",importSource:"react"}}}}}},...r?.loaders||[],...n?.loaders||[],...i?.loaders||[],...o?.loaders||[],...e.options.module.rules].filter(Boolean),n?.plugins?.forEach(c=>c.apply(e)),i?.plugins?.forEach(c=>c.apply(e)),o?.plugins?.forEach(c=>c.apply(e))}async apply(e){if(this.mode==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var We=a(require("path"));var Ui=a(require("path"));var si=a(require("path"));function ri(t,e){if(!e||!e.action||!e.action.default_popup)return;let s=e.action.default_popup;return si.default.join(t,s)}var ni=a(require("path"));function ii(t,e){if(!e||!e.browser_action||!e.browser_action.default_popup)return;let s=e.browser_action.default_popup;return ni.default.join(t,s)}var vt=a(require("path"));function oi(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":vt.default.join(t,r)}}if(e.chrome_url_overrides.newtab){let r=e.chrome_url_overrides.newtab;s={"chrome_url_overrides/newtab":vt.default.join(t,r)}}if(e.chrome_url_overrides.bookmarks){let r=e.chrome_url_overrides.bookmarks;s={"chrome_url_overrides/bookmarks":vt.default.join(t,r)}}return s}var ai=a(require("path"));function ci(t,e){if(!e||!e.devtools_page)return;let s=e.devtools_page;return ai.default.join(t,s)}var Ks=a(require("path"));function pi(t,e){if(e.options_page){let r=e.options_page;return Ks.default.join(t,r)}if(!e||!e.options_ui||!e.options_ui.page)return;let s=e.options_ui.page;return Ks.default.join(t,s)}var li=a(require("path"));function fi(t,e){if(!e||!e.page_action||!e.page_action.default_popup)return;let s=e.page_action.default_popup;return li.default.join(t,s)}var mi=a(require("path"));function ui(t,e){if(!e||!e.sandbox||!e.sandbox.pages)return{"sandbox/page-0":void 0};let s=e.sandbox.pages,r={};for(let[n,i]of s.entries())r[`sandbox/page-${n}`]=mi.default.join(t,i);return r}var di=a(require("path"));function gi(t,e){if(!e||!e.side_panel||!e.side_panel.default_path)return;let s=e.side_panel.default_path;return di.default.join(t,s)}var hi=a(require("path"));function yi(t,e){if(!e||!e.sidebar_action||!e.sidebar_action.default_panel)return;let s=e.sidebar_action.default_panel;return hi.default.join(t,s)}function De(t,e){return{"action/default_popup":ri(t,e),"browser_action/default_popup":ii(t,e),...oi(t,e),devtools_page:ci(t,e),"options_ui/page":pi(t,e),"page_action/default_popup":fi(t,e),...ui(t,e),"side_panel/default_path":gi(t,e),"sidebar_action/default_panel":yi(t,e)}}var Qs=a(require("path"));function bi(t,e){if(!e||!e.action||!e.action.default_icon)return;if(typeof e.action.default_icon=="string")return Qs.default.join(t,e.action.default_icon);let s=[];for(let r in e.action.default_icon)s.push(Qs.default.join(t,e.action.default_icon[r]));return s}var er=a(require("path"));function wi(t,e){if(!e||!e.browser_action||!e.browser_action.default_icon)return;let s=[];if(typeof e.browser_action.default_icon=="string")return er.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]=er.default.join(t,e.browser_action.default_icon[r]);s.push(n)}return s}var tr=a(require("path"));function xi(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=tr.default.join(t,s.light)),s.dark&&(s.dark=tr.default.join(t,s.dark)),s.size&&delete s.size;return e.browser_action.theme_icons}}var vi=a(require("path"));function _i(t,e){if(!e||!e.icons)return;let s=[];for(let r in e.icons){let n=vi.default.join(t,e.icons[r]);s.push(n)}return s}var sr=a(require("path"));function Si(t,e){if(!e||!e.page_action||!e.page_action.default_icon)return;if(typeof e.page_action.default_icon=="string")return sr.default.join(t,e.page_action.default_icon);let s=[];for(let r in e.page_action.default_icon){let n=sr.default.join(t,e.page_action.default_icon[r]);s.push(n)}return s}var Pi=a(require("path"));function ki(t,e){return!e||!e.sidebar_action||!e.sidebar_action.default_icon?void 0:Pi.default.join(t,e.sidebar_action.default_icon)}function Ei(t,e){return{action:bi(t,e),browser_action:wi(t,e),"browser_action/theme_icons":xi(t,e),icons:_i(t,e),page_action:Si(t,e),sidebar_action:ki(t,e)}}var ji=a(require("path"));function $i(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}`]=ji.default.join(t,n.path)}),s)}var Ci=a(require("path"));function Fi(t,e){if(!e||!e.storage||!e.storage.managed_schema)return;let s=e.storage.managed_schema;return Ci.default.join(t,s)}function Di(t,e){return{...$i(t,e),"storage/managed_schema":Fi(t,e)}}var Le=a(require("path")),_t=a(require("fs"));function Li(t,e){let s=Le.default.join(Le.default.dirname(e),"_locales"),r=[];if(_t.default.existsSync(s))for(let n of _t.default.readdirSync(s)){let i=Le.default.join(s,n);for(let o of _t.default.readdirSync(i))r.push(Le.default.join(t,"_locales",n,o))}return r}var Ii=a(require("path"));function Oi(t,e){if(!e||!e.background)return;let s=e.background.scripts;if(s)return s.map(r=>Ii.default.join(t,r))}var Mi=a(require("path"));function Ai(t,e){if(!e||!e.background)return;let s=e.background.service_worker;if(s)return Mi.default.join(t,s)}var rr=a(require("path"));function Ri(t,e){if(!e||!e.content_scripts)return{"content_scripts/content-0":void 0};let s=i=>{if(i.js?.length!==0)return i.js?.map(o=>rr.default.join(t,o))},r=i=>{if(i.css?.length!==0)return i.css?.map(o=>rr.default.join(t,o))},n={};for(let[i,o]of e.content_scripts.entries()){let c=s(o),p=r(o);n[`content_scripts/content-${i}`]=[...(c||[]).filter(l=>l!=null),...(p||[]).filter(l=>l!=null)]}return n}var Ni=a(require("path"));function Ti(t,e){if(!e||!e.user_scripts||!e.user_scripts.api_script)return;let s=e.user_scripts.api_script;return Ni.default.join(t,s)}function Ie(t,e){return{"background/scripts":Oi(t,e),"background/service_worker":Ai(t,e),...Ri(t,e),"user_scripts/api_script":Ti(t,e)}}function qi(t){if(!(!t||!t.web_accessible_resources||!t.web_accessible_resources.length))return t.web_accessible_resources}function de({manifestPath:t,browser:e}){let s=Ui.default.dirname(t),r=require(t),n=ce(r,e||"chrome");return{html:De(s,n),icons:Ei(s,n),json:Di(s,n),locales:Li(s,t),scripts:Ie(s,n),web_accessible_resources:qi(n)}}var ge=a(require("path"));var St=a(require("fs")),Oe=a(require("path"));function Pt(t,e){if(!St.default.existsSync(t)||!St.default.statSync(t).isDirectory())return[];let s=[];function r(n){let i=St.default.readdirSync(n,{withFileTypes:!0});for(let o of i){let c=Oe.default.join(n,o.name);o.isDirectory()?r(c):o.isFile()&&e(o.name)&&s.push(c)}}return r(t),s}function kt(t,e,s=""){return!e||!e.length?{}:e.reduce((r,n)=>{let i=Oe.default.extname(n),o=Oe.default.basename(n,i),c=s?`${s}/${o}`:Oe.default.relative(t,n);return{...r,[c]:n}},{})}function Wi({manifestPath:t}){let e=ge.default.dirname(t),s={public:ge.default.join(e,"public"),pages:ge.default.join(e,"pages"),scripts:ge.default.join(e,"scripts")},r={public:Pt(s.public,()=>!0),pages:Pt(s.pages,i=>i.endsWith(".html")),scripts:Pt(s.scripts,i=>[".js",".mjs",".jsx",".mjsx",".ts",".mts",".tsx",".mtsx"].includes(ge.default.extname(i)))};return{public:kt(e,r.public),pages:kt(e,r.pages,"pages"),scripts:kt(e,r.scripts,"scripts")}}var Et=a(require("path")),Bi=a(require("webpack")),jt=class{manifestPath;includeList;excludeList;loaderOptions;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList,this.loaderOptions=e.loaderOptions}apply(e){new Bi.default.ProvidePlugin({r:[Et.default.resolve(__dirname,"./resolver-module.js"),"default"]}).apply(e),e.options.module?.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,loader:require.resolve(Et.default.resolve(__dirname,"./resolver-loader.js")),include:[Et.default.dirname(this.manifestPath)],exclude:/node_modules/,options:{manifestPath:this.manifestPath,includeList:this.includeList,jsx:this.loaderOptions?this.loaderOptions.jsx:!1,typescript:this.loaderOptions?this.loaderOptions.typescript:!1,minify:this.loaderOptions?this.loaderOptions.minify:!1}})}};var Ji=a(require("fs")),Ct=a(require("webpack")),zi=require("webpack");var $t=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){e.hooks.compilation.tap("manifest:emit-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:emit-manifest",stage:Ct.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{let r=this.manifestPath,n;try{let c=Ji.default.readFileSync(r,"utf-8");n=JSON.parse(c)}catch(c){let l=require(this.manifestPath).name||"Extension.js";s.errors.push(new Ct.default.WebpackError(mn(l,c)));return}let i=JSON.stringify(n,null,2);s.emitAsset("manifest.json",new zi.sources.RawSource(i))})})}};var So=a(require("path")),Me=require("webpack");function Hi(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 Vi=a(require("path"));var Ft=t=>Vi.default.basename(t);function Gi(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/${Ft(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/${Ft(r)}`,r,e)]))},...t.browser_action.theme_icons&&{theme_icons:t.browser_action.theme_icons.map(s=>({...s,...s.light&&{light:h(`browser_action/${Ft(s.light)}`,s.light,e)},...s.dark&&{dark:h(`browser_action/${Ft(s.dark)}`,s.dark,e)}}))}}}}function Xi(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 Zi(t,e){return{...Hi(t,e),...Gi(t,e),...Xi(t,e)}}var Ki=a(require("path"));var Yi=t=>Ki.default.basename(t);function Qi(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/${Yi(t.action.default_icon)}`,t.action.default_icon,e):Object.fromEntries(Object.entries(t.action.default_icon).map(([s,r])=>[s,h(`action/${Yi(r)}`,r,e)]))}}}}function eo(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 Dt(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 to(t,e){return{...Qi(t,e),...eo(t,e),...Dt(t,e)}}function so(t,e){return t.background&&t.background.page&&{background:{...t.background,...t.background.page&&{page:h("background/page.html",t.background.page,e)}}}}function ro(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 no(t,e){return t.content_scripts&&{content_scripts:t.content_scripts.map((s,r)=>{let n=[...new Set(s.js)],i=[...new Set(s.css)];return{...s,js:[...n.map(o=>h(`content_scripts/content-${r}.js`,o,e))],css:[...i.map(o=>h(`content_scripts/content-${r}.css`,o,e))]}})}}function io(t,e){return t.devtools_page&&{devtools_page:h("devtools_page.html",t.devtools_page,e)}}var oo=a(require("path"));var Qp=t=>oo.default.basename(t);function ao(t,e){return t.icons&&{icons:Object.fromEntries(Object.entries(t.icons).map(([s,r])=>[s,h(`icons/${Qp(r)}`,r,e)]))}}function co(t,e){return t.options_page&&{options_page:h("options_ui/page.html",t.options_page,e)}}function po(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 fo=a(require("path"));var lo=t=>fo.default.basename(t);function mo(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/${lo(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/${lo(r)}`,r,e)]))}}}}function uo(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 go=a(require("path"));var el=t=>go.default.basename(t);function ho(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/${el(t.sidebar_action.default_icon)}`,t.sidebar_action.default_icon,e)}}}}function yo(t,e){return t.storage&&{storage:{...t.storage.managed_schema&&{managed_schema:h("storage/managed_schema.json",t.storage.managed_schema,e)}}}}var bo=a(require("path"));var tl=t=>bo.default.basename(t);function wo(t,e){return t.theme&&{theme:{...t.theme,...t.theme.images&&{images:{...t.theme.images,theme_frame:h(`theme/images/${tl(t.theme.images.theme_frame)}`,t.theme.images.theme_frame,e)}}}}}function xo(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 vo(t){return t.web_accessible_resources&&t.web_accessible_resources.length&&{web_accessible_resources:t.web_accessible_resources}}function _o(t,e){return{...so(t,e),...ro(t,e),...no(t,e),...io(t,e),...ao(t,e),...co(t,e),...po(t,e),...mo(t,e),...uo(t,e),...Dt(t,e),...ho(t,e),...yo(t,e),...wo(t,e),...xo(t,e),...vo(t)}}function nr(t,e,s){let r=e||require(t);return JSON.stringify({...r,..._o(r,s),...Zi(r,s),...to(r,s)},null,2)}var Lt=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)):{}}applyProdOverrides(e,s){return s.content_scripts?s.content_scripts.map((r,n)=>{if(r.js.length&&!r.css.length){let i=e.options.output?.path||"";r.css=r.js.map(o=>{let c=So.default.join(i,o.replace(".js",".css"));return h(`content_scripts/content-${n}.css`,c,{})})}return r}):{}}apply(e){e.hooks.thisCompilation.tap("manifest:update-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:update-manifest",stage:Me.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},()=>{if(s.errors.length>0)return;let r=B(s,this.manifestPath),n=nr(this.manifestPath,r,this.excludeList||{}),i={...r,...JSON.parse(n)};e.options.mode==="development"&&i.content_scripts&&(i.content_scripts=this.applyDevOverrides(i)),e.options.mode==="development"&&i.content_scripts&&(i.content_scripts=this.applyDevOverrides(i));let o=JSON.stringify(i,null,2),c=new Me.sources.RawSource(o);s.updateAsset("manifest.json",c)}),e.options.mode==="production"&&s.hooks.afterProcessAssets.tap("manifest:update-manifest",()=>{if(s.errors.length>0)return;let r=B(s,this.manifestPath),n=nr(this.manifestPath,r,this.excludeList||{}),i={...r,...JSON.parse(n)};i.content_scripts&&(i.content_scripts=this.applyProdOverrides(e,i));let o=JSON.stringify(i,null,2),c=new Me.sources.RawSource(o);s.updateAsset("manifest.json",c)})})}};var Po=a(require("fs")),It=class{dependencyList;constructor(e){this.dependencyList=e}apply(e){e.hooks.afterCompile.tap("ManifestPlugin (AddDependenciesPlugin)",s=>{if(s.errors?.length)return;let r=new Set(s.fileDependencies);this.dependencyList&&this.dependencyList.forEach(n=>{Po.default.existsSync(n)&&(r.has(n)||(r.add(n),s.fileDependencies.add(n)))})})}};var ko=a(require("fs")),Eo=a(require("path")),Mt=a(require("webpack"));var Ot=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"],i=[".js",".ts",".jsx",".tsx",".mjs",".cjs"],o=".html",c=Object.entries(this.includeList||{});for(let[p,l]of c)if(l){let m=this.extractPaths(l);for(let d of m){let g=Eo.default.extname(d),E=require(this.manifestPath).name||"Extension.js";if(!ko.default.existsSync(d)){let P=ie(E,p,d);r.includes(g)?e.errors.push(new s(P)):n.includes(g)?e.errors.push(new s(P)):i.includes(g)?e.errors.push(new s(P)):g===o?e.errors.push(new s(P)):e.errors.push(new s(P))}}}}apply(e){e.hooks.compilation.tap("manifest:check-manifest-files",s=>{s.hooks.processAssets.tap({name:"compatibility:check-manifest-files",stage:Mt.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT},()=>{let r=Mt.default.WebpackError;this.handleErrors(s,r)})})}};var jo=a(require("fs")),Rt=a(require("webpack"));var At=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 i=s.options.context||"",o=`${i}/package.json`;if(!jo.default.existsSync(o)){r();return}let c=require(this.manifestPath),p=ce(c,this.browser),l=this.flattenAndSort(Object.values(De(i,p))),m=this.flattenAndSort(Object.values(Ie(i,p)));s.hooks.thisCompilation.tap("manifest:throw-if-recompile-is-needed",d=>{d.hooks.processAssets.tap({name:"manifest:check-manifest-files",stage:Rt.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY},()=>{let y=d.getAsset("manifest.json")?.source.source().toString(),E=JSON.parse(y||"{}"),P=this.flattenAndSort(Object.values(De(i,E))),q=this.flattenAndSort(Object.values(Ie(i,E)));if(m.toString()!==q.toString()||l.toString()!==P.toString()){let U=l.filter(W=>!P.includes(W))[0],H=P.filter(W=>!l.includes(W))[0],Pe=un(H,U);d.errors.push(new Rt.default.WebpackError(Pe))}})})}r()})}};var Nt=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 $t({manifestPath:this.manifestPath}).apply(e),new Ot({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Lt({manifestPath:this.manifestPath,excludeList:this.excludeList}).apply(e),new It([this.manifestPath]).apply(e),new At({manifestPath:this.manifestPath,browser:this.browser,includeList:this.includeList}).apply(e)}};var pr=a(require("path"));var or=a(require("fs")),Ut=a(require("webpack")),Lo=require("webpack");var $o=a(require("fs")),ye=a(require("path")),Co=a(require("parse5-utils"));var he=a(require("parse5-utils"));function Tt(t){try{return new URL(t),!0}catch{return!1}}function Ae(t,e){let{childNodes:s=[]}=t;for(let r of s)if(r.nodeName==="script"){let n=he.default.getAttribute(r,"src");if(!n||Tt(n))continue;e({filePath:n,childNode:r,assetType:"script"})}else if(r.nodeName==="link"){let n=he.default.getAttribute(r,"href"),i=he.default.getAttribute(r,"rel");if(!n||Tt(n))continue;e(i==="dns-prefetch"||i==="icon"||i==="manifest"||i==="modulepreload"||i==="preconnect"||i==="prefetch"||i==="preload"||i==="prerender"?{filePath:n,childNode:r,assetType:"staticHref"}:{filePath:n,childNode:r,assetType:"css"})}else if(r.nodeName==="a"||r.nodeName==="area"){let n=he.default.getAttribute(r,"href");if(!n||Tt(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=he.default.getAttribute(r,"src");if(!n||Tt(n))continue;e({filePath:n,childNode:r,assetType:"staticSrc"})}else Ae(r,e)}function $(t,e){let s={css:[],js:[],static:[]};if(!t)return s;let r=e||$o.default.readFileSync(t,{encoding:"utf8"}),n=Co.default.parse(r),i=(o,c)=>ye.default.join(ye.default.dirname(o),c.startsWith("/")?ye.default.relative(ye.default.dirname(o),c):c);for(let o of n.childNodes)if(o.nodeName==="html"){for(let c of o.childNodes)(c.nodeName==="head"||c.nodeName==="body")&&Ae(c,({filePath:p,assetType:l})=>{let m=i(t,p);switch(l){case"script":s.js?.push(m);break;case"css":s.css?.push(m);break;case"staticSrc":case"staticHref":if(p.startsWith("#"))break;s.static?.push(m);break;default:break}});return{css:s.css,js:s.js,static:s.static}}}function Fo(t,e,s){let r=Object.keys(t).find(i=>{let o=t[i];return t[i]===e||$(o)?.js?.includes(e)||$(o)?.css?.includes(e)})||"",n=ir(e);return r?`/${r.replace(n,"")}${s}`:`${e.replace(n,"")}${s}`}function ir(t){switch(ye.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 X(t,e,s){return s?`/${t}${e}`:`${t}${e}`}function Do(t,e){return Object.values(e||{}).some(s=>s===t)}var qt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let r=require(this.manifestPath).name||"Extension.js";e.hooks.thisCompilation.tap("html:emit-html-file",n=>{n.hooks.processAssets.tap({name:"AddAssetsToCompilationPlugin",stage:Ut.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let i=Object.entries(this.includeList||{});for(let o of i){let[c,p]=o;if(p){if(!or.default.existsSync(p)){let m=ie(r,c,p);n.warnings.push(new Ut.default.WebpackError(m));return}let l=or.default.readFileSync(p,"utf8");if(!S(p,this.excludeList)){let m=new Lo.sources.RawSource(l),d=X(c,".html");n.emitAsset(d,m)}}}})})}};var Wt=a(require("fs")),be=a(require("path")),Io=a(require("webpack")),Re=require("webpack");var Bt=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:Re.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{if(s.errors.length>0)return;let r=Object.entries(this.includeList||{});for(let n of r){let[i,o]=n,c=i+".html";if(o){let p=s.getAsset(c);if(p){let l=p.source.source().toString(),m=$(o,l)?.static,d=[...new Set(m)];for(let g of d)if(!g.includes("public/")){if(!Wt.default.existsSync(g)&&!Do(g,this.includeList)&&!be.default.basename(g).startsWith("#")){let U=st(require(this.manifestPath).name,o,g);s.warnings.push(new Io.default.WebpackError(U));return}let y=Wt.default.readFileSync(g),E=new Re.sources.RawSource(y),P=be.default.join("assets",be.default.basename(g));if(!s.getAsset(P))if(g.endsWith(".html")){let q=$(g),U=[...q?.js||[],...q?.css||[],...q?.static||[]];s.emitAsset(P,E),U.forEach(H=>{let Pe=Wt.default.readFileSync(H),W=new Re.sources.RawSource(Pe),Jr=be.default.join("assets",be.default.basename(H));s.getAsset(Jr)||s.emitAsset(Jr,W)})}else s.emitAsset(P,E)}}}}})})}};var Oo=a(require("path")),ar=a(require("fs"));var Jt=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,i]=r;if(i){if(!ar.default.existsSync(i))return;let o=$(i),c=o?.js||[],p=o?.css||[],l=[...c,...p].filter(m=>!S(m,this.excludeList));if(e.options.mode==="development"){let m=Oo.default.resolve(__dirname,"minimum-script-file.mjs");l.push(m)}ar.default.existsSync(i)&&(S(i,this.excludeList)||(e.options.entry={...e.options.entry,[n]:{import:l}}))}}}};var Ht=require("webpack");var cr=a(require("fs")),Z=a(require("path")),D=a(require("parse5-utils"));function Mo(t,e,s,r,n){let i=cr.default.readFileSync(s,{encoding:"utf8"}),o=D.default.parse(i),c=!!t.getAsset(e+".css"),p=!1;for(let l of o.childNodes)if(l.nodeName==="html"){for(let m of l.childNodes){if((m.nodeName==="head"||m.nodeName==="body")&&Ae(m,({filePath:d,childNode:g,assetType:y})=>{let E=Z.default.dirname(s),P=Z.default.resolve(E,d),q=ir(P),U=S(Z.default.resolve(E,d),n),H=Z.default.join("/",Z.default.normalize(d)),Pe=$n(P,r);switch(y){case"script":{U?l=D.default.setAttribute(g,"src",H):(l=D.default.remove(g),p=!0);break}case"css":{U?l=D.default.setAttribute(g,"href",H):(l=D.default.remove(g),c=!0);break}case"staticHref":case"staticSrc":{if(U)l=D.default.setAttribute(g,y==="staticSrc"?"src":"href",H);else if(Pe){let W=Fo(r,P,q);l=D.default.setAttribute(g,y==="staticSrc"?"src":"href",W)}else{let W=Z.default.join("assets",Z.default.basename(P,q));cr.default.existsSync(P)&&(l=D.default.setAttribute(g,y==="staticSrc"?"src":"href",X(W,"",!0)))}break}default:break}}),m.nodeName==="head"&&c&&t.options.mode==="production"){let d=D.default.createNode("link");d.attrs=[{name:"rel",value:"stylesheet"},{name:"href",value:X(e,".css",!0)}],D.default.append(m,d)}if(m.nodeName==="body"&&(p||t.options.mode!=="production")){let d=D.default.createNode("script");d.attrs=[{name:"src",value:X(e,".js",!0)}],D.default.append(m,d)}}return D.default.serialize(o)}}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("html:update-html-file",s=>{s.hooks.processAssets.tap({name:"html:update-html-file",stage:Ht.Compilation.PROCESS_ASSETS_STAGE_DERIVED},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[i,o]=n;if(o){let c=Mo(s,i,o,r,this.excludeList||{});if(!S(o,this.excludeList)&&c){let p=new Ht.sources.RawSource(c),l=X(i,".html");s.updateAsset(l,p)}}}})})}};var Ao=a(require("fs")),Ro=require("webpack");var Vt=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:Ro.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,i]=n;if(i){let o=$(i),c=new Set(s.fileDependencies);if(Ao.default.existsSync(i)){let p=[i,...o?.static||[]];for(let l of p)c.has(l)||(c.add(l),l===i&&s.fileDependencies.add(l))}}}})})}};var No=a(require("fs"));var Gt=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(!No.default.existsSync(n)){let o=require(this.manifestPath).name||"Extension.js";console.error(ie(o,s,n)),process.exit(1)}this.initialHtmlAssets[n]={js:$(n)?.js||[],css:$(n)?.css||[]}}})}apply(e){let s=this.includeList||{};this.storeInitialHtmlAssets(s),e.hooks.make.tapAsync("html:throw-if-recompile-is-needed",(r,n)=>{let i=e.modifiedFiles||new Set,o=Array.from(i)[0];if(o&&this.initialHtmlAssets[o]){let c=$(o)?.js||[],p=$(o)?.css||[],{js:l,css:m}=this.initialHtmlAssets[o];if(this.hasEntriesChanged(p,m)||this.hasEntriesChanged(c,l)){let d=require(this.manifestPath).name;console.log(wn(d,o))}}n()})}};var To=a(require("fs")),qo=require("webpack");function rl(t,e,s){let r="Module not found: Error: Can't resolve ",i=s.message.replace(r,"").split("'")[1];if(s.message.includes(r))for(let o of Object.entries(e)){let[,c]=o;if(c){if(!To.default.existsSync(c))return null;let p=$(c),l=p?.js||[],m=p?.css||[];if(l.includes(i)||m.includes(i)){let d=st(require(t).name,c,i);return new qo.WebpackError(d)}}}return null}var Xt=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 i=rl(this.manifestPath,this.includeList||{},r);i&&(s.errors[n]=i)})})})}};var Zt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new qt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Bt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Jt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new zt({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:[pr.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(pr.default.join(__dirname,"ensure-hmr-for-scripts.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}}]}),new Vt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Gt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Xt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var Ne=a(require("path"));var lr=a(require("fs")),Uo=a(require("path"));function Wo(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(n=>{let i=lr.default.existsSync(n)&&!S(n,e),o=Uo.default.extname(n);return i&&(o===".js"||o===".mjs"||o===".jsx"||o===".ts"||o===".tsx")})}function Bo(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(n=>lr.default.existsSync(n)&&!S(n,e)&&(n.endsWith(".css")||n.endsWith(".scss")||n.endsWith(".sass")||n.endsWith(".less")))}var Yt=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,i]of Object.entries(s)){let o=Wo(i,this.excludeList),c=Bo(i,this.excludeList),p=[...o];e.options.mode==="production"&&p.push(...c),(c.length||o.length)&&(r[n]={import:p})}e.options.entry={...e.options.entry,...r}}};var te=require("webpack"),nl=['var isBrowser = !!(() => { try { return browser.runtime.getURL("/") } catch(e) {} })()','var isChrome = !!(() => { try { return chrome.runtime.getURL("/") } catch(e) {} })()'],il=[...nl,`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 } }`],Kt=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 i=ol();return r.addRuntimeModule(n,i),!0})})}};function ol(){class t extends te.RuntimeModule{constructor(){super("publicPath",te.RuntimeModule.STAGE_BASIC)}generate(){let s=this.compilation?.outputOptions.publicPath;return te.Template.asString([...il,`var path = ${JSON.stringify(this.compilation?.getPath(s||"",{hash:this.compilation.hash||"XXXX"}))}`,`${te.RuntimeGlobals.publicPath} = typeof importScripts === 'function' || !(isBrowser || isChrome) ? path : runtime.runtime.getURL(path);`])}}return new t}var Qt=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);s.content_scripts?.some(r=>r.world&&r.world.toLowerCase()==="main")&&ee.includes(this.browser)&&!s.key&&(console.error(_n(s.name||"")),process.exit(1))}};var es=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 Yt({manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Ne.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(Ne.default.join(__dirname,"inject-content-css-during-dev.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Ne.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(Ne.default.join(__dirname,"add-hmr-accept-code.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="production"&&new Kt().apply(e),new Qt({manifestPath:this.manifestPath,browser:this.browser||"chrome",includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e)}};var mr=a(require("path")),Te=a(require("fs")),ur=a(require("webpack")),qe=require("webpack");var we=a(require("path")),ts=a(require("fs"));function fr(t){let e=we.default.join(we.default.dirname(t),"_locales"),s=[];if(ts.default.existsSync(e))for(let r of ts.default.readdirSync(e)){let n=we.default.join(e,r);for(let i of ts.default.readdirSync(n))s.push(we.default.join(we.default.dirname(t),"_locales",r,i))}return s}var ss=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:qe.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{let n=require(this.manifestPath).name||"Extension.js";if(!Te.default.existsSync(this.manifestPath)){s.errors.push(new ur.default.WebpackError(fn(n,this.manifestPath)));return}if(s.errors.length>0)return;let i=fr(this.manifestPath);for(let o of Object.entries(i||[])){let[c,p]=o,l=p;if(l){if(!Te.default.existsSync(l)){s.warnings.push(new ur.default.WebpackError(rt(n,c,l)));return}let m=Te.default.readFileSync(l),d=new qe.sources.RawSource(m),g=e.options.context||mr.default.dirname(this.manifestPath);if(!S(l,this.excludeList)){let y=mr.default.relative(g,l);s.emitAsset(y,d)}}}})}),e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:qe.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=fr(this.manifestPath);for(let n of Object.entries(r||[])){let[,i]=n;if(i){let o=new Set(s.fileDependencies),c=r||[];for(let p of c)Te.default.existsSync(p)&&(o.has(p)||(o.add(p),s.fileDependencies.add(p)))}}})})}};var rs=a(require("fs")),Jo=a(require("webpack")),Ue=require("webpack");var ns=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:Ue.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[i,o]=n,c=Array.isArray(o)?o:[o];for(let p of c)if(p&&!S(p,this.excludeList)){if(!rs.default.existsSync(p)){let g=require(this.manifestPath).name||"Extension.js";s.warnings.push(new Jo.default.WebpackError(rt(g,i,p)));return}let l=rs.default.readFileSync(p),m=new Ue.sources.RawSource(l);s.emitAsset(i+".json",m)}}})}),e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:Ue.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,i]=n,o=Array.isArray(i)?i:[i];for(let c of o)if(c){let p=new Set(s.fileDependencies);S(c,this.excludeList)||rs.default.existsSync(c)&&(p.has(c)||(p.add(c),s.fileDependencies.add(c)))}}})})}};var dr=a(require("fs")),zo=a(require("path")),os=require("webpack");var is=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:os.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[i,o]=n;if(o===void 0)continue;let c=Array.isArray(o)?typeof o[0]=="string"?o:o.map(Object.values).flat():[o];for(let p of c)if(p){if(!dr.default.existsSync(p))continue;if(!S(p,this.excludeList)){let l=dr.default.readFileSync(p),m=new os.sources.RawSource(l),d=zo.default.basename(p),y=`${i.endsWith("theme_icons")?i.replace("theme_icons",""):i}/${d}`;s.emitAsset(y,m)}}}})})}};var Ho=a(require("fs")),Vo=require("webpack"),as=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:Vo.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let n of Object.entries(r)){let[,i]=n,o=Array.isArray(i)?typeof i[0]=="string"?i:i.map(Object.values).flat():[i];for(let c of o)if(c){let p=new Set(s.fileDependencies);Ho.default.existsSync(c)&&(p.has(c)||(p.add(c),s.fileDependencies.add(c)))}}})})}};var cs=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new is({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new as({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var ls=require("webpack");function Go(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 ps=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}generateManifestPatches(e,s){let r=B(e,this.manifestPath),n=r.web_accessible_resources||[],i=r.web_accessible_resources||[];for(let[p,l]of Object.entries(s)){let m=r.content_scripts?.find(d=>d.js&&d.js.some(g=>g.includes(p)));if(m){let d=m.matches||[];if(r.manifest_version===3){let g=n.find(y=>y.matches.some(E=>d.includes(E)));g?l.forEach(y=>{g.resources.includes(y)||g.resources.push(y)}):n.push({resources:l.filter(y=>!y.endsWith(".map")),matches:Go(d)})}else l.forEach(g=>{i.includes(g)||i.push(g)})}}r.manifest_version===3?r.web_accessible_resources=n:r.web_accessible_resources=Array.from(new Set(i));let o=JSON.stringify(r,null,2),c=new ls.sources.RawSource(o);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:ls.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 i=s.chunkGraph,o={};s.entrypoints.forEach((c,p)=>{if(r.includes(p)){let l=[];c.chunks.forEach(m=>{Array.from(i.getChunkModulesIterable(m)).forEach(g=>{i.getModuleChunks(g).forEach(y=>{y.auxiliaryFiles.forEach(E=>{l.includes(E)||l.push(E)})})})}),o[p]=l}}),this.generateManifestPatches(s,o)})})}};var L=a(require("fs")),I=a(require("path")),Xo=a(require("chokidar")),fs=class{options;constructor(e){this.options=e}ensureDirectoryExistence(e){let s=I.default.dirname(e);if(L.default.existsSync(s))return!0;L.default.mkdirSync(s,{recursive:!0})}copyFile(e,s){this.ensureDirectoryExistence(s),L.default.copyFileSync(e,s)}copyFolder(e,s){L.default.existsSync(s)||L.default.mkdirSync(s,{recursive:!0}),L.default.readdirSync(e).forEach(n=>{let i=I.default.join(e,n),o=I.default.join(s,n);L.default.statSync(i).isDirectory()?this.copyFolder(i,o):this.copyFile(i,o)})}apply(e){let s=I.default.dirname(this.options.manifestPath),r=I.default.join(s,"public"),n=e.options.output?.path||"";L.default.existsSync(r)&&(e.hooks.afterEmit.tap("special-folders:copy-public-folder",()=>{let i=I.default.join(n,"public");L.default.existsSync(i)||L.default.mkdirSync(i,{recursive:!0}),L.default.existsSync(r)&&this.copyFolder(r,i)}),e.options.mode!=="production"&&e.hooks.afterPlugins.tap("special-folders:copy-public-folder",()=>{let i=I.default.join(s,"public"),o=Xo.default.watch(i,{ignoreInitial:!0});o.on("add",c=>{let p=I.default.join(n,I.default.relative(s,c));this.copyFile(c,p)}),o.on("change",c=>{let p=I.default.join(n,I.default.relative(s,c));this.copyFile(c,p)}),o.on("unlink",c=>{let p=I.default.join(n,I.default.relative(s,c));L.default.existsSync(p)&&L.default.unlinkSync(p)}),e.hooks.watchClose.tap("special-folders:copy-public-folder",()=>{o.close().catch(console.error)})}))}};var N=a(require("path")),gr=a(require("chokidar"));var ms=class{manifestPath;constructor(e){this.manifestPath=e}throwCompilationError(e,s,r){let n=N.relative(process.cwd(),s),p=dn(r?"Adding":"Removing",r?"added":"removed",e,e==="pages"?"HTML pages":"script files",n);if(r){console.warn(p);return}console.error(p),process.exit(1)}apply(e){e.hooks.afterPlugins.tap("special-folders:warn-upon-folder-changes",()=>{let s=N.dirname(this.manifestPath),r=N.join(s,"pages"),n=N.join(s,"scripts"),i=gr.watch(r,{ignoreInitial:!0}),o=gr.watch(n,{ignoreInitial:!0}),c=e.options.resolve?.extensions;i.on("add",p=>{p.endsWith(".html")&&this.throwCompilationError("pages",p,!0)}),i.on("unlink",p=>{p.endsWith(".html")&&this.throwCompilationError("pages",p)}),o.on("add",p=>{c?.includes(N.extname(p))&&this.throwCompilationError("scripts",p,!0)}),o.on("unlink",p=>{c?.includes(N.extname(p))&&this.throwCompilationError("scripts",p)}),e.hooks.watchClose.tap("WarnUponFolderChanges",()=>{i.close().catch(console.error),o.close().catch(console.error)})})}};var us=class{static name="plugin-special-folders";options;constructor(e){this.options=e}apply(e){let{manifestPath:s}=this.options;new fs({manifestPath:s}).apply(e),e.options.mode==="development"&&e.options.watchOptions&&new ms(s).apply(e)}};var ds=class{static name="plugin-extension";manifestPath;browser;mode;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.mode=e.mode}apply(e){let s=this.manifestPath,r=de({manifestPath:s}),n=Wi({manifestPath:s});new jt({manifestPath:s,includeList:{...n?.pages||{},...n?.scripts||{}},excludeList:n.public,loaderOptions:{jsx:ue(We.default.dirname(this.manifestPath))||me(We.default.dirname(this.manifestPath))||Ce(We.default.dirname(this.manifestPath)),typescript:G(We.default.dirname(this.manifestPath)),minify:this.mode==="production"}}).apply(e),new Nt({browser:this.browser,manifestPath:s,includeList:{...r.html,...r.icons,...r.json,...r.scripts},excludeList:n.public}).apply(e),new Zt({manifestPath:s,includeList:{...r.html,...n.pages},excludeList:{...n.public,...n.scripts}}).apply(e),new es({manifestPath:s,browser:this.browser,includeList:{...r.scripts,...n.scripts},excludeList:{...n.public,...n.pages}}).apply(e),new ss({manifestPath:s}).apply(e),new ns({manifestPath:s,includeList:r.json,excludeList:n.public}).apply(e),new cs({manifestPath:s,includeList:r.icons,excludeList:n.public}).apply(e),new ps({manifestPath:s,includeList:{...r.scripts,...n.scripts},excludeList:n.public}).apply(e),new us({manifestPath:s}).apply(e)}};var ze=a(require("path"));var Zo=a(require("path")),Yo=a(require("ws"));function gs(t,e){t.clients.forEach(s=>{s.readyState===Yo.default.OPEN&&s.send(JSON.stringify(e))})}function Ko(t,e,s){if(!s||!e)return;let r=de({manifestPath:e}).locales,n=de({manifestPath:e}).scripts,i=de({manifestPath:e}).json;if(!t){process.env.EXTENSION_ENV==="development"&&console.error("WebSocket server is not running.");return}Zo.default.basename(s)==="manifest.json"&&gs(t,{changedFile:"manifest.json"}),r?.forEach(o=>{o.includes(s)&&gs(t,{changedFile:"_locales"})}),Object.entries(n).forEach(([o,c])=>{let p=Array.isArray(c)?c:[c];Object.values(p).flatMap(m=>m).includes(s)&&o==="background/service_worker"&&gs(t,{changedFile:"service_worker"})}),Object.entries(i).forEach(([o,c])=>{c?.includes(s)&&o==="declarative_net_request"&&gs(t,{changedFile:"declarative_net_request"})})}var yr=a(require("path")),sa=a(require("fs")),Je=a(require("ws"));var Be=a(require("path")),al=a(require("http")),ea=a(require("https")),hr=a(require("fs"));var Qo=t=>{if(!hr.default.existsSync(t))return;let e=Be.default.basename(t);return hr.default.readFileSync(Be.default.join(__dirname,"certs",e))};function ta(t,e){let s={key:Qo(Be.default.join(__dirname,"certs","localhost.key")),cert:Qo(Be.default.join(__dirname,"certs","localhost.cert"))},r=ea.default.createServer(s,(n,i)=>{i.writeHead(200),i.end()});return r.on("error",n=>{throw console.error(vn(t,e)),new Error(n.message)}),{server:r,port:e}}function cl(t,e,s){switch(s){case"chrome":return new Je.default.Server({host:"localhost",port:e});case"edge":return new Je.default.Server({host:"localhost",port:e+1});case"firefox":return new Je.default.Server({server:ta(t,e+2).server});default:return new Je.default.Server({host:"localhost",port:8888})}}async function ra(t,e){let s=t.options.context||"",r=require(yr.default.join(s,"manifest.json")),n=r.name||"Extension.js",i=e.port||8e3,o=cl(n,i,e.browser);if(o.on("connection",c=>{c.send(JSON.stringify({status:"serverReady"})),c.on("error",p=>{console.log(yn(n,p))}),c.on("message",p=>{let l=JSON.parse(p.toString());if(l.status==="clientReady"){let m=require(yr.default.join(s,"manifest.json"));setTimeout(()=>{console.log(Hs(m,e.browser,l)),console.log("")},2500),Cn(e.browser)&&setTimeout(()=>{console.log(hn(e.browser))},5e3)}})}),e.browser==="firefox"&&!sa.default.existsSync(tt)){let c=Fn(r);console.log(Hs(r,e.browser,c)),console.log(""),console.log(xn()),console.log("")}return o}var na=a(require("path")),br=a(require("fs"));function ia(t,e){let s=na.default.resolve(__dirname,`./extensions/${t}-manager-extension/reload-service.js`);try{let r=br.default.readFileSync(s,"utf8"),n=r.replace(/__RELOAD_PORT__/g,e.toString());n!==r&&br.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 He=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;ia(this.browser,this.port);let s=await ra(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 o=(r.modifiedFiles||new Set).values().next().value;if(!o){n();return}let c=ze.default.relative(ze.default.dirname(this.manifestPath),o),p=ze.default.relative(process.cwd(),ze.default.dirname(o));process.env.EXTENSION_ENV==="development"&&console.info(`\u25BA\u25BA Updated file \`${c}\` (relative to ${p})`),this.manifestPath&&Ko(s,this.manifestPath,o),n()})}};var wr=a(require("path"));function oa(t,e,s){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[wr.default.dirname(s)],exclude:/node_modules/,use:[{loader:wr.default.resolve(__dirname,"./inject-chromium-client-loader"),options:{manifestPath:s,browser:e}}]})}var xr=a(require("path"));function aa(t,e,s){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[xr.default.dirname(s)],exclude:/node_modules/,use:[{loader:xr.default.resolve(__dirname,"./inject-firefox-client-loader"),options:{manifestPath:s,browser:e}}]})}var ys=require("webpack");var vr=a(require("content-security-policy-parser"));function ca(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,vr.default)(e);e="",s.get("script-src")||s.set("script-src",["'self' 'unsafe-eval' blob: filesystem:"]),s.get("script-src")?.includes("'unsafe-eval'")||s.set("script-src",["unsafe-eval"]);for(let r in s)e+=`${r} ${s.get(r)?.join(" ")};`;return e}function pa(t){let e=t.content_security_policy;if(!e)return{extension_pages:"script-src 'self'; object-src 'self'; "};let s=(0,vr.default)(e.extension_pages||""),r="";for(let n in s)r+=`${n} ${s.get(n)?.join(" ")}; `;return{extension_pages:r.trim()}}function la(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 fa(t){let e=["/*.json","/*.js","/*.css"];return[...t.web_accessible_resources||[],{resources:e,matches:["<all_urls>"]}]}function _r(t,e){return t.background?{background:{...t.background}}:e==="firefox"?{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 Sr(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 hs=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}generateManifestPatches(e){let s=B(e,this.manifestPath),r={...s,content_security_policy:s.manifest_version===3?pa(s):ca(s),...s.manifest_version===3?s.permissions?{permissions:[...new Set(["scripting",...s.permissions])]}:{permissions:["scripting"]}:{},..._r(s,this.browser),...Sr(s),web_accessible_resources:s.manifest_version===3?fa(s):la(s)},n=JSON.stringify(r,null,2),i=new ys.sources.RawSource(n);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",i)}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:ys.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.webpack.WebpackError&&s.errors.push(new e.webpack.WebpackError(`run-chromium: ${n}`));return}this.generateManifestPatches(s)})})}};var Pr=a(require("fs")),xe=a(require("path")),ma=a(require("webpack-target-webextension"));var bs=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}handleBackground(e,s,r){let n=xe.default.resolve(__dirname,s==="firefox"?"minimum-firefox-file.mjs":"minimum-chromium-file.mjs"),i=xe.default.dirname(this.manifestPath),o=r.background;if(s==="firefox"){o=r["gecko:background"]||r["firefox:background"]||o;let c=o?.scripts||o?.["gecko:scripts"]||o?.["firefox:scripts"];if(c&&c.length>0){let p=xe.default.join(i,c[0]);this.ensureFileExists(p,"background.scripts")}else this.addDefaultEntry(e,"background/script",n)}else if(o=r["chromium:background"]||r["chrome:background"]||r["edge:background"]||o,r.manifest_version===3){let c=o?.service_worker||o?.["chromium:service_worker"]||o?.["chrome:service_worker"]||o?.["edge:service_worker"];if(c){let p=xe.default.join(i,c);this.ensureFileExists(p,"background.service_worker")}else this.addDefaultEntry(e,"background/service_worker",n)}else if(r.manifest_version===2){let c=o?.scripts||o?.["chromium:scripts"]||o?.["chrome:scripts"]||o?.["edge:scripts"];if(c&&c.length>0){let p=xe.default.join(i,c[0]);this.ensureFileExists(p,"background.scripts")}else this.addDefaultEntry(e,"background/script",n)}}ensureFileExists(e,s){if(!Pr.default.existsSync(e)&&this.manifestPath){let n=require(this.manifestPath).name||"Extension.js",i=bn(n,s,e);throw console.error(i),new Error(i)}}addDefaultEntry(e,s,r){e.options.entry={...e.options.entry,[s]:{import:[r]}}}getEntryName(e){if(e.background){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||!Pr.default.lstatSync(this.manifestPath).isFile())return;let s=require(this.manifestPath);this.handleBackground(e,this.browser,s),new ma.default({background:this.getEntryName(s),weakRuntimeCheck:!0}).apply(e)}};var kr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){ee.includes(this.browser)&&oa(e,this.browser,this.manifestPath),this.browser==="firefox"&&aa(e,this.browser,this.manifestPath),new hs({manifestPath:this.manifestPath,browser:this.browser}).apply(e),new bs({manifestPath:this.manifestPath,browser:this.browser}).apply(e)}},ua=kr;var ws=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 He({manifestPath:this.manifestPath,browser:this.browser,port:this.port,stats:this.stats}).apply(e),e.options.mode==="development"&&new ua({manifestPath:this.manifestPath,browser:this.browser,autoReload:this.autoReload,stats:this.stats}).apply(e)}};var da=a(require("webpack")),xs=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser}apply(e){new da.default.ProvidePlugin({browser:require.resolve("webextension-polyfill")}).apply(e)}};var _s=require("webpack");var vs=class{browser;manifestPath;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}patchManifest(e){let s=ce(e,this.browser);return JSON.stringify(s,null,2)}apply(e){e.hooks.compilation.tap("compatibility:browser-fields",s=>{s.hooks.processAssets.tap({name:"compatibility:browser-fields",stage:_s.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE},()=>{let r=B(s,this.manifestPath),n=this.patchManifest(r),i=new _s.sources.RawSource(n);s.updateAsset("manifest.json",i)})})}};var Ss=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 xs({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new vs({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e)}};var ka=a(require("fs"));var ga=a(require("webpack")),ha=a(require("content-security-policy-parser"));function ya(t){let e=t.content_security_policy,s=t.content_security_policy?.extension_pages,r=n=>{if(!n)return;let i=(0,ha.default)(n);if(i.get("script-src")&&i.get("script-src")?.includes("'unsafe-eval'")){let o=t.name||"Extension.js";return tn(o)}};if(t.manifest_version===3){let n=e?r(s):void 0;if(n)return new ga.default.WebpackError(n)}return null}var Er=a(require("webpack"));function ba(t,e){let s=t.web_accessible_resources;if(s){let r=s.some(o=>typeof o=="string"),n=s.some(o=>typeof o=="object"||o.resources||o.matches),i=t.name||"Extension.js";if(t.manifest_version===2&&!r)return new Er.default.WebpackError(rn(i,e));if(t.manifest_version===3&&!n)return new Er.default.WebpackError(nn(i,e))}return null}var wa=a(require("webpack"));function xa(t,e){if(e==="firefox"&&t.background?.service_worker){let s=t.name||"Extension.js";return new wa.default.WebpackError(en(s))}return null}var va=a(require("path")),_a=a(require("fs")),Sa=a(require("webpack"));function Pa(t,e){let s=va.default.join(e.options.context||"","_locales"),r=t.name||"Extension.js";return _a.default.existsSync(s)&&!t.default_locale?new Sa.default.WebpackError(sn(r)):null}var Ps=class{options;constructor(e){this.options=e}handleRuntimeErrors(e,s,r){let n=ya(s),i=ba(s,r),o=xa(s,r),c=Pa(s,e);n&&e.errors.push(n),i&&e.errors.push(i),o&&e.options.mode==="production"&&e.errors.push(o),c&&e.errors.push(c)}apply(e){e.hooks.afterCompile.tapAsync("CompatPlugin (module)",(s,r)=>{let n=this.options.manifestPath,i=JSON.parse(ka.default.readFileSync(n,"utf-8")),o=this.options.browser||"chrome";this.handleRuntimeErrors(s,i,o),r()})}};var Aa=a(require("fs")),Ra=a(require("ajv"));var Ea={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://json.schemastore.org/chrome-manifest.json",additionalProperties:!0,definitions:{action_v2:{type:"object",properties:{default_title:{type:"string",description:"Tooltip for the main toolbar icon."},default_popup:{$ref:"#/definitions/uri",description:"The popup appears when the user clicks the icon."},default_icon:{anyOf:[{type:"string",description:"FIXME: String form is deprecated."},{type:"object",description:"Icon for the main toolbar.",properties:{"19":{$ref:"#/definitions/icon"},"38":{$ref:"#/definitions/icon"}}}]}},dependencies:{name:{not:{required:["name"]}},icons:{not:{required:["icons"]}},popup:{not:{required:["popup"]}}}},action_v3:{type:"object",properties:{default_title:{type:"string",description:"Tooltip for the main toolbar icon."},default_popup:{$ref:"#/definitions/uri",description:"The popup appears when the user clicks the icon."},default_icon:{type:"object",properties:{"16":{$ref:"#/definitions/icon"},"24":{$ref:"#/definitions/icon"},"32":{$ref:"#/definitions/icon"}}}},dependencies:{name:{not:{required:["name"]}},icons:{not:{required:["icons"]}},popup:{not:{required:["popup"]}}}},command:{type:"object",if:{$comment:"Global shortcuts change the acceptable pattern for the suggested_key.",properties:{global:{const:!0}},required:["global"]},then:{additionalProperties:!1,properties:{description:{type:"string"},global:{type:"boolean",description:"Whether this command should work while Chrome does not have focus. Keyboard shortcut suggestions for global commands are limited to Ctrl+Shift+[0..9]"},suggested_key:{type:"object",additionalProperties:!1,patternProperties:{"^(default|mac|windows|linux|chromeos)$":{type:"string",pattern:"^(Ctrl|Command|MacCtrl)\\+Shift\\+[0-9]"}}}}},else:{additionalProperties:!1,properties:{description:{type:"string"},global:{type:"boolean",description:"Whether this command should work while Chrome does not have focus. Keyboard shortcut suggestions for global commands are limited to Ctrl+Shift+[0..9]"},suggested_key:{type:"object",additionalProperties:!1,patternProperties:{"^(default|mac|windows|linux|chromeos)$":{type:"string",pattern:"^(Ctrl|Command|MacCtrl|Alt|Option)\\+(Shift\\+)?[A-Z]"}}}}}},content_security_policy:{type:"string",description:"This introduces some fairly strict policies that will make extensions more secure by default, and provides you with the ability to create and enforce rules governing the types of content that can be loaded and executed by your extensions and applications.",format:"content-security-policy",default:"script-src 'self'; object-src 'self'"},glob_pattern:{type:"string",format:"glob-pattern"},icon:{$ref:"#/definitions/uri"},match_pattern:{type:"string",format:"match-pattern",pattern:"^((\\*|http|https|file|ftp|chrome-extension):\\/\\/(\\*|\\*\\.[^\\/\\*]+|[^\\/\\*]+)?(\\/.*))|urn:(\\*|.*)|<all_urls>$"},mime_type:{type:"string",format:"mime-type",pattern:"^(?:application|audio|image|message|model|multipart|text|video)\\/[-+.\\w]+$"},page:{$ref:"#/definitions/uri"},permissions:{type:"array",uniqueItems:!0,items:{type:"string",format:"permission"}},scripts:{type:"array",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/uri"}},uri:{type:"string"},version_string:{type:"string",pattern:"^(?:\\d{1,5}\\.){0,3}\\d{1,5}$"},web_resource:{type:"object",required:["resources"],properties:{resources:{type:"array",description:`An array of resources to be exposed. Resources are specified as strings and may contain * for wildcard matches. For example, "/images/*" exposes everything in the extension's /images directory recursively while "*.png" exposes all PNG files.`,items:{$ref:"#/definitions/glob_pattern"}},matches:{type:"array",description:"A list of URL match patterns specifying which pages can access the resources. Only the origin is used to match URLs; subdomains patterns (*.google.com) and paths are ignored.",items:{$ref:"#/definitions/match_pattern"}},extension_ids:{type:"array",description:"A list of extension IDs, specifying which extensions can access the resources.",items:{type:"string"}},use_dynamic_url:{type:"boolean",description:"If true, only allow resources to be accessible through dynamic ID. The dynamic ID is generated per session. It's regenerated on browser restart or extension reload."}}}},dependencies:{content_scripts:{not:{required:["script_badge"]}},script_badge:{not:{required:["content_scripts"]}}},else:{properties:{background:{type:"object",description:"The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.",properties:{persistent:{type:"boolean",description:"When false, makes the background page an event page (loaded only when needed).",default:!0},page:{$ref:"#/definitions/page",description:"Specify the HTML of the background page.",default:"background.html"},scripts:{$ref:"#/definitions/scripts",description:"A background page will be generated by the extension system that includes each of the files listed in the scripts property.",default:["background.js"]}},dependencies:{page:{not:{required:["scripts"]}},scripts:{not:{required:["page"]}}}},browser_action:{$ref:"#/definitions/action_v2",description:"Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup."},page_action:{$ref:"#/definitions/action_v2",description:"Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages."},content_security_policy:{$ref:"#/definitions/content_security_policy"},web_accessible_resources:{type:"array",description:"An array of strings specifying the paths (relative to the package root) of packaged resources that are expected to be usable in the context of a web page.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/uri"}}},dependencies:{page_action:{not:{required:["browser_action"]}},browser_action:{not:{required:["page_action"]}}}},if:{properties:{manifest_version:{const:3}}},properties:{manifest_version:{type:"number",description:"One integer specifying the version of the manifest file format your package requires.",enum:[2,3]},name:{type:"string",description:"The name of the extension",maxLength:45},version:{$ref:"#/definitions/version_string",description:"One to four dot-separated integers identifying the version of this extension."},default_locale:{type:"string",description:"Specifies the subdirectory of _locales that contains the default strings for this extension.",default:"en"},description:{type:"string",description:"A plain text description of the extension",maxLength:132},icons:{type:"object",description:"One or more icons that represent the extension, app, or theme. Recommended format: PNG; also BMP, GIF, ICO, JPEG.",minProperties:1,properties:{"16":{$ref:"#/definitions/icon",description:"Used as the favicon for an extension's pages and infobar."},"48":{$ref:"#/definitions/icon",description:"Used on the extension management page (chrome://extensions)."},"128":{$ref:"#/definitions/icon",description:"Used during installation and in the Chrome Web Store."},"256":{$ref:"#/definitions/icon",description:"Used during installation and in the Chrome Web Store."}}},chrome_url_overrides:{type:"object",description:"Override pages are a way to substitute an HTML file from your extension for a page that Google Chrome normally provides.",additionalProperties:!1,maxProperties:1,properties:{bookmarks:{$ref:"#/definitions/page",description:"The page that appears when the user chooses the Bookmark Manager menu item from the Chrome menu or, on Mac, the Bookmark Manager item from the Bookmarks menu. You can also get to this page by entering the URL chrome://bookmarks.",default:"bookmarks.html"},history:{$ref:"#/definitions/page",description:"The page that appears when the user chooses the History menu item from the Chrome menu or, on Mac, the Show Full History item from the History menu. You can also get to this page by entering the URL chrome://history.",default:"history.html"},newtab:{$ref:"#/definitions/page",description:"The page that appears when the user creates a new tab or window. You can also get to this page by entering the URL chrome://newtab.",default:"newtab.html"}}},commands:{type:"object",description:"Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.",patternProperties:{".*":{$ref:"#/definitions/command"},"^_execute_browser_action$":{$ref:"#/definitions/command"},"^_execute_page_action$":{$ref:"#/definitions/command"}}},content_scripts:{type:"array",description:"Content scripts are JavaScript files that run in the context of web pages.",minItems:1,uniqueItems:!0,items:{type:"object",required:["matches"],additionalProperties:!1,properties:{matches:{type:"array",description:"Specifies which pages this content script will be injected into.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/match_pattern"}},exclude_matches:{type:"array",description:"Excludes pages that this content script would otherwise be injected into.",uniqueItems:!0,items:{$ref:"#/definitions/match_pattern"}},css:{type:"array",description:"The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.",uniqueItems:!0,items:{$ref:"#/definitions/uri"}},js:{$ref:"#/definitions/scripts",description:"The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array."},world:{type:"string",description:"The JavaScript world for a script to execute within.",enum:["ISOLATED","MAIN"],default:"ISOLATED"},run_at:{type:"string",description:"Controls when the files in js are injected.",enum:["document_start","document_end","document_idle"],default:"document_idle"},all_frames:{type:"boolean",description:"Controls whether the content script runs in all frames of the matching page, or only the top frame.",default:!1},include_globs:{type:"array",description:"Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword.",uniqueItems:!0,items:{$ref:"#/definitions/glob_pattern"}},exclude_globs:{type:"array",description:"Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword.",uniqueItems:!0,items:{$ref:"#/definitions/glob_pattern"}},match_about_blank:{type:"boolean",description:"Whether to insert the content script on about:blank and about:srcdoc.",default:!1}}}},devtools_page:{$ref:"#/definitions/page",description:"A DevTools extension adds functionality to the Chrome DevTools. It can add new UI panels and sidebars, interact with the inspected page, get information about network requests, and more."},externally_connectable:{description:"Declares which extensions, apps, and web pages can connect to your extension via runtime.connect and runtime.sendMessage.",type:"object",additionalProperties:!1,properties:{ids:{type:"array",items:{type:"string",description:"The IDs of extensions or apps that are allowed to connect. If left empty or unspecified, no extensions or apps can connect."}},matches:{type:"array",items:{type:"string",description:"The URL patterns for web pages that are allowed to connect. This does not affect content scripts. If left empty or unspecified, no web pages can connect."}},accepts_tls_channel_id:{type:"boolean",default:!1,description:"Indicates that the extension would like to make use of the TLS channel ID of the web page connecting to it. The web page must also opt to send the TLS channel ID to the extension via setting includeTlsChannelId to true in runtime.connect's connectInfo or runtime.sendMessage's options."}}},file_browser_handlers:{type:"array",description:"You can use this API to enable users to upload files to your website.",minItems:1,items:{type:"object",required:["id","default_title","file_filters"],additionalProperties:!1,properties:{id:{type:"string",description:"Used by event handling code to differentiate between multiple file handlers"},default_title:{type:"string",description:"What the button will display."},file_filters:{type:"array",description:"Filetypes to match.",minItems:1,items:{type:"string"}}}}},homepage_url:{$ref:"#/definitions/uri",description:"The URL of the homepage for this extension."},incognito:{type:"string",description:"Specify how this extension will behave if allowed to run in incognito mode.",enum:["spanning","split","not_allowed"],default:"spanning"},input_components:{type:"array",description:"Allows your extension to handle keystrokes, set the composition, and manage the candidate window.",items:{type:"object",required:["name","type","id","description","language","layouts"],additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"},id:{type:"string"},description:{type:"string"},language:{type:"string"},layouts:{type:"array"}}}},key:{type:"string",description:"This value can be used to control the unique ID of an extension, app, or theme when it is loaded during development."},minimum_chrome_version:{$ref:"#/definitions/version_string",description:"The version of Chrome that your extension, app, or theme requires, if any."},nacl_modules:{type:"array",description:"One or more mappings from MIME types to the Native Client module that handles each type.",minItems:1,uniqueItems:!0,items:{type:"object",required:["path","mime_type"],additionalProperties:!1,properties:{path:{$ref:"#/definitions/uri",description:"The location of a Native Client manifest (a .nmf file) within the extension directory."},mime_type:{$ref:"#/definitions/mime_type",description:"The MIME type for which the Native Client module will be registered as content handler."}}}},oauth2:{type:"object",description:"Use the Chrome Identity API to authenticate users: the getAuthToken for users logged into their Google Account and the launchWebAuthFlow for users logged into a non-Google account.",required:["client_id","scopes"],additionalProperties:!1,properties:{client_id:{type:"string",description:"You need to register your app in the Google APIs Console to get the client ID."},scopes:{type:"array",minItems:1,items:{type:"string"}}}},offline_enabled:{type:"boolean",description:"Whether the app or extension is expected to work offline. When Chrome detects that it is offline, apps with this field set to true will be highlighted on the New Tab page."},omnibox:{type:"object",description:"The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.",required:["keyword"],additionalProperties:!1,properties:{keyword:{type:"string",description:"The keyword that will trigger your extension."}}},optional_permissions:{$ref:"#/definitions/permissions",description:"Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary."},options_page:{$ref:"#/definitions/page",description:"To allow users to customize the behavior of your extension, you may wish to provide an options page. If you do, a link to it will be provided from the extensions management page at chrome://extensions. Clicking the Options link opens a new tab pointing at your options page.",default:"options.html"},options_ui:{type:"object",description:"To allow users to customize the behavior of your extension, you may wish to provide an options page. If you do, an Options link will be shown on the extensions management page at chrome://extensions which opens a dialogue containing your options page.",required:["page"],properties:{page:{type:"string",description:"The path to your options page, relative to your extension's root."},chrome_style:{type:"boolean",default:!0,description:"If true, a Chrome user agent stylesheet will be applied to your options page. The default value is false, but we recommend you enable it for a consistent UI with Chrome."},open_in_tab:{type:"boolean",default:!1,description:"If true, your extension's options page will be opened in a new tab rather than embedded in chrome://extensions. The default is false, and we recommend that you don't change it. This is only useful to delay the inevitable deprecation of the old options UI! It will be removed soon, so try not to use it. It will break."}}},permissions:{$ref:"#/definitions/permissions",description:"Permissions help to limit damage if your extension or app is compromised by malware. Some permissions are also displayed to users before installation, as detailed in Permission Warnings."},requirements:{type:"object",description:"Technologies required by the app or extension. Hosting sites such as the Chrome Web Store may use this list to dissuade users from installing apps or extensions that will not work on their computer.",additionalProperties:!1,properties:{plugins:{type:"object",description:"Indicates if an app or extension requires NPAPI to run. This requirement is enabled by default when the manifest includes the 'plugins' field.",required:["npapi"],additionalProperties:!1,properties:{npapi:{type:"boolean",default:!0}}},"3D":{type:"object",description:"The '3D' requirement denotes GPU hardware acceleration.",required:["features"],additionalProperties:!1,properties:{features:{type:"array",description:"List of the 3D-related features your app requires.",minItems:1,uniqueItems:!0,items:{type:"string",enum:["webgl"]}}}}}},sandbox:{type:"object",description:"Defines an collection of app or extension pages that are to be served in a sandboxed unique origin, and optionally a Content Security Policy to use with them.",required:["pages"],additionalProperties:!1,properties:{pages:{type:"array",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/page"}},content_security_policy:{$ref:"#/definitions/content_security_policy",default:"sandbox allow-scripts allow-forms"}}},short_name:{type:"string",description:"The short name is typically used where there is insufficient space to display the full name.",maxLength:12},update_url:{$ref:"#/definitions/uri",description:"If you publish using the Chrome Developer Dashboard, ignore this field. If you host your own extension or app: URL to an update manifest XML file."},tts_engine:{type:"object",description:"Register itself as a speech engine.",required:["voices"],additionalProperties:!1,properties:{voices:{type:"array",description:"Voices the extension can synthesize.",minItems:1,uniqueItems:!0,items:{type:"object",required:["voice_name","event_types"],additionalProperties:!1,properties:{voice_name:{type:"string",description:"Identifies the name of the voice and the engine used."},lang:{type:"string",description:"Almost always, a voice can synthesize speech in just a single language. When an engine supports more than one language, it can easily register a separate voice for each language."},gender:{type:"string",description:"If your voice corresponds to a male or female voice, you can use this parameter to help clients choose the most appropriate voice for their application."},event_types:{type:"array",description:"Events sent to update the client on the progress of speech synthesis.",minItems:1,uniqueItems:!0,items:{type:"string",description:"",enum:["start","word","sentence","marker","end","error"]}}}}}}},version_name:{type:"string",description:"In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version string and will be used for display purposes if present."},chrome_settings_overrides:{},content_pack:{},current_locale:{},import:{},platforms:{},signature:{},spellcheck:{},storage:{},system_indicator:{}},required:["manifest_version","name","version"],then:{$comment:"browser_action and page_action are no longer present in v3",properties:{background:{type:"object",description:"The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.",properties:{service_worker:{type:"string",description:"The service worker js file."},type:{type:"string",enum:["module"]}},dependencies:{page:{not:{required:["scripts"]}},scripts:{not:{required:["page"]}}}},host_permissions:{$ref:"#/definitions/permissions"},action:{$ref:"#/definitions/action_v3",description:"Used to control the toolbar button for your extension in Chrome's UI."},content_security_policy:{type:"object",properties:{extension_pages:{$ref:"#/definitions/content_security_policy",description:"This policy covers pages in your extension, including html files and service workers."},sandbox:{$ref:"#/definitions/content_security_policy",description:"This policy covers any sandboxed extension pages that your extension uses."}}},web_accessible_resources:{type:"array",description:"An array of objects that declare resource access rules. Each object maps an array of extension resources to an array of URLs and/or extension IDs that can access those resources.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/web_resource"}}},dependencies:{browser_action:{not:{required:["browser_action"]}},page_action:{not:{required:["page_action"]}}}},title:"JSON schema for Google Chrome extension manifest files",type:"object"};function ja(t){t.addFormat("permission",{type:"string",validate:e=>typeof e=="string"&&e.trim()!==""}),t.addFormat("content-security-policy",{type:"string",validate:e=>typeof e=="string"}),t.addFormat("glob-pattern",{type:"string",validate:e=>typeof e=="string"&&/[\*\?\[\]]/.test(e)}),t.addFormat("match-pattern",{type:"string",validate:e=>e==="<all_urls>"||e==="file:///"||e.startsWith("http://localhost")||e.startsWith("http:// ")||e.startsWith("http://*:*/*")?!0:typeof e=="string"&&/^(\*|http|https|file|ftp):\/\//.test(e)}),t.addFormat("uri",{type:"string",validate:e=>typeof e=="string"&&/^(\w+:)?\/\//.test(e)}),t.addFormat("mime-type",{type:"string",validate:e=>typeof e=="string"&&/^[a-z]+\/[a-z0-9\-\+]+$/.test(e)})}var $a=a(require("path")),Ca=require("webpack");function Fa(t,e,s){let r=t.options.context||"",n=$a.default.join(r,"manifest.json"),o=require(n).name||"Extension.js",c=e?.params.missingProperty;t.errors.push(new Ca.WebpackError(cn(o,s,c)))}var Da=a(require("path")),La=require("webpack");function Ia(t,e,s){let r=t.options.context||"",n=Da.default.join(r,"manifest.json"),o=require(n).name||"Extension.js";t.warnings.push(new La.WebpackError(an(o,e,s)))}var Oa=a(require("path")),Ma=require("webpack");function jr(t,e,s){let r=t.options.context||"",n=Oa.default.join(r,"manifest.json"),o=require(n).name||"Extension.js";t.warnings.push(new Ma.WebpackError(on(o,s,e)))}var ks=class{options;constructor(e){this.options=e}handleSchemaErrors(e,s,r){let n=new Ra.default;ja(n);let i={allOf:[Ea]},o=n.compile(i),c=o(s),p=s.manifest_version===3;if(!c&&o.errors){let l=o.errors[0];if(l?.keyword==="required"){Fa(e,l,r);return}p&&(l?.keyword==="type"&&Ia(e,l,r),l?.keyword==="not"&&jr(e,l,r))}}apply(e){e.hooks.afterCompile.tapAsync("CompatPlugin (module)",(s,r)=>{let n=this.options.manifestPath,i=JSON.parse(Aa.default.readFileSync(n,"utf-8")),o=this.options.browser||"chrome";this.handleSchemaErrors(s,i,o),r()})}};var qa=a(require("fs")),Cr=a(require("path"));var $r=a(require("webpack"));function Na(t,e){let s="Conflict: Multiple assets emit different content to the same filename ";if(e.message.includes(s)){let r=e.message.replace(s,"");if(r.startsWith("content_scripts"))return new $r.default.WebpackError(pn(t,r))}return null}function Ta(t,e){let s=require(t);return e.message.includes("Top-level-await is only supported in EcmaScript Modules")?new $r.default.WebpackError(ln(s.name)):null}var Es=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){let s=Cr.default.join(Cr.default.dirname(this.manifestPath),"package.json");if(!qa.default.existsSync(s))return;let r=require(s).name;e.hooks.compilation.tap("develop:common-errors",n=>{n.hooks.afterSeal.tapAsync("develop:common-errors",i=>{n.errors.forEach((o,c)=>{let p=Na(r,o),l=Ta(r,o);p&&(n.errors[c]=p),l&&(n.errors[c]=l)}),i()})})}};var js=class{static name="plugin-errors";manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){new Ps({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new ks({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new Es({manifestPath:this.manifestPath}).apply(e)}};var kc=a(require("os")),Ir=a(require("path"));var pc=a(require("fs")),lc=require("child_process");var se=a(require("path")),Xe=a(require("fs"));var Ua={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}},Wa={...Ua},Ba={...Ua};var b=require("@colors/colors/safe");function k(t,e){let s=e==="warn"?(0,b.brightYellow)("\u25BA\u25BA\u25BA"):e==="info"?(0,b.cyan)("\u25BA\u25BA\u25BA"):e==="error"?`${(0,b.bold)((0,b.red)("ERROR"))} in ${Ve(t)} ${(0,b.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:(0,b.brightGreen)("\u25BA\u25BA\u25BA");return`${(0,b.gray)("")}${s}`}function Ve(t){return t.charAt(0).toUpperCase()+t.slice(1)}function $s(t){let e=Ve(t);return`${k(t,"info")} Creating new ${e} user profile...`}function Ja(t){return`${k(t,"success")} Instance already running.`}function za(t){return`${k(t,"info")} Instance exited.`}function Cs(t,e){let s=t==="firefox"?"Add-on":"Extension";return`${k(t,"success")} ${Ve(t)} ${s} running in ${(0,b.brightBlue)(e||"unknown")} mode.`}function Ge(t,e){let s=e=="null"?`Browser is not installed
|
|
111
111
|
|
|
112
112
|
`:`Can't find the browser path
|
|
113
113
|
|
|
114
114
|
`;return`${k(t,"error")} ${s}Either install the missing browser or choose a different one via ${(0,b.brightYellow)("--browser")} flag.
|
|
115
|
-
${(0,b.red)("NOT FOUND")} ${(0,b.underline)(e||Ve(t)+"BROWSER")}`}function
|
|
115
|
+
${(0,b.red)("NOT FOUND")} ${(0,b.underline)(e||Ve(t)+"BROWSER")}`}function Ha(t){return`${k(t,"error")} No Service Worker Support
|
|
116
116
|
|
|
117
117
|
Firefox does not support the ${(0,b.brightYellow)("background.service_worker")} field yet.
|
|
118
118
|
Update your manifest.json file to use ${(0,b.brightYellow)("background.scripts")} instead.
|
|
119
119
|
|
|
120
|
-
Read more: ${(0,b.underline)("https://bugzilla.mozilla.org/show_bug.cgi?id=1573659")}.`}function
|
|
121
|
-
${(0,b.red)(e)}`}function
|
|
122
|
-
${(0,b.red)(e)}`}function
|
|
120
|
+
Read more: ${(0,b.underline)("https://bugzilla.mozilla.org/show_bug.cgi?id=1573659")}.`}function Va(t,e){return`${k(t,"error")} Error launching browser:
|
|
121
|
+
${(0,b.red)(e)}`}function Ga(t,e){return`${k(t,"error")} ${(0,b.red)(e.stack)}`}function Xa(t){return`${k(t,"error")} Unable to connect to ${Ve(t)}. Too many retries.`}function Za(t,e){return`${k(t,"error")} Error while installing temporary addon:
|
|
122
|
+
${(0,b.red)(e)}`}function Ya(t,e){return`${k(t,"error")} Path is not directory
|
|
123
123
|
|
|
124
124
|
Please provide a valid directory path and try again.
|
|
125
|
-
${(0,b.red)("NOT DIRECTORY")} ${(0,b.underline)(e)}`}function
|
|
126
|
-
${(0,b.brightYellow)(JSON.stringify(e))}`}function
|
|
127
|
-
${(0,b.red)(e)}`}var ic=a(require("progress"));function Cs(t,e){let r=new ic.default(`${t} [:bar] :percent :etas`,{complete:"=",incomplete:" ",width:50,total:131072}),n=setInterval(()=>{let i=Math.random()*10*1024;r.tick(i),r.complete&&(clearInterval(n),e())},50)}function oc(t,e,s){if(Fs.default.existsSync(se.default.resolve(__dirname,`run-${t}-profile`)))return e||se.default.resolve(__dirname,`run-${t}-profile`);let n=JSON.stringify(t==="chrome"?Ua:Wa);return s||Cs(js(t),()=>{let i=se.default.resolve(__dirname,`run-${t}-profile`),o=se.default.join(i,"Default");Fs.default.mkdirSync(o,{recursive:!0});let c=se.default.join(o,"Preferences");Fs.default.writeFileSync(c,n,"utf8")}),se.default.resolve(__dirname,`run-${t}-profile`)}function ac(t){let e=Array.isArray(t.extension)?t.extension:[t.extension],s=oc(t.browser,t.profile,!1);return[`--load-extension=${e.join()}`,`--user-data-dir=${s}`,"--no-first-run","--disable-client-side-phishing-detection","--disable-component-extensions-with-background-pages","--disable-default-apps","--disable-features=InterestFeedContentSuggestions","--disable-features=Translate","--hide-scrollbars","--mute-audio","--no-default-browser-check","--no-first-run","--ash-no-nudges","--disable-search-engine-choice-screen","--disable-features=MediaRoute","--use-mock-keychain","--disable-background-networking","--disable-breakpad","--disable-component-update","--disable-domain-reliability","--disable-features=AutofillServerCommunicatio","--disable-features=CertificateTransparencyComponentUpdate","--disable-sync","--disable-features=OptimizationHints","--disable-features=DialMediaRouteProvider","--no-pings","--enable-features=SidePanelUpdates",...t.browserFlags||[]]}process.on("SIGINT",()=>{process.exit()});process.on("SIGTERM",()=>{process.exit()});var _e=class{extension;browser;browserFlags;userDataDir;profile;preferences;startingUrl;autoReload;stats;constructor(e){this.extension=e.extension,this.browser=e.browser,this.browserFlags=e.browserFlags||[],this.userDataDir=e.userDataDir,this.profile=e.profile||e.userDataDir,this.preferences=e.preferences,this.startingUrl=e.startingUrl}launchChromium(e){let s;switch(e){case"chrome":s=require(`${e}-location`);break;case"edge":s=require(`${e}-location`)();break;default:s=require(`${e}`);break}cc.default.existsSync(s)||(console.error(Ge(e,s)),process.exit());let r=ac(this),n=this.startingUrl?[this.startingUrl,...r]:[...r],i=process.env.EXTENSION_ENV==="development"?"inherit":"ignore",o=(0,pc.spawn)(s,n,{stdio:i});process.env.EXTENSION_ENV==="development"&&(o.stdout?.pipe(process.stdout),o.stderr?.pipe(process.stderr))}apply(e){let s=!1;e.hooks.done.tapAsync("run-browsers:module",(r,n)=>{if(r.compilation.errors.length>0){n();return}if(s){n();return}this.launchChromium(this.browser),setTimeout(()=>{console.log($s(this.browser,r.compilation.options.mode))},2e3),s=!0,n()})}};var Dr=a(require("fs")),Sc=a(require("path")),Lr=require("child_process");var Xe=a(require("fs")),Ds=a(require("path")),lc=a(require("os")),fc=a(require("which")),mc=process.platform==="darwin",pl=process.platform==="win32",ll=!mc&&!pl;function fl(){if(ll)try{return fc.default.sync("firefox")}catch{return null}else if(mc){let t="/Applications/Firefox.app/Contents/MacOS/firefox",e=Ds.default.join(lc.default.homedir(),t.slice(1));return Xe.default.existsSync(t)?t:Xe.default.existsSync(e)?e:null}else{let t=Ds.default.join("Mozilla Firefox","firefox.exe"),e=[process.env.LOCALAPPDATA,process.env.PROGRAMFILES,process.env["PROGRAMFILES(X86)"]];for(let r of e)if(r){let n=Ds.default.join(r,t);if(Xe.default.existsSync(n))return n}let s=["C:\\Program Files\\Mozilla Firefox\\firefox.exe","C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"];for(let r of s)if(Xe.default.existsSync(r))return r;return null}}var Ls=fl();var dc=a(require("path")),Is=a(require("fs")),Fr=a(require("firefox-profile"));var ml={"app.update.enabled":!1,"browser.dom.window.dump.enabled":!0,"browser.formfill.enable":!1,"browser.link.open_newwindow":3,"browser.sessionstore.enabled":!1,"browser.shell.checkDefaultBrowser":!1,"browser.sync.enabled":!1,"browser.startup.page":0,"browser.startup.homepage_welcome_url":"about:blank","browser.startup.homepage_welcome_url_additional":"about:blank","browser.urlbar.suggest.bookmark":!1,"browser.urlbar.suggest.clipboard":!1,"browser.urlbar.suggest.history":!1,"browser.urlbar.suggest.openpage":!1,"browser.urlbar.suggest.remotetab":!1,"browser.urlbar.suggest.searches":!1,"browser.urlbar.suggest.topsites":!1,"browser.urlbar.suggest.engines":!1,"browser.urlbar.suggest.calculator":!1,"browser.urlbar.suggest.recentsearches":!1,"datareporting.policy.dataSubmissionEnabled":!1,"datareporting.policy.firstRunURL":"","devtools.browserconsole.contentMessages":!0,"devtools.chrome.enabled":!0,"devtools.debugger.prompt-connection":!1,"devtools.debugger.remote-enabled":!0,"devtools.errorconsole.enabled":!0,"extensions.installDistroAddons":!1,"extensions.autoDisableScopes":10,"extensions.chrome.enabled":!0,"extensions.logging.enabled":!1,"extensions.checkCompatibility.nightly":!1,"extensions.update.enabled":!1,"extensions.update.notifyUser":!1,"extensions.enabledScopes":5,"extensions.getAddons.cache.enabled":!1,"network.prefetch.next":!1,"network.speculative.preconnect.enabled":!1,"toolkit.telemetry.enabled":!1,"toolkit.telemetry.archive.enabled":!1,"toolkit.telemetry.newProfilePing.enabled":!1,"toolkit.recovery.enabled":!1,"urlclassifier.updateinterval":172800,"security.enterprise_roots.enabled":!0,"xpinstall.signatures.required":!1};function uc(t){return{...ml,...t}}function gc(t,e){let s=uc(e);Object.keys(s).forEach(i=>{t.setPreference(i,s[i])});let n=Object.keys(e);return n.length>0&&n.forEach(i=>{t.setPreference(i,e[i])}),t.updatePreferences(),t}function ul(t,e){let s=new Fr.default({destinationDirectory:t});return gc(s,e)}function dl(t,e,s){let r;if(Is.default.statSync(e).isDirectory())r=e;else throw new Error(Za(t,e));let i=new Fr.default({destinationDirectory:r});return gc(i,s)}function hc(t,e,s,r){let n,i=e||dc.default.resolve(__dirname,"run-firefox-data-dir");return Is.default.existsSync(i)?n=dl(t,i,s||{}):(r||Cs(js(t),()=>{}),Is.default.mkdirSync(i,{recursive:!0}),n=ul(i,s||{})),n}async function yc(t,e){let{browser:s,startingUrl:r,preferences:n,userDataDir:i,browserConsole:o=!1,browserFlags:c=[]}=e,p=hc(s,i,n),l=[];r&&l.push(`--url "${r}"`),o&&l.push("--jsconsole"),c&&l.push(...c);let m=t.options.devServer?.port?t.options.devServer?.port+100:9222;return[`--binary-args "${c.join(" ")}"`,`--profile "${p.path()}"`,`--listen ${m}`,"--verbose"].join(" ")}var _c=a(require("path"));var bc=a(require("net")),wc=a(require("events"));function gl(t,e){let s=e.toString(),r=s.indexOf(":");if(r<1)return{remainingData:e};let n=parseInt(s.substring(0,r),10);if(isNaN(n))return{remainingData:e,error:new Error(Ya(t)),fatal:!0};if(e.length-(r+1)<n)return{remainingData:e};let i=e.slice(r+1,r+1+n),o=e.slice(r+1+n);try{let c=JSON.parse(i.toString());return{remainingData:o,parsedMessage:c}}catch(c){return{remainingData:o,error:c,fatal:!1}}}var Os=class extends wc.default{incomingData=Buffer.alloc(0);pendingRequests=[];activeRequests=new Map;connection;async connect(e){await new Promise((s,r)=>{try{let n={port:e,host:"127.0.0.1"},i=bc.default.createConnection(n,()=>{s()});this.connection=i,i.on("data",this.onData.bind(this)),i.on("error",r),i.on("end",this.onEnd.bind(this)),i.on("timeout",this.onTimeout.bind(this)),this.expectReply("root",{resolve:s,reject:r})}catch(n){r(n)}})}disconnect(){this.connection&&(this.connection.removeAllListeners(),this.connection.end(),this.rejectAllRequests(new Error(Ka("firefox"))))}rejectAllRequests(e){this.activeRequests.forEach(s=>{s.reject(e)}),this.activeRequests.clear(),this.pendingRequests.forEach(({deferred:s})=>{s.reject(e)}),this.pendingRequests=[]}async request(e){let s=typeof e=="string"?{to:"root",type:e}:e;if(!s.to)throw new Error(Qa("firefox",s.type));return await new Promise((r,n)=>{let i={resolve:r,reject:n};this.pendingRequests.push({request:s,deferred:i}),this.flushPendingRequests()})}flushPendingRequests(){this.pendingRequests=this.pendingRequests.filter(({request:e,deferred:s})=>{if(this.activeRequests.has(e.to))return!0;if(!this.connection)throw new Error(ec("firefox"));try{let r=`${Buffer.from(JSON.stringify(e)).length}:${JSON.stringify(e)}`;this.connection.write(r),this.expectReply(e.to,s)}catch(r){s.reject(r)}return!1})}expectReply(e,s){if(this.activeRequests.has(e))throw new Error(tc("firefox",e));this.activeRequests.set(e,s)}onData(e){for(this.incomingData=Buffer.concat([this.incomingData,e]);this.readMessage(););}readMessage(){let{remainingData:e,parsedMessage:s,error:r,fatal:n}=gl("firefox",this.incomingData);return this.incomingData=e,r?(this.emit("error",new Error(sc("firefox",r))),n&&this.disconnect(),!n):s?(this.handleMessage(s),!0):!1}handleMessage(e){if(!e.from){this.emit("error",new Error(rc("firefox",e)));return}let s=this.activeRequests.get(e.from);s?(this.activeRequests.delete(e.from),e.error?s.reject(e):s.resolve(e),this.flushPendingRequests()):this.emit("error",new Error(nc("firefox",JSON.stringify(e))))}onError(e){this.emit("error",e)}onEnd(){this.emit("end")}onTimeout(){this.emit("timeout")}};function xc(t){return t instanceof Error?String(t):`${t.error}: ${t.message}`}function vc(t,e){return Array.isArray(t)&&t.includes(e.code)?!0:e.code===t}var hl=150,yl=1e3,Ms=class{options;constructor(e){this.options=e}async connectClient(e){let s;for(let r of Array.from({length:hl}))try{let n=new Os;return await n.connect(e),n}catch(n){if(vc("ECONNREFUSED",n))await new Promise(i=>setTimeout(i,yl)),s=n;else throw console.error(Va(this.options.browser,n.stack)),n}throw console.error(Ga(this.options.browser)),s}async installAddons(e){let{devtools:s}=this.options,r=Array.isArray(this.options.extension)?this.options.extension:[this.options.extension],n=e.options.devServer?.port,i=n?n+100:9222,o=await this.connectClient(i);for(let[c,p]of r.entries()){let l=_c.default.join(p.replace(/"/g,"")),m=c===0&&s;try{let d=await o.request({to:"root",type:"getRoot"});await o.request({to:d.addonsActor,type:"installTemporaryAddon",addonPath:l,openDevTools:m})}catch(d){let g=xc(d);throw new Error(Xa(this.options.browser,g))}}}};var re=null;process.on("SIGINT",()=>{re&&re.kill("SIGINT"),process.exit()});process.on("SIGTERM",()=>{re&&re.kill("SIGTERM"),process.exit()});var As=class{extension;browser;browserFlags;userDataDir;profile;preferences;startingUrl;autoReload;stats;constructor(e){this.extension=e.extension,this.browser=e.browser||"firefox",this.browserFlags=e.browserFlags||[],this.userDataDir=e.userDataDir,this.profile=e.profile,this.preferences=e.preferences,this.startingUrl=e.startingUrl}async getFxRunnerCommand(){let e=Sc.default.join(process.cwd(),"node_modules",".bin","fx-runner"),s=ae()?"pnpm dlx -y fx-runner":"npx -y fx-runner";if(Dr.default.existsSync(e))return e;try{return await new Promise((r,n)=>{(0,Lr.exec)(`${s} --version`,i=>{i?n(i):r(null)})}),s}catch{console.error(Ge("firefox",e)),process.exit(1)}}async launchFirefox(e){let r=`${await this.getFxRunnerCommand()} start --binary "${Ls}" --foreground --no-remote`;Dr.default.existsSync(Ls||"")||(console.error(Ge(this.browser,Ls||"")),process.exit(1));let n=await yc(e,this),i=`${r} ${n}`;re=(0,Lr.exec)(i,(c,p,l)=>{if(c!=null)throw c;l.includes("Unable to move the cache")?console.log(Ba(this.browser)):(console.log(Ja(this.browser)),process.exit())}),process.env.EXTENSION_ENV==="development"&&(re.stdout?.pipe(process.stdout),re.stderr?.pipe(process.stderr));let o=new Ms(this);try{await o.installAddons(e)}catch(c){c?.toString()?.includes("background.service_worker is currently disabled")&&(console.error(za(this.browser)),process.exit(1)),console.error(Ha(this.browser,c)),process.exit(1)}}apply(e){let s=!1;e.hooks.done.tapAsync("run-firefox:module",async(r,n)=>{if(r.compilation.errors.length>0){n();return}if(s){n();return}setTimeout(()=>{console.log($s(this.browser,r.compilation.options.mode))},2e3),await this.launchFirefox(e),s=!0,n()})}};var Rs=class{static name="plugin-browsers";extension;browser;browserFlags;userDataDir;profile;preferences;startingUrl;constructor(e){this.extension=[...e.extension,...e.browserFlags?.filter(s=>!s.startsWith("--load-extension="))||[]],this.browser=e.browser,this.browserFlags=e.browserFlags?.filter(s=>!s.startsWith("--load-extension="))||[],this.userDataDir=e.userDataDir,this.profile=e.profile||"",this.preferences=e.preferences||{},this.startingUrl=e.startingUrl||""}getProfilePath(e,s,r){return r||(e.options.mode==="production"?Ir.default.join(Pc.default.tmpdir(),"extension-js",s,"profile"):Ir.default.resolve(__dirname,`run-${s}-profile`))}apply(e){let s={stats:!0,extension:this.extension,browser:this.browser,browserFlags:this.browserFlags||[],userDataDir:this.getProfilePath(e,this.browser,this.userDataDir||this.profile)};switch(this.browser){case"chrome":{new _e({...s,browser:"chrome"}).apply(e);break}case"edge":new _e({...s,browser:"edge"}).apply(e);break;case"firefox":new As({...s,browser:"firefox"}).apply(e);break;default:{new _e({...s,browser:this.browser}).apply(e);break}}}};function J(t,e){let s=Ze.default.join(t,"manifest.json"),r=Ze.default.join(t,`dist/${e.browser}`),n=require(s);return{mode:e.mode||"development",entry:{},target:"web",context:t,devtool:n.manifest_version===3?"cheap-source-map":"eval-cheap-source-map",output:{clean:{keep(i){return!i.startsWith("hot/background")}},path:r,publicPath:"/",hotUpdateChunkFilename:"hot/[id].[fullhash].hot-update.js",hotUpdateMainFilename:"hot/[runtime].[fullhash].hot-update.json",environment:{bigIntLiteral:!0,dynamicImport:!0}},resolve:{modules:["node_modules",Ze.default.join(t,"node_modules")],extensions:[".js",".mjs",".jsx",".ts",".mts",".tsx",".json",".wasm",".less",".css",".sass",".scss"]},watchOptions:{ignored:/node_modules|dist/},module:{rules:[]},plugins:[new it({manifestPath:s}),new dt({manifestPath:s,mode:e.mode}),new ut({manifestPath:s,mode:e.mode}),new wt({manifestPath:s,mode:e.mode}),process.env.EXTENSION_ENV==="development"&&new Es({manifestPath:s,browser:e.browser}),new _s({manifestPath:s,browser:e.browser,polyfill:e.polyfill}),new us({manifestPath:s,browser:e.browser,mode:e.mode}),new bs({manifestPath:s,browser:e.browser,stats:!0,port:e.port||8e3}),!e.noOpen&&new Rs({extension:[r,Ze.default.join(__dirname,"extensions",`${e.browser}-manager-extension`)],browser:e.browser,startingUrl:e.startingUrl,profile:e.profile||e.userDataDir,preferences:e.preferences,browserFlags:e.browserFlags})].filter(Boolean),stats:{all:!1,errors:!0,warnings:!0},infrastructureLogging:{level:"none"},performance:{hints:!1,maxAssetSize:999e3,maxEntrypointSize:999e3},optimization:{minimize:e.mode==="production"},experiments:{asyncWebAssembly:!0}}}var Ke=a(require("path")),tp=a(require("go-git-it"));var Ye=a(require("path")),Ns=a(require("fs")),u=require("@colors/colors/safe");function _(t){return`${t==="warn"?(0,u.brightYellow)("\u25BA\u25BA\u25BA"):t==="info"?(0,u.cyan)("\u25BA\u25BA\u25BA"):t==="error"?`${(0,u.bold)((0,u.red)("ERROR"))} in Extension.js ${(0,u.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:(0,u.brightGreen)("\u25BA\u25BA\u25BA")}`}function Y(t){return`${_("error")} Manifest file not found.
|
|
125
|
+
${(0,b.red)("NOT DIRECTORY")} ${(0,b.underline)(e)}`}function Ka(t){return`${k(t,"error")} Error parsing message length.`}function Qa(t){return`${k(t,"error")} ${(0,b.magenta)("MessagingClient")} connection closed.`}function ec(t,e){return`${k(t,"error")} Unexpected ${(0,b.magenta)("MessagingClient")} request without target actor: ${(0,b.brightYellow)(e)}`}function tc(t){return`${k(t,"error")} ${(0,b.magenta)("MessagingClient")} connection closed.`}function sc(t,e){return`${k(t,"error")} Target actor ${(0,b.brightYellow)(e)} already has an active request.`}function rc(t,e){return`${k(t,"error")} Error parsing packet: ${(0,b.red)(e)}`}function nc(t,e){return`${k(t,"error")} Message received without a sender actor:
|
|
126
|
+
${(0,b.brightYellow)(JSON.stringify(e))}`}function ic(t,e){return`${k(t,"error")} Received unexpected message:
|
|
127
|
+
${(0,b.red)(e)}`}var oc=a(require("progress"));function Fs(t,e){let r=new oc.default(`${t} [:bar] :percent :etas`,{complete:"=",incomplete:" ",width:50,total:131072}),n=setInterval(()=>{let i=Math.random()*10*1024;r.tick(i),r.complete&&(clearInterval(n),e())},50)}function ac(t,e,s){if(e&&Xe.default.existsSync(e))return e;if(Xe.default.existsSync(se.default.resolve(__dirname,`run-${t}-profile`)))return se.default.resolve(__dirname,`run-${t}-profile`);let n=JSON.stringify(t==="chrome"?Wa:Ba);return s||Fs($s(t),()=>{let i=se.default.resolve(__dirname,`run-${t}-profile`),o=se.default.join(i,"Default");Xe.default.mkdirSync(o,{recursive:!0});let c=se.default.join(o,"Preferences");Xe.default.writeFileSync(c,n,"utf8")}),se.default.resolve(__dirname,`run-${t}-profile`)}function cc(t){let e=Array.isArray(t.extension)?t.extension:[t.extension],s=ac(t.browser,t.profile,!1);return[`--load-extension=${e.join()}`,`--user-data-dir=${s}`,"--no-first-run","--disable-client-side-phishing-detection","--disable-component-extensions-with-background-pages","--disable-default-apps","--disable-features=InterestFeedContentSuggestions","--disable-features=Translate","--hide-scrollbars","--mute-audio","--no-default-browser-check","--no-first-run","--ash-no-nudges","--disable-search-engine-choice-screen","--disable-features=MediaRoute","--use-mock-keychain","--disable-background-networking","--disable-breakpad","--disable-component-update","--disable-domain-reliability","--disable-features=AutofillServerCommunicatio","--disable-features=CertificateTransparencyComponentUpdate","--disable-sync","--disable-features=OptimizationHints","--disable-features=DialMediaRouteProvider","--no-pings","--enable-features=SidePanelUpdates",...t.browserFlags||[]]}process.on("SIGINT",()=>{process.exit()});process.on("SIGTERM",()=>{process.exit()});var _e=class{extension;browser;browserFlags;userDataDir;profile;preferences;startingUrl;autoReload;stats;constructor(e){this.extension=e.extension,this.browser=e.browser,this.browserFlags=e.browserFlags||[],this.userDataDir=e.userDataDir,this.profile=e.profile||e.userDataDir,this.preferences=e.preferences,this.startingUrl=e.startingUrl}launchChromium(e){let s;switch(e){case"chrome":s=require(`${e}-location`);break;case"edge":s=require(`${e}-location`)();break;default:s=require(`${e}`);break}pc.default.existsSync(s)||(console.error(Ge(e,s)),process.exit());let r=cc(this),n=this.startingUrl?[this.startingUrl,...r]:[...r],i=process.env.EXTENSION_ENV==="development"?"inherit":"ignore",o=(0,lc.spawn)(s,n,{stdio:i});process.env.EXTENSION_ENV==="development"&&(o.stdout?.pipe(process.stdout),o.stderr?.pipe(process.stderr))}apply(e){let s=!1;e.hooks.done.tapAsync("run-browsers:module",(r,n)=>{if(r.compilation.errors.length>0){n();return}if(s){n();return}this.launchChromium(this.browser),setTimeout(()=>{console.log(Cs(this.browser,r.compilation.options.mode))},2e3),s=!0,n()})}};var Dr=a(require("fs")),Pc=a(require("path")),Lr=require("child_process");var Ze=a(require("fs")),Ds=a(require("path")),fc=a(require("os")),mc=a(require("which")),uc=process.platform==="darwin",ll=process.platform==="win32",fl=!uc&&!ll;function ml(){if(fl)try{return mc.default.sync("firefox")}catch{return null}else if(uc){let t="/Applications/Firefox.app/Contents/MacOS/firefox",e=Ds.default.join(fc.default.homedir(),t.slice(1));return Ze.default.existsSync(t)?t:Ze.default.existsSync(e)?e:null}else{let t=Ds.default.join("Mozilla Firefox","firefox.exe"),e=[process.env.LOCALAPPDATA,process.env.PROGRAMFILES,process.env["PROGRAMFILES(X86)"]];for(let r of e)if(r){let n=Ds.default.join(r,t);if(Ze.default.existsSync(n))return n}let s=["C:\\Program Files\\Mozilla Firefox\\firefox.exe","C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"];for(let r of s)if(Ze.default.existsSync(r))return r;return null}}var Ls=ml();var gc=a(require("path")),Is=a(require("fs")),Fr=a(require("firefox-profile"));var ul={"app.update.enabled":!1,"browser.dom.window.dump.enabled":!0,"browser.formfill.enable":!1,"browser.link.open_newwindow":3,"browser.sessionstore.enabled":!1,"browser.shell.checkDefaultBrowser":!1,"browser.sync.enabled":!1,"browser.startup.page":0,"browser.startup.homepage_welcome_url":"about:blank","browser.startup.homepage_welcome_url_additional":"about:blank","browser.urlbar.suggest.bookmark":!1,"browser.urlbar.suggest.clipboard":!1,"browser.urlbar.suggest.history":!1,"browser.urlbar.suggest.openpage":!1,"browser.urlbar.suggest.remotetab":!1,"browser.urlbar.suggest.searches":!1,"browser.urlbar.suggest.topsites":!1,"browser.urlbar.suggest.engines":!1,"browser.urlbar.suggest.calculator":!1,"browser.urlbar.suggest.recentsearches":!1,"datareporting.policy.dataSubmissionEnabled":!1,"datareporting.policy.firstRunURL":"","devtools.browserconsole.contentMessages":!0,"devtools.chrome.enabled":!0,"devtools.debugger.prompt-connection":!1,"devtools.debugger.remote-enabled":!0,"devtools.errorconsole.enabled":!0,"extensions.installDistroAddons":!1,"extensions.autoDisableScopes":10,"extensions.chrome.enabled":!0,"extensions.logging.enabled":!1,"extensions.checkCompatibility.nightly":!1,"extensions.update.enabled":!1,"extensions.update.notifyUser":!1,"extensions.enabledScopes":5,"extensions.getAddons.cache.enabled":!1,"network.prefetch.next":!1,"network.speculative.preconnect.enabled":!1,"toolkit.telemetry.enabled":!1,"toolkit.telemetry.archive.enabled":!1,"toolkit.telemetry.newProfilePing.enabled":!1,"toolkit.recovery.enabled":!1,"urlclassifier.updateinterval":172800,"security.enterprise_roots.enabled":!0,"xpinstall.signatures.required":!1};function dc(t){return{...ul,...t}}function hc(t,e){let s=dc(e);Object.keys(s).forEach(i=>{t.setPreference(i,s[i])});let n=Object.keys(e);return n.length>0&&n.forEach(i=>{t.setPreference(i,e[i])}),t.updatePreferences(),t}function dl(t,e){let s=new Fr.default({destinationDirectory:t});return hc(s,e)}function gl(t,e,s){let r;if(Is.default.statSync(e).isDirectory())r=e;else throw new Error(Ya(t,e));let i=new Fr.default({destinationDirectory:r});return hc(i,s)}function yc(t,e,s,r){let n,i=e||gc.default.resolve(__dirname,"run-firefox-data-dir");return Is.default.existsSync(i)?n=gl(t,i,s||{}):(r||Fs($s(t),()=>{}),Is.default.mkdirSync(i,{recursive:!0}),n=dl(i,s||{})),n}async function bc(t,e){let{browser:s,startingUrl:r,preferences:n,userDataDir:i,browserConsole:o=!1,browserFlags:c=[]}=e,p=yc(s,i,n),l=[];r&&l.push(`--url "${r}"`),o&&l.push("--jsconsole"),c&&l.push(...c);let m=t.options.devServer?.port?t.options.devServer?.port+100:9222;return[`--binary-args "${c.join(" ")}"`,`--profile "${p.path()}"`,`--listen ${m}`,"--verbose"].join(" ")}var Sc=a(require("path"));var wc=a(require("net")),xc=a(require("events"));function hl(t,e){let s=e.toString(),r=s.indexOf(":");if(r<1)return{remainingData:e};let n=parseInt(s.substring(0,r),10);if(isNaN(n))return{remainingData:e,error:new Error(Ka(t)),fatal:!0};if(e.length-(r+1)<n)return{remainingData:e};let i=e.slice(r+1,r+1+n),o=e.slice(r+1+n);try{let c=JSON.parse(i.toString());return{remainingData:o,parsedMessage:c}}catch(c){return{remainingData:o,error:c,fatal:!1}}}var Os=class extends xc.default{incomingData=Buffer.alloc(0);pendingRequests=[];activeRequests=new Map;connection;async connect(e){await new Promise((s,r)=>{try{let n={port:e,host:"127.0.0.1"},i=wc.default.createConnection(n,()=>{s()});this.connection=i,i.on("data",this.onData.bind(this)),i.on("error",r),i.on("end",this.onEnd.bind(this)),i.on("timeout",this.onTimeout.bind(this)),this.expectReply("root",{resolve:s,reject:r})}catch(n){r(n)}})}disconnect(){this.connection&&(this.connection.removeAllListeners(),this.connection.end(),this.rejectAllRequests(new Error(Qa("firefox"))))}rejectAllRequests(e){this.activeRequests.forEach(s=>{s.reject(e)}),this.activeRequests.clear(),this.pendingRequests.forEach(({deferred:s})=>{s.reject(e)}),this.pendingRequests=[]}async request(e){let s=typeof e=="string"?{to:"root",type:e}:e;if(!s.to)throw new Error(ec("firefox",s.type));return await new Promise((r,n)=>{let i={resolve:r,reject:n};this.pendingRequests.push({request:s,deferred:i}),this.flushPendingRequests()})}flushPendingRequests(){this.pendingRequests=this.pendingRequests.filter(({request:e,deferred:s})=>{if(this.activeRequests.has(e.to))return!0;if(!this.connection)throw new Error(tc("firefox"));try{let r=`${Buffer.from(JSON.stringify(e)).length}:${JSON.stringify(e)}`;this.connection.write(r),this.expectReply(e.to,s)}catch(r){s.reject(r)}return!1})}expectReply(e,s){if(this.activeRequests.has(e))throw new Error(sc("firefox",e));this.activeRequests.set(e,s)}onData(e){for(this.incomingData=Buffer.concat([this.incomingData,e]);this.readMessage(););}readMessage(){let{remainingData:e,parsedMessage:s,error:r,fatal:n}=hl("firefox",this.incomingData);return this.incomingData=e,r?(this.emit("error",new Error(rc("firefox",r))),n&&this.disconnect(),!n):s?(this.handleMessage(s),!0):!1}handleMessage(e){if(!e.from){this.emit("error",new Error(nc("firefox",e)));return}let s=this.activeRequests.get(e.from);s?(this.activeRequests.delete(e.from),e.error?s.reject(e):s.resolve(e),this.flushPendingRequests()):this.emit("error",new Error(ic("firefox",JSON.stringify(e))))}onError(e){this.emit("error",e)}onEnd(){this.emit("end")}onTimeout(){this.emit("timeout")}};function vc(t){return t instanceof Error?String(t):`${t.error}: ${t.message}`}function _c(t,e){return Array.isArray(t)&&t.includes(e.code)?!0:e.code===t}var yl=150,bl=1e3,Ms=class{options;constructor(e){this.options=e}async connectClient(e){let s;for(let r of Array.from({length:yl}))try{let n=new Os;return await n.connect(e),n}catch(n){if(_c("ECONNREFUSED",n))await new Promise(i=>setTimeout(i,bl)),s=n;else throw console.error(Ga(this.options.browser,n.stack)),n}throw console.error(Xa(this.options.browser)),s}async installAddons(e){let{devtools:s}=this.options,r=Array.isArray(this.options.extension)?this.options.extension:[this.options.extension],n=e.options.devServer?.port,i=n?n+100:9222,o=await this.connectClient(i);for(let[c,p]of r.entries()){let l=Sc.default.join(p.replace(/"/g,"")),m=c===0&&s;try{let d=await o.request({to:"root",type:"getRoot"});await o.request({to:d.addonsActor,type:"installTemporaryAddon",addonPath:l,openDevTools:m})}catch(d){let g=vc(d);throw new Error(Za(this.options.browser,g))}}}};var re=null;process.on("SIGINT",()=>{re&&re.kill("SIGINT"),process.exit()});process.on("SIGTERM",()=>{re&&re.kill("SIGTERM"),process.exit()});var As=class{extension;browser;browserFlags;userDataDir;profile;preferences;startingUrl;autoReload;stats;constructor(e){this.extension=e.extension,this.browser=e.browser||"firefox",this.browserFlags=e.browserFlags||[],this.userDataDir=e.userDataDir,this.profile=e.profile,this.preferences=e.preferences,this.startingUrl=e.startingUrl}async getFxRunnerCommand(){let e=Pc.default.join(process.cwd(),"node_modules",".bin","fx-runner"),s=ae()?"pnpm dlx -y fx-runner":"npx -y fx-runner";if(Dr.default.existsSync(e))return e;try{return await new Promise((r,n)=>{(0,Lr.exec)(`${s} --version`,i=>{i?n(i):r(null)})}),s}catch{console.error(Ge("firefox",e)),process.exit(1)}}async launchFirefox(e){let r=`${await this.getFxRunnerCommand()} start --binary "${Ls}" --foreground --no-remote`;Dr.default.existsSync(Ls||"")||(console.error(Ge(this.browser,Ls||"")),process.exit(1));let n=await bc(e,this),i=`${r} ${n}`;re=(0,Lr.exec)(i,(c,p,l)=>{if(c!=null)throw c;l.includes("Unable to move the cache")?console.log(Ja(this.browser)):(console.log(za(this.browser)),process.exit())}),process.env.EXTENSION_ENV==="development"&&(re.stdout?.pipe(process.stdout),re.stderr?.pipe(process.stderr));let o=new Ms(this);try{await o.installAddons(e)}catch(c){c?.toString()?.includes("background.service_worker is currently disabled")&&(console.error(Ha(this.browser)),process.exit(1)),console.error(Va(this.browser,c)),process.exit(1)}}apply(e){let s=!1;e.hooks.done.tapAsync("run-firefox:module",async(r,n)=>{if(r.compilation.errors.length>0){n();return}if(s){n();return}setTimeout(()=>{console.log(Cs(this.browser,r.compilation.options.mode))},2e3),await this.launchFirefox(e),s=!0,n()})}};var Rs=class{static name="plugin-browsers";extension;browser;browserFlags;userDataDir;profile;preferences;startingUrl;constructor(e){this.extension=[...e.extension,...e.browserFlags?.filter(s=>!s.startsWith("--load-extension="))||[]],this.browser=e.browser,this.browserFlags=e.browserFlags?.filter(s=>!s.startsWith("--load-extension="))||[],this.userDataDir=e.userDataDir,this.profile=e.profile||"",this.preferences=e.preferences||{},this.startingUrl=e.startingUrl||""}getProfilePath(e,s,r){return r||(e.options.mode==="production"?Ir.default.join(kc.default.tmpdir(),"extension-js",s,"profile"):Ir.default.resolve(__dirname,`run-${s}-profile`))}apply(e){let s={stats:!0,extension:this.extension,browser:this.browser,browserFlags:this.browserFlags||[],userDataDir:this.getProfilePath(e,this.browser,this.userDataDir||this.profile)};switch(this.browser){case"chrome":{new _e({...s,browser:"chrome"}).apply(e);break}case"edge":new _e({...s,browser:"edge"}).apply(e);break;case"firefox":new As({...s,browser:"firefox"}).apply(e);break;default:{new _e({...s,browser:this.browser}).apply(e);break}}}};function J(t,e){let s=Ye.default.join(t,"manifest.json"),r=Ye.default.join(t,`dist/${e.browser}`),n=require(s);return{mode:e.mode||"development",entry:{},target:"web",context:t,devtool:n.manifest_version===3?"cheap-source-map":"eval-cheap-source-map",output:{clean:{keep(i){return!i.startsWith("hot/background")}},path:r,publicPath:"/",hotUpdateChunkFilename:"hot/[id].[fullhash].hot-update.js",hotUpdateMainFilename:"hot/[runtime].[fullhash].hot-update.json",environment:{bigIntLiteral:!0,dynamicImport:!0}},resolve:{modules:["node_modules",Ye.default.join(t,"node_modules")],extensions:[".js",".mjs",".jsx",".ts",".mts",".tsx",".json",".wasm",".less",".css",".sass",".scss"]},watchOptions:{ignored:/node_modules|dist/},module:{rules:[]},plugins:[new ot({manifestPath:s}),new gt({manifestPath:s,mode:e.mode}),new dt({manifestPath:s,mode:e.mode}),new xt({manifestPath:s,mode:e.mode}),process.env.EXTENSION_ENV==="development"&&new js({manifestPath:s,browser:e.browser}),new Ss({manifestPath:s,browser:e.browser,polyfill:e.polyfill}),new ds({manifestPath:s,browser:e.browser,mode:e.mode}),new ws({manifestPath:s,browser:e.browser,stats:!0,port:e.port||8e3}),!e.noOpen&&new Rs({extension:[r,Ye.default.join(__dirname,"extensions",`${e.browser}-manager-extension`)],browser:e.browser,startingUrl:e.startingUrl,profile:e.profile||e.userDataDir,preferences:e.preferences,browserFlags:e.browserFlags})].filter(Boolean),stats:{all:!1,errors:!0,warnings:!0},infrastructureLogging:{level:"none"},performance:{hints:!1,maxAssetSize:999e3,maxEntrypointSize:999e3},optimization:{minimize:e.mode==="production"},experiments:{asyncWebAssembly:!0}}}var Qe=a(require("path")),sp=a(require("go-git-it"));var Ke=a(require("path")),Ns=a(require("fs")),u=require("@colors/colors/safe");function _(t){return`${t==="warn"?(0,u.brightYellow)("\u25BA\u25BA\u25BA"):t==="info"?(0,u.cyan)("\u25BA\u25BA\u25BA"):t==="error"?`${(0,u.bold)((0,u.red)("ERROR"))} in Extension.js ${(0,u.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:(0,u.brightGreen)("\u25BA\u25BA\u25BA")}`}function Y(t){return`${_("error")} Manifest file not found.
|
|
128
128
|
|
|
129
129
|
Ensure the path to your extension exists and try again.
|
|
130
|
-
${(0,u.red)("NOT FOUND")} ${(0,u.underline)(t)}`}function Ts(t){let e=t==="firefox"?"Add-on":"Extension";return`${_("info")} Building ${ne(t)} ${e} package...`}function qs(t,e){let s=
|
|
130
|
+
${(0,u.red)("NOT FOUND")} ${(0,u.underline)(t)}`}function Ts(t){let e=t==="firefox"?"Add-on":"Extension";return`${_("info")} Building ${ne(t)} ${e} package...`}function qs(t,e){let s=Ke.default.join(t,"dist",e.browser||"chrome"),r=Ke.default.join(s,"manifest.json"),n=require(r),{name:i,version:o,hostPermissions:c,permissions:p}=n,l=Ec(t,n).defaultLocale,m=Ec(t,n).otherLocales.join(", "),d=`${l} ${m&&", "+m}`,g=c&&c.length,y=p&&p.length,E=Js().version;return`
|
|
131
131
|
\u{1F9E9} ${(0,u.brightGreen)("Extension.js")} ${(0,u.gray)(`${E}`)}
|
|
132
132
|
Extension Name ${(0,u.gray)(i)}
|
|
133
133
|
Extension Version ${(0,u.gray)(o)}
|
|
134
134
|
Locales ${(0,u.gray)(d)}
|
|
135
135
|
Host Permissions ${(0,u.gray)(g?c.join(", "):"Browser defaults")}
|
|
136
136
|
Permissions ${(0,u.gray)(y?p.join(", "):"Browser defaults")}
|
|
137
|
-
`}function
|
|
137
|
+
`}function jc(t,e){let s=t==="production"?u.brightBlue:u.brightBlue,r=e==="firefox"?"Add-on":"Extension";return`${_("success")} ${ne(e)} ${r} ready for ${s(t||"unknown")}.`}function $c(t,e,s){let r=e?.toJson(),n=Ke.default.join(t,"manifest.json"),i=JSON.parse(Ns.default.readFileSync(n,"utf8")),o=r?.assets,c=`${_("info")} Building ${(0,u.cyan)(i.name)} extension using ${ne(s)} defaults...
|
|
138
138
|
|
|
139
139
|
`,p=`
|
|
140
140
|
Build completed in ${((r?.time||0)/1e3).toFixed(2)} seconds.`,l=`Build Target: ${(0,u.gray)(ne(s))}
|
|
141
141
|
`,m=`Build Status: ${e?.hasErrors()?(0,u.red)("Failed"):(0,u.brightGreen)("Success")}
|
|
142
142
|
`,d=`
|
|
143
143
|
Version: ${(0,u.gray)(i.version)}
|
|
144
|
-
`,g=`Size: ${(0,u.gray)(
|
|
145
|
-
`,y="";return y+=c,y+=
|
|
146
|
-
${(0,u.gray)("URL")} ${(0,u.underline)(`https://github.com/${t}/${e}`)}`}function
|
|
144
|
+
`,g=`Size: ${(0,u.gray)(wl(o))}
|
|
145
|
+
`,y="";return y+=c,y+=xl(o),y+=d,y+=g,y+=l,y+=m,y+=p,y}function Cc(){return`${_("success")} No errors or warnings found. Your extension is ${(0,u.brightGreen)("ready for deployment")}.`}function Fc(t,e){return`${_("info")} Fetching data...
|
|
146
|
+
${(0,u.gray)("URL")} ${(0,u.underline)(`https://github.com/${t}/${e}`)}`}function Dc(t){return`${_("info")} Downloading ${(0,u.cyan)(t)}...`}function Lc(t){return`
|
|
147
147
|
${_("info")} Creating a new browser extension...
|
|
148
|
-
${(0,u.gray)("PATH")} ${(0,u.underline)(`${t}`)}`}function
|
|
149
|
-
${(0,u.gray)("PATH")} ${(0,u.underline)(t)}`}function
|
|
150
|
-
${(0,u.gray)("PATH")} ${(0,u.underline)(t)}.`}function
|
|
151
|
-
${(0,u.gray)("PATH")} ${(0,u.underline)(t)}`}function
|
|
148
|
+
${(0,u.gray)("PATH")} ${(0,u.underline)(`${t}`)}`}function Ic(t){return`${_("info")} No ${(0,u.brightYellow)(".gitignore")} found, zipping all the content inside path:
|
|
149
|
+
${(0,u.gray)("PATH")} ${(0,u.underline)(t)}`}function Oc(t){return`${_("info")} Packaging source files. Files in ${(0,u.brightYellow)(".gitignore")} will be excluded...
|
|
150
|
+
${(0,u.gray)("PATH")} ${(0,u.underline)(t)}.`}function Mc(t){return`${_("info")} Packaging extension distribution files...
|
|
151
|
+
${(0,u.gray)("PATH")} ${(0,u.underline)(t)}`}function Ac(t,e,s,r){return`\u{1F4E6} Package name: ${(0,u.brightYellow)(`${e}`)}, Target Browser: ${`${ne(t)}`}
|
|
152
152
|
${(0,u.gray)("\u2514\u2500")} ${(0,u.underline)(`${s}`)} (source)
|
|
153
|
-
${(0,u.gray)("\u2514\u2500")} ${(0,u.underline)(`${r}`)} (distribution)`}function
|
|
154
|
-
${(0,u.gray)("\u2514\u2500")} ${(0,u.underline)(`${r}`)} ${(0,u.gray)("(distribution)")}`}function
|
|
155
|
-
${(0,u.gray)("\u2514\u2500")} ${(0,u.underline)(`${r}`)} (source)`}function
|
|
156
|
-
${(0,u.red)(t)}`}function
|
|
157
|
-
${(0,u.red)(t)}`}function
|
|
158
|
-
${(0,u.gray)("URL")} ${(0,u.underline)(t)}`}function
|
|
159
|
-
${(0,u.gray)("PATH")} ${(0,u.underline)(t)}`}function
|
|
160
|
-
`,typeof t[r]=="object"&&!t[r].size&&(s+=
|
|
161
|
-
${
|
|
153
|
+
${(0,u.gray)("\u2514\u2500")} ${(0,u.underline)(`${r}`)} (distribution)`}function Rc(t,e,s,r){return`\u{1F4E6} Package name: ${(0,u.brightYellow)(`${t}.${e}`)}, Target Browser: ${`${ne(s)}`}
|
|
154
|
+
${(0,u.gray)("\u2514\u2500")} ${(0,u.underline)(`${r}`)} ${(0,u.gray)("(distribution)")}`}function Nc(t,e,s,r){return`\u{1F4E6} Package name: ${(0,u.brightYellow)(`${t}-source.${e}`)}, Target Browser: ${`${ne(s)}`}
|
|
155
|
+
${(0,u.gray)("\u2514\u2500")} ${(0,u.underline)(`${r}`)} (source)`}function Tc(t){return`${_("error")} Failed to compress extension package.
|
|
156
|
+
${(0,u.red)(t)}`}function qc(t){return`${_("info")} Writing type definitions for ${(0,u.cyan)(t.name||"")}...`}function Uc(t){return`${_("error")} Failed to write the extension type definition.
|
|
157
|
+
${(0,u.red)(t)}`}function Wc(t){return`${_("info")} Downloading extension...
|
|
158
|
+
${(0,u.gray)("URL")} ${(0,u.underline)(t)}`}function Bc(t){return`${_("info")} Unpackaging browser extension...
|
|
159
|
+
${(0,u.gray)("PATH")} ${(0,u.underline)(t)}`}function Jc(){return`${_("info")} Browser extension unpackaged ${(0,u.brightGreen)("successfully")}. Compiling...`}function zc(t){return`${_("error")} Failed to download or extract ZIP file. ${(0,u.red)(t)}`}function ne(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Ec(t,e){let s=e.default_locale,r=Ke.default.join(t,"_locales");if(!Ns.default.existsSync(r))return{defaultLocale:"Browser defaults",otherLocales:[]};let n=Ns.default.readdirSync(r).filter(i=>i!==s);return{defaultLocale:s,otherLocales:n}}function Hc(t){return`${(t/1024).toFixed(2)}KB`}function wl(t){let e=0;return t?.forEach(s=>{e+=s.size}),Hc(e)}function Vc(t,e=""){let s="";return Object.keys(t).forEach((r,n,i)=>{let o=n===i.length-1,c=o?"\u2514\u2500":"\u251C\u2500",p=t[r].size?` (${Hc(t[r].size)})`:"";s+=`${(0,u.gray)(e)}${(0,u.gray)(c)} ${r}${(0,u.gray)(p)}
|
|
160
|
+
`,typeof t[r]=="object"&&!t[r].size&&(s+=Vc(t[r],`${e}${o?" ":(0,u.gray)("\u2502 ")}`))}),s}function xl(t){let e={};return t?.forEach(s=>{let r=s.name.split("/"),n=e;r.forEach((i,o)=>{n[i]||(n[i]={}),o===r.length-1?n[i]={size:s.size}:n=n[i]})}),`.
|
|
161
|
+
${Vc(e)}`}function Gc(t){return`${_("info")} Using ${(0,u.brightYellow)(t)}. ${(0,u.magenta)("This is very experimental")}.`}function Xc(t){return`${_("info")} Installing ${(0,u.cyan)(t)} dependencies...`}function Zc(t,e,s){return`${_("error")} Command ${t} ${e.join(" ")} failed with exit code ${s}`}function Yc(t){return`${_("error")} Can't install project dependencies. ${(0,u.red)(t.message||t.toString())}`}var Us=a(require("path")),Kc=a(require("axios")),Qc=a(require("adm-zip"));var Or=a(require("stream")),ep=require("util"),vl=(0,ep.promisify)(Or.default.pipeline);async function tp(t,e){let s=t.split("?")[0];try{console.log(Wc(s));let r=await(0,Kc.default)({url:t,method:"GET",responseType:"stream"}),n=Us.default.extname(s),i=Us.default.basename(s,n),o=Us.default.join(e,i);console.log(Bc(o));let c=[];await vl(r.data,new Or.default.Writable({write(m,d,g){c.push(m),g()}}));let p=Buffer.concat(c);return new Qc.default(p).extractAllTo(o,!0),console.log(Jc()),o}catch(r){throw console.error(zc(r)),r}}var _l=t=>{try{return new URL(t),!0}catch{return!1}};async function Sl(t,e){return await(0,sp.default)(t,process.cwd(),e),Qe.default.resolve(process.cwd(),Qe.default.basename(t))}async function Pl(t){return await tp(t,process.cwd())}async function K(t){if(!t)return process.cwd();if(_l(t)){let e=new URL(t);if(e.protocol.startsWith("http")){if(e.origin!=="https://github.com")return await Pl(t);let s=e.pathname.split("/"),r=s.slice(1,3)[0],n=s.slice(1,3)[1];console.log(Fc(r,n));let i=Qe.default.basename(e.pathname),o=await Sl(t,Dc(i));return console.log(Lc(i)),o}}return Qe.default.resolve(process.cwd(),t)}var z=a(require("path")),rp=a(require("fs")),np=a(require("ignore")),ip=a(require("tiny-glob")),Mr=a(require("adm-zip")),op=a(require("slugify"));function kl(t){try{return rp.default.readFileSync(t,"utf8")}catch{return""}}function El(t){return(0,op.default)(t,{replacement:"-",remove:/[^a-zA-Z0-9 ]/g,lower:!0})}function jl(t){switch(t){case"opera":return"crx";case"firefox":return"xpi";default:return"zip"}}function $l(t,e){let s=El(e.zipFilename||t.name);return e.zipFilename?s:`${s}-${t.version}`}async function Cl(t){let e=z.default.join(t,".gitignore"),s=kl(e),r=(0,np.default)();return s?r.add(s):console.log(Ic(t)),(await(0,ip.default)("**/*",{cwd:t,dot:!0})).filter(i=>!r.ignores(i))}async function ap(t,{browser:e="chrome",...s}){try{let r=z.default.join(t,"dist"),n=z.default.join(r,e),i=s.zipSource?t:n,o=require(z.default.join(i,"manifest.json")),c=$l(o,s),p=jl(e),l=z.default.join(n,`${c}.${p}`),m=z.default.join(r,`${c}-source.${p}`);if(s.zipSource){console.log(""),console.log(Oc(m));let d=new Mr.default;(await Cl(t)).forEach(y=>{d.addLocalFile(z.default.join(t,y),z.default.dirname(y))}),d.writeZip(m)}if(s.zip){console.log(""),console.log(Mc(l));let d=new Mr.default;d.addLocalFolder(n),d.writeZip(l)}s.zip&&s.zipSource?(console.log(""),console.log(Ac(e,c,m,l))):s.zip?(console.log(""),console.log(Rc(c,p,e,l))):s.zipSource&&(console.log(""),console.log(Nc(c,p,e,m)))}catch(r){throw console.error(Tc(r)),r}}var Ar=a(require("fs")),Rr=a(require("path"));function Q(t){let e=Rr.default.join(t,"extension.config.js");if(Ar.default.existsSync(e)&&Fl(t)){let s=require(e);if(s&&s!=null&&s&&typeof s.config=="function")return s.config}return s=>s}function Fl(t){let e=Rr.default.join(t,"extension.config.js");return Ar.default.existsSync(e)?(console.log(Gc("extension.config.js")),!0):!1}async function fp(t,e){let s=await K(t);!t?.startsWith("http")&&!cp.default.existsSync(Nr.default.join(s,"manifest.json"))&&(console.log(Y(Nr.default.join(s,"manifest.json"))),process.exit(1));try{let r=e?.browser||"chrome",n=J(s,{...e,browser:r,mode:"production"}),i=n.plugins?.filter(m=>m?.constructor.name!=="plugin-browsers"&&m?.constructor.name!=="plugin-reload"),c=Q(s)({...n,plugins:i}),p=(0,lp.merge)(c),l=(0,pp.default)(p);await new Promise((m,d)=>{l.run(async(g,y)=>{if(g)return console.error(g.stack||g),d(g);console.log($c(s,y,r)),(e?.zip||e?.zipSource)&&await ap(s,{...e,browser:r}),y?.hasErrors()?(console.log(y.toString({colors:!0})),process.exit(1)):(console.log(Cc()),m())})})}catch(r){process.env.EXTENSION_ENV==="development"&&console.error(r),process.exit(1)}}var Ur=a(require("fs")),Bs=a(require("path"));var qr=a(require("path")),mp=a(require("webpack")),up=a(require("webpack-dev-server")),dp=require("webpack-merge");function Tr(t){t.stop().then(()=>{process.exit()}).catch(e=>{console.log(`Error in the Extension.js runner: ${e.stack||""}`)})}async function gp(t,{...e}){let s=J(t,{...e,mode:"development"}),n=Q(t)(s),i=(0,dp.merge)(n),o=(0,mp.default)(i),c={host:"127.0.0.1",allowedHosts:"all",static:qr.default.join(t,"public"),compress:!1,devMiddleware:{writeToDisk:!0},watchFiles:ct(t)?void 0:{paths:[qr.default.join(t,"**/*.html")],options:{usePolling:!0,interval:1e3}},client:{logging:process.env.EXTENSION_ENV==="development"?"error":"none",progress:!1,overlay:!1},headers:{"Access-Control-Allow-Origin":"*"},port:"auto",hot:"only"},p=new up.default(c,o);p.startCallback(l=>{l!=null&&console.log(`Error in the Extension.js runner: ${l.stack||""}`)}),process.on("ERROR",()=>{Tr(p)}),process.on("SIGINT",()=>{Tr(p)}),process.on("SIGTERM",()=>{Tr(p)})}var Ws=a(require("path")),Se=a(require("fs/promises"));async function hp(t){let e=Ws.default.join(t,"extension-env.d.ts"),s=process.env.EXTENSION_ENV==="development"?Ws.default.resolve(process.cwd(),"programs/cli/types"):"extension/dist/types",r=`// Required Extension.js types for TypeScript projects.
|
|
162
162
|
// This file is auto-generated and should not be excluded.
|
|
163
163
|
// If you need additional types, consider creating a new *.d.ts file and
|
|
164
164
|
// referencing it in the "include" array of your tsconfig.json file.
|
|
@@ -167,4 +167,4 @@ ${Hc(e)}`}function Vc(t){return`${_("info")} Using ${(0,u.brightYellow)(t)}. ${(
|
|
|
167
167
|
|
|
168
168
|
// Polyfill types for browser.* APIs.
|
|
169
169
|
/// <reference types="${s}/polyfill.d.ts" />
|
|
170
|
-
`;try{await Se.default.access(e),(await Se.default.readFile(e,"utf8")).includes("develop/dist/types")&&await Se.default.writeFile(e,r),process.env.EXTENSION_ENV==="development"&&await Se.default.writeFile(e,r)}catch{let i=require(Ws.default.join(t,"manifest.json"));console.log(
|
|
170
|
+
`;try{await Se.default.access(e),(await Se.default.readFile(e,"utf8")).includes("develop/dist/types")&&await Se.default.writeFile(e,r),process.env.EXTENSION_ENV==="development"&&await Se.default.writeFile(e,r)}catch{let i=require(Ws.default.join(t,"manifest.json"));console.log(qc(i));try{await Se.default.writeFile(e,r)}catch(o){console.log(Uc(o))}}}var yp=a(require("path")),bp=require("cross-spawn"),wp=a(require("fs")),xp=require("package-manager-detector");async function Dl(){let t=await(0,xp.detect)(),e="npm";if(ae())return"pnpm";switch(t?.name){case"yarn":e="yarn";break;case"pnpm":e="pnpm";break;default:e="npm"}return e}function Ll(){return["install"]}async function vp(t){let e=yp.default.join(t,"node_modules"),s=await Dl(),r=Ll(),n=process.cwd();try{process.chdir(t),await wp.default.promises.mkdir(e,{recursive:!0});let i=process.env.EXTENSION_ENV==="development"?"inherit":"ignore",o=(0,bp.spawn)(s,r,{stdio:i});await new Promise((c,p)=>{o.on("close",l=>{l!==0?p(new Error(Zc(s,r,l))):c()}),o.on("error",l=>{p(l)})})}catch(i){console.error(Yc(i)),process.exit(1)}finally{process.chdir(n)}}async function _p(t,e){let s=await K(t),r=Bs.default.join(s,"manifest.json");!t?.startsWith("http")&&!Ur.default.existsSync(r)&&(console.log(Y(Bs.default.join(s,"manifest.json"))),process.exit(1));try{G(s)&&await hp(s);let n=Bs.default.join(s,"node_modules");if(!Ur.default.existsSync(n)){let i=require(r).name;console.log(Xc(i)),await vp(s)}setTimeout(async()=>{await gp(s,{...e,mode:"development",browser:e.browser||"chrome"})},50)}catch(n){process.env.EXTENSION_ENV==="development"&&console.error(n),process.exit(1)}}var Sp=a(require("fs")),Wr=a(require("path")),Pp=a(require("webpack")),kp=require("webpack-merge");async function Ep(t,e){let s=await K(t);!t?.startsWith("http")&&!Sp.default.existsSync(Wr.default.join(s,"manifest.json"))&&(console.log(Y(Wr.default.join(s,"manifest.json"))),process.exit(1));try{let r=e.browser||"chrome",n=J(s,{...e,browser:r,mode:"production"}),i=n.plugins?.filter(m=>m?.constructor.name==="plugin-browsers");console.log(Ts(r));let c=Q(s)({...n,plugins:i}),p=(0,kp.merge)(c);(0,Pp.default)(p).run(async(m,d)=>{m&&(console.error(m.stack||m),process.exit(1)),d?.hasErrors()?(console.log(d.toString({colors:!0})),process.exit(1)):console.log(qs(s,{browser:r,mode:"production"}))})}catch(r){process.env.EXTENSION_ENV==="development"&&console.error(r),process.exit(1)}}var jp=a(require("fs")),Br=a(require("path")),$p=a(require("webpack")),Cp=require("webpack-merge");async function Fp(t,e){let s=await K(t);!t?.startsWith("http")&&!jp.default.existsSync(Br.default.join(s,"manifest.json"))&&(console.log(Y(Br.default.join(s,"manifest.json"))),process.exit(1));try{let r=e.browser||"chrome",n=J(s,{...e,browser:r,mode:"production"}),i=n.plugins?.filter(m=>m?.constructor.name!=="plugin-reload");console.log(Ts(r));let c=Q(s)({...n,plugins:i}),p=(0,Cp.merge)(c);(0,$p.default)(p).run((m,d)=>{m&&(console.error(m.stack||m),process.exit(1)),d?.hasErrors()?(console.log(d.toString({colors:!0})),process.exit(1)):(console.log(qs(s,e)),setTimeout(()=>{console.log(jc("production",r))},1500))})}catch(r){process.env.EXTENSION_ENV==="development"&&console.error(r),process.exit(1)}}0&&(module.exports={extensionBuild,extensionDev,extensionPreview,extensionStart});
|