import{aa as p}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{s as c}from"./machine.-tangy-colts-beg-869.js";import{i as n,e as i}from"./machineh-tangy-colts-beg-110.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const h=p(({helpers:t})=>({states:{components:[{componentName:t.componentName.select,fieldType:"config",id:"post-type",label:a("Post Type"),mode:"multiple",onChange:"SELECT_POST_TYPE",onRefetch:"REFETCH_POST_TYPES",optionFilterProp:"label",options:[],placeholder:a("any post type"),render:!0,showSearch:!0,value:void 0},{componentName:t.componentName.select,fieldType:"config",id:"post-id",label:a("Posts"),mode:"multiple",onChange:"SELECT_POST",onRefetch:"REFETCH_POSTS",optionFilterProp:"label",options:[],placeholder:a("any post"),render:!0,showSearch:!0,value:void 0},{componentName:t.componentName.hookListener,fieldType:"config",id:"hook-listener",label:a("Listen Hook"),render:!0}]},actions:{ON_MACHINE_LOAD:async({$:e})=>{c(e,[{db:"postType",id:"post-type"},{db:"postId",id:"post-id"}]),await Promise.all([i(e),n(e)])},REFETCH_POST_TYPES:async({$:e})=>i(e),REFETCH_POSTS:async({$:e})=>n(e),SELECT_POST:async({$:e,e:s})=>{e.setThisComponent(o=>{o.value=s}),e.setDb(o=>{o.postId=s})},SELECT_POST_TYPE:async({$:e,e:s})=>{e.setThisComponent(o=>{o.value=s}),e.setDb(o=>{o.postType=s}),e.setComponent("post-id",o=>{o.value=void 0}),await n(e)}}}));export{h as default};
