<div x-data="{
        googleanalyticsEnabled: @entangle('google_analytics_enabled')
    }">
    <form id="website-analytics-settings-card" novalidate="novalidate">
        <div class="card">
            <div class="card-body">
                <h5>Google Analytics</h5>
                <div class="mb-6">
                    <a href="https://analytics.google.com/analytics/web/">https://analytics.google.com/analytics/web/</a>
                </div>
                <div class="mb-4">
                    <x-form.checkbox
                        name='google_analytics_enabled'
                        wire:model.defer='google_analytics_enabled'
                        parent_class='form-switch'>
                        Habilitar Google Analytics
                    </x-form.checkbox>
                </div>
                <div class="mb-4 fv-row">
                    <label for="google_analytics_id" class="form-label">ID de medición de Google Analytics</label>
                    <div class="input-group">
                        <span class="input-group-text"><i class="fab fa-google"></i></span>
                        <input type="text" id="google_analytics_id" name="google_analytics_id" wire:model='google_analytics_id' class="form-control" placeholder="XX-12345678901"  :disabled="!googleanalyticsEnabled">
                    </div>
                    @error("google_analytics_id")
                        <span class="text-danger">{{ $message }}</span>
                    @enderror
                </div>
            </div>
        </div>
        <div>
            {{-- Botones --}}
            <div class="row my-4">
                <div class="col-lg-12 text-end">
                    <button
                        type="submit"
                        class="btn btn-primary btn-save btn-sm mt-2 mr-2 waves-effect waves-light"
                        disabled
                        data-loading-text="Guardando...">
                        <i class="ti ti-device-floppy mr-2"></i>
                        Guardar cambios
                    </button>
                    <button
                        type="button"
                        wire:click="loadSettings"
                        class="btn btn-secondary btn-cancel btn-sm mt-2 mr-2 waves-effect waves-light"
                        disabled>
                        <i class="ti ti-rotate-2 mr-2"></i>
                        Cancelar
                    </button>
                </div>
            </div>
            {{-- Notifications --}}
            <div class="notification-container" wire:ignore></div>
        </div>
    </form>
</div>
