import{_ as B,i as _,r as c,l as d,b as f,w as s,e as r,d as V,f as o,G as w,c as G,F as L,x as R,h as b,t as y,an as z,ao as D,J as g}from"./index-BDh_pN-M.js";import"./index-Bg8xNGen.js";import{B as Z}from"./index-DdRBin1M.js";import{C as q}from"./index-CbMXeqxJ.js";import{C as E,a as I}from"./index-DmlvUhtX.js";import{C as J}from"./index-Dgm5--V8.js";import"./index-CABkbwV5.js";import{F as T}from"./index-zhU1DFYQ.js";const U={class:"button-container"},j={__name:"index",setup(A){const l=_.global.t;let i=c([]),v=c(null),n=c([]),m=c(!1),p;async function x(){let e=(await z()).capabilities;i.value=e.map(t=>({name:t.name,labelZh:t.zhName})),n.value=e.filter(t=>t.enabled).map(t=>t.name)}async function h(){m.value=!0;let u=i.value.map(e=>({name:e.name,enabled:n.value.includes(e.name)}));try{await D({capabilities:u}),p=g({type:"success",message:l("factorySet.submitSuccess"),className:"bottom-notify",position:"bottom"})}catch{p=g({type:"danger",message:l("factorySet.submitFailed"),className:"bottom-notify",position:"bottom"})}m.value=!1}return x(),(u,e)=>{const t=I,k=J,C=E,S=q,N=Z,F=T;return f(),d(F,{ref_key:"formRef",ref:v},{default:s(()=>[r(S,{title:o(l)("factorySet.functionList"),inset:""},{default:s(()=>[r(C,{modelValue:o(n),"onUpdate:modelValue":e[0]||(e[0]=a=>w(n)?n.value=a:n=a),shape:"square"},{default:s(()=>[(f(!0),G(L,null,R(o(i),a=>(f(),d(k,{key:a.name},{default:s(()=>[r(t,{name:a.name},{default:s(()=>[b(y(o(_).global.locale==="zh_CN"?a.labelZh:a.name),1)]),_:2},1032,["name"])]),_:2},1024))),128))]),_:1},8,["modelValue"])]),_:1},8,["title"]),V("div",U,[r(N,{round:"",block:"",type:"primary","native-type":"submit",class:"confirm-button",onClick:h,loading:o(m),"loading-text":o(l)("factorySet.submitting")},{default:s(()=>[b(y(o(l)("factorySet.submit")),1)]),_:1},8,["loading","loading-text"])])]),_:1},512)}}},Y=B(j,[["__scopeId","data-v-dce97e42"]]);export{Y as default};
