import{lt as e,o as t,u as n}from"./vscode-api-DjORcpSo.js";import{f as r,g as i,v as a}from"./mention-item-C-utQkFh.js";import{t as o}from"./use-platform-D2c1wBYs.js";import{r as s,t as c}from"./get-file-icon-EMOLzufn.js";import{t as l}from"./skills-DzhgVcoJ.js";import{t as u}from"./mcp-BZLb22Sx.js";import{t as d}from"./get-skill-icon-XTFV6Q07.js";var f=`com.google.Chrome`,p=`Google Chrome`,m=`Chrome`,h=/^process:(?:.*[\\/])?chrome\.exe$/i,g=`chrome`,_=`Chrome`;function v(e){return e.find(e=>e.plugin.name===`computer-use`)??null}function y(e){return e.find(e=>e.plugin.name===`computer-use`&&e.plugin.installed&&e.plugin.enabled)??null}function b({mentionPath:e,mentionDisplayName:t,nativeApps:n,computerPlugin:r}){return T(e,r)?{isComputerUse:!0,nativeApp:w(n,t)}:{isComputerUse:!1,nativeApp:null}}function x({app:e,description:t,computerPlugin:n,iconSmall:r}){let i=S(e);return{kind:`plugin`,name:i,displayName:i,path:a(n.plugin.id),description:t??n.description??``,iconSmall:r??n.logoPath??``}}function S(e){return C(e)?_:e.displayName}function C(e){return e.bundleId===f&&e.displayName===p||e.bundleId===m&&e.displayName===p||h.test(e.bundleId)&&e.displayName.trim().toLowerCase()===g}function w(e,t){return t.length===0?null:e.find(e=>e.displayName===t||S(e)===t)??null}function T(e,t){return t==null?!1:e===a(t.plugin.id)}function E({path:e,matchType:t}){return t===`directory`?c.folder:c[s(e)]}function D(){return l}function O({label:e,path:t,plugins:n}){let r=e.trim().toLowerCase();if(t!=null&&t.length>0){let e=n.find(e=>a(e.plugin.id)===t);if(e!=null)return e}return n.find(e=>e.plugin.id.toLowerCase()===r||e.plugin.name.toLowerCase()===r||e.displayName?.toLowerCase()===r)}function k(e){return e.description??(e.marketplaceName||null)}function A(e,t){return r(e,t)}function j(e,t){let n=A(e,t);return d(null,{size:`small`,smallOnly:!0,iconSmall:i(e),basePath:n.path,fallbackName:n.name,fallbackDescription:n.description,fallbackIcon:u})}var M=e();function N(e){let r=(0,M.c)(9),{enabled:i}=e,{platform:a,isLoading:s}=o(),c=i&&(a===`macOS`||a===`windows`),l;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={order:`usage`},r[0]=l):l=r[0];let u;r[1]===c?u=r[2]:(u={params:l,queryConfig:{enabled:c,staleTime:n.FIVE_MINUTES,refetchOnWindowFocus:!1}},r[1]=c,r[2]=u);let d=t(`native-desktop-apps`,u),f;r[3]!==d||r[4]!==c?(f=c?d.data?.apps??[]:[],r[3]=d,r[4]=c,r[5]=f):f=r[5];let p=s||c&&d.isLoading,m;return r[6]!==f||r[7]!==p?(m={nativeApps:f,isLoading:p},r[6]=f,r[7]=p,r[8]=m):m=r[8],m}export{A as a,_ as c,S as d,x as f,j as i,v as l,b as m,O as n,E as o,C as p,k as r,D as s,N as t,y as u};
//# sourceMappingURL=use-native-apps.electron-JZTsXfme.js.map