import{aa as c,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{h as a,s as E}from"./machine.-tangy-colts-beg-869.js";import{f as r,a as i,h as s,b as d,c as m,d as C}from"./machineh-tangy-colts-beg-816.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const u=c(({helpers:o})=>({states:{components:[m(o),{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:n("Select the member to remove the role from."),id:"user-id",label:n("Select Member"),onChange:"SELECT_USER",onRefetch:"REFETCH_MEMBERS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:n("Select the role to remove from the member."),id:"role-id",label:n("Select Role"),onChange:"SELECT_ROLE",onRefetch:"REFETCH_ROLES",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0}]},actions:{SET_CONNECTION:async({$:e,e:t})=>{a("connectionId")({$:e,e:t}),await Promise.all([i(e),r(e)]),C(e,o)},CONNECTION_ADD_CHANGE:d,HANDLE_BOT_TOKEN:s,SELECT_USER:a("userId"),SELECT_ROLE:a("roleId"),REFETCH_MEMBERS:({$:e})=>i(e),REFETCH_ROLES:({$:e})=>r(e),IF_CONNECTION_SELECTED:({$:e})=>{var t;return l((t=e.getComponent("connection-id"))==null?void 0:t.value)},ON_MACHINE_LOAD:async({$:e})=>{E(e,[{db:"connectionId",id:"connection-id"},{db:"userId",id:"user-id"},{db:"roleId",id:"role-id"}]),await Promise.all([i(e),r(e)])}}}));export{u as default};
