"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var r in e)__defProp(t,r,{get:e[r],enumerable:!0})},__copyProps=(t,e,r,o)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let n of __getOwnPropNames(e))__hasOwnProp.call(t,n)||n===r||__defProp(t,n,{get:()=>e[n],enumerable:!(o=__getOwnPropDesc(e,n))||o.enumerable});return t},__toESM=(t,e,r)=>(r=null!=t?__create(__getProtoOf(t)):{},__copyProps(!e&&t&&t.__esModule?r:__defProp(r,"default",{value:t,enumerable:!0}),t)),__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),extension_exports={};__export(extension_exports,{isPlaywrightExtensionInstalled:()=>isPlaywrightExtensionInstalled,playwrightExtensionId:()=>playwrightExtensionId,playwrightExtensionInstallUrl:()=>playwrightExtensionInstallUrl}),module.exports=__toCommonJS(extension_exports);var import_fs=__toESM(require("fs")),import_path=__toESM(require("path"));const playwrightExtensionId="mmlmfjhmonkocbjadbfplnigmagldckm",playwrightExtensionInstallUrl=`https://chromewebstore.google.com/detail/playwright-extension/${playwrightExtensionId}`;async function isPlaywrightExtensionInstalled(t){let e;try{e=await import_fs.default.promises.readdir(t)}catch{return!1}for(let r of e)if(("Default"===r||r.startsWith("Profile "))&&await isExtensionInstalledInProfile(import_path.default.join(t,r)))return!0;return!1}async function isExtensionInstalledInProfile(t){if(await pathExists(import_path.default.join(t,"Extensions",playwrightExtensionId)))return!0;try{return(await import_fs.default.promises.readFile(import_path.default.join(t,"Preferences"),"utf-8")).includes(`"${playwrightExtensionId}"`)}catch{return!1}}async function pathExists(t){try{return await import_fs.default.promises.access(t),!0}catch{return!1}}