import{aa as l,ab as i}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as t,s as h}from"./machine.-tangy-colts-beg-869.js";import{e as c,h as N,b as C,c as E,d}from"./machineh-tangy-colts-beg-816.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};const s=l(({helpers:n})=>({states:{components:[E(n),{allowClear:!0,componentName:n.componentName.select,fieldType:"config",helperText:o("Select the channel you want to update."),id:"channel-id",label:o("Select Channel"),onChange:"SELECT_CHANNEL",onRefetch:"REFETCH_CHANNELS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:n.componentName.mixInput,helperText:o("Enter the new name for the channel (optional)."),id:"channel-name",label:o("New Channel Name"),onChange:"SET_CHANNEL_NAME",path:"name",render:"IF_CHANNEL_SELECTED",required:!1,value:void 0},{componentName:n.componentName.mixInput,helperText:o("Enter the new topic for the channel (optional)."),id:"channel-topic",label:o("New Channel Topic"),onChange:"SET_CHANNEL_TOPIC",path:"topic",render:"IF_CHANNEL_SELECTED",required:!1,value:void 0}]},actions:{SET_CONNECTION:async({$:e,e:a})=>{t("connectionId")({$:e,e:a}),await c(e),d(e,n)},CONNECTION_ADD_CHANGE:C,HANDLE_BOT_TOKEN:N,SELECT_CHANNEL:t("channelId"),REFETCH_CHANNELS:({$:e})=>c(e),SET_CHANNEL_NAME:t("channelName"),SET_CHANNEL_TOPIC:t("channelTopic"),IF_CHANNEL_SELECTED:({$:e})=>{var a;return i((a=e.getComponent("channel-id"))==null?void 0:a.value)},IF_CONNECTION_SELECTED:({$:e})=>{var a;return i((a=e.getComponent("connection-id"))==null?void 0:a.value)},ON_MACHINE_LOAD:({$:e})=>{h(e,[{db:"connectionId",id:"connection-id"},{db:"channelId",id:"channel-id"},{db:"channelName",id:"channel-name"},{db:"channelTopic",id:"channel-topic"}]),c(e)}}}));export{s as default};
