import{aa as i,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as c,s as h}from"./machine.-tangy-colts-beg-869.js";import{h as C,b as N,c as p,d as E}from"./machineh-tangy-colts-beg-816.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,e){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,e),e)}};const s=i(({helpers:a})=>({states:{components:[p(a),{componentName:a.componentName.mixInput,helperText:o("Enter the name for the new channel."),id:"channel-name",label:o("Channel Name"),onChange:"SET_CHANNEL_NAME",path:"name",render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:a.componentName.select,helperText:o("Select the type of channel to create."),id:"channel-type",label:o("Channel Type"),onChange:"SET_CHANNEL_TYPE",options:[{label:o("Text Channel"),value:"0"},{label:o("Voice Channel"),value:"2"},{label:o("Category"),value:"4"}],path:"type",render:"IF_CONNECTION_SELECTED",required:!1,value:void 0},{componentName:a.componentName.mixInput,helperText:o("Enter the topic or description for the channel (optional)."),id:"channel-topic",label:o("Channel Topic"),onChange:"SET_CHANNEL_TOPIC",path:"topic",render:"IF_CHANNEL_TYPE_SELECTED",required:!1,value:void 0}]},actions:{SET_CONNECTION:({$:e,e:t})=>{c("connectionId")({$:e,e:t}),E(e,a),e.setDb(n=>{n.channelName=void 0,n.channelTopic=void 0,n.channelType=void 0}),e.setComponent("channel-name",n=>{n.value=void 0}),e.setComponent("channel-topic",n=>{n.value=void 0}),e.setComponent("channel-type",n=>{n.value=void 0})},CONNECTION_ADD_CHANGE:N,HANDLE_BOT_TOKEN:C,SET_CHANNEL_NAME:c("channelName"),SET_CHANNEL_TOPIC:c("channelTopic"),SET_CHANNEL_TYPE:c("channelType"),IF_CHANNEL_TYPE_SELECTED:({$:e})=>{var t,n;return l((t=e.getComponent("channel-type"))==null?void 0:t.value)&&((n=e.getComponent("channel-type"))==null?void 0:n.value)==="0"},IF_CONNECTION_SELECTED:({$:e})=>{var t;return l((t=e.getComponent("connection-id"))==null?void 0:t.value)},ON_MACHINE_LOAD:({$:e})=>{h(e,[{db:"connectionId",id:"connection-id"},{db:"channelType",id:"channel-type"},{db:"channelName",id:"channel-name"},{db:"channelTopic",id:"channel-topic"}])}}}));export{s as default};
