import{aa as E,ab as c}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as a,s}from"./machine.-tangy-colts-beg-869.js";import{e as i,h as C,b as r,c as l,d as h}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 p=E(({helpers:n})=>({states:{components:[l(n),{allowClear:!0,componentName:n.componentName.select,fieldType:"config",helperText:o("Select the forum channel where you want to create a new post."),id:"channel-id",label:o("Select Forum 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 title for the new forum post."),id:"post-title",label:o("Post Title"),onChange:"SET_POST_TITLE",path:"name",render:"IF_CHANNEL_SELECTED",required:!0,value:[]},{componentName:n.componentName.mixInput,helperText:o("Enter the content for the first message in the forum post."),id:"message-content",label:o("Message Content"),onChange:"SET_MESSAGE_CONTENT",path:"content",render:"IF_CHANNEL_SELECTED",required:!0,value:[]}]},actions:{SET_CONNECTION:async({$:e,e:t})=>{a("connectionId")({$:e,e:t}),await i(e),h(e,n)},CONNECTION_ADD_CHANGE:r,HANDLE_BOT_TOKEN:C,SELECT_CHANNEL:a("channelId"),REFETCH_CHANNELS:({$:e})=>i(e),SET_MESSAGE_CONTENT:a("messageContent"),SET_POST_TITLE:a("postTitle"),IF_CHANNEL_SELECTED:({$:e})=>{var t;return c((t=e.getComponent("channel-id"))==null?void 0:t.value)},IF_CONNECTION_SELECTED:({$:e})=>{var t;return c((t=e.getComponent("connection-id"))==null?void 0:t.value)},ON_MACHINE_LOAD:({$:e})=>{s(e,[{db:"connectionId",id:"connection-id"},{db:"channelId",id:"channel-id"},{db:"postTitle",id:"post-title"},{db:"messageContent",id:"message-content"}]),i(e)}}}));export{p as default};
