@empoweredvote/ev-ui 0.6.2 → 0.6.4

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 CHANGED
@@ -82,6 +82,7 @@ __export(index_exports, {
82
82
  spacing: () => spacing,
83
83
  textStyles: () => textStyles,
84
84
  tierColors: () => tierColors,
85
+ useEvContextPromotion: () => useEvContextPromotion,
85
86
  useMediaQuery: () => useMediaQuery,
86
87
  zIndex: () => zIndex
87
88
  });
@@ -2467,7 +2468,7 @@ function CompassCardHorizontal({
2467
2468
  textTransform: "uppercase",
2468
2469
  padding: "6px 0",
2469
2470
  pointerEvents: "none"
2470
- } }, "Running Unopposed")),
2471
+ } }, typeof politician.running_unopposed === "string" ? politician.running_unopposed : "Running Unopposed")),
2471
2472
  /* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1, minWidth: 0, padding: spacing[4], paddingLeft: spacing[3] } }, /* @__PURE__ */ import_react13.default.createElement(
2472
2473
  CompassCardHorizontalMeta,
2473
2474
  {
@@ -2817,7 +2818,7 @@ function CompassCardVertical({
2817
2818
  textTransform: "uppercase",
2818
2819
  padding: "6px 0",
2819
2820
  borderRadius: borderRadius.sm
2820
- } }, "Running Unopposed"),
2821
+ } }, typeof politician.running_unopposed === "string" ? politician.running_unopposed : "Running Unopposed"),
2821
2822
  /* @__PURE__ */ import_react14.default.createElement("div", { style: {
2822
2823
  flex: 1,
2823
2824
  padding: spacing[4],
@@ -2990,6 +2991,9 @@ var evContext = {
2990
2991
  if (current.authed.compass !== void 0) out.compass = current.authed.compass;
2991
2992
  if (current.authed.address !== void 0) out.address = current.authed.address;
2992
2993
  if (current.authed.verdicts !== void 0) out.verdicts = current.authed.verdicts;
2994
+ if (current.authed.promotionDismissed !== void 0) {
2995
+ out.promotionDismissed = current.authed.promotionDismissed;
2996
+ }
2993
2997
  return out;
2994
2998
  },
2995
2999
  /**
@@ -3014,6 +3018,9 @@ var evContext = {
3014
3018
  if (patch.compass !== void 0) allowed.compass = patch.compass;
3015
3019
  if (patch.address !== void 0) allowed.address = patch.address;
3016
3020
  if (patch.verdicts !== void 0) allowed.verdicts = patch.verdicts;
3021
+ if (patch.promotionDismissed !== void 0) {
3022
+ allowed.promotionDismissed = patch.promotionDismissed;
3023
+ }
3017
3024
  if (Object.keys(allowed).length === 0) return false;
3018
3025
  const current = await this.get() || {};
3019
3026
  const priorAuthed = current.authed && current.authed.userId === userId ? current.authed : null;
@@ -3022,10 +3029,17 @@ var evContext = {
3022
3029
  if (priorAuthed.compass !== void 0) nextAuthed.compass = priorAuthed.compass;
3023
3030
  if (priorAuthed.address !== void 0) nextAuthed.address = priorAuthed.address;
3024
3031
  if (priorAuthed.verdicts !== void 0) nextAuthed.verdicts = priorAuthed.verdicts;
3032
+ if (priorAuthed.promotionDismissed !== void 0) {
3033
+ nextAuthed.promotionDismissed = priorAuthed.promotionDismissed;
3034
+ }
3025
3035
  }
3026
3036
  if (allowed.compass !== void 0) nextAuthed.compass = allowed.compass;
3027
3037
  if (allowed.address !== void 0) nextAuthed.address = allowed.address;
3028
3038
  if (allowed.verdicts !== void 0) nextAuthed.verdicts = allowed.verdicts;
3039
+ if (allowed.promotionDismissed !== void 0 && allowed.promotionDismissed !== null && typeof allowed.promotionDismissed === "object") {
3040
+ const prior = priorAuthed && priorAuthed.promotionDismissed && typeof priorAuthed.promotionDismissed === "object" ? priorAuthed.promotionDismissed : {};
3041
+ nextAuthed.promotionDismissed = { ...prior, ...allowed.promotionDismissed };
3042
+ }
3029
3043
  return this.set({ ...current, authed: nextAuthed });
3030
3044
  },
3031
3045
  /**
@@ -5794,15 +5808,174 @@ function computeTierCoverage(topics) {
5794
5808
  return counts;
5795
5809
  }
5796
5810
 
5811
+ // src/useEvContextPromotion.js
5812
+ var import_react31 = require("react");
5813
+ function useEvContextPromotion({
5814
+ domain,
5815
+ isLoggedIn,
5816
+ userId,
5817
+ apiData,
5818
+ apiWriter,
5819
+ enabled = true
5820
+ }) {
5821
+ const [shouldPrompt, setShouldPrompt] = (0, import_react31.useState)(false);
5822
+ const [payload, setPayload] = (0, import_react31.useState)(null);
5823
+ const [status, setStatus] = (0, import_react31.useState)("idle");
5824
+ const [error, setError] = (0, import_react31.useState)(null);
5825
+ const apiDataRef = (0, import_react31.useRef)(apiData);
5826
+ apiDataRef.current = apiData;
5827
+ const userIdRef = (0, import_react31.useRef)(userId);
5828
+ userIdRef.current = userId;
5829
+ const isLoggedInRef = (0, import_react31.useRef)(isLoggedIn);
5830
+ isLoggedInRef.current = isLoggedIn;
5831
+ const enabledRef = (0, import_react31.useRef)(enabled);
5832
+ enabledRef.current = enabled;
5833
+ const domainRef = (0, import_react31.useRef)(domain);
5834
+ domainRef.current = domain;
5835
+ const apiWriterRef = (0, import_react31.useRef)(apiWriter);
5836
+ apiWriterRef.current = apiWriter;
5837
+ const detect = (0, import_react31.useCallback)(async () => {
5838
+ const _enabled = enabledRef.current;
5839
+ const _isLoggedIn = isLoggedInRef.current;
5840
+ const _userId = userIdRef.current;
5841
+ const _apiData = apiDataRef.current;
5842
+ const _domain = domainRef.current;
5843
+ if (!_enabled || !_isLoggedIn || !_userId) {
5844
+ setShouldPrompt(false);
5845
+ setPayload(null);
5846
+ return;
5847
+ }
5848
+ if (!isApiEmpty(_domain, _apiData)) {
5849
+ setShouldPrompt(false);
5850
+ setPayload(null);
5851
+ return;
5852
+ }
5853
+ try {
5854
+ const slice = await evContext.getAuthedSlice(_userId);
5855
+ if (slice && slice.promotionDismissed && slice.promotionDismissed[_domain] === true) {
5856
+ setShouldPrompt(false);
5857
+ setPayload(null);
5858
+ return;
5859
+ }
5860
+ } catch {
5861
+ }
5862
+ let guest = null;
5863
+ try {
5864
+ guest = await evContext.get();
5865
+ } catch {
5866
+ guest = null;
5867
+ }
5868
+ if (isGuestPopulated(_domain, guest)) {
5869
+ setShouldPrompt(true);
5870
+ setPayload(guest[_domain]);
5871
+ } else {
5872
+ setShouldPrompt(false);
5873
+ setPayload(null);
5874
+ }
5875
+ }, []);
5876
+ (0, import_react31.useEffect)(() => {
5877
+ detect();
5878
+ }, [detect, isLoggedIn, userId, apiData, enabled, domain]);
5879
+ (0, import_react31.useEffect)(() => {
5880
+ const unsub = evContext.subscribe(() => {
5881
+ detect();
5882
+ });
5883
+ return unsub;
5884
+ }, [detect]);
5885
+ const promote = (0, import_react31.useCallback)(async () => {
5886
+ const _userId = userIdRef.current;
5887
+ const _domain = domainRef.current;
5888
+ const _writer = apiWriterRef.current;
5889
+ const _payload = payload;
5890
+ if (!_userId || !_payload || typeof _writer !== "function") return;
5891
+ setStatus("saving");
5892
+ setError(null);
5893
+ try {
5894
+ await _writer(_payload);
5895
+ try {
5896
+ await evContext.setAuthedSlice(_userId, { [_domain]: _payload });
5897
+ } catch {
5898
+ }
5899
+ try {
5900
+ await evContext.setAuthedSlice(_userId, {
5901
+ promotionDismissed: { [_domain]: false }
5902
+ });
5903
+ } catch {
5904
+ }
5905
+ setStatus("saved");
5906
+ setShouldPrompt(false);
5907
+ } catch (err) {
5908
+ setStatus("error");
5909
+ setError(err instanceof Error ? err : new Error(String(err)));
5910
+ }
5911
+ }, [payload]);
5912
+ const dismiss = (0, import_react31.useCallback)(async () => {
5913
+ const _userId = userIdRef.current;
5914
+ const _domain = domainRef.current;
5915
+ if (!_userId) return;
5916
+ try {
5917
+ await evContext.setAuthedSlice(_userId, {
5918
+ promotionDismissed: { [_domain]: true }
5919
+ });
5920
+ } catch {
5921
+ }
5922
+ setShouldPrompt(false);
5923
+ }, []);
5924
+ return { shouldPrompt, payload, promote, dismiss, status, error };
5925
+ }
5926
+ function isApiEmpty(domain, apiData) {
5927
+ if (apiData === null || apiData === void 0) return true;
5928
+ if (domain === "compass") {
5929
+ if (typeof apiData !== "object") return false;
5930
+ if (Array.isArray(apiData)) return apiData.length === 0;
5931
+ if (apiData.answers && typeof apiData.answers === "object") {
5932
+ return Object.keys(apiData.answers).length === 0;
5933
+ }
5934
+ return Object.keys(apiData).length === 0;
5935
+ }
5936
+ if (domain === "address") {
5937
+ if (typeof apiData === "string") return apiData.trim().length === 0;
5938
+ if (typeof apiData !== "object") return false;
5939
+ const a = apiData;
5940
+ const hasAddr = typeof a.formatted === "string" && a.formatted.length > 0;
5941
+ const hasAddrAlt = typeof a.addr === "string" && a.addr.length > 0;
5942
+ const hasLat = typeof a.lat === "number" || typeof a.latitude === "number";
5943
+ return !(hasAddr || hasAddrAlt || hasLat);
5944
+ }
5945
+ if (domain === "verdicts") {
5946
+ if (typeof apiData !== "object") return false;
5947
+ if (Array.isArray(apiData)) return apiData.length === 0;
5948
+ return Object.keys(apiData).length === 0;
5949
+ }
5950
+ return false;
5951
+ }
5952
+ function isGuestPopulated(domain, fullEvContext) {
5953
+ if (!fullEvContext || typeof fullEvContext !== "object") return false;
5954
+ const slice = fullEvContext[domain];
5955
+ if (!slice || typeof slice !== "object") return false;
5956
+ if (domain === "compass") {
5957
+ const ans = slice.answers || slice.a;
5958
+ if (ans && typeof ans === "object") return Object.keys(ans).length > 0;
5959
+ return false;
5960
+ }
5961
+ if (domain === "address") {
5962
+ return typeof slice.formatted === "string" && slice.formatted.length > 0 || typeof slice.addr === "string" && slice.addr.length > 0;
5963
+ }
5964
+ if (domain === "verdicts") {
5965
+ return Object.keys(slice).length > 0;
5966
+ }
5967
+ return false;
5968
+ }
5969
+
5797
5970
  // src/StanceAccordion.jsx
5798
- var import_react32 = __toESM(require("react"));
5971
+ var import_react33 = __toESM(require("react"));
5799
5972
 
5800
5973
  // src/Favicon.jsx
5801
- var import_react31 = __toESM(require("react"));
5974
+ var import_react32 = __toESM(require("react"));
5802
5975
  function Favicon({ url, size = 16 }) {
5803
5976
  try {
5804
5977
  const domain = new URL(url).hostname;
5805
- return /* @__PURE__ */ import_react31.default.createElement(
5978
+ return /* @__PURE__ */ import_react32.default.createElement(
5806
5979
  "img",
5807
5980
  {
5808
5981
  src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
@@ -5813,7 +5986,7 @@ function Favicon({ url, size = 16 }) {
5813
5986
  }
5814
5987
  );
5815
5988
  } catch {
5816
- return /* @__PURE__ */ import_react31.default.createElement(
5989
+ return /* @__PURE__ */ import_react32.default.createElement(
5817
5990
  "svg",
5818
5991
  {
5819
5992
  width: size,
@@ -5824,8 +5997,8 @@ function Favicon({ url, size = 16 }) {
5824
5997
  strokeWidth: "1.5",
5825
5998
  style: { verticalAlign: "middle", flexShrink: 0 }
5826
5999
  },
5827
- /* @__PURE__ */ import_react31.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
5828
- /* @__PURE__ */ import_react31.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
6000
+ /* @__PURE__ */ import_react32.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
6001
+ /* @__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" })
5829
6002
  );
5830
6003
  }
5831
6004
  }
@@ -5856,11 +6029,11 @@ function StanceAccordion({
5856
6029
  apiUrl = "https://api.empowered.vote"
5857
6030
  }) {
5858
6031
  var _a;
5859
- const [expandedTopicId, setExpandedTopicId] = (0, import_react32.useState)(null);
5860
- const [loadingId, setLoadingId] = (0, import_react32.useState)(null);
5861
- const [showAll, setShowAll] = (0, import_react32.useState)(false);
5862
- const contextCache = (0, import_react32.useRef)(/* @__PURE__ */ new Map());
5863
- const quotesCache = (0, import_react32.useRef)(null);
6032
+ const [expandedTopicId, setExpandedTopicId] = (0, import_react33.useState)(null);
6033
+ const [loadingId, setLoadingId] = (0, import_react33.useState)(null);
6034
+ const [showAll, setShowAll] = (0, import_react33.useState)(false);
6035
+ const contextCache = (0, import_react33.useRef)(/* @__PURE__ */ new Map());
6036
+ const quotesCache = (0, import_react33.useRef)(null);
5864
6037
  const polAnswerMap = {};
5865
6038
  if (polAnswers) {
5866
6039
  polAnswers.forEach((a) => {
@@ -5919,7 +6092,7 @@ function StanceAccordion({
5919
6092
  quotesCache.current = [];
5920
6093
  }
5921
6094
  }
5922
- const handleToggle = (0, import_react32.useCallback)(
6095
+ const handleToggle = (0, import_react33.useCallback)(
5923
6096
  async (topicId) => {
5924
6097
  if (expandedTopicId === topicId) {
5925
6098
  setExpandedTopicId(null);
@@ -5936,7 +6109,7 @@ function StanceAccordion({
5936
6109
  },
5937
6110
  [expandedTopicId, politicianId, apiUrl]
5938
6111
  );
5939
- (0, import_react32.useEffect)(() => {
6112
+ (0, import_react33.useEffect)(() => {
5940
6113
  if (initialExpandedTopicId && topics && topics.length > 0) {
5941
6114
  handleToggle(String(initialExpandedTopicId));
5942
6115
  }
@@ -5952,13 +6125,13 @@ function StanceAccordion({
5952
6125
  visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
5953
6126
  }
5954
6127
  }
5955
- return /* @__PURE__ */ import_react32.default.createElement(
6128
+ return /* @__PURE__ */ import_react33.default.createElement(
5956
6129
  "div",
5957
6130
  {
5958
6131
  className: "flex flex-col",
5959
6132
  style: { fontFamily: "'Manrope', sans-serif" }
5960
6133
  },
5961
- /* @__PURE__ */ import_react32.default.createElement(
6134
+ /* @__PURE__ */ import_react33.default.createElement(
5962
6135
  "h3",
5963
6136
  {
5964
6137
  className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
@@ -5980,15 +6153,15 @@ function StanceAccordion({
5980
6153
  if (topic.topic_key) return q.issue === topic.topic_key;
5981
6154
  return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
5982
6155
  }) : [];
5983
- return /* @__PURE__ */ import_react32.default.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ import_react32.default.createElement(
6156
+ return /* @__PURE__ */ import_react33.default.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ import_react33.default.createElement(
5984
6157
  "button",
5985
6158
  {
5986
6159
  type: "button",
5987
6160
  onClick: () => handleToggle(topicId),
5988
6161
  className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
5989
6162
  },
5990
- /* @__PURE__ */ import_react32.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
5991
- /* @__PURE__ */ import_react32.default.createElement(
6163
+ /* @__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)),
6164
+ /* @__PURE__ */ import_react33.default.createElement(
5992
6165
  "svg",
5993
6166
  {
5994
6167
  width: "16",
@@ -6005,9 +6178,9 @@ function StanceAccordion({
6005
6178
  transition: "transform 0.2s ease"
6006
6179
  }
6007
6180
  },
6008
- /* @__PURE__ */ import_react32.default.createElement("polyline", { points: "9 18 15 12 9 6" })
6181
+ /* @__PURE__ */ import_react33.default.createElement("polyline", { points: "9 18 15 12 9 6" })
6009
6182
  )
6010
- ), /* @__PURE__ */ import_react32.default.createElement(
6183
+ ), /* @__PURE__ */ import_react33.default.createElement(
6011
6184
  "div",
6012
6185
  {
6013
6186
  style: {
@@ -6016,7 +6189,7 @@ function StanceAccordion({
6016
6189
  transition: "grid-template-rows 0.25s ease"
6017
6190
  }
6018
6191
  },
6019
- /* @__PURE__ */ import_react32.default.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ import_react32.default.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ import_react32.default.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ import_react32.default.createElement(
6192
+ /* @__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(
6020
6193
  "div",
6021
6194
  {
6022
6195
  style: {
@@ -6028,14 +6201,14 @@ function StanceAccordion({
6028
6201
  animation: "ev-spin 0.8s linear infinite"
6029
6202
  }
6030
6203
  }
6031
- )), !isLoading && cached && /* @__PURE__ */ import_react32.default.createElement(import_react32.default.Fragment, null, cached.reasoning ? /* @__PURE__ */ import_react32.default.createElement(
6204
+ )), !isLoading && cached && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, cached.reasoning ? /* @__PURE__ */ import_react33.default.createElement(
6032
6205
  "p",
6033
6206
  {
6034
6207
  className: "text-sm text-neutral-700 mb-3",
6035
6208
  style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
6036
6209
  },
6037
6210
  cached.reasoning
6038
- ) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ import_react32.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react32.default.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ import_react32.default.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ import_react32.default.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ import_react32.default.createElement(
6211
+ ) : 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(
6039
6212
  "a",
6040
6213
  {
6041
6214
  href: src,
@@ -6043,9 +6216,9 @@ function StanceAccordion({
6043
6216
  rel: "noreferrer",
6044
6217
  className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
6045
6218
  },
6046
- /* @__PURE__ */ import_react32.default.createElement(Favicon, { url: src }),
6047
- /* @__PURE__ */ import_react32.default.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
6048
- ))))), topicQuotes.length > 0 && /* @__PURE__ */ import_react32.default.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ import_react32.default.createElement(
6219
+ /* @__PURE__ */ import_react33.default.createElement(Favicon, { url: src }),
6220
+ /* @__PURE__ */ import_react33.default.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
6221
+ ))))), topicQuotes.length > 0 && /* @__PURE__ */ import_react33.default.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ import_react33.default.createElement(
6049
6222
  "p",
6050
6223
  {
6051
6224
  style: {
@@ -6062,7 +6235,7 @@ function StanceAccordion({
6062
6235
  const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
6063
6236
  const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
6064
6237
  const sourceName = quote.source_name || quote.sourceName;
6065
- return /* @__PURE__ */ import_react32.default.createElement(
6238
+ return /* @__PURE__ */ import_react33.default.createElement(
6066
6239
  "div",
6067
6240
  {
6068
6241
  key: quote.id,
@@ -6074,7 +6247,7 @@ function StanceAccordion({
6074
6247
  marginBottom: "8px"
6075
6248
  }
6076
6249
  },
6077
- /* @__PURE__ */ import_react32.default.createElement(
6250
+ /* @__PURE__ */ import_react33.default.createElement(
6078
6251
  "p",
6079
6252
  {
6080
6253
  style: {
@@ -6087,7 +6260,7 @@ function StanceAccordion({
6087
6260
  },
6088
6261
  quote.text
6089
6262
  ),
6090
- verdict === "agreed" && /* @__PURE__ */ import_react32.default.createElement(
6263
+ verdict === "agreed" && /* @__PURE__ */ import_react33.default.createElement(
6091
6264
  "span",
6092
6265
  {
6093
6266
  style: {
@@ -6104,10 +6277,10 @@ function StanceAccordion({
6104
6277
  flexShrink: 0
6105
6278
  }
6106
6279
  },
6107
- /* @__PURE__ */ import_react32.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react32.default.createElement("path", { d: "M5 13l4 4L19 7" })),
6280
+ /* @__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" })),
6108
6281
  "Agreed"
6109
6282
  ),
6110
- verdict === "disagreed" && /* @__PURE__ */ import_react32.default.createElement(
6283
+ verdict === "disagreed" && /* @__PURE__ */ import_react33.default.createElement(
6111
6284
  "span",
6112
6285
  {
6113
6286
  style: {
@@ -6124,10 +6297,10 @@ function StanceAccordion({
6124
6297
  flexShrink: 0
6125
6298
  }
6126
6299
  },
6127
- /* @__PURE__ */ import_react32.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react32.default.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
6300
+ /* @__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" })),
6128
6301
  "Disagreed"
6129
6302
  ),
6130
- sourceName && /* @__PURE__ */ import_react32.default.createElement(
6303
+ sourceName && /* @__PURE__ */ import_react33.default.createElement(
6131
6304
  "a",
6132
6305
  {
6133
6306
  href: quote.source_url || quote.sourceUrl,
@@ -6144,10 +6317,10 @@ function StanceAccordion({
6144
6317
  sourceName
6145
6318
  )
6146
6319
  );
6147
- })), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ import_react32.default.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
6320
+ })), !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."))))
6148
6321
  ));
6149
6322
  }),
6150
- hasToggle && /* @__PURE__ */ import_react32.default.createElement(
6323
+ hasToggle && /* @__PURE__ */ import_react33.default.createElement(
6151
6324
  "button",
6152
6325
  {
6153
6326
  type: "button",
@@ -6214,6 +6387,7 @@ function StanceAccordion({
6214
6387
  spacing,
6215
6388
  textStyles,
6216
6389
  tierColors,
6390
+ useEvContextPromotion,
6217
6391
  useMediaQuery,
6218
6392
  zIndex
6219
6393
  });