@flarehr/apollo-super-selection 1.3.34200 → 1.3.34266

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 (55) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -1
  2. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  3. package/dist/lib/apollo-super-selection/p-2855d33a.system.entry.js +69 -0
  4. package/dist/lib/apollo-super-selection/p-7fcf97a5.entry.js +14 -0
  5. package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
  6. package/dist/lib/cjs/apollo-super-selection.cjs.js +1 -1
  7. package/dist/lib/cjs/loader.cjs.js +1 -1
  8. package/dist/lib/cjs/{sss-button_30.cjs.entry.js → sss-button_38.cjs.entry.js} +880 -3
  9. package/dist/lib/collection/apollo-super-selection.css +1 -1
  10. package/dist/lib/collection/collection-manifest.json +16 -0
  11. package/dist/lib/collection/components/app-host/super-selection-app-host.css +2 -2
  12. package/dist/lib/collection/components/super-selection-app/misc/button.js +2 -1
  13. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-common.js +22 -0
  14. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-display-field.js +41 -0
  15. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-error-box.js +76 -0
  16. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.js +121 -0
  17. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-smsf.js +144 -0
  18. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-my-own-fund.js +217 -0
  19. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-smsf.js +355 -0
  20. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-types.js +281 -0
  21. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-warning-box.js +46 -0
  22. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill.js +73 -0
  23. package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +10 -0
  24. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +10 -0
  25. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +1 -0
  26. package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +1 -0
  27. package/dist/lib/collection/components/super-selection-app/super-selection-app.js +4 -1
  28. package/dist/lib/esm/apollo-super-selection.js +1 -1
  29. package/dist/lib/esm/loader.js +1 -1
  30. package/dist/lib/esm/{sss-button_30.entry.js → sss-button_38.entry.js} +873 -4
  31. package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
  32. package/dist/lib/esm-es5/loader.js +1 -1
  33. package/dist/lib/esm-es5/sss-button_38.entry.js +69 -0
  34. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +20 -0
  35. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +39 -0
  36. package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.d.ts +1 -1
  37. package/dist/lib/types/components/super-selection-app/misc/button.d.ts +1 -1
  38. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-common.d.ts +9 -0
  39. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-display-field.d.ts +5 -0
  40. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-error-box.d.ts +5 -0
  41. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.d.ts +18 -0
  42. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-smsf.d.ts +28 -0
  43. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-my-own-fund.d.ts +30 -0
  44. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-smsf.d.ts +48 -0
  45. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-types.d.ts +90 -0
  46. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-warning-box.d.ts +4 -0
  47. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill.d.ts +11 -0
  48. package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +2 -0
  49. package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +5 -0
  50. package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +2 -1
  51. package/dist/lib/types/components.d.ts +132 -0
  52. package/package.json +2 -2
  53. package/dist/lib/apollo-super-selection/p-4eccef5e.entry.js +0 -14
  54. package/dist/lib/apollo-super-selection/p-51445515.system.entry.js +0 -69
  55. package/dist/lib/esm-es5/sss-button_30.entry.js +0 -69
@@ -0,0 +1,217 @@
1
+ import { Component, h, Prop, State } from '@stencil/core';
2
+ import customFundChoiceApi from '../funds/custom-fund/api/custom-fund-choice.api';
3
+ import { EventTrackingService } from '../services/event-tracking.service';
4
+ import navigationService from '../services/navigation.service';
5
+ import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
6
+ import superSelectionAppService from '../services/super-selection-app.service';
7
+ import { DisabledField, Header, isNullOrWhitespace, Style } from './prefill-common';
8
+ import { FundName, FundUsi, MemberGivenNames, MemberLastName, MemberNumber, NAME_PATTERN } from './prefill-types';
9
+ export class PrefillMyOwnFund {
10
+ constructor() {
11
+ this.mode = 'review';
12
+ this.formState = 'pristine';
13
+ this.isSubmitDisabled = true;
14
+ this.eventTrackingService = EventTrackingService.Instance;
15
+ this.createSuperFundPrefillDeclinedDetail = (prefill) => {
16
+ return {
17
+ fundType: 'My Own Fund',
18
+ isUsiValid: prefill.fundDetail.type === 'Valid',
19
+ isMemberNumberPresent: !isNullOrWhitespace(prefill.memberNumber),
20
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
21
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
22
+ };
23
+ };
24
+ this.createSuperFundPrefillViewedDetail = (prefill) => {
25
+ return {
26
+ fundType: 'My Own Fund',
27
+ isUsiValid: prefill.fundDetail.type === 'Valid',
28
+ isMemberNumberPresent: !isNullOrWhitespace(prefill.memberNumber),
29
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
30
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
31
+ };
32
+ };
33
+ }
34
+ componentDidLoad() {
35
+ const detail = this.createSuperFundPrefillViewedDetail(this.prefill);
36
+ return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(detail);
37
+ }
38
+ async componentWillLoad() {
39
+ if (this.prefill && this.prefill.fundDetail.type === 'Valid') {
40
+ this.initialiseComponent(this.prefill.fundDetail.fundName, this.prefill);
41
+ }
42
+ else {
43
+ // If prefill does not exist, or is invalid we should
44
+ // not have landed on this page, navigate to consent page
45
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ConsentPage);
46
+ }
47
+ }
48
+ render() {
49
+ const errorMessages = [
50
+ this.memberNumber.errorMessage,
51
+ this.memberLastName.errorMessage,
52
+ this.memberGivenNames.errorMessage
53
+ ].filter((err) => err !== null);
54
+ return (h("div", null,
55
+ h(Header, null),
56
+ h("div", { class: "flex flex-col items-center gap-8 mt-8 sm:mt-12" },
57
+ h("div", { class: "flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg" },
58
+ h("div", { class: "flex flex-col items-start gap-3.5 self-stretch" },
59
+ h("div", { class: "self-stretch text-grey-900 text-lg not-italic font-bold leading-7" }, "Your fund details"),
60
+ h("sss-prefill-warning-box", { class: "self-stretch", notificationList: [
61
+ 'Make sure you are a current member of the fund before completing this step.',
62
+ 'Please check that the fund USI is correct as some funds have similar names.'
63
+ ] }),
64
+ this.mode === 'review' && errorMessages.length > 0 && (h("sss-prefill-error-box", { class: "self-stretch", notificationList: errorMessages, withHeader: true })),
65
+ this.mode === 'review' && (h("div", { class: "flex flex-col gap-3 self-stretch mt-4" },
66
+ h("sss-prefill-display-field", { field: this.fundUsi }),
67
+ h("sss-prefill-display-field", { field: this.fundName }),
68
+ h("sss-prefill-display-field", { field: this.memberNumber }),
69
+ h("sss-prefill-display-field", { field: this.memberLastName }),
70
+ h("sss-prefill-display-field", { field: this.memberGivenNames }))),
71
+ this.mode === 'review' && (h("sss-button", { class: "self-stretch", fillWidth: true, variant: "light", promiseFn: () => this.setModeToEdit() },
72
+ h("div", { class: "flex flex-row gap-2" },
73
+ h("div", { class: "text-sm not-italic font-medium leading-4" }, "Edit details"),
74
+ h("div", { class: "w-4 h-4 relative" },
75
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "currentColor" },
76
+ h("path", { d: "M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z" }),
77
+ h("path", { d: "M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z" })))))),
78
+ this.mode === 'edit' && (h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: { 'was-validated': this.formState === 'validated' }, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = this.formHasMissingData()) },
79
+ DisabledField(this.fundName.name, this.fundName.value),
80
+ DisabledField(this.fundUsi.name, this.fundUsi.value),
81
+ h("div", { class: "mt-3" },
82
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberNumber.name),
83
+ h("div", { class: "mt-1" },
84
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: "[A-Za-z0-9]{4,16}", value: this.memberNumber.value, onInput: (ev) => {
85
+ this.updateMemberNumber(ev.target.value);
86
+ } }),
87
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberNumber.errorMessage))),
88
+ h("div", { class: "flex gap-x-4 flex-col sm:flex-row" },
89
+ h("div", { class: "mt-3 w-full sm:w-1/2" },
90
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberGivenNames.name),
91
+ h("div", { class: "mt-1" },
92
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: NAME_PATTERN, value: this.memberGivenNames.value, onInput: (ev) => {
93
+ this.updateMemberGivenNames(ev.target.value);
94
+ } }),
95
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberGivenNames.errorMessage))),
96
+ h("div", { class: "mt-3 w-full sm:w-1/2" },
97
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberLastName.name),
98
+ h("div", { class: "mt-1" },
99
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: NAME_PATTERN, value: this.memberLastName.value, onInput: (ev) => {
100
+ this.updateMemberLastName(ev.target.value);
101
+ } }),
102
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberLastName.errorMessage)))))))),
103
+ h("div", { class: "flex w-80 flex-col items-start gap-4" },
104
+ h("sss-button", { class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
105
+ h("sss-button", { class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")))));
106
+ }
107
+ initialiseComponent(fundName, prefill) {
108
+ this.fundUsi = new FundUsi(prefill.fundDetail.fundUsi, true);
109
+ this.fundName = new FundName(fundName, true);
110
+ this.memberNumber = new MemberNumber(prefill.memberNumber);
111
+ this.memberGivenNames = new MemberGivenNames(prefill.memberFirstName);
112
+ this.memberLastName = new MemberLastName(prefill.memberFamilyName);
113
+ this.isSubmitDisabled = this.formHasMissingData();
114
+ }
115
+ isFormValid() {
116
+ return (this.fundUsi.isValid &&
117
+ this.fundName.isValid &&
118
+ this.memberNumber.isValid &&
119
+ this.memberGivenNames.isValid &&
120
+ this.memberLastName.isValid);
121
+ }
122
+ formHasMissingData() {
123
+ return (this.fundUsi.isEmpty ||
124
+ this.fundName.isEmpty ||
125
+ this.memberNumber.isEmpty ||
126
+ this.memberGivenNames.isEmpty ||
127
+ this.memberLastName.isEmpty);
128
+ }
129
+ setModeToEdit() {
130
+ this.mode = 'edit';
131
+ return Promise.resolve();
132
+ }
133
+ updateMemberNumber(memberNumber) {
134
+ this.memberNumber = new MemberNumber(memberNumber.trim());
135
+ }
136
+ updateMemberGivenNames(memberGivenNames) {
137
+ this.memberGivenNames = new MemberGivenNames(memberGivenNames.trimStart());
138
+ }
139
+ updateMemberLastName(memberLastName) {
140
+ this.memberLastName = new MemberLastName(memberLastName.trim());
141
+ }
142
+ async handleSubmitForm() {
143
+ this.formState = 'validated';
144
+ if (!this.isFormValid()) {
145
+ return;
146
+ }
147
+ if (this.mode === 'edit' && !this.formElement.checkValidity()) {
148
+ return;
149
+ }
150
+ navigationService.navigateInternallyToStandardChoice({
151
+ history: this.history,
152
+ fundName: this.fundName.value,
153
+ handleSubmitFn: async (standardChoiceFormSignature) => {
154
+ const customFundChoiceDto = Object.assign({ fundUsi: this.fundUsi.value, memberNumber: this.memberNumber.value, memberFirstName: this.memberGivenNames.value, memberFamilyName: this.memberLastName.value, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
155
+ await customFundChoiceApi.submitCustomFundChoiceAsync(customFundChoiceDto);
156
+ }
157
+ });
158
+ }
159
+ async handleFundNominationDeclined() {
160
+ const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
161
+ await this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(detail);
162
+ return navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ConsentPage);
163
+ }
164
+ static get is() { return "sss-prefill-my-own-fund"; }
165
+ static get properties() { return {
166
+ "history": {
167
+ "type": "unknown",
168
+ "mutable": false,
169
+ "complexType": {
170
+ "original": "RouterHistory",
171
+ "resolved": "RouterHistory",
172
+ "references": {
173
+ "RouterHistory": {
174
+ "location": "import",
175
+ "path": "@stencil/router"
176
+ }
177
+ }
178
+ },
179
+ "required": false,
180
+ "optional": false,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": ""
184
+ }
185
+ },
186
+ "prefill": {
187
+ "type": "unknown",
188
+ "mutable": false,
189
+ "complexType": {
190
+ "original": "PrefillOwnFundChoiceDto",
191
+ "resolved": "{ fundDetail: { type: \"Valid\"; fundUsi: string; fundName: string; } | { type: \"Invalid\"; fundUsi: string; }; memberNumber: string | null; memberFirstName: string | null; memberFamilyName: string | null; }",
192
+ "references": {
193
+ "PrefillOwnFundChoiceDto": {
194
+ "location": "import",
195
+ "path": "../api/super-selection.api.dto"
196
+ }
197
+ }
198
+ },
199
+ "required": false,
200
+ "optional": false,
201
+ "docs": {
202
+ "tags": [],
203
+ "text": ""
204
+ }
205
+ }
206
+ }; }
207
+ static get states() { return {
208
+ "mode": {},
209
+ "formState": {},
210
+ "isSubmitDisabled": {},
211
+ "fundUsi": {},
212
+ "fundName": {},
213
+ "memberNumber": {},
214
+ "memberGivenNames": {},
215
+ "memberLastName": {}
216
+ }; }
217
+ }
@@ -0,0 +1,355 @@
1
+ import { Component, h, Prop, State } from '@stencil/core';
2
+ import customFundChoiceApi from '../funds/custom-fund/api/custom-fund-choice.api';
3
+ import { EventTrackingService } from '../services/event-tracking.service';
4
+ import navigationService from '../services/navigation.service';
5
+ import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
6
+ import superSelectionAppService from '../services/super-selection-app.service';
7
+ import { DisabledField, Header, isNullOrWhitespace, Style } from './prefill-common';
8
+ import { BankAccountBsb, BankAccountName, BankAccountNumber, FundAbn, FundAddress, FundAddressCity, FundAddressLine1, FundAddressLine2, FundAddressPostcode, FundAddressState, FundEsa, MemberGivenNames, MemberLastName, SmsfFundName } from './prefill-types';
9
+ export class PrefillSMSF {
10
+ constructor() {
11
+ this.mode = 'review';
12
+ this.formState = 'pristine';
13
+ this.isSubmitDisabled = true;
14
+ this.eventTrackingService = EventTrackingService.Instance;
15
+ this.createSuperFundPrefillDeclinedDetail = (prefill) => {
16
+ return {
17
+ fundType: 'SMSF',
18
+ isAbnValid: prefill.fundAbn.valid,
19
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
20
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
21
+ };
22
+ };
23
+ this.createSuperFundPrefillViewedDetail = (prefill) => {
24
+ return {
25
+ fundType: 'SMSF',
26
+ isAbnValid: prefill.fundAbn.valid,
27
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
28
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
29
+ };
30
+ };
31
+ }
32
+ componentDidLoad() {
33
+ const detail = this.createSuperFundPrefillViewedDetail(this.prefill);
34
+ return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(detail);
35
+ }
36
+ async componentWillLoad() {
37
+ if (this.prefill && this.prefill.fundAbn.valid) {
38
+ this.initialiseComponent(this.prefill);
39
+ }
40
+ else {
41
+ // If prefill does not exist, or is invalid we should
42
+ // not have landed on this page, navigate to consent page
43
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.PrefillInvalidMyOwnFundPage);
44
+ }
45
+ }
46
+ render() {
47
+ const errorMessages = [
48
+ this.fundName.errorMessage,
49
+ this.fundEsa.errorMessage,
50
+ this.fundAddressLine1.errorMessage,
51
+ this.fundAddressLine2.errorMessage,
52
+ this.fundAddressCity.errorMessage,
53
+ this.fundAddressPostcode.errorMessage,
54
+ this.fundAddressState.errorMessage,
55
+ this.memberLastName.errorMessage,
56
+ this.memberGivenNames.errorMessage,
57
+ this.bankAccountName.errorMessage,
58
+ this.bankAccountBsb.errorMessage,
59
+ this.bankAccountNumber.errorMessage
60
+ ].filter((err) => err !== null);
61
+ return (h("div", null,
62
+ h(Header, null),
63
+ h("div", { class: "flex flex-col items-center gap-8 mt-8 sm:mt-12" },
64
+ h("div", { class: "flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg" },
65
+ h("div", { class: "flex flex-col items-start gap-3 self-stretch" },
66
+ h("div", { class: "self-stretch text-grey-900 text-lg not-italic font-bold leading-7" }, "Your self-managed super fund (SMSF) details"),
67
+ h("sss-prefill-warning-box", { class: "self-stretch", notificationList: [
68
+ 'Make sure your Self-managed super fund (SMSF) is a registered fund before completing this step.'
69
+ ] }),
70
+ this.mode === 'review' && errorMessages.length > 0 && (h("sss-prefill-error-box", { class: "self-stretch", notificationList: errorMessages, withHeader: true })),
71
+ this.mode === 'review' && (h("div", { class: "flex flex-col gap-3 self-stretch mt-4" },
72
+ h("sss-prefill-display-field", { field: this.fundName }),
73
+ h("sss-prefill-display-field", { field: this.fundAbn }),
74
+ h("sss-prefill-display-field", { field: this.fundEsa }),
75
+ h("sss-prefill-display-field", { field: this.fundAddress }),
76
+ h("sss-prefill-display-field", { field: this.memberLastName }),
77
+ h("sss-prefill-display-field", { field: this.memberGivenNames }),
78
+ h("sss-prefill-display-field", { field: this.bankAccountName }),
79
+ h("sss-prefill-display-field", { field: this.bankAccountBsb }),
80
+ h("sss-prefill-display-field", { field: this.bankAccountNumber }))),
81
+ this.mode === 'review' && (h("sss-button", { class: "self-stretch", fillWidth: true, variant: "light", promiseFn: () => this.setModeToEdit() },
82
+ h("div", { class: "flex flex-row gap-2" },
83
+ h("div", { class: "text-sm not-italic font-medium leading-4" }, "Edit details"),
84
+ h("div", { class: "w-4 h-4 relative" },
85
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "currentColor" },
86
+ h("path", { d: "M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z" }),
87
+ h("path", { d: "M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z" })))))),
88
+ this.mode === 'edit' && (h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: { 'was-validated': this.formState === 'validated' }, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = this.formHasMissingData()) },
89
+ h("div", { class: "mt-3" },
90
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.fundName.name),
91
+ h("div", { class: "mt-1" },
92
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, value: this.fundName.value, onInput: (ev) => {
93
+ this.updateFundName(ev.target.value);
94
+ } }),
95
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.fundName.errorMessage))),
96
+ DisabledField(this.fundAbn.name, this.fundAbn.value),
97
+ h("div", { class: "mt-3" },
98
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.fundEsa.name),
99
+ h("div", { class: "mt-1" },
100
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, minlength: "2", value: this.fundEsa.value, onInput: (ev) => {
101
+ this.updateFundEsa(ev.target.value);
102
+ } }),
103
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.fundEsa.errorMessage))),
104
+ h("div", { class: "mt-3" },
105
+ h("label", { class: "text-sm font-medium text-gray-700" }, "Fund address"),
106
+ h("div", { class: "mt-1 rounded-md shadow-sm -space-y-px" },
107
+ h("input", { placeholder: "Address line 1", type: "text", class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none rounded-t-md shadow-none': true }), required: true, minlength: "2", name: "addressLine1", id: "addressLine1", value: this.fundAddressLine1.value, onChange: (ev) => {
108
+ this.updateAddressLine1(ev.target.value);
109
+ } }),
110
+ h("input", { placeholder: "Address line 2 (optional)", type: "text", class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none shadow-none': true }), value: this.fundAddressLine2.value, onChange: (ev) => this.updateAddressLine2(ev.target.value) }),
111
+ h("input", { placeholder: "City/suburb", type: "text", class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none shadow-none': true }), required: true, value: this.fundAddressCity.value, onChange: (ev) => {
112
+ this.updateAddressCity(ev.target.value);
113
+ } }),
114
+ h("div", { class: "flex -space-x-px" },
115
+ h("div", { class: "w-1/2 flex-1 min-w-0" },
116
+ h("input", { placeholder: "Postcode", type: "text", required: true, class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none rounded-bl-md shadow-none': true }), name: "postcode", minlength: "4", maxlength: "4", pattern: "[0-9]{4}", id: "postcode", value: this.fundAddressPostcode.value, inputmode: "numeric", onChange: (ev) => {
117
+ this.updateAddressPostcode(ev.target.value);
118
+ } })),
119
+ h("div", { class: "flex-1 min-w-0" },
120
+ h("select", { class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none rounded-br-md shadow-none': true, 'text-gray-500': this.formState !== 'validated' }), name: "state", required: true, id: "state", onChange: (ev) => {
121
+ this.updateAddressState(ev.target.value);
122
+ } },
123
+ h("option", { disabled: true, selected: this.fundAddressState.value !== undefined, value: "" }, "State"),
124
+ this.fundAddressState.options.map((s) => (h("option", { value: s.value, selected: this.fundAddressState.value === s.value }, s.label))))))),
125
+ this.formState === 'validated' && (h("div", { class: "mt-2 text-sm text-red-600" }, this.fundAddressLine1.errorMessage ||
126
+ this.fundAddressLine1.errorMessage ||
127
+ this.fundAddressCity.errorMessage ||
128
+ this.fundAddressPostcode.errorMessage ||
129
+ this.fundAddressState.errorMessage))),
130
+ h("div", { class: "flex gap-x-4 flex-col sm:flex-row" },
131
+ h("div", { class: "mt-3 w-full sm:w-1/2" },
132
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberGivenNames.name),
133
+ h("div", { class: "mt-1" },
134
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, value: this.memberGivenNames.value, onInput: (ev) => {
135
+ this.updateMemberGivenNames(ev.target.value);
136
+ } }),
137
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberGivenNames.errorMessage))),
138
+ h("div", { class: "mt-3 w-full sm:w-1/2" },
139
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberLastName.name),
140
+ h("div", { class: "mt-1" },
141
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, value: this.memberLastName.value, onInput: (ev) => {
142
+ this.updateMemberLastName(ev.target.value);
143
+ } }),
144
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberLastName.errorMessage)))),
145
+ h("div", { class: "mt-3" },
146
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.bankAccountName.name),
147
+ h("div", { class: "mt-1" },
148
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, value: this.bankAccountName.value, onInput: (ev) => {
149
+ this.updateBankAccountName(ev.target.value);
150
+ } }),
151
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.bankAccountName.errorMessage))),
152
+ h("div", { class: "mt-3" },
153
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.bankAccountBsb.name),
154
+ h("div", { class: "mt-1" },
155
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, value: this.bankAccountBsb.value, onInput: (ev) => {
156
+ this.updateBankAccountBsb(ev.target.value);
157
+ } }),
158
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.bankAccountBsb.errorMessage))),
159
+ h("div", { class: "mt-3" },
160
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.bankAccountNumber.name),
161
+ h("div", { class: "mt-1" },
162
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, value: this.bankAccountNumber.value, onInput: (ev) => {
163
+ this.updateBankAccountNumber(ev.target.value);
164
+ } }),
165
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.bankAccountNumber.errorMessage))))))),
166
+ h("div", { class: "flex w-80 flex-col items-start gap-4" },
167
+ h("sss-button", { class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
168
+ h("sss-button", { class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")))));
169
+ }
170
+ isFormValid() {
171
+ return (this.fundName.isValid &&
172
+ this.fundAbn.isValid &&
173
+ this.fundEsa.isValid &&
174
+ this.fundAddressLine1.isValid &&
175
+ this.fundAddressLine2.isValid &&
176
+ this.fundAddressCity.isValid &&
177
+ this.fundAddressPostcode.isValid &&
178
+ this.fundAddressState.isValid &&
179
+ this.memberGivenNames.isValid &&
180
+ this.memberLastName.isValid &&
181
+ this.bankAccountName.isValid &&
182
+ this.bankAccountBsb.isValid &&
183
+ this.bankAccountNumber.isValid);
184
+ }
185
+ formHasMissingData() {
186
+ return (this.fundName.isEmpty ||
187
+ this.fundAbn.isEmpty ||
188
+ this.fundEsa.isEmpty ||
189
+ this.fundAddressLine1.isEmpty ||
190
+ this.fundAddressCity.isEmpty ||
191
+ this.fundAddressPostcode.isEmpty ||
192
+ this.fundAddressState.isEmpty ||
193
+ this.memberGivenNames.isEmpty ||
194
+ this.memberLastName.isEmpty ||
195
+ this.bankAccountName.isEmpty ||
196
+ this.bankAccountBsb.isEmpty ||
197
+ this.bankAccountNumber.isEmpty);
198
+ }
199
+ setModeToEdit() {
200
+ this.mode = 'edit';
201
+ return Promise.resolve();
202
+ }
203
+ updateFundName(fundName) {
204
+ this.fundName = new SmsfFundName(fundName.trim());
205
+ }
206
+ updateFundEsa(fundEda) {
207
+ this.fundEsa = new FundEsa(fundEda.trim());
208
+ }
209
+ updateAddressLine1(value) {
210
+ this.fundAddressLine1 = new FundAddressLine1(value.trim());
211
+ }
212
+ updateAddressLine2(value) {
213
+ this.fundAddressLine2 = new FundAddressLine2(value.trim());
214
+ }
215
+ updateAddressCity(value) {
216
+ this.fundAddressCity = new FundAddressCity(value.trim());
217
+ }
218
+ updateAddressPostcode(value) {
219
+ this.fundAddressPostcode = new FundAddressPostcode(value.trim());
220
+ }
221
+ updateAddressState(value) {
222
+ this.fundAddressState = new FundAddressState(value.trim());
223
+ }
224
+ updateBankAccountName(bankAccountName) {
225
+ this.bankAccountName = new BankAccountName(bankAccountName.trim());
226
+ }
227
+ updateBankAccountBsb(bankAccountBsb) {
228
+ this.bankAccountBsb = new BankAccountBsb(bankAccountBsb.trim());
229
+ }
230
+ updateBankAccountNumber(bankAccountNumber) {
231
+ this.bankAccountNumber = new BankAccountNumber(bankAccountNumber.trim());
232
+ }
233
+ updateMemberGivenNames(memberGivenNames) {
234
+ this.memberGivenNames = new MemberGivenNames(memberGivenNames);
235
+ }
236
+ updateMemberLastName(memberLastName) {
237
+ this.memberLastName = new MemberLastName(memberLastName.trim());
238
+ }
239
+ async handleSubmitForm() {
240
+ this.formState = 'validated';
241
+ if (!this.isFormValid() || !this.formElement.checkValidity()) {
242
+ return;
243
+ }
244
+ navigationService.navigateInternallyToStandardChoice({
245
+ history: this.history,
246
+ fundName: this.fundName.value,
247
+ handleSubmitFn: async (standardChoiceFormSignature) => {
248
+ const smsfChoiceDto = Object.assign({ smsfChoice: {
249
+ abn: this.fundAbn.value,
250
+ fundName: this.fundName.value,
251
+ fundAddress: {
252
+ addressLine1: this.fundAddressLine1.value,
253
+ addressLine2: this.fundAddressLine2.value.trim() === ''
254
+ ? null
255
+ : this.fundAddressLine2.value.trim(),
256
+ city: this.fundAddressCity.value,
257
+ state: this.fundAddressState.value,
258
+ postcode: this.fundAddressPostcode.value
259
+ },
260
+ bsb: this.bankAccountBsb.value,
261
+ bankAccountName: this.bankAccountName.value,
262
+ bankAccountNumber: this.bankAccountNumber.value,
263
+ electronicServiceAddress: this.fundEsa.value,
264
+ memberFirstName: this.memberGivenNames.value,
265
+ memberFamilyName: this.memberLastName.value
266
+ }, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
267
+ await customFundChoiceApi.submitSelfManagedFundChoiceAsync(smsfChoiceDto);
268
+ }
269
+ });
270
+ }
271
+ initialiseComponent(prefill) {
272
+ this.fundName = new SmsfFundName(prefill.fundName);
273
+ this.fundAbn = new FundAbn(prefill.fundAbn.value, prefill.fundAbn.valid);
274
+ this.fundEsa = new FundEsa(prefill.electronicServiceAddress);
275
+ this.fundAddressLine1 = new FundAddressLine1(prefill.addressLine1);
276
+ this.fundAddressLine2 = new FundAddressLine2(prefill.addressLine2);
277
+ this.fundAddressCity = new FundAddressCity(prefill.addressCity);
278
+ this.fundAddressPostcode = new FundAddressPostcode(prefill.addressPostcode);
279
+ this.fundAddressState = new FundAddressState(prefill.addressState);
280
+ this.fundAddress = new FundAddress(this.fundAddressLine1, this.fundAddressLine2, this.fundAddressCity, this.fundAddressState, this.fundAddressPostcode);
281
+ this.memberGivenNames = new MemberGivenNames(prefill.memberFirstName);
282
+ this.memberLastName = new MemberLastName(prefill.memberFamilyName);
283
+ this.bankAccountName = new BankAccountName(prefill.bankAccountName);
284
+ this.bankAccountBsb = new BankAccountBsb(prefill.bankAccountBsb);
285
+ this.bankAccountNumber = new BankAccountNumber(prefill.bankAccountNumber);
286
+ this.isSubmitDisabled = this.formHasMissingData();
287
+ }
288
+ async handleFundNominationDeclined() {
289
+ const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
290
+ await this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(detail);
291
+ return navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ConsentPage);
292
+ }
293
+ static get is() { return "sss-prefill-smsf"; }
294
+ static get properties() { return {
295
+ "history": {
296
+ "type": "unknown",
297
+ "mutable": false,
298
+ "complexType": {
299
+ "original": "RouterHistory",
300
+ "resolved": "RouterHistory",
301
+ "references": {
302
+ "RouterHistory": {
303
+ "location": "import",
304
+ "path": "@stencil/router"
305
+ }
306
+ }
307
+ },
308
+ "required": false,
309
+ "optional": false,
310
+ "docs": {
311
+ "tags": [],
312
+ "text": ""
313
+ }
314
+ },
315
+ "prefill": {
316
+ "type": "unknown",
317
+ "mutable": false,
318
+ "complexType": {
319
+ "original": "PrefillSMSFChoiceDto",
320
+ "resolved": "{ fundAbn: { valid: boolean; value: string; }; fundName: string | null; addressLine1: string | null; addressLine2: string | null; addressCity: string | null; addressState: string | null; addressPostcode: string | null; bankAccountBsb: string | null; bankAccountName: string | null; bankAccountNumber: string | null; electronicServiceAddress: string | null; memberFirstName: string | null; memberFamilyName: string | null; }",
321
+ "references": {
322
+ "PrefillSMSFChoiceDto": {
323
+ "location": "import",
324
+ "path": "../api/super-selection.api.dto"
325
+ }
326
+ }
327
+ },
328
+ "required": false,
329
+ "optional": false,
330
+ "docs": {
331
+ "tags": [],
332
+ "text": ""
333
+ }
334
+ }
335
+ }; }
336
+ static get states() { return {
337
+ "mode": {},
338
+ "formState": {},
339
+ "isSubmitDisabled": {},
340
+ "fundName": {},
341
+ "fundAbn": {},
342
+ "fundEsa": {},
343
+ "fundAddressLine1": {},
344
+ "fundAddressLine2": {},
345
+ "fundAddressCity": {},
346
+ "fundAddressPostcode": {},
347
+ "fundAddressState": {},
348
+ "fundAddress": {},
349
+ "memberGivenNames": {},
350
+ "memberLastName": {},
351
+ "bankAccountName": {},
352
+ "bankAccountBsb": {},
353
+ "bankAccountNumber": {}
354
+ }; }
355
+ }