{{--
Visual Flow Builder -- Single-page three-panel layout
Left: Config/Details panel (w-80)
Center: Visual flow canvas (flex-1)
Right: Add Node panel (w-64)
All wire:click / wire:model bindings target existing WorkflowBuilder.php methods & properties.
--}}
@php
// ── Icon SVG path data (reused across canvas nodes AND the left panel) ──
$triggerIconPaths = [
'email_received' => '',
'contact_created' => '',
'contact_updated' => '',
'deal_stage_changed'=> '',
'tag_added' => '',
'tag_removed' => '',
'form_submitted' => '',
'webhook_received' => '',
'scheduled' => '',
'campaign_opened' => '',
'campaign_clicked' => '',
];
$subtypeIcons = [
'send_email' => '',
'send_notification' => '',
'add_tag' => '',
'remove_tag' => '',
'update_contact' => '',
'assign_agent' => '',
'create_deal' => '',
'move_deal' => '',
'wait_delay' => '',
'webhook_call' => '',
'ai_reply' => '',
'if_else' => '',
'has_tag' => '',
'contact_field' => '',
'email_opened' => '',
'email_clicked' => '',
'add_to_group' => '',
'remove_from_group' => '',
'in_group' => '',
];
// Short descriptions for the right-panel add-node cards
$actionDescriptions = [
'send_email' => __('Compose and send an email'),
'send_notification' => __('Alert via email, Slack, or in-app'),
'add_tag' => __('Attach a tag to the contact'),
'remove_tag' => __('Detach a tag from the contact'),
'update_contact' => __('Change a contact field value'),
'assign_agent' => __('Route to a team member'),
'create_deal' => __('Open a new deal in pipeline'),
'move_deal' => __('Advance a deal to next stage'),
'wait_delay' => __('Pause before the next step'),
'webhook_call' => __('Send data to an external app via Webhook'),
'ai_reply' => __('Generate a reply with AI'),
'add_to_group' => __('Add contact to a group'),
'remove_from_group' => __('Remove contact from a group'),
];
$conditionDescriptions = [
'if_else' => __('Branch on a field value'),
'has_tag' => __('Check if contact has a tag'),
'contact_field' => __('Evaluate a contact property'),
'email_opened' => __('Was the email opened?'),
'email_clicked' => __('Was a link clicked?'),
'in_group' => __('Check if contact is in a group'),
];
$currentTriggerIcon = $triggerIconPaths[$triggerType] ?? '';
@endphp
{{-- ================================================================== --}}
{{-- TOP BAR --}}
{{-- ================================================================== --}}