import{s as c}from"./icons.f9be01a3.js";import{d as f,r as i,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.eb5d1044.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="6c14c741-9dbe-4ded-8f9e-00d8ce972dcb",n._sentryDebugIdIdentifier="sentry-dbid-6c14c741-9dbe-4ded-8f9e-00d8ce972dcb")}catch{}})();const w=f({__name:"SaveButton",props:{model:{}},setup(n){const t=n,a=i(!1);async function s(){a.value=!0;try{await t.model.save()}finally{a.value=!1}}return addEventListener("keydown",e=>{(e.metaKey||e.ctrlKey)&&e.key==="s"&&(e.preventDefault(),s())}),addEventListener("beforeunload",e=>{t.model.hasChanges()&&(e.preventDefault(),e.returnValue="")}),(e,o)=>{var d,r;const l=u("icon");return p(),v("button",{class:g(["save-button",{changes:(d=e.model)==null?void 0:d.hasChanges()}]),onClick:o[0]||(o[0]=S=>s())},[_(l,{class:"icon",path:y(c),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),b(" "+m(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.1bf43c53.js.map
