import{A as S,B as A,h as V,i as w,r as h,e as d,b as u,o as s,d as t,a as m,t as n,w as p,f as v,u as r,c as q,F as M,g as P,x as F}from"./vue.esm-bundler.js?ver=1.5.4";import{A as N,t as f}from"./Translator.js?ver=1.5.4";import{B as U}from"./Badge.js?ver=1.5.4";import{_ as j}from"./Animation.js?ver=1.5.4";import"./Arr.js?ver=1.5.4";import"./Model.js?ver=1.5.4";import"./Rest.js?ver=1.5.4";import"./Storage.js?ver=1.5.4";import"./Str.js?ver=1.5.4";import"./vue-router.js?ver=1.5.4";import"./Url.js?ver=1.5.4";import"./dayjs.min.js?ver=1.5.4";import"./timezone.js?ver=1.5.4";import"./Notify.js?ver=1.5.4";import"./index.js?ver=1.5.4";import"./DynamicIcon.js?ver=1.5.4";import"./_plugin-vue_export-helper.js?ver=1.5.4";import"./index3.js?ver=1.5.4";import"./IconButton.js?ver=1.5.4";import"./Utils.js?ver=1.5.4";import"./TransitionAccordion.js?ver=1.5.4";const T={key:0,class:"fct-content-card-list-item py-4 px-6"},z={class:"fct-content-card-list-head"},O={class:"flex items-start gap-2 flex-row"},D={class:"mb-0"},E={key:0,class:"fct-content-card-list-content"},I={class:"mt-3 space-y-2 fct-module-settings-option-wrap"},K={key:0,class:"text-xs block"},L={class:"fct-content-card-list-action"},R={class:"pr-4"},me={__name:"ModuleSettings",props:S({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=A(a,"modelValue"),_=N.get("app_config.isProActive"),o=V(!1),b=V(!1),x=(g,i)=>{g==="enable_advanced_inventory"&&!_&&i==="yes"&&(e[g]="no")};return w(()=>{o.value=e.value.active,b.value=!0}),(g,i)=>{const k=h("el-button"),C=h("el-checkbox"),B=h("el-switch");return b.value?(s(),d("div",T,[t("div",z,[t("div",O,[t("h4",D,n(a.field.title),1),m(U,{size:"small",type:o.value==="yes"?"active":"inactive","hide-icon":!0},{default:p(()=>[v(n(o.value==="yes"?r(f)("Active"):r(f)("Inactive")),1)]),_:1},8,["type"])])]),a.field.description?(s(),d("div",E,[t("p",null,n(a.field.description),1),a.field.settings?(s(),q(j,{key:0,visible:o.value==="yes",accordion:""},{default:p(()=>[t("div",I,[(s(!0),d(M,null,P(a.field.settings,(c,l)=>(s(),d("div",{key:l,class:"fct-module-settings-option"},[m(C,{modelValue:e.value[l],"onUpdate:modelValue":y=>e.value[l]=y,"true-value":"yes","false-value":"no",disabled:l==="enable_advanced_inventory"&&!r(_),onChange:y=>x(l,y)},{default:p(()=>[v(n(c.label)+" ",1),l==="enable_advanced_inventory"&&!r(_)?(s(),d("span",K,[v(n(r(f)("This feature is only available in FluentCart Pro."))+" ",1),m(k,{size:"small",tag:"a",link:"",href:"https://fluentcart.com/discount-deal",target:"_blank",rel:"noopener noreferrer"},{default:p(()=>[v(n(r(f)("Upgrade to Pro")),1)]),_:1})])):u("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onChange"])]))),128))])]),_:1},8,["visible"])):u("",!0)])):u("",!0),t("div",L,[t("div",R,[m(B,{"active-value":"yes","inactive-value":"no",modelValue:o.value,"onUpdate:modelValue":i[0]||(i[0]=c=>o.value=c),onChange:i[1]||(i[1]=c=>{(!e.value||typeof e.value!="object")&&(e.value={}),F(()=>{e.value.active=c})})},null,8,["modelValue"])]),u("",!0)])])):u("",!0)}}};export{me as default};
