@streamlayer/react 1.24.5 → 1.24.7

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 (166) hide show
  1. package/lib/cjs/advertisement.js +19607 -203
  2. package/lib/cjs/auth.js +4459 -1
  3. package/lib/cjs/bet-pack.js +15691 -1
  4. package/lib/cjs/index.js +19411 -1
  5. package/lib/cjs/insight.js +13509 -1
  6. package/lib/cjs/masters.js +20696 -1
  7. package/lib/cjs/notification.js +13087 -1
  8. package/lib/cjs/package.json +1 -0
  9. package/lib/cjs/pause-ad.js +8390 -1
  10. package/lib/cjs/points.js +7189 -1
  11. package/lib/cjs/polyfills.js +69 -0
  12. package/lib/cjs/polymarket.js +16394 -14
  13. package/lib/cjs/style.css +1 -0
  14. package/lib/cjs/useStreamLayerApp.js +4711 -1
  15. package/lib/dist/cjs/index.js +20696 -1
  16. package/lib/dist/es/index.js +20669 -10
  17. package/lib/dist/es/polyfills.js +92 -0
  18. package/lib/es/Question.js +66 -65
  19. package/lib/es/advertisement.js +3402 -3294
  20. package/lib/es/analytics.js +1 -1
  21. package/lib/es/bet-pack.js +1 -1
  22. package/lib/es/feature.js +192 -37
  23. package/lib/es/{index-DvqmgCor.js → index-D8wyDNJD.js} +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/index10.js +181 -7
  26. package/lib/es/index11.js +371 -181
  27. package/lib/es/index12.js +366 -2579
  28. package/lib/es/index13.js +789 -234
  29. package/lib/es/index14.js +293 -792
  30. package/lib/es/index15.js +2550 -305
  31. package/lib/es/index16.js +64 -66
  32. package/lib/es/index2.js +285 -279
  33. package/lib/es/index3.js +34 -4
  34. package/lib/es/index4.js +16 -17
  35. package/lib/es/index5.js +3 -19
  36. package/lib/es/index6.js +7 -5
  37. package/lib/es/index7.js +284 -5
  38. package/lib/es/index8.js +236 -281
  39. package/lib/es/index9.js +8 -179
  40. package/lib/es/insight.js +2 -2
  41. package/lib/es/masters2.js +199 -189
  42. package/lib/es/notification.js +27 -28
  43. package/lib/es/pause-ad.js +124 -149
  44. package/lib/es/points.js +23 -24
  45. package/lib/es/polymarket.js +3 -3
  46. package/lib/es/storage.js +4 -4
  47. package/lib/es/style.css +1 -0
  48. package/lib/es/useStreamLayerApp2.js +5579 -4475
  49. package/lib/source.css +1 -120
  50. package/package.json +126 -91
  51. package/lib/cjs/Question.js +0 -1
  52. package/lib/cjs/analytics.js +0 -1
  53. package/lib/cjs/feature.js +0 -1
  54. package/lib/cjs/gamification-feature.js +0 -1
  55. package/lib/cjs/gamification-feature2.js +0 -1
  56. package/lib/cjs/hooks-n9ax4LRT.js +0 -1
  57. package/lib/cjs/index-DvqmgCor.js +0 -5
  58. package/lib/cjs/index10.js +0 -1
  59. package/lib/cjs/index11.js +0 -1
  60. package/lib/cjs/index12.js +0 -1
  61. package/lib/cjs/index13.js +0 -1
  62. package/lib/cjs/index14.js +0 -4
  63. package/lib/cjs/index15.js +0 -1
  64. package/lib/cjs/index16.js +0 -5
  65. package/lib/cjs/index2.js +0 -1
  66. package/lib/cjs/index3.js +0 -1
  67. package/lib/cjs/index4.js +0 -5
  68. package/lib/cjs/index5.js +0 -1
  69. package/lib/cjs/index6.js +0 -1
  70. package/lib/cjs/index7.js +0 -1
  71. package/lib/cjs/index8.js +0 -1
  72. package/lib/cjs/index9.js +0 -7
  73. package/lib/cjs/masters2.js +0 -8
  74. package/lib/cjs/sl-types.js +0 -1
  75. package/lib/cjs/storage.js +0 -1
  76. package/lib/cjs/theme.js +0 -1
  77. package/lib/cjs/useStreamLayerApp2.js +0 -17
  78. package/lib/cjs/utils.js +0 -47
  79. package/lib/classic/app/advertisement.d.ts +0 -19
  80. package/lib/classic/app/app.d.ts +0 -23
  81. package/lib/classic/app/auth.d.ts +0 -4
  82. package/lib/classic/app/bet-pack.d.ts +0 -10
  83. package/lib/classic/app/insight.d.ts +0 -13
  84. package/lib/classic/app/masters.d.ts +0 -19
  85. package/lib/classic/app/notification.d.ts +0 -5
  86. package/lib/classic/app/pause-ad.d.ts +0 -27
  87. package/lib/classic/app/points.d.ts +0 -3
  88. package/lib/classic/app/polymarket.d.ts +0 -7
  89. package/lib/classic/app/useStreamLayerApp.d.ts +0 -1
  90. package/lib/classic/cjs/Question.js +0 -1
  91. package/lib/classic/cjs/advertisement.js +0 -203
  92. package/lib/classic/cjs/analytics.js +0 -1
  93. package/lib/classic/cjs/auth.js +0 -1
  94. package/lib/classic/cjs/bet-pack.js +0 -5
  95. package/lib/classic/cjs/feature.js +0 -1
  96. package/lib/classic/cjs/gamification-feature.js +0 -1
  97. package/lib/classic/cjs/hooks-n9ax4LRT.js +0 -1
  98. package/lib/classic/cjs/index-DvqmgCor.js +0 -5
  99. package/lib/classic/cjs/index.js +0 -1
  100. package/lib/classic/cjs/index10.js +0 -1
  101. package/lib/classic/cjs/index11.js +0 -1
  102. package/lib/classic/cjs/index12.js +0 -1
  103. package/lib/classic/cjs/index13.js +0 -4
  104. package/lib/classic/cjs/index2.js +0 -5
  105. package/lib/classic/cjs/index3.js +0 -1
  106. package/lib/classic/cjs/index4.js +0 -1
  107. package/lib/classic/cjs/index5.js +0 -1
  108. package/lib/classic/cjs/index6.js +0 -1
  109. package/lib/classic/cjs/index7.js +0 -7
  110. package/lib/classic/cjs/index8.js +0 -1
  111. package/lib/classic/cjs/index9.js +0 -1
  112. package/lib/classic/cjs/insight.js +0 -1
  113. package/lib/classic/cjs/notification.js +0 -1
  114. package/lib/classic/cjs/notification2.js +0 -1
  115. package/lib/classic/cjs/pause-ad.js +0 -1
  116. package/lib/classic/cjs/points.js +0 -1
  117. package/lib/classic/cjs/polymarket.js +0 -14
  118. package/lib/classic/cjs/sl-types.js +0 -1
  119. package/lib/classic/cjs/useStreamLayerApp.js +0 -1
  120. package/lib/classic/cjs/useStreamLayerApp2.js +0 -17
  121. package/lib/classic/cjs/utils.js +0 -47
  122. package/lib/classic/es/Question.js +0 -388
  123. package/lib/classic/es/advertisement.js +0 -38759
  124. package/lib/classic/es/analytics.js +0 -84
  125. package/lib/classic/es/auth.js +0 -11
  126. package/lib/classic/es/bet-pack.js +0 -3419
  127. package/lib/classic/es/feature.js +0 -59
  128. package/lib/classic/es/gamification-feature.js +0 -4
  129. package/lib/classic/es/hooks-n9ax4LRT.js +0 -97
  130. package/lib/classic/es/index-DvqmgCor.js +0 -3775
  131. package/lib/classic/es/index.js +0 -15
  132. package/lib/classic/es/index10.js +0 -2592
  133. package/lib/classic/es/index11.js +0 -317
  134. package/lib/classic/es/index12.js +0 -185
  135. package/lib/classic/es/index13.js +0 -820
  136. package/lib/classic/es/index2.js +0 -2597
  137. package/lib/classic/es/index3.js +0 -19
  138. package/lib/classic/es/index4.js +0 -6
  139. package/lib/classic/es/index5.js +0 -5
  140. package/lib/classic/es/index6.js +0 -285
  141. package/lib/classic/es/index7.js +0 -181
  142. package/lib/classic/es/index8.js +0 -7
  143. package/lib/classic/es/index9.js +0 -11
  144. package/lib/classic/es/insight.js +0 -79
  145. package/lib/classic/es/notification.js +0 -9
  146. package/lib/classic/es/notification2.js +0 -1127
  147. package/lib/classic/es/pause-ad.js +0 -257
  148. package/lib/classic/es/points.js +0 -77
  149. package/lib/classic/es/polymarket.js +0 -6617
  150. package/lib/classic/es/sl-types.js +0 -156
  151. package/lib/classic/es/useStreamLayerApp.js +0 -4
  152. package/lib/classic/es/useStreamLayerApp2.js +0 -11573
  153. package/lib/classic/es/utils.js +0 -76
  154. package/lib/classic/index.d.ts +0 -6
  155. package/lib/classic/masters.d.ts +0 -8
  156. package/lib/classic/source.css +0 -110
  157. package/lib/dist/cjs/gamification-feature.js +0 -1
  158. package/lib/dist/cjs/index-DvqmgCor.js +0 -5
  159. package/lib/dist/cjs/masters.js +0 -69
  160. package/lib/dist/es/gamification-feature.js +0 -4
  161. package/lib/dist/es/index-DvqmgCor.js +0 -3775
  162. package/lib/dist/es/masters.js +0 -22204
  163. package/lib/dist/index.d.ts +0 -1355
  164. package/lib/dist/source.css +0 -64
  165. package/lib/es/sl-types.js +0 -156
  166. package/lib/style.css +0 -1
package/lib/es/index11.js CHANGED
@@ -1,185 +1,375 @@
1
- import { s as a } from "./sl-types.js";
2
- import { Q as i } from "./useStreamLayerApp2.js";
3
- import { jsxs as t, jsx as s, Fragment as U } from "react/jsx-runtime";
4
- import { memo as $, useMemo as w } from "react";
5
- import { F as y } from "./index15.js";
6
- import { B as T } from "./index8.js";
7
- const G = {
8
- [i.TWEET]: { label: "Insight", iconName: "icon-insight" },
9
- [i.PROMOTION]: { label: "Insight", iconName: "icon-insight" },
10
- [i.UNSET]: void 0,
11
- [i.FACTOID]: { label: "Insight", iconName: "icon-insight" },
12
- [i.POLL]: { label: "Poll", iconName: "icon-poll" },
13
- [i.TRIVIA]: { label: "Trivia", iconName: "icon-trivia" },
14
- [i.PREDICTION]: { label: "Prediction", iconName: "icon-prediction" }
15
- }, J = {
16
- [i.TWEET]: "Learn more",
17
- [i.FACTOID]: "Learn more",
18
- [i.POLL]: "Answer",
19
- [i.TRIVIA]: "Answer",
20
- [i.PREDICTION]: "Answer",
21
- [i.PROMOTION]: "",
22
- [i.UNSET]: ""
23
- }, K = (r) => r.split(/\s+/).map((n) => n[0]).join("").toUpperCase(), X = (r) => r ? r.toLocaleString("en-US") : "0", L = (r) => {
24
- const n = new Date(r);
25
- if (!n)
26
- return "";
27
- const c = /* @__PURE__ */ new Date(), o = Math.floor(c.getTime() - n.getTime());
28
- return o < 6e4 ? `${Math.floor(o / 1e3)}s` : o < 36e5 ? `${Math.floor(o / 6e4)}m` : o < 864e5 ? `${Math.floor(o / 36e5)}h` : n.getFullYear() === c.getFullYear() ? `${n.toLocaleDateString("en-US", {
29
- month: "short",
30
- day: "numeric"
31
- })}` : `${n.toLocaleDateString("en-US", {
32
- month: "2-digit",
33
- day: "2-digit",
34
- year: "2-digit"
35
- })}`;
36
- }, D = /* @__PURE__ */ a("div")({
37
- name: "Container",
38
- class: "cjq447q",
39
- propsAsIs: !1
40
- }), H = /* @__PURE__ */ a("div")({
41
- name: "ImageContainer",
42
- class: "i14egogb",
43
- propsAsIs: !1
44
- }), S = /* @__PURE__ */ a("img")({
45
- name: "Image",
46
- class: "i2g9g4l",
47
- propsAsIs: !1
48
- }), O = () => T, E = /* @__PURE__ */ a(O())({
49
- name: "TwitterIcon",
50
- class: "t1c454nm",
51
- propsAsIs: !0
52
- }), b = /* @__PURE__ */ a("div")({
53
- name: "Details",
54
- class: "d11nigc3",
55
- propsAsIs: !1
56
- }), x = /* @__PURE__ */ a("div")({
57
- name: "Name",
58
- class: "nrxa4k8",
59
- propsAsIs: !1
60
- }), C = /* @__PURE__ */ a("div")({
61
- name: "UserNameAndDate",
62
- class: "u1p051g3",
63
- propsAsIs: !1
64
- }), F = ({ image: r, name: n, userName: c, verified: o, createdTweet: p }) => {
65
- const m = p && L(p);
66
- return /* @__PURE__ */ t(D, { children: [
67
- r && /* @__PURE__ */ t(H, { children: [
68
- /* @__PURE__ */ s(S, { className: "SL_AccountImage", src: r }),
69
- /* @__PURE__ */ s(E, { name: "twitter" })
70
- ] }),
71
- /* @__PURE__ */ t(b, { children: [
72
- n && /* @__PURE__ */ t(x, { className: "SL_TweetAccountName", children: [
73
- n,
74
- " ",
75
- o && /* @__PURE__ */ s(T, { name: "icon-twitter-verified" })
76
- ] }),
77
- c && /* @__PURE__ */ t(C, { className: "SL_TweetAccountUserName", children: [
78
- "@",
79
- c,
80
- " ",
81
- m && `・ ${m}`
82
- ] })
83
- ] })
84
- ] });
85
- }, P = /* @__PURE__ */ a("div")({
86
- name: "Container",
87
- class: "c1kzqw87",
88
- propsAsIs: !1
89
- }), M = /* @__PURE__ */ a("div")({
90
- name: "Details",
91
- class: "d9r1hf9",
92
- propsAsIs: !1
93
- }), R = /* @__PURE__ */ a("div")({
94
- name: "Body",
95
- class: "bezygt5",
96
- propsAsIs: !1
97
- }), d = /* @__PURE__ */ a("div")({
98
- name: "ImagesContainer",
99
- class: "i1y8f7ym",
100
- propsAsIs: !1
101
- }), h = /* @__PURE__ */ a("div")({
102
- name: "ImagesBlock",
103
- class: "i18gwonx",
104
- propsAsIs: !1
105
- }), N = /* @__PURE__ */ a("img")({
106
- name: "Image",
107
- class: "i3g0xjd",
108
- propsAsIs: !1
109
- }), j = () => N, l = /* @__PURE__ */ a(j())({
110
- name: "ImageFullSize",
111
- class: "io8rt7p",
112
- propsAsIs: !0
113
- }), V = () => N, f = /* @__PURE__ */ a(V())({
114
- name: "ImageHalfSize",
115
- class: "i4hn3ox",
116
- propsAsIs: !0
117
- }), _ = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), z = (r) => r?.replace(_, ""), Z = $(
118
- ({ image: r, body: n, muted: c, account: o, accountVerified: p, tweet: m, isDetail: u, controlVideo: v }) => {
119
- const e = m?.meta?.extendedEntities?.media, g = e?.find(
120
- ({ type: I }) => I === "photo"
121
- /* PHOTO */
122
- ), A = w(() => e?.[0]?.videoInfo?.variants?.findLast(
123
- ({ contentType: I }) => I === "video/mp4"
124
- /* VIDEO */
125
- )?.url, [e]);
126
- return /* @__PURE__ */ t(P, { children: [
127
- /* @__PURE__ */ t(M, { children: [
128
- /* @__PURE__ */ s(
129
- F,
130
- {
131
- image: r,
132
- name: m?.meta?.accountName,
133
- userName: o,
134
- verified: p,
135
- createdTweet: m?.date
136
- }
137
- ),
138
- /* @__PURE__ */ s(R, { children: z(n) }),
139
- !u && g && /* @__PURE__ */ s(d, { children: /* @__PURE__ */ s(l, { src: e?.[0].mediaUrlHttps }) }),
140
- u && g && /* @__PURE__ */ t(U, { children: [
141
- e?.length === 1 && /* @__PURE__ */ s(d, { children: /* @__PURE__ */ s(l, { src: e[0].mediaUrlHttps }) }),
142
- e?.length === 2 && /* @__PURE__ */ t(d, { children: [
143
- /* @__PURE__ */ s(f, { src: e[0].mediaUrlHttps }),
144
- /* @__PURE__ */ s(f, { src: e[1].mediaUrlHttps })
145
- ] }),
146
- e?.length === 3 && /* @__PURE__ */ t(d, { children: [
147
- /* @__PURE__ */ s(f, { src: e[0].mediaUrlHttps }),
148
- /* @__PURE__ */ t(h, { children: [
149
- /* @__PURE__ */ s(l, { src: e[1].mediaUrlHttps }),
150
- /* @__PURE__ */ s(l, { src: e[2].mediaUrlHttps })
151
- ] })
152
- ] }),
153
- e?.length === 4 && /* @__PURE__ */ t(d, { children: [
154
- /* @__PURE__ */ t(h, { children: [
155
- /* @__PURE__ */ s(l, { src: e[0].mediaUrlHttps }),
156
- /* @__PURE__ */ s(l, { src: e[1].mediaUrlHttps })
157
- ] }),
158
- /* @__PURE__ */ t(h, { children: [
159
- /* @__PURE__ */ s(l, { src: e[2].mediaUrlHttps }),
160
- /* @__PURE__ */ s(l, { src: e[3].mediaUrlHttps })
161
- ] })
162
- ] })
163
- ] })
164
- ] }),
165
- !g && (e?.[0]?.type === "video" || e?.[0]?.type === "animated_gif") && A && /* @__PURE__ */ s(
166
- y,
167
- {
168
- muted: c,
169
- source: A,
170
- poster: e[0].mediaUrlHttps,
171
- controlVideo: v
1
+ import { jsx as et } from "react/jsx-runtime";
2
+ import { g as nt, a as rt } from "./index3.js";
3
+ import at from "react";
4
+ var G = {}, $ = function() {
5
+ return $ = Object.assign || function(s) {
6
+ for (var i, u = 1, l = arguments.length; u < l; u++) for (var e in i = arguments[u]) Object.prototype.hasOwnProperty.call(i, e) && (s[e] = i[e]);
7
+ return s;
8
+ }, $.apply(this, arguments);
9
+ }, it = (function() {
10
+ function s(i, u, l) {
11
+ var e = this;
12
+ this.endVal = u, this.options = l, this.version = "2.8.0", this.defaults = { startVal: 0, decimalPlaces: 0, duration: 2, useEasing: !0, useGrouping: !0, useIndianSeparators: !1, smartEasingThreshold: 999, smartEasingAmount: 333, separator: ",", decimal: ".", prefix: "", suffix: "", enableScrollSpy: !1, scrollSpyDelay: 200, scrollSpyOnce: !1 }, this.finalEndVal = null, this.useEasing = !0, this.countDown = !1, this.error = "", this.startVal = 0, this.paused = !0, this.once = !1, this.count = function(c) {
13
+ e.startTime || (e.startTime = c);
14
+ var d = c - e.startTime;
15
+ e.remaining = e.duration - d, e.useEasing ? e.countDown ? e.frameVal = e.startVal - e.easingFn(d, 0, e.startVal - e.endVal, e.duration) : e.frameVal = e.easingFn(d, e.startVal, e.endVal - e.startVal, e.duration) : e.frameVal = e.startVal + (e.endVal - e.startVal) * (d / e.duration);
16
+ var h = e.countDown ? e.frameVal < e.endVal : e.frameVal > e.endVal;
17
+ e.frameVal = h ? e.endVal : e.frameVal, e.frameVal = Number(e.frameVal.toFixed(e.options.decimalPlaces)), e.printValue(e.frameVal), d < e.duration ? e.rAF = requestAnimationFrame(e.count) : e.finalEndVal !== null ? e.update(e.finalEndVal) : e.options.onCompleteCallback && e.options.onCompleteCallback();
18
+ }, this.formatNumber = function(c) {
19
+ var d, h, V, P, L = c < 0 ? "-" : "";
20
+ d = Math.abs(c).toFixed(e.options.decimalPlaces);
21
+ var T = (d += "").split(".");
22
+ if (h = T[0], V = T.length > 1 ? e.options.decimal + T[1] : "", e.options.useGrouping) {
23
+ P = "";
24
+ for (var Y = 3, I = 0, C = 0, k = h.length; C < k; ++C) e.options.useIndianSeparators && C === 4 && (Y = 2, I = 1), C !== 0 && I % Y == 0 && (P = e.options.separator + P), I++, P = h[k - C - 1] + P;
25
+ h = P;
26
+ }
27
+ return e.options.numerals && e.options.numerals.length && (h = h.replace(/[0-9]/g, (function(N) {
28
+ return e.options.numerals[+N];
29
+ })), V = V.replace(/[0-9]/g, (function(N) {
30
+ return e.options.numerals[+N];
31
+ }))), L + e.options.prefix + h + V + e.options.suffix;
32
+ }, this.easeOutExpo = function(c, d, h, V) {
33
+ return h * (1 - Math.pow(2, -10 * c / V)) * 1024 / 1023 + d;
34
+ }, this.options = $($({}, this.defaults), l), this.formattingFn = this.options.formattingFn ? this.options.formattingFn : this.formatNumber, this.easingFn = this.options.easingFn ? this.options.easingFn : this.easeOutExpo, this.startVal = this.validateValue(this.options.startVal), this.frameVal = this.startVal, this.endVal = this.validateValue(u), this.options.decimalPlaces = Math.max(this.options.decimalPlaces), this.resetDuration(), this.options.separator = String(this.options.separator), this.useEasing = this.options.useEasing, this.options.separator === "" && (this.options.useGrouping = !1), this.el = typeof i == "string" ? document.getElementById(i) : i, this.el ? this.printValue(this.startVal) : this.error = "[CountUp] target is null or undefined", typeof window < "u" && this.options.enableScrollSpy && (this.error ? console.error(this.error, i) : (window.onScrollFns = window.onScrollFns || [], window.onScrollFns.push((function() {
35
+ return e.handleScroll(e);
36
+ })), window.onscroll = function() {
37
+ window.onScrollFns.forEach((function(c) {
38
+ return c();
39
+ }));
40
+ }, this.handleScroll(this)));
41
+ }
42
+ return s.prototype.handleScroll = function(i) {
43
+ if (i && window && !i.once) {
44
+ var u = window.innerHeight + window.scrollY, l = i.el.getBoundingClientRect(), e = l.top + window.pageYOffset, c = l.top + l.height + window.pageYOffset;
45
+ c < u && c > window.scrollY && i.paused ? (i.paused = !1, setTimeout((function() {
46
+ return i.start();
47
+ }), i.options.scrollSpyDelay), i.options.scrollSpyOnce && (i.once = !0)) : (window.scrollY > c || e > u) && !i.paused && i.reset();
48
+ }
49
+ }, s.prototype.determineDirectionAndSmartEasing = function() {
50
+ var i = this.finalEndVal ? this.finalEndVal : this.endVal;
51
+ this.countDown = this.startVal > i;
52
+ var u = i - this.startVal;
53
+ if (Math.abs(u) > this.options.smartEasingThreshold && this.options.useEasing) {
54
+ this.finalEndVal = i;
55
+ var l = this.countDown ? 1 : -1;
56
+ this.endVal = i + l * this.options.smartEasingAmount, this.duration = this.duration / 2;
57
+ } else this.endVal = i, this.finalEndVal = null;
58
+ this.finalEndVal !== null ? this.useEasing = !1 : this.useEasing = this.options.useEasing;
59
+ }, s.prototype.start = function(i) {
60
+ this.error || (this.options.onStartCallback && this.options.onStartCallback(), i && (this.options.onCompleteCallback = i), this.duration > 0 ? (this.determineDirectionAndSmartEasing(), this.paused = !1, this.rAF = requestAnimationFrame(this.count)) : this.printValue(this.endVal));
61
+ }, s.prototype.pauseResume = function() {
62
+ this.paused ? (this.startTime = null, this.duration = this.remaining, this.startVal = this.frameVal, this.determineDirectionAndSmartEasing(), this.rAF = requestAnimationFrame(this.count)) : cancelAnimationFrame(this.rAF), this.paused = !this.paused;
63
+ }, s.prototype.reset = function() {
64
+ cancelAnimationFrame(this.rAF), this.paused = !0, this.resetDuration(), this.startVal = this.validateValue(this.options.startVal), this.frameVal = this.startVal, this.printValue(this.startVal);
65
+ }, s.prototype.update = function(i) {
66
+ cancelAnimationFrame(this.rAF), this.startTime = null, this.endVal = this.validateValue(i), this.endVal !== this.frameVal && (this.startVal = this.frameVal, this.finalEndVal == null && this.resetDuration(), this.finalEndVal = null, this.determineDirectionAndSmartEasing(), this.rAF = requestAnimationFrame(this.count));
67
+ }, s.prototype.printValue = function(i) {
68
+ var u;
69
+ if (this.el) {
70
+ var l = this.formattingFn(i);
71
+ !((u = this.options.plugin) === null || u === void 0) && u.render ? this.options.plugin.render(this.el, l) : this.el.tagName === "INPUT" ? this.el.value = l : this.el.tagName === "text" || this.el.tagName === "tspan" ? this.el.textContent = l : this.el.innerHTML = l;
72
+ }
73
+ }, s.prototype.ensureNumber = function(i) {
74
+ return typeof i == "number" && !isNaN(i);
75
+ }, s.prototype.validateValue = function(i) {
76
+ var u = Number(i);
77
+ return this.ensureNumber(u) ? u : (this.error = "[CountUp] invalid start or end value: ".concat(i), null);
78
+ }, s.prototype.resetDuration = function() {
79
+ this.startTime = null, this.duration = 1e3 * Number(this.options.duration), this.remaining = this.duration;
80
+ }, s;
81
+ })();
82
+ const st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
83
+ __proto__: null,
84
+ CountUp: it
85
+ }, Symbol.toStringTag, { value: "Module" })), ot = /* @__PURE__ */ nt(st);
86
+ var K;
87
+ function ut() {
88
+ if (K) return G;
89
+ K = 1, Object.defineProperty(G, "__esModule", { value: !0 });
90
+ var s = at, i = ot;
91
+ function u(r, t) {
92
+ var n = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
93
+ if (n != null) {
94
+ var a, o, f, w, y = [], p = !0, m = !1;
95
+ try {
96
+ if (f = (n = n.call(r)).next, t !== 0) for (; !(p = (a = f.call(n)).done) && (y.push(a.value), y.length !== t); p = !0) ;
97
+ } catch (g) {
98
+ m = !0, o = g;
99
+ } finally {
100
+ try {
101
+ if (!p && n.return != null && (w = n.return(), Object(w) !== w)) return;
102
+ } finally {
103
+ if (m) throw o;
172
104
  }
173
- )
174
- ] });
105
+ }
106
+ return y;
107
+ }
108
+ }
109
+ function l(r, t) {
110
+ var n = Object.keys(r);
111
+ if (Object.getOwnPropertySymbols) {
112
+ var a = Object.getOwnPropertySymbols(r);
113
+ t && (a = a.filter(function(o) {
114
+ return Object.getOwnPropertyDescriptor(r, o).enumerable;
115
+ })), n.push.apply(n, a);
116
+ }
117
+ return n;
118
+ }
119
+ function e(r) {
120
+ for (var t = 1; t < arguments.length; t++) {
121
+ var n = arguments[t] != null ? arguments[t] : {};
122
+ t % 2 ? l(Object(n), !0).forEach(function(a) {
123
+ h(r, a, n[a]);
124
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(n)) : l(Object(n)).forEach(function(a) {
125
+ Object.defineProperty(r, a, Object.getOwnPropertyDescriptor(n, a));
126
+ });
127
+ }
128
+ return r;
129
+ }
130
+ function c(r, t) {
131
+ if (typeof r != "object" || !r) return r;
132
+ var n = r[Symbol.toPrimitive];
133
+ if (n !== void 0) {
134
+ var a = n.call(r, t);
135
+ if (typeof a != "object") return a;
136
+ throw new TypeError("@@toPrimitive must return a primitive value.");
137
+ }
138
+ return (t === "string" ? String : Number)(r);
139
+ }
140
+ function d(r) {
141
+ var t = c(r, "string");
142
+ return typeof t == "symbol" ? t : String(t);
143
+ }
144
+ function h(r, t, n) {
145
+ return t = d(t), t in r ? Object.defineProperty(r, t, {
146
+ value: n,
147
+ enumerable: !0,
148
+ configurable: !0,
149
+ writable: !0
150
+ }) : r[t] = n, r;
151
+ }
152
+ function V() {
153
+ return V = Object.assign ? Object.assign.bind() : function(r) {
154
+ for (var t = 1; t < arguments.length; t++) {
155
+ var n = arguments[t];
156
+ for (var a in n)
157
+ Object.prototype.hasOwnProperty.call(n, a) && (r[a] = n[a]);
158
+ }
159
+ return r;
160
+ }, V.apply(this, arguments);
161
+ }
162
+ function P(r, t) {
163
+ if (r == null) return {};
164
+ var n = {}, a = Object.keys(r), o, f;
165
+ for (f = 0; f < a.length; f++)
166
+ o = a[f], !(t.indexOf(o) >= 0) && (n[o] = r[o]);
167
+ return n;
175
168
  }
176
- );
169
+ function L(r, t) {
170
+ if (r == null) return {};
171
+ var n = P(r, t), a, o;
172
+ if (Object.getOwnPropertySymbols) {
173
+ var f = Object.getOwnPropertySymbols(r);
174
+ for (o = 0; o < f.length; o++)
175
+ a = f[o], !(t.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(r, a) && (n[a] = r[a]);
176
+ }
177
+ return n;
178
+ }
179
+ function T(r, t) {
180
+ return Y(r) || u(r, t) || I(r, t) || k();
181
+ }
182
+ function Y(r) {
183
+ if (Array.isArray(r)) return r;
184
+ }
185
+ function I(r, t) {
186
+ if (r) {
187
+ if (typeof r == "string") return C(r, t);
188
+ var n = Object.prototype.toString.call(r).slice(8, -1);
189
+ if (n === "Object" && r.constructor && (n = r.constructor.name), n === "Map" || n === "Set") return Array.from(r);
190
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return C(r, t);
191
+ }
192
+ }
193
+ function C(r, t) {
194
+ (t == null || t > r.length) && (t = r.length);
195
+ for (var n = 0, a = new Array(t); n < t; n++) a[n] = r[n];
196
+ return a;
197
+ }
198
+ function k() {
199
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
200
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
201
+ }
202
+ var N = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
203
+ function v(r) {
204
+ var t = s.useRef(r);
205
+ return N(function() {
206
+ t.current = r;
207
+ }), s.useCallback(function() {
208
+ for (var n = arguments.length, a = new Array(n), o = 0; o < n; o++)
209
+ a[o] = arguments[o];
210
+ return t.current.apply(void 0, a);
211
+ }, []);
212
+ }
213
+ var J = function(t, n) {
214
+ var a = n.decimal, o = n.decimals, f = n.duration, w = n.easingFn, y = n.end, p = n.formattingFn, m = n.numerals, g = n.prefix, j = n.separator, A = n.start, x = n.suffix, U = n.useEasing, O = n.useGrouping, E = n.useIndianSeparators, D = n.enableScrollSpy, b = n.scrollSpyDelay, _ = n.scrollSpyOnce, F = n.plugin;
215
+ return new i.CountUp(t, y, {
216
+ startVal: A,
217
+ duration: f,
218
+ decimal: a,
219
+ decimalPlaces: o,
220
+ easingFn: w,
221
+ formattingFn: p,
222
+ numerals: m,
223
+ separator: j,
224
+ prefix: g,
225
+ suffix: x,
226
+ plugin: F,
227
+ useEasing: U,
228
+ useIndianSeparators: E,
229
+ useGrouping: O,
230
+ enableScrollSpy: D,
231
+ scrollSpyDelay: b,
232
+ scrollSpyOnce: _
233
+ });
234
+ }, Q = ["ref", "startOnMount", "enableReinitialize", "delay", "onEnd", "onStart", "onPauseResume", "onReset", "onUpdate"], X = {
235
+ decimal: ".",
236
+ separator: ",",
237
+ delay: null,
238
+ prefix: "",
239
+ suffix: "",
240
+ duration: 2,
241
+ start: 0,
242
+ decimals: 0,
243
+ startOnMount: !0,
244
+ enableReinitialize: !0,
245
+ useEasing: !0,
246
+ useGrouping: !0,
247
+ useIndianSeparators: !1
248
+ }, W = function(t) {
249
+ var n = Object.fromEntries(Object.entries(t).filter(function(S) {
250
+ var q = T(S, 2), B = q[1];
251
+ return B !== void 0;
252
+ })), a = s.useMemo(function() {
253
+ return e(e({}, X), n);
254
+ }, [t]), o = a.ref, f = a.startOnMount, w = a.enableReinitialize, y = a.delay, p = a.onEnd, m = a.onStart, g = a.onPauseResume, j = a.onReset, A = a.onUpdate, x = L(a, Q), U = s.useRef(), O = s.useRef(), E = s.useRef(!1), D = v(function() {
255
+ return J(typeof o == "string" ? o : o.current, x);
256
+ }), b = v(function(S) {
257
+ var q = U.current;
258
+ if (q && !S)
259
+ return q;
260
+ var B = D();
261
+ return U.current = B, B;
262
+ }), _ = v(function() {
263
+ var S = function() {
264
+ return b(!0).start(function() {
265
+ p?.({
266
+ pauseResume: F,
267
+ reset: R,
268
+ start: z,
269
+ update: M
270
+ });
271
+ });
272
+ };
273
+ y && y > 0 ? O.current = setTimeout(S, y * 1e3) : S(), m?.({
274
+ pauseResume: F,
275
+ reset: R,
276
+ update: M
277
+ });
278
+ }), F = v(function() {
279
+ b().pauseResume(), g?.({
280
+ reset: R,
281
+ start: z,
282
+ update: M
283
+ });
284
+ }), R = v(function() {
285
+ b().el && (O.current && clearTimeout(O.current), b().reset(), j?.({
286
+ pauseResume: F,
287
+ start: z,
288
+ update: M
289
+ }));
290
+ }), M = v(function(S) {
291
+ b().update(S), A?.({
292
+ pauseResume: F,
293
+ reset: R,
294
+ start: z
295
+ });
296
+ }), z = v(function() {
297
+ R(), _();
298
+ }), H = v(function(S) {
299
+ f && (S && R(), _());
300
+ });
301
+ return s.useEffect(function() {
302
+ E.current ? w && H(!0) : (E.current = !0, H());
303
+ }, [w, E, H, y, t.start, t.suffix, t.prefix, t.duration, t.separator, t.decimals, t.decimal, t.formattingFn]), s.useEffect(function() {
304
+ return function() {
305
+ R();
306
+ };
307
+ }, [R]), {
308
+ start: z,
309
+ pauseResume: F,
310
+ reset: R,
311
+ update: M,
312
+ getCountUp: b
313
+ };
314
+ }, Z = ["className", "redraw", "containerProps", "children", "style"], tt = function(t) {
315
+ var n = t.className, a = t.redraw, o = t.containerProps, f = t.children, w = t.style, y = L(t, Z), p = s.useRef(null), m = s.useRef(!1), g = W(e(e({}, y), {}, {
316
+ ref: p,
317
+ startOnMount: typeof f != "function" || t.delay === 0,
318
+ // component manually restarts
319
+ enableReinitialize: !1
320
+ })), j = g.start, A = g.reset, x = g.update, U = g.pauseResume, O = g.getCountUp, E = v(function() {
321
+ j();
322
+ }), D = v(function(F) {
323
+ t.preserveValue || A(), x(F);
324
+ }), b = v(function() {
325
+ if (typeof t.children == "function" && !(p.current instanceof Element)) {
326
+ console.error(`Couldn't find attached element to hook the CountUp instance into! Try to attach "containerRef" from the render prop to a an Element, eg. <span ref={containerRef} />.`);
327
+ return;
328
+ }
329
+ O();
330
+ });
331
+ s.useEffect(function() {
332
+ b();
333
+ }, [b]), s.useEffect(function() {
334
+ m.current && D(t.end);
335
+ }, [t.end, D]);
336
+ var _ = a && t;
337
+ return s.useEffect(function() {
338
+ a && m.current && E();
339
+ }, [E, a, _]), s.useEffect(function() {
340
+ !a && m.current && E();
341
+ }, [E, a, t.start, t.suffix, t.prefix, t.duration, t.separator, t.decimals, t.decimal, t.className, t.formattingFn]), s.useEffect(function() {
342
+ m.current = !0;
343
+ }, []), typeof f == "function" ? f({
344
+ countUpRef: p,
345
+ start: j,
346
+ reset: A,
347
+ update: x,
348
+ pauseResume: U,
349
+ getCountUp: O
350
+ }) : /* @__PURE__ */ s.createElement("span", V({
351
+ className: n,
352
+ ref: p,
353
+ style: w
354
+ }, o), typeof t.start < "u" ? O().formattingFn(t.start) : "");
355
+ };
356
+ return G.default = tt, G.useCountUp = W, G;
357
+ }
358
+ var lt = ut();
359
+ const ft = /* @__PURE__ */ rt(lt), ht = ({ value: s = 0, decimals: i, duration: u = 1, preserveValue: l = !0, ...e }) => {
360
+ const [, c] = s.toString().split("."), d = i ?? (c?.length || 0);
361
+ return /* @__PURE__ */ et(
362
+ ft,
363
+ {
364
+ end: s,
365
+ ...e,
366
+ duration: u,
367
+ decimals: d,
368
+ enableScrollSpy: !1,
369
+ preserveValue: l
370
+ }
371
+ );
372
+ };
177
373
  export {
178
- F as D,
179
- K as I,
180
- Z as N,
181
- G as e,
182
- z as j,
183
- J as o,
184
- X as s
374
+ ht as p
185
375
  };