@uvalib/web-components 1.2.0 → 1.3.0

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.
Files changed (200) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +808 -46
  3. package/dist/analytics.d.ts +10 -0
  4. package/dist/analytics.js +9 -0
  5. package/dist/analytics.js.map +1 -0
  6. package/dist/base/UvalibElement.js +8 -5
  7. package/dist/base/UvalibElement.js.map +1 -1
  8. package/dist/base/analytics-state.d.ts +7 -0
  9. package/dist/base/analytics-state.js.map +1 -1
  10. package/dist/base/light-dom-styles.d.ts +13 -0
  11. package/dist/base/light-dom-styles.js +26 -0
  12. package/dist/base/light-dom-styles.js.map +1 -1
  13. package/dist/base/search-tracker.d.ts +57 -0
  14. package/dist/base/search-tracker.js +51 -0
  15. package/dist/base/search-tracker.js.map +1 -0
  16. package/dist/base.css +286 -14
  17. package/dist/base.d.ts +2 -0
  18. package/dist/base.js +1 -0
  19. package/dist/base.js.map +1 -1
  20. package/dist/components/site-analytics/SiteAnalytics.d.ts +20 -1
  21. package/dist/components/site-analytics/SiteAnalytics.js +93 -12
  22. package/dist/components/site-analytics/SiteAnalytics.js.map +1 -1
  23. package/dist/components/site-page/SitePage.d.ts +23 -0
  24. package/dist/components/site-page/SitePage.js +77 -0
  25. package/dist/components/site-page/SitePage.js.map +1 -1
  26. package/dist/components/uvalib-back-to-top/UvalibBackToTop.d.ts +58 -0
  27. package/dist/components/uvalib-back-to-top/UvalibBackToTop.js +250 -0
  28. package/dist/components/uvalib-back-to-top/UvalibBackToTop.js.map +1 -0
  29. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.d.ts +1 -0
  30. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.js +4 -0
  31. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.js.map +1 -0
  32. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.d.ts +14 -0
  33. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.js +56 -4
  34. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.js.map +1 -1
  35. package/dist/components/uvalib-chip-group/UvalibChipGroup.d.ts +25 -3
  36. package/dist/components/uvalib-chip-group/UvalibChipGroup.js +80 -10
  37. package/dist/components/uvalib-chip-group/UvalibChipGroup.js.map +1 -1
  38. package/dist/components/uvalib-combobox/UvalibCombobox.d.ts +212 -0
  39. package/dist/components/uvalib-combobox/UvalibCombobox.js +1088 -0
  40. package/dist/components/uvalib-combobox/UvalibCombobox.js.map +1 -0
  41. package/dist/components/uvalib-combobox/uvalib-combobox.d.ts +1 -0
  42. package/dist/components/uvalib-combobox/uvalib-combobox.js +4 -0
  43. package/dist/components/uvalib-combobox/uvalib-combobox.js.map +1 -0
  44. package/dist/components/uvalib-contents/UvalibContents.d.ts +53 -0
  45. package/dist/components/uvalib-contents/UvalibContents.js +202 -3
  46. package/dist/components/uvalib-contents/UvalibContents.js.map +1 -1
  47. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.d.ts +56 -17
  48. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.js +285 -81
  49. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.js.map +1 -1
  50. package/dist/components/uvalib-date-range/UvalibDateRange.d.ts +6 -0
  51. package/dist/components/uvalib-date-range/UvalibDateRange.js +23 -0
  52. package/dist/components/uvalib-date-range/UvalibDateRange.js.map +1 -1
  53. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.d.ts +113 -0
  54. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.js +589 -0
  55. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.js.map +1 -0
  56. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.d.ts +1 -0
  57. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.js +4 -0
  58. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.js.map +1 -0
  59. package/dist/components/uvalib-image-regions/UvalibImageRegions.d.ts +130 -0
  60. package/dist/components/uvalib-image-regions/UvalibImageRegions.js +658 -0
  61. package/dist/components/uvalib-image-regions/UvalibImageRegions.js.map +1 -0
  62. package/dist/components/uvalib-image-regions/regions.d.ts +57 -0
  63. package/dist/components/uvalib-image-regions/regions.js +117 -0
  64. package/dist/components/uvalib-image-regions/regions.js.map +1 -0
  65. package/dist/components/uvalib-image-regions/uvalib-image-regions.d.ts +1 -0
  66. package/dist/components/uvalib-image-regions/uvalib-image-regions.js +4 -0
  67. package/dist/components/uvalib-image-regions/uvalib-image-regions.js.map +1 -0
  68. package/dist/components/uvalib-lightbox/UvalibLightbox.d.ts +40 -0
  69. package/dist/components/uvalib-lightbox/UvalibLightbox.js +144 -16
  70. package/dist/components/uvalib-lightbox/UvalibLightbox.js.map +1 -1
  71. package/dist/components/uvalib-map/UvalibMap.d.ts +182 -0
  72. package/dist/components/uvalib-map/UvalibMap.js +1001 -0
  73. package/dist/components/uvalib-map/UvalibMap.js.map +1 -0
  74. package/dist/components/uvalib-map/uvalib-map.d.ts +1 -0
  75. package/dist/components/uvalib-map/uvalib-map.js +4 -0
  76. package/dist/components/uvalib-map/uvalib-map.js.map +1 -0
  77. package/dist/components/uvalib-metadata/UvalibMetadata.d.ts +39 -2
  78. package/dist/components/uvalib-metadata/UvalibMetadata.js +214 -8
  79. package/dist/components/uvalib-metadata/UvalibMetadata.js.map +1 -1
  80. package/dist/components/uvalib-pager/UvalibPager.d.ts +22 -3
  81. package/dist/components/uvalib-pager/UvalibPager.js +42 -4
  82. package/dist/components/uvalib-pager/UvalibPager.js.map +1 -1
  83. package/dist/custom-elements.json +9253 -3253
  84. package/dist/index.d.ts +8 -0
  85. package/dist/index.js +5 -0
  86. package/dist/index.js.map +1 -1
  87. package/dist/pagefind.css +4 -0
  88. package/dist/styles/base.js +119 -0
  89. package/dist/styles/base.js.map +1 -1
  90. package/dist/styles/color-scheme.js +5 -0
  91. package/dist/styles/color-scheme.js.map +1 -1
  92. package/dist/styles/controls.js +6 -0
  93. package/dist/styles/controls.js.map +1 -1
  94. package/dist/styles/hidden.d.ts +2 -0
  95. package/dist/styles/hidden.js +51 -0
  96. package/dist/styles/hidden.js.map +1 -0
  97. package/dist/styles/message.d.ts +1 -0
  98. package/dist/styles/message.js +82 -0
  99. package/dist/styles/message.js.map +1 -0
  100. package/dist/styles/pagefind.js +4 -0
  101. package/dist/styles/pagefind.js.map +1 -1
  102. package/dist/styles/result-list.d.ts +1 -0
  103. package/dist/styles/result-list.js +111 -0
  104. package/dist/styles/result-list.js.map +1 -0
  105. package/dist/styles/results.js +0 -15
  106. package/dist/styles/results.js.map +1 -1
  107. package/dist/testing/index.d.ts +110 -0
  108. package/dist/testing/index.js +100 -0
  109. package/dist/testing/index.js.map +1 -0
  110. package/dist/testing/lighthouse-rules.d.ts +10 -0
  111. package/dist/testing/lighthouse-rules.js +44 -0
  112. package/dist/testing/lighthouse-rules.js.map +1 -0
  113. package/dist/tokens.css +5 -0
  114. package/dist-cdn/analytics.js +32 -0
  115. package/dist-cdn/analytics.js.map +1 -0
  116. package/dist-cdn/base.css +286 -14
  117. package/dist-cdn/bento-box.js +3 -3
  118. package/dist-cdn/chunks/{SiteAnalytics-Cm-FyhYS.js → SiteAnalytics-B9gu5aGO.js} +59 -30
  119. package/dist-cdn/chunks/SiteAnalytics-B9gu5aGO.js.map +1 -0
  120. package/dist-cdn/chunks/{UvalibElement-BnI-eRRR.js → UvalibElement-pGONDAwB.js} +108 -101
  121. package/dist-cdn/chunks/UvalibElement-pGONDAwB.js.map +1 -0
  122. package/dist-cdn/chunks/{accessible-GqhVn5_H.js → accessible-DJv7YOtS.js} +2 -2
  123. package/dist-cdn/chunks/{accessible-GqhVn5_H.js.map → accessible-DJv7YOtS.js.map} +1 -1
  124. package/dist-cdn/chunks/analytics-state-Ce8DKe4F.js.map +1 -1
  125. package/dist-cdn/chunks/{base-p5pk0vb2.js → base-BI8h0Gf3.js} +121 -2
  126. package/dist-cdn/chunks/base-BI8h0Gf3.js.map +1 -0
  127. package/dist-cdn/chunks/{library-weekly-hours-COE7Vv6V.js → library-weekly-hours-CrV3TlP5.js} +3 -3
  128. package/dist-cdn/chunks/{library-weekly-hours-COE7Vv6V.js.map → library-weekly-hours-CrV3TlP5.js.map} +1 -1
  129. package/dist-cdn/chunks/regions-B8ExwUGP.js +86 -0
  130. package/dist-cdn/chunks/regions-B8ExwUGP.js.map +1 -0
  131. package/dist-cdn/chunks/{repeat-CIFUYkyh.js → repeat-m5Zd_QeP.js} +2 -2
  132. package/dist-cdn/chunks/{repeat-CIFUYkyh.js.map → repeat-m5Zd_QeP.js.map} +1 -1
  133. package/dist-cdn/chunks/{site-header-BlOYvQg1.js → site-header-DYRMpdBj.js} +9 -4
  134. package/dist-cdn/chunks/{site-header-BlOYvQg1.js.map → site-header-DYRMpdBj.js.map} +1 -1
  135. package/dist-cdn/chunks/{site-main-nav-AaxZ9rQf.js → site-main-nav-DURrQMal.js} +3 -3
  136. package/dist-cdn/chunks/{site-main-nav-AaxZ9rQf.js.map → site-main-nav-DURrQMal.js.map} +1 -1
  137. package/dist-cdn/chunks/{static-html-1mTAG6nS.js → static-html-C1rhtCHu.js} +2 -2
  138. package/dist-cdn/chunks/{static-html-1mTAG6nS.js.map → static-html-C1rhtCHu.js.map} +1 -1
  139. package/dist-cdn/custom-elements.json +9253 -3253
  140. package/dist-cdn/events-section.js +3 -3
  141. package/dist-cdn/library-hours-setup.js +2 -2
  142. package/dist-cdn/library-weekly-hours.js +1 -1
  143. package/dist-cdn/manifest.json +10 -2
  144. package/dist-cdn/pagefind.css +4 -0
  145. package/dist-cdn/site-alerts.js +4 -4
  146. package/dist-cdn/site-analytics.js +2 -2
  147. package/dist-cdn/site-footer.js +2 -2
  148. package/dist-cdn/site-header.js +1 -1
  149. package/dist-cdn/site-hours-section.js +4 -4
  150. package/dist-cdn/site-main-nav.js +1 -1
  151. package/dist-cdn/site-page.js +56 -11
  152. package/dist-cdn/site-page.js.map +1 -1
  153. package/dist-cdn/site-style.js +2 -2
  154. package/dist-cdn/skills/uvalib-web-components/SKILL.md +98 -13
  155. package/dist-cdn/skills/uvalib-web-components/reference/accessibility-testing.md +34 -2
  156. package/dist-cdn/skills/uvalib-web-components/reference/components.md +300 -13
  157. package/dist-cdn/skills/uvalib-web-components/reference/snippets.md +1 -1
  158. package/dist-cdn/tokens.css +5 -0
  159. package/dist-cdn/uvalib-analytics.js +2 -2
  160. package/dist-cdn/uvalib-back-to-top.js +156 -0
  161. package/dist-cdn/uvalib-back-to-top.js.map +1 -0
  162. package/dist-cdn/uvalib-breadcrumbs.js +31 -11
  163. package/dist-cdn/uvalib-breadcrumbs.js.map +1 -1
  164. package/dist-cdn/uvalib-card-grid.js +1 -1
  165. package/dist-cdn/uvalib-card.js +3 -3
  166. package/dist-cdn/uvalib-chip-group.js +53 -14
  167. package/dist-cdn/uvalib-chip-group.js.map +1 -1
  168. package/dist-cdn/uvalib-combobox.js +667 -0
  169. package/dist-cdn/uvalib-combobox.js.map +1 -0
  170. package/dist-cdn/uvalib-contents.js +100 -22
  171. package/dist-cdn/uvalib-contents.js.map +1 -1
  172. package/dist-cdn/uvalib-date-histogram.js +237 -127
  173. package/dist-cdn/uvalib-date-histogram.js.map +1 -1
  174. package/dist-cdn/uvalib-date-range.js +14 -2
  175. package/dist-cdn/uvalib-date-range.js.map +1 -1
  176. package/dist-cdn/uvalib-filter-drawer.js +355 -0
  177. package/dist-cdn/uvalib-filter-drawer.js.map +1 -0
  178. package/dist-cdn/uvalib-filter.js +3 -3
  179. package/dist-cdn/uvalib-image-regions.js +447 -0
  180. package/dist-cdn/uvalib-image-regions.js.map +1 -0
  181. package/dist-cdn/uvalib-lightbox.js +144 -55
  182. package/dist-cdn/uvalib-lightbox.js.map +1 -1
  183. package/dist-cdn/uvalib-map.js +471 -0
  184. package/dist-cdn/uvalib-map.js.map +1 -0
  185. package/dist-cdn/uvalib-metadata.js +150 -24
  186. package/dist-cdn/uvalib-metadata.js.map +1 -1
  187. package/dist-cdn/uvalib-pager.js +29 -17
  188. package/dist-cdn/uvalib-pager.js.map +1 -1
  189. package/dist-cdn/uvalib-photo-grid.js +2 -2
  190. package/dist-cdn/uvalib-results-count.js +2 -2
  191. package/dist-cdn/uvalib-tabs.js +2 -2
  192. package/dist-cdn/uvalib-tag-list.js +2 -2
  193. package/package.json +43 -1
  194. package/skills/uvalib-web-components/SKILL.md +98 -13
  195. package/skills/uvalib-web-components/reference/accessibility-testing.md +34 -2
  196. package/skills/uvalib-web-components/reference/components.md +300 -13
  197. package/skills/uvalib-web-components/reference/snippets.md +1 -1
  198. package/dist-cdn/chunks/SiteAnalytics-Cm-FyhYS.js.map +0 -1
  199. package/dist-cdn/chunks/UvalibElement-BnI-eRRR.js.map +0 -1
  200. package/dist-cdn/chunks/base-p5pk0vb2.js.map +0 -1
@@ -0,0 +1,471 @@
1
+ import { a as e, i as t, l as n, m as r, n as i, o as a, p as o, r as s, t as c } from "./chunks/UvalibElement-pGONDAwB.js";
2
+ import { a as l } from "./chunks/analytics-DTTihuBD.js";
3
+ import { n as u, r as d, t as f } from "./chunks/source-children-BHsDwCvL.js";
4
+ import { t as p } from "./chunks/accessible-DJv7YOtS.js";
5
+ // src/components/uvalib-map/UvalibMap.ts
6
+ var m = "uvalib-map", h = "https://tile.openstreetmap.org/{z}/{x}/{y}.png", g = "&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors", _ = [38.0336, -78.5048], v = 24, y = 56, b = 44, x = "var(--uvalib-map-height, min(24rem, 75vw))", S = "Tab or arrow keys move between places; Enter opens one. With the map focused, arrow keys pan and + and − zoom.", C = 0, w = (e) => e.toLocaleString("en-US"), T = (e, t) => t === 1 && /s$/.test(e) ? e.slice(0, -1) : e, E = (e) => Number.isFinite(e.lat) && Number.isFinite(e.lng) && Math.abs(e.lat) <= 90 && Math.abs(e.lng) <= 180;
7
+ function D(e) {
8
+ let t = /^\s*(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s*$/.exec(e);
9
+ if (!t) return null;
10
+ let [n, r] = [Number(t[1]), Number(t[2])];
11
+ return Math.abs(n) <= 90 && Math.abs(r) <= 180 ? [n, r] : null;
12
+ }
13
+ function O(e) {
14
+ let t = e.documentElement.getAttribute("data-uva-color-scheme");
15
+ if (t === null) return !1;
16
+ try {
17
+ if (!e.defaultView?.CSS?.supports?.("color", "light-dark(#000, #fff)")) return !1;
18
+ } catch {
19
+ return !1;
20
+ }
21
+ return t === "dark" || t !== "light" && !!e.defaultView?.matchMedia?.("(prefers-color-scheme: dark)").matches;
22
+ }
23
+ var k = (e) => `
24
+ ${e} { display: block; position: relative; max-width: 100%; min-width: 0; box-sizing: border-box; }
25
+ ${e}[hidden], ${e} [hidden] { display: none !important; }
26
+ ${e} .visually-hidden {
27
+ position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px; padding: 0;
28
+ overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
29
+ }
30
+ ${e} .skip-link { position: absolute; inset-inline-start: 0; inset-block-start: 0; z-index: 1100; transform: translateY(-120%); }
31
+ ${e} .skip-link:focus-visible { transform: translateY(0); }
32
+ ${e} .map { position: relative; block-size: ${x}; min-block-size: 12rem; box-sizing: border-box; }
33
+ ${e} .leaflet-pane, ${e} .leaflet-tile, ${e} .leaflet-marker-icon, ${e} .leaflet-marker-shadow,
34
+ ${e} .leaflet-tile-container, ${e} .leaflet-pane > svg, ${e} .leaflet-pane > canvas,
35
+ ${e} .leaflet-zoom-box, ${e} .leaflet-image-layer, ${e} .leaflet-layer {
36
+ position: absolute; left: 0; top: 0;
37
+ }
38
+ ${e} .leaflet-container { overflow: hidden; -webkit-tap-highlight-color: transparent; }
39
+ ${e} .leaflet-tile, ${e} .leaflet-marker-icon { user-select: none; -webkit-user-drag: none; }
40
+ ${e} .leaflet-marker-icon { display: block; }
41
+ ${e} .leaflet-container .leaflet-tile-pane img, ${e} .leaflet-container .leaflet-tile {
42
+ max-width: none !important; max-height: none !important; width: auto; padding: 0;
43
+ }
44
+ ${e} .leaflet-container.leaflet-touch-zoom { touch-action: pan-x pan-y; }
45
+ ${e} .leaflet-container.leaflet-touch-drag { touch-action: pinch-zoom; }
46
+ ${e} .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { touch-action: none; }
47
+ ${e} .leaflet-tile { filter: inherit; visibility: hidden; }
48
+ ${e} .leaflet-tile-loaded { visibility: inherit; }
49
+ ${e} .leaflet-zoom-box { width: 0; height: 0; box-sizing: border-box; z-index: 800; }
50
+ ${e} .leaflet-pane { z-index: 400; }
51
+ ${e} .leaflet-tile-pane { z-index: 200; }
52
+ ${e} .leaflet-overlay-pane { z-index: 400; }
53
+ ${e} .leaflet-shadow-pane { z-index: 500; }
54
+ ${e} .leaflet-marker-pane { z-index: 600; }
55
+ ${e} .leaflet-tooltip-pane { z-index: 650; }
56
+ ${e} .leaflet-popup-pane { z-index: 700; }
57
+ ${e} .leaflet-control { position: relative; z-index: 800; pointer-events: auto; float: left; clear: both; }
58
+ ${e} .leaflet-top, ${e} .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
59
+ ${e} .leaflet-top { top: 0; }
60
+ ${e} .leaflet-right { right: 0; }
61
+ ${e} .leaflet-bottom { bottom: 0; }
62
+ ${e} .leaflet-left { left: 0; }
63
+ ${e} .leaflet-right .leaflet-control { float: right; }
64
+ ${e} .leaflet-top .leaflet-control { margin-top: 10px; }
65
+ ${e} .leaflet-bottom .leaflet-control { margin-bottom: 10px; }
66
+ ${e} .leaflet-left .leaflet-control { margin-left: 10px; }
67
+ ${e} .leaflet-right .leaflet-control { margin-right: 10px; }
68
+ ${e} .leaflet-control-attribution { margin: 0 !important; }
69
+ ${e} .leaflet-zoom-animated { transform-origin: 0 0; }
70
+ ${e} .leaflet-zoom-anim .leaflet-zoom-animated { transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1); }
71
+ ${e} .leaflet-zoom-anim .leaflet-tile, ${e} .leaflet-pan-anim .leaflet-tile { transition: none; }
72
+ ${e} .leaflet-zoom-anim .leaflet-zoom-hide { visibility: hidden; }
73
+ ${e} .leaflet-interactive { cursor: pointer; }
74
+ ${e} .leaflet-grab { cursor: grab; }
75
+ ${e} .leaflet-dragging .leaflet-grab, ${e} .leaflet-dragging .leaflet-grab .leaflet-interactive { cursor: grabbing; }
76
+ ${e} .leaflet-marker-icon, ${e} .leaflet-tile-container { pointer-events: none; }
77
+ ${e} .leaflet-marker-icon.leaflet-interactive { pointer-events: auto; }
78
+ ${e} .leaflet-tooltip { position: absolute; pointer-events: none; white-space: nowrap; user-select: none; }
79
+ ${e} .uvalib-map-marker .marker {
80
+ box-sizing: border-box; display: flex; align-items: center; justify-content: center;
81
+ inline-size: 100%; block-size: 100%; margin: 0; padding: 0; border: 0; background: none;
82
+ cursor: pointer; font: inherit; color: inherit;
83
+ }
84
+ ${e} .uvalib-map-marker .dot { box-sizing: border-box; display: block; flex: none; inline-size: var(--d); block-size: var(--d); border-radius: 50%; }
85
+ ${e} .leaflet-bar a {
86
+ box-sizing: border-box; display: flex !important; align-items: center; justify-content: center;
87
+ inline-size: 44px !important; block-size: 44px !important; line-height: 1 !important;
88
+ }
89
+ @media (prefers-reduced-motion: reduce) {
90
+ ${e} .leaflet-zoom-anim .leaflet-zoom-animated { transition: none; }
91
+ }
92
+ @media (forced-colors: active) {
93
+ ${e} .uvalib-map-marker .dot {
94
+ forced-color-adjust: none; background: Canvas !important; border: 3px solid CanvasText !important; box-shadow: none !important;
95
+ }
96
+ ${e} .uvalib-map-marker.is-active .dot { outline: 3px solid Highlight; outline-offset: 3px; }
97
+ ${e} .uvalib-map-marker .marker:focus-visible .dot { outline: 3px solid Highlight; outline-offset: 6px; }
98
+ ${e} .map, ${e} .map .leaflet-bar, ${e} .map .leaflet-bar a, ${e} .map .leaflet-tooltip,
99
+ ${e} .map .leaflet-control-attribution, ${e} .place {
100
+ border: 1px solid CanvasText !important;
101
+ }
102
+ ${e} .place.is-active { outline: 3px solid Highlight; outline-offset: 1px; }
103
+ ${e} :is(.map, .leaflet-bar a, a, .skip-link):focus-visible { outline: 3px solid Highlight; outline-offset: 2px; }
104
+ }
105
+ `, A = o(k(":host")), j = class extends c {
106
+ static {
107
+ this.styles = [
108
+ p,
109
+ A,
110
+ o("\n :host { font-family: var(--uva-font-family, inherit); color: var(--uva-color-text, #2b2b2b); }\n .instructions {\n margin: 0 0 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--uva-color-text-muted, #4b5563);\n }\n .map {\n border: 1px solid var(--uva-color-control-border, #808080);\n border-radius: 4px;\n background: var(--uva-color-track, #e5e7eb) !important;\n font-family: inherit !important;\n font-size: 1rem !important;\n line-height: 1.5 !important;\n }\n .map:focus-visible {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: 2px;\n }\n .dark-tiles .leaflet-tile-pane {\n filter: var(--uvalib-map-dark-filter, invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9));\n }\n .uvalib-map-marker .dot {\n background: var(--uva-color-accent-bg, var(--uva-brand-blue, #232d4b));\n border: 2px solid var(--uva-color-on-accent, #fff);\n box-shadow: 0 0 0 1px var(--uva-color-accent-bg, var(--uva-brand-blue, #232d4b));\n transition: transform 0.15s ease, box-shadow 0.15s ease;\n }\n .uvalib-map-marker.is-active .dot {\n transform: scale(1.25);\n box-shadow:\n 0 0 0 3px var(--uva-color-surface, #fff),\n 0 0 0 6px var(--uva-color-text, #2b2b2b);\n }\n .uvalib-map-marker .marker:focus-visible { outline: none; }\n .uvalib-map-marker .marker:focus-visible .dot {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: 6px;\n }\n .leaflet-bar {\n border: 1px solid var(--uva-color-control-border, #808080) !important;\n border-radius: 4px !important;\n background: var(--uva-color-surface-raised, #fff) !important;\n box-shadow: 0 1px 4px var(--uva-color-shadow, rgba(0, 0, 0, 0.2)) !important;\n }\n .leaflet-bar a {\n border: 0 !important;\n border-radius: 0 !important;\n background: var(--uva-color-surface-raised, #fff) !important;\n color: var(--uva-color-text, #2b2b2b) !important;\n font: 600 1.5rem/1 var(--uva-font-family, system-ui, sans-serif) !important;\n text-decoration: none !important;\n }\n .leaflet-bar a:first-child { border-radius: 3px 3px 0 0 !important; }\n .leaflet-bar a:last-child { border-radius: 0 0 3px 3px !important; }\n .leaflet-bar a + a { border-block-start: 1px solid var(--uva-color-control-border, #808080) !important; }\n .leaflet-bar a:hover { background: var(--uva-color-surface-hover, #dadada) !important; }\n .leaflet-bar a.leaflet-disabled {\n background: var(--uva-color-track, #e5e7eb) !important;\n color: var(--uva-color-text-muted, #4b5563) !important;\n cursor: not-allowed;\n }\n .leaflet-bar a:focus-visible { position: relative; z-index: 1; }\n .leaflet-control-attribution {\n padding: 0.125rem 0.375rem !important;\n background: var(--uva-color-surface, #fff) !important;\n color: var(--uva-color-text, #2b2b2b) !important;\n font-size: 0.8125rem !important;\n line-height: 1.5 !important;\n }\n .leaflet-control-attribution a {\n color: var(--uva-color-link, var(--uva-brand-blue, #232d4b)) !important;\n text-decoration: underline !important;\n }\n .leaflet-tooltip {\n padding: 0.25rem 0.5rem !important;\n border: 1px solid var(--uva-color-control-border, #808080) !important;\n border-radius: 4px !important;\n background: var(--uva-color-surface-raised, #fff) !important;\n color: var(--uva-color-text, #2b2b2b) !important;\n box-shadow: 0 1px 4px var(--uva-color-shadow, rgba(0, 0, 0, 0.2)) !important;\n font-size: 0.875rem !important;\n line-height: 1.4 !important;\n }\n .leaflet-tooltip::before { display: none !important; }\n .tip-name { display: block; font-weight: 600; }\n .places {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));\n gap: 0.5rem;\n margin: 1rem 0 0;\n padding: 0;\n list-style: none;\n }\n .places:focus { outline: none; }\n .places:focus-visible {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: 2px;\n }\n .place {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n gap: 0.25rem 0.5rem;\n padding: 0.5rem 0.75rem;\n border: 1px solid var(--uva-color-control-border, #808080);\n border-radius: 4px;\n background: var(--uva-color-surface-raised, #fff);\n color: var(--uva-color-text, #2b2b2b);\n }\n .place.is-active {\n outline: 3px solid var(--uva-color-text, #2b2b2b);\n outline-offset: 1px;\n }\n .place a, .place .name {\n display: inline-block;\n min-block-size: 24px;\n font-weight: 600;\n line-height: 1.5;\n }\n .place a { color: var(--uva-color-link, var(--uva-brand-blue, #232d4b)); text-decoration: underline; }\n .count {\n padding: 0 0.5rem;\n border: 1px solid var(--uva-color-control-border, #808080);\n border-radius: 999px;\n background: var(--uva-color-track, #e5e7eb);\n color: var(--uva-color-text, #2b2b2b);\n font-size: 0.875rem;\n white-space: nowrap;\n }\n .description {\n flex-basis: 100%;\n font-size: 0.875rem;\n color: var(--uva-color-text-muted, #4b5563);\n }\n @media (prefers-reduced-motion: reduce) {\n .uvalib-map-marker .dot { transition: none; }\n }\n ")
111
+ ];
112
+ }
113
+ constructor() {
114
+ super(), this.items = [], this.label = "", this.countLabel = "items", this.tileUrl = h, this.darkTileUrl = "", this.attribution = g, this.center = "", this.sourceItems = [], this.hasLeaflet = !1, this.active = -1, this.dark = !1, this.uid = `uvalib-map-${++C}`, this.sourceKey = "[]", this.markers = [], this.drawn = [], this.reduceMotion = !1, this.userMoved = !1, this.fitting = !1, this.hoverIndex = -1, this.focusIndex = -1, this.dismissed = !1, this.warnedLabel = !1, this.warnedLeaflet = !1, this.onPageLoad = () => this.requestUpdate(), this.readScheme = () => {
115
+ this.dark = O(this.ownerDocument);
116
+ }, this.onMapClick = (e) => {
117
+ if (e.target.closest?.(".leaflet-control-zoom a")) {
118
+ this.queueZoomReport();
119
+ return;
120
+ }
121
+ let t = this.indexOf(e), n = this.places[t];
122
+ if (t < 0 || !n) return;
123
+ let r = this.map?.dragging;
124
+ e.detail !== 0 && r?.moved?.() ? e.preventDefault() : (l(this, [
125
+ m,
126
+ "select",
127
+ this.label,
128
+ t + 1
129
+ ]), this.dispatchEvent(new CustomEvent("select", {
130
+ detail: { item: n },
131
+ bubbles: !0,
132
+ composed: !0,
133
+ cancelable: !0
134
+ })) || e.preventDefault());
135
+ }, this.onMapKeydown = (e) => {
136
+ let t = e.target;
137
+ if (e.key === " " && t.closest?.(".leaflet-control-zoom a")) {
138
+ e.preventDefault(), t.closest("a").click();
139
+ return;
140
+ }
141
+ let n = this.indexOf(e);
142
+ if (n < 0) return;
143
+ let r = this.markers.flatMap((e, t) => e ? [t] : []), i = r.indexOf(n), a = -1;
144
+ if (e.key === "ArrowRight" || e.key === "ArrowDown") a = r[i + 1] ?? -1;
145
+ else if (e.key === "ArrowLeft" || e.key === "ArrowUp") a = r[i - 1] ?? -1;
146
+ else if (e.key === "Home") a = r[0] ?? -1;
147
+ else if (e.key === "End") a = r[r.length - 1] ?? -1;
148
+ else if (e.key === " " && t.localName === "a") {
149
+ e.preventDefault(), t.click();
150
+ return;
151
+ } else return;
152
+ e.preventDefault(), e.stopPropagation(), a >= 0 && (this.reveal(a), this.markerEl(a)?.querySelector(".marker")?.focus());
153
+ }, this.onMapFocusIn = (e) => {
154
+ let t = this.indexOf(e);
155
+ t < 0 || (this.focusIndex = t, this.dismissed = !1, this.reveal(t), this.syncActive());
156
+ }, this.onMapFocusOut = (e) => {
157
+ this.indexOf(e) < 0 || e.relatedTarget?.closest?.(".marker") || (this.focusIndex = -1, this.syncActive());
158
+ }, this.onMapLeave = () => {
159
+ this.hoverIndex = -1, this.syncActive();
160
+ }, this.skipToList = (e) => {
161
+ e.preventDefault(), this.renderRoot.querySelector(`#${this.uid}-list`)?.focus();
162
+ }, new f(this, () => this.lightDom, (e) => this.readList(e)), this.addEventListener("keydown", (e) => {
163
+ e.key === "Escape" && this.active >= 0 && (this.dismissed = !0, this.syncActive());
164
+ });
165
+ }
166
+ createRenderRoot() {
167
+ let e = super.createRenderRoot();
168
+ if (e instanceof ShadowRoot && this.noStyle) {
169
+ let t = A.styleSheet;
170
+ t && (e.adoptedStyleSheets = [t]);
171
+ }
172
+ return e;
173
+ }
174
+ connectedCallback() {
175
+ if (super.connectedCallback(), this.lightDom && this.noStyle) {
176
+ let e = this.getRootNode();
177
+ s(`${this.localName}::structure`, o(k(this.localName)), {
178
+ root: e instanceof ShadowRoot || e instanceof Document ? e : void 0,
179
+ scope: !1
180
+ });
181
+ }
182
+ let e = this.ownerDocument;
183
+ this.schemeObserver = new MutationObserver(() => this.readScheme()), this.schemeObserver.observe(e.documentElement, {
184
+ attributes: !0,
185
+ attributeFilter: ["data-uva-color-scheme"]
186
+ }), this.darkQuery = e.defaultView?.matchMedia?.("(prefers-color-scheme: dark)"), this.darkQuery?.addEventListener("change", this.readScheme), this.readScheme(), e.readyState !== "complete" && e.defaultView?.addEventListener("load", this.onPageLoad, { once: !0 }), this.hasUpdated && this.requestUpdate();
187
+ }
188
+ disconnectedCallback() {
189
+ super.disconnectedCallback(), this.ownerDocument.defaultView?.removeEventListener("load", this.onPageLoad), this.schemeObserver?.disconnect(), this.darkQuery?.removeEventListener("change", this.readScheme), this.teardown();
190
+ }
191
+ get places() {
192
+ return this.items?.length ? this.items : this.sourceItems;
193
+ }
194
+ readList(e) {
195
+ let t = e.find((e) => e instanceof Element && (e.localName === "ul" || e.localName === "ol")), n = [];
196
+ for (let e of t ? [...t.children] : []) {
197
+ if (e.localName !== "li") continue;
198
+ let t = e.matches("[data-lat]") ? e : e.querySelector("[data-lat]");
199
+ if (!t) continue;
200
+ let r = e.querySelector("a[href]"), i = t.dataset, a = {
201
+ name: u((r ?? t).textContent),
202
+ lat: Number(i.lat),
203
+ lng: Number(i.lng)
204
+ }, o = i.id ?? (e.id || void 0);
205
+ o && (a.id = o), i.count !== void 0 && i.count.trim() !== "" && Number.isFinite(Number(i.count)) && (a.count = Number(i.count));
206
+ let s = r?.getAttribute("href");
207
+ s && (a.href = s);
208
+ let c = i.description ?? e.dataset.description;
209
+ c && (a.description = u(c)), n.push(a);
210
+ }
211
+ let r = JSON.stringify(n);
212
+ r !== this.sourceKey && (this.sourceKey = r, this.sourceItems = n);
213
+ }
214
+ findLeaflet() {
215
+ let e = (e) => !!e && typeof e.map == "function" && typeof e.divIcon == "function" && typeof e.tileLayer == "function", t = this.leaflet, n = this.ownerDocument.defaultView;
216
+ for (let r of [
217
+ t,
218
+ t?.default,
219
+ n?.L
220
+ ]) if (e(r)) return r;
221
+ }
222
+ willUpdate(e) {
223
+ let t = this.findLeaflet();
224
+ t !== this.L && (this.map && this.teardown(), this.L = t), this.hasLeaflet = !!t, e.has("label") && !this.label.trim() && !this.warnedLabel && (this.warnedLabel = !0, console.warn(`<${m}>: label is required; it names the map region and the list.`));
225
+ }
226
+ updated(e) {
227
+ if (super.updated(e), !this.L) {
228
+ !this.warnedLeaflet && this.ownerDocument.readyState === "complete" && (this.warnedLeaflet = !0, setTimeout(() => {
229
+ this.isConnected && !this.findLeaflet() && console.warn(`<${m}>: Leaflet was not found (set the leaflet property, or load leaflet.js for window.L); showing the list only.`);
230
+ }, 1e3));
231
+ return;
232
+ }
233
+ let t = this.setUpMap();
234
+ this.map && (!t && (e.has("tileUrl") || e.has("darkTileUrl") || e.has("attribution") || e.has("dark")) && this.drawTiles(), t || this.places !== this.drawn || e.has("countLabel") ? (this.drawMarkers(), (t || !this.userMoved) && this.fit()) : (e.has("center") || e.has("zoom")) && this.fit(), e.has("active") && this.showActive(e.get("active")));
235
+ }
236
+ get container() {
237
+ return this.renderRoot.querySelector(`#${this.uid}-map`);
238
+ }
239
+ setUpMap() {
240
+ let e = this.L, t = this.container;
241
+ if (!e || !t || this.map) return !1;
242
+ let n = this.ownerDocument.defaultView;
243
+ this.reduceMotion = !!n?.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
244
+ let r = !this.reduceMotion, i = e.map(t, {
245
+ zoomControl: !1,
246
+ attributionControl: !1,
247
+ scrollWheelZoom: !1,
248
+ zoomAnimation: r,
249
+ fadeAnimation: r,
250
+ markerZoomAnimation: r,
251
+ inertia: r,
252
+ keyboard: !0,
253
+ zoomSnap: .5
254
+ });
255
+ return this.map = i, e.control.zoom({ position: "topleft" }).addTo(i), e.control.attribution({
256
+ position: "bottomright",
257
+ prefix: "<a href=\"https://leafletjs.com\">Leaflet</a>"
258
+ }).addTo(i), this.tooltip = e.tooltip({
259
+ direction: "top",
260
+ opacity: 1,
261
+ className: "uvalib-map-tooltip"
262
+ }), i.on("movestart", () => {
263
+ this.fitting || (this.userMoved = !0);
264
+ }), this.drawTiles(), this.ro = new ResizeObserver(() => {
265
+ this.map && (this.map.invalidateSize({ animate: !1 }), this.userMoved || this.fit());
266
+ }), this.ro.observe(t), !0;
267
+ }
268
+ teardown() {
269
+ clearTimeout(this.zoomTimer), this.ro?.disconnect(), this.ro = void 0, this.map?.remove(), this.map = void 0, this.tiles = void 0, this.tooltip = void 0, this.markers = [], this.drawn = [], this.userMoved = !1;
270
+ }
271
+ drawTiles() {
272
+ let { L: e, map: t } = this;
273
+ if (!e || !t) return;
274
+ let n = this.dark && this.darkTileUrl ? this.darkTileUrl : this.tileUrl || "https://tile.openstreetmap.org/{z}/{x}/{y}.png";
275
+ this.tiles?.remove(), this.tiles = e.tileLayer(n, {
276
+ attribution: this.attribution,
277
+ maxZoom: 19
278
+ }).addTo(t);
279
+ }
280
+ dotSize(e, t) {
281
+ return !(t > 0) || e === void 0 || !(e > 0) ? v : Math.round(v + 32 * Math.sqrt(e / t));
282
+ }
283
+ placeName(e) {
284
+ return e.count === void 0 ? e.name : `${e.name}, ${this.countText(e.count)}`;
285
+ }
286
+ countText(e) {
287
+ return `${w(e)} ${T(this.countLabel || "items", e)}`;
288
+ }
289
+ href(e) {
290
+ return e.href && d(e.href, this.ownerDocument.baseURI) ? e.href : null;
291
+ }
292
+ drawMarkers() {
293
+ let { L: e, map: t } = this;
294
+ if (!e || !t) return;
295
+ for (let e of this.markers) e?.remove();
296
+ let n = this.places;
297
+ this.drawn = n;
298
+ let r = Math.max(0, ...n.map((e) => Number.isFinite(e.count) ? e.count : 0)), i = this.ownerDocument;
299
+ this.markers = n.map((n, a) => {
300
+ if (!E(n)) return;
301
+ let o = this.dotSize(n.count, r), s = Math.max(b, o), c = this.href(n), l = i.createElement(c ? "a" : "button");
302
+ l instanceof HTMLAnchorElement ? l.href = c : l.type = "button", l.className = "marker", l.dataset.index = String(a), l.style.setProperty("--d", `${o}px`);
303
+ let u = i.createElement("span");
304
+ u.className = "dot", u.setAttribute("aria-hidden", "true");
305
+ let d = i.createElement("span");
306
+ d.className = "visually-hidden", d.textContent = this.placeName(n), l.append(u, d);
307
+ let f = e.marker([n.lat, n.lng], {
308
+ icon: e.divIcon({
309
+ className: "uvalib-map-marker",
310
+ html: l,
311
+ iconSize: [s, s],
312
+ iconAnchor: [s / 2, s / 2]
313
+ }),
314
+ keyboard: !1,
315
+ zIndexOffset: (y - o) * 10
316
+ });
317
+ return f.on("mouseover", () => this.hover(a)), f.addTo(t);
318
+ }), this.hoverIndex = -1, this.focusIndex = -1, this.active !== -1 && (this.active = -1);
319
+ }
320
+ fit() {
321
+ let { L: e, map: t } = this;
322
+ if (!e || !t) return;
323
+ let n = this.places.filter(E).map((t) => e.latLng(t.lat, t.lng)), r = D(this.center), i = Number.isFinite(this.zoom) ? this.zoom : void 0;
324
+ this.fitting = !0;
325
+ try {
326
+ if (r) t.setView(r, i ?? 16, { animate: !1 });
327
+ else if (n.length === 1) t.setView(n[0], i ?? 16, { animate: !1 });
328
+ else if (n.length && i !== void 0) t.setView(e.latLngBounds(n).getCenter(), i, { animate: !1 });
329
+ else if (n.length) {
330
+ let r = e.latLngBounds(n);
331
+ t.fitBounds(r, {
332
+ padding: [32, 32],
333
+ maxZoom: 17,
334
+ animate: !1
335
+ }), this.underControls(n) && t.fitBounds(r, {
336
+ paddingTopLeft: [80, 40],
337
+ paddingBottomRight: [40, 40],
338
+ maxZoom: 17,
339
+ animate: !1
340
+ });
341
+ } else t.setView(_, 15, { animate: !1 });
342
+ } finally {
343
+ this.fitting = !1;
344
+ }
345
+ }
346
+ underControls(e) {
347
+ let t = this.map, n = t.getContainer().getBoundingClientRect(), r = [...t.getContainer().querySelectorAll(".leaflet-control-zoom, .leaflet-control-attribution")].map((e) => e.getBoundingClientRect());
348
+ return e.some((e) => {
349
+ let i = t.latLngToContainerPoint(e), [a, o] = [i.x + n.left, i.y + n.top];
350
+ return r.some((e) => e.width > 0 && a >= e.left - 12 && a <= e.right + 12 && o >= e.top - 12 && o <= e.bottom + 12);
351
+ });
352
+ }
353
+ markerEl(e) {
354
+ return this.markers[e]?.getElement();
355
+ }
356
+ hover(e) {
357
+ this.hoverIndex = e, this.dismissed = !1, this.syncActive();
358
+ }
359
+ syncActive() {
360
+ this.active = this.dismissed ? -1 : this.hoverIndex >= 0 ? this.hoverIndex : this.focusIndex;
361
+ }
362
+ showActive(e) {
363
+ let { map: t, tooltip: n } = this;
364
+ if (!t || !n) return;
365
+ if (e !== void 0 && e >= 0) {
366
+ this.markerEl(e)?.classList.remove("is-active");
367
+ let t = this.markerDot(e);
368
+ this.markers[e]?.setZIndexOffset((y - t) * 10);
369
+ }
370
+ let r = this.active, i = this.markers[r], a = this.places[r];
371
+ if (r < 0 || !i || !a) {
372
+ n.remove();
373
+ return;
374
+ }
375
+ this.markerEl(r)?.classList.add("is-active"), i.setZIndexOffset(1e4);
376
+ let o = this.ownerDocument.createElement("span"), s = this.ownerDocument.createElement("span");
377
+ s.className = "tip-name", s.textContent = a.name, o.append(s), a.count !== void 0 && o.append(this.countText(a.count));
378
+ let c = Math.max(b, this.markerDot(r));
379
+ n.options.offset = [0, -Math.round(c * .6)], n.setLatLng(i.getLatLng()).setContent(o), t.hasLayer(n) ? n.update() : n.addTo(t);
380
+ }
381
+ markerDot(e) {
382
+ let t = parseFloat(this.markerEl(e)?.querySelector(".marker")?.style.getPropertyValue("--d") ?? "");
383
+ return Number.isFinite(t) ? t : v;
384
+ }
385
+ reveal(e) {
386
+ let { map: t } = this, n = this.markers[e];
387
+ if (!t || !n) return;
388
+ let r = n.getLatLng();
389
+ t.getBounds().pad(-.15).contains(r) || t.panTo(r, { animate: !this.reduceMotion });
390
+ }
391
+ indexOf(e) {
392
+ let t = e.target?.closest?.(".marker");
393
+ return t ? Number(t.dataset.index) : -1;
394
+ }
395
+ queueZoomReport() {
396
+ clearTimeout(this.zoomTimer), this.zoomTimer = setTimeout(() => {
397
+ this.map && l(this, [
398
+ m,
399
+ "zoom",
400
+ this.label,
401
+ this.map.getZoom()
402
+ ]);
403
+ }, 1e3);
404
+ }
405
+ onPlaceEnter(e) {
406
+ this.hover(e);
407
+ }
408
+ onPlaceLeave() {
409
+ this.hoverIndex = -1, this.syncActive();
410
+ }
411
+ onPlaceFocusIn(e) {
412
+ this.focusIndex = e, this.dismissed = !1, this.reveal(e), this.syncActive();
413
+ }
414
+ onPlaceFocusOut(e) {
415
+ e.relatedTarget?.closest?.(".place") || (this.focusIndex = -1, this.syncActive());
416
+ }
417
+ render() {
418
+ let e = this.places, t = this.label.trim() || "Places", r = `${this.uid}-list`, i = this.hasLeaflet ? n`<a class="skip-link" href="#${r}" @click=${this.skipToList}
419
+ >Skip map, go to the list</a
420
+ >
421
+ <p class="instructions" part="instructions">${S}</p>
422
+ <div class=${this.dark && !this.darkTileUrl ? "frame dark-tiles" : "frame"}>
423
+ <div
424
+ id="${this.uid}-map"
425
+ class="map"
426
+ part="map"
427
+ role="region"
428
+ aria-label=${`${t}, map`}
429
+ @click=${{
430
+ handleEvent: this.onMapClick,
431
+ capture: !0
432
+ }}
433
+ @keydown=${this.onMapKeydown}
434
+ @focusin=${this.onMapFocusIn}
435
+ @focusout=${this.onMapFocusOut}
436
+ @mouseleave=${this.onMapLeave}
437
+ ></div>
438
+ </div>` : a;
439
+ return n`${i}
440
+ <ul class="places" part="list" id=${r} tabindex="-1" aria-label=${`${t}, list`}>
441
+ ${e.map((e, t) => {
442
+ let r = this.href(e);
443
+ return n`<li
444
+ class=${t === this.active ? "place is-active" : "place"}
445
+ part="place"
446
+ @mouseenter=${() => this.onPlaceEnter(t)}
447
+ @mouseleave=${() => this.onPlaceLeave()}
448
+ @focusin=${() => this.onPlaceFocusIn(t)}
449
+ @focusout=${(e) => this.onPlaceFocusOut(e)}
450
+ >
451
+ ${r ? n`<a href=${r}>${e.name}</a>` : n`<span class="name">${e.name}</span>`}
452
+ ${e.count !== void 0 && Number.isFinite(e.count) ? n`<span class="count">${this.countText(e.count)}</span>` : a}
453
+ ${e.description ? n`<span class="description">${e.description}</span>` : a}
454
+ </li>`;
455
+ })}
456
+ </ul>`;
457
+ }
458
+ };
459
+ // src/components/uvalib-map/uvalib-map.ts
460
+ i([e({ type: Array })], j.prototype, "items", void 0), i([e({ type: String })], j.prototype, "label", void 0), i([e({
461
+ type: String,
462
+ attribute: "count-label"
463
+ })], j.prototype, "countLabel", void 0), i([e({
464
+ type: String,
465
+ attribute: "tile-url"
466
+ })], j.prototype, "tileUrl", void 0), i([e({
467
+ type: String,
468
+ attribute: "dark-tile-url"
469
+ })], j.prototype, "darkTileUrl", void 0), i([e({ type: String })], j.prototype, "attribution", void 0), i([e({ type: String })], j.prototype, "center", void 0), i([e({ type: Number })], j.prototype, "zoom", void 0), i([e({ attribute: !1 })], j.prototype, "leaflet", void 0), i([t()], j.prototype, "sourceItems", void 0), i([t()], j.prototype, "hasLeaflet", void 0), i([t()], j.prototype, "active", void 0), i([t()], j.prototype, "dark", void 0), r("uvalib-map", j);
470
+
471
+ //# sourceMappingURL=uvalib-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uvalib-map.js","names":["unsafeCSS","nothing","_decorate","property","state","n","r$1","b","define","__decorate","A","r","installLightDomStyles","UvalibElement","trackEvent","normalize","safeHref","SourceChildren","accessible","TAG","OSM_TILE_URL","OSM_ATTRIBUTION","GROUNDS","MIN_DOT","MAX_DOT","HIT","MAP_HEIGHT","MAP_INSTRUCTIONS","instanceCounter","fmt","noun","unit","validPlace","p","parseCenter","m","s","lat","lng","pageIsDark","attr","doc","structuralRules","host","shadowStructure","UvalibMap","i","drag","order","j","at","next","nodes","root","sheet","node","list","out","li","src","a","d","item","id","href","description","key","isL","x","own","win","L","changed","created","el","still","map","url","max","count","places","hit","ctl","dot","name","marker","pts","center","zoom","bounds","box","rects","c","ll","y","tooltip","prev","content","size","label","listId"],"sources":["../src/components/uvalib-map/UvalibMap.ts","../src/components/uvalib-map/uvalib-map.ts"],"sourcesContent":["import { html, nothing, unsafeCSS, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n// Types only: Leaflet is the host page's (the `leaflet` property or `window.L`), never bundled.\nimport type * as Leaflet from 'leaflet';\nimport { trackEvent } from '../../base/analytics.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { normalize, safeHref, SourceChildren } from '../../base/source-children.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { accessible } from '../../styles/accessible.js';\n\n/** One place on the map, and in the list beside it. */\nexport interface MapItem {\n /** Your own key, passed back in `select`. */\n id?: string;\n /** The place's name: the list entry, the marker's accessible name and its tooltip. */\n name: string;\n lat: number;\n lng: number;\n /** A count (photos, items, …) that sizes the marker and is part of its name. */\n count?: number;\n /** The place's page: the list entry and the marker are links to it. */\n href?: string;\n /** A line under the name in the list. */\n description?: string;\n}\n\ntype LeafletNS = typeof Leaflet;\n\n/** The analytics category. */\nconst TAG = 'uvalib-map';\n\n/** OpenStreetMap's standard tiles: fine for low traffic only (see the README). */\nexport const OSM_TILE_URL = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';\nexport const OSM_ATTRIBUTION =\n '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors';\n\n/** Where the map opens with no places and no `center`: the Lawn. */\nconst GROUNDS: [number, number] = [38.0336, -78.5048];\n\n/** Marker dot diameters (px): the smallest and largest count. Every target is at least 44px. */\nconst MIN_DOT = 24;\nconst MAX_DOT = 56;\nconst HIT = 44;\n\nconst MAP_HEIGHT = 'var(--uvalib-map-height, min(24rem, 75vw))';\n\n/** Shown above the map, and kept in step with base.css's pre-upgrade placeholder. */\nexport const MAP_INSTRUCTIONS =\n 'Tab or arrow keys move between places; Enter opens one. With the map focused, arrow keys pan and + and − zoom.';\n\nlet instanceCounter = 0;\n\nconst fmt = (n: number) => n.toLocaleString('en-US');\n\n/** \"photos\" for most counts, \"photo\" for one. */\nconst noun = (unit: string, n: number) => (n === 1 && /s$/.test(unit) ? unit.slice(0, -1) : unit);\n\nconst validPlace = (p: MapItem) =>\n Number.isFinite(p.lat) &&\n Number.isFinite(p.lng) &&\n Math.abs(p.lat) <= 90 &&\n Math.abs(p.lng) <= 180;\n\n/** Parse `\"lat, lng\"`; null unless both are numbers in range. */\nfunction parseCenter(s: string): [number, number] | null {\n const m = /^\\s*(-?\\d+(?:\\.\\d+)?)\\s*,\\s*(-?\\d+(?:\\.\\d+)?)\\s*$/.exec(s);\n if (!m) return null;\n const [lat, lng] = [Number(m[1]), Number(m[2])];\n return Math.abs(lat) <= 90 && Math.abs(lng) <= 180 ? [lat, lng] : null;\n}\n\n/** Whether the page shows the opt-in dark mode (`data-uva-color-scheme` on the root element). */\nfunction pageIsDark(doc: Document): boolean {\n const attr = doc.documentElement.getAttribute('data-uva-color-scheme');\n if (attr === null) return false;\n try {\n if (!doc.defaultView?.CSS?.supports?.('color', 'light-dark(#000, #fff)')) return false;\n } catch {\n return false;\n }\n if (attr === 'dark') return true;\n if (attr === 'light') return false;\n return !!doc.defaultView?.matchMedia?.('(prefers-color-scheme: dark)').matches;\n}\n\n/**\n * Leaflet's own layout rules that the map needs (panes, tiles, controls, the tooltip), so\n * Leaflet's leaflet.css is optional and the map works inside the shadow root. Kept with\n * `no-style`, with the map's height, the 44px marker and zoom targets, the hidden marker\n * names and skip link, and forced-colors borders. `host` is `:host` or the tag. Sizes that\n * leaflet.css also sets are `!important`, so a page that loads it (light DOM) keeps them.\n */\nconst structuralRules = (host: string) => `\n ${host} { display: block; position: relative; max-width: 100%; min-width: 0; box-sizing: border-box; }\n ${host}[hidden], ${host} [hidden] { display: none !important; }\n ${host} .visually-hidden {\n position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px; padding: 0;\n overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;\n }\n ${host} .skip-link { position: absolute; inset-inline-start: 0; inset-block-start: 0; z-index: 1100; transform: translateY(-120%); }\n ${host} .skip-link:focus-visible { transform: translateY(0); }\n ${host} .map { position: relative; block-size: ${MAP_HEIGHT}; min-block-size: 12rem; box-sizing: border-box; }\n ${host} .leaflet-pane, ${host} .leaflet-tile, ${host} .leaflet-marker-icon, ${host} .leaflet-marker-shadow,\n ${host} .leaflet-tile-container, ${host} .leaflet-pane > svg, ${host} .leaflet-pane > canvas,\n ${host} .leaflet-zoom-box, ${host} .leaflet-image-layer, ${host} .leaflet-layer {\n position: absolute; left: 0; top: 0;\n }\n ${host} .leaflet-container { overflow: hidden; -webkit-tap-highlight-color: transparent; }\n ${host} .leaflet-tile, ${host} .leaflet-marker-icon { user-select: none; -webkit-user-drag: none; }\n ${host} .leaflet-marker-icon { display: block; }\n ${host} .leaflet-container .leaflet-tile-pane img, ${host} .leaflet-container .leaflet-tile {\n max-width: none !important; max-height: none !important; width: auto; padding: 0;\n }\n ${host} .leaflet-container.leaflet-touch-zoom { touch-action: pan-x pan-y; }\n ${host} .leaflet-container.leaflet-touch-drag { touch-action: pinch-zoom; }\n ${host} .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { touch-action: none; }\n ${host} .leaflet-tile { filter: inherit; visibility: hidden; }\n ${host} .leaflet-tile-loaded { visibility: inherit; }\n ${host} .leaflet-zoom-box { width: 0; height: 0; box-sizing: border-box; z-index: 800; }\n ${host} .leaflet-pane { z-index: 400; }\n ${host} .leaflet-tile-pane { z-index: 200; }\n ${host} .leaflet-overlay-pane { z-index: 400; }\n ${host} .leaflet-shadow-pane { z-index: 500; }\n ${host} .leaflet-marker-pane { z-index: 600; }\n ${host} .leaflet-tooltip-pane { z-index: 650; }\n ${host} .leaflet-popup-pane { z-index: 700; }\n ${host} .leaflet-control { position: relative; z-index: 800; pointer-events: auto; float: left; clear: both; }\n ${host} .leaflet-top, ${host} .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }\n ${host} .leaflet-top { top: 0; }\n ${host} .leaflet-right { right: 0; }\n ${host} .leaflet-bottom { bottom: 0; }\n ${host} .leaflet-left { left: 0; }\n ${host} .leaflet-right .leaflet-control { float: right; }\n ${host} .leaflet-top .leaflet-control { margin-top: 10px; }\n ${host} .leaflet-bottom .leaflet-control { margin-bottom: 10px; }\n ${host} .leaflet-left .leaflet-control { margin-left: 10px; }\n ${host} .leaflet-right .leaflet-control { margin-right: 10px; }\n ${host} .leaflet-control-attribution { margin: 0 !important; }\n ${host} .leaflet-zoom-animated { transform-origin: 0 0; }\n ${host} .leaflet-zoom-anim .leaflet-zoom-animated { transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1); }\n ${host} .leaflet-zoom-anim .leaflet-tile, ${host} .leaflet-pan-anim .leaflet-tile { transition: none; }\n ${host} .leaflet-zoom-anim .leaflet-zoom-hide { visibility: hidden; }\n ${host} .leaflet-interactive { cursor: pointer; }\n ${host} .leaflet-grab { cursor: grab; }\n ${host} .leaflet-dragging .leaflet-grab, ${host} .leaflet-dragging .leaflet-grab .leaflet-interactive { cursor: grabbing; }\n ${host} .leaflet-marker-icon, ${host} .leaflet-tile-container { pointer-events: none; }\n ${host} .leaflet-marker-icon.leaflet-interactive { pointer-events: auto; }\n ${host} .leaflet-tooltip { position: absolute; pointer-events: none; white-space: nowrap; user-select: none; }\n ${host} .uvalib-map-marker .marker {\n box-sizing: border-box; display: flex; align-items: center; justify-content: center;\n inline-size: 100%; block-size: 100%; margin: 0; padding: 0; border: 0; background: none;\n cursor: pointer; font: inherit; color: inherit;\n }\n ${host} .uvalib-map-marker .dot { box-sizing: border-box; display: block; flex: none; inline-size: var(--d); block-size: var(--d); border-radius: 50%; }\n ${host} .leaflet-bar a {\n box-sizing: border-box; display: flex !important; align-items: center; justify-content: center;\n inline-size: 44px !important; block-size: 44px !important; line-height: 1 !important;\n }\n @media (prefers-reduced-motion: reduce) {\n ${host} .leaflet-zoom-anim .leaflet-zoom-animated { transition: none; }\n }\n @media (forced-colors: active) {\n ${host} .uvalib-map-marker .dot {\n forced-color-adjust: none; background: Canvas !important; border: 3px solid CanvasText !important; box-shadow: none !important;\n }\n ${host} .uvalib-map-marker.is-active .dot { outline: 3px solid Highlight; outline-offset: 3px; }\n ${host} .uvalib-map-marker .marker:focus-visible .dot { outline: 3px solid Highlight; outline-offset: 6px; }\n ${host} .map, ${host} .map .leaflet-bar, ${host} .map .leaflet-bar a, ${host} .map .leaflet-tooltip,\n ${host} .map .leaflet-control-attribution, ${host} .place {\n border: 1px solid CanvasText !important;\n }\n ${host} .place.is-active { outline: 3px solid Highlight; outline-offset: 1px; }\n ${host} :is(.map, .leaflet-bar a, a, .skip-link):focus-visible { outline: 3px solid Highlight; outline-offset: 2px; }\n }\n`;\nconst shadowStructure = unsafeCSS(structuralRules(':host'));\n\n/**\n * A map of places with a linked list of the same places: buildings, rooms or outdoor spaces,\n * each a marker sized by a count, with a link to the place's page. It wraps\n * [Leaflet](https://leafletjs.com) 1.9, which the page provides (the library never bundles\n * it): set the `leaflet` property to the Leaflet module (`import * as L from 'leaflet'`), or\n * load leaflet.js so that `window.L` exists. Without Leaflet only the list is shown, with\n * one console warning. Leaflet's leaflet.css is optional: the element carries the layout\n * rules it needs, in shadow DOM and light DOM alike.\n *\n * Places come from `items` (`{ id?, name, lat, lng, count?, href?, description? }`) or from\n * a child `<ul>`/`<ol>` of `<li><a href data-lat data-lng data-count>Name</a></li>`, which is\n * the list before the script runs (and without it). The list always stays, under the map:\n * it is the text equivalent.\n *\n * Each marker is a real link (a button when the place has no `href`) named like \"The\n * Rotunda, 2,702 photos\" (`count-label` is the noun), sized by the square root of its count\n * (a 24 to 56px dot in a hit area of at least 44px). Tab or the arrow keys move between\n * markers, Enter follows the link (or chooses the place), and Escape hides the tooltip.\n * Hovering or focusing a marker shows a tooltip with its name and count and highlights its\n * list entry; hovering or focusing a list entry highlights its marker (a ring and a larger\n * dot, not colour alone) and brings it into view.\n *\n * The map is a region named by `label`, after a \"Skip map, go to the list\" link and a line\n * of key instructions. It opens on the bounds of the places, or on `center` and `zoom`. The\n * zoom buttons are 44px with a visible focus ring; the attribution stays. Tiles come from\n * `tile-url` (OpenStreetMap by default: low-traffic use only) with `attribution`. In the\n * page's dark mode the tiles are inverted with a CSS filter (`--uvalib-map-dark-filter`)\n * unless `dark-tile-url` gives dark tiles; markers and controls are never filtered. With\n * `prefers-reduced-motion` nothing animates.\n *\n * @tagname uvalib-map\n * @slot - A `<ul>` or `<ol>` of places: each `<li>` holds an `<a href>` (or the `<li>` itself) with `data-lat`, `data-lng` and optionally `data-count`, `data-id` and `data-description`. Used when `items` is empty; without JavaScript it is the list.\n * @fires select - A marker was chosen (click, Enter or Space). `detail` is `{ item }`. Cancelable: for a place with `href`, `preventDefault()` keeps the page from following the link. Bubbles and is composed.\n * @fires uvalib-analytics-event - For `<site-analytics>`: `['uvalib-map', 'select', '<label>', <position from 1>]` when a marker is chosen, and `['uvalib-map', 'zoom', '<label>', <zoom level>]` 1 s after the last zoom-button press. Never a place's name, coordinates or URL. Bubbles and is composed.\n * @csspart map - The map region (the Leaflet container).\n * @csspart instructions - The line of key instructions above the map.\n * @csspart list - The list of places.\n * @csspart place - Each list entry.\n * @cssprop [--uvalib-map-height=min(24rem, 75vw)] - Height of the map.\n * @cssprop [--uvalib-map-dark-filter=invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9)] - The filter on the tiles in dark mode, when there is no `dark-tile-url`.\n * @cssprop [--uva-brand-blue=#232d4b] - Marker fill.\n * @cssprop [--uva-brand-orange=#e57200] - Focus ring when `--uva-color-focus` is unset.\n * @cssprop [--uva-font-family=inherit] - Font family.\n * @cssprop --uva-color-accent-bg - Dark-mode role token: marker fill (else `--uva-brand-blue`).\n * @cssprop --uva-color-on-accent - Dark-mode role token: marker border (else #fff).\n * @cssprop --uva-color-text - Dark-mode role token: text and the highlight ring (else #2b2b2b).\n * @cssprop --uva-color-text-muted - Dark-mode role token: instructions and descriptions (else #4b5563).\n * @cssprop --uva-color-link - Dark-mode role token: links (else `--uva-brand-blue`).\n * @cssprop --uva-color-surface - Dark-mode role token: attribution background and the highlight ring's gap (else #fff).\n * @cssprop --uva-color-surface-raised - Dark-mode role token: zoom buttons, tooltip and list entries (else #fff).\n * @cssprop --uva-color-surface-hover - Dark-mode role token: hovered zoom button (else #dadada).\n * @cssprop --uva-color-track - Dark-mode role token: the map before tiles load, and count badges (else #e5e7eb).\n * @cssprop --uva-color-control-border - Dark-mode role token: borders (else #808080).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n * @cssprop --uva-color-shadow - Dark-mode role token: control and tooltip shadow.\n */\nexport class UvalibMap extends UvalibElement {\n static styles = [\n accessible,\n shadowStructure,\n unsafeCSS(`\n :host { font-family: var(--uva-font-family, inherit); color: var(--uva-color-text, #2b2b2b); }\n .instructions {\n margin: 0 0 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--uva-color-text-muted, #4b5563);\n }\n .map {\n border: 1px solid var(--uva-color-control-border, #808080);\n border-radius: 4px;\n background: var(--uva-color-track, #e5e7eb) !important;\n font-family: inherit !important;\n font-size: 1rem !important;\n line-height: 1.5 !important;\n }\n .map:focus-visible {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: 2px;\n }\n .dark-tiles .leaflet-tile-pane {\n filter: var(--uvalib-map-dark-filter, invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9));\n }\n .uvalib-map-marker .dot {\n background: var(--uva-color-accent-bg, var(--uva-brand-blue, #232d4b));\n border: 2px solid var(--uva-color-on-accent, #fff);\n box-shadow: 0 0 0 1px var(--uva-color-accent-bg, var(--uva-brand-blue, #232d4b));\n transition: transform 0.15s ease, box-shadow 0.15s ease;\n }\n .uvalib-map-marker.is-active .dot {\n transform: scale(1.25);\n box-shadow:\n 0 0 0 3px var(--uva-color-surface, #fff),\n 0 0 0 6px var(--uva-color-text, #2b2b2b);\n }\n .uvalib-map-marker .marker:focus-visible { outline: none; }\n .uvalib-map-marker .marker:focus-visible .dot {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: 6px;\n }\n .leaflet-bar {\n border: 1px solid var(--uva-color-control-border, #808080) !important;\n border-radius: 4px !important;\n background: var(--uva-color-surface-raised, #fff) !important;\n box-shadow: 0 1px 4px var(--uva-color-shadow, rgba(0, 0, 0, 0.2)) !important;\n }\n .leaflet-bar a {\n border: 0 !important;\n border-radius: 0 !important;\n background: var(--uva-color-surface-raised, #fff) !important;\n color: var(--uva-color-text, #2b2b2b) !important;\n font: 600 1.5rem/1 var(--uva-font-family, system-ui, sans-serif) !important;\n text-decoration: none !important;\n }\n .leaflet-bar a:first-child { border-radius: 3px 3px 0 0 !important; }\n .leaflet-bar a:last-child { border-radius: 0 0 3px 3px !important; }\n .leaflet-bar a + a { border-block-start: 1px solid var(--uva-color-control-border, #808080) !important; }\n .leaflet-bar a:hover { background: var(--uva-color-surface-hover, #dadada) !important; }\n .leaflet-bar a.leaflet-disabled {\n background: var(--uva-color-track, #e5e7eb) !important;\n color: var(--uva-color-text-muted, #4b5563) !important;\n cursor: not-allowed;\n }\n .leaflet-bar a:focus-visible { position: relative; z-index: 1; }\n .leaflet-control-attribution {\n padding: 0.125rem 0.375rem !important;\n background: var(--uva-color-surface, #fff) !important;\n color: var(--uva-color-text, #2b2b2b) !important;\n font-size: 0.8125rem !important;\n line-height: 1.5 !important;\n }\n .leaflet-control-attribution a {\n color: var(--uva-color-link, var(--uva-brand-blue, #232d4b)) !important;\n text-decoration: underline !important;\n }\n .leaflet-tooltip {\n padding: 0.25rem 0.5rem !important;\n border: 1px solid var(--uva-color-control-border, #808080) !important;\n border-radius: 4px !important;\n background: var(--uva-color-surface-raised, #fff) !important;\n color: var(--uva-color-text, #2b2b2b) !important;\n box-shadow: 0 1px 4px var(--uva-color-shadow, rgba(0, 0, 0, 0.2)) !important;\n font-size: 0.875rem !important;\n line-height: 1.4 !important;\n }\n .leaflet-tooltip::before { display: none !important; }\n .tip-name { display: block; font-weight: 600; }\n .places {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));\n gap: 0.5rem;\n margin: 1rem 0 0;\n padding: 0;\n list-style: none;\n }\n .places:focus { outline: none; }\n .places:focus-visible {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: 2px;\n }\n .place {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n gap: 0.25rem 0.5rem;\n padding: 0.5rem 0.75rem;\n border: 1px solid var(--uva-color-control-border, #808080);\n border-radius: 4px;\n background: var(--uva-color-surface-raised, #fff);\n color: var(--uva-color-text, #2b2b2b);\n }\n .place.is-active {\n outline: 3px solid var(--uva-color-text, #2b2b2b);\n outline-offset: 1px;\n }\n .place a, .place .name {\n display: inline-block;\n min-block-size: 24px;\n font-weight: 600;\n line-height: 1.5;\n }\n .place a { color: var(--uva-color-link, var(--uva-brand-blue, #232d4b)); text-decoration: underline; }\n .count {\n padding: 0 0.5rem;\n border: 1px solid var(--uva-color-control-border, #808080);\n border-radius: 999px;\n background: var(--uva-color-track, #e5e7eb);\n color: var(--uva-color-text, #2b2b2b);\n font-size: 0.875rem;\n white-space: nowrap;\n }\n .description {\n flex-basis: 100%;\n font-size: 0.875rem;\n color: var(--uva-color-text-muted, #4b5563);\n }\n @media (prefers-reduced-motion: reduce) {\n .uvalib-map-marker .dot { transition: none; }\n }\n `),\n ];\n\n /** The places. When non-empty, wins over the child list. Set a new array to update. */\n @property({ type: Array })\n items: MapItem[] = [];\n\n /** The map's name (required): the region's label, the list's label and the analytics name. */\n @property({ type: String })\n label = '';\n\n /** The noun after each count, plural (\"photos\"); a count of one drops a trailing s. */\n @property({ type: String, attribute: 'count-label' })\n countLabel = 'items';\n\n /** The tile URL template (`{z}/{x}/{y}`, optionally `{s}` and `{r}`). */\n @property({ type: String, attribute: 'tile-url' })\n tileUrl = OSM_TILE_URL;\n\n /** Tiles for the page's dark mode. Without it, dark mode filters the light tiles instead. */\n @property({ type: String, attribute: 'dark-tile-url' })\n darkTileUrl = '';\n\n /** The tiles' attribution, as HTML. Required by most tile sources; always shown. */\n @property({ type: String })\n attribution = OSM_ATTRIBUTION;\n\n /** Where the map opens, `\"lat,lng\"`. Without it the map fits every place. */\n @property({ type: String })\n center = '';\n\n /** The opening zoom level (with `center`, or centred on the places). */\n @property({ type: Number })\n zoom?: number;\n\n /**\n * The Leaflet module (`import * as L from 'leaflet'; map.leaflet = L`). Without it\n * `window.L` is used (leaflet.js from a script tag).\n */\n @property({ attribute: false })\n leaflet?: unknown;\n\n @state() private sourceItems: MapItem[] = [];\n @state() private hasLeaflet = false;\n @state() private active = -1;\n @state() private dark = false;\n\n private readonly uid = `uvalib-map-${++instanceCounter}`;\n private sourceKey = '[]';\n private L?: LeafletNS;\n private map?: Leaflet.Map;\n private tiles?: Leaflet.TileLayer;\n private tooltip?: Leaflet.Tooltip;\n private markers: (Leaflet.Marker | undefined)[] = [];\n private drawn: MapItem[] = [];\n private reduceMotion = false;\n /** The visitor moved the map: a resize no longer refits it. */\n private userMoved = false;\n private fitting = false;\n private hoverIndex = -1;\n private focusIndex = -1;\n private dismissed = false;\n private warnedLabel = false;\n private warnedLeaflet = false;\n private zoomTimer?: ReturnType<typeof setTimeout>;\n private ro?: ResizeObserver;\n private schemeObserver?: MutationObserver;\n private darkQuery?: MediaQueryList;\n\n constructor() {\n super();\n new SourceChildren(\n this,\n () => this.lightDom,\n (nodes) => this.readList(nodes),\n );\n this.addEventListener('keydown', (e) => {\n if (e.key === 'Escape' && this.active >= 0) {\n this.dismissed = true;\n this.syncActive();\n }\n });\n }\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const root = super.createRenderRoot();\n if (root instanceof ShadowRoot && this.noStyle) {\n const sheet = shadowStructure.styleSheet;\n if (sheet) root.adoptedStyleSheets = [sheet];\n }\n return root;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (this.lightDom && this.noStyle) {\n const node = this.getRootNode();\n installLightDomStyles(\n `${this.localName}::structure`,\n unsafeCSS(structuralRules(this.localName)),\n {\n root: node instanceof ShadowRoot || node instanceof Document ? node : undefined,\n scope: false,\n },\n );\n }\n const doc = this.ownerDocument;\n this.schemeObserver = new MutationObserver(() => this.readScheme());\n this.schemeObserver.observe(doc.documentElement, {\n attributes: true,\n attributeFilter: ['data-uva-color-scheme'],\n });\n this.darkQuery = doc.defaultView?.matchMedia?.('(prefers-color-scheme: dark)');\n this.darkQuery?.addEventListener('change', this.readScheme);\n this.readScheme();\n // leaflet.js loaded with async (or after this script): look again once the page has loaded.\n if (doc.readyState !== 'complete')\n doc.defaultView?.addEventListener('load', this.onPageLoad, { once: true });\n if (this.hasUpdated) this.requestUpdate();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.ownerDocument.defaultView?.removeEventListener('load', this.onPageLoad);\n this.schemeObserver?.disconnect();\n this.darkQuery?.removeEventListener('change', this.readScheme);\n this.teardown();\n }\n\n private onPageLoad = () => this.requestUpdate();\n\n private readScheme = () => {\n this.dark = pageIsDark(this.ownerDocument);\n };\n\n /** The places shown: `items`, else the child list. */\n private get places(): MapItem[] {\n return this.items?.length ? this.items : this.sourceItems;\n }\n\n /** The child list's places, compared with the last read so only a real change re-renders. */\n private readList(nodes: Node[]): void {\n const list = nodes.find(\n (n): n is HTMLElement =>\n n instanceof Element && (n.localName === 'ul' || n.localName === 'ol'),\n );\n const out: MapItem[] = [];\n for (const li of list ? [...list.children] : []) {\n if (li.localName !== 'li') continue;\n const src = (li.matches('[data-lat]') ? li : li.querySelector('[data-lat]')) as HTMLElement;\n if (!src) continue;\n const a = li.querySelector('a[href]');\n const d = src.dataset;\n const item: MapItem = {\n name: normalize((a ?? src).textContent),\n lat: Number(d.lat),\n lng: Number(d.lng),\n };\n const id = d.id ?? (li.id || undefined);\n if (id) item.id = id;\n if (d.count !== undefined && d.count.trim() !== '' && Number.isFinite(Number(d.count)))\n item.count = Number(d.count);\n const href = a?.getAttribute('href');\n if (href) item.href = href;\n const description = d.description ?? (li as HTMLElement).dataset.description;\n if (description) item.description = normalize(description);\n out.push(item);\n }\n const key = JSON.stringify(out);\n if (key === this.sourceKey) return;\n this.sourceKey = key;\n this.sourceItems = out;\n }\n\n /** The page's Leaflet: the `leaflet` property (a module namespace or its default), or `window.L`. */\n private findLeaflet(): LeafletNS | undefined {\n const isL = (x: unknown): x is LeafletNS =>\n !!x &&\n typeof (x as LeafletNS).map === 'function' &&\n typeof (x as LeafletNS).divIcon === 'function' &&\n typeof (x as LeafletNS).tileLayer === 'function';\n const own = this.leaflet as { default?: unknown } | undefined;\n const win = this.ownerDocument.defaultView as (Window & { L?: unknown }) | null;\n for (const x of [own, own?.default, win?.L]) if (isL(x)) return x;\n return undefined;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n const L = this.findLeaflet();\n if (L !== this.L) {\n if (this.map) this.teardown();\n this.L = L;\n }\n this.hasLeaflet = !!L;\n if (changed.has('label') && !this.label.trim() && !this.warnedLabel) {\n this.warnedLabel = true;\n console.warn(`<${TAG}>: label is required; it names the map region and the list.`);\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n if (!this.L) {\n // A page script may set `leaflet` just after this renders: warn only if it is still\n // missing a second after the page has loaded.\n if (!this.warnedLeaflet && this.ownerDocument.readyState === 'complete') {\n this.warnedLeaflet = true;\n setTimeout(() => {\n if (this.isConnected && !this.findLeaflet())\n console.warn(\n `<${TAG}>: Leaflet was not found (set the leaflet property, or load leaflet.js for window.L); showing the list only.`,\n );\n }, 1000);\n }\n return;\n }\n const created = this.setUpMap();\n const map = this.map;\n if (!map) return;\n if (\n !created &&\n (changed.has('tileUrl') ||\n changed.has('darkTileUrl') ||\n changed.has('attribution') ||\n changed.has('dark'))\n )\n this.drawTiles();\n if (created || this.places !== this.drawn || changed.has('countLabel')) {\n this.drawMarkers();\n if (created || !this.userMoved) this.fit();\n } else if (changed.has('center') || changed.has('zoom')) {\n this.fit();\n }\n if (changed.has('active')) this.showActive(changed.get('active') as number | undefined);\n }\n\n private get container(): HTMLElement | null {\n return this.renderRoot.querySelector<HTMLElement>(`#${this.uid}-map`);\n }\n\n /** Create the Leaflet map once its container is rendered. True when it was created now. */\n private setUpMap(): boolean {\n const L = this.L;\n const el = this.container;\n if (!L || !el || this.map) return false;\n const win = this.ownerDocument.defaultView;\n this.reduceMotion = !!win?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n const still = !this.reduceMotion;\n const map = L.map(el, {\n zoomControl: false,\n attributionControl: false,\n scrollWheelZoom: false,\n zoomAnimation: still,\n fadeAnimation: still,\n markerZoomAnimation: still,\n inertia: still,\n keyboard: true,\n // Half steps, so the opening view fits the places as closely as it can.\n zoomSnap: 0.5,\n });\n this.map = map;\n L.control.zoom({ position: 'topleft' }).addTo(map);\n L.control\n .attribution({\n position: 'bottomright',\n prefix: '<a href=\"https://leafletjs.com\">Leaflet</a>',\n })\n .addTo(map);\n this.tooltip = L.tooltip({\n direction: 'top',\n opacity: 1,\n className: 'uvalib-map-tooltip',\n });\n map.on('movestart', () => {\n if (!this.fitting) this.userMoved = true;\n });\n this.drawTiles();\n this.ro = new ResizeObserver(() => {\n if (!this.map) return;\n this.map.invalidateSize({ animate: false });\n if (!this.userMoved) this.fit();\n });\n this.ro.observe(el);\n return true;\n }\n\n private teardown(): void {\n clearTimeout(this.zoomTimer);\n this.ro?.disconnect();\n this.ro = undefined;\n this.map?.remove();\n this.map = undefined;\n this.tiles = undefined;\n this.tooltip = undefined;\n this.markers = [];\n this.drawn = [];\n this.userMoved = false;\n }\n\n /** The tile layer for the current scheme: dark tiles when given, else the filtered light ones. */\n private drawTiles(): void {\n const { L, map } = this;\n if (!L || !map) return;\n const url = this.dark && this.darkTileUrl ? this.darkTileUrl : this.tileUrl || OSM_TILE_URL;\n this.tiles?.remove();\n this.tiles = L.tileLayer(url, { attribution: this.attribution, maxZoom: 19 }).addTo(map);\n }\n\n /** Marker dot diameter: the square root of the count, between MIN_DOT and MAX_DOT. */\n private dotSize(count: number | undefined, max: number): number {\n if (!(max > 0) || count === undefined || !(count > 0)) return MIN_DOT;\n return Math.round(MIN_DOT + (MAX_DOT - MIN_DOT) * Math.sqrt(count / max));\n }\n\n /** \"The Rotunda, 2,702 photos\", or the name alone without a count. */\n private placeName(p: MapItem): string {\n return p.count === undefined ? p.name : `${p.name}, ${this.countText(p.count)}`;\n }\n\n private countText(n: number): string {\n return `${fmt(n)} ${noun(this.countLabel || 'items', n)}`;\n }\n\n private href(p: MapItem): string | null {\n return p.href && safeHref(p.href, this.ownerDocument.baseURI) ? p.href : null;\n }\n\n private drawMarkers(): void {\n const { L, map } = this;\n if (!L || !map) return;\n for (const m of this.markers) m?.remove();\n const places = this.places;\n this.drawn = places;\n const max = Math.max(0, ...places.map((p) => (Number.isFinite(p.count) ? p.count! : 0)));\n const doc = this.ownerDocument;\n this.markers = places.map((p, i) => {\n if (!validPlace(p)) return undefined;\n const d = this.dotSize(p.count, max);\n const hit = Math.max(HIT, d);\n const href = this.href(p);\n const ctl = doc.createElement(href ? 'a' : 'button');\n if (ctl instanceof HTMLAnchorElement) ctl.href = href!;\n else (ctl as HTMLButtonElement).type = 'button';\n ctl.className = 'marker';\n ctl.dataset.index = String(i);\n ctl.style.setProperty('--d', `${d}px`);\n const dot = doc.createElement('span');\n dot.className = 'dot';\n dot.setAttribute('aria-hidden', 'true');\n const name = doc.createElement('span');\n name.className = 'visually-hidden';\n name.textContent = this.placeName(p);\n ctl.append(dot, name);\n const marker = L.marker([p.lat, p.lng], {\n icon: L.divIcon({\n className: 'uvalib-map-marker',\n html: ctl,\n iconSize: [hit, hit],\n iconAnchor: [hit / 2, hit / 2],\n }),\n keyboard: false,\n // Smaller dots above larger ones, so every one stays reachable by pointer.\n zIndexOffset: (MAX_DOT - d) * 10,\n });\n marker.on('mouseover', () => this.hover(i));\n return marker.addTo(map);\n });\n this.hoverIndex = -1;\n this.focusIndex = -1;\n if (this.active !== -1) this.active = -1;\n }\n\n /** Open on `center`/`zoom`, else on the places' bounds, else on Grounds. */\n private fit(): void {\n const { L, map } = this;\n if (!L || !map) return;\n const pts = this.places.filter(validPlace).map((p) => L.latLng(p.lat, p.lng));\n const center = parseCenter(this.center);\n const zoom = Number.isFinite(this.zoom) ? this.zoom! : undefined;\n this.fitting = true;\n try {\n if (center) map.setView(center, zoom ?? 16, { animate: false });\n else if (pts.length === 1) map.setView(pts[0]!, zoom ?? 16, { animate: false });\n else if (pts.length && zoom !== undefined)\n map.setView(L.latLngBounds(pts).getCenter(), zoom, { animate: false });\n else if (pts.length) {\n // As close as the largest marker allows; again clear of the zoom buttons (top\n // left) and the attribution (bottom right) if a marker would sit under them.\n const bounds = L.latLngBounds(pts);\n const edge = MAX_DOT / 2 + 4;\n map.fitBounds(bounds, { padding: [edge, edge], maxZoom: 17, animate: false });\n if (this.underControls(pts))\n map.fitBounds(bounds, {\n paddingTopLeft: [80, 40],\n paddingBottomRight: [40, 40],\n maxZoom: 17,\n animate: false,\n });\n } else map.setView(GROUNDS, 15, { animate: false });\n } finally {\n this.fitting = false;\n }\n }\n\n /** Whether any of `pts` is under (or within 12px of) the zoom buttons or the attribution. */\n private underControls(pts: Leaflet.LatLng[]): boolean {\n const map = this.map!;\n const box = map.getContainer().getBoundingClientRect();\n const rects = [\n ...map.getContainer().querySelectorAll('.leaflet-control-zoom, .leaflet-control-attribution'),\n ].map((c) => c.getBoundingClientRect());\n return pts.some((ll) => {\n const p = map.latLngToContainerPoint(ll);\n const [x, y] = [p.x + box.left, p.y + box.top];\n return rects.some(\n (r) =>\n r.width > 0 &&\n x >= r.left - 12 &&\n x <= r.right + 12 &&\n y >= r.top - 12 &&\n y <= r.bottom + 12,\n );\n });\n }\n\n private markerEl(i: number): HTMLElement | undefined {\n return this.markers[i]?.getElement();\n }\n\n private hover(i: number): void {\n this.hoverIndex = i;\n this.dismissed = false;\n this.syncActive();\n }\n\n /** The highlighted place: the one hovered, else the one focused (none after Escape). */\n private syncActive(): void {\n this.active = this.dismissed ? -1 : this.hoverIndex >= 0 ? this.hoverIndex : this.focusIndex;\n }\n\n /** Highlight the active place's marker and show its tooltip (after a render). */\n private showActive(prev: number | undefined): void {\n const { map, tooltip } = this;\n if (!map || !tooltip) return;\n if (prev !== undefined && prev >= 0) {\n this.markerEl(prev)?.classList.remove('is-active');\n const d = this.markerDot(prev);\n this.markers[prev]?.setZIndexOffset((MAX_DOT - d) * 10);\n }\n const i = this.active;\n const marker = this.markers[i];\n const p = this.places[i];\n if (i < 0 || !marker || !p) {\n tooltip.remove();\n return;\n }\n this.markerEl(i)?.classList.add('is-active');\n marker.setZIndexOffset(10000);\n const content = this.ownerDocument.createElement('span');\n const name = this.ownerDocument.createElement('span');\n name.className = 'tip-name';\n name.textContent = p.name;\n content.append(name);\n if (p.count !== undefined) content.append(this.countText(p.count));\n const size = Math.max(HIT, this.markerDot(i));\n tooltip.options.offset = [0, -Math.round(size * 0.6)];\n tooltip.setLatLng(marker.getLatLng()).setContent(content);\n if (!map.hasLayer(tooltip)) tooltip.addTo(map);\n else tooltip.update();\n }\n\n private markerDot(i: number): number {\n const d = parseFloat(\n this.markerEl(i)?.querySelector<HTMLElement>('.marker')?.style.getPropertyValue('--d') ?? '',\n );\n return Number.isFinite(d) ? d : MIN_DOT;\n }\n\n /** Bring a place into view (on focus), without animation under reduced motion. */\n private reveal(i: number): void {\n const { map } = this;\n const marker = this.markers[i];\n if (!map || !marker) return;\n const ll = marker.getLatLng();\n if (!map.getBounds().pad(-0.15).contains(ll)) map.panTo(ll, { animate: !this.reduceMotion });\n }\n\n private indexOf(e: Event): number {\n const t = e.target as Element | null;\n const ctl = t?.closest?.('.marker') as HTMLElement | null;\n return ctl ? Number(ctl.dataset.index) : -1;\n }\n\n private onMapClick = (e: MouseEvent) => {\n const t = e.target as Element;\n if (t.closest?.('.leaflet-control-zoom a')) {\n this.queueZoomReport();\n return;\n }\n const i = this.indexOf(e);\n const p = this.places[i];\n if (i < 0 || !p) return;\n // The end of a drag that started on a marker is not a choice (a key press always is).\n const drag = this.map?.dragging as unknown as { moved?: () => boolean } | undefined;\n if (e.detail !== 0 && drag?.moved?.()) {\n e.preventDefault();\n return;\n }\n trackEvent(this, [TAG, 'select', this.label, i + 1]);\n const go = this.dispatchEvent(\n new CustomEvent('select', {\n detail: { item: p },\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n if (!go) e.preventDefault();\n };\n\n /** Report the zoom level 1 s after the last zoom-button press. */\n private queueZoomReport(): void {\n clearTimeout(this.zoomTimer);\n this.zoomTimer = setTimeout(() => {\n if (this.map) trackEvent(this, [TAG, 'zoom', this.label, this.map.getZoom()]);\n }, 1000);\n }\n\n private onMapKeydown = (e: KeyboardEvent) => {\n const t = e.target as Element;\n // Leaflet's zoom buttons are links with role=\"button\": Space presses them too.\n if (e.key === ' ' && t.closest?.('.leaflet-control-zoom a')) {\n e.preventDefault();\n (t.closest('a') as HTMLElement).click();\n return;\n }\n const i = this.indexOf(e);\n if (i < 0) return;\n const order = this.markers.flatMap((m, j) => (m ? [j] : []));\n const at = order.indexOf(i);\n let next = -1;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') next = order[at + 1] ?? -1;\n else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') next = order[at - 1] ?? -1;\n else if (e.key === 'Home') next = order[0] ?? -1;\n else if (e.key === 'End') next = order[order.length - 1] ?? -1;\n else if (e.key === ' ' && t.localName === 'a') {\n // A link marker is a control here: Space chooses it, like Enter.\n e.preventDefault();\n (t as HTMLElement).click();\n return;\n } else return;\n e.preventDefault();\n e.stopPropagation();\n if (next >= 0) {\n this.reveal(next);\n this.markerEl(next)?.querySelector<HTMLElement>('.marker')?.focus();\n }\n };\n\n private onMapFocusIn = (e: FocusEvent) => {\n const i = this.indexOf(e);\n if (i < 0) return;\n this.focusIndex = i;\n this.dismissed = false;\n this.reveal(i);\n this.syncActive();\n };\n\n private onMapFocusOut = (e: FocusEvent) => {\n if (this.indexOf(e) < 0) return;\n const to = e.relatedTarget as Element | null;\n if (to?.closest?.('.marker')) return; // the next marker's focusin sets it\n this.focusIndex = -1;\n this.syncActive();\n };\n\n private onMapLeave = () => {\n this.hoverIndex = -1;\n this.syncActive();\n };\n\n private onPlaceEnter(i: number): void {\n this.hover(i);\n }\n\n private onPlaceLeave(): void {\n this.hoverIndex = -1;\n this.syncActive();\n }\n\n private onPlaceFocusIn(i: number): void {\n this.focusIndex = i;\n this.dismissed = false;\n this.reveal(i);\n this.syncActive();\n }\n\n private onPlaceFocusOut(e: FocusEvent): void {\n const to = e.relatedTarget as Element | null;\n if (to?.closest?.('.place')) return;\n this.focusIndex = -1;\n this.syncActive();\n }\n\n /** The skip link: focus the list (a fragment link cannot reach into a shadow root). */\n private skipToList = (e: Event) => {\n e.preventDefault();\n this.renderRoot.querySelector<HTMLElement>(`#${this.uid}-list`)?.focus();\n };\n\n override render() {\n const places = this.places;\n const label = this.label.trim() || 'Places';\n const listId = `${this.uid}-list`;\n const map = this.hasLeaflet\n ? html`<a class=\"skip-link\" href=\"#${listId}\" @click=${this.skipToList}\n >Skip map, go to the list</a\n >\n <p class=\"instructions\" part=\"instructions\">${MAP_INSTRUCTIONS}</p>\n <div class=${this.dark && !this.darkTileUrl ? 'frame dark-tiles' : 'frame'}>\n <div\n id=\"${this.uid}-map\"\n class=\"map\"\n part=\"map\"\n role=\"region\"\n aria-label=${`${label}, map`}\n @click=${{ handleEvent: this.onMapClick, capture: true }}\n @keydown=${this.onMapKeydown}\n @focusin=${this.onMapFocusIn}\n @focusout=${this.onMapFocusOut}\n @mouseleave=${this.onMapLeave}\n ></div>\n </div>`\n : nothing;\n return html`${map}\n <ul class=\"places\" part=\"list\" id=${listId} tabindex=\"-1\" aria-label=${`${label}, list`}>\n ${places.map((p, i) => {\n const href = this.href(p);\n return html`<li\n class=${i === this.active ? 'place is-active' : 'place'}\n part=\"place\"\n @mouseenter=${() => this.onPlaceEnter(i)}\n @mouseleave=${() => this.onPlaceLeave()}\n @focusin=${() => this.onPlaceFocusIn(i)}\n @focusout=${(e: FocusEvent) => this.onPlaceFocusOut(e)}\n >\n ${\n href ? html`<a href=${href}>${p.name}</a>` : html`<span class=\"name\">${p.name}</span>`\n }\n ${\n p.count !== undefined && Number.isFinite(p.count)\n ? html`<span class=\"count\">${this.countText(p.count)}</span>`\n : nothing\n }\n ${p.description ? html`<span class=\"description\">${p.description}</span>` : nothing}\n </li>`;\n })}\n </ul>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { UvalibMap } from './UvalibMap.js';\n\ndefine('uvalib-map', UvalibMap);\n"],"mappings":";;;;;AA6BA,IAAMmB,IAAM,cAGCC,IAAe,kDACfC,IACX,6FAGIC,IAA4B,CAAC,SAAS,QAAQ,GAG9CC,IAAU,IACVC,IAAU,IACVC,IAAM,IAENC,IAAa,8CAGNC,IACX,kHAEEC,IAAkB,GAEhBC,KAAO,MAAcxB,EAAE,eAAe,OAAO,GAG7CyB,KAAQ,GAAc,MAAezB,MAAM,KAAK,KAAK,KAAK0B,CAAI,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA,GAEtFC,KAAc,MAClB,OAAO,SAASC,EAAE,GAAG,KACrB,OAAO,SAASA,EAAE,GAAG,KACrB,KAAK,IAAIA,EAAE,GAAG,KAAK,MACnB,KAAK,IAAIA,EAAE,GAAG,KAAK;AAGrB,SAASC,EAAY,GAAoC;CACvD,IAAMC,IAAI,oDAAoD,KAAKC,CAAC;CACpE,IAAI,CAACD,GAAG,OAAO;CACf,IAAM,CAACE,GAAKC,KAAO,CAAC,OAAOH,EAAE,EAAE,GAAG,OAAOA,EAAE,EAAE,CAAC;CAC9C,OAAO,KAAK,IAAIE,CAAG,KAAK,MAAM,KAAK,IAAIC,CAAG,KAAK,MAAM,CAACD,GAAKC,CAAG,IAAI;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