import{s as f}from"./icons.1cdfa11b.js";import{d as i,r as c,a as u,b as p,c as v,e as _,A as y,V as m,O as b,H as g,t as h}from"./registerWidgets.2f354556.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="7ebdf1f9-36e0-4be7-a262-5c73166e8057",n._sentryDebugIdIdentifier="sentry-dbid-7ebdf1f9-36e0-4be7-a262-5c73166e8057")}catch{}})();const w=i({__name:"SaveButton",props:{model:{}},setup(n){const a=n,t=c(!1);async function s(){t.value=!0;try{await a.model.save()}finally{t.value=!1}}return addEventListener("keydown",e=>{(e.metaKey||e.ctrlKey)&&e.key==="s"&&(e.preventDefault(),s())}),addEventListener("beforeunload",e=>{a.model.hasChanges()&&(e.preventDefault(),e.returnValue="")}),(e,o)=>{var r,l;const d=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())},[_(d,{class:"icon",path:y(f),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),m(" "+b(t.value?"Saving ...":(l=e.model)!=null&&l.hasChanges()?"Save":"Saved"),1)],2)}}});const k=h(w,[["__scopeId","data-v-15752ff4"]]);export{k as S};
//# sourceMappingURL=SaveButton.14adcf95.js.map
