import{aa as c,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as i}from"./main-tangy-colts-beg.js";import{s as C}from"./machine.-tangy-colts-beg-869.js";import{f as n}from"./machineh-tangy-colts-beg-95.js";import{h,c as p}from"./notionco-tangy-colts-beg-866.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 _=c(({helpers:t})=>({states:{components:[p(t),{componentName:t.componentName.select,fieldType:"config",id:"page-id",label:i("Page"),onChange:"SELECT_PAGE",onRefetch:"REFETCH_PAGE",optionFilterProp:"label",options:[],placeholder:i("Select a Page"),render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0}]},actions:{IF_CONNECTION_SELECTED:({$:e})=>{var o;return s((o=e.getComponent("connection-id"))==null?void 0:o.value)},SELECT_PAGE:async({$:e,e:o})=>{e.setThisComponent(a=>{a.value=o}),e.setDb(a=>{a.pageId=o})},ON_MACHINE_LOAD:async({$:e})=>{C(e,[{db:"connectionId",id:"connection-id"},{db:"pageId",id:"page-id"}]),await n(e)},REFETCH_PAGE:async({$:e})=>{await n(e)},SET_CONNECTION:async({$:e,e:o})=>{e.setThisComponent(a=>{a.value=o}),e.setDb(a=>{a.connectionId=o}),await n(e)},CONNECTION_ADD_CHANGE:h}}));export{_ as default};
