import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,p as n}from"./debug-otxXY3j-.js";import{o as r,r as i}from"./common-NEOWMwtB.js";import{c as a,s as o}from"./escHotkey-D8WgbSyj.js";import{i as s,n as c,r as l}from"./gates-C4JvRq4i.js";import{n as u,t as d}from"./executor-BVh1PTF-.js";import{format as f}from"util";function p(){try{return Bun.spawnSync({cmd:[`osascript`,`-e`,`tell application "System Events" to get name of every process whose background only is false`],stdout:`pipe`,stderr:`pipe`}).exitCode===0}catch{return!1}}function m(){try{return Bun.spawnSync({cmd:[`screencapture`,`-x`,`-R`,`0,0,1,1`,`/dev/null`],stdout:`pipe`,stderr:`pipe`}).exitCode===0}catch{return!1}}function h(){return _||(_={serverName:i,logger:new g,executor:d({getMouseAnimationEnabled:()=>l().mouseAnimation,getHideBeforeActionEnabled:()=>l().hideBeforeAction}),ensureOsPermissions:async()=>{if(process.platform!==`darwin`)return{granted:!0};let e=a().tcc;if(e){let t=e.checkAccessibility(),n=e.checkScreenRecording();return t&&n?{granted:!0}:{granted:!1,accessibility:t,screenRecording:n}}let t=p(),n=m();return t&&n?{granted:!0}:{granted:!1,accessibility:t,screenRecording:n}},isDisabled:()=>!c(),getSubGates:l,getAutoUnhideEnabled:()=>!0,cropRawPatch:()=>null},_)}var g,_,v=e((()=>{t(),r(),u(),s(),o(),g=class{silly(e,t){n(f(e,t??``),{level:`debug`})}debug(e,t){n(f(e,t??``),{level:`debug`})}info(e,t){n(f(e,t??``),{level:`info`})}warn(e,t){n(f(e,t??``),{level:`warn`})}error(e,t){n(f(e,t??``),{level:`error`})}}}));export{v as n,h as t};