@php $endereco = $empresa->endereco @endphp
<div class="mb-3">
    <input type="hidden" name="domicilio" id="domicilio" value="OUTROS"/>
    <label for="cep" class="form-label">{{ __("CEP") }} <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('cep') is-invalid @enderror" name="cep" id="zipCode" data-mask="cep" autocomplete="off" value="{{ old('cep', $endereco->cep) }}">
    @error('cep')
        <small class="text-danger">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="logradouro" class="form-label">{{ __("Logradouro") }} <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('logradouro') is-invalid @enderror" name="logradouro" id="street" autocomplete="off" value="{{ old('logradouro', $endereco->logradouro) }}">
                                @error('logradouro')
        <small class="text-danger">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="numero" class="form-label">{{ __("Número") }}</label>
    <input type="text" class="form-control @error('numero') is-invalid @enderror" name="numero" id="numero" value="{{ old('numero', $endereco->numero) }}">
                                @error('numero')
        <small class="text-danger">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="complemento" class="form-label">{{ __("Complemento") }}</label>
    <input type="text" class="form-control" name="complemento" id="complemento" value="{{ old('complemento', $endereco->complemento) }}">
</div>
<div class="mb-3">
    <label for="cidade" class="form-label">{{ __("Cidade") }} <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('cidade') is-invalid @enderror" name="cidade" id="city" autocomplete="off" value="{{ old('cidade', $endereco->cidade) }}">
                                @error('cidade')
        <small class="text-danger">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="bairro" class="form-label">{{ __("Bairro") }} <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('bairro') is-invalid @enderror" name="bairro" id="neighborhood" autocomplete="off" value="{{ old('bairro', $endereco->bairro) }}">
                                @error('bairro')
        <small class="text-danger">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="uf" class="form-label">{{ __("UF") }} <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('uf') is-invalid @enderror" name="uf" id="state" maxlength="2" autocomplete="off" value="{{ old('uf', $endereco->uf) }}">
                                @error('uf')
        <small class="text-danger">{{ $message }}</small>
    @enderror
</div>

<div class="mb-3">
    <label for="photo" class="form-label text-bold">{{ __("Comprovante de endereço") }}:</label>
    <input type="file" class="form-control" name="comprovante" id="comprovante" accept="image/jpeg,image/jpg,image/png,image/gif,.pdf" />
</div>

<div class="mb-3">
    <a href="{{ asset($endereco->comprovante) }}" class="text-primary" download>
        {{ __("Comprovante") }} - <small>{{ __("baixar") }}</small> <i class="fa-solid fa-download"></i>
    </a>
</div>

<hr/>

<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#mapModal">
    {{ __("Selecionar Ponto no Mapa") }}
</button>

<div class="my-3">
    <label for="latitude" class="form-label">{{ __("Latitude") }} <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('latitude') is-invalid @enderror bg-light" name="latitude" id="latitude" autocomplete="off" value="{{ old('latitude', $endereco->latitude) }}" readonly="true">
                                @error('latitude')
        <small class="text-danger">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="longitude" class="form-label">{{ __("Longitude") }} <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('longitude') is-invalid @enderror bg-light" name="longitude" id="longitude" autocomplete="off" value="{{ old('longitude', $endereco->longitude) }}" readonly="true">
                                @error('longitude')
        <small class="text-danger">{{ $message }}</small>
    @enderror
</div>

<div class="modal fade" id="mapModal" tabindex="-1" aria-labelledby="mapModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="mapModalLabel">{{ __("Clique no mapa para escolher um Ponto Turístico") }}</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ __('Fechar') }}"></button>
            </div>
            <div class="modal-body">
                <div id="map"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary me-3" data-bs-dismiss="modal">{{ __("Cancelar") }}</button>
                <button type="button" class="btn btn-success" id="okBtn" data-bs-dismiss="modal">{{ __("OK") }}</button>
            </div>
        </div>
    </div>
</div>
