import"./rolldown-runtime-DIIn1E2Q.js";import{a as e,dt as t}from"./vendor-primevue-_eYbXsHY.js";import{I as n,O as r,R as i,Rt as a,S as o,Ut as s,_t as c,et as l,j as u,pt as d,q as f}from"./vendor-vue-core-DO0afONr.js";import{qt as p}from"./api-BebQfoGK.js";import{i as m}from"./dialogService-Cm1GEBK8.js";var h={class:`flex items-center gap-2`},g=i({__name:`GlobalToast`,setup(i){let g=t(),_=p(),v=m();d(()=>_.messagesToAdd,e=>{e.length!==0&&(e.forEach(e=>{g.add(e)}),_.messagesToAdd=[])},{deep:!0}),d(()=>_.messagesToRemove,e=>{e.length!==0&&(e.forEach(e=>{g.remove(e)}),_.messagesToRemove=[])},{deep:!0}),d(()=>_.removeAllRequested,e=>{e&&(g.removeAllGroups(),_.removeAllRequested=!1)});function updateToastPosition(){let e=document.getElementById(`dynamic-toast-style`)||createStyleElement(),t=document.querySelector(`.graph-canvas-container`)?.getBoundingClientRect();t&&(e.textContent=`
    .p-toast.p-component.p-toast-top-right {
      top: ${t.top+100}px !important;
      right: ${window.innerWidth-(t.left+t.width)+20}px !important;
       z-index: 10000 !important;
    }
  `)}function createStyleElement(){let e=document.createElement(`style`);return e.id=`dynamic-toast-style`,document.head.appendChild(e),e}return d(()=>v.get(`Comfy.UseNewMenu`),()=>f(updateToastPosition),{immediate:!0}),d(()=>v.get(`Comfy.Sidebar.Location`),()=>f(updateToastPosition),{immediate:!0}),(t,i)=>(l(),u(o,null,[n(a(e)),n(a(e),{group:`billing-operation`,position:`top-right`},{message:c(e=>[r(`div`,h,[i[0]||=r(`i`,{class:`pi pi-spin pi-spinner text-primary`},null,-1),r(`span`,null,s(e.message.summary),1)])]),_:1})],64))}});export{g as t};
//# sourceMappingURL=GlobalToast-DHYvVkn4.js.map