<div>
    <div class="row">
        <div class="col-xl-12 col-xxl-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title">Datos Generales</h4>
                </div>
                <div class="card-body">
                    <form wire:submit.prevent="submit">
                        <!--[if BLOCK]><![endif]--><?php if($errors->any()): ?>
                            <div class="alert alert-danger">
                                <ul>
                                    <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li><?php echo e($error); ?></li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                </ul>
                            </div>
                        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                    <div class="row">
                        <div class="col-md-2 col-sm-12">
                            <div class="form-group">
                                <label for="fecha_ingreso">Fecha de Ingreso <span class="text-danger">(*)</span></label>
                                <input type="date" class="form-control <?php $__errorArgs = ['fecha_ingreso'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> error <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" wire:model.live="fecha_ingreso">
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['fecha_ingreso'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>
                        <div class="col-md-2 col-sm-12">
                            <div class="form-group">
                                <label for="entidad_id">Entidad</label>
                                <select class="form-control select2 <?php $__errorArgs = ['entidad_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> error <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" wire:model.live="entidad_id" id="entidad_id">
                                    <option value="">--SELECCIONE--</option>
                                    <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $entidades; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $entidad): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($entidad->id); ?>" <?php echo e(old('entidad_id') == $entidad->id ? 'selected' : ''); ?>><?php echo e($entidad->nombre); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                </select>
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['entidad_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>
                        <div class="col-md-8 col-sm-12">
                            <div class="form-group">
                                <label for="responsable_id">Técnico Asignado</label>
                                <select class="form-control select2  <?php $__errorArgs = ['responsable_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> error <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"  wire:model.live="responsable_id" id="responsable_id">
                                    <option value="">--SELECCIONE--</option>
                                    <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $responsables; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $responsable): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($responsable->id); ?>" <?php echo e(old('responsable_id') == $responsable->id ? 'selected' : ''); ?>><?php echo e($responsable->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                </select>
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['responsable_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        
                        <div class="col-md-4">
                            <div class="form-group" >
                                    <label for="gerencia_id">Gerencia</label>
                                    <select id="gerencia_id" class="form-control select2" wire:model.live="gerencia_id" >
                                        <option value="">--SELECCIONE--</option>
                                        <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $gerencias; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gerencia): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($gerencia->id); ?>" <?php if($gerencia_id == $gerencia->id): echo 'selected'; endif; ?>>
                                                <?php echo e($gerencia->nombre); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                    </select>
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['gerencia_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group" >
                                    <label for="unidad_id">Unidad</label>
                                    <select id="unidad_id" class="form-control select2" wire:model.live="unidad_id" >
                                        <option value="">--SELECCIONE--</option>
                                        <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $unidades; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $unidad): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($unidad->id); ?>" <?php if($unidad_id == $unidad->id): echo 'selected'; endif; ?>>
                                                <?php echo e($unidad->nombre); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                    </select>
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['unidad_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12 col-sm-12">
                            <div class="form-group">
                                <label for="objeto_contratacion">Objeto de la Contratación <span class="text-danger">(*)</span></label>
                                <textarea name="objeto_contratacion" id="objeto_contratacion" wire:model.live="objeto_contratacion" class="form-control <?php $__errorArgs = ['objeto_contratacion'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> error <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" cols="30" rows="2"><?php echo e(old('objeto_contratacion')); ?></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-3 col-sm-12">
                            <div class="form-group">
                                <label for="normativa_id">Normativa Aplicable <span class="text-danger">(*)</span></label>
                                <select id="normativa_id" class="form-control select2 <?php $__errorArgs = ['normativa_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> error <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" wire:model.live="normativa_id">
                                    <option value="">--SELECCIONE--</option>
                                    <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $normativas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $normativa): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($normativa->id); ?>" <?php echo e(old('normativa_id') == $normativa->id ? 'selected' : ''); ?>><?php echo e($normativa->nombre); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                </select>
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['normativa_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>
                        <div class="col-md-3 col-sm-12">
                            <div class="form-group">
                                <label for="modalidad_id">Modalidad del Proceso <span class="text-danger">(*)</span></label>
                                <select id="modalidad_id" class="form-control select2 <?php $__errorArgs = ['modalidad_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> error <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" wire:model.live="modalidad_id">
                                    <option value="">--SELECCIONE--</option>
                                    <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $modalidades; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $modalidad): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($modalidad->id); ?>" <?php echo e(old('modalidad_id') == $modalidad->id ? 'selected' : ''); ?>><?php echo e($modalidad->nombre); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                </select>
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['modalidad_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>
                        <div class="col-md-3 col-sm-12">
                            <div class="form-group">
                                <label for="tipo_contratacion_id">Tipo Contratación <span class="text-danger">(*)</span></label>
                                <select wire:model.live="tipoContratacionId" id="tipoContratacionId"
                                        class="form-control select2">
                                    <option value="">--SELECCIONE--</option>
                                    <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $tiposContratacion; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tipo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($tipo->id); ?>"><?php echo e($tipo->nombre); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                </select>
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['tipoContratacionId'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>

                        <div class="col-md-3 col-sm-12">
                            <div class="form-group">
                                <label for="forma_adjudicacion_id">Forma Adjudicación <span class="text-danger">(*)</span></label>
                                <select wire:model.live="formaAdjudicacionId" id="formaAdjudicacionId"
                                        class="form-control select2">
                                    <option value="">--SELECCIONE--</option>
                                    <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $formasDisponibles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $forma): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($forma->id); ?>"><?php echo e($forma->nombre); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                </select>
                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['formaAdjudicacionId'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group mb-4">
                            <div class="flex justify-between items-center mb-2">
                                <h3 class="font-bold">Especificaciones</h3>
                                <button type="button" wire:click="openItemModal" class="btn btn-secondary">Agregar</button>
                            </div>

                            <!--[if BLOCK]><![endif]--><?php if(session()->has('message')): ?>
                                <div class="mb-2 text-green-700"><?php echo e(session('message')); ?></div>
                            <?php endif; ?><!--[if ENDBLOCK]><![endif]-->

                            <table class="table table-hover" style="width: 100%;">
                                <thead>
                                    <tr>
                                        <th class="text-center">Acciones</th>
                                        <th class="text-center">Nombre</th>
                                        <th class="text-center">Precio Referencial</th>
                                        <th class="text-center">Unidad Medida</th>
                                        <th class="text-center">Tiempo o Plazo de Entrega</th>
                                        <th class="text-center">Forma de  Entrega</th>
                                        <th class="text-center">Lugar de Entrega</th>
                                        <th class="text-center">Garantia</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $idx => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td class="text-center">
                                                <button type="button" wire:click="openItemModal(<?php echo e($idx); ?>)" class="btn btn-warning btn-sm"><i class="fa fa-edit"></i></button>
                                                <button type="button" wire:click="removeItem(<?php echo e($idx); ?>)" class="btn btn-danger btn-sm"><i class="fa fa-trash"></i></button>
                                            </td>
                                            <td class="text-center">
                                                <input readonly type="text" wire:model.defer="items.<?php echo e($idx); ?>.nombre" class="w-full border p-1 rounded" />
                                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ["items.{$idx}.nombre"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                                            </td>
                                            <td class="text-center">
                                                <input readonly type="number" min="1" wire:model.defer="items.<?php echo e($idx); ?>.monto" class="w-full border p-1 rounded" />
                                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ["items.{$idx}.monto"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                                            </td>
                                            <td class="text-center">
                                                <input readonly type="text" min="1" wire:model.defer="items.<?php echo e($idx); ?>.unidad" class="w-full border p-1 rounded" />
                                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ["items.{$idx}.unidad"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                                            </td>
                                            <td class="text-center">
                                                <input readonly type="text" min="1" wire:model.defer="items.<?php echo e($idx); ?>.tiempo_entrega" class="w-full border p-1 rounded" />
                                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ["items.{$idx}.tiempo_entrega"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                                            </td>
                                            <td class="text-center">
                                                <input readonly type="text" min="1" wire:model.defer="items.<?php echo e($idx); ?>.forma_entrega" class="w-full border p-1 rounded" />
                                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ["items.{$idx}.forma_entrega"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                                            </td>
                                            <td class="text-center">
                                                <input readonly type="text" min="1" wire:model.defer="items.<?php echo e($idx); ?>.lugar_entrega" class="w-full border p-1 rounded" />
                                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ["items.{$idx}.lugar_entrega"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                                            </td>
                                            <td class="text-center">
                                                <input readonly type="file" min="1" wire:model.defer="items.<?php echo e($idx); ?>.garantia" class="w-full border p-1 rounded" />
                                                <!--[if BLOCK]><![endif]--><?php $__errorArgs = ["items.{$idx}.garantia"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                                    <!--[if BLOCK]><![endif]--><?php if(count($items) === 0): ?>
                                        <tr>
                                            <td colspan="4" class="p-2 text-center text-gray-600">No hay ítems agregados.</td>
                                        </tr>
                                    <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="text-center">
                        <button type="submit" class="btn btn-primary rounded">Registrar</button>
                        <a href="<?php echo e(route('procesos-contratacion.index')); ?>" class="btn btn-warning rounded">Salir</a>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!--[if BLOCK]><![endif]--><?php if($showItemModal): ?>
    <div class="modal fade show d-block" tabindex="-1" style="background-color: rgba(0, 0, 0, 0.5);" role="dialog">
        <div class="modal-dialog modal-lg" >
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title"><?php echo e(is_null($editingIndex) ? 'Agregar ítem' : 'Editar ítem'); ?></h5>
                    <button type="button" wire:click="$set('showItemModal', false)" class="btn-close"></button>
                </div>
                <div class="modal-body">
                    <div class="mb-3">
                        <label for="nombre">Nombre Item/Lote/Bien/Detalle Obra/Tramos/Paquetes/Servicio</label>
                        <input type="text" wire:model.defer="itemForm.nombre" class="form-control">
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['itemForm.nombre'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>
                    <div class="mb-3">
                        <label for="monto">Precio Referencial</label>
                        <input type="number" wire:model.defer="itemForm.monto" class="form-control">
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['itemForm.monto'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>
                    <div class="mb-3">
                        <label for="unidad">Unidad de Medida</label>
                        <input type="text" wire:model.defer="itemForm.unidad" class="form-control">
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['itemForm.unidad'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>
                    <div class="mb-3">
                        <label for="tiempo_entrega">Tiempo o Plazo de Entrega (dias)</label>
                        <input type="number" wire:model.defer="itemForm.tiempo_entrega" class="form-control">
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['itemForm.tiempo_entrega'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>
                    <div class="mb-3">
                        <label for="forma_entrega">Forma de Entrega</label>
                        <input type="text" wire:model.defer="itemForm.forma_entrega" class="form-control">
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['itemForm.forma_entrega'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>
                    <div class="mb-3">
                        <label for="lugar_entrega">Lugar de Entrega</label>
                        <input type="text" wire:model.defer="itemForm.lugar_entrega" class="form-control">
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['itemForm.lugar_entrega'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>
                    <div class="mb-3">
                        <label for="garantia">Garantía (archivo)</label>
                        <input type="file" wire:model.defer="itemForm.garantia" class="form-control">
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['itemForm.garantia'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger text-xs"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" wire:click="$set('showItemModal', false)" class="btn btn-secondary">Cancelar</button>
                    <button type="button" wire:click="saveItem" class="btn btn-primary">Guardar</button>
                </div>
            </div>
        </div>
    </div>
<?php endif; ?><!--[if ENDBLOCK]><![endif]-->
</div>
<?php $__env->startSection('scripts'); ?>
<script>
    document.addEventListener('livewire:initialized', function () {
        // $(".select2").select2();
        Livewire.hook('morphed', () => {
            $(".select2").select2();
        });
    })
    document.addEventListener('livewire:navigated', function () {
        $('.select2').each(function () {
            let $select = $(this);
            $select.select2();
            $select.on('change', function () {
                // El id del select será el nombre de la propiedad Livewire
                let prop = $select.attr('id');
                window.Livewire.find('<?php echo e($_instance->getId()); ?>').set(prop, $select.val());
            });
        });
    });
    Livewire.on('alerta', ({ text }) => {
        Swal.fire('Correcto', text, 'success');
    });
</script>
<?php $__env->stopSection(); ?><?php /**PATH C:\laragon\www\contrataciones\resources\views/livewire/proceso-contratacion-component.blade.php ENDPATH**/ ?>