import { defineAsyncComponent, markRaw } from 'vue';

import AddButtonEdge from '../editor/edges/AddButtonEdge.vue';

const AppCreateNode = defineAsyncComponent(() => import('../editor/nodes/AppCreateNode.vue'));
const AppDesignNode = defineAsyncComponent(() => import('../editor/nodes/AppDesignNode.vue'));
const AppSettingsNode = defineAsyncComponent(() => import('../editor/nodes/AppSettingsNode.vue'));
const AppUpdateNode = defineAsyncComponent(() => import('../editor/nodes/AppUpdateNode.vue'));
const ChoiceNode = defineAsyncComponent(() => import('../editor/nodes/ChoiceNode.vue'));
const CodeNode = defineAsyncComponent(() => import('../editor/nodes/CodeNode.vue'));
const ConditionNode = defineAsyncComponent(() => import('../editor/nodes/ConditionNode.vue'));
const ConfirmNode = defineAsyncComponent(() => import('../editor/nodes/ConfirmNode.vue'));
const DashboardBasicInfoNode = defineAsyncComponent(() => import('../editor/nodes/DashboardBasicInfoNode.vue'));
const DashboardCreateNode = defineAsyncComponent(() => import('../editor/nodes/DashboardCreateNode.vue'));
const DashboardDesignNode = defineAsyncComponent(() => import('../editor/nodes/DashboardDesignNode.vue'));
const DashboardPublishNode = defineAsyncComponent(() => import('../editor/nodes/DashboardPublishNode.vue'));
const DbDeleteNode = defineAsyncComponent(() => import('../editor/nodes/DbDeleteNode.vue'));
const DbInsertNode = defineAsyncComponent(() => import('../editor/nodes/DbInsertNode.vue'));
const DbQueryNode = defineAsyncComponent(() => import('../editor/nodes/DbQueryNode.vue'));
const DbSqlNode = defineAsyncComponent(() => import('../editor/nodes/DbSqlNode.vue'));
const DbUpdateNode = defineAsyncComponent(() => import('../editor/nodes/DbUpdateNode.vue'));
const EndNode = defineAsyncComponent(() => import('../editor/nodes/EndNode.vue'));
const FormBasicInfoNode = defineAsyncComponent(() => import('../editor/nodes/FormBasicInfoNode.vue'));
const FormCreateNode = defineAsyncComponent(() => import('../editor/nodes/FormCreateNode.vue'));
const FormDatabaseCreateNode = defineAsyncComponent(() => import('../editor/nodes/FormDatabaseCreateNode.vue'));
const FormDatabaseDesignNode = defineAsyncComponent(() => import('../editor/nodes/FormDatabaseDesignNode.vue'));
const FormDataNode = defineAsyncComponent(() => import('../editor/nodes/FormDataNode.vue'));
const FormListDesignNode = defineAsyncComponent(() => import('../editor/nodes/FormListDesignNode.vue'));
const FormPublishNode = defineAsyncComponent(() => import('../editor/nodes/FormPublishNode.vue'));
const FormUIDesignNode = defineAsyncComponent(() => import('../editor/nodes/FormUIDesignNode.vue'));
const HttpNode = defineAsyncComponent(() => import('../editor/nodes/HttpNode.vue'));
const IntentNode = defineAsyncComponent(() => import('../editor/nodes/IntentNode.vue'));
const KnowledgeRetrievalNode = defineAsyncComponent(() => import('../editor/nodes/KnowledgeRetrievalNode.vue'));
const LLMNode = defineAsyncComponent(() => import('../editor/nodes/LLMNode.vue'));
const LoopNode = defineAsyncComponent(() => import('../editor/nodes/LoopNode.vue'));
const MergeNode = defineAsyncComponent(() => import('../editor/nodes/MergeNode.vue'));
const MessageNode = defineAsyncComponent(() => import('../editor/nodes/MessageNode.vue'));
const ParallelNode = defineAsyncComponent(() => import('../editor/nodes/ParallelNode.vue'));
const QuestionNode = defineAsyncComponent(() => import('../editor/nodes/QuestionNode.vue'));
const SnowflakeCortexAnalystNode = defineAsyncComponent(() => import('../editor/nodes/SnowflakeCortexAnalystNode.vue'));
const SnowflakeCortexLLMNode = defineAsyncComponent(() => import('../editor/nodes/SnowflakeCortexLLMNode.vue'));
const StartNode = defineAsyncComponent(() => import('../editor/nodes/StartNode.vue'));
const SubflowNode = defineAsyncComponent(() => import('../editor/nodes/SubflowNode.vue'));
const SystemSummaryNode = defineAsyncComponent(() => import('../editor/nodes/SystemSummaryNode.vue'));
const TemplateNode = defineAsyncComponent(() => import('../editor/nodes/TemplateNode.vue'));
const TextToSqlNode = defineAsyncComponent(() => import('../editor/nodes/TextToSqlNode.vue'));

export const workflowNodeTypes = {
  start: markRaw(StartNode),
  llm: markRaw(LLMNode),
  end: markRaw(EndNode),
  http: markRaw(HttpNode),
  code: markRaw(CodeNode),
  condition: markRaw(ConditionNode),
  template: markRaw(TemplateNode),
  parallel: markRaw(ParallelNode),
  merge: markRaw(MergeNode),
  db_insert: markRaw(DbInsertNode),
  db_update: markRaw(DbUpdateNode),
  db_query: markRaw(DbQueryNode),
  db_delete: markRaw(DbDeleteNode),
  db_sql: markRaw(DbSqlNode),
  question: markRaw(QuestionNode),
  choice: markRaw(ChoiceNode),
  message: markRaw(MessageNode),
  confirm: markRaw(ConfirmNode),
  intent: markRaw(IntentNode),
  snowflake_cortex_llm: markRaw(SnowflakeCortexLLMNode),
  snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
  loop: markRaw(LoopNode),
  form_basic_info: markRaw(FormBasicInfoNode),
  form_database_design: markRaw(FormDatabaseDesignNode),
  form_database_create: markRaw(FormDatabaseCreateNode),
  form_ui_design: markRaw(FormUIDesignNode),
  form_list_design: markRaw(FormListDesignNode),
  form_create: markRaw(FormCreateNode),
  form_publish: markRaw(FormPublishNode),
  app_create: markRaw(AppCreateNode),
  app_design: markRaw(AppDesignNode),
  app_settings: markRaw(AppSettingsNode),
  app_update: markRaw(AppUpdateNode),
  dashboard_basic_info: markRaw(DashboardBasicInfoNode),
  dashboard_design: markRaw(DashboardDesignNode),
  dashboard_create: markRaw(DashboardCreateNode),
  dashboard_publish: markRaw(DashboardPublishNode),
  system_summary: markRaw(SystemSummaryNode),
  subflow: markRaw(SubflowNode),
  form_data_create: markRaw(FormDataNode),
  form_data_read: markRaw(FormDataNode),
  form_data_update: markRaw(FormDataNode),
  form_data_delete: markRaw(FormDataNode),
  form_data_list: markRaw(FormDataNode),
  form_schema_to_llm: markRaw(FormDataNode),
  text_to_sql: markRaw(TextToSqlNode),
  knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
};

export const workflowEdgeTypes = {
  addButton: markRaw(AddButtonEdge),
};
