import{aa as l,ab as c}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{h as n,s}from"./machine.-tangy-colts-beg-869.js";import{f as i,a as r,h as d,b as E,c as h,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=l(({helpers:o})=>({states:{components:[h(o),{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:a("Select the member to add the role to."),id:"user-id",label:a("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:a("Select the role to add to the member.( Note: The person or bot assigning the role must have a highest role that is higher in the role hierarchy to add the role to the member.)"),id:"role-id",label:a("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})=>{n("connectionId")({$:e,e:t}),await Promise.all([r(e),i(e)]),C(e,o)},CONNECTION_ADD_CHANGE:E,HANDLE_BOT_TOKEN:d,SELECT_USER:n("userId"),SELECT_ROLE:n("roleId"),REFETCH_MEMBERS:({$:e})=>r(e),REFETCH_ROLES:({$:e})=>i(e),IF_CONNECTION_SELECTED:({$:e})=>{var t;return c((t=e.getComponent("connection-id"))==null?void 0:t.value)},ON_MACHINE_LOAD:async({$:e})=>{s(e,[{db:"connectionId",id:"connection-id"},{db:"userId",id:"user-id"},{db:"roleId",id:"role-id"}]),await Promise.all([r(e),i(e)])}}}));export{u as default};
