import{_ as n}from"./index-tFmyJvsy.js";var p=1;function a(){if(!(typeof globalThis>"u"))return globalThis}n(a,"getCaptureGlobal");function m(){var o;return!!((o=a())!=null&&o.mermaidCaptureSizes)}n(m,"shouldCaptureSizes");function d(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}n(d,"capturedFromLocation");function s(o,r){const e=a();if(!e)return;const t=r.node(),i=(t&&"ownerSVGElement"in t?t.ownerSVGElement:null)??t,c=(i==null?void 0:i.id)??"(unknown)";e.mermaidCapturedSizes??(e.mermaidCapturedSizes=[]);const u={svgId:c,sizes:o};e.mermaidCapturedSizes.push(u),e.mermaidLastCapturedSizes=u}n(s,"emitCapturedSizes");function l(o,r){const e=[];for(const t of r.nodes)t.isGroup||e.push({id:t.id,width:t.width??0,height:t.height??0});e.length!==0&&s({metadata:{captureVersion:p,capturedAt:new Date().toISOString(),capturedFrom:d()},nodes:e},o)}n(l,"captureNodeSizes");export{l as captureNodeSizes,m as shouldCaptureSizes};
