@sensiblestats/widget-react 0.140.0 → 0.142.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +1 -1
- package/dist/index.cjs +241 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +242 -48
- package/dist/index.js.map +1 -1
- package/dist/styles.css +20 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -215,6 +215,12 @@ var BUNDLED_EN_GB = {
|
|
|
215
215
|
"widget.v8BuilderSingles": "Singles",
|
|
216
216
|
"widget.v8BuilderTotal": "total",
|
|
217
217
|
"widget.v8BuilderAny": "Any",
|
|
218
|
+
"widget.v8BuilderCustomLabel": "Type your own total",
|
|
219
|
+
"widget.v8BuilderCustomPlaceholder": "e.g. {example}",
|
|
220
|
+
"widget.v8BuilderCustomSet": "Set",
|
|
221
|
+
"widget.v8BuilderCustomRange": "Enter a total above 1.01 and up to 1000.",
|
|
222
|
+
"widget.v8BuilderCustomUnreadable": "Type the total like {example}.",
|
|
223
|
+
"widget.v8BuilderCustomEdit": "Your total {total}, edit",
|
|
218
224
|
"widget.v8BuilderLoading": "Loading\u2026",
|
|
219
225
|
"widget.v8BuilderError": "Couldn't load this right now.",
|
|
220
226
|
"widget.v8BuilderRetry": "Try again",
|
|
@@ -284,6 +290,8 @@ var BUNDLED_EN_GB = {
|
|
|
284
290
|
"widget.presets.moreMatches": "More matches",
|
|
285
291
|
"widget.presets.changeCombo": "Change total or matches",
|
|
286
292
|
"widget.presets.standoutAsk": "Standout matches today",
|
|
293
|
+
"widget.presets.legFactOver": "Went over in {hits} of the last {games} games",
|
|
294
|
+
"widget.presets.legFactUnder": "Went under in {hits} of the last {games} games",
|
|
287
295
|
"widget.nba.with": "With",
|
|
288
296
|
"widget.nba.without": "Without",
|
|
289
297
|
"widget.nba.line": "Line",
|
|
@@ -1106,6 +1114,9 @@ var ROW_LEAVES = {
|
|
|
1106
1114
|
favRemove: (c) => (name) => c.t("widget.favRemove", { name }),
|
|
1107
1115
|
favStar: (c) => (name) => c.t("widget.favStar", { name }),
|
|
1108
1116
|
favUnstar: (c) => (name) => c.t("widget.favUnstar", { name }),
|
|
1117
|
+
v8BuilderCustomPlaceholder: (c) => (example) => c.t("widget.v8BuilderCustomPlaceholder", { example }),
|
|
1118
|
+
v8BuilderCustomUnreadable: (c) => (example) => c.t("widget.v8BuilderCustomUnreadable", { example }),
|
|
1119
|
+
v8BuilderCustomEdit: (c) => (total) => c.t("widget.v8BuilderCustomEdit", { total }),
|
|
1109
1120
|
v8Follow: (c) => (name) => c.t("widget.v8Follow", { name }),
|
|
1110
1121
|
v8PricesAsOf: (c) => (time) => c.t("widget.v8PricesAsOf", { time }),
|
|
1111
1122
|
v8InjuryAsOf: (c) => (time) => c.t("widget.v8InjuryAsOf", { time }),
|
|
@@ -1121,6 +1132,8 @@ var ROW_LEAVES = {
|
|
|
1121
1132
|
v8Hits: (c) => (hits, window2) => c.t("widget.v8Hits", { hits, window: window2 }),
|
|
1122
1133
|
"presets.comboDisplay": (c) => (legs, total) => c.t("widget.presets.comboDisplay", { legs, total }),
|
|
1123
1134
|
"presets.comboMessage": (c) => (legs, total) => c.t("widget.presets.comboMessage", { legs, total }),
|
|
1135
|
+
"presets.legFactOver": (c) => (hits, games) => c.t("widget.presets.legFactOver", { hits, games }),
|
|
1136
|
+
"presets.legFactUnder": (c) => (hits, games) => c.t("widget.presets.legFactUnder", { hits, games }),
|
|
1124
1137
|
"nba.over": (c) => (line) => c.t("widget.nba.over", { line }),
|
|
1125
1138
|
"nba.under": (c) => (line) => c.t("widget.nba.under", { line }),
|
|
1126
1139
|
"nba.lastN": (c) => (n) => c.t("widget.nba.lastN", { count: n }),
|
|
@@ -1297,9 +1310,29 @@ function parseOddsFormat(value) {
|
|
|
1297
1310
|
const v = typeof value === "string" ? value.trim().toLowerCase() : "";
|
|
1298
1311
|
return v === "decimal" || v === "american" || v === "fractional" ? v : void 0;
|
|
1299
1312
|
}
|
|
1313
|
+
var CUSTOM_TOTAL_EXAMPLE = { decimal: "7.50", fractional: "13/2", american: "+650" };
|
|
1314
|
+
var roundCents = (x) => Math.round(x * 100 + 1e-9) / 100;
|
|
1315
|
+
function parseCustomTotal(text2, format2) {
|
|
1316
|
+
const t = text2.trim().replace(/\u2212/g, "-").replace(/^([+-]?\d+)[.,]$/, "$1");
|
|
1317
|
+
const point = /^(\d{0,9})[.,](\d{1,9})$/.exec(t);
|
|
1318
|
+
const whole = /^\d{1,12}$/.test(t);
|
|
1319
|
+
const fraction = format2 === "fractional" ? /^(\d{1,9})\s*\/\s*(\d{1,9})$/.exec(t) : null;
|
|
1320
|
+
const american = format2 === "american" ? /^([+-]?)(\d{1,12})$/.exec(t) : null;
|
|
1321
|
+
let value = null;
|
|
1322
|
+
if (point) value = Number(`${point[1] || "0"}.${point[2]}`);
|
|
1323
|
+
else if (format2 === "decimal" && whole) value = Number(t);
|
|
1324
|
+
else if (format2 === "fractional" && whole) value = 1 + Number(t);
|
|
1325
|
+
else if (format2 === "fractional" && /^ev(s|ens)$/i.test(t)) value = 2;
|
|
1326
|
+
else if (fraction && Number(fraction[2]) > 0) value = 1 + Number(fraction[1]) / Number(fraction[2]);
|
|
1327
|
+
else if (american && Number(american[2]) >= 100) value = american[1] === "-" ? 1 + 100 / Number(american[2]) : 1 + Number(american[2]) / 100;
|
|
1328
|
+
if (value === null) return { error: "unreadable" };
|
|
1329
|
+
const cents2 = roundCents(value);
|
|
1330
|
+
if (!(cents2 > 1.01 && cents2 <= 1e3)) return { error: "range" };
|
|
1331
|
+
return { decimal: cents2.toFixed(2), text: format2 === "fractional" && whole ? `${t}/1` : t };
|
|
1332
|
+
}
|
|
1300
1333
|
|
|
1301
1334
|
// src/version.generated.ts
|
|
1302
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1335
|
+
var WIDGET_REACT_VERSION = "0.142.0";
|
|
1303
1336
|
|
|
1304
1337
|
// src/config.ts
|
|
1305
1338
|
function hostTag(cfg) {
|
|
@@ -1609,6 +1642,12 @@ function normalizeUi(cfg, loaded) {
|
|
|
1609
1642
|
v8BuilderSingles: strings.v8BuilderSingles,
|
|
1610
1643
|
v8BuilderTotal: strings.v8BuilderTotal,
|
|
1611
1644
|
v8BuilderAny: strings.v8BuilderAny,
|
|
1645
|
+
v8BuilderCustomLabel: strings.v8BuilderCustomLabel,
|
|
1646
|
+
v8BuilderCustomPlaceholder: strings.v8BuilderCustomPlaceholder,
|
|
1647
|
+
v8BuilderCustomSet: strings.v8BuilderCustomSet,
|
|
1648
|
+
v8BuilderCustomRange: strings.v8BuilderCustomRange,
|
|
1649
|
+
v8BuilderCustomUnreadable: strings.v8BuilderCustomUnreadable,
|
|
1650
|
+
v8BuilderCustomEdit: strings.v8BuilderCustomEdit,
|
|
1612
1651
|
v8BuilderLoading: strings.v8BuilderLoading,
|
|
1613
1652
|
v8BuilderError: strings.v8BuilderError,
|
|
1614
1653
|
v8BuilderRetry: strings.v8BuilderRetry,
|
|
@@ -2142,6 +2181,9 @@ function toComboLegVM(leg) {
|
|
|
2142
2181
|
const hasStat = !!insightId && !!statText;
|
|
2143
2182
|
if (price === void 0 || matchOddsId === void 0 || matchId === void 0 || !home || !away || !selectionLabel) return null;
|
|
2144
2183
|
const line = str(leg.line);
|
|
2184
|
+
const rawFact = leg.fact && typeof leg.fact === "object" ? leg.fact : void 0;
|
|
2185
|
+
const direction2 = leg.direction === "over" || leg.direction === "under" ? leg.direction : void 0;
|
|
2186
|
+
const fact = rawFact && direction2 && Number.isInteger(rawFact.hits) && Number.isInteger(rawFact.games) && Number.isInteger(rawFact.window) && rawFact.games >= 5 && rawFact.hits >= 0 && rawFact.hits <= rawFact.games && rawFact.games <= rawFact.window ? { hits: rawFact.hits, games: rawFact.games, window: rawFact.window, direction: direction2 } : void 0;
|
|
2145
2187
|
return {
|
|
2146
2188
|
key: `${matchOddsId}`,
|
|
2147
2189
|
matchId,
|
|
@@ -2162,6 +2204,7 @@ function toComboLegVM(leg) {
|
|
|
2162
2204
|
matchOddsId,
|
|
2163
2205
|
quotedAtUtc: str(leg.quotedAtUtc),
|
|
2164
2206
|
...hasStat ? { insightId, statText } : {},
|
|
2207
|
+
...fact ? { fact } : {},
|
|
2165
2208
|
pinEnabled: leg.pinEnabled === true
|
|
2166
2209
|
};
|
|
2167
2210
|
}
|
|
@@ -8352,6 +8395,8 @@ function ComboLegRow({ leg, addToSlipEnabled, ui, slip, monitor, hold, closed })
|
|
|
8352
8395
|
const kickoff = leg.kickoffLabel ?? (kickoffFallback ? `${kickoffFallback.dayLabel} ${kickoffFallback.time}` : void 0);
|
|
8353
8396
|
const selection = addToSlipEnabled ? comboLegToSlipSelection(leg, slip.conversationId) : null;
|
|
8354
8397
|
const showPin = !!monitor && leg.pinEnabled;
|
|
8398
|
+
const factText = leg.fact ? (leg.fact.direction === "over" ? ui.presets.legFactOver : ui.presets.legFactUnder)(leg.fact.hits, leg.fact.games) : void 0;
|
|
8399
|
+
const line = leg.statText ?? factText;
|
|
8355
8400
|
return /* @__PURE__ */ jsxs32("li", { className: "ss-w-combo-leg", children: [
|
|
8356
8401
|
leg.competition || kickoff || showPin ? /* @__PURE__ */ jsxs32("div", { className: "ss-w-combo-leg-meta", children: [
|
|
8357
8402
|
/* @__PURE__ */ jsx37("span", { className: "ss-w-bi-comp", children: leg.competition ?? "" }),
|
|
@@ -8387,7 +8432,7 @@ function ComboLegRow({ leg, addToSlipEnabled, ui, slip, monitor, hold, closed })
|
|
|
8387
8432
|
}
|
|
8388
8433
|
)
|
|
8389
8434
|
] }),
|
|
8390
|
-
|
|
8435
|
+
line ? /* @__PURE__ */ jsx37("p", { className: "ss-w-combo-leg-stat", children: line }) : null
|
|
8391
8436
|
] });
|
|
8392
8437
|
}
|
|
8393
8438
|
function ComboCardView({ vm, ui, slip, monitor }) {
|
|
@@ -10852,7 +10897,8 @@ var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend,
|
|
|
10852
10897
|
// src/components/TabBar.tsx
|
|
10853
10898
|
import { useEffect as useEffect37, useLayoutEffect, useRef as useRef30 } from "react";
|
|
10854
10899
|
import { jsx as jsx70, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
10855
|
-
var TIGHT_LEVELS = [0, 1, 2, 3, 4, 5, 6];
|
|
10900
|
+
var TIGHT_LEVELS = [0, 1, 2, 3, 4, 5, 6, 7];
|
|
10901
|
+
var FOCUS_EDGE = 24;
|
|
10856
10902
|
function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule, hasBuilder = false, gamesEnabled, clubEnabled }) {
|
|
10857
10903
|
const tabs = [
|
|
10858
10904
|
{ tab: "chat", label: ui.tabChat, count: 0, dot: monitor.chatDot },
|
|
@@ -10885,11 +10931,15 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
10885
10931
|
const strip = listRef.current;
|
|
10886
10932
|
if (!strip) return;
|
|
10887
10933
|
const measure = () => {
|
|
10934
|
+
strip.removeAttribute("data-scroll");
|
|
10888
10935
|
for (const tight of TIGHT_LEVELS) {
|
|
10889
10936
|
if (tight === 0) strip.removeAttribute("data-tight");
|
|
10890
10937
|
else strip.setAttribute("data-tight", String(tight));
|
|
10891
10938
|
if (strip.scrollWidth <= strip.clientWidth) return;
|
|
10892
10939
|
}
|
|
10940
|
+
strip.setAttribute("data-scroll", "");
|
|
10941
|
+
const on = strip.querySelector("[data-on]");
|
|
10942
|
+
if (on) strip.scrollLeft = Math.max(0, on.offsetLeft - 16);
|
|
10893
10943
|
};
|
|
10894
10944
|
measure();
|
|
10895
10945
|
const fonts = typeof document !== "undefined" ? document.fonts : void 0;
|
|
@@ -10901,31 +10951,63 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
10901
10951
|
fonts?.removeEventListener?.("loadingdone", measure);
|
|
10902
10952
|
};
|
|
10903
10953
|
}, [labelSignature]);
|
|
10954
|
+
const pointerDown = useRef30(false);
|
|
10955
|
+
const keepFocusedTabInView = (e) => {
|
|
10956
|
+
const strip = e.currentTarget;
|
|
10957
|
+
const tab = e.target;
|
|
10958
|
+
if (pointerDown.current) {
|
|
10959
|
+
pointerDown.current = false;
|
|
10960
|
+
return;
|
|
10961
|
+
}
|
|
10962
|
+
if (!strip.hasAttribute("data-scroll") || !(tab instanceof HTMLElement) || tab === strip) return;
|
|
10963
|
+
const left = tab.offsetLeft - FOCUS_EDGE;
|
|
10964
|
+
const right = tab.offsetLeft + tab.offsetWidth + FOCUS_EDGE - strip.clientWidth;
|
|
10965
|
+
if (strip.scrollLeft > left) strip.scrollLeft = Math.max(0, left);
|
|
10966
|
+
else if (strip.scrollLeft < right) strip.scrollLeft = right;
|
|
10967
|
+
};
|
|
10904
10968
|
if (tabs.length < 2) return null;
|
|
10905
|
-
return /* @__PURE__ */ jsx70(
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
"
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
"aria-label": tab === "live" && count2 > 0 ? `${label} \xB7 ${ui.liveCountLabel(count2)}` : void 0,
|
|
10915
|
-
className: "ss-w-tab",
|
|
10916
|
-
onClick: () => {
|
|
10917
|
-
if (tab !== monitor.activeTab) track({ name: "tab_change", from: monitor.activeTab, to: tab });
|
|
10918
|
-
monitor.setActiveTab(tab);
|
|
10919
|
-
},
|
|
10920
|
-
children: [
|
|
10921
|
-
label,
|
|
10922
|
-
count2 > 0 && /* @__PURE__ */ jsx70("span", { className: "ss-w-tab-count", "aria-hidden": tab === "live" ? true : void 0, children: count2 }),
|
|
10923
|
-
dot && !active && /* @__PURE__ */ jsx70("span", { className: "ss-w-tab-dot", "aria-hidden": "true" })
|
|
10924
|
-
]
|
|
10969
|
+
return /* @__PURE__ */ jsx70(
|
|
10970
|
+
"div",
|
|
10971
|
+
{
|
|
10972
|
+
className: "ss-w-tabs",
|
|
10973
|
+
role: "tablist",
|
|
10974
|
+
ref: listRef,
|
|
10975
|
+
onFocus: keepFocusedTabInView,
|
|
10976
|
+
onPointerDown: () => {
|
|
10977
|
+
pointerDown.current = true;
|
|
10925
10978
|
},
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10979
|
+
onClick: () => {
|
|
10980
|
+
pointerDown.current = false;
|
|
10981
|
+
},
|
|
10982
|
+
onPointerCancel: () => {
|
|
10983
|
+
pointerDown.current = false;
|
|
10984
|
+
},
|
|
10985
|
+
children: tabs.map(({ tab, label, count: count2, dot }) => {
|
|
10986
|
+
const active = monitor.activeTab === tab;
|
|
10987
|
+
return /* @__PURE__ */ jsxs64(
|
|
10988
|
+
"button",
|
|
10989
|
+
{
|
|
10990
|
+
type: "button",
|
|
10991
|
+
role: "tab",
|
|
10992
|
+
"aria-selected": active,
|
|
10993
|
+
"data-on": active ? "" : void 0,
|
|
10994
|
+
"aria-label": tab === "live" && count2 > 0 ? `${label} \xB7 ${ui.liveCountLabel(count2)}` : void 0,
|
|
10995
|
+
className: "ss-w-tab",
|
|
10996
|
+
onClick: () => {
|
|
10997
|
+
if (tab !== monitor.activeTab) track({ name: "tab_change", from: monitor.activeTab, to: tab });
|
|
10998
|
+
monitor.setActiveTab(tab);
|
|
10999
|
+
},
|
|
11000
|
+
children: [
|
|
11001
|
+
label,
|
|
11002
|
+
count2 > 0 && /* @__PURE__ */ jsx70("span", { className: "ss-w-tab-count", "aria-hidden": tab === "live" ? true : void 0, children: count2 }),
|
|
11003
|
+
dot && !active && /* @__PURE__ */ jsx70("span", { className: "ss-w-tab-dot", "aria-hidden": "true" })
|
|
11004
|
+
]
|
|
11005
|
+
},
|
|
11006
|
+
tab
|
|
11007
|
+
);
|
|
11008
|
+
})
|
|
11009
|
+
}
|
|
11010
|
+
);
|
|
10929
11011
|
}
|
|
10930
11012
|
|
|
10931
11013
|
// src/components/MonitorTabs.tsx
|
|
@@ -17184,7 +17266,7 @@ function FavouritesSheet({ ui, controller, sport, sports, onSportChange, onClose
|
|
|
17184
17266
|
}
|
|
17185
17267
|
|
|
17186
17268
|
// src/components/dashboard/v8/SentenceBuilder.tsx
|
|
17187
|
-
import { useEffect as useEffect54, useRef as useRef44, useState as useState80 } from "react";
|
|
17269
|
+
import { useEffect as useEffect54, useId as useId12, useRef as useRef44, useState as useState80 } from "react";
|
|
17188
17270
|
import { Fragment as Fragment43, jsx as jsx141, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
17189
17271
|
var TOTALS = ["any", "3", "5", "10", "20", "50"];
|
|
17190
17272
|
var BASE_LEGS = [1, 2, 3, 4];
|
|
@@ -17218,6 +17300,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17218
17300
|
const openingView = {
|
|
17219
17301
|
legs: preset.legs,
|
|
17220
17302
|
total: asTotal(preset.totalTarget, totals),
|
|
17303
|
+
custom: null,
|
|
17221
17304
|
// All markets opens unless the visitor has a usual market, which is never beaten.
|
|
17222
17305
|
marketKey: marketOptions && !marketOptions.some((m) => m.usual) ? null : preset.marketKey,
|
|
17223
17306
|
gamesId: opening.option?.id ?? null,
|
|
@@ -17234,11 +17317,38 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17234
17317
|
matchIds: v.widen ? [] : v.matchIds,
|
|
17235
17318
|
legs: v.legs,
|
|
17236
17319
|
// The total row is hidden for Singles, so a total picked earlier must not narrow them; the pick stays in state for the way back.
|
|
17237
|
-
total: v.legs === 1 ? "any" : v.total,
|
|
17320
|
+
total: v.legs === 1 ? "any" : v.custom?.decimal ?? v.total,
|
|
17238
17321
|
widen: v.widen,
|
|
17239
17322
|
...operatorUserId ? { operatorUserId } : {},
|
|
17240
17323
|
...anonymousUserId ? { anonymousUserId } : {}
|
|
17241
17324
|
});
|
|
17325
|
+
const [editing, setEditing] = useState80(false);
|
|
17326
|
+
const [draft, setDraft] = useState80("");
|
|
17327
|
+
const [invalid, setInvalid] = useState80(null);
|
|
17328
|
+
const inputRef = useRef44(null);
|
|
17329
|
+
const pencilRef = useRef44(null);
|
|
17330
|
+
const noteId = useId12();
|
|
17331
|
+
const customId = useId12();
|
|
17332
|
+
useEffect54(() => {
|
|
17333
|
+
if (editing) inputRef.current?.focus();
|
|
17334
|
+
}, [editing]);
|
|
17335
|
+
const customLabel = (c) => c.format === oddsFormat ? c.text : c.decimal;
|
|
17336
|
+
useEffect54(() => {
|
|
17337
|
+
if (view.legs === 1) {
|
|
17338
|
+
setEditing(false);
|
|
17339
|
+
setDraft("");
|
|
17340
|
+
setInvalid(null);
|
|
17341
|
+
}
|
|
17342
|
+
}, [view.legs]);
|
|
17343
|
+
const openCustom = () => {
|
|
17344
|
+
setDraft(view.custom ? customLabel(view.custom) : "");
|
|
17345
|
+
setInvalid(null);
|
|
17346
|
+
setEditing(true);
|
|
17347
|
+
};
|
|
17348
|
+
const closeCustom = () => {
|
|
17349
|
+
setEditing(false);
|
|
17350
|
+
pencilRef.current?.focus();
|
|
17351
|
+
};
|
|
17242
17352
|
const [first] = useState80(() => requestFor(view));
|
|
17243
17353
|
const { grid, status: status2, confirmed, request } = useBuilderGrid({ conversation, locale: ui.hostTag, memory: memory3, initial: first });
|
|
17244
17354
|
const lastRequest = useRef44(first);
|
|
@@ -17260,6 +17370,18 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17260
17370
|
commit(next, false);
|
|
17261
17371
|
send(requestFor(next));
|
|
17262
17372
|
};
|
|
17373
|
+
const setCustom = () => {
|
|
17374
|
+
const parsed = parseCustomTotal(draft, oddsFormat);
|
|
17375
|
+
if ("error" in parsed) {
|
|
17376
|
+
setInvalid(parsed.error);
|
|
17377
|
+
return;
|
|
17378
|
+
}
|
|
17379
|
+
closeCustom();
|
|
17380
|
+
setInvalid(null);
|
|
17381
|
+
const custom = { decimal: parsed.decimal, text: parsed.text, format: oddsFormat };
|
|
17382
|
+
if (view.custom?.decimal === parsed.decimal) commit({ ...view, custom }, widenedNote);
|
|
17383
|
+
else ask({ ...view, custom });
|
|
17384
|
+
};
|
|
17263
17385
|
const allGames = gamesOptions?.find((o) => o.matchIds.length === 0) ?? null;
|
|
17264
17386
|
const pickGames = (option) => {
|
|
17265
17387
|
const next = { ...view, gamesId: option.id, matchIds: option.matchIds, widen: option.matchIds.length === 0 };
|
|
@@ -17293,7 +17415,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17293
17415
|
const singles = view.legs === 1;
|
|
17294
17416
|
const onOpeningChoice = view.marketKey === openingView.marketKey && view.widen === openingView.widen && view.gamesId === openingView.gamesId && sameIds(view.matchIds, openingView.matchIds);
|
|
17295
17417
|
const quotedAt = rows ? oldestQuote(rows) : null;
|
|
17296
|
-
const combo = ready && grid.total !== null ? { sport, totalChosen: view.total, totalActual: grid.total } : void 0;
|
|
17418
|
+
const combo = ready && grid.total !== null ? { sport, totalChosen: view.custom ? "custom" : view.total, totalActual: grid.total } : void 0;
|
|
17297
17419
|
const canWiden = gamesOptions === null || allGames !== null;
|
|
17298
17420
|
useEffect54(() => {
|
|
17299
17421
|
if (!empty2 || !singles || widened || !canWiden || autoWidened.current) return;
|
|
@@ -17375,19 +17497,72 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17375
17497
|
] }),
|
|
17376
17498
|
view.legs > 1 ? /* @__PURE__ */ jsxs124("div", { className: "ss-w-v8-builder-ln ss-w-v8-builder-ln--total", children: [
|
|
17377
17499
|
/* @__PURE__ */ jsx141("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderTotal }),
|
|
17378
|
-
/* @__PURE__ */
|
|
17379
|
-
|
|
17380
|
-
|
|
17381
|
-
|
|
17382
|
-
|
|
17383
|
-
|
|
17384
|
-
|
|
17385
|
-
|
|
17500
|
+
/* @__PURE__ */ jsxs124("div", { className: "ss-w-v8-builder-btns", role: "group", "aria-label": ui.v8BuilderTotal, children: [
|
|
17501
|
+
totals.map((t) => /* @__PURE__ */ jsx141(
|
|
17502
|
+
"button",
|
|
17503
|
+
{
|
|
17504
|
+
type: "button",
|
|
17505
|
+
className: "ss-w-v8-builder-btn",
|
|
17506
|
+
"aria-pressed": view.custom === null && view.total === t,
|
|
17507
|
+
onClick: () => {
|
|
17508
|
+
if (view.total !== t || view.custom) {
|
|
17509
|
+
setEditing(false);
|
|
17510
|
+
ask({ ...view, total: t, custom: null });
|
|
17511
|
+
}
|
|
17512
|
+
},
|
|
17513
|
+
children: totalLabel(t, preset.totalOptions, oddsFormat, ui)
|
|
17386
17514
|
},
|
|
17387
|
-
|
|
17388
|
-
|
|
17389
|
-
|
|
17390
|
-
|
|
17515
|
+
t
|
|
17516
|
+
)),
|
|
17517
|
+
/* @__PURE__ */ jsx141(
|
|
17518
|
+
"button",
|
|
17519
|
+
{
|
|
17520
|
+
ref: pencilRef,
|
|
17521
|
+
type: "button",
|
|
17522
|
+
className: "ss-w-v8-builder-btn",
|
|
17523
|
+
"data-custom": true,
|
|
17524
|
+
"aria-pressed": view.custom !== null,
|
|
17525
|
+
"aria-expanded": editing,
|
|
17526
|
+
"aria-controls": editing ? customId : void 0,
|
|
17527
|
+
"aria-label": view.custom ? ui.v8BuilderCustomEdit(customLabel(view.custom)) : ui.v8BuilderCustomLabel,
|
|
17528
|
+
onClick: () => editing ? closeCustom() : openCustom(),
|
|
17529
|
+
children: view.custom ? customLabel(view.custom) : /* @__PURE__ */ jsx141(PencilIcon, {})
|
|
17530
|
+
}
|
|
17531
|
+
)
|
|
17532
|
+
] }),
|
|
17533
|
+
editing ? /* @__PURE__ */ jsxs124("div", { id: customId, className: "ss-w-v8-builder-custom", children: [
|
|
17534
|
+
/* @__PURE__ */ jsx141(
|
|
17535
|
+
"input",
|
|
17536
|
+
{
|
|
17537
|
+
ref: inputRef,
|
|
17538
|
+
className: "ss-w-v8-builder-input",
|
|
17539
|
+
type: "text",
|
|
17540
|
+
inputMode: oddsFormat === "decimal" ? "decimal" : "text",
|
|
17541
|
+
maxLength: 12,
|
|
17542
|
+
value: draft,
|
|
17543
|
+
placeholder: ui.v8BuilderCustomPlaceholder(CUSTOM_TOTAL_EXAMPLE[oddsFormat]),
|
|
17544
|
+
"aria-label": ui.v8BuilderCustomLabel,
|
|
17545
|
+
"aria-invalid": invalid !== null,
|
|
17546
|
+
"aria-describedby": invalid ? noteId : void 0,
|
|
17547
|
+
onChange: (e) => {
|
|
17548
|
+
setDraft(e.target.value);
|
|
17549
|
+
setInvalid(null);
|
|
17550
|
+
},
|
|
17551
|
+
onKeyDown: (e) => {
|
|
17552
|
+
if (e.key === "Enter") {
|
|
17553
|
+
e.preventDefault();
|
|
17554
|
+
setCustom();
|
|
17555
|
+
} else if (e.key === "Escape") {
|
|
17556
|
+
e.preventDefault();
|
|
17557
|
+
e.stopPropagation();
|
|
17558
|
+
closeCustom();
|
|
17559
|
+
}
|
|
17560
|
+
}
|
|
17561
|
+
}
|
|
17562
|
+
),
|
|
17563
|
+
/* @__PURE__ */ jsx141("button", { type: "button", className: "ss-w-v8-builder-btn", onClick: setCustom, children: ui.v8BuilderCustomSet }),
|
|
17564
|
+
invalid ? /* @__PURE__ */ jsx141("p", { id: noteId, className: "ss-w-v8-builder-note", "data-kind": `custom-${invalid}`, role: "alert", children: invalid === "range" ? ui.v8BuilderCustomRange : ui.v8BuilderCustomUnreadable(CUSTOM_TOTAL_EXAMPLE[oddsFormat]) }) : null
|
|
17565
|
+
] }) : null
|
|
17391
17566
|
] }) : null,
|
|
17392
17567
|
ready && singles && widenedNote && !empty2 ? /* @__PURE__ */ jsx141("p", { className: "ss-w-v8-builder-note", "data-kind": "widened", children: ui.v8SinglesWidened(marketName) }) : null,
|
|
17393
17568
|
ready && !widenedNote && !empty2 && preset.widenedForMarket === true && onOpeningChoice && view.marketKey !== null ? /* @__PURE__ */ jsx141("p", { className: "ss-w-v8-builder-note", children: ui.v8Widened }) : null,
|
|
@@ -17419,6 +17594,12 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17419
17594
|
] }) : null
|
|
17420
17595
|
] }) : null });
|
|
17421
17596
|
}
|
|
17597
|
+
function PencilIcon() {
|
|
17598
|
+
return /* @__PURE__ */ jsxs124("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: [
|
|
17599
|
+
/* @__PURE__ */ jsx141("path", { d: "M12 20h9" }),
|
|
17600
|
+
/* @__PURE__ */ jsx141("path", { d: "M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z" })
|
|
17601
|
+
] });
|
|
17602
|
+
}
|
|
17422
17603
|
function GamesOptions({ options, ui }) {
|
|
17423
17604
|
const top = options.filter((o) => o.group !== "league" && o.group !== "game");
|
|
17424
17605
|
const leagues = options.filter((o) => o.group === "league");
|
|
@@ -19671,6 +19852,13 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
19671
19852
|
.ss-w-tabs[data-tight="5"] .ss-w-tab { font-size: 11px; }
|
|
19672
19853
|
.ss-w-tabs[data-tight="6"] .ss-w-tab { font-size: 11px; padding-left: 2px; padding-right: 2px; gap: 3px; letter-spacing: -.01em; }
|
|
19673
19854
|
.ss-w-tabs[data-tight="6"] .ss-w-tab-count { padding-left: 3px; padding-right: 3px; }
|
|
19855
|
+
.ss-w-tabs[data-tight="7"], .ss-w-tabs[data-scroll] { gap: 0; }
|
|
19856
|
+
.ss-w-tabs[data-tight="7"] .ss-w-tab { font-size: 11px; padding-left: 2px; padding-right: 2px; gap: 3px; letter-spacing: -.01em; }
|
|
19857
|
+
.ss-w-tabs[data-tight="7"] .ss-w-tab-count { background: none; padding: 0; min-width: 0; }
|
|
19858
|
+
.ss-w-tabs[data-scroll] { overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 16px 24px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent); }
|
|
19859
|
+
.ss-w-tabs[data-scroll]::-webkit-scrollbar { display: none; }
|
|
19860
|
+
/* A flex item, not padding: WebKit leaves a flex scroller's end padding out of the scroll range, so the fade would cover the last tab. */
|
|
19861
|
+
.ss-w-tabs[data-scroll]::after { content: ''; flex: 0 0 24px; }
|
|
19674
19862
|
.ss-w-tab-count { font-size: 10.5px; font-weight: 700; color: var(--ss-w-faint); background: var(--ss-w-bubble); border-radius: 999px; padding: 1px 6px; }
|
|
19675
19863
|
.ss-w-tab[data-on] .ss-w-tab-count { color: var(--ss-w-accent); }
|
|
19676
19864
|
/* The dot sits on the tab's corner and takes no width: a poll landing late must not push the last tab out of a strip that already fits to the pixel */
|
|
@@ -20047,9 +20235,18 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
20047
20235
|
.ss-w-v8-builder-btn:disabled:not([aria-pressed="true"]) { opacity: .55; }
|
|
20048
20236
|
.ss-w-v8-builder-btn[data-suggested]:not([aria-pressed="true"]) { border-style: dashed; border-color: var(--ss-v8-mint); }
|
|
20049
20237
|
.ss-w-v8-builder button:focus-visible { outline: 2px solid var(--ss-v8-mint); outline-offset: 1px; }
|
|
20050
|
-
.ss-w-v8-builder-ln--total > .ss-w-v8-builder-btns { display: grid; grid-template-columns:
|
|
20051
|
-
.ss-w-v8-builder-ln--total .ss-w-v8-builder-btn { min-width: 0; padding: 4px 2px; font-size: 13.5px; }
|
|
20052
|
-
.ss-w-v8-builder-ln--total .ss-w-v8-builder-btn:first-child { padding: 4px 9px; }
|
|
20238
|
+
.ss-w-v8-builder-ln--total > .ss-w-v8-builder-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
20239
|
+
.ss-w-v8-builder-ln--total .ss-w-v8-builder-btn { min-width: 0; padding: 4px 2px; font-size: 13.5px; overflow-wrap: normal; }
|
|
20240
|
+
.ss-w-v8-builder-ln--total .ss-w-v8-builder-btn:first-child { padding: 4px 9px; grid-column: span 2; }
|
|
20241
|
+
.ss-w-v8-builder-btn[data-custom] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
20242
|
+
.ss-w-v8-builder-btn[data-custom] svg { width: 16px; height: 16px; vertical-align: middle; }
|
|
20243
|
+
.ss-w-v8-builder-custom { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; box-sizing: border-box; padding-left: 84px; }
|
|
20244
|
+
.ss-w-v8-builder-input { flex: 1 1 0; min-width: 0; box-sizing: border-box; height: 40px; margin: 0; padding: 8px 10px; border: 1px solid var(--ss-v8-chip-line); border-radius: 10px; background: var(--ss-v8-chip); color: #fff; font: inherit; font-size: 16px; font-weight: 600; line-height: 1.2; }
|
|
20245
|
+
.ss-w-v8-builder-input::placeholder { color: color-mix(in srgb, #fff 78%, var(--ss-w-nav)); opacity: 1; }
|
|
20246
|
+
.ss-w-v8-builder-custom > .ss-w-v8-builder-btn { flex: 0 0 auto; min-height: 40px; padding: 6px 14px; }
|
|
20247
|
+
.ss-w-v8-builder-input:focus-visible { outline: 2px solid var(--ss-v8-mint); outline-offset: 1px; }
|
|
20248
|
+
.ss-w-v8-builder-input[aria-invalid="true"] { border-color: #f2b8b5; }
|
|
20249
|
+
.ss-w-v8-builder-custom > .ss-w-v8-builder-note { flex: 1 1 100%; }
|
|
20053
20250
|
.ss-w-v8-builder > .ss-w-v8-builder-btn { align-self: flex-start; min-height: 40px; padding: 6px 14px; }
|
|
20054
20251
|
.ss-w-v8-builder .ss-w-slip-btn { min-height: 36px; }
|
|
20055
20252
|
.ss-w-v8-builder .ss-w-combo-addall .ss-w-slip-btn { min-height: 44px; }
|
|
@@ -20064,10 +20261,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
20064
20261
|
}
|
|
20065
20262
|
@container (max-width: 400px) {
|
|
20066
20263
|
.ss-w-v8-builder-ln--total .ss-w-v8-builder-w { flex-basis: 100%; }
|
|
20067
|
-
}
|
|
20068
|
-
/* Stacked, six targets still split "10.00" below this: three to a row, two rows. */
|
|
20069
|
-
@container (max-width: 360px) {
|
|
20070
|
-
.ss-w-v8-builder-ln--total > .ss-w-v8-builder-btns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
20264
|
+
.ss-w-v8-builder-custom { padding-left: 0; }
|
|
20071
20265
|
}
|
|
20072
20266
|
|
|
20073
20267
|
@media (prefers-reduced-motion: reduce) {
|