{"version":3,"file":"sfc-B9z9WArW.mjs","names":[],"sources":["../src/render-shared/sfc.ts"],"sourcesContent":["import { fromHtml } from 'hast-util-from-html'\n\nexport function normalizeSFCSource(source: string): string {\n  const hastRoot = fromHtml(source, { fragment: true })\n\n  const hasTemplate = hastRoot.children.some(node => node.type === 'element' && node.tagName === 'template')\n  const hasScript = hastRoot.children.some(node => node.type === 'element' && node.tagName === 'script')\n\n  if (!hasTemplate && !source) {\n    source = `${source}\\n<template><div /></template>`\n  }\n  if (!hasScript) {\n    source = `${source}\\n<script setup>/* EMPTY */</script>`\n  }\n\n  return source\n}\n"],"mappings":";;AAEA,SAAgB,mBAAmB,QAAwB;CACzD,MAAM,WAAW,SAAS,QAAQ,EAAE,UAAU,MAAM,CAAC;CAErD,MAAM,cAAc,SAAS,SAAS,MAAK,SAAQ,KAAK,SAAS,aAAa,KAAK,YAAY,WAAW;CAC1G,MAAM,YAAY,SAAS,SAAS,MAAK,SAAQ,KAAK,SAAS,aAAa,KAAK,YAAY,SAAS;AAEtG,KAAI,CAAC,eAAe,CAAC,OACnB,UAAS,GAAG,OAAO;AAErB,KAAI,CAAC,UACH,UAAS,GAAG,OAAO;AAGrB,QAAO"}