// TODO webp
const outputImage = (type, node, frms, arenaAttrs) => {
    const src = node.getAttribute('src');
    const alt = node.getAttribute('alt');
    const width = node.getAttribute('width');
    const height = node.getAttribute('height');
    const className = node.getAttribute('class');
    if (!src) {
        return '';
    }
    const srcset = (arenaAttrs.srcset || node.getAttribute('srcset'));
    const prepareSrc = arenaAttrs.prepareSrc;
    const resultSrc = prepareSrc ? prepareSrc(src, width, height) : src;
    const img = `<img src="${resultSrc}" alt="${alt}" class="${className}">`;
    if (srcset && prepareSrc) {
        const sources = srcset.map((item) => `<source media="${item.media}"
    srcset="${item.rations.map((r) => `${prepareSrc(src, r.width, r.height)} ${r.ratio}x`).join(', ')}"/>`).join('\n');
        return `
    <picture>
      ${sources}
      ${img}
    </picture>`;
    }
    return img;
};
export default outputImage;
//# sourceMappingURL=outputImage.js.map