@simplybusiness/services 1.2.7 → 1.2.9

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.
package/dist/cjs/index.js CHANGED
@@ -281,6 +281,298 @@ var baseEventDefinitions = [
281
281
  }
282
282
  ];
283
283
 
284
+ // src/snowplow/event-definitions/intervention.ts
285
+ var interventionEventDefinitions = [
286
+ {
287
+ name: "interventionInteractionCompleted",
288
+ type: "unstructured",
289
+ makePayload: (params) => {
290
+ const {
291
+ interventionName,
292
+ userUniqueIdentifier,
293
+ userUniqueIdentifierType,
294
+ action,
295
+ site
296
+ } = params;
297
+ return {
298
+ schema: "iglu:com.simplybusiness/intervention_interaction_completed/jsonschema/2-1-0",
299
+ data: {
300
+ intervention_name: interventionName,
301
+ user_unique_identifier: userUniqueIdentifier,
302
+ user_unique_identifier_type: userUniqueIdentifierType,
303
+ action,
304
+ site
305
+ }
306
+ };
307
+ }
308
+ }
309
+ ];
310
+
311
+ // src/snowplow/constants.ts
312
+ var DELIMITER = "|";
313
+
314
+ // src/snowplow/event-definitions/questionnaire/redaction.ts
315
+ var PII_ANSWER = [
316
+ "customer_title",
317
+ "customer_first_name",
318
+ "customer_last_name",
319
+ "customer_email_address",
320
+ "preapp_email_address",
321
+ "customer_telephone_number",
322
+ "customer_alternative_telephone_number",
323
+ "uk_address_lookup",
324
+ "uk_correspondence_address_lookup",
325
+ "customer_address_1_pre_quote",
326
+ "customer_address_2_pre_quote",
327
+ "customer_town_pre_quote",
328
+ "customer_postcode_pre_quote",
329
+ "customer_address_1",
330
+ "customer_address_2",
331
+ "customer_town",
332
+ "customer_postcode",
333
+ "address_1_pre_quote",
334
+ "address_2_pre_quote",
335
+ "uk_postcode_pre_quote",
336
+ "town_pre_quote",
337
+ "owner_first_name",
338
+ "owner_last_name",
339
+ "beneficiary_first_name",
340
+ "beneficiary_last_name",
341
+ "gender",
342
+ "dynamic_ssn_fein",
343
+ "ssn",
344
+ "fein",
345
+ "sof_county_court_judgement_online_yes",
346
+ "sof_county_court_judgement_online_no",
347
+ "sof_ccj_count",
348
+ "sof_ccj_value",
349
+ "sof_ccj_date",
350
+ "sof_court_judgement_yes",
351
+ "sof_court_judgement_no",
352
+ "ccj_date",
353
+ "sof_single_ccj_no",
354
+ "sof_single_ccj_yes",
355
+ "sof_ccj_yes",
356
+ "sof_ccj_no",
357
+ "ccj_count",
358
+ "sof_bankrupt_yes",
359
+ "sof_bankrupt_no",
360
+ "sof_multiple_bankruptcies_yes",
361
+ "sof_multiple_bankruptcies_no",
362
+ "bankruptcy_date",
363
+ "sof_single_bankruptcy_no",
364
+ "sof_single_bankruptcy_yes",
365
+ "sof_bankruptcy_yes",
366
+ "sof_bankruptcy_no",
367
+ "bankruptcy_discharged",
368
+ "sof_liquidation_yes",
369
+ "sof_liquidation_no",
370
+ "sof_multiple_liquidations",
371
+ "liquidation_date",
372
+ "sof_criminal_offence_yes",
373
+ "sof_criminal_offence_no",
374
+ "sof_criminal_yes",
375
+ "sof_criminal_no",
376
+ "hcp_date_of_birth_1",
377
+ "hcp_date_of_birth_2",
378
+ "hcp_date_of_birth_3",
379
+ "hcp_date_of_birth_4",
380
+ "hcp_date_of_birth_5",
381
+ "hcp_date_of_birth_6",
382
+ "hcp_date_of_birth_7",
383
+ "hcp_date_of_birth_8",
384
+ "hcp_date_of_birth_9",
385
+ "hcp_date_of_birth_10",
386
+ "sof_previous_claims_yes",
387
+ "sof_previous_claims_no",
388
+ "sof_claims_yes",
389
+ "sof_claims_no",
390
+ "sof_property_claims_in_the_last_5_years_yes",
391
+ "sof_property_claims_in_the_last_5_years_no",
392
+ "sof_property_claims_in_the_last_0_to_4_years_yes",
393
+ "sof_property_claims_in_the_last_0_to_4_years_no",
394
+ "claim_count",
395
+ "sof_number_of_claims",
396
+ "number_of_claims_in_last_5_years",
397
+ "number_of_claims_in_time_owned",
398
+ "date_of_incident_1",
399
+ "date_of_incident_2",
400
+ "date_of_incident_3",
401
+ "date_of_incident_4",
402
+ "date_of_incident_5",
403
+ "type_of_incident_1",
404
+ "type_of_incident_2",
405
+ "type_of_incident_3",
406
+ "type_of_incident_4",
407
+ "type_of_incident_5",
408
+ "incident_value_1",
409
+ "incident_value_2",
410
+ "incident_value_3",
411
+ "incident_value_4",
412
+ "incident_value_5",
413
+ "sof_pollution_disease_claims_yes",
414
+ "sof_pollution_disease_claims_no",
415
+ "sof_potential_claims_yes",
416
+ "sof_potential_claims_no",
417
+ "sof_previous_circumstances_yes",
418
+ "sof_previous_circumstances_no",
419
+ "sof_possible_claims_yes",
420
+ "sof_possible_claims_no",
421
+ "date_of_possible_incident",
422
+ "type_of_possible_incident",
423
+ "possible_incident_value",
424
+ "sof_property_claims_yes",
425
+ "sof_property_claims_no",
426
+ "sof_liability_claims_yes",
427
+ "sof_liability_claims_no",
428
+ "van_registration",
429
+ "sof_disqualified_director_yes",
430
+ "sof_disqualified_director_no",
431
+ "sof_insurance_refused_yes",
432
+ "sof_insurance_refused_no",
433
+ "sof_insurance_declined_yes",
434
+ "sof_insurance_declined_no",
435
+ "insurance_refused"
436
+ ];
437
+ var RADIO_ANSWER_FROM_QUESTIONS = [
438
+ "have_secondary_trade_yes",
439
+ "have_secondary_trade_no"
440
+ ];
441
+ var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
442
+ var redact = (params) => {
443
+ let { question, answer } = params;
444
+ const piiAnswer = new Set(PII_ANSWER);
445
+ const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
446
+ if (piiAnswer.has(question)) {
447
+ answer = "REDACTED";
448
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
449
+ } else if (radioAnswerFromQuestions.has(question)) {
450
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
451
+ }
452
+ return { question, answer };
453
+ };
454
+
455
+ // src/snowplow/event-definitions/personalised_cover.ts
456
+ var personalisedCoverEventDefinitions = [
457
+ {
458
+ name: "seeMoreClicked",
459
+ type: "structured",
460
+ makePayload: (_) => ({
461
+ category: "personalised_cover",
462
+ action: "see_more_clicked",
463
+ label: "page",
464
+ property: "personalised_cover"
465
+ })
466
+ },
467
+ {
468
+ name: "selectPackageClicked",
469
+ type: "structured",
470
+ makePayload: (_) => ({
471
+ category: "personalised_cover",
472
+ action: "select_package_clicked",
473
+ label: "page",
474
+ property: "personalised_cover"
475
+ })
476
+ },
477
+ {
478
+ name: "validationShown",
479
+ type: "structured",
480
+ makePayload: (params) => {
481
+ const { cover, question } = params;
482
+ return {
483
+ category: "personalised_cover",
484
+ action: "validation_shown",
485
+ label: "cover_question",
486
+ property: `${snakeCase(cover)}_${snakeCase(question)}`
487
+ };
488
+ }
489
+ },
490
+ {
491
+ name: "coverQuestionAnswered",
492
+ type: "unstructured",
493
+ makePayload: (params) => {
494
+ const { context } = params;
495
+ const { question, answer } = redact(params);
496
+ const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
497
+ return {
498
+ schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-1",
499
+ data: {
500
+ site: context.site,
501
+ page_name: "personalised_cover",
502
+ section_name: "Personalised Cover Questions",
503
+ question,
504
+ answer: flatAnswer
505
+ }
506
+ };
507
+ }
508
+ },
509
+ {
510
+ name: "limitLinkClicked",
511
+ type: "structured",
512
+ makePayload: (params) => {
513
+ const { label } = params;
514
+ return {
515
+ category: "personalised_cover",
516
+ action: "limit_link_clicked",
517
+ label,
518
+ property: "link_clicked"
519
+ };
520
+ }
521
+ },
522
+ {
523
+ name: "limitChanged",
524
+ type: "structured",
525
+ makePayload: (params) => {
526
+ const { label, limit } = params;
527
+ return {
528
+ category: "personalised_cover",
529
+ action: "limit_changed",
530
+ label,
531
+ property: limit
532
+ };
533
+ }
534
+ },
535
+ {
536
+ name: "coverPresented",
537
+ type: "structured",
538
+ makePayload: (params) => {
539
+ const { property } = params;
540
+ return {
541
+ category: "personalised_cover",
542
+ action: "cover_presented",
543
+ label: "cover_name",
544
+ property
545
+ };
546
+ }
547
+ },
548
+ {
549
+ name: "additionalQuestionsClicked",
550
+ type: "structured",
551
+ makePayload: (params) => {
552
+ const { property } = params;
553
+ return {
554
+ category: "personalised_cover",
555
+ action: "additional_questions_clicked",
556
+ label: "cover_name",
557
+ property
558
+ };
559
+ }
560
+ },
561
+ {
562
+ name: "chatbotPromptClicked",
563
+ type: "structured",
564
+ makePayload: (params) => {
565
+ const { label, property } = params;
566
+ return {
567
+ category: "personalised_cover",
568
+ action: "chatbot_prompt_clicked",
569
+ label: property,
570
+ property: label
571
+ };
572
+ }
573
+ }
574
+ ];
575
+
284
576
  // src/snowplow/event-definitions/qcp.ts
285
577
  var qcpEventDefinitions = [
286
578
  {
@@ -442,395 +734,206 @@ var qcpEventDefinitions = [
442
734
  })
443
735
  },
444
736
  {
445
- name: "priceDetailsPopUpOpened",
446
- type: "structured",
447
- makePayload: () => ({
448
- category: "price_details",
449
- action: "price_details_popup_opened",
450
- label: "Price details",
451
- property: window.location.href
452
- })
453
- },
454
- {
455
- name: "editLimitButtonClicked",
456
- type: "structured",
457
- makePayload: () => ({
458
- category: "cover_limit_changes",
459
- action: "edit_limit_button_clicked",
460
- label: "Edit Limit",
461
- property: window.location.href
462
- })
463
- },
464
- {
465
- name: "applyButtonClicked",
466
- type: "structured",
467
- makePayload: () => ({
468
- category: "cover_limit_changes",
469
- action: "apply_button_clicked",
470
- label: "Apply Button Clicked",
471
- property: window.location.href
472
- })
473
- },
474
- {
475
- name: "coverageInfoClicked",
476
- type: "structured",
477
- makePayload: (params) => {
478
- const { deviceType, open = true } = params;
479
- return {
480
- action: "show_coverage_info_clicked",
481
- category: `uk-qcp-react-${deviceType}-show-coverage-info-toggle`,
482
- label: `${open ? "show" : "hide"}_coverage_info_clicked`,
483
- property: window.location.href
484
- };
485
- }
486
- },
487
- {
488
- name: "backToApplication",
489
- type: "unstructured",
490
- makePayload: (params) => {
491
- const { journeyId, vertical } = params;
492
- return {
493
- schema: "iglu:com.simplybusiness/qcp_back_to_application/jsonschema/1-0-0",
494
- data: {
495
- journey_id: journeyId,
496
- vertical
497
- }
498
- };
499
- },
500
- contexts: ["serviceChannelContext"]
501
- },
502
- // No quotes referral
503
- {
504
- name: "coverOptionsLinkClicked",
505
- type: "structured",
506
- makePayload: () => ({
507
- category: "uk-qcp-react-cover-options-link",
508
- action: "cover_options_link_clicked",
509
- label: "cover_options_link_clicked",
510
- property: window.location.href
511
- })
512
- },
513
- {
514
- name: "referralReasonsVariantBCoverOptionsLinkClicked",
515
- type: "structured",
516
- makePayload: () => ({
517
- category: "uk-24-12-qcp-mvt-referral-reasons",
518
- action: "cover_options_link_clicked_variant_b",
519
- label: "cover_options_link_clicked_variant_b",
520
- property: window.location.href
521
- })
522
- },
523
- {
524
- name: "referralReasonsVariantCCoverOptionsLinkClicked",
525
- type: "structured",
526
- makePayload: () => ({
527
- category: "uk-24-12-qcp-mvt-referral-reasons",
528
- action: "cover_options_link_clicked_variant_c",
529
- label: "cover_options_link_clicked_variant_c",
530
- property: window.location.href
531
- })
532
- },
533
- {
534
- name: "phoneNumberLinkClicked",
535
- type: "structured",
536
- makePayload: () => ({
537
- category: "uk-qcp-react-phone-number-link",
538
- action: "phone_number_link_clicked",
539
- label: "phone_number_link_clicked",
540
- property: window.location.href
541
- })
542
- },
543
- {
544
- name: "linkClicked",
545
- type: "unstructured",
546
- makePayload: (params) => {
547
- const { targetUrl, elementContent } = params;
548
- return {
549
- schema: "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",
550
- data: {
551
- targetUrl,
552
- elementContent
553
- }
554
- };
555
- }
556
- },
557
- {
558
- name: "qcpUpsellAccordionClicked",
559
- type: "structured",
560
- makePayload: (params) => ({
561
- category: "us-qcp-upsells",
562
- action: "accordion_clicked_qcp",
563
- label: params?.label,
564
- property: window.location.href
565
- })
566
- },
567
- {
568
- name: "qdsUpsellAccordionClicked",
569
- type: "structured",
570
- makePayload: (params) => ({
571
- category: "us-qcp-upsells",
572
- action: "accordion_clicked_slider",
573
- label: params?.label,
574
- property: window.location.href
575
- })
576
- },
577
- {
578
- name: "qcpUpsellTooltipHelperClicked",
737
+ name: "priceDetailsPopUpOpened",
579
738
  type: "structured",
580
- makePayload: (params) => ({
581
- category: "us-qcp-upsells",
582
- action: "tooltip_helper_clicked_qcp",
583
- label: params?.label,
739
+ makePayload: () => ({
740
+ category: "price_details",
741
+ action: "price_details_popup_opened",
742
+ label: "Price details",
584
743
  property: window.location.href
585
744
  })
586
745
  },
587
746
  {
588
- name: "qdsUpsellTooltipHelperClicked",
747
+ name: "editLimitButtonClicked",
589
748
  type: "structured",
590
- makePayload: (params) => ({
591
- category: "us-qcp-upsells",
592
- action: "tooltip_helper_clicked_slider",
593
- label: params?.label,
749
+ makePayload: () => ({
750
+ category: "cover_limit_changes",
751
+ action: "edit_limit_button_clicked",
752
+ label: "Edit Limit",
594
753
  property: window.location.href
595
754
  })
596
755
  },
597
756
  {
598
- name: "qcpQuoteButtonClicked",
757
+ name: "applyButtonClicked",
599
758
  type: "structured",
600
- makePayload: (payload) => ({
601
- category: "quote-buttons",
602
- action: "button-clicked",
603
- label: payload?.label,
759
+ makePayload: () => ({
760
+ category: "cover_limit_changes",
761
+ action: "apply_button_clicked",
762
+ label: "Apply Button Clicked",
604
763
  property: window.location.href
605
764
  })
606
765
  },
607
766
  {
608
- name: "layoutToggleClickedExperiment",
767
+ name: "coverageInfoClicked",
609
768
  type: "structured",
610
769
  makePayload: (params) => {
611
- const { layout } = params;
612
- return {
613
- category: "uk-25-04-16-gridview_layout",
614
- action: "layout_toggle_clicked",
615
- label: layout,
616
- property: window.location.href
617
- };
618
- }
619
- },
620
- {
621
- name: "selectCoverOptionsClicked",
622
- type: "structured",
623
- makePayload: (payload) => {
770
+ const { deviceType, open = true } = params;
624
771
  return {
625
- category: "uk-25-09-qcp-covers-demand-test",
626
- action: "cover_options_clicked",
627
- label: payload?.label,
772
+ action: "show_coverage_info_clicked",
773
+ category: `uk-qcp-react-${deviceType}-show-coverage-info-toggle`,
774
+ label: `${open ? "show" : "hide"}_coverage_info_clicked`,
628
775
  property: window.location.href
629
776
  };
630
777
  }
631
778
  },
632
779
  {
633
- name: "voucherClaimClicked",
634
- type: "structured",
635
- makePayload: () => ({
636
- category: "uk-25-06-hyrdra-voucher-intervention-qcp-page",
637
- action: "voucher_claim_clicked",
638
- label: "voucher_claim_clicked",
639
- property: window.location.href
640
- })
641
- }
642
- ];
643
-
644
- // src/snowplow/event-definitions/referral.ts
645
- var referralEventDefinitions = [
646
- {
647
- name: "nextCoverageClicked",
648
- type: "structured",
649
- makePayload: (params) => {
650
- const { url } = params;
651
- const eventName = "post_referral_workers_compensation_continuation_link";
652
- return {
653
- category: eventName,
654
- action: "link_click",
655
- label: eventName,
656
- property: url
657
- };
658
- }
659
- }
660
- ];
661
-
662
- // src/snowplow/event-definitions/intervention.ts
663
- var interventionEventDefinitions = [
664
- {
665
- name: "interventionInteractionCompleted",
780
+ name: "backToApplication",
666
781
  type: "unstructured",
667
782
  makePayload: (params) => {
668
- const {
669
- interventionName,
670
- userUniqueIdentifier,
671
- userUniqueIdentifierType,
672
- action,
673
- site
674
- } = params;
783
+ const { journeyId, vertical } = params;
675
784
  return {
676
- schema: "iglu:com.simplybusiness/intervention_interaction_completed/jsonschema/2-1-0",
785
+ schema: "iglu:com.simplybusiness/qcp_back_to_application/jsonschema/1-0-0",
677
786
  data: {
678
- intervention_name: interventionName,
679
- user_unique_identifier: userUniqueIdentifier,
680
- user_unique_identifier_type: userUniqueIdentifierType,
681
- action,
682
- site
787
+ journey_id: journeyId,
788
+ vertical
683
789
  }
684
790
  };
685
- }
686
- }
687
- ];
688
-
689
- // src/snowplow/constants.ts
690
- var DELIMITER = "|";
691
-
692
- // src/snowplow/event-definitions/redaction.ts
693
- var PII_ANSWER = [
694
- "customer_title",
695
- "customer_first_name",
696
- "customer_last_name",
697
- "customer_email_address",
698
- "preapp_email_address",
699
- "customer_telephone_number",
700
- "customer_alternative_telephone_number",
701
- "uk_address_lookup",
702
- "uk_correspondence_address_lookup",
703
- "customer_address_1_pre_quote",
704
- "customer_address_2_pre_quote",
705
- "customer_town_pre_quote",
706
- "customer_postcode_pre_quote",
707
- "customer_address_1",
708
- "customer_address_2",
709
- "customer_town",
710
- "customer_postcode",
711
- "address_1_pre_quote",
712
- "address_2_pre_quote",
713
- "uk_postcode_pre_quote",
714
- "town_pre_quote",
715
- "owner_first_name",
716
- "owner_last_name",
717
- "beneficiary_first_name",
718
- "beneficiary_last_name",
719
- "gender",
720
- "dynamic_ssn_fein",
721
- "ssn",
722
- "fein",
723
- "sof_county_court_judgement_online_yes",
724
- "sof_county_court_judgement_online_no",
725
- "sof_ccj_count",
726
- "sof_ccj_value",
727
- "sof_ccj_date",
728
- "sof_court_judgement_yes",
729
- "sof_court_judgement_no",
730
- "ccj_date",
731
- "sof_single_ccj_no",
732
- "sof_single_ccj_yes",
733
- "sof_ccj_yes",
734
- "sof_ccj_no",
735
- "ccj_count",
736
- "sof_bankrupt_yes",
737
- "sof_bankrupt_no",
738
- "sof_multiple_bankruptcies_yes",
739
- "sof_multiple_bankruptcies_no",
740
- "bankruptcy_date",
741
- "sof_single_bankruptcy_no",
742
- "sof_single_bankruptcy_yes",
743
- "sof_bankruptcy_yes",
744
- "sof_bankruptcy_no",
745
- "bankruptcy_discharged",
746
- "sof_liquidation_yes",
747
- "sof_liquidation_no",
748
- "sof_multiple_liquidations",
749
- "liquidation_date",
750
- "sof_criminal_offence_yes",
751
- "sof_criminal_offence_no",
752
- "sof_criminal_yes",
753
- "sof_criminal_no",
754
- "hcp_date_of_birth_1",
755
- "hcp_date_of_birth_2",
756
- "hcp_date_of_birth_3",
757
- "hcp_date_of_birth_4",
758
- "hcp_date_of_birth_5",
759
- "hcp_date_of_birth_6",
760
- "hcp_date_of_birth_7",
761
- "hcp_date_of_birth_8",
762
- "hcp_date_of_birth_9",
763
- "hcp_date_of_birth_10",
764
- "sof_previous_claims_yes",
765
- "sof_previous_claims_no",
766
- "sof_claims_yes",
767
- "sof_claims_no",
768
- "sof_property_claims_in_the_last_5_years_yes",
769
- "sof_property_claims_in_the_last_5_years_no",
770
- "sof_property_claims_in_the_last_0_to_4_years_yes",
771
- "sof_property_claims_in_the_last_0_to_4_years_no",
772
- "claim_count",
773
- "sof_number_of_claims",
774
- "number_of_claims_in_last_5_years",
775
- "number_of_claims_in_time_owned",
776
- "date_of_incident_1",
777
- "date_of_incident_2",
778
- "date_of_incident_3",
779
- "date_of_incident_4",
780
- "date_of_incident_5",
781
- "type_of_incident_1",
782
- "type_of_incident_2",
783
- "type_of_incident_3",
784
- "type_of_incident_4",
785
- "type_of_incident_5",
786
- "incident_value_1",
787
- "incident_value_2",
788
- "incident_value_3",
789
- "incident_value_4",
790
- "incident_value_5",
791
- "sof_pollution_disease_claims_yes",
792
- "sof_pollution_disease_claims_no",
793
- "sof_potential_claims_yes",
794
- "sof_potential_claims_no",
795
- "sof_previous_circumstances_yes",
796
- "sof_previous_circumstances_no",
797
- "sof_possible_claims_yes",
798
- "sof_possible_claims_no",
799
- "date_of_possible_incident",
800
- "type_of_possible_incident",
801
- "possible_incident_value",
802
- "sof_property_claims_yes",
803
- "sof_property_claims_no",
804
- "sof_liability_claims_yes",
805
- "sof_liability_claims_no",
806
- "van_registration",
807
- "sof_disqualified_director_yes",
808
- "sof_disqualified_director_no",
809
- "sof_insurance_refused_yes",
810
- "sof_insurance_refused_no",
811
- "sof_insurance_declined_yes",
812
- "sof_insurance_declined_no",
813
- "insurance_refused"
814
- ];
815
- var RADIO_ANSWER_FROM_QUESTIONS = [
816
- "have_secondary_trade_yes",
817
- "have_secondary_trade_no"
818
- ];
819
- var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
820
- var redact = (params) => {
821
- let { question, answer } = params;
822
- const piiAnswer = new Set(PII_ANSWER);
823
- const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
824
- if (piiAnswer.has(question)) {
825
- answer = "REDACTED";
826
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
827
- } else if (radioAnswerFromQuestions.has(question)) {
828
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
791
+ },
792
+ contexts: ["serviceChannelContext"]
793
+ },
794
+ // No quotes referral
795
+ {
796
+ name: "coverOptionsLinkClicked",
797
+ type: "structured",
798
+ makePayload: () => ({
799
+ category: "uk-qcp-react-cover-options-link",
800
+ action: "cover_options_link_clicked",
801
+ label: "cover_options_link_clicked",
802
+ property: window.location.href
803
+ })
804
+ },
805
+ {
806
+ name: "referralReasonsVariantBCoverOptionsLinkClicked",
807
+ type: "structured",
808
+ makePayload: () => ({
809
+ category: "uk-24-12-qcp-mvt-referral-reasons",
810
+ action: "cover_options_link_clicked_variant_b",
811
+ label: "cover_options_link_clicked_variant_b",
812
+ property: window.location.href
813
+ })
814
+ },
815
+ {
816
+ name: "referralReasonsVariantCCoverOptionsLinkClicked",
817
+ type: "structured",
818
+ makePayload: () => ({
819
+ category: "uk-24-12-qcp-mvt-referral-reasons",
820
+ action: "cover_options_link_clicked_variant_c",
821
+ label: "cover_options_link_clicked_variant_c",
822
+ property: window.location.href
823
+ })
824
+ },
825
+ {
826
+ name: "phoneNumberLinkClicked",
827
+ type: "structured",
828
+ makePayload: () => ({
829
+ category: "uk-qcp-react-phone-number-link",
830
+ action: "phone_number_link_clicked",
831
+ label: "phone_number_link_clicked",
832
+ property: window.location.href
833
+ })
834
+ },
835
+ {
836
+ name: "linkClicked",
837
+ type: "unstructured",
838
+ makePayload: (params) => {
839
+ const { targetUrl, elementContent } = params;
840
+ return {
841
+ schema: "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",
842
+ data: {
843
+ targetUrl,
844
+ elementContent
845
+ }
846
+ };
847
+ }
848
+ },
849
+ {
850
+ name: "qcpUpsellAccordionClicked",
851
+ type: "structured",
852
+ makePayload: (params) => ({
853
+ category: "us-qcp-upsells",
854
+ action: "accordion_clicked_qcp",
855
+ label: params?.label,
856
+ property: window.location.href
857
+ })
858
+ },
859
+ {
860
+ name: "qdsUpsellAccordionClicked",
861
+ type: "structured",
862
+ makePayload: (params) => ({
863
+ category: "us-qcp-upsells",
864
+ action: "accordion_clicked_slider",
865
+ label: params?.label,
866
+ property: window.location.href
867
+ })
868
+ },
869
+ {
870
+ name: "qcpUpsellTooltipHelperClicked",
871
+ type: "structured",
872
+ makePayload: (params) => ({
873
+ category: "us-qcp-upsells",
874
+ action: "tooltip_helper_clicked_qcp",
875
+ label: params?.label,
876
+ property: window.location.href
877
+ })
878
+ },
879
+ {
880
+ name: "qdsUpsellTooltipHelperClicked",
881
+ type: "structured",
882
+ makePayload: (params) => ({
883
+ category: "us-qcp-upsells",
884
+ action: "tooltip_helper_clicked_slider",
885
+ label: params?.label,
886
+ property: window.location.href
887
+ })
888
+ },
889
+ {
890
+ name: "qcpQuoteButtonClicked",
891
+ type: "structured",
892
+ makePayload: (payload) => ({
893
+ category: "quote-buttons",
894
+ action: "button-clicked",
895
+ label: payload?.label,
896
+ property: window.location.href
897
+ })
898
+ },
899
+ {
900
+ name: "layoutToggleClickedExperiment",
901
+ type: "structured",
902
+ makePayload: (params) => {
903
+ const { layout } = params;
904
+ return {
905
+ category: "uk-25-04-16-gridview_layout",
906
+ action: "layout_toggle_clicked",
907
+ label: layout,
908
+ property: window.location.href
909
+ };
910
+ }
911
+ },
912
+ {
913
+ name: "selectCoverOptionsClicked",
914
+ type: "structured",
915
+ makePayload: (payload) => {
916
+ return {
917
+ category: "uk-25-09-qcp-covers-demand-test",
918
+ action: "cover_options_clicked",
919
+ label: payload?.label,
920
+ property: window.location.href
921
+ };
922
+ }
923
+ },
924
+ {
925
+ name: "voucherClaimClicked",
926
+ type: "structured",
927
+ makePayload: () => ({
928
+ category: "uk-25-06-hyrdra-voucher-intervention-qcp-page",
929
+ action: "voucher_claim_clicked",
930
+ label: "voucher_claim_clicked",
931
+ property: window.location.href
932
+ })
829
933
  }
830
- return { question, answer };
831
- };
934
+ ];
832
935
 
833
- // src/snowplow/event-definitions/questionnaire.ts
936
+ // src/snowplow/event-definitions/questionnaire/questionnaire.ts
834
937
  var questionnaireEventDefinitions = [
835
938
  {
836
939
  name: "questionAnswered",
@@ -840,7 +943,7 @@ var questionnaireEventDefinitions = [
840
943
  const { question, answer } = redact(params);
841
944
  const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
842
945
  return {
843
- schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-3",
946
+ schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-4",
844
947
  data: {
845
948
  site: context.site,
846
949
  page_index: 1,
@@ -980,122 +1083,19 @@ var questionnaireEventDefinitions = [
980
1083
  }
981
1084
  ];
982
1085
 
983
- // src/snowplow/event-definitions/personalised_cover.ts
984
- var personalisedCoverEventDefinitions = [
985
- {
986
- name: "seeMoreClicked",
987
- type: "structured",
988
- makePayload: (_) => ({
989
- category: "personalised_cover",
990
- action: "see_more_clicked",
991
- label: "page",
992
- property: "personalised_cover"
993
- })
994
- },
995
- {
996
- name: "selectPackageClicked",
997
- type: "structured",
998
- makePayload: (_) => ({
999
- category: "personalised_cover",
1000
- action: "select_package_clicked",
1001
- label: "page",
1002
- property: "personalised_cover"
1003
- })
1004
- },
1005
- {
1006
- name: "validationShown",
1007
- type: "structured",
1008
- makePayload: (params) => {
1009
- const { cover, question } = params;
1010
- return {
1011
- category: "personalised_cover",
1012
- action: "validation_shown",
1013
- label: "cover_question",
1014
- property: `${snakeCase(cover)}_${snakeCase(question)}`
1015
- };
1016
- }
1017
- },
1018
- {
1019
- name: "coverQuestionAnswered",
1020
- type: "unstructured",
1021
- makePayload: (params) => {
1022
- const { context } = params;
1023
- const { question, answer } = redact(params);
1024
- const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
1025
- return {
1026
- schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-1",
1027
- data: {
1028
- site: context.site,
1029
- page_name: "personalised_cover",
1030
- section_name: "Personalised Cover Questions",
1031
- question,
1032
- answer: flatAnswer
1033
- }
1034
- };
1035
- }
1036
- },
1037
- {
1038
- name: "limitLinkClicked",
1039
- type: "structured",
1040
- makePayload: (params) => {
1041
- const { label } = params;
1042
- return {
1043
- category: "personalised_cover",
1044
- action: "limit_link_clicked",
1045
- label,
1046
- property: "link_clicked"
1047
- };
1048
- }
1049
- },
1050
- {
1051
- name: "limitChanged",
1052
- type: "structured",
1053
- makePayload: (params) => {
1054
- const { label, limit } = params;
1055
- return {
1056
- category: "personalised_cover",
1057
- action: "limit_changed",
1058
- label,
1059
- property: limit
1060
- };
1061
- }
1062
- },
1063
- {
1064
- name: "coverPresented",
1065
- type: "structured",
1066
- makePayload: (params) => {
1067
- const { property } = params;
1068
- return {
1069
- category: "personalised_cover",
1070
- action: "cover_presented",
1071
- label: "cover_name",
1072
- property
1073
- };
1074
- }
1075
- },
1076
- {
1077
- name: "additionalQuestionsClicked",
1078
- type: "structured",
1079
- makePayload: (params) => {
1080
- const { property } = params;
1081
- return {
1082
- category: "personalised_cover",
1083
- action: "additional_questions_clicked",
1084
- label: "cover_name",
1085
- property
1086
- };
1087
- }
1088
- },
1086
+ // src/snowplow/event-definitions/referral.ts
1087
+ var referralEventDefinitions = [
1089
1088
  {
1090
- name: "chatbotPromptClicked",
1089
+ name: "nextCoverageClicked",
1091
1090
  type: "structured",
1092
1091
  makePayload: (params) => {
1093
- const { label, property } = params;
1092
+ const { url } = params;
1093
+ const eventName = "post_referral_workers_compensation_continuation_link";
1094
1094
  return {
1095
- category: "personalised_cover",
1096
- action: "chatbot_prompt_clicked",
1097
- label: property,
1098
- property: label
1095
+ category: eventName,
1096
+ action: "link_click",
1097
+ label: eventName,
1098
+ property: url
1099
1099
  };
1100
1100
  }
1101
1101
  }