import{aa as s}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{s as r}from"./machine.-tangy-colts-beg-869.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const C=s(({helpers:o})=>({states:{components:[{addConnectionHelpingText:a('You can find credentials from <a target="_blank" class="text-blue-600 underline" rel="noopener noreferrer nofollow" href="https://my.demio.com/manage/settings/api-details">Here</a>'),componentName:o.componentName.connection,connectionsTypes:[{encryptKeys:["value"],label:a("API Key"),type:"api_key",verifyConnection:{headers:{Accept:"application/json","api-key":"","api-secret":""},method:"GET",responseKeyMatch:["pong"],url:"https://my.demio.com/api/v1/ping"}}],fieldType:"config",id:"connection-id",label:a("Select Connection"),onConnectionAddChange:"CONNECTION_ADD_CHANGE",onConnectionChange:"SET_CONNECTION",render:!0,value:void 0}]},actions:{ON_MACHINE_LOAD:async({$:e})=>{r(e,[{db:"connectionId",id:"connection-id"}])},CONNECTION_ADD_CHANGE:({$:e,e:t})=>{e.setThisComponent(n=>{e.util.isConnectionComponent(n)&&n.connectionsTypes.forEach(i=>{var c;i.type==="api_key"&&((c=i.verifyConnection)!=null&&c.headers)&&(i.verifyConnection.headers["api-key"]=t.key,i.verifyConnection.headers["api-secret"]=t.value)})})},SET_CONNECTION:async({$:e,e:t})=>{e.setThisComponent(n=>{n.value=t}),e.setDb(n=>{n.connectionId=t})}}}));export{C as default};
