@tiendanube/live-state 1.1.0 → 1.3.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 CHANGED
@@ -5,7 +5,7 @@ import { jsx as D, jsxs as O } from "react/jsx-runtime";
5
5
  import { Alert as ee, Box as k, Button as te, Card as ne, Icon as re, Link as ie, Text as A } from "@nimbus-ds/components";
6
6
  import { CloseIcon as ae, MoneyIcon as oe } from "@nimbus-ds/icons";
7
7
  //#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
8
- var j = class extends n {
8
+ var se = class extends n {
9
9
  constructor(e, t) {
10
10
  super(), this.options = t, this.#e = e, this.#s = null, this.#o = h(), this.bindMethods(), this.setOptions(t);
11
11
  }
@@ -28,16 +28,16 @@ var j = class extends n {
28
28
  this.refetch = this.refetch.bind(this);
29
29
  }
30
30
  onSubscribe() {
31
- this.listeners.size === 1 && (this.#t.addObserver(this), M(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
31
+ this.listeners.size === 1 && (this.#t.addObserver(this), j(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
32
32
  }
33
33
  onUnsubscribe() {
34
34
  this.hasListeners() || this.destroy();
35
35
  }
36
36
  shouldFetchOnReconnect() {
37
- return N(this.#t, this.options, this.options.refetchOnReconnect);
37
+ return M(this.#t, this.options, this.options.refetchOnReconnect);
38
38
  }
39
39
  shouldFetchOnWindowFocus() {
40
- return N(this.#t, this.options, this.options.refetchOnWindowFocus);
40
+ return M(this.#t, this.options, this.options.refetchOnWindowFocus);
41
41
  }
42
42
  destroy() {
43
43
  this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
@@ -51,13 +51,13 @@ var j = class extends n {
51
51
  observer: this
52
52
  });
53
53
  let r = this.hasListeners();
54
- r && P(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || y(this.options.enabled, this.#t) !== y(t.enabled, this.#t) || S(this.options.staleTime, this.#t) !== S(t.staleTime, this.#t)) && this.#g();
54
+ r && N(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || y(this.options.enabled, this.#t) !== y(t.enabled, this.#t) || S(this.options.staleTime, this.#t) !== S(t.staleTime, this.#t)) && this.#g();
55
55
  let i = this.#_();
56
56
  r && (this.#t !== n || y(this.options.enabled, this.#t) !== y(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
57
57
  }
58
58
  getOptimisticResult(e) {
59
59
  let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
60
- return ce(this, n) && (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
60
+ return le(this, n) && (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
61
61
  }
62
62
  getCurrentResult() {
63
63
  return this.#r;
@@ -118,7 +118,7 @@ var j = class extends n {
118
118
  createResult(e, t) {
119
119
  let n = this.#t, i = this.options, a = this.#r, s = this.#i, c = this.#a, l = e === n ? this.#n : e.state, { state: u } = e, d = { ...u }, f = !1, p;
120
120
  if (t._optimisticResults) {
121
- let r = this.hasListeners(), a = !r && M(e, t), s = r && P(e, n, t, i);
121
+ let r = this.hasListeners(), a = !r && j(e, t), s = r && N(e, n, t, i);
122
122
  (a || s) && (d = {
123
123
  ...d,
124
124
  ...o(u.data, e.options)
@@ -161,7 +161,7 @@ var j = class extends n {
161
161
  isPaused: d.fetchStatus === "paused",
162
162
  isPlaceholderData: f,
163
163
  isRefetchError: S && w,
164
- isStale: F(e, t),
164
+ isStale: P(e, t),
165
165
  refetch: this.refetch,
166
166
  promise: this.#o,
167
167
  isEnabled: y(t.enabled, e) !== !1
@@ -219,35 +219,35 @@ var j = class extends n {
219
219
  });
220
220
  }
221
221
  };
222
- function se(e, t) {
222
+ function ce(e, t) {
223
223
  return y(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && y(t.retryOnMount, e) === !1);
224
224
  }
225
- function M(e, t) {
226
- return se(e, t) || e.state.data !== void 0 && N(e, t, t.refetchOnMount);
225
+ function j(e, t) {
226
+ return ce(e, t) || e.state.data !== void 0 && M(e, t, t.refetchOnMount);
227
227
  }
228
- function N(e, t, n) {
228
+ function M(e, t, n) {
229
229
  if (y(t.enabled, e) !== !1 && S(t.staleTime, e) !== "static") {
230
230
  let r = typeof n == "function" ? n(e) : n;
231
- return r === "always" || r !== !1 && F(e, t);
231
+ return r === "always" || r !== !1 && P(e, t);
232
232
  }
233
233
  return !1;
234
234
  }
235
- function P(e, t, n, r) {
236
- return (e !== t || y(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && F(e, n);
235
+ function N(e, t, n, r) {
236
+ return (e !== t || y(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && P(e, n);
237
237
  }
238
- function F(e, t) {
238
+ function P(e, t) {
239
239
  return y(t.enabled, e) !== !1 && e.isStaleByTime(S(t.staleTime, e));
240
240
  }
241
- function ce(e, t) {
241
+ function le(e, t) {
242
242
  return !a(e.getCurrentResult(), t);
243
243
  }
244
244
  //#endregion
245
245
  //#region node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
246
- var I = C.createContext(!1), le = () => C.useContext(I);
247
- I.Provider;
246
+ var F = C.createContext(!1), ue = () => C.useContext(F);
247
+ F.Provider;
248
248
  //#endregion
249
249
  //#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
250
- function ue() {
250
+ function de() {
251
251
  let e = !1;
252
252
  return {
253
253
  clearReset: () => {
@@ -259,7 +259,7 @@ function ue() {
259
259
  isReset: () => e
260
260
  };
261
261
  }
262
- var de = C.createContext(ue()), L = () => C.useContext(de), R = (e, t, n) => {
262
+ var I = C.createContext(de()), L = () => C.useContext(I), R = (e, t, n) => {
263
263
  let r = n?.state.error && typeof e.throwOnError == "function" ? x(e.throwOnError, [n.state.error, n]) : e.throwOnError;
264
264
  (e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
265
265
  }, z = (e) => {
@@ -276,9 +276,9 @@ var de = C.createContext(ue()), L = () => C.useContext(de), R = (e, t, n) => {
276
276
  });
277
277
  //#endregion
278
278
  //#region node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
279
- function U(e, t, n) {
279
+ function me(e, t, n) {
280
280
  if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e))) throw Error("Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object");
281
- let r = le(), i = L(), a = d(n), o = a.defaultQueryOptions(e);
281
+ let r = ue(), i = L(), a = d(n), o = a.defaultQueryOptions(e);
282
282
  a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);
283
283
  let l = a.getQueryCache().get(o.queryHash);
284
284
  process.env.NODE_ENV !== "production" && (o.queryFn || console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)), o._optimisticResults = r ? "isRestoring" : "optimistic", V(o), R(o, i, l), z(i);
@@ -302,27 +302,27 @@ function U(e, t, n) {
302
302
  }
303
303
  //#endregion
304
304
  //#region node_modules/@tanstack/react-query/build/modern/useQuery.js
305
- function me(e, t) {
306
- return U(e, j, t);
305
+ function he(e, t) {
306
+ return me(e, se, t);
307
307
  }
308
308
  //#endregion
309
309
  //#region src/utils/query.ts
310
- var W = ["live-state"];
311
- async function he(e) {
310
+ var U = ["live-state"];
311
+ async function ge(e) {
312
312
  await _.prefetchQuery({
313
- queryKey: W,
313
+ queryKey: U,
314
314
  queryFn: ({ signal: t }) => e({ signal: t }),
315
315
  staleTime: 6e4
316
316
  });
317
317
  }
318
- async function ge() {
319
- await _.invalidateQueries({ queryKey: W });
318
+ async function _e() {
319
+ await _.invalidateQueries({ queryKey: U });
320
320
  }
321
321
  //#endregion
322
322
  //#region src/hooks/useLiveState.ts
323
- function _e() {
324
- let { fetcher: e, mockData: t, refetchInterval: n, log: r } = p(), i = t !== void 0, { data: a, error: o, isLoading: s, refetch: c } = me({
325
- queryKey: W,
323
+ function ve() {
324
+ let { fetcher: e, mockData: t, refetchInterval: n, log: r } = p(), i = t !== void 0, { data: a, error: o, isLoading: s, refetch: c } = he({
325
+ queryKey: U,
326
326
  queryFn: ({ signal: t }) => e({ signal: t }),
327
327
  enabled: !i,
328
328
  staleTime: 6e4,
@@ -357,7 +357,7 @@ function _e() {
357
357
  }
358
358
  //#endregion
359
359
  //#region src/hooks/useTrackEvent.ts
360
- function G() {
360
+ function W() {
361
361
  let { onEvent: e, disabled: t, log: n } = p();
362
362
  return w((r, a) => {
363
363
  e?.(r, a), t || i(r, a, n);
@@ -369,10 +369,10 @@ function G() {
369
369
  }
370
370
  //#endregion
371
371
  //#region src/utils/closable-storage.ts
372
- var K = "@tiendanube/live-state:closable", q = K;
373
- function J() {
372
+ var G = "@tiendanube/live-state:closable", K = G;
373
+ function q() {
374
374
  try {
375
- let e = localStorage.getItem(q);
375
+ let e = localStorage.getItem(K);
376
376
  if (!e) return {};
377
377
  let t = JSON.parse(e);
378
378
  if (typeof t != "object" || !t) return {};
@@ -396,21 +396,21 @@ function J() {
396
396
  return {};
397
397
  }
398
398
  }
399
- function Y(e) {
399
+ function J(e) {
400
400
  try {
401
- localStorage.setItem(q, JSON.stringify(e));
401
+ localStorage.setItem(K, JSON.stringify(e));
402
402
  } catch {}
403
403
  }
404
404
  //#endregion
405
405
  //#region src/hooks/useClosable.ts
406
- function ve({ context: e, id: t, maxCloseTimes: n = 3, expiresIn: r }) {
406
+ function ye({ context: e, id: t, maxCloseTimes: n = 3, expiresIn: r }) {
407
407
  let [i, a] = E(null);
408
408
  return T(() => {
409
409
  if (!t) {
410
410
  a(!0);
411
411
  return;
412
412
  }
413
- let i = J(), o = i[e]?.[t];
413
+ let i = q(), o = i[e]?.[t];
414
414
  if (!o) {
415
415
  a(!0);
416
416
  return;
@@ -418,7 +418,7 @@ function ve({ context: e, id: t, maxCloseTimes: n = 3, expiresIn: r }) {
418
418
  let { count: s, closedAt: c } = o;
419
419
  if (r != null && c > 0 && Date.now() - c > r) {
420
420
  let n = { ...i };
421
- n[e] && (delete n[e][t], Y(n)), a(!0);
421
+ n[e] && (delete n[e][t], J(n)), a(!0);
422
422
  return;
423
423
  }
424
424
  a(s < n);
@@ -431,8 +431,8 @@ function ve({ context: e, id: t, maxCloseTimes: n = 3, expiresIn: r }) {
431
431
  isVisible: i,
432
432
  close: w(() => {
433
433
  if (a(!1), !t) return;
434
- let n = J(), r = n[e]?.[t]?.count ?? 0;
435
- Y({
434
+ let n = q(), r = n[e]?.[t]?.count ?? 0;
435
+ J({
436
436
  ...n,
437
437
  [e]: {
438
438
  ...n[e] ?? {},
@@ -447,7 +447,7 @@ function ve({ context: e, id: t, maxCloseTimes: n = 3, expiresIn: r }) {
447
447
  }
448
448
  //#endregion
449
449
  //#region src/utils/cta.ts
450
- function X(e, t) {
450
+ function Y(e, t) {
451
451
  let n = m(t);
452
452
  try {
453
453
  switch (e.type) {
@@ -473,25 +473,25 @@ function X(e, t) {
473
473
  }
474
474
  //#endregion
475
475
  //#region src/utils/sanitize.ts
476
- var ye = new Set([
476
+ var be = new Set([
477
477
  "strong",
478
478
  "em",
479
479
  "b",
480
480
  "i",
481
481
  "br",
482
482
  "span"
483
- ]), be = /<(script|style|iframe|object|embed|form|input|button|textarea|select|link|meta|head|body|html|svg|math)[\s\S]*?<\/\1\s*>|<(script|style|iframe|object|embed|form|input|button|textarea|select|link|meta|head|body|html|svg|math)[^>]*\/?>/gi;
484
- function xe(e) {
485
- return e.replace(be, "").replace(/<([a-zA-Z][a-zA-Z0-9]*)\s[^>]*>/g, "<$1>").replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)[^>]*>/g, (e, t) => ye.has(t.toLowerCase()) ? e : "");
486
- }
483
+ ]), xe = /<(script|style|iframe|object|embed|form|input|button|textarea|select|link|meta|head|body|html|svg|math)[\s\S]*?<\/\1\s*>|<(script|style|iframe|object|embed|form|input|button|textarea|select|link|meta|head|body|html|svg|math)[^>]*\/?>/gi;
487
484
  function Se(e) {
485
+ return e.replace(xe, "").replace(/<([a-zA-Z][a-zA-Z0-9]*)\s[^>]*>/g, "<$1>").replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)[^>]*>/g, (e, t) => be.has(t.toLowerCase()) ? e : "");
486
+ }
487
+ function Ce(e) {
488
488
  return /<[a-zA-Z][^>]*>/.test(e);
489
489
  }
490
490
  //#endregion
491
491
  //#region src/components/RichText.tsx
492
- function Z({ content: e, ...t }) {
493
- if (Se(e)) {
494
- let n = xe(e);
492
+ function X({ content: e, ...t }) {
493
+ if (Ce(e)) {
494
+ let n = Se(e);
495
495
  return /* @__PURE__ */ D(A, {
496
496
  ...t,
497
497
  children: /* @__PURE__ */ D("span", { dangerouslySetInnerHTML: { __html: n } })
@@ -503,16 +503,21 @@ function Z({ content: e, ...t }) {
503
503
  });
504
504
  }
505
505
  //#endregion
506
- //#region src/components/LiveStateAlert.tsx
507
- function Q({ data: e, trackingConfig: t, onClose: n, onCtaClick: r }) {
508
- let i = G(), { log: a } = p(), o = e.type === "alert" ? "danger" : "warning", s = w(() => u({
506
+ //#region src/components/LiveStateMessage.tsx
507
+ var we = {
508
+ alert: "danger",
509
+ warning: "warning",
510
+ info: "primary"
511
+ };
512
+ function Z({ data: e, trackingConfig: t, onClose: n, onCtaClick: r }) {
513
+ let i = W(), { log: a } = p(), o = we[e.type] ?? "danger", s = w(() => u({
509
514
  context: e.context,
510
515
  campaignId: e.campaignId,
511
516
  group: e.group,
512
517
  ...e.metadata,
513
518
  ...t.properties
514
519
  }), [e, t.properties]), c = w(() => {
515
- i(g(t.prefix, t.page, e.context, "click"), s()), r ? r(e.cta) : X(e.cta, a);
520
+ e.cta && (i(g(t.prefix, t.page, e.context, "click"), s()), r ? r(e.cta) : Y(e.cta, a));
516
521
  }, [
517
522
  e,
518
523
  t,
@@ -534,6 +539,7 @@ function Q({ data: e, trackingConfig: t, onClose: n, onCtaClick: r }) {
534
539
  }, []), /* @__PURE__ */ D(ee, {
535
540
  appearance: o,
536
541
  title: e.title,
542
+ "data-testid": "live-state-message",
537
543
  onRemove: n ? l : void 0,
538
544
  children: /* @__PURE__ */ O(k, {
539
545
  display: "flex",
@@ -544,14 +550,15 @@ function Q({ data: e, trackingConfig: t, onClose: n, onCtaClick: r }) {
544
550
  children: [/* @__PURE__ */ D(k, {
545
551
  flex: "1 1 auto",
546
552
  minWidth: "220px",
547
- children: /* @__PURE__ */ D(Z, { content: e.message })
548
- }), /* @__PURE__ */ D(k, {
553
+ children: /* @__PURE__ */ D(X, { content: e.message })
554
+ }), e.cta && /* @__PURE__ */ D(k, {
549
555
  display: "flex",
550
556
  justifyContent: "flex-end",
551
557
  marginTop: "2",
552
558
  children: /* @__PURE__ */ D(te, {
553
559
  appearance: "primary",
554
560
  onClick: c,
561
+ "data-testid": "live-state-message-cta-button",
555
562
  children: e.cta.label
556
563
  })
557
564
  })]
@@ -559,8 +566,8 @@ function Q({ data: e, trackingConfig: t, onClose: n, onCtaClick: r }) {
559
566
  });
560
567
  }
561
568
  //#endregion
562
- //#region src/components/LiveStateInfo.tsx
563
- var Ce = {
569
+ //#region src/components/LiveStatePromo.tsx
570
+ var Q = {
564
571
  blue: {
565
572
  background: "#0050C3",
566
573
  icon: "#FFFFFF"
@@ -571,7 +578,7 @@ var Ce = {
571
578
  }
572
579
  };
573
580
  function $({ data: e, trackingConfig: t, defaultVariant: n = "blue", onClose: r, isMobile: i, onCtaClick: a }) {
574
- let o = G(), { log: s } = p(), c = e.variant || n, l = Ce[c], [d, f] = E(() => window.innerWidth < 750);
581
+ let o = W(), { log: s } = p(), c = e.variant || n, l = Q[c], [d, f] = E(() => window.innerWidth < 750);
575
582
  T(() => {
576
583
  let e = () => f(window.innerWidth < 750);
577
584
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
@@ -583,7 +590,7 @@ function $({ data: e, trackingConfig: t, defaultVariant: n = "blue", onClose: r,
583
590
  ...e.metadata,
584
591
  ...t.properties
585
592
  }), [e, t.properties]), _ = w(() => {
586
- o(g(t.prefix, t.page, e.context, "click"), h()), a ? a(e.cta) : X(e.cta, s);
593
+ e.cta && (o(g(t.prefix, t.page, e.context, "click"), h()), a ? a(e.cta) : Y(e.cta, s));
587
594
  }, [
588
595
  e,
589
596
  t,
@@ -603,21 +610,22 @@ function $({ data: e, trackingConfig: t, defaultVariant: n = "blue", onClose: r,
603
610
  T(() => {
604
611
  o(g(t.prefix, t.page, e.context, "view"), h());
605
612
  }, []);
606
- let y = /* @__PURE__ */ D(ie, {
613
+ let y = e.cta ? /* @__PURE__ */ D(ie, {
607
614
  as: "a",
608
615
  textDecoration: "none",
609
616
  onClick: _,
610
- "data-testid": "live-state-cta-link",
617
+ "data-testid": "live-state-promo-cta-link",
611
618
  children: /* @__PURE__ */ D(A, {
612
619
  color: "primary-interactive",
613
620
  fontSize: "base",
614
621
  children: e.cta.label
615
622
  })
616
- });
623
+ }) : null;
617
624
  return /* @__PURE__ */ D(ne, { children: /* @__PURE__ */ O(k, {
618
625
  display: "flex",
619
626
  flexDirection: "row",
620
627
  justifyContent: "space-between",
628
+ "data-testid": "live-state-promo",
621
629
  children: [/* @__PURE__ */ O(k, {
622
630
  display: "flex",
623
631
  gap: "4",
@@ -643,17 +651,17 @@ function $({ data: e, trackingConfig: t, defaultVariant: n = "blue", onClose: r,
643
651
  }), /* @__PURE__ */ O(k, {
644
652
  display: "grid",
645
653
  gap: "2",
646
- children: [/* @__PURE__ */ O(k, { children: [/* @__PURE__ */ D(Z, {
654
+ children: [/* @__PURE__ */ O(k, { children: [/* @__PURE__ */ D(X, {
647
655
  content: e.title,
648
656
  fontSize: "base",
649
657
  color: "neutral-textHigh"
650
- }), /* @__PURE__ */ D(Z, {
658
+ }), /* @__PURE__ */ D(X, {
651
659
  content: e.message,
652
660
  fontSize: "base",
653
661
  color: "neutral-textLow"
654
662
  })] }), m && y]
655
663
  })]
656
- }), (!m || r) && /* @__PURE__ */ O(k, {
664
+ }), (!m && y || r) && /* @__PURE__ */ O(k, {
657
665
  display: "flex",
658
666
  flexDirection: m ? "column" : "row",
659
667
  alignItems: m ? "flex-end" : "center",
@@ -685,32 +693,36 @@ function $({ data: e, trackingConfig: t, defaultVariant: n = "blue", onClose: r,
685
693
  }
686
694
  //#endregion
687
695
  //#region src/components/LiveStateRenderer.tsx
688
- function we({ data: e, loading: t, trackingConfig: n, allowedContexts: r, defaultVariant: i, isMobile: a, onCtaClick: o }) {
689
- let { log: s, onNavigate: c } = p(), l = o ?? c, { isVisible: u, close: d } = ve({
696
+ function Te({ data: e, loading: t, trackingConfig: n, allowedContexts: r, defaultVariant: i, isMobile: a, onCtaClick: o }) {
697
+ let { log: s, onNavigate: c } = p(), l = o ?? c, { isVisible: u, close: d } = ye({
690
698
  context: e?.context ?? "",
691
699
  id: e?.campaignId,
692
700
  maxCloseTimes: e?.metadata?.maxCloseTimes,
693
701
  expiresIn: e?.metadata?.expiresIn
694
702
  });
695
703
  if (t || !e) return null;
696
- if (!e.context || !e.type || !e.title || !e.message || !e.cta?.label || !e.cta?.url || !e.cta?.type) return s("warn", "Invalid payload, missing required fields", { data: e }), null;
704
+ let f = e.cta != null && (!e.cta.label || !e.cta.url || !e.cta.type);
705
+ if (!e.context || !e.model || !e.type || !e.title || !e.message || f) return s("warn", "Invalid payload, missing required fields", { data: e }), null;
697
706
  if (r && !r.includes(e.context) || u === null || !u) return null;
698
- let f = e.closable ? d : void 0;
699
- return e.type === "alert" || e.type === "warning" ? /* @__PURE__ */ D(Q, {
700
- data: e,
701
- onClose: f,
702
- trackingConfig: n,
703
- onCtaClick: l
704
- }) : e.type === "info" ? /* @__PURE__ */ D($, {
705
- data: e,
706
- onClose: f,
707
- trackingConfig: n,
708
- defaultVariant: i,
709
- isMobile: a,
710
- onCtaClick: l
711
- }) : (s("warn", `Unknown type: ${e.type}`, { data: e }), null);
707
+ let m = e.closable ? d : void 0;
708
+ return {
709
+ message: /* @__PURE__ */ D(Z, {
710
+ data: e,
711
+ onClose: m,
712
+ trackingConfig: n,
713
+ onCtaClick: l
714
+ }),
715
+ promo: /* @__PURE__ */ D($, {
716
+ data: e,
717
+ onClose: m,
718
+ trackingConfig: n,
719
+ defaultVariant: i,
720
+ isMobile: a,
721
+ onCtaClick: l
722
+ })
723
+ }[e.model];
712
724
  }
713
725
  //#endregion
714
- export { K as LIVE_STATE_STORAGE_KEY, Q as LiveStateAlert, $ as LiveStateInfo, v as LiveStateProvider, we as LiveStateRenderer, X as handleCtaClick, ge as invalidateLiveState, he as prefetchLiveState, i as trackEvent, _e as useLiveState, G as useTrackEvent };
726
+ export { G as LIVE_STATE_STORAGE_KEY, Z as LiveStateMessage, $ as LiveStatePromo, v as LiveStateProvider, Te as LiveStateRenderer, Y as handleCtaClick, _e as invalidateLiveState, ge as prefetchLiveState, i as trackEvent, ve as useLiveState, W as useTrackEvent };
715
727
 
716
728
  //# sourceMappingURL=index.js.map