// @bun
var{defineProperty:C,getOwnPropertyNames:F,getOwnPropertyDescriptor:G}=Object,H=Object.prototype.hasOwnProperty;function I(j){return this[j]}var P=(j)=>{var q=(E??=new WeakMap).get(j),z;if(q)return q;if(q=C({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var A of F(j))if(!H.call(q,A))C(q,A,{get:I.bind(j,A),enumerable:!(z=G(j,A))||z.enumerable})}return E.set(j,q),q},E;var J=(j)=>j;function K(j,q){this[j]=J.bind(null,q)}var Q=(j,q)=>{for(var z in q)C(j,z,{get:q[z],enumerable:!0,configurable:!0,set:K.bind(q,z)})};var T=(j,q)=>()=>(j&&(q=j(j=0)),q);var L=import.meta.require;async function N(){if(B!==null)return B;try{let j=await import("stx-router");if(typeof j.getRouterScript==="function")B=j.getRouterScript();else B=""}catch{B=""}return B}async function V(j,q){let z=await N();if(!z)return j;let A={interceptAllLinks:!0,container:"main",...q},D=`${`<script>window.__stxRouterConfig=${JSON.stringify(A)};</script>
`}<script>${z}</script>`;if(/<\/body>/i.test(j))return j.replace(/<\/body>/i,`${D}
</body>`);return`${j}
${D}`}var B=null;export{V as injectRouterScript};
