@flarehr/apollo-super-selection 4.59.46171 → 4.60.46274

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.
@@ -1 +1 @@
1
- System.register(["./p-44bec843.system.js","./p-14885f78.system.js","./p-15f0e5eb.system.js"],(function(e,s){"use strict";var t,i,o;return{setters:[function(e){t=e.p;i=e.b},function(){},function(e){o=e.g}],execute:function(){var e=function(){var e=s.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return t(i)};e().then((function(e){o();return i([["p-6ac8791e.system",[[0,"context-consumer",{context:[16],renderer:[16],subscribe:[16],unsubscribe:[32]}]]],["p-02f24922.system",[[0,"stencil-async-content",{documentLocation:[1,"document-location"],content:[32]}]]],["p-ef3afa00.system",[[0,"stencil-route-title",{titleSuffix:[1,"title-suffix"],pageTitle:[1,"page-title"]}]]],["p-f29066b9.system",[[0,"stencil-router-prompt",{when:[4],message:[1],history:[16],unblock:[32]}]]],["p-51aefdb1.system",[[0,"stencil-router-redirect",{history:[16],root:[1],url:[1]}]]],["p-8c9c7343.system",[[0,"sss-prefill",{history:[16],prefill:[32]}],[0,"sss-my-own-fund",{history:[16],formState:[32],isNotAllInformationProvidedMessageVisible:[32],isSubmitDisabled:[32]}],[0,"sss-self-managed-fund",{history:[16],formState:[32],isSubmitDisabled:[32]}],[0,"sss-super-choice-page",{history:[16],promotedFunds:[32]}],[1,"super-selection-app-host",{sessionState:[32],jwt:[32],appConfiguration:[32],ignoreExistingSelection:[32]}],[0,"sss-default-fund",{history:[16],defaultFundProductName:[32]}],[0,"sss-consent-page",{history:[16],campaignConnectRequestInProgress:[32]}],[0,"sss-existing-choice-page",{history:[16],existingFund:[32]}],[0,"sss-standard-choice-form",{history:[16],standardChoiceFormSignature:[32],formState:[32],isSubmitDisabled:[32]}],[0,"sss-promoted-fund-join-v1-page",{history:[16]}],[0,"sss-promoted-fund-join-v2-page",{history:[16]}],[0,"sss-slate-join-page",{history:[16]}],[0,"sss-success"],[0,"sss-super-campaign-host",{history:[16],componentLoaded:[32],backendUrl:[32],accessToken:[32]}],[0,"sss-prefill-my-own-fund",{history:[16],prefill:[16],mode:[32],formState:[32],isSubmitDisabled:[32],fundUsi:[32],fundName:[32],memberNumber:[32],memberGivenNames:[32],memberLastName:[32]}],[0,"sss-prefill-smsf",{history:[16],prefill:[16],mode:[32],formState:[32],isSubmitDisabled:[32],fundName:[32],fundAbn:[32],fundEsa:[32],fundAddressLine1:[32],fundAddressLine2:[32],fundAddressCity:[32],fundAddressPostcode:[32],fundAddressState:[32],fundAddress:[32],memberGivenNames:[32],memberLastName:[32],bankAccountName:[32],bankName:[32],bankAccountBsb:[32],bankAccountNumber:[32]}],[0,"sss-prefill-invalid-my-own-fund",{history:[16],prefill:[16],fundUsi:[32],fundName:[32],memberNumber:[32],memberGivenNames:[32],memberLastName:[32]}],[0,"sss-prefill-invalid-smsf",{history:[16],prefill:[16],fundName:[32],fundAbn:[32],fundEsa:[32],fundAddressLine1:[32],fundAddressLine2:[32],fundAddressCity:[32],fundAddressPostcode:[32],fundAddressState:[32],fundAddress:[32],memberGivenNames:[32],memberLastName:[32],bankAccountName:[32],bankAccountBsb:[32],bankAccountNumber:[32]}],[1,"super-selection-app",{ignoreExistingSelection:[4,"ignore-existing-selection"],accessToken:[1,"access-token"],backendUrl:[1,"backend-url"],appBaseUrl:[1,"app-base-url"],history:[16],location:[16],isSelfHosted:[4,"is-self-hosted"],isAppInitialised:[32]}],[0,"sss-my-own-fund-inputs",{myOwnFundForm:[16],showValidationErrors:[4,"show-validation-errors"],selectedOption:[32]}],[0,"sss-loading-super-indicator"],[0,"sss-self-managed-fund-inputs",{fundForm:[16],showValidationErrors:[4,"show-validation-errors"],isAbnValid:[32],isAbnTouched:[32],isAbnUsedForRegulated:[32],currentBank:[32],addressErrorMessage:[32]}],[0,"sss-super-choice-item-bottom",{disclaimer:[16],abnInfo:[1,"abn-info"],abn:[1],isMultiFund:[4,"is-multi-fund"]}],[0,"sss-loading-page"],[0,"sss-super-choice-item-top",{name:[1],logo:[1],features:[16],featureSubText:[16],customContent:[16],isMultiFund:[4,"is-multi-fund"],isPromotedDefault:[4,"is-promoted-default"],extraBadge:[16]}],[4,"sss-loading-component",{header:[1]}],[0,"sss-dropdown-async",{placeholder:[1],searchFunction:[16],value:[16],required:[4],requiredValidationMessage:[1,"required-validation-message"],disabled:[4],minSearchStringLength:[2,"min-search-string-length"],showValidationErrors:[4,"show-validation-errors"],searchState:[32],inputValue:[32],isDropdownVisible:[32],filteredOptions:[32],highlightedOptionIndex:[32],selectedOption:[32]},[[2,"focus","handleFocus"],[2,"blur","handleBlur"],[2,"keydown","handleKeyDown"]]],[0,"sss-footer-section",{textOverride:[16]}],[4,"stencil-route-switch",{group:[513],scrollTopOffset:[2,"scroll-top-offset"],location:[16],routeViewsUpdated:[16]}],[4,"stencil-router",{root:[1],historyType:[1,"history-type"],titleSuffix:[1,"title-suffix"],scrollTopOffset:[2,"scroll-top-offset"],location:[32],history:[32]}],[4,"sss-custom-fund",{history:[16],currentCustomFund:[32],fundOptionsList:[32],showFundOptionsSelection:[32]}],[0,"sss-iframe-host",{build:[16]}],[0,"sss-prefill-warning-box",{notificationList:[16]}],[0,"sss-header-section",{currentPage:[1,"current-page"]}],[0,"sss-name-input",{value:[1],name:[1],readableName:[1,"readable-name"],showValidationErrors:[4,"show-validation-errors"],errorMessage:[32]}],[0,"sss-prefill-display-field",{field:[16]}],[0,"sss-prefill-error-box",{withHeader:[4,"with-header"],notificationList:[16]}],[4,"stencil-route-link",{url:[1],urlMatch:[1,"url-match"],activeClass:[1,"active-class"],exact:[4],strict:[4],custom:[1],anchorClass:[1,"anchor-class"],anchorRole:[1,"anchor-role"],anchorTitle:[1,"anchor-title"],anchorTabIndex:[1,"anchor-tab-index"],anchorId:[1,"anchor-id"],history:[16],location:[16],root:[1],ariaHaspopup:[1,"aria-haspopup"],ariaPosinset:[1,"aria-posinset"],ariaSetsize:[2,"aria-setsize"],ariaLabel:[1,"aria-label"],match:[32]}],[4,"sss-button",{fillWidth:[4,"fill-width"],fillWidthOnMobile:[4,"fill-width-on-mobile"],disabled:[4],variant:[1],size:[1],promiseFn:[16],state:[32]}],[0,"sss-loading-indicator",{theme:[1],size:[2]}],[0,"stencil-route",{group:[513],componentUpdated:[16],match:[1040],url:[1],component:[1],componentProps:[16],exact:[4],routeRender:[16],scrollTopOffset:[2,"scroll-top-offset"],routeViewsUpdated:[16],location:[16],history:[16],historyType:[1,"history-type"]}]]]],e)}))}}}));
1
+ System.register(["./p-44bec843.system.js","./p-14885f78.system.js","./p-15f0e5eb.system.js"],(function(e,s){"use strict";var t,i,o;return{setters:[function(e){t=e.p;i=e.b},function(){},function(e){o=e.g}],execute:function(){var e=function(){var e=s.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return t(i)};e().then((function(e){o();return i([["p-6ac8791e.system",[[0,"context-consumer",{context:[16],renderer:[16],subscribe:[16],unsubscribe:[32]}]]],["p-02f24922.system",[[0,"stencil-async-content",{documentLocation:[1,"document-location"],content:[32]}]]],["p-ef3afa00.system",[[0,"stencil-route-title",{titleSuffix:[1,"title-suffix"],pageTitle:[1,"page-title"]}]]],["p-f29066b9.system",[[0,"stencil-router-prompt",{when:[4],message:[1],history:[16],unblock:[32]}]]],["p-51aefdb1.system",[[0,"stencil-router-redirect",{history:[16],root:[1],url:[1]}]]],["p-89bdba34.system",[[0,"sss-prefill",{history:[16],prefill:[32]}],[0,"sss-my-own-fund",{history:[16],formState:[32],isNotAllInformationProvidedMessageVisible:[32],isSubmitDisabled:[32]}],[0,"sss-self-managed-fund",{history:[16],formState:[32],isSubmitDisabled:[32]}],[0,"sss-super-choice-page",{history:[16],promotedFunds:[32]}],[1,"super-selection-app-host",{sessionState:[32],jwt:[32],appConfiguration:[32],ignoreExistingSelection:[32]}],[0,"sss-default-fund",{history:[16],defaultFundProductName:[32]}],[0,"sss-consent-page",{history:[16],campaignConnectRequestInProgress:[32]}],[0,"sss-existing-choice-page",{history:[16],existingFund:[32]}],[0,"sss-standard-choice-form",{history:[16],standardChoiceFormSignature:[32],formState:[32],isSubmitDisabled:[32]}],[0,"sss-promoted-fund-join-v1-page",{history:[16]}],[0,"sss-promoted-fund-join-v2-page",{history:[16]}],[0,"sss-slate-join-page",{history:[16]}],[0,"sss-success"],[0,"sss-super-campaign-host",{history:[16],componentLoaded:[32],backendUrl:[32],accessToken:[32]}],[0,"sss-prefill-my-own-fund",{history:[16],prefill:[16],mode:[32],formState:[32],isSubmitDisabled:[32],fundUsi:[32],fundName:[32],memberNumber:[32],memberGivenNames:[32],memberLastName:[32]}],[0,"sss-prefill-smsf",{history:[16],prefill:[16],mode:[32],formState:[32],isSubmitDisabled:[32],fundName:[32],fundAbn:[32],fundEsa:[32],fundAddressLine1:[32],fundAddressLine2:[32],fundAddressCity:[32],fundAddressPostcode:[32],fundAddressState:[32],fundAddress:[32],memberGivenNames:[32],memberLastName:[32],bankAccountName:[32],bankName:[32],bankAccountBsb:[32],bankAccountNumber:[32]}],[0,"sss-prefill-invalid-my-own-fund",{history:[16],prefill:[16],fundUsi:[32],fundName:[32],memberNumber:[32],memberGivenNames:[32],memberLastName:[32]}],[0,"sss-prefill-invalid-smsf",{history:[16],prefill:[16],fundName:[32],fundAbn:[32],fundEsa:[32],fundAddressLine1:[32],fundAddressLine2:[32],fundAddressCity:[32],fundAddressPostcode:[32],fundAddressState:[32],fundAddress:[32],memberGivenNames:[32],memberLastName:[32],bankAccountName:[32],bankAccountBsb:[32],bankAccountNumber:[32]}],[1,"super-selection-app",{ignoreExistingSelection:[4,"ignore-existing-selection"],accessToken:[1,"access-token"],backendUrl:[1,"backend-url"],appBaseUrl:[1,"app-base-url"],history:[16],location:[16],isSelfHosted:[4,"is-self-hosted"],isAppInitialised:[32]}],[0,"sss-my-own-fund-inputs",{myOwnFundForm:[16],showValidationErrors:[4,"show-validation-errors"],selectedOption:[32]}],[0,"sss-loading-super-indicator"],[0,"sss-self-managed-fund-inputs",{fundForm:[16],showValidationErrors:[4,"show-validation-errors"],isAbnValid:[32],isAbnTouched:[32],isAbnUsedForRegulated:[32],currentBank:[32],addressErrorMessage:[32]}],[0,"sss-super-choice-item-bottom",{disclaimer:[16],abnInfo:[1,"abn-info"],abn:[1],isMultiFund:[4,"is-multi-fund"]}],[0,"sss-loading-page"],[0,"sss-super-choice-item-top",{name:[1],logo:[1],features:[16],featureSubText:[16],customContent:[16],isMultiFund:[4,"is-multi-fund"],isPromotedDefault:[4,"is-promoted-default"],extraBadge:[16]}],[4,"sss-loading-component",{header:[1]}],[0,"sss-dropdown-async",{placeholder:[1],searchFunction:[16],value:[16],required:[4],requiredValidationMessage:[1,"required-validation-message"],disabled:[4],minSearchStringLength:[2,"min-search-string-length"],showValidationErrors:[4,"show-validation-errors"],searchState:[32],inputValue:[32],isDropdownVisible:[32],filteredOptions:[32],highlightedOptionIndex:[32],selectedOption:[32]},[[2,"focus","handleFocus"],[2,"blur","handleBlur"],[2,"keydown","handleKeyDown"]]],[0,"sss-footer-section",{textOverride:[16]}],[4,"stencil-route-switch",{group:[513],scrollTopOffset:[2,"scroll-top-offset"],location:[16],routeViewsUpdated:[16]}],[4,"stencil-router",{root:[1],historyType:[1,"history-type"],titleSuffix:[1,"title-suffix"],scrollTopOffset:[2,"scroll-top-offset"],location:[32],history:[32]}],[4,"sss-custom-fund",{history:[16],currentCustomFund:[32],fundOptionsList:[32],showFundOptionsSelection:[32]}],[0,"sss-iframe-host",{build:[16]}],[0,"sss-prefill-warning-box",{notificationList:[16]}],[0,"sss-header-section",{currentPage:[1,"current-page"]}],[0,"sss-name-input",{value:[1],name:[1],readableName:[1,"readable-name"],showValidationErrors:[4,"show-validation-errors"],errorMessage:[32]}],[0,"sss-prefill-display-field",{field:[16]}],[0,"sss-prefill-error-box",{withHeader:[4,"with-header"],notificationList:[16]}],[4,"stencil-route-link",{url:[1],urlMatch:[1,"url-match"],activeClass:[1,"active-class"],exact:[4],strict:[4],custom:[1],anchorClass:[1,"anchor-class"],anchorRole:[1,"anchor-role"],anchorTitle:[1,"anchor-title"],anchorTabIndex:[1,"anchor-tab-index"],anchorId:[1,"anchor-id"],history:[16],location:[16],root:[1],ariaHaspopup:[1,"aria-haspopup"],ariaPosinset:[1,"aria-posinset"],ariaSetsize:[2,"aria-setsize"],ariaLabel:[1,"aria-label"],match:[32]}],[4,"sss-button",{fillWidth:[4,"fill-width"],fillWidthOnMobile:[4,"fill-width-on-mobile"],disabled:[4],variant:[1],size:[1],promiseFn:[16],state:[32]}],[0,"sss-loading-indicator",{theme:[1],size:[2]}],[0,"stencil-route",{group:[513],componentUpdated:[16],match:[1040],url:[1],component:[1],componentProps:[16],exact:[4],routeRender:[16],scrollTopOffset:[2,"scroll-top-offset"],routeViewsUpdated:[16],location:[16],history:[16],historyType:[1,"history-type"]}]]]],e)}))}}}));
@@ -284,7 +284,7 @@ class TapSubscriber extends datoramaAkita.Subscriber {
284
284
  }
285
285
  }
286
286
 
287
- const AppVersion = '4.59.46171';
287
+ const AppVersion = '4.60.46274';
288
288
 
289
289
  // -------------------------------------------------------------------------------------
290
290
  // guards
@@ -3521,14 +3521,17 @@ class SuperSelectionApi {
3521
3521
  const superSelectionApi = new SuperSelectionApi();
3522
3522
 
3523
3523
  class SuperCampaignState {
3524
- constructor(funds) {
3525
- this.promotedFundsShown = funds;
3524
+ constructor() {
3525
+ this._promotedFundsShown = [];
3526
3526
  }
3527
3527
  get PromotedFundIds() {
3528
- return this.promotedFundsShown.map((p) => p.fundId);
3528
+ return this._promotedFundsShown.map((p) => p.fundId);
3529
+ }
3530
+ set promotedFundsShown(value) {
3531
+ this._promotedFundsShown = value;
3529
3532
  }
3530
3533
  get DefaultFundPosition() {
3531
- this.promotedFundsShown.filter((value, index) => {
3534
+ this._promotedFundsShown.filter((value, index) => {
3532
3535
  if (value.fundType == 'promoted-default') {
3533
3536
  return index;
3534
3537
  }
@@ -3688,11 +3691,17 @@ class SuperSelectionAppService {
3688
3691
  }
3689
3692
  }
3690
3693
  setSuperCampaignPromotedFundsShown(shownFunds) {
3691
- this._state.superCampaignState = new SuperCampaignState(shownFunds);
3694
+ if (this._state.superCampaignState !== undefined)
3695
+ this._state.superCampaignState.promotedFundsShown = shownFunds;
3696
+ else
3697
+ throw new Error('Cannot set shown funds for SuperCampaing state because it is undefined');
3692
3698
  }
3693
3699
  get superCampaignState() {
3694
3700
  return this._state.superCampaignState;
3695
3701
  }
3702
+ initializeSuperCampaignState(value) {
3703
+ this._state.superCampaignState = value;
3704
+ }
3696
3705
  get isUsingSuperCampaign() {
3697
3706
  return this.state.superCampaignEnabled && this.superCampaignState !== undefined;
3698
3707
  }
@@ -16887,16 +16896,19 @@ const SuperCampaignHost = class {
16887
16896
  document.removeEventListener(eventName, this.superCampaignEventHandlers[eventName]);
16888
16897
  }
16889
16898
  };
16899
+ this.superCampaignLoaded = async (event) => {
16900
+ if (event.detail.sender == 'super-campaign') {
16901
+ superSelectionAppService.initializeSuperCampaignState(new SuperCampaignState());
16902
+ }
16903
+ return Promise.resolve();
16904
+ };
16890
16905
  this.chooseAnotherFundRequested = async (event) => {
16891
16906
  if (event.detail.sender == 'super-campaign') {
16892
16907
  await navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFund);
16893
16908
  }
16894
16909
  };
16895
16910
  this.fundPanelShown = async (event) => {
16896
- var _a;
16897
16911
  if (event.detail.sender == 'super-campaign') {
16898
- // eslint-disable-next-line no-console
16899
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16900
16912
  const promotedFundsShown = event.detail.shownFunds.map((f) => f.fundId);
16901
16913
  superSelectionAppService.setSuperCampaignPromotedFundsShown(event.detail.shownFunds);
16902
16914
  await EventTrackingService.Instance.TrackSuperFundPanelViewedAsync({
@@ -16907,17 +16919,15 @@ const SuperCampaignHost = class {
16907
16919
  }
16908
16920
  };
16909
16921
  this.fundTileClicked = async (event) => {
16910
- var _a, _b, _c;
16922
+ var _a, _b;
16911
16923
  const eventDetails = event.detail;
16912
16924
  if (eventDetails.sender == 'super-campaign') {
16913
- // eslint-disable-next-line no-console
16914
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16915
16925
  const promotedFundsShown = this.SuperCampaignState.PromotedFundIds;
16916
16926
  const defaultFundUsiSet = Option.toUndefined(superSelectionAppService.defaultFundUsi);
16917
16927
  await Promise.all([
16918
16928
  eventDetails.fundType == 'promoted-default'
16919
16929
  ? await EventTrackingService.Instance.TrackPromotedDefaultSuperFundDetailViewedAsync({
16920
- fundUsi: (_b = eventDetails.fundUsi) !== null && _b !== void 0 ? _b : '',
16930
+ fundUsi: (_a = eventDetails.fundUsi) !== null && _a !== void 0 ? _a : '',
16921
16931
  fundName: eventDetails.fundName,
16922
16932
  promotedFundId: eventDetails.fundId,
16923
16933
  promotedFundsShown,
@@ -16925,7 +16935,7 @@ const SuperCampaignHost = class {
16925
16935
  superCampaignEnabled: true
16926
16936
  })
16927
16937
  : await EventTrackingService.Instance.TrackPromotedSuperFundDetailViewedAsync({
16928
- fundUsi: (_c = eventDetails.fundUsi) !== null && _c !== void 0 ? _c : undefined,
16938
+ fundUsi: (_b = eventDetails.fundUsi) !== null && _b !== void 0 ? _b : undefined,
16929
16939
  fundName: eventDetails.fundName,
16930
16940
  promotedFundId: eventDetails.fundId,
16931
16941
  promotedFundsShown,
@@ -16947,10 +16957,7 @@ const SuperCampaignHost = class {
16947
16957
  }
16948
16958
  };
16949
16959
  this.fundPdsViewed = async (event) => {
16950
- var _a;
16951
16960
  if (event.detail.sender == 'super-campaign') {
16952
- // eslint-disable-next-line no-console
16953
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16954
16961
  await EventTrackingService.Instance.TrackSuperFundPdsViewedAsync({
16955
16962
  fundName: event.detail.fundName,
16956
16963
  fundUsi: event.detail.fundUsi,
@@ -16960,28 +16967,19 @@ const SuperCampaignHost = class {
16960
16967
  }
16961
16968
  };
16962
16969
  this.disclaimerViewed = async (event) => {
16963
- var _a;
16964
16970
  if (event.detail.sender == 'super-campaign') {
16965
- // eslint-disable-next-line no-console
16966
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16967
16971
  await EventTrackingService.Instance.TrackSuperFundDisclaimerViewedAsync(SuperFundDisclaimerViewedDetail.create(true));
16968
16972
  }
16969
16973
  };
16970
16974
  this.disclaimerAccepted = async (event) => {
16971
- var _a;
16972
16975
  if (event.detail.sender == 'super-campaign') {
16973
- // eslint-disable-next-line no-console
16974
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16975
16976
  await EventTrackingService.Instance.TrackSuperFundDisclaimerAcceptedAsync({
16976
16977
  superCampaignEnabled: true
16977
16978
  });
16978
16979
  }
16979
16980
  };
16980
16981
  this.promotedFundJoined = async (event) => {
16981
- var _a;
16982
16982
  if (event.detail.sender == 'super-campaign') {
16983
- // eslint-disable-next-line no-console
16984
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16985
16983
  const fundJoinInfo = event.detail.fundJoinInfo;
16986
16984
  switch (fundJoinInfo.fundType) {
16987
16985
  case 'Promoted':
@@ -17097,7 +17095,8 @@ const SuperCampaignHost = class {
17097
17095
  'fund-pds-viewed': this.fundPdsViewed.bind(this),
17098
17096
  'disclaimer-viewed': this.disclaimerViewed.bind(this),
17099
17097
  'disclaimer-accepted': this.disclaimerAccepted.bind(this),
17100
- 'promoted-fund-joined': this.promotedFundJoined.bind(this)
17098
+ 'promoted-fund-joined': this.promotedFundJoined.bind(this),
17099
+ 'super-campaign-loaded': this.superCampaignLoaded.bind(this)
17101
17100
  };
17102
17101
  }
17103
17102
  async componentWillLoad() {
@@ -13,6 +13,7 @@ import slateChoiceApi from '../super-selection-app/funds/slate-super/api/slate-c
13
13
  import { EventTrackingService } from '../super-selection-app/services/event-tracking.service';
14
14
  import miscService from '../super-selection-app/services/misc.service';
15
15
  import navigationService from '../super-selection-app/services/navigation.service';
16
+ import { SuperCampaignState } from '../super-selection-app/services/super-selection.store';
16
17
  import { SuperSelectionAppRoutes } from '../super-selection-app/services/super-selection-app.routes';
17
18
  import superSelectionAppService from '../super-selection-app/services/super-selection-app.service';
18
19
  import { Usi } from './super-campaign-types';
@@ -41,16 +42,19 @@ export class SuperCampaignHost {
41
42
  document.removeEventListener(eventName, this.superCampaignEventHandlers[eventName]);
42
43
  }
43
44
  };
45
+ this.superCampaignLoaded = async (event) => {
46
+ if (event.detail.sender == 'super-campaign') {
47
+ superSelectionAppService.initializeSuperCampaignState(new SuperCampaignState());
48
+ }
49
+ return Promise.resolve();
50
+ };
44
51
  this.chooseAnotherFundRequested = async (event) => {
45
52
  if (event.detail.sender == 'super-campaign') {
46
53
  await navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFund);
47
54
  }
48
55
  };
49
56
  this.fundPanelShown = async (event) => {
50
- var _a;
51
57
  if (event.detail.sender == 'super-campaign') {
52
- // eslint-disable-next-line no-console
53
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
54
58
  const promotedFundsShown = event.detail.shownFunds.map((f) => f.fundId);
55
59
  superSelectionAppService.setSuperCampaignPromotedFundsShown(event.detail.shownFunds);
56
60
  await EventTrackingService.Instance.TrackSuperFundPanelViewedAsync({
@@ -61,17 +65,15 @@ export class SuperCampaignHost {
61
65
  }
62
66
  };
63
67
  this.fundTileClicked = async (event) => {
64
- var _a, _b, _c;
68
+ var _a, _b;
65
69
  const eventDetails = event.detail;
66
70
  if (eventDetails.sender == 'super-campaign') {
67
- // eslint-disable-next-line no-console
68
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
69
71
  const promotedFundsShown = this.SuperCampaignState.PromotedFundIds;
70
72
  const defaultFundUsiSet = O.toUndefined(superSelectionAppService.defaultFundUsi);
71
73
  await Promise.all([
72
74
  eventDetails.fundType == 'promoted-default'
73
75
  ? await EventTrackingService.Instance.TrackPromotedDefaultSuperFundDetailViewedAsync({
74
- fundUsi: (_b = eventDetails.fundUsi) !== null && _b !== void 0 ? _b : '',
76
+ fundUsi: (_a = eventDetails.fundUsi) !== null && _a !== void 0 ? _a : '',
75
77
  fundName: eventDetails.fundName,
76
78
  promotedFundId: eventDetails.fundId,
77
79
  promotedFundsShown,
@@ -79,7 +81,7 @@ export class SuperCampaignHost {
79
81
  superCampaignEnabled: true
80
82
  })
81
83
  : await EventTrackingService.Instance.TrackPromotedSuperFundDetailViewedAsync({
82
- fundUsi: (_c = eventDetails.fundUsi) !== null && _c !== void 0 ? _c : undefined,
84
+ fundUsi: (_b = eventDetails.fundUsi) !== null && _b !== void 0 ? _b : undefined,
83
85
  fundName: eventDetails.fundName,
84
86
  promotedFundId: eventDetails.fundId,
85
87
  promotedFundsShown,
@@ -101,10 +103,7 @@ export class SuperCampaignHost {
101
103
  }
102
104
  };
103
105
  this.fundPdsViewed = async (event) => {
104
- var _a;
105
106
  if (event.detail.sender == 'super-campaign') {
106
- // eslint-disable-next-line no-console
107
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
108
107
  await EventTrackingService.Instance.TrackSuperFundPdsViewedAsync({
109
108
  fundName: event.detail.fundName,
110
109
  fundUsi: event.detail.fundUsi,
@@ -114,28 +113,19 @@ export class SuperCampaignHost {
114
113
  }
115
114
  };
116
115
  this.disclaimerViewed = async (event) => {
117
- var _a;
118
116
  if (event.detail.sender == 'super-campaign') {
119
- // eslint-disable-next-line no-console
120
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
121
117
  await EventTrackingService.Instance.TrackSuperFundDisclaimerViewedAsync(SuperFundDisclaimerViewedDetail.create(true));
122
118
  }
123
119
  };
124
120
  this.disclaimerAccepted = async (event) => {
125
- var _a;
126
121
  if (event.detail.sender == 'super-campaign') {
127
- // eslint-disable-next-line no-console
128
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
129
122
  await EventTrackingService.Instance.TrackSuperFundDisclaimerAcceptedAsync({
130
123
  superCampaignEnabled: true
131
124
  });
132
125
  }
133
126
  };
134
127
  this.promotedFundJoined = async (event) => {
135
- var _a;
136
128
  if (event.detail.sender == 'super-campaign') {
137
- // eslint-disable-next-line no-console
138
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
139
129
  const fundJoinInfo = event.detail.fundJoinInfo;
140
130
  switch (fundJoinInfo.fundType) {
141
131
  case 'Promoted':
@@ -251,7 +241,8 @@ export class SuperCampaignHost {
251
241
  'fund-pds-viewed': this.fundPdsViewed.bind(this),
252
242
  'disclaimer-viewed': this.disclaimerViewed.bind(this),
253
243
  'disclaimer-accepted': this.disclaimerAccepted.bind(this),
254
- 'promoted-fund-joined': this.promotedFundJoined.bind(this)
244
+ 'promoted-fund-joined': this.promotedFundJoined.bind(this),
245
+ 'super-campaign-loaded': this.superCampaignLoaded.bind(this)
255
246
  };
256
247
  }
257
248
  async componentWillLoad() {
@@ -3,7 +3,7 @@ import { pipe } from 'fp-ts/lib/function';
3
3
  import * as O from 'fp-ts/lib/Option';
4
4
  import jwtDecode from 'jwt-decode';
5
5
  import superSelectionApi from '../api/super-selection.api';
6
- import { initialState, SuperCampaignState } from './super-selection.store';
6
+ import { initialState } from './super-selection.store';
7
7
  export class SuperSelectionAppService {
8
8
  constructor() {
9
9
  const { state, onChange } = createStore(initialState);
@@ -137,11 +137,17 @@ export class SuperSelectionAppService {
137
137
  }
138
138
  }
139
139
  setSuperCampaignPromotedFundsShown(shownFunds) {
140
- this._state.superCampaignState = new SuperCampaignState(shownFunds);
140
+ if (this._state.superCampaignState !== undefined)
141
+ this._state.superCampaignState.promotedFundsShown = shownFunds;
142
+ else
143
+ throw new Error('Cannot set shown funds for SuperCampaing state because it is undefined');
141
144
  }
142
145
  get superCampaignState() {
143
146
  return this._state.superCampaignState;
144
147
  }
148
+ initializeSuperCampaignState(value) {
149
+ this._state.superCampaignState = value;
150
+ }
145
151
  get isUsingSuperCampaign() {
146
152
  return this.state.superCampaignEnabled && this.superCampaignState !== undefined;
147
153
  }
@@ -1,13 +1,16 @@
1
1
  import * as O from 'fp-ts/lib/Option';
2
2
  export class SuperCampaignState {
3
- constructor(funds) {
4
- this.promotedFundsShown = funds;
3
+ constructor() {
4
+ this._promotedFundsShown = [];
5
5
  }
6
6
  get PromotedFundIds() {
7
- return this.promotedFundsShown.map((p) => p.fundId);
7
+ return this._promotedFundsShown.map((p) => p.fundId);
8
+ }
9
+ set promotedFundsShown(value) {
10
+ this._promotedFundsShown = value;
8
11
  }
9
12
  get DefaultFundPosition() {
10
- this.promotedFundsShown.filter((value, index) => {
13
+ this._promotedFundsShown.filter((value, index) => {
11
14
  if (value.fundType == 'promoted-default') {
12
15
  return index;
13
16
  }
@@ -260,7 +260,7 @@ class TapSubscriber extends Subscriber {
260
260
  }
261
261
  }
262
262
 
263
- const AppVersion = '4.59.46171';
263
+ const AppVersion = '4.60.46274';
264
264
 
265
265
  // -------------------------------------------------------------------------------------
266
266
  // guards
@@ -3497,14 +3497,17 @@ class SuperSelectionApi {
3497
3497
  const superSelectionApi = new SuperSelectionApi();
3498
3498
 
3499
3499
  class SuperCampaignState {
3500
- constructor(funds) {
3501
- this.promotedFundsShown = funds;
3500
+ constructor() {
3501
+ this._promotedFundsShown = [];
3502
3502
  }
3503
3503
  get PromotedFundIds() {
3504
- return this.promotedFundsShown.map((p) => p.fundId);
3504
+ return this._promotedFundsShown.map((p) => p.fundId);
3505
+ }
3506
+ set promotedFundsShown(value) {
3507
+ this._promotedFundsShown = value;
3505
3508
  }
3506
3509
  get DefaultFundPosition() {
3507
- this.promotedFundsShown.filter((value, index) => {
3510
+ this._promotedFundsShown.filter((value, index) => {
3508
3511
  if (value.fundType == 'promoted-default') {
3509
3512
  return index;
3510
3513
  }
@@ -3664,11 +3667,17 @@ class SuperSelectionAppService {
3664
3667
  }
3665
3668
  }
3666
3669
  setSuperCampaignPromotedFundsShown(shownFunds) {
3667
- this._state.superCampaignState = new SuperCampaignState(shownFunds);
3670
+ if (this._state.superCampaignState !== undefined)
3671
+ this._state.superCampaignState.promotedFundsShown = shownFunds;
3672
+ else
3673
+ throw new Error('Cannot set shown funds for SuperCampaing state because it is undefined');
3668
3674
  }
3669
3675
  get superCampaignState() {
3670
3676
  return this._state.superCampaignState;
3671
3677
  }
3678
+ initializeSuperCampaignState(value) {
3679
+ this._state.superCampaignState = value;
3680
+ }
3672
3681
  get isUsingSuperCampaign() {
3673
3682
  return this.state.superCampaignEnabled && this.superCampaignState !== undefined;
3674
3683
  }
@@ -16863,16 +16872,19 @@ const SuperCampaignHost = class {
16863
16872
  document.removeEventListener(eventName, this.superCampaignEventHandlers[eventName]);
16864
16873
  }
16865
16874
  };
16875
+ this.superCampaignLoaded = async (event) => {
16876
+ if (event.detail.sender == 'super-campaign') {
16877
+ superSelectionAppService.initializeSuperCampaignState(new SuperCampaignState());
16878
+ }
16879
+ return Promise.resolve();
16880
+ };
16866
16881
  this.chooseAnotherFundRequested = async (event) => {
16867
16882
  if (event.detail.sender == 'super-campaign') {
16868
16883
  await navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFund);
16869
16884
  }
16870
16885
  };
16871
16886
  this.fundPanelShown = async (event) => {
16872
- var _a;
16873
16887
  if (event.detail.sender == 'super-campaign') {
16874
- // eslint-disable-next-line no-console
16875
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16876
16888
  const promotedFundsShown = event.detail.shownFunds.map((f) => f.fundId);
16877
16889
  superSelectionAppService.setSuperCampaignPromotedFundsShown(event.detail.shownFunds);
16878
16890
  await EventTrackingService.Instance.TrackSuperFundPanelViewedAsync({
@@ -16883,17 +16895,15 @@ const SuperCampaignHost = class {
16883
16895
  }
16884
16896
  };
16885
16897
  this.fundTileClicked = async (event) => {
16886
- var _a, _b, _c;
16898
+ var _a, _b;
16887
16899
  const eventDetails = event.detail;
16888
16900
  if (eventDetails.sender == 'super-campaign') {
16889
- // eslint-disable-next-line no-console
16890
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16891
16901
  const promotedFundsShown = this.SuperCampaignState.PromotedFundIds;
16892
16902
  const defaultFundUsiSet = Option.toUndefined(superSelectionAppService.defaultFundUsi);
16893
16903
  await Promise.all([
16894
16904
  eventDetails.fundType == 'promoted-default'
16895
16905
  ? await EventTrackingService.Instance.TrackPromotedDefaultSuperFundDetailViewedAsync({
16896
- fundUsi: (_b = eventDetails.fundUsi) !== null && _b !== void 0 ? _b : '',
16906
+ fundUsi: (_a = eventDetails.fundUsi) !== null && _a !== void 0 ? _a : '',
16897
16907
  fundName: eventDetails.fundName,
16898
16908
  promotedFundId: eventDetails.fundId,
16899
16909
  promotedFundsShown,
@@ -16901,7 +16911,7 @@ const SuperCampaignHost = class {
16901
16911
  superCampaignEnabled: true
16902
16912
  })
16903
16913
  : await EventTrackingService.Instance.TrackPromotedSuperFundDetailViewedAsync({
16904
- fundUsi: (_c = eventDetails.fundUsi) !== null && _c !== void 0 ? _c : undefined,
16914
+ fundUsi: (_b = eventDetails.fundUsi) !== null && _b !== void 0 ? _b : undefined,
16905
16915
  fundName: eventDetails.fundName,
16906
16916
  promotedFundId: eventDetails.fundId,
16907
16917
  promotedFundsShown,
@@ -16923,10 +16933,7 @@ const SuperCampaignHost = class {
16923
16933
  }
16924
16934
  };
16925
16935
  this.fundPdsViewed = async (event) => {
16926
- var _a;
16927
16936
  if (event.detail.sender == 'super-campaign') {
16928
- // eslint-disable-next-line no-console
16929
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16930
16937
  await EventTrackingService.Instance.TrackSuperFundPdsViewedAsync({
16931
16938
  fundName: event.detail.fundName,
16932
16939
  fundUsi: event.detail.fundUsi,
@@ -16936,28 +16943,19 @@ const SuperCampaignHost = class {
16936
16943
  }
16937
16944
  };
16938
16945
  this.disclaimerViewed = async (event) => {
16939
- var _a;
16940
16946
  if (event.detail.sender == 'super-campaign') {
16941
- // eslint-disable-next-line no-console
16942
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16943
16947
  await EventTrackingService.Instance.TrackSuperFundDisclaimerViewedAsync(SuperFundDisclaimerViewedDetail.create(true));
16944
16948
  }
16945
16949
  };
16946
16950
  this.disclaimerAccepted = async (event) => {
16947
- var _a;
16948
16951
  if (event.detail.sender == 'super-campaign') {
16949
- // eslint-disable-next-line no-console
16950
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16951
16952
  await EventTrackingService.Instance.TrackSuperFundDisclaimerAcceptedAsync({
16952
16953
  superCampaignEnabled: true
16953
16954
  });
16954
16955
  }
16955
16956
  };
16956
16957
  this.promotedFundJoined = async (event) => {
16957
- var _a;
16958
16958
  if (event.detail.sender == 'super-campaign') {
16959
- // eslint-disable-next-line no-console
16960
- console.log(`$handling super-campaign event: ${(_a = event.detail) === null || _a === void 0 ? void 0 : _a.type}`);
16961
16959
  const fundJoinInfo = event.detail.fundJoinInfo;
16962
16960
  switch (fundJoinInfo.fundType) {
16963
16961
  case 'Promoted':
@@ -17073,7 +17071,8 @@ const SuperCampaignHost = class {
17073
17071
  'fund-pds-viewed': this.fundPdsViewed.bind(this),
17074
17072
  'disclaimer-viewed': this.disclaimerViewed.bind(this),
17075
17073
  'disclaimer-accepted': this.disclaimerAccepted.bind(this),
17076
- 'promoted-fund-joined': this.promotedFundJoined.bind(this)
17074
+ 'promoted-fund-joined': this.promotedFundJoined.bind(this),
17075
+ 'super-campaign-loaded': this.superCampaignLoaded.bind(this)
17077
17076
  };
17078
17077
  }
17079
17078
  async componentWillLoad() {