@icvdeveloper/common-module 1.4.14 → 2.1.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 (189) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/module.d.mts +1051 -2
  3. package/dist/module.d.ts +1051 -2
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +29 -15
  6. package/dist/runtime/@types/components.d.ts +22 -0
  7. package/dist/runtime/@types/configVariables.d.ts +6 -0
  8. package/dist/runtime/analytics.d.ts +1 -6
  9. package/dist/runtime/assets/scss/_agenda.css +1 -0
  10. package/dist/runtime/assets/scss/_animations.css +1 -0
  11. package/dist/runtime/assets/scss/_container_variants.css +1 -0
  12. package/dist/runtime/assets/scss/_custom.css +3 -0
  13. package/dist/runtime/assets/scss/_forms.css +1 -0
  14. package/dist/runtime/assets/scss/_header.css +0 -0
  15. package/dist/runtime/assets/scss/_index_production.css +1 -0
  16. package/dist/runtime/assets/scss/_transitions.css +1 -0
  17. package/dist/runtime/assets/scss/_variables.css +1 -0
  18. package/dist/runtime/assets/scss/_variables2.css +0 -0
  19. package/dist/runtime/assets/scss/_webcast.css +1 -0
  20. package/dist/runtime/assets/scss/index.css +1 -705
  21. package/dist/runtime/assets/svg/icon-minus.svg +6 -0
  22. package/dist/runtime/assets/svg/icon-video.svg +6 -0
  23. package/dist/runtime/components/affiliates/AffiliateModal.vue +66 -0
  24. package/dist/runtime/components/affiliates/AffiliatePage.vue +329 -159
  25. package/dist/runtime/components/agenda/AgendaList.vue +18 -14
  26. package/dist/runtime/components/agenda/AgendaTabbed.vue +60 -54
  27. package/dist/runtime/components/agenda/components/AgendaListAccordion.vue +8 -3
  28. package/dist/runtime/components/agenda/components/Calendar.vue +23 -18
  29. package/dist/runtime/components/agenda/components/Favorite.vue +46 -0
  30. package/dist/runtime/components/agenda/components/InfoLink.vue +15 -5
  31. package/dist/runtime/components/agenda/components/PlayIcon.vue +3 -5
  32. package/dist/runtime/components/agenda/components/PresentationLink.vue +37 -19
  33. package/dist/runtime/components/agenda/components/Sponsor.vue +31 -24
  34. package/dist/runtime/components/auth/PasswordReset.vue +20 -5
  35. package/dist/runtime/components/auth/Registration.vue +14 -4
  36. package/dist/runtime/components/auth/Ucc.vue +44 -27
  37. package/dist/runtime/components/chat/ChatConversationList.vue +108 -0
  38. package/dist/runtime/components/chat/ChatCreateConversation.vue +199 -0
  39. package/dist/runtime/components/chat/ChatCreateGroupConversation.vue +154 -0
  40. package/dist/runtime/components/chat/ChatHeader.vue +97 -0
  41. package/dist/runtime/components/chat/ChatMessage.vue +40 -0
  42. package/dist/runtime/components/chat/ChatShowConversation.vue +76 -0
  43. package/dist/runtime/components/chat/ChatWidget.vue +40 -0
  44. package/dist/runtime/components/chat/ChatWindow.vue +154 -0
  45. package/dist/runtime/components/chat/ChatWindow.vue.d.ts +6 -0
  46. package/dist/runtime/components/chat/MessageInput.vue +27 -0
  47. package/dist/runtime/components/chat/SearchInput.vue +32 -0
  48. package/dist/runtime/components/core/Accordion.vue +12 -12
  49. package/dist/runtime/components/core/AttendeeList.vue +31 -36
  50. package/dist/runtime/components/core/CountdownTimer.vue +68 -52
  51. package/dist/runtime/components/core/DynamicHtml.vue.d.ts +6 -9
  52. package/dist/runtime/components/core/Modal.vue +24 -22
  53. package/dist/runtime/components/core/ModalButton.vue +43 -0
  54. package/dist/runtime/components/core/Navbar.vue +33 -21
  55. package/dist/runtime/components/core/Navigation.vue +286 -0
  56. package/dist/runtime/components/core/SvgIcon.vue +34 -1
  57. package/dist/runtime/components/core/VButton.vue +35 -0
  58. package/dist/runtime/components/core/ZoomModal.vue +9 -3
  59. package/dist/runtime/components/events/EventHeader.vue +14 -4
  60. package/dist/runtime/components/events/ListEvents.vue +21 -22
  61. package/dist/runtime/components/forms/CheckboxGroup.vue +46 -0
  62. package/dist/runtime/components/forms/ErrorField.vue +11 -2
  63. package/dist/runtime/components/forms/Message.vue +1 -1
  64. package/dist/runtime/components/forms/RadioGroup.vue +50 -0
  65. package/dist/runtime/components/forms/SearchInput.vue +8 -2
  66. package/dist/runtime/components/forms/SelectDropDown.vue +47 -0
  67. package/dist/runtime/components/forms/SupportForm.vue +22 -11
  68. package/dist/runtime/components/forms/SwitchInput.vue +50 -30
  69. package/dist/runtime/components/forms/TextArea.vue +1 -1
  70. package/dist/runtime/components/forms/TextInput.vue +1 -1
  71. package/dist/runtime/components/layouts/Accordion.vue +11 -6
  72. package/dist/runtime/components/media/ArchivePlayerAndContentContainer.vue +24 -5
  73. package/dist/runtime/components/media/ArchiveVideoPlayer.vue +19 -23
  74. package/dist/runtime/components/media/PlayerAndContentContainer.vue +4 -1
  75. package/dist/runtime/components/media/WebcastVideoPlayer.vue +6 -18
  76. package/dist/runtime/components/media/components/AgendaPanel.vue +7 -6
  77. package/dist/runtime/components/media/components/ArchiveMediaContainer.vue +17 -15
  78. package/dist/runtime/components/media/components/CeCreditNotification.vue +8 -8
  79. package/dist/runtime/components/media/components/ContentArea.vue +59 -18
  80. package/dist/runtime/components/media/components/ContentTabs.vue +40 -28
  81. package/dist/runtime/components/media/components/DocumentsPanel.vue +19 -17
  82. package/dist/runtime/components/media/components/MediaContainer.vue +11 -13
  83. package/dist/runtime/components/media/components/OverviewPanel.vue +5 -2
  84. package/dist/runtime/components/media/components/PresentersPanel.vue +74 -55
  85. package/dist/runtime/components/media/components/SessionReporting.vue +5 -4
  86. package/dist/runtime/components/media/components/SponsorsPanel.vue +13 -12
  87. package/dist/runtime/components/presenters/PresenterListing.vue +33 -25
  88. package/dist/runtime/components/presenters/PresenterModal.vue +26 -21
  89. package/dist/runtime/components/presenters/Presenters.vue +139 -0
  90. package/dist/runtime/components/profile/Profile.vue +10 -6
  91. package/dist/runtime/components/profile/components/Sidebar.vue +1 -1
  92. package/dist/runtime/components/profile/components/SidebarNavItem.vue +2 -4
  93. package/dist/runtime/components/profile/tabs/Favorites.vue +5 -4
  94. package/dist/runtime/components/profile/tabs/GeneralInformation.vue +26 -16
  95. package/dist/runtime/components/profile/tabs/ProfileImage.vue +7 -6
  96. package/dist/runtime/components/registration/AlreadyRegisteredModal.vue +102 -0
  97. package/dist/runtime/components/registration/PaymentForm.vue +136 -0
  98. package/dist/runtime/components/registration/RegistrationForm.vue +417 -0
  99. package/dist/runtime/components/registration/RegistrationGroupSelect.vue +146 -0
  100. package/dist/runtime/components/registration/StripePaymentForm.vue +121 -0
  101. package/dist/runtime/components/support/FAQAccordion.vue +8 -7
  102. package/dist/runtime/composables/useAdobeLaunch.d.ts +2 -7
  103. package/dist/runtime/composables/useAdobeLaunch.mjs +2 -2
  104. package/dist/runtime/composables/useAgenda.d.ts +13 -1
  105. package/dist/runtime/composables/useAgenda.mjs +125 -25
  106. package/dist/runtime/composables/useApi.d.ts +1 -1
  107. package/dist/runtime/composables/useAuth.d.ts +1 -1
  108. package/dist/runtime/composables/useAuth.mjs +1 -1
  109. package/dist/runtime/composables/useClassBinding.d.ts +3 -1
  110. package/dist/runtime/composables/useConferenceHelpers.d.ts +7 -3
  111. package/dist/runtime/composables/useConferenceHelpers.mjs +26 -15
  112. package/dist/runtime/composables/useEventHooks.d.ts +29 -0
  113. package/dist/runtime/composables/useEventHooks.mjs +21 -0
  114. package/dist/runtime/composables/useEvents.d.ts +17 -1
  115. package/dist/runtime/composables/useEvents.mjs +35 -9
  116. package/dist/runtime/composables/useLogin.mjs +9 -5
  117. package/dist/runtime/composables/useNavigation.d.ts +1 -1
  118. package/dist/runtime/composables/useNavigation.mjs +4 -2
  119. package/dist/runtime/composables/usePresentation.d.ts +2 -2
  120. package/dist/runtime/composables/usePresentation.mjs +8 -7
  121. package/dist/runtime/composables/usePresenter.d.ts +2 -2
  122. package/dist/runtime/composables/usePresenters.d.ts +2 -2
  123. package/dist/runtime/composables/usePusher.d.ts +4 -0
  124. package/dist/runtime/composables/usePusher.mjs +38 -26
  125. package/dist/runtime/composables/useScripts.mjs +1 -1
  126. package/dist/runtime/composables/useStream.d.ts +2 -3
  127. package/dist/runtime/composables/useStream.mjs +8 -2
  128. package/dist/runtime/composables/useUcc.d.ts +1 -1
  129. package/dist/runtime/composables/useUcc.mjs +29 -23
  130. package/dist/runtime/enums/general.d.ts +4 -1
  131. package/dist/runtime/enums/general.mjs +4 -1
  132. package/dist/runtime/models/adobeLaunch.d.ts +6 -0
  133. package/dist/runtime/models/adobeLaunch.mjs +0 -0
  134. package/dist/runtime/models/analytics.d.ts +6 -0
  135. package/dist/runtime/models/analytics.mjs +0 -0
  136. package/dist/runtime/models/attendeeList.d.ts +1 -1
  137. package/dist/runtime/models/conference.d.ts +122 -91
  138. package/dist/runtime/models/conversation.d.ts +11 -13
  139. package/dist/runtime/models/document.d.ts +5 -5
  140. package/dist/runtime/models/globalConfig.d.ts +9 -3
  141. package/dist/runtime/models/group.d.ts +38 -8
  142. package/dist/runtime/models/icons.d.ts +8 -1
  143. package/dist/runtime/models/index.d.ts +20 -0
  144. package/dist/runtime/models/index.mjs +20 -0
  145. package/dist/runtime/models/link.d.ts +4 -4
  146. package/dist/runtime/models/loginParams.d.ts +5 -0
  147. package/dist/runtime/models/loginParams.mjs +0 -0
  148. package/dist/runtime/models/navigationConfig.d.ts +7 -7
  149. package/dist/runtime/models/pagination.d.ts +11 -11
  150. package/dist/runtime/models/portal.d.ts +15 -10
  151. package/dist/runtime/models/templateConfig.d.ts +13 -7
  152. package/dist/runtime/models/ucc.d.ts +22 -0
  153. package/dist/runtime/models/ucc.mjs +0 -0
  154. package/dist/runtime/models/user.d.ts +25 -12
  155. package/dist/runtime/models/vButton.d.ts +7 -0
  156. package/dist/runtime/models/vButton.mjs +0 -0
  157. package/dist/runtime/models/video.d.ts +5 -4
  158. package/dist/runtime/models/virtualPagesConfig.d.ts +223 -0
  159. package/dist/runtime/models/virtualPagesConfig.mjs +0 -0
  160. package/dist/runtime/plugin.mjs +18 -9
  161. package/dist/runtime/store/affiliates.d.ts +4 -1
  162. package/dist/runtime/store/affiliates.mjs +38 -0
  163. package/dist/runtime/store/attendeeList.d.ts +1 -1
  164. package/dist/runtime/store/auth.d.ts +3 -7
  165. package/dist/runtime/store/auth.mjs +6 -0
  166. package/dist/runtime/store/conferences.d.ts +3 -1
  167. package/dist/runtime/store/conferences.mjs +14 -9
  168. package/dist/runtime/store/conversations.d.ts +78 -10
  169. package/dist/runtime/store/conversations.mjs +255 -22
  170. package/dist/runtime/store/modalPlayerConfig.d.ts +27 -0
  171. package/dist/runtime/store/modalPlayerConfig.mjs +58 -0
  172. package/dist/runtime/store/navigationConfig.d.ts +1 -1
  173. package/dist/runtime/store/presentations.d.ts +2 -2
  174. package/dist/runtime/store/templateConfigs.d.ts +7 -6
  175. package/dist/runtime/store/templateConfigs.mjs +7 -6
  176. package/dist/runtime/store/user.mjs +0 -1
  177. package/dist/runtime/v3plusCommonPlugin.d.ts +1 -1
  178. package/dist/types.d.mts +3 -2
  179. package/dist/types.d.ts +3 -2
  180. package/package.json +12 -9
  181. package/dist/runtime/components/media/components/JsonApi.vue +0 -33
  182. package/dist/runtime/components/media/components/JsonApi.vue.d.ts +0 -16
  183. package/dist/runtime/components/media/components/PresentersPanel.vue.d.ts +0 -32
  184. package/dist/runtime/components/media/components/WindowContent.vue +0 -118
  185. package/dist/runtime/components/media/components/WindowContent.vue.d.ts +0 -50
  186. package/dist/runtime/components/media/components/WindowSlide.vue +0 -92
  187. package/dist/runtime/components/media/components/WindowSlide.vue.d.ts +0 -36
  188. package/dist/runtime/models/authUser.d.ts +0 -16
  189. /package/dist/runtime/{models/authUser.mjs → assets/scss/_footer.css} +0 -0
@@ -0,0 +1,136 @@
1
+ <script lang="ts" setup>
2
+ import { ref, toRefs, onMounted } from 'vue';
3
+
4
+ type Props = {
5
+ total: number,
6
+ value: any,
7
+ errors?: {}
8
+ };
9
+
10
+ const props = withDefaults(defineProps<Props>(), {
11
+ errors: () => {
12
+ return {}
13
+ }
14
+ });
15
+
16
+ // TODO - is 'value' used?
17
+ const { total, value, errors } = toRefs(props);
18
+
19
+ // data
20
+ const paymentInputs = ref<{}>({});
21
+
22
+ // emits
23
+ // TODO - set value type
24
+ const emit = defineEmits<{
25
+ (event: 'input', value: any): void;
26
+ }>();
27
+
28
+ // computed
29
+ const totalFormatted = () => {
30
+ return new Intl.NumberFormat('en-US', {
31
+ style: 'currency',
32
+ currency: 'USD',
33
+ minimumFractionDigits: 2
34
+ })
35
+ .format(total.value/100);
36
+ };
37
+
38
+ const monthArray = ():[{ 'name': string, 'value': number}] => {
39
+ return [
40
+ { name: '01 - January', value: 1 },
41
+ { name: '02 - February', value: 2 },
42
+ { name: '03 - March', value: 3 },
43
+ { name: '04 - April', value: 4 },
44
+ { name: '05 - May', value: 5 },
45
+ { name: '06 - June', value: 6 },
46
+ { name: '07 - July', value: 7 },
47
+ { name: '08 - August', value: 8 },
48
+ { name: '09 - September', value: 9 },
49
+ { name: '10 - October', value: 10 },
50
+ { name: '11 - November', value: 11 },
51
+ { name: '12 - December', value: 12 },
52
+ ];
53
+ };
54
+
55
+ const yearArray = () => {
56
+ const startingYear = new Date().getFullYear();
57
+ const returnArray = [];
58
+ for(let i = startingYear; i <= (startingYear + 10); i++) {
59
+ returnArray.push({name: i, value: i});
60
+ }
61
+ return returnArray;
62
+ };
63
+
64
+ watch(paymentInputs.value, (newValue, oldValue) => {
65
+ emit('input', newValue);
66
+ });
67
+
68
+ onMounted(() => {
69
+ paymentInputs.value.cc_exp_month = 1;
70
+ paymentInputs.value.cc_exp_year = new Date().getFullYear();
71
+ });
72
+ </script>
73
+
74
+ <template>
75
+ <!-- Payment Form -->
76
+ <div class="row mb-5 border border-gray-400 rounded p-4">
77
+ <div class="py-3 px-3 flex bg-gray-600 rounded text-white font-semibold">
78
+ <div class="flex-1">
79
+ Payment Information
80
+ </div>
81
+ <div class="flex-1 text-right">
82
+ {{ totalFormatted }}
83
+ </div>
84
+ </div>
85
+
86
+ <div class="row flex flex-col mb-2">
87
+ <div class="flex-1 my-2">
88
+ <div>
89
+ <label class="block font-semibold text-gray-800 mb-1">
90
+ Card Number
91
+ </label>
92
+ <input
93
+ v-model="paymentInputs['cc_number']"
94
+ type="text"
95
+ class="form-input"
96
+ >
97
+ <CommonErrorField :errors="errors['cc_number']" />
98
+ <CommonErrorField :errors="errors['payment']" />
99
+ </div>
100
+ </div>
101
+ <div class="flex flex-1 my-2">
102
+ <div class="flex-1 mx-1">
103
+ <label class="block font-semibold text-gray-800 mb-1">
104
+ Exp. Month
105
+ </label>
106
+ <CommonSelectDropDown
107
+ v-model="paymentInputs['cc_exp_month']"
108
+ :options="monthArray"
109
+ />
110
+ <CommonErrorField :errors="errors['cc_exp_month']" />
111
+ </div>
112
+ <div class="flex-1 mx-1">
113
+ <label class="block font-semibold text-gray-800 mb-1">
114
+ Exp. Year
115
+ </label>
116
+ <CommonSelectDropDown
117
+ v-model="paymentInputs['cc_exp_year']"
118
+ :options="yearArray"
119
+ />
120
+ <CommonErrorField :errors="errors['cc_exp_year']" />
121
+ </div>
122
+ <div class="flex-1 mx-1">
123
+ <label class="block font-semibold text-gray-800 mb-1">
124
+ CVC/CVV
125
+ </label>
126
+ <input
127
+ v-model="paymentInputs['cc_cvc']"
128
+ type="text"
129
+ class="form-input"
130
+ >
131
+ <CommonErrorField :errors="errors['cc_cvc']" />
132
+ </div>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ </template>
@@ -0,0 +1,417 @@
1
+ <script lang="ts" setup>
2
+ import { ref, toRefs, onMounted, computed } from 'vue';
3
+ import { useRouter } from '#vue-router';
4
+ import { storeToRefs } from 'pinia';
5
+ import { get, debounce } from 'lodash-es';
6
+ import { useApi } from '../../composables';
7
+ import { useAuthStore } from '../../store';
8
+ import { useTemplateConfigsStore } from '../../store';
9
+ import type { IFetchError } from 'ofetch'
10
+ import type { Conference } from '../../models/conference';
11
+ import type { Group, RegistrationForm } from '../../models/group';
12
+
13
+ type Props = {
14
+ content: string;
15
+ conference?: Conference | null;
16
+ }
17
+
18
+ const props = withDefaults(defineProps<Props>(), {
19
+ conference: null
20
+ });
21
+
22
+ const { content } = toRefs(props);
23
+ const { globalConfigValue } = useTemplateConfigsStore();
24
+ const { user } = storeToRefs(useAuthStore());
25
+ const router = useRouter();
26
+
27
+ // data
28
+ const group = ref<Group>();
29
+ const registrationFormObject = ref<RegistrationForm>();
30
+ const formInputs = ref<{[key: string]: string}>({});
31
+ const title = ref<string>('');
32
+ const formComplete = ref<boolean>(false);
33
+ const loading = ref<boolean>(false);
34
+ const errors = ref<{[key: string]: []}>({});
35
+ const showLogin = ref<boolean>(false);
36
+ const stripeComponent = ref();
37
+
38
+ // computed
39
+ const regButtonEnabled = computed((): boolean => {
40
+ return globalConfigValue('reg_button_enabled') === true;
41
+ });
42
+
43
+ const regExternalUrl = computed((): string => {
44
+ const extRegUrl = globalConfigValue('external_reg_url');
45
+ if (extRegUrl) return extRegUrl;
46
+ return '';
47
+ });
48
+
49
+ const showCheckout = computed((): boolean => {
50
+ if (group.value && group.value.price != 0 && group.value.enabled) {
51
+ return true;
52
+ }
53
+ return false;
54
+ });
55
+
56
+ const isTownhallRegistration = computed((): boolean => {
57
+ return globalConfigValue('townhall_registration_enabled', false);
58
+ });
59
+
60
+ const isLoggedIn = computed(():boolean => {
61
+ return user.value != null;
62
+ });
63
+
64
+ const userAcctError = computed((): string => {
65
+ if (group.value.type == 'online') {
66
+ return 'An account with this email already exists. Please log in to continue your registration.';
67
+ } else if (group.value.type == 'media') {
68
+ return 'An account with this email already exists. Please login to continue your purchase, or continue your purchase as a guest.';
69
+ } else {
70
+ return '';
71
+ }
72
+ });
73
+
74
+ const regButtonAlias = computed((): string => {
75
+ let returnText = "Register";
76
+ const aliasText = globalConfigValue('reg_button_alias', '');
77
+ if (aliasText.length != 0) returnText = aliasText;
78
+ return returnText;
79
+ });
80
+
81
+ // methods
82
+ const debounceEmail = debounce(() => {
83
+ const request = useApi();
84
+ request(`groups/${group.value.id}/check-email`,
85
+ {
86
+ method: 'POST',
87
+ query: {
88
+ email: formInputs.value.email
89
+ }
90
+ })
91
+ .then((response: any) => {
92
+ if (response.data.registered === true) {
93
+ showLogin.value = true;
94
+ }
95
+ })
96
+ .catch(error => {
97
+ console.log(error);
98
+ });
99
+ }, 500);
100
+
101
+ const closeUserAcctError = (): void => {
102
+ if (group.value.type == 'media') {
103
+ errors.value['user'] = [];
104
+ }
105
+ showLogin.value = false;
106
+ };
107
+
108
+ const getRegistrationFormData = (_group: string): void => {
109
+ const request = useApi();
110
+ request(`groups/${_group}?with=registration_form.fields,merchant`)
111
+ // TODO - define type
112
+ .then((response: any) => {
113
+ group.value = response.data as Group;
114
+ registrationFormObject.value = group.value.registration_form;
115
+
116
+ title.value = `Registration - ${group.value.name}`;
117
+
118
+ if(registrationFormObject.value != undefined && registrationFormObject.value.fields) {
119
+ registrationFormObject.value.fields.map((field: any) => {
120
+ // TODO - define type
121
+ let tmpValue: any = '';
122
+
123
+ if (field.type == 'checkbox') {
124
+ tmpValue = [];
125
+ }
126
+
127
+ if (field.type == 'hidden') {
128
+ tmpValue = field.value;
129
+ }
130
+
131
+ formInputs.value[field.name] = tmpValue;
132
+ });
133
+ }
134
+ })
135
+ };
136
+
137
+ const shouldRenderField = (field: any): boolean => {
138
+ if ((isLoggedIn.value && field.name === 'password') || (isLoggedIn.value && field.name === 'email')) {
139
+ return false;
140
+ }
141
+ return true;
142
+ };
143
+
144
+ const getTextInputType = (_field_object: any): string => {
145
+ if (_field_object.type == 'password') {
146
+ return 'password';
147
+ } else if (_field_object.validation.email) {
148
+ return 'email';
149
+ } else if (_field_object.validation.numeric) {
150
+ return 'number';
151
+ } else {
152
+ return 'text';
153
+ }
154
+ };
155
+
156
+ const getPlaceholder = (_placeholder: string | null): string => {
157
+ if (_placeholder != null) return _placeholder;
158
+ return '';
159
+ };
160
+
161
+ const handleForm = (): void => {
162
+ if (showCheckout.value) {
163
+ loading.value = true;
164
+ stripeComponent.value.payWithStripe();
165
+ } else {
166
+ register();
167
+ }
168
+ };
169
+
170
+ const register = (ccToken: string = '') => {
171
+ loading.value = true;
172
+ errors.value = {};
173
+ console.log('formInputs', formInputs.value);
174
+ const inputs = {
175
+ method: 'POST',
176
+ body: {
177
+ ...formInputs.value
178
+ }
179
+ };
180
+ if (ccToken.length != 0) {
181
+ inputs.body.cc_token = ccToken;
182
+ }
183
+ if (isLoggedIn.value) {
184
+ inputs.body.email = user.value!.email;
185
+ }
186
+
187
+ const request = useApi();
188
+
189
+ request(`groups/${group.value.id}/registration`, inputs)
190
+ .then((response: any) => {
191
+ if(isLoggedIn.value) {
192
+ router.push('/');
193
+ }
194
+ formComplete.value = true;
195
+ user.value = response;
196
+ })
197
+ .catch((error: IFetchError) => {
198
+ errors.value = get(error?.response?._data, 'errors', {});
199
+ })
200
+ .finally(() => {
201
+ loading.value = false;
202
+ });
203
+ };
204
+
205
+ onMounted(() => {
206
+ getRegistrationFormData(content.value);
207
+ });
208
+ </script>
209
+
210
+ <template>
211
+ <div
212
+ v-if="group != undefined && Object.keys(group).length > 0"
213
+ id="page-registration"
214
+ >
215
+ <div class="px-2">
216
+ <!-- Registration Form -->
217
+ <div
218
+ v-if="!formComplete && regButtonEnabled && regExternalUrl.length == 0"
219
+ class="mx-auto text-left max-form-width"
220
+ >
221
+ <h3
222
+ v-if="group.name"
223
+ class="py-8 font-light"
224
+ >
225
+ Please complete the registration form below for {{ group.name }}.
226
+ </h3>
227
+ <form
228
+ class="w-full mx-auto"
229
+ @submit.prevent="handleForm"
230
+ >
231
+ <template v-for="field in registrationFormObject.fields">
232
+ <div
233
+ v-if="shouldRenderField(field)"
234
+ :key="field.name"
235
+ class="row mb-3"
236
+ >
237
+ <label
238
+ v-if="field.type != 'hidden'"
239
+ class="block body-color-1 mb-1"
240
+ >
241
+ {{ field.label }}
242
+ </label>
243
+
244
+ <!-- Input / Password -->
245
+ <span v-if="['text', 'password'].indexOf(field.type) >= 0">
246
+ <span v-if="field.name === 'email'">
247
+ <CommonTextInput
248
+ v-model="formInputs[field.name]"
249
+ :placeholder="getPlaceholder(field.placeholder)"
250
+ :required="field.validation.required"
251
+ :type="getTextInputType(field)"
252
+ @update:model-value="debounceEmail"
253
+ />
254
+ </span>
255
+
256
+ <span v-else>
257
+ <CommonTextInput
258
+ v-model="formInputs[field.name]"
259
+ :placeholder="getPlaceholder(field.placeholder)"
260
+ :required="field.validation.required"
261
+ :type="getTextInputType(field)"
262
+ />
263
+ </span>
264
+ </span>
265
+
266
+ <!-- TextArea -->
267
+ <span v-if="field.type == 'textarea'">
268
+ <CommonTextArea v-model="formInputs[field.name]" />
269
+ </span>
270
+
271
+ <!-- Select -->
272
+ <span v-if="field.type == 'select'">
273
+ <CommonSelectDropDown
274
+ v-model="formInputs[field.name]"
275
+ :options="field.options"
276
+ :first-disabled="true"
277
+ />
278
+ </span>
279
+
280
+ <!-- Checkboxes -->
281
+ <span v-if="field.type == 'checkbox'">
282
+ <CommonCheckboxGroup
283
+ v-model="formInputs[field.name]"
284
+ :options="field.options"
285
+ />
286
+ </span>
287
+
288
+ <!-- Radio Buttons -->
289
+ <span v-if="field.type == 'radiogroup'">
290
+ <CommonRadioGroup
291
+ v-model="formInputs[field.name]"
292
+ :options="field.options"
293
+ />
294
+ </span>
295
+
296
+ <!-- Hidden -->
297
+ <span v-if="field.type == 'hidden'">
298
+ <input
299
+ v-model="formInputs[field.name]"
300
+ type="hidden"
301
+ >
302
+ </span>
303
+
304
+ <!-- Error Field -->
305
+ <CommonErrorField
306
+ v-if="errors[field.name]"
307
+ :errors="errors[field.name]"
308
+ />
309
+ <CommonErrorField
310
+ v-if="field.name == 'email' && (errors.user != undefined && errors.user.length)"
311
+ :errors="errors.user"
312
+ />
313
+ </div>
314
+ </template>
315
+ <!-- Payment Form -->
316
+ <!-- TODO - update Stripe integration -->
317
+ <CommonStripePaymentForm
318
+ v-if="showCheckout"
319
+ ref="stripeComponent"
320
+ :stripe-key="group?.merchant?.account_id as string"
321
+ :price="group.price as number"
322
+ :errors="errors"
323
+ @token-generated="register"
324
+ @on-error="loading = false"
325
+ />
326
+
327
+ <!-- error field when email field/error is hidden -->
328
+ <CommonErrorField
329
+ v-if="isLoggedIn && errors.user.length"
330
+ class="mt-3"
331
+ :errors="errors.user"
332
+ />
333
+
334
+ <button
335
+ class="btn btn-primary my-2"
336
+ type="submit"
337
+ :disabled="loading"
338
+ >
339
+ <span v-if="!loading">Submit</span>
340
+ <span v-else>Processing</span>
341
+ </button>
342
+ </form>
343
+ </div>
344
+ <!-- End Registration Form -->
345
+
346
+ <!-- If Registration External URL -->
347
+ <div
348
+ v-if="regButtonEnabled && regExternalUrl.length != 0"
349
+ class="px-2"
350
+ >
351
+ <a
352
+ :href="regExternalUrl"
353
+ :target="/^http/.test(regExternalUrl) ? '_blank' : '_self'"
354
+ >
355
+ <button
356
+ class="btn btn-primary my-2"
357
+ type="submit"
358
+ >
359
+ {{ regButtonAlias }}
360
+ </button>
361
+ </a>
362
+ </div>
363
+
364
+ <!-- If Registration disabled -->
365
+ <div
366
+ v-if="!regButtonEnabled || !group"
367
+ class="px-2 md:px-4"
368
+ >
369
+ <div class="flex justify-around m-2 border-b border-gray-400 py-12 text-lg">
370
+ Sorry! There are no registration options available at this time.
371
+ </div>
372
+ </div>
373
+
374
+ <br>
375
+
376
+ <div
377
+ v-if="user && formComplete"
378
+ class="w-full mx-auto max-form-width"
379
+ >
380
+ <template v-if="user.name">
381
+ <h2 class="mb-4">
382
+ {{ user.name }}
383
+ </h2>
384
+ </template>
385
+ <CommonDynamicHtml
386
+ v-if="group.registration_message"
387
+ :template="group.registration_message"
388
+ />
389
+ <CommonLoginFullWidth
390
+ v-else-if="!user"
391
+ title="Thank you for registering. Please log in to continue to your event."
392
+ />
393
+ <span v-else>
394
+ You are now registered for <span class="font-bold"><i>{{ group.name }}</i></span>.
395
+ </span>
396
+ </div>
397
+ </div>
398
+
399
+ <CommonModal
400
+ v-if="showLogin"
401
+ @trigger="closeUserAcctError"
402
+ >
403
+ <template #modal-body>
404
+ <div class="py-5">
405
+ <CommonLoginFullWidth
406
+ :title="userAcctError"
407
+ :center-text="false"
408
+ :allow-guest="group.type == 'media'"
409
+ @loggingin="errors={}"
410
+ @loggedin="showLogin=false"
411
+ @close-login="closeUserAcctError"
412
+ />
413
+ </div>
414
+ </template>
415
+ </CommonModal>
416
+ </div>
417
+ </template>
@@ -0,0 +1,146 @@
1
+ <script lang="ts" setup>
2
+ import { toRefs } from 'vue';
3
+ import { storeToRefs } from 'pinia';
4
+ import { get } from 'lodash-es';
5
+ import { useUserStore } from '../../store/user';
6
+ import { useTemplateConfigsStore } from '../../store/templateConfigs';
7
+ import type { Group } from '../../models/group';
8
+
9
+ type Props = {
10
+ content: any[];
11
+ };
12
+
13
+ const props = defineProps<Props>();
14
+
15
+ const { content } = toRefs(props);
16
+
17
+ const { globalConfigValue } = useTemplateConfigsStore();
18
+ const { currentUser } = storeToRefs(useUserStore());
19
+
20
+ const emit = defineEmits<{
21
+ (event: "setRegForm", value: string): void;
22
+ }>();
23
+
24
+ // computed
25
+ const hasGroups = (): boolean => {
26
+ return content.value.length > 0;
27
+ };
28
+
29
+ const regButtonEnabled = (): boolean => {
30
+ return globalConfigValue("reg_button_enabled");
31
+ }
32
+
33
+ const regExternalUrl = (): string => {
34
+ const extRegUrl = globalConfigValue("external_reg_url");
35
+ if (extRegUrl.length > 0) return extRegUrl;
36
+ return '';
37
+ };
38
+
39
+ const regButtonAlias = (): string => {
40
+ let returnText = "Register";
41
+ const aliasText = globalConfigValue("reg_button_alias");
42
+ if (aliasText.length > 0) returnText = aliasText;
43
+ return returnText;
44
+ };
45
+
46
+ // methods
47
+ const getRegisterText = (_group: Group): string => {
48
+ return _group.price as number > 0 ? "Buy Now" : "Register";
49
+ };
50
+
51
+ const formatCurrency = (_value: number): string => {
52
+ const val: number = _value / 100;
53
+ return val
54
+ .toLocaleString('en-US', {currency: 'USD', style: 'currency'})
55
+ .substring(1);
56
+ };
57
+
58
+ const setRegForm = (_code: string) => {
59
+ emit("setRegForm", _code);
60
+ };
61
+
62
+ const checkAlreadyRegistered = (_group_id: number): boolean => {
63
+ let hasGroups: boolean = false;
64
+ if (get(currentUser.value, 'group_ids', false) != false) {
65
+ const groupIds: number[] = currentUser.value.group_ids as number[];
66
+ hasGroups = groupIds.includes(_group_id);
67
+ }
68
+ return hasGroups;
69
+ };
70
+ </script>
71
+
72
+ <template>
73
+ <div class="px-2">
74
+ <!-- If the conference has one or more groups -->
75
+ <template v-if="hasGroups() && regButtonEnabled() && regExternalUrl().length == 0">
76
+ <div
77
+ v-for="(group, index) in content"
78
+ :key="group.id"
79
+ class="flex flex-col justify-around p-6 m-2 text-center"
80
+ :class="index != content.length - 1 ? 'border-b border-gray-400' : ''"
81
+ >
82
+ <div class="flex flex-1 flex-col py-2">
83
+ <div class="flex-1 mb-2 text-xl font-bold">
84
+ {{ group.name }}
85
+ </div>
86
+ <div class="flex-1">
87
+ {{ group.description }}
88
+ </div>
89
+ </div>
90
+
91
+ <div class="flex flex-col grow-0 items-center justify-between">
92
+ <div
93
+ v-if="group.price"
94
+ class="text-lg mb-2"
95
+ >
96
+ {{ formatCurrency(group.price) }}
97
+ </div>
98
+ <button
99
+ v-if="group.type == 'media' || !checkAlreadyRegistered(group.id)"
100
+ class="btn btn-primary"
101
+ @click="setRegForm(group.code)"
102
+ >
103
+ {{ getRegisterText(group) }}
104
+ </button>
105
+ <span
106
+ v-else
107
+ class="text-red"
108
+ >
109
+ You are already registered for this access level for this event.
110
+ </span>
111
+ </div>
112
+ </div>
113
+ </template>
114
+
115
+ <!-- If the conference does not have any groups, or reg disabled -->
116
+ <div
117
+ v-if="!hasGroups() || !regButtonEnabled()"
118
+ class="px-2 md:px-4"
119
+ >
120
+ <div class="flex justify-around m-2 border-b border-gray-400 py-12 text-lg">
121
+ Sorry! There are no registration options available at this time.
122
+ </div>
123
+ </div>
124
+
125
+ <!-- If Registration External URL -->
126
+ <div
127
+ v-if="regButtonEnabled() && regExternalUrl().length > 0"
128
+ class="px-2 text-center"
129
+ >
130
+ <a
131
+ :href="regExternalUrl"
132
+ :target="/^http/.test(regExternalUrl()) ? '_blank' : '_self'"
133
+ >
134
+ <button
135
+ class="btn btn-primary my-2"
136
+ type="submit"
137
+ >
138
+ {{ regButtonAlias }}
139
+ </button>
140
+ </a>
141
+ </div>
142
+ <br>
143
+ </div>
144
+ </template>
145
+
146
+ <style></style>