@platform-x/hcltechx-mfe-wrapper 1.0.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.
Files changed (54) hide show
  1. package/BrightcovePlayer-B2Rrij5a.mjs +177 -0
  2. package/ChallengeDetailComponent-QSflL_pe.mjs +89 -0
  3. package/CommonContentComponent-D8PuLEle.mjs +78 -0
  4. package/DailyMotion-Pq0OS_nv.mjs +136 -0
  5. package/EngagementHomeComponent-CO2rSsxl.mjs +91 -0
  6. package/EventDetailComponent-DMKfvnfx.mjs +84 -0
  7. package/EventList-BM7sWeX5.mjs +22503 -0
  8. package/EventListComponent-SpgarpPb.mjs +82 -0
  9. package/Facebook-DVoDyq2n.mjs +121 -0
  10. package/FilePlayer-TBmUK03G.mjs +202 -0
  11. package/Kaltura-CLaSL9Gw.mjs +121 -0
  12. package/Mixcloud-BIUEG_vf.mjs +113 -0
  13. package/Mux-D2H0Zcnl.mjs +165 -0
  14. package/Preview-CqNeXEJq.mjs +127 -0
  15. package/RecentCarousel-DsRr-cur.mjs +243 -0
  16. package/Share-BTinEfR4.mjs +2243 -0
  17. package/SoundCloud-CL3-ElQD.mjs +123 -0
  18. package/Streamable-B6PCkCf3.mjs +115 -0
  19. package/Twitch-T-goXjKL.mjs +117 -0
  20. package/Vidyard-D8-XmjAR.mjs +113 -0
  21. package/Vimeo-jej0FY4O.mjs +146 -0
  22. package/Wistia-CPzm8ZXT.mjs +124 -0
  23. package/YouTube-VNohNZKu.mjs +176 -0
  24. package/index-BTIxC-e5.mjs +20 -0
  25. package/index-Dluh6sv-.mjs +7333 -0
  26. package/index.d.ts +2 -0
  27. package/index.mjs +10 -0
  28. package/lib/Components/EventDetails/EventDetailComponent.d.ts +1 -0
  29. package/lib/Components/EventDetails/index.d.ts +2 -0
  30. package/lib/Components/EventList/EventListComponent.d.ts +2 -0
  31. package/lib/Components/EventList/index.d.ts +2 -0
  32. package/lib/Components/FallBackPage/FallBackPage.d.ts +2 -0
  33. package/lib/Components/Loader/Loader.d.ts +2 -0
  34. package/lib/contentType-wrapper.d.ts +12 -0
  35. package/lib/contentTypes/Components/ChallengeDetailComponent.d.ts +2 -0
  36. package/lib/contentTypes/Components/CommonContentComponent.d.ts +4 -0
  37. package/lib/contentTypes/Components/EventDetailComponent.d.ts +2 -0
  38. package/lib/contentTypes/index.d.ts +2 -0
  39. package/lib/prelems/Components/EngagementHomeComponent.d.ts +2 -0
  40. package/lib/prelems/Components/EventListComponent.d.ts +10 -0
  41. package/lib/prelems/index.d.ts +2 -0
  42. package/lib/prelems-wrapper.d.ts +9 -0
  43. package/lib/services/ApiConfig.d.ts +1 -0
  44. package/lib/services/fetchApi.d.ts +11 -0
  45. package/lib/services/fetchQueries.d.ts +7 -0
  46. package/lib/services/mutateApi.d.ts +7 -0
  47. package/lib/services/mutateQueries.d.ts +4 -0
  48. package/lib/utils/Mapping.d.ts +7 -0
  49. package/lib/utils/componentMapping.d.ts +11 -0
  50. package/lib/utils/constants.d.ts +10 -0
  51. package/lib/utils/types.d.ts +32 -0
  52. package/mutateApi-DOEWbC_3.mjs +37 -0
  53. package/package.json +25 -0
  54. package/style.css +1 -0
@@ -0,0 +1,177 @@
1
+ import { jsxs as b, jsx as P } from "react/jsx-runtime";
2
+ import { Box as y } from "@mui/material";
3
+ import { useMemo as D, useEffect as T } from "react";
4
+ import { e as A, g as E, h as B } from "./EventList-BM7sWeX5.mjs";
5
+ import { makeStyles as w } from "@mui/styles";
6
+ import "./index-Dluh6sv-.mjs";
7
+ import "react-dom";
8
+ import "@mui/system";
9
+ window.bc = window.bc || {};
10
+ class _ {
11
+ constructor() {
12
+ this.playerObj = {}, this.vidId = "", this.videoData = { VideoID: "", AccountID: "", PlayerID: "" }, this.subscribeEvents = void 0, this.options = {};
13
+ }
14
+ brightCoveWebPlayer(o, d, e, a) {
15
+ this.playerObj = {}, this.vidId = o, this.videoData = d, this.addPlayer(), this.options = { ...this.getDefaultOptions(), ...e }, this.subscribeEvents = a;
16
+ }
17
+ getDefaultOptions() {
18
+ return {
19
+ html5: {
20
+ hls: {
21
+ smoothQualityChange: !0
22
+ }
23
+ },
24
+ autoplay: !1,
25
+ bigPlayButton: !1,
26
+ debug: !1
27
+ };
28
+ }
29
+ addPlayer() {
30
+ var u, p, I, g, f;
31
+ let o;
32
+ this.videoData.PlaylistID === "playlist" ? o = '<div class="vjs-playlist-player-container" style="width: 100%; height: inherit;"><video-js id="myPlayerID-' + this.vidId + '" data-playlist-id="' + this.videoData.VideoID + '" data-account="' + this.videoData.AccountID + '" data-player="' + this.videoData.PlayerID + '" data-embed="default" class="video-js" controls style="width:100%;height:100%;"></video-js></div>' : o = '<video-js id="myPlayerID-' + this.vidId + '" data-video-id="' + this.videoData.VideoID + '" data-account="' + this.videoData.AccountID + '" data-player="' + this.videoData.PlayerID + '" data-embed="default" class="video-js" controls style="width:100%;height:100%;"></video-js>';
33
+ const d = document.querySelectorAll("iframe:not(#productsummary)");
34
+ let e = "", a = window, h = document;
35
+ if (d && d.length > 0) {
36
+ let t = !1;
37
+ if (d == null || d.forEach((l) => {
38
+ const i = l == null ? void 0 : l.contentWindow, m = i == null ? void 0 : i.document, s = m == null ? void 0 : m.getElementById(this.vidId);
39
+ s && (t = !0, e = s, a = i, h = m);
40
+ }), !t) {
41
+ const l = document.getElementById(this.vidId);
42
+ t = !1, e = l;
43
+ }
44
+ } else {
45
+ const t = document.getElementById(this.vidId);
46
+ t && (e = t);
47
+ }
48
+ if (e) {
49
+ e.innerHTML = o;
50
+ const t = "brightcove-player", l = (u = h == null ? void 0 : h.getElementById(t)) == null ? void 0 : u.getAttribute("src");
51
+ if (!h.getElementById(t) || (l == null ? void 0 : l.split("/")[3]) !== ((p = this.videoData) == null ? void 0 : p.AccountID)) {
52
+ h.getElementById(t) && (l == null ? void 0 : l.split("/")[3]) !== ((I = this.videoData) == null ? void 0 : I.AccountID) && ((g = h.getElementById(t)) == null || g.remove());
53
+ const i = document.createElement("script");
54
+ i.id = t, i.src = "https://players.brightcove.net/" + this.videoData.AccountID + "/" + this.videoData.PlayerID + "_default/index.min.js", (f = h == null ? void 0 : h.body) == null || f.appendChild(i), i.onload = () => this.callback(a);
55
+ } else
56
+ this.callback(a);
57
+ }
58
+ }
59
+ callback(o) {
60
+ var d, e;
61
+ this.playerObj = o == null ? void 0 : o.bc(`myPlayerID-${this.vidId}`, this.options), (d = this.subscribeEvents) == null || d.call(this, this.playerObj), this.options.autoplay && (this.options.mute && ((e = this.playerObj) == null || e.muted(!0)), this.playerObj.play());
62
+ }
63
+ closeVideo() {
64
+ var o, d;
65
+ this.playerObj && ((d = (o = this.playerObj) == null ? void 0 : o.dispose) == null || d.call(o));
66
+ }
67
+ }
68
+ const j = w(() => ({
69
+ brightcovePlayerWrapper: {
70
+ "&.brightcovePlayercontainer": {
71
+ "& .video-js .vjs-control": {
72
+ [A().breakpoints.down("sm")]: {
73
+ width: "2.8em"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ })), L = ({
79
+ VideoData: r,
80
+ setVideoContent: o,
81
+ options: d,
82
+ analytics: e,
83
+ prelemTitle: a,
84
+ analyticsEnable: h
85
+ }) => {
86
+ const u = D(() => new _(), []), p = j(), g = "elm-" + B().toString(36), [, f] = E(), t = {
87
+ "VOD Title": "VOD Title",
88
+ "Video Length": 0
89
+ }, l = `
90
+ .bc-player-default_default .vjs-play-progress, .bc-player-default_default .vjs-volume-level{
91
+ background-color:#1e0d16;
92
+ }
93
+
94
+ .vjs-mouse.bc-player-default_default .vjs-progress-control:hover{
95
+ height: 0.5em;
96
+ top: -0.5em;
97
+ }
98
+ `, i = (s) => {
99
+ const n = {
100
+ "Page Title": e == null ? void 0 : e.pageTitle,
101
+ "Prelem Title": e != null && e.prelemTitle ? e == null ? void 0 : e.prelemTitle : a,
102
+ "Slot number": e == null ? void 0 : e.prelemPosition,
103
+ "Event Name": s,
104
+ "Content Type": "VOD",
105
+ "VOD Title": t["VOD Title"],
106
+ "VOD URL": "VOD URL",
107
+ "Video Length": t["Video Length"]
108
+ };
109
+ f("VOD Impression", n);
110
+ }, m = (s) => {
111
+ let n;
112
+ s.on("playing", function() {
113
+ var v;
114
+ t["Video Length"] === 0 && (t["VOD Title"] = (v = s == null ? void 0 : s.mediainfo) == null ? void 0 : v.name, t["Video Length"] = parseInt(s.duration())), i("video_start");
115
+ }), s.on("pause", function() {
116
+ i("video_pause");
117
+ }), s.on("ended", function() {
118
+ i("video_complete");
119
+ }), s.on("timeupdate", function() {
120
+ const v = parseInt(s.duration()), c = parseInt(s.currentTime());
121
+ c === Math.floor(v * 0.25) && c !== n && (n = c, i("video_25%")), c === Math.floor(v * 0.5) && c !== n && (n = c, i("video_50%")), c === Math.floor(v * 0.75) && c !== n && (n = c, i("video_75%"));
122
+ });
123
+ };
124
+ return T(() => {
125
+ const s = setTimeout(() => {
126
+ u.brightCoveWebPlayer(g, r, d, (n) => {
127
+ n.on("loadstart", () => {
128
+ o && o(n == null ? void 0 : n.mediainfo);
129
+ }), !(e != null && e.isAuthoring) && h && m(n);
130
+ });
131
+ }, 100);
132
+ return () => {
133
+ clearTimeout(s), u.closeVideo(), !(e != null && e.isAuthoring) && h && i("video_stop");
134
+ };
135
+ }, [
136
+ u,
137
+ r == null ? void 0 : r.VideoID,
138
+ r == null ? void 0 : r.PlayerID,
139
+ r == null ? void 0 : r.AccountID,
140
+ r == null ? void 0 : r.PlaylistID
141
+ ]), /* @__PURE__ */ b(y, { style: { height: "100%", width: "100%" }, children: [
142
+ /* @__PURE__ */ P("style", { children: l }),
143
+ /* @__PURE__ */ P(
144
+ "div",
145
+ {
146
+ id: g,
147
+ style: { height: "100%", width: "100%" },
148
+ className: `${p.brightcovePlayerWrapper} brightcovePlayercontainer`
149
+ }
150
+ )
151
+ ] });
152
+ };
153
+ L.defaultProps = {
154
+ analyticsEnable: !0,
155
+ VideoData: {
156
+ AccountID: "6415745389001",
157
+ PlayerID: "default",
158
+ VideoID: "6340658248112",
159
+ PlaylistID: "PlaylistID"
160
+ },
161
+ analytics: {
162
+ isAnalyticsEnabled: !0,
163
+ isSeoEnabled: !1,
164
+ isAuthoring: !1,
165
+ position: 0,
166
+ pageId: 1234,
167
+ prelemId: 2345,
168
+ pageTitle: "Prelem Title",
169
+ pageDesc: "Prelem Description",
170
+ pageTags: "Page Tags1, page tagg2",
171
+ prelemTags: "Prelem Tags1, Prelem tagg2"
172
+ },
173
+ prelemTitle: ""
174
+ };
175
+ export {
176
+ L as default
177
+ };
@@ -0,0 +1,89 @@
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import { C as x } from "./EventList-BM7sWeX5.mjs";
3
+ import { useState as g, useEffect as G } from "react";
4
+ import { s as h, f as H, a as J } from "./index-Dluh6sv-.mjs";
5
+ import { m as B } from "./mutateApi-DOEWbC_3.mjs";
6
+ import "@mui/material";
7
+ import "@mui/styles";
8
+ import "@mui/system";
9
+ import "react-dom";
10
+ const Q = (I) => {
11
+ const {
12
+ pageData: o = {},
13
+ secondaryArgs: f,
14
+ prelemAnalyticsProp: _,
15
+ prelemAuthoringHelper: E,
16
+ userId: d
17
+ } = I || {}, {
18
+ prelemBaseEndpoint: { language: y, site_host: C }
19
+ } = f, [P, a] = g(!1), [D, p] = g(!1), [j, v] = g(0), [S, w] = g(0), u = localStorage.getItem("userId") || d, T = async (c) => {
20
+ var n, t, s, l, e, m;
21
+ if (!u) {
22
+ h("User ID is not available. Please log in.");
23
+ return;
24
+ }
25
+ try {
26
+ a(!0);
27
+ const i = {
28
+ input: {
29
+ ...c,
30
+ userId: u
31
+ }
32
+ }, r = await B.joinChallenge(i, y, C);
33
+ ((n = r == null ? void 0 : r.errors) == null ? void 0 : n.length) > 0 ? h((t = r == null ? void 0 : r.errors[0]) == null ? void 0 : t.message) : (l = (s = r == null ? void 0 : r.data) == null ? void 0 : s.community_joinChallenge) != null && l.id ? (J((m = (e = r == null ? void 0 : r.data) == null ? void 0 : e.community_joinChallenge) == null ? void 0 : m.message), p(!0), A()) : console.error("Join Challenge API failed");
34
+ } catch (i) {
35
+ console.error("Error in Join Challenge API:", i);
36
+ } finally {
37
+ a(!1);
38
+ }
39
+ }, A = async () => {
40
+ var c, n, t, s;
41
+ if (!u) {
42
+ h("User ID is not available. Please log in.");
43
+ return;
44
+ }
45
+ try {
46
+ a(!0);
47
+ const l = {
48
+ challenge_id: o == null ? void 0 : o.page,
49
+ user_id: d
50
+ }, e = await H.getChallengeDetails(l, y, C);
51
+ if (((c = e == null ? void 0 : e.errors) == null ? void 0 : c.length) > 0)
52
+ h((n = e == null ? void 0 : e.errors[0]) == null ? void 0 : n.message);
53
+ else if ((t = e == null ? void 0 : e.data) != null && t.community_challengesDetail) {
54
+ const {
55
+ total_participant: m,
56
+ is_joined: i,
57
+ user_steps: r = 0
58
+ } = (s = e == null ? void 0 : e.data) == null ? void 0 : s.community_challengesDetail;
59
+ p(i), v(m), w(r);
60
+ } else
61
+ console.error("GetEventDetails API failed");
62
+ } catch (l) {
63
+ console.error("Error in GetEventDetails API:", l);
64
+ } finally {
65
+ a(!1);
66
+ }
67
+ }, U = {
68
+ joinChallenge: T,
69
+ loading: P,
70
+ isEnrolled: D,
71
+ enrolledParticipants: j,
72
+ userAchieved: S
73
+ };
74
+ return G(() => {
75
+ o != null && o.page && A();
76
+ }, [o]), /* @__PURE__ */ b(
77
+ x,
78
+ {
79
+ content: o,
80
+ analytics: _,
81
+ authoringHelper: E,
82
+ secondaryArgs: f,
83
+ challengeDetails: U
84
+ }
85
+ );
86
+ };
87
+ export {
88
+ Q as default
89
+ };
@@ -0,0 +1,78 @@
1
+ import { jsx as k } from "react/jsx-runtime";
2
+ import L, { memo as O, useState as g, useEffect as j } from "react";
3
+ import { F as x, f as z, s as w } from "./index-Dluh6sv-.mjs";
4
+ import { m as J } from "./mutateApi-DOEWbC_3.mjs";
5
+ import "react-dom";
6
+ import "@mui/material";
7
+ import "@mui/system";
8
+ const A = {
9
+ Article: "Article",
10
+ Quiz: "Quiz",
11
+ Poll: "Poll",
12
+ Event: "Event",
13
+ Vod: "Vod"
14
+ }, c = {};
15
+ Object.keys(A).forEach((l) => (c[l] = L.lazy(
16
+ () => import("./index-BTIxC-e5.mjs").then((o) => ({
17
+ default: o[A[l]]
18
+ }))
19
+ ), c));
20
+ const N = (l) => {
21
+ var y, a, h, _, C, S;
22
+ const { pageData: o = {}, secondaryArgs: m = {} } = l || {}, E = c[(o == null ? void 0 : o.content_type) || (o == null ? void 0 : o.tag_name)] || x, P = {
23
+ pageId: o == null ? void 0 : o.page,
24
+ pageTitle: o == null ? void 0 : o.title,
25
+ pageDesc: o == null ? void 0 : o.description,
26
+ pageTags: (a = (y = o == null ? void 0 : o.settings) == null ? void 0 : y.keywords) == null ? void 0 : a.join(", "),
27
+ isAuthoring: !1,
28
+ isSeoEnabled: (h = o == null ? void 0 : o.settings) == null ? void 0 : h.seo_blockIndexing,
29
+ isAnalyticsEnabled: o == null ? void 0 : o.analytics_enable
30
+ }, T = {
31
+ isModalShow: !0
32
+ }, [u, n] = g(!1), [b, v] = g([]), {
33
+ prelemBaseEndpoint: { site_host: d, language: f }
34
+ } = m, p = async () => {
35
+ var t, s;
36
+ try {
37
+ u || n(!0);
38
+ const e = await z.fetchPoll({ title: o.document_path }, f, d);
39
+ v((s = (t = e.data) == null ? void 0 : t.users_fetchContent) == null ? void 0 : s.options), n(!1);
40
+ } catch (e) {
41
+ n(!1), w(`${e}`);
42
+ }
43
+ }, I = async (t) => {
44
+ var s;
45
+ try {
46
+ n(!0);
47
+ const e = {
48
+ input: {
49
+ pollInfo: { ...t, start_date: "" }
50
+ }
51
+ }, i = await J.savePoll(e, f, d);
52
+ if (n(!1), (s = i == null ? void 0 : i.data) != null && s.users_saveContent) {
53
+ const r = JSON.parse(localStorage.getItem("TakenPoles") || "[]");
54
+ r != null && r.includes(o.page) || localStorage.setItem("TakenPoles", JSON.stringify([...r, o.page])), p();
55
+ }
56
+ } catch (e) {
57
+ n(!1), w(`${e}`);
58
+ }
59
+ };
60
+ return j(() => {
61
+ const t = JSON.parse(localStorage.getItem("TakenPoles") || "[]");
62
+ t != null && t.includes(o == null ? void 0 : o.page) && p();
63
+ }, []), /* @__PURE__ */ k(
64
+ E,
65
+ {
66
+ content: o,
67
+ analytics: P,
68
+ authoringHelper: T,
69
+ secondaryArgs: m,
70
+ results: ((_ = o == null ? void 0 : o.content_type) == null ? void 0 : _.toLowerCase()) === "poll" ? b : void 0,
71
+ onSubmit: ((C = o == null ? void 0 : o.content_type) == null ? void 0 : C.toLowerCase()) === "poll" ? (t) => I(t) : void 0,
72
+ showLoading: ((S = o == null ? void 0 : o.content_type) == null ? void 0 : S.toLowerCase()) === "poll" ? u : void 0
73
+ }
74
+ );
75
+ }, R = O(N);
76
+ export {
77
+ R as default
78
+ };
@@ -0,0 +1,136 @@
1
+ import { g as P } from "./index-Dluh6sv-.mjs";
2
+ import v from "react";
3
+ import { u as D, p as O } from "./EventList-BM7sWeX5.mjs";
4
+ function b(t, e) {
5
+ for (var r = 0; r < e.length; r++) {
6
+ const o = e[r];
7
+ if (typeof o != "string" && !Array.isArray(o)) {
8
+ for (const a in o)
9
+ if (a !== "default" && !(a in t)) {
10
+ const i = Object.getOwnPropertyDescriptor(o, a);
11
+ i && Object.defineProperty(t, a, i.get ? i : {
12
+ enumerable: !0,
13
+ get: () => o[a]
14
+ });
15
+ }
16
+ }
17
+ }
18
+ return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
19
+ }
20
+ var M = Object.create, s = Object.defineProperty, w = Object.getOwnPropertyDescriptor, S = Object.getOwnPropertyNames, j = Object.getPrototypeOf, T = Object.prototype.hasOwnProperty, A = (t, e, r) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, E = (t, e) => {
21
+ for (var r in e)
22
+ s(t, r, { get: e[r], enumerable: !0 });
23
+ }, h = (t, e, r, o) => {
24
+ if (e && typeof e == "object" || typeof e == "function")
25
+ for (let a of S(e))
26
+ !T.call(t, a) && a !== r && s(t, a, { get: () => e[a], enumerable: !(o = w(e, a)) || o.enumerable });
27
+ return t;
28
+ }, L = (t, e, r) => (r = t != null ? M(j(t)) : {}, h(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ !t || !t.__esModule ? s(r, "default", { value: t, enumerable: !0 }) : r,
34
+ t
35
+ )), C = (t) => h(s({}, "__esModule", { value: !0 }), t), n = (t, e, r) => (A(t, typeof e != "symbol" ? e + "" : e, r), r), d = {};
36
+ E(d, {
37
+ default: () => p
38
+ });
39
+ var _ = C(d), c = L(v), l = D, f = O;
40
+ const N = "https://api.dmcdn.net/all.js", x = "DM", R = "dmAsyncInit";
41
+ class p extends c.Component {
42
+ constructor() {
43
+ super(...arguments), n(this, "callPlayer", l.callPlayer), n(this, "onDurationChange", () => {
44
+ const e = this.getDuration();
45
+ this.props.onDuration(e);
46
+ }), n(this, "mute", () => {
47
+ this.callPlayer("setMuted", !0);
48
+ }), n(this, "unmute", () => {
49
+ this.callPlayer("setMuted", !1);
50
+ }), n(this, "ref", (e) => {
51
+ this.container = e;
52
+ });
53
+ }
54
+ componentDidMount() {
55
+ this.props.onMount && this.props.onMount(this);
56
+ }
57
+ load(e) {
58
+ const { controls: r, config: o, onError: a, playing: i } = this.props, [, y] = e.match(f.MATCH_URL_DAILYMOTION);
59
+ if (this.player) {
60
+ this.player.load(y, {
61
+ start: (0, l.parseStartTime)(e),
62
+ autoplay: i
63
+ });
64
+ return;
65
+ }
66
+ (0, l.getSDK)(N, x, R, (u) => u.player).then((u) => {
67
+ if (!this.container)
68
+ return;
69
+ const m = u.player;
70
+ this.player = new m(this.container, {
71
+ width: "100%",
72
+ height: "100%",
73
+ video: y,
74
+ params: {
75
+ controls: r,
76
+ autoplay: this.props.playing,
77
+ mute: this.props.muted,
78
+ start: (0, l.parseStartTime)(e),
79
+ origin: window.location.origin,
80
+ ...o.params
81
+ },
82
+ events: {
83
+ apiready: this.props.onReady,
84
+ seeked: () => this.props.onSeek(this.player.currentTime),
85
+ video_end: this.props.onEnded,
86
+ durationchange: this.onDurationChange,
87
+ pause: this.props.onPause,
88
+ playing: this.props.onPlay,
89
+ waiting: this.props.onBuffer,
90
+ error: (g) => a(g)
91
+ }
92
+ });
93
+ }, a);
94
+ }
95
+ play() {
96
+ this.callPlayer("play");
97
+ }
98
+ pause() {
99
+ this.callPlayer("pause");
100
+ }
101
+ stop() {
102
+ }
103
+ seekTo(e, r = !0) {
104
+ this.callPlayer("seek", e), r || this.pause();
105
+ }
106
+ setVolume(e) {
107
+ this.callPlayer("setVolume", e);
108
+ }
109
+ getDuration() {
110
+ return this.player.duration || null;
111
+ }
112
+ getCurrentTime() {
113
+ return this.player.currentTime;
114
+ }
115
+ getSecondsLoaded() {
116
+ return this.player.bufferedTime;
117
+ }
118
+ render() {
119
+ const { display: e } = this.props, r = {
120
+ width: "100%",
121
+ height: "100%",
122
+ display: e
123
+ };
124
+ return /* @__PURE__ */ c.default.createElement("div", { style: r }, /* @__PURE__ */ c.default.createElement("div", { ref: this.ref }));
125
+ }
126
+ }
127
+ n(p, "displayName", "DailyMotion");
128
+ n(p, "canPlay", f.canPlay.dailymotion);
129
+ n(p, "loopOnEnded", !0);
130
+ const K = /* @__PURE__ */ P(_), F = /* @__PURE__ */ b({
131
+ __proto__: null,
132
+ default: K
133
+ }, [_]);
134
+ export {
135
+ F as D
136
+ };
@@ -0,0 +1,91 @@
1
+ import { jsx as M } from "react/jsx-runtime";
2
+ import { f as U, c as j } from "./EventList-BM7sWeX5.mjs";
3
+ import { useState as g, useEffect as B } from "react";
4
+ import { f as A, s as o, a as W } from "./index-Dluh6sv-.mjs";
5
+ import { m as q } from "./mutateApi-DOEWbC_3.mjs";
6
+ import "@mui/material";
7
+ import "@mui/styles";
8
+ import "@mui/system";
9
+ import "react-dom";
10
+ const z = async (p, f, w, y = "", a = "wellnessevent") => {
11
+ var r, c, i, d;
12
+ const t = await A.getContentSchemaList(
13
+ {
14
+ searchTerm: y,
15
+ filter: (a == null ? void 0 : a.toLocaleLowerCase()) === "events" ? "wellnessevent" : a == null ? void 0 : a.toLocaleLowerCase()
16
+ },
17
+ p || "en",
18
+ f
19
+ );
20
+ (c = (r = t == null ? void 0 : t.data) == null ? void 0 : r.publish_getContents) != null && c.records ? w((d = (i = t == null ? void 0 : t.data) == null ? void 0 : i.publish_getContents) == null ? void 0 : d.records) : o("Something went wrong !");
21
+ }, $ = (p) => {
22
+ const { secondaryArgs: f, prelemAnalyticsProp: w, prelemAuthoringHelper: y, userId: a } = p || {}, {
23
+ prelemBaseEndpoint: { language: t, site_host: r }
24
+ } = f, [c, i] = g(!1), [d, D] = g({}), [C, S] = g({}), [_, E] = g(0), h = localStorage.getItem("userId") || a, [G, T] = g([]), I = async (P, n, u) => {
25
+ var l, m;
26
+ if (!h) {
27
+ o("User ID is not available. Please log in.");
28
+ return;
29
+ }
30
+ try {
31
+ const s = {
32
+ input: { activity_type: u, target: P.toString(), action: n },
33
+ user_id: h
34
+ }, e = await q.setPersonalGoal(s, t, r);
35
+ ((m = (l = e == null ? void 0 : e.data) == null ? void 0 : l.community_setPersonalGoal) == null ? void 0 : m.message) === "Created Successfully!!!" && n === "goal" ? W("Goal updated successfully!") : n !== "entry" && o("Something went wrong, please try after sometime !");
36
+ } catch (s) {
37
+ console.error("Error in update goal API:", s), o("Something went wrong, please try after sometime !");
38
+ }
39
+ }, k = async (P = "") => {
40
+ var n, u, l, m;
41
+ if (!h) {
42
+ o("User ID is not available. Please log in.");
43
+ return;
44
+ }
45
+ try {
46
+ i(!0);
47
+ const s = {
48
+ date: P,
49
+ user_id: h
50
+ }, e = await A.fetchPersonalTracker(s, t, r);
51
+ if (((n = e == null ? void 0 : e.errors) == null ? void 0 : n.length) > 0)
52
+ o((u = e == null ? void 0 : e.errors[0]) == null ? void 0 : u.message);
53
+ else if ((l = e == null ? void 0 : e.data) != null && l.community_fetchPersonalTracker) {
54
+ const { water_intake: b, steps: H, streak_count: x } = (m = e == null ? void 0 : e.data) == null ? void 0 : m.community_fetchPersonalTracker;
55
+ D(b), S(H), E(x);
56
+ } else
57
+ console.error("GetPersonalData API failed"), o("GetPersonalData API failed");
58
+ } catch (s) {
59
+ console.error("Error in GetPersonalData API:", s), o("Error in GetPersonalData API"), D({}), S({});
60
+ } finally {
61
+ i(!1);
62
+ }
63
+ }, L = {
64
+ waterIntakeData: d,
65
+ loading: c,
66
+ fetchPersonalData: k,
67
+ updateGoals: I
68
+ }, v = {
69
+ stepsData: C,
70
+ loading: c,
71
+ updateGoals: I
72
+ };
73
+ return B(() => {
74
+ k(U(/* @__PURE__ */ new Date(), "yyyy-MM-dd")), z(t, r, T, "", "challenges");
75
+ }, []), /* @__PURE__ */ M(
76
+ j,
77
+ {
78
+ analytics: w,
79
+ authoringHelper: y,
80
+ secondaryArgs: f,
81
+ waterIntakeDetails: L,
82
+ stepsDetails: v,
83
+ streaksCount: _,
84
+ data: G
85
+ }
86
+ );
87
+ };
88
+ export {
89
+ $ as EngagementHomeComponent,
90
+ $ as default
91
+ };
@@ -0,0 +1,84 @@
1
+ import { jsx as G } from "react/jsx-runtime";
2
+ import { E as H } from "./EventList-BM7sWeX5.mjs";
3
+ import { useState as g, useEffect as J } from "react";
4
+ import { s as f, f as U, a as d } from "./index-Dluh6sv-.mjs";
5
+ import { m as B } from "./mutateApi-DOEWbC_3.mjs";
6
+ import "@mui/material";
7
+ import "@mui/styles";
8
+ import "@mui/system";
9
+ import "react-dom";
10
+ const O = (h) => {
11
+ const {
12
+ pageData: r = {},
13
+ secondaryArgs: v,
14
+ prelemAnalyticsProp: A,
15
+ prelemAuthoringHelper: P,
16
+ userId: _
17
+ } = h || {}, {
18
+ prelemBaseEndpoint: { language: E, site_host: y }
19
+ } = v, [D, c] = g(!1), [p, I] = g(!1), [S, j] = g(0), m = localStorage.getItem("userId") || _, w = async (u) => {
20
+ var s, n, i, l, a, o;
21
+ if (!m) {
22
+ f("User ID is not available. Please log in.");
23
+ return;
24
+ }
25
+ try {
26
+ c(!0);
27
+ const e = {
28
+ input: {
29
+ ...u,
30
+ userId: m
31
+ }
32
+ }, t = await B.joinEvent(e, E, y);
33
+ ((s = t == null ? void 0 : t.errors) == null ? void 0 : s.length) > 0 ? f((n = t == null ? void 0 : t.errors[0]) == null ? void 0 : n.message) : (l = (i = t == null ? void 0 : t.data) == null ? void 0 : i.community_userRegistration) != null && l.id ? (d((o = (a = t == null ? void 0 : t.data) == null ? void 0 : a.community_userRegistration) == null ? void 0 : o.message), I(!0)) : console.error("Join Event API failed");
34
+ } catch (e) {
35
+ console.error("Error in Join Event API:", e);
36
+ } finally {
37
+ c(!1);
38
+ }
39
+ }, T = async () => {
40
+ var u, s, n, i, l, a;
41
+ if (!m) {
42
+ f("User ID is not available. Please log in.");
43
+ return;
44
+ }
45
+ try {
46
+ c(!0);
47
+ const o = {
48
+ event_id: r == null ? void 0 : r.page,
49
+ user_id: m
50
+ }, e = await U.getEventDetails(o, E, y);
51
+ if (((u = e == null ? void 0 : e.errors) == null ? void 0 : u.length) > 0)
52
+ f((s = e == null ? void 0 : e.errors[0]) == null ? void 0 : s.message);
53
+ else if ((n = e == null ? void 0 : e.data) != null && n.community_eventDetails) {
54
+ const { total_participant: t, is_joined: x } = (i = e == null ? void 0 : e.data) == null ? void 0 : i.community_eventDetails;
55
+ d((a = (l = e == null ? void 0 : e.data) == null ? void 0 : l.community_eventDetails) == null ? void 0 : a.message), I(x), j(t);
56
+ } else
57
+ console.error("GetEventDetails API failed");
58
+ } catch (o) {
59
+ console.error("Error in GetEventDetails API:", o);
60
+ } finally {
61
+ c(!1);
62
+ }
63
+ }, b = {
64
+ joinEvent: w,
65
+ loading: D,
66
+ isRegistered: p,
67
+ registeredParticipants: S
68
+ };
69
+ return J(() => {
70
+ r != null && r.page && T();
71
+ }, [r]), /* @__PURE__ */ G(
72
+ H,
73
+ {
74
+ content: r,
75
+ analytics: A,
76
+ authoringHelper: P,
77
+ secondaryArgs: v,
78
+ eventDetails: b
79
+ }
80
+ );
81
+ };
82
+ export {
83
+ O as default
84
+ };