<?php

declare(strict_types=1);

/** @var array<string,mixed>|null $storeRow */
/** @var int $storeId */
/** @var string|null $dbError */
/** @var string|null $storeFetchError */
/** @var array{id:int,username:string,display_name:string,avatar_rel:string}|null $fatePublicMember */
/** @var string $cityFilter */
/** @var string $sort */
/** @var string $storeSearchQ */
/** @var Closure $buildQuery */
/** @var bool $fateAdminNavVisible */
/** @var int|null $fatePageHitCount 由 store.php 與 index.php 共用 fate_page_stats_for_footer() */
/** @var string $fatePageTitle */

require_once dirname(__DIR__, 2) . '/includes/fate_store_map.php';
$fateStoreMap = fate_store_map_prepare_from_row(is_array($storeRow ?? null) ? $storeRow : null);
$fateIncludeStoreMap = $fateStoreMap['fateIncludeStoreMap'];
$storeMapLat = $fateStoreMap['storeMapLat'];
$storeMapLng = $fateStoreMap['storeMapLng'];
$storeMapEmbedUrl = $fateStoreMap['storeMapEmbedUrl'];

// 須在模版檔內直接 require head/footer（與 home.php 相同），
// 勿用 fate_template_require_partial()：該函式在區域 scope 載入，$fatePageHitCount 等變數傳不進頁腳。
require __DIR__ . '/partials/head.php';
require __DIR__ . '/store_main.php';
require __DIR__ . '/partials/footer.php';
