@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.mjs
CHANGED
|
@@ -15,7 +15,8 @@ function RadarChartCore({
|
|
|
15
15
|
size = 400,
|
|
16
16
|
labelFontSize = 18,
|
|
17
17
|
padding = 80,
|
|
18
|
-
labelOffset = 20
|
|
18
|
+
labelOffset = 20,
|
|
19
|
+
tightFit = false
|
|
19
20
|
}) {
|
|
20
21
|
const radius = size / 2 - 40;
|
|
21
22
|
const centerX = size / 2;
|
|
@@ -114,6 +115,20 @@ function RadarChartCore({
|
|
|
114
115
|
const leftPadding = symmetricPadding;
|
|
115
116
|
const rightPadding = symmetricPadding;
|
|
116
117
|
const verticalPadding = padding;
|
|
118
|
+
let tightTop = -verticalPadding;
|
|
119
|
+
let tightHeight = size + verticalPadding * 2;
|
|
120
|
+
if (tightFit && numSpokes > 0) {
|
|
121
|
+
let yMin = Infinity, yMax = -Infinity;
|
|
122
|
+
for (let i = 0; i < numSpokes; i++) {
|
|
123
|
+
const angle = 2 * Math.PI * i / numSpokes;
|
|
124
|
+
const y = centerY - radius * Math.cos(angle);
|
|
125
|
+
if (y < yMin) yMin = y;
|
|
126
|
+
if (y > yMax) yMax = y;
|
|
127
|
+
}
|
|
128
|
+
const labelMargin = labelOffset + labelFontSize * 1.4 + labelFontSize * 1.1;
|
|
129
|
+
tightTop = yMin - labelMargin;
|
|
130
|
+
tightHeight = yMax + labelMargin - tightTop;
|
|
131
|
+
}
|
|
117
132
|
const guidePolygons = [];
|
|
118
133
|
for (let level = 1; level <= 5; level++) {
|
|
119
134
|
const scale = level / 5;
|
|
@@ -132,7 +147,7 @@ function RadarChartCore({
|
|
|
132
147
|
"svg",
|
|
133
148
|
{
|
|
134
149
|
className: "w-full h-auto max-h-full",
|
|
135
|
-
viewBox: `-${leftPadding}
|
|
150
|
+
viewBox: `-${leftPadding} ${tightTop} ${size + leftPadding + rightPadding} ${tightHeight}`,
|
|
136
151
|
preserveAspectRatio: "xMidYMid meet"
|
|
137
152
|
},
|
|
138
153
|
guidePolygons,
|
|
@@ -190,6 +205,7 @@ function RadarChartCore({
|
|
|
190
205
|
fill: isUnansweredLabel ? "#9ca3af" : void 0,
|
|
191
206
|
style: { cursor: "pointer", userSelect: "none", fontSize: fSize }
|
|
192
207
|
},
|
|
208
|
+
isUnansweredLabel && /* @__PURE__ */ React.createElement("title", null, "No stance on file for this topic."),
|
|
193
209
|
lines.map((ln, idx) => /* @__PURE__ */ React.createElement("tspan", { key: idx, x: labelX, dy: idx === 0 ? "0" : `${lineHeight}` }, ln))
|
|
194
210
|
);
|
|
195
211
|
}),
|
|
@@ -216,18 +232,25 @@ function RadarChartCore({
|
|
|
216
232
|
}
|
|
217
233
|
}
|
|
218
234
|
),
|
|
219
|
-
pointsArr.map(([cx, cy], i) =>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
235
|
+
pointsArr.map(([cx, cy], i) => {
|
|
236
|
+
const shortTitle = spokes[i][0];
|
|
237
|
+
const userVal = spokes[i][1];
|
|
238
|
+
if (!userVal || Number(userVal) === 0) return null;
|
|
239
|
+
const compareVal = compareData[shortTitle];
|
|
240
|
+
const matches = hasCompareData && userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
241
|
+
return /* @__PURE__ */ React.createElement(
|
|
242
|
+
"circle",
|
|
243
|
+
{
|
|
244
|
+
key: `user-dot-${i}`,
|
|
245
|
+
cx,
|
|
246
|
+
cy,
|
|
247
|
+
r: matches ? 8 : 7,
|
|
248
|
+
fill: matches ? "#fed12e" : "#7C6B9E",
|
|
249
|
+
stroke: "#FFFFFF",
|
|
250
|
+
strokeWidth: 3
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
}),
|
|
231
254
|
hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */ React.createElement(
|
|
232
255
|
"polygon",
|
|
233
256
|
{
|
|
@@ -251,18 +274,25 @@ function RadarChartCore({
|
|
|
251
274
|
}
|
|
252
275
|
}
|
|
253
276
|
) : null,
|
|
254
|
-
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) =>
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
277
|
+
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => {
|
|
278
|
+
const shortTitle = spokes[i][0];
|
|
279
|
+
const userVal = spokes[i][1];
|
|
280
|
+
const compareVal = compareData[shortTitle];
|
|
281
|
+
if (!compareVal || Number(compareVal) === 0) return null;
|
|
282
|
+
const matches = userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
283
|
+
return /* @__PURE__ */ React.createElement(
|
|
284
|
+
"circle",
|
|
285
|
+
{
|
|
286
|
+
key: `compare-dot-${i}`,
|
|
287
|
+
cx,
|
|
288
|
+
cy,
|
|
289
|
+
r: matches ? 8 : 7,
|
|
290
|
+
fill: matches ? "#fed12e" : "#5A9A6E",
|
|
291
|
+
stroke: "#FFFFFF",
|
|
292
|
+
strokeWidth: 3
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}),
|
|
266
296
|
spokes.map(([shortTitle], i) => {
|
|
267
297
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
268
298
|
const x = centerX + radius * Math.sin(angle);
|
|
@@ -2075,7 +2105,7 @@ function CompassCardHorizontalMeta({
|
|
|
2075
2105
|
IconOverlay,
|
|
2076
2106
|
{
|
|
2077
2107
|
ballot: politician.ballot || null,
|
|
2078
|
-
hasStances:
|
|
2108
|
+
hasStances: false,
|
|
2079
2109
|
branch: politician.branch || null
|
|
2080
2110
|
}
|
|
2081
2111
|
));
|
|
@@ -2106,11 +2136,12 @@ function buildAnswerMapByShortTitle(allTopics, allAnswers, allowedShorts) {
|
|
|
2106
2136
|
}
|
|
2107
2137
|
|
|
2108
2138
|
// src/CompassCardHorizontal.jsx
|
|
2109
|
-
var RADAR_SIZE =
|
|
2110
|
-
var SLOT_WIDTH =
|
|
2139
|
+
var RADAR_SIZE = 400;
|
|
2140
|
+
var SLOT_WIDTH = 420;
|
|
2111
2141
|
function CompassCardHorizontal({
|
|
2112
2142
|
politician,
|
|
2113
2143
|
userAnswers = null,
|
|
2144
|
+
invertedSpokes = {},
|
|
2114
2145
|
tierVisuals = null,
|
|
2115
2146
|
view = "compass",
|
|
2116
2147
|
surface = "representatives",
|
|
@@ -2194,7 +2225,7 @@ function CompassCardHorizontal({
|
|
|
2194
2225
|
topics,
|
|
2195
2226
|
data,
|
|
2196
2227
|
compareData,
|
|
2197
|
-
invertedSpokes: {},
|
|
2228
|
+
invertedSpokes: invertedSpokes || {},
|
|
2198
2229
|
onToggleInversion: () => {
|
|
2199
2230
|
},
|
|
2200
2231
|
onReplaceTopic: () => {
|
|
@@ -2371,8 +2402,645 @@ function CompassCardHorizontal({
|
|
|
2371
2402
|
);
|
|
2372
2403
|
}
|
|
2373
2404
|
|
|
2405
|
+
// src/CompassCardVertical.jsx
|
|
2406
|
+
import React11, { useState as useState6, useEffect as useEffect6 } from "react";
|
|
2407
|
+
var RADAR_SIZE2 = 400;
|
|
2408
|
+
function CompassCardVertical({
|
|
2409
|
+
politician,
|
|
2410
|
+
userAnswers = null,
|
|
2411
|
+
invertedSpokes = {},
|
|
2412
|
+
tierVisuals = null,
|
|
2413
|
+
view = "compass",
|
|
2414
|
+
surface = "representatives",
|
|
2415
|
+
variant = "compass",
|
|
2416
|
+
onBuildCompass = null,
|
|
2417
|
+
onClick
|
|
2418
|
+
}) {
|
|
2419
|
+
var _a;
|
|
2420
|
+
const [hovered, setHovered] = useState6(false);
|
|
2421
|
+
const [focused, setFocused] = useState6(false);
|
|
2422
|
+
const [imgError, setImgError] = useState6(false);
|
|
2423
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = useState6(false);
|
|
2424
|
+
useEffect6(() => {
|
|
2425
|
+
setImgError(false);
|
|
2426
|
+
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2427
|
+
const cardStyle = {
|
|
2428
|
+
position: "relative",
|
|
2429
|
+
display: "flex",
|
|
2430
|
+
flexDirection: "column",
|
|
2431
|
+
height: "100%",
|
|
2432
|
+
backgroundColor: (_a = tierVisuals == null ? void 0 : tierVisuals.bg) != null ? _a : colors.bgWhite,
|
|
2433
|
+
border: `1px solid ${colors.borderLight}`,
|
|
2434
|
+
borderRadius: borderRadius.xl,
|
|
2435
|
+
overflow: "hidden",
|
|
2436
|
+
boxShadow: focused ? focus.ring : hovered ? shadows.cardHover : shadows.md,
|
|
2437
|
+
transform: hovered ? "translateY(-2px)" : "none",
|
|
2438
|
+
transition: `box-shadow ${duration.normal} ease, transform ${duration.normal} ease`,
|
|
2439
|
+
cursor: onClick ? "pointer" : "default",
|
|
2440
|
+
fontFamily: fonts.primary,
|
|
2441
|
+
outline: "none"
|
|
2442
|
+
};
|
|
2443
|
+
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2444
|
+
function renderCompass() {
|
|
2445
|
+
var _a2, _b, _c;
|
|
2446
|
+
if (!userAnswers || userAnswers.length === 0) {
|
|
2447
|
+
return /* @__PURE__ */ React11.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2448
|
+
}
|
|
2449
|
+
let topics = [];
|
|
2450
|
+
let data = {};
|
|
2451
|
+
let compareData = {};
|
|
2452
|
+
try {
|
|
2453
|
+
if (Array.isArray(userAnswers) && userAnswers.length > 0) {
|
|
2454
|
+
const hasEmbeddedTopics = (_b = (_a2 = userAnswers[0]) == null ? void 0 : _a2.topic) == null ? void 0 : _b.short_title;
|
|
2455
|
+
if (hasEmbeddedTopics) {
|
|
2456
|
+
const allowedShorts = userAnswers.map((a) => a.topic.short_title);
|
|
2457
|
+
const allTopics = userAnswers.map((a) => a.topic);
|
|
2458
|
+
const { topicsFiltered, answersByShort } = buildAnswerMapByShortTitle(
|
|
2459
|
+
allTopics,
|
|
2460
|
+
userAnswers,
|
|
2461
|
+
allowedShorts
|
|
2462
|
+
);
|
|
2463
|
+
topics = topicsFiltered;
|
|
2464
|
+
data = answersByShort;
|
|
2465
|
+
} else {
|
|
2466
|
+
if (!Array.isArray(userAnswers[0])) {
|
|
2467
|
+
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 }));
|
|
2468
|
+
data = {};
|
|
2469
|
+
for (const a of userAnswers) {
|
|
2470
|
+
if (a.short_title) data[a.short_title] = (_c = a.value) != null ? _c : 0;
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
if ((politician == null ? void 0 : politician.stances) && typeof politician.stances === "object") {
|
|
2476
|
+
compareData = Array.isArray(politician.stances) ? politician.stances.reduce((acc, s) => {
|
|
2477
|
+
var _a3;
|
|
2478
|
+
if (s.short_title) acc[s.short_title] = (_a3 = s.value) != null ? _a3 : 0;
|
|
2479
|
+
return acc;
|
|
2480
|
+
}, {}) : politician.stances;
|
|
2481
|
+
}
|
|
2482
|
+
if (topics.length === 0) {
|
|
2483
|
+
return /* @__PURE__ */ React11.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2484
|
+
}
|
|
2485
|
+
} catch {
|
|
2486
|
+
return /* @__PURE__ */ React11.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2487
|
+
}
|
|
2488
|
+
const unansweredSpokes = {};
|
|
2489
|
+
for (const t of topics) {
|
|
2490
|
+
const v = compareData[t.short_title];
|
|
2491
|
+
if (!v || Number(v) === 0) unansweredSpokes[t.short_title] = true;
|
|
2492
|
+
}
|
|
2493
|
+
return /* @__PURE__ */ React11.createElement("div", { style: { width: RADAR_SIZE2 + 240, maxWidth: "100%", flexShrink: 0 } }, /* @__PURE__ */ React11.createElement(
|
|
2494
|
+
RadarChartCore,
|
|
2495
|
+
{
|
|
2496
|
+
topics,
|
|
2497
|
+
data,
|
|
2498
|
+
compareData,
|
|
2499
|
+
invertedSpokes: invertedSpokes || {},
|
|
2500
|
+
unansweredSpokes,
|
|
2501
|
+
onToggleInversion: () => {
|
|
2502
|
+
},
|
|
2503
|
+
onReplaceTopic: () => {
|
|
2504
|
+
},
|
|
2505
|
+
size: RADAR_SIZE2,
|
|
2506
|
+
padding: 40,
|
|
2507
|
+
labelOffset: 5,
|
|
2508
|
+
labelFontSize: 18,
|
|
2509
|
+
tightFit: true
|
|
2510
|
+
}
|
|
2511
|
+
));
|
|
2512
|
+
}
|
|
2513
|
+
function renderAvatar() {
|
|
2514
|
+
var _a2, _b, _c;
|
|
2515
|
+
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;
|
|
2516
|
+
const baseStyle = {
|
|
2517
|
+
width: 88,
|
|
2518
|
+
height: 110,
|
|
2519
|
+
flexShrink: 0,
|
|
2520
|
+
overflow: "hidden",
|
|
2521
|
+
borderRadius: borderRadius.md,
|
|
2522
|
+
backgroundColor: colors.evMutedBlue,
|
|
2523
|
+
display: "flex",
|
|
2524
|
+
alignItems: "center",
|
|
2525
|
+
justifyContent: "center"
|
|
2526
|
+
};
|
|
2527
|
+
if (imageSrc && !imgError) {
|
|
2528
|
+
return /* @__PURE__ */ React11.createElement("div", { style: baseStyle }, /* @__PURE__ */ React11.createElement(
|
|
2529
|
+
"img",
|
|
2530
|
+
{
|
|
2531
|
+
src: imageSrc,
|
|
2532
|
+
alt: `${politician.full_name} portrait`,
|
|
2533
|
+
onError: () => setImgError(true),
|
|
2534
|
+
style: {
|
|
2535
|
+
width: "100%",
|
|
2536
|
+
height: "100%",
|
|
2537
|
+
objectFit: "cover",
|
|
2538
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2539
|
+
display: "block"
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
));
|
|
2543
|
+
}
|
|
2544
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2545
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2546
|
+
return /* @__PURE__ */ React11.createElement("div", { style: baseStyle }, /* @__PURE__ */ React11.createElement("span", { style: {
|
|
2547
|
+
color: colors.textWhite,
|
|
2548
|
+
fontFamily: fonts.primary,
|
|
2549
|
+
fontWeight: fontWeights.bold,
|
|
2550
|
+
fontSize: fontSizes["2xl"]
|
|
2551
|
+
} }, initials));
|
|
2552
|
+
}
|
|
2553
|
+
function renderPortrait() {
|
|
2554
|
+
var _a2, _b, _c;
|
|
2555
|
+
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;
|
|
2556
|
+
if (imageSrc && !imgError) {
|
|
2557
|
+
return /* @__PURE__ */ React11.createElement(
|
|
2558
|
+
"img",
|
|
2559
|
+
{
|
|
2560
|
+
src: imageSrc,
|
|
2561
|
+
alt: `${politician.full_name} portrait`,
|
|
2562
|
+
style: {
|
|
2563
|
+
width: RADAR_SIZE2,
|
|
2564
|
+
height: RADAR_SIZE2,
|
|
2565
|
+
objectFit: "cover",
|
|
2566
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2567
|
+
display: "block",
|
|
2568
|
+
borderRadius: borderRadius.md
|
|
2569
|
+
},
|
|
2570
|
+
onError: () => setImgError(true)
|
|
2571
|
+
}
|
|
2572
|
+
);
|
|
2573
|
+
}
|
|
2574
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2575
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2576
|
+
return /* @__PURE__ */ React11.createElement("div", { style: {
|
|
2577
|
+
width: RADAR_SIZE2,
|
|
2578
|
+
height: RADAR_SIZE2,
|
|
2579
|
+
backgroundColor: colors.evMutedBlue,
|
|
2580
|
+
color: colors.textWhite,
|
|
2581
|
+
display: "flex",
|
|
2582
|
+
alignItems: "center",
|
|
2583
|
+
justifyContent: "center",
|
|
2584
|
+
fontFamily: fonts.primary,
|
|
2585
|
+
fontWeight: fontWeights.bold,
|
|
2586
|
+
fontSize: fontSizes["5xl"],
|
|
2587
|
+
borderRadius: borderRadius.md
|
|
2588
|
+
} }, initials);
|
|
2589
|
+
}
|
|
2590
|
+
function renderEmptyVariant() {
|
|
2591
|
+
return /* @__PURE__ */ React11.createElement("div", { style: {
|
|
2592
|
+
width: "100%",
|
|
2593
|
+
height: "100%",
|
|
2594
|
+
flex: 1,
|
|
2595
|
+
display: "flex",
|
|
2596
|
+
flexDirection: "column",
|
|
2597
|
+
alignItems: "center",
|
|
2598
|
+
justifyContent: "center",
|
|
2599
|
+
gap: "12px",
|
|
2600
|
+
padding: "20px",
|
|
2601
|
+
boxSizing: "border-box",
|
|
2602
|
+
backgroundColor: colorScales.teal["050"],
|
|
2603
|
+
borderRadius: borderRadius.md
|
|
2604
|
+
} }, /* @__PURE__ */ React11.createElement(PlaceholderRadar, { size: 220, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ React11.createElement("p", { style: {
|
|
2605
|
+
margin: 0,
|
|
2606
|
+
fontSize: fontSizes.sm,
|
|
2607
|
+
color: colors.textMuted,
|
|
2608
|
+
textAlign: "center",
|
|
2609
|
+
lineHeight: 1.4,
|
|
2610
|
+
fontFamily: fonts.primary
|
|
2611
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ React11.createElement(
|
|
2612
|
+
"button",
|
|
2613
|
+
{
|
|
2614
|
+
type: "button",
|
|
2615
|
+
onClick: onBuildCompass || void 0,
|
|
2616
|
+
onMouseEnter: () => setEmptyCtaHovered(true),
|
|
2617
|
+
onMouseLeave: () => setEmptyCtaHovered(false),
|
|
2618
|
+
style: {
|
|
2619
|
+
minWidth: "180px",
|
|
2620
|
+
height: "44px",
|
|
2621
|
+
padding: "0 20px",
|
|
2622
|
+
backgroundColor: emptyCtaHovered ? semanticTokens.light.buttonPrimary.background.hovered : semanticTokens.light.buttonPrimary.background.default,
|
|
2623
|
+
color: colors.textWhite,
|
|
2624
|
+
fontSize: fontSizes.sm,
|
|
2625
|
+
fontWeight: fontWeights.semibold,
|
|
2626
|
+
fontFamily: fonts.primary,
|
|
2627
|
+
borderRadius: borderRadius.full,
|
|
2628
|
+
border: "none",
|
|
2629
|
+
cursor: onBuildCompass ? "pointer" : "default",
|
|
2630
|
+
transition: `background ${duration.normal} ease`
|
|
2631
|
+
}
|
|
2632
|
+
},
|
|
2633
|
+
"Calibrate your compass"
|
|
2634
|
+
));
|
|
2635
|
+
}
|
|
2636
|
+
function renderUnavailablePlate(message) {
|
|
2637
|
+
return /* @__PURE__ */ React11.createElement("div", { style: {
|
|
2638
|
+
width: "100%",
|
|
2639
|
+
height: "100%",
|
|
2640
|
+
flex: 1,
|
|
2641
|
+
backgroundColor: colorScales.teal["050"],
|
|
2642
|
+
borderRadius: borderRadius.md,
|
|
2643
|
+
display: "flex",
|
|
2644
|
+
alignItems: "center",
|
|
2645
|
+
justifyContent: "center",
|
|
2646
|
+
padding: spacing[6],
|
|
2647
|
+
boxSizing: "border-box"
|
|
2648
|
+
} }, /* @__PURE__ */ React11.createElement("p", { style: {
|
|
2649
|
+
fontSize: fontSizes.base,
|
|
2650
|
+
fontWeight: fontWeights.semibold,
|
|
2651
|
+
lineHeight: 1.4,
|
|
2652
|
+
color: colors.textMuted,
|
|
2653
|
+
textAlign: "center",
|
|
2654
|
+
margin: 0,
|
|
2655
|
+
fontFamily: fonts.primary
|
|
2656
|
+
} }, message));
|
|
2657
|
+
}
|
|
2658
|
+
function renderSlotContent() {
|
|
2659
|
+
if (view === "portrait") return renderPortrait();
|
|
2660
|
+
if (variant === "empty") return renderEmptyVariant();
|
|
2661
|
+
if (variant === "administrative" || variant === "judicial") {
|
|
2662
|
+
return renderUnavailablePlate("Compass currently unavailable for this role.");
|
|
2663
|
+
}
|
|
2664
|
+
if (variant === "no-stances") {
|
|
2665
|
+
return renderUnavailablePlate(`No compass stances on file for ${(politician == null ? void 0 : politician.full_name) || "this official"} yet.`);
|
|
2666
|
+
}
|
|
2667
|
+
return renderCompass();
|
|
2668
|
+
}
|
|
2669
|
+
return /* @__PURE__ */ React11.createElement(
|
|
2670
|
+
"div",
|
|
2671
|
+
{
|
|
2672
|
+
role: "article",
|
|
2673
|
+
"aria-label": `${politician.full_name}, ${politician.office_title || ""}`,
|
|
2674
|
+
tabIndex: 0,
|
|
2675
|
+
style: cardStyle,
|
|
2676
|
+
onClick,
|
|
2677
|
+
onKeyDown: (e) => {
|
|
2678
|
+
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
2679
|
+
e.preventDefault();
|
|
2680
|
+
onClick();
|
|
2681
|
+
}
|
|
2682
|
+
},
|
|
2683
|
+
onMouseEnter: () => setHovered(true),
|
|
2684
|
+
onMouseLeave: () => setHovered(false),
|
|
2685
|
+
onFocus: () => setFocused(true),
|
|
2686
|
+
onBlur: () => setFocused(false)
|
|
2687
|
+
},
|
|
2688
|
+
/* @__PURE__ */ React11.createElement("div", { style: { padding: spacing[4], paddingBottom: spacing[3], display: "flex", alignItems: "stretch", gap: spacing[3], flexShrink: 0 } }, renderAvatar(), /* @__PURE__ */ React11.createElement("div", { style: { display: "flex", flexDirection: "column", gap: spacing[1], minWidth: 0, flex: 1 } }, /* @__PURE__ */ React11.createElement("p", { style: {
|
|
2689
|
+
fontFamily: fonts.primary,
|
|
2690
|
+
fontSize: fontSizes.xl,
|
|
2691
|
+
fontWeight: fontWeights.semibold,
|
|
2692
|
+
lineHeight: 1.3,
|
|
2693
|
+
color: colors.evMutedBlue,
|
|
2694
|
+
margin: 0
|
|
2695
|
+
} }, politician.full_name), /* @__PURE__ */ React11.createElement("p", { style: {
|
|
2696
|
+
fontFamily: fonts.primary,
|
|
2697
|
+
fontSize: fontSizes.sm,
|
|
2698
|
+
fontWeight: fontWeights.semibold,
|
|
2699
|
+
lineHeight: 1.4,
|
|
2700
|
+
color: colors.textSecondary,
|
|
2701
|
+
margin: 0
|
|
2702
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ React11.createElement("p", { style: {
|
|
2703
|
+
fontFamily: fonts.primary,
|
|
2704
|
+
fontSize: fontSizes.sm,
|
|
2705
|
+
fontWeight: fontWeights.regular,
|
|
2706
|
+
lineHeight: 1.5,
|
|
2707
|
+
color: colors.textMuted,
|
|
2708
|
+
margin: 0,
|
|
2709
|
+
overflow: "hidden",
|
|
2710
|
+
textOverflow: "ellipsis",
|
|
2711
|
+
whiteSpace: "nowrap"
|
|
2712
|
+
} }, politician.district_label), /* @__PURE__ */ React11.createElement("div", { style: { marginTop: "auto" } }, /* @__PURE__ */ React11.createElement(
|
|
2713
|
+
IconOverlay,
|
|
2714
|
+
{
|
|
2715
|
+
ballot: politician.ballot || null,
|
|
2716
|
+
hasStances: false,
|
|
2717
|
+
branch: politician.branch || null
|
|
2718
|
+
}
|
|
2719
|
+
)))),
|
|
2720
|
+
surface === "elections" && politician.withdrawn && /* @__PURE__ */ React11.createElement("div", { style: {
|
|
2721
|
+
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
2722
|
+
backgroundColor: "rgba(120,0,0,0.85)",
|
|
2723
|
+
color: "#fff",
|
|
2724
|
+
fontSize: "12px",
|
|
2725
|
+
fontWeight: 700,
|
|
2726
|
+
letterSpacing: "0.4px",
|
|
2727
|
+
textAlign: "center",
|
|
2728
|
+
textTransform: "uppercase",
|
|
2729
|
+
padding: "6px 0",
|
|
2730
|
+
borderRadius: borderRadius.sm
|
|
2731
|
+
} }, "Withdrawn"),
|
|
2732
|
+
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */ React11.createElement("div", { style: {
|
|
2733
|
+
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
2734
|
+
backgroundColor: "rgba(0,0,0,0.75)",
|
|
2735
|
+
color: "#fff",
|
|
2736
|
+
fontSize: "12px",
|
|
2737
|
+
fontWeight: 700,
|
|
2738
|
+
letterSpacing: "0.4px",
|
|
2739
|
+
textAlign: "center",
|
|
2740
|
+
textTransform: "uppercase",
|
|
2741
|
+
padding: "6px 0",
|
|
2742
|
+
borderRadius: borderRadius.sm
|
|
2743
|
+
} }, "Running Unopposed"),
|
|
2744
|
+
/* @__PURE__ */ React11.createElement("div", { style: {
|
|
2745
|
+
flex: 1,
|
|
2746
|
+
padding: spacing[4],
|
|
2747
|
+
paddingTop: 0,
|
|
2748
|
+
display: "flex",
|
|
2749
|
+
alignItems: "center",
|
|
2750
|
+
justifyContent: "center",
|
|
2751
|
+
position: "relative",
|
|
2752
|
+
minHeight: 0
|
|
2753
|
+
} }, renderSlotContent())
|
|
2754
|
+
);
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
// src/CompassKey.jsx
|
|
2758
|
+
import React12, { useEffect as useEffect7, useState as useState7 } from "react";
|
|
2759
|
+
|
|
2760
|
+
// src/evContext.js
|
|
2761
|
+
var DEFAULT_BROKER_URL = "https://ev-context.empowered.vote/";
|
|
2762
|
+
var brokerUrl = DEFAULT_BROKER_URL;
|
|
2763
|
+
var iframe = null;
|
|
2764
|
+
var readyPromise = null;
|
|
2765
|
+
var pendingRequests = /* @__PURE__ */ new Map();
|
|
2766
|
+
var subscribers = /* @__PURE__ */ new Set();
|
|
2767
|
+
var lastValue = null;
|
|
2768
|
+
var nextRequestId = 1;
|
|
2769
|
+
function brokerOrigin() {
|
|
2770
|
+
try {
|
|
2771
|
+
return new URL(brokerUrl).origin;
|
|
2772
|
+
} catch {
|
|
2773
|
+
return "";
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
function ensureMounted() {
|
|
2777
|
+
if (typeof window === "undefined" || typeof document === "undefined") return null;
|
|
2778
|
+
if (iframe) return iframe;
|
|
2779
|
+
iframe = document.createElement("iframe");
|
|
2780
|
+
iframe.src = brokerUrl;
|
|
2781
|
+
iframe.setAttribute("aria-hidden", "true");
|
|
2782
|
+
iframe.setAttribute("tabindex", "-1");
|
|
2783
|
+
iframe.style.position = "absolute";
|
|
2784
|
+
iframe.style.width = "1px";
|
|
2785
|
+
iframe.style.height = "1px";
|
|
2786
|
+
iframe.style.border = "0";
|
|
2787
|
+
iframe.style.opacity = "0";
|
|
2788
|
+
iframe.style.pointerEvents = "none";
|
|
2789
|
+
iframe.style.top = "-9999px";
|
|
2790
|
+
iframe.style.left = "-9999px";
|
|
2791
|
+
window.addEventListener("message", onMessage);
|
|
2792
|
+
(document.body || document.documentElement).appendChild(iframe);
|
|
2793
|
+
readyPromise = new Promise((resolve) => {
|
|
2794
|
+
const onReady = (e) => {
|
|
2795
|
+
if (e.origin !== brokerOrigin()) return;
|
|
2796
|
+
if (!e.data || e.data.type !== "ev-context:ready") return;
|
|
2797
|
+
window.removeEventListener("message", onReady);
|
|
2798
|
+
resolve();
|
|
2799
|
+
};
|
|
2800
|
+
window.addEventListener("message", onReady);
|
|
2801
|
+
iframe.addEventListener("load", () => {
|
|
2802
|
+
setTimeout(() => resolve(), 50);
|
|
2803
|
+
});
|
|
2804
|
+
});
|
|
2805
|
+
return iframe;
|
|
2806
|
+
}
|
|
2807
|
+
function onMessage(event) {
|
|
2808
|
+
var _a, _b, _c;
|
|
2809
|
+
if (event.origin !== brokerOrigin()) return;
|
|
2810
|
+
const data = event.data;
|
|
2811
|
+
if (!data || typeof data !== "object") return;
|
|
2812
|
+
if (data.type === "ev-context:value" || data.type === "ev-context:ack") {
|
|
2813
|
+
const id = data.requestId;
|
|
2814
|
+
const wasPending = id && pendingRequests.has(id);
|
|
2815
|
+
if (wasPending) {
|
|
2816
|
+
const { resolve, timeout } = pendingRequests.get(id);
|
|
2817
|
+
clearTimeout(timeout);
|
|
2818
|
+
pendingRequests.delete(id);
|
|
2819
|
+
resolve(data.type === "ev-context:value" ? (_a = data.value) != null ? _a : null : data.ok);
|
|
2820
|
+
}
|
|
2821
|
+
if (data.type === "ev-context:value" && !wasPending) {
|
|
2822
|
+
lastValue = (_b = data.value) != null ? _b : null;
|
|
2823
|
+
notifySubscribers();
|
|
2824
|
+
}
|
|
2825
|
+
} else if (data.type === "ev-context:update") {
|
|
2826
|
+
lastValue = (_c = data.value) != null ? _c : null;
|
|
2827
|
+
notifySubscribers();
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
function notifySubscribers() {
|
|
2831
|
+
for (const fn of subscribers) {
|
|
2832
|
+
try {
|
|
2833
|
+
fn(lastValue);
|
|
2834
|
+
} catch {
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
function send(message, { expectReply = true, timeoutMs = 4e3 } = {}) {
|
|
2839
|
+
ensureMounted();
|
|
2840
|
+
return readyPromise.then(() => new Promise((resolve, reject) => {
|
|
2841
|
+
if (!iframe || !iframe.contentWindow) {
|
|
2842
|
+
reject(new Error("evContext broker iframe not ready"));
|
|
2843
|
+
return;
|
|
2844
|
+
}
|
|
2845
|
+
const requestId = expectReply ? `req-${nextRequestId++}` : void 0;
|
|
2846
|
+
if (expectReply) {
|
|
2847
|
+
const timeout = setTimeout(() => {
|
|
2848
|
+
pendingRequests.delete(requestId);
|
|
2849
|
+
reject(new Error("evContext request timed out"));
|
|
2850
|
+
}, timeoutMs);
|
|
2851
|
+
pendingRequests.set(requestId, { resolve, reject, timeout });
|
|
2852
|
+
}
|
|
2853
|
+
try {
|
|
2854
|
+
iframe.contentWindow.postMessage({ ...message, requestId }, brokerOrigin());
|
|
2855
|
+
if (!expectReply) resolve(true);
|
|
2856
|
+
} catch (err) {
|
|
2857
|
+
if (expectReply) {
|
|
2858
|
+
const entry = pendingRequests.get(requestId);
|
|
2859
|
+
if (entry) {
|
|
2860
|
+
clearTimeout(entry.timeout);
|
|
2861
|
+
pendingRequests.delete(requestId);
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
reject(err);
|
|
2865
|
+
}
|
|
2866
|
+
}));
|
|
2867
|
+
}
|
|
2868
|
+
var evContext = {
|
|
2869
|
+
/**
|
|
2870
|
+
* Override the broker URL. Call once at app startup before any get/set.
|
|
2871
|
+
* Defaults to https://ev-context.empowered.vote/ for prod.
|
|
2872
|
+
*/
|
|
2873
|
+
configure({ brokerUrl: url } = {}) {
|
|
2874
|
+
if (url) brokerUrl = url;
|
|
2875
|
+
},
|
|
2876
|
+
/** Mount the iframe immediately (optional — get/set will mount lazily). */
|
|
2877
|
+
preload() {
|
|
2878
|
+
ensureMounted();
|
|
2879
|
+
return readyPromise;
|
|
2880
|
+
},
|
|
2881
|
+
/** Read the current shared context. Resolves to the stored value or null. */
|
|
2882
|
+
async get() {
|
|
2883
|
+
return send({ type: "ev-context:get" });
|
|
2884
|
+
},
|
|
2885
|
+
/** Overwrite the shared context. */
|
|
2886
|
+
async set(value) {
|
|
2887
|
+
return send({ type: "ev-context:set", value });
|
|
2888
|
+
},
|
|
2889
|
+
/** Clear the shared context. */
|
|
2890
|
+
async clear() {
|
|
2891
|
+
return send({ type: "ev-context:clear" });
|
|
2892
|
+
},
|
|
2893
|
+
/**
|
|
2894
|
+
* Subscribe to live updates. Fires when this tab or any other tab
|
|
2895
|
+
* (any subdomain) writes to the store. Returns an unsubscribe function.
|
|
2896
|
+
*/
|
|
2897
|
+
subscribe(fn) {
|
|
2898
|
+
subscribers.add(fn);
|
|
2899
|
+
send({ type: "ev-context:subscribe" }).then((value) => {
|
|
2900
|
+
lastValue = value != null ? value : lastValue;
|
|
2901
|
+
try {
|
|
2902
|
+
fn(lastValue);
|
|
2903
|
+
} catch {
|
|
2904
|
+
}
|
|
2905
|
+
}).catch(() => {
|
|
2906
|
+
});
|
|
2907
|
+
return () => {
|
|
2908
|
+
subscribers.delete(fn);
|
|
2909
|
+
};
|
|
2910
|
+
}
|
|
2911
|
+
};
|
|
2912
|
+
|
|
2913
|
+
// src/CompassKey.jsx
|
|
2914
|
+
function CompassKey({ compact = false } = {}) {
|
|
2915
|
+
const [dismissed, setDismissed] = useState7(false);
|
|
2916
|
+
const [loaded, setLoaded] = useState7(false);
|
|
2917
|
+
useEffect7(() => {
|
|
2918
|
+
let cancelled = false;
|
|
2919
|
+
evContext.get().then((shared) => {
|
|
2920
|
+
if (cancelled) return;
|
|
2921
|
+
setDismissed(Boolean(shared == null ? void 0 : shared.compassKeyDismissed));
|
|
2922
|
+
setLoaded(true);
|
|
2923
|
+
}).catch(() => {
|
|
2924
|
+
if (!cancelled) setLoaded(true);
|
|
2925
|
+
});
|
|
2926
|
+
return () => {
|
|
2927
|
+
cancelled = true;
|
|
2928
|
+
};
|
|
2929
|
+
}, []);
|
|
2930
|
+
function persistDismissed(value) {
|
|
2931
|
+
evContext.get().then((current) => {
|
|
2932
|
+
const next = { ...current || {}, compassKeyDismissed: value };
|
|
2933
|
+
evContext.set(next).catch(() => {
|
|
2934
|
+
});
|
|
2935
|
+
}).catch(() => {
|
|
2936
|
+
});
|
|
2937
|
+
}
|
|
2938
|
+
function handleDismiss() {
|
|
2939
|
+
setDismissed(true);
|
|
2940
|
+
persistDismissed(true);
|
|
2941
|
+
}
|
|
2942
|
+
function handleReopen() {
|
|
2943
|
+
setDismissed(false);
|
|
2944
|
+
persistDismissed(false);
|
|
2945
|
+
}
|
|
2946
|
+
if (!loaded) return null;
|
|
2947
|
+
const Swatch = ({ color, label, ring }) => /* @__PURE__ */ React12.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ React12.createElement("span", { style: {
|
|
2948
|
+
display: "inline-block",
|
|
2949
|
+
width: 12,
|
|
2950
|
+
height: 12,
|
|
2951
|
+
borderRadius: "50%",
|
|
2952
|
+
background: color,
|
|
2953
|
+
border: `2px solid ${ring || "#fff"}`,
|
|
2954
|
+
boxShadow: "0 0 0 1px rgba(0,0,0,0.08)"
|
|
2955
|
+
} }), /* @__PURE__ */ React12.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, label));
|
|
2956
|
+
if (dismissed) {
|
|
2957
|
+
return /* @__PURE__ */ React12.createElement(
|
|
2958
|
+
"button",
|
|
2959
|
+
{
|
|
2960
|
+
type: "button",
|
|
2961
|
+
onClick: handleReopen,
|
|
2962
|
+
"aria-label": "Show compass legend",
|
|
2963
|
+
style: {
|
|
2964
|
+
display: "inline-flex",
|
|
2965
|
+
alignItems: "center",
|
|
2966
|
+
gap: spacing[1],
|
|
2967
|
+
padding: "4px 10px",
|
|
2968
|
+
borderRadius: borderRadius.full,
|
|
2969
|
+
background: "transparent",
|
|
2970
|
+
border: `1px solid ${colors.borderLight}`,
|
|
2971
|
+
color: colors.textMuted,
|
|
2972
|
+
fontFamily: fonts.primary,
|
|
2973
|
+
fontSize: fontSizes.xs,
|
|
2974
|
+
fontWeight: fontWeights.semibold,
|
|
2975
|
+
cursor: "pointer"
|
|
2976
|
+
}
|
|
2977
|
+
},
|
|
2978
|
+
/* @__PURE__ */ React12.createElement("span", { "aria-hidden": "true" }, "?"),
|
|
2979
|
+
" Compass key"
|
|
2980
|
+
);
|
|
2981
|
+
}
|
|
2982
|
+
return /* @__PURE__ */ React12.createElement(
|
|
2983
|
+
"div",
|
|
2984
|
+
{
|
|
2985
|
+
role: "region",
|
|
2986
|
+
"aria-label": "Compass legend",
|
|
2987
|
+
style: {
|
|
2988
|
+
display: "inline-flex",
|
|
2989
|
+
alignItems: "center",
|
|
2990
|
+
flexWrap: "wrap",
|
|
2991
|
+
gap: compact ? spacing[2] : spacing[3],
|
|
2992
|
+
padding: compact ? `${spacing[1]} ${spacing[2]}` : `${spacing[2]} ${spacing[3]}`,
|
|
2993
|
+
background: "#fff",
|
|
2994
|
+
border: `1px solid ${colors.borderLight}`,
|
|
2995
|
+
borderRadius: borderRadius.md,
|
|
2996
|
+
fontFamily: fonts.primary,
|
|
2997
|
+
maxWidth: "100%",
|
|
2998
|
+
boxSizing: "border-box"
|
|
2999
|
+
}
|
|
3000
|
+
},
|
|
3001
|
+
!compact && /* @__PURE__ */ React12.createElement("span", { style: {
|
|
3002
|
+
fontSize: fontSizes.xs,
|
|
3003
|
+
fontWeight: fontWeights.semibold,
|
|
3004
|
+
color: colors.textMuted,
|
|
3005
|
+
textTransform: "uppercase",
|
|
3006
|
+
letterSpacing: "0.5px"
|
|
3007
|
+
} }, "Compass key"),
|
|
3008
|
+
/* @__PURE__ */ React12.createElement(Swatch, { color: "#7C6B9E", label: "You" }),
|
|
3009
|
+
/* @__PURE__ */ React12.createElement(Swatch, { color: "#5A9A6E", label: "Politician" }),
|
|
3010
|
+
/* @__PURE__ */ React12.createElement(Swatch, { color: "#fed12e", label: "Match" }),
|
|
3011
|
+
/* @__PURE__ */ React12.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ React12.createElement("span", { style: {
|
|
3012
|
+
fontSize: fontSizes.xs,
|
|
3013
|
+
fontWeight: fontWeights.semibold,
|
|
3014
|
+
color: "#9ca3af",
|
|
3015
|
+
fontFamily: fonts.primary,
|
|
3016
|
+
textDecoration: "underline",
|
|
3017
|
+
textDecorationStyle: "dashed",
|
|
3018
|
+
textUnderlineOffset: "3px"
|
|
3019
|
+
} }, "Topic"), /* @__PURE__ */ React12.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, "= no stance")),
|
|
3020
|
+
/* @__PURE__ */ React12.createElement(
|
|
3021
|
+
"button",
|
|
3022
|
+
{
|
|
3023
|
+
type: "button",
|
|
3024
|
+
onClick: handleDismiss,
|
|
3025
|
+
"aria-label": "Hide compass legend",
|
|
3026
|
+
style: {
|
|
3027
|
+
marginLeft: spacing[2],
|
|
3028
|
+
padding: "2px 6px",
|
|
3029
|
+
border: "none",
|
|
3030
|
+
background: "transparent",
|
|
3031
|
+
color: colors.textMuted,
|
|
3032
|
+
fontSize: "16px",
|
|
3033
|
+
lineHeight: 1,
|
|
3034
|
+
cursor: "pointer"
|
|
3035
|
+
}
|
|
3036
|
+
},
|
|
3037
|
+
"\xD7"
|
|
3038
|
+
)
|
|
3039
|
+
);
|
|
3040
|
+
}
|
|
3041
|
+
|
|
2374
3042
|
// src/CategorySection.jsx
|
|
2375
|
-
import
|
|
3043
|
+
import React13, { useState as useState8 } from "react";
|
|
2376
3044
|
function CategorySection({
|
|
2377
3045
|
title,
|
|
2378
3046
|
infoTooltip,
|
|
@@ -2382,7 +3050,7 @@ function CategorySection({
|
|
|
2382
3050
|
tier
|
|
2383
3051
|
}) {
|
|
2384
3052
|
var _a, _b;
|
|
2385
|
-
const [showTooltip, setShowTooltip] =
|
|
3053
|
+
const [showTooltip, setShowTooltip] = useState8(false);
|
|
2386
3054
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
2387
3055
|
const styles2 = {
|
|
2388
3056
|
section: {
|
|
@@ -2450,7 +3118,7 @@ function CategorySection({
|
|
|
2450
3118
|
gap: spacing[4]
|
|
2451
3119
|
}
|
|
2452
3120
|
};
|
|
2453
|
-
return /* @__PURE__ */
|
|
3121
|
+
return /* @__PURE__ */ React13.createElement("section", { style: styles2.section, className: "ev-category-section" }, /* @__PURE__ */ React13.createElement("div", { style: styles2.header }, /* @__PURE__ */ React13.createElement("span", { style: styles2.titlePill }, title), infoTooltip && /* @__PURE__ */ React13.createElement(
|
|
2454
3122
|
"button",
|
|
2455
3123
|
{
|
|
2456
3124
|
type: "button",
|
|
@@ -2462,8 +3130,8 @@ function CategorySection({
|
|
|
2462
3130
|
"aria-label": `Info about ${title}`
|
|
2463
3131
|
},
|
|
2464
3132
|
"i",
|
|
2465
|
-
showTooltip && /* @__PURE__ */
|
|
2466
|
-
), websiteUrl && /* @__PURE__ */
|
|
3133
|
+
showTooltip && /* @__PURE__ */ React13.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
3134
|
+
), websiteUrl && /* @__PURE__ */ React13.createElement(
|
|
2467
3135
|
"a",
|
|
2468
3136
|
{
|
|
2469
3137
|
href: websiteUrl,
|
|
@@ -2472,7 +3140,7 @@ function CategorySection({
|
|
|
2472
3140
|
style: styles2.externalLink,
|
|
2473
3141
|
"aria-label": `Visit official website for ${title}`
|
|
2474
3142
|
},
|
|
2475
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ React13.createElement(
|
|
2476
3144
|
"svg",
|
|
2477
3145
|
{
|
|
2478
3146
|
viewBox: "0 0 24 24",
|
|
@@ -2480,7 +3148,7 @@ function CategorySection({
|
|
|
2480
3148
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2481
3149
|
style: { width: "14px", height: "14px" }
|
|
2482
3150
|
},
|
|
2483
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ React13.createElement(
|
|
2484
3152
|
"path",
|
|
2485
3153
|
{
|
|
2486
3154
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -2491,12 +3159,12 @@ function CategorySection({
|
|
|
2491
3159
|
}
|
|
2492
3160
|
)
|
|
2493
3161
|
)
|
|
2494
|
-
)), /* @__PURE__ */
|
|
3162
|
+
)), /* @__PURE__ */ React13.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
2495
3163
|
}
|
|
2496
3164
|
|
|
2497
3165
|
// src/SubGroupSection.jsx
|
|
2498
|
-
import
|
|
2499
|
-
function SubGroupSection({ title, websiteUrl, children }) {
|
|
3166
|
+
import React14 from "react";
|
|
3167
|
+
function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap, justifyContent }) {
|
|
2500
3168
|
const styles2 = {
|
|
2501
3169
|
section: {
|
|
2502
3170
|
marginBottom: spacing[4]
|
|
@@ -2524,11 +3192,13 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
2524
3192
|
},
|
|
2525
3193
|
grid: {
|
|
2526
3194
|
display: "grid",
|
|
2527
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(min(250px, 100%), 1fr))",
|
|
2528
|
-
gap: spacing[2]
|
|
3195
|
+
gridTemplateColumns: gridTemplateColumns || "repeat(auto-fill, minmax(min(250px, 100%), 1fr))",
|
|
3196
|
+
gap: gap || spacing[2],
|
|
3197
|
+
justifyContent: justifyContent || void 0,
|
|
3198
|
+
width: "100%"
|
|
2529
3199
|
}
|
|
2530
3200
|
};
|
|
2531
|
-
return /* @__PURE__ */
|
|
3201
|
+
return /* @__PURE__ */ React14.createElement("div", { style: styles2.section }, title && /* @__PURE__ */ React14.createElement("div", { style: styles2.header }, /* @__PURE__ */ React14.createElement("span", { style: styles2.label }, title), websiteUrl && /* @__PURE__ */ React14.createElement(
|
|
2532
3202
|
"a",
|
|
2533
3203
|
{
|
|
2534
3204
|
href: websiteUrl,
|
|
@@ -2536,12 +3206,12 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
2536
3206
|
rel: "noopener noreferrer",
|
|
2537
3207
|
style: styles2.link
|
|
2538
3208
|
},
|
|
2539
|
-
/* @__PURE__ */
|
|
2540
|
-
)), /* @__PURE__ */
|
|
3209
|
+
/* @__PURE__ */ React14.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "12px", height: "12px" } }, /* @__PURE__ */ React14.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.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" }))
|
|
3210
|
+
)), /* @__PURE__ */ React14.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
2541
3211
|
}
|
|
2542
3212
|
|
|
2543
3213
|
// src/GovernmentBodySection.jsx
|
|
2544
|
-
import
|
|
3214
|
+
import React15, { useState as useState9 } from "react";
|
|
2545
3215
|
function GovernmentBodySection({
|
|
2546
3216
|
title,
|
|
2547
3217
|
websiteUrl,
|
|
@@ -2550,7 +3220,7 @@ function GovernmentBodySection({
|
|
|
2550
3220
|
children
|
|
2551
3221
|
}) {
|
|
2552
3222
|
var _a;
|
|
2553
|
-
const [expanded, setExpanded] =
|
|
3223
|
+
const [expanded, setExpanded] = useState9(defaultExpanded);
|
|
2554
3224
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
2555
3225
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
2556
3226
|
const styles2 = {
|
|
@@ -2590,7 +3260,7 @@ function GovernmentBodySection({
|
|
|
2590
3260
|
display: expanded ? "block" : "none"
|
|
2591
3261
|
}
|
|
2592
3262
|
};
|
|
2593
|
-
return /* @__PURE__ */
|
|
3263
|
+
return /* @__PURE__ */ React15.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ React15.createElement(
|
|
2594
3264
|
"div",
|
|
2595
3265
|
{
|
|
2596
3266
|
style: styles2.header,
|
|
@@ -2606,8 +3276,8 @@ function GovernmentBodySection({
|
|
|
2606
3276
|
"aria-expanded": expanded,
|
|
2607
3277
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
2608
3278
|
},
|
|
2609
|
-
/* @__PURE__ */
|
|
2610
|
-
websiteUrl && /* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ React15.createElement("span", { style: styles2.title }, title),
|
|
3280
|
+
websiteUrl && /* @__PURE__ */ React15.createElement(
|
|
2611
3281
|
"a",
|
|
2612
3282
|
{
|
|
2613
3283
|
href: websiteUrl,
|
|
@@ -2617,14 +3287,14 @@ function GovernmentBodySection({
|
|
|
2617
3287
|
onClick: (e) => e.stopPropagation(),
|
|
2618
3288
|
"aria-label": `Visit ${title} website`
|
|
2619
3289
|
},
|
|
2620
|
-
/* @__PURE__ */
|
|
3290
|
+
/* @__PURE__ */ React15.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "14px", height: "14px" } }, /* @__PURE__ */ React15.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React15.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" }))
|
|
2621
3291
|
),
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
), /* @__PURE__ */
|
|
3292
|
+
/* @__PURE__ */ React15.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
3293
|
+
), /* @__PURE__ */ React15.createElement("div", { style: styles2.content }, children));
|
|
2624
3294
|
}
|
|
2625
3295
|
|
|
2626
3296
|
// src/SocialLinks.jsx
|
|
2627
|
-
import
|
|
3297
|
+
import React16 from "react";
|
|
2628
3298
|
var SOCIAL_PLATFORMS = [
|
|
2629
3299
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
2630
3300
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -2695,7 +3365,7 @@ function SocialLinks({
|
|
|
2695
3365
|
}
|
|
2696
3366
|
};
|
|
2697
3367
|
const platformIconMap = {
|
|
2698
|
-
twitter: /* @__PURE__ */
|
|
3368
|
+
twitter: /* @__PURE__ */ React16.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React16.createElement(
|
|
2699
3369
|
"path",
|
|
2700
3370
|
{
|
|
2701
3371
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -2705,7 +3375,7 @@ function SocialLinks({
|
|
|
2705
3375
|
strokeLinejoin: "round"
|
|
2706
3376
|
}
|
|
2707
3377
|
)),
|
|
2708
|
-
facebook: /* @__PURE__ */
|
|
3378
|
+
facebook: /* @__PURE__ */ React16.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React16.createElement(
|
|
2709
3379
|
"path",
|
|
2710
3380
|
{
|
|
2711
3381
|
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",
|
|
@@ -2715,8 +3385,8 @@ function SocialLinks({
|
|
|
2715
3385
|
strokeLinejoin: "round"
|
|
2716
3386
|
}
|
|
2717
3387
|
)),
|
|
2718
|
-
instagram: /* @__PURE__ */
|
|
2719
|
-
linkedin: /* @__PURE__ */
|
|
3388
|
+
instagram: /* @__PURE__ */ React16.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React16.createElement("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React16.createElement("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React16.createElement("circle", { cx: "18", cy: "6", r: "1", fill: "currentColor" })),
|
|
3389
|
+
linkedin: /* @__PURE__ */ React16.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React16.createElement(
|
|
2720
3390
|
"path",
|
|
2721
3391
|
{
|
|
2722
3392
|
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",
|
|
@@ -2725,8 +3395,8 @@ function SocialLinks({
|
|
|
2725
3395
|
strokeLinecap: "round",
|
|
2726
3396
|
strokeLinejoin: "round"
|
|
2727
3397
|
}
|
|
2728
|
-
), /* @__PURE__ */
|
|
2729
|
-
youtube: /* @__PURE__ */
|
|
3398
|
+
), /* @__PURE__ */ React16.createElement("rect", { x: "2", y: "9", width: "4", height: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React16.createElement("circle", { cx: "4", cy: "4", r: "2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
3399
|
+
youtube: /* @__PURE__ */ React16.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React16.createElement("rect", { x: "2", y: "5", width: "20", height: "14", rx: "3", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React16.createElement("polygon", { points: "10,9 16,12 10,15", fill: "currentColor" }))
|
|
2730
3400
|
};
|
|
2731
3401
|
const links = [
|
|
2732
3402
|
{
|
|
@@ -2752,7 +3422,7 @@ function SocialLinks({
|
|
|
2752
3422
|
{
|
|
2753
3423
|
href: website,
|
|
2754
3424
|
label: "Website",
|
|
2755
|
-
icon: /* @__PURE__ */
|
|
3425
|
+
icon: /* @__PURE__ */ React16.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React16.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React16.createElement(
|
|
2756
3426
|
"path",
|
|
2757
3427
|
{
|
|
2758
3428
|
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",
|
|
@@ -2782,7 +3452,7 @@ function SocialLinks({
|
|
|
2782
3452
|
if (links.length === 0) {
|
|
2783
3453
|
return null;
|
|
2784
3454
|
}
|
|
2785
|
-
return /* @__PURE__ */
|
|
3455
|
+
return /* @__PURE__ */ React16.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ React16.createElement(
|
|
2786
3456
|
"a",
|
|
2787
3457
|
{
|
|
2788
3458
|
key: link.label,
|
|
@@ -2805,7 +3475,7 @@ function SocialLinks({
|
|
|
2805
3475
|
}
|
|
2806
3476
|
|
|
2807
3477
|
// src/IssueTags.jsx
|
|
2808
|
-
import
|
|
3478
|
+
import React17 from "react";
|
|
2809
3479
|
function IssueTags({
|
|
2810
3480
|
tags = [],
|
|
2811
3481
|
selectedTags = [],
|
|
@@ -2848,9 +3518,9 @@ function IssueTags({
|
|
|
2848
3518
|
onTagClick(tag.value);
|
|
2849
3519
|
}
|
|
2850
3520
|
};
|
|
2851
|
-
return /* @__PURE__ */
|
|
3521
|
+
return /* @__PURE__ */ React17.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
2852
3522
|
const isSelected = selectedTags.includes(tag.value);
|
|
2853
|
-
return /* @__PURE__ */
|
|
3523
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2854
3524
|
"span",
|
|
2855
3525
|
{
|
|
2856
3526
|
key: tag.value,
|
|
@@ -2879,7 +3549,7 @@ function IssueTags({
|
|
|
2879
3549
|
}
|
|
2880
3550
|
|
|
2881
3551
|
// src/CommitteeTable.jsx
|
|
2882
|
-
import
|
|
3552
|
+
import React18, { useState as useState10 } from "react";
|
|
2883
3553
|
var ROLE_ORDER = {
|
|
2884
3554
|
"chair": 0,
|
|
2885
3555
|
"co-chair": 1,
|
|
@@ -2906,7 +3576,7 @@ function CommitteeTable({
|
|
|
2906
3576
|
maxVisible = 6,
|
|
2907
3577
|
style = {}
|
|
2908
3578
|
}) {
|
|
2909
|
-
const [showAll, setShowAll] =
|
|
3579
|
+
const [showAll, setShowAll] = useState10(false);
|
|
2910
3580
|
if (committees.length === 0) {
|
|
2911
3581
|
return null;
|
|
2912
3582
|
}
|
|
@@ -2968,7 +3638,7 @@ function CommitteeTable({
|
|
|
2968
3638
|
cursor: "pointer"
|
|
2969
3639
|
}
|
|
2970
3640
|
};
|
|
2971
|
-
return /* @__PURE__ */
|
|
3641
|
+
return /* @__PURE__ */ React18.createElement("div", { style: styles2.container, className: "ev-committee-table" }, /* @__PURE__ */ React18.createElement("h4", { style: styles2.heading }, /* @__PURE__ */ React18.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React18.createElement("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /* @__PURE__ */ React18.createElement("circle", { cx: "9", cy: "7", r: "4" }), /* @__PURE__ */ React18.createElement("path", { d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" })), title), /* @__PURE__ */ React18.createElement("table", { style: styles2.table }, /* @__PURE__ */ React18.createElement("tbody", null, visible.map((committee, index) => /* @__PURE__ */ React18.createElement("tr", { key: index, style: styles2.row }, /* @__PURE__ */ React18.createElement("td", { style: { ...styles2.cell, ...styles2.nameCell } }, committee.url ? /* @__PURE__ */ React18.createElement(
|
|
2972
3642
|
"a",
|
|
2973
3643
|
{
|
|
2974
3644
|
href: committee.url,
|
|
@@ -2983,7 +3653,7 @@ function CommitteeTable({
|
|
|
2983
3653
|
}
|
|
2984
3654
|
},
|
|
2985
3655
|
committee.name
|
|
2986
|
-
) : committee.name), /* @__PURE__ */
|
|
3656
|
+
) : committee.name), /* @__PURE__ */ React18.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ React18.createElement(
|
|
2987
3657
|
"button",
|
|
2988
3658
|
{
|
|
2989
3659
|
type: "button",
|
|
@@ -2991,7 +3661,7 @@ function CommitteeTable({
|
|
|
2991
3661
|
onClick: () => setShowAll(!showAll)
|
|
2992
3662
|
},
|
|
2993
3663
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
2994
|
-
/* @__PURE__ */
|
|
3664
|
+
/* @__PURE__ */ React18.createElement(
|
|
2995
3665
|
"svg",
|
|
2996
3666
|
{
|
|
2997
3667
|
width: "14",
|
|
@@ -3004,16 +3674,16 @@ function CommitteeTable({
|
|
|
3004
3674
|
strokeLinejoin: "round",
|
|
3005
3675
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
3006
3676
|
},
|
|
3007
|
-
/* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ React18.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
3008
3678
|
)
|
|
3009
3679
|
));
|
|
3010
3680
|
}
|
|
3011
3681
|
|
|
3012
3682
|
// src/PoliticianProfile.jsx
|
|
3013
|
-
import
|
|
3683
|
+
import React21, { useState as useState11, useEffect as useEffect8 } from "react";
|
|
3014
3684
|
|
|
3015
3685
|
// src/LegislativeInlineSummary.jsx
|
|
3016
|
-
import
|
|
3686
|
+
import React19 from "react";
|
|
3017
3687
|
function normalizePosition(pos) {
|
|
3018
3688
|
if (!pos) return "";
|
|
3019
3689
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -3121,7 +3791,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
3121
3791
|
fontSize: fontSizes.sm,
|
|
3122
3792
|
fontWeight: fontWeights.medium
|
|
3123
3793
|
};
|
|
3124
|
-
return /* @__PURE__ */
|
|
3794
|
+
return /* @__PURE__ */ React19.createElement("div", { style: card }, stats.length > 0 && /* @__PURE__ */ React19.createElement("div", { style: statsRow }, stats.map((s, i) => /* @__PURE__ */ React19.createElement("div", { key: i, style: statItem }, /* @__PURE__ */ React19.createElement("span", { style: statValue }, s.value), s.label && /* @__PURE__ */ React19.createElement("span", { style: statLabel }, s.label)))), mostRecentAction && /* @__PURE__ */ React19.createElement("div", { style: actionLine, title: mostRecentAction }, mostRecentAction), /* @__PURE__ */ React19.createElement("div", null), /* @__PURE__ */ React19.createElement("div", { style: footerRow }, /* @__PURE__ */ React19.createElement(
|
|
3125
3795
|
"button",
|
|
3126
3796
|
{
|
|
3127
3797
|
onClick: () => {
|
|
@@ -3146,12 +3816,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
3146
3816
|
}
|
|
3147
3817
|
},
|
|
3148
3818
|
"View Full Legislative Record",
|
|
3149
|
-
/* @__PURE__ */
|
|
3819
|
+
/* @__PURE__ */ React19.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__ */ React19.createElement("path", { d: "M9 18l6-6-6-6" }))
|
|
3150
3820
|
)));
|
|
3151
3821
|
}
|
|
3152
3822
|
|
|
3153
3823
|
// src/JudicialScorecard.jsx
|
|
3154
|
-
import
|
|
3824
|
+
import React20 from "react";
|
|
3155
3825
|
|
|
3156
3826
|
// src/judicialUtils.js
|
|
3157
3827
|
function formatDate(dateStr) {
|
|
@@ -3269,7 +3939,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
3269
3939
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
3270
3940
|
}
|
|
3271
3941
|
};
|
|
3272
|
-
return /* @__PURE__ */
|
|
3942
|
+
return /* @__PURE__ */ React20.createElement("section", { style: sectionStyle }, /* @__PURE__ */ React20.createElement("h3", { style: headingStyle }, "Judicial Record"), evaluations.length > 0 && /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: "16px" } }, evaluations.slice(0, 3).map((ev, i) => /* @__PURE__ */ React20.createElement("span", { key: i, style: evalChipStyle }, ev.rating, /* @__PURE__ */ React20.createElement("span", { style: { fontWeight: 400, color: "#4a90a4", fontSize: "11px" } }, "\u2014 ", ev.source)))), metrics.length > 0 && /* @__PURE__ */ React20.createElement("div", { style: cardGridStyle }, metrics.slice(0, 4).map((m, i) => /* @__PURE__ */ React20.createElement("div", { key: i, style: metricCardStyle }, /* @__PURE__ */ React20.createElement("div", { style: metricLabelStyle }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ React20.createElement("div", { style: metricValueStyle }, formatMetricValue(m.metric_type, m.value)), m.context_label && /* @__PURE__ */ React20.createElement("div", { style: metricContextStyle }, m.context_label)))), disciplinary.length > 0 && /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: "12px" } }, disciplinary.slice(0, 2).map((d, i) => /* @__PURE__ */ React20.createElement("div", { key: i, style: disciplinaryStyle }, /* @__PURE__ */ React20.createElement("strong", null, d.record_type), " \u2014 ", formatDate(d.record_date), d.description && /* @__PURE__ */ React20.createElement("div", { style: { marginTop: "4px" } }, d.description)))), /* @__PURE__ */ React20.createElement("a", { href: `/politician/${politicianId}/judicial-record`, onClick: handleNavigate, style: linkStyle }, "View Full Judicial Record \u2192"));
|
|
3273
3943
|
}
|
|
3274
3944
|
|
|
3275
3945
|
// src/PoliticianProfile.jsx
|
|
@@ -3420,13 +4090,13 @@ function formatAddress(addr) {
|
|
|
3420
4090
|
if (cityStateZip) lines.push(cityStateZip);
|
|
3421
4091
|
return lines;
|
|
3422
4092
|
}
|
|
3423
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3424
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3425
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3426
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3427
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3428
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3429
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4093
|
+
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */ React21.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React21.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ React21.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ React21.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ React21.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
4094
|
+
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */ React21.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React21.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React21.createElement("polyline", { points: "12 6 12 12 16 14" }));
|
|
4095
|
+
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */ React21.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React21.createElement("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }), /* @__PURE__ */ React21.createElement("circle", { cx: "12", cy: "10", r: "3" }));
|
|
4096
|
+
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */ React21.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React21.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" }));
|
|
4097
|
+
var MailIcon = ({ size = 16 }) => /* @__PURE__ */ React21.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React21.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__ */ React21.createElement("path", { d: "M22 6L12 13L2 6" }));
|
|
4098
|
+
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */ React21.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React21.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React21.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" }));
|
|
4099
|
+
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ React21.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React21.createElement("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }), /* @__PURE__ */ React21.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ React21.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" }));
|
|
3430
4100
|
function PoliticianProfile({
|
|
3431
4101
|
politician = {},
|
|
3432
4102
|
onBack,
|
|
@@ -3453,8 +4123,8 @@ function PoliticianProfile({
|
|
|
3453
4123
|
return pol.photo_origin_url;
|
|
3454
4124
|
})();
|
|
3455
4125
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
3456
|
-
const [imgError, setImgError] =
|
|
3457
|
-
|
|
4126
|
+
const [imgError, setImgError] = useState11(false);
|
|
4127
|
+
useEffect8(() => {
|
|
3458
4128
|
setImgError(false);
|
|
3459
4129
|
}, [profileImageUrl]);
|
|
3460
4130
|
const getSocialHandle = (type) => {
|
|
@@ -3754,7 +4424,7 @@ function PoliticianProfile({
|
|
|
3754
4424
|
borderRadius: borderRadius.full
|
|
3755
4425
|
}
|
|
3756
4426
|
};
|
|
3757
|
-
return /* @__PURE__ */
|
|
4427
|
+
return /* @__PURE__ */ React21.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ React21.createElement(
|
|
3758
4428
|
"button",
|
|
3759
4429
|
{
|
|
3760
4430
|
type: "button",
|
|
@@ -3767,9 +4437,9 @@ function PoliticianProfile({
|
|
|
3767
4437
|
e.currentTarget.style.textDecoration = "none";
|
|
3768
4438
|
}
|
|
3769
4439
|
},
|
|
3770
|
-
/* @__PURE__ */
|
|
4440
|
+
/* @__PURE__ */ React21.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React21.createElement("path", { d: "M15 19l-7-7 7-7" })),
|
|
3771
4441
|
label
|
|
3772
|
-
), /* @__PURE__ */
|
|
4442
|
+
), /* @__PURE__ */ React21.createElement("div", { style: styles2.card }, /* @__PURE__ */ React21.createElement("div", { style: styles2.heroRow }, /* @__PURE__ */ React21.createElement("div", { style: styles2.photoWrap }, profileImageUrl && !imgError ? /* @__PURE__ */ React21.createElement(
|
|
3773
4443
|
"img",
|
|
3774
4444
|
{
|
|
3775
4445
|
src: profileImageUrl,
|
|
@@ -3777,7 +4447,7 @@ function PoliticianProfile({
|
|
|
3777
4447
|
style: styles2.photo,
|
|
3778
4448
|
onError: () => setImgError(true)
|
|
3779
4449
|
}
|
|
3780
|
-
) : /* @__PURE__ */
|
|
4450
|
+
) : /* @__PURE__ */ React21.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ React21.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ React21.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ React21.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ React21.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ React21.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ React21.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ React21.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ React21.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React21.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ React21.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React21.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ React21.createElement(
|
|
3781
4451
|
"a",
|
|
3782
4452
|
{
|
|
3783
4453
|
href: pol.web_form_url,
|
|
@@ -3791,9 +4461,9 @@ function PoliticianProfile({
|
|
|
3791
4461
|
e.currentTarget.style.background = colors.evTeal;
|
|
3792
4462
|
}
|
|
3793
4463
|
},
|
|
3794
|
-
/* @__PURE__ */
|
|
4464
|
+
/* @__PURE__ */ React21.createElement(ExternalLinkIcon, { size: 14 }),
|
|
3795
4465
|
"Submit a Message"
|
|
3796
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
4466
|
+
))), hasContactInfo && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("div", { style: divider }), /* @__PURE__ */ React21.createElement("div", { style: sectionHeading }, /* @__PURE__ */ React21.createElement(MailIcon, { size: 20 }), "Contact Information"), /* @__PURE__ */ React21.createElement("div", { style: styles2.contactGrid }, hasAddresses && /* @__PURE__ */ React21.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React21.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React21.createElement(MapPinIcon, { size: 12 }), "Addresses"), addresses.map((addr, i) => /* @__PURE__ */ React21.createElement("div", { key: `addr-${i}` }, /* @__PURE__ */ React21.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, addr.type), /* @__PURE__ */ React21.createElement("p", { style: styles2.contactValue }, addr.lines.map((line, j) => /* @__PURE__ */ React21.createElement(React21.Fragment, { key: j }, line, j < addr.lines.length - 1 && /* @__PURE__ */ React21.createElement("br", null))))))), hasPhones && /* @__PURE__ */ React21.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React21.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React21.createElement(PhoneIcon, { size: 12 }), "Phone"), Object.entries(phonesByType).map(([type, phones], i) => /* @__PURE__ */ React21.createElement("div", { key: `phone-${type}` }, /* @__PURE__ */ React21.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), phones.map((phone, j) => /* @__PURE__ */ React21.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ React21.createElement(
|
|
3797
4467
|
"a",
|
|
3798
4468
|
{
|
|
3799
4469
|
href: `tel:${phone}`,
|
|
@@ -3806,7 +4476,7 @@ function PoliticianProfile({
|
|
|
3806
4476
|
}
|
|
3807
4477
|
},
|
|
3808
4478
|
phone
|
|
3809
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
4479
|
+
)))))), hasEmails && /* @__PURE__ */ React21.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React21.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React21.createElement(MailIcon, { size: 12 }), "Email"), Object.entries(emailsByType).filter(([, emails]) => emails.some((e) => e && e.trim())).map(([type, emails], i) => /* @__PURE__ */ React21.createElement("div", { key: `email-${type}` }, /* @__PURE__ */ React21.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), emails.filter((e) => e && e.trim()).map((email, j) => /* @__PURE__ */ React21.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ React21.createElement(
|
|
3810
4480
|
"a",
|
|
3811
4481
|
{
|
|
3812
4482
|
href: `mailto:${email}`,
|
|
@@ -3819,7 +4489,7 @@ function PoliticianProfile({
|
|
|
3819
4489
|
}
|
|
3820
4490
|
},
|
|
3821
4491
|
email
|
|
3822
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
4492
|
+
)))))), hasWebsitesCol && /* @__PURE__ */ React21.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React21.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React21.createElement(GlobeIcon, { size: 12 }), "Websites"), allWebsites.map((url, i) => /* @__PURE__ */ React21.createElement("p", { key: i, style: styles2.contactValue }, /* @__PURE__ */ React21.createElement(
|
|
3823
4493
|
"a",
|
|
3824
4494
|
{
|
|
3825
4495
|
href: url,
|
|
@@ -3834,7 +4504,7 @@ function PoliticianProfile({
|
|
|
3834
4504
|
}
|
|
3835
4505
|
},
|
|
3836
4506
|
extractDomain(url)
|
|
3837
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
4507
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ React21.createElement(
|
|
3838
4508
|
SocialLinks,
|
|
3839
4509
|
{
|
|
3840
4510
|
twitter,
|
|
@@ -3845,14 +4515,14 @@ function PoliticianProfile({
|
|
|
3845
4515
|
size: "sm",
|
|
3846
4516
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
3847
4517
|
}
|
|
3848
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
4518
|
+
)))), committees.length > 0 && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("div", { style: divider }), /* @__PURE__ */ React21.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ React21.createElement(
|
|
3849
4519
|
JudicialScorecard,
|
|
3850
4520
|
{
|
|
3851
4521
|
judicialRecord,
|
|
3852
4522
|
politicianId,
|
|
3853
4523
|
onNavigateToRecord
|
|
3854
4524
|
}
|
|
3855
|
-
) : /* @__PURE__ */
|
|
4525
|
+
) : /* @__PURE__ */ React21.createElement(
|
|
3856
4526
|
LegislativeInlineSummary,
|
|
3857
4527
|
{
|
|
3858
4528
|
summary: legislativeSummary,
|
|
@@ -3863,7 +4533,7 @@ function PoliticianProfile({
|
|
|
3863
4533
|
}
|
|
3864
4534
|
|
|
3865
4535
|
// src/LegislativeRecord.jsx
|
|
3866
|
-
import
|
|
4536
|
+
import React22, { useState as useState12 } from "react";
|
|
3867
4537
|
var DEFAULT_LIMIT = 25;
|
|
3868
4538
|
function normalizeText(str) {
|
|
3869
4539
|
if (!str) return "";
|
|
@@ -3943,7 +4613,7 @@ function getPositionBadge(position) {
|
|
|
3943
4613
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
3944
4614
|
}
|
|
3945
4615
|
function Badge({ label, bg, text }) {
|
|
3946
|
-
return /* @__PURE__ */
|
|
4616
|
+
return /* @__PURE__ */ React22.createElement("span", { style: {
|
|
3947
4617
|
display: "inline-block",
|
|
3948
4618
|
background: bg,
|
|
3949
4619
|
color: text,
|
|
@@ -3956,18 +4626,18 @@ function Badge({ label, bg, text }) {
|
|
|
3956
4626
|
} }, label);
|
|
3957
4627
|
}
|
|
3958
4628
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
3959
|
-
return /* @__PURE__ */
|
|
4629
|
+
return /* @__PURE__ */ React22.createElement("div", { style: {
|
|
3960
4630
|
display: "flex",
|
|
3961
4631
|
alignItems: "center",
|
|
3962
4632
|
justifyContent: "space-between",
|
|
3963
4633
|
marginBottom: spacing[4]
|
|
3964
|
-
} }, /* @__PURE__ */
|
|
4634
|
+
} }, /* @__PURE__ */ React22.createElement("h2", { style: {
|
|
3965
4635
|
fontFamily: fonts.primary,
|
|
3966
4636
|
fontSize: fontSizes.xl,
|
|
3967
4637
|
fontWeight: fontWeights.bold,
|
|
3968
4638
|
color: colors.evTeal,
|
|
3969
4639
|
margin: 0
|
|
3970
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
4640
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ React22.createElement(
|
|
3971
4641
|
"select",
|
|
3972
4642
|
{
|
|
3973
4643
|
value: yearFilter,
|
|
@@ -3983,13 +4653,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
3983
4653
|
cursor: "pointer"
|
|
3984
4654
|
}
|
|
3985
4655
|
},
|
|
3986
|
-
/* @__PURE__ */
|
|
3987
|
-
years.map((y) => /* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ React22.createElement("option", { value: "All" }, "All years"),
|
|
4657
|
+
years.map((y) => /* @__PURE__ */ React22.createElement("option", { key: y, value: y }, y))
|
|
3988
4658
|
));
|
|
3989
4659
|
}
|
|
3990
4660
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
3991
4661
|
if (totalCount <= visibleCount) return null;
|
|
3992
|
-
return /* @__PURE__ */
|
|
4662
|
+
return /* @__PURE__ */ React22.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ React22.createElement(
|
|
3993
4663
|
"button",
|
|
3994
4664
|
{
|
|
3995
4665
|
type: "button",
|
|
@@ -4017,7 +4687,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
4017
4687
|
));
|
|
4018
4688
|
}
|
|
4019
4689
|
function EmptyState({ message }) {
|
|
4020
|
-
return /* @__PURE__ */
|
|
4690
|
+
return /* @__PURE__ */ React22.createElement("p", { style: {
|
|
4021
4691
|
fontFamily: fonts.primary,
|
|
4022
4692
|
fontSize: fontSizes.sm,
|
|
4023
4693
|
color: colors.textMuted,
|
|
@@ -4027,24 +4697,24 @@ function EmptyState({ message }) {
|
|
|
4027
4697
|
} }, message);
|
|
4028
4698
|
}
|
|
4029
4699
|
function Spinner() {
|
|
4030
|
-
return /* @__PURE__ */
|
|
4700
|
+
return /* @__PURE__ */ React22.createElement("div", { style: {
|
|
4031
4701
|
display: "flex",
|
|
4032
4702
|
justifyContent: "center",
|
|
4033
4703
|
alignItems: "center",
|
|
4034
4704
|
padding: spacing[10]
|
|
4035
|
-
} }, /* @__PURE__ */
|
|
4705
|
+
} }, /* @__PURE__ */ React22.createElement("div", { style: {
|
|
4036
4706
|
width: "40px",
|
|
4037
4707
|
height: "40px",
|
|
4038
4708
|
borderRadius: borderRadius.full,
|
|
4039
4709
|
border: `3px solid ${colors.borderLight}`,
|
|
4040
4710
|
borderTopColor: colors.evTeal,
|
|
4041
4711
|
animation: "ev-spin 0.8s linear infinite"
|
|
4042
|
-
} }), /* @__PURE__ */
|
|
4712
|
+
} }), /* @__PURE__ */ React22.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
4043
4713
|
}
|
|
4044
4714
|
function CommitteesSection({ committees, leadership }) {
|
|
4045
|
-
const [showAll, setShowAll] =
|
|
4715
|
+
const [showAll, setShowAll] = useState12(false);
|
|
4046
4716
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
4047
|
-
return /* @__PURE__ */
|
|
4717
|
+
return /* @__PURE__ */ React22.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React22.createElement(SectionHeader, { title: "Committees & Leadership" }), leadership && leadership.length > 0 && /* @__PURE__ */ React22.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: spacing[2], marginBottom: spacing[4] } }, leadership.map((role, i) => /* @__PURE__ */ React22.createElement("div", { key: i, style: {
|
|
4048
4718
|
display: "inline-flex",
|
|
4049
4719
|
alignItems: "center",
|
|
4050
4720
|
gap: spacing[1],
|
|
@@ -4055,23 +4725,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
4055
4725
|
fontFamily: fonts.primary,
|
|
4056
4726
|
fontSize: fontSizes.sm,
|
|
4057
4727
|
fontWeight: fontWeights.semibold
|
|
4058
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
4728
|
+
} }, role.title, role.chamber && /* @__PURE__ */ React22.createElement("span", { style: { fontWeight: fontWeights.regular, opacity: 0.85 } }, "(", role.chamber, ")")))), committees.length === 0 ? /* @__PURE__ */ React22.createElement(EmptyState, { message: "Committee information is not available for this office." }) : /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", null, visible.map((c, i) => {
|
|
4059
4729
|
const badge = getRoleBadge(c.role);
|
|
4060
|
-
return /* @__PURE__ */
|
|
4730
|
+
return /* @__PURE__ */ React22.createElement("div", { key: i, style: {
|
|
4061
4731
|
display: "flex",
|
|
4062
4732
|
alignItems: "center",
|
|
4063
4733
|
justifyContent: "space-between",
|
|
4064
4734
|
padding: `${spacing[3]} 0`,
|
|
4065
4735
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
4066
4736
|
gap: spacing[3]
|
|
4067
|
-
} }, /* @__PURE__ */
|
|
4737
|
+
} }, /* @__PURE__ */ React22.createElement("span", { style: {
|
|
4068
4738
|
fontFamily: fonts.primary,
|
|
4069
4739
|
fontSize: fontSizes.sm,
|
|
4070
4740
|
color: colors.textSecondary,
|
|
4071
4741
|
flex: 1,
|
|
4072
4742
|
minWidth: 0
|
|
4073
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
4074
|
-
})), !showAll && /* @__PURE__ */
|
|
4743
|
+
} }, c.committee_name, c.parent_name && /* @__PURE__ */ React22.createElement("span", { style: { color: colors.textMuted, marginLeft: spacing[1] } }, "(", c.parent_name, ")")), /* @__PURE__ */ React22.createElement(Badge, { label: badge.label, bg: badge.bg, text: badge.text }));
|
|
4744
|
+
})), !showAll && /* @__PURE__ */ React22.createElement(
|
|
4075
4745
|
ShowAllLink,
|
|
4076
4746
|
{
|
|
4077
4747
|
totalCount: committees.length,
|
|
@@ -4082,15 +4752,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
4082
4752
|
}
|
|
4083
4753
|
function LegislationSection({ bills, isMobile }) {
|
|
4084
4754
|
const years = getYears(bills, "introduced_at");
|
|
4085
|
-
const [yearFilter, setYearFilter] =
|
|
4086
|
-
const [showAll, setShowAll] =
|
|
4755
|
+
const [yearFilter, setYearFilter] = useState12("All");
|
|
4756
|
+
const [showAll, setShowAll] = useState12(false);
|
|
4087
4757
|
const handleYearChange = (y) => {
|
|
4088
4758
|
setYearFilter(y);
|
|
4089
4759
|
setShowAll(false);
|
|
4090
4760
|
};
|
|
4091
4761
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
4092
4762
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
4093
|
-
return /* @__PURE__ */
|
|
4763
|
+
return /* @__PURE__ */ React22.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React22.createElement(
|
|
4094
4764
|
SectionHeader,
|
|
4095
4765
|
{
|
|
4096
4766
|
title: "Sponsored Legislation",
|
|
@@ -4098,42 +4768,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
4098
4768
|
years,
|
|
4099
4769
|
onYearChange: handleYearChange
|
|
4100
4770
|
}
|
|
4101
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
4771
|
+
), bills.length === 0 ? /* @__PURE__ */ React22.createElement(EmptyState, { message: "Sponsored legislation data is not available for this office." }) : /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", null, visible.map((bill, i) => {
|
|
4102
4772
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
4103
|
-
return /* @__PURE__ */
|
|
4773
|
+
return /* @__PURE__ */ React22.createElement("div", { key: i, style: {
|
|
4104
4774
|
display: "flex",
|
|
4105
4775
|
flexDirection: isMobile ? "column" : "row",
|
|
4106
4776
|
alignItems: isMobile ? "flex-start" : "center",
|
|
4107
4777
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
4108
4778
|
padding: `${spacing[3]} 0`,
|
|
4109
4779
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
4110
|
-
} }, /* @__PURE__ */
|
|
4780
|
+
} }, /* @__PURE__ */ React22.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React22.createElement("span", { style: {
|
|
4111
4781
|
fontFamily: fonts.primary,
|
|
4112
4782
|
fontSize: fontSizes.xs,
|
|
4113
4783
|
fontWeight: fontWeights.bold,
|
|
4114
4784
|
color: colors.textSecondary,
|
|
4115
4785
|
marginRight: spacing[2]
|
|
4116
|
-
} }, bill.number), /* @__PURE__ */
|
|
4786
|
+
} }, bill.number), /* @__PURE__ */ React22.createElement("span", { style: {
|
|
4117
4787
|
fontFamily: fonts.primary,
|
|
4118
4788
|
fontSize: fontSizes.sm,
|
|
4119
4789
|
color: colors.textSecondary
|
|
4120
|
-
} }, bill.title)), /* @__PURE__ */
|
|
4790
|
+
} }, bill.title)), /* @__PURE__ */ React22.createElement("div", { style: {
|
|
4121
4791
|
display: "flex",
|
|
4122
4792
|
alignItems: "center",
|
|
4123
4793
|
gap: spacing[2],
|
|
4124
4794
|
flexShrink: 0,
|
|
4125
4795
|
flexWrap: "wrap"
|
|
4126
|
-
} }, /* @__PURE__ */
|
|
4796
|
+
} }, /* @__PURE__ */ React22.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ React22.createElement("span", { style: {
|
|
4127
4797
|
fontFamily: fonts.primary,
|
|
4128
4798
|
fontSize: fontSizes.xs,
|
|
4129
4799
|
color: colors.textMuted
|
|
4130
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
4800
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ React22.createElement("span", { style: {
|
|
4131
4801
|
fontFamily: fonts.primary,
|
|
4132
4802
|
fontSize: fontSizes.xs,
|
|
4133
4803
|
color: colors.textMuted,
|
|
4134
4804
|
fontStyle: "italic"
|
|
4135
4805
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
4136
|
-
})), !showAll && /* @__PURE__ */
|
|
4806
|
+
})), !showAll && /* @__PURE__ */ React22.createElement(
|
|
4137
4807
|
ShowAllLink,
|
|
4138
4808
|
{
|
|
4139
4809
|
totalCount: filtered.length,
|
|
@@ -4144,15 +4814,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
4144
4814
|
}
|
|
4145
4815
|
function VotingSection({ votes, isMobile }) {
|
|
4146
4816
|
const years = getYears(votes, "vote_date");
|
|
4147
|
-
const [yearFilter, setYearFilter] =
|
|
4148
|
-
const [showAll, setShowAll] =
|
|
4817
|
+
const [yearFilter, setYearFilter] = useState12("All");
|
|
4818
|
+
const [showAll, setShowAll] = useState12(false);
|
|
4149
4819
|
const handleYearChange = (y) => {
|
|
4150
4820
|
setYearFilter(y);
|
|
4151
4821
|
setShowAll(false);
|
|
4152
4822
|
};
|
|
4153
4823
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
4154
4824
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
4155
|
-
return /* @__PURE__ */
|
|
4825
|
+
return /* @__PURE__ */ React22.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React22.createElement(
|
|
4156
4826
|
SectionHeader,
|
|
4157
4827
|
{
|
|
4158
4828
|
title: "Voting Record",
|
|
@@ -4160,38 +4830,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
4160
4830
|
years,
|
|
4161
4831
|
onYearChange: handleYearChange
|
|
4162
4832
|
}
|
|
4163
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
4833
|
+
), votes.length === 0 ? /* @__PURE__ */ React22.createElement(EmptyState, { message: "Voting records are not available for this office." }) : /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", null, visible.map((vote, i) => {
|
|
4164
4834
|
const positionBadge = getPositionBadge(vote.position);
|
|
4165
4835
|
const normPosition = normalizeText(vote.position);
|
|
4166
4836
|
const topic = vote.bill_title || vote.vote_question;
|
|
4167
4837
|
const sourceUrl = vote.bill_url;
|
|
4168
|
-
return /* @__PURE__ */
|
|
4838
|
+
return /* @__PURE__ */ React22.createElement("div", { key: i, style: {
|
|
4169
4839
|
display: "flex",
|
|
4170
4840
|
flexDirection: isMobile ? "column" : "row",
|
|
4171
4841
|
alignItems: isMobile ? "flex-start" : "center",
|
|
4172
4842
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
4173
4843
|
padding: `${spacing[3]} 0`,
|
|
4174
4844
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
4175
|
-
} }, /* @__PURE__ */
|
|
4845
|
+
} }, /* @__PURE__ */ React22.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React22.createElement("span", { style: {
|
|
4176
4846
|
fontFamily: fonts.primary,
|
|
4177
4847
|
fontSize: fontSizes.sm,
|
|
4178
4848
|
color: colors.textSecondary
|
|
4179
|
-
} }, topic)), /* @__PURE__ */
|
|
4849
|
+
} }, topic)), /* @__PURE__ */ React22.createElement("div", { style: {
|
|
4180
4850
|
display: "flex",
|
|
4181
4851
|
alignItems: "center",
|
|
4182
4852
|
gap: spacing[2],
|
|
4183
4853
|
flexShrink: 0,
|
|
4184
4854
|
flexWrap: "wrap"
|
|
4185
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
4855
|
+
} }, vote.vote_date && /* @__PURE__ */ React22.createElement("span", { style: {
|
|
4186
4856
|
fontFamily: fonts.primary,
|
|
4187
4857
|
fontSize: fontSizes.xs,
|
|
4188
4858
|
color: colors.textMuted
|
|
4189
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
4859
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ React22.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ React22.createElement("span", { style: {
|
|
4190
4860
|
fontFamily: fonts.primary,
|
|
4191
4861
|
fontSize: fontSizes.xs,
|
|
4192
4862
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
4193
4863
|
fontWeight: fontWeights.medium
|
|
4194
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
4864
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ React22.createElement(
|
|
4195
4865
|
"a",
|
|
4196
4866
|
{
|
|
4197
4867
|
href: sourceUrl,
|
|
@@ -4212,7 +4882,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
4212
4882
|
},
|
|
4213
4883
|
"Source"
|
|
4214
4884
|
)));
|
|
4215
|
-
})), !showAll && /* @__PURE__ */
|
|
4885
|
+
})), !showAll && /* @__PURE__ */ React22.createElement(
|
|
4216
4886
|
ShowAllLink,
|
|
4217
4887
|
{
|
|
4218
4888
|
totalCount: filtered.length,
|
|
@@ -4231,20 +4901,20 @@ function LegislativeRecord({
|
|
|
4231
4901
|
}) {
|
|
4232
4902
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
4233
4903
|
if (loading) {
|
|
4234
|
-
return /* @__PURE__ */
|
|
4904
|
+
return /* @__PURE__ */ React22.createElement(Spinner, null);
|
|
4235
4905
|
}
|
|
4236
|
-
return /* @__PURE__ */
|
|
4906
|
+
return /* @__PURE__ */ React22.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ React22.createElement("h1", { style: {
|
|
4237
4907
|
fontFamily: fonts.primary,
|
|
4238
4908
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
4239
4909
|
fontWeight: fontWeights.bold,
|
|
4240
4910
|
color: colors.evTeal,
|
|
4241
4911
|
marginBottom: spacing[8],
|
|
4242
4912
|
marginTop: 0
|
|
4243
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
4913
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ React22.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ React22.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ React22.createElement(VotingSection, { votes, isMobile }));
|
|
4244
4914
|
}
|
|
4245
4915
|
|
|
4246
4916
|
// src/JudicialRecordDetail.jsx
|
|
4247
|
-
import
|
|
4917
|
+
import React23 from "react";
|
|
4248
4918
|
var containerStyle = {
|
|
4249
4919
|
fontFamily: "'Manrope', sans-serif",
|
|
4250
4920
|
maxWidth: "800px"
|
|
@@ -4329,7 +4999,7 @@ var emptyStateStyle = {
|
|
|
4329
4999
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
4330
5000
|
var _a;
|
|
4331
5001
|
if (!judicialRecord) {
|
|
4332
|
-
return /* @__PURE__ */
|
|
5002
|
+
return /* @__PURE__ */ React23.createElement("div", { style: containerStyle }, /* @__PURE__ */ React23.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ React23.createElement("div", { style: emptyStateStyle }, "No judicial record data available."));
|
|
4333
5003
|
}
|
|
4334
5004
|
const {
|
|
4335
5005
|
judge_detail: detail,
|
|
@@ -4338,13 +5008,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
4338
5008
|
disciplinary_records: disciplinary = []
|
|
4339
5009
|
} = judicialRecord;
|
|
4340
5010
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
4341
|
-
return /* @__PURE__ */
|
|
5011
|
+
return /* @__PURE__ */ React23.createElement("div", { style: containerStyle }, /* @__PURE__ */ React23.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ React23.createElement("h1", { style: nameStyle }, displayName), /* @__PURE__ */ React23.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__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("h2", { style: sectionHeadingStyle }, "Background"), detail.appointed_by && /* @__PURE__ */ React23.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React23.createElement("span", { style: detailLabelStyle }, "Appointed by"), /* @__PURE__ */ React23.createElement("span", { style: detailValueStyle }, detail.appointed_by, " (", detail.appointing_president_party, ")")), detail.confirmation_vote && /* @__PURE__ */ React23.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React23.createElement("span", { style: detailLabelStyle }, "Confirmation Vote"), /* @__PURE__ */ React23.createElement("span", { style: detailValueStyle }, detail.confirmation_vote)), detail.election_type && /* @__PURE__ */ React23.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React23.createElement("span", { style: detailLabelStyle }, "Election Type"), /* @__PURE__ */ React23.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__ */ React23.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React23.createElement("span", { style: detailLabelStyle }, "Areas of Focus"), /* @__PURE__ */ React23.createElement("span", { style: detailValueStyle }, detail.areas_of_focus.join(", ")))), /* @__PURE__ */ React23.createElement("h2", { style: sectionHeadingStyle }, "Performance Evaluations"), evaluations.length === 0 ? /* @__PURE__ */ React23.createElement("div", { style: emptyStateStyle }, "No evaluation data available yet.") : /* @__PURE__ */ React23.createElement("table", { style: tableStyle }, /* @__PURE__ */ React23.createElement("thead", null, /* @__PURE__ */ React23.createElement("tr", null, /* @__PURE__ */ React23.createElement("th", { style: thStyle }, "Source"), /* @__PURE__ */ React23.createElement("th", { style: thStyle }, "Rating"), /* @__PURE__ */ React23.createElement("th", { style: thStyle }, "Date"))), /* @__PURE__ */ React23.createElement("tbody", null, evaluations.map((ev, i) => /* @__PURE__ */ React23.createElement("tr", { key: i }, /* @__PURE__ */ React23.createElement("td", { style: tdStyle }, ev.source_url ? /* @__PURE__ */ React23.createElement("a", { href: ev.source_url, target: "_blank", rel: "noopener noreferrer", style: { color: "#319795" } }, ev.source) : ev.source), /* @__PURE__ */ React23.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, ev.rating), /* @__PURE__ */ React23.createElement("td", { style: tdStyle }, formatDate(ev.rating_date)))))), /* @__PURE__ */ React23.createElement("h2", { style: sectionHeadingStyle }, "Performance Metrics"), metrics.length === 0 ? /* @__PURE__ */ React23.createElement("div", { style: emptyStateStyle }, "No performance metric data available yet.") : /* @__PURE__ */ React23.createElement("table", { style: tableStyle }, /* @__PURE__ */ React23.createElement("thead", null, /* @__PURE__ */ React23.createElement("tr", null, /* @__PURE__ */ React23.createElement("th", { style: thStyle }, "Metric"), /* @__PURE__ */ React23.createElement("th", { style: thStyle }, "Value"), /* @__PURE__ */ React23.createElement("th", { style: thStyle }, "Context"), /* @__PURE__ */ React23.createElement("th", { style: thStyle }, "Period"))), /* @__PURE__ */ React23.createElement("tbody", null, metrics.map((m, i) => /* @__PURE__ */ React23.createElement("tr", { key: i }, /* @__PURE__ */ React23.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ React23.createElement("td", { style: tdStyle }, formatMetricValue(m.metric_type, m.value)), /* @__PURE__ */ React23.createElement("td", { style: { ...tdStyle, color: "#718096", fontSize: "13px" } }, m.context_label), /* @__PURE__ */ React23.createElement("td", { style: tdStyle }, m.time_period))))), disciplinary.length > 0 && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("h2", { style: sectionHeadingStyle }, "Disciplinary History"), disciplinary.map((d, i) => /* @__PURE__ */ React23.createElement("div", { key: i, style: {
|
|
4342
5012
|
borderLeft: "3px solid #fc8181",
|
|
4343
5013
|
backgroundColor: "#fff5f5",
|
|
4344
5014
|
borderRadius: "0 6px 6px 0",
|
|
4345
5015
|
padding: "12px 16px",
|
|
4346
5016
|
marginBottom: "10px"
|
|
4347
|
-
} }, /* @__PURE__ */
|
|
5017
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: { fontWeight: 700, color: "#742a2a", fontSize: "14px" } }, d.record_type, " \u2014 ", formatDate(d.record_date)), d.description && /* @__PURE__ */ React23.createElement("div", { style: { color: "#9b2c2c", fontSize: "13px", marginTop: "4px" } }, d.description), d.source_url && /* @__PURE__ */ React23.createElement(
|
|
4348
5018
|
"a",
|
|
4349
5019
|
{
|
|
4350
5020
|
href: d.source_url,
|
|
@@ -4357,7 +5027,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
4357
5027
|
}
|
|
4358
5028
|
|
|
4359
5029
|
// src/AuthForm.jsx
|
|
4360
|
-
import
|
|
5030
|
+
import React24, { useState as useState13 } from "react";
|
|
4361
5031
|
function AuthForm({
|
|
4362
5032
|
logoSrc = "/EVLogo.svg",
|
|
4363
5033
|
appName = "Empowered Vote",
|
|
@@ -4368,11 +5038,11 @@ function AuthForm({
|
|
|
4368
5038
|
error = null,
|
|
4369
5039
|
submitting = false
|
|
4370
5040
|
}) {
|
|
4371
|
-
const [username, setUsername] =
|
|
4372
|
-
const [password, setPassword] =
|
|
4373
|
-
const [confirmPassword, setConfirmPassword] =
|
|
4374
|
-
const [showPasswords, setShowPasswords] =
|
|
4375
|
-
const [passwordMismatch, setPasswordMismatch] =
|
|
5041
|
+
const [username, setUsername] = useState13("");
|
|
5042
|
+
const [password, setPassword] = useState13("");
|
|
5043
|
+
const [confirmPassword, setConfirmPassword] = useState13("");
|
|
5044
|
+
const [showPasswords, setShowPasswords] = useState13(false);
|
|
5045
|
+
const [passwordMismatch, setPasswordMismatch] = useState13(false);
|
|
4376
5046
|
const isLogin = mode === "login";
|
|
4377
5047
|
const handleSubmit = (e) => {
|
|
4378
5048
|
e.preventDefault();
|
|
@@ -4384,7 +5054,7 @@ function AuthForm({
|
|
|
4384
5054
|
setPasswordMismatch(false);
|
|
4385
5055
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
4386
5056
|
};
|
|
4387
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
5057
|
+
const EyeOpen = () => /* @__PURE__ */ React24.createElement(
|
|
4388
5058
|
"svg",
|
|
4389
5059
|
{
|
|
4390
5060
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4394,7 +5064,7 @@ function AuthForm({
|
|
|
4394
5064
|
stroke: "currentColor",
|
|
4395
5065
|
style: { width: "20px", height: "20px" }
|
|
4396
5066
|
},
|
|
4397
|
-
/* @__PURE__ */
|
|
5067
|
+
/* @__PURE__ */ React24.createElement(
|
|
4398
5068
|
"path",
|
|
4399
5069
|
{
|
|
4400
5070
|
strokeLinecap: "round",
|
|
@@ -4402,7 +5072,7 @@ function AuthForm({
|
|
|
4402
5072
|
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"
|
|
4403
5073
|
}
|
|
4404
5074
|
),
|
|
4405
|
-
/* @__PURE__ */
|
|
5075
|
+
/* @__PURE__ */ React24.createElement(
|
|
4406
5076
|
"path",
|
|
4407
5077
|
{
|
|
4408
5078
|
strokeLinecap: "round",
|
|
@@ -4411,7 +5081,7 @@ function AuthForm({
|
|
|
4411
5081
|
}
|
|
4412
5082
|
)
|
|
4413
5083
|
);
|
|
4414
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
5084
|
+
const EyeClosed = () => /* @__PURE__ */ React24.createElement(
|
|
4415
5085
|
"svg",
|
|
4416
5086
|
{
|
|
4417
5087
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4421,7 +5091,7 @@ function AuthForm({
|
|
|
4421
5091
|
stroke: "currentColor",
|
|
4422
5092
|
style: { width: "20px", height: "20px" }
|
|
4423
5093
|
},
|
|
4424
|
-
/* @__PURE__ */
|
|
5094
|
+
/* @__PURE__ */ React24.createElement(
|
|
4425
5095
|
"path",
|
|
4426
5096
|
{
|
|
4427
5097
|
strokeLinecap: "round",
|
|
@@ -4430,17 +5100,17 @@ function AuthForm({
|
|
|
4430
5100
|
}
|
|
4431
5101
|
)
|
|
4432
5102
|
);
|
|
4433
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
5103
|
+
const PasswordToggle = () => /* @__PURE__ */ React24.createElement(
|
|
4434
5104
|
"button",
|
|
4435
5105
|
{
|
|
4436
5106
|
type: "button",
|
|
4437
5107
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
4438
5108
|
style: styles.passwordToggle
|
|
4439
5109
|
},
|
|
4440
|
-
showPasswords ? /* @__PURE__ */
|
|
5110
|
+
showPasswords ? /* @__PURE__ */ React24.createElement(EyeOpen, null) : /* @__PURE__ */ React24.createElement(EyeClosed, null)
|
|
4441
5111
|
);
|
|
4442
5112
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
4443
|
-
return /* @__PURE__ */
|
|
5113
|
+
return /* @__PURE__ */ React24.createElement("div", { style: styles.wrapper }, /* @__PURE__ */ React24.createElement("div", { style: styles.container }, /* @__PURE__ */ React24.createElement("div", { style: styles.header }, logoSrc && /* @__PURE__ */ React24.createElement("img", { src: logoSrc, alt: appName, style: styles.logo }), appName && /* @__PURE__ */ React24.createElement("h1", { style: styles.appName }, appName), appSubtitle && /* @__PURE__ */ React24.createElement("p", { style: styles.appSubtitle }, appSubtitle)), /* @__PURE__ */ React24.createElement("form", { onSubmit: handleSubmit, style: styles.card }, /* @__PURE__ */ React24.createElement("h2", { style: styles.cardTitle }, isLogin ? "Welcome Back" : "Create Account"), /* @__PURE__ */ React24.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React24.createElement("label", { style: styles.label }, "Username"), /* @__PURE__ */ React24.createElement(
|
|
4444
5114
|
"input",
|
|
4445
5115
|
{
|
|
4446
5116
|
type: "text",
|
|
@@ -4457,7 +5127,7 @@ function AuthForm({
|
|
|
4457
5127
|
},
|
|
4458
5128
|
required: true
|
|
4459
5129
|
}
|
|
4460
|
-
)), /* @__PURE__ */
|
|
5130
|
+
)), /* @__PURE__ */ React24.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React24.createElement("label", { style: styles.label }, "Password"), /* @__PURE__ */ React24.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ React24.createElement(
|
|
4461
5131
|
"input",
|
|
4462
5132
|
{
|
|
4463
5133
|
type: showPasswords ? "text" : "password",
|
|
@@ -4473,7 +5143,7 @@ function AuthForm({
|
|
|
4473
5143
|
},
|
|
4474
5144
|
required: true
|
|
4475
5145
|
}
|
|
4476
|
-
), /* @__PURE__ */
|
|
5146
|
+
), /* @__PURE__ */ React24.createElement(PasswordToggle, null))), !isLogin && /* @__PURE__ */ React24.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React24.createElement("label", { style: styles.label }, "Confirm Password"), /* @__PURE__ */ React24.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ React24.createElement(
|
|
4477
5147
|
"input",
|
|
4478
5148
|
{
|
|
4479
5149
|
type: showPasswords ? "text" : "password",
|
|
@@ -4489,7 +5159,7 @@ function AuthForm({
|
|
|
4489
5159
|
},
|
|
4490
5160
|
required: true
|
|
4491
5161
|
}
|
|
4492
|
-
), /* @__PURE__ */
|
|
5162
|
+
), /* @__PURE__ */ React24.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ React24.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ React24.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ React24.createElement(
|
|
4493
5163
|
"button",
|
|
4494
5164
|
{
|
|
4495
5165
|
type: "submit",
|
|
@@ -4507,7 +5177,7 @@ function AuthForm({
|
|
|
4507
5177
|
}
|
|
4508
5178
|
},
|
|
4509
5179
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
4510
|
-
), onModeSwitch && /* @__PURE__ */
|
|
5180
|
+
), onModeSwitch && /* @__PURE__ */ React24.createElement("div", { style: styles.modeSwitch }, /* @__PURE__ */ React24.createElement("p", { style: styles.modeSwitchText }, isLogin ? "Don't have an account?" : "Already have an account?"), /* @__PURE__ */ React24.createElement(
|
|
4511
5181
|
"button",
|
|
4512
5182
|
{
|
|
4513
5183
|
type: "button",
|
|
@@ -4680,9 +5350,9 @@ var styles = {
|
|
|
4680
5350
|
};
|
|
4681
5351
|
|
|
4682
5352
|
// src/TopicTierBadge.jsx
|
|
4683
|
-
import
|
|
5353
|
+
import React25 from "react";
|
|
4684
5354
|
function LandmarkIcon({ size = 14 }) {
|
|
4685
|
-
return /* @__PURE__ */
|
|
5355
|
+
return /* @__PURE__ */ React25.createElement(
|
|
4686
5356
|
"svg",
|
|
4687
5357
|
{
|
|
4688
5358
|
width: size,
|
|
@@ -4696,16 +5366,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
4696
5366
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4697
5367
|
"aria-hidden": "true"
|
|
4698
5368
|
},
|
|
4699
|
-
/* @__PURE__ */
|
|
4700
|
-
/* @__PURE__ */
|
|
4701
|
-
/* @__PURE__ */
|
|
4702
|
-
/* @__PURE__ */
|
|
4703
|
-
/* @__PURE__ */
|
|
4704
|
-
/* @__PURE__ */
|
|
5369
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M10 18v-7" }),
|
|
5370
|
+
/* @__PURE__ */ React25.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" }),
|
|
5371
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M14 18v-7" }),
|
|
5372
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M18 18v-7" }),
|
|
5373
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M3 22h18" }),
|
|
5374
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M6 18v-7" })
|
|
4705
5375
|
);
|
|
4706
5376
|
}
|
|
4707
5377
|
function Building2Icon({ size = 14 }) {
|
|
4708
|
-
return /* @__PURE__ */
|
|
5378
|
+
return /* @__PURE__ */ React25.createElement(
|
|
4709
5379
|
"svg",
|
|
4710
5380
|
{
|
|
4711
5381
|
width: size,
|
|
@@ -4719,17 +5389,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
4719
5389
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4720
5390
|
"aria-hidden": "true"
|
|
4721
5391
|
},
|
|
4722
|
-
/* @__PURE__ */
|
|
4723
|
-
/* @__PURE__ */
|
|
4724
|
-
/* @__PURE__ */
|
|
4725
|
-
/* @__PURE__ */
|
|
4726
|
-
/* @__PURE__ */
|
|
4727
|
-
/* @__PURE__ */
|
|
4728
|
-
/* @__PURE__ */
|
|
5392
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
5393
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
5394
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
5395
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M10 6h4" }),
|
|
5396
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M10 10h4" }),
|
|
5397
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M10 14h4" }),
|
|
5398
|
+
/* @__PURE__ */ React25.createElement("path", { d: "M10 18h4" })
|
|
4729
5399
|
);
|
|
4730
5400
|
}
|
|
4731
5401
|
function HomeIcon({ size = 14 }) {
|
|
4732
|
-
return /* @__PURE__ */
|
|
5402
|
+
return /* @__PURE__ */ React25.createElement(
|
|
4733
5403
|
"svg",
|
|
4734
5404
|
{
|
|
4735
5405
|
width: size,
|
|
@@ -4743,8 +5413,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
4743
5413
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4744
5414
|
"aria-hidden": "true"
|
|
4745
5415
|
},
|
|
4746
|
-
/* @__PURE__ */
|
|
4747
|
-
/* @__PURE__ */
|
|
5416
|
+
/* @__PURE__ */ React25.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
5417
|
+
/* @__PURE__ */ React25.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
4748
5418
|
);
|
|
4749
5419
|
}
|
|
4750
5420
|
var TIER_INFO = {
|
|
@@ -4804,7 +5474,7 @@ function TopicTierBadge({
|
|
|
4804
5474
|
userSelect: "none"
|
|
4805
5475
|
};
|
|
4806
5476
|
};
|
|
4807
|
-
return /* @__PURE__ */
|
|
5477
|
+
return /* @__PURE__ */ React25.createElement(
|
|
4808
5478
|
"span",
|
|
4809
5479
|
{
|
|
4810
5480
|
className: "ev-topic-tier-badge",
|
|
@@ -4814,13 +5484,13 @@ function TopicTierBadge({
|
|
|
4814
5484
|
},
|
|
4815
5485
|
effectiveTiers.map((tier) => {
|
|
4816
5486
|
const { label, Icon } = TIER_INFO[tier];
|
|
4817
|
-
return /* @__PURE__ */
|
|
5487
|
+
return /* @__PURE__ */ React25.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ React25.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ React25.createElement("span", null, label));
|
|
4818
5488
|
})
|
|
4819
5489
|
);
|
|
4820
5490
|
}
|
|
4821
5491
|
|
|
4822
5492
|
// src/CompassCoverageCallout.jsx
|
|
4823
|
-
import
|
|
5493
|
+
import React26, { useState as useState14 } from "react";
|
|
4824
5494
|
var TIER_LABELS = {
|
|
4825
5495
|
federal: "federal",
|
|
4826
5496
|
state: "state",
|
|
@@ -4833,7 +5503,7 @@ function CompassCoverageCallout({
|
|
|
4833
5503
|
compassUrl,
|
|
4834
5504
|
onDismiss
|
|
4835
5505
|
}) {
|
|
4836
|
-
const [dismissed, setDismissed] =
|
|
5506
|
+
const [dismissed, setDismissed] = useState14(false);
|
|
4837
5507
|
if (dismissed) return null;
|
|
4838
5508
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
4839
5509
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -4884,15 +5554,15 @@ function CompassCoverageCallout({
|
|
|
4884
5554
|
setDismissed(true);
|
|
4885
5555
|
if (onDismiss) onDismiss();
|
|
4886
5556
|
};
|
|
4887
|
-
return /* @__PURE__ */
|
|
5557
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4888
5558
|
"div",
|
|
4889
5559
|
{
|
|
4890
5560
|
className: "ev-compass-coverage-callout",
|
|
4891
5561
|
role: "status",
|
|
4892
5562
|
style: containerStyle2
|
|
4893
5563
|
},
|
|
4894
|
-
/* @__PURE__ */
|
|
4895
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
5564
|
+
/* @__PURE__ */ React26.createElement("div", { style: textStyle }, /* @__PURE__ */ React26.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ React26.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__ */ React26.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
5565
|
+
onDismiss !== void 0 && /* @__PURE__ */ React26.createElement(
|
|
4896
5566
|
"button",
|
|
4897
5567
|
{
|
|
4898
5568
|
onClick: handleDismiss,
|
|
@@ -4905,7 +5575,7 @@ function CompassCoverageCallout({
|
|
|
4905
5575
|
}
|
|
4906
5576
|
|
|
4907
5577
|
// src/ExpandCompassNudge.jsx
|
|
4908
|
-
import
|
|
5578
|
+
import React27 from "react";
|
|
4909
5579
|
function ExpandCompassNudge({
|
|
4910
5580
|
politicianName,
|
|
4911
5581
|
missingCount,
|
|
@@ -4952,7 +5622,7 @@ function ExpandCompassNudge({
|
|
|
4952
5622
|
};
|
|
4953
5623
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
4954
5624
|
const speakerName = politicianName || "This politician";
|
|
4955
|
-
return /* @__PURE__ */
|
|
5625
|
+
return /* @__PURE__ */ React27.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ React27.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ React27.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__ */ React27.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
4956
5626
|
}
|
|
4957
5627
|
|
|
4958
5628
|
// src/computeTierCoverage.js
|
|
@@ -4973,14 +5643,14 @@ function computeTierCoverage(topics) {
|
|
|
4973
5643
|
}
|
|
4974
5644
|
|
|
4975
5645
|
// src/StanceAccordion.jsx
|
|
4976
|
-
import
|
|
5646
|
+
import React29, { useState as useState15, useRef as useRef3, useCallback, useEffect as useEffect9 } from "react";
|
|
4977
5647
|
|
|
4978
5648
|
// src/Favicon.jsx
|
|
4979
|
-
import
|
|
5649
|
+
import React28 from "react";
|
|
4980
5650
|
function Favicon({ url, size = 16 }) {
|
|
4981
5651
|
try {
|
|
4982
5652
|
const domain = new URL(url).hostname;
|
|
4983
|
-
return /* @__PURE__ */
|
|
5653
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4984
5654
|
"img",
|
|
4985
5655
|
{
|
|
4986
5656
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -4991,7 +5661,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
4991
5661
|
}
|
|
4992
5662
|
);
|
|
4993
5663
|
} catch {
|
|
4994
|
-
return /* @__PURE__ */
|
|
5664
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4995
5665
|
"svg",
|
|
4996
5666
|
{
|
|
4997
5667
|
width: size,
|
|
@@ -5002,8 +5672,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
5002
5672
|
strokeWidth: "1.5",
|
|
5003
5673
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
5004
5674
|
},
|
|
5005
|
-
/* @__PURE__ */
|
|
5006
|
-
/* @__PURE__ */
|
|
5675
|
+
/* @__PURE__ */ React28.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5676
|
+
/* @__PURE__ */ React28.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" })
|
|
5007
5677
|
);
|
|
5008
5678
|
}
|
|
5009
5679
|
}
|
|
@@ -5034,9 +5704,9 @@ function StanceAccordion({
|
|
|
5034
5704
|
apiUrl = "https://api.empowered.vote"
|
|
5035
5705
|
}) {
|
|
5036
5706
|
var _a;
|
|
5037
|
-
const [expandedTopicId, setExpandedTopicId] =
|
|
5038
|
-
const [loadingId, setLoadingId] =
|
|
5039
|
-
const [showAll, setShowAll] =
|
|
5707
|
+
const [expandedTopicId, setExpandedTopicId] = useState15(null);
|
|
5708
|
+
const [loadingId, setLoadingId] = useState15(null);
|
|
5709
|
+
const [showAll, setShowAll] = useState15(false);
|
|
5040
5710
|
const contextCache = useRef3(/* @__PURE__ */ new Map());
|
|
5041
5711
|
const quotesCache = useRef3(null);
|
|
5042
5712
|
const polAnswerMap = {};
|
|
@@ -5114,7 +5784,7 @@ function StanceAccordion({
|
|
|
5114
5784
|
},
|
|
5115
5785
|
[expandedTopicId, politicianId, apiUrl]
|
|
5116
5786
|
);
|
|
5117
|
-
|
|
5787
|
+
useEffect9(() => {
|
|
5118
5788
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
5119
5789
|
handleToggle(String(initialExpandedTopicId));
|
|
5120
5790
|
}
|
|
@@ -5130,13 +5800,13 @@ function StanceAccordion({
|
|
|
5130
5800
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
5131
5801
|
}
|
|
5132
5802
|
}
|
|
5133
|
-
return /* @__PURE__ */
|
|
5803
|
+
return /* @__PURE__ */ React29.createElement(
|
|
5134
5804
|
"div",
|
|
5135
5805
|
{
|
|
5136
5806
|
className: "flex flex-col",
|
|
5137
5807
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
5138
5808
|
},
|
|
5139
|
-
/* @__PURE__ */
|
|
5809
|
+
/* @__PURE__ */ React29.createElement(
|
|
5140
5810
|
"h3",
|
|
5141
5811
|
{
|
|
5142
5812
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -5158,15 +5828,15 @@ function StanceAccordion({
|
|
|
5158
5828
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
5159
5829
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
5160
5830
|
}) : [];
|
|
5161
|
-
return /* @__PURE__ */
|
|
5831
|
+
return /* @__PURE__ */ React29.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ React29.createElement(
|
|
5162
5832
|
"button",
|
|
5163
5833
|
{
|
|
5164
5834
|
type: "button",
|
|
5165
5835
|
onClick: () => handleToggle(topicId),
|
|
5166
5836
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
5167
5837
|
},
|
|
5168
|
-
/* @__PURE__ */
|
|
5169
|
-
/* @__PURE__ */
|
|
5838
|
+
/* @__PURE__ */ React29.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React29.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ React29.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ React29.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
5839
|
+
/* @__PURE__ */ React29.createElement(
|
|
5170
5840
|
"svg",
|
|
5171
5841
|
{
|
|
5172
5842
|
width: "16",
|
|
@@ -5183,9 +5853,9 @@ function StanceAccordion({
|
|
|
5183
5853
|
transition: "transform 0.2s ease"
|
|
5184
5854
|
}
|
|
5185
5855
|
},
|
|
5186
|
-
/* @__PURE__ */
|
|
5856
|
+
/* @__PURE__ */ React29.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
5187
5857
|
)
|
|
5188
|
-
), /* @__PURE__ */
|
|
5858
|
+
), /* @__PURE__ */ React29.createElement(
|
|
5189
5859
|
"div",
|
|
5190
5860
|
{
|
|
5191
5861
|
style: {
|
|
@@ -5194,7 +5864,7 @@ function StanceAccordion({
|
|
|
5194
5864
|
transition: "grid-template-rows 0.25s ease"
|
|
5195
5865
|
}
|
|
5196
5866
|
},
|
|
5197
|
-
/* @__PURE__ */
|
|
5867
|
+
/* @__PURE__ */ React29.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ React29.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ React29.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ React29.createElement(
|
|
5198
5868
|
"div",
|
|
5199
5869
|
{
|
|
5200
5870
|
style: {
|
|
@@ -5206,14 +5876,14 @@ function StanceAccordion({
|
|
|
5206
5876
|
animation: "ev-spin 0.8s linear infinite"
|
|
5207
5877
|
}
|
|
5208
5878
|
}
|
|
5209
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
5879
|
+
)), !isLoading && cached && /* @__PURE__ */ React29.createElement(React29.Fragment, null, cached.reasoning ? /* @__PURE__ */ React29.createElement(
|
|
5210
5880
|
"p",
|
|
5211
5881
|
{
|
|
5212
5882
|
className: "text-sm text-neutral-700 mb-3",
|
|
5213
5883
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
5214
5884
|
},
|
|
5215
5885
|
cached.reasoning
|
|
5216
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
5886
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ React29.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React29.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ React29.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ React29.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ React29.createElement(
|
|
5217
5887
|
"a",
|
|
5218
5888
|
{
|
|
5219
5889
|
href: src,
|
|
@@ -5221,9 +5891,9 @@ function StanceAccordion({
|
|
|
5221
5891
|
rel: "noreferrer",
|
|
5222
5892
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
5223
5893
|
},
|
|
5224
|
-
/* @__PURE__ */
|
|
5225
|
-
/* @__PURE__ */
|
|
5226
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
5894
|
+
/* @__PURE__ */ React29.createElement(Favicon, { url: src }),
|
|
5895
|
+
/* @__PURE__ */ React29.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
5896
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ React29.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ React29.createElement(
|
|
5227
5897
|
"p",
|
|
5228
5898
|
{
|
|
5229
5899
|
style: {
|
|
@@ -5240,7 +5910,7 @@ function StanceAccordion({
|
|
|
5240
5910
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
5241
5911
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
5242
5912
|
const sourceName = quote.source_name || quote.sourceName;
|
|
5243
|
-
return /* @__PURE__ */
|
|
5913
|
+
return /* @__PURE__ */ React29.createElement(
|
|
5244
5914
|
"div",
|
|
5245
5915
|
{
|
|
5246
5916
|
key: quote.id,
|
|
@@ -5252,7 +5922,7 @@ function StanceAccordion({
|
|
|
5252
5922
|
marginBottom: "8px"
|
|
5253
5923
|
}
|
|
5254
5924
|
},
|
|
5255
|
-
/* @__PURE__ */
|
|
5925
|
+
/* @__PURE__ */ React29.createElement(
|
|
5256
5926
|
"p",
|
|
5257
5927
|
{
|
|
5258
5928
|
style: {
|
|
@@ -5265,7 +5935,7 @@ function StanceAccordion({
|
|
|
5265
5935
|
},
|
|
5266
5936
|
quote.text
|
|
5267
5937
|
),
|
|
5268
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
5938
|
+
verdict === "agreed" && /* @__PURE__ */ React29.createElement(
|
|
5269
5939
|
"span",
|
|
5270
5940
|
{
|
|
5271
5941
|
style: {
|
|
@@ -5282,10 +5952,10 @@ function StanceAccordion({
|
|
|
5282
5952
|
flexShrink: 0
|
|
5283
5953
|
}
|
|
5284
5954
|
},
|
|
5285
|
-
/* @__PURE__ */
|
|
5955
|
+
/* @__PURE__ */ React29.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React29.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
5286
5956
|
"Agreed"
|
|
5287
5957
|
),
|
|
5288
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
5958
|
+
verdict === "disagreed" && /* @__PURE__ */ React29.createElement(
|
|
5289
5959
|
"span",
|
|
5290
5960
|
{
|
|
5291
5961
|
style: {
|
|
@@ -5302,10 +5972,10 @@ function StanceAccordion({
|
|
|
5302
5972
|
flexShrink: 0
|
|
5303
5973
|
}
|
|
5304
5974
|
},
|
|
5305
|
-
/* @__PURE__ */
|
|
5975
|
+
/* @__PURE__ */ React29.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React29.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
5306
5976
|
"Disagreed"
|
|
5307
5977
|
),
|
|
5308
|
-
sourceName && /* @__PURE__ */
|
|
5978
|
+
sourceName && /* @__PURE__ */ React29.createElement(
|
|
5309
5979
|
"a",
|
|
5310
5980
|
{
|
|
5311
5981
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -5322,10 +5992,10 @@ function StanceAccordion({
|
|
|
5322
5992
|
sourceName
|
|
5323
5993
|
)
|
|
5324
5994
|
);
|
|
5325
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
5995
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ React29.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
|
|
5326
5996
|
));
|
|
5327
5997
|
}),
|
|
5328
|
-
hasToggle && /* @__PURE__ */
|
|
5998
|
+
hasToggle && /* @__PURE__ */ React29.createElement(
|
|
5329
5999
|
"button",
|
|
5330
6000
|
{
|
|
5331
6001
|
type: "button",
|
|
@@ -5344,8 +6014,10 @@ export {
|
|
|
5344
6014
|
CategorySection,
|
|
5345
6015
|
CommitteeTable,
|
|
5346
6016
|
CompassCardHorizontal,
|
|
6017
|
+
CompassCardVertical,
|
|
5347
6018
|
CompassCoverageCallout,
|
|
5348
6019
|
CompassIcon,
|
|
6020
|
+
CompassKey,
|
|
5349
6021
|
ExpandCompassNudge,
|
|
5350
6022
|
FilterSidebar,
|
|
5351
6023
|
GovernmentBodySection,
|
|
@@ -5375,6 +6047,7 @@ export {
|
|
|
5375
6047
|
defaultNavItems,
|
|
5376
6048
|
duration,
|
|
5377
6049
|
easing,
|
|
6050
|
+
evContext,
|
|
5378
6051
|
focus,
|
|
5379
6052
|
fontSizes,
|
|
5380
6053
|
fontWeights,
|