✨ 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
79 lines
3.6 KiB
JavaScript
79 lines
3.6 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "resolveHref", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return resolveHref;
|
|
}
|
|
});
|
|
const _querystring = require("../shared/lib/router/utils/querystring");
|
|
const _formaturl = require("../shared/lib/router/utils/format-url");
|
|
const _omit = require("../shared/lib/router/utils/omit");
|
|
const _utils = require("../shared/lib/utils");
|
|
const _normalizetrailingslash = require("./normalize-trailing-slash");
|
|
const _islocalurl = require("../shared/lib/router/utils/is-local-url");
|
|
const _utils1 = require("../shared/lib/router/utils");
|
|
const _interpolateas = require("../shared/lib/router/utils/interpolate-as");
|
|
function resolveHref(router, href, resolveAs) {
|
|
// we use a dummy base url for relative urls
|
|
let base;
|
|
let urlAsString = typeof href === "string" ? href : (0, _formaturl.formatWithValidation)(href);
|
|
// repeated slashes and backslashes in the URL are considered
|
|
// invalid and will never match a Next.js page/file
|
|
const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
|
|
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
|
|
const urlParts = urlAsStringNoProto.split("?", 1);
|
|
if ((urlParts[0] || "").match(/(\/\/|\\)/)) {
|
|
console.error("Invalid href '" + urlAsString + "' passed to next/router in page: '" + router.pathname + "'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");
|
|
const normalizedUrl = (0, _utils.normalizeRepeatedSlashes)(urlAsStringNoProto);
|
|
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : "") + normalizedUrl;
|
|
}
|
|
// Return because it cannot be routed by the Next.js router
|
|
if (!(0, _islocalurl.isLocalURL)(urlAsString)) {
|
|
return resolveAs ? [
|
|
urlAsString
|
|
] : urlAsString;
|
|
}
|
|
try {
|
|
base = new URL(urlAsString.startsWith("#") ? router.asPath : router.pathname, "http://n");
|
|
} catch (_) {
|
|
// fallback to / for invalid asPath values e.g. //
|
|
base = new URL("/", "http://n");
|
|
}
|
|
try {
|
|
const finalUrl = new URL(urlAsString, base);
|
|
finalUrl.pathname = (0, _normalizetrailingslash.normalizePathTrailingSlash)(finalUrl.pathname);
|
|
let interpolatedAs = "";
|
|
if ((0, _utils1.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
|
|
const query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);
|
|
const { result, params } = (0, _interpolateas.interpolateAs)(finalUrl.pathname, finalUrl.pathname, query);
|
|
if (result) {
|
|
interpolatedAs = (0, _formaturl.formatWithValidation)({
|
|
pathname: result,
|
|
hash: finalUrl.hash,
|
|
query: (0, _omit.omit)(query, params)
|
|
});
|
|
}
|
|
}
|
|
// if the origin didn't change, it means we received a relative href
|
|
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
|
|
return resolveAs ? [
|
|
resolvedHref,
|
|
interpolatedAs || resolvedHref
|
|
] : resolvedHref;
|
|
} catch (_) {
|
|
return resolveAs ? [
|
|
urlAsString
|
|
] : urlAsString;
|
|
}
|
|
}
|
|
|
|
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
}
|
|
|
|
//# sourceMappingURL=resolve-href.js.map
|