@foreach($form->schema['form'] as $key => $element)
@php
$custom_attributes = isset($element['custom_attributes']) ? $element['custom_attributes'] : [];
@endphp
@if($element['type'] == 'text')
@elseif($element['type'] == 'range')
@elseif($element['type'] == 'calendar')
@elseif($element['type'] == 'textarea')
@elseif(in_array($element['type'], ['radio', 'checkbox']))
@elseif($element['type'] == 'dropdown')
@elseif($element['type'] == 'heading')
@php
echo '<' . $element['tag'] . ' style="color:' . $element['text_color'] . '">' . $element['content'] .'' . $element['tag'] . '>';
@endphp
@elseif($element['type'] == 'file_upload')
$custom_attributes])>
@if(!empty($element['help_text']))
{{$element['help_text']}}
@endif
@elseif($element['type'] == 'text_editor')
@if(!empty($element['help_text']))
{{$element['help_text']}}
@endif
@elseif($element['type'] == 'terms_and_condition')
@elseif($element['type'] == 'hr')
@elseif($element['type'] == 'html_text')
{!!$element['html_text']!!}
@elseif($element['type'] == 'rating')
@elseif($element['type'] == 'switch')
$custom_attributes]) data-msg-required="{{$element['required_error_msg']}}">
@if(!empty($element['help_text']))
{{$element['help_text']}}
@endif
@elseif($element['type'] == 'signature')
{{__('messages.clear')}}
{{__('messages.undo')}}
@if(!empty($element['help_text']))
{{$element['help_text']}}
@endif
@elseif(($element['type'] == 'youtube') && !empty($element['iframe_url']))
@php
$video_id = '';
$url = $element['iframe_url'];
if (str_contains($url, 'watch')) {
$video_id = str_replace('https://www.youtube.com/watch?v=', '', $url);
} else if (str_contains($url, 'youtu.be')) {
$video_id = str_replace('https://youtu.be/', '', $url);
} else if (str_contains($url, 'embed')) {
$video_id = str_replace('https://www.youtube.com/embed/', '', $url);
}
$yt_embed_url = "https://www.youtube.com/embed/{$video_id}";
@endphp
@elseif(($element['type'] == 'iframe') && !empty($element['iframe_url']))
@elseif(($element['type'] == 'pdf') && !empty($element['pdf']))
@elseif($element['type'] == 'countdown')
@endif