@icvdeveloper/common-module 0.0.1

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 (141) hide show
  1. package/README.md +6 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.ts +9 -0
  4. package/dist/module.json +8 -0
  5. package/dist/module.mjs +102051 -0
  6. package/dist/runtime/@types/configVariables.d.ts +78 -0
  7. package/dist/runtime/@types/configVariables.mjs +0 -0
  8. package/dist/runtime/analytics.d.ts +8 -0
  9. package/dist/runtime/analytics.mjs +38 -0
  10. package/dist/runtime/assets/scss/_agenda.scss +47 -0
  11. package/dist/runtime/assets/scss/_animations.scss +11 -0
  12. package/dist/runtime/assets/scss/_container_variants.scss +26 -0
  13. package/dist/runtime/assets/scss/_custom.scss +364 -0
  14. package/dist/runtime/assets/scss/_footer.scss +20 -0
  15. package/dist/runtime/assets/scss/_forms.scss +29 -0
  16. package/dist/runtime/assets/scss/_functions.scss +24 -0
  17. package/dist/runtime/assets/scss/_header.scss +41 -0
  18. package/dist/runtime/assets/scss/_index_production.scss +45 -0
  19. package/dist/runtime/assets/scss/_transitions.scss +24 -0
  20. package/dist/runtime/assets/scss/_variables.scss +62 -0
  21. package/dist/runtime/assets/scss/_variables2.scss +0 -0
  22. package/dist/runtime/assets/scss/_webcast.scss +141 -0
  23. package/dist/runtime/assets/scss/index.scss +42 -0
  24. package/dist/runtime/assets/svg/answer.svg +14 -0
  25. package/dist/runtime/assets/svg/avatar.svg +1 -0
  26. package/dist/runtime/assets/svg/bell-icon.svg +3 -0
  27. package/dist/runtime/assets/svg/chat-icon.svg +1 -0
  28. package/dist/runtime/assets/svg/checkmark-icon.svg +1 -0
  29. package/dist/runtime/assets/svg/close-icon.svg +1 -0
  30. package/dist/runtime/assets/svg/icon-avatar.svg +1 -0
  31. package/dist/runtime/assets/svg/icon-close.svg +1 -0
  32. package/dist/runtime/assets/svg/icon-down-arrow.svg +1 -0
  33. package/dist/runtime/assets/svg/icon-facebook.svg +1 -0
  34. package/dist/runtime/assets/svg/icon-info.svg +3 -0
  35. package/dist/runtime/assets/svg/icon-linkedin.svg +1 -0
  36. package/dist/runtime/assets/svg/icon-new-window.svg +11 -0
  37. package/dist/runtime/assets/svg/icon-offline.svg +3 -0
  38. package/dist/runtime/assets/svg/icon-online.svg +3 -0
  39. package/dist/runtime/assets/svg/icon-person.svg +3 -0
  40. package/dist/runtime/assets/svg/icon-play.svg +3 -0
  41. package/dist/runtime/assets/svg/icon-star-filled.svg +30 -0
  42. package/dist/runtime/assets/svg/icon-star.svg +25 -0
  43. package/dist/runtime/assets/svg/icon-twitter.svg +1 -0
  44. package/dist/runtime/assets/svg/icon-video-chat.svg +14 -0
  45. package/dist/runtime/assets/svg/icon-website.svg +3 -0
  46. package/dist/runtime/assets/svg/icon-youtube.svg +1 -0
  47. package/dist/runtime/assets/svg/icon-zoom.svg +10 -0
  48. package/dist/runtime/assets/svg/notification-icon.svg +32 -0
  49. package/dist/runtime/assets/svg/offline-icon.svg +1 -0
  50. package/dist/runtime/assets/svg/online-icon.svg +3 -0
  51. package/dist/runtime/assets/svg/peer2peer.svg +3 -0
  52. package/dist/runtime/assets/svg/phone.svg +1 -0
  53. package/dist/runtime/assets/svg/plus-icon.svg +1 -0
  54. package/dist/runtime/assets/svg/red-icon.svg +3 -0
  55. package/dist/runtime/assets/svg/reject.svg +14 -0
  56. package/dist/runtime/assets/svg/search-icon.svg +3 -0
  57. package/dist/runtime/components/affiliates/AffiliatePage.vue +16 -0
  58. package/dist/runtime/components/agenda/AgendaTabbed.vue +342 -0
  59. package/dist/runtime/components/agenda/components/InfoLink.vue +55 -0
  60. package/dist/runtime/components/agenda/components/PlayIcon.vue +48 -0
  61. package/dist/runtime/components/agenda/components/PresentationLink.vue +147 -0
  62. package/dist/runtime/components/agenda/components/Sponsor.vue +108 -0
  63. package/dist/runtime/components/auth/LoginFullWidth.vue +76 -0
  64. package/dist/runtime/components/core/CountdownTimer.vue +275 -0
  65. package/dist/runtime/components/core/DynamicHtml.vue +16 -0
  66. package/dist/runtime/components/core/DynamicHtml.vue.d.ts +2 -0
  67. package/dist/runtime/components/core/Modal.vue +84 -0
  68. package/dist/runtime/components/core/SvgIcon.vue +119 -0
  69. package/dist/runtime/components/core/ZoomModal.vue +37 -0
  70. package/dist/runtime/components/events/EventHeader.vue +131 -0
  71. package/dist/runtime/components/events/PastEvents.vue +150 -0
  72. package/dist/runtime/components/events/UpcomingEvents.vue +145 -0
  73. package/dist/runtime/components/forms/ErrorField.vue +19 -0
  74. package/dist/runtime/components/forms/Message.vue +25 -0
  75. package/dist/runtime/components/forms/SearchInput.vue +30 -0
  76. package/dist/runtime/components/forms/SupportForm.vue +109 -0
  77. package/dist/runtime/components/forms/TextArea.vue +26 -0
  78. package/dist/runtime/components/forms/TextInput.vue +22 -0
  79. package/dist/runtime/components/layouts/Accordion.vue +76 -0
  80. package/dist/runtime/components/presenters/PresenterListing.vue +89 -0
  81. package/dist/runtime/components/presenters/PresenterModal.vue +83 -0
  82. package/dist/runtime/composables/useAgenda.d.ts +81 -0
  83. package/dist/runtime/composables/useAgenda.mjs +178 -0
  84. package/dist/runtime/composables/useAnalytics.d.ts +7 -0
  85. package/dist/runtime/composables/useAnalytics.mjs +10 -0
  86. package/dist/runtime/composables/useApi.d.ts +1 -0
  87. package/dist/runtime/composables/useApi.mjs +16 -0
  88. package/dist/runtime/composables/useConferenceHelpers.d.ts +65 -0
  89. package/dist/runtime/composables/useConferenceHelpers.mjs +270 -0
  90. package/dist/runtime/composables/useDateFormat.d.ts +12 -0
  91. package/dist/runtime/composables/useDateFormat.mjs +21 -0
  92. package/dist/runtime/composables/useLogin.d.ts +30 -0
  93. package/dist/runtime/composables/useLogin.mjs +58 -0
  94. package/dist/runtime/composables/usePresentation.d.ts +53 -0
  95. package/dist/runtime/composables/usePresentation.mjs +98 -0
  96. package/dist/runtime/composables/usePresenter.d.ts +15 -0
  97. package/dist/runtime/composables/usePresenter.mjs +67 -0
  98. package/dist/runtime/composables/usePresenters.d.ts +13 -0
  99. package/dist/runtime/composables/usePresenters.mjs +21 -0
  100. package/dist/runtime/composables/useV3plusCommonModule.d.ts +2 -0
  101. package/dist/runtime/composables/useV3plusCommonModule.mjs +2 -0
  102. package/dist/runtime/models/affiliate.d.ts +1 -0
  103. package/dist/runtime/models/affiliate.mjs +0 -0
  104. package/dist/runtime/models/authUser.d.ts +16 -0
  105. package/dist/runtime/models/authUser.mjs +0 -0
  106. package/dist/runtime/models/conference.d.ts +124 -0
  107. package/dist/runtime/models/conference.mjs +18 -0
  108. package/dist/runtime/models/globalConfig.d.ts +80 -0
  109. package/dist/runtime/models/globalConfig.mjs +0 -0
  110. package/dist/runtime/models/group.d.ts +14 -0
  111. package/dist/runtime/models/group.mjs +0 -0
  112. package/dist/runtime/models/icons.d.ts +18 -0
  113. package/dist/runtime/models/icons.mjs +0 -0
  114. package/dist/runtime/models/navigationConfig.d.ts +8 -0
  115. package/dist/runtime/models/navigationConfig.mjs +0 -0
  116. package/dist/runtime/models/pagesConfig.d.ts +169 -0
  117. package/dist/runtime/models/pagesConfig.mjs +0 -0
  118. package/dist/runtime/models/portal.d.ts +8 -0
  119. package/dist/runtime/models/portal.mjs +0 -0
  120. package/dist/runtime/models/templateConfig.d.ts +44 -0
  121. package/dist/runtime/models/templateConfig.mjs +0 -0
  122. package/dist/runtime/plugin.d.ts +2 -0
  123. package/dist/runtime/plugin.mjs +55 -0
  124. package/dist/runtime/store/affiliates.d.ts +12 -0
  125. package/dist/runtime/store/affiliates.mjs +35 -0
  126. package/dist/runtime/store/auth.d.ts +14 -0
  127. package/dist/runtime/store/auth.mjs +32 -0
  128. package/dist/runtime/store/conferences.d.ts +13 -0
  129. package/dist/runtime/store/conferences.mjs +86 -0
  130. package/dist/runtime/store/navigationConfig.d.ts +7 -0
  131. package/dist/runtime/store/navigationConfig.mjs +14 -0
  132. package/dist/runtime/store/portal.d.ts +9 -0
  133. package/dist/runtime/store/portal.mjs +39 -0
  134. package/dist/runtime/store/support.d.ts +3 -0
  135. package/dist/runtime/store/support.mjs +20 -0
  136. package/dist/runtime/store/templateConfigs.d.ts +20 -0
  137. package/dist/runtime/store/templateConfigs.mjs +84 -0
  138. package/dist/runtime/v3plusCommonPlugin.d.ts +14 -0
  139. package/dist/runtime/v3plusCommonPlugin.mjs +8 -0
  140. package/dist/types.d.ts +10 -0
  141. package/package.json +57 -0
@@ -0,0 +1,270 @@
1
+ import { format } from "date-fns";
2
+ import { get, find } from "lodash";
3
+ import { storeToRefs } from "pinia";
4
+ import { ConferenceState } from "../models/conference.mjs";
5
+ import { useDateFormat } from "./useDateFormat.mjs";
6
+ const getConferenceConfigMainValue = (_conference, _name) => {
7
+ const configPages = get(_conference, "template_config.config.pages", []);
8
+ const mainPageContent = get(
9
+ find(configPages, { name: "main" }),
10
+ "content",
11
+ []
12
+ );
13
+ const configObj = find(mainPageContent, { name: _name });
14
+ return configObj ? configObj.value : null;
15
+ };
16
+ export const useConferenceHelpers = (conferences) => {
17
+ const { pagesConfigValue, globalConfigValue } = toRefs(
18
+ useTemplateConfigsStore()
19
+ );
20
+ const { formatTimezoneToLocal } = useDateFormat();
21
+ const route = useRoute();
22
+ const { isLoggedIn } = storeToRefs(useAuthStore());
23
+ const { currentConference } = storeToRefs(useConferencesStore());
24
+ const _selectedConference = ref(null);
25
+ if (!Array.isArray(conferences.value)) {
26
+ _selectedConference.value = conferences.value;
27
+ }
28
+ const _setSelectedConference = (conference) => {
29
+ if (!Array.isArray(conferences.value)) {
30
+ throw new TypeError(
31
+ "parameter conferences supplied useConferenceHelpers should be of type Array"
32
+ );
33
+ }
34
+ if (_selectedConference.value && _selectedConference.value.id !== conference.id) {
35
+ _selectedConference.value = find(conferences.value, {
36
+ id: conference.id
37
+ });
38
+ }
39
+ if (_selectedConference.value === void 0) {
40
+ throw new Error("could not find conference in arrray");
41
+ }
42
+ };
43
+ const isSingleDayEvent = (conference) => {
44
+ if (conference) {
45
+ _setSelectedConference(conference);
46
+ }
47
+ const firstDay = new Date(_selectedConference.value.start_date).getMonth() + "/" + new Date(_selectedConference.value.start_date).getDate();
48
+ const lastDay = new Date(_selectedConference.value.end_date).getMonth() + "/" + 3;
49
+ new Date(_selectedConference.value.end_date).getDate();
50
+ return firstDay === lastDay;
51
+ };
52
+ const showConferenceWebcastButton = (conference) => {
53
+ if (conference) {
54
+ _setSelectedConference(conference);
55
+ }
56
+ return _selectedConference.value.access && _selectedConference.value.state !== "archive" && _selectedConference.value.state !== "hidden";
57
+ };
58
+ const getConferenceWebcastUrl = (conference) => {
59
+ if (conference) {
60
+ _setSelectedConference(conference);
61
+ }
62
+ if (_selectedConference.value.state === "upcoming") {
63
+ return "/stream-test";
64
+ }
65
+ const channel = get(
66
+ _selectedConference.value,
67
+ "days[0].tracks[0].channel",
68
+ 1
69
+ );
70
+ return _selectedConference.value.agenda_enabled ? `/agenda/${_selectedConference.value.id}` : `/upcoming-events/${_selectedConference.value.id}/webcast/${channel}`;
71
+ };
72
+ const getConferenceWebcastButtonText = (conference) => {
73
+ if (conference) {
74
+ _setSelectedConference(conference);
75
+ }
76
+ if (_selectedConference.value.state === "upcoming") {
77
+ return "View Test Stream";
78
+ }
79
+ const viewNowAliasText = globalConfigValue.value("view_now_button_alias");
80
+ return viewNowAliasText || "View Now";
81
+ };
82
+ const getConferenceDisplayDate = (conference) => {
83
+ if (conference) {
84
+ _setSelectedConference(conference);
85
+ }
86
+ const startDate = new Date(_selectedConference.value.start_date);
87
+ const endDate = new Date(_selectedConference.value.end_date);
88
+ const tzFormat = pagesConfigValue.value("main.use_event_text_tz") ? " zzz" : "";
89
+ if (isSingleDayEvent()) {
90
+ const startFormat2 = "MMMM do, yyyy h:mm" + tzFormat;
91
+ return formatTimezoneToLocal(
92
+ startDate,
93
+ startFormat2,
94
+ _selectedConference.value.timezone
95
+ );
96
+ }
97
+ let startFormat = "MMMM d";
98
+ if (format(startDate, "yyyy") !== format(endDate, "yyyy")) {
99
+ startFormat += ", yyyy";
100
+ }
101
+ let returnDate = formatTimezoneToLocal(
102
+ startDate,
103
+ startFormat,
104
+ _selectedConference.value.timezone
105
+ );
106
+ returnDate += " - ";
107
+ let endFormat = "d, yyyy" + tzFormat;
108
+ if (format(startDate, "MMMM") !== format(endDate, "MMMM") || format(startDate, "yyyy") !== format(endDate, "yyyy")) {
109
+ endFormat = "MMMM " + endFormat;
110
+ }
111
+ returnDate += formatTimezoneToLocal(
112
+ endDate,
113
+ endFormat,
114
+ _selectedConference.value.timezone
115
+ );
116
+ return returnDate;
117
+ };
118
+ const showViewArchiveButton = (conference) => {
119
+ if (conference) {
120
+ _setSelectedConference(conference);
121
+ }
122
+ if (_selectedConference.value.state !== "archive")
123
+ return false;
124
+ if (route.name === "index") {
125
+ return isLoggedIn && _selectedConference.value.access;
126
+ } else {
127
+ return _selectedConference.value.access || _selectedConference.value.agenda_enabled || pagesConfigValue.value("archive_player.preview_enabled", false);
128
+ }
129
+ };
130
+ const getViewArchiveUrl = (conference) => {
131
+ if (conference) {
132
+ _setSelectedConference(conference);
133
+ }
134
+ if (_selectedConference.value.agenda_enabled) {
135
+ return `/agenda/${_selectedConference.value.id}`;
136
+ } else {
137
+ const presentationId = get(
138
+ _selectedConference.value,
139
+ "days[0].tracks[0].presentations[0].id",
140
+ null
141
+ );
142
+ return `/archive/${presentationId}`;
143
+ }
144
+ };
145
+ const getViewArchiveButtonText = (conference) => {
146
+ if (conference) {
147
+ _setSelectedConference(conference);
148
+ }
149
+ const viewArchiveAliasText = globalConfigValue.value(
150
+ "view_archive_button_alias",
151
+ ""
152
+ );
153
+ const viewPreviewAliasText = globalConfigValue.value(
154
+ "view_preview_button_alias",
155
+ ""
156
+ );
157
+ if (!_selectedConference.value.access && pagesConfigValue.value("archive_player.preview_enabled", false)) {
158
+ if (viewPreviewAliasText.length) {
159
+ return viewPreviewAliasText;
160
+ } else {
161
+ return "Preview";
162
+ }
163
+ } else if (viewArchiveAliasText.length) {
164
+ return viewArchiveAliasText;
165
+ } else {
166
+ return "View Archive";
167
+ }
168
+ };
169
+ const showConferenceRegButton = (conference) => {
170
+ if (conference) {
171
+ _setSelectedConference(conference);
172
+ }
173
+ if (_selectedConference.value.access || globalConfigValue.value("townhall_registration_enabled", false)) {
174
+ return false;
175
+ } else {
176
+ const confSetting = getConferenceConfigMainValue(
177
+ _selectedConference.value,
178
+ "conference_reg_button_enabled"
179
+ );
180
+ if (confSetting != null) {
181
+ return confSetting === true;
182
+ } else {
183
+ return globalConfigValue.value("reg_button_enabled") === true;
184
+ }
185
+ }
186
+ };
187
+ const getConferenceRegUrl = (conference) => {
188
+ if (conference) {
189
+ _setSelectedConference(conference);
190
+ }
191
+ if (globalConfigValue.value("townhall_registration_enabled", false)) {
192
+ if (_selectedConference.value.id === currentConference.value.id) {
193
+ return "/";
194
+ } else if (_selectedConference.value.state === "live" || _selectedConference.value.state === "mixed") {
195
+ return `/upcoming-events/${_selectedConference.value.id}`;
196
+ } else {
197
+ return `/past-events/${_selectedConference.value.id}`;
198
+ }
199
+ }
200
+ const confExternalUrl = getConferenceConfigMainValue(
201
+ _selectedConference.value,
202
+ "conference_external_reg_url"
203
+ );
204
+ if (confExternalUrl)
205
+ return confExternalUrl;
206
+ const portalExternalUrl = globalConfigValue.value("external_reg_url");
207
+ if (portalExternalUrl)
208
+ return portalExternalUrl;
209
+ return `/registration/options/${_selectedConference.value.id}`;
210
+ };
211
+ const getConferenceRegText = (conference) => {
212
+ if (conference) {
213
+ _setSelectedConference(conference);
214
+ }
215
+ const confSetting = getConferenceConfigMainValue(
216
+ _selectedConference.value,
217
+ "conference_reg_button_alias"
218
+ );
219
+ if (confSetting != null && confSetting !== "") {
220
+ return confSetting;
221
+ } else {
222
+ const portalSetting = globalConfigValue.value("reg_button_alias");
223
+ if (portalSetting != null && portalSetting !== "") {
224
+ return portalSetting;
225
+ }
226
+ }
227
+ return "Register";
228
+ };
229
+ const showConferenceViewButton = (conference) => {
230
+ if (conference) {
231
+ _setSelectedConference(conference);
232
+ }
233
+ return isLoggedIn && conference.access;
234
+ };
235
+ const conferenceIsLive = (conference) => {
236
+ if (conference) {
237
+ _setSelectedConference(conference);
238
+ }
239
+ return _selectedConference.value.state === ConferenceState.LIVE || _selectedConference.value.state === ConferenceState.MIXED;
240
+ };
241
+ const conferenceIsMixed = (conference) => {
242
+ if (conference) {
243
+ _setSelectedConference(conference);
244
+ }
245
+ return _selectedConference.value.state === ConferenceState.MIXED;
246
+ };
247
+ const conferenceIsArchived = (conference) => {
248
+ if (conference) {
249
+ _setSelectedConference(conference);
250
+ }
251
+ return _selectedConference.value.state === ConferenceState.ARCHIVED;
252
+ };
253
+ return {
254
+ isSingleDayEvent,
255
+ showConferenceWebcastButton,
256
+ getConferenceWebcastButtonText,
257
+ getConferenceWebcastUrl,
258
+ getConferenceDisplayDate,
259
+ showViewArchiveButton,
260
+ getViewArchiveUrl,
261
+ getViewArchiveButtonText,
262
+ showConferenceRegButton,
263
+ getConferenceRegUrl,
264
+ getConferenceRegText,
265
+ showConferenceViewButton,
266
+ conferenceIsLive,
267
+ conferenceIsMixed,
268
+ conferenceIsArchived
269
+ };
270
+ };
@@ -0,0 +1,12 @@
1
+ export declare type DateFunctions = {
2
+ /**
3
+ * Takes a date string and converts it to a formatted date
4
+ * e.g August 8, 2022
5
+ */
6
+ formatDate: (date: string) => string;
7
+ /**
8
+ * Takes a date string with its timezone and converts it to the users local time.
9
+ */
10
+ formatTimezoneToLocal: (date: string | Date, format: string, timezone: string) => string;
11
+ };
12
+ export declare const useDateFormat: () => DateFunctions;
@@ -0,0 +1,21 @@
1
+ import { format as formatTz } from "date-fns-tz";
2
+ import { format } from "date-fns";
3
+ export const useDateFormat = () => {
4
+ const formatDate = (date) => {
5
+ return format(new Date(date), "MMMM do, Y");
6
+ };
7
+ const formatTimezoneToLocal = (date, format2, timezone) => {
8
+ return formatTz(
9
+ new Date(
10
+ formatTz(date, "yyyy-MM-dd HH:mm z", {
11
+ timeZone: timezone
12
+ })
13
+ ),
14
+ format2
15
+ );
16
+ };
17
+ return {
18
+ formatTimezoneToLocal,
19
+ formatDate
20
+ };
21
+ };
@@ -0,0 +1,30 @@
1
+ import { Ref } from "vue";
2
+ import { Conference } from "../models/conference";
3
+ declare type UserLogin = {
4
+ /**
5
+ * Email input
6
+ */
7
+ email: Ref<string>;
8
+ /**
9
+ * Password Input
10
+ */
11
+ password: Ref<string>;
12
+ /**
13
+ * Login has too many active sessions
14
+ */
15
+ tooManySessions: Ref<boolean>;
16
+ /**
17
+ * Login errors
18
+ */
19
+ loginError: Ref<boolean>;
20
+ /**
21
+ * Handle login.
22
+ */
23
+ handleLogin: (revoke?: boolean) => void;
24
+ /**
25
+ * Reset login
26
+ */
27
+ showReset: () => void;
28
+ };
29
+ export declare const useLogin: (conference: Ref<Conference>) => UserLogin;
30
+ export {};
@@ -0,0 +1,58 @@
1
+ import { storeToRefs } from "pinia";
2
+ import { defineEmits } from "vue";
3
+ import { useConferenceHelpers } from "./useConferenceHelpers.mjs";
4
+ export const useLogin = (conference) => {
5
+ const { login } = useAuthStore();
6
+ const { currentConference } = storeToRefs(useConferencesStore());
7
+ const { globalConfigValue } = storeToRefs(useTemplateConfigsStore());
8
+ const email = ref("");
9
+ const password = ref("");
10
+ const tooManySessions = ref(false);
11
+ const loginError = ref(false);
12
+ const emit = defineEmits(["showReset", "loggedIn"]);
13
+ const router = useRouter();
14
+ const shouldRedirect = () => {
15
+ let redirectUrl = null;
16
+ if (currentConference.value !== null) {
17
+ if (globalConfigValue.value("login_redirect_enabled")) {
18
+ const { getConferenceWebcastUrl } = useConferenceHelpers(currentConference);
19
+ redirectUrl = getConferenceWebcastUrl();
20
+ }
21
+ } else if (conference.value !== null) {
22
+ if (globalConfigValue.value("login_redirect_enabled")) {
23
+ const { getConferenceWebcastUrl } = useConferenceHelpers(conference);
24
+ redirectUrl = getConferenceWebcastUrl();
25
+ }
26
+ }
27
+ if (redirectUrl === null) {
28
+ router.push("/");
29
+ } else if (redirectUrl.trim().length > 0) {
30
+ router.push(redirectUrl);
31
+ }
32
+ };
33
+ const handleLogin = (revoke = false) => {
34
+ login({ email: email.value, password: password.value, revoke }).then(() => {
35
+ emit("loggedIn");
36
+ shouldRedirect();
37
+ }).catch((error) => {
38
+ if (error.response.status === 423) {
39
+ tooManySessions.value = true;
40
+ } else {
41
+ loginError.value = true;
42
+ }
43
+ });
44
+ };
45
+ const showReset = () => {
46
+ email.value = "";
47
+ password.value = "";
48
+ emit("showReset");
49
+ };
50
+ return {
51
+ email,
52
+ password,
53
+ tooManySessions,
54
+ handleLogin,
55
+ loginError,
56
+ showReset
57
+ };
58
+ };
@@ -0,0 +1,53 @@
1
+ import { Ref } from "nuxt/dist/app/compat/capi";
2
+ import { Conference, Presentation, Track } from "../models/conference";
3
+ export declare type UsePresentationMethods = {
4
+ /**
5
+ * show session time
6
+ */
7
+ showPresentationTimes: (presentation: Presentation) => boolean;
8
+ /**
9
+ * show presentation end times
10
+ */
11
+ showPresentationEndTimes: () => boolean;
12
+ /**
13
+ * get presentation end time
14
+ */
15
+ getPresentationEndTime: (presentation: Presentation) => string;
16
+ /**
17
+ * get presentation link target
18
+ */
19
+ getPresentationLinkTarget: (presentation: Presentation) => string;
20
+ /**
21
+ * get Archive presentation link destination
22
+ */
23
+ getArchivePresentationLinkDestination: (presentation: Presentation) => string;
24
+ /**
25
+ * get presentation link destination
26
+ */
27
+ getLivePresentationLinkDestination: (presentation: Presentation, track: Track) => string;
28
+ /**
29
+ * show presentation description icon
30
+ */
31
+ showPresentationLinkIcon: () => boolean;
32
+ /**
33
+ * get presentation description link text
34
+ */
35
+ getPresentationLinkText: () => string;
36
+ /**
37
+ * show presentation Play icon
38
+ */
39
+ showPresentationPlayIcon: (presentation: Presentation) => boolean;
40
+ /**
41
+ * presentation has custom play icon
42
+ */
43
+ getPresentationCustomPlayIcon: (presentation: Presentation) => boolean | string;
44
+ /**
45
+ * Get presentation streaming text
46
+ */
47
+ getPresentationStreamingText: (presentation: Presentation) => string;
48
+ /**
49
+ * Presentation is live or mixed
50
+ */
51
+ presentationIsLiveOrMixed: (presentation: Presentation) => boolean;
52
+ };
53
+ export declare const usePresentation: (conference: Ref<Conference>) => UsePresentationMethods;
@@ -0,0 +1,98 @@
1
+ import { addSeconds } from "date-fns";
2
+ import {
3
+ ConferenceState
4
+ } from "../models/conference";
5
+ import { useDateFormat } from "./useDateFormat.mjs";
6
+ import { useConferenceHelpers } from "./useConferenceHelpers.mjs";
7
+ export const usePresentation = (conference) => {
8
+ const { formatTimezoneToLocal } = useDateFormat();
9
+ const { pagesConfigValue } = useTemplateConfigsStore();
10
+ const { conferenceIsMixed, getConferenceRegUrl } = useConferenceHelpers(conference);
11
+ const showPresentationTimes = (presentation) => {
12
+ return pagesConfigValue("agenda.session_times", true) && presentation.date_visible;
13
+ };
14
+ const showPresentationEndTimes = () => {
15
+ return pagesConfigValue("agenda.session_end_times", false);
16
+ };
17
+ const getPresentationEndTime = (presentation) => {
18
+ return formatTimezoneToLocal(
19
+ addSeconds(new Date(presentation.date), presentation.duration),
20
+ "h:m a",
21
+ conference.value.timezone
22
+ );
23
+ };
24
+ const getPresentationLinkTarget = (presentation) => {
25
+ return presentation.type === "link" ? "_blank" : "";
26
+ };
27
+ const getArchivePresentationLinkDestination = (presentation) => {
28
+ if (!conference.value.access && (!pagesConfigValue("archive_player.preview_enabled", false) || presentation.type === "link")) {
29
+ return getConferenceRegUrl();
30
+ } else if (presentation.type === "link") {
31
+ return presentation.video_url;
32
+ }
33
+ return `/archive/${presentation.id}`;
34
+ };
35
+ const getLivePresentationLinkDestination = (presentation, track) => {
36
+ if (conference.value.access) {
37
+ if (presentation.type === "link") {
38
+ return presentation.video_url;
39
+ }
40
+ if ((presentation.video_url || presentation.type === "embed") && conferenceIsMixed) {
41
+ return getArchivePresentationLinkDestination(presentation);
42
+ }
43
+ return `/upcoming-events/${conference.value.id}/webcast/${track.channel}`;
44
+ }
45
+ return getConferenceRegUrl();
46
+ };
47
+ const showPresentationLinkIcon = () => {
48
+ return pagesConfigValue("agenda.session_desc_link") === "icon";
49
+ };
50
+ const getPresentationLinkText = () => {
51
+ return pagesConfigValue("agenda.session_desc_link_text", "");
52
+ };
53
+ const showPresentationPlayIcon = (presentation) => {
54
+ if (presentation.type === "zoom") {
55
+ return pagesConfigValue("agenda.use_zoom_icon");
56
+ } else {
57
+ return pagesConfigValue("agenda.use_play_icon");
58
+ }
59
+ };
60
+ const getPresentationCustomPlayIcon = (presentation) => {
61
+ if (presentation.is_live) {
62
+ return pagesConfigValue("agenda.live_play_icon", false);
63
+ }
64
+ if (conference.value.state === ConferenceState.MIXED && (presentation.video_url || presentation.type === "embed")) {
65
+ return pagesConfigValue("agenda.pre_recorded_play_icon", false);
66
+ }
67
+ return false;
68
+ };
69
+ const getPresentationStreamingText = (presentation) => {
70
+ if (presentation.type === "zoom") {
71
+ return pagesConfigValue("agenda.zoom_text");
72
+ }
73
+ if (presentation.is_live) {
74
+ return pagesConfigValue("agenda.live_stream_text");
75
+ }
76
+ if (conference.value.state === ConferenceState.MIXED && (presentation.video_url || presentation.type === "embed")) {
77
+ return pagesConfigValue("agenda.pre_recorded_text");
78
+ }
79
+ return "";
80
+ };
81
+ const presentationIsLiveOrMixed = (presentation) => {
82
+ return presentation.is_live || conference.value.state === ConferenceState.MIXED && (presentation.video_url.length > 0 || presentation.type === "embed");
83
+ };
84
+ return {
85
+ showPresentationTimes,
86
+ showPresentationEndTimes,
87
+ getPresentationEndTime,
88
+ getPresentationLinkTarget,
89
+ getArchivePresentationLinkDestination,
90
+ getLivePresentationLinkDestination,
91
+ showPresentationLinkIcon,
92
+ getPresentationLinkText,
93
+ showPresentationPlayIcon,
94
+ getPresentationCustomPlayIcon,
95
+ getPresentationStreamingText,
96
+ presentationIsLiveOrMixed
97
+ };
98
+ };
@@ -0,0 +1,15 @@
1
+ import { ComputedRef, Ref } from "nuxt/dist/app/compat/capi";
2
+ import { Presenter } from "../models/conference";
3
+ export declare type UsePresenterMethods = {
4
+ fullName: ComputedRef<string>;
5
+ titleCompany: ComputedRef<string>;
6
+ imageHeight: ComputedRef<string>;
7
+ presenterImageStyle: ComputedRef<{
8
+ [key: string]: string | number;
9
+ }>;
10
+ itemWidthStyle: ComputedRef<{
11
+ [key: string]: string;
12
+ }>;
13
+ isGrayScale: ComputedRef<boolean>;
14
+ };
15
+ export declare const usePresenter: (presenter: Ref<Presenter>) => UsePresenterMethods;
@@ -0,0 +1,67 @@
1
+ export const usePresenter = (presenter) => {
2
+ const { pagesConfigValue, globalConfigValue } = useTemplateConfigsStore();
3
+ const imageStyle = ref(
4
+ pagesConfigValue("main.presenter_all_image_style", "default")
5
+ );
6
+ const imageWidth = ref(
7
+ pagesConfigValue("presenters.presenter_image_width", 0)
8
+ );
9
+ const itemWidth = ref(120);
10
+ if (!imageWidth.value > 0) {
11
+ imageWidth.value = pagesConfigValue("main.presenter_all_item_width");
12
+ }
13
+ const fullName = computed(() => {
14
+ let name = presenter.value.first_name + " " + presenter.value.last_name;
15
+ if (presenter.value.designations) {
16
+ name += ", " + presenter.value.designations;
17
+ }
18
+ return name;
19
+ });
20
+ const titleCompany = computed(() => {
21
+ if (presenter.value.title && !presenter.value.company) {
22
+ return presenter.value.title;
23
+ } else if (presenter.value.title && presenter.value.company) {
24
+ return presenter.value.title + ", " + presenter.value.company;
25
+ } else if (!presenter.value.title && presenter.value.company) {
26
+ return presenter.value.company;
27
+ } else {
28
+ return "";
29
+ }
30
+ });
31
+ const imageHeight = computed(() => {
32
+ return ["circle", "square"].includes(imageStyle.value) ? `${itemWidth.value}px` : "auto";
33
+ });
34
+ const presenterImageStyle = computed(() => {
35
+ let borderRadius = "0";
36
+ if (imageStyle.value === "circle") {
37
+ borderRadius = "50%";
38
+ }
39
+ if (imageStyle.value === "rounded") {
40
+ borderRadius = "6%";
41
+ }
42
+ const backgroundSize = ["circle", "square"].includes(imageStyle.value) ? "cover" : "contain";
43
+ return {
44
+ width: `${itemWidth.value}px`,
45
+ height: imageHeight.value,
46
+ "border-radius": borderRadius,
47
+ "background-position": "center",
48
+ "background-size": backgroundSize,
49
+ "background-repeat": "no-repeat",
50
+ "background-image": `url('${presenter.value.photo}')`
51
+ };
52
+ });
53
+ const itemWidthStyle = computed(() => {
54
+ return { width: `${itemWidth.value}px` };
55
+ });
56
+ const isGrayScale = computed(() => {
57
+ return globalConfigValue("presenter_icon_color_style") === "greyscale";
58
+ });
59
+ return {
60
+ fullName,
61
+ titleCompany,
62
+ imageHeight,
63
+ presenterImageStyle,
64
+ itemWidthStyle,
65
+ isGrayScale
66
+ };
67
+ };
@@ -0,0 +1,13 @@
1
+ import { Ref } from "nuxt/dist/app/compat/capi";
2
+ import { Conference, Presenter } from "../models/conference";
3
+ export declare type UsePresentersMethods = {
4
+ /**
5
+ * get presenters label
6
+ */
7
+ getPresentersLabel(numberOfPresenters: number): string;
8
+ /**
9
+ * sort presenters
10
+ */
11
+ getSortedPresenters(presenters: Presenter[]): Presenter[];
12
+ };
13
+ export declare const usePresenters: (conference: Ref<Conference>) => UsePresentersMethods;
@@ -0,0 +1,21 @@
1
+ import { sortBy } from "lodash";
2
+ export const usePresenters = (conference) => {
3
+ const { pagesConfigValue } = useTemplateConfigsStore();
4
+ const getPresentersLabel = (numberOfPresenters) => {
5
+ let displayName = pagesConfigValue(
6
+ "main.presenter_all_alias",
7
+ "Presenters"
8
+ );
9
+ if (numberOfPresenters === 1 && displayName.endsWith("s") === true) {
10
+ displayName = displayName.substr(0, displayName.length - 1);
11
+ }
12
+ return displayName;
13
+ };
14
+ const getSortedPresenters = (presenters) => {
15
+ return sortBy(presenters, ["role", "last_name"]);
16
+ };
17
+ return {
18
+ getPresentersLabel,
19
+ getSortedPresenters
20
+ };
21
+ };
@@ -0,0 +1,2 @@
1
+ import type { V3plusCommonPlugin } from "../v3plusCommonPlugin";
2
+ export declare const useV3plusCommonModule: () => V3plusCommonPlugin;
@@ -0,0 +1,2 @@
1
+ import { useNuxtApp } from "#imports";
2
+ export const useV3plusCommonModule = () => useNuxtApp().$v3plusCommonModule;
@@ -0,0 +1 @@
1
+ export declare type Affiliate = {};
File without changes