kupos-ui-components-lib 9.7.8 → 9.7.10

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.
Files changed (26) hide show
  1. package/dist/KuposUIComponent.d.ts +3 -0
  2. package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
  3. package/dist/components/ServiceItem/PeruServiceItemDesktop.js +134 -188
  4. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  5. package/dist/components/ServiceItem/ServiceItemDesktop.js +16 -2
  6. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  7. package/dist/components/ServiceItem/ServiceItemMobile.js +16 -7
  8. package/dist/components/ServiceItem/mobileTypes.d.ts +32 -0
  9. package/dist/components/ServiceItem/types.d.ts +22 -0
  10. package/dist/styles.css +221 -0
  11. package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +13 -11
  12. package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +9 -9
  13. package/dist/utils/CommonService.js +11 -1
  14. package/package.json +1 -1
  15. package/src/KuposUIComponent.tsx +3 -0
  16. package/src/assets/images/anims/service_list/thunder_icon.json +1 -0
  17. package/src/assets/images/anims/service_list/users_anim.json +1 -0
  18. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +254 -345
  19. package/src/components/ServiceItem/ServiceItemDesktop.tsx +50 -5
  20. package/src/components/ServiceItem/ServiceItemMobile.tsx +340 -286
  21. package/src/components/ServiceItem/mobileTypes.ts +29 -1
  22. package/src/components/ServiceItem/types.ts +23 -1
  23. package/src/styles.css +15 -0
  24. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +525 -0
  25. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +555 -0
  26. package/src/utils/CommonService.ts +13 -1
@@ -0,0 +1,555 @@
1
+ import React from "react";
2
+ import LottiePlayer from "../../assets/LottiePlayer";
3
+ import commonService from "../../utils/CommonService";
4
+
5
+ const TIME_SLOTS = [
6
+ "Entre 07:00 AM y 10:00 AM",
7
+ "Entre 11:00 AM y 14:00 AM",
8
+ "Entre 15:00 PM y 18:00 PM",
9
+ "Entre 19:00 PM y 22:00 PM",
10
+ ];
11
+
12
+ const HARDCODED_OPERATORS = [
13
+ {
14
+ logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
15
+ name: "Turbus",
16
+ time: "7:00 am",
17
+ seatsAvailable: "3 disponibles",
18
+ },
19
+ {
20
+ logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Pullman_Bus_logo.svg/320px-Pullman_Bus_logo.svg.png",
21
+ name: "Pullmanbus",
22
+ time: "8:00 am",
23
+ seatsAvailable: "5 disponibles",
24
+ },
25
+ {
26
+ logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
27
+ name: "Expreso Santa C...",
28
+ time: "9:00 am",
29
+ seatsAvailable: "3 disponibles",
30
+ },
31
+ ];
32
+
33
+ const FeatureServiceUi = ({
34
+ serviceItem,
35
+ showTopLabel,
36
+ isSoldOut,
37
+ getAnimationIcon,
38
+ cityOrigin,
39
+ cityDestination,
40
+ renderIcon,
41
+ viewersConfig,
42
+ isFeatureDropDownExpand,
43
+ onToggleExpand,
44
+ ticketQuantity = 1,
45
+ onIncreaseTicketQuantity,
46
+ onDecreaseTicketQuantity,
47
+ onBookButtonPress,
48
+ selectedTimeSlot,
49
+ onTimeSlotChange,
50
+ isTimeDropdownOpen,
51
+ onTimeDropdownToggle,
52
+ }) => {
53
+ const operators =
54
+ serviceItem?.operators?.length > 0
55
+ ? serviceItem.operators
56
+ : HARDCODED_OPERATORS;
57
+
58
+ const isItemExpanded =
59
+ serviceItem.id === isFeatureDropDownExpand ||
60
+ isFeatureDropDownExpand === true;
61
+ const isThisTimeDropdownOpen = isTimeDropdownOpen === serviceItem.id;
62
+ const canDecreaseTicketQuantity = ticketQuantity > 1;
63
+
64
+ const HOW_IT_WORKS_STEPS = [
65
+ {
66
+ icon: "flexible",
67
+ name: "Salida flexible",
68
+ text: "Viajas en un horario entre las 07:00 y las 10:00 AM del día elegido.",
69
+ },
70
+ {
71
+ icon: "bus",
72
+ name: "Empresa asignada",
73
+ text: "Una de las empresas confirmará tu viaje al instante tras el pago.",
74
+ },
75
+ {
76
+ icon: "price",
77
+ name: "Precio garantizado",
78
+ text: "Mejor precio garantizado. Sin cambios ni cancelación.",
79
+ },
80
+ {
81
+ icon: "ticket",
82
+ name: "¡Listo!",
83
+ text: "Recibe todos los detalles de tu viaje al instante tras la compra.",
84
+ },
85
+ ];
86
+
87
+ const FeatureStepIcon = ({ icon }) => {
88
+ switch (icon) {
89
+ case "flexible":
90
+ return renderIcon("flexibleIcon", "24px");
91
+ case "bus":
92
+ return renderIcon("empressaIcon", "24px");
93
+ case "price":
94
+ return renderIcon("precioIcon", "24px");
95
+ default:
96
+ return renderIcon("listoIcon", "24px");
97
+ }
98
+ };
99
+
100
+ return (
101
+ <div
102
+ // ${
103
+ // serviceItem.offer_text ? "mb-[55px]" : "mb-[10px]"
104
+ // }
105
+ className={`relative mb-[10px]
106
+ ${
107
+ serviceItem?.is_direct_trip ||
108
+ serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
109
+ showTopLabel
110
+ ? "mt-[24px]"
111
+ : "mt-[20px]"
112
+ }`}
113
+ >
114
+ <div
115
+ className="border border-[#ccc]"
116
+ style={{
117
+ // border: "0.6px solid #ccc",
118
+ padding: "14px",
119
+ borderRadius: "14px",
120
+ }}
121
+ >
122
+ <div className="flex justify-between items-center px-[14px] pb-[10px] text-[13.33px]">
123
+ <div className="flex items-center gap-[10px]">
124
+ <span>Salida flexible</span>
125
+ <div
126
+ className="bold-text font-[9px]"
127
+ style={{
128
+ backgroundColor: "#FF5C60",
129
+ padding: "1px 8px",
130
+ borderRadius: "4px",
131
+ color: "#fff",
132
+ animation: "pulse-zoom 2s ease-in-out infinite",
133
+ whiteSpace: "nowrap",
134
+ }}
135
+ >
136
+ <span>AHORRAS 60%</span>
137
+ </div>
138
+ </div>
139
+ <span>
140
+ {/* {renderIcon("fireIcon", "14px")}{" "} */}
141
+ <img
142
+ src={serviceItem.icons?.fireIcon}
143
+ alt="fire"
144
+ className="w-[14px] h-[14px] mb-[4px] mr-[4px]"
145
+ />
146
+ <span className="bold-text">Remate</span> términa en{" "}
147
+ <span
148
+ className="bold-text text-end"
149
+ ref={(node) => commonService.startCountdown(node, 599)}
150
+ style={{
151
+ fontVariantNumeric: "tabular-nums",
152
+ display: "inline-block",
153
+ color: "#FF5C60",
154
+ minWidth: "40px",
155
+ }}
156
+ />
157
+ </span>
158
+ </div>
159
+ <div
160
+ id={`service-card-${serviceItem.id}`}
161
+ className="bg-[#0C1421] text-white mx-auto relative rounded-[14px] p-[14px] text-[13.33px]"
162
+ >
163
+ <div className="grid grid-cols-[25%_48%_27%] items-stretch">
164
+ {/* LEFT: origin, destination, flexible, time, confirmed seat */}
165
+ <div className="flex flex-col justify-between gap-[20px] my-[14px] pr-[22px]">
166
+ <div className="flex flex-col gap-[8px]">
167
+ <div className="flex items-center gap-[8px]">
168
+ <img
169
+ src={serviceItem.icons?.whiteOrigin}
170
+ alt="origin"
171
+ className={`w-[14px] h-[14px] shrink-0 ${
172
+ isSoldOut ? "grayscale" : ""
173
+ }`}
174
+ />
175
+ <span className="text-[13px] bold-text">
176
+ {cityOrigin?.label.split(",")[0]}
177
+ </span>
178
+ </div>
179
+ <div className="flex items-center gap-[8px]">
180
+ <img
181
+ src={serviceItem.icons?.whiteDestination}
182
+ alt="destination"
183
+ className={`w-[14px] h-[14px] shrink-0 ${
184
+ isSoldOut ? "grayscale" : ""
185
+ }`}
186
+ style={{ opacity: isSoldOut ? 0.5 : 1 }}
187
+ />
188
+ <span className="text-[13px] bold-text">
189
+ {cityDestination?.label.split(",")[0]}
190
+ </span>
191
+ </div>
192
+ </div>
193
+
194
+ <div className="flex flex-col gap-[8px]">
195
+ <div className="text-[12px] bold-text">Viernes 23 de mayo</div>
196
+
197
+ <div
198
+ className="kupos-time-dd relative"
199
+ tabIndex={0}
200
+ onBlur={(e) => {
201
+ if (!e.currentTarget.contains(e.relatedTarget as Node)) {
202
+ onTimeDropdownToggle?.(null);
203
+ }
204
+ }}
205
+ style={{ outline: "none" }}
206
+ >
207
+ <button
208
+ type="button"
209
+ onClick={() =>
210
+ onTimeDropdownToggle?.(
211
+ isThisTimeDropdownOpen ? null : serviceItem.id,
212
+ )
213
+ }
214
+ className="flex whitespace-nowrap cursor-pointer select-none items-center gap-[6px] border-none bg-transparent p-0 bold-text text-[12px] text-[white]"
215
+ >
216
+ <span>{selectedTimeSlot}</span>
217
+ <img
218
+ src={serviceItem?.icons?.downArrow}
219
+ alt="down arrow"
220
+ className={`kupos-time-chevron transition-transform duration-200 ${isThisTimeDropdownOpen ? "rotate-180" : "rotate-0"}`}
221
+ style={{
222
+ width: "12px",
223
+ height: "8px",
224
+ filter: "brightness(0) invert(1)",
225
+ }}
226
+ />
227
+ </button>
228
+ {isThisTimeDropdownOpen && (
229
+ <>
230
+ <div
231
+ className="absolute left-0 top-[calc(100%+10px)]"
232
+ style={{
233
+ zIndex: 20,
234
+ backgroundColor: "#fff",
235
+ borderRadius: "14px",
236
+ minWidth: "248px",
237
+ boxShadow: "0 8px 32px rgba(0,0,0,0.28)",
238
+ overflow: "hidden",
239
+ padding: "6px 0",
240
+ }}
241
+ >
242
+ {TIME_SLOTS.map((slot) => {
243
+ const isActive = slot === selectedTimeSlot;
244
+ return (
245
+ <button
246
+ key={slot}
247
+ type="button"
248
+ onClick={() => {
249
+ onTimeSlotChange?.(slot);
250
+ onTimeDropdownToggle?.(null);
251
+ }}
252
+ className={`flex w-full cursor-pointer items-center gap-[10px] border-none px-[12px] py-[9px] text-left text-[13px] ${isActive ? "bg-[#FF5C60] font-bold text-[white]" : "bg-transparent font-normal text-[#1a1a1a]"}`}
253
+ >
254
+ <span>{slot}</span>
255
+ </button>
256
+ );
257
+ })}
258
+ </div>
259
+ </>
260
+ )}
261
+ </div>
262
+ {/* <div className="text-[12px] bold-text whitespace-nowrap">
263
+ Entre 07:00 AM y 10:00 AM
264
+ </div> */}
265
+ </div>
266
+
267
+ <div className="flex flex-col items-start gap-[10px] text-[12px] ">
268
+ <div className="flex items-justify gap-[8px]">
269
+ {renderIcon("sheildIcon", "16px")}
270
+
271
+ <span
272
+ className="text-[11px]"
273
+ style={{
274
+ lineHeight: 1.3,
275
+ }}
276
+ >
277
+ Empresa y hora a confirmar luego del pago.
278
+ </span>
279
+ </div>
280
+ <div className="flex items-justify gap-[8px]">
281
+ {renderIcon("confirmarIcon", "16px")}
282
+
283
+ <span
284
+ className="text-[11px]"
285
+ style={{
286
+ lineHeight: 1.3,
287
+ }}
288
+ >
289
+ Tu compra está 100% asegurada.
290
+ </span>
291
+ </div>
292
+ </div>
293
+ </div>
294
+
295
+ {/* MIDDLE: competing operators + viewers */}
296
+ <div className="min-w-0 px-[22px] flex flex-col items-center justify-between gap-[16px] py-[2px] border-r border-[#363c48] border-l border-[#363c48]">
297
+ <div className="text-center">
298
+ <div className="bold-text text-[14px]">
299
+ 3 operadores compitiendo por tu compra
300
+ </div>
301
+ </div>
302
+
303
+ <div className="grid w-full grid-cols-3 items-stretch gap-[14px] mb-[12px]">
304
+ {operators.map((op, idx) => (
305
+ <div
306
+ key={idx}
307
+ className="flex min-w-0 flex-col items-center justify-center gap-[8px] rounded-[8px]"
308
+ style={{
309
+ // height: "80px",
310
+ border: "1px solid #363c48",
311
+ backgroundColor: "#1a202e",
312
+ padding: "14px 10px",
313
+ }}
314
+ >
315
+ <img
316
+ src={serviceItem.operator_details[0]}
317
+ alt={op.name}
318
+ className={`h-[24px] max-w-full object-contain ${
319
+ isSoldOut ? "grayscale" : ""
320
+ }`}
321
+ />
322
+ <span className="text-[11px] truncate max-w-full text-center">
323
+ {serviceItem.operator_details[2]}
324
+ </span>
325
+ <div className="bg-[#FF8F45] text-white text-[12px] font-bold px-[10px] py-[4px] rounded-[4px] bold-text whitespace-nowrap">
326
+ <span>{op?.time}</span>
327
+ </div>
328
+ <span className="text-[10px] mt-[6px]">
329
+ {op?.seatsAvailable}
330
+ </span>
331
+ </div>
332
+ ))}
333
+ </div>
334
+
335
+ <div
336
+ className="flex w-full items-center justify-center gap-[6px] text-[12px]"
337
+ style={{
338
+ border: "1px solid #363c48",
339
+ backgroundColor: "#1a202e",
340
+ padding: "8px 14px",
341
+ borderRadius: "24px",
342
+ }}
343
+ >
344
+ <LottiePlayer
345
+ // animationData={serviceItem.icons.flexibleAnim}
346
+ animationData={getAnimationIcon("usersAnimation")}
347
+ width="18px"
348
+ height="18px"
349
+ />
350
+ <span className="text-[13px]">
351
+ <span className="bold-text text-white">
352
+ {" "}
353
+ <span
354
+ className="bold-text"
355
+ ref={(node) =>
356
+ commonService.startViewerCount(node, viewersConfig)
357
+ }
358
+ style={{
359
+ fontVariantNumeric: "tabular-nums",
360
+ color: "#FF5C60",
361
+ }}
362
+ />{" "}
363
+ </span>{" "}
364
+ viendo |{" "}
365
+ <span
366
+ className="bold-text"
367
+ ref={(node) =>
368
+ commonService.startComprandoCount(node, 4, 16)
369
+ }
370
+ style={{ fontVariantNumeric: "tabular-nums" }}
371
+ />{" "}
372
+ han comprado
373
+ </span>
374
+ </div>
375
+ </div>
376
+
377
+ {/* RIGHT: price + button */}
378
+ <div className="flex flex-col justify-center gap-[12px] py-[2px] pl-[22px] pr-[10px] relative mb-[16px]">
379
+ <div
380
+ className="flex flex-col gap-[6px] "
381
+ style={{
382
+ alignItems: "center",
383
+ }}
384
+ >
385
+ <span
386
+ className="text-[#FF8F45] bold-text text-[26px] leading-tight"
387
+ style={{
388
+ animation: "pulse-zoom 2s ease-in-out infinite",
389
+ whiteSpace: "nowrap",
390
+ }}
391
+ >
392
+ 60% OFF
393
+ </span>
394
+ {/* <span className="text-[#666] text-[14px] line-through">
395
+ $10.000
396
+ </span> */}
397
+ <span
398
+ className="text-[13.33px] font-normal leading-[20px] text-[#9f9f9f] relative"
399
+ style={{ position: "relative" }}
400
+ >
401
+ $10.000
402
+ <span
403
+ style={{
404
+ position: "absolute",
405
+ left: "-2px",
406
+ top: "50%",
407
+ width: "calc(100% + 4px)",
408
+ height: "1px",
409
+
410
+ backgroundColor: "#FF5C60",
411
+
412
+ transform: "rotate(-10deg)",
413
+ transformOrigin: "center",
414
+ }}
415
+ />
416
+ </span>
417
+ <span className="text-white bold-text text-[28px] leading-none">
418
+ {`$${(4000 * ticketQuantity).toLocaleString()}`}
419
+ </span>
420
+ </div>
421
+
422
+ <div className="mt-[4px] flex flex-col items-center gap-[8px]">
423
+ <span className="text-[12px] text-white">
424
+ ¿Cuántos pasajes quieres?
425
+ </span>
426
+ <div
427
+ className="flex w-full items-center justify-between"
428
+ style={{
429
+ border: "1px solid #363c48",
430
+ backgroundColor: "#1a202e",
431
+ padding: "6px 14px",
432
+ borderRadius: "14px",
433
+ }}
434
+ >
435
+ <button
436
+ type="button"
437
+ aria-label="Disminuir pasajes"
438
+ disabled={!canDecreaseTicketQuantity}
439
+ onClick={() => onDecreaseTicketQuantity?.(serviceItem)}
440
+ className={`flex h-[34px] w-[34px] items-center justify-center rounded-full border-none text-[25px] leading-none text-white ${
441
+ canDecreaseTicketQuantity
442
+ ? "cursor-pointer bg-[#2d374d]"
443
+ : "cursor-not-allowed bg-[#222b3d] opacity-50"
444
+ }`}
445
+ >
446
+ -
447
+ </button>
448
+ <span className="bold-text text-[20px] text-white">
449
+ {ticketQuantity}
450
+ </span>
451
+ <button
452
+ type="button"
453
+ aria-label="Aumentar pasajes"
454
+ onClick={() => onIncreaseTicketQuantity?.(serviceItem)}
455
+ className="flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-full border-none bg-[#2d374d] text-[25px] leading-none text-white"
456
+ >
457
+ +
458
+ </button>
459
+ </div>
460
+ </div>
461
+
462
+ <button
463
+ type="button"
464
+ onClick={onBookButtonPress}
465
+ className="flex items-center gap-[6px] px-[20px] py-[10px] rounded-[16px] text-white bold-text text-[13px] mt-[4px] justify-center border-none cursor-pointer"
466
+ style={{
467
+ backgroundColor: "#FF5C60",
468
+ animation: "pulse-zoom 2s ease-in-out infinite",
469
+ whiteSpace: "nowrap",
470
+ }}
471
+ >
472
+ <LottiePlayer
473
+ // animationData={serviceItem.icons.flexibleAnim}
474
+ animationData={getAnimationIcon("thunderAnimation")}
475
+ width="18px"
476
+ height="18px"
477
+ />
478
+ <span className="whitespace-nowrap">¡Lo quiero!</span>
479
+ </button>
480
+ </div>
481
+
482
+ <div
483
+ className={`absolute bottom-[11px] right-[18px] cursor-pointer transition-transform duration-300 ease-in-out ${isItemExpanded ? "rotate-180" : ""}`}
484
+ onClick={onToggleExpand}
485
+ >
486
+ <img
487
+ src={serviceItem.icons?.downArrow}
488
+ alt="down arrow"
489
+ style={{
490
+ width: "14px",
491
+ height: "8px",
492
+ filter: "brightness(0) invert(1)",
493
+ }}
494
+ />
495
+ </div>
496
+ </div>
497
+ </div>
498
+ <div
499
+ className="grid"
500
+ style={{
501
+ gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
502
+ opacity: isItemExpanded ? 1 : 0,
503
+ transition:
504
+ "grid-template-rows 300ms ease-in-out, opacity 250ms ease-in-out",
505
+ }}
506
+ >
507
+ <div
508
+ className={`min-h-0 overflow-hidden px-[16px] text-[13.33px] ${
509
+ isItemExpanded ? "pt-[14px] pb-[6px]" : "py-0"
510
+ }`}
511
+ style={{ transition: "padding 300ms ease-in-out" }}
512
+ >
513
+ <span className="bold-text">¿Cómo funciona?</span>
514
+
515
+ <div className="mt-[14px] grid grid-cols-4 gap-[20px] px-[16px] ">
516
+ {HOW_IT_WORKS_STEPS.map((step) => (
517
+ <div
518
+ key={step.name}
519
+ className="flex flex-col items-center text-center text-[#272727]"
520
+ >
521
+ <FeatureStepIcon icon={step.icon} />
522
+ <span className="bold-text mt-[10px] text-[12px] leading-[14px]">
523
+ {step.name}
524
+ </span>
525
+ <span className="mt-[2px] max-w-[220px] text-[12px] leading-[14px] text-[#4a4a4a]">
526
+ {step.text}
527
+ </span>
528
+ </div>
529
+ ))}
530
+ </div>
531
+ </div>
532
+ </div>
533
+ </div>
534
+
535
+ {/* TOP BADGE — "Remate | Termina en 09:55 min" hardcoded, no countdown hook */}
536
+ {/* {showTopLabel && (
537
+ <div className="absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[15px] z-10 ">
538
+ <div className="flex items-center gap-[6px] py-[5px] px-[14px] rounded-[38px] text-[12.5px] bg-[#FF8F45] text-white whitespace-nowrap">
539
+ <LottiePlayer
540
+ animationData={getAnimationIcon("bombAnimation")}
541
+ width="14px"
542
+ height="14px"
543
+ />
544
+ <span>
545
+ <strong>Remate</strong> | Termina en{" "}
546
+ <strong>{HARDCODED_COUNTDOWN}</strong> min
547
+ </span>
548
+ </div>
549
+ </div>
550
+ )} */}
551
+ </div>
552
+ );
553
+ };
554
+
555
+ export default FeatureServiceUi;
@@ -329,10 +329,15 @@ const commonService = {
329
329
  ) => {
330
330
  if (!node || !viewersConfig) return;
331
331
 
332
+ const { min, max, interval = 5000 } = viewersConfig;
333
+ const configKey = `${min}-${max}-${interval}`;
334
+ if (node.dataset.viewerId && node.dataset.viewerConfig === configKey) {
335
+ return;
336
+ }
337
+
332
338
  const prevId = node.dataset.viewerId;
333
339
  if (prevId) clearInterval(Number(prevId));
334
340
 
335
- const { min, max, interval = 5000 } = viewersConfig;
336
341
  const clamp = (v: number) => Math.min(max, Math.max(min, v));
337
342
  const initialValue = Math.floor(Math.random() * (max - min + 1)) + min;
338
343
 
@@ -347,6 +352,7 @@ const commonService = {
347
352
  }, interval);
348
353
 
349
354
  node.dataset.viewerId = String(id);
355
+ node.dataset.viewerConfig = configKey;
350
356
  },
351
357
 
352
358
  startCountdown: (
@@ -388,6 +394,11 @@ const commonService = {
388
394
  ) => {
389
395
  if (!node) return;
390
396
 
397
+ const configKey = `${min}-${max}`;
398
+ if (node.dataset.comprandoId && node.dataset.comprandoConfig === configKey) {
399
+ return;
400
+ }
401
+
391
402
  const prevId = node.dataset.comprandoId;
392
403
  if (prevId) clearInterval(Number(prevId));
393
404
 
@@ -408,6 +419,7 @@ const commonService = {
408
419
  }, 5000); // Update every 5 seconds
409
420
 
410
421
  node.dataset.comprandoId = String(id);
422
+ node.dataset.comprandoConfig = configKey;
411
423
  },
412
424
  };
413
425