@empoweredvote/ev-ui 0.5.1 → 0.6.1
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/dist/index.js +902 -226
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +896 -223
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,8 +35,10 @@ __export(index_exports, {
|
|
|
35
35
|
CategorySection: () => CategorySection,
|
|
36
36
|
CommitteeTable: () => CommitteeTable,
|
|
37
37
|
CompassCardHorizontal: () => CompassCardHorizontal,
|
|
38
|
+
CompassCardVertical: () => CompassCardVertical,
|
|
38
39
|
CompassCoverageCallout: () => CompassCoverageCallout,
|
|
39
40
|
CompassIcon: () => CompassIcon,
|
|
41
|
+
CompassKey: () => CompassKey,
|
|
40
42
|
ExpandCompassNudge: () => ExpandCompassNudge,
|
|
41
43
|
FilterSidebar: () => FilterSidebar,
|
|
42
44
|
GovernmentBodySection: () => GovernmentBodySection,
|
|
@@ -66,6 +68,7 @@ __export(index_exports, {
|
|
|
66
68
|
defaultNavItems: () => defaultNavItems,
|
|
67
69
|
duration: () => duration,
|
|
68
70
|
easing: () => easing,
|
|
71
|
+
evContext: () => evContext,
|
|
69
72
|
focus: () => focus,
|
|
70
73
|
fontSizes: () => fontSizes,
|
|
71
74
|
fontWeights: () => fontWeights,
|
|
@@ -101,7 +104,8 @@ function RadarChartCore({
|
|
|
101
104
|
size = 400,
|
|
102
105
|
labelFontSize = 18,
|
|
103
106
|
padding = 80,
|
|
104
|
-
labelOffset = 20
|
|
107
|
+
labelOffset = 20,
|
|
108
|
+
tightFit = false
|
|
105
109
|
}) {
|
|
106
110
|
const radius = size / 2 - 40;
|
|
107
111
|
const centerX = size / 2;
|
|
@@ -200,6 +204,20 @@ function RadarChartCore({
|
|
|
200
204
|
const leftPadding = symmetricPadding;
|
|
201
205
|
const rightPadding = symmetricPadding;
|
|
202
206
|
const verticalPadding = padding;
|
|
207
|
+
let tightTop = -verticalPadding;
|
|
208
|
+
let tightHeight = size + verticalPadding * 2;
|
|
209
|
+
if (tightFit && numSpokes > 0) {
|
|
210
|
+
let yMin = Infinity, yMax = -Infinity;
|
|
211
|
+
for (let i = 0; i < numSpokes; i++) {
|
|
212
|
+
const angle = 2 * Math.PI * i / numSpokes;
|
|
213
|
+
const y = centerY - radius * Math.cos(angle);
|
|
214
|
+
if (y < yMin) yMin = y;
|
|
215
|
+
if (y > yMax) yMax = y;
|
|
216
|
+
}
|
|
217
|
+
const labelMargin = labelOffset + labelFontSize * 1.4 + labelFontSize * 1.1;
|
|
218
|
+
tightTop = yMin - labelMargin;
|
|
219
|
+
tightHeight = yMax + labelMargin - tightTop;
|
|
220
|
+
}
|
|
203
221
|
const guidePolygons = [];
|
|
204
222
|
for (let level = 1; level <= 5; level++) {
|
|
205
223
|
const scale = level / 5;
|
|
@@ -218,7 +236,7 @@ function RadarChartCore({
|
|
|
218
236
|
"svg",
|
|
219
237
|
{
|
|
220
238
|
className: "w-full h-auto max-h-full",
|
|
221
|
-
viewBox: `-${leftPadding}
|
|
239
|
+
viewBox: `-${leftPadding} ${tightTop} ${size + leftPadding + rightPadding} ${tightHeight}`,
|
|
222
240
|
preserveAspectRatio: "xMidYMid meet"
|
|
223
241
|
},
|
|
224
242
|
guidePolygons,
|
|
@@ -276,6 +294,7 @@ function RadarChartCore({
|
|
|
276
294
|
fill: isUnansweredLabel ? "#9ca3af" : void 0,
|
|
277
295
|
style: { cursor: "pointer", userSelect: "none", fontSize: fSize }
|
|
278
296
|
},
|
|
297
|
+
isUnansweredLabel && /* @__PURE__ */ import_react.default.createElement("title", null, "No stance on file for this topic."),
|
|
279
298
|
lines.map((ln, idx) => /* @__PURE__ */ import_react.default.createElement("tspan", { key: idx, x: labelX, dy: idx === 0 ? "0" : `${lineHeight}` }, ln))
|
|
280
299
|
);
|
|
281
300
|
}),
|
|
@@ -302,18 +321,25 @@ function RadarChartCore({
|
|
|
302
321
|
}
|
|
303
322
|
}
|
|
304
323
|
),
|
|
305
|
-
pointsArr.map(([cx, cy], i) =>
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
324
|
+
pointsArr.map(([cx, cy], i) => {
|
|
325
|
+
const shortTitle = spokes[i][0];
|
|
326
|
+
const userVal = spokes[i][1];
|
|
327
|
+
if (!userVal || Number(userVal) === 0) return null;
|
|
328
|
+
const compareVal = compareData[shortTitle];
|
|
329
|
+
const matches = hasCompareData && userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
330
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
331
|
+
"circle",
|
|
332
|
+
{
|
|
333
|
+
key: `user-dot-${i}`,
|
|
334
|
+
cx,
|
|
335
|
+
cy,
|
|
336
|
+
r: matches ? 8 : 7,
|
|
337
|
+
fill: matches ? "#fed12e" : "#7C6B9E",
|
|
338
|
+
stroke: "#FFFFFF",
|
|
339
|
+
strokeWidth: 3
|
|
340
|
+
}
|
|
341
|
+
);
|
|
342
|
+
}),
|
|
317
343
|
hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */ import_react.default.createElement(
|
|
318
344
|
"polygon",
|
|
319
345
|
{
|
|
@@ -337,18 +363,25 @@ function RadarChartCore({
|
|
|
337
363
|
}
|
|
338
364
|
}
|
|
339
365
|
) : null,
|
|
340
|
-
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) =>
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
366
|
+
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => {
|
|
367
|
+
const shortTitle = spokes[i][0];
|
|
368
|
+
const userVal = spokes[i][1];
|
|
369
|
+
const compareVal = compareData[shortTitle];
|
|
370
|
+
if (!compareVal || Number(compareVal) === 0) return null;
|
|
371
|
+
const matches = userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
372
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
373
|
+
"circle",
|
|
374
|
+
{
|
|
375
|
+
key: `compare-dot-${i}`,
|
|
376
|
+
cx,
|
|
377
|
+
cy,
|
|
378
|
+
r: matches ? 8 : 7,
|
|
379
|
+
fill: matches ? "#fed12e" : "#5A9A6E",
|
|
380
|
+
stroke: "#FFFFFF",
|
|
381
|
+
strokeWidth: 3
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
}),
|
|
352
385
|
spokes.map(([shortTitle], i) => {
|
|
353
386
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
354
387
|
const x = centerX + radius * Math.sin(angle);
|
|
@@ -2149,7 +2182,7 @@ function CompassCardHorizontalMeta({
|
|
|
2149
2182
|
IconOverlay,
|
|
2150
2183
|
{
|
|
2151
2184
|
ballot: politician.ballot || null,
|
|
2152
|
-
hasStances:
|
|
2185
|
+
hasStances: false,
|
|
2153
2186
|
branch: politician.branch || null
|
|
2154
2187
|
}
|
|
2155
2188
|
));
|
|
@@ -2180,11 +2213,12 @@ function buildAnswerMapByShortTitle(allTopics, allAnswers, allowedShorts) {
|
|
|
2180
2213
|
}
|
|
2181
2214
|
|
|
2182
2215
|
// src/CompassCardHorizontal.jsx
|
|
2183
|
-
var RADAR_SIZE =
|
|
2184
|
-
var SLOT_WIDTH =
|
|
2216
|
+
var RADAR_SIZE = 400;
|
|
2217
|
+
var SLOT_WIDTH = 420;
|
|
2185
2218
|
function CompassCardHorizontal({
|
|
2186
2219
|
politician,
|
|
2187
2220
|
userAnswers = null,
|
|
2221
|
+
invertedSpokes = {},
|
|
2188
2222
|
tierVisuals = null,
|
|
2189
2223
|
view = "compass",
|
|
2190
2224
|
surface = "representatives",
|
|
@@ -2268,7 +2302,7 @@ function CompassCardHorizontal({
|
|
|
2268
2302
|
topics,
|
|
2269
2303
|
data,
|
|
2270
2304
|
compareData,
|
|
2271
|
-
invertedSpokes: {},
|
|
2305
|
+
invertedSpokes: invertedSpokes || {},
|
|
2272
2306
|
onToggleInversion: () => {
|
|
2273
2307
|
},
|
|
2274
2308
|
onReplaceTopic: () => {
|
|
@@ -2445,8 +2479,645 @@ function CompassCardHorizontal({
|
|
|
2445
2479
|
);
|
|
2446
2480
|
}
|
|
2447
2481
|
|
|
2448
|
-
// src/
|
|
2482
|
+
// src/CompassCardVertical.jsx
|
|
2449
2483
|
var import_react14 = __toESM(require("react"));
|
|
2484
|
+
var RADAR_SIZE2 = 400;
|
|
2485
|
+
function CompassCardVertical({
|
|
2486
|
+
politician,
|
|
2487
|
+
userAnswers = null,
|
|
2488
|
+
invertedSpokes = {},
|
|
2489
|
+
tierVisuals = null,
|
|
2490
|
+
view = "compass",
|
|
2491
|
+
surface = "representatives",
|
|
2492
|
+
variant = "compass",
|
|
2493
|
+
onBuildCompass = null,
|
|
2494
|
+
onClick
|
|
2495
|
+
}) {
|
|
2496
|
+
var _a;
|
|
2497
|
+
const [hovered, setHovered] = (0, import_react14.useState)(false);
|
|
2498
|
+
const [focused, setFocused] = (0, import_react14.useState)(false);
|
|
2499
|
+
const [imgError, setImgError] = (0, import_react14.useState)(false);
|
|
2500
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = (0, import_react14.useState)(false);
|
|
2501
|
+
(0, import_react14.useEffect)(() => {
|
|
2502
|
+
setImgError(false);
|
|
2503
|
+
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2504
|
+
const cardStyle = {
|
|
2505
|
+
position: "relative",
|
|
2506
|
+
display: "flex",
|
|
2507
|
+
flexDirection: "column",
|
|
2508
|
+
height: "100%",
|
|
2509
|
+
backgroundColor: (_a = tierVisuals == null ? void 0 : tierVisuals.bg) != null ? _a : colors.bgWhite,
|
|
2510
|
+
border: `1px solid ${colors.borderLight}`,
|
|
2511
|
+
borderRadius: borderRadius.xl,
|
|
2512
|
+
overflow: "hidden",
|
|
2513
|
+
boxShadow: focused ? focus.ring : hovered ? shadows.cardHover : shadows.md,
|
|
2514
|
+
transform: hovered ? "translateY(-2px)" : "none",
|
|
2515
|
+
transition: `box-shadow ${duration.normal} ease, transform ${duration.normal} ease`,
|
|
2516
|
+
cursor: onClick ? "pointer" : "default",
|
|
2517
|
+
fontFamily: fonts.primary,
|
|
2518
|
+
outline: "none"
|
|
2519
|
+
};
|
|
2520
|
+
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2521
|
+
function renderCompass() {
|
|
2522
|
+
var _a2, _b, _c;
|
|
2523
|
+
if (!userAnswers || userAnswers.length === 0) {
|
|
2524
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2525
|
+
}
|
|
2526
|
+
let topics = [];
|
|
2527
|
+
let data = {};
|
|
2528
|
+
let compareData = {};
|
|
2529
|
+
try {
|
|
2530
|
+
if (Array.isArray(userAnswers) && userAnswers.length > 0) {
|
|
2531
|
+
const hasEmbeddedTopics = (_b = (_a2 = userAnswers[0]) == null ? void 0 : _a2.topic) == null ? void 0 : _b.short_title;
|
|
2532
|
+
if (hasEmbeddedTopics) {
|
|
2533
|
+
const allowedShorts = userAnswers.map((a) => a.topic.short_title);
|
|
2534
|
+
const allTopics = userAnswers.map((a) => a.topic);
|
|
2535
|
+
const { topicsFiltered, answersByShort } = buildAnswerMapByShortTitle(
|
|
2536
|
+
allTopics,
|
|
2537
|
+
userAnswers,
|
|
2538
|
+
allowedShorts
|
|
2539
|
+
);
|
|
2540
|
+
topics = topicsFiltered;
|
|
2541
|
+
data = answersByShort;
|
|
2542
|
+
} else {
|
|
2543
|
+
if (!Array.isArray(userAnswers[0])) {
|
|
2544
|
+
topics = userAnswers.filter((a) => a.short_title).map((a) => ({ id: a.topic_id || a.short_title, short_title: a.short_title, title: a.short_title }));
|
|
2545
|
+
data = {};
|
|
2546
|
+
for (const a of userAnswers) {
|
|
2547
|
+
if (a.short_title) data[a.short_title] = (_c = a.value) != null ? _c : 0;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
if ((politician == null ? void 0 : politician.stances) && typeof politician.stances === "object") {
|
|
2553
|
+
compareData = Array.isArray(politician.stances) ? politician.stances.reduce((acc, s) => {
|
|
2554
|
+
var _a3;
|
|
2555
|
+
if (s.short_title) acc[s.short_title] = (_a3 = s.value) != null ? _a3 : 0;
|
|
2556
|
+
return acc;
|
|
2557
|
+
}, {}) : politician.stances;
|
|
2558
|
+
}
|
|
2559
|
+
if (topics.length === 0) {
|
|
2560
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2561
|
+
}
|
|
2562
|
+
} catch {
|
|
2563
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2564
|
+
}
|
|
2565
|
+
const unansweredSpokes = {};
|
|
2566
|
+
for (const t of topics) {
|
|
2567
|
+
const v = compareData[t.short_title];
|
|
2568
|
+
if (!v || Number(v) === 0) unansweredSpokes[t.short_title] = true;
|
|
2569
|
+
}
|
|
2570
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: { width: RADAR_SIZE2 + 240, maxWidth: "100%", flexShrink: 0 } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2571
|
+
RadarChartCore,
|
|
2572
|
+
{
|
|
2573
|
+
topics,
|
|
2574
|
+
data,
|
|
2575
|
+
compareData,
|
|
2576
|
+
invertedSpokes: invertedSpokes || {},
|
|
2577
|
+
unansweredSpokes,
|
|
2578
|
+
onToggleInversion: () => {
|
|
2579
|
+
},
|
|
2580
|
+
onReplaceTopic: () => {
|
|
2581
|
+
},
|
|
2582
|
+
size: RADAR_SIZE2,
|
|
2583
|
+
padding: 40,
|
|
2584
|
+
labelOffset: 5,
|
|
2585
|
+
labelFontSize: 18,
|
|
2586
|
+
tightFit: true
|
|
2587
|
+
}
|
|
2588
|
+
));
|
|
2589
|
+
}
|
|
2590
|
+
function renderAvatar() {
|
|
2591
|
+
var _a2, _b, _c;
|
|
2592
|
+
const imageSrc = (politician == null ? void 0 : politician.photo_origin_url) || (politician == null ? void 0 : politician.images) && ((_a2 = politician.images[0]) == null ? void 0 : _a2.url) || null;
|
|
2593
|
+
const baseStyle = {
|
|
2594
|
+
width: 88,
|
|
2595
|
+
height: 110,
|
|
2596
|
+
flexShrink: 0,
|
|
2597
|
+
overflow: "hidden",
|
|
2598
|
+
borderRadius: borderRadius.md,
|
|
2599
|
+
backgroundColor: colors.evMutedBlue,
|
|
2600
|
+
display: "flex",
|
|
2601
|
+
alignItems: "center",
|
|
2602
|
+
justifyContent: "center"
|
|
2603
|
+
};
|
|
2604
|
+
if (imageSrc && !imgError) {
|
|
2605
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2606
|
+
"img",
|
|
2607
|
+
{
|
|
2608
|
+
src: imageSrc,
|
|
2609
|
+
alt: `${politician.full_name} portrait`,
|
|
2610
|
+
onError: () => setImgError(true),
|
|
2611
|
+
style: {
|
|
2612
|
+
width: "100%",
|
|
2613
|
+
height: "100%",
|
|
2614
|
+
objectFit: "cover",
|
|
2615
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2616
|
+
display: "block"
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
));
|
|
2620
|
+
}
|
|
2621
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2622
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2623
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react14.default.createElement("span", { style: {
|
|
2624
|
+
color: colors.textWhite,
|
|
2625
|
+
fontFamily: fonts.primary,
|
|
2626
|
+
fontWeight: fontWeights.bold,
|
|
2627
|
+
fontSize: fontSizes["2xl"]
|
|
2628
|
+
} }, initials));
|
|
2629
|
+
}
|
|
2630
|
+
function renderPortrait() {
|
|
2631
|
+
var _a2, _b, _c;
|
|
2632
|
+
const imageSrc = (politician == null ? void 0 : politician.photo_origin_url) || (politician == null ? void 0 : politician.images) && ((_a2 = politician.images[0]) == null ? void 0 : _a2.url) || null;
|
|
2633
|
+
if (imageSrc && !imgError) {
|
|
2634
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
2635
|
+
"img",
|
|
2636
|
+
{
|
|
2637
|
+
src: imageSrc,
|
|
2638
|
+
alt: `${politician.full_name} portrait`,
|
|
2639
|
+
style: {
|
|
2640
|
+
width: RADAR_SIZE2,
|
|
2641
|
+
height: RADAR_SIZE2,
|
|
2642
|
+
objectFit: "cover",
|
|
2643
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2644
|
+
display: "block",
|
|
2645
|
+
borderRadius: borderRadius.md
|
|
2646
|
+
},
|
|
2647
|
+
onError: () => setImgError(true)
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
}
|
|
2651
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2652
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2653
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2654
|
+
width: RADAR_SIZE2,
|
|
2655
|
+
height: RADAR_SIZE2,
|
|
2656
|
+
backgroundColor: colors.evMutedBlue,
|
|
2657
|
+
color: colors.textWhite,
|
|
2658
|
+
display: "flex",
|
|
2659
|
+
alignItems: "center",
|
|
2660
|
+
justifyContent: "center",
|
|
2661
|
+
fontFamily: fonts.primary,
|
|
2662
|
+
fontWeight: fontWeights.bold,
|
|
2663
|
+
fontSize: fontSizes["5xl"],
|
|
2664
|
+
borderRadius: borderRadius.md
|
|
2665
|
+
} }, initials);
|
|
2666
|
+
}
|
|
2667
|
+
function renderEmptyVariant() {
|
|
2668
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2669
|
+
width: "100%",
|
|
2670
|
+
height: "100%",
|
|
2671
|
+
flex: 1,
|
|
2672
|
+
display: "flex",
|
|
2673
|
+
flexDirection: "column",
|
|
2674
|
+
alignItems: "center",
|
|
2675
|
+
justifyContent: "center",
|
|
2676
|
+
gap: "12px",
|
|
2677
|
+
padding: "20px",
|
|
2678
|
+
boxSizing: "border-box",
|
|
2679
|
+
backgroundColor: colorScales.teal["050"],
|
|
2680
|
+
borderRadius: borderRadius.md
|
|
2681
|
+
} }, /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: 220, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2682
|
+
margin: 0,
|
|
2683
|
+
fontSize: fontSizes.sm,
|
|
2684
|
+
color: colors.textMuted,
|
|
2685
|
+
textAlign: "center",
|
|
2686
|
+
lineHeight: 1.4,
|
|
2687
|
+
fontFamily: fonts.primary
|
|
2688
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ import_react14.default.createElement(
|
|
2689
|
+
"button",
|
|
2690
|
+
{
|
|
2691
|
+
type: "button",
|
|
2692
|
+
onClick: onBuildCompass || void 0,
|
|
2693
|
+
onMouseEnter: () => setEmptyCtaHovered(true),
|
|
2694
|
+
onMouseLeave: () => setEmptyCtaHovered(false),
|
|
2695
|
+
style: {
|
|
2696
|
+
minWidth: "180px",
|
|
2697
|
+
height: "44px",
|
|
2698
|
+
padding: "0 20px",
|
|
2699
|
+
backgroundColor: emptyCtaHovered ? semanticTokens.light.buttonPrimary.background.hovered : semanticTokens.light.buttonPrimary.background.default,
|
|
2700
|
+
color: colors.textWhite,
|
|
2701
|
+
fontSize: fontSizes.sm,
|
|
2702
|
+
fontWeight: fontWeights.semibold,
|
|
2703
|
+
fontFamily: fonts.primary,
|
|
2704
|
+
borderRadius: borderRadius.full,
|
|
2705
|
+
border: "none",
|
|
2706
|
+
cursor: onBuildCompass ? "pointer" : "default",
|
|
2707
|
+
transition: `background ${duration.normal} ease`
|
|
2708
|
+
}
|
|
2709
|
+
},
|
|
2710
|
+
"Calibrate your compass"
|
|
2711
|
+
));
|
|
2712
|
+
}
|
|
2713
|
+
function renderUnavailablePlate(message) {
|
|
2714
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2715
|
+
width: "100%",
|
|
2716
|
+
height: "100%",
|
|
2717
|
+
flex: 1,
|
|
2718
|
+
backgroundColor: colorScales.teal["050"],
|
|
2719
|
+
borderRadius: borderRadius.md,
|
|
2720
|
+
display: "flex",
|
|
2721
|
+
alignItems: "center",
|
|
2722
|
+
justifyContent: "center",
|
|
2723
|
+
padding: spacing[6],
|
|
2724
|
+
boxSizing: "border-box"
|
|
2725
|
+
} }, /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2726
|
+
fontSize: fontSizes.base,
|
|
2727
|
+
fontWeight: fontWeights.semibold,
|
|
2728
|
+
lineHeight: 1.4,
|
|
2729
|
+
color: colors.textMuted,
|
|
2730
|
+
textAlign: "center",
|
|
2731
|
+
margin: 0,
|
|
2732
|
+
fontFamily: fonts.primary
|
|
2733
|
+
} }, message));
|
|
2734
|
+
}
|
|
2735
|
+
function renderSlotContent() {
|
|
2736
|
+
if (view === "portrait") return renderPortrait();
|
|
2737
|
+
if (variant === "empty") return renderEmptyVariant();
|
|
2738
|
+
if (variant === "administrative" || variant === "judicial") {
|
|
2739
|
+
return renderUnavailablePlate("Compass currently unavailable for this role.");
|
|
2740
|
+
}
|
|
2741
|
+
if (variant === "no-stances") {
|
|
2742
|
+
return renderUnavailablePlate(`No compass stances on file for ${(politician == null ? void 0 : politician.full_name) || "this official"} yet.`);
|
|
2743
|
+
}
|
|
2744
|
+
return renderCompass();
|
|
2745
|
+
}
|
|
2746
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
2747
|
+
"div",
|
|
2748
|
+
{
|
|
2749
|
+
role: "article",
|
|
2750
|
+
"aria-label": `${politician.full_name}, ${politician.office_title || ""}`,
|
|
2751
|
+
tabIndex: 0,
|
|
2752
|
+
style: cardStyle,
|
|
2753
|
+
onClick,
|
|
2754
|
+
onKeyDown: (e) => {
|
|
2755
|
+
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
2756
|
+
e.preventDefault();
|
|
2757
|
+
onClick();
|
|
2758
|
+
}
|
|
2759
|
+
},
|
|
2760
|
+
onMouseEnter: () => setHovered(true),
|
|
2761
|
+
onMouseLeave: () => setHovered(false),
|
|
2762
|
+
onFocus: () => setFocused(true),
|
|
2763
|
+
onBlur: () => setFocused(false)
|
|
2764
|
+
},
|
|
2765
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { style: { padding: spacing[4], paddingBottom: spacing[3], display: "flex", alignItems: "stretch", gap: spacing[3], flexShrink: 0 } }, renderAvatar(), /* @__PURE__ */ import_react14.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: spacing[1], minWidth: 0, flex: 1 } }, /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2766
|
+
fontFamily: fonts.primary,
|
|
2767
|
+
fontSize: fontSizes.xl,
|
|
2768
|
+
fontWeight: fontWeights.semibold,
|
|
2769
|
+
lineHeight: 1.3,
|
|
2770
|
+
color: colors.evMutedBlue,
|
|
2771
|
+
margin: 0
|
|
2772
|
+
} }, politician.full_name), /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2773
|
+
fontFamily: fonts.primary,
|
|
2774
|
+
fontSize: fontSizes.sm,
|
|
2775
|
+
fontWeight: fontWeights.semibold,
|
|
2776
|
+
lineHeight: 1.4,
|
|
2777
|
+
color: colors.textSecondary,
|
|
2778
|
+
margin: 0
|
|
2779
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2780
|
+
fontFamily: fonts.primary,
|
|
2781
|
+
fontSize: fontSizes.sm,
|
|
2782
|
+
fontWeight: fontWeights.regular,
|
|
2783
|
+
lineHeight: 1.5,
|
|
2784
|
+
color: colors.textMuted,
|
|
2785
|
+
margin: 0,
|
|
2786
|
+
overflow: "hidden",
|
|
2787
|
+
textOverflow: "ellipsis",
|
|
2788
|
+
whiteSpace: "nowrap"
|
|
2789
|
+
} }, politician.district_label), /* @__PURE__ */ import_react14.default.createElement("div", { style: { marginTop: "auto" } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2790
|
+
IconOverlay,
|
|
2791
|
+
{
|
|
2792
|
+
ballot: politician.ballot || null,
|
|
2793
|
+
hasStances: false,
|
|
2794
|
+
branch: politician.branch || null
|
|
2795
|
+
}
|
|
2796
|
+
)))),
|
|
2797
|
+
surface === "elections" && politician.withdrawn && /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2798
|
+
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
2799
|
+
backgroundColor: "rgba(120,0,0,0.85)",
|
|
2800
|
+
color: "#fff",
|
|
2801
|
+
fontSize: "12px",
|
|
2802
|
+
fontWeight: 700,
|
|
2803
|
+
letterSpacing: "0.4px",
|
|
2804
|
+
textAlign: "center",
|
|
2805
|
+
textTransform: "uppercase",
|
|
2806
|
+
padding: "6px 0",
|
|
2807
|
+
borderRadius: borderRadius.sm
|
|
2808
|
+
} }, "Withdrawn"),
|
|
2809
|
+
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2810
|
+
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
2811
|
+
backgroundColor: "rgba(0,0,0,0.75)",
|
|
2812
|
+
color: "#fff",
|
|
2813
|
+
fontSize: "12px",
|
|
2814
|
+
fontWeight: 700,
|
|
2815
|
+
letterSpacing: "0.4px",
|
|
2816
|
+
textAlign: "center",
|
|
2817
|
+
textTransform: "uppercase",
|
|
2818
|
+
padding: "6px 0",
|
|
2819
|
+
borderRadius: borderRadius.sm
|
|
2820
|
+
} }, "Running Unopposed"),
|
|
2821
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2822
|
+
flex: 1,
|
|
2823
|
+
padding: spacing[4],
|
|
2824
|
+
paddingTop: 0,
|
|
2825
|
+
display: "flex",
|
|
2826
|
+
alignItems: "center",
|
|
2827
|
+
justifyContent: "center",
|
|
2828
|
+
position: "relative",
|
|
2829
|
+
minHeight: 0
|
|
2830
|
+
} }, renderSlotContent())
|
|
2831
|
+
);
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
// src/CompassKey.jsx
|
|
2835
|
+
var import_react15 = __toESM(require("react"));
|
|
2836
|
+
|
|
2837
|
+
// src/evContext.js
|
|
2838
|
+
var DEFAULT_BROKER_URL = "https://ev-context.empowered.vote/";
|
|
2839
|
+
var brokerUrl = DEFAULT_BROKER_URL;
|
|
2840
|
+
var iframe = null;
|
|
2841
|
+
var readyPromise = null;
|
|
2842
|
+
var pendingRequests = /* @__PURE__ */ new Map();
|
|
2843
|
+
var subscribers = /* @__PURE__ */ new Set();
|
|
2844
|
+
var lastValue = null;
|
|
2845
|
+
var nextRequestId = 1;
|
|
2846
|
+
function brokerOrigin() {
|
|
2847
|
+
try {
|
|
2848
|
+
return new URL(brokerUrl).origin;
|
|
2849
|
+
} catch {
|
|
2850
|
+
return "";
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
function ensureMounted() {
|
|
2854
|
+
if (typeof window === "undefined" || typeof document === "undefined") return null;
|
|
2855
|
+
if (iframe) return iframe;
|
|
2856
|
+
iframe = document.createElement("iframe");
|
|
2857
|
+
iframe.src = brokerUrl;
|
|
2858
|
+
iframe.setAttribute("aria-hidden", "true");
|
|
2859
|
+
iframe.setAttribute("tabindex", "-1");
|
|
2860
|
+
iframe.style.position = "absolute";
|
|
2861
|
+
iframe.style.width = "1px";
|
|
2862
|
+
iframe.style.height = "1px";
|
|
2863
|
+
iframe.style.border = "0";
|
|
2864
|
+
iframe.style.opacity = "0";
|
|
2865
|
+
iframe.style.pointerEvents = "none";
|
|
2866
|
+
iframe.style.top = "-9999px";
|
|
2867
|
+
iframe.style.left = "-9999px";
|
|
2868
|
+
window.addEventListener("message", onMessage);
|
|
2869
|
+
(document.body || document.documentElement).appendChild(iframe);
|
|
2870
|
+
readyPromise = new Promise((resolve) => {
|
|
2871
|
+
const onReady = (e) => {
|
|
2872
|
+
if (e.origin !== brokerOrigin()) return;
|
|
2873
|
+
if (!e.data || e.data.type !== "ev-context:ready") return;
|
|
2874
|
+
window.removeEventListener("message", onReady);
|
|
2875
|
+
resolve();
|
|
2876
|
+
};
|
|
2877
|
+
window.addEventListener("message", onReady);
|
|
2878
|
+
iframe.addEventListener("load", () => {
|
|
2879
|
+
setTimeout(() => resolve(), 50);
|
|
2880
|
+
});
|
|
2881
|
+
});
|
|
2882
|
+
return iframe;
|
|
2883
|
+
}
|
|
2884
|
+
function onMessage(event) {
|
|
2885
|
+
var _a, _b, _c;
|
|
2886
|
+
if (event.origin !== brokerOrigin()) return;
|
|
2887
|
+
const data = event.data;
|
|
2888
|
+
if (!data || typeof data !== "object") return;
|
|
2889
|
+
if (data.type === "ev-context:value" || data.type === "ev-context:ack") {
|
|
2890
|
+
const id = data.requestId;
|
|
2891
|
+
const wasPending = id && pendingRequests.has(id);
|
|
2892
|
+
if (wasPending) {
|
|
2893
|
+
const { resolve, timeout } = pendingRequests.get(id);
|
|
2894
|
+
clearTimeout(timeout);
|
|
2895
|
+
pendingRequests.delete(id);
|
|
2896
|
+
resolve(data.type === "ev-context:value" ? (_a = data.value) != null ? _a : null : data.ok);
|
|
2897
|
+
}
|
|
2898
|
+
if (data.type === "ev-context:value" && !wasPending) {
|
|
2899
|
+
lastValue = (_b = data.value) != null ? _b : null;
|
|
2900
|
+
notifySubscribers();
|
|
2901
|
+
}
|
|
2902
|
+
} else if (data.type === "ev-context:update") {
|
|
2903
|
+
lastValue = (_c = data.value) != null ? _c : null;
|
|
2904
|
+
notifySubscribers();
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
function notifySubscribers() {
|
|
2908
|
+
for (const fn of subscribers) {
|
|
2909
|
+
try {
|
|
2910
|
+
fn(lastValue);
|
|
2911
|
+
} catch {
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
function send(message, { expectReply = true, timeoutMs = 4e3 } = {}) {
|
|
2916
|
+
ensureMounted();
|
|
2917
|
+
return readyPromise.then(() => new Promise((resolve, reject) => {
|
|
2918
|
+
if (!iframe || !iframe.contentWindow) {
|
|
2919
|
+
reject(new Error("evContext broker iframe not ready"));
|
|
2920
|
+
return;
|
|
2921
|
+
}
|
|
2922
|
+
const requestId = expectReply ? `req-${nextRequestId++}` : void 0;
|
|
2923
|
+
if (expectReply) {
|
|
2924
|
+
const timeout = setTimeout(() => {
|
|
2925
|
+
pendingRequests.delete(requestId);
|
|
2926
|
+
reject(new Error("evContext request timed out"));
|
|
2927
|
+
}, timeoutMs);
|
|
2928
|
+
pendingRequests.set(requestId, { resolve, reject, timeout });
|
|
2929
|
+
}
|
|
2930
|
+
try {
|
|
2931
|
+
iframe.contentWindow.postMessage({ ...message, requestId }, brokerOrigin());
|
|
2932
|
+
if (!expectReply) resolve(true);
|
|
2933
|
+
} catch (err) {
|
|
2934
|
+
if (expectReply) {
|
|
2935
|
+
const entry = pendingRequests.get(requestId);
|
|
2936
|
+
if (entry) {
|
|
2937
|
+
clearTimeout(entry.timeout);
|
|
2938
|
+
pendingRequests.delete(requestId);
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
reject(err);
|
|
2942
|
+
}
|
|
2943
|
+
}));
|
|
2944
|
+
}
|
|
2945
|
+
var evContext = {
|
|
2946
|
+
/**
|
|
2947
|
+
* Override the broker URL. Call once at app startup before any get/set.
|
|
2948
|
+
* Defaults to https://ev-context.empowered.vote/ for prod.
|
|
2949
|
+
*/
|
|
2950
|
+
configure({ brokerUrl: url } = {}) {
|
|
2951
|
+
if (url) brokerUrl = url;
|
|
2952
|
+
},
|
|
2953
|
+
/** Mount the iframe immediately (optional — get/set will mount lazily). */
|
|
2954
|
+
preload() {
|
|
2955
|
+
ensureMounted();
|
|
2956
|
+
return readyPromise;
|
|
2957
|
+
},
|
|
2958
|
+
/** Read the current shared context. Resolves to the stored value or null. */
|
|
2959
|
+
async get() {
|
|
2960
|
+
return send({ type: "ev-context:get" });
|
|
2961
|
+
},
|
|
2962
|
+
/** Overwrite the shared context. */
|
|
2963
|
+
async set(value) {
|
|
2964
|
+
return send({ type: "ev-context:set", value });
|
|
2965
|
+
},
|
|
2966
|
+
/** Clear the shared context. */
|
|
2967
|
+
async clear() {
|
|
2968
|
+
return send({ type: "ev-context:clear" });
|
|
2969
|
+
},
|
|
2970
|
+
/**
|
|
2971
|
+
* Subscribe to live updates. Fires when this tab or any other tab
|
|
2972
|
+
* (any subdomain) writes to the store. Returns an unsubscribe function.
|
|
2973
|
+
*/
|
|
2974
|
+
subscribe(fn) {
|
|
2975
|
+
subscribers.add(fn);
|
|
2976
|
+
send({ type: "ev-context:subscribe" }).then((value) => {
|
|
2977
|
+
lastValue = value != null ? value : lastValue;
|
|
2978
|
+
try {
|
|
2979
|
+
fn(lastValue);
|
|
2980
|
+
} catch {
|
|
2981
|
+
}
|
|
2982
|
+
}).catch(() => {
|
|
2983
|
+
});
|
|
2984
|
+
return () => {
|
|
2985
|
+
subscribers.delete(fn);
|
|
2986
|
+
};
|
|
2987
|
+
}
|
|
2988
|
+
};
|
|
2989
|
+
|
|
2990
|
+
// src/CompassKey.jsx
|
|
2991
|
+
function CompassKey({ compact = false } = {}) {
|
|
2992
|
+
const [dismissed, setDismissed] = (0, import_react15.useState)(false);
|
|
2993
|
+
const [loaded, setLoaded] = (0, import_react15.useState)(false);
|
|
2994
|
+
(0, import_react15.useEffect)(() => {
|
|
2995
|
+
let cancelled = false;
|
|
2996
|
+
evContext.get().then((shared) => {
|
|
2997
|
+
if (cancelled) return;
|
|
2998
|
+
setDismissed(Boolean(shared == null ? void 0 : shared.compassKeyDismissed));
|
|
2999
|
+
setLoaded(true);
|
|
3000
|
+
}).catch(() => {
|
|
3001
|
+
if (!cancelled) setLoaded(true);
|
|
3002
|
+
});
|
|
3003
|
+
return () => {
|
|
3004
|
+
cancelled = true;
|
|
3005
|
+
};
|
|
3006
|
+
}, []);
|
|
3007
|
+
function persistDismissed(value) {
|
|
3008
|
+
evContext.get().then((current) => {
|
|
3009
|
+
const next = { ...current || {}, compassKeyDismissed: value };
|
|
3010
|
+
evContext.set(next).catch(() => {
|
|
3011
|
+
});
|
|
3012
|
+
}).catch(() => {
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
function handleDismiss() {
|
|
3016
|
+
setDismissed(true);
|
|
3017
|
+
persistDismissed(true);
|
|
3018
|
+
}
|
|
3019
|
+
function handleReopen() {
|
|
3020
|
+
setDismissed(false);
|
|
3021
|
+
persistDismissed(false);
|
|
3022
|
+
}
|
|
3023
|
+
if (!loaded) return null;
|
|
3024
|
+
const Swatch = ({ color, label, ring }) => /* @__PURE__ */ import_react15.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3025
|
+
display: "inline-block",
|
|
3026
|
+
width: 12,
|
|
3027
|
+
height: 12,
|
|
3028
|
+
borderRadius: "50%",
|
|
3029
|
+
background: color,
|
|
3030
|
+
border: `2px solid ${ring || "#fff"}`,
|
|
3031
|
+
boxShadow: "0 0 0 1px rgba(0,0,0,0.08)"
|
|
3032
|
+
} }), /* @__PURE__ */ import_react15.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, label));
|
|
3033
|
+
if (dismissed) {
|
|
3034
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
3035
|
+
"button",
|
|
3036
|
+
{
|
|
3037
|
+
type: "button",
|
|
3038
|
+
onClick: handleReopen,
|
|
3039
|
+
"aria-label": "Show compass legend",
|
|
3040
|
+
style: {
|
|
3041
|
+
display: "inline-flex",
|
|
3042
|
+
alignItems: "center",
|
|
3043
|
+
gap: spacing[1],
|
|
3044
|
+
padding: "4px 10px",
|
|
3045
|
+
borderRadius: borderRadius.full,
|
|
3046
|
+
background: "transparent",
|
|
3047
|
+
border: `1px solid ${colors.borderLight}`,
|
|
3048
|
+
color: colors.textMuted,
|
|
3049
|
+
fontFamily: fonts.primary,
|
|
3050
|
+
fontSize: fontSizes.xs,
|
|
3051
|
+
fontWeight: fontWeights.semibold,
|
|
3052
|
+
cursor: "pointer"
|
|
3053
|
+
}
|
|
3054
|
+
},
|
|
3055
|
+
/* @__PURE__ */ import_react15.default.createElement("span", { "aria-hidden": "true" }, "?"),
|
|
3056
|
+
" Compass key"
|
|
3057
|
+
);
|
|
3058
|
+
}
|
|
3059
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
3060
|
+
"div",
|
|
3061
|
+
{
|
|
3062
|
+
role: "region",
|
|
3063
|
+
"aria-label": "Compass legend",
|
|
3064
|
+
style: {
|
|
3065
|
+
display: "inline-flex",
|
|
3066
|
+
alignItems: "center",
|
|
3067
|
+
flexWrap: "wrap",
|
|
3068
|
+
gap: compact ? spacing[2] : spacing[3],
|
|
3069
|
+
padding: compact ? `${spacing[1]} ${spacing[2]}` : `${spacing[2]} ${spacing[3]}`,
|
|
3070
|
+
background: "#fff",
|
|
3071
|
+
border: `1px solid ${colors.borderLight}`,
|
|
3072
|
+
borderRadius: borderRadius.md,
|
|
3073
|
+
fontFamily: fonts.primary,
|
|
3074
|
+
maxWidth: "100%",
|
|
3075
|
+
boxSizing: "border-box"
|
|
3076
|
+
}
|
|
3077
|
+
},
|
|
3078
|
+
!compact && /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3079
|
+
fontSize: fontSizes.xs,
|
|
3080
|
+
fontWeight: fontWeights.semibold,
|
|
3081
|
+
color: colors.textMuted,
|
|
3082
|
+
textTransform: "uppercase",
|
|
3083
|
+
letterSpacing: "0.5px"
|
|
3084
|
+
} }, "Compass key"),
|
|
3085
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#7C6B9E", label: "You" }),
|
|
3086
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#5A9A6E", label: "Politician" }),
|
|
3087
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#fed12e", label: "Match" }),
|
|
3088
|
+
/* @__PURE__ */ import_react15.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3089
|
+
fontSize: fontSizes.xs,
|
|
3090
|
+
fontWeight: fontWeights.semibold,
|
|
3091
|
+
color: "#9ca3af",
|
|
3092
|
+
fontFamily: fonts.primary,
|
|
3093
|
+
textDecoration: "underline",
|
|
3094
|
+
textDecorationStyle: "dashed",
|
|
3095
|
+
textUnderlineOffset: "3px"
|
|
3096
|
+
} }, "Topic"), /* @__PURE__ */ import_react15.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, "= no stance")),
|
|
3097
|
+
/* @__PURE__ */ import_react15.default.createElement(
|
|
3098
|
+
"button",
|
|
3099
|
+
{
|
|
3100
|
+
type: "button",
|
|
3101
|
+
onClick: handleDismiss,
|
|
3102
|
+
"aria-label": "Hide compass legend",
|
|
3103
|
+
style: {
|
|
3104
|
+
marginLeft: spacing[2],
|
|
3105
|
+
padding: "2px 6px",
|
|
3106
|
+
border: "none",
|
|
3107
|
+
background: "transparent",
|
|
3108
|
+
color: colors.textMuted,
|
|
3109
|
+
fontSize: "16px",
|
|
3110
|
+
lineHeight: 1,
|
|
3111
|
+
cursor: "pointer"
|
|
3112
|
+
}
|
|
3113
|
+
},
|
|
3114
|
+
"\xD7"
|
|
3115
|
+
)
|
|
3116
|
+
);
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
// src/CategorySection.jsx
|
|
3120
|
+
var import_react16 = __toESM(require("react"));
|
|
2450
3121
|
function CategorySection({
|
|
2451
3122
|
title,
|
|
2452
3123
|
infoTooltip,
|
|
@@ -2456,7 +3127,7 @@ function CategorySection({
|
|
|
2456
3127
|
tier
|
|
2457
3128
|
}) {
|
|
2458
3129
|
var _a, _b;
|
|
2459
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3130
|
+
const [showTooltip, setShowTooltip] = (0, import_react16.useState)(false);
|
|
2460
3131
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
2461
3132
|
const styles2 = {
|
|
2462
3133
|
section: {
|
|
@@ -2524,7 +3195,7 @@ function CategorySection({
|
|
|
2524
3195
|
gap: spacing[4]
|
|
2525
3196
|
}
|
|
2526
3197
|
};
|
|
2527
|
-
return /* @__PURE__ */
|
|
3198
|
+
return /* @__PURE__ */ import_react16.default.createElement("section", { style: styles2.section, className: "ev-category-section" }, /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react16.default.createElement("span", { style: styles2.titlePill }, title), infoTooltip && /* @__PURE__ */ import_react16.default.createElement(
|
|
2528
3199
|
"button",
|
|
2529
3200
|
{
|
|
2530
3201
|
type: "button",
|
|
@@ -2536,8 +3207,8 @@ function CategorySection({
|
|
|
2536
3207
|
"aria-label": `Info about ${title}`
|
|
2537
3208
|
},
|
|
2538
3209
|
"i",
|
|
2539
|
-
showTooltip && /* @__PURE__ */
|
|
2540
|
-
), websiteUrl && /* @__PURE__ */
|
|
3210
|
+
showTooltip && /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
3211
|
+
), websiteUrl && /* @__PURE__ */ import_react16.default.createElement(
|
|
2541
3212
|
"a",
|
|
2542
3213
|
{
|
|
2543
3214
|
href: websiteUrl,
|
|
@@ -2546,7 +3217,7 @@ function CategorySection({
|
|
|
2546
3217
|
style: styles2.externalLink,
|
|
2547
3218
|
"aria-label": `Visit official website for ${title}`
|
|
2548
3219
|
},
|
|
2549
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
2550
3221
|
"svg",
|
|
2551
3222
|
{
|
|
2552
3223
|
viewBox: "0 0 24 24",
|
|
@@ -2554,7 +3225,7 @@ function CategorySection({
|
|
|
2554
3225
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2555
3226
|
style: { width: "14px", height: "14px" }
|
|
2556
3227
|
},
|
|
2557
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
2558
3229
|
"path",
|
|
2559
3230
|
{
|
|
2560
3231
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -2565,12 +3236,12 @@ function CategorySection({
|
|
|
2565
3236
|
}
|
|
2566
3237
|
)
|
|
2567
3238
|
)
|
|
2568
|
-
)), /* @__PURE__ */
|
|
3239
|
+
)), /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
2569
3240
|
}
|
|
2570
3241
|
|
|
2571
3242
|
// src/SubGroupSection.jsx
|
|
2572
|
-
var
|
|
2573
|
-
function SubGroupSection({ title, websiteUrl, children }) {
|
|
3243
|
+
var import_react17 = __toESM(require("react"));
|
|
3244
|
+
function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap, justifyContent }) {
|
|
2574
3245
|
const styles2 = {
|
|
2575
3246
|
section: {
|
|
2576
3247
|
marginBottom: spacing[4]
|
|
@@ -2598,11 +3269,13 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
2598
3269
|
},
|
|
2599
3270
|
grid: {
|
|
2600
3271
|
display: "grid",
|
|
2601
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(min(250px, 100%), 1fr))",
|
|
2602
|
-
gap: spacing[2]
|
|
3272
|
+
gridTemplateColumns: gridTemplateColumns || "repeat(auto-fill, minmax(min(250px, 100%), 1fr))",
|
|
3273
|
+
gap: gap || spacing[2],
|
|
3274
|
+
justifyContent: justifyContent || void 0,
|
|
3275
|
+
width: "100%"
|
|
2603
3276
|
}
|
|
2604
3277
|
};
|
|
2605
|
-
return /* @__PURE__ */
|
|
3278
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.section }, title && /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react17.default.createElement("span", { style: styles2.label }, title), websiteUrl && /* @__PURE__ */ import_react17.default.createElement(
|
|
2606
3279
|
"a",
|
|
2607
3280
|
{
|
|
2608
3281
|
href: websiteUrl,
|
|
@@ -2610,12 +3283,12 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
2610
3283
|
rel: "noopener noreferrer",
|
|
2611
3284
|
style: styles2.link
|
|
2612
3285
|
},
|
|
2613
|
-
/* @__PURE__ */
|
|
2614
|
-
)), /* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ import_react17.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "12px", height: "12px" } }, /* @__PURE__ */ import_react17.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react17.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z", stroke: "currentColor", strokeWidth: "2" }))
|
|
3287
|
+
)), /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
2615
3288
|
}
|
|
2616
3289
|
|
|
2617
3290
|
// src/GovernmentBodySection.jsx
|
|
2618
|
-
var
|
|
3291
|
+
var import_react18 = __toESM(require("react"));
|
|
2619
3292
|
function GovernmentBodySection({
|
|
2620
3293
|
title,
|
|
2621
3294
|
websiteUrl,
|
|
@@ -2624,7 +3297,7 @@ function GovernmentBodySection({
|
|
|
2624
3297
|
children
|
|
2625
3298
|
}) {
|
|
2626
3299
|
var _a;
|
|
2627
|
-
const [expanded, setExpanded] = (0,
|
|
3300
|
+
const [expanded, setExpanded] = (0, import_react18.useState)(defaultExpanded);
|
|
2628
3301
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
2629
3302
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
2630
3303
|
const styles2 = {
|
|
@@ -2664,7 +3337,7 @@ function GovernmentBodySection({
|
|
|
2664
3337
|
display: expanded ? "block" : "none"
|
|
2665
3338
|
}
|
|
2666
3339
|
};
|
|
2667
|
-
return /* @__PURE__ */
|
|
3340
|
+
return /* @__PURE__ */ import_react18.default.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ import_react18.default.createElement(
|
|
2668
3341
|
"div",
|
|
2669
3342
|
{
|
|
2670
3343
|
style: styles2.header,
|
|
@@ -2680,8 +3353,8 @@ function GovernmentBodySection({
|
|
|
2680
3353
|
"aria-expanded": expanded,
|
|
2681
3354
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
2682
3355
|
},
|
|
2683
|
-
/* @__PURE__ */
|
|
2684
|
-
websiteUrl && /* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { style: styles2.title }, title),
|
|
3357
|
+
websiteUrl && /* @__PURE__ */ import_react18.default.createElement(
|
|
2685
3358
|
"a",
|
|
2686
3359
|
{
|
|
2687
3360
|
href: websiteUrl,
|
|
@@ -2691,14 +3364,14 @@ function GovernmentBodySection({
|
|
|
2691
3364
|
onClick: (e) => e.stopPropagation(),
|
|
2692
3365
|
"aria-label": `Visit ${title} website`
|
|
2693
3366
|
},
|
|
2694
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ import_react18.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "14px", height: "14px" } }, /* @__PURE__ */ import_react18.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react18.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z", stroke: "currentColor", strokeWidth: "2" }))
|
|
2695
3368
|
),
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
), /* @__PURE__ */
|
|
3369
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
3370
|
+
), /* @__PURE__ */ import_react18.default.createElement("div", { style: styles2.content }, children));
|
|
2698
3371
|
}
|
|
2699
3372
|
|
|
2700
3373
|
// src/SocialLinks.jsx
|
|
2701
|
-
var
|
|
3374
|
+
var import_react19 = __toESM(require("react"));
|
|
2702
3375
|
var SOCIAL_PLATFORMS = [
|
|
2703
3376
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
2704
3377
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -2769,7 +3442,7 @@ function SocialLinks({
|
|
|
2769
3442
|
}
|
|
2770
3443
|
};
|
|
2771
3444
|
const platformIconMap = {
|
|
2772
|
-
twitter: /* @__PURE__ */
|
|
3445
|
+
twitter: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2773
3446
|
"path",
|
|
2774
3447
|
{
|
|
2775
3448
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -2779,7 +3452,7 @@ function SocialLinks({
|
|
|
2779
3452
|
strokeLinejoin: "round"
|
|
2780
3453
|
}
|
|
2781
3454
|
)),
|
|
2782
|
-
facebook: /* @__PURE__ */
|
|
3455
|
+
facebook: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2783
3456
|
"path",
|
|
2784
3457
|
{
|
|
2785
3458
|
d: "M18 2H15C13.6739 2 12.4021 2.52678 11.4645 3.46447C10.5268 4.40215 10 5.67392 10 7V10H7V14H10V22H14V14H17L18 10H14V7C14 6.73478 14.1054 6.48043 14.2929 6.29289C14.4804 6.10536 14.7348 6 15 6H18V2Z",
|
|
@@ -2789,8 +3462,8 @@ function SocialLinks({
|
|
|
2789
3462
|
strokeLinejoin: "round"
|
|
2790
3463
|
}
|
|
2791
3464
|
)),
|
|
2792
|
-
instagram: /* @__PURE__ */
|
|
2793
|
-
linkedin: /* @__PURE__ */
|
|
3465
|
+
instagram: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "18", cy: "6", r: "1", fill: "currentColor" })),
|
|
3466
|
+
linkedin: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2794
3467
|
"path",
|
|
2795
3468
|
{
|
|
2796
3469
|
d: "M16 8C17.5913 8 19.1174 8.63214 20.2426 9.75736C21.3679 10.8826 22 12.4087 22 14V21H18V14C18 13.4696 17.7893 12.9609 17.4142 12.5858C17.0391 12.2107 16.5304 12 16 12C15.4696 12 14.9609 12.2107 14.5858 12.5858C14.2107 12.9609 14 13.4696 14 14V21H10V14C10 12.4087 10.6321 10.8826 11.7574 9.75736C12.8826 8.63214 14.4087 8 16 8Z",
|
|
@@ -2799,8 +3472,8 @@ function SocialLinks({
|
|
|
2799
3472
|
strokeLinecap: "round",
|
|
2800
3473
|
strokeLinejoin: "round"
|
|
2801
3474
|
}
|
|
2802
|
-
), /* @__PURE__ */
|
|
2803
|
-
youtube: /* @__PURE__ */
|
|
3475
|
+
), /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "9", width: "4", height: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "4", cy: "4", r: "2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
3476
|
+
youtube: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "5", width: "20", height: "14", rx: "3", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("polygon", { points: "10,9 16,12 10,15", fill: "currentColor" }))
|
|
2804
3477
|
};
|
|
2805
3478
|
const links = [
|
|
2806
3479
|
{
|
|
@@ -2826,7 +3499,7 @@ function SocialLinks({
|
|
|
2826
3499
|
{
|
|
2827
3500
|
href: website,
|
|
2828
3501
|
label: "Website",
|
|
2829
|
-
icon: /* @__PURE__ */
|
|
3502
|
+
icon: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement(
|
|
2830
3503
|
"path",
|
|
2831
3504
|
{
|
|
2832
3505
|
d: "M2 12H22M12 2C14.5 4.5 16 8 16 12C16 16 14.5 19.5 12 22C9.5 19.5 8 16 8 12C8 8 9.5 4.5 12 2Z",
|
|
@@ -2856,7 +3529,7 @@ function SocialLinks({
|
|
|
2856
3529
|
if (links.length === 0) {
|
|
2857
3530
|
return null;
|
|
2858
3531
|
}
|
|
2859
|
-
return /* @__PURE__ */
|
|
3532
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ import_react19.default.createElement(
|
|
2860
3533
|
"a",
|
|
2861
3534
|
{
|
|
2862
3535
|
key: link.label,
|
|
@@ -2879,7 +3552,7 @@ function SocialLinks({
|
|
|
2879
3552
|
}
|
|
2880
3553
|
|
|
2881
3554
|
// src/IssueTags.jsx
|
|
2882
|
-
var
|
|
3555
|
+
var import_react20 = __toESM(require("react"));
|
|
2883
3556
|
function IssueTags({
|
|
2884
3557
|
tags = [],
|
|
2885
3558
|
selectedTags = [],
|
|
@@ -2922,9 +3595,9 @@ function IssueTags({
|
|
|
2922
3595
|
onTagClick(tag.value);
|
|
2923
3596
|
}
|
|
2924
3597
|
};
|
|
2925
|
-
return /* @__PURE__ */
|
|
3598
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
2926
3599
|
const isSelected = selectedTags.includes(tag.value);
|
|
2927
|
-
return /* @__PURE__ */
|
|
3600
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
2928
3601
|
"span",
|
|
2929
3602
|
{
|
|
2930
3603
|
key: tag.value,
|
|
@@ -2953,7 +3626,7 @@ function IssueTags({
|
|
|
2953
3626
|
}
|
|
2954
3627
|
|
|
2955
3628
|
// src/CommitteeTable.jsx
|
|
2956
|
-
var
|
|
3629
|
+
var import_react21 = __toESM(require("react"));
|
|
2957
3630
|
var ROLE_ORDER = {
|
|
2958
3631
|
"chair": 0,
|
|
2959
3632
|
"co-chair": 1,
|
|
@@ -2980,7 +3653,7 @@ function CommitteeTable({
|
|
|
2980
3653
|
maxVisible = 6,
|
|
2981
3654
|
style = {}
|
|
2982
3655
|
}) {
|
|
2983
|
-
const [showAll, setShowAll] = (0,
|
|
3656
|
+
const [showAll, setShowAll] = (0, import_react21.useState)(false);
|
|
2984
3657
|
if (committees.length === 0) {
|
|
2985
3658
|
return null;
|
|
2986
3659
|
}
|
|
@@ -3042,7 +3715,7 @@ function CommitteeTable({
|
|
|
3042
3715
|
cursor: "pointer"
|
|
3043
3716
|
}
|
|
3044
3717
|
};
|
|
3045
|
-
return /* @__PURE__ */
|
|
3718
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", { style: styles2.container, className: "ev-committee-table" }, /* @__PURE__ */ import_react21.default.createElement("h4", { style: styles2.heading }, /* @__PURE__ */ import_react21.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react21.default.createElement("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /* @__PURE__ */ import_react21.default.createElement("circle", { cx: "9", cy: "7", r: "4" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" })), title), /* @__PURE__ */ import_react21.default.createElement("table", { style: styles2.table }, /* @__PURE__ */ import_react21.default.createElement("tbody", null, visible.map((committee, index) => /* @__PURE__ */ import_react21.default.createElement("tr", { key: index, style: styles2.row }, /* @__PURE__ */ import_react21.default.createElement("td", { style: { ...styles2.cell, ...styles2.nameCell } }, committee.url ? /* @__PURE__ */ import_react21.default.createElement(
|
|
3046
3719
|
"a",
|
|
3047
3720
|
{
|
|
3048
3721
|
href: committee.url,
|
|
@@ -3057,7 +3730,7 @@ function CommitteeTable({
|
|
|
3057
3730
|
}
|
|
3058
3731
|
},
|
|
3059
3732
|
committee.name
|
|
3060
|
-
) : committee.name), /* @__PURE__ */
|
|
3733
|
+
) : committee.name), /* @__PURE__ */ import_react21.default.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ import_react21.default.createElement(
|
|
3061
3734
|
"button",
|
|
3062
3735
|
{
|
|
3063
3736
|
type: "button",
|
|
@@ -3065,7 +3738,7 @@ function CommitteeTable({
|
|
|
3065
3738
|
onClick: () => setShowAll(!showAll)
|
|
3066
3739
|
},
|
|
3067
3740
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
3068
|
-
/* @__PURE__ */
|
|
3741
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
3069
3742
|
"svg",
|
|
3070
3743
|
{
|
|
3071
3744
|
width: "14",
|
|
@@ -3078,16 +3751,16 @@ function CommitteeTable({
|
|
|
3078
3751
|
strokeLinejoin: "round",
|
|
3079
3752
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
3080
3753
|
},
|
|
3081
|
-
/* @__PURE__ */
|
|
3754
|
+
/* @__PURE__ */ import_react21.default.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
3082
3755
|
)
|
|
3083
3756
|
));
|
|
3084
3757
|
}
|
|
3085
3758
|
|
|
3086
3759
|
// src/PoliticianProfile.jsx
|
|
3087
|
-
var
|
|
3760
|
+
var import_react24 = __toESM(require("react"));
|
|
3088
3761
|
|
|
3089
3762
|
// src/LegislativeInlineSummary.jsx
|
|
3090
|
-
var
|
|
3763
|
+
var import_react22 = __toESM(require("react"));
|
|
3091
3764
|
function normalizePosition(pos) {
|
|
3092
3765
|
if (!pos) return "";
|
|
3093
3766
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -3195,7 +3868,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
3195
3868
|
fontSize: fontSizes.sm,
|
|
3196
3869
|
fontWeight: fontWeights.medium
|
|
3197
3870
|
};
|
|
3198
|
-
return /* @__PURE__ */
|
|
3871
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { style: card }, stats.length > 0 && /* @__PURE__ */ import_react22.default.createElement("div", { style: statsRow }, stats.map((s, i) => /* @__PURE__ */ import_react22.default.createElement("div", { key: i, style: statItem }, /* @__PURE__ */ import_react22.default.createElement("span", { style: statValue }, s.value), s.label && /* @__PURE__ */ import_react22.default.createElement("span", { style: statLabel }, s.label)))), mostRecentAction && /* @__PURE__ */ import_react22.default.createElement("div", { style: actionLine, title: mostRecentAction }, mostRecentAction), /* @__PURE__ */ import_react22.default.createElement("div", null), /* @__PURE__ */ import_react22.default.createElement("div", { style: footerRow }, /* @__PURE__ */ import_react22.default.createElement(
|
|
3199
3872
|
"button",
|
|
3200
3873
|
{
|
|
3201
3874
|
onClick: () => {
|
|
@@ -3220,12 +3893,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
3220
3893
|
}
|
|
3221
3894
|
},
|
|
3222
3895
|
"View Full Legislative Record",
|
|
3223
|
-
/* @__PURE__ */
|
|
3896
|
+
/* @__PURE__ */ import_react22.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ import_react22.default.createElement("path", { d: "M9 18l6-6-6-6" }))
|
|
3224
3897
|
)));
|
|
3225
3898
|
}
|
|
3226
3899
|
|
|
3227
3900
|
// src/JudicialScorecard.jsx
|
|
3228
|
-
var
|
|
3901
|
+
var import_react23 = __toESM(require("react"));
|
|
3229
3902
|
|
|
3230
3903
|
// src/judicialUtils.js
|
|
3231
3904
|
function formatDate(dateStr) {
|
|
@@ -3343,7 +4016,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
3343
4016
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
3344
4017
|
}
|
|
3345
4018
|
};
|
|
3346
|
-
return /* @__PURE__ */
|
|
4019
|
+
return /* @__PURE__ */ import_react23.default.createElement("section", { style: sectionStyle }, /* @__PURE__ */ import_react23.default.createElement("h3", { style: headingStyle }, "Judicial Record"), evaluations.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginBottom: "16px" } }, evaluations.slice(0, 3).map((ev, i) => /* @__PURE__ */ import_react23.default.createElement("span", { key: i, style: evalChipStyle }, ev.rating, /* @__PURE__ */ import_react23.default.createElement("span", { style: { fontWeight: 400, color: "#4a90a4", fontSize: "11px" } }, "\u2014 ", ev.source)))), metrics.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: cardGridStyle }, metrics.slice(0, 4).map((m, i) => /* @__PURE__ */ import_react23.default.createElement("div", { key: i, style: metricCardStyle }, /* @__PURE__ */ import_react23.default.createElement("div", { style: metricLabelStyle }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react23.default.createElement("div", { style: metricValueStyle }, formatMetricValue(m.metric_type, m.value)), m.context_label && /* @__PURE__ */ import_react23.default.createElement("div", { style: metricContextStyle }, m.context_label)))), disciplinary.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginBottom: "12px" } }, disciplinary.slice(0, 2).map((d, i) => /* @__PURE__ */ import_react23.default.createElement("div", { key: i, style: disciplinaryStyle }, /* @__PURE__ */ import_react23.default.createElement("strong", null, d.record_type), " \u2014 ", formatDate(d.record_date), d.description && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginTop: "4px" } }, d.description)))), /* @__PURE__ */ import_react23.default.createElement("a", { href: `/politician/${politicianId}/judicial-record`, onClick: handleNavigate, style: linkStyle }, "View Full Judicial Record \u2192"));
|
|
3347
4020
|
}
|
|
3348
4021
|
|
|
3349
4022
|
// src/PoliticianProfile.jsx
|
|
@@ -3494,13 +4167,13 @@ function formatAddress(addr) {
|
|
|
3494
4167
|
if (cityStateZip) lines.push(cityStateZip);
|
|
3495
4168
|
return lines;
|
|
3496
4169
|
}
|
|
3497
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3498
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3499
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3500
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3501
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3502
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3503
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4170
|
+
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
4171
|
+
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react24.default.createElement("polyline", { points: "12 6 12 12 16 14" }));
|
|
4172
|
+
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }), /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "10", r: "3" }));
|
|
4173
|
+
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 10.8 19.79 19.79 0 01.07 2.18 2 2 0 012.02 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" }));
|
|
4174
|
+
var MailIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M4 4H20C21.1 4 22 4.9 22 6V18C22 19.1 21.1 20 20 20H4C2.9 20 2 19.1 2 18V6C2 4.9 2.9 4 4 4Z" }), /* @__PURE__ */ import_react24.default.createElement("path", { d: "M22 6L12 13L2 6" }));
|
|
4175
|
+
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react24.default.createElement("path", { d: "M2 12H22M12 2C14.5 4.5 16 8 16 12C16 16 14.5 19.5 12 22C9.5 19.5 8 16 8 12C8 8 9.5 4.5 12 2Z" }));
|
|
4176
|
+
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }), /* @__PURE__ */ import_react24.default.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" }));
|
|
3504
4177
|
function PoliticianProfile({
|
|
3505
4178
|
politician = {},
|
|
3506
4179
|
onBack,
|
|
@@ -3527,8 +4200,8 @@ function PoliticianProfile({
|
|
|
3527
4200
|
return pol.photo_origin_url;
|
|
3528
4201
|
})();
|
|
3529
4202
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
3530
|
-
const [imgError, setImgError] = (0,
|
|
3531
|
-
(0,
|
|
4203
|
+
const [imgError, setImgError] = (0, import_react24.useState)(false);
|
|
4204
|
+
(0, import_react24.useEffect)(() => {
|
|
3532
4205
|
setImgError(false);
|
|
3533
4206
|
}, [profileImageUrl]);
|
|
3534
4207
|
const getSocialHandle = (type) => {
|
|
@@ -3828,7 +4501,7 @@ function PoliticianProfile({
|
|
|
3828
4501
|
borderRadius: borderRadius.full
|
|
3829
4502
|
}
|
|
3830
4503
|
};
|
|
3831
|
-
return /* @__PURE__ */
|
|
4504
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ import_react24.default.createElement(
|
|
3832
4505
|
"button",
|
|
3833
4506
|
{
|
|
3834
4507
|
type: "button",
|
|
@@ -3841,9 +4514,9 @@ function PoliticianProfile({
|
|
|
3841
4514
|
e.currentTarget.style.textDecoration = "none";
|
|
3842
4515
|
}
|
|
3843
4516
|
},
|
|
3844
|
-
/* @__PURE__ */
|
|
4517
|
+
/* @__PURE__ */ import_react24.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M15 19l-7-7 7-7" })),
|
|
3845
4518
|
label
|
|
3846
|
-
), /* @__PURE__ */
|
|
4519
|
+
), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.card }, /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.heroRow }, /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.photoWrap }, profileImageUrl && !imgError ? /* @__PURE__ */ import_react24.default.createElement(
|
|
3847
4520
|
"img",
|
|
3848
4521
|
{
|
|
3849
4522
|
src: profileImageUrl,
|
|
@@ -3851,7 +4524,7 @@ function PoliticianProfile({
|
|
|
3851
4524
|
style: styles2.photo,
|
|
3852
4525
|
onError: () => setImgError(true)
|
|
3853
4526
|
}
|
|
3854
|
-
) : /* @__PURE__ */
|
|
4527
|
+
) : /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ import_react24.default.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ import_react24.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react24.default.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ import_react24.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react24.default.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ import_react24.default.createElement(
|
|
3855
4528
|
"a",
|
|
3856
4529
|
{
|
|
3857
4530
|
href: pol.web_form_url,
|
|
@@ -3865,9 +4538,9 @@ function PoliticianProfile({
|
|
|
3865
4538
|
e.currentTarget.style.background = colors.evTeal;
|
|
3866
4539
|
}
|
|
3867
4540
|
},
|
|
3868
|
-
/* @__PURE__ */
|
|
4541
|
+
/* @__PURE__ */ import_react24.default.createElement(ExternalLinkIcon, { size: 14 }),
|
|
3869
4542
|
"Submit a Message"
|
|
3870
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
4543
|
+
))), hasContactInfo && /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react24.default.createElement("div", { style: sectionHeading }, /* @__PURE__ */ import_react24.default.createElement(MailIcon, { size: 20 }), "Contact Information"), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGrid }, hasAddresses && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(MapPinIcon, { size: 12 }), "Addresses"), addresses.map((addr, i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `addr-${i}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, addr.type), /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactValue }, addr.lines.map((line, j) => /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, { key: j }, line, j < addr.lines.length - 1 && /* @__PURE__ */ import_react24.default.createElement("br", null))))))), hasPhones && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(PhoneIcon, { size: 12 }), "Phone"), Object.entries(phonesByType).map(([type, phones], i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `phone-${type}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), phones.map((phone, j) => /* @__PURE__ */ import_react24.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
3871
4544
|
"a",
|
|
3872
4545
|
{
|
|
3873
4546
|
href: `tel:${phone}`,
|
|
@@ -3880,7 +4553,7 @@ function PoliticianProfile({
|
|
|
3880
4553
|
}
|
|
3881
4554
|
},
|
|
3882
4555
|
phone
|
|
3883
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
4556
|
+
)))))), hasEmails && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(MailIcon, { size: 12 }), "Email"), Object.entries(emailsByType).filter(([, emails]) => emails.some((e) => e && e.trim())).map(([type, emails], i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `email-${type}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), emails.filter((e) => e && e.trim()).map((email, j) => /* @__PURE__ */ import_react24.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
3884
4557
|
"a",
|
|
3885
4558
|
{
|
|
3886
4559
|
href: `mailto:${email}`,
|
|
@@ -3893,7 +4566,7 @@ function PoliticianProfile({
|
|
|
3893
4566
|
}
|
|
3894
4567
|
},
|
|
3895
4568
|
email
|
|
3896
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
4569
|
+
)))))), hasWebsitesCol && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(GlobeIcon, { size: 12 }), "Websites"), allWebsites.map((url, i) => /* @__PURE__ */ import_react24.default.createElement("p", { key: i, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
3897
4570
|
"a",
|
|
3898
4571
|
{
|
|
3899
4572
|
href: url,
|
|
@@ -3908,7 +4581,7 @@ function PoliticianProfile({
|
|
|
3908
4581
|
}
|
|
3909
4582
|
},
|
|
3910
4583
|
extractDomain(url)
|
|
3911
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
4584
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ import_react24.default.createElement(
|
|
3912
4585
|
SocialLinks,
|
|
3913
4586
|
{
|
|
3914
4587
|
twitter,
|
|
@@ -3919,14 +4592,14 @@ function PoliticianProfile({
|
|
|
3919
4592
|
size: "sm",
|
|
3920
4593
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
3921
4594
|
}
|
|
3922
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
4595
|
+
)))), committees.length > 0 && /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react24.default.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ import_react24.default.createElement(
|
|
3923
4596
|
JudicialScorecard,
|
|
3924
4597
|
{
|
|
3925
4598
|
judicialRecord,
|
|
3926
4599
|
politicianId,
|
|
3927
4600
|
onNavigateToRecord
|
|
3928
4601
|
}
|
|
3929
|
-
) : /* @__PURE__ */
|
|
4602
|
+
) : /* @__PURE__ */ import_react24.default.createElement(
|
|
3930
4603
|
LegislativeInlineSummary,
|
|
3931
4604
|
{
|
|
3932
4605
|
summary: legislativeSummary,
|
|
@@ -3937,7 +4610,7 @@ function PoliticianProfile({
|
|
|
3937
4610
|
}
|
|
3938
4611
|
|
|
3939
4612
|
// src/LegislativeRecord.jsx
|
|
3940
|
-
var
|
|
4613
|
+
var import_react25 = __toESM(require("react"));
|
|
3941
4614
|
var DEFAULT_LIMIT = 25;
|
|
3942
4615
|
function normalizeText(str) {
|
|
3943
4616
|
if (!str) return "";
|
|
@@ -4017,7 +4690,7 @@ function getPositionBadge(position) {
|
|
|
4017
4690
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
4018
4691
|
}
|
|
4019
4692
|
function Badge({ label, bg, text }) {
|
|
4020
|
-
return /* @__PURE__ */
|
|
4693
|
+
return /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4021
4694
|
display: "inline-block",
|
|
4022
4695
|
background: bg,
|
|
4023
4696
|
color: text,
|
|
@@ -4030,18 +4703,18 @@ function Badge({ label, bg, text }) {
|
|
|
4030
4703
|
} }, label);
|
|
4031
4704
|
}
|
|
4032
4705
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
4033
|
-
return /* @__PURE__ */
|
|
4706
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4034
4707
|
display: "flex",
|
|
4035
4708
|
alignItems: "center",
|
|
4036
4709
|
justifyContent: "space-between",
|
|
4037
4710
|
marginBottom: spacing[4]
|
|
4038
|
-
} }, /* @__PURE__ */
|
|
4711
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("h2", { style: {
|
|
4039
4712
|
fontFamily: fonts.primary,
|
|
4040
4713
|
fontSize: fontSizes.xl,
|
|
4041
4714
|
fontWeight: fontWeights.bold,
|
|
4042
4715
|
color: colors.evTeal,
|
|
4043
4716
|
margin: 0
|
|
4044
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
4717
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ import_react25.default.createElement(
|
|
4045
4718
|
"select",
|
|
4046
4719
|
{
|
|
4047
4720
|
value: yearFilter,
|
|
@@ -4057,13 +4730,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
4057
4730
|
cursor: "pointer"
|
|
4058
4731
|
}
|
|
4059
4732
|
},
|
|
4060
|
-
/* @__PURE__ */
|
|
4061
|
-
years.map((y) => /* @__PURE__ */
|
|
4733
|
+
/* @__PURE__ */ import_react25.default.createElement("option", { value: "All" }, "All years"),
|
|
4734
|
+
years.map((y) => /* @__PURE__ */ import_react25.default.createElement("option", { key: y, value: y }, y))
|
|
4062
4735
|
));
|
|
4063
4736
|
}
|
|
4064
4737
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
4065
4738
|
if (totalCount <= visibleCount) return null;
|
|
4066
|
-
return /* @__PURE__ */
|
|
4739
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
4067
4740
|
"button",
|
|
4068
4741
|
{
|
|
4069
4742
|
type: "button",
|
|
@@ -4091,7 +4764,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
4091
4764
|
));
|
|
4092
4765
|
}
|
|
4093
4766
|
function EmptyState({ message }) {
|
|
4094
|
-
return /* @__PURE__ */
|
|
4767
|
+
return /* @__PURE__ */ import_react25.default.createElement("p", { style: {
|
|
4095
4768
|
fontFamily: fonts.primary,
|
|
4096
4769
|
fontSize: fontSizes.sm,
|
|
4097
4770
|
color: colors.textMuted,
|
|
@@ -4101,24 +4774,24 @@ function EmptyState({ message }) {
|
|
|
4101
4774
|
} }, message);
|
|
4102
4775
|
}
|
|
4103
4776
|
function Spinner() {
|
|
4104
|
-
return /* @__PURE__ */
|
|
4777
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4105
4778
|
display: "flex",
|
|
4106
4779
|
justifyContent: "center",
|
|
4107
4780
|
alignItems: "center",
|
|
4108
4781
|
padding: spacing[10]
|
|
4109
|
-
} }, /* @__PURE__ */
|
|
4782
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4110
4783
|
width: "40px",
|
|
4111
4784
|
height: "40px",
|
|
4112
4785
|
borderRadius: borderRadius.full,
|
|
4113
4786
|
border: `3px solid ${colors.borderLight}`,
|
|
4114
4787
|
borderTopColor: colors.evTeal,
|
|
4115
4788
|
animation: "ev-spin 0.8s linear infinite"
|
|
4116
|
-
} }), /* @__PURE__ */
|
|
4789
|
+
} }), /* @__PURE__ */ import_react25.default.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
4117
4790
|
}
|
|
4118
4791
|
function CommitteesSection({ committees, leadership }) {
|
|
4119
|
-
const [showAll, setShowAll] = (0,
|
|
4792
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
4120
4793
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
4121
|
-
return /* @__PURE__ */
|
|
4794
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(SectionHeader, { title: "Committees & Leadership" }), leadership && leadership.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: spacing[2], marginBottom: spacing[4] } }, leadership.map((role, i) => /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
4122
4795
|
display: "inline-flex",
|
|
4123
4796
|
alignItems: "center",
|
|
4124
4797
|
gap: spacing[1],
|
|
@@ -4129,23 +4802,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
4129
4802
|
fontFamily: fonts.primary,
|
|
4130
4803
|
fontSize: fontSizes.sm,
|
|
4131
4804
|
fontWeight: fontWeights.semibold
|
|
4132
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
4805
|
+
} }, role.title, role.chamber && /* @__PURE__ */ import_react25.default.createElement("span", { style: { fontWeight: fontWeights.regular, opacity: 0.85 } }, "(", role.chamber, ")")))), committees.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Committee information is not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((c, i) => {
|
|
4133
4806
|
const badge = getRoleBadge(c.role);
|
|
4134
|
-
return /* @__PURE__ */
|
|
4807
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
4135
4808
|
display: "flex",
|
|
4136
4809
|
alignItems: "center",
|
|
4137
4810
|
justifyContent: "space-between",
|
|
4138
4811
|
padding: `${spacing[3]} 0`,
|
|
4139
4812
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
4140
4813
|
gap: spacing[3]
|
|
4141
|
-
} }, /* @__PURE__ */
|
|
4814
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4142
4815
|
fontFamily: fonts.primary,
|
|
4143
4816
|
fontSize: fontSizes.sm,
|
|
4144
4817
|
color: colors.textSecondary,
|
|
4145
4818
|
flex: 1,
|
|
4146
4819
|
minWidth: 0
|
|
4147
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
4148
|
-
})), !showAll && /* @__PURE__ */
|
|
4820
|
+
} }, c.committee_name, c.parent_name && /* @__PURE__ */ import_react25.default.createElement("span", { style: { color: colors.textMuted, marginLeft: spacing[1] } }, "(", c.parent_name, ")")), /* @__PURE__ */ import_react25.default.createElement(Badge, { label: badge.label, bg: badge.bg, text: badge.text }));
|
|
4821
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
4149
4822
|
ShowAllLink,
|
|
4150
4823
|
{
|
|
4151
4824
|
totalCount: committees.length,
|
|
@@ -4156,15 +4829,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
4156
4829
|
}
|
|
4157
4830
|
function LegislationSection({ bills, isMobile }) {
|
|
4158
4831
|
const years = getYears(bills, "introduced_at");
|
|
4159
|
-
const [yearFilter, setYearFilter] = (0,
|
|
4160
|
-
const [showAll, setShowAll] = (0,
|
|
4832
|
+
const [yearFilter, setYearFilter] = (0, import_react25.useState)("All");
|
|
4833
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
4161
4834
|
const handleYearChange = (y) => {
|
|
4162
4835
|
setYearFilter(y);
|
|
4163
4836
|
setShowAll(false);
|
|
4164
4837
|
};
|
|
4165
4838
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
4166
4839
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
4167
|
-
return /* @__PURE__ */
|
|
4840
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
4168
4841
|
SectionHeader,
|
|
4169
4842
|
{
|
|
4170
4843
|
title: "Sponsored Legislation",
|
|
@@ -4172,42 +4845,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
4172
4845
|
years,
|
|
4173
4846
|
onYearChange: handleYearChange
|
|
4174
4847
|
}
|
|
4175
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
4848
|
+
), bills.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Sponsored legislation data is not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((bill, i) => {
|
|
4176
4849
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
4177
|
-
return /* @__PURE__ */
|
|
4850
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
4178
4851
|
display: "flex",
|
|
4179
4852
|
flexDirection: isMobile ? "column" : "row",
|
|
4180
4853
|
alignItems: isMobile ? "flex-start" : "center",
|
|
4181
4854
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
4182
4855
|
padding: `${spacing[3]} 0`,
|
|
4183
4856
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
4184
|
-
} }, /* @__PURE__ */
|
|
4857
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4185
4858
|
fontFamily: fonts.primary,
|
|
4186
4859
|
fontSize: fontSizes.xs,
|
|
4187
4860
|
fontWeight: fontWeights.bold,
|
|
4188
4861
|
color: colors.textSecondary,
|
|
4189
4862
|
marginRight: spacing[2]
|
|
4190
|
-
} }, bill.number), /* @__PURE__ */
|
|
4863
|
+
} }, bill.number), /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4191
4864
|
fontFamily: fonts.primary,
|
|
4192
4865
|
fontSize: fontSizes.sm,
|
|
4193
4866
|
color: colors.textSecondary
|
|
4194
|
-
} }, bill.title)), /* @__PURE__ */
|
|
4867
|
+
} }, bill.title)), /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4195
4868
|
display: "flex",
|
|
4196
4869
|
alignItems: "center",
|
|
4197
4870
|
gap: spacing[2],
|
|
4198
4871
|
flexShrink: 0,
|
|
4199
4872
|
flexWrap: "wrap"
|
|
4200
|
-
} }, /* @__PURE__ */
|
|
4873
|
+
} }, /* @__PURE__ */ import_react25.default.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4201
4874
|
fontFamily: fonts.primary,
|
|
4202
4875
|
fontSize: fontSizes.xs,
|
|
4203
4876
|
color: colors.textMuted
|
|
4204
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
4877
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4205
4878
|
fontFamily: fonts.primary,
|
|
4206
4879
|
fontSize: fontSizes.xs,
|
|
4207
4880
|
color: colors.textMuted,
|
|
4208
4881
|
fontStyle: "italic"
|
|
4209
4882
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
4210
|
-
})), !showAll && /* @__PURE__ */
|
|
4883
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
4211
4884
|
ShowAllLink,
|
|
4212
4885
|
{
|
|
4213
4886
|
totalCount: filtered.length,
|
|
@@ -4218,15 +4891,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
4218
4891
|
}
|
|
4219
4892
|
function VotingSection({ votes, isMobile }) {
|
|
4220
4893
|
const years = getYears(votes, "vote_date");
|
|
4221
|
-
const [yearFilter, setYearFilter] = (0,
|
|
4222
|
-
const [showAll, setShowAll] = (0,
|
|
4894
|
+
const [yearFilter, setYearFilter] = (0, import_react25.useState)("All");
|
|
4895
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
4223
4896
|
const handleYearChange = (y) => {
|
|
4224
4897
|
setYearFilter(y);
|
|
4225
4898
|
setShowAll(false);
|
|
4226
4899
|
};
|
|
4227
4900
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
4228
4901
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
4229
|
-
return /* @__PURE__ */
|
|
4902
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
4230
4903
|
SectionHeader,
|
|
4231
4904
|
{
|
|
4232
4905
|
title: "Voting Record",
|
|
@@ -4234,38 +4907,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
4234
4907
|
years,
|
|
4235
4908
|
onYearChange: handleYearChange
|
|
4236
4909
|
}
|
|
4237
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
4910
|
+
), votes.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Voting records are not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((vote, i) => {
|
|
4238
4911
|
const positionBadge = getPositionBadge(vote.position);
|
|
4239
4912
|
const normPosition = normalizeText(vote.position);
|
|
4240
4913
|
const topic = vote.bill_title || vote.vote_question;
|
|
4241
4914
|
const sourceUrl = vote.bill_url;
|
|
4242
|
-
return /* @__PURE__ */
|
|
4915
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
4243
4916
|
display: "flex",
|
|
4244
4917
|
flexDirection: isMobile ? "column" : "row",
|
|
4245
4918
|
alignItems: isMobile ? "flex-start" : "center",
|
|
4246
4919
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
4247
4920
|
padding: `${spacing[3]} 0`,
|
|
4248
4921
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
4249
|
-
} }, /* @__PURE__ */
|
|
4922
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4250
4923
|
fontFamily: fonts.primary,
|
|
4251
4924
|
fontSize: fontSizes.sm,
|
|
4252
4925
|
color: colors.textSecondary
|
|
4253
|
-
} }, topic)), /* @__PURE__ */
|
|
4926
|
+
} }, topic)), /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4254
4927
|
display: "flex",
|
|
4255
4928
|
alignItems: "center",
|
|
4256
4929
|
gap: spacing[2],
|
|
4257
4930
|
flexShrink: 0,
|
|
4258
4931
|
flexWrap: "wrap"
|
|
4259
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
4932
|
+
} }, vote.vote_date && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4260
4933
|
fontFamily: fonts.primary,
|
|
4261
4934
|
fontSize: fontSizes.xs,
|
|
4262
4935
|
color: colors.textMuted
|
|
4263
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
4936
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ import_react25.default.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4264
4937
|
fontFamily: fonts.primary,
|
|
4265
4938
|
fontSize: fontSizes.xs,
|
|
4266
4939
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
4267
4940
|
fontWeight: fontWeights.medium
|
|
4268
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
4941
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ import_react25.default.createElement(
|
|
4269
4942
|
"a",
|
|
4270
4943
|
{
|
|
4271
4944
|
href: sourceUrl,
|
|
@@ -4286,7 +4959,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
4286
4959
|
},
|
|
4287
4960
|
"Source"
|
|
4288
4961
|
)));
|
|
4289
|
-
})), !showAll && /* @__PURE__ */
|
|
4962
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
4290
4963
|
ShowAllLink,
|
|
4291
4964
|
{
|
|
4292
4965
|
totalCount: filtered.length,
|
|
@@ -4305,20 +4978,20 @@ function LegislativeRecord({
|
|
|
4305
4978
|
}) {
|
|
4306
4979
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
4307
4980
|
if (loading) {
|
|
4308
|
-
return /* @__PURE__ */
|
|
4981
|
+
return /* @__PURE__ */ import_react25.default.createElement(Spinner, null);
|
|
4309
4982
|
}
|
|
4310
|
-
return /* @__PURE__ */
|
|
4983
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ import_react25.default.createElement("h1", { style: {
|
|
4311
4984
|
fontFamily: fonts.primary,
|
|
4312
4985
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
4313
4986
|
fontWeight: fontWeights.bold,
|
|
4314
4987
|
color: colors.evTeal,
|
|
4315
4988
|
marginBottom: spacing[8],
|
|
4316
4989
|
marginTop: 0
|
|
4317
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
4990
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ import_react25.default.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ import_react25.default.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ import_react25.default.createElement(VotingSection, { votes, isMobile }));
|
|
4318
4991
|
}
|
|
4319
4992
|
|
|
4320
4993
|
// src/JudicialRecordDetail.jsx
|
|
4321
|
-
var
|
|
4994
|
+
var import_react26 = __toESM(require("react"));
|
|
4322
4995
|
var containerStyle = {
|
|
4323
4996
|
fontFamily: "'Manrope', sans-serif",
|
|
4324
4997
|
maxWidth: "800px"
|
|
@@ -4403,7 +5076,7 @@ var emptyStateStyle = {
|
|
|
4403
5076
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
4404
5077
|
var _a;
|
|
4405
5078
|
if (!judicialRecord) {
|
|
4406
|
-
return /* @__PURE__ */
|
|
5079
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react26.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No judicial record data available."));
|
|
4407
5080
|
}
|
|
4408
5081
|
const {
|
|
4409
5082
|
judge_detail: detail,
|
|
@@ -4412,13 +5085,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
4412
5085
|
disciplinary_records: disciplinary = []
|
|
4413
5086
|
} = judicialRecord;
|
|
4414
5087
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
4415
|
-
return /* @__PURE__ */
|
|
5088
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react26.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react26.default.createElement("h1", { style: nameStyle }, displayName), /* @__PURE__ */ import_react26.default.createElement("p", { style: roleStyle }, (detail == null ? void 0 : detail.court_role) || politician.office_title, (detail == null ? void 0 : detail.date_seated) && ` \xB7 Seated ${formatDate(detail.date_seated)}`), detail && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Background"), detail.appointed_by && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Appointed by"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.appointed_by, " (", detail.appointing_president_party, ")")), detail.confirmation_vote && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Confirmation Vote"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.confirmation_vote)), detail.election_type && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Election Type"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.election_type === "retention" ? "Retention (Yes/No)" : "Contested Election")), ((_a = detail.areas_of_focus) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Areas of Focus"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.areas_of_focus.join(", ")))), /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Evaluations"), evaluations.length === 0 ? /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No evaluation data available yet.") : /* @__PURE__ */ import_react26.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react26.default.createElement("thead", null, /* @__PURE__ */ import_react26.default.createElement("tr", null, /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Source"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Rating"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Date"))), /* @__PURE__ */ import_react26.default.createElement("tbody", null, evaluations.map((ev, i) => /* @__PURE__ */ import_react26.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, ev.source_url ? /* @__PURE__ */ import_react26.default.createElement("a", { href: ev.source_url, target: "_blank", rel: "noopener noreferrer", style: { color: "#319795" } }, ev.source) : ev.source), /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, ev.rating), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, formatDate(ev.rating_date)))))), /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Metrics"), metrics.length === 0 ? /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No performance metric data available yet.") : /* @__PURE__ */ import_react26.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react26.default.createElement("thead", null, /* @__PURE__ */ import_react26.default.createElement("tr", null, /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Metric"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Value"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Context"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Period"))), /* @__PURE__ */ import_react26.default.createElement("tbody", null, metrics.map((m, i) => /* @__PURE__ */ import_react26.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, formatMetricValue(m.metric_type, m.value)), /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, color: "#718096", fontSize: "13px" } }, m.context_label), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, m.time_period))))), disciplinary.length > 0 && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Disciplinary History"), disciplinary.map((d, i) => /* @__PURE__ */ import_react26.default.createElement("div", { key: i, style: {
|
|
4416
5089
|
borderLeft: "3px solid #fc8181",
|
|
4417
5090
|
backgroundColor: "#fff5f5",
|
|
4418
5091
|
borderRadius: "0 6px 6px 0",
|
|
4419
5092
|
padding: "12px 16px",
|
|
4420
5093
|
marginBottom: "10px"
|
|
4421
|
-
} }, /* @__PURE__ */
|
|
5094
|
+
} }, /* @__PURE__ */ import_react26.default.createElement("div", { style: { fontWeight: 700, color: "#742a2a", fontSize: "14px" } }, d.record_type, " \u2014 ", formatDate(d.record_date)), d.description && /* @__PURE__ */ import_react26.default.createElement("div", { style: { color: "#9b2c2c", fontSize: "13px", marginTop: "4px" } }, d.description), d.source_url && /* @__PURE__ */ import_react26.default.createElement(
|
|
4422
5095
|
"a",
|
|
4423
5096
|
{
|
|
4424
5097
|
href: d.source_url,
|
|
@@ -4431,7 +5104,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
4431
5104
|
}
|
|
4432
5105
|
|
|
4433
5106
|
// src/AuthForm.jsx
|
|
4434
|
-
var
|
|
5107
|
+
var import_react27 = __toESM(require("react"));
|
|
4435
5108
|
function AuthForm({
|
|
4436
5109
|
logoSrc = "/EVLogo.svg",
|
|
4437
5110
|
appName = "Empowered Vote",
|
|
@@ -4442,11 +5115,11 @@ function AuthForm({
|
|
|
4442
5115
|
error = null,
|
|
4443
5116
|
submitting = false
|
|
4444
5117
|
}) {
|
|
4445
|
-
const [username, setUsername] = (0,
|
|
4446
|
-
const [password, setPassword] = (0,
|
|
4447
|
-
const [confirmPassword, setConfirmPassword] = (0,
|
|
4448
|
-
const [showPasswords, setShowPasswords] = (0,
|
|
4449
|
-
const [passwordMismatch, setPasswordMismatch] = (0,
|
|
5118
|
+
const [username, setUsername] = (0, import_react27.useState)("");
|
|
5119
|
+
const [password, setPassword] = (0, import_react27.useState)("");
|
|
5120
|
+
const [confirmPassword, setConfirmPassword] = (0, import_react27.useState)("");
|
|
5121
|
+
const [showPasswords, setShowPasswords] = (0, import_react27.useState)(false);
|
|
5122
|
+
const [passwordMismatch, setPasswordMismatch] = (0, import_react27.useState)(false);
|
|
4450
5123
|
const isLogin = mode === "login";
|
|
4451
5124
|
const handleSubmit = (e) => {
|
|
4452
5125
|
e.preventDefault();
|
|
@@ -4458,7 +5131,7 @@ function AuthForm({
|
|
|
4458
5131
|
setPasswordMismatch(false);
|
|
4459
5132
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
4460
5133
|
};
|
|
4461
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
5134
|
+
const EyeOpen = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
4462
5135
|
"svg",
|
|
4463
5136
|
{
|
|
4464
5137
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4468,7 +5141,7 @@ function AuthForm({
|
|
|
4468
5141
|
stroke: "currentColor",
|
|
4469
5142
|
style: { width: "20px", height: "20px" }
|
|
4470
5143
|
},
|
|
4471
|
-
/* @__PURE__ */
|
|
5144
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
4472
5145
|
"path",
|
|
4473
5146
|
{
|
|
4474
5147
|
strokeLinecap: "round",
|
|
@@ -4476,7 +5149,7 @@ function AuthForm({
|
|
|
4476
5149
|
d: "M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"
|
|
4477
5150
|
}
|
|
4478
5151
|
),
|
|
4479
|
-
/* @__PURE__ */
|
|
5152
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
4480
5153
|
"path",
|
|
4481
5154
|
{
|
|
4482
5155
|
strokeLinecap: "round",
|
|
@@ -4485,7 +5158,7 @@ function AuthForm({
|
|
|
4485
5158
|
}
|
|
4486
5159
|
)
|
|
4487
5160
|
);
|
|
4488
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
5161
|
+
const EyeClosed = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
4489
5162
|
"svg",
|
|
4490
5163
|
{
|
|
4491
5164
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4495,7 +5168,7 @@ function AuthForm({
|
|
|
4495
5168
|
stroke: "currentColor",
|
|
4496
5169
|
style: { width: "20px", height: "20px" }
|
|
4497
5170
|
},
|
|
4498
|
-
/* @__PURE__ */
|
|
5171
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
4499
5172
|
"path",
|
|
4500
5173
|
{
|
|
4501
5174
|
strokeLinecap: "round",
|
|
@@ -4504,17 +5177,17 @@ function AuthForm({
|
|
|
4504
5177
|
}
|
|
4505
5178
|
)
|
|
4506
5179
|
);
|
|
4507
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
5180
|
+
const PasswordToggle = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
4508
5181
|
"button",
|
|
4509
5182
|
{
|
|
4510
5183
|
type: "button",
|
|
4511
5184
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
4512
5185
|
style: styles.passwordToggle
|
|
4513
5186
|
},
|
|
4514
|
-
showPasswords ? /* @__PURE__ */
|
|
5187
|
+
showPasswords ? /* @__PURE__ */ import_react27.default.createElement(EyeOpen, null) : /* @__PURE__ */ import_react27.default.createElement(EyeClosed, null)
|
|
4515
5188
|
);
|
|
4516
5189
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
4517
|
-
return /* @__PURE__ */
|
|
5190
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.wrapper }, /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.container }, /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.header }, logoSrc && /* @__PURE__ */ import_react27.default.createElement("img", { src: logoSrc, alt: appName, style: styles.logo }), appName && /* @__PURE__ */ import_react27.default.createElement("h1", { style: styles.appName }, appName), appSubtitle && /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.appSubtitle }, appSubtitle)), /* @__PURE__ */ import_react27.default.createElement("form", { onSubmit: handleSubmit, style: styles.card }, /* @__PURE__ */ import_react27.default.createElement("h2", { style: styles.cardTitle }, isLogin ? "Welcome Back" : "Create Account"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Username"), /* @__PURE__ */ import_react27.default.createElement(
|
|
4518
5191
|
"input",
|
|
4519
5192
|
{
|
|
4520
5193
|
type: "text",
|
|
@@ -4531,7 +5204,7 @@ function AuthForm({
|
|
|
4531
5204
|
},
|
|
4532
5205
|
required: true
|
|
4533
5206
|
}
|
|
4534
|
-
)), /* @__PURE__ */
|
|
5207
|
+
)), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Password"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react27.default.createElement(
|
|
4535
5208
|
"input",
|
|
4536
5209
|
{
|
|
4537
5210
|
type: showPasswords ? "text" : "password",
|
|
@@ -4547,7 +5220,7 @@ function AuthForm({
|
|
|
4547
5220
|
},
|
|
4548
5221
|
required: true
|
|
4549
5222
|
}
|
|
4550
|
-
), /* @__PURE__ */
|
|
5223
|
+
), /* @__PURE__ */ import_react27.default.createElement(PasswordToggle, null))), !isLogin && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Confirm Password"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react27.default.createElement(
|
|
4551
5224
|
"input",
|
|
4552
5225
|
{
|
|
4553
5226
|
type: showPasswords ? "text" : "password",
|
|
@@ -4563,7 +5236,7 @@ function AuthForm({
|
|
|
4563
5236
|
},
|
|
4564
5237
|
required: true
|
|
4565
5238
|
}
|
|
4566
|
-
), /* @__PURE__ */
|
|
5239
|
+
), /* @__PURE__ */ import_react27.default.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ import_react27.default.createElement(
|
|
4567
5240
|
"button",
|
|
4568
5241
|
{
|
|
4569
5242
|
type: "submit",
|
|
@@ -4581,7 +5254,7 @@ function AuthForm({
|
|
|
4581
5254
|
}
|
|
4582
5255
|
},
|
|
4583
5256
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
4584
|
-
), onModeSwitch && /* @__PURE__ */
|
|
5257
|
+
), onModeSwitch && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.modeSwitch }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.modeSwitchText }, isLogin ? "Don't have an account?" : "Already have an account?"), /* @__PURE__ */ import_react27.default.createElement(
|
|
4585
5258
|
"button",
|
|
4586
5259
|
{
|
|
4587
5260
|
type: "button",
|
|
@@ -4754,9 +5427,9 @@ var styles = {
|
|
|
4754
5427
|
};
|
|
4755
5428
|
|
|
4756
5429
|
// src/TopicTierBadge.jsx
|
|
4757
|
-
var
|
|
5430
|
+
var import_react28 = __toESM(require("react"));
|
|
4758
5431
|
function LandmarkIcon({ size = 14 }) {
|
|
4759
|
-
return /* @__PURE__ */
|
|
5432
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4760
5433
|
"svg",
|
|
4761
5434
|
{
|
|
4762
5435
|
width: size,
|
|
@@ -4770,16 +5443,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
4770
5443
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4771
5444
|
"aria-hidden": "true"
|
|
4772
5445
|
},
|
|
4773
|
-
/* @__PURE__ */
|
|
4774
|
-
/* @__PURE__ */
|
|
4775
|
-
/* @__PURE__ */
|
|
4776
|
-
/* @__PURE__ */
|
|
4777
|
-
/* @__PURE__ */
|
|
4778
|
-
/* @__PURE__ */
|
|
5446
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 18v-7" }),
|
|
5447
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }),
|
|
5448
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M14 18v-7" }),
|
|
5449
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M18 18v-7" }),
|
|
5450
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M3 22h18" }),
|
|
5451
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 18v-7" })
|
|
4779
5452
|
);
|
|
4780
5453
|
}
|
|
4781
5454
|
function Building2Icon({ size = 14 }) {
|
|
4782
|
-
return /* @__PURE__ */
|
|
5455
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4783
5456
|
"svg",
|
|
4784
5457
|
{
|
|
4785
5458
|
width: size,
|
|
@@ -4793,17 +5466,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
4793
5466
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4794
5467
|
"aria-hidden": "true"
|
|
4795
5468
|
},
|
|
4796
|
-
/* @__PURE__ */
|
|
4797
|
-
/* @__PURE__ */
|
|
4798
|
-
/* @__PURE__ */
|
|
4799
|
-
/* @__PURE__ */
|
|
4800
|
-
/* @__PURE__ */
|
|
4801
|
-
/* @__PURE__ */
|
|
4802
|
-
/* @__PURE__ */
|
|
5469
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
5470
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
5471
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
5472
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 6h4" }),
|
|
5473
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 10h4" }),
|
|
5474
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 14h4" }),
|
|
5475
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 18h4" })
|
|
4803
5476
|
);
|
|
4804
5477
|
}
|
|
4805
5478
|
function HomeIcon({ size = 14 }) {
|
|
4806
|
-
return /* @__PURE__ */
|
|
5479
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4807
5480
|
"svg",
|
|
4808
5481
|
{
|
|
4809
5482
|
width: size,
|
|
@@ -4817,8 +5490,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
4817
5490
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4818
5491
|
"aria-hidden": "true"
|
|
4819
5492
|
},
|
|
4820
|
-
/* @__PURE__ */
|
|
4821
|
-
/* @__PURE__ */
|
|
5493
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
5494
|
+
/* @__PURE__ */ import_react28.default.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
4822
5495
|
);
|
|
4823
5496
|
}
|
|
4824
5497
|
var TIER_INFO = {
|
|
@@ -4878,7 +5551,7 @@ function TopicTierBadge({
|
|
|
4878
5551
|
userSelect: "none"
|
|
4879
5552
|
};
|
|
4880
5553
|
};
|
|
4881
|
-
return /* @__PURE__ */
|
|
5554
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4882
5555
|
"span",
|
|
4883
5556
|
{
|
|
4884
5557
|
className: "ev-topic-tier-badge",
|
|
@@ -4888,13 +5561,13 @@ function TopicTierBadge({
|
|
|
4888
5561
|
},
|
|
4889
5562
|
effectiveTiers.map((tier) => {
|
|
4890
5563
|
const { label, Icon } = TIER_INFO[tier];
|
|
4891
|
-
return /* @__PURE__ */
|
|
5564
|
+
return /* @__PURE__ */ import_react28.default.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ import_react28.default.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ import_react28.default.createElement("span", null, label));
|
|
4892
5565
|
})
|
|
4893
5566
|
);
|
|
4894
5567
|
}
|
|
4895
5568
|
|
|
4896
5569
|
// src/CompassCoverageCallout.jsx
|
|
4897
|
-
var
|
|
5570
|
+
var import_react29 = __toESM(require("react"));
|
|
4898
5571
|
var TIER_LABELS = {
|
|
4899
5572
|
federal: "federal",
|
|
4900
5573
|
state: "state",
|
|
@@ -4907,7 +5580,7 @@ function CompassCoverageCallout({
|
|
|
4907
5580
|
compassUrl,
|
|
4908
5581
|
onDismiss
|
|
4909
5582
|
}) {
|
|
4910
|
-
const [dismissed, setDismissed] = (0,
|
|
5583
|
+
const [dismissed, setDismissed] = (0, import_react29.useState)(false);
|
|
4911
5584
|
if (dismissed) return null;
|
|
4912
5585
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
4913
5586
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -4958,15 +5631,15 @@ function CompassCoverageCallout({
|
|
|
4958
5631
|
setDismissed(true);
|
|
4959
5632
|
if (onDismiss) onDismiss();
|
|
4960
5633
|
};
|
|
4961
|
-
return /* @__PURE__ */
|
|
5634
|
+
return /* @__PURE__ */ import_react29.default.createElement(
|
|
4962
5635
|
"div",
|
|
4963
5636
|
{
|
|
4964
5637
|
className: "ev-compass-coverage-callout",
|
|
4965
5638
|
role: "status",
|
|
4966
5639
|
style: containerStyle2
|
|
4967
5640
|
},
|
|
4968
|
-
/* @__PURE__ */
|
|
4969
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
5641
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { style: textStyle }, /* @__PURE__ */ import_react29.default.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ import_react29.default.createElement("div", null, count === 0 ? `None of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. ` : `Only ${count} of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. `, "Add more ", tierLabel, "-applicable topics to get better comparisons with ", tierLabel, " officials."), /* @__PURE__ */ import_react29.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
5642
|
+
onDismiss !== void 0 && /* @__PURE__ */ import_react29.default.createElement(
|
|
4970
5643
|
"button",
|
|
4971
5644
|
{
|
|
4972
5645
|
onClick: handleDismiss,
|
|
@@ -4979,7 +5652,7 @@ function CompassCoverageCallout({
|
|
|
4979
5652
|
}
|
|
4980
5653
|
|
|
4981
5654
|
// src/ExpandCompassNudge.jsx
|
|
4982
|
-
var
|
|
5655
|
+
var import_react30 = __toESM(require("react"));
|
|
4983
5656
|
function ExpandCompassNudge({
|
|
4984
5657
|
politicianName,
|
|
4985
5658
|
missingCount,
|
|
@@ -5026,7 +5699,7 @@ function ExpandCompassNudge({
|
|
|
5026
5699
|
};
|
|
5027
5700
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
5028
5701
|
const speakerName = politicianName || "This politician";
|
|
5029
|
-
return /* @__PURE__ */
|
|
5702
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ import_react30.default.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ import_react30.default.createElement("p", { style: bodyStyle }, speakerName, " has stances on ", missingCount, " more ", topicsLabel, " you haven't answered yet. Expand your compass to see where you stand on all of them."), /* @__PURE__ */ import_react30.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
5030
5703
|
}
|
|
5031
5704
|
|
|
5032
5705
|
// src/computeTierCoverage.js
|
|
@@ -5047,14 +5720,14 @@ function computeTierCoverage(topics) {
|
|
|
5047
5720
|
}
|
|
5048
5721
|
|
|
5049
5722
|
// src/StanceAccordion.jsx
|
|
5050
|
-
var
|
|
5723
|
+
var import_react32 = __toESM(require("react"));
|
|
5051
5724
|
|
|
5052
5725
|
// src/Favicon.jsx
|
|
5053
|
-
var
|
|
5726
|
+
var import_react31 = __toESM(require("react"));
|
|
5054
5727
|
function Favicon({ url, size = 16 }) {
|
|
5055
5728
|
try {
|
|
5056
5729
|
const domain = new URL(url).hostname;
|
|
5057
|
-
return /* @__PURE__ */
|
|
5730
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5058
5731
|
"img",
|
|
5059
5732
|
{
|
|
5060
5733
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -5065,7 +5738,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
5065
5738
|
}
|
|
5066
5739
|
);
|
|
5067
5740
|
} catch {
|
|
5068
|
-
return /* @__PURE__ */
|
|
5741
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5069
5742
|
"svg",
|
|
5070
5743
|
{
|
|
5071
5744
|
width: size,
|
|
@@ -5076,8 +5749,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
5076
5749
|
strokeWidth: "1.5",
|
|
5077
5750
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
5078
5751
|
},
|
|
5079
|
-
/* @__PURE__ */
|
|
5080
|
-
/* @__PURE__ */
|
|
5752
|
+
/* @__PURE__ */ import_react31.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5753
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
|
|
5081
5754
|
);
|
|
5082
5755
|
}
|
|
5083
5756
|
}
|
|
@@ -5108,11 +5781,11 @@ function StanceAccordion({
|
|
|
5108
5781
|
apiUrl = "https://api.empowered.vote"
|
|
5109
5782
|
}) {
|
|
5110
5783
|
var _a;
|
|
5111
|
-
const [expandedTopicId, setExpandedTopicId] = (0,
|
|
5112
|
-
const [loadingId, setLoadingId] = (0,
|
|
5113
|
-
const [showAll, setShowAll] = (0,
|
|
5114
|
-
const contextCache = (0,
|
|
5115
|
-
const quotesCache = (0,
|
|
5784
|
+
const [expandedTopicId, setExpandedTopicId] = (0, import_react32.useState)(null);
|
|
5785
|
+
const [loadingId, setLoadingId] = (0, import_react32.useState)(null);
|
|
5786
|
+
const [showAll, setShowAll] = (0, import_react32.useState)(false);
|
|
5787
|
+
const contextCache = (0, import_react32.useRef)(/* @__PURE__ */ new Map());
|
|
5788
|
+
const quotesCache = (0, import_react32.useRef)(null);
|
|
5116
5789
|
const polAnswerMap = {};
|
|
5117
5790
|
if (polAnswers) {
|
|
5118
5791
|
polAnswers.forEach((a) => {
|
|
@@ -5171,7 +5844,7 @@ function StanceAccordion({
|
|
|
5171
5844
|
quotesCache.current = [];
|
|
5172
5845
|
}
|
|
5173
5846
|
}
|
|
5174
|
-
const handleToggle = (0,
|
|
5847
|
+
const handleToggle = (0, import_react32.useCallback)(
|
|
5175
5848
|
async (topicId) => {
|
|
5176
5849
|
if (expandedTopicId === topicId) {
|
|
5177
5850
|
setExpandedTopicId(null);
|
|
@@ -5188,7 +5861,7 @@ function StanceAccordion({
|
|
|
5188
5861
|
},
|
|
5189
5862
|
[expandedTopicId, politicianId, apiUrl]
|
|
5190
5863
|
);
|
|
5191
|
-
(0,
|
|
5864
|
+
(0, import_react32.useEffect)(() => {
|
|
5192
5865
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
5193
5866
|
handleToggle(String(initialExpandedTopicId));
|
|
5194
5867
|
}
|
|
@@ -5204,13 +5877,13 @@ function StanceAccordion({
|
|
|
5204
5877
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
5205
5878
|
}
|
|
5206
5879
|
}
|
|
5207
|
-
return /* @__PURE__ */
|
|
5880
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
5208
5881
|
"div",
|
|
5209
5882
|
{
|
|
5210
5883
|
className: "flex flex-col",
|
|
5211
5884
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
5212
5885
|
},
|
|
5213
|
-
/* @__PURE__ */
|
|
5886
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
5214
5887
|
"h3",
|
|
5215
5888
|
{
|
|
5216
5889
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -5232,15 +5905,15 @@ function StanceAccordion({
|
|
|
5232
5905
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
5233
5906
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
5234
5907
|
}) : [];
|
|
5235
|
-
return /* @__PURE__ */
|
|
5908
|
+
return /* @__PURE__ */ import_react32.default.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
5236
5909
|
"button",
|
|
5237
5910
|
{
|
|
5238
5911
|
type: "button",
|
|
5239
5912
|
onClick: () => handleToggle(topicId),
|
|
5240
5913
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
5241
5914
|
},
|
|
5242
|
-
/* @__PURE__ */
|
|
5243
|
-
/* @__PURE__ */
|
|
5915
|
+
/* @__PURE__ */ import_react32.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
5916
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
5244
5917
|
"svg",
|
|
5245
5918
|
{
|
|
5246
5919
|
width: "16",
|
|
@@ -5257,9 +5930,9 @@ function StanceAccordion({
|
|
|
5257
5930
|
transition: "transform 0.2s ease"
|
|
5258
5931
|
}
|
|
5259
5932
|
},
|
|
5260
|
-
/* @__PURE__ */
|
|
5933
|
+
/* @__PURE__ */ import_react32.default.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
5261
5934
|
)
|
|
5262
|
-
), /* @__PURE__ */
|
|
5935
|
+
), /* @__PURE__ */ import_react32.default.createElement(
|
|
5263
5936
|
"div",
|
|
5264
5937
|
{
|
|
5265
5938
|
style: {
|
|
@@ -5268,7 +5941,7 @@ function StanceAccordion({
|
|
|
5268
5941
|
transition: "grid-template-rows 0.25s ease"
|
|
5269
5942
|
}
|
|
5270
5943
|
},
|
|
5271
|
-
/* @__PURE__ */
|
|
5944
|
+
/* @__PURE__ */ import_react32.default.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ import_react32.default.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ import_react32.default.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
5272
5945
|
"div",
|
|
5273
5946
|
{
|
|
5274
5947
|
style: {
|
|
@@ -5280,14 +5953,14 @@ function StanceAccordion({
|
|
|
5280
5953
|
animation: "ev-spin 0.8s linear infinite"
|
|
5281
5954
|
}
|
|
5282
5955
|
}
|
|
5283
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
5956
|
+
)), !isLoading && cached && /* @__PURE__ */ import_react32.default.createElement(import_react32.default.Fragment, null, cached.reasoning ? /* @__PURE__ */ import_react32.default.createElement(
|
|
5284
5957
|
"p",
|
|
5285
5958
|
{
|
|
5286
5959
|
className: "text-sm text-neutral-700 mb-3",
|
|
5287
5960
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
5288
5961
|
},
|
|
5289
5962
|
cached.reasoning
|
|
5290
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
5963
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ import_react32.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react32.default.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ import_react32.default.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ import_react32.default.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
5291
5964
|
"a",
|
|
5292
5965
|
{
|
|
5293
5966
|
href: src,
|
|
@@ -5295,9 +5968,9 @@ function StanceAccordion({
|
|
|
5295
5968
|
rel: "noreferrer",
|
|
5296
5969
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
5297
5970
|
},
|
|
5298
|
-
/* @__PURE__ */
|
|
5299
|
-
/* @__PURE__ */
|
|
5300
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
5971
|
+
/* @__PURE__ */ import_react32.default.createElement(Favicon, { url: src }),
|
|
5972
|
+
/* @__PURE__ */ import_react32.default.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
5973
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ import_react32.default.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ import_react32.default.createElement(
|
|
5301
5974
|
"p",
|
|
5302
5975
|
{
|
|
5303
5976
|
style: {
|
|
@@ -5314,7 +5987,7 @@ function StanceAccordion({
|
|
|
5314
5987
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
5315
5988
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
5316
5989
|
const sourceName = quote.source_name || quote.sourceName;
|
|
5317
|
-
return /* @__PURE__ */
|
|
5990
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
5318
5991
|
"div",
|
|
5319
5992
|
{
|
|
5320
5993
|
key: quote.id,
|
|
@@ -5326,7 +5999,7 @@ function StanceAccordion({
|
|
|
5326
5999
|
marginBottom: "8px"
|
|
5327
6000
|
}
|
|
5328
6001
|
},
|
|
5329
|
-
/* @__PURE__ */
|
|
6002
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
5330
6003
|
"p",
|
|
5331
6004
|
{
|
|
5332
6005
|
style: {
|
|
@@ -5339,7 +6012,7 @@ function StanceAccordion({
|
|
|
5339
6012
|
},
|
|
5340
6013
|
quote.text
|
|
5341
6014
|
),
|
|
5342
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
6015
|
+
verdict === "agreed" && /* @__PURE__ */ import_react32.default.createElement(
|
|
5343
6016
|
"span",
|
|
5344
6017
|
{
|
|
5345
6018
|
style: {
|
|
@@ -5356,10 +6029,10 @@ function StanceAccordion({
|
|
|
5356
6029
|
flexShrink: 0
|
|
5357
6030
|
}
|
|
5358
6031
|
},
|
|
5359
|
-
/* @__PURE__ */
|
|
6032
|
+
/* @__PURE__ */ import_react32.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react32.default.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
5360
6033
|
"Agreed"
|
|
5361
6034
|
),
|
|
5362
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
6035
|
+
verdict === "disagreed" && /* @__PURE__ */ import_react32.default.createElement(
|
|
5363
6036
|
"span",
|
|
5364
6037
|
{
|
|
5365
6038
|
style: {
|
|
@@ -5376,10 +6049,10 @@ function StanceAccordion({
|
|
|
5376
6049
|
flexShrink: 0
|
|
5377
6050
|
}
|
|
5378
6051
|
},
|
|
5379
|
-
/* @__PURE__ */
|
|
6052
|
+
/* @__PURE__ */ import_react32.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react32.default.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
5380
6053
|
"Disagreed"
|
|
5381
6054
|
),
|
|
5382
|
-
sourceName && /* @__PURE__ */
|
|
6055
|
+
sourceName && /* @__PURE__ */ import_react32.default.createElement(
|
|
5383
6056
|
"a",
|
|
5384
6057
|
{
|
|
5385
6058
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -5396,10 +6069,10 @@ function StanceAccordion({
|
|
|
5396
6069
|
sourceName
|
|
5397
6070
|
)
|
|
5398
6071
|
);
|
|
5399
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
6072
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ import_react32.default.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
|
|
5400
6073
|
));
|
|
5401
6074
|
}),
|
|
5402
|
-
hasToggle && /* @__PURE__ */
|
|
6075
|
+
hasToggle && /* @__PURE__ */ import_react32.default.createElement(
|
|
5403
6076
|
"button",
|
|
5404
6077
|
{
|
|
5405
6078
|
type: "button",
|
|
@@ -5419,8 +6092,10 @@ function StanceAccordion({
|
|
|
5419
6092
|
CategorySection,
|
|
5420
6093
|
CommitteeTable,
|
|
5421
6094
|
CompassCardHorizontal,
|
|
6095
|
+
CompassCardVertical,
|
|
5422
6096
|
CompassCoverageCallout,
|
|
5423
6097
|
CompassIcon,
|
|
6098
|
+
CompassKey,
|
|
5424
6099
|
ExpandCompassNudge,
|
|
5425
6100
|
FilterSidebar,
|
|
5426
6101
|
GovernmentBodySection,
|
|
@@ -5450,6 +6125,7 @@ function StanceAccordion({
|
|
|
5450
6125
|
defaultNavItems,
|
|
5451
6126
|
duration,
|
|
5452
6127
|
easing,
|
|
6128
|
+
evContext,
|
|
5453
6129
|
focus,
|
|
5454
6130
|
fontSizes,
|
|
5455
6131
|
fontWeights,
|