import{mkdir as f}from"node:fs/promises";import d from"os";import p from"path";import{promises as l}from"node:fs";var v=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o,i;function m(){if(i)return o;i=1;const e=d,r=p;function a(n){const t=process.env.XDG_CACHE_HOME||r.join(e.homedir(),".cache");return r.join(t,n)}function c(n){return r.join(e.homedir(),"Library","Caches",n)}function s(n){const t=process.env.LOCALAPPDATA||r.join(e.homedir(),"AppData","Local");return r.join(t,n,"Cache")}const u=function(){switch(e.platform()){case"darwin":return c;case"win32":return s;case"aix":case"android":case"freebsd":case"linux":case"netbsd":case"openbsd":case"sunos":return a;default:return console.error(`(node:${process.pid}) [cachedir] Warning: the platform "${e.platform()}" is not currently supported by node-cachedir, falling back to "posix". Please file an issue with your platform here: https://github.com/LinusU/node-cachedir/issues/new`),a}}();return o=function(t){if(typeof t!="string")throw new TypeError("id is not a string");if(t.length===0)throw new Error("id cannot be empty");if(/[^0-9a-zA-Z-]/.test(t))throw new Error("id cannot contain special characters");return u(t)},o}var w=m();const y=h(w);async function b(e){try{return await l.access(e),!0}catch{return!1}}const A=async e=>{const r=y(e);return await g(r),r},g=async e=>{await b(e)||await f(e,{recursive:!0})};export{h as a,v as c,A as g};
//# sourceMappingURL=main-D3f0J5VR.js.map
