function e(e){let t=e.metadata?.emoji??e.frontmatter?.emoji,n=e.metadata?.homepage??e.frontmatter?.homepage??e.frontmatter?.website??e.frontmatter?.url,r=n?.trim()?n.trim():void 0;return{...t?{emoji:t}:{},...r?{homepage:r}:{}}}function t(e){let t=e.hasRemoteBin;return e.required.filter(n=>!(e.hasLocalBin(n)||t?.(n)))}function n(e){return e.required.length===0||e.required.some(t=>e.hasLocalBin(t))||e.hasRemoteAnyBin?.(e.required)?[]:e.required}function r(e){return e.required.length===0||e.required.includes(e.localPlatform)||e.remotePlatforms?.some(t=>e.required.includes(t))?[]:e.required}function i(e){let t=[];for(let n of e.required)e.isSatisfied(n)||t.push(n);return t}function a(e){return e.required.map(t=>({path:t,satisfied:e.isSatisfied(t)}))}function o(e){let o=t({required:e.required.bins,hasLocalBin:e.hasLocalBin,hasRemoteBin:e.hasRemoteBin}),s=n({required:e.required.anyBins,hasLocalBin:e.hasLocalBin,hasRemoteAnyBin:e.hasRemoteAnyBin}),c=r({required:e.required.os,localPlatform:e.localPlatform,remotePlatforms:e.remotePlatforms}),l=i({required:e.required.env,isSatisfied:e.isEnvSatisfied}),u=a({required:e.required.config,isSatisfied:e.isConfigSatisfied}),d=u.filter(e=>!e.satisfied).map(e=>e.path),f=e.always?{bins:[],anyBins:[],env:[],config:[],os:[]}:{bins:o,anyBins:s,env:l,config:d,os:c};return{missing:f,eligible:e.always||f.bins.length===0&&f.anyBins.length===0&&f.env.length===0&&f.config.length===0&&f.os.length===0,configChecks:u}}function s(e){let t={bins:e.metadata?.requires?.bins??[],anyBins:e.metadata?.requires?.anyBins??[],env:e.metadata?.requires?.env??[],config:e.metadata?.requires?.config??[],os:e.metadata?.os??[]};return{required:t,...o({always:e.always,required:t,hasLocalBin:e.hasLocalBin,hasRemoteBin:e.hasRemoteBin,hasRemoteAnyBin:e.hasRemoteAnyBin,localPlatform:e.localPlatform,remotePlatforms:e.remotePlatforms,isEnvSatisfied:e.isEnvSatisfied,isConfigSatisfied:e.isConfigSatisfied})}}function c(e){return s({always:e.always,metadata:e.metadata,hasLocalBin:e.hasLocalBin,hasRemoteBin:e.remote?.hasBin,hasRemoteAnyBin:e.remote?.hasAnyBin,localPlatform:e.localPlatform,remotePlatforms:e.remote?.platforms,isEnvSatisfied:e.isEnvSatisfied,isConfigSatisfied:e.isConfigSatisfied})}function l(t){let{emoji:n,homepage:r}=e({metadata:t.metadata,frontmatter:t.frontmatter}),{required:i,missing:a,eligible:o,configChecks:s}=c({always:t.always,metadata:t.metadata??void 0,hasLocalBin:t.hasLocalBin,localPlatform:t.localPlatform,remote:t.remote,isEnvSatisfied:t.isEnvSatisfied,isConfigSatisfied:t.isConfigSatisfied});return{...n?{emoji:n}:{},...r?{homepage:r}:{},required:i,missing:a,requirementsSatisfied:o,configChecks:s}}function u(e){return l({...e,localPlatform:process.platform})}function d(e){return u({always:e.always,metadata:e.entry.metadata,frontmatter:e.entry.frontmatter,hasLocalBin:e.hasLocalBin,remote:e.remote,isEnvSatisfied:e.isEnvSatisfied,isConfigSatisfied:e.isConfigSatisfied})}export{d as t};
