{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "freight-quote-calculator",
  "title": "Freight Quote Calculator",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/freight-quote-calculator/FreightQuoteCalculator.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport {\n  ArrowLeftRight,\n  ArrowRight,\n  Boxes,\n  Check,\n  CheckCircle2,\n  Clock,\n  Download,\n  FileText,\n  Info,\n  Leaf,\n  Package,\n  Plane,\n  Scale,\n  Ship,\n  Truck,\n  Zap,\n} from 'lucide-react'\nimport { cn } from '@/lib/utils'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'\nimport { Checkbox } from '@/components/ui/checkbox'\nimport { Input } from '@/components/ui/input'\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'\nimport { Separator } from '@/components/ui/separator'\n\nexport interface FreightQuoteCalculatorProps {\n  initialOrigin?: string\n  initialDestination?: string\n  initialPallets?: number\n  initialLengthCm?: number\n  initialWidthCm?: number\n  initialHeightCm?: number\n  initialGrossWeightKg?: number\n  initialCurrency?: string\n  className?: string\n}\n\n// Route Ports & Hubs\nconst ORIGIN_PORTS = [\n  { code: 'CNSHA', name: 'Shanghai Port (CNSHA)', country: 'China', type: 'Marine & Air' },\n  { code: 'CNNGB', name: 'Ningbo-Zhoushan Port (CNNGB)', country: 'China', type: 'Marine Port' },\n  { code: 'SGSIN', name: 'Port of Singapore (SGSIN)', country: 'Singapore', type: 'Hub Port' },\n  { code: 'DEHAM', name: 'Port of Hamburg (DEHAM)', country: 'Germany', type: 'Marine & Rail' },\n  { code: 'NLRTM', name: 'Port of Rotterdam (NLRTM)', country: 'Netherlands', type: 'Main Gateway' },\n  { code: 'JPTYO', name: 'Port of Tokyo (JPTYO)', country: 'Japan', type: 'Marine & Air' },\n]\n\nconst DESTINATION_PORTS = [\n  { code: 'USLAX', name: 'Port of Los Angeles (USLAX)', country: 'United States', type: 'West Coast Gateway' },\n  { code: 'USNYC', name: 'Port of New York & New Jersey (USNYC)', country: 'United States', type: 'East Coast Hub' },\n  { code: 'USORD', name: 'Chicago O’Hare Logistics Hub (USORD)', country: 'United States', type: 'Inland Hub' },\n  { code: 'GBFXT', name: 'Port of Felixstowe (GBFXT)', country: 'United Kingdom', type: 'Deep Sea Port' },\n  { code: 'AUMEL', name: 'Port of Melbourne (AUMEL)', country: 'Australia', type: 'Marine Port' },\n  { code: 'AEJEA', name: 'Jebel Ali Port (AEJEA)', country: 'United Arab Emirates', type: 'Middle East Hub' },\n]\n\n// Currencies\ninterface CurrencyConfig {\n  code: string\n  symbol: string\n  label: string\n  rate: number\n}\n\nconst CURRENCIES: Record<string, CurrencyConfig> = {\n  USD: { code: 'USD', symbol: '$', label: 'USD ($)', rate: 1.0 },\n  EUR: { code: 'EUR', symbol: '€', label: 'EUR (€)', rate: 0.92 },\n  GBP: { code: 'GBP', symbol: '£', label: 'GBP (£)', rate: 0.79 },\n  CNY: { code: 'CNY', symbol: '¥', label: 'CNY (¥)', rate: 7.23 },\n  SGD: { code: 'SGD', symbol: 'S$', label: 'SGD (S$)', rate: 1.34 },\n}\n\nconst CUSTOMS_USD = 150\nconst INSURANCE_USD = 85\nconst LIFTGATE_USD = 50\n\ntype FreightMode = 'ocean-fcl' | 'ocean-lcl' | 'air' | 'ground'\n\nexport function FreightQuoteCalculator({\n  initialOrigin = 'CNSHA',\n  initialDestination = 'USLAX',\n  initialPallets = 6,\n  initialLengthCm = 120,\n  initialWidthCm = 80,\n  initialHeightCm = 160,\n  initialGrossWeightKg = 400,\n  initialCurrency = 'USD',\n  className,\n}: FreightQuoteCalculatorProps) {\n  const [origin, setOrigin] = React.useState(initialOrigin)\n  const [destination, setDestination] = React.useState(initialDestination)\n  const [pallets, setPallets] = React.useState(initialPallets)\n  const [lengthCm, setLengthCm] = React.useState(initialLengthCm)\n  const [widthCm, setWidthCm] = React.useState(initialWidthCm)\n  const [heightCm, setHeightCm] = React.useState(initialHeightCm)\n  const [grossWeightKg, setGrossWeightKg] = React.useState(initialGrossWeightKg)\n  const [selectedCurrency, setSelectedCurrency] = React.useState(initialCurrency)\n\n  const [addCustoms, setAddCustoms] = React.useState(false)\n  const [addInsurance, setAddInsurance] = React.useState(false)\n  const [addLiftgate, setAddLiftgate] = React.useState(false)\n\n  const [selectedMode, setSelectedMode] = React.useState<FreightMode>('ocean-fcl')\n  const [isBooked, setIsBooked] = React.useState(false)\n  const [isDownloading, setIsDownloading] = React.useState(false)\n\n  const swapRoute = () => {\n    setOrigin((prev) => {\n      const next = destination\n      setDestination(prev)\n      return next\n    })\n  }\n\n  // Calculations\n  const singlePalletVolumeCbm = React.useMemo(() => {\n    const l = Number(lengthCm) || 0\n    const w = Number(widthCm) || 0\n    const h = Number(heightCm) || 0\n    return (l * w * h) / 1_000_000\n  }, [lengthCm, widthCm, heightCm])\n\n  const totalVolumeCbm = React.useMemo(() => {\n    const count = Number(pallets) || 0\n    return count * singlePalletVolumeCbm\n  }, [pallets, singlePalletVolumeCbm])\n\n  const totalGrossWeightKg = React.useMemo(() => {\n    const count = Number(pallets) || 0\n    const unitWeight = Number(grossWeightKg) || 0\n    return count * unitWeight\n  }, [pallets, grossWeightKg])\n\n  const airVolumetricWeightKg = React.useMemo(() => {\n    return Math.round(totalVolumeCbm * (1000 / 6))\n  }, [totalVolumeCbm])\n\n  const currentCurrency = CURRENCIES[selectedCurrency] ?? CURRENCIES.USD\n\n  const formatMoney = React.useCallback(\n    (amountInUsd: number): string => {\n      const converted = amountInUsd * currentCurrency.rate\n      return new Intl.NumberFormat('en-US', {\n        style: 'currency',\n        currency: currentCurrency.code,\n        minimumFractionDigits: 2,\n        maximumFractionDigits: 2,\n      }).format(converted)\n    },\n    [currentCurrency],\n  )\n\n  const fclContainersCount = Math.max(1, Math.ceil(pallets / 10))\n\n  const oceanFclBaseUsd = fclContainersCount * 2850\n  const oceanLclBaseUsd = Math.round((totalVolumeCbm || 1) * 140 + 130)\n  const airFreightBaseUsd = Math.round((airVolumetricWeightKg || 100) * 4.18)\n  const groundFreightBaseUsd = (Number(pallets) || 1) * 265\n\n  const addonsTotalUsd =\n    (addCustoms ? CUSTOMS_USD : 0) + (addInsurance ? INSURANCE_USD : 0) + (addLiftgate ? LIFTGATE_USD : 0)\n\n  const activeBasePriceUsd = React.useMemo(() => {\n    switch (selectedMode) {\n      case 'ocean-fcl':\n        return oceanFclBaseUsd\n      case 'ocean-lcl':\n        return oceanLclBaseUsd\n      case 'air':\n        return airFreightBaseUsd\n      case 'ground':\n        return groundFreightBaseUsd\n      default:\n        return oceanFclBaseUsd\n    }\n  }, [selectedMode, oceanFclBaseUsd, oceanLclBaseUsd, airFreightBaseUsd, groundFreightBaseUsd])\n\n  const activeTotalPriceUsd = activeBasePriceUsd + addonsTotalUsd\n\n  const activeTransitTime = React.useMemo(() => {\n    switch (selectedMode) {\n      case 'ocean-fcl':\n        return '14-18 days'\n      case 'ocean-lcl':\n        return '18-22 days'\n      case 'air':\n        return '3-5 days'\n      case 'ground':\n        return '5-7 days'\n    }\n  }, [selectedMode])\n\n  const activeCarbonEmission = React.useMemo(() => {\n    switch (selectedMode) {\n      case 'ocean-fcl':\n        return `${(1.2 * fclContainersCount).toFixed(1)} tCO2`\n      case 'ocean-lcl':\n        return `${(totalVolumeCbm * 0.087).toFixed(1)} tCO2`\n      case 'air':\n        return `${(airVolumetricWeightKg * 0.003125).toFixed(1)} tCO2`\n      case 'ground':\n        return `${(pallets * 0.26).toFixed(1)} tCO2`\n    }\n  }, [selectedMode, fclContainersCount, totalVolumeCbm, airVolumetricWeightKg, pallets])\n\n  const handleBookQuote = () => {\n    setIsBooked(true)\n    setTimeout(() => {\n      setIsBooked(false)\n    }, 3500)\n  }\n\n  const handleDownloadPdf = () => {\n    setIsDownloading(true)\n    setTimeout(() => {\n      setIsDownloading(false)\n    }, 2000)\n  }\n\n  return (\n    <div\n      data-slot=\"freight-quote-calculator\"\n      className={cn('mx-auto w-full max-w-6xl space-y-8 p-4 sm:p-6 lg:p-8', className)}\n    >\n      {/* Header Section */}\n      <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n        <div className=\"space-y-1.5\">\n          <div className=\"flex items-center gap-2\">\n            <Badge variant=\"outline\" className=\"gap-1.5 px-2.5 py-0.5 text-xs font-medium\">\n              <Boxes className=\"text-primary size-3.5\" />\n              Multimodal Logistics\n            </Badge>\n            <Badge variant=\"secondary\" className=\"text-xs font-normal\">\n              Spot Rates Live\n            </Badge>\n          </div>\n          <h2 className=\"text-foreground text-2xl font-bold tracking-tight sm:text-3xl\">\n            Freight Rate &amp; Cargo Quote Calculator\n          </h2>\n          <p className=\"text-muted-foreground text-sm\">\n            Compare spot rates across Ocean FCL/LCL, Air Freight, and Ground Trucking with instant CBM volumetric\n            analysis.\n          </p>\n        </div>\n\n        {/* Currency Selector */}\n        <div className=\"flex items-center gap-2 sm:self-start\">\n          <span className=\"text-muted-foreground text-xs font-medium\">Currency:</span>\n          <Select value={selectedCurrency} onValueChange={setSelectedCurrency}>\n            <SelectTrigger className=\"w-[125px] text-xs font-medium\">\n              <SelectValue placeholder={selectedCurrency} />\n            </SelectTrigger>\n            <SelectContent align=\"end\">\n              {Object.values(CURRENCIES).map((curr) => (\n                <SelectItem key={curr.code} value={curr.code} className=\"text-xs\">\n                  {{\n                    USD: 'USD ($)',\n                    EUR: 'EUR (€)',\n                    GBP: 'GBP (£)',\n                    CNY: 'CNY (¥)',\n                    SGD: 'SGD (S$)',\n                  }[curr.code] ?? curr.label}\n                </SelectItem>\n              ))}\n            </SelectContent>\n          </Select>\n        </div>\n      </div>\n\n      {/* Main 2-Column Layout */}\n      <div className=\"grid grid-cols-1 gap-8 lg:grid-cols-12 lg:items-start\">\n        {/* Left Column: Input Form & Volumetric Calculator (7 cols) */}\n        <div className=\"space-y-6 lg:col-span-7\">\n          {/* 1. Route Configuration Card */}\n          <Card className=\"border-border shadow-xs\">\n            <CardHeader className=\"pb-4\">\n              <div className=\"flex flex-wrap items-center justify-between\">\n                <CardTitle className=\"text-base font-semibold\">1. Shipping Route</CardTitle>\n                <span className=\"text-muted-foreground text-xs font-medium\">International Corridors</span>\n              </div>\n              <CardDescription className=\"text-xs\">\n                Select origin loading port and destination discharge terminal.\n              </CardDescription>\n            </CardHeader>\n            <CardContent className=\"space-y-4\">\n              <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-[1fr,auto,1fr] sm:items-end\">\n                {/* Origin */}\n                <div className=\"space-y-1.5\">\n                  <label htmlFor=\"route-origin\" className=\"text-foreground text-xs font-medium\">\n                    Origin (Port / Hub)\n                  </label>\n                  <Select value={origin} onValueChange={setOrigin}>\n                    <SelectTrigger id=\"route-origin\" className=\"text-xs [&_svg]:shrink-0 [&>span]:truncate\">\n                      <SelectValue />\n                    </SelectTrigger>\n                    <SelectContent>\n                      {ORIGIN_PORTS.map((p) => (\n                        <SelectItem key={p.code} value={p.code} className=\"text-xs\">\n                          {p.name}\n                        </SelectItem>\n                      ))}\n                    </SelectContent>\n                  </Select>\n                </div>\n\n                {/* Swap Button */}\n                <div className=\"flex justify-center pb-0.5 sm:pb-0\">\n                  <Button\n                    type=\"button\"\n                    variant=\"outline\"\n                    size=\"icon\"\n                    className=\"size-9 shrink-0\"\n                    aria-label=\"Swap Origin and Destination\"\n                    onClick={swapRoute}\n                  >\n                    <ArrowLeftRight className=\"size-4\" />\n                  </Button>\n                </div>\n\n                {/* Destination */}\n                <div className=\"space-y-1.5\">\n                  <label htmlFor=\"route-destination\" className=\"text-foreground text-xs font-medium\">\n                    Destination (Port / Hub)\n                  </label>\n                  <Select value={destination} onValueChange={setDestination}>\n                    <SelectTrigger id=\"route-destination\" className=\"text-xs [&_svg]:shrink-0 [&>span]:truncate\">\n                      <SelectValue />\n                    </SelectTrigger>\n                    <SelectContent>\n                      {DESTINATION_PORTS.map((p) => (\n                        <SelectItem key={p.code} value={p.code} className=\"text-xs\">\n                          {p.name}\n                        </SelectItem>\n                      ))}\n                    </SelectContent>\n                  </Select>\n                </div>\n              </div>\n\n              {/* Route Info Banner */}\n              <div className=\"bg-muted/40 border-border/80 flex flex-wrap items-center justify-between rounded-lg border px-3 py-2 text-xs\">\n                <div className=\"flex items-center gap-2\">\n                  <Ship className=\"text-primary size-4 shrink-0\" />\n                  <span className=\"text-foreground font-medium\">Transpacific Direct Corridor</span>\n                </div>\n                <span className=\"text-muted-foreground tabular-nums\">Distance: ~5,800 NM (10,740 km)</span>\n              </div>\n            </CardContent>\n          </Card>\n\n          {/* 2. Cargo Type & Mode Selector */}\n          <Card className=\"border-border shadow-xs\">\n            <CardHeader className=\"pb-4\">\n              <div className=\"flex flex-wrap items-center justify-between\">\n                <CardTitle className=\"text-base font-semibold\">2. Cargo Freight Mode</CardTitle>\n                <span className=\"text-muted-foreground text-xs\">Select primary transport</span>\n              </div>\n              <CardDescription className=\"text-xs\">\n                Choose your preferred multimodal transit mode to evaluate rates.\n              </CardDescription>\n            </CardHeader>\n            <CardContent>\n              <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\n                {/* Ocean FCL */}\n                <button\n                  type=\"button\"\n                  className={cn(\n                    'border-border focus-visible:ring-ring relative flex flex-col justify-between gap-3 rounded-lg border p-3.5 text-left transition-colors outline-none focus-visible:ring-2',\n                    selectedMode === 'ocean-fcl'\n                      ? 'border-primary bg-primary/5 ring-primary ring-1'\n                      : 'hover:border-border/80 hover:bg-muted/30 bg-card',\n                  )}\n                  onClick={() => setSelectedMode('ocean-fcl')}\n                >\n                  <div className=\"flex w-full items-start justify-between\">\n                    <div className=\"bg-primary/10 text-primary flex size-8 items-center justify-center rounded-md\">\n                      <Ship className=\"size-4\" />\n                    </div>\n                    <Badge variant=\"default\" className=\"text-xs\">\n                      Recommended\n                    </Badge>\n                  </div>\n                  <div>\n                    <div className=\"text-foreground text-sm font-semibold\">Ocean FCL (Full Container)</div>\n                    <div className=\"text-muted-foreground mt-0.5 text-xs\">\n                      20ft / 40ft dedicated sea freight container\n                    </div>\n                  </div>\n                  <div className=\"border-border/50 flex w-full items-center justify-between border-t pt-1 text-xs\">\n                    <span className=\"text-muted-foreground\">Est. Transit: 14-18 days</span>\n                    <span className=\"text-foreground font-semibold tabular-nums\">{formatMoney(oceanFclBaseUsd)}</span>\n                  </div>\n                </button>\n\n                {/* Ocean LCL */}\n                <button\n                  type=\"button\"\n                  className={cn(\n                    'border-border focus-visible:ring-ring relative flex flex-col justify-between gap-3 rounded-lg border p-3.5 text-left transition-colors outline-none focus-visible:ring-2',\n                    selectedMode === 'ocean-lcl'\n                      ? 'border-primary bg-primary/5 ring-primary ring-1'\n                      : 'hover:border-border/80 hover:bg-muted/30 bg-card',\n                  )}\n                  onClick={() => setSelectedMode('ocean-lcl')}\n                >\n                  <div className=\"flex w-full items-start justify-between\">\n                    <div className=\"bg-primary/10 text-primary flex size-8 items-center justify-center rounded-md\">\n                      <Boxes className=\"size-4\" />\n                    </div>\n                    <Badge variant=\"outline\" className=\"text-xs font-normal\">\n                      Economy\n                    </Badge>\n                  </div>\n                  <div>\n                    <div className=\"text-foreground text-sm font-semibold\">Ocean LCL (Shared)</div>\n                    <div className=\"text-muted-foreground mt-0.5 text-xs\">\n                      Consolidated sea freight priced by CBM volume\n                    </div>\n                  </div>\n                  <div className=\"border-border/50 flex w-full items-center justify-between border-t pt-1 text-xs\">\n                    <span className=\"text-muted-foreground\">Est. Transit: 18-22 days</span>\n                    <span className=\"text-foreground font-semibold tabular-nums\">{formatMoney(oceanLclBaseUsd)}</span>\n                  </div>\n                </button>\n\n                {/* Express Air Freight */}\n                <button\n                  type=\"button\"\n                  className={cn(\n                    'border-border focus-visible:ring-ring relative flex flex-col justify-between gap-3 rounded-lg border p-3.5 text-left transition-colors outline-none focus-visible:ring-2',\n                    selectedMode === 'air'\n                      ? 'border-primary bg-primary/5 ring-primary ring-1'\n                      : 'hover:border-border/80 hover:bg-muted/30 bg-card',\n                  )}\n                  onClick={() => setSelectedMode('air')}\n                >\n                  <div className=\"flex w-full items-start justify-between\">\n                    <div className=\"bg-primary/10 text-primary flex size-8 items-center justify-center rounded-md\">\n                      <Plane className=\"size-4\" />\n                    </div>\n                    <Badge variant=\"secondary\" className=\"text-xs\">\n                      Fastest\n                    </Badge>\n                  </div>\n                  <div>\n                    <div className=\"text-foreground text-sm font-semibold\">Express Air Freight</div>\n                    <div className=\"text-muted-foreground mt-0.5 text-xs\">\n                      Priority belly/freighter aircraft dispatch\n                    </div>\n                  </div>\n                  <div className=\"border-border/50 flex w-full items-center justify-between border-t pt-1 text-xs\">\n                    <span className=\"text-muted-foreground\">Est. Transit: 3-5 days</span>\n                    <span className=\"text-foreground font-semibold tabular-nums\">{formatMoney(airFreightBaseUsd)}</span>\n                  </div>\n                </button>\n\n                {/* Ground Freight */}\n                <button\n                  type=\"button\"\n                  className={cn(\n                    'border-border focus-visible:ring-ring relative flex flex-col justify-between gap-3 rounded-lg border p-3.5 text-left transition-colors outline-none focus-visible:ring-2',\n                    selectedMode === 'ground'\n                      ? 'border-primary bg-primary/5 ring-primary ring-1'\n                      : 'hover:border-border/80 hover:bg-muted/30 bg-card',\n                  )}\n                  onClick={() => setSelectedMode('ground')}\n                >\n                  <div className=\"flex w-full items-start justify-between\">\n                    <div className=\"bg-primary/10 text-primary flex size-8 items-center justify-center rounded-md\">\n                      <Truck className=\"size-4\" />\n                    </div>\n                    <Badge variant=\"outline\" className=\"text-xs font-normal\">\n                      Overland\n                    </Badge>\n                  </div>\n                  <div>\n                    <div className=\"text-foreground text-sm font-semibold\">Ground Freight</div>\n                    <div className=\"text-muted-foreground mt-0.5 text-xs\">\n                      Regional linehaul, FTL &amp; pallet LTL trucking\n                    </div>\n                  </div>\n                  <div className=\"border-border/50 flex w-full items-center justify-between border-t pt-1 text-xs\">\n                    <span className=\"text-muted-foreground\">Est. Transit: 5-7 days</span>\n                    <span className=\"text-foreground font-semibold tabular-nums\">\n                      {formatMoney(groundFreightBaseUsd)}\n                    </span>\n                  </div>\n                </button>\n              </div>\n            </CardContent>\n          </Card>\n\n          {/* 3. Package Dimensions & Volumetric CBM Calculator */}\n          <Card className=\"border-border shadow-xs\">\n            <CardHeader className=\"pb-4\">\n              <div className=\"flex flex-wrap items-center justify-between\">\n                <CardTitle className=\"text-base font-semibold\">3. Cargo Dimensions &amp; Volumetric Weight</CardTitle>\n                <Badge variant=\"outline\" className=\"gap-1 text-xs font-normal\">\n                  <Scale className=\"text-primary size-3\" />\n                  IATA 1:6 Standard\n                </Badge>\n              </div>\n              <CardDescription className=\"text-xs\">\n                Enter pallet quantity, unit dimensions, and individual gross weight.\n              </CardDescription>\n            </CardHeader>\n            <CardContent className=\"space-y-5\">\n              {/* Dimensions Inputs Grid */}\n              <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-5\">\n                <div className=\"col-span-2 space-y-1.5 sm:col-span-1\">\n                  <label htmlFor=\"dim-pallets\" className=\"text-foreground text-xs font-medium\">\n                    Quantity\n                  </label>\n                  <div className=\"relative\">\n                    <Input\n                      id=\"dim-pallets\"\n                      value={pallets}\n                      onChange={(e) => setPallets(Math.max(1, parseInt(e.target.value, 10) || 1))}\n                      type=\"number\"\n                      min=\"1\"\n                      max=\"100\"\n                      className=\"pr-8 text-xs tabular-nums\"\n                    />\n                    <span className=\"text-muted-foreground absolute top-1/2 right-2.5 -translate-y-1/2 text-xs\">\n                      pal\n                    </span>\n                  </div>\n                </div>\n\n                <div className=\"space-y-1.5\">\n                  <label htmlFor=\"dim-length\" className=\"text-foreground text-xs font-medium\">\n                    Length (L)\n                  </label>\n                  <div className=\"relative\">\n                    <Input\n                      id=\"dim-length\"\n                      value={lengthCm}\n                      onChange={(e) => setLengthCm(Math.max(1, parseInt(e.target.value, 10) || 1))}\n                      type=\"number\"\n                      min=\"10\"\n                      max=\"1000\"\n                      className=\"pr-8 text-xs tabular-nums\"\n                    />\n                    <span className=\"text-muted-foreground absolute top-1/2 right-2.5 -translate-y-1/2 text-xs\">\n                      cm\n                    </span>\n                  </div>\n                </div>\n\n                <div className=\"space-y-1.5\">\n                  <label htmlFor=\"dim-width\" className=\"text-foreground text-xs font-medium\">\n                    Width (W)\n                  </label>\n                  <div className=\"relative\">\n                    <Input\n                      id=\"dim-width\"\n                      value={widthCm}\n                      onChange={(e) => setWidthCm(Math.max(1, parseInt(e.target.value, 10) || 1))}\n                      type=\"number\"\n                      min=\"10\"\n                      max=\"1000\"\n                      className=\"pr-8 text-xs tabular-nums\"\n                    />\n                    <span className=\"text-muted-foreground absolute top-1/2 right-2.5 -translate-y-1/2 text-xs\">\n                      cm\n                    </span>\n                  </div>\n                </div>\n\n                <div className=\"space-y-1.5\">\n                  <label htmlFor=\"dim-height\" className=\"text-foreground text-xs font-medium\">\n                    Height (H)\n                  </label>\n                  <div className=\"relative\">\n                    <Input\n                      id=\"dim-height\"\n                      value={heightCm}\n                      onChange={(e) => setHeightCm(Math.max(1, parseInt(e.target.value, 10) || 1))}\n                      type=\"number\"\n                      min=\"10\"\n                      max=\"1000\"\n                      className=\"pr-8 text-xs tabular-nums\"\n                    />\n                    <span className=\"text-muted-foreground absolute top-1/2 right-2.5 -translate-y-1/2 text-xs\">\n                      cm\n                    </span>\n                  </div>\n                </div>\n\n                <div className=\"col-span-2 space-y-1.5 sm:col-span-1\">\n                  <label htmlFor=\"dim-weight\" className=\"text-foreground text-xs font-medium\">\n                    Weight/Pallet\n                  </label>\n                  <div className=\"relative\">\n                    <Input\n                      id=\"dim-weight\"\n                      value={grossWeightKg}\n                      onChange={(e) => setGrossWeightKg(Math.max(1, parseInt(e.target.value, 10) || 1))}\n                      type=\"number\"\n                      min=\"1\"\n                      max=\"5000\"\n                      className=\"pr-8 text-xs tabular-nums\"\n                    />\n                    <span className=\"text-muted-foreground absolute top-1/2 right-2.5 -translate-y-1/2 text-xs\">\n                      kg\n                    </span>\n                  </div>\n                </div>\n              </div>\n\n              {/* Computed Volumetric Display Cards */}\n              <div className=\"border-border/80 bg-muted/30 space-y-3 rounded-lg border p-4\">\n                <div className=\"flex flex-wrap items-center justify-between text-xs\">\n                  <span className=\"text-foreground flex items-center gap-1.5 font-semibold\">\n                    <Package className=\"text-primary size-3.5\" />\n                    Cargo Metric Computations\n                  </span>\n                  <span className=\"text-muted-foreground\">Standard Euro/US Pallet Basis</span>\n                </div>\n\n                <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-4\">\n                  {/* Metric 1: Total Volume */}\n                  <div className=\"bg-card border-border/80 rounded-md border p-2.5\">\n                    <div className=\"text-muted-foreground text-xs\">Total Volume</div>\n                    <div className=\"text-foreground mt-0.5 text-lg font-bold tabular-nums\">\n                      {totalVolumeCbm.toFixed(2)} <span className=\"text-muted-foreground text-xs font-normal\">CBM</span>\n                    </div>\n                    <div className=\"text-muted-foreground mt-1 text-xs\">\n                      {singlePalletVolumeCbm.toFixed(2)} m³ / unit\n                    </div>\n                  </div>\n\n                  {/* Metric 2: Actual Gross Weight */}\n                  <div className=\"bg-card border-border/80 rounded-md border p-2.5\">\n                    <div className=\"text-muted-foreground text-xs\">Actual Gross Wt.</div>\n                    <div className=\"text-foreground mt-0.5 text-lg font-bold tabular-nums\">\n                      {totalGrossWeightKg.toLocaleString('en-US')}{' '}\n                      <span className=\"text-muted-foreground text-xs font-normal\">kg</span>\n                    </div>\n                    <div className=\"text-muted-foreground mt-1 text-xs\">\n                      {pallets} × {grossWeightKg} kg\n                    </div>\n                  </div>\n\n                  {/* Metric 3: Air Volumetric Weight */}\n                  <div className=\"bg-card border-border/80 rounded-md border p-2.5\">\n                    <div className=\"text-muted-foreground text-xs\">Chargeable Wt. (Air)</div>\n                    <div className=\"text-foreground mt-0.5 text-lg font-bold tabular-nums\">\n                      {airVolumetricWeightKg.toLocaleString('en-US')}{' '}\n                      <span className=\"text-muted-foreground text-xs font-normal\">kg</span>\n                    </div>\n                    <div className=\"text-muted-foreground mt-1 text-xs\">Volumetric (1:6000)</div>\n                  </div>\n\n                  {/* Metric 4: Ocean Revenue Ton */}\n                  <div className=\"bg-card border-border/80 rounded-md border p-2.5\">\n                    <div className=\"text-muted-foreground text-xs\">Ocean Revenue Ton</div>\n                    <div className=\"text-foreground mt-0.5 text-lg font-bold tabular-nums\">\n                      {Math.max(totalVolumeCbm, totalGrossWeightKg / 1000).toFixed(2)}{' '}\n                      <span className=\"text-muted-foreground text-xs font-normal\">RT</span>\n                    </div>\n                    <div className=\"text-muted-foreground mt-1 text-xs\">Max(CBM, Weight/T)</div>\n                  </div>\n                </div>\n\n                {/* Note */}\n                <p className=\"text-muted-foreground flex items-center gap-1.5 pt-1 text-xs\">\n                  <Info className=\"text-primary size-3.5 shrink-0\" />\n                  <span>\n                    Computed Total Volume ({totalVolumeCbm.toFixed(2)} CBM) &amp; Chargeable Weight (\n                    {airVolumetricWeightKg.toLocaleString('en-US')} kg) apply dynamically to quotes.\n                  </span>\n                </p>\n              </div>\n            </CardContent>\n          </Card>\n\n          {/* 4. Value-Added Services */}\n          <Card className=\"border-border shadow-xs\">\n            <CardHeader className=\"pb-3\">\n              <div className=\"flex flex-wrap items-center justify-between\">\n                <CardTitle className=\"text-base font-semibold\">4. Value-Added Freight Services</CardTitle>\n                <span className=\"text-muted-foreground text-xs font-medium\">Optional Add-ons</span>\n              </div>\n              <CardDescription className=\"text-xs\">\n                Enhance shipment handling with customs, all-risk insurance, and destination equipment.\n              </CardDescription>\n            </CardHeader>\n            <CardContent className=\"space-y-3\">\n              {/* Service 1: Customs Clearance */}\n              <label className=\"border-border hover:border-primary/40 bg-card flex cursor-pointer items-start justify-between gap-3 rounded-lg border p-3.5 transition-colors\">\n                <div className=\"flex items-start gap-3\">\n                  <Checkbox checked={addCustoms} onCheckedChange={(val) => setAddCustoms(Boolean(val))} />\n                  <div className=\"space-y-0.5\">\n                    <div className=\"flex items-center gap-2\">\n                      <span className=\"text-foreground text-sm font-medium\">Customs Clearance</span>\n                      <Badge variant=\"outline\" className=\"text-xs font-normal tabular-nums\">\n                        +{formatMoney(CUSTOMS_USD)}\n                      </Badge>\n                    </div>\n                    <p className=\"text-muted-foreground text-xs\">\n                      Export filing, ISF 10+2 documentation, automated customs broker import clearance.\n                    </p>\n                  </div>\n                </div>\n              </label>\n\n              {/* Service 2: Cargo Insurance */}\n              <label className=\"border-border hover:border-primary/40 bg-card flex cursor-pointer items-start justify-between gap-3 rounded-lg border p-3.5 transition-colors\">\n                <div className=\"flex items-start gap-3\">\n                  <Checkbox checked={addInsurance} onCheckedChange={(val) => setAddInsurance(Boolean(val))} />\n                  <div className=\"space-y-0.5\">\n                    <div className=\"flex items-center gap-2\">\n                      <span className=\"text-foreground text-sm font-medium\">All-Risk Cargo Insurance</span>\n                      <Badge variant=\"outline\" className=\"text-xs font-normal tabular-nums\">\n                        +{formatMoney(INSURANCE_USD)}\n                      </Badge>\n                    </div>\n                    <p className=\"text-muted-foreground text-xs\">\n                      Comprehensive door-to-door insurance coverage up to $100,000 against damage or loss.\n                    </p>\n                  </div>\n                </div>\n              </label>\n\n              {/* Service 3: Liftgate Delivery */}\n              <label className=\"border-border hover:border-primary/40 bg-card flex cursor-pointer items-start justify-between gap-3 rounded-lg border p-3.5 transition-colors\">\n                <div className=\"flex items-start gap-3\">\n                  <Checkbox checked={addLiftgate} onCheckedChange={(val) => setAddLiftgate(Boolean(val))} />\n                  <div className=\"space-y-0.5\">\n                    <div className=\"flex items-center gap-2\">\n                      <span className=\"text-foreground text-sm font-medium\">Liftgate at Delivery</span>\n                      <Badge variant=\"outline\" className=\"text-xs font-normal tabular-nums\">\n                        +{formatMoney(LIFTGATE_USD)}\n                      </Badge>\n                    </div>\n                    <p className=\"text-muted-foreground text-xs\">\n                      Hydraulic liftgate truck delivery for destinations without a dedicated loading dock.\n                    </p>\n                  </div>\n                </div>\n              </label>\n            </CardContent>\n          </Card>\n        </div>\n\n        {/* Right Column: Sticky Instant Rate Quotes Card (5 cols) */}\n        <div className=\"space-y-6 lg:sticky lg:top-8 lg:col-span-5\">\n          <Card className=\"border-border bg-card shadow-xs\">\n            <CardHeader className=\"pb-4\">\n              <div className=\"flex flex-wrap items-center justify-between\">\n                <span className=\"text-muted-foreground text-xs font-semibold tracking-wider uppercase\">\n                  Instant Spot Rates\n                </span>\n                <Badge variant=\"default\" className=\"gap-1 text-xs\">\n                  <Zap className=\"size-3\" />\n                  Live Quote\n                </Badge>\n              </div>\n\n              {/* Route Preview */}\n              <div className=\"border-border/60 mt-2 flex flex-wrap items-center justify-between border-b pb-3 text-xs\">\n                <div className=\"text-foreground flex items-center gap-1.5 font-medium\">\n                  <span>{origin}</span>\n                  <ArrowRight className=\"text-muted-foreground size-3\" />\n                  <span>{destination}</span>\n                </div>\n                <span className=\"text-muted-foreground tabular-nums\">\n                  {pallets} Pallets · {totalVolumeCbm.toFixed(2)} CBM\n                </span>\n              </div>\n\n              {/* Primary Selected Quote Header */}\n              <div className=\"mt-4 space-y-1\">\n                <div className=\"text-muted-foreground text-xs font-medium\">Total Estimated Landed Freight Cost</div>\n                <div className=\"flex items-baseline gap-2\">\n                  <span className=\"text-foreground text-4xl font-bold tracking-tight tabular-nums\">\n                    {formatMoney(activeTotalPriceUsd)}\n                  </span>\n                  <span className=\"text-muted-foreground text-xs font-medium\">({currentCurrency.code})</span>\n                </div>\n                <div className=\"text-muted-foreground flex items-center gap-3 pt-1 text-xs\">\n                  <span className=\"flex items-center gap-1\">\n                    <Clock className=\"text-primary size-3\" />\n                    Transit: {activeTransitTime}\n                  </span>\n                  <span>·</span>\n                  <span className=\"flex items-center gap-1\">\n                    <Leaf className=\"text-success size-3\" />\n                    Est. {activeCarbonEmission}\n                  </span>\n                </div>\n              </div>\n            </CardHeader>\n\n            <CardContent className=\"space-y-4 pt-0\">\n              {/* Rate Quotes Comparison Cards */}\n              <div className=\"space-y-2\">\n                <span className=\"text-foreground text-xs font-semibold tracking-wider uppercase\">\n                  Compare Multimodal Options:\n                </span>\n\n                {/* Option 1: Ocean FCL */}\n                <div\n                  className={cn(\n                    'border-border hover:border-primary/50 cursor-pointer rounded-lg border p-3 transition-colors',\n                    selectedMode === 'ocean-fcl' ? 'border-primary bg-primary/5 ring-primary ring-1' : 'bg-card',\n                  )}\n                  onClick={() => setSelectedMode('ocean-fcl')}\n                >\n                  <div className=\"flex flex-wrap items-center justify-between\">\n                    <div className=\"flex items-center gap-2\">\n                      <Ship className=\"text-primary size-4 shrink-0\" />\n                      <div>\n                        <div className=\"text-foreground flex items-center gap-1.5 text-xs font-semibold\">\n                          Ocean FCL (20ft Container)\n                          <Badge variant=\"default\" className=\"px-1.5 py-0.5 text-xs\">\n                            Recommended\n                          </Badge>\n                        </div>\n                        <div className=\"text-muted-foreground text-xs\">Transit: 14-18 days · 1.2 tCO2</div>\n                      </div>\n                    </div>\n                    <div className=\"text-right\">\n                      <div className=\"text-foreground text-sm font-bold tabular-nums\">\n                        {formatMoney(oceanFclBaseUsd + addonsTotalUsd)}\n                      </div>\n                      <div className=\"text-muted-foreground text-xs\">Port-to-Port</div>\n                    </div>\n                  </div>\n                </div>\n\n                {/* Option 2: Ocean LCL */}\n                <div\n                  className={cn(\n                    'border-border hover:border-primary/50 cursor-pointer rounded-lg border p-3 transition-colors',\n                    selectedMode === 'ocean-lcl' ? 'border-primary bg-primary/5 ring-primary ring-1' : 'bg-card',\n                  )}\n                  onClick={() => setSelectedMode('ocean-lcl')}\n                >\n                  <div className=\"flex flex-wrap items-center justify-between\">\n                    <div className=\"flex items-center gap-2\">\n                      <Boxes className=\"text-primary size-4 shrink-0\" />\n                      <div>\n                        <div className=\"text-foreground flex items-center gap-1.5 text-xs font-semibold\">\n                          Ocean LCL (Shared)\n                          <Badge variant=\"outline\" className=\"px-1.5 py-0.5 text-xs font-normal\">\n                            Economy\n                          </Badge>\n                        </div>\n                        <div className=\"text-muted-foreground text-xs\">Transit: 18-22 days · 0.8 tCO2</div>\n                      </div>\n                    </div>\n                    <div className=\"text-right\">\n                      <div className=\"text-foreground text-sm font-bold tabular-nums\">\n                        {formatMoney(oceanLclBaseUsd + addonsTotalUsd)}\n                      </div>\n                      <div className=\"text-muted-foreground text-xs\">CFS-to-CFS</div>\n                    </div>\n                  </div>\n                </div>\n\n                {/* Option 3: Express Air Freight */}\n                <div\n                  className={cn(\n                    'border-border hover:border-primary/50 cursor-pointer rounded-lg border p-3 transition-colors',\n                    selectedMode === 'air' ? 'border-primary bg-primary/5 ring-primary ring-1' : 'bg-card',\n                  )}\n                  onClick={() => setSelectedMode('air')}\n                >\n                  <div className=\"flex flex-wrap items-center justify-between\">\n                    <div className=\"flex items-center gap-2\">\n                      <Plane className=\"text-primary size-4 shrink-0\" />\n                      <div>\n                        <div className=\"text-foreground flex items-center gap-1.5 text-xs font-semibold\">\n                          Express Air Freight\n                          <Badge variant=\"secondary\" className=\"px-1.5 py-0.5 text-xs\">\n                            Fastest\n                          </Badge>\n                        </div>\n                        <div className=\"text-muted-foreground text-xs\">Transit: 3-5 days · 4.8 tCO2</div>\n                      </div>\n                    </div>\n                    <div className=\"text-right\">\n                      <div className=\"text-foreground text-sm font-bold tabular-nums\">\n                        {formatMoney(airFreightBaseUsd + addonsTotalUsd)}\n                      </div>\n                      <div className=\"text-muted-foreground text-xs\">Airport-to-Airport</div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n\n              <Separator />\n\n              {/* Cost Breakdown Table */}\n              <div className=\"space-y-2 text-xs\">\n                <span className=\"text-muted-foreground font-medium tracking-wider uppercase\">Itemized Breakdown</span>\n                <div className=\"space-y-1.5\">\n                  <div className=\"flex flex-wrap items-center justify-between\">\n                    <span className=\"text-muted-foreground\">Base Freight Carrier Rate</span>\n                    <span className=\"text-foreground font-medium tabular-nums\">{formatMoney(activeBasePriceUsd)}</span>\n                  </div>\n                  {addCustoms && (\n                    <div className=\"flex flex-wrap items-center justify-between\">\n                      <span className=\"text-muted-foreground\">Customs Clearance Service</span>\n                      <span className=\"text-foreground font-medium tabular-nums\">+{formatMoney(CUSTOMS_USD)}</span>\n                    </div>\n                  )}\n                  {addInsurance && (\n                    <div className=\"flex flex-wrap items-center justify-between\">\n                      <span className=\"text-muted-foreground\">All-Risk Cargo Insurance</span>\n                      <span className=\"text-foreground font-medium tabular-nums\">+{formatMoney(INSURANCE_USD)}</span>\n                    </div>\n                  )}\n                  {addLiftgate && (\n                    <div className=\"flex flex-wrap items-center justify-between\">\n                      <span className=\"text-muted-foreground\">Destination Liftgate Equipment</span>\n                      <span className=\"text-foreground font-medium tabular-nums\">+{formatMoney(LIFTGATE_USD)}</span>\n                    </div>\n                  )}\n                  <div className=\"text-muted-foreground flex flex-wrap items-center justify-between\">\n                    <span>Bunker / Fuel Surcharge (BAF)</span>\n                    <span className=\"text-success font-medium\">Included</span>\n                  </div>\n                </div>\n              </div>\n\n              <Separator />\n\n              {/* Trust / Guarantee Points */}\n              <ul className=\"text-muted-foreground space-y-1.5 text-xs\">\n                <li className=\"flex items-center gap-2\">\n                  <Check className=\"text-primary size-3.5 shrink-0\" />\n                  <span>Rate locked for 7 calendar days</span>\n                </li>\n                <li className=\"flex items-center gap-2\">\n                  <Check className=\"text-primary size-3.5 shrink-0\" />\n                  <span>IATA &amp; FMC compliant licensed forwarders</span>\n                </li>\n                <li className=\"flex items-center gap-2\">\n                  <Check className=\"text-primary size-3.5 shrink-0\" />\n                  <span>Automated EDI customs documentation &amp; bill of lading</span>\n                </li>\n              </ul>\n            </CardContent>\n\n            <CardFooter className=\"flex flex-col gap-2.5 pt-2\">\n              {/* Book Button */}\n              <Button className=\"w-full gap-2 font-semibold shadow-xs\" size=\"lg\" onClick={handleBookQuote}>\n                {isBooked ? (\n                  <>\n                    <CheckCircle2 className=\"text-success size-4\" />\n                    Freight Quote Booked!\n                  </>\n                ) : (\n                  <>\n                    Book Freight Quote\n                    <ArrowRight className=\"size-4\" />\n                  </>\n                )}\n              </Button>\n\n              {/* Download PDF Button */}\n              <Button\n                aria-label=\"Download attachment\"\n                variant=\"outline\"\n                className=\"w-full gap-2 text-xs\"\n                size=\"default\"\n                onClick={handleDownloadPdf}\n              >\n                {!isDownloading ? <Download className=\"size-3.5\" /> : <FileText className=\"size-3.5 animate-pulse\" />}\n                {isDownloading ? 'Generating PDF Manifest...' : 'Download Detailed Quote PDF'}\n              </Button>\n            </CardFooter>\n          </Card>\n        </div>\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/FreightQuoteCalculator.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/checkbox.json",
    "https://uipkge.dev/r/react/input.json",
    "https://uipkge.dev/r/react/select.json",
    "https://uipkge.dev/r/react/separator.json"
  ],
  "description": "Multimodal Air, Ocean, and Ground freight rate estimator with CBM volumetric weight calculation, dynamic route pricing, value-added services, and live comparison quotes.",
  "categories": [
    "logistics",
    "calculator"
  ]
}