{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "asset-tracking-map",
  "title": "Asset Tracking Map",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-vue/blocks/asset-tracking-map/AssetTrackingMap.vue",
      "content": "<script setup lang=\"ts\">\nimport { nextTick, ref } from 'vue'\nimport { Map, MapMarker, type MapRef } from '@/components/ui/map'\nimport { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\n\ndefineProps<{ accessToken?: string }>()\n\ninterface ContainerAsset {\n  id: string\n  containerNo: string\n  type: 'Reefer' | 'Dry Cargo' | 'Hazardous'\n  location: string\n  coords: [number, number]\n  temp?: string\n  humidity?: string\n  battery: string\n  geofence: 'Inside Zone' | 'In Transit' | 'Exited Perimeter'\n  status: 'Nominal' | 'Alert' | 'Secured'\n}\n\nconst mapRef = ref<MapRef | null>(null)\n\nconst assets: ContainerAsset[] = [\n  {\n    id: 'c-1',\n    containerNo: 'MSKU-948102',\n    type: 'Reefer',\n    location: 'Port of Long Beach, Pier G',\n    coords: [-118.216, 33.754],\n    temp: '-18.4°C',\n    humidity: '84%',\n    battery: '92%',\n    geofence: 'Inside Zone',\n    status: 'Nominal',\n  },\n  {\n    id: 'c-2',\n    containerNo: 'CMAU-310892',\n    type: 'Dry Cargo',\n    location: 'Barstow Rail Yard, Track 4',\n    coords: [-117.022, 34.898],\n    battery: '78%',\n    geofence: 'In Transit',\n    status: 'Nominal',\n  },\n  {\n    id: 'c-3',\n    containerNo: 'HLXU-772901',\n    type: 'Reefer',\n    location: 'Inland Empire Logistics Depot',\n    coords: [-117.585, 34.062],\n    temp: '+4.2°C',\n    humidity: '62%',\n    battery: '64%',\n    geofence: 'Inside Zone',\n    status: 'Alert',\n  },\n  {\n    id: 'c-4',\n    containerNo: 'OOLU-550183',\n    type: 'Hazardous',\n    location: 'Pacific Intermodal Terminal',\n    coords: [-118.243, 33.974],\n    battery: '95%',\n    geofence: 'Inside Zone',\n    status: 'Secured',\n  },\n]\n\nconst activeAsset = ref<ContainerAsset>(assets[0])\n\nasync function selectAsset(a: ContainerAsset) {\n  activeAsset.value = a\n  // `:center` is reactive, so Vue re-applies it on the next tick and would\n  // otherwise cancel this flight and strand the camera at the default zoom.\n  await nextTick()\n  mapRef.value?.flyTo({ center: a.coords, zoom: 11.5 })\n}\n</script>\n\n<template>\n  <div class=\"grid gap-4 lg:grid-cols-[1fr_320px]\">\n    <div class=\"border-border bg-card relative h-[480px] overflow-hidden rounded-xl border\">\n      <Map\n        ref=\"mapRef\"\n        :access-token=\"accessToken\"\n        variant=\"light\"\n        :center=\"activeAsset.coords\"\n        :zoom=\"9.2\"\n        class=\"h-full w-full\"\n      >\n        <MapMarker v-for=\"a in assets\" :key=\"a.id\" :lng-lat=\"a.coords\" anchor=\"bottom\" @click=\"selectAsset(a)\">\n          <div class=\"group relative flex cursor-pointer flex-col items-center\">\n            <div\n              class=\"flex size-7 items-center justify-center rounded-md font-mono text-xs font-bold shadow-md ring-2\"\n              :class=\"\n                a.status === 'Alert'\n                  ? 'bg-warning text-white ring-amber-400'\n                  : 'bg-primary text-primary-foreground ring-primary/25'\n              \"\n            >\n              📦\n            </div>\n            <span\n              class=\"border-border bg-background/90 mt-1 rounded border px-1 py-0.5 font-mono text-xs font-bold shadow-xs\"\n            >\n              {{ a.containerNo.split('-')[1] }}\n            </span>\n          </div>\n        </MapMarker>\n      </Map>\n    </div>\n\n    <!-- Asset Telemetry & Sensor Card -->\n    <Card class=\"flex flex-col justify-between\">\n      <CardHeader>\n        <div class=\"flex items-center justify-between\">\n          <Badge variant=\"outline\" class=\"font-mono text-xs\">{{ activeAsset.type }}</Badge>\n          <Badge\n            :class=\"\n              activeAsset.status === 'Alert'\n                ? 'border-warning/20 bg-warning/10 text-warning'\n                : 'border-success/20 bg-success/10 text-success'\n            \"\n          >\n            {{ activeAsset.status }}\n          </Badge>\n        </div>\n        <CardTitle class=\"mt-2 font-mono text-lg\">{{ activeAsset.containerNo }}</CardTitle>\n        <CardDescription class=\"text-xs\">{{ activeAsset.location }}</CardDescription>\n      </CardHeader>\n      <CardContent class=\"space-y-4\">\n        <div class=\"border-border bg-muted/40 grid grid-cols-2 gap-2 rounded-lg border p-2.5 font-mono text-xs\">\n          <div v-if=\"activeAsset.temp\">\n            <div class=\"text-muted-foreground text-xs uppercase\">Cold Chain Temp</div>\n            <div class=\"text-sm font-bold\" :class=\"activeAsset.status === 'Alert' ? 'text-warning' : 'text-foreground'\">\n              {{ activeAsset.temp }}\n            </div>\n          </div>\n          <div v-if=\"activeAsset.humidity\">\n            <div class=\"text-muted-foreground text-xs uppercase\">Humidity</div>\n            <div class=\"text-foreground text-sm font-bold\">{{ activeAsset.humidity }}</div>\n          </div>\n          <div>\n            <div class=\"text-muted-foreground text-xs uppercase\">IoT Battery</div>\n            <div class=\"text-foreground text-sm font-bold\">{{ activeAsset.battery }}</div>\n          </div>\n          <div>\n            <div class=\"text-muted-foreground text-xs uppercase\">Geofence</div>\n            <div class=\"text-foreground text-sm font-bold\">{{ activeAsset.geofence }}</div>\n          </div>\n        </div>\n\n        <div class=\"border-border space-y-1 border-t pt-3\">\n          <div class=\"text-muted-foreground mb-1 font-mono text-xs tracking-wider uppercase\">Tracked Cargo Units</div>\n          <button\n            v-for=\"a in assets\"\n            :key=\"a.id\"\n            type=\"button\"\n            class=\"flex w-full items-center justify-between rounded-md px-2 py-1 text-xs transition-colors\"\n            :class=\"\n              activeAsset.id === a.id\n                ? 'bg-accent text-accent-foreground font-semibold'\n                : 'hover:bg-muted text-muted-foreground'\n            \"\n            @click=\"selectAsset(a)\"\n          >\n            <span class=\"font-mono\">{{ a.containerNo }}</span>\n            <span class=\"font-mono text-xs\" :class=\"a.status === 'Alert' ? 'text-warning font-bold' : 'opacity-70'\">\n              {{ a.type }}\n            </span>\n          </button>\n        </div>\n\n        <Button variant=\"outline\" size=\"sm\" class=\"w-full font-mono text-xs\" @click=\"selectAsset(activeAsset)\">\n          Center on Container\n        </Button>\n      </CardContent>\n    </Card>\n  </div>\n</template>\n",
      "type": "registry:block",
      "target": "~/app/components/blocks/AssetTrackingMap.vue"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/vue/badge.json",
    "https://uipkge.dev/r/vue/button.json",
    "https://uipkge.dev/r/vue/card.json",
    "https://uipkge.dev/r/vue/map.json"
  ],
  "description": "Intermodal cargo container tracking with cold-chain sensor status, geofence perimeter rings, and battery levels.",
  "categories": [
    "logistics",
    "supply-chain",
    "map"
  ]
}