@osm-editor-kit/street-imagery-react 0.1.0-alpha.13 → 0.1.0-alpha.15
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/LICENSE +21 -0
- package/README.md +54 -2
- package/dist/MapillaryPanel-SOHGB7JA.js +3 -0
- package/dist/PanoramaxPanel-5P5LWMRY.js +3 -0
- package/dist/StreetLevelImageryViewer.d.ts +8 -2
- package/dist/{chunk-QBBIFF2C.js → chunk-LZR5SZDS.js} +112 -62
- package/dist/{chunk-5D7YCQUN.js → chunk-R6BDVYWM.js} +94 -39
- package/dist/chunk-XLBFXACK.js +56 -0
- package/dist/filters/PhotoDateRangeFilter.d.ts +4 -1
- package/dist/filters/dateSliderPointer.d.ts +21 -0
- package/dist/hooks/useProviderData.d.ts +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +915 -738
- package/dist/mapillary/useMapillaryFeatures.d.ts +5 -5
- package/dist/panels/MapillaryPanel.d.ts +7 -2
- package/dist/panels/PanoramaxPanel.d.ts +7 -2
- package/dist/panels/PanoramaxWebViewerPanel.d.ts +7 -2
- package/dist/panels/panoramaxItem.d.ts +2 -0
- package/dist/panels/photoView.d.ts +19 -0
- package/dist/panoramax-web-viewer.js +113 -51
- package/dist/viewer-panels.js +3 -2
- package/dist/viewpoints/FloatingPhotoViewer.d.ts +22 -7
- package/dist/viewpoints/floatingViewerPosition.d.ts +18 -0
- package/dist/viewpoints/usePhotosLookingAt.d.ts +26 -0
- package/package.json +7 -4
- package/dist/MapillaryPanel-FQR4TTEW.js +0 -2
- package/dist/PanoramaxPanel-GO4GSVFE.js +0 -2
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { useStreetImageryI18n } from './chunk-3DFVM6VK.js';
|
|
|
2
2
|
export { STREET_IMAGERY_MESSAGES, StreetImageryLocaleProvider, useStreetImageryI18n } from './chunk-3DFVM6VK.js';
|
|
3
3
|
export { useViewerActions, useViewerBearing, useViewerHfov, useViewerLngLat } from './chunk-GYUS2JVV.js';
|
|
4
4
|
import { c } from 'react/compiler-runtime';
|
|
5
|
-
import { distanceMeters, sequencesToFeatureCollection, emptyLineCollection, adapterById, providerById, providerCoversBbox, fetchedSequencesMinZoom, viewShapeRadiusMeters, viewConeGeoJson, viewfieldLayerId, photoLayerId, photoTargetLayerId, featureLayerId, PROVIDER_IDS, mapFeatureMatchesDateRange, isBrowserAvailableProvider, photoFilter, photoFullUrlQueryKey, photoThumbnailQueryKey, formatLocalDateTime, formatRelativeDate, formatDateTooltip, formatMonth, mapillaryPhotoSource, buildViewSuggestions, yearsToMs, SIGN_TARGET, bestTargetImage, MAP_FEATURE_COLOR, mapillaryValueName, mapillaryIconUrl, dateRangeToSliderPositions, sliderPositionsToDateRange, dateSliderBins, dateSliderPosition, yearsAgoMs, parseIsoDateStartMs, findLocationOpener, formatDate, isIsoDate, alignLineToPoints, setStreetImageryConfig, fetchImageDetections, fetchMapFeatureImages, fetchMapillaryMapFeaturesInBbox, bboxAround, resolvePhotoPanoramaUrl, resolvePhotoThumbnailUrl, coneRadiusMeters, openLocationInNewTab, buildMapFeatureLayerFilter, featureSourceId, viewfieldZoomStep, buildPhotoLayerFilter, photoSourceId, viewfieldSourceId, sequenceTilesSourceId, renameExpressionProperties, sequenceTilesLayerId, sequenceSourceId, sequenceLayerId, viewfieldLineLayerId, emptyPointCollection, mapFeaturesToFeatureCollection, VIEWFIELD_MIN_ZOOM, photosToFeatureCollection, photosToViewfieldsFeatureCollection, emptyPolygonCollection, bboxIntersects } from '@osm-editor-kit/street-imagery';
|
|
5
|
+
import { distanceMeters, sequencesToFeatureCollection, emptyLineCollection, adapterById, providerById, providerCoversBbox, fetchedSequencesMinZoom, viewShapeRadiusMeters, viewConeGeoJson, viewfieldLayerId, photoLayerId, photoTargetLayerId, featureLayerId, PROVIDER_IDS, mapFeatureMatchesDateRange, isBrowserAvailableProvider, photoFilter, photoFullUrlQueryKey, photoThumbnailQueryKey, formatLocalDateTime, formatRelativeDate, formatDateTooltip, formatMonth, mapillaryPhotoSource, buildViewSuggestions, yearsToMs, rankPhotosLookingAt, SIGN_TARGET, bestTargetImage, MAP_FEATURE_COLOR, mapillaryValueName, mapillaryIconUrl, dateRangeToSliderPositions, sliderPositionsToDateRange, dateSliderBins, dateSliderPosition, yearsAgoMs, parseIsoDateStartMs, findLocationOpener, formatDate, isIsoDate, alignLineToPoints, setStreetImageryConfig, fetchImageDetections, fetchMapFeatureImages, fetchMapillaryMapFeaturesInBbox, bboxAround, resolvePhotoPanoramaUrl, resolvePhotoThumbnailUrl, coneRadiusMeters, openLocationInNewTab, buildMapFeatureLayerFilter, featureSourceId, viewfieldZoomStep, buildPhotoLayerFilter, photoSourceId, viewfieldSourceId, sequenceTilesSourceId, renameExpressionProperties, sequenceTilesLayerId, sequenceSourceId, sequenceLayerId, viewfieldLineLayerId, emptyPointCollection, mapFeaturesToFeatureCollection, VIEWFIELD_MIN_ZOOM, photosToFeatureCollection, photosToViewfieldsFeatureCollection, emptyPolygonCollection, bboxIntersects } from '@osm-editor-kit/street-imagery';
|
|
6
6
|
import { useMap, Source, Layer } from 'react-map-gl/maplibre';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { lazy, useEffect, useSyncExternalStore, useState, useRef, useEffectEvent, Fragment as Fragment$1, Suspense } from 'react';
|
|
@@ -1490,10 +1490,10 @@ var StreetLevelImagerySourcesAndLayers = (t0) => {
|
|
|
1490
1490
|
function _temp(id) {
|
|
1491
1491
|
return providerById[id].kind === "photo" && adapterById[id]?.fetchPhotos;
|
|
1492
1492
|
}
|
|
1493
|
-
var MapillaryPanel = lazy(() => import('./MapillaryPanel-
|
|
1493
|
+
var MapillaryPanel = lazy(() => import('./MapillaryPanel-SOHGB7JA.js').then((module) => ({
|
|
1494
1494
|
default: module.MapillaryPanel
|
|
1495
1495
|
})));
|
|
1496
|
-
var PanoramaxPanel = lazy(() => import('./PanoramaxPanel-
|
|
1496
|
+
var PanoramaxPanel = lazy(() => import('./PanoramaxPanel-5P5LWMRY.js').then((module) => ({
|
|
1497
1497
|
default: module.PanoramaxPanel
|
|
1498
1498
|
})));
|
|
1499
1499
|
var ViewerPanelPlaceholder = () => {
|
|
@@ -1512,13 +1512,14 @@ var ViewerPanelPlaceholder = () => {
|
|
|
1512
1512
|
return t0;
|
|
1513
1513
|
};
|
|
1514
1514
|
var StreetLevelImageryViewer = (t0) => {
|
|
1515
|
-
const $ = c(
|
|
1515
|
+
const $ = c(22);
|
|
1516
1516
|
const {
|
|
1517
1517
|
photo,
|
|
1518
1518
|
groupPhotos,
|
|
1519
1519
|
onPhotoSelected,
|
|
1520
1520
|
onEaseMapToPoint,
|
|
1521
1521
|
onViewerPhoto,
|
|
1522
|
+
onViewerView,
|
|
1522
1523
|
lookAtBearing,
|
|
1523
1524
|
lookAt,
|
|
1524
1525
|
outlines,
|
|
@@ -1534,8 +1535,8 @@ var StreetLevelImageryViewer = (t0) => {
|
|
|
1534
1535
|
t1 = $[0];
|
|
1535
1536
|
}
|
|
1536
1537
|
let t2;
|
|
1537
|
-
if ($[1] !== groupPhotos || $[2] !== hideAttribution || $[3] !== lookAt || $[4] !== lookAtBearing || $[5] !== onEaseMapToPoint || $[6] !== onPhotoSelected || $[7] !== onViewerPhoto || $[8] !==
|
|
1538
|
-
t2 = /* @__PURE__ */ jsx(Suspense, { fallback: t1, children: /* @__PURE__ */ jsx(MapillaryPanel, { groupPhotos, hideAttribution, onEaseMapToPoint, onPhotoSelected, lookAt, lookAtBearing, outlines, onViewerPhoto, photo }) });
|
|
1538
|
+
if ($[1] !== groupPhotos || $[2] !== hideAttribution || $[3] !== lookAt || $[4] !== lookAtBearing || $[5] !== onEaseMapToPoint || $[6] !== onPhotoSelected || $[7] !== onViewerPhoto || $[8] !== onViewerView || $[9] !== outlines || $[10] !== photo) {
|
|
1539
|
+
t2 = /* @__PURE__ */ jsx(Suspense, { fallback: t1, children: /* @__PURE__ */ jsx(MapillaryPanel, { groupPhotos, hideAttribution, onEaseMapToPoint, onPhotoSelected, lookAt, lookAtBearing, outlines, onViewerPhoto, onViewerView, photo }) });
|
|
1539
1540
|
$[1] = groupPhotos;
|
|
1540
1541
|
$[2] = hideAttribution;
|
|
1541
1542
|
$[3] = lookAt;
|
|
@@ -1543,36 +1544,38 @@ var StreetLevelImageryViewer = (t0) => {
|
|
|
1543
1544
|
$[5] = onEaseMapToPoint;
|
|
1544
1545
|
$[6] = onPhotoSelected;
|
|
1545
1546
|
$[7] = onViewerPhoto;
|
|
1546
|
-
$[8] =
|
|
1547
|
-
$[9] =
|
|
1548
|
-
$[10] =
|
|
1547
|
+
$[8] = onViewerView;
|
|
1548
|
+
$[9] = outlines;
|
|
1549
|
+
$[10] = photo;
|
|
1550
|
+
$[11] = t2;
|
|
1549
1551
|
} else {
|
|
1550
|
-
t2 = $[
|
|
1552
|
+
t2 = $[11];
|
|
1551
1553
|
}
|
|
1552
1554
|
return t2;
|
|
1553
1555
|
}
|
|
1554
1556
|
if (photo.providerId === "panoramax") {
|
|
1555
1557
|
const Panel = PanoramaxPanelOverride ?? PanoramaxPanel;
|
|
1556
1558
|
let t1;
|
|
1557
|
-
if ($[
|
|
1559
|
+
if ($[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1558
1560
|
t1 = /* @__PURE__ */ jsx(ViewerPanelPlaceholder, {});
|
|
1559
|
-
$[
|
|
1561
|
+
$[12] = t1;
|
|
1560
1562
|
} else {
|
|
1561
|
-
t1 = $[
|
|
1563
|
+
t1 = $[12];
|
|
1562
1564
|
}
|
|
1563
1565
|
let t2;
|
|
1564
|
-
if ($[
|
|
1565
|
-
t2 = /* @__PURE__ */ jsx(Suspense, { fallback: t1, children: /* @__PURE__ */ jsx(Panel, { groupPhotos, hideAttribution, onViewerPhoto, onEaseMapToPoint, onPhotoSelected, photo }) });
|
|
1566
|
-
$[
|
|
1567
|
-
$[
|
|
1568
|
-
$[
|
|
1569
|
-
$[
|
|
1570
|
-
$[
|
|
1571
|
-
$[
|
|
1572
|
-
$[
|
|
1573
|
-
$[
|
|
1566
|
+
if ($[13] !== Panel || $[14] !== groupPhotos || $[15] !== hideAttribution || $[16] !== onEaseMapToPoint || $[17] !== onPhotoSelected || $[18] !== onViewerPhoto || $[19] !== onViewerView || $[20] !== photo) {
|
|
1567
|
+
t2 = /* @__PURE__ */ jsx(Suspense, { fallback: t1, children: /* @__PURE__ */ jsx(Panel, { groupPhotos, hideAttribution, onViewerPhoto, onViewerView, onEaseMapToPoint, onPhotoSelected, photo }) });
|
|
1568
|
+
$[13] = Panel;
|
|
1569
|
+
$[14] = groupPhotos;
|
|
1570
|
+
$[15] = hideAttribution;
|
|
1571
|
+
$[16] = onEaseMapToPoint;
|
|
1572
|
+
$[17] = onPhotoSelected;
|
|
1573
|
+
$[18] = onViewerPhoto;
|
|
1574
|
+
$[19] = onViewerView;
|
|
1575
|
+
$[20] = photo;
|
|
1576
|
+
$[21] = t2;
|
|
1574
1577
|
} else {
|
|
1575
|
-
t2 = $[
|
|
1578
|
+
t2 = $[21];
|
|
1576
1579
|
}
|
|
1577
1580
|
return t2;
|
|
1578
1581
|
}
|
|
@@ -1929,6 +1932,24 @@ ${formatRelativeDate(timestamp, locale)}` : formatDateTooltip(timestamp, locale)
|
|
|
1929
1932
|
return t5;
|
|
1930
1933
|
};
|
|
1931
1934
|
|
|
1935
|
+
// src/viewpoints/floatingViewerPosition.ts
|
|
1936
|
+
var FLOATING_VIEWER_EDGE = 8;
|
|
1937
|
+
var clampFloatingViewerPosition = ({
|
|
1938
|
+
right,
|
|
1939
|
+
bottom
|
|
1940
|
+
}, box, container, minVisibleShare) => {
|
|
1941
|
+
if (minVisibleShare === void 0) {
|
|
1942
|
+
return {
|
|
1943
|
+
right: Math.max(FLOATING_VIEWER_EDGE, right),
|
|
1944
|
+
bottom: Math.max(FLOATING_VIEWER_EDGE, bottom)
|
|
1945
|
+
};
|
|
1946
|
+
}
|
|
1947
|
+
return {
|
|
1948
|
+
right: Math.min(container.width - box.width * minVisibleShare, Math.max(-box.width * (1 - minVisibleShare), right)),
|
|
1949
|
+
bottom: Math.min(container.height - box.height, Math.max(-box.height * (1 - minVisibleShare), bottom))
|
|
1950
|
+
};
|
|
1951
|
+
};
|
|
1952
|
+
|
|
1932
1953
|
// src/viewpoints/viewDirectionLabels.ts
|
|
1933
1954
|
var viewSuggestionLabel = ({
|
|
1934
1955
|
viewpoint,
|
|
@@ -1941,7 +1962,16 @@ var DEFAULT_LAYOUT = {
|
|
|
1941
1962
|
minimized: false
|
|
1942
1963
|
};
|
|
1943
1964
|
var MIN_WIDTH = 280;
|
|
1944
|
-
var
|
|
1965
|
+
var BUTTON_DRAG_SLOP = 4;
|
|
1966
|
+
var EDGE = FLOATING_VIEWER_EDGE;
|
|
1967
|
+
var MINIMIZED_WIDTH = "6rem";
|
|
1968
|
+
var containerSize = (box, position) => {
|
|
1969
|
+
const container = position === "fixed" ? document.documentElement : box.offsetParent;
|
|
1970
|
+
return {
|
|
1971
|
+
width: container?.clientWidth ?? 0,
|
|
1972
|
+
height: container?.clientHeight ?? 0
|
|
1973
|
+
};
|
|
1974
|
+
};
|
|
1945
1975
|
var hasStoredLayout = (storageKey) => {
|
|
1946
1976
|
try {
|
|
1947
1977
|
return localStorage.getItem(storageKey) != null;
|
|
@@ -2013,7 +2043,7 @@ var ToolbarButton = (t0) => {
|
|
|
2013
2043
|
} = t0;
|
|
2014
2044
|
let t1;
|
|
2015
2045
|
if ($[0] !== children || $[1] !== disabled || $[2] !== label || $[3] !== onClick) {
|
|
2016
|
-
t1 = /* @__PURE__ */ jsx("button", { "aria-label": label, className: "inline-flex size-7 items-center justify-center rounded-md text-slate-600 hover:bg-slate-100 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent", disabled, onClick, title: label, type: "button", children });
|
|
2046
|
+
t1 = /* @__PURE__ */ jsx("button", { "aria-label": label, className: "inline-flex size-7 shrink-0 items-center justify-center rounded-md text-slate-600 hover:bg-slate-100 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent", disabled, onClick, title: label, type: "button", children });
|
|
2017
2047
|
$[0] = children;
|
|
2018
2048
|
$[1] = disabled;
|
|
2019
2049
|
$[2] = label;
|
|
@@ -2246,16 +2276,16 @@ var FloatingViewerInfoButton = (t0) => {
|
|
|
2246
2276
|
return t2;
|
|
2247
2277
|
};
|
|
2248
2278
|
var FloatingPhotoViewer = (t0) => {
|
|
2249
|
-
const $ = c(
|
|
2279
|
+
const $ = c(136);
|
|
2250
2280
|
const {
|
|
2251
2281
|
title,
|
|
2252
2282
|
titleActions,
|
|
2253
|
-
suggestions,
|
|
2283
|
+
suggestions: t1,
|
|
2254
2284
|
activeDirectionKey,
|
|
2255
2285
|
onSelectSuggestion,
|
|
2256
2286
|
shownPhotoId,
|
|
2257
|
-
canGoBack:
|
|
2258
|
-
canGoForward:
|
|
2287
|
+
canGoBack: t2,
|
|
2288
|
+
canGoForward: t3,
|
|
2259
2289
|
onBack,
|
|
2260
2290
|
onForward,
|
|
2261
2291
|
onClose,
|
|
@@ -2265,70 +2295,99 @@ var FloatingPhotoViewer = (t0) => {
|
|
|
2265
2295
|
children,
|
|
2266
2296
|
footer,
|
|
2267
2297
|
drawer,
|
|
2268
|
-
storageKey:
|
|
2269
|
-
defaultPosition
|
|
2298
|
+
storageKey: t4,
|
|
2299
|
+
defaultPosition,
|
|
2300
|
+
position: t5,
|
|
2301
|
+
minVisibleShare
|
|
2270
2302
|
} = t0;
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2303
|
+
let t6;
|
|
2304
|
+
if ($[0] !== t1) {
|
|
2305
|
+
t6 = t1 === void 0 ? [] : t1;
|
|
2306
|
+
$[0] = t1;
|
|
2307
|
+
$[1] = t6;
|
|
2308
|
+
} else {
|
|
2309
|
+
t6 = $[1];
|
|
2310
|
+
}
|
|
2311
|
+
const suggestions = t6;
|
|
2312
|
+
const canGoBack = t2 === void 0 ? false : t2;
|
|
2313
|
+
const canGoForward = t3 === void 0 ? false : t3;
|
|
2314
|
+
const storageKey = t4 === void 0 ? "street-imagery:floating-viewer" : t4;
|
|
2315
|
+
const position = t5 === void 0 ? "absolute" : t5;
|
|
2274
2316
|
const {
|
|
2275
2317
|
messages
|
|
2276
2318
|
} = useStreetImageryI18n();
|
|
2277
2319
|
const severalViewpoints = new Set(suggestions.map(_temp3)).size > 1;
|
|
2278
|
-
let
|
|
2279
|
-
if ($[
|
|
2280
|
-
|
|
2281
|
-
$[
|
|
2282
|
-
$[
|
|
2320
|
+
let t7;
|
|
2321
|
+
if ($[2] !== storageKey) {
|
|
2322
|
+
t7 = () => readLayout(storageKey);
|
|
2323
|
+
$[2] = storageKey;
|
|
2324
|
+
$[3] = t7;
|
|
2283
2325
|
} else {
|
|
2284
|
-
|
|
2326
|
+
t7 = $[3];
|
|
2285
2327
|
}
|
|
2286
|
-
const [layout, setLayout] = useState(
|
|
2328
|
+
const [layout, setLayout] = useState(t7);
|
|
2287
2329
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
2288
|
-
let
|
|
2289
|
-
if ($[
|
|
2290
|
-
|
|
2291
|
-
$[
|
|
2292
|
-
$[
|
|
2330
|
+
let t8;
|
|
2331
|
+
if ($[4] !== storageKey) {
|
|
2332
|
+
t8 = () => hasStoredLayout(storageKey);
|
|
2333
|
+
$[4] = storageKey;
|
|
2334
|
+
$[5] = t8;
|
|
2293
2335
|
} else {
|
|
2294
|
-
|
|
2336
|
+
t8 = $[5];
|
|
2295
2337
|
}
|
|
2296
|
-
const [moved, setMoved] = useState(
|
|
2338
|
+
const [moved, setMoved] = useState(t8);
|
|
2297
2339
|
const atTopLeft = defaultPosition?.corner === "top-left" && !moved;
|
|
2298
|
-
let
|
|
2299
|
-
if ($[
|
|
2300
|
-
|
|
2340
|
+
let t9;
|
|
2341
|
+
if ($[6] !== atTopLeft || $[7] !== defaultPosition || $[8] !== layout.bottom || $[9] !== layout.right) {
|
|
2342
|
+
t9 = atTopLeft ? {
|
|
2301
2343
|
left: defaultPosition.left ?? EDGE,
|
|
2302
2344
|
top: defaultPosition.top ?? EDGE
|
|
2303
2345
|
} : {
|
|
2304
2346
|
right: layout.right,
|
|
2305
2347
|
bottom: layout.bottom
|
|
2306
2348
|
};
|
|
2307
|
-
$[
|
|
2308
|
-
$[
|
|
2309
|
-
$[
|
|
2310
|
-
$[
|
|
2311
|
-
$[
|
|
2349
|
+
$[6] = atTopLeft;
|
|
2350
|
+
$[7] = defaultPosition;
|
|
2351
|
+
$[8] = layout.bottom;
|
|
2352
|
+
$[9] = layout.right;
|
|
2353
|
+
$[10] = t9;
|
|
2312
2354
|
} else {
|
|
2313
|
-
|
|
2355
|
+
t9 = $[10];
|
|
2314
2356
|
}
|
|
2315
|
-
const
|
|
2357
|
+
const placement = t9;
|
|
2358
|
+
let t10;
|
|
2359
|
+
if ($[11] !== atTopLeft || $[12] !== layout.bottom || $[13] !== layout.right || $[14] !== minVisibleShare || $[15] !== placement) {
|
|
2360
|
+
t10 = minVisibleShare === void 0 || atTopLeft ? placement : {
|
|
2361
|
+
right: `clamp(${EDGE}px, ${layout.right}px, calc(100% - ${MINIMIZED_WIDTH}))`,
|
|
2362
|
+
bottom: Math.max(EDGE, layout.bottom)
|
|
2363
|
+
};
|
|
2364
|
+
$[11] = atTopLeft;
|
|
2365
|
+
$[12] = layout.bottom;
|
|
2366
|
+
$[13] = layout.right;
|
|
2367
|
+
$[14] = minVisibleShare;
|
|
2368
|
+
$[15] = placement;
|
|
2369
|
+
$[16] = t10;
|
|
2370
|
+
} else {
|
|
2371
|
+
t10 = $[16];
|
|
2372
|
+
}
|
|
2373
|
+
const minimizedPlacement = t10;
|
|
2374
|
+
const boxRef = useRef(null);
|
|
2316
2375
|
const dragRef = useRef(null);
|
|
2317
|
-
let
|
|
2318
|
-
if ($[
|
|
2319
|
-
|
|
2376
|
+
let t11;
|
|
2377
|
+
if ($[17] !== storageKey) {
|
|
2378
|
+
t11 = (next) => {
|
|
2320
2379
|
setLayout(next);
|
|
2321
2380
|
writeLayout(storageKey, next);
|
|
2322
2381
|
};
|
|
2323
|
-
$[
|
|
2324
|
-
$[
|
|
2382
|
+
$[17] = storageKey;
|
|
2383
|
+
$[18] = t11;
|
|
2325
2384
|
} else {
|
|
2326
|
-
|
|
2385
|
+
t11 = $[18];
|
|
2327
2386
|
}
|
|
2328
|
-
const updateLayout =
|
|
2329
|
-
let
|
|
2330
|
-
if ($[
|
|
2331
|
-
|
|
2387
|
+
const updateLayout = t11;
|
|
2388
|
+
let t12;
|
|
2389
|
+
if ($[19] !== canGoBack || $[20] !== canGoForward || $[21] !== onBack || $[22] !== onClose || $[23] !== onForward || $[24] !== step) {
|
|
2390
|
+
t12 = (event) => {
|
|
2332
2391
|
const target = event.target;
|
|
2333
2392
|
if (target instanceof Element && target.closest('input, textarea, select, [contenteditable="true"]')) {
|
|
2334
2393
|
return;
|
|
@@ -2353,382 +2412,492 @@ var FloatingPhotoViewer = (t0) => {
|
|
|
2353
2412
|
}
|
|
2354
2413
|
}
|
|
2355
2414
|
};
|
|
2356
|
-
$[
|
|
2357
|
-
$[
|
|
2358
|
-
$[
|
|
2359
|
-
$[
|
|
2360
|
-
$[
|
|
2361
|
-
$[
|
|
2362
|
-
$[
|
|
2415
|
+
$[19] = canGoBack;
|
|
2416
|
+
$[20] = canGoForward;
|
|
2417
|
+
$[21] = onBack;
|
|
2418
|
+
$[22] = onClose;
|
|
2419
|
+
$[23] = onForward;
|
|
2420
|
+
$[24] = step;
|
|
2421
|
+
$[25] = t12;
|
|
2363
2422
|
} else {
|
|
2364
|
-
|
|
2423
|
+
t12 = $[25];
|
|
2365
2424
|
}
|
|
2366
|
-
const onShortcut = useEffectEvent(
|
|
2367
|
-
let
|
|
2368
|
-
if ($[
|
|
2369
|
-
|
|
2425
|
+
const onShortcut = useEffectEvent(t12);
|
|
2426
|
+
let t13;
|
|
2427
|
+
if ($[26] !== onShortcut) {
|
|
2428
|
+
t13 = function subscribeKeyboardShortcuts() {
|
|
2370
2429
|
window.addEventListener("keydown", onShortcut);
|
|
2371
2430
|
return () => window.removeEventListener("keydown", onShortcut);
|
|
2372
2431
|
};
|
|
2373
|
-
$[
|
|
2374
|
-
$[
|
|
2432
|
+
$[26] = onShortcut;
|
|
2433
|
+
$[27] = t13;
|
|
2375
2434
|
} else {
|
|
2376
|
-
|
|
2435
|
+
t13 = $[27];
|
|
2377
2436
|
}
|
|
2378
|
-
let
|
|
2379
|
-
if ($[
|
|
2380
|
-
|
|
2381
|
-
$[
|
|
2437
|
+
let t14;
|
|
2438
|
+
if ($[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2439
|
+
t14 = [];
|
|
2440
|
+
$[28] = t14;
|
|
2382
2441
|
} else {
|
|
2383
|
-
|
|
2442
|
+
t14 = $[28];
|
|
2384
2443
|
}
|
|
2385
|
-
useEffect(
|
|
2386
|
-
let
|
|
2387
|
-
if ($[
|
|
2388
|
-
|
|
2389
|
-
|
|
2444
|
+
useEffect(t13, t14);
|
|
2445
|
+
let t15;
|
|
2446
|
+
if ($[29] !== atTopLeft || $[30] !== layout || $[31] !== minVisibleShare || $[32] !== position) {
|
|
2447
|
+
t15 = () => {
|
|
2448
|
+
const box = boxRef.current;
|
|
2449
|
+
if (!box || atTopLeft) {
|
|
2450
|
+
return;
|
|
2451
|
+
}
|
|
2452
|
+
const {
|
|
2453
|
+
right,
|
|
2454
|
+
bottom
|
|
2455
|
+
} = clampFloatingViewerPosition(layout, {
|
|
2456
|
+
width: box.offsetWidth,
|
|
2457
|
+
height: box.offsetHeight
|
|
2458
|
+
}, containerSize(box, position), minVisibleShare);
|
|
2459
|
+
if (right !== layout.right || bottom !== layout.bottom) {
|
|
2460
|
+
setLayout({
|
|
2461
|
+
...layout,
|
|
2462
|
+
right,
|
|
2463
|
+
bottom
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
};
|
|
2467
|
+
$[29] = atTopLeft;
|
|
2468
|
+
$[30] = layout;
|
|
2469
|
+
$[31] = minVisibleShare;
|
|
2470
|
+
$[32] = position;
|
|
2471
|
+
$[33] = t15;
|
|
2472
|
+
} else {
|
|
2473
|
+
t15 = $[33];
|
|
2474
|
+
}
|
|
2475
|
+
const keepOnScreen = useEffectEvent(t15);
|
|
2476
|
+
const isFree = minVisibleShare !== void 0;
|
|
2477
|
+
let t16;
|
|
2478
|
+
if ($[34] !== isFree || $[35] !== keepOnScreen) {
|
|
2479
|
+
t16 = function followBoxAndContainerSize() {
|
|
2480
|
+
const box_0 = boxRef.current;
|
|
2481
|
+
if (!isFree || !box_0) {
|
|
2482
|
+
return;
|
|
2483
|
+
}
|
|
2484
|
+
const observer = new ResizeObserver(() => keepOnScreen());
|
|
2485
|
+
observer.observe(box_0);
|
|
2486
|
+
if (box_0.offsetParent) {
|
|
2487
|
+
observer.observe(box_0.offsetParent);
|
|
2488
|
+
}
|
|
2489
|
+
window.addEventListener("resize", keepOnScreen);
|
|
2490
|
+
return () => {
|
|
2491
|
+
observer.disconnect();
|
|
2492
|
+
window.removeEventListener("resize", keepOnScreen);
|
|
2493
|
+
};
|
|
2494
|
+
};
|
|
2495
|
+
$[34] = isFree;
|
|
2496
|
+
$[35] = keepOnScreen;
|
|
2497
|
+
$[36] = t16;
|
|
2498
|
+
} else {
|
|
2499
|
+
t16 = $[36];
|
|
2500
|
+
}
|
|
2501
|
+
let t17;
|
|
2502
|
+
if ($[37] !== isFree || $[38] !== layout.minimized) {
|
|
2503
|
+
t17 = [isFree, layout.minimized];
|
|
2504
|
+
$[37] = isFree;
|
|
2505
|
+
$[38] = layout.minimized;
|
|
2506
|
+
$[39] = t17;
|
|
2507
|
+
} else {
|
|
2508
|
+
t17 = $[39];
|
|
2509
|
+
}
|
|
2510
|
+
useEffect(t16, t17);
|
|
2511
|
+
let t18;
|
|
2512
|
+
if ($[40] !== atTopLeft || $[41] !== layout || $[42] !== position) {
|
|
2513
|
+
t18 = (event_0, mode) => {
|
|
2514
|
+
const target_0 = event_0.target;
|
|
2515
|
+
if (event_0.button !== 0 || target_0.closest("a")) {
|
|
2390
2516
|
return;
|
|
2391
2517
|
}
|
|
2392
|
-
|
|
2393
|
-
const
|
|
2394
|
-
|
|
2395
|
-
const
|
|
2518
|
+
const button = target_0.closest("button");
|
|
2519
|
+
const onButton = button !== null;
|
|
2520
|
+
(button ?? event_0.currentTarget).setPointerCapture(event_0.pointerId);
|
|
2521
|
+
const box_1 = boxRef.current;
|
|
2522
|
+
const container = box_1 ? containerSize(box_1, position) : null;
|
|
2523
|
+
const start = atTopLeft && box_1 && container ? {
|
|
2396
2524
|
...layout,
|
|
2397
|
-
right: container.
|
|
2398
|
-
bottom: container.
|
|
2525
|
+
right: container.width - box_1.offsetLeft - box_1.offsetWidth,
|
|
2526
|
+
bottom: container.height - box_1.offsetTop - box_1.offsetHeight
|
|
2399
2527
|
} : layout;
|
|
2400
|
-
setLayout(start);
|
|
2401
|
-
setMoved(true);
|
|
2402
2528
|
dragRef.current = {
|
|
2403
2529
|
x: event_0.clientX,
|
|
2404
2530
|
y: event_0.clientY,
|
|
2405
2531
|
layout: start,
|
|
2406
|
-
mode
|
|
2532
|
+
mode,
|
|
2533
|
+
onButton
|
|
2407
2534
|
};
|
|
2535
|
+
if (!onButton) {
|
|
2536
|
+
setLayout(start);
|
|
2537
|
+
setMoved(true);
|
|
2538
|
+
}
|
|
2408
2539
|
};
|
|
2409
|
-
$[
|
|
2410
|
-
$[
|
|
2411
|
-
$[
|
|
2540
|
+
$[40] = atTopLeft;
|
|
2541
|
+
$[41] = layout;
|
|
2542
|
+
$[42] = position;
|
|
2543
|
+
$[43] = t18;
|
|
2412
2544
|
} else {
|
|
2413
|
-
|
|
2545
|
+
t18 = $[43];
|
|
2414
2546
|
}
|
|
2415
|
-
const startDrag =
|
|
2416
|
-
let
|
|
2417
|
-
if ($[
|
|
2418
|
-
|
|
2547
|
+
const startDrag = t18;
|
|
2548
|
+
let t19;
|
|
2549
|
+
if ($[44] !== minVisibleShare || $[45] !== position) {
|
|
2550
|
+
t19 = (event_1) => {
|
|
2419
2551
|
const drag = dragRef.current;
|
|
2420
2552
|
if (!drag) {
|
|
2421
2553
|
return;
|
|
2422
2554
|
}
|
|
2423
2555
|
const dx = event_1.clientX - drag.x;
|
|
2424
2556
|
const dy = event_1.clientY - drag.y;
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
}
|
|
2557
|
+
if (drag.onButton) {
|
|
2558
|
+
if (Math.hypot(dx, dy) < BUTTON_DRAG_SLOP) {
|
|
2559
|
+
return;
|
|
2560
|
+
}
|
|
2561
|
+
event_1.currentTarget.setPointerCapture(event_1.pointerId);
|
|
2562
|
+
drag.onButton = false;
|
|
2563
|
+
setMoved(true);
|
|
2564
|
+
}
|
|
2565
|
+
const box_2 = boxRef.current;
|
|
2566
|
+
if (drag.mode === "resize") {
|
|
2567
|
+
setLayout({
|
|
2568
|
+
...drag.layout,
|
|
2569
|
+
width: Math.max(MIN_WIDTH, drag.layout.width - dx)
|
|
2570
|
+
});
|
|
2571
|
+
} else {
|
|
2572
|
+
if (box_2) {
|
|
2573
|
+
const next_0 = clampFloatingViewerPosition({
|
|
2574
|
+
right: drag.layout.right - dx,
|
|
2575
|
+
bottom: drag.layout.bottom - dy
|
|
2576
|
+
}, {
|
|
2577
|
+
width: box_2.offsetWidth,
|
|
2578
|
+
height: box_2.offsetHeight
|
|
2579
|
+
}, containerSize(box_2, position), minVisibleShare);
|
|
2580
|
+
setLayout({
|
|
2581
|
+
...drag.layout,
|
|
2582
|
+
...next_0
|
|
2583
|
+
});
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2433
2586
|
};
|
|
2434
|
-
$[
|
|
2587
|
+
$[44] = minVisibleShare;
|
|
2588
|
+
$[45] = position;
|
|
2589
|
+
$[46] = t19;
|
|
2435
2590
|
} else {
|
|
2436
|
-
|
|
2591
|
+
t19 = $[46];
|
|
2437
2592
|
}
|
|
2438
|
-
const onDrag =
|
|
2439
|
-
let
|
|
2440
|
-
if ($[
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2593
|
+
const onDrag = t19;
|
|
2594
|
+
let t20;
|
|
2595
|
+
if ($[47] !== layout || $[48] !== storageKey) {
|
|
2596
|
+
t20 = () => {
|
|
2597
|
+
const wasDragged = dragRef.current?.onButton === false;
|
|
2598
|
+
dragRef.current = null;
|
|
2599
|
+
if (wasDragged) {
|
|
2444
2600
|
writeLayout(storageKey, layout);
|
|
2445
2601
|
}
|
|
2446
2602
|
};
|
|
2447
|
-
$[
|
|
2448
|
-
$[
|
|
2449
|
-
$[
|
|
2603
|
+
$[47] = layout;
|
|
2604
|
+
$[48] = storageKey;
|
|
2605
|
+
$[49] = t20;
|
|
2450
2606
|
} else {
|
|
2451
|
-
|
|
2607
|
+
t20 = $[49];
|
|
2452
2608
|
}
|
|
2453
|
-
const endDrag =
|
|
2454
|
-
let
|
|
2455
|
-
if ($[
|
|
2456
|
-
|
|
2609
|
+
const endDrag = t20;
|
|
2610
|
+
let t21;
|
|
2611
|
+
if ($[50] !== endDrag || $[51] !== onDrag) {
|
|
2612
|
+
t21 = {
|
|
2457
2613
|
onPointerMove: onDrag,
|
|
2458
2614
|
onPointerUp: endDrag,
|
|
2459
2615
|
onPointerCancel: endDrag
|
|
2460
2616
|
};
|
|
2461
|
-
$[
|
|
2462
|
-
$[
|
|
2617
|
+
$[50] = endDrag;
|
|
2618
|
+
$[51] = onDrag;
|
|
2619
|
+
$[52] = t21;
|
|
2463
2620
|
} else {
|
|
2464
|
-
|
|
2621
|
+
t21 = $[52];
|
|
2465
2622
|
}
|
|
2466
|
-
const dragHandlers =
|
|
2623
|
+
const dragHandlers = t21;
|
|
2467
2624
|
if (layout.minimized) {
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2625
|
+
const t222 = `${position} z-10 inline-flex items-center gap-2 rounded-full bg-white px-3 py-1.5 text-sm font-medium text-slate-800 shadow-lg ring-1 ring-slate-200 hover:bg-slate-50`;
|
|
2626
|
+
let t232;
|
|
2627
|
+
if ($[53] !== layout || $[54] !== updateLayout) {
|
|
2628
|
+
t232 = () => updateLayout({
|
|
2471
2629
|
...layout,
|
|
2472
2630
|
minimized: false
|
|
2473
2631
|
});
|
|
2474
|
-
$[
|
|
2475
|
-
$[
|
|
2476
|
-
$[
|
|
2632
|
+
$[53] = layout;
|
|
2633
|
+
$[54] = updateLayout;
|
|
2634
|
+
$[55] = t232;
|
|
2477
2635
|
} else {
|
|
2478
|
-
|
|
2636
|
+
t232 = $[55];
|
|
2479
2637
|
}
|
|
2480
|
-
let
|
|
2481
|
-
if ($[
|
|
2482
|
-
|
|
2483
|
-
$[
|
|
2638
|
+
let t242;
|
|
2639
|
+
if ($[56] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2640
|
+
t242 = /* @__PURE__ */ jsx(Icon, { path: ICONS.expand });
|
|
2641
|
+
$[56] = t242;
|
|
2484
2642
|
} else {
|
|
2485
|
-
|
|
2643
|
+
t242 = $[56];
|
|
2486
2644
|
}
|
|
2487
|
-
let
|
|
2488
|
-
if ($[
|
|
2489
|
-
|
|
2490
|
-
|
|
2645
|
+
let t252;
|
|
2646
|
+
if ($[57] !== minimizedPlacement || $[58] !== t222 || $[59] !== t232 || $[60] !== title) {
|
|
2647
|
+
t252 = /* @__PURE__ */ jsxs("button", { className: t222, onClick: t232, style: minimizedPlacement, type: "button", children: [
|
|
2648
|
+
t242,
|
|
2491
2649
|
title
|
|
2492
2650
|
] });
|
|
2493
|
-
$[
|
|
2494
|
-
$[
|
|
2495
|
-
$[
|
|
2496
|
-
$[
|
|
2651
|
+
$[57] = minimizedPlacement;
|
|
2652
|
+
$[58] = t222;
|
|
2653
|
+
$[59] = t232;
|
|
2654
|
+
$[60] = title;
|
|
2655
|
+
$[61] = t252;
|
|
2497
2656
|
} else {
|
|
2498
|
-
|
|
2657
|
+
t252 = $[61];
|
|
2499
2658
|
}
|
|
2500
|
-
return
|
|
2659
|
+
return t252;
|
|
2501
2660
|
}
|
|
2502
|
-
const
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2661
|
+
const t22 = `${position} z-10 flex max-h-[calc(100%-1rem)] flex-col overflow-hidden rounded-xl bg-white shadow-xl ring-1 ring-slate-200`;
|
|
2662
|
+
const t23 = `min(${layout.width}px, calc(100% - 1rem))`;
|
|
2663
|
+
let t24;
|
|
2664
|
+
if ($[62] !== placement || $[63] !== t23) {
|
|
2665
|
+
t24 = {
|
|
2666
|
+
...placement,
|
|
2667
|
+
width: t23
|
|
2508
2668
|
};
|
|
2509
|
-
$[
|
|
2510
|
-
$[
|
|
2511
|
-
$[
|
|
2669
|
+
$[62] = placement;
|
|
2670
|
+
$[63] = t23;
|
|
2671
|
+
$[64] = t24;
|
|
2512
2672
|
} else {
|
|
2513
|
-
|
|
2673
|
+
t24 = $[64];
|
|
2514
2674
|
}
|
|
2515
|
-
let
|
|
2516
|
-
if ($[
|
|
2517
|
-
|
|
2518
|
-
$[
|
|
2519
|
-
$[
|
|
2675
|
+
let t25;
|
|
2676
|
+
if ($[65] !== startDrag) {
|
|
2677
|
+
t25 = (event_2) => startDrag(event_2, "resize");
|
|
2678
|
+
$[65] = startDrag;
|
|
2679
|
+
$[66] = t25;
|
|
2520
2680
|
} else {
|
|
2521
|
-
|
|
2681
|
+
t25 = $[66];
|
|
2522
2682
|
}
|
|
2523
|
-
let
|
|
2524
|
-
if ($[
|
|
2525
|
-
|
|
2526
|
-
$[
|
|
2527
|
-
$[
|
|
2528
|
-
$[
|
|
2683
|
+
let t26;
|
|
2684
|
+
if ($[67] !== dragHandlers || $[68] !== t25) {
|
|
2685
|
+
t26 = /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 left-0 z-10 w-1.5 cursor-ew-resize hover:bg-fuchsia-500/20", onPointerDown: t25, ...dragHandlers });
|
|
2686
|
+
$[67] = dragHandlers;
|
|
2687
|
+
$[68] = t25;
|
|
2688
|
+
$[69] = t26;
|
|
2529
2689
|
} else {
|
|
2530
|
-
|
|
2690
|
+
t26 = $[69];
|
|
2531
2691
|
}
|
|
2532
|
-
let
|
|
2533
|
-
if ($[
|
|
2534
|
-
|
|
2535
|
-
$[
|
|
2536
|
-
$[
|
|
2692
|
+
let t27;
|
|
2693
|
+
if ($[70] !== startDrag) {
|
|
2694
|
+
t27 = (event_3) => startDrag(event_3, "move");
|
|
2695
|
+
$[70] = startDrag;
|
|
2696
|
+
$[71] = t27;
|
|
2537
2697
|
} else {
|
|
2538
|
-
|
|
2698
|
+
t27 = $[71];
|
|
2539
2699
|
}
|
|
2540
|
-
let
|
|
2541
|
-
if ($[
|
|
2542
|
-
|
|
2700
|
+
let t28;
|
|
2701
|
+
if ($[72] !== step) {
|
|
2702
|
+
t28 = step ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2543
2703
|
/* @__PURE__ */ jsx(ToolbarButton, { disabled: !step.onPrevious, label: step.previousLabel, onClick: () => step.onPrevious?.(), children: /* @__PURE__ */ jsx(Icon, { path: ICONS.back }) }),
|
|
2544
2704
|
/* @__PURE__ */ jsx(ToolbarButton, { disabled: !step.onNext, label: step.nextLabel, onClick: () => step.onNext?.(), children: /* @__PURE__ */ jsx(Icon, { path: ICONS.forward }) })
|
|
2545
2705
|
] }) : null;
|
|
2546
|
-
$[
|
|
2547
|
-
$[
|
|
2706
|
+
$[72] = step;
|
|
2707
|
+
$[73] = t28;
|
|
2548
2708
|
} else {
|
|
2549
|
-
|
|
2709
|
+
t28 = $[73];
|
|
2550
2710
|
}
|
|
2551
|
-
let
|
|
2552
|
-
if ($[
|
|
2553
|
-
|
|
2554
|
-
$[
|
|
2555
|
-
$[
|
|
2711
|
+
let t29;
|
|
2712
|
+
if ($[74] !== title) {
|
|
2713
|
+
t29 = /* @__PURE__ */ jsx("h2", { className: "min-w-0 truncate px-1 text-sm font-semibold text-slate-800", children: title });
|
|
2714
|
+
$[74] = title;
|
|
2715
|
+
$[75] = t29;
|
|
2556
2716
|
} else {
|
|
2557
|
-
|
|
2717
|
+
t29 = $[75];
|
|
2558
2718
|
}
|
|
2559
|
-
let
|
|
2560
|
-
if ($[
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2719
|
+
let t30;
|
|
2720
|
+
if ($[76] !== titleActions) {
|
|
2721
|
+
t30 = titleActions ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-0.5", children: titleActions }) : null;
|
|
2722
|
+
$[76] = titleActions;
|
|
2723
|
+
$[77] = t30;
|
|
2724
|
+
} else {
|
|
2725
|
+
t30 = $[77];
|
|
2726
|
+
}
|
|
2727
|
+
let t31;
|
|
2728
|
+
if ($[78] !== t29 || $[79] !== t30) {
|
|
2729
|
+
t31 = /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-0.5", children: [
|
|
2730
|
+
t29,
|
|
2731
|
+
t30
|
|
2564
2732
|
] });
|
|
2565
|
-
$[
|
|
2566
|
-
$[
|
|
2567
|
-
$[
|
|
2733
|
+
$[78] = t29;
|
|
2734
|
+
$[79] = t30;
|
|
2735
|
+
$[80] = t31;
|
|
2568
2736
|
} else {
|
|
2569
|
-
|
|
2737
|
+
t31 = $[80];
|
|
2570
2738
|
}
|
|
2571
|
-
let
|
|
2572
|
-
if ($[
|
|
2573
|
-
|
|
2739
|
+
let t32;
|
|
2740
|
+
if ($[81] !== canGoBack || $[82] !== canGoForward || $[83] !== messages.viewer.backInHistory || $[84] !== messages.viewer.forwardInHistory || $[85] !== onBack || $[86] !== onForward) {
|
|
2741
|
+
t32 = onBack && onForward ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2574
2742
|
/* @__PURE__ */ jsx(ToolbarButton, { disabled: !canGoBack, label: messages.viewer.backInHistory, onClick: onBack, children: /* @__PURE__ */ jsx(Icon, { path: ICONS.undo }) }),
|
|
2575
2743
|
/* @__PURE__ */ jsx(ToolbarButton, { disabled: !canGoForward, label: messages.viewer.forwardInHistory, onClick: onForward, children: /* @__PURE__ */ jsx(Icon, { path: ICONS.redo }) })
|
|
2576
2744
|
] }) : null;
|
|
2577
|
-
$[
|
|
2578
|
-
$[
|
|
2579
|
-
$[
|
|
2580
|
-
$[
|
|
2581
|
-
$[
|
|
2582
|
-
$[
|
|
2583
|
-
$[
|
|
2745
|
+
$[81] = canGoBack;
|
|
2746
|
+
$[82] = canGoForward;
|
|
2747
|
+
$[83] = messages.viewer.backInHistory;
|
|
2748
|
+
$[84] = messages.viewer.forwardInHistory;
|
|
2749
|
+
$[85] = onBack;
|
|
2750
|
+
$[86] = onForward;
|
|
2751
|
+
$[87] = t32;
|
|
2584
2752
|
} else {
|
|
2585
|
-
|
|
2753
|
+
t32 = $[87];
|
|
2586
2754
|
}
|
|
2587
|
-
let
|
|
2588
|
-
if ($[
|
|
2589
|
-
|
|
2755
|
+
let t33;
|
|
2756
|
+
if ($[88] !== layout || $[89] !== updateLayout) {
|
|
2757
|
+
t33 = () => updateLayout({
|
|
2590
2758
|
...layout,
|
|
2591
2759
|
minimized: true
|
|
2592
2760
|
});
|
|
2593
|
-
$[
|
|
2594
|
-
$[
|
|
2595
|
-
$[
|
|
2596
|
-
} else {
|
|
2597
|
-
t24 = $[64];
|
|
2598
|
-
}
|
|
2599
|
-
let t25;
|
|
2600
|
-
if ($[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2601
|
-
t25 = /* @__PURE__ */ jsx(Icon, { path: ICONS.minimize });
|
|
2602
|
-
$[65] = t25;
|
|
2761
|
+
$[88] = layout;
|
|
2762
|
+
$[89] = updateLayout;
|
|
2763
|
+
$[90] = t33;
|
|
2603
2764
|
} else {
|
|
2604
|
-
|
|
2765
|
+
t33 = $[90];
|
|
2605
2766
|
}
|
|
2606
|
-
let
|
|
2607
|
-
if ($[
|
|
2608
|
-
|
|
2609
|
-
$[
|
|
2610
|
-
$[67] = t24;
|
|
2611
|
-
$[68] = t26;
|
|
2612
|
-
} else {
|
|
2613
|
-
t26 = $[68];
|
|
2614
|
-
}
|
|
2615
|
-
let t27;
|
|
2616
|
-
if ($[69] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2617
|
-
t27 = /* @__PURE__ */ jsx(Icon, { path: ICONS.close });
|
|
2618
|
-
$[69] = t27;
|
|
2619
|
-
} else {
|
|
2620
|
-
t27 = $[69];
|
|
2621
|
-
}
|
|
2622
|
-
let t28;
|
|
2623
|
-
if ($[70] !== messages.viewer.close || $[71] !== onClose) {
|
|
2624
|
-
t28 = /* @__PURE__ */ jsx(ToolbarButton, { label: messages.viewer.close, onClick: onClose, children: t27 });
|
|
2625
|
-
$[70] = messages.viewer.close;
|
|
2626
|
-
$[71] = onClose;
|
|
2627
|
-
$[72] = t28;
|
|
2767
|
+
let t34;
|
|
2768
|
+
if ($[91] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2769
|
+
t34 = /* @__PURE__ */ jsx(Icon, { path: ICONS.minimize });
|
|
2770
|
+
$[91] = t34;
|
|
2628
2771
|
} else {
|
|
2629
|
-
|
|
2772
|
+
t34 = $[91];
|
|
2630
2773
|
}
|
|
2631
|
-
let
|
|
2632
|
-
if ($[
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2774
|
+
let t35;
|
|
2775
|
+
if ($[92] !== messages.viewer.minimize || $[93] !== t33) {
|
|
2776
|
+
t35 = /* @__PURE__ */ jsx(ToolbarButton, { label: messages.viewer.minimize, onClick: t33, children: t34 });
|
|
2777
|
+
$[92] = messages.viewer.minimize;
|
|
2778
|
+
$[93] = t33;
|
|
2779
|
+
$[94] = t35;
|
|
2780
|
+
} else {
|
|
2781
|
+
t35 = $[94];
|
|
2782
|
+
}
|
|
2783
|
+
let t36;
|
|
2784
|
+
if ($[95] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2785
|
+
t36 = /* @__PURE__ */ jsx(Icon, { path: ICONS.close });
|
|
2786
|
+
$[95] = t36;
|
|
2787
|
+
} else {
|
|
2788
|
+
t36 = $[95];
|
|
2789
|
+
}
|
|
2790
|
+
let t37;
|
|
2791
|
+
if ($[96] !== messages.viewer.close || $[97] !== onClose) {
|
|
2792
|
+
t37 = /* @__PURE__ */ jsx(ToolbarButton, { label: messages.viewer.close, onClick: onClose, children: t36 });
|
|
2793
|
+
$[96] = messages.viewer.close;
|
|
2794
|
+
$[97] = onClose;
|
|
2795
|
+
$[98] = t37;
|
|
2796
|
+
} else {
|
|
2797
|
+
t37 = $[98];
|
|
2798
|
+
}
|
|
2799
|
+
let t38;
|
|
2800
|
+
if ($[99] !== dragHandlers || $[100] !== t27 || $[101] !== t28 || $[102] !== t31 || $[103] !== t32 || $[104] !== t35 || $[105] !== t37) {
|
|
2801
|
+
t38 = /* @__PURE__ */ jsxs("header", { className: "flex cursor-move touch-none items-center gap-1 border-b border-slate-100 px-2 py-1.5 select-none", onPointerDown: t27, ...dragHandlers, children: [
|
|
2802
|
+
t28,
|
|
2803
|
+
t31,
|
|
2804
|
+
t32,
|
|
2805
|
+
t35,
|
|
2806
|
+
t37
|
|
2639
2807
|
] });
|
|
2640
|
-
$[
|
|
2641
|
-
$[
|
|
2642
|
-
$[
|
|
2643
|
-
$[
|
|
2644
|
-
$[
|
|
2645
|
-
$[
|
|
2646
|
-
$[
|
|
2647
|
-
$[
|
|
2648
|
-
} else {
|
|
2649
|
-
|
|
2650
|
-
}
|
|
2651
|
-
let
|
|
2652
|
-
if ($[
|
|
2653
|
-
|
|
2654
|
-
$[
|
|
2655
|
-
$[
|
|
2656
|
-
$[
|
|
2657
|
-
$[
|
|
2658
|
-
$[
|
|
2659
|
-
$[
|
|
2660
|
-
$[
|
|
2661
|
-
$[
|
|
2662
|
-
$[
|
|
2663
|
-
} else {
|
|
2664
|
-
|
|
2665
|
-
}
|
|
2666
|
-
let
|
|
2667
|
-
if ($[
|
|
2668
|
-
|
|
2669
|
-
$[
|
|
2670
|
-
$[
|
|
2671
|
-
} else {
|
|
2672
|
-
|
|
2673
|
-
}
|
|
2674
|
-
let
|
|
2675
|
-
if ($[
|
|
2676
|
-
|
|
2677
|
-
$[
|
|
2678
|
-
$[
|
|
2679
|
-
} else {
|
|
2680
|
-
|
|
2681
|
-
}
|
|
2682
|
-
let
|
|
2683
|
-
if ($[
|
|
2684
|
-
|
|
2808
|
+
$[99] = dragHandlers;
|
|
2809
|
+
$[100] = t27;
|
|
2810
|
+
$[101] = t28;
|
|
2811
|
+
$[102] = t31;
|
|
2812
|
+
$[103] = t32;
|
|
2813
|
+
$[104] = t35;
|
|
2814
|
+
$[105] = t37;
|
|
2815
|
+
$[106] = t38;
|
|
2816
|
+
} else {
|
|
2817
|
+
t38 = $[106];
|
|
2818
|
+
}
|
|
2819
|
+
let t39;
|
|
2820
|
+
if ($[107] !== activeDirectionKey || $[108] !== messages.viewer.suggestedViews || $[109] !== messages.viewer.suggestedViewsHint || $[110] !== onSelectSuggestion || $[111] !== severalViewpoints || $[112] !== shownPhotoId || $[113] !== suggestions || $[114] !== toolbar) {
|
|
2821
|
+
t39 = toolbar ? /* @__PURE__ */ jsx("div", { className: "border-b border-slate-100 px-2 py-1.5", children: toolbar }) : suggestions.length > 0 ? /* @__PURE__ */ jsx("nav", { "aria-label": messages.viewer.suggestedViews, className: "grid grid-cols-[repeat(auto-fit,minmax(5.25rem,1fr))] gap-1 border-b border-slate-100 px-2 py-1.5", title: messages.viewer.suggestedViewsHint, children: suggestions.map((suggestion_0) => /* @__PURE__ */ jsx(SuggestionChip, { active: suggestion_0.direction.key === activeDirectionKey, onSelect: (candidate) => onSelectSuggestion?.(suggestion_0, candidate), shownPhotoId, showPlace: severalViewpoints, suggestion: suggestion_0 }, suggestion_0.direction.key)) }) : null;
|
|
2822
|
+
$[107] = activeDirectionKey;
|
|
2823
|
+
$[108] = messages.viewer.suggestedViews;
|
|
2824
|
+
$[109] = messages.viewer.suggestedViewsHint;
|
|
2825
|
+
$[110] = onSelectSuggestion;
|
|
2826
|
+
$[111] = severalViewpoints;
|
|
2827
|
+
$[112] = shownPhotoId;
|
|
2828
|
+
$[113] = suggestions;
|
|
2829
|
+
$[114] = toolbar;
|
|
2830
|
+
$[115] = t39;
|
|
2831
|
+
} else {
|
|
2832
|
+
t39 = $[115];
|
|
2833
|
+
}
|
|
2834
|
+
let t40;
|
|
2835
|
+
if ($[116] !== status) {
|
|
2836
|
+
t40 = status ? /* @__PURE__ */ jsx("p", { className: "px-3 py-2 text-xs text-slate-500", role: "status", children: status }) : null;
|
|
2837
|
+
$[116] = status;
|
|
2838
|
+
$[117] = t40;
|
|
2839
|
+
} else {
|
|
2840
|
+
t40 = $[117];
|
|
2841
|
+
}
|
|
2842
|
+
let t41;
|
|
2843
|
+
if ($[118] !== footer) {
|
|
2844
|
+
t41 = footer ? /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-xs text-slate-600", children: footer }) : null;
|
|
2845
|
+
$[118] = footer;
|
|
2846
|
+
$[119] = t41;
|
|
2847
|
+
} else {
|
|
2848
|
+
t41 = $[119];
|
|
2849
|
+
}
|
|
2850
|
+
let t42;
|
|
2851
|
+
if ($[120] !== drawer || $[121] !== drawerOpen) {
|
|
2852
|
+
t42 = drawer ? /* @__PURE__ */ jsxs("div", { className: "border-t border-slate-100", children: [
|
|
2685
2853
|
/* @__PURE__ */ jsxs("button", { "aria-expanded": drawerOpen, className: "flex w-full items-center justify-between px-3 py-2 text-xs font-medium text-slate-700 hover:bg-slate-50", onClick: () => setDrawerOpen(_temp22), type: "button", children: [
|
|
2686
2854
|
drawer.label,
|
|
2687
2855
|
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: drawerOpen ? "inline-flex rotate-90" : "inline-flex", children: /* @__PURE__ */ jsx(Icon, { className: "size-3.5", path: ICONS.forward }) })
|
|
2688
2856
|
] }),
|
|
2689
2857
|
drawerOpen ? /* @__PURE__ */ jsx("div", { className: "px-2 pb-2", children: drawer.content }) : null
|
|
2690
2858
|
] }) : null;
|
|
2691
|
-
$[
|
|
2692
|
-
$[
|
|
2693
|
-
$[
|
|
2859
|
+
$[120] = drawer;
|
|
2860
|
+
$[121] = drawerOpen;
|
|
2861
|
+
$[122] = t42;
|
|
2694
2862
|
} else {
|
|
2695
|
-
|
|
2863
|
+
t42 = $[122];
|
|
2696
2864
|
}
|
|
2697
|
-
let
|
|
2698
|
-
if ($[
|
|
2699
|
-
|
|
2700
|
-
|
|
2865
|
+
let t43;
|
|
2866
|
+
if ($[123] !== children || $[124] !== t40 || $[125] !== t41 || $[126] !== t42) {
|
|
2867
|
+
t43 = /* @__PURE__ */ jsxs("div", { className: "min-h-0 overflow-y-auto", children: [
|
|
2868
|
+
t40,
|
|
2701
2869
|
children,
|
|
2702
|
-
|
|
2703
|
-
|
|
2870
|
+
t41,
|
|
2871
|
+
t42
|
|
2704
2872
|
] });
|
|
2705
|
-
$[
|
|
2706
|
-
$[
|
|
2707
|
-
$[
|
|
2708
|
-
$[
|
|
2709
|
-
$[
|
|
2873
|
+
$[123] = children;
|
|
2874
|
+
$[124] = t40;
|
|
2875
|
+
$[125] = t41;
|
|
2876
|
+
$[126] = t42;
|
|
2877
|
+
$[127] = t43;
|
|
2710
2878
|
} else {
|
|
2711
|
-
|
|
2879
|
+
t43 = $[127];
|
|
2712
2880
|
}
|
|
2713
|
-
let
|
|
2714
|
-
if ($[
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2881
|
+
let t44;
|
|
2882
|
+
if ($[128] !== messages.viewer.regionLabel || $[129] !== t22 || $[130] !== t24 || $[131] !== t26 || $[132] !== t38 || $[133] !== t39 || $[134] !== t43) {
|
|
2883
|
+
t44 = /* @__PURE__ */ jsxs("section", { "aria-label": messages.viewer.regionLabel, className: t22, ref: boxRef, style: t24, children: [
|
|
2884
|
+
t26,
|
|
2885
|
+
t38,
|
|
2886
|
+
t39,
|
|
2887
|
+
t43
|
|
2720
2888
|
] });
|
|
2721
|
-
$[
|
|
2722
|
-
$[
|
|
2723
|
-
$[
|
|
2724
|
-
$[
|
|
2725
|
-
$[
|
|
2726
|
-
$[
|
|
2727
|
-
$[
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2889
|
+
$[128] = messages.viewer.regionLabel;
|
|
2890
|
+
$[129] = t22;
|
|
2891
|
+
$[130] = t24;
|
|
2892
|
+
$[131] = t26;
|
|
2893
|
+
$[132] = t38;
|
|
2894
|
+
$[133] = t39;
|
|
2895
|
+
$[134] = t43;
|
|
2896
|
+
$[135] = t44;
|
|
2897
|
+
} else {
|
|
2898
|
+
t44 = $[135];
|
|
2899
|
+
}
|
|
2900
|
+
return t44;
|
|
2732
2901
|
};
|
|
2733
2902
|
function _temp3(suggestion) {
|
|
2734
2903
|
return suggestion.viewpoint.id;
|
|
@@ -3255,6 +3424,141 @@ function _temp24(query) {
|
|
|
3255
3424
|
function _temp33(query_0) {
|
|
3256
3425
|
return query_0.isError;
|
|
3257
3426
|
}
|
|
3427
|
+
var DEFAULT_SOURCES2 = [mapillaryPhotoSource];
|
|
3428
|
+
var usePhotosLookingAt = (place, t0) => {
|
|
3429
|
+
const $ = c(30);
|
|
3430
|
+
let t1;
|
|
3431
|
+
if ($[0] !== t0) {
|
|
3432
|
+
t1 = t0 === void 0 ? {} : t0;
|
|
3433
|
+
$[0] = t0;
|
|
3434
|
+
$[1] = t1;
|
|
3435
|
+
} else {
|
|
3436
|
+
t1 = $[1];
|
|
3437
|
+
}
|
|
3438
|
+
const {
|
|
3439
|
+
maxAgeYears,
|
|
3440
|
+
photoTypes,
|
|
3441
|
+
maxDistanceMeters,
|
|
3442
|
+
maxFlatAngleDeg,
|
|
3443
|
+
limit,
|
|
3444
|
+
filterPhoto,
|
|
3445
|
+
sources: t2,
|
|
3446
|
+
enabled: t3
|
|
3447
|
+
} = t1;
|
|
3448
|
+
const sources = t2 === void 0 ? DEFAULT_SOURCES2 : t2;
|
|
3449
|
+
const enabled = t3 === void 0 ? true : t3;
|
|
3450
|
+
const [now] = useState(_temp8);
|
|
3451
|
+
const active = enabled && place != null;
|
|
3452
|
+
let t4;
|
|
3453
|
+
if ($[2] !== active || $[3] !== place || $[4] !== sources) {
|
|
3454
|
+
let t52;
|
|
3455
|
+
if ($[6] !== active || $[7] !== place) {
|
|
3456
|
+
t52 = (source) => ({
|
|
3457
|
+
queryKey: ["street-imagery", "photos-near", source.id, place?.[0], place?.[1]],
|
|
3458
|
+
queryFn: (t62) => {
|
|
3459
|
+
const {
|
|
3460
|
+
signal
|
|
3461
|
+
} = t62;
|
|
3462
|
+
return place ? source.fetchNear(place, signal) : Promise.resolve([]);
|
|
3463
|
+
},
|
|
3464
|
+
enabled: active,
|
|
3465
|
+
staleTime: 6e5
|
|
3466
|
+
});
|
|
3467
|
+
$[6] = active;
|
|
3468
|
+
$[7] = place;
|
|
3469
|
+
$[8] = t52;
|
|
3470
|
+
} else {
|
|
3471
|
+
t52 = $[8];
|
|
3472
|
+
}
|
|
3473
|
+
t4 = sources.map(t52);
|
|
3474
|
+
$[2] = active;
|
|
3475
|
+
$[3] = place;
|
|
3476
|
+
$[4] = sources;
|
|
3477
|
+
$[5] = t4;
|
|
3478
|
+
} else {
|
|
3479
|
+
t4 = $[5];
|
|
3480
|
+
}
|
|
3481
|
+
let t5;
|
|
3482
|
+
if ($[9] !== t4) {
|
|
3483
|
+
t5 = {
|
|
3484
|
+
queries: t4
|
|
3485
|
+
};
|
|
3486
|
+
$[9] = t4;
|
|
3487
|
+
$[10] = t5;
|
|
3488
|
+
} else {
|
|
3489
|
+
t5 = $[10];
|
|
3490
|
+
}
|
|
3491
|
+
const queries = useQueries(t5);
|
|
3492
|
+
let t6;
|
|
3493
|
+
if ($[11] !== filterPhoto || $[12] !== limit || $[13] !== maxAgeYears || $[14] !== maxDistanceMeters || $[15] !== maxFlatAngleDeg || $[16] !== now || $[17] !== photoTypes || $[18] !== place || $[19] !== queries) {
|
|
3494
|
+
const photos = queries.flatMap(_temp25);
|
|
3495
|
+
const kept = filterPhoto ? photos.filter(filterPhoto) : photos;
|
|
3496
|
+
t6 = place ? rankPhotosLookingAt(place, kept, {
|
|
3497
|
+
now,
|
|
3498
|
+
maxAgeMs: maxAgeYears == null ? void 0 : yearsToMs(maxAgeYears),
|
|
3499
|
+
maxDistanceMeters,
|
|
3500
|
+
maxFlatAngleDeg,
|
|
3501
|
+
photoTypes,
|
|
3502
|
+
limit
|
|
3503
|
+
}) : [];
|
|
3504
|
+
$[11] = filterPhoto;
|
|
3505
|
+
$[12] = limit;
|
|
3506
|
+
$[13] = maxAgeYears;
|
|
3507
|
+
$[14] = maxDistanceMeters;
|
|
3508
|
+
$[15] = maxFlatAngleDeg;
|
|
3509
|
+
$[16] = now;
|
|
3510
|
+
$[17] = photoTypes;
|
|
3511
|
+
$[18] = place;
|
|
3512
|
+
$[19] = queries;
|
|
3513
|
+
$[20] = t6;
|
|
3514
|
+
} else {
|
|
3515
|
+
t6 = $[20];
|
|
3516
|
+
}
|
|
3517
|
+
let t7;
|
|
3518
|
+
if ($[21] !== active || $[22] !== queries) {
|
|
3519
|
+
t7 = active && queries.some(_temp34);
|
|
3520
|
+
$[21] = active;
|
|
3521
|
+
$[22] = queries;
|
|
3522
|
+
$[23] = t7;
|
|
3523
|
+
} else {
|
|
3524
|
+
t7 = $[23];
|
|
3525
|
+
}
|
|
3526
|
+
let t8;
|
|
3527
|
+
if ($[24] !== queries) {
|
|
3528
|
+
t8 = queries.length > 0 && queries.every(_temp43);
|
|
3529
|
+
$[24] = queries;
|
|
3530
|
+
$[25] = t8;
|
|
3531
|
+
} else {
|
|
3532
|
+
t8 = $[25];
|
|
3533
|
+
}
|
|
3534
|
+
let t9;
|
|
3535
|
+
if ($[26] !== t6 || $[27] !== t7 || $[28] !== t8) {
|
|
3536
|
+
t9 = {
|
|
3537
|
+
candidates: t6,
|
|
3538
|
+
isLoading: t7,
|
|
3539
|
+
isError: t8
|
|
3540
|
+
};
|
|
3541
|
+
$[26] = t6;
|
|
3542
|
+
$[27] = t7;
|
|
3543
|
+
$[28] = t8;
|
|
3544
|
+
$[29] = t9;
|
|
3545
|
+
} else {
|
|
3546
|
+
t9 = $[29];
|
|
3547
|
+
}
|
|
3548
|
+
return t9;
|
|
3549
|
+
};
|
|
3550
|
+
function _temp8() {
|
|
3551
|
+
return Date.now();
|
|
3552
|
+
}
|
|
3553
|
+
function _temp25(query) {
|
|
3554
|
+
return query.data ?? [];
|
|
3555
|
+
}
|
|
3556
|
+
function _temp34(query_0) {
|
|
3557
|
+
return query_0.isPending;
|
|
3558
|
+
}
|
|
3559
|
+
function _temp43(query_1) {
|
|
3560
|
+
return query_1.isError;
|
|
3561
|
+
}
|
|
3258
3562
|
var STALE_TIME = 10 * 60 * 1e3;
|
|
3259
3563
|
var useMapillaryMapFeatureImages = (featureId, t0) => {
|
|
3260
3564
|
const $ = c(10);
|
|
@@ -3342,7 +3646,7 @@ var useMapillaryMapFeaturesNear = (lngLat, t0) => {
|
|
|
3342
3646
|
return features.map((feature) => ({
|
|
3343
3647
|
...feature,
|
|
3344
3648
|
distanceMeters: distanceMeters(center, feature.lngLat)
|
|
3345
|
-
})).filter((feature_0) => feature_0.distanceMeters <= radiusMeters).sort(
|
|
3649
|
+
})).filter((feature_0) => feature_0.distanceMeters <= radiusMeters).sort(_temp9);
|
|
3346
3650
|
};
|
|
3347
3651
|
$[2] = lngLat;
|
|
3348
3652
|
$[3] = objectValues;
|
|
@@ -3498,7 +3802,7 @@ var useSelectedMapillaryFeature = (t0) => {
|
|
|
3498
3802
|
}
|
|
3499
3803
|
return t5;
|
|
3500
3804
|
};
|
|
3501
|
-
function
|
|
3805
|
+
function _temp9(a, b) {
|
|
3502
3806
|
return a.distanceMeters - b.distanceMeters;
|
|
3503
3807
|
}
|
|
3504
3808
|
var useLocationPickStore = create()((set) => ({
|
|
@@ -3516,15 +3820,15 @@ var useLocationPickStore = create()((set) => ({
|
|
|
3516
3820
|
}
|
|
3517
3821
|
}));
|
|
3518
3822
|
var useArmedLocationOpenerId = () => {
|
|
3519
|
-
return useLocationPickStore(
|
|
3823
|
+
return useLocationPickStore(_temp10);
|
|
3520
3824
|
};
|
|
3521
3825
|
var useLocationPickActions = () => {
|
|
3522
|
-
return useLocationPickStore(
|
|
3826
|
+
return useLocationPickStore(_temp26);
|
|
3523
3827
|
};
|
|
3524
|
-
function
|
|
3828
|
+
function _temp10(state) {
|
|
3525
3829
|
return state.armedOpenerId;
|
|
3526
3830
|
}
|
|
3527
|
-
function
|
|
3831
|
+
function _temp26(state) {
|
|
3528
3832
|
return state.actions;
|
|
3529
3833
|
}
|
|
3530
3834
|
|
|
@@ -3777,7 +4081,7 @@ var MapillaryFeatureBar = (t0) => {
|
|
|
3777
4081
|
}
|
|
3778
4082
|
let t6;
|
|
3779
4083
|
if ($[9] !== feature.value || $[10] !== t5) {
|
|
3780
|
-
t6 = /* @__PURE__ */ jsx("img", { alt: "", className: "size-7 shrink-0", onError:
|
|
4084
|
+
t6 = /* @__PURE__ */ jsx("img", { alt: "", className: "size-7 shrink-0", onError: _temp11, src: t5 }, t4);
|
|
3781
4085
|
$[9] = feature.value;
|
|
3782
4086
|
$[10] = t5;
|
|
3783
4087
|
$[11] = t6;
|
|
@@ -3855,49 +4159,82 @@ ${labels.dayPhotos(day.images.length, active && day.images.length > 1)}`, type:
|
|
|
3855
4159
|
}
|
|
3856
4160
|
return t2;
|
|
3857
4161
|
};
|
|
3858
|
-
function
|
|
4162
|
+
function _temp11(event) {
|
|
3859
4163
|
event.currentTarget.style.display = "none";
|
|
3860
4164
|
}
|
|
4165
|
+
|
|
4166
|
+
// src/filters/dateSliderPointer.ts
|
|
4167
|
+
var DATE_SLIDER_STEP = 1e-3;
|
|
4168
|
+
var HANDLE_PX = 16;
|
|
4169
|
+
var GRAB_RADIUS_PX = 22;
|
|
4170
|
+
var stepped = (position) => Math.round(position / DATE_SLIDER_STEP) * DATE_SLIDER_STEP;
|
|
4171
|
+
var clamped = (position) => Math.min(1, Math.max(0, position));
|
|
4172
|
+
var closeTo = (a, b, widthPx, px) => Math.abs(a - b) * widthPx <= px;
|
|
4173
|
+
var positionOnTrack = (leftPx, widthPx) => stepped(clamped(leftPx / widthPx));
|
|
4174
|
+
var moveHandle = (positions, handle, position) => handle === "from" ? {
|
|
4175
|
+
...positions,
|
|
4176
|
+
from: Math.min(position, positions.to)
|
|
4177
|
+
} : {
|
|
4178
|
+
...positions,
|
|
4179
|
+
to: Math.max(position, positions.from)
|
|
4180
|
+
};
|
|
4181
|
+
var nearestHandle = (positions, press) => press < (positions.from + positions.to) / 2 ? "from" : "to";
|
|
4182
|
+
var pressedHandle = (positions, press, widthPx) => {
|
|
4183
|
+
const overlap = closeTo(positions.from, positions.to, widthPx, HANDLE_PX);
|
|
4184
|
+
const middle = (positions.from + positions.to) / 2;
|
|
4185
|
+
return overlap && closeTo(press, middle, widthPx, GRAB_RADIUS_PX) ? null : nearestHandle(positions, press);
|
|
4186
|
+
};
|
|
4187
|
+
var handleOfDrag = (deltaPx) => deltaPx < 0 ? "from" : "to";
|
|
4188
|
+
var dragPositions = (start, press, handle, deltaPx, widthPx) => {
|
|
4189
|
+
const grabbed = closeTo(press, start[handle], widthPx, GRAB_RADIUS_PX);
|
|
4190
|
+
const origin = grabbed ? start[handle] : press;
|
|
4191
|
+
return moveHandle(start, handle, stepped(clamped(origin + deltaPx / widthPx)));
|
|
4192
|
+
};
|
|
4193
|
+
var tapPositions = (start, press, widthPx) => {
|
|
4194
|
+
const handle = nearestHandle(start, press);
|
|
4195
|
+
const onHandle = closeTo(press, start[handle], widthPx, HANDLE_PX / 2);
|
|
4196
|
+
return {
|
|
4197
|
+
handle,
|
|
4198
|
+
positions: onHandle ? null : moveHandle(start, handle, press)
|
|
4199
|
+
};
|
|
4200
|
+
};
|
|
3861
4201
|
var DEFAULT_YEAR_LINES = [1, 2, 3, 4];
|
|
3862
4202
|
var BINS = 60;
|
|
3863
|
-
var STEP = 1e-3;
|
|
3864
4203
|
var CHART_HEIGHT_PX = 36;
|
|
3865
4204
|
var RED = "#dc2626";
|
|
3866
|
-
var
|
|
4205
|
+
var DRAG_SLOP_PX = 4;
|
|
4206
|
+
var HANDLE_CLASS = "pointer-events-none absolute inset-0 m-0 h-full w-full appearance-none bg-transparent focus:outline-none [&::-webkit-slider-runnable-track]:appearance-none [&::-webkit-slider-runnable-track]:bg-transparent [&::-moz-range-track]:bg-transparent [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:bg-slate-800 [&::-webkit-slider-thumb]:shadow [&::-moz-range-thumb]:box-border [&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-white [&::-moz-range-thumb]:bg-slate-800 [&::-moz-range-thumb]:shadow focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-sky-500 focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-sky-500";
|
|
3867
4207
|
var percent = (position) => `${position * 100}%`;
|
|
3868
|
-
var
|
|
3869
|
-
const $ = c(80);
|
|
4208
|
+
var trackBox = (area) => {
|
|
3870
4209
|
const {
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
const dateInputs = t3 === void 0 ? "collapsed" : t3;
|
|
3894
|
-
const allDatesAction = t4 === void 0 ? true : t4;
|
|
4210
|
+
left,
|
|
4211
|
+
width
|
|
4212
|
+
} = area.getBoundingClientRect();
|
|
4213
|
+
const inset = HANDLE_PX / 2;
|
|
4214
|
+
return {
|
|
4215
|
+
left: left + inset,
|
|
4216
|
+
width: Math.max(1, width - 2 * inset)
|
|
4217
|
+
};
|
|
4218
|
+
};
|
|
4219
|
+
var PhotoDateRangeFilter = ({
|
|
4220
|
+
value,
|
|
4221
|
+
onChange,
|
|
4222
|
+
capturedAt,
|
|
4223
|
+
yearLines = DEFAULT_YEAR_LINES,
|
|
4224
|
+
recommendedMaxAgeYears,
|
|
4225
|
+
markers = [],
|
|
4226
|
+
maxYears,
|
|
4227
|
+
now: nowProp,
|
|
4228
|
+
dateInputs = "collapsed",
|
|
4229
|
+
className,
|
|
4230
|
+
allDatesAction = true
|
|
4231
|
+
}) => {
|
|
3895
4232
|
const {
|
|
3896
4233
|
locale,
|
|
3897
4234
|
messages
|
|
3898
4235
|
} = useStreetImageryI18n();
|
|
3899
4236
|
const text = messages.dateFilter;
|
|
3900
|
-
const [startNow] = useState(
|
|
4237
|
+
const [startNow] = useState(() => Date.now());
|
|
3901
4238
|
const now = nowProp ?? startNow;
|
|
3902
4239
|
const scale = {
|
|
3903
4240
|
now,
|
|
@@ -3906,396 +4243,236 @@ var PhotoDateRangeFilter = (t0) => {
|
|
|
3906
4243
|
const [dragged, setDragged] = useState(null);
|
|
3907
4244
|
const fromInput = useRef(null);
|
|
3908
4245
|
const toInput = useRef(null);
|
|
4246
|
+
const press = useRef(null);
|
|
3909
4247
|
const positions = dragged ?? dateRangeToSliderPositions(value, scale);
|
|
3910
4248
|
const shownRange = dragged ? sliderPositionsToDateRange(dragged, scale) : value;
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
from,
|
|
3921
|
-
to: Math.max(from, to)
|
|
3922
|
-
};
|
|
4249
|
+
const readPositions = (moved) => {
|
|
4250
|
+
const from = Number(fromInput.current?.value ?? positions.from);
|
|
4251
|
+
const to = Number(toInput.current?.value ?? positions.to);
|
|
4252
|
+
return moved === "from" ? {
|
|
4253
|
+
from: Math.min(from, to),
|
|
4254
|
+
to
|
|
4255
|
+
} : {
|
|
4256
|
+
from,
|
|
4257
|
+
to: Math.max(from, to)
|
|
3923
4258
|
};
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
4259
|
+
};
|
|
4260
|
+
const commit = (moved_0, next) => {
|
|
4261
|
+
setDragged(null);
|
|
4262
|
+
const range = sliderPositionsToDateRange(next, scale);
|
|
4263
|
+
const other = moved_0 === "from" ? "to" : "from";
|
|
4264
|
+
onChange({
|
|
4265
|
+
...range,
|
|
4266
|
+
[other]: value[other]
|
|
4267
|
+
});
|
|
4268
|
+
};
|
|
4269
|
+
const commitOnRelease = (moved_1) => (input) => {
|
|
3932
4270
|
if (!input) {
|
|
3933
|
-
return;
|
|
4271
|
+
return void 0;
|
|
3934
4272
|
}
|
|
3935
|
-
const
|
|
3936
|
-
|
|
3937
|
-
const next = sliderPositionsToDateRange(readPositions(moved_0), scale);
|
|
3938
|
-
const other = moved_0 === "from" ? "to" : "from";
|
|
3939
|
-
onChange({
|
|
3940
|
-
...next,
|
|
3941
|
-
[other]: value[other]
|
|
3942
|
-
});
|
|
4273
|
+
const onRelease = () => {
|
|
4274
|
+
commit(moved_1, readPositions(moved_1));
|
|
3943
4275
|
};
|
|
3944
|
-
input.addEventListener("change",
|
|
4276
|
+
input.addEventListener("change", onRelease);
|
|
3945
4277
|
return () => {
|
|
3946
|
-
input.removeEventListener("change",
|
|
4278
|
+
input.removeEventListener("change", onRelease);
|
|
3947
4279
|
};
|
|
3948
4280
|
};
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
4281
|
+
const trackDrag = (moved_2, event) => {
|
|
4282
|
+
if (event.type === "input") {
|
|
4283
|
+
setDragged(readPositions(moved_2));
|
|
4284
|
+
}
|
|
4285
|
+
};
|
|
4286
|
+
const onPressStart = (event_0) => {
|
|
4287
|
+
if (event_0.button !== 0 || press.current) {
|
|
4288
|
+
return;
|
|
4289
|
+
}
|
|
4290
|
+
const track = trackBox(event_0.currentTarget);
|
|
4291
|
+
const position = positionOnTrack(event_0.clientX - track.left, track.width);
|
|
4292
|
+
event_0.currentTarget.setPointerCapture(event_0.pointerId);
|
|
4293
|
+
press.current = {
|
|
4294
|
+
pointerId: event_0.pointerId,
|
|
4295
|
+
x: event_0.clientX,
|
|
4296
|
+
position,
|
|
4297
|
+
start: positions,
|
|
4298
|
+
handle: pressedHandle(positions, position, track.width),
|
|
4299
|
+
dragging: false
|
|
3955
4300
|
};
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
4301
|
+
};
|
|
4302
|
+
const onPressMove = (event_1) => {
|
|
4303
|
+
const current = press.current;
|
|
4304
|
+
if (current?.pointerId !== event_1.pointerId) {
|
|
4305
|
+
return;
|
|
4306
|
+
}
|
|
4307
|
+
const deltaPx = event_1.clientX - current.x;
|
|
4308
|
+
if (!current.dragging && Math.abs(deltaPx) < DRAG_SLOP_PX) {
|
|
4309
|
+
return;
|
|
4310
|
+
}
|
|
4311
|
+
current.dragging = true;
|
|
4312
|
+
current.handle ??= handleOfDrag(deltaPx);
|
|
4313
|
+
const {
|
|
4314
|
+
width
|
|
4315
|
+
} = trackBox(event_1.currentTarget);
|
|
4316
|
+
setDragged(dragPositions(current.start, current.position, current.handle, deltaPx, width));
|
|
4317
|
+
};
|
|
4318
|
+
const onPressEnd = (event_2) => {
|
|
4319
|
+
const current_0 = press.current;
|
|
4320
|
+
if (current_0?.pointerId !== event_2.pointerId) {
|
|
4321
|
+
return;
|
|
4322
|
+
}
|
|
4323
|
+
press.current = null;
|
|
4324
|
+
const {
|
|
4325
|
+
width: width_0
|
|
4326
|
+
} = trackBox(event_2.currentTarget);
|
|
4327
|
+
const {
|
|
4328
|
+
handle,
|
|
4329
|
+
positions: next_0
|
|
4330
|
+
} = current_0.dragging && current_0.handle ? {
|
|
4331
|
+
handle: current_0.handle,
|
|
4332
|
+
positions: dragPositions(current_0.start, current_0.position, current_0.handle, event_2.clientX - current_0.x, width_0)
|
|
4333
|
+
} : tapPositions(current_0.start, current_0.position, width_0);
|
|
4334
|
+
if (next_0) {
|
|
4335
|
+
commit(handle, next_0);
|
|
4336
|
+
}
|
|
4337
|
+
const input_0 = handle === "from" ? fromInput : toInput;
|
|
4338
|
+
input_0.current?.focus({
|
|
4339
|
+
preventScroll: true
|
|
4340
|
+
});
|
|
4341
|
+
};
|
|
4342
|
+
const onPressCancel = (event_3) => {
|
|
4343
|
+
if (press.current?.pointerId === event_3.pointerId) {
|
|
4344
|
+
press.current = null;
|
|
4345
|
+
setDragged(null);
|
|
4346
|
+
}
|
|
4347
|
+
};
|
|
3962
4348
|
const bins = capturedAt ? dateSliderBins(capturedAt, scale, BINS) : [];
|
|
3963
4349
|
const maxCount = Math.max(1, ...bins);
|
|
3964
4350
|
const years = [...new Set(recommendedMaxAgeYears ? [...yearLines, recommendedMaxAgeYears] : yearLines)].map((count) => ({
|
|
3965
4351
|
count,
|
|
3966
4352
|
position: dateSliderPosition(yearsAgoMs(count, now), scale)
|
|
3967
|
-
})).filter(
|
|
4353
|
+
})).filter(({
|
|
4354
|
+
position: position_0
|
|
4355
|
+
}) => position_0 > 0 && position_0 < 1);
|
|
3968
4356
|
const shownMarkers = markers.map((marker) => {
|
|
3969
4357
|
const time = typeof marker.date === "number" ? marker.date : parseIsoDateStartMs(marker.date);
|
|
3970
4358
|
return {
|
|
3971
4359
|
...marker,
|
|
3972
4360
|
position: dateSliderPosition(time, scale)
|
|
3973
4361
|
};
|
|
3974
|
-
}).filter(
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
$[8] = t8;
|
|
3980
|
-
} else {
|
|
3981
|
-
t8 = $[8];
|
|
3982
|
-
}
|
|
3983
|
-
const day = t8;
|
|
3984
|
-
let t9;
|
|
3985
|
-
if ($[9] !== day || $[10] !== shownRange.from || $[11] !== shownRange.to || $[12] !== text) {
|
|
3986
|
-
t9 = shownRange.from && shownRange.to ? text.between(day(shownRange.from), day(shownRange.to)) : shownRange.from ? text.since(day(shownRange.from)) : shownRange.to ? text.until(day(shownRange.to)) : text.allDates;
|
|
3987
|
-
$[9] = day;
|
|
3988
|
-
$[10] = shownRange.from;
|
|
3989
|
-
$[11] = shownRange.to;
|
|
3990
|
-
$[12] = text;
|
|
3991
|
-
$[13] = t9;
|
|
3992
|
-
} else {
|
|
3993
|
-
t9 = $[13];
|
|
3994
|
-
}
|
|
3995
|
-
const rangeLabel = t9;
|
|
4362
|
+
}).filter(({
|
|
4363
|
+
position: position_1
|
|
4364
|
+
}) => position_1 > 0 && position_1 < 1);
|
|
4365
|
+
const day = (isoDate) => formatDate(parseIsoDateStartMs(isoDate), locale);
|
|
4366
|
+
const rangeLabel = shownRange.from && shownRange.to ? text.between(day(shownRange.from), day(shownRange.to)) : shownRange.from ? text.since(day(shownRange.from)) : shownRange.to ? text.until(day(shownRange.to)) : text.allDates;
|
|
3996
4367
|
const setYears = (count_0) => {
|
|
3997
4368
|
onChange({
|
|
3998
4369
|
from: new Date(yearsAgoMs(count_0, now)).toISOString().slice(0, 10)
|
|
3999
4370
|
});
|
|
4000
4371
|
};
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
});
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
};
|
|
4018
|
-
$[14] = onChange;
|
|
4019
|
-
$[15] = value;
|
|
4020
|
-
$[16] = t10;
|
|
4021
|
-
} else {
|
|
4022
|
-
t10 = $[16];
|
|
4023
|
-
}
|
|
4024
|
-
const setDay = t10;
|
|
4372
|
+
const setDay = (key, input_1) => {
|
|
4373
|
+
if (input_1 === "") {
|
|
4374
|
+
onChange({
|
|
4375
|
+
...value,
|
|
4376
|
+
[key]: void 0
|
|
4377
|
+
});
|
|
4378
|
+
} else if (isIsoDate(input_1)) {
|
|
4379
|
+
onChange({
|
|
4380
|
+
...value,
|
|
4381
|
+
[key]: input_1
|
|
4382
|
+
});
|
|
4383
|
+
}
|
|
4384
|
+
};
|
|
4025
4385
|
const isAllDates = !shownRange.from && !shownRange.to;
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
}
|
|
4094
|
-
let t20;
|
|
4095
|
-
if ($[35] !== trackDrag) {
|
|
4096
|
-
t20 = (event_0) => {
|
|
4097
|
-
trackDrag("from", event_0.nativeEvent);
|
|
4098
|
-
};
|
|
4099
|
-
$[35] = trackDrag;
|
|
4100
|
-
$[36] = t20;
|
|
4101
|
-
} else {
|
|
4102
|
-
t20 = $[36];
|
|
4103
|
-
}
|
|
4104
|
-
let t21;
|
|
4105
|
-
if ($[37] !== commitOnRelease) {
|
|
4106
|
-
t21 = (input_1) => {
|
|
4107
|
-
fromInput.current = input_1;
|
|
4108
|
-
return commitOnRelease("from")(input_1);
|
|
4109
|
-
};
|
|
4110
|
-
$[37] = commitOnRelease;
|
|
4111
|
-
$[38] = t21;
|
|
4112
|
-
} else {
|
|
4113
|
-
t21 = $[38];
|
|
4114
|
-
}
|
|
4115
|
-
let t22;
|
|
4116
|
-
if ($[39] !== positions.from || $[40] !== t19 || $[41] !== t20 || $[42] !== t21 || $[43] !== text.fromHandle) {
|
|
4117
|
-
t22 = /* @__PURE__ */ jsx("input", { "aria-label": text.fromHandle, "aria-valuetext": t19, className: HANDLE_CLASS, max: 1, min: 0, onChange: t20, ref: t21, step: STEP, type: "range", value: positions.from });
|
|
4118
|
-
$[39] = positions.from;
|
|
4119
|
-
$[40] = t19;
|
|
4120
|
-
$[41] = t20;
|
|
4121
|
-
$[42] = t21;
|
|
4122
|
-
$[43] = text.fromHandle;
|
|
4123
|
-
$[44] = t22;
|
|
4124
|
-
} else {
|
|
4125
|
-
t22 = $[44];
|
|
4126
|
-
}
|
|
4127
|
-
let t23;
|
|
4128
|
-
if ($[45] !== day || $[46] !== shownRange.to || $[47] !== text.allDates) {
|
|
4129
|
-
t23 = shownRange.to ? day(shownRange.to) : text.allDates;
|
|
4130
|
-
$[45] = day;
|
|
4131
|
-
$[46] = shownRange.to;
|
|
4132
|
-
$[47] = text.allDates;
|
|
4133
|
-
$[48] = t23;
|
|
4134
|
-
} else {
|
|
4135
|
-
t23 = $[48];
|
|
4136
|
-
}
|
|
4137
|
-
let t24;
|
|
4138
|
-
if ($[49] !== trackDrag) {
|
|
4139
|
-
t24 = (event_1) => {
|
|
4140
|
-
trackDrag("to", event_1.nativeEvent);
|
|
4141
|
-
};
|
|
4142
|
-
$[49] = trackDrag;
|
|
4143
|
-
$[50] = t24;
|
|
4144
|
-
} else {
|
|
4145
|
-
t24 = $[50];
|
|
4146
|
-
}
|
|
4147
|
-
let t25;
|
|
4148
|
-
if ($[51] !== commitOnRelease) {
|
|
4149
|
-
t25 = (input_2) => {
|
|
4150
|
-
toInput.current = input_2;
|
|
4151
|
-
return commitOnRelease("to")(input_2);
|
|
4152
|
-
};
|
|
4153
|
-
$[51] = commitOnRelease;
|
|
4154
|
-
$[52] = t25;
|
|
4155
|
-
} else {
|
|
4156
|
-
t25 = $[52];
|
|
4157
|
-
}
|
|
4158
|
-
let t26;
|
|
4159
|
-
if ($[53] !== positions.to || $[54] !== t23 || $[55] !== t24 || $[56] !== t25 || $[57] !== text.toHandle) {
|
|
4160
|
-
t26 = /* @__PURE__ */ jsx("input", { "aria-label": text.toHandle, "aria-valuetext": t23, className: HANDLE_CLASS, max: 1, min: 0, onChange: t24, ref: t25, step: STEP, type: "range", value: positions.to });
|
|
4161
|
-
$[53] = positions.to;
|
|
4162
|
-
$[54] = t23;
|
|
4163
|
-
$[55] = t24;
|
|
4164
|
-
$[56] = t25;
|
|
4165
|
-
$[57] = text.toHandle;
|
|
4166
|
-
$[58] = t26;
|
|
4167
|
-
} else {
|
|
4168
|
-
t26 = $[58];
|
|
4169
|
-
}
|
|
4170
|
-
let t27;
|
|
4171
|
-
if ($[59] !== t18 || $[60] !== t22 || $[61] !== t26) {
|
|
4172
|
-
t27 = /* @__PURE__ */ jsxs("div", { className: "relative h-4", children: [
|
|
4173
|
-
t18,
|
|
4174
|
-
t22,
|
|
4175
|
-
t26
|
|
4176
|
-
] });
|
|
4177
|
-
$[59] = t18;
|
|
4178
|
-
$[60] = t22;
|
|
4179
|
-
$[61] = t26;
|
|
4180
|
-
$[62] = t27;
|
|
4181
|
-
} else {
|
|
4182
|
-
t27 = $[62];
|
|
4183
|
-
}
|
|
4184
|
-
const t28 = "relative mx-2 h-4";
|
|
4185
|
-
const t30 = years.map((t29) => {
|
|
4186
|
-
const {
|
|
4386
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
4387
|
+
/* @__PURE__ */ jsxs(
|
|
4388
|
+
"div",
|
|
4389
|
+
{
|
|
4390
|
+
className: `-mb-3.5 touch-pan-y pb-3.5 select-none ${dragged ? "cursor-grabbing" : "cursor-pointer"}`,
|
|
4391
|
+
onPointerCancel: onPressCancel,
|
|
4392
|
+
onPointerDown: onPressStart,
|
|
4393
|
+
onPointerMove: onPressMove,
|
|
4394
|
+
onPointerUp: onPressEnd,
|
|
4395
|
+
onClick: () => {
|
|
4396
|
+
},
|
|
4397
|
+
children: [
|
|
4398
|
+
/* @__PURE__ */ jsx("div", { className: "mx-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", style: {
|
|
4399
|
+
height: CHART_HEIGHT_PX,
|
|
4400
|
+
marginTop: shownMarkers.length > 0 ? 14 : 0
|
|
4401
|
+
}, children: [
|
|
4402
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "absolute inset-0 flex items-end", children: bins.map((count_1, index) => {
|
|
4403
|
+
const start = index / BINS;
|
|
4404
|
+
const inRange = start + 1 / BINS > positions.from && start < positions.to;
|
|
4405
|
+
return /* @__PURE__ */ jsx(
|
|
4406
|
+
"div",
|
|
4407
|
+
{
|
|
4408
|
+
className: `flex-1 rounded-t-[1px] ${inRange ? "bg-slate-500" : "bg-slate-300"}`,
|
|
4409
|
+
style: {
|
|
4410
|
+
height: count_1 === 0 ? 0 : Math.max(2, Math.log1p(count_1) / Math.log1p(maxCount) * CHART_HEIGHT_PX)
|
|
4411
|
+
},
|
|
4412
|
+
title: count_1 > 0 ? text.photoCount(count_1) : void 0
|
|
4413
|
+
},
|
|
4414
|
+
index
|
|
4415
|
+
);
|
|
4416
|
+
}) }),
|
|
4417
|
+
years.map(({
|
|
4418
|
+
count: count_2,
|
|
4419
|
+
position: position_2
|
|
4420
|
+
}) => /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-y-0 w-px -translate-x-1/2", style: {
|
|
4421
|
+
left: percent(position_2),
|
|
4422
|
+
backgroundColor: count_2 === recommendedMaxAgeYears ? RED : "rgb(148 163 184 / 0.7)"
|
|
4423
|
+
} }, count_2)),
|
|
4424
|
+
shownMarkers.map((marker_0) => /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 w-0 border-l-2 border-dashed", style: {
|
|
4425
|
+
left: percent(marker_0.position),
|
|
4426
|
+
borderColor: marker_0.color ?? RED
|
|
4427
|
+
}, children: /* @__PURE__ */ jsx("span", { className: "absolute -top-3.5 -translate-x-1/2 text-[10px] leading-none whitespace-nowrap", style: {
|
|
4428
|
+
color: marker_0.color ?? RED
|
|
4429
|
+
}, children: marker_0.label }) }, `${marker_0.date}-${marker_0.label}`))
|
|
4430
|
+
] }) }),
|
|
4431
|
+
/* @__PURE__ */ jsxs("div", { className: "relative h-4", children: [
|
|
4432
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-x-2 top-1/2 h-1 -translate-y-1/2 rounded-full bg-slate-200", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 rounded-full bg-slate-700", style: {
|
|
4433
|
+
left: percent(positions.from),
|
|
4434
|
+
right: percent(1 - positions.to)
|
|
4435
|
+
} }) }),
|
|
4436
|
+
/* @__PURE__ */ jsx("input", { "aria-label": text.fromHandle, "aria-valuetext": shownRange.from ? day(shownRange.from) : text.allDates, className: HANDLE_CLASS, max: 1, min: 0, onChange: (event_4) => {
|
|
4437
|
+
trackDrag("from", event_4.nativeEvent);
|
|
4438
|
+
}, ref: (input_2) => {
|
|
4439
|
+
fromInput.current = input_2;
|
|
4440
|
+
return commitOnRelease("from")(input_2);
|
|
4441
|
+
}, step: DATE_SLIDER_STEP, type: "range", value: positions.from }),
|
|
4442
|
+
/* @__PURE__ */ jsx("input", { "aria-label": text.toHandle, "aria-valuetext": shownRange.to ? day(shownRange.to) : text.allDates, className: HANDLE_CLASS, max: 1, min: 0, onChange: (event_5) => {
|
|
4443
|
+
trackDrag("to", event_5.nativeEvent);
|
|
4444
|
+
}, ref: (input_3) => {
|
|
4445
|
+
toInput.current = input_3;
|
|
4446
|
+
return commitOnRelease("to")(input_3);
|
|
4447
|
+
}, step: DATE_SLIDER_STEP, type: "range", value: positions.to })
|
|
4448
|
+
] })
|
|
4449
|
+
]
|
|
4450
|
+
}
|
|
4451
|
+
),
|
|
4452
|
+
/* @__PURE__ */ jsx("div", { className: "pointer-events-none relative mx-2 h-4", children: years.map(({
|
|
4187
4453
|
count: count_3,
|
|
4188
|
-
position:
|
|
4189
|
-
}
|
|
4190
|
-
return /* @__PURE__ */ jsx("button", { className: `absolute top-0 -translate-x-1/2 rounded px-0.5 text-[10px] leading-4 whitespace-nowrap hover:underline ${count_3 === recommendedMaxAgeYears ? "font-semibold text-red-600" : "text-slate-500 hover:text-slate-900"}`, onClick: () => {
|
|
4454
|
+
position: position_3
|
|
4455
|
+
}) => /* @__PURE__ */ jsx("button", { className: `pointer-events-auto absolute top-0 -translate-x-1/2 rounded px-0.5 text-[10px] leading-4 whitespace-nowrap hover:underline ${count_3 === recommendedMaxAgeYears ? "font-semibold text-red-600" : "text-slate-500 hover:text-slate-900"}`, onClick: () => {
|
|
4191
4456
|
setYears(count_3);
|
|
4192
4457
|
}, style: {
|
|
4193
|
-
left: percent(
|
|
4194
|
-
}, title: count_3 === recommendedMaxAgeYears ? text.recommendedMaxAge(count_3) : text.lastYears(count_3), type: "button", children: text.yearsShort(count_3) }, count_3)
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
t31 = $[64];
|
|
4203
|
-
}
|
|
4204
|
-
let t32;
|
|
4205
|
-
if ($[65] !== rangeLabel) {
|
|
4206
|
-
t32 = /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-700", children: rangeLabel });
|
|
4207
|
-
$[65] = rangeLabel;
|
|
4208
|
-
$[66] = t32;
|
|
4209
|
-
} else {
|
|
4210
|
-
t32 = $[66];
|
|
4211
|
-
}
|
|
4212
|
-
let t33;
|
|
4213
|
-
if ($[67] !== allDatesAction || $[68] !== isAllDates || $[69] !== onChange || $[70] !== text.allDates) {
|
|
4214
|
-
t33 = isAllDates || !allDatesAction ? null : /* @__PURE__ */ jsx("button", { className: "shrink-0 font-medium text-slate-600 underline decoration-slate-300 underline-offset-2 hover:text-slate-900", onClick: () => {
|
|
4215
|
-
onChange({});
|
|
4216
|
-
}, type: "button", children: text.allDates });
|
|
4217
|
-
$[67] = allDatesAction;
|
|
4218
|
-
$[68] = isAllDates;
|
|
4219
|
-
$[69] = onChange;
|
|
4220
|
-
$[70] = text.allDates;
|
|
4221
|
-
$[71] = t33;
|
|
4222
|
-
} else {
|
|
4223
|
-
t33 = $[71];
|
|
4224
|
-
}
|
|
4225
|
-
let t34;
|
|
4226
|
-
if ($[72] !== t32 || $[73] !== t33) {
|
|
4227
|
-
t34 = /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-baseline justify-between gap-2 text-xs", children: [
|
|
4228
|
-
t32,
|
|
4229
|
-
t33
|
|
4230
|
-
] });
|
|
4231
|
-
$[72] = t32;
|
|
4232
|
-
$[73] = t33;
|
|
4233
|
-
$[74] = t34;
|
|
4234
|
-
} else {
|
|
4235
|
-
t34 = $[74];
|
|
4236
|
-
}
|
|
4237
|
-
let t35;
|
|
4238
|
-
if ($[75] !== dateInputs || $[76] !== setDay || $[77] !== text || $[78] !== value) {
|
|
4239
|
-
t35 = dateInputs === "none" ? null : /* @__PURE__ */ jsxs("details", { className: "mt-1 text-xs text-slate-600", open: dateInputs === "open" || void 0, children: [
|
|
4458
|
+
left: percent(position_3)
|
|
4459
|
+
}, title: count_3 === recommendedMaxAgeYears ? text.recommendedMaxAge(count_3) : text.lastYears(count_3), type: "button", children: text.yearsShort(count_3) }, count_3)) }),
|
|
4460
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-baseline justify-between gap-2 text-xs", children: [
|
|
4461
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-slate-700", children: rangeLabel }),
|
|
4462
|
+
isAllDates || !allDatesAction ? null : /* @__PURE__ */ jsx("button", { className: "shrink-0 font-medium text-slate-600 underline decoration-slate-300 underline-offset-2 hover:text-slate-900", onClick: () => {
|
|
4463
|
+
onChange({});
|
|
4464
|
+
}, type: "button", children: text.allDates })
|
|
4465
|
+
] }),
|
|
4466
|
+
dateInputs === "none" ? null : /* @__PURE__ */ jsxs("details", { className: "mt-1 text-xs text-slate-600", open: dateInputs === "open" || void 0, children: [
|
|
4240
4467
|
/* @__PURE__ */ jsx("summary", { className: "cursor-pointer select-none hover:text-slate-900", children: text.exactDates }),
|
|
4241
4468
|
/* @__PURE__ */ jsx("div", { className: "mt-1.5 grid grid-cols-2 gap-2", children: ["from", "to"].map((key_0) => /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1", children: [
|
|
4242
4469
|
text[key_0],
|
|
4243
|
-
/* @__PURE__ */ jsx("input", { className: "rounded-md border border-slate-200 px-2 py-1.5 text-sm text-slate-800", onChange: (
|
|
4244
|
-
setDay(key_0,
|
|
4470
|
+
/* @__PURE__ */ jsx("input", { className: "rounded-md border border-slate-200 px-2 py-1.5 text-sm text-slate-800", onChange: (event_6) => {
|
|
4471
|
+
setDay(key_0, event_6.target.value);
|
|
4245
4472
|
}, type: "date", value: value[key_0] ?? "" })
|
|
4246
4473
|
] }, key_0)) })
|
|
4247
|
-
] })
|
|
4248
|
-
$[75] = dateInputs;
|
|
4249
|
-
$[76] = setDay;
|
|
4250
|
-
$[77] = text;
|
|
4251
|
-
$[78] = value;
|
|
4252
|
-
$[79] = t35;
|
|
4253
|
-
} else {
|
|
4254
|
-
t35 = $[79];
|
|
4255
|
-
}
|
|
4256
|
-
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
4257
|
-
/* @__PURE__ */ jsx("div", { className: "mx-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", style: t12, children: [
|
|
4258
|
-
/* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "absolute inset-0 flex items-end", children: bins.map(t13) }),
|
|
4259
|
-
years.map((t14) => {
|
|
4260
|
-
const {
|
|
4261
|
-
count: count_2,
|
|
4262
|
-
position: position_1
|
|
4263
|
-
} = t14;
|
|
4264
|
-
return /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-y-0 w-px -translate-x-1/2", style: {
|
|
4265
|
-
left: percent(position_1),
|
|
4266
|
-
backgroundColor: count_2 === recommendedMaxAgeYears ? RED : "rgb(148 163 184 / 0.7)"
|
|
4267
|
-
} }, count_2);
|
|
4268
|
-
}),
|
|
4269
|
-
shownMarkers.map(_temp43)
|
|
4270
|
-
] }) }),
|
|
4271
|
-
t27,
|
|
4272
|
-
t31,
|
|
4273
|
-
t34,
|
|
4274
|
-
t35
|
|
4474
|
+
] })
|
|
4275
4475
|
] });
|
|
4276
4476
|
};
|
|
4277
|
-
function _temp11() {
|
|
4278
|
-
return Date.now();
|
|
4279
|
-
}
|
|
4280
|
-
function _temp26(t0) {
|
|
4281
|
-
const {
|
|
4282
|
-
position
|
|
4283
|
-
} = t0;
|
|
4284
|
-
return position > 0 && position < 1;
|
|
4285
|
-
}
|
|
4286
|
-
function _temp34(t0) {
|
|
4287
|
-
const {
|
|
4288
|
-
position: position_0
|
|
4289
|
-
} = t0;
|
|
4290
|
-
return position_0 > 0 && position_0 < 1;
|
|
4291
|
-
}
|
|
4292
|
-
function _temp43(marker_0) {
|
|
4293
|
-
return /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 w-0 border-l-2 border-dashed", style: {
|
|
4294
|
-
left: percent(marker_0.position),
|
|
4295
|
-
borderColor: marker_0.color ?? RED
|
|
4296
|
-
}, children: /* @__PURE__ */ jsx("span", { className: "absolute -top-3.5 -translate-x-1/2 text-[10px] leading-none whitespace-nowrap", style: {
|
|
4297
|
-
color: marker_0.color ?? RED
|
|
4298
|
-
}, children: marker_0.label }) }, `${marker_0.date}-${marker_0.label}`);
|
|
4299
|
-
}
|
|
4300
4477
|
|
|
4301
|
-
export { BASE_COLOR, FloatingPhotoViewer, FloatingViewerInfoButton, LocationPickOnMap, MAPILLARY_FEATURE_BAR_LABELS, MapillaryFeatureBar, PhotoCount, PhotoDate, PhotoDateRangeFilter, SELECTION_COLOR, SelectedMapFeatureLayer, StreetLevelImagerySelectionOverlay, StreetLevelImagerySourcesAndLayers, StreetLevelImageryViewCone, StreetLevelImageryViewer, VIEWPOINT_DEFAULT_COLOR, VIEWPOINT_DIRECTION_LAYER_ID, VIEW_SHAPE_FILL_OPACITY, ViewpointLayer, getViewpointSession, previousDataWhile, queryStreetImageryFeatures, resolveSelectedSequence, streetImageryInteractiveLayerIds, useActiveDirectionKey, useAllProviderMapFeatures, useAllProviderPhotos, useArmedLocationOpenerId, useCanGoBack, useCanGoForward, useCurrentHistoryEntry, useLocationPickActions, useMapViewportBbox, useMapillaryImageDetections, useMapillaryMapFeatureImages, useMapillaryMapFeaturesNear, usePhotoFullUrl, usePhotoThumbnail, useProviderMapFeatures, useProviderPhotos, useProviderSequences, useSelectedMapillaryFeature, useViewSuggestions, useViewpointLine, useViewpoints, viewDirectionKeyFromFeatures, viewSuggestionLabel };
|
|
4478
|
+
export { BASE_COLOR, FloatingPhotoViewer, FloatingViewerInfoButton, LocationPickOnMap, MAPILLARY_FEATURE_BAR_LABELS, MapillaryFeatureBar, PhotoCount, PhotoDate, PhotoDateRangeFilter, SELECTION_COLOR, SelectedMapFeatureLayer, StreetLevelImagerySelectionOverlay, StreetLevelImagerySourcesAndLayers, StreetLevelImageryViewCone, StreetLevelImageryViewer, VIEWPOINT_DEFAULT_COLOR, VIEWPOINT_DIRECTION_LAYER_ID, VIEW_SHAPE_FILL_OPACITY, ViewpointLayer, getViewpointSession, previousDataWhile, queryStreetImageryFeatures, resolveSelectedSequence, streetImageryInteractiveLayerIds, useActiveDirectionKey, useAllProviderMapFeatures, useAllProviderPhotos, useArmedLocationOpenerId, useCanGoBack, useCanGoForward, useCurrentHistoryEntry, useLocationPickActions, useMapViewportBbox, useMapillaryImageDetections, useMapillaryMapFeatureImages, useMapillaryMapFeaturesNear, usePhotoFullUrl, usePhotoThumbnail, usePhotosLookingAt, useProviderMapFeatures, useProviderPhotos, useProviderSequences, useSelectedMapillaryFeature, useViewSuggestions, useViewpointLine, useViewpoints, viewDirectionKeyFromFeatures, viewSuggestionLabel };
|