@empoweredvote/ev-ui 0.8.14 → 0.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +671 -606
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +293 -228
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -90,36 +90,8 @@ __export(index_exports, {
|
|
|
90
90
|
module.exports = __toCommonJS(index_exports);
|
|
91
91
|
|
|
92
92
|
// src/RadarChartCore.jsx
|
|
93
|
-
var
|
|
93
|
+
var import_react = __toESM(require("react"));
|
|
94
94
|
var import_web = require("@react-spring/web");
|
|
95
|
-
var import_react3 = require("react");
|
|
96
|
-
|
|
97
|
-
// src/useTheme.js
|
|
98
|
-
var import_react = require("react");
|
|
99
|
-
function useTheme() {
|
|
100
|
-
const read = () => {
|
|
101
|
-
if (typeof document === "undefined") return false;
|
|
102
|
-
const root = document.documentElement;
|
|
103
|
-
const body = document.body;
|
|
104
|
-
const hasDarkClass = (el) => el && el.classList && el.classList.contains("dark");
|
|
105
|
-
const hasDarkAttr = (el) => el && el.getAttribute && el.getAttribute("data-theme") === "dark";
|
|
106
|
-
return hasDarkClass(root) || hasDarkAttr(root) || hasDarkClass(body) || hasDarkAttr(body);
|
|
107
|
-
};
|
|
108
|
-
const [isDark, setIsDark] = (0, import_react.useState)(read);
|
|
109
|
-
(0, import_react.useEffect)(() => {
|
|
110
|
-
if (typeof document === "undefined" || typeof MutationObserver === "undefined") return;
|
|
111
|
-
const update = () => setIsDark(read());
|
|
112
|
-
update();
|
|
113
|
-
const observer = new MutationObserver(update);
|
|
114
|
-
const opts = { attributes: true, attributeFilter: ["class", "data-theme"] };
|
|
115
|
-
observer.observe(document.documentElement, opts);
|
|
116
|
-
if (document.body) observer.observe(document.body, opts);
|
|
117
|
-
return () => observer.disconnect();
|
|
118
|
-
}, []);
|
|
119
|
-
return { isDark };
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// src/RadarChartCore.jsx
|
|
123
95
|
function RadarChartCore({
|
|
124
96
|
topics,
|
|
125
97
|
data,
|
|
@@ -131,83 +103,95 @@ function RadarChartCore({
|
|
|
131
103
|
onReplaceTopic = () => {
|
|
132
104
|
},
|
|
133
105
|
size = 400,
|
|
134
|
-
labelFontSize =
|
|
106
|
+
labelFontSize = 13,
|
|
135
107
|
padding = 80,
|
|
136
|
-
labelOffset =
|
|
137
|
-
tightFit = false
|
|
108
|
+
labelOffset = 52,
|
|
109
|
+
tightFit = false,
|
|
110
|
+
activeSpoke = null,
|
|
111
|
+
writeIns = {},
|
|
112
|
+
darkMode = false,
|
|
113
|
+
lineColor,
|
|
114
|
+
ringColor,
|
|
115
|
+
// replacedSpokes: short_titles of substitute spokes (not the user's original defaults)
|
|
116
|
+
replacedSpokes = {},
|
|
117
|
+
// boldOriginalSpokes: when true, bold spokes that are NOT replacements
|
|
118
|
+
boldOriginalSpokes = false,
|
|
119
|
+
highlightedSpoke = null
|
|
138
120
|
}) {
|
|
139
|
-
|
|
121
|
+
var _a;
|
|
140
122
|
const radius = size / 2 - 40;
|
|
123
|
+
const extRadius = radius * 1.15;
|
|
141
124
|
const centerX = size / 2;
|
|
142
125
|
const centerY = size / 2;
|
|
126
|
+
const [tooltip, setTooltip] = (0, import_react.useState)(null);
|
|
143
127
|
const spokes = Object.entries(data);
|
|
144
128
|
const numSpokes = Math.max(spokes.length, 1);
|
|
145
|
-
const prevCountRef = (0,
|
|
129
|
+
const prevCountRef = (0, import_react.useRef)(numSpokes);
|
|
146
130
|
const countChanged = numSpokes !== prevCountRef.current;
|
|
147
|
-
(0,
|
|
131
|
+
(0, import_react.useEffect)(() => {
|
|
148
132
|
prevCountRef.current = numSpokes;
|
|
149
133
|
}, [numSpokes]);
|
|
150
|
-
|
|
151
|
-
var
|
|
134
|
+
function calcAdjusted(value, shortTitle) {
|
|
135
|
+
var _a2;
|
|
136
|
+
if (!value || Number(value) === 0) return 0;
|
|
152
137
|
const topic = topics.find((t) => t.short_title === shortTitle);
|
|
153
|
-
const max = ((
|
|
154
|
-
const pct =
|
|
155
|
-
|
|
156
|
-
|
|
138
|
+
const max = ((_a2 = topic == null ? void 0 : topic.stances) == null ? void 0 : _a2.length) || 10;
|
|
139
|
+
const pct = Number(value) / max * 10;
|
|
140
|
+
return invertedSpokes[shortTitle] ? (max + 1) * 10 / max - pct : pct;
|
|
141
|
+
}
|
|
142
|
+
const pointsArr = spokes.map(([shortTitle, value], index) => {
|
|
143
|
+
const adjusted = calcAdjusted(value, shortTitle);
|
|
157
144
|
const r = adjusted / 10 * radius;
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
return [x, y];
|
|
145
|
+
const angle = 2 * Math.PI * index / numSpokes;
|
|
146
|
+
return [centerX + r * Math.sin(angle), centerY - r * Math.cos(angle)];
|
|
161
147
|
});
|
|
162
148
|
const targetPoints = pointsArr.map((p) => p.join(",")).join(" ");
|
|
163
|
-
const
|
|
149
|
+
const springBase = {
|
|
164
150
|
to: { points: targetPoints },
|
|
165
151
|
immediate: countChanged,
|
|
166
|
-
reset: countChanged,
|
|
167
152
|
config: { tension: 300, friction: 30 }
|
|
168
|
-
}
|
|
153
|
+
};
|
|
154
|
+
if (countChanged) springBase.from = { points: targetPoints };
|
|
155
|
+
const spring = (0, import_web.useSpring)(springBase);
|
|
169
156
|
const hasCompareData = Object.keys(compareData).length > 0;
|
|
170
157
|
const centerPoints = spokes.map(() => `${centerX},${centerY}`).join(" ");
|
|
171
158
|
let comparePoints = null;
|
|
172
159
|
let compareCoords = null;
|
|
173
160
|
if (hasCompareData) {
|
|
174
161
|
const ccoords = spokes.map(([shortTitle], index) => {
|
|
175
|
-
var
|
|
176
|
-
const value = (
|
|
177
|
-
const
|
|
178
|
-
const max = ((_b = topic == null ? void 0 : topic.stances) == null ? void 0 : _b.length) || 10;
|
|
179
|
-
const pct = Math.min(value / max * 10, 10);
|
|
180
|
-
const angle = 2 * Math.PI * index / numSpokes;
|
|
181
|
-
const adjusted = value === 0 ? 0 : invertedSpokes[shortTitle] ? 11 - pct : pct;
|
|
162
|
+
var _a2;
|
|
163
|
+
const value = (_a2 = compareData[shortTitle]) != null ? _a2 : 0;
|
|
164
|
+
const adjusted = calcAdjusted(value, shortTitle);
|
|
182
165
|
const r = adjusted / 10 * radius;
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
return [x, y];
|
|
166
|
+
const angle = 2 * Math.PI * index / numSpokes;
|
|
167
|
+
return [centerX + r * Math.sin(angle), centerY - r * Math.cos(angle)];
|
|
186
168
|
});
|
|
187
169
|
compareCoords = ccoords;
|
|
188
170
|
comparePoints = ccoords.map((p) => p.join(",")).join(" ");
|
|
189
171
|
}
|
|
190
|
-
const hadCompareDataRef = (0,
|
|
172
|
+
const hadCompareDataRef = (0, import_react.useRef)(false);
|
|
191
173
|
const compareJustAppeared = hasCompareData && !hadCompareDataRef.current;
|
|
192
|
-
(0,
|
|
174
|
+
(0, import_react.useEffect)(() => {
|
|
193
175
|
hadCompareDataRef.current = hasCompareData;
|
|
194
176
|
}, [hasCompareData]);
|
|
195
|
-
const
|
|
177
|
+
const compareSpringBase = {
|
|
196
178
|
to: { points: comparePoints || centerPoints || `${centerX},${centerY}` },
|
|
197
179
|
immediate: countChanged || compareJustAppeared,
|
|
198
|
-
reset: countChanged || compareJustAppeared,
|
|
199
180
|
config: { tension: 300, friction: 30 }
|
|
200
|
-
}
|
|
181
|
+
};
|
|
182
|
+
if (countChanged || compareJustAppeared) compareSpringBase.from = compareSpringBase.to;
|
|
183
|
+
const compareSpring = (0, import_web.useSpring)(compareSpringBase);
|
|
184
|
+
const spokeExtension = spokes.reduce((acc, [shortTitle]) => {
|
|
185
|
+
const userAdj = calcAdjusted(data[shortTitle], shortTitle);
|
|
186
|
+
const cmpAdj = hasCompareData && compareData[shortTitle] ? calcAdjusted(compareData[shortTitle], shortTitle) : 0;
|
|
187
|
+
acc[shortTitle] = userAdj > 10 || cmpAdj > 10;
|
|
188
|
+
return acc;
|
|
189
|
+
}, {});
|
|
201
190
|
const labelMeta = spokes.map(([shortTitle], i) => {
|
|
202
191
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
203
|
-
const baseFSize = labelFontSize;
|
|
204
192
|
const lines = wrapLabel(shortTitle, 12);
|
|
205
|
-
const longestLineLen = lines.reduce(
|
|
206
|
-
|
|
207
|
-
0
|
|
208
|
-
);
|
|
209
|
-
const fSize = adaptiveFontSize(longestLineLen, baseFSize);
|
|
210
|
-
const estimatedWidth = longestLineLen * fSize * 0.6;
|
|
193
|
+
const longestLineLen = lines.reduce((m, ln) => ln.length > m ? ln.length : m, 0);
|
|
194
|
+
const estimatedWidth = longestLineLen * labelFontSize * 0.55;
|
|
211
195
|
const sinA = Math.sin(angle);
|
|
212
196
|
const side = sinA < -0.1 ? "left" : sinA > 0.1 ? "right" : "center";
|
|
213
197
|
return { estimatedWidth, side };
|
|
@@ -216,23 +200,9 @@ function RadarChartCore({
|
|
|
216
200
|
const rightLabelWidths = labelMeta.filter((m) => m.side === "right").map((m) => m.estimatedWidth);
|
|
217
201
|
const minPadding = 40;
|
|
218
202
|
const maxPadding = padding * 2;
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
minPadding
|
|
223
|
-
),
|
|
224
|
-
maxPadding
|
|
225
|
-
);
|
|
226
|
-
const rawRightPadding = Math.min(
|
|
227
|
-
Math.max(
|
|
228
|
-
rightLabelWidths.length ? Math.max(...rightLabelWidths) + labelOffset : 0,
|
|
229
|
-
minPadding
|
|
230
|
-
),
|
|
231
|
-
maxPadding
|
|
232
|
-
);
|
|
233
|
-
const symmetricPadding = Math.max(rawLeftPadding, rawRightPadding);
|
|
234
|
-
const leftPadding = symmetricPadding;
|
|
235
|
-
const rightPadding = symmetricPadding;
|
|
203
|
+
const rawLeft = Math.min(Math.max(leftLabelWidths.length ? Math.max(...leftLabelWidths) + labelOffset : 0, minPadding), maxPadding);
|
|
204
|
+
const rawRight = Math.min(Math.max(rightLabelWidths.length ? Math.max(...rightLabelWidths) + labelOffset : 0, minPadding), maxPadding);
|
|
205
|
+
const sidePadding = Math.max(rawLeft, rawRight);
|
|
236
206
|
const verticalPadding = padding;
|
|
237
207
|
let tightTop = -verticalPadding;
|
|
238
208
|
let tightHeight = size + verticalPadding * 2;
|
|
@@ -240,11 +210,12 @@ function RadarChartCore({
|
|
|
240
210
|
let yMin = Infinity, yMax = -Infinity;
|
|
241
211
|
for (let i = 0; i < numSpokes; i++) {
|
|
242
212
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
243
|
-
const
|
|
213
|
+
const effectiveR = spokeExtension[(_a = spokes[i]) == null ? void 0 : _a[0]] ? extRadius : radius;
|
|
214
|
+
const y = centerY - effectiveR * Math.cos(angle);
|
|
244
215
|
if (y < yMin) yMin = y;
|
|
245
216
|
if (y > yMax) yMax = y;
|
|
246
217
|
}
|
|
247
|
-
const labelMargin = labelOffset + labelFontSize *
|
|
218
|
+
const labelMargin = labelOffset + labelFontSize * 2.5;
|
|
248
219
|
tightTop = yMin - labelMargin;
|
|
249
220
|
tightHeight = yMax + labelMargin - tightTop;
|
|
250
221
|
}
|
|
@@ -254,101 +225,111 @@ function RadarChartCore({
|
|
|
254
225
|
const ring = [];
|
|
255
226
|
for (let i = 0; i < numSpokes; i++) {
|
|
256
227
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
257
|
-
|
|
258
|
-
const y = centerY - radius * scale * Math.cos(angle);
|
|
259
|
-
ring.push(`${x},${y}`);
|
|
228
|
+
ring.push(`${centerX + radius * scale * Math.sin(angle)},${centerY - radius * scale * Math.cos(angle)}`);
|
|
260
229
|
}
|
|
261
230
|
guidePolygons.push(
|
|
262
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ import_react.default.createElement("polygon", { key: level, points: ring.join(" "), fill: "none", stroke: ringColor != null ? ringColor : darkMode ? "#555" : "#ccc" })
|
|
263
232
|
);
|
|
264
233
|
}
|
|
265
|
-
|
|
234
|
+
const getStanceText = (shortTitle, value) => {
|
|
235
|
+
if (writeIns[shortTitle]) return writeIns[shortTitle];
|
|
236
|
+
const topic = topics.find((t) => t.short_title === shortTitle);
|
|
237
|
+
const stances = (topic == null ? void 0 : topic.stances) || [];
|
|
238
|
+
const idx = Math.round(Number(value)) - 1;
|
|
239
|
+
if (idx >= 0 && idx < stances.length) {
|
|
240
|
+
return stances[idx].text || shortTitle;
|
|
241
|
+
}
|
|
242
|
+
return shortTitle;
|
|
243
|
+
};
|
|
244
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
266
245
|
"svg",
|
|
267
246
|
{
|
|
268
247
|
className: "w-full h-auto max-h-full",
|
|
269
|
-
viewBox: `-${
|
|
270
|
-
preserveAspectRatio: "xMidYMid meet"
|
|
248
|
+
viewBox: `-${sidePadding} ${tightTop} ${size + sidePadding * 2} ${tightHeight}`,
|
|
249
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
250
|
+
onMouseLeave: () => setTooltip(null)
|
|
271
251
|
},
|
|
272
252
|
guidePolygons,
|
|
273
253
|
spokes.map(([shortTitle], i) => {
|
|
274
254
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
275
|
-
const
|
|
276
|
-
const
|
|
255
|
+
const endX = centerX + radius * Math.sin(angle);
|
|
256
|
+
const endY = centerY - radius * Math.cos(angle);
|
|
277
257
|
const isUnanswered = !!unansweredSpokes[shortTitle];
|
|
278
|
-
|
|
258
|
+
const needsExt = spokeExtension[shortTitle];
|
|
259
|
+
const extX = centerX + extRadius * Math.sin(angle);
|
|
260
|
+
const extY = centerY - extRadius * Math.cos(angle);
|
|
261
|
+
return /* @__PURE__ */ import_react.default.createElement("g", { key: `spoke-${shortTitle}` }, /* @__PURE__ */ import_react.default.createElement(
|
|
279
262
|
"line",
|
|
280
263
|
{
|
|
281
|
-
key: `line-${shortTitle}`,
|
|
282
264
|
x1: centerX,
|
|
283
265
|
y1: centerY,
|
|
284
|
-
x2:
|
|
285
|
-
y2:
|
|
286
|
-
stroke: isUnanswered ?
|
|
266
|
+
x2: endX,
|
|
267
|
+
y2: endY,
|
|
268
|
+
stroke: isUnanswered ? "#9ca3af" : lineColor != null ? lineColor : darkMode ? "#bbb" : "#888",
|
|
287
269
|
strokeDasharray: isUnanswered ? "4 3" : void 0,
|
|
288
270
|
opacity: isUnanswered ? 0.6 : 1
|
|
289
271
|
}
|
|
290
|
-
)
|
|
272
|
+
), needsExt && /* @__PURE__ */ import_react.default.createElement(
|
|
273
|
+
"line",
|
|
274
|
+
{
|
|
275
|
+
x1: endX,
|
|
276
|
+
y1: endY,
|
|
277
|
+
x2: extX,
|
|
278
|
+
y2: extY,
|
|
279
|
+
stroke: "#aaa",
|
|
280
|
+
strokeDasharray: "4 4",
|
|
281
|
+
opacity: 0.4
|
|
282
|
+
}
|
|
283
|
+
));
|
|
291
284
|
}),
|
|
292
285
|
spokes.map(([shortTitle], i) => {
|
|
293
286
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
294
|
-
const anchor = angle > Math.PI ? "end" : angle < Math.PI && angle > 0 ? "start" : "middle";
|
|
295
287
|
const cosA = Math.cos(angle);
|
|
296
|
-
const isTop = cosA > 0.5;
|
|
297
288
|
const isBottom = cosA < -0.5;
|
|
298
|
-
const
|
|
289
|
+
const isTop = cosA > 0.5;
|
|
299
290
|
const lines = wrapLabel(shortTitle, 12);
|
|
300
|
-
const longestLine = lines.reduce(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
const fSize = adaptiveFontSize(longestLine, baseFSize);
|
|
305
|
-
const lineHeight = fSize * 1.1;
|
|
306
|
-
const dynamicLabelOffset = lines.length > 1 ? labelOffset + 8 : labelOffset;
|
|
307
|
-
const offset2 = radius + dynamicLabelOffset;
|
|
291
|
+
const longestLine = lines.reduce((m, ln) => ln.length > m ? ln.length : m, 0);
|
|
292
|
+
const lineHeight = labelFontSize * 1.2;
|
|
293
|
+
const dynamicOffset = lines.length > 1 ? labelOffset + 6 : labelOffset;
|
|
294
|
+
const offset2 = radius + dynamicOffset;
|
|
308
295
|
const labelX = centerX + offset2 * Math.sin(angle);
|
|
309
296
|
let labelY = centerY - offset2 * Math.cos(angle);
|
|
310
|
-
if (isTop && lines.length > 1)
|
|
311
|
-
|
|
312
|
-
}
|
|
297
|
+
if (isTop && lines.length > 1) labelY -= (lines.length - 1) * lineHeight;
|
|
298
|
+
const isActive = shortTitle === activeSpoke;
|
|
313
299
|
const isUnansweredLabel = !!unansweredSpokes[shortTitle];
|
|
314
|
-
|
|
300
|
+
const isReplaced = !!replacedSpokes[shortTitle];
|
|
301
|
+
const shouldBold = boldOriginalSpokes && !isReplaced;
|
|
302
|
+
const fSize = labelFontSize;
|
|
303
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
315
304
|
"text",
|
|
316
305
|
{
|
|
317
306
|
key: `label-${shortTitle}`,
|
|
318
307
|
x: labelX,
|
|
319
308
|
y: labelY,
|
|
320
|
-
textAnchor:
|
|
309
|
+
textAnchor: "middle",
|
|
321
310
|
dominantBaseline: isBottom ? "hanging" : "auto",
|
|
322
311
|
onClick: () => onReplaceTopic(shortTitle),
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
style: { cursor: "pointer", userSelect: "none", fontSize: fSize }
|
|
312
|
+
fill: isActive ? "#E85D26" : shortTitle === highlightedSpoke ? darkMode ? "#7DD4E8" : "#59B0C4" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
|
|
313
|
+
fontWeight: isActive || shouldBold ? "bold" : "normal",
|
|
314
|
+
style: { cursor: "pointer", userSelect: "none", fontSize: fSize, fontFamily: "sans-serif" }
|
|
326
315
|
},
|
|
327
|
-
isUnansweredLabel && /* @__PURE__ */
|
|
328
|
-
lines.map((ln, idx) => /* @__PURE__ */
|
|
316
|
+
isUnansweredLabel && /* @__PURE__ */ import_react.default.createElement("title", null, "No stance on file for this topic."),
|
|
317
|
+
lines.map((ln, idx) => /* @__PURE__ */ import_react.default.createElement("tspan", { key: idx, x: labelX, dy: idx === 0 ? "0" : `${lineHeight}` }, ln))
|
|
329
318
|
);
|
|
330
319
|
}),
|
|
331
|
-
countChanged ? /* @__PURE__ */
|
|
320
|
+
countChanged ? /* @__PURE__ */ import_react.default.createElement(
|
|
332
321
|
"polygon",
|
|
333
322
|
{
|
|
334
323
|
key: "user-static",
|
|
335
324
|
points: targetPoints,
|
|
336
|
-
style: {
|
|
337
|
-
fill: "rgba(124, 107, 158, 0.4)",
|
|
338
|
-
stroke: "#7C6B9E",
|
|
339
|
-
strokeWidth: 3
|
|
340
|
-
}
|
|
325
|
+
style: { fill: "rgba(124, 107, 158, 0.4)", stroke: "#7C6B9E", strokeWidth: 3 }
|
|
341
326
|
}
|
|
342
|
-
) : /* @__PURE__ */
|
|
327
|
+
) : /* @__PURE__ */ import_react.default.createElement(
|
|
343
328
|
import_web.animated.polygon,
|
|
344
329
|
{
|
|
345
330
|
key: "user-animated",
|
|
346
331
|
points: spring.points,
|
|
347
|
-
style: {
|
|
348
|
-
fill: "rgba(124, 107, 158, 0.4)",
|
|
349
|
-
stroke: "#7C6B9E",
|
|
350
|
-
strokeWidth: 3
|
|
351
|
-
}
|
|
332
|
+
style: { fill: "rgba(124, 107, 158, 0.4)", stroke: "#7C6B9E", strokeWidth: 3 }
|
|
352
333
|
}
|
|
353
334
|
),
|
|
354
335
|
pointsArr.map(([cx, cy], i) => {
|
|
@@ -357,39 +338,42 @@ function RadarChartCore({
|
|
|
357
338
|
if (!userVal || Number(userVal) === 0) return null;
|
|
358
339
|
const compareVal = compareData[shortTitle];
|
|
359
340
|
const matches = hasCompareData && userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
360
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
361
342
|
"circle",
|
|
362
343
|
{
|
|
363
344
|
key: `user-dot-${i}`,
|
|
364
345
|
cx,
|
|
365
346
|
cy,
|
|
366
|
-
r: matches ?
|
|
347
|
+
r: matches ? 6 : 5,
|
|
367
348
|
fill: matches ? "#fed12e" : "#7C6B9E",
|
|
368
349
|
stroke: "#FFFFFF",
|
|
369
|
-
strokeWidth:
|
|
350
|
+
strokeWidth: 2,
|
|
351
|
+
style: { pointerEvents: "none" }
|
|
370
352
|
}
|
|
371
353
|
);
|
|
372
354
|
}),
|
|
373
|
-
hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */
|
|
355
|
+
hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */ import_react.default.createElement(
|
|
374
356
|
"polygon",
|
|
375
357
|
{
|
|
376
358
|
key: "compare-static",
|
|
377
359
|
points: comparePoints,
|
|
378
360
|
style: {
|
|
379
|
-
fill: "rgba(90, 154, 110, 0.
|
|
380
|
-
stroke: "#5A9A6E",
|
|
381
|
-
strokeWidth: 2
|
|
361
|
+
fill: darkMode ? "rgba(110, 210, 140, 0.55)" : "rgba(90, 154, 110, 0.45)",
|
|
362
|
+
stroke: darkMode ? "#6DD28C" : "#5A9A6E",
|
|
363
|
+
strokeWidth: 2,
|
|
364
|
+
mixBlendMode: darkMode ? "normal" : "multiply"
|
|
382
365
|
}
|
|
383
366
|
}
|
|
384
|
-
) : /* @__PURE__ */
|
|
367
|
+
) : /* @__PURE__ */ import_react.default.createElement(
|
|
385
368
|
import_web.animated.polygon,
|
|
386
369
|
{
|
|
387
370
|
key: "compare-animated",
|
|
388
371
|
points: compareSpring.points,
|
|
389
372
|
style: {
|
|
390
|
-
fill: "rgba(90, 154, 110, 0.
|
|
391
|
-
stroke: "#5A9A6E",
|
|
392
|
-
strokeWidth: 2
|
|
373
|
+
fill: darkMode ? "rgba(110, 210, 140, 0.55)" : "rgba(90, 154, 110, 0.45)",
|
|
374
|
+
stroke: darkMode ? "#6DD28C" : "#5A9A6E",
|
|
375
|
+
strokeWidth: 2,
|
|
376
|
+
mixBlendMode: darkMode ? "normal" : "multiply"
|
|
393
377
|
}
|
|
394
378
|
}
|
|
395
379
|
) : null,
|
|
@@ -398,46 +382,118 @@ function RadarChartCore({
|
|
|
398
382
|
const userVal = spokes[i][1];
|
|
399
383
|
const compareVal = compareData[shortTitle];
|
|
400
384
|
if (!compareVal || Number(compareVal) === 0) return null;
|
|
401
|
-
const matches = userVal !== 0 && compareVal
|
|
402
|
-
return /* @__PURE__ */
|
|
385
|
+
const matches = userVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
386
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
403
387
|
"circle",
|
|
404
388
|
{
|
|
405
389
|
key: `compare-dot-${i}`,
|
|
406
390
|
cx,
|
|
407
391
|
cy,
|
|
408
|
-
r: matches ?
|
|
409
|
-
fill: matches ? "#fed12e" : "#5A9A6E",
|
|
392
|
+
r: matches ? 6 : 5,
|
|
393
|
+
fill: matches ? "#fed12e" : darkMode ? "#6DD28C" : "#5A9A6E",
|
|
410
394
|
stroke: "#FFFFFF",
|
|
411
|
-
strokeWidth:
|
|
395
|
+
strokeWidth: 2,
|
|
396
|
+
style: { pointerEvents: "none" }
|
|
412
397
|
}
|
|
413
398
|
);
|
|
414
399
|
}),
|
|
415
400
|
spokes.map(([shortTitle], i) => {
|
|
416
401
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
417
|
-
const
|
|
418
|
-
const
|
|
402
|
+
const endX = centerX + (spokeExtension[shortTitle] ? extRadius : radius) * Math.sin(angle);
|
|
403
|
+
const endY = centerY - (spokeExtension[shortTitle] ? extRadius : radius) * Math.cos(angle);
|
|
419
404
|
const isUnansweredHitbox = !!unansweredSpokes[shortTitle];
|
|
420
|
-
return /* @__PURE__ */
|
|
405
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
421
406
|
"line",
|
|
422
407
|
{
|
|
423
408
|
key: `hitbox-${shortTitle}`,
|
|
424
409
|
x1: centerX,
|
|
425
410
|
y1: centerY,
|
|
426
|
-
x2:
|
|
427
|
-
y2:
|
|
411
|
+
x2: endX,
|
|
412
|
+
y2: endY,
|
|
428
413
|
stroke: "transparent",
|
|
429
414
|
strokeWidth: 14,
|
|
430
415
|
onClick: () => isUnansweredHitbox ? onReplaceTopic(shortTitle) : onToggleInversion(shortTitle),
|
|
431
416
|
style: { cursor: "pointer" }
|
|
432
417
|
}
|
|
433
418
|
);
|
|
434
|
-
})
|
|
419
|
+
}),
|
|
420
|
+
pointsArr.map(([cx, cy], i) => {
|
|
421
|
+
const shortTitle = spokes[i][0];
|
|
422
|
+
const userVal = spokes[i][1];
|
|
423
|
+
if (!userVal || Number(userVal) === 0) return null;
|
|
424
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
425
|
+
"circle",
|
|
426
|
+
{
|
|
427
|
+
key: `user-sensor-${i}`,
|
|
428
|
+
cx,
|
|
429
|
+
cy,
|
|
430
|
+
r: 14,
|
|
431
|
+
fill: "transparent",
|
|
432
|
+
stroke: "none",
|
|
433
|
+
style: { cursor: "default" },
|
|
434
|
+
onMouseEnter: () => setTooltip({ x: cx, y: cy, text: getStanceText(shortTitle, userVal) }),
|
|
435
|
+
onMouseLeave: () => setTooltip(null)
|
|
436
|
+
}
|
|
437
|
+
);
|
|
438
|
+
}),
|
|
439
|
+
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => {
|
|
440
|
+
const shortTitle = spokes[i][0];
|
|
441
|
+
const compareVal = compareData[shortTitle];
|
|
442
|
+
if (!compareVal || Number(compareVal) === 0) return null;
|
|
443
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
444
|
+
"circle",
|
|
445
|
+
{
|
|
446
|
+
key: `compare-sensor-${i}`,
|
|
447
|
+
cx,
|
|
448
|
+
cy,
|
|
449
|
+
r: 14,
|
|
450
|
+
fill: "transparent",
|
|
451
|
+
stroke: "none",
|
|
452
|
+
style: { cursor: "default" },
|
|
453
|
+
onMouseEnter: () => setTooltip({ x: cx, y: cy, text: getStanceText(shortTitle, compareVal) }),
|
|
454
|
+
onMouseLeave: () => setTooltip(null)
|
|
455
|
+
}
|
|
456
|
+
);
|
|
457
|
+
}),
|
|
458
|
+
tooltip && (() => {
|
|
459
|
+
const tipW = 190;
|
|
460
|
+
const tipH = 70;
|
|
461
|
+
const svgW = size + sidePadding * 2;
|
|
462
|
+
const tx = tooltip.x + sidePadding + 12 > svgW - tipW ? tooltip.x - tipW - 12 : tooltip.x + 12;
|
|
463
|
+
const ty = tooltip.y - 10;
|
|
464
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
465
|
+
"foreignObject",
|
|
466
|
+
{
|
|
467
|
+
x: tx,
|
|
468
|
+
y: ty,
|
|
469
|
+
width: tipW,
|
|
470
|
+
height: tipH,
|
|
471
|
+
style: { overflow: "visible", pointerEvents: "none" }
|
|
472
|
+
},
|
|
473
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
474
|
+
"div",
|
|
475
|
+
{
|
|
476
|
+
xmlns: "http://www.w3.org/1999/xhtml",
|
|
477
|
+
style: {
|
|
478
|
+
background: darkMode ? "#2F3237" : "#ffffff",
|
|
479
|
+
border: darkMode ? "1px solid #59B0C4" : "1px solid #d1d5db",
|
|
480
|
+
borderRadius: 8,
|
|
481
|
+
padding: "7px 11px",
|
|
482
|
+
fontSize: 12,
|
|
483
|
+
lineHeight: 1.4,
|
|
484
|
+
color: darkMode ? "#EBEDEF" : "#111",
|
|
485
|
+
boxShadow: darkMode ? "0 2px 12px rgba(0,0,0,0.4)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
486
|
+
width: tipW + "px",
|
|
487
|
+
wordWrap: "break-word"
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
tooltip.text
|
|
491
|
+
)
|
|
492
|
+
);
|
|
493
|
+
})()
|
|
435
494
|
);
|
|
436
495
|
}
|
|
437
|
-
function
|
|
438
|
-
return Math.max(baseFSize, 10);
|
|
439
|
-
}
|
|
440
|
-
function wrapLabel(label, maxChars = 12) {
|
|
496
|
+
function wrapLabel(label, maxChars = 12, maxLines = 3) {
|
|
441
497
|
const str = String(label);
|
|
442
498
|
let rawWords;
|
|
443
499
|
if (str.includes("/")) {
|
|
@@ -462,15 +518,15 @@ function wrapLabel(label, maxChars = 12) {
|
|
|
462
518
|
}
|
|
463
519
|
}
|
|
464
520
|
if (line) lines.push(line);
|
|
465
|
-
if (lines.length >
|
|
466
|
-
const overflow = lines.splice(
|
|
467
|
-
lines[1] = lines[1] + " " + overflow;
|
|
521
|
+
if (lines.length > maxLines) {
|
|
522
|
+
const overflow = lines.splice(maxLines).join(" ");
|
|
523
|
+
lines[maxLines - 1] = lines[maxLines - 1] + " " + overflow;
|
|
468
524
|
}
|
|
469
525
|
return lines;
|
|
470
526
|
}
|
|
471
527
|
|
|
472
528
|
// src/Header.jsx
|
|
473
|
-
var
|
|
529
|
+
var import_react3 = __toESM(require("react"));
|
|
474
530
|
|
|
475
531
|
// src/tokens.js
|
|
476
532
|
var colorScales = {
|
|
@@ -866,13 +922,13 @@ var breakpoints = {
|
|
|
866
922
|
};
|
|
867
923
|
|
|
868
924
|
// src/useMediaQuery.js
|
|
869
|
-
var
|
|
925
|
+
var import_react2 = require("react");
|
|
870
926
|
function useMediaQuery(query) {
|
|
871
|
-
const [matches, setMatches] = (0,
|
|
927
|
+
const [matches, setMatches] = (0, import_react2.useState)(() => {
|
|
872
928
|
if (typeof window === "undefined") return false;
|
|
873
929
|
return window.matchMedia(query).matches;
|
|
874
930
|
});
|
|
875
|
-
(0,
|
|
931
|
+
(0, import_react2.useEffect)(() => {
|
|
876
932
|
if (typeof window === "undefined") return;
|
|
877
933
|
const mql = window.matchMedia(query);
|
|
878
934
|
const handler = (e) => setMatches(e.matches);
|
|
@@ -884,6 +940,16 @@ function useMediaQuery(query) {
|
|
|
884
940
|
}
|
|
885
941
|
|
|
886
942
|
// src/Header.jsx
|
|
943
|
+
var dark = {
|
|
944
|
+
bg: "#1C1F23",
|
|
945
|
+
bgElevated: "#2F3237",
|
|
946
|
+
bgHover: "#41454E",
|
|
947
|
+
border: "#41454E",
|
|
948
|
+
link: "#59B0C4",
|
|
949
|
+
text: "#D3D7DE",
|
|
950
|
+
textMuted: "#9CA3AF",
|
|
951
|
+
shadow: "0 10px 40px rgba(0,0,0,0.4)"
|
|
952
|
+
};
|
|
887
953
|
function Header({
|
|
888
954
|
logoSrc,
|
|
889
955
|
logoAlt = "Empowered Vote",
|
|
@@ -894,14 +960,15 @@ function Header({
|
|
|
894
960
|
currentPath,
|
|
895
961
|
onNavigate,
|
|
896
962
|
profileMenu,
|
|
963
|
+
darkMode = false,
|
|
897
964
|
style = {}
|
|
898
965
|
}) {
|
|
899
|
-
const [mobileMenuOpen, setMobileMenuOpen] = (0,
|
|
900
|
-
const [openDropdown, setOpenDropdown] = (0,
|
|
901
|
-
const [profileOpen, setProfileOpen] = (0,
|
|
966
|
+
const [mobileMenuOpen, setMobileMenuOpen] = (0, import_react3.useState)(false);
|
|
967
|
+
const [openDropdown, setOpenDropdown] = (0, import_react3.useState)(null);
|
|
968
|
+
const [profileOpen, setProfileOpen] = (0, import_react3.useState)(false);
|
|
902
969
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
903
|
-
const profileRef = (0,
|
|
904
|
-
(0,
|
|
970
|
+
const profileRef = (0, import_react3.useRef)(null);
|
|
971
|
+
(0, import_react3.useEffect)(() => {
|
|
905
972
|
if (!profileOpen) return;
|
|
906
973
|
const handleClickOutside = (e) => {
|
|
907
974
|
if (profileRef.current && !profileRef.current.contains(e.target)) {
|
|
@@ -917,9 +984,16 @@ function Header({
|
|
|
917
984
|
onNavigate(href);
|
|
918
985
|
}
|
|
919
986
|
};
|
|
987
|
+
const linkColor = darkMode ? dark.link : colors.evTeal;
|
|
988
|
+
const dropdownBg = darkMode ? dark.bgElevated : colors.bgWhite;
|
|
989
|
+
const dropdownShadow = darkMode ? dark.shadow : "0 10px 40px rgba(0,0,0,0.1)";
|
|
990
|
+
const hoverBg = darkMode ? dark.bgHover : colors.bgLight;
|
|
991
|
+
const borderColor = darkMode ? dark.border : colors.borderLight;
|
|
992
|
+
const mobileShadow = darkMode ? "0 4px 20px rgba(0,0,0,0.4)" : "0 4px 20px rgba(0,0,0,0.1)";
|
|
920
993
|
const styles2 = {
|
|
921
994
|
header: {
|
|
922
|
-
backgroundColor: colors.bgWhite,
|
|
995
|
+
backgroundColor: darkMode ? dark.bg : colors.bgWhite,
|
|
996
|
+
borderBottom: darkMode ? `1px solid ${dark.border}` : "none",
|
|
923
997
|
position: "sticky",
|
|
924
998
|
top: 0,
|
|
925
999
|
zIndex: 50,
|
|
@@ -947,7 +1021,7 @@ function Header({
|
|
|
947
1021
|
fontFamily: fonts.primary,
|
|
948
1022
|
fontWeight: fontWeights.bold,
|
|
949
1023
|
fontSize: fontSizes.xl,
|
|
950
|
-
color:
|
|
1024
|
+
color: linkColor,
|
|
951
1025
|
textDecoration: "none",
|
|
952
1026
|
cursor: "pointer",
|
|
953
1027
|
display: "flex",
|
|
@@ -970,11 +1044,12 @@ function Header({
|
|
|
970
1044
|
zIndex: 100
|
|
971
1045
|
},
|
|
972
1046
|
dropdownInner: {
|
|
973
|
-
backgroundColor:
|
|
1047
|
+
backgroundColor: dropdownBg,
|
|
974
1048
|
borderRadius: borderRadius.lg,
|
|
975
|
-
boxShadow:
|
|
1049
|
+
boxShadow: dropdownShadow,
|
|
976
1050
|
minWidth: "200px",
|
|
977
|
-
padding: spacing[2]
|
|
1051
|
+
padding: spacing[2],
|
|
1052
|
+
border: darkMode ? `1px solid ${dark.border}` : "none"
|
|
978
1053
|
},
|
|
979
1054
|
dropdownItem: {
|
|
980
1055
|
display: "block",
|
|
@@ -982,7 +1057,7 @@ function Header({
|
|
|
982
1057
|
fontFamily: fonts.primary,
|
|
983
1058
|
fontWeight: fontWeights.medium,
|
|
984
1059
|
fontSize: fontSizes.base,
|
|
985
|
-
color:
|
|
1060
|
+
color: linkColor,
|
|
986
1061
|
textDecoration: "none",
|
|
987
1062
|
borderRadius: borderRadius.md,
|
|
988
1063
|
cursor: "pointer"
|
|
@@ -1004,13 +1079,13 @@ function Header({
|
|
|
1004
1079
|
display: "inline-flex",
|
|
1005
1080
|
alignItems: "center",
|
|
1006
1081
|
backgroundColor: "transparent",
|
|
1007
|
-
color:
|
|
1082
|
+
color: linkColor,
|
|
1008
1083
|
fontFamily: fonts.primary,
|
|
1009
1084
|
fontWeight: fontWeights.bold,
|
|
1010
1085
|
fontSize: fontSizes.base,
|
|
1011
1086
|
padding: `${spacing[2]} ${spacing[5]}`,
|
|
1012
1087
|
borderRadius: borderRadius.full || "999px",
|
|
1013
|
-
border: `1.5px solid ${
|
|
1088
|
+
border: `1.5px solid ${linkColor}`,
|
|
1014
1089
|
cursor: "pointer",
|
|
1015
1090
|
textDecoration: "none",
|
|
1016
1091
|
lineHeight: 1.2,
|
|
@@ -1026,7 +1101,7 @@ function Header({
|
|
|
1026
1101
|
hamburger: {
|
|
1027
1102
|
width: "24px",
|
|
1028
1103
|
height: "2px",
|
|
1029
|
-
backgroundColor:
|
|
1104
|
+
backgroundColor: linkColor,
|
|
1030
1105
|
position: "relative"
|
|
1031
1106
|
},
|
|
1032
1107
|
mobileMenu: {
|
|
@@ -1036,25 +1111,26 @@ function Header({
|
|
|
1036
1111
|
top: "100%",
|
|
1037
1112
|
left: 0,
|
|
1038
1113
|
right: 0,
|
|
1039
|
-
backgroundColor: colors.bgWhite,
|
|
1114
|
+
backgroundColor: darkMode ? dark.bg : colors.bgWhite,
|
|
1040
1115
|
padding: spacing[4],
|
|
1041
|
-
boxShadow:
|
|
1116
|
+
boxShadow: mobileShadow,
|
|
1117
|
+
borderTop: darkMode ? `1px solid ${dark.border}` : "none"
|
|
1042
1118
|
},
|
|
1043
1119
|
mobileNavItem: {
|
|
1044
1120
|
fontFamily: fonts.primary,
|
|
1045
1121
|
fontWeight: fontWeights.bold,
|
|
1046
1122
|
fontSize: fontSizes.lg,
|
|
1047
|
-
color:
|
|
1123
|
+
color: linkColor,
|
|
1048
1124
|
textDecoration: "none",
|
|
1049
1125
|
padding: `${spacing[3]} 0`,
|
|
1050
|
-
borderBottom: `1px solid ${
|
|
1126
|
+
borderBottom: `1px solid ${borderColor}`
|
|
1051
1127
|
},
|
|
1052
1128
|
profileButton: {
|
|
1053
1129
|
width: "40px",
|
|
1054
1130
|
height: "40px",
|
|
1055
1131
|
borderRadius: borderRadius.full,
|
|
1056
|
-
border: `2px solid ${
|
|
1057
|
-
backgroundColor: colors.bgLight,
|
|
1132
|
+
border: `2px solid ${linkColor}`,
|
|
1133
|
+
backgroundColor: darkMode ? dark.bgElevated : colors.bgLight,
|
|
1058
1134
|
cursor: "pointer",
|
|
1059
1135
|
display: "flex",
|
|
1060
1136
|
alignItems: "center",
|
|
@@ -1069,11 +1145,12 @@ function Header({
|
|
|
1069
1145
|
zIndex: 100
|
|
1070
1146
|
},
|
|
1071
1147
|
profileDropdownInner: {
|
|
1072
|
-
backgroundColor:
|
|
1148
|
+
backgroundColor: dropdownBg,
|
|
1073
1149
|
borderRadius: borderRadius.lg,
|
|
1074
|
-
boxShadow:
|
|
1150
|
+
boxShadow: dropdownShadow,
|
|
1075
1151
|
minWidth: "160px",
|
|
1076
|
-
padding: spacing[2]
|
|
1152
|
+
padding: spacing[2],
|
|
1153
|
+
border: darkMode ? `1px solid ${dark.border}` : "none"
|
|
1077
1154
|
},
|
|
1078
1155
|
profileDropdownItem: {
|
|
1079
1156
|
display: "block",
|
|
@@ -1082,7 +1159,7 @@ function Header({
|
|
|
1082
1159
|
fontFamily: fonts.primary,
|
|
1083
1160
|
fontWeight: fontWeights.medium,
|
|
1084
1161
|
fontSize: fontSizes.base,
|
|
1085
|
-
color:
|
|
1162
|
+
color: linkColor,
|
|
1086
1163
|
textDecoration: "none",
|
|
1087
1164
|
borderRadius: borderRadius.md,
|
|
1088
1165
|
cursor: "pointer",
|
|
@@ -1092,7 +1169,7 @@ function Header({
|
|
|
1092
1169
|
},
|
|
1093
1170
|
mobileDivider: {
|
|
1094
1171
|
height: "1px",
|
|
1095
|
-
backgroundColor:
|
|
1172
|
+
backgroundColor: borderColor,
|
|
1096
1173
|
margin: `${spacing[3]} 0`
|
|
1097
1174
|
},
|
|
1098
1175
|
profileLabel: {
|
|
@@ -1100,8 +1177,8 @@ function Header({
|
|
|
1100
1177
|
fontFamily: fonts.primary,
|
|
1101
1178
|
fontWeight: fontWeights.semibold,
|
|
1102
1179
|
fontSize: fontSizes.sm,
|
|
1103
|
-
color: colors.textMuted,
|
|
1104
|
-
borderBottom: `1px solid ${
|
|
1180
|
+
color: darkMode ? dark.textMuted : colors.textMuted,
|
|
1181
|
+
borderBottom: `1px solid ${borderColor}`,
|
|
1105
1182
|
marginBottom: spacing[1],
|
|
1106
1183
|
overflow: "hidden",
|
|
1107
1184
|
textOverflow: "ellipsis",
|
|
@@ -1112,14 +1189,14 @@ function Header({
|
|
|
1112
1189
|
const isActive = currentPath === item.href;
|
|
1113
1190
|
const hasDropdown = item.dropdown && item.dropdown.length > 0;
|
|
1114
1191
|
const isOpen = openDropdown === item.label;
|
|
1115
|
-
return /* @__PURE__ */
|
|
1192
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
1116
1193
|
"div",
|
|
1117
1194
|
{
|
|
1118
1195
|
style: { position: "relative" },
|
|
1119
1196
|
onMouseEnter: () => hasDropdown && setOpenDropdown(item.label),
|
|
1120
1197
|
onMouseLeave: () => hasDropdown && setOpenDropdown(null)
|
|
1121
1198
|
},
|
|
1122
|
-
/* @__PURE__ */
|
|
1199
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
1123
1200
|
"a",
|
|
1124
1201
|
{
|
|
1125
1202
|
href: item.href,
|
|
@@ -1130,7 +1207,7 @@ function Header({
|
|
|
1130
1207
|
}
|
|
1131
1208
|
},
|
|
1132
1209
|
item.label,
|
|
1133
|
-
hasDropdown && /* @__PURE__ */
|
|
1210
|
+
hasDropdown && /* @__PURE__ */ import_react3.default.createElement(
|
|
1134
1211
|
"svg",
|
|
1135
1212
|
{
|
|
1136
1213
|
style: styles2.dropdownIcon,
|
|
@@ -1138,11 +1215,11 @@ function Header({
|
|
|
1138
1215
|
fill: "none",
|
|
1139
1216
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1140
1217
|
},
|
|
1141
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
1142
1219
|
"path",
|
|
1143
1220
|
{
|
|
1144
1221
|
d: "M1 1L8 8L15 1",
|
|
1145
|
-
stroke:
|
|
1222
|
+
stroke: linkColor,
|
|
1146
1223
|
strokeWidth: "2",
|
|
1147
1224
|
strokeLinecap: "round",
|
|
1148
1225
|
strokeLinejoin: "round"
|
|
@@ -1150,7 +1227,7 @@ function Header({
|
|
|
1150
1227
|
)
|
|
1151
1228
|
)
|
|
1152
1229
|
),
|
|
1153
|
-
hasDropdown && isOpen && /* @__PURE__ */
|
|
1230
|
+
hasDropdown && isOpen && /* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.dropdown }, /* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.dropdownInner }, item.dropdown.map((dropdownItem, idx) => /* @__PURE__ */ import_react3.default.createElement(
|
|
1154
1231
|
"a",
|
|
1155
1232
|
{
|
|
1156
1233
|
key: idx,
|
|
@@ -1158,7 +1235,7 @@ function Header({
|
|
|
1158
1235
|
onClick: (e) => handleNavClick(e, dropdownItem.href),
|
|
1159
1236
|
style: styles2.dropdownItem,
|
|
1160
1237
|
onMouseEnter: (e) => {
|
|
1161
|
-
e.target.style.backgroundColor =
|
|
1238
|
+
e.target.style.backgroundColor = hoverBg;
|
|
1162
1239
|
},
|
|
1163
1240
|
onMouseLeave: (e) => {
|
|
1164
1241
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1168,26 +1245,26 @@ function Header({
|
|
|
1168
1245
|
))))
|
|
1169
1246
|
);
|
|
1170
1247
|
};
|
|
1171
|
-
return /* @__PURE__ */
|
|
1248
|
+
return /* @__PURE__ */ import_react3.default.createElement("header", { style: styles2.header }, /* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.container }, /* @__PURE__ */ import_react3.default.createElement(
|
|
1172
1249
|
"a",
|
|
1173
1250
|
{
|
|
1174
1251
|
href: logoHref,
|
|
1175
1252
|
onClick: (e) => handleNavClick(e, logoHref),
|
|
1176
1253
|
style: { display: "flex", alignItems: "center" }
|
|
1177
1254
|
},
|
|
1178
|
-
logoSrc ? /* @__PURE__ */
|
|
1255
|
+
logoSrc ? /* @__PURE__ */ import_react3.default.createElement("img", { src: logoSrc, alt: logoAlt, style: styles2.logo }) : /* @__PURE__ */ import_react3.default.createElement(
|
|
1179
1256
|
"span",
|
|
1180
1257
|
{
|
|
1181
1258
|
style: {
|
|
1182
1259
|
fontFamily: fonts.primary,
|
|
1183
1260
|
fontWeight: fontWeights.bold,
|
|
1184
1261
|
fontSize: fontSizes["2xl"],
|
|
1185
|
-
color:
|
|
1262
|
+
color: linkColor
|
|
1186
1263
|
}
|
|
1187
1264
|
},
|
|
1188
1265
|
"empowered.vote"
|
|
1189
1266
|
)
|
|
1190
|
-
), /* @__PURE__ */
|
|
1267
|
+
), /* @__PURE__ */ import_react3.default.createElement("nav", { style: styles2.nav, className: "ev-header-nav" }, navItems.map((item, idx) => /* @__PURE__ */ import_react3.default.createElement(NavLink, { key: idx, item }))), /* @__PURE__ */ import_react3.default.createElement("div", { style: { display: isMobile ? "none" : "flex", alignItems: "center", gap: spacing[3] } }, secondaryAction && import_react3.default.isValidElement(secondaryAction) && secondaryAction, secondaryAction && !import_react3.default.isValidElement(secondaryAction) && /* @__PURE__ */ import_react3.default.createElement(
|
|
1191
1268
|
"a",
|
|
1192
1269
|
{
|
|
1193
1270
|
href: secondaryAction.href,
|
|
@@ -1201,16 +1278,16 @@ function Header({
|
|
|
1201
1278
|
style: styles2.secondaryAction,
|
|
1202
1279
|
className: "ev-header-secondary",
|
|
1203
1280
|
onMouseEnter: (e) => {
|
|
1204
|
-
e.currentTarget.style.backgroundColor =
|
|
1281
|
+
e.currentTarget.style.backgroundColor = linkColor;
|
|
1205
1282
|
e.currentTarget.style.color = colors.textWhite;
|
|
1206
1283
|
},
|
|
1207
1284
|
onMouseLeave: (e) => {
|
|
1208
1285
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
1209
|
-
e.currentTarget.style.color =
|
|
1286
|
+
e.currentTarget.style.color = linkColor;
|
|
1210
1287
|
}
|
|
1211
1288
|
},
|
|
1212
1289
|
secondaryAction.label
|
|
1213
|
-
), ctaButton && /* @__PURE__ */
|
|
1290
|
+
), ctaButton && /* @__PURE__ */ import_react3.default.createElement(
|
|
1214
1291
|
"a",
|
|
1215
1292
|
{
|
|
1216
1293
|
href: ctaButton.href,
|
|
@@ -1225,7 +1302,7 @@ function Header({
|
|
|
1225
1302
|
}
|
|
1226
1303
|
},
|
|
1227
1304
|
ctaButton.label
|
|
1228
|
-
), profileMenu && /* @__PURE__ */
|
|
1305
|
+
), profileMenu && /* @__PURE__ */ import_react3.default.createElement("div", { ref: profileRef, style: { position: "relative" } }, /* @__PURE__ */ import_react3.default.createElement(
|
|
1229
1306
|
"button",
|
|
1230
1307
|
{
|
|
1231
1308
|
style: styles2.profileButton,
|
|
@@ -1233,24 +1310,24 @@ function Header({
|
|
|
1233
1310
|
"aria-label": "Profile menu",
|
|
1234
1311
|
"aria-expanded": profileOpen
|
|
1235
1312
|
},
|
|
1236
|
-
/* @__PURE__ */
|
|
1313
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
1237
1314
|
"svg",
|
|
1238
1315
|
{
|
|
1239
1316
|
width: "20",
|
|
1240
1317
|
height: "20",
|
|
1241
1318
|
viewBox: "0 0 24 24",
|
|
1242
1319
|
fill: "none",
|
|
1243
|
-
stroke:
|
|
1320
|
+
stroke: linkColor,
|
|
1244
1321
|
strokeWidth: "2",
|
|
1245
1322
|
strokeLinecap: "round",
|
|
1246
1323
|
strokeLinejoin: "round"
|
|
1247
1324
|
},
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ import_react3.default.createElement("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
|
|
1326
|
+
/* @__PURE__ */ import_react3.default.createElement("circle", { cx: "12", cy: "7", r: "4" })
|
|
1250
1327
|
)
|
|
1251
|
-
), profileOpen && /* @__PURE__ */
|
|
1328
|
+
), profileOpen && /* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.profileDropdown }, /* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.profileDropdownInner }, profileMenu.label && /* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.profileLabel }, profileMenu.label), profileMenu.items.map((item, idx) => {
|
|
1252
1329
|
if (item.href) {
|
|
1253
|
-
return /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
1254
1331
|
"a",
|
|
1255
1332
|
{
|
|
1256
1333
|
key: idx,
|
|
@@ -1264,7 +1341,7 @@ function Header({
|
|
|
1264
1341
|
},
|
|
1265
1342
|
style: styles2.profileDropdownItem,
|
|
1266
1343
|
onMouseEnter: (e) => {
|
|
1267
|
-
e.target.style.backgroundColor =
|
|
1344
|
+
e.target.style.backgroundColor = hoverBg;
|
|
1268
1345
|
},
|
|
1269
1346
|
onMouseLeave: (e) => {
|
|
1270
1347
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1273,7 +1350,7 @@ function Header({
|
|
|
1273
1350
|
item.label
|
|
1274
1351
|
);
|
|
1275
1352
|
}
|
|
1276
|
-
return /* @__PURE__ */
|
|
1353
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
1277
1354
|
"button",
|
|
1278
1355
|
{
|
|
1279
1356
|
key: idx,
|
|
@@ -1284,7 +1361,7 @@ function Header({
|
|
|
1284
1361
|
},
|
|
1285
1362
|
style: styles2.profileDropdownItem,
|
|
1286
1363
|
onMouseEnter: (e) => {
|
|
1287
|
-
e.target.style.backgroundColor =
|
|
1364
|
+
e.target.style.backgroundColor = hoverBg;
|
|
1288
1365
|
},
|
|
1289
1366
|
onMouseLeave: (e) => {
|
|
1290
1367
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1292,7 +1369,7 @@ function Header({
|
|
|
1292
1369
|
},
|
|
1293
1370
|
item.label
|
|
1294
1371
|
);
|
|
1295
|
-
}))))), /* @__PURE__ */
|
|
1372
|
+
}))))), /* @__PURE__ */ import_react3.default.createElement(
|
|
1296
1373
|
"button",
|
|
1297
1374
|
{
|
|
1298
1375
|
style: styles2.mobileMenuButton,
|
|
@@ -1301,7 +1378,7 @@ function Header({
|
|
|
1301
1378
|
"aria-label": "Toggle menu",
|
|
1302
1379
|
"aria-expanded": mobileMenuOpen
|
|
1303
1380
|
},
|
|
1304
|
-
/* @__PURE__ */
|
|
1381
|
+
/* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.hamburger }, /* @__PURE__ */ import_react3.default.createElement(
|
|
1305
1382
|
"span",
|
|
1306
1383
|
{
|
|
1307
1384
|
style: {
|
|
@@ -1310,10 +1387,10 @@ function Header({
|
|
|
1310
1387
|
left: 0,
|
|
1311
1388
|
width: "100%",
|
|
1312
1389
|
height: "2px",
|
|
1313
|
-
backgroundColor:
|
|
1390
|
+
backgroundColor: linkColor
|
|
1314
1391
|
}
|
|
1315
1392
|
}
|
|
1316
|
-
), /* @__PURE__ */
|
|
1393
|
+
), /* @__PURE__ */ import_react3.default.createElement(
|
|
1317
1394
|
"span",
|
|
1318
1395
|
{
|
|
1319
1396
|
style: {
|
|
@@ -1322,13 +1399,13 @@ function Header({
|
|
|
1322
1399
|
left: 0,
|
|
1323
1400
|
width: "100%",
|
|
1324
1401
|
height: "2px",
|
|
1325
|
-
backgroundColor:
|
|
1402
|
+
backgroundColor: linkColor
|
|
1326
1403
|
}
|
|
1327
1404
|
}
|
|
1328
1405
|
))
|
|
1329
|
-
)), /* @__PURE__ */
|
|
1406
|
+
)), /* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.mobileMenu, className: "ev-header-mobile-menu" }, navItems.map((item, idx) => {
|
|
1330
1407
|
const hasDropdown = item.dropdown && item.dropdown.length > 0;
|
|
1331
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, { key: idx }, hasDropdown ? /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(
|
|
1332
1409
|
"span",
|
|
1333
1410
|
{
|
|
1334
1411
|
style: {
|
|
@@ -1338,7 +1415,7 @@ function Header({
|
|
|
1338
1415
|
}
|
|
1339
1416
|
},
|
|
1340
1417
|
item.label
|
|
1341
|
-
), item.dropdown.map((sub, subIdx) => /* @__PURE__ */
|
|
1418
|
+
), item.dropdown.map((sub, subIdx) => /* @__PURE__ */ import_react3.default.createElement(
|
|
1342
1419
|
"a",
|
|
1343
1420
|
{
|
|
1344
1421
|
key: subIdx,
|
|
@@ -1355,7 +1432,7 @@ function Header({
|
|
|
1355
1432
|
}
|
|
1356
1433
|
},
|
|
1357
1434
|
sub.label
|
|
1358
|
-
))) : /* @__PURE__ */
|
|
1435
|
+
))) : /* @__PURE__ */ import_react3.default.createElement(
|
|
1359
1436
|
"a",
|
|
1360
1437
|
{
|
|
1361
1438
|
href: item.href,
|
|
@@ -1367,7 +1444,7 @@ function Header({
|
|
|
1367
1444
|
},
|
|
1368
1445
|
item.label
|
|
1369
1446
|
));
|
|
1370
|
-
}), secondaryAction &&
|
|
1447
|
+
}), secondaryAction && import_react3.default.isValidElement(secondaryAction) && /* @__PURE__ */ import_react3.default.createElement("div", { style: { marginTop: spacing[4], textAlign: "center" } }, secondaryAction), secondaryAction && !import_react3.default.isValidElement(secondaryAction) && /* @__PURE__ */ import_react3.default.createElement(
|
|
1371
1448
|
"a",
|
|
1372
1449
|
{
|
|
1373
1450
|
href: secondaryAction.href,
|
|
@@ -1382,7 +1459,7 @@ function Header({
|
|
|
1382
1459
|
style: { ...styles2.secondaryAction, marginTop: spacing[4], textAlign: "center", justifyContent: "center" }
|
|
1383
1460
|
},
|
|
1384
1461
|
secondaryAction.label
|
|
1385
|
-
), ctaButton && /* @__PURE__ */
|
|
1462
|
+
), ctaButton && /* @__PURE__ */ import_react3.default.createElement(
|
|
1386
1463
|
"a",
|
|
1387
1464
|
{
|
|
1388
1465
|
href: ctaButton.href,
|
|
@@ -1393,7 +1470,7 @@ function Header({
|
|
|
1393
1470
|
style: { ...styles2.ctaButton, marginTop: spacing[4], textAlign: "center" }
|
|
1394
1471
|
},
|
|
1395
1472
|
ctaButton.label
|
|
1396
|
-
), profileMenu && /* @__PURE__ */
|
|
1473
|
+
), profileMenu && /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement("div", { style: styles2.mobileDivider }), profileMenu.label && /* @__PURE__ */ import_react3.default.createElement(
|
|
1397
1474
|
"span",
|
|
1398
1475
|
{
|
|
1399
1476
|
style: {
|
|
@@ -1409,7 +1486,7 @@ function Header({
|
|
|
1409
1486
|
profileMenu.label
|
|
1410
1487
|
), profileMenu.items.map((item, idx) => {
|
|
1411
1488
|
if (item.href) {
|
|
1412
|
-
return /* @__PURE__ */
|
|
1489
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
1413
1490
|
"a",
|
|
1414
1491
|
{
|
|
1415
1492
|
key: idx,
|
|
@@ -1426,7 +1503,7 @@ function Header({
|
|
|
1426
1503
|
item.label
|
|
1427
1504
|
);
|
|
1428
1505
|
}
|
|
1429
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
1430
1507
|
"button",
|
|
1431
1508
|
{
|
|
1432
1509
|
key: idx,
|
|
@@ -1450,10 +1527,10 @@ function Header({
|
|
|
1450
1527
|
}
|
|
1451
1528
|
|
|
1452
1529
|
// src/SiteHeader.jsx
|
|
1453
|
-
var
|
|
1530
|
+
var import_react5 = __toESM(require("react"));
|
|
1454
1531
|
|
|
1455
1532
|
// src/FeedbackButton.jsx
|
|
1456
|
-
var
|
|
1533
|
+
var import_react4 = __toESM(require("react"));
|
|
1457
1534
|
var FEEDBACK_BASE_DEFAULT = "https://alpha.empowered.vote/feedback";
|
|
1458
1535
|
var HOST_FEATURE_MAP = {
|
|
1459
1536
|
"compass.empowered.vote": "compass",
|
|
@@ -1524,7 +1601,7 @@ function FeedbackButton({
|
|
|
1524
1601
|
cursor: "pointer"
|
|
1525
1602
|
};
|
|
1526
1603
|
const baseStyle = variant === "link" ? linkStyle2 : pillStyle;
|
|
1527
|
-
return /* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
1528
1605
|
"a",
|
|
1529
1606
|
{
|
|
1530
1607
|
href,
|
|
@@ -1575,6 +1652,7 @@ function SiteHeader({
|
|
|
1575
1652
|
profileMenu,
|
|
1576
1653
|
secondaryAction,
|
|
1577
1654
|
feedbackFeature,
|
|
1655
|
+
darkMode = false,
|
|
1578
1656
|
style = {}
|
|
1579
1657
|
}) {
|
|
1580
1658
|
const handleNavigate = (href) => {
|
|
@@ -1588,11 +1666,11 @@ function SiteHeader({
|
|
|
1588
1666
|
if (secondaryAction === false) {
|
|
1589
1667
|
resolvedSecondary = void 0;
|
|
1590
1668
|
} else if (secondaryAction === void 0) {
|
|
1591
|
-
resolvedSecondary = /* @__PURE__ */
|
|
1669
|
+
resolvedSecondary = /* @__PURE__ */ import_react5.default.createElement(FeedbackButton, { feature: feedbackFeature });
|
|
1592
1670
|
} else {
|
|
1593
1671
|
resolvedSecondary = secondaryAction;
|
|
1594
1672
|
}
|
|
1595
|
-
return /* @__PURE__ */
|
|
1673
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
1596
1674
|
Header,
|
|
1597
1675
|
{
|
|
1598
1676
|
logoSrc,
|
|
@@ -1603,13 +1681,14 @@ function SiteHeader({
|
|
|
1603
1681
|
currentPath,
|
|
1604
1682
|
onNavigate: handleNavigate,
|
|
1605
1683
|
profileMenu,
|
|
1684
|
+
darkMode,
|
|
1606
1685
|
style
|
|
1607
1686
|
}
|
|
1608
1687
|
);
|
|
1609
1688
|
}
|
|
1610
1689
|
|
|
1611
1690
|
// src/FilterSidebar.jsx
|
|
1612
|
-
var
|
|
1691
|
+
var import_react6 = __toESM(require("react"));
|
|
1613
1692
|
function FilterSidebar({
|
|
1614
1693
|
title = "Filter by",
|
|
1615
1694
|
zipCode = "",
|
|
@@ -1763,14 +1842,14 @@ function FilterSidebar({
|
|
|
1763
1842
|
fontSize: fontSizes.sm
|
|
1764
1843
|
}
|
|
1765
1844
|
};
|
|
1766
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ import_react6.default.createElement("aside", { style: styles2.sidebar, className: "ev-filter-sidebar" }, !isMobile && /* @__PURE__ */ import_react6.default.createElement("h2", { style: styles2.title }, title), /* @__PURE__ */ import_react6.default.createElement("div", { style: isMobile ? void 0 : styles2.contentTop }, /* @__PURE__ */ import_react6.default.createElement("div", { style: isMobile ? { marginBottom: spacing[3] } : styles2.section }, !isMobile && /* @__PURE__ */ import_react6.default.createElement("label", { style: styles2.sectionLabel }, "Location"), autocompleteContainerRef ? /* @__PURE__ */ import_react6.default.createElement(
|
|
1767
1846
|
"div",
|
|
1768
1847
|
{
|
|
1769
1848
|
ref: autocompleteContainerRef,
|
|
1770
1849
|
style: styles2.zipInputWrapper,
|
|
1771
1850
|
className: "ev-autocomplete-container"
|
|
1772
1851
|
}
|
|
1773
|
-
) : /* @__PURE__ */
|
|
1852
|
+
) : /* @__PURE__ */ import_react6.default.createElement("div", { style: styles2.zipInputWrapper }, /* @__PURE__ */ import_react6.default.createElement(
|
|
1774
1853
|
"input",
|
|
1775
1854
|
{
|
|
1776
1855
|
ref: zipInputRef,
|
|
@@ -1782,7 +1861,7 @@ function FilterSidebar({
|
|
|
1782
1861
|
style: styles2.zipInput,
|
|
1783
1862
|
"aria-label": "Search location"
|
|
1784
1863
|
}
|
|
1785
|
-
), /* @__PURE__ */
|
|
1864
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
1786
1865
|
"button",
|
|
1787
1866
|
{
|
|
1788
1867
|
type: "button",
|
|
@@ -1791,7 +1870,7 @@ function FilterSidebar({
|
|
|
1791
1870
|
"aria-label": "Clear ZIP code"
|
|
1792
1871
|
},
|
|
1793
1872
|
"\xD7"
|
|
1794
|
-
))), /* @__PURE__ */
|
|
1873
|
+
))), /* @__PURE__ */ import_react6.default.createElement("div", { style: isMobile ? {} : styles2.section }, !isMobile && /* @__PURE__ */ import_react6.default.createElement("label", { style: styles2.sectionLabel }, "Group"), /* @__PURE__ */ import_react6.default.createElement("div", { style: styles2.radioGroup, role: "radiogroup", "aria-label": "Filter by group" }, filterOptions.map((option) => /* @__PURE__ */ import_react6.default.createElement("label", { key: option.value, style: styles2.radioLabel }, /* @__PURE__ */ import_react6.default.createElement(
|
|
1795
1874
|
"input",
|
|
1796
1875
|
{
|
|
1797
1876
|
type: "radio",
|
|
@@ -1801,18 +1880,18 @@ function FilterSidebar({
|
|
|
1801
1880
|
onChange: () => onFilterChange == null ? void 0 : onFilterChange(option.value),
|
|
1802
1881
|
style: styles2.radioInput
|
|
1803
1882
|
}
|
|
1804
|
-
), option.label))))), !isMobile && /* @__PURE__ */
|
|
1883
|
+
), option.label))))), !isMobile && /* @__PURE__ */ import_react6.default.createElement("div", { style: styles2.imageSection }, locationLabel && /* @__PURE__ */ import_react6.default.createElement("div", { style: styles2.locationLabel }, locationLabel), buildingImageSrc ? /* @__PURE__ */ import_react6.default.createElement(
|
|
1805
1884
|
"img",
|
|
1806
1885
|
{
|
|
1807
1886
|
src: buildingImageSrc,
|
|
1808
1887
|
alt: `${selectedFilter} government building`,
|
|
1809
1888
|
style: styles2.buildingImage
|
|
1810
1889
|
}
|
|
1811
|
-
) : /* @__PURE__ */
|
|
1890
|
+
) : /* @__PURE__ */ import_react6.default.createElement("div", { style: styles2.buildingPlaceholder }, "No image")));
|
|
1812
1891
|
}
|
|
1813
1892
|
|
|
1814
1893
|
// src/PoliticianCard.jsx
|
|
1815
|
-
var
|
|
1894
|
+
var import_react7 = __toESM(require("react"));
|
|
1816
1895
|
function PoliticianCard({
|
|
1817
1896
|
id,
|
|
1818
1897
|
imageSrc,
|
|
@@ -1964,7 +2043,7 @@ function PoliticianCard({
|
|
|
1964
2043
|
textTransform: "uppercase"
|
|
1965
2044
|
}
|
|
1966
2045
|
};
|
|
1967
|
-
const CompassIcon2 = () => /* @__PURE__ */
|
|
2046
|
+
const CompassIcon2 = () => /* @__PURE__ */ import_react7.default.createElement(
|
|
1968
2047
|
"svg",
|
|
1969
2048
|
{
|
|
1970
2049
|
style: styles2.compassIcon,
|
|
@@ -1972,7 +2051,7 @@ function PoliticianCard({
|
|
|
1972
2051
|
fill: "none",
|
|
1973
2052
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1974
2053
|
},
|
|
1975
|
-
/* @__PURE__ */
|
|
2054
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
|
1976
2055
|
"polygon",
|
|
1977
2056
|
{
|
|
1978
2057
|
points: "12,1 21.5,6.5 21.5,17.5 12,23 2.5,17.5 2.5,6.5",
|
|
@@ -1982,13 +2061,13 @@ function PoliticianCard({
|
|
|
1982
2061
|
strokeLinejoin: "round"
|
|
1983
2062
|
}
|
|
1984
2063
|
),
|
|
1985
|
-
/* @__PURE__ */
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
2064
|
+
/* @__PURE__ */ import_react7.default.createElement("line", { x1: "12", y1: "12", x2: "12", y2: "1", stroke: "currentColor", strokeWidth: "1" }),
|
|
2065
|
+
/* @__PURE__ */ import_react7.default.createElement("line", { x1: "12", y1: "12", x2: "21.5", y2: "6.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2066
|
+
/* @__PURE__ */ import_react7.default.createElement("line", { x1: "12", y1: "12", x2: "21.5", y2: "17.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2067
|
+
/* @__PURE__ */ import_react7.default.createElement("line", { x1: "12", y1: "12", x2: "12", y2: "23", stroke: "currentColor", strokeWidth: "1" }),
|
|
2068
|
+
/* @__PURE__ */ import_react7.default.createElement("line", { x1: "12", y1: "12", x2: "2.5", y2: "17.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2069
|
+
/* @__PURE__ */ import_react7.default.createElement("line", { x1: "12", y1: "12", x2: "2.5", y2: "6.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2070
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
|
1992
2071
|
"polygon",
|
|
1993
2072
|
{
|
|
1994
2073
|
points: "12,4 18,7.5 18,16 12,19.5 7,15 5,8",
|
|
@@ -1996,7 +2075,7 @@ function PoliticianCard({
|
|
|
1996
2075
|
opacity: "0.35"
|
|
1997
2076
|
}
|
|
1998
2077
|
),
|
|
1999
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
|
2000
2079
|
"polygon",
|
|
2001
2080
|
{
|
|
2002
2081
|
points: "12,4 18,7.5 18,16 12,19.5 7,15 5,8",
|
|
@@ -2007,8 +2086,8 @@ function PoliticianCard({
|
|
|
2007
2086
|
}
|
|
2008
2087
|
)
|
|
2009
2088
|
);
|
|
2010
|
-
const [imgError, setImgError] = (0,
|
|
2011
|
-
(0,
|
|
2089
|
+
const [imgError, setImgError] = (0, import_react7.useState)(false);
|
|
2090
|
+
(0, import_react7.useEffect)(() => {
|
|
2012
2091
|
setImgError(false);
|
|
2013
2092
|
}, [imageSrc]);
|
|
2014
2093
|
const getInitials = (n) => {
|
|
@@ -2017,7 +2096,7 @@ function PoliticianCard({
|
|
|
2017
2096
|
const initials = parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_a = parts[0]) == null ? void 0 : _a[0]) || "?";
|
|
2018
2097
|
return initials.toUpperCase();
|
|
2019
2098
|
};
|
|
2020
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
2021
2100
|
"div",
|
|
2022
2101
|
{
|
|
2023
2102
|
style: styles2.card,
|
|
@@ -2042,8 +2121,8 @@ function PoliticianCard({
|
|
|
2042
2121
|
}
|
|
2043
2122
|
}
|
|
2044
2123
|
},
|
|
2045
|
-
badge && /* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2124
|
+
badge && /* @__PURE__ */ import_react7.default.createElement("span", { style: styles2.badge }, badge),
|
|
2125
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { style: styles2.imageWrapper }, imageSrc && !imgError ? /* @__PURE__ */ import_react7.default.createElement(
|
|
2047
2126
|
"img",
|
|
2048
2127
|
{
|
|
2049
2128
|
src: imageSrc,
|
|
@@ -2051,9 +2130,9 @@ function PoliticianCard({
|
|
|
2051
2130
|
style: styles2.image,
|
|
2052
2131
|
onError: () => setImgError(true)
|
|
2053
2132
|
}
|
|
2054
|
-
) : /* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
onCompassClick && /* @__PURE__ */
|
|
2133
|
+
) : /* @__PURE__ */ import_react7.default.createElement("div", { style: styles2.imagePlaceholder }, getInitials(name))),
|
|
2134
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { style: styles2.content }, /* @__PURE__ */ import_react7.default.createElement("h3", { style: styles2.name }, name), /* @__PURE__ */ import_react7.default.createElement("p", { style: styles2.title }, title), subtitle && /* @__PURE__ */ import_react7.default.createElement("p", { style: styles2.subtitle }, subtitle), footer && /* @__PURE__ */ import_react7.default.createElement("div", { style: { marginTop: "auto", marginLeft: "-5px" } }, footer)),
|
|
2135
|
+
onCompassClick && /* @__PURE__ */ import_react7.default.createElement(
|
|
2057
2136
|
"button",
|
|
2058
2137
|
{
|
|
2059
2138
|
type: "button",
|
|
@@ -2068,16 +2147,16 @@ function PoliticianCard({
|
|
|
2068
2147
|
},
|
|
2069
2148
|
"aria-label": `View ${name}'s compass`
|
|
2070
2149
|
},
|
|
2071
|
-
/* @__PURE__ */
|
|
2150
|
+
/* @__PURE__ */ import_react7.default.createElement(CompassIcon2, null)
|
|
2072
2151
|
)
|
|
2073
2152
|
);
|
|
2074
2153
|
}
|
|
2075
2154
|
|
|
2076
2155
|
// src/CompassCardHorizontal.jsx
|
|
2077
|
-
var
|
|
2156
|
+
var import_react13 = __toESM(require("react"));
|
|
2078
2157
|
|
|
2079
2158
|
// src/PlaceholderRadar.jsx
|
|
2080
|
-
var
|
|
2159
|
+
var import_react8 = __toESM(require("react"));
|
|
2081
2160
|
function PlaceholderRadar({ size = 250, name = "" }) {
|
|
2082
2161
|
const cx = size / 2;
|
|
2083
2162
|
const cy = size / 2;
|
|
@@ -2090,7 +2169,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2090
2169
|
const outerPts = vertices.map(([x, y]) => `${x},${y}`).join(" ");
|
|
2091
2170
|
const midPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.6},${cy + (y - cy) * 0.6}`).join(" ");
|
|
2092
2171
|
const innerPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.3},${cy + (y - cy) * 0.3}`).join(" ");
|
|
2093
|
-
return /* @__PURE__ */
|
|
2172
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
2094
2173
|
"svg",
|
|
2095
2174
|
{
|
|
2096
2175
|
width: size,
|
|
@@ -2104,7 +2183,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2104
2183
|
flexShrink: 0
|
|
2105
2184
|
}
|
|
2106
2185
|
},
|
|
2107
|
-
vertices.map(([x, y], i) => /* @__PURE__ */
|
|
2186
|
+
vertices.map(([x, y], i) => /* @__PURE__ */ import_react8.default.createElement(
|
|
2108
2187
|
"line",
|
|
2109
2188
|
{
|
|
2110
2189
|
key: i,
|
|
@@ -2118,7 +2197,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2118
2197
|
opacity: "0.6"
|
|
2119
2198
|
}
|
|
2120
2199
|
)),
|
|
2121
|
-
/* @__PURE__ */
|
|
2200
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
2122
2201
|
"polygon",
|
|
2123
2202
|
{
|
|
2124
2203
|
points: innerPts,
|
|
@@ -2129,7 +2208,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2129
2208
|
opacity: "0.5"
|
|
2130
2209
|
}
|
|
2131
2210
|
),
|
|
2132
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
2133
2212
|
"polygon",
|
|
2134
2213
|
{
|
|
2135
2214
|
points: midPts,
|
|
@@ -2140,7 +2219,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2140
2219
|
opacity: "0.6"
|
|
2141
2220
|
}
|
|
2142
2221
|
),
|
|
2143
|
-
/* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
2144
2223
|
"polygon",
|
|
2145
2224
|
{
|
|
2146
2225
|
points: outerPts,
|
|
@@ -2154,16 +2233,16 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2154
2233
|
}
|
|
2155
2234
|
|
|
2156
2235
|
// src/CompassCardHorizontalMeta.jsx
|
|
2157
|
-
var
|
|
2236
|
+
var import_react12 = __toESM(require("react"));
|
|
2158
2237
|
|
|
2159
2238
|
// src/IconOverlay.jsx
|
|
2160
|
-
var
|
|
2161
|
-
var
|
|
2239
|
+
var import_react10 = __toESM(require("react"));
|
|
2240
|
+
var import_react11 = require("@floating-ui/react");
|
|
2162
2241
|
|
|
2163
2242
|
// src/icons.js
|
|
2164
|
-
var
|
|
2243
|
+
var import_react9 = __toESM(require("react"));
|
|
2165
2244
|
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
2166
|
-
return /* @__PURE__ */
|
|
2245
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
2167
2246
|
"svg",
|
|
2168
2247
|
{
|
|
2169
2248
|
width: size,
|
|
@@ -2176,13 +2255,13 @@ function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
|
2176
2255
|
strokeLinejoin: "round",
|
|
2177
2256
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2178
2257
|
},
|
|
2179
|
-
/* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2181
|
-
/* @__PURE__ */
|
|
2258
|
+
/* @__PURE__ */ import_react9.default.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
2259
|
+
/* @__PURE__ */ import_react9.default.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
2260
|
+
/* @__PURE__ */ import_react9.default.createElement("path", { d: "M22 19H2" })
|
|
2182
2261
|
);
|
|
2183
2262
|
}
|
|
2184
2263
|
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
2185
|
-
return /* @__PURE__ */
|
|
2264
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
2186
2265
|
"svg",
|
|
2187
2266
|
{
|
|
2188
2267
|
width: size,
|
|
@@ -2195,27 +2274,27 @@ function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
|
2195
2274
|
strokeLinejoin: "round",
|
|
2196
2275
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2197
2276
|
},
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ import_react9.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2278
|
+
/* @__PURE__ */ import_react9.default.createElement("path", { d: "m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" })
|
|
2200
2279
|
);
|
|
2201
2280
|
}
|
|
2202
2281
|
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
2203
2282
|
let paths;
|
|
2204
2283
|
switch (branch) {
|
|
2205
2284
|
case "executive":
|
|
2206
|
-
paths = /* @__PURE__ */
|
|
2285
|
+
paths = /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement("path", { d: "M3 21h18" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M5 21V7l8-4v18" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M19 21V11l-6-4" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M9 9v.01" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M9 12v.01" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M9 15v.01" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M9 18v.01" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M5 21h14" }), /* @__PURE__ */ import_react9.default.createElement("line", { x1: "13", y1: "5", x2: "13", y2: "3" }), /* @__PURE__ */ import_react9.default.createElement("line", { x1: "13", y1: "3", x2: "15", y2: "4" }));
|
|
2207
2286
|
break;
|
|
2208
2287
|
case "legislative":
|
|
2209
|
-
paths = /* @__PURE__ */
|
|
2288
|
+
paths = /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement("path", { d: "M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M19 17V5a2 2 0 0 0-2-2H4" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M15 8h-5" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M15 12h-5" }));
|
|
2210
2289
|
break;
|
|
2211
2290
|
case "judicial":
|
|
2212
|
-
paths = /* @__PURE__ */
|
|
2291
|
+
paths = /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement("path", { d: "M12 3v19" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M5 8l7-5 7 5" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M3 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M17 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M8 21h8" }));
|
|
2213
2292
|
break;
|
|
2214
2293
|
default:
|
|
2215
|
-
paths = /* @__PURE__ */
|
|
2294
|
+
paths = /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement("path", { d: "M10 18v-7" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M14 18v-7" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M18 18v-7" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M3 22h18" }), /* @__PURE__ */ import_react9.default.createElement("path", { d: "M6 18v-7" }));
|
|
2216
2295
|
break;
|
|
2217
2296
|
}
|
|
2218
|
-
return /* @__PURE__ */
|
|
2297
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
2219
2298
|
"svg",
|
|
2220
2299
|
{
|
|
2221
2300
|
width: size,
|
|
@@ -2234,24 +2313,24 @@ function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
|
2234
2313
|
|
|
2235
2314
|
// src/IconOverlay.jsx
|
|
2236
2315
|
function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps = {}, onClick }) {
|
|
2237
|
-
const [isOpen, setIsOpen] = (0,
|
|
2238
|
-
const { refs, floatingStyles, context } = (0,
|
|
2316
|
+
const [isOpen, setIsOpen] = (0, import_react10.useState)(false);
|
|
2317
|
+
const { refs, floatingStyles, context } = (0, import_react11.useFloating)({
|
|
2239
2318
|
open: isOpen,
|
|
2240
2319
|
onOpenChange: setIsOpen,
|
|
2241
|
-
middleware: [(0,
|
|
2242
|
-
whileElementsMounted:
|
|
2320
|
+
middleware: [(0, import_react11.offset)(8), (0, import_react11.flip)(), (0, import_react11.shift)({ padding: 4 })],
|
|
2321
|
+
whileElementsMounted: import_react11.autoUpdate
|
|
2243
2322
|
});
|
|
2244
|
-
const hover = (0,
|
|
2245
|
-
const focus2 = (0,
|
|
2246
|
-
const dismiss = (0,
|
|
2247
|
-
const role = (0,
|
|
2248
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
2323
|
+
const hover = (0, import_react11.useHover)(context);
|
|
2324
|
+
const focus2 = (0, import_react11.useFocus)(context);
|
|
2325
|
+
const dismiss = (0, import_react11.useDismiss)(context);
|
|
2326
|
+
const role = (0, import_react11.useRole)(context, { role: "tooltip" });
|
|
2327
|
+
const { getReferenceProps, getFloatingProps } = (0, import_react11.useInteractions)([
|
|
2249
2328
|
hover,
|
|
2250
2329
|
focus2,
|
|
2251
2330
|
dismiss,
|
|
2252
2331
|
role
|
|
2253
2332
|
]);
|
|
2254
|
-
return /* @__PURE__ */
|
|
2333
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, /* @__PURE__ */ import_react10.default.createElement(
|
|
2255
2334
|
"span",
|
|
2256
2335
|
{
|
|
2257
2336
|
ref: refs.setReference,
|
|
@@ -2264,8 +2343,8 @@ function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps
|
|
|
2264
2343
|
onClick(e);
|
|
2265
2344
|
} : void 0
|
|
2266
2345
|
},
|
|
2267
|
-
/* @__PURE__ */
|
|
2268
|
-
), isOpen && /* @__PURE__ */
|
|
2346
|
+
/* @__PURE__ */ import_react10.default.createElement(IconComponent, { size, color, ...extraProps })
|
|
2347
|
+
), isOpen && /* @__PURE__ */ import_react10.default.createElement(import_react11.FloatingPortal, null, /* @__PURE__ */ import_react10.default.createElement(
|
|
2269
2348
|
"div",
|
|
2270
2349
|
{
|
|
2271
2350
|
ref: refs.setFloating,
|
|
@@ -2289,7 +2368,7 @@ function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps
|
|
|
2289
2368
|
function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
2290
2369
|
if (!ballot && !hasStances && !branch) return null;
|
|
2291
2370
|
const ballotTooltip = ballot ? `This seat is on your ballot \u2014 ${ballot.electionLabel}: ${new Date(ballot.electionDate).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })}` : null;
|
|
2292
|
-
return /* @__PURE__ */
|
|
2371
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
2293
2372
|
"div",
|
|
2294
2373
|
{
|
|
2295
2374
|
style: {
|
|
@@ -2302,7 +2381,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2302
2381
|
// offset icon wrapper padding so icons align flush-left with text
|
|
2303
2382
|
}
|
|
2304
2383
|
},
|
|
2305
|
-
ballot && /* @__PURE__ */
|
|
2384
|
+
ballot && /* @__PURE__ */ import_react10.default.createElement(
|
|
2306
2385
|
IconWithTooltip,
|
|
2307
2386
|
{
|
|
2308
2387
|
IconComponent: BallotIcon,
|
|
@@ -2311,7 +2390,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2311
2390
|
size: 14
|
|
2312
2391
|
}
|
|
2313
2392
|
),
|
|
2314
|
-
hasStances && /* @__PURE__ */
|
|
2393
|
+
hasStances && /* @__PURE__ */ import_react10.default.createElement(
|
|
2315
2394
|
IconWithTooltip,
|
|
2316
2395
|
{
|
|
2317
2396
|
IconComponent: CompassIcon,
|
|
@@ -2321,7 +2400,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2321
2400
|
onClick: onCompassClick
|
|
2322
2401
|
}
|
|
2323
2402
|
),
|
|
2324
|
-
branch && /* @__PURE__ */
|
|
2403
|
+
branch && /* @__PURE__ */ import_react10.default.createElement(
|
|
2325
2404
|
IconWithTooltip,
|
|
2326
2405
|
{
|
|
2327
2406
|
IconComponent: BranchIcon,
|
|
@@ -2341,20 +2420,20 @@ function CompassCardHorizontalMeta({
|
|
|
2341
2420
|
userAnswers
|
|
2342
2421
|
}) {
|
|
2343
2422
|
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2344
|
-
return /* @__PURE__ */
|
|
2423
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", { style: {
|
|
2345
2424
|
flex: 1,
|
|
2346
2425
|
minWidth: 0,
|
|
2347
2426
|
display: "flex",
|
|
2348
2427
|
flexDirection: "column",
|
|
2349
2428
|
gap: spacing[1]
|
|
2350
|
-
} }, /* @__PURE__ */
|
|
2429
|
+
} }, /* @__PURE__ */ import_react12.default.createElement("p", { style: {
|
|
2351
2430
|
fontFamily: fonts.primary,
|
|
2352
2431
|
fontSize: fontSizes.lg,
|
|
2353
2432
|
fontWeight: fontWeights.semibold,
|
|
2354
2433
|
lineHeight: 1.4,
|
|
2355
2434
|
color: colors.evMutedBlue,
|
|
2356
2435
|
margin: 0
|
|
2357
|
-
} }, politician.full_name), /* @__PURE__ */
|
|
2436
|
+
} }, politician.full_name), /* @__PURE__ */ import_react12.default.createElement("p", { style: {
|
|
2358
2437
|
fontFamily: fonts.primary,
|
|
2359
2438
|
fontSize: fontSizes.sm,
|
|
2360
2439
|
fontWeight: fontWeights.semibold,
|
|
@@ -2365,7 +2444,7 @@ function CompassCardHorizontalMeta({
|
|
|
2365
2444
|
display: "-webkit-box",
|
|
2366
2445
|
WebkitLineClamp: 2,
|
|
2367
2446
|
WebkitBoxOrient: "vertical"
|
|
2368
|
-
} }, titleText || ""), politician.district_label && /* @__PURE__ */
|
|
2447
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ import_react12.default.createElement("p", { style: {
|
|
2369
2448
|
fontFamily: fonts.primary,
|
|
2370
2449
|
fontSize: fontSizes.sm,
|
|
2371
2450
|
fontWeight: fontWeights.regular,
|
|
@@ -2375,7 +2454,7 @@ function CompassCardHorizontalMeta({
|
|
|
2375
2454
|
overflow: "hidden",
|
|
2376
2455
|
textOverflow: "ellipsis",
|
|
2377
2456
|
whiteSpace: "nowrap"
|
|
2378
|
-
} }, politician.district_label), /* @__PURE__ */
|
|
2457
|
+
} }, politician.district_label), /* @__PURE__ */ import_react12.default.createElement(
|
|
2379
2458
|
IconOverlay,
|
|
2380
2459
|
{
|
|
2381
2460
|
ballot: politician.ballot || null,
|
|
@@ -2424,11 +2503,11 @@ function CompassCardHorizontal({
|
|
|
2424
2503
|
onClick
|
|
2425
2504
|
}) {
|
|
2426
2505
|
var _a;
|
|
2427
|
-
const [hovered, setHovered] = (0,
|
|
2428
|
-
const [focused, setFocused] = (0,
|
|
2429
|
-
const [imgError, setImgError] = (0,
|
|
2430
|
-
const [emptyCtaHovered, setEmptyCtaHovered] = (0,
|
|
2431
|
-
(0,
|
|
2506
|
+
const [hovered, setHovered] = (0, import_react13.useState)(false);
|
|
2507
|
+
const [focused, setFocused] = (0, import_react13.useState)(false);
|
|
2508
|
+
const [imgError, setImgError] = (0, import_react13.useState)(false);
|
|
2509
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = (0, import_react13.useState)(false);
|
|
2510
|
+
(0, import_react13.useEffect)(() => {
|
|
2432
2511
|
setImgError(false);
|
|
2433
2512
|
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2434
2513
|
const cardStyle = {
|
|
@@ -2452,7 +2531,7 @@ function CompassCardHorizontal({
|
|
|
2452
2531
|
function renderCompass() {
|
|
2453
2532
|
var _a2, _b, _c;
|
|
2454
2533
|
if (!userAnswers || userAnswers.length === 0) {
|
|
2455
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ import_react13.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2456
2535
|
}
|
|
2457
2536
|
let topics = [];
|
|
2458
2537
|
let data = {};
|
|
@@ -2488,12 +2567,12 @@ function CompassCardHorizontal({
|
|
|
2488
2567
|
}, {}) : politician.stances;
|
|
2489
2568
|
}
|
|
2490
2569
|
if (topics.length === 0) {
|
|
2491
|
-
return /* @__PURE__ */
|
|
2570
|
+
return /* @__PURE__ */ import_react13.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2492
2571
|
}
|
|
2493
2572
|
} catch (err) {
|
|
2494
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ import_react13.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2495
2574
|
}
|
|
2496
|
-
return /* @__PURE__ */
|
|
2575
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2497
2576
|
RadarChartCore,
|
|
2498
2577
|
{
|
|
2499
2578
|
topics,
|
|
@@ -2515,7 +2594,7 @@ function CompassCardHorizontal({
|
|
|
2515
2594
|
var _a2, _b, _c;
|
|
2516
2595
|
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;
|
|
2517
2596
|
if (imageSrc && !imgError) {
|
|
2518
|
-
return /* @__PURE__ */
|
|
2597
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2519
2598
|
"img",
|
|
2520
2599
|
{
|
|
2521
2600
|
src: imageSrc,
|
|
@@ -2533,7 +2612,7 @@ function CompassCardHorizontal({
|
|
|
2533
2612
|
}
|
|
2534
2613
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2535
2614
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2536
|
-
return /* @__PURE__ */
|
|
2615
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { style: {
|
|
2537
2616
|
width: "100%",
|
|
2538
2617
|
height: "100%",
|
|
2539
2618
|
backgroundColor: colors.evMutedBlue,
|
|
@@ -2547,7 +2626,7 @@ function CompassCardHorizontal({
|
|
|
2547
2626
|
} }, initials);
|
|
2548
2627
|
}
|
|
2549
2628
|
function renderEmptyVariant() {
|
|
2550
|
-
return /* @__PURE__ */
|
|
2629
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { style: {
|
|
2551
2630
|
width: "100%",
|
|
2552
2631
|
height: "100%",
|
|
2553
2632
|
display: "flex",
|
|
@@ -2558,14 +2637,14 @@ function CompassCardHorizontal({
|
|
|
2558
2637
|
padding: "12px 14px",
|
|
2559
2638
|
boxSizing: "border-box",
|
|
2560
2639
|
backgroundColor: colorScales.teal["050"]
|
|
2561
|
-
} }, /* @__PURE__ */
|
|
2640
|
+
} }, /* @__PURE__ */ import_react13.default.createElement(PlaceholderRadar, { size: 140, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ import_react13.default.createElement("p", { style: {
|
|
2562
2641
|
margin: 0,
|
|
2563
2642
|
fontSize: fontSizes.xs,
|
|
2564
2643
|
color: colors.textMuted,
|
|
2565
2644
|
textAlign: "center",
|
|
2566
2645
|
lineHeight: 1.4,
|
|
2567
2646
|
fontFamily: fonts.primary
|
|
2568
|
-
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */
|
|
2647
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ import_react13.default.createElement(
|
|
2569
2648
|
"button",
|
|
2570
2649
|
{
|
|
2571
2650
|
type: "button",
|
|
@@ -2593,7 +2672,7 @@ function CompassCardHorizontal({
|
|
|
2593
2672
|
));
|
|
2594
2673
|
}
|
|
2595
2674
|
function renderUnavailablePlate(message = "Compass currently unavailable for this role.") {
|
|
2596
|
-
return /* @__PURE__ */
|
|
2675
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { style: {
|
|
2597
2676
|
width: "100%",
|
|
2598
2677
|
height: "100%",
|
|
2599
2678
|
backgroundColor: colorScales.teal["050"],
|
|
@@ -2602,7 +2681,7 @@ function CompassCardHorizontal({
|
|
|
2602
2681
|
justifyContent: "center",
|
|
2603
2682
|
padding: spacing[4],
|
|
2604
2683
|
boxSizing: "border-box"
|
|
2605
|
-
} }, /* @__PURE__ */
|
|
2684
|
+
} }, /* @__PURE__ */ import_react13.default.createElement("p", { style: {
|
|
2606
2685
|
fontSize: fontSizes.sm,
|
|
2607
2686
|
fontWeight: fontWeights.semibold,
|
|
2608
2687
|
lineHeight: 1.4,
|
|
@@ -2621,7 +2700,7 @@ function CompassCardHorizontal({
|
|
|
2621
2700
|
const name = (politician == null ? void 0 : politician.full_name) || "this official";
|
|
2622
2701
|
return renderUnavailablePlate(`No compass stances on file for ${name} yet.`);
|
|
2623
2702
|
}
|
|
2624
|
-
return /* @__PURE__ */
|
|
2703
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { style: {
|
|
2625
2704
|
width: "100%",
|
|
2626
2705
|
height: "100%",
|
|
2627
2706
|
display: "flex",
|
|
@@ -2631,7 +2710,7 @@ function CompassCardHorizontal({
|
|
|
2631
2710
|
boxSizing: "border-box"
|
|
2632
2711
|
} }, renderCompass());
|
|
2633
2712
|
}
|
|
2634
|
-
return /* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2635
2714
|
"div",
|
|
2636
2715
|
{
|
|
2637
2716
|
role: "article",
|
|
@@ -2650,7 +2729,7 @@ function CompassCardHorizontal({
|
|
|
2650
2729
|
onFocus: () => setFocused(true),
|
|
2651
2730
|
onBlur: () => setFocused(false)
|
|
2652
2731
|
},
|
|
2653
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ import_react13.default.createElement("div", { style: slotStyle }, renderSlotContent(), surface === "elections" && politician.running_unopposed && /* @__PURE__ */ import_react13.default.createElement("div", { style: {
|
|
2654
2733
|
position: "absolute",
|
|
2655
2734
|
bottom: "15px",
|
|
2656
2735
|
left: 0,
|
|
@@ -2665,7 +2744,7 @@ function CompassCardHorizontal({
|
|
|
2665
2744
|
padding: "6px 0",
|
|
2666
2745
|
pointerEvents: "none"
|
|
2667
2746
|
} }, typeof politician.running_unopposed === "string" ? politician.running_unopposed : "Running Unopposed")),
|
|
2668
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1, minWidth: 0, padding: spacing[4], paddingLeft: spacing[3] } }, /* @__PURE__ */ import_react13.default.createElement(
|
|
2669
2748
|
CompassCardHorizontalMeta,
|
|
2670
2749
|
{
|
|
2671
2750
|
politician,
|
|
@@ -2677,7 +2756,7 @@ function CompassCardHorizontal({
|
|
|
2677
2756
|
}
|
|
2678
2757
|
|
|
2679
2758
|
// src/CompassCardVertical.jsx
|
|
2680
|
-
var
|
|
2759
|
+
var import_react14 = __toESM(require("react"));
|
|
2681
2760
|
var RADAR_SIZE2 = 400;
|
|
2682
2761
|
function CompassCardVertical({
|
|
2683
2762
|
politician,
|
|
@@ -2691,11 +2770,11 @@ function CompassCardVertical({
|
|
|
2691
2770
|
onClick
|
|
2692
2771
|
}) {
|
|
2693
2772
|
var _a;
|
|
2694
|
-
const [hovered, setHovered] = (0,
|
|
2695
|
-
const [focused, setFocused] = (0,
|
|
2696
|
-
const [imgError, setImgError] = (0,
|
|
2697
|
-
const [emptyCtaHovered, setEmptyCtaHovered] = (0,
|
|
2698
|
-
(0,
|
|
2773
|
+
const [hovered, setHovered] = (0, import_react14.useState)(false);
|
|
2774
|
+
const [focused, setFocused] = (0, import_react14.useState)(false);
|
|
2775
|
+
const [imgError, setImgError] = (0, import_react14.useState)(false);
|
|
2776
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = (0, import_react14.useState)(false);
|
|
2777
|
+
(0, import_react14.useEffect)(() => {
|
|
2699
2778
|
setImgError(false);
|
|
2700
2779
|
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2701
2780
|
const cardStyle = {
|
|
@@ -2718,7 +2797,7 @@ function CompassCardVertical({
|
|
|
2718
2797
|
function renderCompass() {
|
|
2719
2798
|
var _a2, _b, _c;
|
|
2720
2799
|
if (!userAnswers || userAnswers.length === 0) {
|
|
2721
|
-
return /* @__PURE__ */
|
|
2800
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2722
2801
|
}
|
|
2723
2802
|
let topics = [];
|
|
2724
2803
|
let data = {};
|
|
@@ -2754,17 +2833,17 @@ function CompassCardVertical({
|
|
|
2754
2833
|
}, {}) : politician.stances;
|
|
2755
2834
|
}
|
|
2756
2835
|
if (topics.length === 0) {
|
|
2757
|
-
return /* @__PURE__ */
|
|
2836
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2758
2837
|
}
|
|
2759
2838
|
} catch {
|
|
2760
|
-
return /* @__PURE__ */
|
|
2839
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2761
2840
|
}
|
|
2762
2841
|
const unansweredSpokes = {};
|
|
2763
2842
|
for (const t of topics) {
|
|
2764
2843
|
const v = compareData[t.short_title];
|
|
2765
2844
|
if (!v || Number(v) === 0) unansweredSpokes[t.short_title] = true;
|
|
2766
2845
|
}
|
|
2767
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: { width: RADAR_SIZE2 + 240, maxWidth: "100%", flexShrink: 0 } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2768
2847
|
RadarChartCore,
|
|
2769
2848
|
{
|
|
2770
2849
|
topics,
|
|
@@ -2799,7 +2878,7 @@ function CompassCardVertical({
|
|
|
2799
2878
|
justifyContent: "center"
|
|
2800
2879
|
};
|
|
2801
2880
|
if (imageSrc && !imgError) {
|
|
2802
|
-
return /* @__PURE__ */
|
|
2881
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2803
2882
|
"img",
|
|
2804
2883
|
{
|
|
2805
2884
|
src: imageSrc,
|
|
@@ -2817,7 +2896,7 @@ function CompassCardVertical({
|
|
|
2817
2896
|
}
|
|
2818
2897
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2819
2898
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2820
|
-
return /* @__PURE__ */
|
|
2899
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react14.default.createElement("span", { style: {
|
|
2821
2900
|
color: colors.textWhite,
|
|
2822
2901
|
fontFamily: fonts.primary,
|
|
2823
2902
|
fontWeight: fontWeights.bold,
|
|
@@ -2828,7 +2907,7 @@ function CompassCardVertical({
|
|
|
2828
2907
|
var _a2, _b, _c;
|
|
2829
2908
|
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;
|
|
2830
2909
|
if (imageSrc && !imgError) {
|
|
2831
|
-
return /* @__PURE__ */
|
|
2910
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
2832
2911
|
"img",
|
|
2833
2912
|
{
|
|
2834
2913
|
src: imageSrc,
|
|
@@ -2847,7 +2926,7 @@ function CompassCardVertical({
|
|
|
2847
2926
|
}
|
|
2848
2927
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2849
2928
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2850
|
-
return /* @__PURE__ */
|
|
2929
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2851
2930
|
width: RADAR_SIZE2,
|
|
2852
2931
|
height: RADAR_SIZE2,
|
|
2853
2932
|
backgroundColor: colors.evMutedBlue,
|
|
@@ -2862,7 +2941,7 @@ function CompassCardVertical({
|
|
|
2862
2941
|
} }, initials);
|
|
2863
2942
|
}
|
|
2864
2943
|
function renderEmptyVariant() {
|
|
2865
|
-
return /* @__PURE__ */
|
|
2944
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2866
2945
|
width: "100%",
|
|
2867
2946
|
height: "100%",
|
|
2868
2947
|
flex: 1,
|
|
@@ -2875,14 +2954,14 @@ function CompassCardVertical({
|
|
|
2875
2954
|
boxSizing: "border-box",
|
|
2876
2955
|
backgroundColor: colorScales.teal["050"],
|
|
2877
2956
|
borderRadius: borderRadius.md
|
|
2878
|
-
} }, /* @__PURE__ */
|
|
2957
|
+
} }, /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: 220, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2879
2958
|
margin: 0,
|
|
2880
2959
|
fontSize: fontSizes.sm,
|
|
2881
2960
|
color: colors.textMuted,
|
|
2882
2961
|
textAlign: "center",
|
|
2883
2962
|
lineHeight: 1.4,
|
|
2884
2963
|
fontFamily: fonts.primary
|
|
2885
|
-
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */
|
|
2964
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ import_react14.default.createElement(
|
|
2886
2965
|
"button",
|
|
2887
2966
|
{
|
|
2888
2967
|
type: "button",
|
|
@@ -2908,7 +2987,7 @@ function CompassCardVertical({
|
|
|
2908
2987
|
));
|
|
2909
2988
|
}
|
|
2910
2989
|
function renderUnavailablePlate(message) {
|
|
2911
|
-
return /* @__PURE__ */
|
|
2990
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2912
2991
|
width: "100%",
|
|
2913
2992
|
height: "100%",
|
|
2914
2993
|
flex: 1,
|
|
@@ -2919,7 +2998,7 @@ function CompassCardVertical({
|
|
|
2919
2998
|
justifyContent: "center",
|
|
2920
2999
|
padding: spacing[6],
|
|
2921
3000
|
boxSizing: "border-box"
|
|
2922
|
-
} }, /* @__PURE__ */
|
|
3001
|
+
} }, /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2923
3002
|
fontSize: fontSizes.base,
|
|
2924
3003
|
fontWeight: fontWeights.semibold,
|
|
2925
3004
|
lineHeight: 1.4,
|
|
@@ -2940,7 +3019,7 @@ function CompassCardVertical({
|
|
|
2940
3019
|
}
|
|
2941
3020
|
return renderCompass();
|
|
2942
3021
|
}
|
|
2943
|
-
return /* @__PURE__ */
|
|
3022
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
2944
3023
|
"div",
|
|
2945
3024
|
{
|
|
2946
3025
|
role: "article",
|
|
@@ -2959,21 +3038,21 @@ function CompassCardVertical({
|
|
|
2959
3038
|
onFocus: () => setFocused(true),
|
|
2960
3039
|
onBlur: () => setFocused(false)
|
|
2961
3040
|
},
|
|
2962
|
-
/* @__PURE__ */
|
|
3041
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { style: { padding: spacing[4], paddingBottom: spacing[3], display: "flex", alignItems: "stretch", gap: spacing[3], flexShrink: 0 } }, renderAvatar(), /* @__PURE__ */ import_react14.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: spacing[1], minWidth: 0, flex: 1 } }, /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2963
3042
|
fontFamily: fonts.primary,
|
|
2964
3043
|
fontSize: fontSizes.xl,
|
|
2965
3044
|
fontWeight: fontWeights.semibold,
|
|
2966
3045
|
lineHeight: 1.3,
|
|
2967
3046
|
color: colors.evMutedBlue,
|
|
2968
3047
|
margin: 0
|
|
2969
|
-
} }, politician.full_name), /* @__PURE__ */
|
|
3048
|
+
} }, politician.full_name), /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2970
3049
|
fontFamily: fonts.primary,
|
|
2971
3050
|
fontSize: fontSizes.sm,
|
|
2972
3051
|
fontWeight: fontWeights.semibold,
|
|
2973
3052
|
lineHeight: 1.4,
|
|
2974
3053
|
color: colors.textSecondary,
|
|
2975
3054
|
margin: 0
|
|
2976
|
-
} }, titleText || ""), politician.district_label && /* @__PURE__ */
|
|
3055
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2977
3056
|
fontFamily: fonts.primary,
|
|
2978
3057
|
fontSize: fontSizes.sm,
|
|
2979
3058
|
fontWeight: fontWeights.regular,
|
|
@@ -2983,7 +3062,7 @@ function CompassCardVertical({
|
|
|
2983
3062
|
overflow: "hidden",
|
|
2984
3063
|
textOverflow: "ellipsis",
|
|
2985
3064
|
whiteSpace: "nowrap"
|
|
2986
|
-
} }, politician.district_label), /* @__PURE__ */
|
|
3065
|
+
} }, politician.district_label), /* @__PURE__ */ import_react14.default.createElement("div", { style: { marginTop: "auto" } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2987
3066
|
IconOverlay,
|
|
2988
3067
|
{
|
|
2989
3068
|
ballot: politician.ballot || null,
|
|
@@ -2991,7 +3070,7 @@ function CompassCardVertical({
|
|
|
2991
3070
|
branch: politician.branch || null
|
|
2992
3071
|
}
|
|
2993
3072
|
)))),
|
|
2994
|
-
surface === "elections" && politician.withdrawn && /* @__PURE__ */
|
|
3073
|
+
surface === "elections" && politician.withdrawn && /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2995
3074
|
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
2996
3075
|
backgroundColor: "rgba(120,0,0,0.85)",
|
|
2997
3076
|
color: "#fff",
|
|
@@ -3003,7 +3082,7 @@ function CompassCardVertical({
|
|
|
3003
3082
|
padding: "6px 0",
|
|
3004
3083
|
borderRadius: borderRadius.sm
|
|
3005
3084
|
} }, "Withdrawn"),
|
|
3006
|
-
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */
|
|
3085
|
+
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
3007
3086
|
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
3008
3087
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
3009
3088
|
color: "#fff",
|
|
@@ -3015,7 +3094,7 @@ function CompassCardVertical({
|
|
|
3015
3094
|
padding: "6px 0",
|
|
3016
3095
|
borderRadius: borderRadius.sm
|
|
3017
3096
|
} }, typeof politician.running_unopposed === "string" ? politician.running_unopposed : "Running Unopposed"),
|
|
3018
|
-
/* @__PURE__ */
|
|
3097
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
3019
3098
|
flex: 1,
|
|
3020
3099
|
padding: spacing[4],
|
|
3021
3100
|
paddingTop: 0,
|
|
@@ -3029,7 +3108,7 @@ function CompassCardVertical({
|
|
|
3029
3108
|
}
|
|
3030
3109
|
|
|
3031
3110
|
// src/CompassKey.jsx
|
|
3032
|
-
var
|
|
3111
|
+
var import_react15 = __toESM(require("react"));
|
|
3033
3112
|
|
|
3034
3113
|
// src/evContext.js
|
|
3035
3114
|
var DEFAULT_BROKER_URL = "https://ev-context.empowered.vote/";
|
|
@@ -3274,9 +3353,9 @@ var evContext = {
|
|
|
3274
3353
|
|
|
3275
3354
|
// src/CompassKey.jsx
|
|
3276
3355
|
function CompassKey({ compact = false } = {}) {
|
|
3277
|
-
const [dismissed, setDismissed] = (0,
|
|
3278
|
-
const [loaded, setLoaded] = (0,
|
|
3279
|
-
(0,
|
|
3356
|
+
const [dismissed, setDismissed] = (0, import_react15.useState)(false);
|
|
3357
|
+
const [loaded, setLoaded] = (0, import_react15.useState)(false);
|
|
3358
|
+
(0, import_react15.useEffect)(() => {
|
|
3280
3359
|
let cancelled = false;
|
|
3281
3360
|
evContext.get().then((shared) => {
|
|
3282
3361
|
if (cancelled) return;
|
|
@@ -3306,7 +3385,7 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3306
3385
|
persistDismissed(false);
|
|
3307
3386
|
}
|
|
3308
3387
|
if (!loaded) return null;
|
|
3309
|
-
const Swatch = ({ color, label, ring }) => /* @__PURE__ */
|
|
3388
|
+
const Swatch = ({ color, label, ring }) => /* @__PURE__ */ import_react15.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3310
3389
|
display: "inline-block",
|
|
3311
3390
|
width: 12,
|
|
3312
3391
|
height: 12,
|
|
@@ -3314,9 +3393,9 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3314
3393
|
background: color,
|
|
3315
3394
|
border: `2px solid ${ring || "#fff"}`,
|
|
3316
3395
|
boxShadow: "0 0 0 1px rgba(0,0,0,0.08)"
|
|
3317
|
-
} }), /* @__PURE__ */
|
|
3396
|
+
} }), /* @__PURE__ */ import_react15.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, label));
|
|
3318
3397
|
if (dismissed) {
|
|
3319
|
-
return /* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
3320
3399
|
"button",
|
|
3321
3400
|
{
|
|
3322
3401
|
type: "button",
|
|
@@ -3337,11 +3416,11 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3337
3416
|
cursor: "pointer"
|
|
3338
3417
|
}
|
|
3339
3418
|
},
|
|
3340
|
-
/* @__PURE__ */
|
|
3419
|
+
/* @__PURE__ */ import_react15.default.createElement("span", { "aria-hidden": "true" }, "?"),
|
|
3341
3420
|
" Compass key"
|
|
3342
3421
|
);
|
|
3343
3422
|
}
|
|
3344
|
-
return /* @__PURE__ */
|
|
3423
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
3345
3424
|
"div",
|
|
3346
3425
|
{
|
|
3347
3426
|
role: "region",
|
|
@@ -3360,17 +3439,17 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3360
3439
|
boxSizing: "border-box"
|
|
3361
3440
|
}
|
|
3362
3441
|
},
|
|
3363
|
-
!compact && /* @__PURE__ */
|
|
3442
|
+
!compact && /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3364
3443
|
fontSize: fontSizes.xs,
|
|
3365
3444
|
fontWeight: fontWeights.semibold,
|
|
3366
3445
|
color: colors.textMuted,
|
|
3367
3446
|
textTransform: "uppercase",
|
|
3368
3447
|
letterSpacing: "0.5px"
|
|
3369
3448
|
} }, "Compass key"),
|
|
3370
|
-
/* @__PURE__ */
|
|
3371
|
-
/* @__PURE__ */
|
|
3372
|
-
/* @__PURE__ */
|
|
3373
|
-
/* @__PURE__ */
|
|
3449
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#7C6B9E", label: "You" }),
|
|
3450
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#5A9A6E", label: "Politician" }),
|
|
3451
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#fed12e", label: "Match" }),
|
|
3452
|
+
/* @__PURE__ */ import_react15.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3374
3453
|
fontSize: fontSizes.xs,
|
|
3375
3454
|
fontWeight: fontWeights.semibold,
|
|
3376
3455
|
color: "#9ca3af",
|
|
@@ -3378,8 +3457,8 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3378
3457
|
textDecoration: "underline",
|
|
3379
3458
|
textDecorationStyle: "dashed",
|
|
3380
3459
|
textUnderlineOffset: "3px"
|
|
3381
|
-
} }, "Topic"), /* @__PURE__ */
|
|
3382
|
-
/* @__PURE__ */
|
|
3460
|
+
} }, "Topic"), /* @__PURE__ */ import_react15.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, "= no stance")),
|
|
3461
|
+
/* @__PURE__ */ import_react15.default.createElement(
|
|
3383
3462
|
"button",
|
|
3384
3463
|
{
|
|
3385
3464
|
type: "button",
|
|
@@ -3402,7 +3481,7 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3402
3481
|
}
|
|
3403
3482
|
|
|
3404
3483
|
// src/CategorySection.jsx
|
|
3405
|
-
var
|
|
3484
|
+
var import_react16 = __toESM(require("react"));
|
|
3406
3485
|
function CategorySection({
|
|
3407
3486
|
title,
|
|
3408
3487
|
infoTooltip,
|
|
@@ -3412,7 +3491,7 @@ function CategorySection({
|
|
|
3412
3491
|
tier
|
|
3413
3492
|
}) {
|
|
3414
3493
|
var _a, _b;
|
|
3415
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3494
|
+
const [showTooltip, setShowTooltip] = (0, import_react16.useState)(false);
|
|
3416
3495
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
3417
3496
|
const styles2 = {
|
|
3418
3497
|
section: {
|
|
@@ -3480,7 +3559,7 @@ function CategorySection({
|
|
|
3480
3559
|
gap: spacing[4]
|
|
3481
3560
|
}
|
|
3482
3561
|
};
|
|
3483
|
-
return /* @__PURE__ */
|
|
3562
|
+
return /* @__PURE__ */ import_react16.default.createElement("section", { style: styles2.section, className: "ev-category-section" }, /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react16.default.createElement("span", { style: styles2.titlePill }, title), infoTooltip && /* @__PURE__ */ import_react16.default.createElement(
|
|
3484
3563
|
"button",
|
|
3485
3564
|
{
|
|
3486
3565
|
type: "button",
|
|
@@ -3492,8 +3571,8 @@ function CategorySection({
|
|
|
3492
3571
|
"aria-label": `Info about ${title}`
|
|
3493
3572
|
},
|
|
3494
3573
|
"i",
|
|
3495
|
-
showTooltip && /* @__PURE__ */
|
|
3496
|
-
), websiteUrl && /* @__PURE__ */
|
|
3574
|
+
showTooltip && /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
3575
|
+
), websiteUrl && /* @__PURE__ */ import_react16.default.createElement(
|
|
3497
3576
|
"a",
|
|
3498
3577
|
{
|
|
3499
3578
|
href: websiteUrl,
|
|
@@ -3502,7 +3581,7 @@ function CategorySection({
|
|
|
3502
3581
|
style: styles2.externalLink,
|
|
3503
3582
|
"aria-label": `Visit official website for ${title}`
|
|
3504
3583
|
},
|
|
3505
|
-
/* @__PURE__ */
|
|
3584
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
3506
3585
|
"svg",
|
|
3507
3586
|
{
|
|
3508
3587
|
viewBox: "0 0 24 24",
|
|
@@ -3510,7 +3589,7 @@ function CategorySection({
|
|
|
3510
3589
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3511
3590
|
style: { width: "14px", height: "14px" }
|
|
3512
3591
|
},
|
|
3513
|
-
/* @__PURE__ */
|
|
3592
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
3514
3593
|
"path",
|
|
3515
3594
|
{
|
|
3516
3595
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -3521,11 +3600,11 @@ function CategorySection({
|
|
|
3521
3600
|
}
|
|
3522
3601
|
)
|
|
3523
3602
|
)
|
|
3524
|
-
)), /* @__PURE__ */
|
|
3603
|
+
)), /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
3525
3604
|
}
|
|
3526
3605
|
|
|
3527
3606
|
// src/SubGroupSection.jsx
|
|
3528
|
-
var
|
|
3607
|
+
var import_react17 = __toESM(require("react"));
|
|
3529
3608
|
function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap, justifyContent }) {
|
|
3530
3609
|
const styles2 = {
|
|
3531
3610
|
section: {
|
|
@@ -3560,7 +3639,7 @@ function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap
|
|
|
3560
3639
|
width: "100%"
|
|
3561
3640
|
}
|
|
3562
3641
|
};
|
|
3563
|
-
return /* @__PURE__ */
|
|
3642
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.section }, title && /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react17.default.createElement("span", { style: styles2.label }, title), websiteUrl && /* @__PURE__ */ import_react17.default.createElement(
|
|
3564
3643
|
"a",
|
|
3565
3644
|
{
|
|
3566
3645
|
href: websiteUrl,
|
|
@@ -3568,12 +3647,12 @@ function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap
|
|
|
3568
3647
|
rel: "noopener noreferrer",
|
|
3569
3648
|
style: styles2.link
|
|
3570
3649
|
},
|
|
3571
|
-
/* @__PURE__ */
|
|
3572
|
-
)), /* @__PURE__ */
|
|
3650
|
+
/* @__PURE__ */ import_react17.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "12px", height: "12px" } }, /* @__PURE__ */ import_react17.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react17.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z", stroke: "currentColor", strokeWidth: "2" }))
|
|
3651
|
+
)), /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
3573
3652
|
}
|
|
3574
3653
|
|
|
3575
3654
|
// src/GovernmentBodySection.jsx
|
|
3576
|
-
var
|
|
3655
|
+
var import_react18 = __toESM(require("react"));
|
|
3577
3656
|
function GovernmentBodySection({
|
|
3578
3657
|
title,
|
|
3579
3658
|
websiteUrl,
|
|
@@ -3582,7 +3661,7 @@ function GovernmentBodySection({
|
|
|
3582
3661
|
children
|
|
3583
3662
|
}) {
|
|
3584
3663
|
var _a;
|
|
3585
|
-
const [expanded, setExpanded] = (0,
|
|
3664
|
+
const [expanded, setExpanded] = (0, import_react18.useState)(defaultExpanded);
|
|
3586
3665
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
3587
3666
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
3588
3667
|
const styles2 = {
|
|
@@ -3622,7 +3701,7 @@ function GovernmentBodySection({
|
|
|
3622
3701
|
display: expanded ? "block" : "none"
|
|
3623
3702
|
}
|
|
3624
3703
|
};
|
|
3625
|
-
return /* @__PURE__ */
|
|
3704
|
+
return /* @__PURE__ */ import_react18.default.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ import_react18.default.createElement(
|
|
3626
3705
|
"div",
|
|
3627
3706
|
{
|
|
3628
3707
|
style: styles2.header,
|
|
@@ -3638,8 +3717,8 @@ function GovernmentBodySection({
|
|
|
3638
3717
|
"aria-expanded": expanded,
|
|
3639
3718
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
3640
3719
|
},
|
|
3641
|
-
/* @__PURE__ */
|
|
3642
|
-
websiteUrl && /* @__PURE__ */
|
|
3720
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { style: styles2.title }, title),
|
|
3721
|
+
websiteUrl && /* @__PURE__ */ import_react18.default.createElement(
|
|
3643
3722
|
"a",
|
|
3644
3723
|
{
|
|
3645
3724
|
href: websiteUrl,
|
|
@@ -3649,14 +3728,14 @@ function GovernmentBodySection({
|
|
|
3649
3728
|
onClick: (e) => e.stopPropagation(),
|
|
3650
3729
|
"aria-label": `Visit ${title} website`
|
|
3651
3730
|
},
|
|
3652
|
-
/* @__PURE__ */
|
|
3731
|
+
/* @__PURE__ */ import_react18.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "14px", height: "14px" } }, /* @__PURE__ */ import_react18.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react18.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z", stroke: "currentColor", strokeWidth: "2" }))
|
|
3653
3732
|
),
|
|
3654
|
-
/* @__PURE__ */
|
|
3655
|
-
), /* @__PURE__ */
|
|
3733
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
3734
|
+
), /* @__PURE__ */ import_react18.default.createElement("div", { style: styles2.content }, children));
|
|
3656
3735
|
}
|
|
3657
3736
|
|
|
3658
3737
|
// src/SocialLinks.jsx
|
|
3659
|
-
var
|
|
3738
|
+
var import_react19 = __toESM(require("react"));
|
|
3660
3739
|
var SOCIAL_PLATFORMS = [
|
|
3661
3740
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
3662
3741
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -3728,7 +3807,7 @@ function SocialLinks({
|
|
|
3728
3807
|
}
|
|
3729
3808
|
};
|
|
3730
3809
|
const platformIconMap = {
|
|
3731
|
-
twitter: /* @__PURE__ */
|
|
3810
|
+
twitter: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
3732
3811
|
"path",
|
|
3733
3812
|
{
|
|
3734
3813
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -3738,7 +3817,7 @@ function SocialLinks({
|
|
|
3738
3817
|
strokeLinejoin: "round"
|
|
3739
3818
|
}
|
|
3740
3819
|
)),
|
|
3741
|
-
facebook: /* @__PURE__ */
|
|
3820
|
+
facebook: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
3742
3821
|
"path",
|
|
3743
3822
|
{
|
|
3744
3823
|
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",
|
|
@@ -3748,8 +3827,8 @@ function SocialLinks({
|
|
|
3748
3827
|
strokeLinejoin: "round"
|
|
3749
3828
|
}
|
|
3750
3829
|
)),
|
|
3751
|
-
instagram: /* @__PURE__ */
|
|
3752
|
-
linkedin: /* @__PURE__ */
|
|
3830
|
+
instagram: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "18", cy: "6", r: "1", fill: "currentColor" })),
|
|
3831
|
+
linkedin: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
3753
3832
|
"path",
|
|
3754
3833
|
{
|
|
3755
3834
|
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",
|
|
@@ -3758,8 +3837,8 @@ function SocialLinks({
|
|
|
3758
3837
|
strokeLinecap: "round",
|
|
3759
3838
|
strokeLinejoin: "round"
|
|
3760
3839
|
}
|
|
3761
|
-
), /* @__PURE__ */
|
|
3762
|
-
youtube: /* @__PURE__ */
|
|
3840
|
+
), /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "9", width: "4", height: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "4", cy: "4", r: "2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
3841
|
+
youtube: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "5", width: "20", height: "14", rx: "3", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("polygon", { points: "10,9 16,12 10,15", fill: "currentColor" }))
|
|
3763
3842
|
};
|
|
3764
3843
|
const links = [
|
|
3765
3844
|
{
|
|
@@ -3785,7 +3864,7 @@ function SocialLinks({
|
|
|
3785
3864
|
{
|
|
3786
3865
|
href: website,
|
|
3787
3866
|
label: "Website",
|
|
3788
|
-
icon: /* @__PURE__ */
|
|
3867
|
+
icon: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement(
|
|
3789
3868
|
"path",
|
|
3790
3869
|
{
|
|
3791
3870
|
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",
|
|
@@ -3815,7 +3894,7 @@ function SocialLinks({
|
|
|
3815
3894
|
if (links.length === 0) {
|
|
3816
3895
|
return null;
|
|
3817
3896
|
}
|
|
3818
|
-
return /* @__PURE__ */
|
|
3897
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ import_react19.default.createElement(
|
|
3819
3898
|
"a",
|
|
3820
3899
|
{
|
|
3821
3900
|
key: link.label,
|
|
@@ -3838,7 +3917,7 @@ function SocialLinks({
|
|
|
3838
3917
|
}
|
|
3839
3918
|
|
|
3840
3919
|
// src/IssueTags.jsx
|
|
3841
|
-
var
|
|
3920
|
+
var import_react20 = __toESM(require("react"));
|
|
3842
3921
|
function IssueTags({
|
|
3843
3922
|
tags = [],
|
|
3844
3923
|
selectedTags = [],
|
|
@@ -3881,9 +3960,9 @@ function IssueTags({
|
|
|
3881
3960
|
onTagClick(tag.value);
|
|
3882
3961
|
}
|
|
3883
3962
|
};
|
|
3884
|
-
return /* @__PURE__ */
|
|
3963
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
3885
3964
|
const isSelected = selectedTags.includes(tag.value);
|
|
3886
|
-
return /* @__PURE__ */
|
|
3965
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
3887
3966
|
"span",
|
|
3888
3967
|
{
|
|
3889
3968
|
key: tag.value,
|
|
@@ -3912,7 +3991,7 @@ function IssueTags({
|
|
|
3912
3991
|
}
|
|
3913
3992
|
|
|
3914
3993
|
// src/CommitteeTable.jsx
|
|
3915
|
-
var
|
|
3994
|
+
var import_react21 = __toESM(require("react"));
|
|
3916
3995
|
var ROLE_ORDER = {
|
|
3917
3996
|
"chair": 0,
|
|
3918
3997
|
"co-chair": 1,
|
|
@@ -3937,9 +4016,10 @@ function CommitteeTable({
|
|
|
3937
4016
|
committees = [],
|
|
3938
4017
|
title = "Committee Memberships",
|
|
3939
4018
|
maxVisible = 6,
|
|
3940
|
-
style = {}
|
|
4019
|
+
style = {},
|
|
4020
|
+
darkMode = false
|
|
3941
4021
|
}) {
|
|
3942
|
-
const [showAll, setShowAll] = (0,
|
|
4022
|
+
const [showAll, setShowAll] = (0, import_react21.useState)(false);
|
|
3943
4023
|
if (committees.length === 0) {
|
|
3944
4024
|
return null;
|
|
3945
4025
|
}
|
|
@@ -3957,7 +4037,7 @@ function CommitteeTable({
|
|
|
3957
4037
|
fontFamily: fonts.primary,
|
|
3958
4038
|
fontWeight: fontWeights.semibold,
|
|
3959
4039
|
fontSize: "18px",
|
|
3960
|
-
color: "#101828",
|
|
4040
|
+
color: darkMode ? "#f3f4f6" : "#101828",
|
|
3961
4041
|
margin: 0,
|
|
3962
4042
|
marginBottom: spacing[3]
|
|
3963
4043
|
},
|
|
@@ -3966,7 +4046,7 @@ function CommitteeTable({
|
|
|
3966
4046
|
borderCollapse: "collapse"
|
|
3967
4047
|
},
|
|
3968
4048
|
row: {
|
|
3969
|
-
borderBottom:
|
|
4049
|
+
borderBottom: `1px solid ${darkMode ? "#374151" : "#F3F4F6"}`
|
|
3970
4050
|
},
|
|
3971
4051
|
cell: {
|
|
3972
4052
|
padding: `${spacing[2]} 0`,
|
|
@@ -3975,16 +4055,16 @@ function CommitteeTable({
|
|
|
3975
4055
|
verticalAlign: "top"
|
|
3976
4056
|
},
|
|
3977
4057
|
nameCell: {
|
|
3978
|
-
color: "#364153",
|
|
4058
|
+
color: darkMode ? "#d1d5db" : "#364153",
|
|
3979
4059
|
paddingRight: spacing[4]
|
|
3980
4060
|
},
|
|
3981
4061
|
positionCell: {
|
|
3982
|
-
color: "#6A7282",
|
|
4062
|
+
color: darkMode ? "#9ca3af" : "#6A7282",
|
|
3983
4063
|
textAlign: "right",
|
|
3984
4064
|
whiteSpace: "nowrap"
|
|
3985
4065
|
},
|
|
3986
4066
|
link: {
|
|
3987
|
-
color: "#364153",
|
|
4067
|
+
color: darkMode ? "#d1d5db" : "#364153",
|
|
3988
4068
|
textDecoration: "none"
|
|
3989
4069
|
},
|
|
3990
4070
|
toggle: {
|
|
@@ -3994,14 +4074,14 @@ function CommitteeTable({
|
|
|
3994
4074
|
fontFamily: fonts.primary,
|
|
3995
4075
|
fontSize: "14px",
|
|
3996
4076
|
fontWeight: fontWeights.medium,
|
|
3997
|
-
color: "#6A7282",
|
|
4077
|
+
color: darkMode ? "#9ca3af" : "#6A7282",
|
|
3998
4078
|
background: "none",
|
|
3999
4079
|
border: "none",
|
|
4000
4080
|
padding: `${spacing[2]} 0`,
|
|
4001
4081
|
cursor: "pointer"
|
|
4002
4082
|
}
|
|
4003
4083
|
};
|
|
4004
|
-
return /* @__PURE__ */
|
|
4084
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", { style: styles2.container, className: "ev-committee-table" }, /* @__PURE__ */ import_react21.default.createElement("h4", { style: styles2.heading }, /* @__PURE__ */ import_react21.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react21.default.createElement("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /* @__PURE__ */ import_react21.default.createElement("circle", { cx: "9", cy: "7", r: "4" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" })), title), /* @__PURE__ */ import_react21.default.createElement("table", { style: styles2.table }, /* @__PURE__ */ import_react21.default.createElement("tbody", null, visible.map((committee, index) => /* @__PURE__ */ import_react21.default.createElement("tr", { key: index, style: styles2.row }, /* @__PURE__ */ import_react21.default.createElement("td", { style: { ...styles2.cell, ...styles2.nameCell } }, committee.url ? /* @__PURE__ */ import_react21.default.createElement(
|
|
4005
4085
|
"a",
|
|
4006
4086
|
{
|
|
4007
4087
|
href: committee.url,
|
|
@@ -4016,7 +4096,7 @@ function CommitteeTable({
|
|
|
4016
4096
|
}
|
|
4017
4097
|
},
|
|
4018
4098
|
committee.name
|
|
4019
|
-
) : committee.name), /* @__PURE__ */
|
|
4099
|
+
) : committee.name), /* @__PURE__ */ import_react21.default.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ import_react21.default.createElement(
|
|
4020
4100
|
"button",
|
|
4021
4101
|
{
|
|
4022
4102
|
type: "button",
|
|
@@ -4024,7 +4104,7 @@ function CommitteeTable({
|
|
|
4024
4104
|
onClick: () => setShowAll(!showAll)
|
|
4025
4105
|
},
|
|
4026
4106
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
4027
|
-
/* @__PURE__ */
|
|
4107
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
4028
4108
|
"svg",
|
|
4029
4109
|
{
|
|
4030
4110
|
width: "14",
|
|
@@ -4037,16 +4117,16 @@ function CommitteeTable({
|
|
|
4037
4117
|
strokeLinejoin: "round",
|
|
4038
4118
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
4039
4119
|
},
|
|
4040
|
-
/* @__PURE__ */
|
|
4120
|
+
/* @__PURE__ */ import_react21.default.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
4041
4121
|
)
|
|
4042
4122
|
));
|
|
4043
4123
|
}
|
|
4044
4124
|
|
|
4045
4125
|
// src/PoliticianProfile.jsx
|
|
4046
|
-
var
|
|
4126
|
+
var import_react24 = __toESM(require("react"));
|
|
4047
4127
|
|
|
4048
4128
|
// src/LegislativeInlineSummary.jsx
|
|
4049
|
-
var
|
|
4129
|
+
var import_react22 = __toESM(require("react"));
|
|
4050
4130
|
function normalizePosition(pos) {
|
|
4051
4131
|
if (!pos) return "";
|
|
4052
4132
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -4154,7 +4234,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
4154
4234
|
fontSize: fontSizes.sm,
|
|
4155
4235
|
fontWeight: fontWeights.medium
|
|
4156
4236
|
};
|
|
4157
|
-
return /* @__PURE__ */
|
|
4237
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { style: card }, stats.length > 0 && /* @__PURE__ */ import_react22.default.createElement("div", { style: statsRow }, stats.map((s, i) => /* @__PURE__ */ import_react22.default.createElement("div", { key: i, style: statItem }, /* @__PURE__ */ import_react22.default.createElement("span", { style: statValue }, s.value), s.label && /* @__PURE__ */ import_react22.default.createElement("span", { style: statLabel }, s.label)))), mostRecentAction && /* @__PURE__ */ import_react22.default.createElement("div", { style: actionLine, title: mostRecentAction }, mostRecentAction), /* @__PURE__ */ import_react22.default.createElement("div", null), /* @__PURE__ */ import_react22.default.createElement("div", { style: footerRow }, /* @__PURE__ */ import_react22.default.createElement(
|
|
4158
4238
|
"button",
|
|
4159
4239
|
{
|
|
4160
4240
|
onClick: () => {
|
|
@@ -4179,12 +4259,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
4179
4259
|
}
|
|
4180
4260
|
},
|
|
4181
4261
|
"View Full Legislative Record",
|
|
4182
|
-
/* @__PURE__ */
|
|
4262
|
+
/* @__PURE__ */ import_react22.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ import_react22.default.createElement("path", { d: "M9 18l6-6-6-6" }))
|
|
4183
4263
|
)));
|
|
4184
4264
|
}
|
|
4185
4265
|
|
|
4186
4266
|
// src/JudicialScorecard.jsx
|
|
4187
|
-
var
|
|
4267
|
+
var import_react23 = __toESM(require("react"));
|
|
4188
4268
|
|
|
4189
4269
|
// src/judicialUtils.js
|
|
4190
4270
|
function formatDate(dateStr) {
|
|
@@ -4302,7 +4382,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
4302
4382
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
4303
4383
|
}
|
|
4304
4384
|
};
|
|
4305
|
-
return /* @__PURE__ */
|
|
4385
|
+
return /* @__PURE__ */ import_react23.default.createElement("section", { style: sectionStyle }, /* @__PURE__ */ import_react23.default.createElement("h3", { style: headingStyle }, "Judicial Record"), evaluations.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginBottom: "16px" } }, evaluations.slice(0, 3).map((ev, i) => /* @__PURE__ */ import_react23.default.createElement("span", { key: i, style: evalChipStyle }, ev.rating, /* @__PURE__ */ import_react23.default.createElement("span", { style: { fontWeight: 400, color: "#4a90a4", fontSize: "11px" } }, "\u2014 ", ev.source)))), metrics.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: cardGridStyle }, metrics.slice(0, 4).map((m, i) => /* @__PURE__ */ import_react23.default.createElement("div", { key: i, style: metricCardStyle }, /* @__PURE__ */ import_react23.default.createElement("div", { style: metricLabelStyle }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react23.default.createElement("div", { style: metricValueStyle }, formatMetricValue(m.metric_type, m.value)), m.context_label && /* @__PURE__ */ import_react23.default.createElement("div", { style: metricContextStyle }, m.context_label)))), disciplinary.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginBottom: "12px" } }, disciplinary.slice(0, 2).map((d, i) => /* @__PURE__ */ import_react23.default.createElement("div", { key: i, style: disciplinaryStyle }, /* @__PURE__ */ import_react23.default.createElement("strong", null, d.record_type), " \u2014 ", formatDate(d.record_date), d.description && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginTop: "4px" } }, d.description)))), /* @__PURE__ */ import_react23.default.createElement("a", { href: `/politician/${politicianId}/judicial-record`, onClick: handleNavigate, style: linkStyle }, "View Full Judicial Record \u2192"));
|
|
4306
4386
|
}
|
|
4307
4387
|
|
|
4308
4388
|
// src/PoliticianProfile.jsx
|
|
@@ -4328,12 +4408,10 @@ function stripRetain(s) {
|
|
|
4328
4408
|
return (s || "").replace(/\s*\(Retain\s+.+?\?\)/, "");
|
|
4329
4409
|
}
|
|
4330
4410
|
function qualifyLocalTitle(baseTitle, pol) {
|
|
4331
|
-
if (!baseTitle) return baseTitle;
|
|
4411
|
+
if (!pol.government_name || !baseTitle) return baseTitle;
|
|
4332
4412
|
const dt = pol.district_type || "";
|
|
4333
4413
|
if (!dt.startsWith("LOCAL") && dt !== "COUNTY") return baseTitle;
|
|
4334
|
-
const
|
|
4335
|
-
if (!govRaw) return baseTitle;
|
|
4336
|
-
const gov = govRaw.split(",")[0].trim();
|
|
4414
|
+
const gov = pol.government_name.split(",")[0].trim();
|
|
4337
4415
|
const govCore = gov.replace(/^City of\s+/i, "").replace(/\s+County$/i, "").trim();
|
|
4338
4416
|
if (govCore && baseTitle.toLowerCase().includes(govCore.toLowerCase())) return baseTitle;
|
|
4339
4417
|
let prefix = dt === "COUNTY" ? gov : gov.replace(/^City of\s+/i, "");
|
|
@@ -4341,17 +4419,6 @@ function qualifyLocalTitle(baseTitle, pol) {
|
|
|
4341
4419
|
prefix = prefix.replace(/\s+County$/, "");
|
|
4342
4420
|
return `${prefix} ${baseTitle}`;
|
|
4343
4421
|
}
|
|
4344
|
-
function deriveSeatSubtitle(pol, cleanTitle) {
|
|
4345
|
-
const dt = pol.district_type || "";
|
|
4346
|
-
if (!dt.startsWith("LOCAL") && dt !== "COUNTY") return null;
|
|
4347
|
-
const t = cleanTitle || "";
|
|
4348
|
-
if (/\bat[- ]large\b/i.test(t)) return "At-Large";
|
|
4349
|
-
let m = t.match(/\bward\s+(\d+)/i);
|
|
4350
|
-
if (m) return `Ward ${m[1]}`;
|
|
4351
|
-
m = t.match(/\bdistrict\s+(\d+)/i);
|
|
4352
|
-
if (m) return `District ${m[1]}`;
|
|
4353
|
-
return null;
|
|
4354
|
-
}
|
|
4355
4422
|
function buildTitleAndSubtitle(pol) {
|
|
4356
4423
|
const cleanTitle = stripRetain(pol.office_title);
|
|
4357
4424
|
const cleanChamber = stripRetain(pol.chamber_name);
|
|
@@ -4372,8 +4439,6 @@ function buildTitleAndSubtitle(pol) {
|
|
|
4372
4439
|
if (dashIdx > 0) return normalizeDistrictSubtitle(cleanTitle.slice(dashIdx + 3));
|
|
4373
4440
|
if (pol.district_type === "NATIONAL_JUDICIAL")
|
|
4374
4441
|
return cleanChamber || null;
|
|
4375
|
-
const seatFromTitle = deriveSeatSubtitle(pol, cleanTitle);
|
|
4376
|
-
if (seatFromTitle) return seatFromTitle;
|
|
4377
4442
|
if (pol.district_id && /^[1-9]\d*$/.test(pol.district_id))
|
|
4378
4443
|
return `District ${pol.district_id}`;
|
|
4379
4444
|
if (pol.district_id === "0" && !/(_EXEC)$/.test(pol.district_type))
|
|
@@ -4478,13 +4543,13 @@ function formatAddress(addr) {
|
|
|
4478
4543
|
if (cityStateZip) lines.push(cityStateZip);
|
|
4479
4544
|
return lines;
|
|
4480
4545
|
}
|
|
4481
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4482
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4483
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4484
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4485
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4486
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4487
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4546
|
+
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
4547
|
+
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react24.default.createElement("polyline", { points: "12 6 12 12 16 14" }));
|
|
4548
|
+
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }), /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "10", r: "3" }));
|
|
4549
|
+
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 10.8 19.79 19.79 0 01.07 2.18 2 2 0 012.02 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" }));
|
|
4550
|
+
var MailIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M4 4H20C21.1 4 22 4.9 22 6V18C22 19.1 21.1 20 20 20H4C2.9 20 2 19.1 2 18V6C2 4.9 2.9 4 4 4Z" }), /* @__PURE__ */ import_react24.default.createElement("path", { d: "M22 6L12 13L2 6" }));
|
|
4551
|
+
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react24.default.createElement("path", { d: "M2 12H22M12 2C14.5 4.5 16 8 16 12C16 16 14.5 19.5 12 22C9.5 19.5 8 16 8 12C8 8 9.5 4.5 12 2Z" }));
|
|
4552
|
+
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }), /* @__PURE__ */ import_react24.default.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" }));
|
|
4488
4553
|
function PoliticianProfile({
|
|
4489
4554
|
politician = {},
|
|
4490
4555
|
onBack,
|
|
@@ -4512,8 +4577,8 @@ function PoliticianProfile({
|
|
|
4512
4577
|
return pol.photo_origin_url;
|
|
4513
4578
|
})();
|
|
4514
4579
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
4515
|
-
const [imgError, setImgError] = (0,
|
|
4516
|
-
(0,
|
|
4580
|
+
const [imgError, setImgError] = (0, import_react24.useState)(false);
|
|
4581
|
+
(0, import_react24.useEffect)(() => {
|
|
4517
4582
|
setImgError(false);
|
|
4518
4583
|
}, [profileImageUrl]);
|
|
4519
4584
|
const getSocialHandle = (type) => {
|
|
@@ -4813,7 +4878,7 @@ function PoliticianProfile({
|
|
|
4813
4878
|
borderRadius: borderRadius.full
|
|
4814
4879
|
}
|
|
4815
4880
|
};
|
|
4816
|
-
return /* @__PURE__ */
|
|
4881
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ import_react24.default.createElement(
|
|
4817
4882
|
"button",
|
|
4818
4883
|
{
|
|
4819
4884
|
type: "button",
|
|
@@ -4826,9 +4891,9 @@ function PoliticianProfile({
|
|
|
4826
4891
|
e.currentTarget.style.textDecoration = "none";
|
|
4827
4892
|
}
|
|
4828
4893
|
},
|
|
4829
|
-
/* @__PURE__ */
|
|
4894
|
+
/* @__PURE__ */ import_react24.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M15 19l-7-7 7-7" })),
|
|
4830
4895
|
label
|
|
4831
|
-
), /* @__PURE__ */
|
|
4896
|
+
), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.card }, /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.heroRow }, /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.photoWrap }, profileImageUrl && !imgError ? /* @__PURE__ */ import_react24.default.createElement(
|
|
4832
4897
|
"img",
|
|
4833
4898
|
{
|
|
4834
4899
|
src: profileImageUrl,
|
|
@@ -4836,7 +4901,7 @@ function PoliticianProfile({
|
|
|
4836
4901
|
style: styles2.photo,
|
|
4837
4902
|
onError: () => setImgError(true)
|
|
4838
4903
|
}
|
|
4839
|
-
) : /* @__PURE__ */
|
|
4904
|
+
) : /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ import_react24.default.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ import_react24.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react24.default.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ import_react24.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react24.default.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ import_react24.default.createElement(
|
|
4840
4905
|
"a",
|
|
4841
4906
|
{
|
|
4842
4907
|
href: pol.web_form_url,
|
|
@@ -4850,9 +4915,9 @@ function PoliticianProfile({
|
|
|
4850
4915
|
e.currentTarget.style.background = colors.evTeal;
|
|
4851
4916
|
}
|
|
4852
4917
|
},
|
|
4853
|
-
/* @__PURE__ */
|
|
4918
|
+
/* @__PURE__ */ import_react24.default.createElement(ExternalLinkIcon, { size: 14 }),
|
|
4854
4919
|
"Submit a Message"
|
|
4855
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
4920
|
+
))), hasContactInfo && /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react24.default.createElement("div", { style: sectionHeading }, /* @__PURE__ */ import_react24.default.createElement(MailIcon, { size: 20 }), "Contact Information"), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGrid }, hasAddresses && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(MapPinIcon, { size: 12 }), "Addresses"), addresses.map((addr, i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `addr-${i}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, addr.type), /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactValue }, addr.lines.map((line, j) => /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, { key: j }, line, j < addr.lines.length - 1 && /* @__PURE__ */ import_react24.default.createElement("br", null))))))), hasPhones && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(PhoneIcon, { size: 12 }), "Phone"), Object.entries(phonesByType).map(([type, phones], i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `phone-${type}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), phones.map((phone, j) => /* @__PURE__ */ import_react24.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4856
4921
|
"a",
|
|
4857
4922
|
{
|
|
4858
4923
|
href: `tel:${phone}`,
|
|
@@ -4865,7 +4930,7 @@ function PoliticianProfile({
|
|
|
4865
4930
|
}
|
|
4866
4931
|
},
|
|
4867
4932
|
phone
|
|
4868
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
4933
|
+
)))))), hasEmails && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(MailIcon, { size: 12 }), "Email"), Object.entries(emailsByType).filter(([, emails]) => emails.some((e) => e && e.trim())).map(([type, emails], i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `email-${type}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), emails.filter((e) => e && e.trim()).map((email, j) => /* @__PURE__ */ import_react24.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4869
4934
|
"a",
|
|
4870
4935
|
{
|
|
4871
4936
|
href: `mailto:${email}`,
|
|
@@ -4878,7 +4943,7 @@ function PoliticianProfile({
|
|
|
4878
4943
|
}
|
|
4879
4944
|
},
|
|
4880
4945
|
email
|
|
4881
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
4946
|
+
)))))), hasWebsitesCol && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(GlobeIcon, { size: 12 }), "Websites"), allWebsites.map((url, i) => /* @__PURE__ */ import_react24.default.createElement("p", { key: i, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4882
4947
|
"a",
|
|
4883
4948
|
{
|
|
4884
4949
|
href: url,
|
|
@@ -4893,7 +4958,7 @@ function PoliticianProfile({
|
|
|
4893
4958
|
}
|
|
4894
4959
|
},
|
|
4895
4960
|
extractDomain(url)
|
|
4896
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
4961
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ import_react24.default.createElement(
|
|
4897
4962
|
SocialLinks,
|
|
4898
4963
|
{
|
|
4899
4964
|
twitter,
|
|
@@ -4905,14 +4970,14 @@ function PoliticianProfile({
|
|
|
4905
4970
|
darkMode,
|
|
4906
4971
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
4907
4972
|
}
|
|
4908
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
4973
|
+
)))), committees.length > 0 && /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react24.default.createElement(CommitteeTable, { committees, darkMode })), pol.is_judicial ? /* @__PURE__ */ import_react24.default.createElement(
|
|
4909
4974
|
JudicialScorecard,
|
|
4910
4975
|
{
|
|
4911
4976
|
judicialRecord,
|
|
4912
4977
|
politicianId,
|
|
4913
4978
|
onNavigateToRecord
|
|
4914
4979
|
}
|
|
4915
|
-
) : /* @__PURE__ */
|
|
4980
|
+
) : /* @__PURE__ */ import_react24.default.createElement(
|
|
4916
4981
|
LegislativeInlineSummary,
|
|
4917
4982
|
{
|
|
4918
4983
|
summary: legislativeSummary,
|
|
@@ -4923,7 +4988,7 @@ function PoliticianProfile({
|
|
|
4923
4988
|
}
|
|
4924
4989
|
|
|
4925
4990
|
// src/LegislativeRecord.jsx
|
|
4926
|
-
var
|
|
4991
|
+
var import_react25 = __toESM(require("react"));
|
|
4927
4992
|
var DEFAULT_LIMIT = 25;
|
|
4928
4993
|
function normalizeText(str) {
|
|
4929
4994
|
if (!str) return "";
|
|
@@ -5003,7 +5068,7 @@ function getPositionBadge(position) {
|
|
|
5003
5068
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
5004
5069
|
}
|
|
5005
5070
|
function Badge({ label, bg, text }) {
|
|
5006
|
-
return /* @__PURE__ */
|
|
5071
|
+
return /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5007
5072
|
display: "inline-block",
|
|
5008
5073
|
background: bg,
|
|
5009
5074
|
color: text,
|
|
@@ -5016,18 +5081,18 @@ function Badge({ label, bg, text }) {
|
|
|
5016
5081
|
} }, label);
|
|
5017
5082
|
}
|
|
5018
5083
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
5019
|
-
return /* @__PURE__ */
|
|
5084
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
5020
5085
|
display: "flex",
|
|
5021
5086
|
alignItems: "center",
|
|
5022
5087
|
justifyContent: "space-between",
|
|
5023
5088
|
marginBottom: spacing[4]
|
|
5024
|
-
} }, /* @__PURE__ */
|
|
5089
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("h2", { style: {
|
|
5025
5090
|
fontFamily: fonts.primary,
|
|
5026
5091
|
fontSize: fontSizes.xl,
|
|
5027
5092
|
fontWeight: fontWeights.bold,
|
|
5028
5093
|
color: colors.evTeal,
|
|
5029
5094
|
margin: 0
|
|
5030
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
5095
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ import_react25.default.createElement(
|
|
5031
5096
|
"select",
|
|
5032
5097
|
{
|
|
5033
5098
|
value: yearFilter,
|
|
@@ -5043,13 +5108,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
5043
5108
|
cursor: "pointer"
|
|
5044
5109
|
}
|
|
5045
5110
|
},
|
|
5046
|
-
/* @__PURE__ */
|
|
5047
|
-
years.map((y) => /* @__PURE__ */
|
|
5111
|
+
/* @__PURE__ */ import_react25.default.createElement("option", { value: "All" }, "All years"),
|
|
5112
|
+
years.map((y) => /* @__PURE__ */ import_react25.default.createElement("option", { key: y, value: y }, y))
|
|
5048
5113
|
));
|
|
5049
5114
|
}
|
|
5050
5115
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
5051
5116
|
if (totalCount <= visibleCount) return null;
|
|
5052
|
-
return /* @__PURE__ */
|
|
5117
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
5053
5118
|
"button",
|
|
5054
5119
|
{
|
|
5055
5120
|
type: "button",
|
|
@@ -5077,7 +5142,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
5077
5142
|
));
|
|
5078
5143
|
}
|
|
5079
5144
|
function EmptyState({ message }) {
|
|
5080
|
-
return /* @__PURE__ */
|
|
5145
|
+
return /* @__PURE__ */ import_react25.default.createElement("p", { style: {
|
|
5081
5146
|
fontFamily: fonts.primary,
|
|
5082
5147
|
fontSize: fontSizes.sm,
|
|
5083
5148
|
color: colors.textMuted,
|
|
@@ -5087,24 +5152,24 @@ function EmptyState({ message }) {
|
|
|
5087
5152
|
} }, message);
|
|
5088
5153
|
}
|
|
5089
5154
|
function Spinner() {
|
|
5090
|
-
return /* @__PURE__ */
|
|
5155
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
5091
5156
|
display: "flex",
|
|
5092
5157
|
justifyContent: "center",
|
|
5093
5158
|
alignItems: "center",
|
|
5094
5159
|
padding: spacing[10]
|
|
5095
|
-
} }, /* @__PURE__ */
|
|
5160
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
5096
5161
|
width: "40px",
|
|
5097
5162
|
height: "40px",
|
|
5098
5163
|
borderRadius: borderRadius.full,
|
|
5099
5164
|
border: `3px solid ${colors.borderLight}`,
|
|
5100
5165
|
borderTopColor: colors.evTeal,
|
|
5101
5166
|
animation: "ev-spin 0.8s linear infinite"
|
|
5102
|
-
} }), /* @__PURE__ */
|
|
5167
|
+
} }), /* @__PURE__ */ import_react25.default.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
5103
5168
|
}
|
|
5104
5169
|
function CommitteesSection({ committees, leadership }) {
|
|
5105
|
-
const [showAll, setShowAll] = (0,
|
|
5170
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
5106
5171
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
5107
|
-
return /* @__PURE__ */
|
|
5172
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(SectionHeader, { title: "Committees & Leadership" }), leadership && leadership.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: spacing[2], marginBottom: spacing[4] } }, leadership.map((role, i) => /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
5108
5173
|
display: "inline-flex",
|
|
5109
5174
|
alignItems: "center",
|
|
5110
5175
|
gap: spacing[1],
|
|
@@ -5115,23 +5180,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
5115
5180
|
fontFamily: fonts.primary,
|
|
5116
5181
|
fontSize: fontSizes.sm,
|
|
5117
5182
|
fontWeight: fontWeights.semibold
|
|
5118
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
5183
|
+
} }, role.title, role.chamber && /* @__PURE__ */ import_react25.default.createElement("span", { style: { fontWeight: fontWeights.regular, opacity: 0.85 } }, "(", role.chamber, ")")))), committees.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Committee information is not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((c, i) => {
|
|
5119
5184
|
const badge = getRoleBadge(c.role);
|
|
5120
|
-
return /* @__PURE__ */
|
|
5185
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
5121
5186
|
display: "flex",
|
|
5122
5187
|
alignItems: "center",
|
|
5123
5188
|
justifyContent: "space-between",
|
|
5124
5189
|
padding: `${spacing[3]} 0`,
|
|
5125
5190
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
5126
5191
|
gap: spacing[3]
|
|
5127
|
-
} }, /* @__PURE__ */
|
|
5192
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5128
5193
|
fontFamily: fonts.primary,
|
|
5129
5194
|
fontSize: fontSizes.sm,
|
|
5130
5195
|
color: colors.textSecondary,
|
|
5131
5196
|
flex: 1,
|
|
5132
5197
|
minWidth: 0
|
|
5133
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
5134
|
-
})), !showAll && /* @__PURE__ */
|
|
5198
|
+
} }, c.committee_name, c.parent_name && /* @__PURE__ */ import_react25.default.createElement("span", { style: { color: colors.textMuted, marginLeft: spacing[1] } }, "(", c.parent_name, ")")), /* @__PURE__ */ import_react25.default.createElement(Badge, { label: badge.label, bg: badge.bg, text: badge.text }));
|
|
5199
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
5135
5200
|
ShowAllLink,
|
|
5136
5201
|
{
|
|
5137
5202
|
totalCount: committees.length,
|
|
@@ -5142,15 +5207,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
5142
5207
|
}
|
|
5143
5208
|
function LegislationSection({ bills, isMobile }) {
|
|
5144
5209
|
const years = getYears(bills, "introduced_at");
|
|
5145
|
-
const [yearFilter, setYearFilter] = (0,
|
|
5146
|
-
const [showAll, setShowAll] = (0,
|
|
5210
|
+
const [yearFilter, setYearFilter] = (0, import_react25.useState)("All");
|
|
5211
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
5147
5212
|
const handleYearChange = (y) => {
|
|
5148
5213
|
setYearFilter(y);
|
|
5149
5214
|
setShowAll(false);
|
|
5150
5215
|
};
|
|
5151
5216
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
5152
5217
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
5153
|
-
return /* @__PURE__ */
|
|
5218
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
5154
5219
|
SectionHeader,
|
|
5155
5220
|
{
|
|
5156
5221
|
title: "Sponsored Legislation",
|
|
@@ -5158,42 +5223,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
5158
5223
|
years,
|
|
5159
5224
|
onYearChange: handleYearChange
|
|
5160
5225
|
}
|
|
5161
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
5226
|
+
), bills.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Sponsored legislation data is not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((bill, i) => {
|
|
5162
5227
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
5163
|
-
return /* @__PURE__ */
|
|
5228
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
5164
5229
|
display: "flex",
|
|
5165
5230
|
flexDirection: isMobile ? "column" : "row",
|
|
5166
5231
|
alignItems: isMobile ? "flex-start" : "center",
|
|
5167
5232
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
5168
5233
|
padding: `${spacing[3]} 0`,
|
|
5169
5234
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
5170
|
-
} }, /* @__PURE__ */
|
|
5235
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5171
5236
|
fontFamily: fonts.primary,
|
|
5172
5237
|
fontSize: fontSizes.xs,
|
|
5173
5238
|
fontWeight: fontWeights.bold,
|
|
5174
5239
|
color: colors.textSecondary,
|
|
5175
5240
|
marginRight: spacing[2]
|
|
5176
|
-
} }, bill.number), /* @__PURE__ */
|
|
5241
|
+
} }, bill.number), /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5177
5242
|
fontFamily: fonts.primary,
|
|
5178
5243
|
fontSize: fontSizes.sm,
|
|
5179
5244
|
color: colors.textSecondary
|
|
5180
|
-
} }, bill.title)), /* @__PURE__ */
|
|
5245
|
+
} }, bill.title)), /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
5181
5246
|
display: "flex",
|
|
5182
5247
|
alignItems: "center",
|
|
5183
5248
|
gap: spacing[2],
|
|
5184
5249
|
flexShrink: 0,
|
|
5185
5250
|
flexWrap: "wrap"
|
|
5186
|
-
} }, /* @__PURE__ */
|
|
5251
|
+
} }, /* @__PURE__ */ import_react25.default.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5187
5252
|
fontFamily: fonts.primary,
|
|
5188
5253
|
fontSize: fontSizes.xs,
|
|
5189
5254
|
color: colors.textMuted
|
|
5190
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
5255
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5191
5256
|
fontFamily: fonts.primary,
|
|
5192
5257
|
fontSize: fontSizes.xs,
|
|
5193
5258
|
color: colors.textMuted,
|
|
5194
5259
|
fontStyle: "italic"
|
|
5195
5260
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
5196
|
-
})), !showAll && /* @__PURE__ */
|
|
5261
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
5197
5262
|
ShowAllLink,
|
|
5198
5263
|
{
|
|
5199
5264
|
totalCount: filtered.length,
|
|
@@ -5204,15 +5269,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
5204
5269
|
}
|
|
5205
5270
|
function VotingSection({ votes, isMobile }) {
|
|
5206
5271
|
const years = getYears(votes, "vote_date");
|
|
5207
|
-
const [yearFilter, setYearFilter] = (0,
|
|
5208
|
-
const [showAll, setShowAll] = (0,
|
|
5272
|
+
const [yearFilter, setYearFilter] = (0, import_react25.useState)("All");
|
|
5273
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
5209
5274
|
const handleYearChange = (y) => {
|
|
5210
5275
|
setYearFilter(y);
|
|
5211
5276
|
setShowAll(false);
|
|
5212
5277
|
};
|
|
5213
5278
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
5214
5279
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
5215
|
-
return /* @__PURE__ */
|
|
5280
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
5216
5281
|
SectionHeader,
|
|
5217
5282
|
{
|
|
5218
5283
|
title: "Voting Record",
|
|
@@ -5220,38 +5285,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
5220
5285
|
years,
|
|
5221
5286
|
onYearChange: handleYearChange
|
|
5222
5287
|
}
|
|
5223
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
5288
|
+
), votes.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Voting records are not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((vote, i) => {
|
|
5224
5289
|
const positionBadge = getPositionBadge(vote.position);
|
|
5225
5290
|
const normPosition = normalizeText(vote.position);
|
|
5226
5291
|
const topic = vote.bill_title || vote.vote_question;
|
|
5227
5292
|
const sourceUrl = vote.bill_url;
|
|
5228
|
-
return /* @__PURE__ */
|
|
5293
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
5229
5294
|
display: "flex",
|
|
5230
5295
|
flexDirection: isMobile ? "column" : "row",
|
|
5231
5296
|
alignItems: isMobile ? "flex-start" : "center",
|
|
5232
5297
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
5233
5298
|
padding: `${spacing[3]} 0`,
|
|
5234
5299
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
5235
|
-
} }, /* @__PURE__ */
|
|
5300
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5236
5301
|
fontFamily: fonts.primary,
|
|
5237
5302
|
fontSize: fontSizes.sm,
|
|
5238
5303
|
color: colors.textSecondary
|
|
5239
|
-
} }, topic)), /* @__PURE__ */
|
|
5304
|
+
} }, topic)), /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
5240
5305
|
display: "flex",
|
|
5241
5306
|
alignItems: "center",
|
|
5242
5307
|
gap: spacing[2],
|
|
5243
5308
|
flexShrink: 0,
|
|
5244
5309
|
flexWrap: "wrap"
|
|
5245
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
5310
|
+
} }, vote.vote_date && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5246
5311
|
fontFamily: fonts.primary,
|
|
5247
5312
|
fontSize: fontSizes.xs,
|
|
5248
5313
|
color: colors.textMuted
|
|
5249
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
5314
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ import_react25.default.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
5250
5315
|
fontFamily: fonts.primary,
|
|
5251
5316
|
fontSize: fontSizes.xs,
|
|
5252
5317
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
5253
5318
|
fontWeight: fontWeights.medium
|
|
5254
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
5319
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ import_react25.default.createElement(
|
|
5255
5320
|
"a",
|
|
5256
5321
|
{
|
|
5257
5322
|
href: sourceUrl,
|
|
@@ -5272,7 +5337,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
5272
5337
|
},
|
|
5273
5338
|
"Source"
|
|
5274
5339
|
)));
|
|
5275
|
-
})), !showAll && /* @__PURE__ */
|
|
5340
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
5276
5341
|
ShowAllLink,
|
|
5277
5342
|
{
|
|
5278
5343
|
totalCount: filtered.length,
|
|
@@ -5291,20 +5356,20 @@ function LegislativeRecord({
|
|
|
5291
5356
|
}) {
|
|
5292
5357
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
5293
5358
|
if (loading) {
|
|
5294
|
-
return /* @__PURE__ */
|
|
5359
|
+
return /* @__PURE__ */ import_react25.default.createElement(Spinner, null);
|
|
5295
5360
|
}
|
|
5296
|
-
return /* @__PURE__ */
|
|
5361
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ import_react25.default.createElement("h1", { style: {
|
|
5297
5362
|
fontFamily: fonts.primary,
|
|
5298
5363
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
5299
5364
|
fontWeight: fontWeights.bold,
|
|
5300
5365
|
color: colors.evTeal,
|
|
5301
5366
|
marginBottom: spacing[8],
|
|
5302
5367
|
marginTop: 0
|
|
5303
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
5368
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ import_react25.default.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ import_react25.default.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ import_react25.default.createElement(VotingSection, { votes, isMobile }));
|
|
5304
5369
|
}
|
|
5305
5370
|
|
|
5306
5371
|
// src/JudicialRecordDetail.jsx
|
|
5307
|
-
var
|
|
5372
|
+
var import_react26 = __toESM(require("react"));
|
|
5308
5373
|
var containerStyle = {
|
|
5309
5374
|
fontFamily: "'Manrope', sans-serif",
|
|
5310
5375
|
maxWidth: "800px"
|
|
@@ -5389,7 +5454,7 @@ var emptyStateStyle = {
|
|
|
5389
5454
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
5390
5455
|
var _a;
|
|
5391
5456
|
if (!judicialRecord) {
|
|
5392
|
-
return /* @__PURE__ */
|
|
5457
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react26.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No judicial record data available."));
|
|
5393
5458
|
}
|
|
5394
5459
|
const {
|
|
5395
5460
|
judge_detail: detail,
|
|
@@ -5398,13 +5463,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
5398
5463
|
disciplinary_records: disciplinary = []
|
|
5399
5464
|
} = judicialRecord;
|
|
5400
5465
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
5401
|
-
return /* @__PURE__ */
|
|
5466
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react26.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react26.default.createElement("h1", { style: nameStyle }, displayName), /* @__PURE__ */ import_react26.default.createElement("p", { style: roleStyle }, (detail == null ? void 0 : detail.court_role) || politician.office_title, (detail == null ? void 0 : detail.date_seated) && ` \xB7 Seated ${formatDate(detail.date_seated)}`), detail && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Background"), detail.appointed_by && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Appointed by"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.appointed_by, " (", detail.appointing_president_party, ")")), detail.confirmation_vote && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Confirmation Vote"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.confirmation_vote)), detail.election_type && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Election Type"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.election_type === "retention" ? "Retention (Yes/No)" : "Contested Election")), ((_a = detail.areas_of_focus) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Areas of Focus"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.areas_of_focus.join(", ")))), /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Evaluations"), evaluations.length === 0 ? /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No evaluation data available yet.") : /* @__PURE__ */ import_react26.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react26.default.createElement("thead", null, /* @__PURE__ */ import_react26.default.createElement("tr", null, /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Source"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Rating"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Date"))), /* @__PURE__ */ import_react26.default.createElement("tbody", null, evaluations.map((ev, i) => /* @__PURE__ */ import_react26.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, ev.source_url ? /* @__PURE__ */ import_react26.default.createElement("a", { href: ev.source_url, target: "_blank", rel: "noopener noreferrer", style: { color: "#319795" } }, ev.source) : ev.source), /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, ev.rating), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, formatDate(ev.rating_date)))))), /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Metrics"), metrics.length === 0 ? /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No performance metric data available yet.") : /* @__PURE__ */ import_react26.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react26.default.createElement("thead", null, /* @__PURE__ */ import_react26.default.createElement("tr", null, /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Metric"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Value"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Context"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Period"))), /* @__PURE__ */ import_react26.default.createElement("tbody", null, metrics.map((m, i) => /* @__PURE__ */ import_react26.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, formatMetricValue(m.metric_type, m.value)), /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, color: "#718096", fontSize: "13px" } }, m.context_label), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, m.time_period))))), disciplinary.length > 0 && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Disciplinary History"), disciplinary.map((d, i) => /* @__PURE__ */ import_react26.default.createElement("div", { key: i, style: {
|
|
5402
5467
|
borderLeft: "3px solid #fc8181",
|
|
5403
5468
|
backgroundColor: "#fff5f5",
|
|
5404
5469
|
borderRadius: "0 6px 6px 0",
|
|
5405
5470
|
padding: "12px 16px",
|
|
5406
5471
|
marginBottom: "10px"
|
|
5407
|
-
} }, /* @__PURE__ */
|
|
5472
|
+
} }, /* @__PURE__ */ import_react26.default.createElement("div", { style: { fontWeight: 700, color: "#742a2a", fontSize: "14px" } }, d.record_type, " \u2014 ", formatDate(d.record_date)), d.description && /* @__PURE__ */ import_react26.default.createElement("div", { style: { color: "#9b2c2c", fontSize: "13px", marginTop: "4px" } }, d.description), d.source_url && /* @__PURE__ */ import_react26.default.createElement(
|
|
5408
5473
|
"a",
|
|
5409
5474
|
{
|
|
5410
5475
|
href: d.source_url,
|
|
@@ -5417,7 +5482,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
5417
5482
|
}
|
|
5418
5483
|
|
|
5419
5484
|
// src/AuthForm.jsx
|
|
5420
|
-
var
|
|
5485
|
+
var import_react27 = __toESM(require("react"));
|
|
5421
5486
|
function AuthForm({
|
|
5422
5487
|
logoSrc = "/EVLogo.svg",
|
|
5423
5488
|
appName = "Empowered Vote",
|
|
@@ -5428,11 +5493,11 @@ function AuthForm({
|
|
|
5428
5493
|
error = null,
|
|
5429
5494
|
submitting = false
|
|
5430
5495
|
}) {
|
|
5431
|
-
const [username, setUsername] = (0,
|
|
5432
|
-
const [password, setPassword] = (0,
|
|
5433
|
-
const [confirmPassword, setConfirmPassword] = (0,
|
|
5434
|
-
const [showPasswords, setShowPasswords] = (0,
|
|
5435
|
-
const [passwordMismatch, setPasswordMismatch] = (0,
|
|
5496
|
+
const [username, setUsername] = (0, import_react27.useState)("");
|
|
5497
|
+
const [password, setPassword] = (0, import_react27.useState)("");
|
|
5498
|
+
const [confirmPassword, setConfirmPassword] = (0, import_react27.useState)("");
|
|
5499
|
+
const [showPasswords, setShowPasswords] = (0, import_react27.useState)(false);
|
|
5500
|
+
const [passwordMismatch, setPasswordMismatch] = (0, import_react27.useState)(false);
|
|
5436
5501
|
const isLogin = mode === "login";
|
|
5437
5502
|
const handleSubmit = (e) => {
|
|
5438
5503
|
e.preventDefault();
|
|
@@ -5444,7 +5509,7 @@ function AuthForm({
|
|
|
5444
5509
|
setPasswordMismatch(false);
|
|
5445
5510
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
5446
5511
|
};
|
|
5447
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
5512
|
+
const EyeOpen = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
5448
5513
|
"svg",
|
|
5449
5514
|
{
|
|
5450
5515
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5454,7 +5519,7 @@ function AuthForm({
|
|
|
5454
5519
|
stroke: "currentColor",
|
|
5455
5520
|
style: { width: "20px", height: "20px" }
|
|
5456
5521
|
},
|
|
5457
|
-
/* @__PURE__ */
|
|
5522
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
5458
5523
|
"path",
|
|
5459
5524
|
{
|
|
5460
5525
|
strokeLinecap: "round",
|
|
@@ -5462,7 +5527,7 @@ function AuthForm({
|
|
|
5462
5527
|
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"
|
|
5463
5528
|
}
|
|
5464
5529
|
),
|
|
5465
|
-
/* @__PURE__ */
|
|
5530
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
5466
5531
|
"path",
|
|
5467
5532
|
{
|
|
5468
5533
|
strokeLinecap: "round",
|
|
@@ -5471,7 +5536,7 @@ function AuthForm({
|
|
|
5471
5536
|
}
|
|
5472
5537
|
)
|
|
5473
5538
|
);
|
|
5474
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
5539
|
+
const EyeClosed = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
5475
5540
|
"svg",
|
|
5476
5541
|
{
|
|
5477
5542
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5481,7 +5546,7 @@ function AuthForm({
|
|
|
5481
5546
|
stroke: "currentColor",
|
|
5482
5547
|
style: { width: "20px", height: "20px" }
|
|
5483
5548
|
},
|
|
5484
|
-
/* @__PURE__ */
|
|
5549
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
5485
5550
|
"path",
|
|
5486
5551
|
{
|
|
5487
5552
|
strokeLinecap: "round",
|
|
@@ -5490,17 +5555,17 @@ function AuthForm({
|
|
|
5490
5555
|
}
|
|
5491
5556
|
)
|
|
5492
5557
|
);
|
|
5493
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
5558
|
+
const PasswordToggle = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
5494
5559
|
"button",
|
|
5495
5560
|
{
|
|
5496
5561
|
type: "button",
|
|
5497
5562
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
5498
5563
|
style: styles.passwordToggle
|
|
5499
5564
|
},
|
|
5500
|
-
showPasswords ? /* @__PURE__ */
|
|
5565
|
+
showPasswords ? /* @__PURE__ */ import_react27.default.createElement(EyeOpen, null) : /* @__PURE__ */ import_react27.default.createElement(EyeClosed, null)
|
|
5501
5566
|
);
|
|
5502
5567
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
5503
|
-
return /* @__PURE__ */
|
|
5568
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.wrapper }, /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.container }, /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.header }, logoSrc && /* @__PURE__ */ import_react27.default.createElement("img", { src: logoSrc, alt: appName, style: styles.logo }), appName && /* @__PURE__ */ import_react27.default.createElement("h1", { style: styles.appName }, appName), appSubtitle && /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.appSubtitle }, appSubtitle)), /* @__PURE__ */ import_react27.default.createElement("form", { onSubmit: handleSubmit, style: styles.card }, /* @__PURE__ */ import_react27.default.createElement("h2", { style: styles.cardTitle }, isLogin ? "Welcome Back" : "Create Account"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Username"), /* @__PURE__ */ import_react27.default.createElement(
|
|
5504
5569
|
"input",
|
|
5505
5570
|
{
|
|
5506
5571
|
type: "text",
|
|
@@ -5517,7 +5582,7 @@ function AuthForm({
|
|
|
5517
5582
|
},
|
|
5518
5583
|
required: true
|
|
5519
5584
|
}
|
|
5520
|
-
)), /* @__PURE__ */
|
|
5585
|
+
)), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Password"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react27.default.createElement(
|
|
5521
5586
|
"input",
|
|
5522
5587
|
{
|
|
5523
5588
|
type: showPasswords ? "text" : "password",
|
|
@@ -5533,7 +5598,7 @@ function AuthForm({
|
|
|
5533
5598
|
},
|
|
5534
5599
|
required: true
|
|
5535
5600
|
}
|
|
5536
|
-
), /* @__PURE__ */
|
|
5601
|
+
), /* @__PURE__ */ import_react27.default.createElement(PasswordToggle, null))), !isLogin && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Confirm Password"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react27.default.createElement(
|
|
5537
5602
|
"input",
|
|
5538
5603
|
{
|
|
5539
5604
|
type: showPasswords ? "text" : "password",
|
|
@@ -5549,7 +5614,7 @@ function AuthForm({
|
|
|
5549
5614
|
},
|
|
5550
5615
|
required: true
|
|
5551
5616
|
}
|
|
5552
|
-
), /* @__PURE__ */
|
|
5617
|
+
), /* @__PURE__ */ import_react27.default.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ import_react27.default.createElement(
|
|
5553
5618
|
"button",
|
|
5554
5619
|
{
|
|
5555
5620
|
type: "submit",
|
|
@@ -5567,7 +5632,7 @@ function AuthForm({
|
|
|
5567
5632
|
}
|
|
5568
5633
|
},
|
|
5569
5634
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
5570
|
-
), onModeSwitch && /* @__PURE__ */
|
|
5635
|
+
), onModeSwitch && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.modeSwitch }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.modeSwitchText }, isLogin ? "Don't have an account?" : "Already have an account?"), /* @__PURE__ */ import_react27.default.createElement(
|
|
5571
5636
|
"button",
|
|
5572
5637
|
{
|
|
5573
5638
|
type: "button",
|
|
@@ -5740,9 +5805,9 @@ var styles = {
|
|
|
5740
5805
|
};
|
|
5741
5806
|
|
|
5742
5807
|
// src/TopicTierBadge.jsx
|
|
5743
|
-
var
|
|
5808
|
+
var import_react28 = __toESM(require("react"));
|
|
5744
5809
|
function LandmarkIcon({ size = 14 }) {
|
|
5745
|
-
return /* @__PURE__ */
|
|
5810
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
5746
5811
|
"svg",
|
|
5747
5812
|
{
|
|
5748
5813
|
width: size,
|
|
@@ -5756,16 +5821,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
5756
5821
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5757
5822
|
"aria-hidden": "true"
|
|
5758
5823
|
},
|
|
5759
|
-
/* @__PURE__ */
|
|
5760
|
-
/* @__PURE__ */
|
|
5761
|
-
/* @__PURE__ */
|
|
5762
|
-
/* @__PURE__ */
|
|
5763
|
-
/* @__PURE__ */
|
|
5764
|
-
/* @__PURE__ */
|
|
5824
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 18v-7" }),
|
|
5825
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }),
|
|
5826
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M14 18v-7" }),
|
|
5827
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M18 18v-7" }),
|
|
5828
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M3 22h18" }),
|
|
5829
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 18v-7" })
|
|
5765
5830
|
);
|
|
5766
5831
|
}
|
|
5767
5832
|
function Building2Icon({ size = 14 }) {
|
|
5768
|
-
return /* @__PURE__ */
|
|
5833
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
5769
5834
|
"svg",
|
|
5770
5835
|
{
|
|
5771
5836
|
width: size,
|
|
@@ -5779,17 +5844,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
5779
5844
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5780
5845
|
"aria-hidden": "true"
|
|
5781
5846
|
},
|
|
5782
|
-
/* @__PURE__ */
|
|
5783
|
-
/* @__PURE__ */
|
|
5784
|
-
/* @__PURE__ */
|
|
5785
|
-
/* @__PURE__ */
|
|
5786
|
-
/* @__PURE__ */
|
|
5787
|
-
/* @__PURE__ */
|
|
5788
|
-
/* @__PURE__ */
|
|
5847
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
5848
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
5849
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
5850
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 6h4" }),
|
|
5851
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 10h4" }),
|
|
5852
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 14h4" }),
|
|
5853
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 18h4" })
|
|
5789
5854
|
);
|
|
5790
5855
|
}
|
|
5791
5856
|
function HomeIcon({ size = 14 }) {
|
|
5792
|
-
return /* @__PURE__ */
|
|
5857
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
5793
5858
|
"svg",
|
|
5794
5859
|
{
|
|
5795
5860
|
width: size,
|
|
@@ -5803,8 +5868,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
5803
5868
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5804
5869
|
"aria-hidden": "true"
|
|
5805
5870
|
},
|
|
5806
|
-
/* @__PURE__ */
|
|
5807
|
-
/* @__PURE__ */
|
|
5871
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
5872
|
+
/* @__PURE__ */ import_react28.default.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
5808
5873
|
);
|
|
5809
5874
|
}
|
|
5810
5875
|
var TIER_INFO = {
|
|
@@ -5864,7 +5929,7 @@ function TopicTierBadge({
|
|
|
5864
5929
|
userSelect: "none"
|
|
5865
5930
|
};
|
|
5866
5931
|
};
|
|
5867
|
-
return /* @__PURE__ */
|
|
5932
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
5868
5933
|
"span",
|
|
5869
5934
|
{
|
|
5870
5935
|
className: "ev-topic-tier-badge",
|
|
@@ -5874,13 +5939,13 @@ function TopicTierBadge({
|
|
|
5874
5939
|
},
|
|
5875
5940
|
effectiveTiers.map((tier) => {
|
|
5876
5941
|
const { label, Icon } = TIER_INFO[tier];
|
|
5877
|
-
return /* @__PURE__ */
|
|
5942
|
+
return /* @__PURE__ */ import_react28.default.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ import_react28.default.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ import_react28.default.createElement("span", null, label));
|
|
5878
5943
|
})
|
|
5879
5944
|
);
|
|
5880
5945
|
}
|
|
5881
5946
|
|
|
5882
5947
|
// src/CompassCoverageCallout.jsx
|
|
5883
|
-
var
|
|
5948
|
+
var import_react29 = __toESM(require("react"));
|
|
5884
5949
|
var TIER_LABELS = {
|
|
5885
5950
|
federal: "federal",
|
|
5886
5951
|
state: "state",
|
|
@@ -5893,7 +5958,7 @@ function CompassCoverageCallout({
|
|
|
5893
5958
|
compassUrl,
|
|
5894
5959
|
onDismiss
|
|
5895
5960
|
}) {
|
|
5896
|
-
const [dismissed, setDismissed] = (0,
|
|
5961
|
+
const [dismissed, setDismissed] = (0, import_react29.useState)(false);
|
|
5897
5962
|
if (dismissed) return null;
|
|
5898
5963
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
5899
5964
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -5944,15 +6009,15 @@ function CompassCoverageCallout({
|
|
|
5944
6009
|
setDismissed(true);
|
|
5945
6010
|
if (onDismiss) onDismiss();
|
|
5946
6011
|
};
|
|
5947
|
-
return /* @__PURE__ */
|
|
6012
|
+
return /* @__PURE__ */ import_react29.default.createElement(
|
|
5948
6013
|
"div",
|
|
5949
6014
|
{
|
|
5950
6015
|
className: "ev-compass-coverage-callout",
|
|
5951
6016
|
role: "status",
|
|
5952
6017
|
style: containerStyle2
|
|
5953
6018
|
},
|
|
5954
|
-
/* @__PURE__ */
|
|
5955
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
6019
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { style: textStyle }, /* @__PURE__ */ import_react29.default.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ import_react29.default.createElement("div", null, count === 0 ? `None of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. ` : `Only ${count} of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. `, "Add more ", tierLabel, "-applicable topics to get better comparisons with ", tierLabel, " officials."), /* @__PURE__ */ import_react29.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
6020
|
+
onDismiss !== void 0 && /* @__PURE__ */ import_react29.default.createElement(
|
|
5956
6021
|
"button",
|
|
5957
6022
|
{
|
|
5958
6023
|
onClick: handleDismiss,
|
|
@@ -5965,7 +6030,7 @@ function CompassCoverageCallout({
|
|
|
5965
6030
|
}
|
|
5966
6031
|
|
|
5967
6032
|
// src/ExpandCompassNudge.jsx
|
|
5968
|
-
var
|
|
6033
|
+
var import_react30 = __toESM(require("react"));
|
|
5969
6034
|
function ExpandCompassNudge({
|
|
5970
6035
|
politicianName,
|
|
5971
6036
|
missingCount,
|
|
@@ -6012,7 +6077,7 @@ function ExpandCompassNudge({
|
|
|
6012
6077
|
};
|
|
6013
6078
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
6014
6079
|
const speakerName = politicianName || "This politician";
|
|
6015
|
-
return /* @__PURE__ */
|
|
6080
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ import_react30.default.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ import_react30.default.createElement("p", { style: bodyStyle }, speakerName, " has stances on ", missingCount, " more ", topicsLabel, " you haven't answered yet. Expand your compass to see where you stand on all of them."), /* @__PURE__ */ import_react30.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
6016
6081
|
}
|
|
6017
6082
|
|
|
6018
6083
|
// src/computeTierCoverage.js
|
|
@@ -6033,7 +6098,7 @@ function computeTierCoverage(topics) {
|
|
|
6033
6098
|
}
|
|
6034
6099
|
|
|
6035
6100
|
// src/useEvContextPromotion.js
|
|
6036
|
-
var
|
|
6101
|
+
var import_react31 = require("react");
|
|
6037
6102
|
function useEvContextPromotion({
|
|
6038
6103
|
domain,
|
|
6039
6104
|
isLoggedIn,
|
|
@@ -6042,23 +6107,23 @@ function useEvContextPromotion({
|
|
|
6042
6107
|
apiWriter,
|
|
6043
6108
|
enabled = true
|
|
6044
6109
|
}) {
|
|
6045
|
-
const [shouldPrompt, setShouldPrompt] = (0,
|
|
6046
|
-
const [payload, setPayload] = (0,
|
|
6047
|
-
const [status, setStatus] = (0,
|
|
6048
|
-
const [error, setError] = (0,
|
|
6049
|
-
const apiDataRef = (0,
|
|
6110
|
+
const [shouldPrompt, setShouldPrompt] = (0, import_react31.useState)(false);
|
|
6111
|
+
const [payload, setPayload] = (0, import_react31.useState)(null);
|
|
6112
|
+
const [status, setStatus] = (0, import_react31.useState)("idle");
|
|
6113
|
+
const [error, setError] = (0, import_react31.useState)(null);
|
|
6114
|
+
const apiDataRef = (0, import_react31.useRef)(apiData);
|
|
6050
6115
|
apiDataRef.current = apiData;
|
|
6051
|
-
const userIdRef = (0,
|
|
6116
|
+
const userIdRef = (0, import_react31.useRef)(userId);
|
|
6052
6117
|
userIdRef.current = userId;
|
|
6053
|
-
const isLoggedInRef = (0,
|
|
6118
|
+
const isLoggedInRef = (0, import_react31.useRef)(isLoggedIn);
|
|
6054
6119
|
isLoggedInRef.current = isLoggedIn;
|
|
6055
|
-
const enabledRef = (0,
|
|
6120
|
+
const enabledRef = (0, import_react31.useRef)(enabled);
|
|
6056
6121
|
enabledRef.current = enabled;
|
|
6057
|
-
const domainRef = (0,
|
|
6122
|
+
const domainRef = (0, import_react31.useRef)(domain);
|
|
6058
6123
|
domainRef.current = domain;
|
|
6059
|
-
const apiWriterRef = (0,
|
|
6124
|
+
const apiWriterRef = (0, import_react31.useRef)(apiWriter);
|
|
6060
6125
|
apiWriterRef.current = apiWriter;
|
|
6061
|
-
const detect = (0,
|
|
6126
|
+
const detect = (0, import_react31.useCallback)(async () => {
|
|
6062
6127
|
const _enabled = enabledRef.current;
|
|
6063
6128
|
const _isLoggedIn = isLoggedInRef.current;
|
|
6064
6129
|
const _userId = userIdRef.current;
|
|
@@ -6097,16 +6162,16 @@ function useEvContextPromotion({
|
|
|
6097
6162
|
setPayload(null);
|
|
6098
6163
|
}
|
|
6099
6164
|
}, []);
|
|
6100
|
-
(0,
|
|
6165
|
+
(0, import_react31.useEffect)(() => {
|
|
6101
6166
|
detect();
|
|
6102
6167
|
}, [detect, isLoggedIn, userId, apiData, enabled, domain]);
|
|
6103
|
-
(0,
|
|
6168
|
+
(0, import_react31.useEffect)(() => {
|
|
6104
6169
|
const unsub = evContext.subscribe(() => {
|
|
6105
6170
|
detect();
|
|
6106
6171
|
});
|
|
6107
6172
|
return unsub;
|
|
6108
6173
|
}, [detect]);
|
|
6109
|
-
const promote = (0,
|
|
6174
|
+
const promote = (0, import_react31.useCallback)(async () => {
|
|
6110
6175
|
const _userId = userIdRef.current;
|
|
6111
6176
|
const _domain = domainRef.current;
|
|
6112
6177
|
const _writer = apiWriterRef.current;
|
|
@@ -6133,7 +6198,7 @@ function useEvContextPromotion({
|
|
|
6133
6198
|
setError(err instanceof Error ? err : new Error(String(err)));
|
|
6134
6199
|
}
|
|
6135
6200
|
}, [payload]);
|
|
6136
|
-
const dismiss = (0,
|
|
6201
|
+
const dismiss = (0, import_react31.useCallback)(async () => {
|
|
6137
6202
|
const _userId = userIdRef.current;
|
|
6138
6203
|
const _domain = domainRef.current;
|
|
6139
6204
|
if (!_userId) return;
|
|
@@ -6192,14 +6257,14 @@ function isGuestPopulated(domain, fullEvContext) {
|
|
|
6192
6257
|
}
|
|
6193
6258
|
|
|
6194
6259
|
// src/StanceAccordion.jsx
|
|
6195
|
-
var
|
|
6260
|
+
var import_react33 = __toESM(require("react"));
|
|
6196
6261
|
|
|
6197
6262
|
// src/Favicon.jsx
|
|
6198
|
-
var
|
|
6263
|
+
var import_react32 = __toESM(require("react"));
|
|
6199
6264
|
function Favicon({ url, size = 16 }) {
|
|
6200
6265
|
try {
|
|
6201
6266
|
const domain = new URL(url).hostname;
|
|
6202
|
-
return /* @__PURE__ */
|
|
6267
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
6203
6268
|
"img",
|
|
6204
6269
|
{
|
|
6205
6270
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -6210,7 +6275,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
6210
6275
|
}
|
|
6211
6276
|
);
|
|
6212
6277
|
} catch {
|
|
6213
|
-
return /* @__PURE__ */
|
|
6278
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
6214
6279
|
"svg",
|
|
6215
6280
|
{
|
|
6216
6281
|
width: size,
|
|
@@ -6221,8 +6286,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
6221
6286
|
strokeWidth: "1.5",
|
|
6222
6287
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
6223
6288
|
},
|
|
6224
|
-
/* @__PURE__ */
|
|
6225
|
-
/* @__PURE__ */
|
|
6289
|
+
/* @__PURE__ */ import_react32.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
6290
|
+
/* @__PURE__ */ import_react32.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
|
|
6226
6291
|
);
|
|
6227
6292
|
}
|
|
6228
6293
|
}
|
|
@@ -6253,11 +6318,11 @@ function StanceAccordion({
|
|
|
6253
6318
|
apiUrl = "https://api.empowered.vote"
|
|
6254
6319
|
}) {
|
|
6255
6320
|
var _a;
|
|
6256
|
-
const [expandedTopicId, setExpandedTopicId] = (0,
|
|
6257
|
-
const [loadingId, setLoadingId] = (0,
|
|
6258
|
-
const [showAll, setShowAll] = (0,
|
|
6259
|
-
const contextCache = (0,
|
|
6260
|
-
const quotesCache = (0,
|
|
6321
|
+
const [expandedTopicId, setExpandedTopicId] = (0, import_react33.useState)(null);
|
|
6322
|
+
const [loadingId, setLoadingId] = (0, import_react33.useState)(null);
|
|
6323
|
+
const [showAll, setShowAll] = (0, import_react33.useState)(false);
|
|
6324
|
+
const contextCache = (0, import_react33.useRef)(/* @__PURE__ */ new Map());
|
|
6325
|
+
const quotesCache = (0, import_react33.useRef)(null);
|
|
6261
6326
|
const polAnswerMap = {};
|
|
6262
6327
|
if (polAnswers) {
|
|
6263
6328
|
polAnswers.forEach((a) => {
|
|
@@ -6316,7 +6381,7 @@ function StanceAccordion({
|
|
|
6316
6381
|
quotesCache.current = [];
|
|
6317
6382
|
}
|
|
6318
6383
|
}
|
|
6319
|
-
const handleToggle = (0,
|
|
6384
|
+
const handleToggle = (0, import_react33.useCallback)(
|
|
6320
6385
|
async (topicId) => {
|
|
6321
6386
|
if (expandedTopicId === topicId) {
|
|
6322
6387
|
setExpandedTopicId(null);
|
|
@@ -6333,7 +6398,7 @@ function StanceAccordion({
|
|
|
6333
6398
|
},
|
|
6334
6399
|
[expandedTopicId, politicianId, apiUrl]
|
|
6335
6400
|
);
|
|
6336
|
-
(0,
|
|
6401
|
+
(0, import_react33.useEffect)(() => {
|
|
6337
6402
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
6338
6403
|
handleToggle(String(initialExpandedTopicId));
|
|
6339
6404
|
}
|
|
@@ -6349,13 +6414,13 @@ function StanceAccordion({
|
|
|
6349
6414
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
6350
6415
|
}
|
|
6351
6416
|
}
|
|
6352
|
-
return /* @__PURE__ */
|
|
6417
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
6353
6418
|
"div",
|
|
6354
6419
|
{
|
|
6355
6420
|
className: "flex flex-col",
|
|
6356
6421
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
6357
6422
|
},
|
|
6358
|
-
/* @__PURE__ */
|
|
6423
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
6359
6424
|
"h3",
|
|
6360
6425
|
{
|
|
6361
6426
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -6378,15 +6443,15 @@ function StanceAccordion({
|
|
|
6378
6443
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
6379
6444
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
6380
6445
|
}) : [];
|
|
6381
|
-
return /* @__PURE__ */
|
|
6446
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
6382
6447
|
"button",
|
|
6383
6448
|
{
|
|
6384
6449
|
type: "button",
|
|
6385
6450
|
onClick: () => handleToggle(topicId),
|
|
6386
6451
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
6387
6452
|
},
|
|
6388
|
-
/* @__PURE__ */
|
|
6389
|
-
/* @__PURE__ */
|
|
6453
|
+
/* @__PURE__ */ import_react33.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react33.default.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ import_react33.default.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ import_react33.default.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
6454
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
6390
6455
|
"svg",
|
|
6391
6456
|
{
|
|
6392
6457
|
width: "16",
|
|
@@ -6403,9 +6468,9 @@ function StanceAccordion({
|
|
|
6403
6468
|
transition: "transform 0.2s ease"
|
|
6404
6469
|
}
|
|
6405
6470
|
},
|
|
6406
|
-
/* @__PURE__ */
|
|
6471
|
+
/* @__PURE__ */ import_react33.default.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
6407
6472
|
)
|
|
6408
|
-
), /* @__PURE__ */
|
|
6473
|
+
), /* @__PURE__ */ import_react33.default.createElement(
|
|
6409
6474
|
"div",
|
|
6410
6475
|
{
|
|
6411
6476
|
style: {
|
|
@@ -6414,7 +6479,7 @@ function StanceAccordion({
|
|
|
6414
6479
|
transition: "grid-template-rows 0.25s ease"
|
|
6415
6480
|
}
|
|
6416
6481
|
},
|
|
6417
|
-
/* @__PURE__ */
|
|
6482
|
+
/* @__PURE__ */ import_react33.default.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ import_react33.default.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ import_react33.default.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
6418
6483
|
"div",
|
|
6419
6484
|
{
|
|
6420
6485
|
style: {
|
|
@@ -6426,14 +6491,14 @@ function StanceAccordion({
|
|
|
6426
6491
|
animation: "ev-spin 0.8s linear infinite"
|
|
6427
6492
|
}
|
|
6428
6493
|
}
|
|
6429
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
6494
|
+
)), !isLoading && cached && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, cached.reasoning ? /* @__PURE__ */ import_react33.default.createElement(
|
|
6430
6495
|
"p",
|
|
6431
6496
|
{
|
|
6432
6497
|
className: "text-sm text-neutral-700 mb-3",
|
|
6433
6498
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
6434
6499
|
},
|
|
6435
6500
|
cached.reasoning
|
|
6436
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
6501
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ import_react33.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react33.default.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ import_react33.default.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ import_react33.default.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
6437
6502
|
"a",
|
|
6438
6503
|
{
|
|
6439
6504
|
href: src,
|
|
@@ -6441,9 +6506,9 @@ function StanceAccordion({
|
|
|
6441
6506
|
rel: "noreferrer",
|
|
6442
6507
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
6443
6508
|
},
|
|
6444
|
-
/* @__PURE__ */
|
|
6445
|
-
/* @__PURE__ */
|
|
6446
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
6509
|
+
/* @__PURE__ */ import_react33.default.createElement(Favicon, { url: src }),
|
|
6510
|
+
/* @__PURE__ */ import_react33.default.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
6511
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ import_react33.default.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ import_react33.default.createElement(
|
|
6447
6512
|
"p",
|
|
6448
6513
|
{
|
|
6449
6514
|
style: {
|
|
@@ -6460,7 +6525,7 @@ function StanceAccordion({
|
|
|
6460
6525
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
6461
6526
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
6462
6527
|
const sourceName = quote.source_name || quote.sourceName;
|
|
6463
|
-
return /* @__PURE__ */
|
|
6528
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
6464
6529
|
"div",
|
|
6465
6530
|
{
|
|
6466
6531
|
key: quote.id,
|
|
@@ -6472,7 +6537,7 @@ function StanceAccordion({
|
|
|
6472
6537
|
marginBottom: "8px"
|
|
6473
6538
|
}
|
|
6474
6539
|
},
|
|
6475
|
-
/* @__PURE__ */
|
|
6540
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
6476
6541
|
"p",
|
|
6477
6542
|
{
|
|
6478
6543
|
style: {
|
|
@@ -6485,7 +6550,7 @@ function StanceAccordion({
|
|
|
6485
6550
|
},
|
|
6486
6551
|
quote.text
|
|
6487
6552
|
),
|
|
6488
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
6553
|
+
verdict === "agreed" && /* @__PURE__ */ import_react33.default.createElement(
|
|
6489
6554
|
"span",
|
|
6490
6555
|
{
|
|
6491
6556
|
style: {
|
|
@@ -6502,10 +6567,10 @@ function StanceAccordion({
|
|
|
6502
6567
|
flexShrink: 0
|
|
6503
6568
|
}
|
|
6504
6569
|
},
|
|
6505
|
-
/* @__PURE__ */
|
|
6570
|
+
/* @__PURE__ */ import_react33.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react33.default.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
6506
6571
|
"Agreed"
|
|
6507
6572
|
),
|
|
6508
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
6573
|
+
verdict === "disagreed" && /* @__PURE__ */ import_react33.default.createElement(
|
|
6509
6574
|
"span",
|
|
6510
6575
|
{
|
|
6511
6576
|
style: {
|
|
@@ -6522,10 +6587,10 @@ function StanceAccordion({
|
|
|
6522
6587
|
flexShrink: 0
|
|
6523
6588
|
}
|
|
6524
6589
|
},
|
|
6525
|
-
/* @__PURE__ */
|
|
6590
|
+
/* @__PURE__ */ import_react33.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react33.default.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
6526
6591
|
"Disagreed"
|
|
6527
6592
|
),
|
|
6528
|
-
sourceName && /* @__PURE__ */
|
|
6593
|
+
sourceName && /* @__PURE__ */ import_react33.default.createElement(
|
|
6529
6594
|
"a",
|
|
6530
6595
|
{
|
|
6531
6596
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -6542,10 +6607,10 @@ function StanceAccordion({
|
|
|
6542
6607
|
sourceName
|
|
6543
6608
|
)
|
|
6544
6609
|
);
|
|
6545
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
6610
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ import_react33.default.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
|
|
6546
6611
|
));
|
|
6547
6612
|
}),
|
|
6548
|
-
hasToggle && /* @__PURE__ */
|
|
6613
|
+
hasToggle && /* @__PURE__ */ import_react33.default.createElement(
|
|
6549
6614
|
"button",
|
|
6550
6615
|
{
|
|
6551
6616
|
type: "button",
|