import{b as i,i as r}from"./useflows-BpG3C9m1.js";import{e}from"./main-few-lands-burn.js";import{s as m}from"./machine.-BRuqPpdF.js";import{h as d,a as t,c as E}from"./openaico-BZSnTkIZ.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const T=i(({helpers:l})=>({states:{components:[E(l),{componentName:l.componentName.select,id:"model-id",label:e("Select Model"),onChange:"SET_MODEL",options:[{label:e("Dall-E-3"),value:"dall-e-3"},{label:e("Dall-E-2"),value:"dall-e-2"}],path:"model",placeholder:e("Select a Model"),render:"IF_CONNECTION_SELECTED",required:!0,value:""},{componentName:l.componentName.mixInput,helperText:e("The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3."),id:"prompt-id",label:e("Image Generation Prompt"),onChange:"SET_PROMPT",path:"prompt",render:"IF_CONNECTION_SELECTED",required:!0,value:[]},{componentName:l.componentName.select,helperText:e("Size of the image or images."),id:"sizeForDalle2",label:e("Select Size"),onChange:"SET_DALL_E_2_SIZE",options:[{label:e("256x256"),value:"256x256"},{label:e("512x512"),value:"512x512"},{label:e("1024x1024"),value:"1024x1024"}],path:"sizeForDalle2",placeholder:e("Select a Size"),render:"IF_DALL_E_2_SELECTED",required:!0,value:""},{componentName:l.componentName.mixInput,helperText:e("The number of images to generate. Must be between 1 and 10."),id:"number",label:e("Number"),onChange:"SET_NUMBER",path:"n",render:"IF_DALL_E_2_SELECTED",value:[]},{componentName:l.componentName.select,helperText:e("Format to return the image or images in. For Base64-encoded PNG, the raw PNG image can be obtained using the IML function toBinary(<module_no>.data[].b64_json; base64) in following modules."),id:"response_format",label:e("Select Response Format"),onChange:"SET_RESPONSE",options:[{label:e("url"),value:"url"},{label:e("b64_json"),value:"b64_json"}],path:"response_format",placeholder:e("Select a Format"),render:"IF_DALL_E_2_SELECTED",value:""},{componentName:l.componentName.select,helperText:e("Size of the image."),id:"sizeForDalle3",label:e("Select Size"),onChange:"SET_DALL_E_3_SIZE",options:[{label:e("1024x1024"),value:"1024x1024"},{label:e("1792x1024"),value:"1792x1024"},{label:e("1024x1792"),value:"1024x1792"}],path:"sizeForDalle3",placeholder:e("Select a Size"),render:"IF_DALL_E_3_SELECTED",value:""},{componentName:l.componentName.select,helperText:e("Quality of the generated image. HD generates images with finer details and greater consistency across the image."),id:"quality",label:e("Select Quality"),onChange:"SET_QUALITY",options:[{label:e("Standard"),value:"standard"},{label:e("Hd"),value:"hd"}],path:"quality",placeholder:e("Select a Format"),render:"IF_DALL_E_3_SELECTED",required:!0,value:""},{componentName:l.componentName.select,id:"style",label:e("Select Style"),onChange:"SET_STYLE",options:[{label:e("Vivid"),value:"vivid"},{label:e("Natural"),value:"natural"}],path:"style",placeholder:e("Select a Style"),render:"IF_DALL_E_3_SELECTED",required:!0,value:""}]},actions:{SET_CONNECTION:async({$:a,e:n})=>{a.setThisComponent(o=>{o.value=n}),a.setDb(o=>{o.connection=n})},IF_CONNECTION_SELECTED:({$:a})=>r(a.getComponent("connection-id")?.value),IF_DALL_E_2_SELECTED:({$:a})=>{if(r(a.getComponent("connection-id")?.value)&&a.getComponent("model-id")?.value==="dall-e-2")return!0},IF_DALL_E_3_SELECTED:({$:a})=>{if(r(a.getComponent("connection-id")?.value)&&a.getComponent("model-id")?.value==="dall-e-3")return!0},SET_MODEL:async({$:a,e:n})=>{a.setThisComponent(o=>{o.value=n}),a.setDb(o=>{o.model=n})},SET_NUMBER:t("number"),SET_PROMPT:t("prompt"),SET_DALL_E_2_SIZE:t("sizeForDalle2"),SET_DALL_E_3_SIZE:t("sizeForDalle3"),SET_QUALITY:t("quality"),SET_STYLE:t("style"),SET_RESPONSE:t("responseFormat"),CONNECTION_ADD_CHANGE:d,ON_MACHINE_LOAD:async({$:a})=>{m(a,[{db:"connection",id:"connection-id"},{db:"model",id:"model-id"},{db:"prompt",id:"prompt-id"},{db:"number",id:"number"},{db:"quality",id:"quality"},{db:"style",id:"style"},{db:"responseFormat",id:"response_format"},{db:"sizeForDalle3",id:"sizeForDalle3"},{db:"sizeForDalle2",id:"sizeForDalle2"}])}}}));export{T as default};
