@extends('layouts.auth')
@section('page-title')
    {{ __('Register') }}
@endsection
@php
    $settings = Utility::settings();
    $logo = \App\Models\Utility::get_file('uploads/logo');
    $setting = \Modules\LandingPage\Entities\LandingPageSetting::settings();

@endphp
@push('custom-scripts')
    @if ($settings['recaptcha_module'] == 'on')
        {!! NoCaptcha::renderJs() !!}
    @endif
@endpush
@if ($settings['cust_darklayout'] == 'on')
    <style>
        .g-recaptcha {
            filter: invert(1) hue-rotate(180deg) !important;
        }
    </style>
@endif
@php
    $languages = App\Models\Utility::languages();
@endphp
@section('language-bar')
    <div class="lang-dropdown-only-desk">
        <li class="dropdown dash-h-item drp-language">
            <a class="dash-head-link dropdown-toggle btn" href="#" data-bs-toggle="dropdown" aria-expanded="false">
                <span class="drp-text"> {{ $languages[$lang] }}
                </span>
            </a>
            <div class="dropdown-menu dash-h-dropdown dropdown-menu-end">
                @foreach ($languages as $code => $language)
                    <a href="{{ route('register', [$ref, $code]) }}" tabindex="0" class="dropdown-item ">
                        <span>{{ Str::ucfirst($language) }}</span>
                    </a>
                @endforeach
            </div>
        </li>
    </div>
@endsection

@php
    $countryGroups = [
        'East Africa' => ['Burundi' => 'Burundi', 'Comoros' => 'Comoros', 'Djibouti' => 'Djibouti', 'DR Congo' => 'DR Congo', 'Eritrea' => 'Eritrea', 'Ethiopia' => 'Ethiopia', 'Kenya' => 'Kenya', 'Madagascar' => 'Madagascar', 'Malawi' => 'Malawi', 'Mauritius' => 'Mauritius', 'Mozambique' => 'Mozambique', 'Rwanda' => 'Rwanda', 'Seychelles' => 'Seychelles', 'Somalia' => 'Somalia', 'South Sudan' => 'South Sudan', 'Tanzania' => 'Tanzania', 'Uganda' => 'Uganda', 'Zambia' => 'Zambia', 'Zimbabwe' => 'Zimbabwe'],
        'Rest of Africa' => ['Algeria' => 'Algeria', 'Angola' => 'Angola', 'Benin' => 'Benin', 'Botswana' => 'Botswana', 'Burkina Faso' => 'Burkina Faso', 'Cameroon' => 'Cameroon', 'Cape Verde' => 'Cape Verde', 'Central African Republic' => 'Central African Republic', 'Chad' => 'Chad', 'Congo' => 'Congo', "Cote d'Ivoire" => "Cote d'Ivoire", 'Egypt' => 'Egypt', 'Equatorial Guinea' => 'Equatorial Guinea', 'Eswatini' => 'Eswatini', 'Gabon' => 'Gabon', 'Gambia' => 'Gambia', 'Ghana' => 'Ghana', 'Guinea' => 'Guinea', 'Guinea-Bissau' => 'Guinea-Bissau', 'Liberia' => 'Liberia', 'Libya' => 'Libya', 'Mali' => 'Mali', 'Mauritania' => 'Mauritania', 'Morocco' => 'Morocco', 'Namibia' => 'Namibia', 'Niger' => 'Niger', 'Nigeria' => 'Nigeria', 'Sao Tome and Principe' => 'Sao Tome and Principe', 'Senegal' => 'Senegal', 'Sierra Leone' => 'Sierra Leone', 'South Africa' => 'South Africa', 'Sudan' => 'Sudan', 'Togo' => 'Togo', 'Tunisia' => 'Tunisia'],
        'Rest of World' => ['Afghanistan' => 'Afghanistan', 'Albania' => 'Albania', 'Andorra' => 'Andorra', 'Argentina' => 'Argentina', 'Armenia' => 'Armenia', 'Australia' => 'Australia', 'Austria' => 'Austria', 'Azerbaijan' => 'Azerbaijan', 'Bahrain' => 'Bahrain', 'Bangladesh' => 'Bangladesh', 'Belgium' => 'Belgium', 'Brazil' => 'Brazil', 'Bulgaria' => 'Bulgaria', 'Canada' => 'Canada', 'China' => 'China', 'Croatia' => 'Croatia', 'Cyprus' => 'Cyprus', 'Czech Republic' => 'Czech Republic', 'Denmark' => 'Denmark', 'Finland' => 'Finland', 'France' => 'France', 'Germany' => 'Germany', 'India' => 'India', 'Iraq' => 'Iraq', 'Ireland' => 'Ireland', 'Israel' => 'Israel', 'Italy' => 'Italy', 'Japan' => 'Japan', 'Jordan' => 'Jordan', 'Kuwait' => 'Kuwait', 'Malaysia' => 'Malaysia', 'Netherlands' => 'Netherlands', 'New Zealand' => 'New Zealand', 'Norway' => 'Norway', 'Oman' => 'Oman', 'Pakistan' => 'Pakistan', 'Philippines' => 'Philippines', 'Poland' => 'Poland', 'Portugal' => 'Portugal', 'Qatar' => 'Qatar', 'Romania' => 'Romania', 'Russia' => 'Russia', 'Saudi Arabia' => 'Saudi Arabia', 'Singapore' => 'Singapore', 'Spain' => 'Spain', 'Sri Lanka' => 'Sri Lanka', 'Sweden' => 'Sweden', 'Switzerland' => 'Switzerland', 'Thailand' => 'Thailand', 'Turkey' => 'Turkey', 'Ukraine' => 'Ukraine', 'United Arab Emirates' => 'United Arab Emirates', 'United Kingdom' => 'United Kingdom', 'United States' => 'United States', 'Uzbekistan' => 'Uzbekistan', 'Vietnam' => 'Vietnam', 'Yemen' => 'Yemen']
    ];

    $stateGroups = [
        'Kenya (47 Counties)' => ['Baringo' => 'Baringo', 'Bomet' => 'Bomet', 'Bungoma' => 'Bungoma', 'Busia' => 'Busia', 'Elgeyo-Marakwet' => 'Elgeyo-Marakwet', 'Embu' => 'Embu', 'Garissa' => 'Garissa', 'Homa Bay' => 'Homa Bay', 'Isiolo' => 'Isiolo', 'Kajiado' => 'Kajiado', 'Kakamega' => 'Kakamega', 'Kericho' => 'Kericho', 'Kiambu' => 'Kiambu', 'Kilifi' => 'Kilifi', 'Kirinyaga' => 'Kirinyaga', 'Kisii' => 'Kisii', 'Kisumu' => 'Kisumu', 'Kitui' => 'Kitui', 'Kwale' => 'Kwale', 'Laikipia' => 'Laikipia', 'Lamu' => 'Lamu', 'Machakos' => 'Machakos', 'Makueni' => 'Makueni', 'Mandera' => 'Mandera', 'Marsabit' => 'Marsabit', 'Meru' => 'Meru', 'Migori' => 'Migori', 'Mombasa' => 'Mombasa', 'Muranga' => 'Muranga', 'Nairobi' => 'Nairobi', 'Nakuru' => 'Nakuru', 'Nandi' => 'Nandi', 'Narok' => 'Narok', 'Nyamira' => 'Nyamira', 'Nyandarua' => 'Nyandarua', 'Nyeri' => 'Nyeri', 'Samburu' => 'Samburu', 'Siaya' => 'Siaya', 'Taita-Taveta' => 'Taita-Taveta', 'Tana River' => 'Tana River', 'Tharaka-Nithi' => 'Tharaka-Nithi', 'Trans Nzoia' => 'Trans Nzoia', 'Turkana' => 'Turkana', 'Uasin Gishu' => 'Uasin Gishu', 'Vihiga' => 'Vihiga', 'Wajir' => 'Wajir', 'West Pokot' => 'West Pokot'],
        'East Africa Regions' => ['Central' => 'Central', 'Eastern' => 'Eastern', 'Northern' => 'Northern', 'Western' => 'Western', 'Karamoja' => 'Karamoja', 'Kigali' => 'Kigali', 'Arusha' => 'Arusha', 'Dar es Salaam' => 'Dar es Salaam', 'Dodoma' => 'Dodoma'],
        'GCC Regions' => ['Abu Dhabi' => 'Abu Dhabi', 'Ajman' => 'Ajman', 'Dubai' => 'Dubai', 'Fujairah' => 'Fujairah', 'Ras Al Khaimah' => 'Ras Al Khaimah', 'Sharjah' => 'Sharjah', 'Umm Al Quwain' => 'Umm Al Quwain', 'Riyadh' => 'Riyadh', 'Makkah' => 'Makkah', 'Madinah' => 'Madinah', 'Ad Dawhah' => 'Ad Dawhah', 'Muscat' => 'Muscat'],
        'Europe Regions' => ['England' => 'England', 'Scotland' => 'Scotland', 'Wales' => 'Wales', 'Northern Ireland' => 'Northern Ireland', 'Berlin' => 'Berlin', 'Bavaria' => 'Bavaria', 'Ile-de-France' => 'Ile-de-France', 'Madrid' => 'Madrid', 'Lazio' => 'Lazio', 'Lombardy' => 'Lombardy', 'Vienna' => 'Vienna', 'Zurich' => 'Zurich']
    ];
@endphp
@section('content')
    <div class="card-body">
        <div>
            <h2 class="mb-3 f-w-600">{{ __('Register') }}</h2>
        </div>
        <form method="POST" action="{{ route('register.store', ['plan' => $plan]) }}" class='needs-validation' novalidate>
            @if (session('status'))
                <div class="mb-4 font-medium text-lg text-green-600 text-danger">
                    {{ __('Email SMTP settings does not configured so please contact to your site admin.') }}
                </div>
            @endif
            @csrf
            <div class="">
                <div class="form-group mb-3">
                    <label for="name" class="form-label">{{ __('Name') }}</label>
                    <input id="name" type="text" class="form-control @error('name') is-invalid @enderror"
                        name="name" value="{{ old('name') }}" autocomplete="name" autofocus
                        placeholder="{{ __('Enter Name') }}" required="required">
                    @error('name')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                </div>
                <div class="form-group mb-3">
                    <label for="email" class="form-label">{{ __('Email') }}</label>
                    <input class="form-control @error('email') is-invalid @enderror" id="email" type="email"
                        name="email" value="{{ old('email') }}" autocomplete="email" autofocus
                        placeholder="{{ __('Enter Email') }}" required="required">
                    @error('email')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                    {{-- <div class="invalid-feedback">
                        {{ __('Please fill in your email') }}
                    </div> --}}
                </div>
                <div class="form-group mb-3">
                    <label for="password" class="form-label">{{ __('Password') }}</label>
                    <input id="password" type="password" data-indicator="pwindicator"
                        class="form-control pwstrength @error('password') is-invalid @enderror" name="password"
                        autocomplete="new-password" placeholder="{{ __('Enter Password') }}" required="required">
                    @error('password')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                    <div id="pwindicator" class="pwindicator">
                        <div class="bar"></div>
                        <div class="label"></div>
                    </div>
                </div>
                <div class="form-group mb-3">
                    <label for="password_confirmation" class="form-label">{{ __('Password Confirmation') }}</label>
                    <input id="password_confirmation" type="password" data-indicator="password_confirmation"
                        class="form-control pwstrength @error('password_confirmation') is-invalid @enderror"
                        name="password_confirmation" autocomplete="new-password"
                        placeholder="{{ __('Enter Confirm Password') }}" required="required">
                    @error('password_confirmation')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                    <div id="password_confirmation" class="pwindicator">
                        <div class="bar"></div>
                        <div class="label"></div>
                    </div>
                </div>
                {{-- Company Basic Information --}}
                <hr class="my-3">
                <h6 class="mb-3 text-muted fw-semibold">{{ __('Company Information') }}</h6>
                <div class="form-group mb-3">
                    <label for="company_name" class="form-label">{{ __('Company Name') }}</label>
                    <input id="company_name" type="text" class="form-control @error('company_name') is-invalid @enderror"
                        name="company_name" value="{{ old('company_name') }}"
                        placeholder="{{ __('Enter Company Name') }}">
                    @error('company_name')
                        <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                    @enderror
                </div>
                <div class="form-group mb-3">
                    <label for="phone" class="form-label">{{ __('Contact Number') }}</label>
                    <div class="input-group">
                        <select name="phone_code" class="form-select" style="max-width:115px;flex:0 0 115px;" aria-label="{{ __('Country code') }}">
                            <optgroup label="East Africa">
                                <option value="+254" {{ old('phone_code','+254')=='+254'?'selected':'' }}>KE +254</option>
                                <option value="+255" {{ old('phone_code')=='+255'?'selected':'' }}>TZ +255</option>
                                <option value="+256" {{ old('phone_code')=='+256'?'selected':'' }}>UG +256</option>
                                <option value="+250" {{ old('phone_code')=='+250'?'selected':'' }}>RW +250</option>
                                <option value="+257" {{ old('phone_code')=='+257'?'selected':'' }}>BI +257</option>
                                <option value="+211" {{ old('phone_code')=='+211'?'selected':'' }}>SS +211</option>
                                <option value="+251" {{ old('phone_code')=='+251'?'selected':'' }}>ET +251</option>
                                <option value="+252" {{ old('phone_code')=='+252'?'selected':'' }}>SO +252</option>
                                <option value="+253" {{ old('phone_code')=='+253'?'selected':'' }}>DJ +253</option>
                                <option value="+291" {{ old('phone_code')=='+291'?'selected':'' }}>ER +291</option>
                            </optgroup>
                            <optgroup label="Rest of Africa">
                                <option value="+20"  {{ old('phone_code')=='+20' ?'selected':'' }}>EG +20</option>
                                <option value="+234" {{ old('phone_code')=='+234'?'selected':'' }}>NG +234</option>
                                <option value="+233" {{ old('phone_code')=='+233'?'selected':'' }}>GH +233</option>
                                <option value="+27"  {{ old('phone_code')=='+27' ?'selected':'' }}>ZA +27</option>
                                <option value="+212" {{ old('phone_code')=='+212'?'selected':'' }}>MA +212</option>
                                <option value="+216" {{ old('phone_code')=='+216'?'selected':'' }}>TN +216</option>
                                <option value="+237" {{ old('phone_code')=='+237'?'selected':'' }}>CM +237</option>
                                <option value="+260" {{ old('phone_code')=='+260'?'selected':'' }}>ZM +260</option>
                                <option value="+263" {{ old('phone_code')=='+263'?'selected':'' }}>ZW +263</option>
                            </optgroup>
                            <optgroup label="Rest of World">
                                <option value="+971" {{ old('phone_code')=='+971'?'selected':'' }}>AE +971</option>
                                <option value="+966" {{ old('phone_code')=='+966'?'selected':'' }}>SA +966</option>
                                <option value="+974" {{ old('phone_code')=='+974'?'selected':'' }}>QA +974</option>
                                <option value="+91"  {{ old('phone_code')=='+91' ?'selected':'' }}>IN +91</option>
                                <option value="+86"  {{ old('phone_code')=='+86' ?'selected':'' }}>CN +86</option>
                                <option value="+44"  {{ old('phone_code')=='+44' ?'selected':'' }}>UK +44</option>
                                <option value="+1"   {{ old('phone_code')=='+1'  ?'selected':'' }}>US +1</option>
                                <option value="+49"  {{ old('phone_code')=='+49' ?'selected':'' }}>DE +49</option>
                                <option value="+33"  {{ old('phone_code')=='+33' ?'selected':'' }}>FR +33</option>
                                <option value="+61"  {{ old('phone_code')=='+61' ?'selected':'' }}>AU +61</option>
                            </optgroup>
                        </select>
                        <input id="phone" type="number" class="form-control @error('phone') is-invalid @enderror"
                            name="phone" value="{{ old('phone') }}"
                            placeholder="{{ __('Enter number without leading 0') }}"
                            min="0" step="1" autocomplete="tel">
                        <style>
                            #phone::-webkit-outer-spin-button,
                            #phone::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
                            #phone { -moz-appearance: textfield; }
                        </style>
                        @error('phone')
                            <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                        @enderror
                    </div>
                    <div class="text-muted mt-1" style="font-size: 11px;">
                        {{ __('Input Phone No. without Zero (0) infront') }}
                    </div>
                </div>

                {{-- Billing Address --}}
                <hr class="my-3">
                <h6 class="mb-3 text-muted fw-semibold">{{ __('Billing Address') }}</h6>
                <div class="row">
                    <div class="col-md-6 form-group mb-3">
                        <label for="billing_name" class="form-label">{{ __('Contact Name') }}</label>
                        <input id="billing_name" type="text" class="form-control @error('billing_name') is-invalid @enderror"
                            name="billing_name" value="{{ old('billing_name') }}"
                            placeholder="{{ __('Enter Name') }}">
                        @error('billing_name')
                            <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                        @enderror
                    </div>
                    <div class="col-md-6 form-group mb-3">
                        <label for="billing_phone" class="form-label">{{ __('Phone') }}</label>
                        <div class="input-group">
                            <select name="billing_phone_code" class="form-select" style="max-width:115px;flex:0 0 115px;" aria-label="{{ __('Country code') }}">
                                <optgroup label="East Africa">
                                    <option value="+254" {{ old('billing_phone_code','+254')=='+254'?'selected':'' }}>KE +254</option>
                                    <option value="+255" {{ old('billing_phone_code')=='+255'?'selected':'' }}>TZ +255</option>
                                    <option value="+256" {{ old('billing_phone_code')=='+256'?'selected':'' }}>UG +256</option>
                                    <option value="+250" {{ old('billing_phone_code')=='+250'?'selected':'' }}>RW +250</option>
                                    <option value="+257" {{ old('billing_phone_code')=='+257'?'selected':'' }}>BI +257</option>
                                    <option value="+211" {{ old('billing_phone_code')=='+211'?'selected':'' }}>SS +211</option>
                                    <option value="+251" {{ old('billing_phone_code')=='+251'?'selected':'' }}>ET +251</option>
                                    <option value="+252" {{ old('billing_phone_code')=='+252'?'selected':'' }}>SO +252</option>
                                    <option value="+291" {{ old('billing_phone_code')=='+291'?'selected':'' }}>ER +291</option>
                                </optgroup>
                                <optgroup label="Rest of Africa">
                                    <option value="+20"  {{ old('billing_phone_code')=='+20' ?'selected':'' }}>EG +20</option>
                                    <option value="+234" {{ old('billing_phone_code')=='+234'?'selected':'' }}>NG +234</option>
                                    <option value="+233" {{ old('billing_phone_code')=='+233'?'selected':'' }}>GH +233</option>
                                    <option value="+27"  {{ old('billing_phone_code')=='+27' ?'selected':'' }}>ZA +27</option>
                                    <option value="+212" {{ old('billing_phone_code')=='+212'?'selected':'' }}>MA +212</option>
                                    <option value="+966" {{ old('billing_phone_code')=='+966'?'selected':'' }}>SA +966</option>
                                    <option value="+971" {{ old('billing_phone_code')=='+971'?'selected':'' }}>AE +971</option>
                                    <option value="+44"  {{ old('billing_phone_code')=='+44' ?'selected':'' }}>UK +44</option>
                                    <option value="+1"   {{ old('billing_phone_code')=='+1'  ?'selected':'' }}>US +1</option>
                                </optgroup>
                            </select>
                            <input id="billing_phone" type="number" class="form-control @error('billing_phone') is-invalid @enderror"
                                name="billing_phone" value="{{ old('billing_phone') }}"
                                placeholder="{{ __('Enter number without leading 0') }}"
                                min="0" step="1" autocomplete="tel">
                            <style>
                                #billing_phone::-webkit-outer-spin-button,
                                #billing_phone::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
                                #billing_phone { -moz-appearance: textfield; }
                            </style>
                            @error('billing_phone')
                                <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                            @enderror
                        </div>
                        <div class="text-muted mt-1" style="font-size: 11px;">{{ __('Input Phone No. without Zero (0) infront') }}</div>
                    </div>
                </div>
                <div class="form-group mb-3">
                    <label for="billing_address" class="form-label">{{ __('Address') }}</label>
                    <input id="billing_address" class="form-control @error('billing_address') is-invalid @enderror"
                        name="billing_address" rows="3"
                        placeholder="{{ __('Enter Address') }}">{{ old('billing_address') }}
                    @error('billing_address')
                        <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                    @enderror
                </div>
                <div class="row">
                    <div class="col-md-6 form-group mb-3">
                        <label for="billing_city" class="form-label">{{ __('City') }}</label>
                        <input id="billing_city" type="text" class="form-control @error('billing_city') is-invalid @enderror"
                            name="billing_city" value="{{ old('billing_city') }}"
                            placeholder="{{ __('Enter City') }}">
                        @error('billing_city')
                            <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                        @enderror
                    </div>
                    <div class="co  l-md-6 form-group mb-3">
                        <label for="billing_state" class="form-label">{{ __('County/State') }}</label>
                        <select id="billing_state" name="billing_state" class="form-control @error('billing_state') is-invalid @enderror">
                            @foreach($stateGroups as $group => $states)
                                <optgroup label="{{ $group }}">
                                    @foreach($states as $val => $label)
                                        <option value="{{ $val }}" {{ old('billing_state', 'Nairobi') === $val ? 'selected' : '' }}>{{ $label }}</option>
                                    @endforeach
                                </optgroup>
                            @endforeach
                        </select>
                        @error('billing_state')
                            <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                        @enderror
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6 form-group mb-3">
                        <label for="billing_zip" class="form-label">{{ __('Postal/Zip Code') }}</label>
                        <input id="billing_zip" type="text" class="form-control @error('billing_zip') is-invalid @enderror"
                            name="billing_zip" value="{{ old('billing_zip') }}"
                            placeholder="{{ __('Enter Postal/Zip Code') }}">
                        @error('billing_zip')
                            <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                        @enderror
                    </div>
                    <div class="col-md-6 form-group mb-3">
                        <label for="billing_country" class="form-label">{{ __('Country') }}</label>
                        <select id="billing_country" name="billing_country" class="form-control @error('billing_country') is-invalid @enderror">
                            @foreach($countryGroups as $group => $countries)
                                <optgroup label="{{ $group }}">
                                    @foreach($countries as $val => $label)
                                        <option value="{{ $val }}" {{ old('billing_country', 'Kenya') === $val ? 'selected' : '' }}>{{ $label }}</option>
                                    @endforeach
                                </optgroup>
                            @endforeach
                        </select>
                        @error('billing_country')
                            <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
                        @enderror
                    </div>
                </div>
                <hr class="my-3">

                <div class="form-check custom-checkbox">
                    <input type="checkbox" class="form-check-input" id="termsCheckbox" name="terms" required="required">
                    <label class="form-check-label text-sm" for="termsCheckbox">{{ __('I agree to the ') }}
                        @if (is_array(json_decode($setting['menubar_page'])) || is_object(json_decode($setting['menubar_page'])))
                            @foreach (json_decode($setting['menubar_page']) as $key => $value)
                                @if (in_array($value->menubar_page_name, ['Terms and Conditions']) && isset($value->template_name))
                                    <a href="{{ $value->template_name == 'page_content' ? route('custom.page', $value->page_slug) : $value->page_url }}"
                                        target="_blank">{{ $value->menubar_page_name }}</a>
                                @endif
                            @endforeach
                            {{ __('and the ') }}
                            @foreach (json_decode($setting['menubar_page']) as $key => $value)
                                @if (in_array($value->menubar_page_name, ['Privacy Policy']) && isset($value->template_name))
                                    <a href="{{ $value->template_name == 'page_content' ? route('custom.page', $value->page_slug) : $value->page_url }}"
                                        target="_blank">{{ $value->menubar_page_name }}</a>
                                @endif
                            @endforeach
                        @endif
                    </label>
                </div>
                    @if ($settings['recaptcha_module'] == 'on')
                    @if (isset($settings['google_recaptcha_version']) && $settings['google_recaptcha_version'] == 'v2-checkbox')
                        <div class="form-group col-lg-12 col-md-12 mt-3">
                            {!! NoCaptcha::display() !!}
                            @error('g-recaptcha-response')
                                <span class="small text-danger" role="alert">
                                    <strong>{{ $message }}</strong>
                                </span>
                            @enderror
                        </div>
                    @else
                        <div class="form-group col-lg-12 col-md-12 mt-3">
                            <input type="hidden" id="g-recaptcha-response" name="g-recaptcha-response" class="form-control">
                            @error('g-recaptcha-response')
                                <span class="error small text-danger" role="alert">
                                    <strong>{{ $message }}</strong>
                                </span>
                            @enderror
                        </div>
                    @endif
                @endif

                <div class="d-grid">
                    <input type="hidden" name="ref_code" value="{{ $ref }}">
                    <button type="submit" class="btn btn-primary btn-block mt-2">{{ __('Register') }}</button>
                </div>

            </div>
            <p class="my-4 text-center">{{ __('Already have an account?') }} <a href="{{ route('login', $lang) }}"
                    class="text-primary">{{ __('Login') }}</a></p>
        </form>

    </div>
@endsection
@if (isset($settings['recaptcha_module']) && $settings['recaptcha_module'] == 'on')
    @if (isset($settings['google_recaptcha_version']) && $settings['google_recaptcha_version'] == 'v2-checkbox')
        {!! NoCaptcha::renderJs() !!}
    @else
        <script src="https://www.google.com/recaptcha/api.js?render={{ $settings['google_recaptcha_key'] }}"></script>
        <script>
            $(document).ready(function() {
                grecaptcha.ready(function() {
                    grecaptcha.execute('{{ $settings['google_recaptcha_key'] }}', {
                        action: 'submit'
                    }).then(function(token) {
                        $('#g-recaptcha-response').val(token);
                    });
                });
            });
        </script>
    @endif
@endif
