import{_ as d}from"./SmartDataTable-2Nc3Ohem.js";import{d as c,H as l,F as b,f as _,h as p,v as i,i as m,c as f,O as h,D as v,y,P as k}from"./index-C5GbdPxY.js";import{V as g}from"./VTooltip-DPhSY2Qe.js";import{V as x}from"./VChip-CsS_5IS6.js";import"./VAvatar-RkAR0u0e.js";import"./VImg-BlqLjeEy.js";import"./VSelect-vtfYszIh.js";import"./VTextField-DxEUpn3-.js";import"./index-XcTykuv2.js";import"./forwardRefs-CB8NoG9r.js";import"./VList-C3dIUnee.js";import"./VMenu-CT0Fri-T.js";import"./VOverlay-DlJb3QlW.js";import"./getScrollParent-DE35ecf2.js";import"./VVirtualScroll-BUlcGoHW.js";import"./confirmDialog-CDDTmj30.js";import"./VCard-DptrO3GI.js";import"./VDialog-Dr29crN8.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./lodash-kem28dbC.js";import"./_commonjsHelpers-_d1bhYXs.js";import"./VForm-BZc3SavJ.js";import"./VCheckbox-rNAD_QU_.js";import"./VDatePicker-DHBX-k2T.js";import"./VSpacer-79sITyKz.js";import"./VBadge-DZHesqMo.js";import"./TableAgent.vue_vue_type_script_setup_true_lang-XA6R7TPe.js";import"./TableEnum.vue_vue_type_script_setup_true_lang-5ITYgflT.js";import"./TableStatus.vue_vue_type_script_setup_true_lang-BRbfAU0T.js";import"./RoleBadge.vue_vue_type_script_setup_true_lang-Ctl8Qye7.js";import"./VDataTable-BFiF8jPV.js";import"./VTable-M43pjJD_.js";import"./filter-DERJvhSS.js";const T=c({__name:"TableCurrentStock",props:{item:{}},setup(a){const t=a,{t:e}=l(),r=b(()=>t.item.current_stock>t.item.alert_quantity);return(o,s)=>(p(),_(g,{text:i(e)(`inventory::ingredients.tooltips.${i(r)?"current_stock_is_above_the_alert_threshold":"current_stock_has_fallen_below_the_alert_threshold"}`)},{activator:m(({props:n})=>[f(x,h({color:i(r)?"success":"error",size:"small"},n),{default:m(()=>[v(y(o.item.current_stock),1)]),_:2},1040,["color"])]),_:1},8,["text"]))}}),it=c({__name:"Index",setup(a){const{t}=l(),{user:e}=k(),r=[{title:t("inventory::ingredients.table.name"),value:"name",sortable:!0},{title:t("branch::branches.table.branch"),value:"branch.name",sortable_key:"branch_id",sortable:!0,hidden:e==null?void 0:e.assigned_to_branch},{title:t("inventory::ingredients.table.current_stock"),value:"current_stock",sortable:!0},{title:t("inventory::ingredients.table.alert_quantity"),value:"alert_quantity",sortable:!0},{title:t("inventory::ingredients.table.unit"),value:"unit_name",sortable:!1},{title:t("inventory::ingredients.table.cost_per_unit"),value:"cost_per_unit.formatted",sortable_key:"cost_per_unit",sortable:!0},{title:t("admin::admin.table.created_at"),value:"created_at",sortable:!0},{title:t("admin::admin.table.updated_at"),value:"updated_at",sortable:!0}],o=[{key:"edit"},{key:"destroy",confirm:{message:t("admin::admin.delete.confirmation_message"),confirmButtonText:t("admin::admin.delete.confirm_button_text")}}],s=[{key:"destroy",confirm:{message:t("admin::admin.delete.confirmation_message"),confirmButtonText:t("admin::admin.delete.confirm_button_text")}}],n={current_stock:{component:T}};return(V,C)=>{const u=d;return p(),_(u,{actions:o,"api-uri":"/v1/ingredients","bulk-actions":s,"cell-components":n,"header-actions":[{key:"create"}],headers:r,module:"inventory",name:"ingredient",resource:"ingredients"})}}});export{it as default};
