import{s as i}from"./icons.74a49ba5.js";import{d as c,r as f,a as u,b as p,c as v,e as _,bu as y,bh as b,eA as m,ew as g,t as h}from"./registerWidgets.daf4e0d4.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="d9530c42-8ad9-4051-a2a4-a622cb934ab8",a._sentryDebugIdIdentifier="sentry-dbid-d9530c42-8ad9-4051-a2a4-a622cb934ab8")}catch{}})();const w=c({__name:"SaveButton",props:{model:{}},setup(a){const n=a,t=f(!1);async function s(){t.value=!0;try{await n.model.save()}finally{t.value=!1}}return addEventListener("keydown",e=>{(e.metaKey||e.ctrlKey)&&e.key==="s"&&(e.preventDefault(),s())}),addEventListener("beforeunload",e=>{n.model.hasChanges()&&(e.preventDefault(),e.returnValue="")}),(e,o)=>{var r,d;const l=u("icon");return p(),v("button",{class:g(["save-button",{changes:(r=e.model)==null?void 0:r.hasChanges()}]),onClick:o[0]||(o[0]=S=>s())},[_(l,{class:"icon",path:y(i),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),b(" "+m(t.value?"Saving ...":(d=e.model)!=null&&d.hasChanges()?"Save":"Saved"),1)],2)}}});const k=h(w,[["__scopeId","data-v-15752ff4"]]);export{k as S};
//# sourceMappingURL=SaveButton.b344b3ef.js.map
