@hmcts/rpx-xui-common-lib 3.2.30-innerHtml-update → 3.2.30-pofcc-156

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,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, EventEmitter, ViewEncapsulation, Input, Output, Injectable, InjectionToken, DOCUMENT, Inject, ViewChild, Pipe, ChangeDetectionStrategy, Directive, ElementRef, NgModule } from '@angular/core';
2
+ import { Component, EventEmitter, ViewEncapsulation, Input, Output, Injectable, InjectionToken, DOCUMENT, Inject, ViewChild, Pipe, ChangeDetectionStrategy, Directive, SecurityContext, ElementRef, NgModule } from '@angular/core';
3
3
  import * as i2 from 'rpx-xui-translation';
4
4
  import { RpxTranslationModule } from 'rpx-xui-translation';
5
5
  import * as i1 from '@angular/common';
6
- import { formatDate, DOCUMENT as DOCUMENT$1, CommonModule } from '@angular/common';
6
+ import { formatDate, CommonModule } from '@angular/common';
7
7
  import * as i2$3 from '@angular/forms';
8
8
  import { FormGroup, FormControl, Validators, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
9
  import { combineLatest, BehaviorSubject, Subject, of as of$1, forkJoin, zip, iif, merge } from 'rxjs';
@@ -20,7 +20,6 @@ import { DocumentInterruptSource, WindowInterruptSource } from '@ng-idle/core';
20
20
  import * as i2$2 from '@ng-idle/keepalive';
21
21
  import * as i4 from '@angular/material/autocomplete';
22
22
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
23
- import DOMPurify from 'dompurify';
24
23
  import * as i1$4 from '@angular/material/tabs';
25
24
  import { MatTabsModule } from '@angular/material/tabs';
26
25
  import * as i2$4 from 'ngx-pagination';
@@ -1541,13 +1540,13 @@ var BookingCheckType;
1541
1540
  BookingCheckType["POSSIBLE_BOOKINGS"] = "POSSIBLE_BOOKINGS";
1542
1541
  })(BookingCheckType || (BookingCheckType = {}));
1543
1542
 
1544
- // used as settings for filters and components
1545
1543
  var PersonRole;
1546
1544
  (function (PersonRole) {
1547
1545
  PersonRole["JUDICIAL"] = "Judicial";
1548
1546
  PersonRole["LEGAL_OPERATIONS"] = "Legal Ops";
1549
1547
  PersonRole["ADMIN"] = "Admin";
1550
1548
  PersonRole["CTSC"] = "CTSC";
1549
+ PersonRole["ENFORCEMENT"] = "Enforcement";
1551
1550
  PersonRole["ALL"] = "All";
1552
1551
  })(PersonRole || (PersonRole = {}));
1553
1552
  // Role categories used in application
@@ -1559,8 +1558,128 @@ var RoleCategory;
1559
1558
  RoleCategory["CTSC"] = "CTSC";
1560
1559
  RoleCategory["PROFESSIONAL"] = "PROFESSIONAL";
1561
1560
  RoleCategory["CITIZEN"] = "CITIZEN";
1561
+ RoleCategory["ENFORCEMENT"] = "ENFORCEMENT";
1562
1562
  RoleCategory["ALL"] = "ALL";
1563
1563
  })(RoleCategory || (RoleCategory = {}));
1564
+ function getRoleCategoryTitle(roleCategory) {
1565
+ switch (roleCategory) {
1566
+ case RoleCategory.LEGAL_OPERATIONS: {
1567
+ return 'legal Ops';
1568
+ }
1569
+ case RoleCategory.JUDICIAL: {
1570
+ return 'judicial';
1571
+ }
1572
+ case RoleCategory.ADMIN: {
1573
+ return 'admin';
1574
+ }
1575
+ case RoleCategory.CTSC: {
1576
+ return 'CTSC';
1577
+ }
1578
+ case RoleCategory.ENFORCEMENT: {
1579
+ return 'enforcement';
1580
+ }
1581
+ default:
1582
+ return 'legal Ops';
1583
+ }
1584
+ }
1585
+ function getRoleCategoryForWorkAllocation(personRole) {
1586
+ if (personRole === PersonRole.JUDICIAL) {
1587
+ return RoleCategory.JUDICIAL;
1588
+ }
1589
+ else if (personRole === PersonRole.LEGAL_OPERATIONS) {
1590
+ return RoleCategory.LEGAL_OPERATIONS;
1591
+ }
1592
+ else if (personRole === PersonRole.ADMIN) {
1593
+ return RoleCategory.ADMIN;
1594
+ }
1595
+ else if (personRole === PersonRole.CTSC) {
1596
+ return RoleCategory.CTSC;
1597
+ }
1598
+ else if (personRole === PersonRole.ENFORCEMENT) {
1599
+ return RoleCategory.ENFORCEMENT;
1600
+ }
1601
+ return null;
1602
+ }
1603
+ function getRoleCategory(personRole) {
1604
+ let roleCategory = RoleCategory.ALL;
1605
+ if (!(personRole === PersonRole.ALL)) {
1606
+ if (personRole === PersonRole.LEGAL_OPERATIONS) {
1607
+ roleCategory = RoleCategory.LEGAL_OPERATIONS;
1608
+ }
1609
+ else if (personRole === PersonRole.ADMIN) {
1610
+ roleCategory = RoleCategory.ADMIN;
1611
+ }
1612
+ else if (personRole === PersonRole.CTSC) {
1613
+ roleCategory = RoleCategory.CTSC;
1614
+ }
1615
+ else if (personRole === PersonRole.ENFORCEMENT) {
1616
+ roleCategory = RoleCategory.ENFORCEMENT;
1617
+ }
1618
+ }
1619
+ return roleCategory;
1620
+ }
1621
+ function getPersonRole(roleCategories) {
1622
+ if (roleCategories.includes(RoleCategory.ADMIN)) {
1623
+ return PersonRole.ADMIN;
1624
+ }
1625
+ if (roleCategories.includes(RoleCategory.CTSC)) {
1626
+ return PersonRole.CTSC;
1627
+ }
1628
+ if (roleCategories.includes(RoleCategory.LEGAL_OPERATIONS)) {
1629
+ return PersonRole.LEGAL_OPERATIONS;
1630
+ }
1631
+ if (roleCategories.includes(RoleCategory.ENFORCEMENT)) {
1632
+ return PersonRole.ENFORCEMENT;
1633
+ }
1634
+ // return default role if no match found
1635
+ return PersonRole.LEGAL_OPERATIONS;
1636
+ }
1637
+ function getPersonRoleForAllocateRole(roleCategory) {
1638
+ if (roleCategory === RoleCategory.LEGAL_OPERATIONS) {
1639
+ return PersonRole.LEGAL_OPERATIONS;
1640
+ }
1641
+ else if (roleCategory === RoleCategory.ADMIN) {
1642
+ return PersonRole.ADMIN;
1643
+ }
1644
+ else if (roleCategory === RoleCategory.CTSC) {
1645
+ return PersonRole.CTSC;
1646
+ }
1647
+ else if (roleCategory === RoleCategory.ENFORCEMENT) {
1648
+ return PersonRole.ENFORCEMENT;
1649
+ }
1650
+ return null;
1651
+ }
1652
+ function getPersonRoleForTaskAssignment(roleCategory) {
1653
+ if (roleCategory === RoleCategory.JUDICIAL) {
1654
+ return PersonRole.JUDICIAL;
1655
+ }
1656
+ else if (roleCategory === RoleCategory.LEGAL_OPERATIONS) {
1657
+ return PersonRole.LEGAL_OPERATIONS;
1658
+ }
1659
+ else if (roleCategory === RoleCategory.ADMIN) {
1660
+ return PersonRole.ADMIN;
1661
+ }
1662
+ else if (roleCategory === RoleCategory.ENFORCEMENT) {
1663
+ return PersonRole.ENFORCEMENT;
1664
+ }
1665
+ return PersonRole.ALL;
1666
+ }
1667
+ function getPersonRoleForWorkAllocation(roleCategory) {
1668
+ switch (roleCategory) {
1669
+ case RoleCategory.ADMIN:
1670
+ return PersonRole.ADMIN;
1671
+ case RoleCategory.JUDICIAL:
1672
+ return PersonRole.JUDICIAL;
1673
+ case RoleCategory.LEGAL_OPERATIONS:
1674
+ return PersonRole.LEGAL_OPERATIONS;
1675
+ case RoleCategory.CTSC:
1676
+ return PersonRole.CTSC;
1677
+ case RoleCategory.ENFORCEMENT:
1678
+ return PersonRole.ENFORCEMENT;
1679
+ default:
1680
+ throw new Error(`Invalid roleCategory ${roleCategory}`);
1681
+ }
1682
+ }
1564
1683
 
1565
1684
  var AddressType;
1566
1685
  (function (AddressType) {
@@ -1708,11 +1827,11 @@ class GoogleAnalyticsService {
1708
1827
  script1.src = `https://www.googletagmanager.com/gtag/js?id=${this.googleAnalyticsKey}`;
1709
1828
  this.document.head.appendChild(script1);
1710
1829
  const script2 = this.document.createElement('script');
1711
- script2.text = `
1830
+ script2.innerHTML = `
1712
1831
  window.dataLayer = window.dataLayer || [];
1713
1832
  function gtag(){dataLayer.push(arguments);}
1714
1833
  gtag('js', new Date());
1715
- gtag('config', ${JSON.stringify(this.googleAnalyticsKey)}, {'send_page_view': false});
1834
+ gtag('config', '${this.googleAnalyticsKey}', {'send_page_view': false});
1716
1835
  `;
1717
1836
  this.document.head.appendChild(script2);
1718
1837
  }
@@ -1724,11 +1843,11 @@ class GoogleAnalyticsService {
1724
1843
  }
1725
1844
  listenForRouteChanges() {
1726
1845
  if (this.googleAnalyticsKey) {
1727
- this.router.events.subscribe((event) => {
1846
+ this.router.events.subscribe(event => {
1728
1847
  if (event instanceof NavigationEnd) {
1729
1848
  this.window.gtag('config', this.googleAnalyticsKey, {
1730
1849
  page_path: event.urlAfterRedirects,
1731
- page_title: this.title.getTitle()
1850
+ page_title: this.title.getTitle(),
1732
1851
  });
1733
1852
  }
1734
1853
  });
@@ -2457,7 +2576,8 @@ class FindAPersonService {
2457
2576
  id: caseworker.idamId,
2458
2577
  // EXUI-4758 - If user has admin role, set domain to admin
2459
2578
  // For more specific domain we need service specific role category (or other technique)
2460
- domain: this.setDomain(caseworker)
2579
+ // Note: Domain only used internally to set the PersonRole for the Person object
2580
+ domain: getPersonRole(caseworker.roleCategories)
2461
2581
  // knownAs can be added if required
2462
2582
  };
2463
2583
  if (caseworker.roleCategories.includes(roleCategory) || roleCategory === RoleCategory.ALL || caseworker.idamId === this.userId) {
@@ -2467,18 +2587,7 @@ class FindAPersonService {
2467
2587
  return people;
2468
2588
  }
2469
2589
  searchInCaseworkers(caseworkers, searchOptions) {
2470
- let roleCategory = RoleCategory.ALL;
2471
- if (!(searchOptions.userRole === PersonRole.ALL)) {
2472
- if (searchOptions.userRole === PersonRole.LEGAL_OPERATIONS) {
2473
- roleCategory = RoleCategory.LEGAL_OPERATIONS;
2474
- }
2475
- else if (searchOptions.userRole === PersonRole.ADMIN) {
2476
- roleCategory = RoleCategory.ADMIN;
2477
- }
2478
- else if (searchOptions.userRole === PersonRole.CTSC) {
2479
- roleCategory = RoleCategory.CTSC;
2480
- }
2481
- }
2590
+ const roleCategory = getRoleCategory(searchOptions.userRole);
2482
2591
  const searchTerm = searchOptions && searchOptions.searchTerm ? searchOptions.searchTerm.toLowerCase() : '';
2483
2592
  const people = caseworkers ? this.mapCaseworkers(caseworkers, roleCategory) : [];
2484
2593
  const finalPeopleList = people.filter((person) => person && person.name && person.name.toLowerCase().includes(searchTerm));
@@ -2490,19 +2599,33 @@ class FindAPersonService {
2490
2599
  searchJudicial(value, serviceId) {
2491
2600
  return this.http.post('api/prd/judicial/getJudicialUsersSearch', { searchString: value, serviceCode: serviceId });
2492
2601
  }
2493
- // Note: Domain only used internally to set the PersonRole for the Person object
2494
- setDomain(caseworker) {
2495
- if (caseworker.roleCategories.includes(RoleCategory.ADMIN)) {
2496
- return PersonRole.ADMIN;
2497
- }
2498
- if (caseworker.roleCategories.includes(RoleCategory.CTSC)) {
2499
- return PersonRole.CTSC;
2500
- }
2501
- if (caseworker.roleCategories.includes(RoleCategory.LEGAL_OPERATIONS)) {
2502
- return PersonRole.LEGAL_OPERATIONS;
2602
+ findByPersonRole(searchTerm, personRole, selectedPersons, services, userIncluded, assignedUser) {
2603
+ switch (personRole) {
2604
+ case PersonRole.JUDICIAL: {
2605
+ return this.findJudicialOrCTSCPeople(searchTerm, personRole, services, userIncluded, assignedUser).pipe(map((persons) => {
2606
+ const ids = selectedPersons.map(({ id }) => id);
2607
+ return persons.filter(({ id }) => !ids.includes(id));
2608
+ }));
2609
+ }
2610
+ case PersonRole.ALL: {
2611
+ return zip(this.findJudicialOrCTSCPeople(searchTerm, personRole, services, userIncluded, assignedUser), this.findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser)).pipe(map((separatePeople) => separatePeople[0].concat(separatePeople[1])));
2612
+ }
2613
+ case PersonRole.CTSC:
2614
+ case PersonRole.LEGAL_OPERATIONS:
2615
+ case PersonRole.ADMIN:
2616
+ case PersonRole.ENFORCEMENT: {
2617
+ return this.findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser);
2618
+ }
2619
+ default: {
2620
+ return of([]);
2621
+ }
2503
2622
  }
2504
- // return default role if no match found
2505
- return PersonRole.LEGAL_OPERATIONS;
2623
+ }
2624
+ findJudicialOrCTSCPeople(searchTerm, personRole, services, userIncluded, assignedUser) {
2625
+ return this.find({ searchTerm, userRole: personRole, services: [services], userIncluded: userIncluded, assignedUser: assignedUser });
2626
+ }
2627
+ findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser) {
2628
+ return this.findCaseworkers({ searchTerm, userRole: personRole, services: [services], userIncluded: userIncluded, assignedUser: assignedUser });
2506
2629
  }
2507
2630
  static { this.ɵfac = function FindAPersonService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FindAPersonService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(SessionStorageService)); }; }
2508
2631
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FindAPersonService, factory: FindAPersonService.ɵfac, providedIn: 'root' }); }
@@ -2617,28 +2740,8 @@ class FindPersonComponent {
2617
2740
  });
2618
2741
  }
2619
2742
  filter(searchTerm) {
2620
- const findJudicialOrCTSCPeople = this.findPersonService.find({ searchTerm, userRole: this.domain, services: [this.services], userIncluded: this.userIncluded, assignedUser: this.assignedUser });
2621
- const findCaseworkersOrAdminsOrCtsc = this.findPersonService.findCaseworkers({ searchTerm, userRole: this.domain, services: [this.services], userIncluded: this.userIncluded, assignedUser: this.assignedUser });
2622
2743
  if (searchTerm && searchTerm.length > this.minSearchCharacters) {
2623
- switch (this.domain) {
2624
- case PersonRole.JUDICIAL: {
2625
- return findJudicialOrCTSCPeople.pipe(map((persons) => {
2626
- const ids = this.selectedPersons.map(({ id }) => id);
2627
- return persons.filter(({ id }) => !ids.includes(id));
2628
- }));
2629
- }
2630
- case PersonRole.ALL: {
2631
- return zip(findJudicialOrCTSCPeople, findCaseworkersOrAdminsOrCtsc).pipe(map((separatePeople) => separatePeople[0].concat(separatePeople[1])));
2632
- }
2633
- case PersonRole.CTSC:
2634
- case PersonRole.LEGAL_OPERATIONS:
2635
- case PersonRole.ADMIN: {
2636
- return findCaseworkersOrAdminsOrCtsc;
2637
- }
2638
- default: {
2639
- return of([]);
2640
- }
2641
- }
2744
+ return this.findPersonService.findByPersonRole(searchTerm, this.domain, this.selectedPersons, this.services, this.userIncluded, this.assignedUser);
2642
2745
  }
2643
2746
  return of([]);
2644
2747
  }
@@ -2650,6 +2753,7 @@ class FindPersonComponent {
2650
2753
  if (!selectedPerson) {
2651
2754
  return '';
2652
2755
  }
2756
+ // The judiciary people contain a different object which has a fullName property
2653
2757
  if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.fullName) {
2654
2758
  return `${selectedPerson.fullName} (${selectedPerson.email})`;
2655
2759
  }
@@ -6556,134 +6660,26 @@ class SelectedCaseListComponent {
6556
6660
  }] }); })();
6557
6661
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectedCaseListComponent, { className: "SelectedCaseListComponent", filePath: "lib/components/selected-case-list/selected-case-list.component.ts", lineNumber: 12 }); })();
6558
6662
 
6559
- class SafeHtmlDirective {
6560
- constructor(elementRef, renderer, document) {
6561
- this.elementRef = elementRef;
6562
- this.renderer = renderer;
6563
- this.document = document;
6564
- this.allowedAttributes = [
6565
- 'aria-label',
6566
- 'class',
6567
- 'href',
6568
- 'rel',
6569
- 'target',
6570
- 'title'
6571
- ];
6572
- this.allowedTags = [
6573
- 'a',
6574
- 'b',
6575
- 'br',
6576
- 'div',
6577
- 'em',
6578
- 'h1',
6579
- 'h2',
6580
- 'h3',
6581
- 'h4',
6582
- 'h5',
6583
- 'h6',
6584
- 'li',
6585
- 'ol',
6586
- 'p',
6587
- 'span',
6588
- 'strong',
6589
- 'u',
6590
- 'ul'
6591
- ];
6592
- }
6593
- ngOnChanges() {
6594
- this.clearContent();
6595
- if (!this.xuilibSafeHtml) {
6596
- return;
6597
- }
6598
- // DOMPurify is the primary XSS sanitisation boundary.
6599
- const sanitizedContent = DOMPurify.sanitize(this.xuilibSafeHtml, {
6600
- ALLOWED_ATTR: this.allowedAttributes,
6601
- ALLOWED_TAGS: this.allowedTags
6602
- });
6603
- const parsedDocument = new DOMParser().parseFromString(sanitizedContent, 'text/html');
6604
- Array.from(parsedDocument.body.childNodes).forEach((node) => {
6605
- this.renderer.appendChild(this.elementRef.nativeElement, this.createSafeNode(node));
6606
- });
6607
- }
6608
- clearContent() {
6609
- const element = this.elementRef.nativeElement;
6610
- while (element.firstChild) {
6611
- this.renderer.removeChild(element, element.firstChild);
6612
- }
6613
- }
6614
- /**
6615
- * Rebuild the DOM instead of assigning sanitized content to innerHTML.
6616
- *
6617
- * DOMPurify performs the security sanitisation. Rebuilding the DOM also
6618
- * avoids introducing another innerHTML sink that security tooling may flag.
6619
- */
6620
- createSafeNode(node) {
6621
- if (node.nodeType === Node.TEXT_NODE) {
6622
- return this.renderer.createText(node.textContent ?? '');
6623
- }
6624
- if (node.nodeType !== Node.ELEMENT_NODE) {
6625
- return this.renderer.createText('');
6626
- }
6627
- const sourceElement = node;
6628
- const tagName = sourceElement.tagName.toLowerCase();
6629
- if (!this.allowedTags.includes(tagName)) {
6630
- return this.createSafeFragment(sourceElement);
6631
- }
6632
- const safeElement = this.renderer.createElement(tagName);
6633
- Array.from(sourceElement.attributes).forEach((attribute) => {
6634
- if (!this.allowedAttributes.includes(attribute.name.toLowerCase())) {
6635
- return;
6636
- }
6637
- this.renderer.setAttribute(safeElement, attribute.name, attribute.value);
6638
- });
6639
- // Defence in depth for links opened in a new browsing context.
6640
- if (tagName === 'a' &&
6641
- safeElement.getAttribute('target')?.toLowerCase() === '_blank') {
6642
- this.renderer.setAttribute(safeElement, 'rel', 'noopener noreferrer');
6643
- }
6644
- Array.from(sourceElement.childNodes).forEach((childNode) => {
6645
- this.renderer.appendChild(safeElement, this.createSafeNode(childNode));
6646
- });
6647
- return safeElement;
6648
- }
6649
- createSafeFragment(element) {
6650
- const fragment = this.document.createDocumentFragment();
6651
- Array.from(element.childNodes).forEach((childNode) => {
6652
- fragment.appendChild(this.createSafeNode(childNode));
6653
- });
6654
- return fragment;
6655
- }
6656
- static { this.ɵfac = function SafeHtmlDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SafeHtmlDirective)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(DOCUMENT$1)); }; }
6657
- static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SafeHtmlDirective, selectors: [["", "xuilibSafeHtml", ""]], inputs: { xuilibSafeHtml: "xuilibSafeHtml" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature] }); }
6658
- }
6659
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SafeHtmlDirective, [{
6660
- type: Directive,
6661
- args: [{
6662
- selector: '[xuilibSafeHtml]',
6663
- standalone: false
6664
- }]
6665
- }], () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: Document, decorators: [{
6666
- type: Inject,
6667
- args: [DOCUMENT$1]
6668
- }] }], { xuilibSafeHtml: [{
6669
- type: Input
6670
- }] }); })();
6671
-
6672
6663
  function ServiceMessageComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
6673
6664
  i0.ɵɵelement(0, "h2", 5);
6674
6665
  } if (rf & 2) {
6675
6666
  const ctx_r0 = i0.ɵɵnextContext();
6676
- i0.ɵɵproperty("xuilibSafeHtml", ctx_r0.message_cy);
6667
+ i0.ɵɵproperty("innerHTML", ctx_r0.sanitizeHtml(ctx_r0.message_cy), i0.ɵɵsanitizeHtml);
6677
6668
  } }
6678
6669
  class ServiceMessageComponent {
6679
- constructor() {
6670
+ constructor(sanitizer) {
6671
+ this.sanitizer = sanitizer;
6680
6672
  this.hideMessage = new EventEmitter();
6681
6673
  }
6682
6674
  onHideMessageEvent(key) {
6683
6675
  this.hideMessage.emit(key);
6684
6676
  }
6685
- static { this.ɵfac = function ServiceMessageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ServiceMessageComponent)(); }; }
6686
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessageComponent, selectors: [["xuilib-service-message"]], inputs: { message_en: "message_en", message_cy: "message_cy", key: "key" }, outputs: { hideMessage: "hideMessage" }, standalone: false, decls: 12, vars: 8, consts: [[1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "img", "aria-label", "hmcts-warning-icon", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s", 3, "xuilibSafeHtml"], ["tabindex", "0", 1, "govuk-link--no-visited-state", 3, "click", "keyup.enter", "routerLink"]], template: function ServiceMessageComponent_Template(rf, ctx) { if (rf & 1) {
6677
+ // ensure no dangerous HTML is rendered in the service message banner
6678
+ sanitizeHtml(content) {
6679
+ return this.sanitizer.sanitize(SecurityContext.HTML, content ?? '') ?? '';
6680
+ }
6681
+ static { this.ɵfac = function ServiceMessageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ServiceMessageComponent)(i0.ɵɵdirectiveInject(i2$1.DomSanitizer)); }; }
6682
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessageComponent, selectors: [["xuilib-service-message"]], inputs: { message_en: "message_en", message_cy: "message_cy", key: "key" }, outputs: { hideMessage: "hideMessage" }, standalone: false, decls: 12, vars: 8, consts: [[1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "img", "aria-label", "hmcts-warning-icon", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s", 3, "innerHTML"], ["tabindex", "0", 1, "govuk-link--no-visited-state", 3, "click", "keyup.enter", "routerLink"]], template: function ServiceMessageComponent_Template(rf, ctx) { if (rf & 1) {
6687
6683
  i0.ɵɵelementStart(0, "div", 0);
6688
6684
  i0.ɵɵnamespaceSVG();
6689
6685
  i0.ɵɵelementStart(1, "svg", 1);
@@ -6705,17 +6701,17 @@ class ServiceMessageComponent {
6705
6701
  i0.ɵɵadvance(5);
6706
6702
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "Warning"));
6707
6703
  i0.ɵɵadvance(2);
6708
- i0.ɵɵproperty("xuilibSafeHtml", ctx.message_en);
6704
+ i0.ɵɵproperty("innerHTML", ctx.sanitizeHtml(ctx.message_en), i0.ɵɵsanitizeHtml);
6709
6705
  i0.ɵɵadvance();
6710
6706
  i0.ɵɵconditional(ctx.message_cy ? 8 : -1);
6711
6707
  i0.ɵɵadvance(2);
6712
6708
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(11, 6, "Hide message"));
6713
- } }, dependencies: [i1$1.RouterLink, SafeHtmlDirective, i2.RpxTranslatePipe], styles: [".govuk-link--no-visited-state[_ngcontent-%COMP%]{cursor:pointer}"] }); }
6709
+ } }, dependencies: [i1$1.RouterLink, i2.RpxTranslatePipe], styles: [".govuk-link--no-visited-state[_ngcontent-%COMP%]{cursor:pointer}"] }); }
6714
6710
  }
6715
6711
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ServiceMessageComponent, [{
6716
6712
  type: Component,
6717
- args: [{ selector: 'xuilib-service-message', standalone: false, template: "<div class=\"hmcts-banner hmcts-banner--warning\">\n\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"img\" aria-label=\"hmcts-warning-icon\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\" [xuilibSafeHtml]=\"message_en\"></h2>\n @if (message_cy) {\n <h2 class=\"govuk-heading-s\" [xuilibSafeHtml]=\"message_cy\"></h2>\n }\n <a [routerLink]=\"\" tabindex=\"0\" class=\"govuk-link--no-visited-state\" (click)=\"onHideMessageEvent(key)\" (keyup.enter)=\"onHideMessageEvent(key)\">{{'Hide message' | rpxTranslate}}</a>\n </div>\n\n</div>\n", styles: [".govuk-link--no-visited-state{cursor:pointer}\n"] }]
6718
- }], () => [], { message_en: [{
6713
+ args: [{ selector: 'xuilib-service-message', standalone: false, template: "<div class=\"hmcts-banner hmcts-banner--warning\">\n\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"img\" aria-label=\"hmcts-warning-icon\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\" [innerHTML]=\"sanitizeHtml(message_en)\"></h2>\n @if (message_cy) {\n <h2 class=\"govuk-heading-s\" [innerHTML]=\"sanitizeHtml(message_cy)\"></h2>\n }\n <a [routerLink]=\"\" tabindex=\"0\" class=\"govuk-link--no-visited-state\" (click)=\"onHideMessageEvent(key)\" (keyup.enter)=\"onHideMessageEvent(key)\">{{'Hide message' | rpxTranslate}}</a>\n </div>\n\n</div>", styles: [".govuk-link--no-visited-state{cursor:pointer}\n"] }]
6714
+ }], () => [{ type: i2$1.DomSanitizer }], { message_en: [{
6719
6715
  type: Input
6720
6716
  }], message_cy: [{
6721
6717
  type: Input
@@ -6724,7 +6720,7 @@ class ServiceMessageComponent {
6724
6720
  }], hideMessage: [{
6725
6721
  type: Output
6726
6722
  }] }); })();
6727
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ServiceMessageComponent, { className: "ServiceMessageComponent", filePath: "lib/components/service-message/service-message.component.ts", lineNumber: 10 }); })();
6723
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ServiceMessageComponent, { className: "ServiceMessageComponent", filePath: "lib/components/service-message/service-message.component.ts", lineNumber: 11 }); })();
6728
6724
 
6729
6725
  function ServiceMessagesComponent_Conditional_0_For_2_Template(rf, ctx) { if (rf & 1) {
6730
6726
  i0.ɵɵelementStart(0, "div", 1);
@@ -6740,19 +6736,18 @@ function ServiceMessagesComponent_Conditional_0_For_2_Template(rf, ctx) { if (rf
6740
6736
  i0.ɵɵelementStart(7, "h2", 6);
6741
6737
  i0.ɵɵtext(8, "Error:");
6742
6738
  i0.ɵɵelementEnd();
6743
- i0.ɵɵelementStart(9, "p");
6744
- i0.ɵɵtext(10);
6745
- i0.ɵɵelementEnd()()();
6739
+ i0.ɵɵelement(9, "p", 7);
6740
+ i0.ɵɵelementEnd()();
6746
6741
  } if (rf & 2) {
6747
6742
  const errMsg_r1 = ctx.$implicit;
6748
6743
  i0.ɵɵadvance(5);
6749
6744
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 2, "Warning"));
6750
- i0.ɵɵadvance(5);
6751
- i0.ɵɵtextInterpolate(errMsg_r1.message);
6745
+ i0.ɵɵadvance(4);
6746
+ i0.ɵɵproperty("innerHTML", errMsg_r1.message, i0.ɵɵsanitizeHtml);
6752
6747
  } }
6753
6748
  function ServiceMessagesComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
6754
6749
  i0.ɵɵelementStart(0, "div", 0);
6755
- i0.ɵɵrepeaterCreate(1, ServiceMessagesComponent_Conditional_0_For_2_Template, 11, 4, "div", 1, i0.ɵɵrepeaterTrackByIdentity);
6750
+ i0.ɵɵrepeaterCreate(1, ServiceMessagesComponent_Conditional_0_For_2_Template, 10, 4, "div", 1, i0.ɵɵrepeaterTrackByIdentity);
6756
6751
  i0.ɵɵelementEnd();
6757
6752
  } if (rf & 2) {
6758
6753
  const ctx_r1 = i0.ɵɵnextContext();
@@ -6761,7 +6756,7 @@ function ServiceMessagesComponent_Conditional_0_Template(rf, ctx) { if (rf & 1)
6761
6756
  } }
6762
6757
  function ServiceMessagesComponent_Conditional_1_For_2_Template(rf, ctx) { if (rf & 1) {
6763
6758
  const _r3 = i0.ɵɵgetCurrentView();
6764
- i0.ɵɵelementStart(0, "xuilib-service-message", 8);
6759
+ i0.ɵɵelementStart(0, "xuilib-service-message", 9);
6765
6760
  i0.ɵɵpipe(1, "rpxTranslate");
6766
6761
  i0.ɵɵpipe(2, "rpxTranslate");
6767
6762
  i0.ɵɵlistener("hideMessage", function ServiceMessagesComponent_Conditional_1_For_2_Template_xuilib_service_message_hideMessage_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.hideMessage($event)); });
@@ -6772,7 +6767,7 @@ function ServiceMessagesComponent_Conditional_1_For_2_Template(rf, ctx) { if (rf
6772
6767
  } }
6773
6768
  function ServiceMessagesComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
6774
6769
  i0.ɵɵelementStart(0, "div", 0);
6775
- i0.ɵɵrepeaterCreate(1, ServiceMessagesComponent_Conditional_1_For_2_Template, 3, 7, "xuilib-service-message", 7, i0.ɵɵrepeaterTrackByIdentity);
6770
+ i0.ɵɵrepeaterCreate(1, ServiceMessagesComponent_Conditional_1_For_2_Template, 3, 7, "xuilib-service-message", 8, i0.ɵɵrepeaterTrackByIdentity);
6776
6771
  i0.ɵɵelementEnd();
6777
6772
  } if (rf & 2) {
6778
6773
  const ctx_r1 = i0.ɵɵnextContext();
@@ -6874,7 +6869,7 @@ class ServiceMessagesComponent {
6874
6869
  return cookie ? JSON.parse(decodeURIComponent(cookie.split("=")[1])) : [];
6875
6870
  }
6876
6871
  static { this.ɵfac = function ServiceMessagesComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ServiceMessagesComponent)(i0.ɵɵdirectiveInject(FeatureToggleService)); }; }
6877
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessagesComponent, selectors: [["xuilib-service-messages"]], inputs: { userRoles: "userRoles", featureToggleKey: "featureToggleKey", serviceMessageCookie: "serviceMessageCookie" }, standalone: false, decls: 2, vars: 2, consts: [[1, "govuk-width-container", "govuk-!-margin-top-6"], [1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s"], [3, "key", "message_en", "message_cy"], [3, "hideMessage", "key", "message_en", "message_cy"]], template: function ServiceMessagesComponent_Template(rf, ctx) { if (rf & 1) {
6872
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessagesComponent, selectors: [["xuilib-service-messages"]], inputs: { userRoles: "userRoles", featureToggleKey: "featureToggleKey", serviceMessageCookie: "serviceMessageCookie" }, standalone: false, decls: 2, vars: 2, consts: [[1, "govuk-width-container", "govuk-!-margin-top-6"], [1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s"], [3, "innerHTML"], [3, "key", "message_en", "message_cy"], [3, "hideMessage", "key", "message_en", "message_cy"]], template: function ServiceMessagesComponent_Template(rf, ctx) { if (rf & 1) {
6878
6873
  i0.ɵɵconditionalCreate(0, ServiceMessagesComponent_Conditional_0_Template, 3, 0, "div", 0);
6879
6874
  i0.ɵɵconditionalCreate(1, ServiceMessagesComponent_Conditional_1_Template, 3, 0, "div", 0);
6880
6875
  } if (rf & 2) {
@@ -6885,7 +6880,7 @@ class ServiceMessagesComponent {
6885
6880
  }
6886
6881
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ServiceMessagesComponent, [{
6887
6882
  type: Component,
6888
- args: [{ selector: "xuilib-service-messages", standalone: false, template: "@if (isBannerError) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (errMsg of bannerErrorMsgs; track errMsg) {\n <div class=\"hmcts-banner hmcts-banner--warning\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\">Error:</h2>\n <p>{{ errMsg.message }}</p>\n </div>\n </div>\n }\n </div>\n}\n@if (filteredMessages?.length > 0) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (message of filteredMessages; track message) {\n <xuilib-service-message [key]=\"message\"\n [message_en]=\"message?.message_en | rpxTranslate\"\n [message_cy]=\"message?.message_cy | rpxTranslate\"\n (hideMessage)=\"hideMessage($event)\">\n </xuilib-service-message>\n }\n </div>\n}\n" }]
6883
+ args: [{ selector: "xuilib-service-messages", standalone: false, template: "@if (isBannerError) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (errMsg of bannerErrorMsgs; track errMsg) {\n <div class=\"hmcts-banner hmcts-banner--warning\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\">Error:</h2>\n <p [innerHTML]=\"errMsg.message\"></p>\n </div>\n </div>\n }\n </div>\n}\n@if (filteredMessages?.length > 0) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (message of filteredMessages; track message) {\n <xuilib-service-message [key]=\"message\"\n [message_en]=\"message?.message_en | rpxTranslate\"\n [message_cy]=\"message?.message_cy | rpxTranslate\"\n (hideMessage)=\"hideMessage($event)\">\n </xuilib-service-message>\n }\n </div>\n}" }]
6889
6884
  }], () => [{ type: FeatureToggleService }], { userRoles: [{
6890
6885
  type: Input
6891
6886
  }], featureToggleKey: [{
@@ -7740,7 +7735,7 @@ function TermsAndConditionsComponent_Case_0_Template(rf, ctx) { if (rf & 1) {
7740
7735
  } if (rf & 2) {
7741
7736
  const ctx_r0 = i0.ɵɵnextContext();
7742
7737
  i0.ɵɵadvance();
7743
- i0.ɵɵproperty("xuilibSafeHtml", i0.ɵɵpipeBind1(2, 1, ctx_r0.document.content));
7738
+ i0.ɵɵproperty("innerHTML", ctx_r0.sanitizeHtml(i0.ɵɵpipeBind1(2, 1, ctx_r0.document.content)), i0.ɵɵsanitizeHtml);
7744
7739
  } }
7745
7740
  function TermsAndConditionsComponent_Case_1_Template(rf, ctx) { if (rf & 1) {
7746
7741
  i0.ɵɵelementStart(0, "xuilib-tc-display-plain");
@@ -7762,22 +7757,28 @@ function TermsAndConditionsComponent_Case_2_Template(rf, ctx) { if (rf & 1) {
7762
7757
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, "An error occured. Please try again."), " ");
7763
7758
  } }
7764
7759
  class TermsAndConditionsComponent {
7765
- constructor() { }
7766
- static { this.ɵfac = function TermsAndConditionsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TermsAndConditionsComponent)(); }; }
7767
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TermsAndConditionsComponent, selectors: [["xuilib-terms-and-conditions"]], inputs: { document: "document" }, standalone: false, decls: 3, vars: 1, consts: [[3, "xuilibSafeHtml"]], template: function TermsAndConditionsComponent_Template(rf, ctx) { if (rf & 1) {
7760
+ constructor(sanitizer) {
7761
+ this.sanitizer = sanitizer;
7762
+ }
7763
+ // ensure no dangerous HTML is rendered in the terms and conditions document
7764
+ sanitizeHtml(content) {
7765
+ return this.sanitizer.sanitize(SecurityContext.HTML, content ?? '') ?? '';
7766
+ }
7767
+ static { this.ɵfac = function TermsAndConditionsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TermsAndConditionsComponent)(i0.ɵɵdirectiveInject(i2$1.DomSanitizer)); }; }
7768
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TermsAndConditionsComponent, selectors: [["xuilib-terms-and-conditions"]], inputs: { document: "document" }, standalone: false, decls: 3, vars: 1, consts: [[3, "innerHTML"]], template: function TermsAndConditionsComponent_Template(rf, ctx) { if (rf & 1) {
7768
7769
  i0.ɵɵconditionalCreate(0, TermsAndConditionsComponent_Case_0_Template, 3, 3, "xuilib-tc-display-html")(1, TermsAndConditionsComponent_Case_1_Template, 3, 3, "xuilib-tc-display-plain")(2, TermsAndConditionsComponent_Case_2_Template, 3, 3, "div");
7769
7770
  } if (rf & 2) {
7770
7771
  let tmp_0_0;
7771
7772
  i0.ɵɵconditional((tmp_0_0 = ctx.document.mimeType) === "text/html" ? 0 : tmp_0_0 === "text/plain" ? 1 : 2);
7772
- } }, dependencies: [TcDisplayHtmlComponent, TcDisplayPlainComponent, SafeHtmlDirective, i2.RpxTranslatePipe], styles: ["[_nghost-%COMP%]{display:block;width:100%}"] }); }
7773
+ } }, dependencies: [TcDisplayHtmlComponent, TcDisplayPlainComponent, i2.RpxTranslatePipe], styles: ["[_nghost-%COMP%]{display:block;width:100%}"] }); }
7773
7774
  }
7774
7775
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TermsAndConditionsComponent, [{
7775
7776
  type: Component,
7776
- args: [{ selector: 'xuilib-terms-and-conditions', standalone: false, template: "\n@switch (document.mimeType) {\n @case ('text/html') {\n <xuilib-tc-display-html>\n <div [xuilibSafeHtml]=\"document.content | rpxTranslate\"></div>\n </xuilib-tc-display-html>\n }\n @case ('text/plain') {\n <xuilib-tc-display-plain>\n {{ document.content | rpxTranslate}}\n </xuilib-tc-display-plain>\n }\n @default {\n <div>\n {{'An error occured. Please try again.' | rpxTranslate}}\n </div>\n }\n}\n", styles: [":host{display:block;width:100%}\n"] }]
7777
- }], () => [], { document: [{
7777
+ args: [{ selector: 'xuilib-terms-and-conditions', standalone: false, template: "\n@switch (document.mimeType) {\n @case ('text/html') {\n <xuilib-tc-display-html>\n <div [innerHTML]=\"sanitizeHtml(document.content | rpxTranslate)\"></div>\n </xuilib-tc-display-html>\n }\n @case ('text/plain') {\n <xuilib-tc-display-plain>\n {{ document.content | rpxTranslate}}\n </xuilib-tc-display-plain>\n }\n @default {\n <div>\n {{'An error occured. Please try again.' | rpxTranslate}}\n </div>\n }\n}\n", styles: [":host{display:block;width:100%}\n"] }]
7778
+ }], () => [{ type: i2$1.DomSanitizer }], { document: [{
7778
7779
  type: Input
7779
7780
  }] }); })();
7780
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TermsAndConditionsComponent, { className: "TermsAndConditionsComponent", filePath: "lib/components/terms-and-conditions/terms-and-conditions.component.ts", lineNumber: 10 }); })();
7781
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TermsAndConditionsComponent, { className: "TermsAndConditionsComponent", filePath: "lib/components/terms-and-conditions/terms-and-conditions.component.ts", lineNumber: 11 }); })();
7781
7782
 
7782
7783
  function UserDetailsComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
7783
7784
  i0.ɵɵelementStart(0, "div", 0)(1, "span", 4);
@@ -10500,23 +10501,21 @@ function HmctsPrimaryNavigationComponent_Conditional_0_Conditional_2_Template(rf
10500
10501
  i0.ɵɵelement(0, "div", 2);
10501
10502
  } }
10502
10503
  function HmctsPrimaryNavigationComponent_Conditional_0_For_5_Template(rf, ctx) { if (rf & 1) {
10503
- i0.ɵɵelementStart(0, "li", 4)(1, "a", 5);
10504
- i0.ɵɵtext(2);
10505
- i0.ɵɵpipe(3, "rpxTranslate");
10506
- i0.ɵɵelementEnd()();
10504
+ i0.ɵɵelementStart(0, "li", 4);
10505
+ i0.ɵɵelement(1, "a", 5);
10506
+ i0.ɵɵpipe(2, "rpxTranslate");
10507
+ i0.ɵɵelementEnd();
10507
10508
  } if (rf & 2) {
10508
10509
  const item_r1 = ctx.$implicit;
10509
10510
  i0.ɵɵadvance();
10510
- i0.ɵɵproperty("routerLink", item_r1.href);
10511
+ i0.ɵɵproperty("routerLink", item_r1.href)("innerHTML", i0.ɵɵpipeBind1(2, 3, item_r1.text), i0.ɵɵsanitizeHtml);
10511
10512
  i0.ɵɵattribute("aria-current", item_r1.active ? true : null);
10512
- i0.ɵɵadvance();
10513
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 3, item_r1.text));
10514
10513
  } }
10515
10514
  function HmctsPrimaryNavigationComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
10516
10515
  i0.ɵɵelementStart(0, "nav", 0)(1, "div", 1);
10517
10516
  i0.ɵɵconditionalCreate(2, HmctsPrimaryNavigationComponent_Conditional_0_Conditional_2_Template, 1, 0, "div", 2);
10518
10517
  i0.ɵɵelementStart(3, "ul", 3);
10519
- i0.ɵɵrepeaterCreate(4, HmctsPrimaryNavigationComponent_Conditional_0_For_5_Template, 4, 5, "li", 4, i0.ɵɵrepeaterTrackByIdentity);
10518
+ i0.ɵɵrepeaterCreate(4, HmctsPrimaryNavigationComponent_Conditional_0_For_5_Template, 3, 5, "li", 4, i0.ɵɵrepeaterTrackByIdentity);
10520
10519
  i0.ɵɵelementEnd()()();
10521
10520
  } if (rf & 2) {
10522
10521
  const ctx_r1 = i0.ɵɵnextContext();
@@ -10533,7 +10532,7 @@ class HmctsPrimaryNavigationComponent {
10533
10532
  constructor() {
10534
10533
  }
10535
10534
  static { this.ɵfac = function HmctsPrimaryNavigationComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HmctsPrimaryNavigationComponent)(); }; }
10536
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HmctsPrimaryNavigationComponent, selectors: [["xuilib-hmcts-primary-navigation"]], inputs: { userLoggedIn: "userLoggedIn", label: "label", items: "items", isBrandedHeader: "isBrandedHeader" }, standalone: false, decls: 1, vars: 1, consts: [[1, "hmcts-primary-navigation"], [1, "hmcts-primary-navigation__container"], [1, "govuk-header__logo"], [1, "hmcts-primary-navigation__list"], [1, "hmcts-primary-navigation__item"], [1, "hmcts-primary-navigation__link", 3, "routerLink"]], template: function HmctsPrimaryNavigationComponent_Template(rf, ctx) { if (rf & 1) {
10535
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HmctsPrimaryNavigationComponent, selectors: [["xuilib-hmcts-primary-navigation"]], inputs: { userLoggedIn: "userLoggedIn", label: "label", items: "items", isBrandedHeader: "isBrandedHeader" }, standalone: false, decls: 1, vars: 1, consts: [[1, "hmcts-primary-navigation"], [1, "hmcts-primary-navigation__container"], [1, "govuk-header__logo"], [1, "hmcts-primary-navigation__list"], [1, "hmcts-primary-navigation__item"], [1, "hmcts-primary-navigation__link", 3, "routerLink", "innerHTML"]], template: function HmctsPrimaryNavigationComponent_Template(rf, ctx) { if (rf & 1) {
10537
10536
  i0.ɵɵconditionalCreate(0, HmctsPrimaryNavigationComponent_Conditional_0_Template, 6, 2, "nav", 0);
10538
10537
  } if (rf & 2) {
10539
10538
  i0.ɵɵconditional(ctx.isUserLoggedIn ? 0 : -1);
@@ -10541,7 +10540,7 @@ class HmctsPrimaryNavigationComponent {
10541
10540
  }
10542
10541
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HmctsPrimaryNavigationComponent, [{
10543
10542
  type: Component,
10544
- args: [{ selector: 'xuilib-hmcts-primary-navigation', standalone: false, template: "@if (isUserLoggedIn) {\n <nav class=\"hmcts-primary-navigation\" [attr.aria-label]=\"label\">\n <div class=\"hmcts-primary-navigation__container\">\n @if (isBrandedHeader) {\n <div class=\"govuk-header__logo\"></div>\n }\n <ul class=\"hmcts-primary-navigation__list\">\n @for (item of items; track item) {\n <li class=\"hmcts-primary-navigation__item\" >\n <a class=\"hmcts-primary-navigation__link\" [attr.aria-current]=\"item.active ? true: null\" [routerLink]=\"item.href\">{{ item.text | rpxTranslate }}</a>\n </li>\n }\n </ul>\n </div>\n </nav>\n}\n", styles: [".govuk-width-container{max-width:960px;margin-right:15px;margin-left:15px}@supports (margin: max(0px)){.govuk-width-container{margin-right:max(15px,calc(15px + env(safe-area-inset-right)));margin-left:max(15px,calc(15px + env(safe-area-inset-left)))}}@media (min-width: 40.0625em){.govuk-width-container{margin-right:30px;margin-left:30px}@supports (margin: max(0px)){.govuk-width-container{margin-right:max(30px,calc(15px + env(safe-area-inset-right)));margin-left:max(30px,calc(15px + env(safe-area-inset-left)))}}}@media (min-width: 1020px){.govuk-width-container{margin-right:auto;margin-left:auto}@supports (margin: max(0px)){.govuk-width-container{margin-right:auto;margin-left:auto}}}.hmcts-primary-navigation{background-color:#0b0c0c}.hmcts-primary-navigation__container{max-width:960px;margin-right:15px;margin-left:15px}@supports (margin: max(0px)){.hmcts-primary-navigation__container{margin-right:max(15px,calc(15px + env(safe-area-inset-right)));margin-left:max(15px,calc(15px + env(safe-area-inset-left)))}}@media (min-width: 40.0625em){.hmcts-primary-navigation__container{margin-right:30px;margin-left:30px}@supports (margin: max(0px)){.hmcts-primary-navigation__container{margin-right:max(30px,calc(15px + env(safe-area-inset-right)));margin-left:max(30px,calc(15px + env(safe-area-inset-left)))}}}@media (min-width: 1020px){.hmcts-primary-navigation__container{margin-right:auto;margin-left:auto}@supports (margin: max(0px)){.hmcts-primary-navigation__container{margin-right:auto;margin-left:auto}}}.hmcts-primary-navigation__container{font-size:0;text-align:justify}.hmcts-primary-navigation__container:after{content:\"\";display:inline-block;width:100%}.hmcts-primary-navigation__list{font-size:0;list-style:none;margin:0;padding:0}.hmcts-primary-navigation__item{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@font-face{font-family:GDS Transport;font-style:normal;font-weight:400;src:url(/assets/fonts/light-94a07e06a1-v2.woff2) format(\"woff2\"),url(/assets/fonts/light-f591b13f7d-v2.woff) format(\"woff\");font-display:fallback}@font-face{font-family:GDS Transport;font-style:normal;font-weight:700;src:url(/assets/fonts/bold-b542beb274-v2.woff2) format(\"woff2\"),url(/assets/fonts/bold-affa96571d-v2.woff) format(\"woff\");font-display:fallback}@media print{.hmcts-primary-navigation__item{font-family:sans-serif}}.hmcts-primary-navigation__item{font-weight:700;font-size:1rem;line-height:1.25}@media (min-width: 40.0625em){.hmcts-primary-navigation__item{font-size:1.1875rem;line-height:1.3157894737}}@media print{.hmcts-primary-navigation__item{font-size:14pt;line-height:1.15}}.hmcts-primary-navigation__item{display:inline-block;margin-right:20px;margin-top:0}.hmcts-primary-navigation__item:last-child{margin-right:0}.hmcts-primary-navigation__link{display:block;padding-bottom:13px;padding-top:12px;text-decoration:underline}.hmcts-primary-navigation__link:link,.hmcts-primary-navigation__link:visited{color:#fff}.hmcts-primary-navigation__link:focus{color:#0b0c0c;position:relative;z-index:1}.hmcts-primary-navigation__link[aria-current]{color:#fff;position:relative;text-decoration:none}.hmcts-primary-navigation__link[aria-current]:before{background-color:#fff;content:\"\";display:block;height:5px;position:absolute;bottom:0;left:0;width:100%}.hmcts-primary-navigation__link[aria-current]:focus{color:#0b0c0c;position:relative}.hmcts-primary-navigation__link[aria-current]:focus:before{background-color:#0b0c0c}\n/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */\n"] }]
10543
+ args: [{ selector: 'xuilib-hmcts-primary-navigation', standalone: false, template: "@if (isUserLoggedIn) {\n <nav class=\"hmcts-primary-navigation\" [attr.aria-label]=\"label\">\n <div class=\"hmcts-primary-navigation__container\">\n @if (isBrandedHeader) {\n <div class=\"govuk-header__logo\"></div>\n }\n <ul class=\"hmcts-primary-navigation__list\">\n @for (item of items; track item) {\n <li class=\"hmcts-primary-navigation__item\" >\n <a class=\"hmcts-primary-navigation__link\" [attr.aria-current]=\"item.active ? true: null\" [routerLink]=\"item.href\" [innerHTML]=\"item.text | rpxTranslate\"></a>\n </li>\n }\n </ul>\n </div>\n </nav>\n}\n", styles: [".govuk-width-container{max-width:960px;margin-right:15px;margin-left:15px}@supports (margin: max(0px)){.govuk-width-container{margin-right:max(15px,calc(15px + env(safe-area-inset-right)));margin-left:max(15px,calc(15px + env(safe-area-inset-left)))}}@media (min-width: 40.0625em){.govuk-width-container{margin-right:30px;margin-left:30px}@supports (margin: max(0px)){.govuk-width-container{margin-right:max(30px,calc(15px + env(safe-area-inset-right)));margin-left:max(30px,calc(15px + env(safe-area-inset-left)))}}}@media (min-width: 1020px){.govuk-width-container{margin-right:auto;margin-left:auto}@supports (margin: max(0px)){.govuk-width-container{margin-right:auto;margin-left:auto}}}.hmcts-primary-navigation{background-color:#0b0c0c}.hmcts-primary-navigation__container{max-width:960px;margin-right:15px;margin-left:15px}@supports (margin: max(0px)){.hmcts-primary-navigation__container{margin-right:max(15px,calc(15px + env(safe-area-inset-right)));margin-left:max(15px,calc(15px + env(safe-area-inset-left)))}}@media (min-width: 40.0625em){.hmcts-primary-navigation__container{margin-right:30px;margin-left:30px}@supports (margin: max(0px)){.hmcts-primary-navigation__container{margin-right:max(30px,calc(15px + env(safe-area-inset-right)));margin-left:max(30px,calc(15px + env(safe-area-inset-left)))}}}@media (min-width: 1020px){.hmcts-primary-navigation__container{margin-right:auto;margin-left:auto}@supports (margin: max(0px)){.hmcts-primary-navigation__container{margin-right:auto;margin-left:auto}}}.hmcts-primary-navigation__container{font-size:0;text-align:justify}.hmcts-primary-navigation__container:after{content:\"\";display:inline-block;width:100%}.hmcts-primary-navigation__list{font-size:0;list-style:none;margin:0;padding:0}.hmcts-primary-navigation__item{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@font-face{font-family:GDS Transport;font-style:normal;font-weight:400;src:url(/assets/fonts/light-94a07e06a1-v2.woff2) format(\"woff2\"),url(/assets/fonts/light-f591b13f7d-v2.woff) format(\"woff\");font-display:fallback}@font-face{font-family:GDS Transport;font-style:normal;font-weight:700;src:url(/assets/fonts/bold-b542beb274-v2.woff2) format(\"woff2\"),url(/assets/fonts/bold-affa96571d-v2.woff) format(\"woff\");font-display:fallback}@media print{.hmcts-primary-navigation__item{font-family:sans-serif}}.hmcts-primary-navigation__item{font-weight:700;font-size:1rem;line-height:1.25}@media (min-width: 40.0625em){.hmcts-primary-navigation__item{font-size:1.1875rem;line-height:1.3157894737}}@media print{.hmcts-primary-navigation__item{font-size:14pt;line-height:1.15}}.hmcts-primary-navigation__item{display:inline-block;margin-right:20px;margin-top:0}.hmcts-primary-navigation__item:last-child{margin-right:0}.hmcts-primary-navigation__link{display:block;padding-bottom:13px;padding-top:12px;text-decoration:underline}.hmcts-primary-navigation__link:link,.hmcts-primary-navigation__link:visited{color:#fff}.hmcts-primary-navigation__link:focus{color:#0b0c0c;position:relative;z-index:1}.hmcts-primary-navigation__link[aria-current]{color:#fff;position:relative;text-decoration:none}.hmcts-primary-navigation__link[aria-current]:before{background-color:#fff;content:\"\";display:block;height:5px;position:absolute;bottom:0;left:0;width:100%}.hmcts-primary-navigation__link[aria-current]:focus{color:#0b0c0c;position:relative}.hmcts-primary-navigation__link[aria-current]:focus:before{background-color:#0b0c0c}\n/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */\n"] }]
10545
10544
  }], () => [], { userLoggedIn: [{
10546
10545
  type: Input
10547
10546
  }], label: [{
@@ -10615,7 +10614,6 @@ const COMMON_COMPONENTS = [
10615
10614
  ContactDetailsComponent,
10616
10615
  FeatureToggleDirective,
10617
10616
  LetDirective,
10618
- SafeHtmlDirective,
10619
10617
  HmctsSessionDialogComponent,
10620
10618
  UserListComponent,
10621
10619
  UserDetailsComponent,
@@ -10730,7 +10728,6 @@ class ExuiCommonLibModule {
10730
10728
  ContactDetailsComponent,
10731
10729
  FeatureToggleDirective,
10732
10730
  LetDirective,
10733
- SafeHtmlDirective,
10734
10731
  HmctsSessionDialogComponent,
10735
10732
  UserListComponent,
10736
10733
  UserDetailsComponent,
@@ -10797,7 +10794,6 @@ class ExuiCommonLibModule {
10797
10794
  ContactDetailsComponent,
10798
10795
  FeatureToggleDirective,
10799
10796
  LetDirective,
10800
- SafeHtmlDirective,
10801
10797
  HmctsSessionDialogComponent,
10802
10798
  UserListComponent,
10803
10799
  UserDetailsComponent,
@@ -10933,5 +10929,5 @@ function radioGroupValidator() {
10933
10929
  * Generated bundle index. Do not edit.
10934
10930
  */
10935
10931
 
10936
- export { AccessibilityComponent, AddressMessageEnum, AddressModel, AddressOption, AddressService, AnonymousFeatureUser, BadgeColour, BookingCheckType, COMMON_COMPONENTS, CapitalizePipe, CheckboxListComponent, ContactDetailsComponent, CookieBannerComponent, CookieService, DateBadgeColour, DueDateComponent, ExuiCommonLibModule, ExuiPageWrapperComponent, FeatureToggleDirective, FeatureToggleGuard, FeatureToggleService, FilterService, FindLocationComponent, FindPersonComponent, FindServiceComponent, FindTaskNameComponent, FindWorkTypeComponent, GOV_UI_COMPONENTS, GenericFilterComponent, GoogleAnalyticsService, GoogleTagManagerService, GovUiService, GovUkCheckboxComponent, GovUkCheckboxesComponent, GovUkDateComponent, GovUkErrorMessageComponent, GovUkFieldsetComponent, GovUkFileUploadComponent, GovUkFormGroupWrapperComponent, GovUkInputComponent, GovUkLabelComponent, GovUkRadioComponent, GovUkRadiosComponent, GovUkSelectComponent, GovUkTextareaComponent, GovukTableColumnConfig, GovukTableComponent, HasLoadingState, HmctsBannerComponent, HmctsErrorSummaryComponent, HmctsIdentityBarComponent, HmctsMainWrapperComponent, HmctsPaginationComponent, HmctsPrimaryNavigationComponent, HmctsSessionDialogComponent, HmctsSubNavigationComponent, InviteUserFormComponent, InviteUserPermissionComponent, LaunchDarklyService, LetContext, LetDirective, LoadingService, LoadingSpinnerComponent, LocationService, LoggedInFeatureUser, ManageSessionServices, PaginationComponent, PersonRole, RadioFilterFieldConfig, RefDataService, RemoveHostDirective, RoleCategory, RoleGuard, RoleMatching, RoleService, SECONDS_IN_A_DAY, SafeHtmlDirective, SearchJudicialsComponent, SearchLocationComponent, SearchServiceComponent, SearchVenueComponent, SearchWorkTypeComponent, SelectedCaseComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseComponent, ShareCaseConfirmComponent, SharedCaseErrorMessages, TabComponent, TaskService, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, TimeoutNotificationsService, UserDetailsComponent, UserListComponent, UserSelectComponent, WriteAddressFieldComponent, WriteAddressInputsComponent, checkboxesBeCheckedValidator, dateValidator, radioGroupValidator, windowProvider, windowToken };
10932
+ export { AccessibilityComponent, AddressMessageEnum, AddressModel, AddressOption, AddressService, AnonymousFeatureUser, BadgeColour, BookingCheckType, COMMON_COMPONENTS, CapitalizePipe, CheckboxListComponent, ContactDetailsComponent, CookieBannerComponent, CookieService, DateBadgeColour, DueDateComponent, ExuiCommonLibModule, ExuiPageWrapperComponent, FeatureToggleDirective, FeatureToggleGuard, FeatureToggleService, FilterService, FindLocationComponent, FindPersonComponent, FindServiceComponent, FindTaskNameComponent, FindWorkTypeComponent, GOV_UI_COMPONENTS, GenericFilterComponent, GoogleAnalyticsService, GoogleTagManagerService, GovUiService, GovUkCheckboxComponent, GovUkCheckboxesComponent, GovUkDateComponent, GovUkErrorMessageComponent, GovUkFieldsetComponent, GovUkFileUploadComponent, GovUkFormGroupWrapperComponent, GovUkInputComponent, GovUkLabelComponent, GovUkRadioComponent, GovUkRadiosComponent, GovUkSelectComponent, GovUkTextareaComponent, GovukTableColumnConfig, GovukTableComponent, HasLoadingState, HmctsBannerComponent, HmctsErrorSummaryComponent, HmctsIdentityBarComponent, HmctsMainWrapperComponent, HmctsPaginationComponent, HmctsPrimaryNavigationComponent, HmctsSessionDialogComponent, HmctsSubNavigationComponent, InviteUserFormComponent, InviteUserPermissionComponent, LaunchDarklyService, LetContext, LetDirective, LoadingService, LoadingSpinnerComponent, LocationService, LoggedInFeatureUser, ManageSessionServices, PaginationComponent, PersonRole, RadioFilterFieldConfig, RefDataService, RemoveHostDirective, RoleCategory, RoleGuard, RoleMatching, RoleService, SECONDS_IN_A_DAY, SearchJudicialsComponent, SearchLocationComponent, SearchServiceComponent, SearchVenueComponent, SearchWorkTypeComponent, SelectedCaseComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseComponent, ShareCaseConfirmComponent, SharedCaseErrorMessages, TabComponent, TaskService, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, TimeoutNotificationsService, UserDetailsComponent, UserListComponent, UserSelectComponent, WriteAddressFieldComponent, WriteAddressInputsComponent, checkboxesBeCheckedValidator, dateValidator, getPersonRole, getPersonRoleForAllocateRole, getPersonRoleForTaskAssignment, getPersonRoleForWorkAllocation, getRoleCategory, getRoleCategoryForWorkAllocation, getRoleCategoryTitle, radioGroupValidator, windowProvider, windowToken };
10937
10933
  //# sourceMappingURL=hmcts-rpx-xui-common-lib.mjs.map