✨ 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
63 lines
1.5 KiB
JavaScript
63 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
const { tokenChars } = require('./validation');
|
|
|
|
/**
|
|
* Parses the `Sec-WebSocket-Protocol` header into a set of subprotocol names.
|
|
*
|
|
* @param {String} header The field value of the header
|
|
* @return {Set} The subprotocol names
|
|
* @public
|
|
*/
|
|
function parse(header) {
|
|
const protocols = new Set();
|
|
let start = -1;
|
|
let end = -1;
|
|
let i = 0;
|
|
|
|
for (i; i < header.length; i++) {
|
|
const code = header.charCodeAt(i);
|
|
|
|
if (end === -1 && tokenChars[code] === 1) {
|
|
if (start === -1) start = i;
|
|
} else if (
|
|
i !== 0 &&
|
|
(code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */
|
|
) {
|
|
if (end === -1 && start !== -1) end = i;
|
|
} else if (code === 0x2c /* ',' */) {
|
|
if (start === -1) {
|
|
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
}
|
|
|
|
if (end === -1) end = i;
|
|
|
|
const protocol = header.slice(start, end);
|
|
|
|
if (protocols.has(protocol)) {
|
|
throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
|
|
}
|
|
|
|
protocols.add(protocol);
|
|
start = end = -1;
|
|
} else {
|
|
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
}
|
|
}
|
|
|
|
if (start === -1 || end !== -1) {
|
|
throw new SyntaxError('Unexpected end of input');
|
|
}
|
|
|
|
const protocol = header.slice(start, i);
|
|
|
|
if (protocols.has(protocol)) {
|
|
throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
|
|
}
|
|
|
|
protocols.add(protocol);
|
|
return protocols;
|
|
}
|
|
|
|
module.exports = { parse };
|