1import{u as m,f as _,a as f}from"./index-mGgJqOFQ.js";import{d as v,y as b,S as h,E as k,o as C,a as I,aa as x,u as l,bk as F,bl as S,bs as g}from"./core-Cu1dlvv4.js";import{u as w}from"./useAutoModal-CaK8mTFj.js";const y=v({__name:"UserImport",setup(P){const{t:e}=b(),u=h(),n=w(),t=k({csvfile:{file:null},update:!1,delete:!1}),i={csvfile:{component:"FileItem",label:e("users_import_csv_file"),description:e("users_import_csv_file_desc"),rules:{file:f},cProps:{id:"csvfile",accept:"text/csv",placeholder:e("placeholder.file")}},update:{label:e("users_import_update"),description:e("users_import_update_desc"),component:"CheckboxItem",cProps:{id:"update"}},delete:{component:"CheckboxItem",label:e("users_import_delete"),description:e("users_import_delete_desc"),cProps:{id:"delete"}}},{v:p,onSubmit:c}=m(t,i),d=c(async o=>{if(t.value.delete&&!await n(e("users_import_confirm_destructive"),{okTitle:e("users_import_delete_others")}))return;const s={...t.value};s.delete||delete s.delete,s.update||delete s.update;const r=await F(s);S.post({uri:"users/import",data:r}).then(()=>{g(["users","userDetails","groups","permissions"]),u.push({name:"user-list"})}).catch(o)});return(o,s)=>{const r=_;return C(),I(r,{modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=a=>t.value=a),icon:"user-plus",fields:i,title:o.$t("users_import"),validations:l(p),onSubmit:x(l(d),["prevent"])},null,8,["modelValue","title","validations","onSubmit"])}}});export{y as default};
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.