

<?php $__env->startSection('content'); ?>

    <div class="py-6">
        <div class="container">
            <div class="row">
                <div class="col-xxl-5 col-xl-6 col-md-8 mx-auto">
                    <div class="bg-white rounded shadow-sm p-4 text-left">
                        <h1 class="h3 fw-600"><?php echo e(translate('Forgot Password?')); ?></h1>
                        <p class="mb-4 opacity-60"><?php echo e(translate('Enter your email address to recover your password.')); ?>

                        </p>
                        <form method="POST" action="<?php echo e(route('password.email')); ?>">
                            <?php echo csrf_field(); ?>
                            <div class="form-group">

                                <?php if(addon_is_activated('otp_system')): ?>
                                    <div class="form-group phone-form-group mb-1">
                                        <input type="tel" id="phone-code"
                                            class="form-control<?php echo e($errors->has('phone') ? ' is-invalid' : ''); ?>"
                                            value="<?php echo e(old('phone')); ?>" placeholder="" name="phone" autocomplete="off">
                                    </div>

                                    <input type="hidden" name="country_code" value="">

                                    <div class="form-group email-form-group mb-1 d-none">
                                        <input type="email"
                                            class="form-control <?php echo e($errors->has('email') ? ' is-invalid' : ''); ?>"
                                            value="<?php echo e(old('email')); ?>" placeholder="<?php echo e(translate('Email')); ?>"
                                            name="email" id="email" autocomplete="off">
                                        <?php if($errors->has('email')): ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($errors->first('email')); ?></strong>
                                            </span>
                                        <?php endif; ?>
                                    </div>

                                    <div class="form-group text-right">
                                        <button class="btn btn-link p-0 text-primary" type="button"
                                            onclick="toggleEmailPhone(this)"><i>*<?php echo e(translate('Use Email Instead')); ?></i></button>
                                    </div>
                                <?php else: ?>
                                    <div class="form-group">
                                        <input type="email"
                                            class="form-control<?php echo e($errors->has('email') ? ' is-invalid' : ''); ?>"
                                            value="<?php echo e(old('email')); ?>" placeholder="<?php echo e(translate('Email')); ?>"
                                            name="email" id="email" autocomplete="off">
                                        <?php if($errors->has('email')): ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($errors->first('email')); ?></strong>
                                            </span>
                                        <?php endif; ?>
                                    </div>
                                <?php endif; ?>

                                <?php if($errors->has('email')): ?>
                                    <span class="invalid-feedback" role="alert">
                                        <strong><?php echo e($errors->first('email')); ?></strong>
                                    </span>
                                <?php endif; ?>
                            </div>
                            <div class="form-group text-right">
                                <button class="btn btn-primary btn-block" type="submit">
                                    <?php echo e(translate('Send Password Reset Link')); ?>

                                </button>
                            </div>
                        </form>
                        <div class="mt-3">
                            <a href="<?php echo e(route('user.login')); ?>"
                                class="text-reset opacity-60"><?php echo e(translate('Back to Login')); ?></a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


<?php $__env->stopSection(); ?>


<?php $__env->startSection('script'); ?>
    <script type="text/javascript">
        <?php if(addon_is_activated('otp_system')): ?>
            var isPhoneShown = true,
                countryData = window.intlTelInputGlobals.getCountryData(),
                input = document.querySelector("#phone-code");

            for (var i = 0; i < countryData.length; i++) {
                var country = countryData[i];
                if (country.iso2 == 'bd') {
                    country.dialCode = '88';
                }
            }

            var iti = intlTelInput(input, {
                separateDialCode: true,
                utilsScript: "<?php echo e(static_asset('assets/js/intlTelutils.js')); ?>?1590403638580",
                onlyCountries: <?php
                    echo json_encode(
                        \App\Models\Country::where('status', 1)
                            ->pluck('code')
                            ->toArray(),
                    );
                ?>,
                customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
                    if (selectedCountryData.iso2 == 'bd') {
                        return "01xxxxxxxxx";
                    }
                    return selectedCountryPlaceholder;
                }
            });

            var country = iti.getSelectedCountryData();
            $('input[name=country_code]').val(country.dialCode);

            input.addEventListener("countrychange", function(e) {
                // var currentMask = e.currentTarget.placeholder;

                var country = iti.getSelectedCountryData();
                $('input[name=country_code]').val(country.dialCode);

            });

            function toggleEmailPhone(el) {
                if (isPhoneShown) {
                    $('.phone-form-group').addClass('d-none');
                    $('.email-form-group').removeClass('d-none');
                    $('input[name=phone]').val(null);
                    isPhoneShown = false;
                    $(el).html('<i>*<?php echo e(translate('Use Phone Number Instead')); ?></i>');
                } else {
                    $('.phone-form-group').removeClass('d-none');
                    $('.email-form-group').addClass('d-none');
                    $('input[name=email]').val(null);
                    isPhoneShown = true;
                    $(el).html('<i>*<?php echo e(translate('Use Email Instead')); ?></i>');
                }
            }
        <?php endif; ?>
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('frontend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home4/swiftma4/public_html/clavisfashionhub/resources/views/auth/passwords/email.blade.php ENDPATH**/ ?>