import"../@a11y/focus-trap/index.js";import{WebDialog as e}from"./web-dialog.js";import"./util.js";function openDialog({$content:n,$container:o=document.body,center:t=!1,initialize:i=()=>new e}={}){const r=i();null!=t&&(r.center=t),null!=n&&("function"==typeof n?n(r):r.appendChild(n));const l=new Promise((e=>{r.addEventListener("close",(n=>{r.remove(),e(n.detail)}),{once:!0})}));return o.appendChild(r),r.show(),{$dialog:r,resolver:l}}export{openDialog};