var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`node:path`),l=require(`@intlayer/core/localization`),u=require(`@intlayer/core/transpiler`),d=require(`@intlayer/types/locales`);d=s(d);const f=d.ENGLISH,p=`https://github.com/aymericzip/intlayer/blob/main/docs`,m=`https://intlayer.org/`,h=e=>Object.keys(e),g=async(e,t=f)=>{let n=await Promise.all(Object.entries(e).map(([e,n])=>[e,n[t]]).map(async([e,t])=>[e,await t]));return Object.fromEntries(n)},_=async(e,t,n=f)=>{if(!e[t])throw Error(`File ${t} not found`);let r=await e[t]?.[n];if(!r){let n=await e[t][f];if(!n)throw Error(`File ${t} not found`);return n}return r},v=(e,t,n=f)=>{let r=(0,u.getMarkdownMetadata)(t),i=(r.slugs??[]).map(String),a=(r.keywords??[]).map(String),o=(0,c.join)(`/`,...i),s=e.slice(1);return{...r,docKey:e,slugs:i,keywords:a,githubUrl:`${p}${s}`.replace(`/en/`,`/${n}/`),relativeUrl:(0,l.getLocalizedUrl)(o,n),url:(0,l.getLocalizedUrl)((0,c.join)(m,o),n)}},y=async(e,t,n=f)=>v(t,await _(e,t,n),n),b=async(e,t=f)=>{let n=await Promise.all(Object.entries(e).map(async([n])=>[n,await y(e,n,t)]));return Object.fromEntries(n)},x=async(e,t,n=f,r=!1)=>{let i=Array.isArray(t)?t:[t],a=await b(e,f),o=Object.values(a).filter(e=>i.every(t=>e.slugs?.includes(t)));return r&&(o=o.filter(e=>e.slugs.length===i.length)),n===f?o:await Promise.all(o.map(async t=>await y(e,t.docKey,n)))},S=async(e,t,n=f,r=!1)=>{let i=Array.isArray(t)?t:[t],a=await b(e,f),o=Object.values(a).filter(e=>i.every(t=>e.slugs?.includes(t)));return r&&(o=o.filter(e=>e.slugs.length===i.length)),await Promise.all(o.map(async t=>await _(e,t.docKey,n)))};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return g}});
//# sourceMappingURL=common-a-l0ULP6.cjs.map