import{T as i,S as a}from"../server.mjs";import"vue";import"#internal/nitro";import"vue-router";const r=t=>{const e=[];for(const[o,s]of Object.entries(t)){if(s===!1||s==null)continue;let n=o;s!==!0&&(n+=`="${String(s).replace(/"/g,"&quot;")}"`),e.push(n)}return e.length>0?` ${e.join(" ")}`:""};function d(t){return t.replace(/[\u00A0-\u9999<>\&]/gim,e=>`&#${e.charCodeAt(0)};`)}const l=t=>{const e=r(t.props),o=`<${t.tag}${e}>`;if(!i.includes(t.tag))return a.includes(t.tag)?o:`${o}</${t.tag}>`;let s=t.children||"";return s&&t.tag==="title"&&(s=d(s)),a.includes(t.tag)?o:`${o}${s}</${t.tag}>`};function c(t){const e={htmlAttrs:{},bodyAttrs:{},tags:{head:[],bodyClose:[],bodyOpen:[]}};for(const o of t){if(o.tag==="htmlAttrs"||o.tag==="bodyAttrs"){e[o.tag]={...e[o.tag],...o.props};continue}e.tags[o.tagPosition||"head"].push(l(o))}return{headTags:e.tags.head.join(`
`),bodyTags:e.tags.bodyClose.join(`
`),bodyTagsOpen:e.tags.bodyOpen.join(`
`),htmlAttrs:r(e.htmlAttrs),bodyAttrs:r(e.bodyAttrs)}}async function b(t){const e={shouldRender:!0};if(await t.hooks.callHook("ssr:beforeRender",e),!e.shouldRender)return{headTags:"",bodyTags:"",bodyTagsOpen:"",htmlAttrs:"",bodyAttrs:""};const o={tags:await t.resolveTags()};await t.hooks.callHook("ssr:render",o);const s=c(o.tags),n={tags:o.tags,html:s};return await t.hooks.callHook("ssr:rendered",n),n.html}export{d as encodeHtmlEntities,r as propsToString,b as renderSSRHead,c as ssrRenderTags,l as tagToString};
//# sourceMappingURL=index.eb9741a9.js.map
