@sdxc/ui 2026.11.18 → 2026.11.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -1
- package/dist/app/index.d.ts +1 -0
- package/dist/app/index.js +1 -0
- package/dist/app/mixins/command-palette.js +10 -2
- package/dist/app/mixins/log-viewer.js +17 -14
- package/dist/app/mixins/route-dialog.d.ts +17 -0
- package/dist/app/mixins/route-dialog.js +53 -0
- package/dist/app/optimistic-toggle.js +6 -0
- package/dist/app/route-dialog.d.ts +38 -0
- package/dist/app/route-dialog.js +49 -0
- package/dist/audio/equalizer.d.ts +24 -0
- package/dist/audio/equalizer.js +57 -0
- package/dist/audio/index.d.ts +16 -0
- package/dist/audio/index.js +16 -0
- package/dist/audio/media-tile.d.ts +38 -0
- package/dist/audio/media-tile.js +98 -0
- package/dist/audio/player-bar.d.ts +108 -0
- package/dist/audio/player-bar.js +338 -0
- package/dist/audio/queue-list.d.ts +56 -0
- package/dist/audio/queue-list.js +102 -0
- package/dist/audio/track-list.d.ts +91 -0
- package/dist/audio/track-list.js +226 -0
- package/dist/audio/utils/media-session.d.ts +44 -0
- package/dist/audio/utils/media-session.js +87 -0
- package/dist/audio/utils/play-queue.d.ts +98 -0
- package/dist/audio/utils/play-queue.js +149 -0
- package/dist/audio/utils/track-time.d.ts +28 -0
- package/dist/audio/utils/track-time.js +36 -0
- package/dist/chat/composer-format.d.ts +35 -0
- package/dist/chat/composer-format.js +84 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +6 -0
- package/dist/chat/mention-menu.d.ts +43 -0
- package/dist/chat/mention-menu.js +70 -0
- package/dist/chat/message-group.d.ts +92 -0
- package/dist/chat/message-group.js +222 -0
- package/dist/chat/mixins/composer-format.d.ts +28 -0
- package/dist/chat/mixins/composer-format.js +80 -0
- package/dist/chat/mixins/composer-send.d.ts +2 -2
- package/dist/chat/mixins/composer-send.js +4 -2
- package/dist/chat/mixins/mention-menu.d.ts +41 -0
- package/dist/chat/mixins/mention-menu.js +213 -0
- package/dist/chat/mixins/reaction-sync.d.ts +47 -0
- package/dist/chat/mixins/reaction-sync.js +172 -0
- package/dist/chat/reaction-bar.d.ts +70 -0
- package/dist/chat/reaction-bar.js +108 -0
- package/dist/chat/typing-indicator.d.ts +42 -0
- package/dist/chat/typing-indicator.js +68 -0
- package/dist/chat/utils/composer-text.d.ts +38 -0
- package/dist/chat/utils/composer-text.js +86 -0
- package/dist/chat/utils/markdown-format.d.ts +30 -0
- package/dist/chat/utils/markdown-format.js +158 -0
- package/dist/chat/utils/mention-query.d.ts +55 -0
- package/dist/chat/utils/mention-query.js +60 -0
- package/dist/commerce/cart-drawer.d.ts +69 -0
- package/dist/commerce/cart-drawer.js +163 -0
- package/dist/commerce/cart-line.d.ts +32 -0
- package/dist/commerce/cart-line.js +43 -0
- package/dist/commerce/checkout-layout.d.ts +32 -0
- package/dist/commerce/checkout-layout.js +51 -0
- package/dist/commerce/facet-filters.d.ts +121 -0
- package/dist/commerce/facet-filters.js +318 -0
- package/dist/commerce/fulfilment-note.d.ts +28 -0
- package/dist/commerce/fulfilment-note.js +26 -0
- package/dist/commerce/index.d.ts +27 -0
- package/dist/commerce/index.js +27 -0
- package/dist/commerce/item-options-dialog.d.ts +67 -0
- package/dist/commerce/item-options-dialog.js +150 -0
- package/dist/commerce/menu-item-card.d.ts +37 -0
- package/dist/commerce/menu-item-card.js +96 -0
- package/dist/commerce/option-group.d.ts +62 -0
- package/dist/commerce/option-group.js +121 -0
- package/dist/commerce/order-summary.d.ts +42 -0
- package/dist/commerce/order-summary.js +76 -0
- package/dist/commerce/order-tracker.d.ts +80 -0
- package/dist/commerce/order-tracker.js +178 -0
- package/dist/commerce/price.d.ts +52 -0
- package/dist/commerce/price.js +108 -0
- package/dist/commerce/product-card.d.ts +53 -0
- package/dist/commerce/product-card.js +127 -0
- package/dist/commerce/product-gallery.d.ts +70 -0
- package/dist/commerce/product-gallery.js +186 -0
- package/dist/commerce/promo-code.d.ts +56 -0
- package/dist/commerce/promo-code.js +101 -0
- package/dist/commerce/quantity-stepper.d.ts +42 -0
- package/dist/commerce/quantity-stepper.js +53 -0
- package/dist/commerce/question-list.d.ts +53 -0
- package/dist/commerce/question-list.js +92 -0
- package/dist/commerce/shipping-estimate.d.ts +53 -0
- package/dist/commerce/shipping-estimate.js +39 -0
- package/dist/commerce/sort-select.d.ts +38 -0
- package/dist/commerce/sort-select.js +38 -0
- package/dist/commerce/variant-picker.d.ts +75 -0
- package/dist/commerce/variant-picker.js +135 -0
- package/dist/components/amount.d.ts +46 -0
- package/dist/components/amount.js +34 -0
- package/dist/components/autocomplete.d.ts +82 -0
- package/dist/components/autocomplete.js +114 -0
- package/dist/components/carousel.d.ts +31 -1
- package/dist/components/carousel.js +66 -3
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +11 -0
- package/dist/components/letterbox.d.ts +47 -0
- package/dist/components/letterbox.js +56 -0
- package/dist/components/lightbox.d.ts +88 -0
- package/dist/components/lightbox.js +224 -0
- package/dist/components/media-grid.d.ts +53 -0
- package/dist/components/media-grid.js +89 -0
- package/dist/components/range-months.d.ts +100 -0
- package/dist/components/range-months.js +274 -0
- package/dist/components/rating-input.d.ts +33 -0
- package/dist/components/rating-input.js +63 -0
- package/dist/components/rating.d.ts +38 -0
- package/dist/components/rating.js +66 -0
- package/dist/components/review-card.d.ts +39 -0
- package/dist/components/review-card.js +59 -0
- package/dist/components/section-bar.d.ts +57 -0
- package/dist/components/section-bar.js +140 -0
- package/dist/components/slider.js +7 -0
- package/dist/components/step-indicator.d.ts +46 -0
- package/dist/components/step-indicator.js +96 -0
- package/dist/finance/index.d.ts +10 -0
- package/dist/finance/index.js +10 -0
- package/dist/finance/ledger.d.ts +60 -0
- package/dist/finance/ledger.js +93 -0
- package/dist/finance/payment-card.d.ts +49 -0
- package/dist/finance/payment-card.js +115 -0
- package/dist/map/engine.d.ts +49 -0
- package/dist/map/engine.js +591 -0
- package/dist/map/index.d.ts +12 -0
- package/dist/map/index.js +12 -0
- package/dist/map/map-canvas.d.ts +101 -0
- package/dist/map/map-canvas.js +275 -0
- package/dist/map/map.d.ts +217 -0
- package/dist/map/map.js +598 -0
- package/dist/map/mixins/map-link.d.ts +30 -0
- package/dist/map/mixins/map-link.js +116 -0
- package/dist/map/utils/basemap.d.ts +88 -0
- package/dist/map/utils/basemap.js +84 -0
- package/dist/map/utils/cluster.d.ts +43 -0
- package/dist/map/utils/cluster.js +80 -0
- package/dist/map/utils/mercator.d.ts +66 -0
- package/dist/map/utils/mercator.js +92 -0
- package/dist/map/utils/stage.d.ts +24 -0
- package/dist/map/utils/stage.js +49 -0
- package/dist/mixins/autocomplete.d.ts +28 -0
- package/dist/mixins/autocomplete.js +283 -0
- package/dist/mixins/carousel-controls.d.ts +14 -3
- package/dist/mixins/carousel-controls.js +89 -30
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.js +2 -0
- package/dist/mixins/lightbox-controls.d.ts +34 -0
- package/dist/mixins/lightbox-controls.js +176 -0
- package/dist/schedule/agenda.d.ts +63 -0
- package/dist/schedule/agenda.js +221 -0
- package/dist/schedule/day-strip.d.ts +50 -0
- package/dist/schedule/day-strip.js +136 -0
- package/dist/schedule/free-busy.d.ts +96 -0
- package/dist/schedule/free-busy.js +285 -0
- package/dist/schedule/index.d.ts +15 -0
- package/dist/schedule/index.js +15 -0
- package/dist/schedule/mixins/day-strip-scroll.d.ts +16 -0
- package/dist/schedule/mixins/day-strip-scroll.js +40 -0
- package/dist/schedule/mixins/time-grid-drag.d.ts +24 -0
- package/dist/schedule/mixins/time-grid-drag.js +532 -0
- package/dist/schedule/month-view.d.ts +68 -0
- package/dist/schedule/month-view.js +301 -0
- package/dist/schedule/time-grid.d.ts +168 -0
- package/dist/schedule/time-grid.js +417 -0
- package/dist/schedule/utils/time-grid-layout.d.ts +50 -0
- package/dist/schedule/utils/time-grid-layout.js +93 -0
- package/dist/schedule/year-view.d.ts +46 -0
- package/dist/schedule/year-view.js +142 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.js +1 -0
- package/dist/styles/typewriter-text.d.ts +20 -0
- package/dist/styles/typewriter-text.js +23 -0
- package/dist/test/map.d.ts +18 -0
- package/dist/test/map.js +96 -0
- package/dist/test/reels.d.ts +30 -0
- package/dist/test/reels.js +41 -0
- package/dist/test/stories.d.ts +31 -0
- package/dist/test/stories.js +66 -0
- package/dist/travel/boarding-pass.d.ts +107 -0
- package/dist/travel/boarding-pass.js +293 -0
- package/dist/travel/car-offer.d.ts +70 -0
- package/dist/travel/car-offer.js +127 -0
- package/dist/travel/fare-calendar.d.ts +85 -0
- package/dist/travel/fare-calendar.js +233 -0
- package/dist/travel/fare-options.d.ts +84 -0
- package/dist/travel/fare-options.js +142 -0
- package/dist/travel/flight-itinerary.d.ts +84 -0
- package/dist/travel/flight-itinerary.js +112 -0
- package/dist/travel/flight-option.d.ts +58 -0
- package/dist/travel/flight-option.js +111 -0
- package/dist/travel/flight-segment.d.ts +105 -0
- package/dist/travel/flight-segment.js +174 -0
- package/dist/travel/index.d.ts +20 -0
- package/dist/travel/index.js +20 -0
- package/dist/travel/package-savings.d.ts +74 -0
- package/dist/travel/package-savings.js +128 -0
- package/dist/travel/price-breakdown.d.ts +66 -0
- package/dist/travel/price-breakdown.js +102 -0
- package/dist/travel/rating-breakdown.d.ts +81 -0
- package/dist/travel/rating-breakdown.js +132 -0
- package/dist/travel/seat-map.d.ts +108 -0
- package/dist/travel/seat-map.js +371 -0
- package/dist/travel/trip-timeline.d.ts +84 -0
- package/dist/travel/trip-timeline.js +212 -0
- package/dist/utils/gamepad-presses.d.ts +21 -0
- package/dist/utils/gamepad-presses.js +28 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/move-focus.d.ts +20 -0
- package/dist/utils/move-focus.js +28 -0
- package/dist/utils/range-months.d.ts +54 -0
- package/dist/utils/range-months.js +98 -0
- package/dist/utils/swipe-direction.d.ts +23 -0
- package/dist/utils/swipe-direction.js +27 -0
- package/dist/utils/typewriter.d.ts +49 -0
- package/dist/utils/typewriter.js +171 -0
- package/dist/video/index.d.ts +6 -2
- package/dist/video/index.js +6 -2
- package/dist/video/mixins/reel-feed-sync.d.ts +41 -0
- package/dist/video/mixins/reel-feed-sync.js +430 -0
- package/dist/video/mixins/story-viewer-sync.d.ts +31 -0
- package/dist/video/mixins/story-viewer-sync.js +391 -0
- package/dist/video/reel-feed.d.ts +95 -0
- package/dist/video/reel-feed.js +124 -0
- package/dist/video/story-ring.d.ts +32 -0
- package/dist/video/story-ring.js +42 -0
- package/dist/video/story-viewer.d.ts +85 -0
- package/dist/video/story-viewer.js +250 -0
- package/package.json +21 -2
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The browser side of a map stage: loads MapLibre on demand into the server-rendered stage,
|
|
3
|
+
* keeps the same marker, label and route nodes placed as the map pans and zooms, reclusters,
|
|
4
|
+
* and runs the controls and the search area. Without WebGL the server render stays as it is.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import { BASEMAP_PAINT, featureKind, linePath, ROAD_WIDTH } from "./utils/basemap.js";
|
|
10
|
+
import { clusterLabel, clusterPoints } from "./utils/cluster.js";
|
|
11
|
+
import { formatBounds, formatLngLat, roundTo } from "./utils/mercator.js";
|
|
12
|
+
import { offsetStyle, readPath } from "./utils/stage.js";
|
|
13
|
+
/** How long the island waits for the first frame before it keeps the server render. */
|
|
14
|
+
const LOAD_TIMEOUT_MS = 10_000;
|
|
15
|
+
/** How long a link marker's popup stays open after the pointer or focus leaves it. */
|
|
16
|
+
const POPUP_LINGER_MS = 160;
|
|
17
|
+
/** Room in pixels kept around markers when a cluster zooms to fit them. */
|
|
18
|
+
const FIT_PADDING = 64;
|
|
19
|
+
/** Zoom a located visitor is shown at, at least. */
|
|
20
|
+
const LOCATE_ZOOM = 14;
|
|
21
|
+
/** True when the browser can create a WebGL context, which MapLibre draws with. */
|
|
22
|
+
function webglAvailable() {
|
|
23
|
+
try {
|
|
24
|
+
let canvas = document.createElement("canvas");
|
|
25
|
+
return (canvas.getContext("webgl2") ?? canvas.getContext("webgl")) !== null;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** True while the visitor asks for reduced motion, read at the moment a camera moves. */
|
|
32
|
+
function reducedMotion() {
|
|
33
|
+
return matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolves a CSS color expression, custom properties included, to `rgba()` as MapLibre reads it,
|
|
37
|
+
* by painting it once: the stage's own properties apply, so theme and page overrides follow.
|
|
38
|
+
*/
|
|
39
|
+
function resolveColor(stage, expression) {
|
|
40
|
+
let probe = document.createElement("span");
|
|
41
|
+
probe.style.color = expression;
|
|
42
|
+
probe.hidden = true;
|
|
43
|
+
stage.appendChild(probe);
|
|
44
|
+
let computed = getComputedStyle(probe).color;
|
|
45
|
+
probe.remove();
|
|
46
|
+
let canvas = document.createElement("canvas");
|
|
47
|
+
canvas.width = 1;
|
|
48
|
+
canvas.height = 1;
|
|
49
|
+
let context = canvas.getContext("2d", { willReadFrequently: true });
|
|
50
|
+
if (context === null)
|
|
51
|
+
return computed;
|
|
52
|
+
context.fillStyle = computed;
|
|
53
|
+
context.fillRect(0, 0, 1, 1);
|
|
54
|
+
let [r = 0, g = 0, b = 0, a = 255] = context.getImageData(0, 0, 1, 1).data;
|
|
55
|
+
return `rgba(${r}, ${g}, ${b}, ${roundTo(a / 255, 3)})`;
|
|
56
|
+
}
|
|
57
|
+
/** True when the stage's page color is dark, which picks a style basemap's dark URL. */
|
|
58
|
+
function isDark(stage) {
|
|
59
|
+
let match = /rgba\((\d+), (\d+), (\d+)/.exec(resolveColor(stage, "var(--ui-bg, Canvas)"));
|
|
60
|
+
if (match === null)
|
|
61
|
+
return false;
|
|
62
|
+
let [r, g, b] = [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
63
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b < 128;
|
|
64
|
+
}
|
|
65
|
+
/** The colors a vector basemap paints with, read from the stage. */
|
|
66
|
+
function basemapColors(stage) {
|
|
67
|
+
return {
|
|
68
|
+
land: resolveColor(stage, BASEMAP_PAINT.land),
|
|
69
|
+
water: resolveColor(stage, BASEMAP_PAINT.water),
|
|
70
|
+
park: resolveColor(stage, BASEMAP_PAINT.park),
|
|
71
|
+
road: resolveColor(stage, BASEMAP_PAINT.road),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A MapLibre style drawing a GeoJSON basemap from one inline source, with no glyphs, sprites
|
|
76
|
+
* or tiles to fetch; place names stay HTML on the stage.
|
|
77
|
+
*/
|
|
78
|
+
function geojsonStyle(data, ground, colors) {
|
|
79
|
+
let features = data.features.map((feature) => ({
|
|
80
|
+
...feature,
|
|
81
|
+
properties: { ...feature.properties, kind: featureKind(feature) },
|
|
82
|
+
}));
|
|
83
|
+
let fill = (kind) => ({
|
|
84
|
+
id: kind,
|
|
85
|
+
type: "fill",
|
|
86
|
+
source: "basemap",
|
|
87
|
+
filter: ["==", ["get", "kind"], kind],
|
|
88
|
+
paint: { "fill-color": colors[kind], "fill-antialias": true },
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
version: 8,
|
|
92
|
+
sources: {
|
|
93
|
+
basemap: { type: "geojson", data: { type: "FeatureCollection", features } },
|
|
94
|
+
},
|
|
95
|
+
layers: [
|
|
96
|
+
{ id: "ground", type: "background", paint: { "background-color": colors[ground] } },
|
|
97
|
+
fill("land"),
|
|
98
|
+
fill("park"),
|
|
99
|
+
fill("water"),
|
|
100
|
+
{
|
|
101
|
+
id: "road",
|
|
102
|
+
type: "line",
|
|
103
|
+
source: "basemap",
|
|
104
|
+
filter: ["==", ["get", "kind"], "road"],
|
|
105
|
+
layout: { "line-cap": "round", "line-join": "round" },
|
|
106
|
+
paint: {
|
|
107
|
+
"line-color": colors.road,
|
|
108
|
+
"line-width": [
|
|
109
|
+
"case",
|
|
110
|
+
["==", ["get", "major"], true],
|
|
111
|
+
ROAD_WIDTH.major,
|
|
112
|
+
ROAD_WIDTH.minor,
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Opens a link marker's popup on hover and focus and closes it shortly after both leave, and
|
|
121
|
+
* places any popup by script where CSS anchor positioning is missing.
|
|
122
|
+
*/
|
|
123
|
+
function bindPopups(stage, signal) {
|
|
124
|
+
let timers = new WeakMap();
|
|
125
|
+
let anchored = CSS.supports("anchor-name: --a");
|
|
126
|
+
/** The popup a marker, or the popup itself, belongs to. */
|
|
127
|
+
function popupOf(target) {
|
|
128
|
+
if (!(target instanceof Element))
|
|
129
|
+
return null;
|
|
130
|
+
let popup = target.closest('[data-slot="map-popup"]');
|
|
131
|
+
if (popup !== null)
|
|
132
|
+
return popup;
|
|
133
|
+
let id = target.closest("[data-map-popup]")?.dataset.mapPopup;
|
|
134
|
+
return id === undefined ? null : document.getElementById(id);
|
|
135
|
+
}
|
|
136
|
+
/** Opens a popup and cancels a pending close. */
|
|
137
|
+
function open(popup) {
|
|
138
|
+
clearTimeout(timers.get(popup));
|
|
139
|
+
if (!popup.matches(":popover-open"))
|
|
140
|
+
popup.showPopover();
|
|
141
|
+
}
|
|
142
|
+
/** Closes a popup after a short pause unless the pointer or focus comes back. */
|
|
143
|
+
function linger(popup) {
|
|
144
|
+
clearTimeout(timers.get(popup));
|
|
145
|
+
timers.set(popup, setTimeout(() => {
|
|
146
|
+
if (popup.matches(":hover, :focus-within"))
|
|
147
|
+
return;
|
|
148
|
+
let marker = stage.querySelector(`[data-map-popup="${CSS.escape(popup.id)}"]`);
|
|
149
|
+
if (marker?.matches(":hover, :focus"))
|
|
150
|
+
return;
|
|
151
|
+
if (popup.matches(":popover-open"))
|
|
152
|
+
popup.hidePopover();
|
|
153
|
+
}, POPUP_LINGER_MS));
|
|
154
|
+
}
|
|
155
|
+
let options = { signal };
|
|
156
|
+
stage.addEventListener("pointerover", (event) => {
|
|
157
|
+
let popup = popupOf(event.target);
|
|
158
|
+
if (popup !== null)
|
|
159
|
+
open(popup);
|
|
160
|
+
}, options);
|
|
161
|
+
stage.addEventListener("focusin", (event) => {
|
|
162
|
+
let target = event.target;
|
|
163
|
+
if (target instanceof Element && target.closest("[data-map-popup]") === null)
|
|
164
|
+
return;
|
|
165
|
+
let popup = popupOf(target);
|
|
166
|
+
if (popup !== null)
|
|
167
|
+
open(popup);
|
|
168
|
+
}, options);
|
|
169
|
+
for (let type of ["pointerout", "focusout"]) {
|
|
170
|
+
stage.addEventListener(type, (event) => {
|
|
171
|
+
let popup = popupOf(event.target);
|
|
172
|
+
if (popup === null)
|
|
173
|
+
return;
|
|
174
|
+
if (popupOf(event.relatedTarget) === popup)
|
|
175
|
+
return;
|
|
176
|
+
linger(popup);
|
|
177
|
+
}, options);
|
|
178
|
+
}
|
|
179
|
+
if (anchored)
|
|
180
|
+
return;
|
|
181
|
+
stage.addEventListener("toggle", (event) => {
|
|
182
|
+
let popup = event.target;
|
|
183
|
+
if (!(popup instanceof HTMLElement) || popup.dataset.slot !== "map-popup")
|
|
184
|
+
return;
|
|
185
|
+
if (!popup.matches(":popover-open"))
|
|
186
|
+
return;
|
|
187
|
+
let marker = stage.querySelector(`[data-map-popup="${CSS.escape(popup.id)}"], [popovertarget="${CSS.escape(popup.id)}"]`);
|
|
188
|
+
if (marker === null)
|
|
189
|
+
return;
|
|
190
|
+
let pin = marker.getBoundingClientRect();
|
|
191
|
+
let card = popup.getBoundingClientRect();
|
|
192
|
+
let left = Math.min(Math.max(8, pin.left + pin.width / 2 - card.width / 2), innerWidth - card.width - 8);
|
|
193
|
+
let above = pin.top - card.height - 12;
|
|
194
|
+
popup.style.position = "fixed";
|
|
195
|
+
popup.style.left = `${left}px`;
|
|
196
|
+
popup.style.top = `${above >= 8 ? above : pin.bottom + 12}px`;
|
|
197
|
+
}, { capture: true, signal });
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Folds the basemap's credit into its (i) button. The engine opens it on load, and on a phone
|
|
201
|
+
* the open line covers whatever floats at the map's foot until the first pan.
|
|
202
|
+
*/
|
|
203
|
+
function collapseAttribution(container) {
|
|
204
|
+
let attribution = container.querySelector(".maplibregl-compact-show");
|
|
205
|
+
if (attribution === null)
|
|
206
|
+
return;
|
|
207
|
+
attribution.classList.remove("maplibregl-compact-show");
|
|
208
|
+
attribution.setAttribute("open", "");
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Mounts MapLibre into the stage and keeps the stage's HTML parts on the map: markers, labels
|
|
212
|
+
* and bubbles move by `left`/`top`, routes by their path data. Resolves `undefined` when WebGL
|
|
213
|
+
* or the library is unavailable, leaving the server render as it was.
|
|
214
|
+
*/
|
|
215
|
+
async function startMap(stage, first, signal) {
|
|
216
|
+
if (!webglAvailable())
|
|
217
|
+
return undefined;
|
|
218
|
+
let [maplibre] = await Promise.all([
|
|
219
|
+
import("maplibre-gl"),
|
|
220
|
+
import("maplibre-gl/dist/maplibre-gl.css").catch(() => undefined),
|
|
221
|
+
]);
|
|
222
|
+
if (signal.aborted)
|
|
223
|
+
return undefined;
|
|
224
|
+
if (first.workerUrl !== null)
|
|
225
|
+
maplibre.setWorkerUrl(first.workerUrl);
|
|
226
|
+
let props = first;
|
|
227
|
+
let applied = { center: first.center, zoom: first.zoom };
|
|
228
|
+
let dark = isDark(stage);
|
|
229
|
+
let ground = stage.dataset.ground === "water" ? "water" : "land";
|
|
230
|
+
let container = document.createElement("div");
|
|
231
|
+
container.dataset.slot = "map-engine-canvas";
|
|
232
|
+
container.setAttribute("style", "position:absolute;inset:0;z-index:0;opacity:0;pointer-events:none;border-radius:inherit");
|
|
233
|
+
stage.insertBefore(container, stage.firstChild);
|
|
234
|
+
/** The style the basemap draws with in the current theme. */
|
|
235
|
+
function styleFor(basemap) {
|
|
236
|
+
if (basemap?.kind === "style")
|
|
237
|
+
return dark ? basemap.dark : basemap.light;
|
|
238
|
+
let colors = basemapColors(stage);
|
|
239
|
+
let data = basemap?.data ?? { type: "FeatureCollection", features: [] };
|
|
240
|
+
return geojsonStyle(data, ground, colors);
|
|
241
|
+
}
|
|
242
|
+
let map;
|
|
243
|
+
try {
|
|
244
|
+
map = new maplibre.Map({
|
|
245
|
+
container,
|
|
246
|
+
style: styleFor(props.basemap),
|
|
247
|
+
center: props.center,
|
|
248
|
+
zoom: props.zoom,
|
|
249
|
+
minZoom: props.minZoom,
|
|
250
|
+
maxZoom: props.maxZoom,
|
|
251
|
+
attributionControl: props.basemap?.kind === "style" ? { compact: true } : false,
|
|
252
|
+
cooperativeGestures: matchMedia("(pointer: coarse)").matches,
|
|
253
|
+
dragRotate: false,
|
|
254
|
+
pitchWithRotate: false,
|
|
255
|
+
touchPitch: false,
|
|
256
|
+
fadeDuration: reducedMotion() ? 0 : 300,
|
|
257
|
+
locale: {
|
|
258
|
+
"Map.Title": props.label,
|
|
259
|
+
"CooperativeGesturesHandler.WindowsHelpText": props.gestureHint,
|
|
260
|
+
"CooperativeGesturesHandler.MacHelpText": props.gestureHint,
|
|
261
|
+
"CooperativeGesturesHandler.MobileHelpText": props.gestureHint,
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
container.remove();
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
map.touchZoomRotate.disableRotation();
|
|
270
|
+
map.keyboard.disableRotation();
|
|
271
|
+
let live = await new Promise((resolve) => {
|
|
272
|
+
let timer = setTimeout(() => resolve(false), LOAD_TIMEOUT_MS);
|
|
273
|
+
map.once("idle", () => {
|
|
274
|
+
clearTimeout(timer);
|
|
275
|
+
resolve(true);
|
|
276
|
+
});
|
|
277
|
+
signal.addEventListener("abort", () => resolve(false), { once: true });
|
|
278
|
+
});
|
|
279
|
+
if (!live) {
|
|
280
|
+
map.remove();
|
|
281
|
+
container.remove();
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
collapseAttribution(container);
|
|
285
|
+
let members = new WeakMap();
|
|
286
|
+
let quiet = false;
|
|
287
|
+
let frame = 0;
|
|
288
|
+
let located;
|
|
289
|
+
/** Pixels from the stage's middle to a point at the current camera. */
|
|
290
|
+
function offsetOf(point) {
|
|
291
|
+
let projected = map.project(point);
|
|
292
|
+
return [projected.x - stage.clientWidth / 2, projected.y - stage.clientHeight / 2];
|
|
293
|
+
}
|
|
294
|
+
/** Moves a part to `point`. */
|
|
295
|
+
function place(element, point) {
|
|
296
|
+
let { left, top } = offsetStyle(offsetOf(point));
|
|
297
|
+
element.style.left = left;
|
|
298
|
+
element.style.top = top;
|
|
299
|
+
}
|
|
300
|
+
/** Reads a part's point from its `data-lng`/`data-lat`. */
|
|
301
|
+
function pointOf(element) {
|
|
302
|
+
return [Number(element.dataset.lng), Number(element.dataset.lat)];
|
|
303
|
+
}
|
|
304
|
+
/** Lights a bubble while any marker inside it is lit, so a hovered listing finds its spot. */
|
|
305
|
+
function lightBubbles() {
|
|
306
|
+
for (let bubble of stage.querySelectorAll('[data-slot="map-cluster"]')) {
|
|
307
|
+
let keys = bubble.dataset.keys?.split(" ") ?? [];
|
|
308
|
+
let lit = keys.some((key) => key !== "" &&
|
|
309
|
+
stage.querySelector(`[data-slot="map-marker"][data-map-key="${CSS.escape(key)}"][data-highlighted]`) !== null);
|
|
310
|
+
if (lit === bubble.hasAttribute("data-highlighted"))
|
|
311
|
+
continue;
|
|
312
|
+
if (lit)
|
|
313
|
+
bubble.setAttribute("data-highlighted", "");
|
|
314
|
+
else
|
|
315
|
+
bubble.removeAttribute("data-highlighted");
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/** Places every part for the current camera and rebuilds the bubbles. */
|
|
319
|
+
function layout() {
|
|
320
|
+
frame = 0;
|
|
321
|
+
for (let element of stage.querySelectorAll('[data-slot="map-marker"], [data-slot="map-place"], [data-slot="map-you"]')) {
|
|
322
|
+
place(element, pointOf(element));
|
|
323
|
+
}
|
|
324
|
+
for (let route of stage.querySelectorAll('[data-slot="map-route"]')) {
|
|
325
|
+
let d = linePath(readPath(route.getAttribute("data-path")), (point) => offsetOf([point[0] ?? 0, point[1] ?? 0]));
|
|
326
|
+
for (let part of route.querySelectorAll("[data-route-part]"))
|
|
327
|
+
part.setAttribute("d", d);
|
|
328
|
+
for (let marker of route.querySelectorAll('[data-slot="map-route-marker"]')) {
|
|
329
|
+
marker.style.offsetPath = `path(${JSON.stringify(d)})`;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
let markers = [...stage.querySelectorAll('[data-slot="map-marker"]')];
|
|
333
|
+
let groups = clusterPoints(markers.map((marker) => {
|
|
334
|
+
let [x, y] = offsetOf(pointOf(marker));
|
|
335
|
+
return { x, y, alone: marker.hasAttribute("data-current") };
|
|
336
|
+
}), props.clusterRadius);
|
|
337
|
+
let template = stage.querySelector("[data-cluster-template]");
|
|
338
|
+
let pool = [
|
|
339
|
+
...stage.querySelectorAll('[data-slot="map-cluster"]:not([data-cluster-template])'),
|
|
340
|
+
];
|
|
341
|
+
for (let group of groups) {
|
|
342
|
+
let grouped = group.members.length > 1;
|
|
343
|
+
for (let index of group.members)
|
|
344
|
+
markers[index].hidden = grouped;
|
|
345
|
+
if (!grouped || template === null)
|
|
346
|
+
continue;
|
|
347
|
+
let bubble = pool.shift() ?? template.cloneNode(true);
|
|
348
|
+
if (!bubble.isConnected) {
|
|
349
|
+
bubble.removeAttribute("data-cluster-template");
|
|
350
|
+
template.parentNode?.insertBefore(bubble, template);
|
|
351
|
+
}
|
|
352
|
+
bubble.hidden = false;
|
|
353
|
+
let points = group.members.map((index) => pointOf(markers[index]));
|
|
354
|
+
members.set(bubble, points);
|
|
355
|
+
bubble.dataset.keys = group.members
|
|
356
|
+
.map((index) => markers[index].dataset.mapKey ?? "")
|
|
357
|
+
.join(" ");
|
|
358
|
+
bubble.textContent = String(group.members.length);
|
|
359
|
+
bubble.setAttribute("aria-label", clusterLabel(props.clusterLabel, group.members.length));
|
|
360
|
+
let { left, top } = offsetStyle([group.x, group.y]);
|
|
361
|
+
bubble.style.left = left;
|
|
362
|
+
bubble.style.top = top;
|
|
363
|
+
}
|
|
364
|
+
for (let unused of pool)
|
|
365
|
+
unused.remove();
|
|
366
|
+
lightBubbles();
|
|
367
|
+
let zoom = map.getZoom();
|
|
368
|
+
for (let control of stage.querySelectorAll("[data-map-control^='zoom-']")) {
|
|
369
|
+
let limit = control.dataset.mapControl === "zoom-in" ? zoom >= props.maxZoom : zoom <= props.minZoom;
|
|
370
|
+
if (limit)
|
|
371
|
+
control.setAttribute("aria-disabled", "true");
|
|
372
|
+
else
|
|
373
|
+
control.removeAttribute("aria-disabled");
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/** Lays the stage out on the next frame, once per frame however many moves arrive. */
|
|
377
|
+
function schedule() {
|
|
378
|
+
if (frame === 0)
|
|
379
|
+
frame = requestAnimationFrame(layout);
|
|
380
|
+
}
|
|
381
|
+
/** Writes the visible bounds, middle and zoom into the search area's fields. */
|
|
382
|
+
function writeArea() {
|
|
383
|
+
let bounds = map.getBounds();
|
|
384
|
+
let center = map.getCenter();
|
|
385
|
+
let values = {
|
|
386
|
+
bounds: formatBounds([
|
|
387
|
+
bounds.getWest(),
|
|
388
|
+
bounds.getSouth(),
|
|
389
|
+
bounds.getEast(),
|
|
390
|
+
bounds.getNorth(),
|
|
391
|
+
]),
|
|
392
|
+
center: formatLngLat([center.lng, center.lat]),
|
|
393
|
+
zoom: String(roundTo(map.getZoom(), 2)),
|
|
394
|
+
};
|
|
395
|
+
for (let field of stage.querySelectorAll("input[data-map-area]")) {
|
|
396
|
+
let value = values[field.dataset.mapArea ?? ""];
|
|
397
|
+
if (value !== undefined)
|
|
398
|
+
field.value = value;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/** Moves the camera, without animation under reduced motion. */
|
|
402
|
+
function animate() {
|
|
403
|
+
return reducedMotion() ? { duration: 0, animate: false } : {};
|
|
404
|
+
}
|
|
405
|
+
map.on("move", schedule);
|
|
406
|
+
map.on("resize", schedule);
|
|
407
|
+
map.on("moveend", () => {
|
|
408
|
+
schedule();
|
|
409
|
+
writeArea();
|
|
410
|
+
if (quiet) {
|
|
411
|
+
quiet = false;
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
for (let button of stage.querySelectorAll('[data-slot="map-area"]')) {
|
|
415
|
+
button.hidden = false;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
stage.addEventListener("click", (event) => {
|
|
419
|
+
let target = event.target instanceof Element ? event.target : null;
|
|
420
|
+
let bubble = target?.closest('[data-slot="map-cluster"]');
|
|
421
|
+
if (bubble) {
|
|
422
|
+
event.preventDefault();
|
|
423
|
+
let points = members.get(bubble) ?? [];
|
|
424
|
+
if (points.length === 0)
|
|
425
|
+
return;
|
|
426
|
+
let bounds = new maplibre.LngLatBounds(points[0], points[0]);
|
|
427
|
+
for (let point of points)
|
|
428
|
+
bounds.extend(point);
|
|
429
|
+
map.fitBounds(bounds, { padding: FIT_PADDING, maxZoom: props.maxZoom, ...animate() });
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
let control = target?.closest("[data-map-control]");
|
|
433
|
+
if (!control)
|
|
434
|
+
return;
|
|
435
|
+
event.preventDefault();
|
|
436
|
+
if (control.getAttribute("aria-disabled") === "true")
|
|
437
|
+
return;
|
|
438
|
+
switch (control.dataset.mapControl) {
|
|
439
|
+
case "zoom-in":
|
|
440
|
+
map.zoomIn(animate());
|
|
441
|
+
break;
|
|
442
|
+
case "zoom-out":
|
|
443
|
+
map.zoomOut(animate());
|
|
444
|
+
break;
|
|
445
|
+
case "reset":
|
|
446
|
+
map.easeTo({ center: props.center, zoom: props.zoom, ...animate() });
|
|
447
|
+
break;
|
|
448
|
+
case "locate":
|
|
449
|
+
navigator.geolocation?.getCurrentPosition((position) => {
|
|
450
|
+
located = [position.coords.longitude, position.coords.latitude];
|
|
451
|
+
let dot = stage.querySelector('[data-slot="map-you"]');
|
|
452
|
+
if (dot === null) {
|
|
453
|
+
dot = document.createElement("span");
|
|
454
|
+
dot.dataset.slot = "map-you";
|
|
455
|
+
dot.setAttribute("aria-hidden", "true");
|
|
456
|
+
dot.setAttribute("style", "position:absolute;z-index:3;inline-size:14px;block-size:14px;translate:-50% -50%;border-radius:50%;background:var(--ui-brand-bg-solid);box-shadow:0 0 0 3px var(--ui-surface-raised, Canvas),0 0 0 8px color-mix(in oklab, var(--ui-brand-bg-solid) 25%, transparent)");
|
|
457
|
+
stage.appendChild(dot);
|
|
458
|
+
}
|
|
459
|
+
dot.dataset.lng = String(located[0]);
|
|
460
|
+
dot.dataset.lat = String(located[1]);
|
|
461
|
+
map.easeTo({
|
|
462
|
+
center: located,
|
|
463
|
+
zoom: Math.max(map.getZoom(), LOCATE_ZOOM),
|
|
464
|
+
...animate(),
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
break;
|
|
468
|
+
case "fullscreen":
|
|
469
|
+
if (document.fullscreenElement === stage)
|
|
470
|
+
void document.exitFullscreen();
|
|
471
|
+
else
|
|
472
|
+
void stage.requestFullscreen?.();
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
}, { signal });
|
|
476
|
+
document.addEventListener("fullscreenchange", () => {
|
|
477
|
+
let full = document.fullscreenElement === stage;
|
|
478
|
+
for (let control of stage.querySelectorAll('[data-map-control="fullscreen"]')) {
|
|
479
|
+
control.setAttribute("aria-pressed", full ? "true" : "false");
|
|
480
|
+
}
|
|
481
|
+
}, { signal });
|
|
482
|
+
/** Repaints the basemap after the theme changes. */
|
|
483
|
+
function recolor() {
|
|
484
|
+
let nowDark = isDark(stage);
|
|
485
|
+
if (props.basemap?.kind === "style") {
|
|
486
|
+
if (nowDark !== dark) {
|
|
487
|
+
dark = nowDark;
|
|
488
|
+
map.setStyle(styleFor(props.basemap));
|
|
489
|
+
}
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
dark = nowDark;
|
|
493
|
+
let colors = basemapColors(stage);
|
|
494
|
+
map.setPaintProperty("ground", "background-color", colors[ground]);
|
|
495
|
+
for (let kind of ["land", "park", "water"]) {
|
|
496
|
+
map.setPaintProperty(kind, "fill-color", colors[kind]);
|
|
497
|
+
}
|
|
498
|
+
map.setPaintProperty("road", "line-color", colors.road);
|
|
499
|
+
}
|
|
500
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", recolor, { signal });
|
|
501
|
+
let themeObserver = new MutationObserver(recolor);
|
|
502
|
+
themeObserver.observe(document.documentElement, {
|
|
503
|
+
attributes: true,
|
|
504
|
+
attributeFilter: ["class", "style", "data-theme"],
|
|
505
|
+
});
|
|
506
|
+
let partsObserver = new MutationObserver((records) => {
|
|
507
|
+
let relevant = records.some((record) => {
|
|
508
|
+
if (record.type === "attributes") {
|
|
509
|
+
return record.target instanceof HTMLElement && record.target.dataset.slot !== "map-cluster";
|
|
510
|
+
}
|
|
511
|
+
return [...record.addedNodes, ...record.removedNodes].some((node) => node instanceof HTMLElement &&
|
|
512
|
+
node.dataset.slot !== "map-cluster" &&
|
|
513
|
+
node.dataset.slot !== "map-you");
|
|
514
|
+
});
|
|
515
|
+
if (!relevant)
|
|
516
|
+
return;
|
|
517
|
+
if (records.every((record) => record.type === "attributes"))
|
|
518
|
+
lightBubbles();
|
|
519
|
+
else
|
|
520
|
+
schedule();
|
|
521
|
+
});
|
|
522
|
+
partsObserver.observe(stage, {
|
|
523
|
+
childList: true,
|
|
524
|
+
subtree: true,
|
|
525
|
+
attributes: true,
|
|
526
|
+
attributeFilter: ["data-highlighted"],
|
|
527
|
+
});
|
|
528
|
+
for (let server of stage.querySelectorAll('[data-slot="map-cluster"]:not([data-cluster-template])')) {
|
|
529
|
+
server.remove();
|
|
530
|
+
}
|
|
531
|
+
for (let control of stage.querySelectorAll("[data-map-control]")) {
|
|
532
|
+
control.hidden = false;
|
|
533
|
+
}
|
|
534
|
+
container.style.opacity = "";
|
|
535
|
+
container.style.pointerEvents = "";
|
|
536
|
+
stage.dataset.engine = "live";
|
|
537
|
+
layout();
|
|
538
|
+
writeArea();
|
|
539
|
+
return {
|
|
540
|
+
sync(next) {
|
|
541
|
+
let previous = props;
|
|
542
|
+
props = next;
|
|
543
|
+
let moved = next.center[0] !== applied.center[0] ||
|
|
544
|
+
next.center[1] !== applied.center[1] ||
|
|
545
|
+
next.zoom !== applied.zoom;
|
|
546
|
+
if (moved) {
|
|
547
|
+
applied = { center: next.center, zoom: next.zoom };
|
|
548
|
+
quiet = true;
|
|
549
|
+
map.jumpTo({ center: next.center, zoom: next.zoom });
|
|
550
|
+
for (let button of stage.querySelectorAll('[data-slot="map-area"]')) {
|
|
551
|
+
button.hidden = true;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
if (next.basemap !== null &&
|
|
555
|
+
JSON.stringify(next.basemap) !== JSON.stringify(previous.basemap)) {
|
|
556
|
+
map.setStyle(styleFor(next.basemap));
|
|
557
|
+
}
|
|
558
|
+
schedule();
|
|
559
|
+
},
|
|
560
|
+
stop() {
|
|
561
|
+
if (frame !== 0)
|
|
562
|
+
cancelAnimationFrame(frame);
|
|
563
|
+
themeObserver.disconnect();
|
|
564
|
+
partsObserver.disconnect();
|
|
565
|
+
map.remove();
|
|
566
|
+
container.remove();
|
|
567
|
+
delete stage.dataset.engine;
|
|
568
|
+
},
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Hydrates a map stage: popups of link markers open on hover and focus, and where WebGL works
|
|
573
|
+
* MapLibre takes over the basemap with drag, wheel, pinch and keyboard panning and zooming
|
|
574
|
+
* (two fingers on touch screens). The stage's `data-engine` reads `live` then, or `static`
|
|
575
|
+
* when the server render stays; everything detaches when `signal` aborts.
|
|
576
|
+
*/
|
|
577
|
+
export async function startEngine(stage, props, signal) {
|
|
578
|
+
bindPopups(stage, signal);
|
|
579
|
+
stage.dataset.engine = "loading";
|
|
580
|
+
let started = await startMap(stage, props, signal).catch(() => undefined);
|
|
581
|
+
if (signal.aborted) {
|
|
582
|
+
started?.stop();
|
|
583
|
+
return undefined;
|
|
584
|
+
}
|
|
585
|
+
if (started === undefined) {
|
|
586
|
+
stage.dataset.engine = "static";
|
|
587
|
+
return undefined;
|
|
588
|
+
}
|
|
589
|
+
signal.addEventListener("abort", () => started.stop(), { once: true });
|
|
590
|
+
return started;
|
|
591
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel for `@sdxc/ui/map`: maps and the pieces that sit on them (markers, popups, routes,
|
|
3
|
+
* clusters, controls), drawn on the server and made interactive in the browser, plus the
|
|
4
|
+
* mixins that link a list to its pins. Each module also imports on its own.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
export * from "./mixins/map-link.js";
|
|
10
|
+
export * from "./map-canvas.js";
|
|
11
|
+
export * from "./map.js";
|
|
12
|
+
export * from "./engine.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel for `@sdxc/ui/map`: maps and the pieces that sit on them (markers, popups, routes,
|
|
3
|
+
* clusters, controls), drawn on the server and made interactive in the browser, plus the
|
|
4
|
+
* mixins that link a list to its pins. Each module also imports on its own.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
export * from "./mixins/map-link.js";
|
|
10
|
+
export * from "./map-canvas.js";
|
|
11
|
+
export * from "./map.js";
|
|
12
|
+
export * from "./engine.js";
|