✨ MAJOR FEATURES: • Auto-zoom intelligence với smart bounds fitting • Enhanced 3D GPS markers với pulsing effects • Professional route display với 6-layer rendering • Status-based parking icons với availability indicators • Production-ready build optimizations 🗺️ AUTO-ZOOM FEATURES: • Smart bounds fitting cho GPS + selected parking • Adaptive padding (50px) cho visual balance • Max zoom control (level 16) để tránh quá gần • Dynamic centering khi không có selection 🎨 ENHANCED VISUALS: • 3D GPS marker với multi-layer pulse effects • Advanced parking icons với status colors • Selection highlighting với animation • Dimming system cho non-selected items 🛣️ ROUTE SYSTEM: • OpenRouteService API integration • Multi-layer route rendering (glow, shadow, main, animated) • Real-time distance & duration calculation • Visual route info trong popup 📱 PRODUCTION READY: • SSR safe với dynamic imports • Build errors resolved • Global deployment via Vercel • Optimized performance 🌍 DEPLOYMENT: • Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app • Bundle size: 22.8 kB optimized • Global CDN distribution • HTTPS enabled 💾 VERSION CONTROL: • MapView-v2.0.tsx backup created • MAPVIEW_VERSIONS.md documentation • Full version history tracking
35 lines
1.5 KiB
JavaScript
35 lines
1.5 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.isFreightContainerID = void 0;
|
|
exports.isISO6346 = isISO6346;
|
|
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
// https://en.wikipedia.org/wiki/ISO_6346
|
|
// according to ISO6346 standard, checksum digit is mandatory for freight container but recommended
|
|
// for other container types (J and Z)
|
|
var isISO6346Str = /^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/;
|
|
var isDigit = /^[0-9]$/;
|
|
function isISO6346(str) {
|
|
(0, _assertString.default)(str);
|
|
str = str.toUpperCase();
|
|
if (!isISO6346Str.test(str)) return false;
|
|
if (str.length === 11) {
|
|
var sum = 0;
|
|
for (var i = 0; i < str.length - 1; i++) {
|
|
if (!isDigit.test(str[i])) {
|
|
var convertedCode = void 0;
|
|
var letterCode = str.charCodeAt(i) - 55;
|
|
if (letterCode < 11) convertedCode = letterCode;else if (letterCode >= 11 && letterCode <= 20) convertedCode = 12 + letterCode % 11;else if (letterCode >= 21 && letterCode <= 30) convertedCode = 23 + letterCode % 21;else convertedCode = 34 + letterCode % 31;
|
|
sum += convertedCode * Math.pow(2, i);
|
|
} else sum += str[i] * Math.pow(2, i);
|
|
}
|
|
var checkSumDigit = sum % 11;
|
|
if (checkSumDigit === 10) checkSumDigit = 0;
|
|
return Number(str[str.length - 1]) === checkSumDigit;
|
|
}
|
|
return true;
|
|
}
|
|
var isFreightContainerID = exports.isFreightContainerID = isISO6346; |