import{isProductionMode as o}from"../../../../shared/env.js";import{buildScript as i}from"./build-script.js";import{resolveBrowserHooksPath as r}from"./resolve-browser-hooks.js";async function m(){return{id:"Segment Analytics",requiredEntitlements:["analytics"],async processContent(e,{getConfig:t}){const n=(await t())?.analytics?.segment;!n?.writeKey||!o()&&!n.includeInDevelopment||(e.addSsrComponents([i(n)],"head"),e.addBrowserPlugin(r()))}}}export{m as segmentAnalyticsPlugin};
