{
  "version": 3,
  "sources": ["../src/image.ts"],
  "sourcesContent": ["/**\n * Use Cloudinary to create the `meta` tag image URL.\n *\n * @param opts `filename` should include the extension.\n */\nexport function MetaImage ({ cloudName, filename, text }:{\n    cloudName:string;\n    filename:string;\n    text?:string;\n}):string {\n    const baseUrl = `https://res.cloudinary.com/${cloudName}/image/upload/`\n\n    if (!text) {\n        // Simple case: no text, just fit the image\n        const imageTransformations = ['w_1200', 'h_627', 'c_fit', 'q_auto',\n            'f_auto'].join(',')\n        return `${baseUrl}${imageTransformations}/${filename}`\n    }\n\n    // Extract the public_id (filename without extension) for overlay reference\n    const publicId = filename.replace(/\\.[^/.]+$/, '')\n\n    // Canvas dimensions: 50px top + 500px image + 250px bottom = 800px total\n    const canvasHeight = 800\n    const topPadding = 50\n    const imageMaxHeight = 500\n\n    // 50 + 500 + 100 = 650\n    const textYPosition = topPadding + imageMaxHeight + 100\n\n    // Step 1: Fit the cube image to 1200x500\n    const fitImage = 'w_1200,h_500,c_fit,q_auto,f_auto'\n\n    // Step 2: Create white canvas (1200x800) as underlay and position the\n    // fitted image at y=50\n    // Use underlay with same image colored white to create the\n    // white background\n    const createCanvas = `u_${publicId},e_colorize:100,co_white,w_1200,` +\n        `h_${canvasHeight},c_fill/fl_layer_apply,g_north,y_-${topPadding}`\n\n    // Step 3: Add text overlay positioned in the white space at y=650, centered\n    const textOverlay = text ? `l_text:roboto_64:${encodeURIComponent(text)},` +\n        `co_black/fl_layer_apply,g_north,y_${textYPosition}/` : ''\n\n    const url = `${baseUrl}${fitImage}/${createCanvas}/` +\n        `${textOverlay}${filename}`\n    return url\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,SAAS,UAAW,EAAE,WAAW,UAAU,KAAK,GAI7C;AACN,QAAM,UAAU,8BAA8B,SAAS;AAEvD,MAAI,CAAC,MAAM;AAEP,UAAM,uBAAuB;AAAA,MAAC;AAAA,MAAU;AAAA,MAAS;AAAA,MAAS;AAAA,MACtD;AAAA,IAAQ,EAAE,KAAK,GAAG;AACtB,WAAO,GAAG,OAAO,GAAG,oBAAoB,IAAI,QAAQ;AAAA,EACxD;AAGA,QAAM,WAAW,SAAS,QAAQ,aAAa,EAAE;AAGjD,QAAM,eAAe;AACrB,QAAM,aAAa;AACnB,QAAM,iBAAiB;AAGvB,QAAM,gBAAgB,aAAa,iBAAiB;AAGpD,QAAM,WAAW;AAMjB,QAAM,eAAe,KAAK,QAAQ,qCACzB,YAAY,qCAAqC,UAAU;AAGpE,QAAM,cAAc,OAAO,oBAAoB,mBAAmB,IAAI,CAAC,sCAC9B,aAAa,MAAM;AAE5D,QAAM,MAAM,GAAG,OAAO,GAAG,QAAQ,IAAI,YAAY,IAC1C,WAAW,GAAG,QAAQ;AAC7B,SAAO;AACX;AA1CgB;",
  "names": []
}
