import{s as c}from"./icons.5353538a.js";import{d as i,r as f,b as u,c as v,e as p,z as y,U as _,N as b,G as m,a as g,q as h}from"./registerWidgets.309e60e2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="66597ecb-4db6-4627-a336-22c1c139eb43",e._sentryDebugIdIdentifier="sentry-dbid-66597ecb-4db6-4627-a336-22c1c139eb43")}catch{}})();const w=i({__name:"SaveButton",props:{model:null},setup(e){const t=e,a=f(!1);async function s(){a.value=!0;try{await t.model.save()}finally{a.value=!1}}return addEventListener("keydown",n=>{(n.metaKey||n.ctrlKey)&&n.key==="s"&&(n.preventDefault(),s())}),addEventListener("beforeunload",n=>{t.model.hasChanges()&&(n.preventDefault(),n.returnValue="")}),(n,o)=>{var l,r;const d=g("icon");return u(),v("button",{class:m(["save-button",{changes:(l=e.model)==null?void 0:l.hasChanges()}]),onClick:o[0]||(o[0]=S=>s())},[p(d,{class:"icon",path:y(c),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),_(" "+b(a.value?"Saving ...":(r=e.model)!=null&&r.hasChanges()?"Save":"Saved"),1)],2)}}});const k=h(w,[["__scopeId","data-v-15752ff4"]]);export{k as S};
//# sourceMappingURL=SaveButton.eb6132df.js.map
