import{r as o,h as e}from"./p-f8363b1b.js";import{t as s}from"./p-510e3bc9.js";import{s as a}from"./p-c78d1e1b.js";import"./p-d2ac57a0.js";import"./p-f44f0a67.js";import"./p-3775d1fc.js";import"./p-80de33dc.js";import"./p-c2fbed0d.js";import"./p-5717491f.js";import"./p-de14d315.js";const i=class{constructor(e){o(this,e),this.users=[]}onReset(o){var e;if("bulkUpdateUsers"===(null===(e=o.detail)||void 0===e?void 0:e.endpoint)){const o=document.querySelector("ion-modal.modal-edit-users");(null==o?void 0:o.dismiss)&&o.dismiss()}}async onSuccess(o){var e;if("bulkUpdateUsers"===(null===(e=o.detail)||void 0===e?void 0:e.endpoint)){const o=document.querySelector("ion-modal.modal-edit-users");(null==o?void 0:o.dismiss)&&(await o.dismiss(),this.presentToast())}}async presentToast(){var o;(await s.create({message:`Updated ${null===(o=this.users)||void 0===o?void 0:o.length} users.`,duration:2e3})).present()}render(){return e("ion-content",null,e("fireenjin-form",{class:"ion-padding",endpoint:"bulkUpdateUsers",beforeSubmit:async o=>({data:o,userIds:this.users.map((o=>o.id))}),disableLoader:!0,resetButtonColor:"medium"},e("fireenjin-select",{name:"companyId",label:"Company",labelPosition:"stacked",endpoint:"listCompanies",limit:100,dataPropsMap:{companies:"results"}}),e("fireenjin-select",{label:"Location",name:"locationId",options:((null==a?void 0:a.locations)||[]).map((o=>({label:(null==o?void 0:o.name)||"No Location Name",value:null==o?void 0:o.id})))}),e("fireenjin-select-tags",{name:"tags",label:"Tags",labelPosition:"stacked",allowAdding:!0,options:[{label:"Important",value:"important"}]})))}};i.style="modal-edit-users .banner{background-color:var(--ion-color-secondary)}modal-edit-users h1{color:#fff}modal-edit-users p{margin:0 0 15px 0;color:rgba(255, 255, 255, 0.8);font-weight:normal}.modal-edit-users{--width:700px;--max-width:700px}@media only screen and (max-width: 800px){.modal-edit-users{--width:100%;--max-width:auto}}";export{i as modal_edit_users}