@algoux/standard-ranklist-renderer-component-solid 0.5.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/dist/index.js ADDED
@@ -0,0 +1,1047 @@
1
+ import "@algoux/standard-ranklist-renderer-component-styles";
2
+ import { delegateEvents, createComponent, use, insert, setAttribute, effect, className, style, template, memo, setStyleProperty, mergeProps } from "solid-js/web";
3
+ import { SRK_ANIMATED_MODAL_ROOT_CLASS, ensureModalInteractionTracker, unregisterModalFocusScope, resolveModalTransformOrigin, MODAL_ANIMATION_DURATION_MS, lockModalBodyScroll, unlockModalBodyScroll, registerModalFocusScope, getSolutionModalTitle, formatSolutionTimestamp, getSolutionResultMeta, getMarkerPresentation, resolveSrkAssetUrl, getProgressMaxAvailableMinutes, getProgressDurationMinutes, isProgressEnded, getProgressMetrics, caniuse, srkSupportedVersions, getProblemHeaderBackgroundImage, shouldShowTimeColumn, captureModalTriggerPointFromMouseEvent, getAcceptedStatusDetails } from "@algoux/standard-ranklist-renderer-component-core";
4
+ import { createUniqueId, createSignal, createMemo, onMount, createEffect, onCleanup, on, untrack, Show, For } from "solid-js";
5
+ import { resolveText, resolveUserMarkers, EnumTheme, secToTimeStr, formatTimeDuration, numberToAlphabet, resolveStyle } from "@algoux/standard-ranklist-utils";
6
+ var _tmpl$$4 = /* @__PURE__ */ template(`<div class=srk-modal-header><div class=srk-modal-title>`), _tmpl$2$4 = /* @__PURE__ */ template(`<div><div class=srk-modal-mask></div><div tabindex=-1><div aria-modal=true class=srk-modal data-srk-modal-panel=true role=dialog tabindex=-1><div class=srk-modal-content><button aria-label=Close class=srk-modal-close type=button><span class=srk-modal-close-x></span></button><div class=srk-modal-body>`);
7
+ function classNames(...values) {
8
+ return values.filter(Boolean).join(" ");
9
+ }
10
+ function Modal(props) {
11
+ const titleId = createUniqueId();
12
+ const destroyOnClose = () => {
13
+ var _a;
14
+ return (_a = props.destroyOnClose) != null ? _a : true;
15
+ };
16
+ const closeOnEsc = () => {
17
+ var _a;
18
+ return (_a = props.closeOnEsc) != null ? _a : true;
19
+ };
20
+ const closeOnMaskClick = () => {
21
+ var _a;
22
+ return (_a = props.closeOnMaskClick) != null ? _a : true;
23
+ };
24
+ const [isMounted, setIsMounted] = createSignal(props.open || !destroyOnClose());
25
+ const [animationState, setAnimationState] = createSignal(props.open ? "pre-open" : "closing");
26
+ const [transformOrigin, setTransformOrigin] = createSignal({
27
+ x: 0,
28
+ y: 0
29
+ });
30
+ let rootRef;
31
+ let dialogRef;
32
+ let closeTimer = null;
33
+ let openTimer = null;
34
+ let bodyLocked = false;
35
+ let focusScopeId = null;
36
+ let pendingFocusRegistration = false;
37
+ const shouldRender = createMemo(() => props.open || isMounted() || !destroyOnClose());
38
+ const shouldLockBody = createMemo(() => props.open || destroyOnClose() && isMounted());
39
+ const rootClassName = createMemo(() => classNames("srk-modal-root", SRK_ANIMATED_MODAL_ROOT_CLASS, props.rootClassName));
40
+ const baseDialogStyle = createMemo(() => {
41
+ var _a, _b;
42
+ return {
43
+ ...props.style,
44
+ width: props.width ? `${props.width}px` : (_a = props.style) == null ? void 0 : _a.width,
45
+ maxWidth: (_b = props.style) == null ? void 0 : _b.maxWidth
46
+ };
47
+ });
48
+ const clearTimers = () => {
49
+ if (closeTimer !== null) {
50
+ window.clearTimeout(closeTimer);
51
+ closeTimer = null;
52
+ }
53
+ if (openTimer !== null) {
54
+ window.clearTimeout(openTimer);
55
+ openTimer = null;
56
+ }
57
+ };
58
+ function handleEscape(event) {
59
+ var _a;
60
+ if (props.open && closeOnEsc()) {
61
+ (_a = props.onClose) == null ? void 0 : _a.call(props, event, "escape");
62
+ }
63
+ }
64
+ const registerFocusScope = () => {
65
+ if (!props.open || !dialogRef || focusScopeId !== null) {
66
+ return;
67
+ }
68
+ if (!dialogRef.isConnected) {
69
+ if (!pendingFocusRegistration) {
70
+ pendingFocusRegistration = true;
71
+ queueMicrotask(() => {
72
+ pendingFocusRegistration = false;
73
+ registerFocusScope();
74
+ });
75
+ }
76
+ return;
77
+ }
78
+ focusScopeId = registerModalFocusScope(dialogRef, {
79
+ onEscape: handleEscape
80
+ });
81
+ };
82
+ onMount(() => {
83
+ registerFocusScope();
84
+ });
85
+ createEffect(() => {
86
+ ensureModalInteractionTracker();
87
+ });
88
+ onCleanup(() => {
89
+ clearTimers();
90
+ unregisterModalFocusScope(focusScopeId);
91
+ focusScopeId = null;
92
+ });
93
+ createEffect(on(() => props.open, (open) => {
94
+ const destroy = destroyOnClose();
95
+ clearTimers();
96
+ if (open) {
97
+ setIsMounted(true);
98
+ setTransformOrigin({
99
+ x: 0,
100
+ y: 0
101
+ });
102
+ setAnimationState("pre-open");
103
+ if (typeof window !== "undefined") {
104
+ openTimer = window.setTimeout(() => {
105
+ if (!props.open || animationState() !== "pre-open") {
106
+ openTimer = null;
107
+ return;
108
+ }
109
+ const resolution = resolveModalTransformOrigin(dialogRef || null);
110
+ setTransformOrigin(resolution.origin);
111
+ setAnimationState("opening");
112
+ openTimer = null;
113
+ }, 0);
114
+ }
115
+ return;
116
+ }
117
+ if (focusScopeId !== null) {
118
+ unregisterModalFocusScope(focusScopeId);
119
+ focusScopeId = null;
120
+ }
121
+ setAnimationState("closing");
122
+ if (!destroy) {
123
+ setIsMounted(true);
124
+ return;
125
+ }
126
+ if (untrack(isMounted) && typeof window !== "undefined") {
127
+ closeTimer = window.setTimeout(() => {
128
+ if (bodyLocked) {
129
+ unlockModalBodyScroll();
130
+ bodyLocked = false;
131
+ }
132
+ rootRef == null ? void 0 : rootRef.remove();
133
+ setIsMounted(false);
134
+ closeTimer = null;
135
+ }, MODAL_ANIMATION_DURATION_MS);
136
+ }
137
+ }, {
138
+ defer: false
139
+ }));
140
+ createEffect(on(shouldLockBody, (lock) => {
141
+ if (lock && !bodyLocked) {
142
+ lockModalBodyScroll();
143
+ bodyLocked = true;
144
+ return;
145
+ }
146
+ if (!lock && bodyLocked) {
147
+ unlockModalBodyScroll();
148
+ bodyLocked = false;
149
+ return;
150
+ }
151
+ }, {
152
+ defer: false
153
+ }));
154
+ onCleanup(() => {
155
+ if (bodyLocked) {
156
+ unlockModalBodyScroll();
157
+ bodyLocked = false;
158
+ }
159
+ unregisterModalFocusScope(focusScopeId);
160
+ focusScopeId = null;
161
+ });
162
+ createEffect(() => {
163
+ if (props.open && shouldRender()) {
164
+ registerFocusScope();
165
+ }
166
+ });
167
+ createEffect(() => {
168
+ var _a;
169
+ const width = props.width ? `${props.width}px` : typeof ((_a = props.style) == null ? void 0 : _a.width) === "string" ? props.style.width : null;
170
+ const originX = `${transformOrigin().x}px`;
171
+ const originY = `${transformOrigin().y}px`;
172
+ const state = animationState();
173
+ const root = rootRef;
174
+ const dialog = dialogRef;
175
+ if (root) {
176
+ root.setAttribute("data-srk-modal-state", state);
177
+ }
178
+ if (!dialog) {
179
+ return;
180
+ }
181
+ if (width) {
182
+ dialog.style.width = width;
183
+ dialog.style.setProperty("--srk-modal-max-width", width);
184
+ } else {
185
+ dialog.style.removeProperty("width");
186
+ dialog.style.removeProperty("--srk-modal-max-width");
187
+ }
188
+ dialog.style.setProperty("--srk-modal-origin-x", originX);
189
+ dialog.style.setProperty("--srk-modal-origin-y", originY);
190
+ });
191
+ const content = () => (() => {
192
+ var _el$ = _tmpl$2$4(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$9 = _el$6.nextSibling;
193
+ var _ref$ = rootRef;
194
+ typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
195
+ _el$3.$$mousedown = (event) => {
196
+ var _a;
197
+ if (closeOnMaskClick() && event.target === event.currentTarget) {
198
+ (_a = props.onClose) == null ? void 0 : _a.call(props, event, "mask");
199
+ }
200
+ };
201
+ use((element) => {
202
+ dialogRef = element;
203
+ registerFocusScope();
204
+ }, _el$4);
205
+ _el$6.$$click = (event) => {
206
+ var _a;
207
+ return (_a = props.onClose) == null ? void 0 : _a.call(props, event, "close-button");
208
+ };
209
+ insert(_el$5, createComponent(Show, {
210
+ get when() {
211
+ return props.title !== void 0;
212
+ },
213
+ get children() {
214
+ var _el$7 = _tmpl$$4(), _el$8 = _el$7.firstChild;
215
+ setAttribute(_el$8, "id", titleId);
216
+ insert(_el$8, () => props.title);
217
+ return _el$7;
218
+ }
219
+ }), _el$9);
220
+ insert(_el$9, () => props.children);
221
+ effect((_p$) => {
222
+ var _v$ = rootClassName(), _v$2 = animationState(), _v$3 = classNames("srk-modal-wrap", props.wrapClassName), _v$4 = props.title !== void 0 ? titleId : void 0, _v$5 = baseDialogStyle();
223
+ _v$ !== _p$.e && className(_el$, _p$.e = _v$);
224
+ _v$2 !== _p$.t && setAttribute(_el$, "data-srk-modal-state", _p$.t = _v$2);
225
+ _v$3 !== _p$.a && className(_el$3, _p$.a = _v$3);
226
+ _v$4 !== _p$.o && setAttribute(_el$4, "aria-labelledby", _p$.o = _v$4);
227
+ _p$.i = style(_el$4, _v$5, _p$.i);
228
+ return _p$;
229
+ }, {
230
+ e: void 0,
231
+ t: void 0,
232
+ a: void 0,
233
+ o: void 0,
234
+ i: void 0
235
+ });
236
+ return _el$;
237
+ })();
238
+ return createComponent(Show, {
239
+ get when() {
240
+ return shouldRender();
241
+ },
242
+ children: content
243
+ });
244
+ }
245
+ delegateEvents(["mousedown", "click"]);
246
+ var _tmpl$$3 = /* @__PURE__ */ template(`<table class="srk-common-table srk-solutions-table"><thead><tr><th class=srk--text-left>Result</th><th class=srk--text-right>Time</th></tr></thead><tbody>`), _tmpl$2$3 = /* @__PURE__ */ template(`<tr><td><span></span></td><td class=srk--text-right>`);
247
+ function DefaultSolutionModal(props) {
248
+ const [cachedPayload, setCachedPayload] = createSignal(props.user ? {
249
+ user: props.user,
250
+ problem: props.problem,
251
+ problemIndex: props.problemIndex,
252
+ solutions: props.solutions || []
253
+ } : null);
254
+ createEffect(() => {
255
+ if (props.user) {
256
+ setCachedPayload({
257
+ user: props.user,
258
+ problem: props.problem,
259
+ problemIndex: props.problemIndex,
260
+ solutions: props.solutions || []
261
+ });
262
+ }
263
+ });
264
+ return createComponent(Show, {
265
+ get when() {
266
+ return cachedPayload();
267
+ },
268
+ children: (payload) => createComponent(Modal, {
269
+ get open() {
270
+ return props.open;
271
+ },
272
+ get onClose() {
273
+ return props.onClose;
274
+ },
275
+ get rootClassName() {
276
+ return props.rootClassName || "srk-general-modal-root";
277
+ },
278
+ get style() {
279
+ return props.style;
280
+ },
281
+ get title() {
282
+ return props.title || getSolutionModalTitle(payload().problemIndex, payload().user);
283
+ },
284
+ get width() {
285
+ return props.width || 320;
286
+ },
287
+ get wrapClassName() {
288
+ return props.wrapClassName || "srk-solutions-modal";
289
+ },
290
+ get children() {
291
+ var _el$ = _tmpl$$3(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
292
+ insert(_el$3, createComponent(For, {
293
+ get each() {
294
+ return payload().solutions;
295
+ },
296
+ children: (solution) => {
297
+ const meta = () => getSolutionResultMeta(solution.result);
298
+ return (() => {
299
+ var _el$4 = _tmpl$2$3(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling;
300
+ insert(_el$6, () => meta().label);
301
+ insert(_el$7, () => formatSolutionTimestamp(solution));
302
+ effect(() => className(_el$6, `srk-solution-result-text ${meta().className || ""}`));
303
+ return _el$4;
304
+ })();
305
+ }
306
+ }));
307
+ return _el$;
308
+ }
309
+ })
310
+ });
311
+ }
312
+ var _tmpl$$2 = /* @__PURE__ */ template(`<div class=srk-user-modal-info-team-members>`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class=srk-user-modal-info><h3 class=srk-user-modal-info-user-name></h3><div class=srk-user-modal-info-labels><span class="srk-user-modal-info-labels-label srk-user-modal-info-labels-label-preset-general">`), _tmpl$3$2 = /* @__PURE__ */ template(`<p class=srk-user-modal-info-user-second-name>`), _tmpl$4$2 = /* @__PURE__ */ template(`<span>`), _tmpl$5$2 = /* @__PURE__ */ template(`<span class=srk-user-modal-info-team-members-slash> / `), _tmpl$6$2 = /* @__PURE__ */ template(`<div class=srk-user-modal-info-photo><img alt="User portrait"class=srk-user-modal-info-photo-img>`);
313
+ function DefaultUserModal(props) {
314
+ const [cachedUser, setCachedUser] = createSignal(props.user || null);
315
+ const theme = () => props.theme || EnumTheme.light;
316
+ const markers = () => props.markers || [];
317
+ const resolvedMarkers = (user) => resolveUserMarkers(user, markers()).map((marker) => ({
318
+ marker,
319
+ presentation: getMarkerPresentation(marker, theme())
320
+ }));
321
+ const formatAssetUrl = (url, field) => resolveSrkAssetUrl(url, field, props.formatSrkAssetUrl);
322
+ createEffect(() => {
323
+ if (props.user) {
324
+ setCachedUser(props.user);
325
+ }
326
+ });
327
+ return createComponent(Show, {
328
+ get when() {
329
+ return cachedUser();
330
+ },
331
+ children: (user) => createComponent(Modal, {
332
+ get open() {
333
+ return props.open;
334
+ },
335
+ get onClose() {
336
+ return props.onClose;
337
+ },
338
+ get rootClassName() {
339
+ return props.rootClassName || "srk-general-modal-root";
340
+ },
341
+ get style() {
342
+ return props.style;
343
+ },
344
+ get title() {
345
+ return props.title || "User Info";
346
+ },
347
+ get width() {
348
+ return props.width || 420;
349
+ },
350
+ get wrapClassName() {
351
+ return props.wrapClassName || "srk-user-modal";
352
+ },
353
+ get children() {
354
+ var _el$ = _tmpl$2$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
355
+ insert(_el$2, () => resolveText(user().name));
356
+ insert(_el$, createComponent(Show, {
357
+ get when() {
358
+ return user().organization;
359
+ },
360
+ children: (organization) => (() => {
361
+ var _el$6 = _tmpl$3$2();
362
+ insert(_el$6, () => resolveText(organization()));
363
+ return _el$6;
364
+ })()
365
+ }), _el$3);
366
+ insert(_el$4, () => user().official === false ? "\uFF0A \u975E\u6B63\u5F0F\u53C2\u52A0\u8005" : "\u6B63\u5F0F\u53C2\u52A0\u8005");
367
+ insert(_el$3, createComponent(For, {
368
+ get each() {
369
+ return resolvedMarkers(user());
370
+ },
371
+ children: (entry) => (() => {
372
+ var _el$7 = _tmpl$4$2();
373
+ insert(_el$7, () => resolveText(entry.marker.label));
374
+ effect((_p$) => {
375
+ var _v$ = `srk-user-modal-info-labels-label ${entry.presentation.className || ""}`, _v$2 = entry.presentation.style;
376
+ _v$ !== _p$.e && className(_el$7, _p$.e = _v$);
377
+ _p$.t = style(_el$7, _v$2, _p$.t);
378
+ return _p$;
379
+ }, {
380
+ e: void 0,
381
+ t: void 0
382
+ });
383
+ return _el$7;
384
+ })()
385
+ }), null);
386
+ insert(_el$, createComponent(Show, {
387
+ get when() {
388
+ var _a;
389
+ return (_a = user().teamMembers) == null ? void 0 : _a.length;
390
+ },
391
+ get children() {
392
+ var _el$5 = _tmpl$$2();
393
+ insert(_el$5, createComponent(For, {
394
+ get each() {
395
+ return user().teamMembers;
396
+ },
397
+ children: (member, index) => [createComponent(Show, {
398
+ get when() {
399
+ return index() > 0;
400
+ },
401
+ get children() {
402
+ return _tmpl$5$2();
403
+ }
404
+ }), (() => {
405
+ var _el$9 = _tmpl$4$2();
406
+ insert(_el$9, () => resolveText(member.name));
407
+ return _el$9;
408
+ })()]
409
+ }));
410
+ return _el$5;
411
+ }
412
+ }), null);
413
+ insert(_el$, createComponent(Show, {
414
+ get when() {
415
+ return user().photo;
416
+ },
417
+ children: (photo) => (() => {
418
+ var _el$10 = _tmpl$6$2(), _el$11 = _el$10.firstChild;
419
+ effect(() => setAttribute(_el$11, "src", formatAssetUrl(photo(), "user.photo")));
420
+ return _el$10;
421
+ })()
422
+ }), null);
423
+ return _el$;
424
+ }
425
+ })
426
+ });
427
+ }
428
+ var _tmpl$$1 = /* @__PURE__ */ template(`<div class=srk-progress-slider-tooltip>`), _tmpl$2$1 = /* @__PURE__ */ template(`<div class=srk-progress-slider-layer><input aria-label="Time Travel"class=srk-progress-slider min=0 step=1 type=range>`), _tmpl$3$1 = /* @__PURE__ */ template(`<div class=srk-progress-time-machine-status><div class=srk-progress-time-machine-text>Time Travel Mode`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class=srk-progress-bar-container><div class=srk-progress-bar><div class=srk-progress-bar-body><div class="srk-progress-bar-segment srk-progress-bar-normal"><div class=srk-progress-bar-fill></div></div><div class="srk-progress-bar-segment srk-progress-bar-frozen"><div class=srk-progress-bar-fill></div></div></div></div><div class=srk-progress-secondary-area><div class=srk-progress-secondary-area-left>Elapsed: </div><div class=srk-progress-secondary-area-center></div><div class=srk-progress-secondary-area-right>Remaining: `), _tmpl$5$1 = /* @__PURE__ */ template(`<div class=srk-progress-live-text>Live`), _tmpl$6$1 = /* @__PURE__ */ template(`<div style=visibility:hidden>SRK`);
429
+ const timeTravelKeys = /* @__PURE__ */ new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"]);
430
+ function ProgressBar(props) {
431
+ var _a, _b;
432
+ const [localTime, setLocalTime] = createSignal(Date.now());
433
+ const [inTimeMachine, setInTimeMachine] = createSignal(false);
434
+ const [timeTravelIsChanging, setTimeTravelIsChanging] = createSignal(false);
435
+ const [timeTravelCurrentValue, setTimeTravelCurrentValue] = createSignal(getProgressMaxAvailableMinutes(props.data.contest, localTime(), props.td));
436
+ const [timeTravelValue, setTimeTravelValue] = createSignal(null);
437
+ const [isMounted, setIsMounted] = createSignal(false);
438
+ let liveInterval;
439
+ let previousContestTitle = JSON.stringify((_b = (_a = props.data) == null ? void 0 : _a.contest) == null ? void 0 : _b.title);
440
+ const td = () => {
441
+ var _a2;
442
+ return (_a2 = props.td) != null ? _a2 : 0;
443
+ };
444
+ const durationMinutes = () => getProgressDurationMinutes(props.data.contest);
445
+ const maxAvailableMinutes = () => getProgressMaxAvailableMinutes(props.data.contest, localTime(), td());
446
+ const ended = () => isProgressEnded(props.data.contest, localTime(), td());
447
+ const progressMetrics = () => getProgressMetrics(props.data, localTime(), td(), timeTravelCurrentValue(), inTimeMachine());
448
+ const clearLiveInterval = () => {
449
+ if (liveInterval) {
450
+ window.clearInterval(liveInterval);
451
+ liveInterval = void 0;
452
+ }
453
+ };
454
+ const handleProgressTimer = () => {
455
+ setLocalTime(Date.now());
456
+ if (ended()) {
457
+ clearLiveInterval();
458
+ }
459
+ };
460
+ const handleTimeTravelChange = (value) => {
461
+ var _a2;
462
+ const exited = value >= durationMinutes() || value >= maxAvailableMinutes();
463
+ (_a2 = props.onTimeTravel) == null ? void 0 : _a2.call(props, exited ? null : value * 60 * 1e3);
464
+ setInTimeMachine(!exited);
465
+ setTimeTravelValue(exited ? null : value * 60 * 1e3);
466
+ setTimeTravelIsChanging(false);
467
+ };
468
+ const beginTimeTravel = () => {
469
+ setTimeTravelIsChanging(true);
470
+ setInTimeMachine(true);
471
+ };
472
+ const commitTimeTravel = () => {
473
+ if (timeTravelIsChanging()) {
474
+ handleTimeTravelChange(timeTravelCurrentValue());
475
+ }
476
+ };
477
+ const handleSliderKeyDown = (event) => {
478
+ if (timeTravelKeys.has(event.key)) {
479
+ beginTimeTravel();
480
+ }
481
+ };
482
+ const handleSliderKeyUp = (event) => {
483
+ if (timeTravelKeys.has(event.key)) {
484
+ commitTimeTravel();
485
+ }
486
+ };
487
+ createEffect(() => {
488
+ const maxValue = maxAvailableMinutes();
489
+ if (!timeTravelIsChanging() && timeTravelValue() === null && timeTravelCurrentValue() !== maxValue) {
490
+ setTimeTravelCurrentValue(maxValue);
491
+ }
492
+ });
493
+ createEffect(() => {
494
+ var _a2, _b2, _c;
495
+ const contestTitle = JSON.stringify((_b2 = (_a2 = props.data) == null ? void 0 : _a2.contest) == null ? void 0 : _b2.title);
496
+ if (contestTitle === previousContestTitle) {
497
+ return;
498
+ }
499
+ previousContestTitle = contestTitle;
500
+ setTimeTravelIsChanging(false);
501
+ setTimeTravelCurrentValue(maxAvailableMinutes());
502
+ setTimeTravelValue(null);
503
+ setInTimeMachine(false);
504
+ (_c = props.onTimeTravel) == null ? void 0 : _c.call(props, null);
505
+ });
506
+ createEffect(() => {
507
+ if (!props.live || typeof window === "undefined") {
508
+ clearLiveInterval();
509
+ return;
510
+ }
511
+ clearLiveInterval();
512
+ liveInterval = window.setInterval(handleProgressTimer, 1e3);
513
+ onCleanup(clearLiveInterval);
514
+ });
515
+ onMount(() => setIsMounted(true));
516
+ onCleanup(clearLiveInterval);
517
+ return (() => {
518
+ var _el$ = _tmpl$4$1(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$4.nextSibling, _el$7 = _el$6.firstChild, _el$11 = _el$2.nextSibling, _el$12 = _el$11.firstChild;
519
+ _el$12.firstChild;
520
+ var _el$14 = _el$12.nextSibling, _el$16 = _el$14.nextSibling;
521
+ _el$16.firstChild;
522
+ insert(_el$2, createComponent(Show, {
523
+ get when() {
524
+ return memo(() => !!(props.enableTimeTravel && progressMetrics().supportRegen))() && isMounted();
525
+ },
526
+ get children() {
527
+ var _el$8 = _tmpl$2$1(), _el$10 = _el$8.firstChild;
528
+ insert(_el$8, createComponent(Show, {
529
+ get when() {
530
+ return timeTravelIsChanging();
531
+ },
532
+ get children() {
533
+ var _el$9 = _tmpl$$1();
534
+ insert(_el$9, () => secToTimeStr(timeTravelCurrentValue() * 60));
535
+ effect((_$p) => setStyleProperty(_el$9, "left", `${durationMinutes() ? timeTravelCurrentValue() / durationMinutes() * 100 : 0}%`));
536
+ return _el$9;
537
+ }
538
+ }), _el$10);
539
+ _el$10.$$touchstart = beginTimeTravel;
540
+ _el$10.$$touchend = commitTimeTravel;
541
+ _el$10.$$mouseup = commitTimeTravel;
542
+ _el$10.$$mousedown = beginTimeTravel;
543
+ _el$10.$$keyup = handleSliderKeyUp;
544
+ _el$10.$$keydown = handleSliderKeyDown;
545
+ _el$10.$$input = (event) => setTimeTravelCurrentValue(Number(event.currentTarget.value));
546
+ _el$10.addEventListener("blur", () => {
547
+ if (timeTravelIsChanging()) {
548
+ commitTimeTravel();
549
+ }
550
+ });
551
+ effect((_p$) => {
552
+ var _v$ = durationMinutes(), _v$2 = secToTimeStr(timeTravelCurrentValue() * 60);
553
+ _v$ !== _p$.e && setAttribute(_el$10, "max", _p$.e = _v$);
554
+ _v$2 !== _p$.t && setAttribute(_el$10, "title", _p$.t = _v$2);
555
+ return _p$;
556
+ }, {
557
+ e: void 0,
558
+ t: void 0
559
+ });
560
+ effect(() => _el$10.value = timeTravelCurrentValue());
561
+ return _el$8;
562
+ }
563
+ }), null);
564
+ insert(_el$12, () => secToTimeStr(Math.round(progressMetrics().elapsed / 1e3)), null);
565
+ insert(_el$14, createComponent(Show, {
566
+ get when() {
567
+ return inTimeMachine();
568
+ },
569
+ get fallback() {
570
+ return memo(() => !!(props.live && !ended()))() ? _tmpl$5$1() : _tmpl$6$1();
571
+ },
572
+ get children() {
573
+ return _tmpl$3$1();
574
+ }
575
+ }));
576
+ insert(_el$16, () => secToTimeStr(Math.round(progressMetrics().remaining / 1e3)), null);
577
+ effect((_p$) => {
578
+ var _v$3 = `${progressMetrics().frozenBreakpoint * 100}%`, _v$4 = `${progressMetrics().normalInnerPercent}%`, _v$5 = `${(1 - progressMetrics().frozenBreakpoint) * 100}%`, _v$6 = `${progressMetrics().frozenInnerPercent}%`, _v$7 = props.live || inTimeMachine() ? {} : {
579
+ display: "none"
580
+ }, _v$8 = props.live || inTimeMachine() ? {} : {
581
+ display: "none"
582
+ };
583
+ _v$3 !== _p$.e && setStyleProperty(_el$4, "width", _p$.e = _v$3);
584
+ _v$4 !== _p$.t && setStyleProperty(_el$5, "width", _p$.t = _v$4);
585
+ _v$5 !== _p$.a && setStyleProperty(_el$6, "width", _p$.a = _v$5);
586
+ _v$6 !== _p$.o && setStyleProperty(_el$7, "width", _p$.o = _v$6);
587
+ _p$.i = style(_el$12, _v$7, _p$.i);
588
+ _p$.n = style(_el$16, _v$8, _p$.n);
589
+ return _p$;
590
+ }, {
591
+ e: void 0,
592
+ t: void 0,
593
+ a: void 0,
594
+ o: void 0,
595
+ i: void 0,
596
+ n: void 0
597
+ });
598
+ return _el$;
599
+ })();
600
+ }
601
+ delegateEvents(["input", "keydown", "keyup", "mousedown", "mouseup", "touchend", "touchstart"]);
602
+ var _tmpl$ = /* @__PURE__ */ template(`<th class=srk--nowrap>Time`), _tmpl$2 = /* @__PURE__ */ template(`<div class="srk-common-table srk-main"><table><thead><tr><th class="srk--text-left srk--nowrap">Name</th><th class=srk--nowrap>Score</th></tr></thead><tbody>`), _tmpl$3 = /* @__PURE__ */ template(`<div>srk type "<!>" is not supported`), _tmpl$4 = /* @__PURE__ */ template(`<div>srk version "<!>" is not supported (current supported: <!>)`), _tmpl$5 = /* @__PURE__ */ template(`<th class="srk-series-header srk--text-right srk--nowrap">`), _tmpl$6 = /* @__PURE__ */ template(`<th class="srk--nowrap srk-problem-header">`), _tmpl$7 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"style=color:unset>`), _tmpl$8 = /* @__PURE__ */ template(`<td class="srk--text-right srk--nowrap">`), _tmpl$9 = /* @__PURE__ */ template(`<tr><td class="srk--text-right srk--nowrap">`), _tmpl$10 = /* @__PURE__ */ template(`<td>`), _tmpl$11 = /* @__PURE__ */ template(`<td class="srk--text-left srk--nowrap srk-user-cell"><div class=srk-user-cell-content><div class=srk-user-body><div class=srk-user-name-row><span class=srk-user-name-text></span><span class=srk-marker-dot-group>`), _tmpl$12 = /* @__PURE__ */ template(`<div class=srk-user-avatar><img alt="User Avatar">`), _tmpl$13 = /* @__PURE__ */ template(`<span>`), _tmpl$14 = /* @__PURE__ */ template(`<p class="srk-user-secondary-text srk--text-ellipsis"title>`), _tmpl$15 = /* @__PURE__ */ template(`<span class=srk--display-block>`), _tmpl$16 = /* @__PURE__ */ template(`<span class="srk--display-block srk-problem-stats">`), _tmpl$17 = /* @__PURE__ */ template(`<td class="srk-prest-status-block srk--text-center srk--nowrap srk-prest-status-block-fb">`), _tmpl$18 = /* @__PURE__ */ template(`<td class="srk-prest-status-block srk--text-center srk--nowrap srk-prest-status-block-accepted">`), _tmpl$19 = /* @__PURE__ */ template(`<td class="srk-prest-status-block srk--text-center srk--nowrap srk-prest-status-block-frozen">`), _tmpl$20 = /* @__PURE__ */ template(`<td class="srk-prest-status-block srk--text-center srk--nowrap srk-prest-status-block-failed">`), _tmpl$21 = /* @__PURE__ */ template(`<span class=srk-prest-status-block-score>`), _tmpl$22 = /* @__PURE__ */ template(`<span class=srk-prest-status-block-score-details>`);
603
+ function Ranklist(props) {
604
+ const theme = () => props.theme || EnumTheme.light;
605
+ const showTimeColumn = () => shouldShowTimeColumn(props.data.rows);
606
+ const formatAssetUrl = (url, field) => resolveSrkAssetUrl(url, field, props.formatSrkAssetUrl);
607
+ const emitUserClick = (event, row, rowIndex) => {
608
+ var _a;
609
+ if (event) {
610
+ captureModalTriggerPointFromMouseEvent(event, {
611
+ source: "user-cell",
612
+ context: {
613
+ rowIndex,
614
+ userId: row.user.id || null,
615
+ userName: resolveText(row.user.name)
616
+ }
617
+ });
618
+ }
619
+ (_a = props.onUserClick) == null ? void 0 : _a.call(props, {
620
+ user: row.user,
621
+ row,
622
+ rowIndex,
623
+ ranklist: props.data
624
+ });
625
+ };
626
+ const buildSolutionPayload = (row, rowIndex, status, problemIndex) => ({
627
+ user: row.user,
628
+ row,
629
+ rowIndex,
630
+ problemIndex,
631
+ problem: props.data.problems[problemIndex],
632
+ status,
633
+ solutions: getStatusSolutions(status),
634
+ ranklist: props.data
635
+ });
636
+ const emitSolutionClick = (event, row, rowIndex, status, problemIndex) => {
637
+ var _a, _b;
638
+ const payload = buildSolutionPayload(row, rowIndex, status, problemIndex);
639
+ if (!payload.solutions.length) {
640
+ return;
641
+ }
642
+ if (event) {
643
+ captureModalTriggerPointFromMouseEvent(event, {
644
+ source: "status-cell",
645
+ context: {
646
+ rowIndex,
647
+ problemIndex,
648
+ problemAlias: ((_a = payload.problem) == null ? void 0 : _a.alias) || null,
649
+ problemTitle: payload.problem ? resolveText(payload.problem.title) : null,
650
+ userId: row.user.id || null
651
+ }
652
+ });
653
+ }
654
+ (_b = props.onSolutionClick) == null ? void 0 : _b.call(props, payload);
655
+ };
656
+ return createComponent(Show, {
657
+ get when() {
658
+ return props.data.type === "general";
659
+ },
660
+ get fallback() {
661
+ return (() => {
662
+ var _el$9 = _tmpl$3(), _el$10 = _el$9.firstChild, _el$12 = _el$10.nextSibling;
663
+ _el$12.nextSibling;
664
+ insert(_el$9, () => props.data.type, _el$12);
665
+ return _el$9;
666
+ })();
667
+ },
668
+ get children() {
669
+ return createComponent(Show, {
670
+ get when() {
671
+ return caniuse(props.data.version);
672
+ },
673
+ get fallback() {
674
+ return (() => {
675
+ var _el$13 = _tmpl$4(), _el$14 = _el$13.firstChild, _el$17 = _el$14.nextSibling, _el$15 = _el$17.nextSibling, _el$18 = _el$15.nextSibling;
676
+ _el$18.nextSibling;
677
+ insert(_el$13, () => props.data.version, _el$17);
678
+ insert(_el$13, srkSupportedVersions, _el$18);
679
+ return _el$13;
680
+ })();
681
+ },
682
+ get children() {
683
+ var _el$ = _tmpl$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild;
684
+ _el$5.nextSibling;
685
+ var _el$8 = _el$3.nextSibling;
686
+ insert(_el$4, createComponent(For, {
687
+ get each() {
688
+ return props.data.series;
689
+ },
690
+ children: (series) => (() => {
691
+ var _el$19 = _tmpl$5();
692
+ insert(_el$19, () => series.title);
693
+ return _el$19;
694
+ })()
695
+ }), _el$5);
696
+ insert(_el$4, createComponent(Show, {
697
+ get when() {
698
+ return showTimeColumn();
699
+ },
700
+ get children() {
701
+ return _tmpl$();
702
+ }
703
+ }), null);
704
+ insert(_el$4, createComponent(For, {
705
+ get each() {
706
+ return props.data.problems;
707
+ },
708
+ children: (problem, problemIndex) => {
709
+ var _a;
710
+ const ProblemHeaderCellPart = (_a = props.parts) == null ? void 0 : _a.problemHeaderCell;
711
+ const index = problemIndex();
712
+ return ProblemHeaderCellPart ? createComponent(ProblemHeaderCellPart, {
713
+ problem,
714
+ problemIndex: index,
715
+ index,
716
+ get theme() {
717
+ return theme();
718
+ }
719
+ }) : (() => {
720
+ var _el$20 = _tmpl$6();
721
+ insert(_el$20, createComponent(Show, {
722
+ get when() {
723
+ return problem.link;
724
+ },
725
+ get fallback() {
726
+ return createComponent(ProblemHeaderBody, {
727
+ problem,
728
+ index
729
+ });
730
+ },
731
+ children: (link) => (() => {
732
+ var _el$21 = _tmpl$7();
733
+ insert(_el$21, createComponent(ProblemHeaderBody, {
734
+ problem,
735
+ index
736
+ }));
737
+ effect(() => setAttribute(_el$21, "href", link()));
738
+ return _el$21;
739
+ })()
740
+ }));
741
+ effect((_$p) => setStyleProperty(_el$20, "background-image", getProblemHeaderBackgroundImage(problem.style, theme())));
742
+ return _el$20;
743
+ })();
744
+ }
745
+ }), null);
746
+ insert(_el$8, createComponent(For, {
747
+ get each() {
748
+ return props.data.rows;
749
+ },
750
+ children: (row, rowIndex) => (() => {
751
+ var _el$22 = _tmpl$9(), _el$23 = _el$22.firstChild;
752
+ insert(_el$22, createComponent(For, {
753
+ get each() {
754
+ return getRankValues(row, props.data.series);
755
+ },
756
+ children: (rankValue, seriesIndex) => (() => {
757
+ var _el$25 = _tmpl$10();
758
+ insert(_el$25, () => getRankText(rankValue, row));
759
+ effect((_p$) => {
760
+ var _v$3 = `srk--text-right srk--nowrap ${getSeriesSegmentClass(rankValue, props.data.series[seriesIndex()])}`, _v$4 = getSeriesSegmentStyle(rankValue, props.data.series[seriesIndex()], theme());
761
+ _v$3 !== _p$.e && className(_el$25, _p$.e = _v$3);
762
+ _p$.t = style(_el$25, _v$4, _p$.t);
763
+ return _p$;
764
+ }, {
765
+ e: void 0,
766
+ t: void 0
767
+ });
768
+ return _el$25;
769
+ })()
770
+ }), _el$23);
771
+ insert(_el$22, () => {
772
+ var _a;
773
+ const UserCellPart = (_a = props.parts) == null ? void 0 : _a.userCell;
774
+ return UserCellPart ? createComponent(UserCellPart, {
775
+ get user() {
776
+ return row.user;
777
+ },
778
+ row,
779
+ get rowIndex() {
780
+ return rowIndex();
781
+ },
782
+ get ranklist() {
783
+ return props.data;
784
+ },
785
+ get markers() {
786
+ return props.data.markers;
787
+ },
788
+ get theme() {
789
+ return theme();
790
+ },
791
+ onClick: (event) => emitUserClick(event, row, rowIndex())
792
+ }) : (() => {
793
+ var _el$26 = _tmpl$11(), _el$27 = _el$26.firstChild, _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling;
794
+ _el$26.$$click = (event) => {
795
+ event.preventDefault();
796
+ emitUserClick(event, row, rowIndex());
797
+ };
798
+ insert(_el$27, createComponent(Show, {
799
+ get when() {
800
+ return row.user.avatar;
801
+ },
802
+ children: (avatar) => (() => {
803
+ var _el$32 = _tmpl$12(), _el$33 = _el$32.firstChild;
804
+ effect(() => setAttribute(_el$33, "src", formatAssetUrl(avatar(), "user.avatar")));
805
+ return _el$32;
806
+ })()
807
+ }), _el$28);
808
+ insert(_el$30, () => resolveText(row.user.name));
809
+ insert(_el$31, createComponent(For, {
810
+ get each() {
811
+ return getResolvedUserMarkers(row.user, props.data.markers, theme());
812
+ },
813
+ children: (entry) => (() => {
814
+ var _el$34 = _tmpl$13();
815
+ effect((_p$) => {
816
+ var _v$7 = `srk-marker srk-marker-dot srk--c-tooltip ${entry.presentation.className || ""}`, _v$8 = getMarkerStyle(entry.presentation.style), _v$9 = resolveText(entry.marker.label);
817
+ _v$7 !== _p$.e && className(_el$34, _p$.e = _v$7);
818
+ _p$.t = style(_el$34, _v$8, _p$.t);
819
+ _v$9 !== _p$.a && setAttribute(_el$34, "data-tooltip", _p$.a = _v$9);
820
+ return _p$;
821
+ }, {
822
+ e: void 0,
823
+ t: void 0,
824
+ a: void 0
825
+ });
826
+ return _el$34;
827
+ })()
828
+ }));
829
+ insert(_el$28, createComponent(Show, {
830
+ get when() {
831
+ return row.user.organization;
832
+ },
833
+ children: (organization) => (() => {
834
+ var _el$35 = _tmpl$14();
835
+ insert(_el$35, () => resolveText(organization()));
836
+ return _el$35;
837
+ })()
838
+ }), null);
839
+ effect((_p$) => {
840
+ var _v$5 = !!props.onUserClick, _v$6 = resolveText(row.user.name);
841
+ _v$5 !== _p$.e && _el$26.classList.toggle("srk--cursor-pointer", _p$.e = _v$5);
842
+ _v$6 !== _p$.t && setAttribute(_el$30, "title", _p$.t = _v$6);
843
+ return _p$;
844
+ }, {
845
+ e: void 0,
846
+ t: void 0
847
+ });
848
+ return _el$26;
849
+ })();
850
+ }, _el$23);
851
+ insert(_el$23, () => row.score.value);
852
+ insert(_el$22, createComponent(Show, {
853
+ get when() {
854
+ return showTimeColumn();
855
+ },
856
+ get children() {
857
+ var _el$24 = _tmpl$8();
858
+ insert(_el$24, (() => {
859
+ var _c$ = memo(() => !!row.score.time);
860
+ return () => _c$() ? formatTimeDuration(row.score.time, "min", Math.floor) : "-";
861
+ })());
862
+ return _el$24;
863
+ }
864
+ }), null);
865
+ insert(_el$22, createComponent(For, {
866
+ get each() {
867
+ return row.statuses;
868
+ },
869
+ children: (status, problemIndex) => {
870
+ var _a;
871
+ const partProps = {
872
+ status,
873
+ problem: props.data.problems[problemIndex()],
874
+ problemIndex: problemIndex(),
875
+ user: row.user,
876
+ row,
877
+ rowIndex: rowIndex(),
878
+ ranklist: props.data,
879
+ solutions: getStatusSolutions(status),
880
+ onClick: (event) => emitSolutionClick(event, row, rowIndex(), status, problemIndex())
881
+ };
882
+ const StatusCellPart = (_a = props.parts) == null ? void 0 : _a.statusCell;
883
+ return StatusCellPart ? createComponent(StatusCellPart, partProps) : createComponent(StatusCell, mergeProps(partProps, {
884
+ get onSolutionClick() {
885
+ return props.onSolutionClick;
886
+ }
887
+ }));
888
+ }
889
+ }), null);
890
+ return _el$22;
891
+ })()
892
+ }));
893
+ effect((_p$) => {
894
+ var _v$ = !!props.borderedRows, _v$2 = !!props.stripedRows;
895
+ _v$ !== _p$.e && _el$2.classList.toggle("srk-table-row-bordered", _p$.e = _v$);
896
+ _v$2 !== _p$.t && _el$2.classList.toggle("srk-table-row-striped", _p$.t = _v$2);
897
+ return _p$;
898
+ }, {
899
+ e: void 0,
900
+ t: void 0
901
+ });
902
+ return _el$;
903
+ }
904
+ });
905
+ }
906
+ });
907
+ }
908
+ function ProblemHeaderBody(props) {
909
+ return [(() => {
910
+ var _el$36 = _tmpl$15();
911
+ insert(_el$36, () => props.problem.alias || numberToAlphabet(props.index));
912
+ return _el$36;
913
+ })(), createComponent(Show, {
914
+ get when() {
915
+ return props.problem.statistics;
916
+ },
917
+ children: (statistics) => (() => {
918
+ var _el$37 = _tmpl$16();
919
+ insert(_el$37, () => statistics().accepted);
920
+ effect(() => setAttribute(_el$37, "title", getProblemStatsTitle(statistics())));
921
+ return _el$37;
922
+ })()
923
+ })];
924
+ }
925
+ function getProblemStatsTitle(statistics) {
926
+ const ratio = statistics.submitted ? (statistics.accepted / statistics.submitted * 100).toFixed(1) : 0;
927
+ return `${statistics.accepted} / ${statistics.submitted} (${ratio}%)`;
928
+ }
929
+ function StatusCell(props) {
930
+ const isClickable = () => props.solutions.length > 0 && !!props.onSolutionClick;
931
+ const onClick = (event) => {
932
+ event.preventDefault();
933
+ if (isClickable()) {
934
+ props.onClick(event);
935
+ }
936
+ };
937
+ if (props.status.result === "FB") {
938
+ return (() => {
939
+ var _el$38 = _tmpl$17();
940
+ _el$38.$$click = onClick;
941
+ insert(_el$38, createComponent(AcceptedStatusBody, {
942
+ get status() {
943
+ return props.status;
944
+ }
945
+ }));
946
+ effect(() => _el$38.classList.toggle("srk--cursor-pointer", !!isClickable()));
947
+ return _el$38;
948
+ })();
949
+ }
950
+ if (props.status.result === "AC") {
951
+ return (() => {
952
+ var _el$39 = _tmpl$18();
953
+ _el$39.$$click = onClick;
954
+ insert(_el$39, createComponent(AcceptedStatusBody, {
955
+ get status() {
956
+ return props.status;
957
+ }
958
+ }));
959
+ effect(() => _el$39.classList.toggle("srk--cursor-pointer", !!isClickable()));
960
+ return _el$39;
961
+ })();
962
+ }
963
+ if (props.status.result === "?") {
964
+ return (() => {
965
+ var _el$40 = _tmpl$19();
966
+ _el$40.$$click = onClick;
967
+ insert(_el$40, () => props.status.tries);
968
+ effect(() => _el$40.classList.toggle("srk--cursor-pointer", !!isClickable()));
969
+ return _el$40;
970
+ })();
971
+ }
972
+ if (props.status.result === "RJ") {
973
+ return (() => {
974
+ var _el$41 = _tmpl$20();
975
+ _el$41.$$click = onClick;
976
+ insert(_el$41, () => props.status.tries);
977
+ effect(() => _el$41.classList.toggle("srk--cursor-pointer", !!isClickable()));
978
+ return _el$41;
979
+ })();
980
+ }
981
+ return _tmpl$10();
982
+ }
983
+ function AcceptedStatusBody(props) {
984
+ const details = () => getAcceptedStatusDetails(props.status);
985
+ if (typeof props.status.score === "number") {
986
+ return [(() => {
987
+ var _el$43 = _tmpl$21();
988
+ insert(_el$43, () => props.status.score);
989
+ return _el$43;
990
+ })(), (() => {
991
+ var _el$44 = _tmpl$22();
992
+ insert(_el$44, details);
993
+ return _el$44;
994
+ })()];
995
+ }
996
+ return memo(details);
997
+ }
998
+ function getRankValues(row, series) {
999
+ return row.rankValues || series.map(() => ({
1000
+ rank: null,
1001
+ segmentIndex: null
1002
+ }));
1003
+ }
1004
+ function getRankText(rankValue, row) {
1005
+ return rankValue.rank ? rankValue.rank : row.user.official === false ? "\uFF0A" : "";
1006
+ }
1007
+ function getStatusSolutions(status) {
1008
+ return [...status.solutions || []].reverse();
1009
+ }
1010
+ function getResolvedUserMarkers(user, markers, theme) {
1011
+ return resolveUserMarkers(user, markers).map((marker) => ({
1012
+ marker,
1013
+ presentation: getMarkerPresentation(marker, theme)
1014
+ }));
1015
+ }
1016
+ function resolveSeriesSegment(rankValue, series) {
1017
+ const index = rankValue.segmentIndex || rankValue.segmentIndex === 0 ? rankValue.segmentIndex : -1;
1018
+ return ((series == null ? void 0 : series.segments) || [])[index] || {};
1019
+ }
1020
+ function getSeriesSegmentClass(rankValue, series) {
1021
+ const segmentStyle = resolveSeriesSegment(rankValue, series).style;
1022
+ return typeof segmentStyle === "string" ? `srk-preset-series-segment-${segmentStyle}` : "";
1023
+ }
1024
+ function getSeriesSegmentStyle(rankValue, series, theme) {
1025
+ const emptyColor = {
1026
+ [EnumTheme.light]: void 0,
1027
+ [EnumTheme.dark]: void 0
1028
+ };
1029
+ const segmentStyle = resolveSeriesSegment(rankValue, series).style;
1030
+ if (!segmentStyle || typeof segmentStyle === "string") {
1031
+ return {};
1032
+ }
1033
+ const style2 = resolveStyle(segmentStyle);
1034
+ const textColor = style2.textColor || emptyColor;
1035
+ const backgroundColor = style2.backgroundColor || emptyColor;
1036
+ return {
1037
+ color: textColor[theme],
1038
+ "background-color": backgroundColor[theme]
1039
+ };
1040
+ }
1041
+ function getMarkerStyle(style2) {
1042
+ return (style2 == null ? void 0 : style2.backgroundColor) ? {
1043
+ "background-color": style2.backgroundColor
1044
+ } : {};
1045
+ }
1046
+ delegateEvents(["click"]);
1047
+ export { DefaultSolutionModal, DefaultUserModal, Modal, ProgressBar, Ranklist };