var e={},t=!1;function n(){t=!0}var r=[],i=[],a=1,o=document.body;function s(t,n){let s=document.createElement(`div`);if(s.id=n===void 0?t:`q-portal--${n}--${a++}`,e.globalNodes!==void 0){let t=e.globalNodes.class;t!==void 0&&(s.className=t)}return o.append(s),r.push(s),i.push(n),s}function c(e){let t=r.indexOf(e);r.splice(t,1),i.splice(t,1),e.remove()}function l(e){if(e===o)return;if(o=e,o===document.body||i.reduce((e,t)=>t===`dialog`?e+1:e,0)<2){r.forEach(e=>{e.contains(o)||o.append(e)});return}let t=i.lastIndexOf(`dialog`);for(let e=0;e<r.length;e++){let n=r[e];(e===t||i[e]!==`dialog`)&&!n.contains(o)&&o.append(n)}}export{e as a,n as i,s as n,t as o,c as r,l as t};