= 2) { loading = true; MapController.searchLocation(query).then(r => { results = r; showResults = true; loading = false; }); } else { results = []; showResults = false; }"
@focus="if (results.length > 0) showResults = true"
@click.away="showResults = false; activeIndex = -1"
@keydown.arrow-down.prevent="if (showResults && results.length > 0) { activeIndex = (activeIndex + 1) % results.length; } else if (results.length > 0) { showResults = true; activeIndex = 0; }"
@keydown.arrow-up.prevent="if (showResults && results.length > 0) { activeIndex = activeIndex <= 0 ? results.length - 1 : activeIndex - 1; }"
@keydown.enter.prevent="if (activeIndex >= 0 && results[activeIndex]) { selectResult(results[activeIndex]); } else if (query.length >= 2) { loading = true; MapController.searchLocation(query).then(r => { results = r; showResults = true; loading = false; }); }"
@keydown.escape="showResults = false; activeIndex = -1; $el.blur()"
:placeholder="t('search.placeholder')"
class="input w-48 pl-8 pr-3 py-2 shadow-lg text-sm"
/>
= 2) { loading = true; MapController.searchLocation(query).then(r => { results = r; showResults = true; loading = false; }); } else { results = []; showResults = false; }"
@focus="if (results.length > 0) showResults = true"
@click.away="showResults = false; activeIndex = -1"
@keydown.arrow-down.prevent="if (showResults && results.length > 0) { activeIndex = (activeIndex + 1) % results.length; } else if (results.length > 0) { showResults = true; activeIndex = 0; }"
@keydown.arrow-up.prevent="if (showResults && results.length > 0) { activeIndex = activeIndex <= 0 ? results.length - 1 : activeIndex - 1; }"
@keydown.enter.prevent="if (activeIndex >= 0 && results[activeIndex]) { selectResult(results[activeIndex]); }"
@keydown.escape="showResults = false; activeIndex = -1; $el.blur()"
:placeholder="t('search.placeholder')"
class="input w-full pl-8 pr-3 py-2 text-sm"
/>
1) { const dx = $event.changedTouches[0].clientX - tx; if (Math.abs(dx) > 30) { loaded = false; idx = dx < 0 ? (idx + 1) % apt.Images.length : (idx - 1 + apt.Images.length) % apt.Images.length; } }"
>