1import{p as x,z as b,r as m,A,d as i,a as o,t as a,i as D,v as I,e as v,b as S,w as C,u as y,J as k,k as E,o as l,f as N}from"./app-TTdzKPnM.js";import{_ as V}from"./SaturnButton-DBZVI7YW.js";try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new n.Error().stack;r&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[r]="c16f126e-d631-42b8-a13d-53bf76cac04e",n._sentryDebugIdIdentifier="sentry-dbid-c16f126e-d631-42b8-a13d-53bf76cac04e")}catch{}const B={key:0,class:"text-center py-8"},T={class:"text-gray-600"},F={key:1},J={class:"font-bold text-xl"},M={class:"font-medium mt-2 text-gray-600"},Y={class:"mt-4 flex items-center gap-2"},z=["disabled"],G={value:"1"},O={value:"0"},P={key:0,class:"text-sm text-gray-500"},U={key:0,class:"mt-2 text-sm font-medium text-ignition"},W={key:1,class:"mt-6"},j={class:"text-sm text-gray-600 mb-4"},K={__name:"ApprovalsSettingsForm",setup(n){var g,_;const r=x(),c=(_=(g=r.props.auth.user)==null?void 0:g.current_team)==null?void 0:_.id,f=b(()=>{var e;return((e=r.props.auth.features)==null?void 0:e.Approvals)||!1}),d=m(f.value?"1":"0");A(f,e=>{d.value=e?"1":"0"},{immediate:!0});const w=b(()=>{var e,t,s,h;return((t=(e=r.props.auth.permissions)==null?void 0:e.team)==null?void 0:t.owner)||((h=(s=r.props.auth.permissions)==null?void 0:s.team)==null?void 0:h.update)}),p=m(!1),u=m("");function $(){c&&(u.value="",p.value=!0,axios.post("/api/settings",{team_id:c,group:"company",name:"approvals_enabled",value:d.value}).then(()=>{k.reload()}).catch(e=>{var t,s;u.value=((s=(t=e.response)==null?void 0:t.data)==null?void 0:s.message)||E("Failed to save. Please try again.")}).finally(()=>{p.value=!1}))}return(e,t)=>(l(),i("div",null,[w.value?(l(),i("div",F,[o("h2",J,a(e.$t("Approvals Feature")),1),o("p",M,a(e.$t("When enabled, time entries must be approved before they can be exported.")),1),o("div",Y,[D(o("select",{id:"approvals_enabled",name:"approvals_enabled","onUpdate:modelValue":t[0]||(t[0]=s=>d.value=s),disabled:p.value,class:"border-0 ring-1 ring-inset ring-saturn-gray focus:ring-2 focus:ring-inset focus:ring-lunar font-medium rounded w-80 disabled:opacity-60",onChange:$},[o("option",G,a(e.$t("Yes")),1),o("option",O,a(e.$t("No")),1)],40,z),[[I,d.value]]),p.value?(l(),i("span",P,a(e.$t("Saving...")),1)):v("",!0)]),u.value?(l(),i("p",U,a(u.value),1)):v("",!0),d.value==="1"?(l(),i("div",W,[o("p",j,a(e.$t("To approve payroll periods and manage time locks, use the Approvals page in the main navigation.")),1),S(V,{onSaturnButtonClicked:t[1]||(t[1]=s=>y(k).visit(e.route("teams.approvals",[y(c)])))},{default:C(()=>[N(a(e.$t("Go to Approvals")),1)]),_:1})])):v("",!0)])):(l(),i("div",B,[o("p",T,a(e.$t("You do not have permission to manage approval settings.")),1)]))]))}};export{K as default}; 2//# sourceMappingURL=ApprovalsSettingsForm-CXPyQyqy.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.