import{s as c}from"./icons.6936d0f0.js";import{d as f,r as i,b as u,c as v,e as p,z as b,U as y,N as _,G as m,a as g,q as h}from"./registerWidgets.1fe34791.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="69a0b915-18a9-46bf-9cca-12ea897bdb75",e._sentryDebugIdIdentifier="sentry-dbid-69a0b915-18a9-46bf-9cca-12ea897bdb75")}catch{}})();const w=f({__name:"SaveButton",props:{model:null},setup(e){const n=e,t=i(!1);async function s(){t.value=!0;try{await n.model.save()}finally{t.value=!1}}return addEventListener("keydown",a=>{(a.metaKey||a.ctrlKey)&&a.key==="s"&&(a.preventDefault(),s())}),addEventListener("beforeunload",a=>{n.model.hasChanges()&&(a.preventDefault(),a.returnValue="")}),(a,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:b(c),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),y(" "+_(t.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.d01d0d4e.js.map
