import release from './public-release.json' with {type:'json'};
import hyperframes from './hyperframes-release.json' with {type:'json'};
export const remotionFilms=release.films.map(film=>({...film,renderer:'remotion'}));
export const hyperframesFilms=hyperframes.films;
export const productFilms=[...remotionFilms,...hyperframesFilms];
export const filmCount=productFilms.length;
export const filmTotalBytes=productFilms.reduce((sum,film)=>sum+film.bytes,0);
export const filmBundle=release.bundle;
export const filmBundleCount=remotionFilms.length;
const hyperframeAssets=new Set(hyperframes.assets.map(asset=>asset.name));
export const filmUrl=name=>{
  const key=name.replace(/^download-/,'');
  return (hyperframeAssets.has(key)?'/videos/hyperframes-films/':'/videos/product-films/')+key;
};
export const filmEngine=film=>film.renderer==='hyperframes'?'HyperFrames · GSAP':'Remotion · React';
export const filmSize=bytes=>(bytes/1e6).toFixed(2)+' MB';
