From f8baaddbd2ac81e6ea346bbf20aa0deca3970031 Mon Sep 17 00:00:00 2001
From: Kevin Cristiano <kcristiano@kcristiano.com>
Date: Thu, 2 Feb 2023 07:04:27 -0500
Subject: [PATCH] civicrm release-5.58.0

---
 civicrm.php                                   |   8 +-
 civicrm/CRM/Activity/BAO/ICalendar.php        |  15 +-
 civicrm/CRM/Activity/BAO/Query.php            |   1 -
 civicrm/CRM/Activity/Form/Activity.php        |   7 +
 civicrm/CRM/Activity/Form/ActivityView.php    |   7 +
 civicrm/CRM/Activity/Form/Task/AddToTag.php   |   2 +-
 .../CRM/Activity/Form/Task/RemoveFromTag.php  |   2 +-
 .../CRM/Activity/Import/Parser/Activity.php   |  14 +-
 civicrm/CRM/Batch/BAO/Batch.php               |   5 +-
 civicrm/CRM/Campaign/Page/AJAX.php            |   2 +-
 civicrm/CRM/Case/Form/Activity.php            |   4 +-
 civicrm/CRM/Case/Form/Activity/OpenCase.php   |   2 +-
 civicrm/CRM/Case/Form/Case.php                |   2 +-
 civicrm/CRM/Case/Info.php                     |   4 +-
 civicrm/CRM/Case/Selector/Search.php          |   4 +-
 civicrm/CRM/Case/XMLProcessor/Process.php     |   2 +-
 civicrm/CRM/Case/XMLProcessor/Report.php      |   7 +
 civicrm/CRM/Contact/BAO/ContactType.php       |   2 +-
 civicrm/CRM/Contact/BAO/RelationshipType.php  |   2 +-
 civicrm/CRM/Contact/Form/Search.php           |   1 -
 civicrm/CRM/Contact/Form/Task/AddToTag.php    |   2 +-
 civicrm/CRM/Contact/Form/Task/EmailTrait.php  |   8 +
 .../CRM/Contact/Form/Task/PDFLetterCommon.php |  82 --
 .../CRM/Contact/Form/Task/RemoveFromTag.php   |   2 +-
 .../CRM/Contact/Import/Form/DataSource.php    |  50 +-
 civicrm/CRM/Contact/Page/View.php             |   2 +-
 civicrm/CRM/Contact/Selector.php              |   1 +
 civicrm/CRM/Contribute/BAO/Contribution.php   |  69 +-
 .../Contribute/Form/Contribution/Confirm.php  |   6 +-
 .../CRM/Contribute/Form/Contribution/Main.php |  49 +-
 .../CRM/Contribute/Form/ContributionBase.php  | 122 +--
 .../CRM/Contribute/Import/Form/DataSource.php |   2 -
 .../Contribute/Import/Parser/Contribution.php |   2 +-
 civicrm/CRM/Core/BAO/File.php                 |   4 +-
 civicrm/CRM/Core/BAO/OptionValue.php          |   9 +-
 civicrm/CRM/Core/BAO/PrevNextCache.php        |  71 --
 civicrm/CRM/Core/BAO/UFGroup.php              |   3 +
 civicrm/CRM/Core/BAO/UserJob.php              |  30 +
 civicrm/CRM/Core/CodeGen/Schema.php           |   2 +
 civicrm/CRM/Core/CodeGen/Specification.php    |   2 +
 civicrm/CRM/Core/DAO/OptionGroup.php          |   8 +-
 civicrm/CRM/Core/Form/Search.php              |   2 +
 civicrm/CRM/Core/I18n/SchemaStructure.php     |   2 +-
 civicrm/CRM/Core/Page.php                     |   7 +
 civicrm/CRM/Core/Payment/FirstData.php        |   2 +-
 civicrm/CRM/Core/Payment/PayJunction.php      |   2 +-
 civicrm/CRM/Core/Selector/Controller.php      |   2 +
 .../Core/Smarty/plugins/function.crmKey.php   |   2 +-
 civicrm/CRM/Custom/Form/CustomDataByType.php  |   3 +-
 civicrm/CRM/Custom/Import/Form/DataSource.php |  11 +-
 civicrm/CRM/Dedupe/Merger.php                 | 128 +--
 .../CRM/Event/Form/ManageEvent/TabHeader.php  |   5 +-
 civicrm/CRM/Event/Form/Registration.php       | 102 ++-
 civicrm/CRM/Event/Form/Search.php             |   2 -
 civicrm/CRM/Event/Form/Task.php               |   2 -
 civicrm/CRM/Event/Form/Task/Badge.php         |   2 -
 civicrm/CRM/Event/Import/Form/DataSource.php  |   1 -
 civicrm/CRM/Event/Page/ManageEvent.php        |  15 +-
 .../Event/Page/ParticipantListing/Simple.php  |   3 +
 civicrm/CRM/Event/Selector/Search.php         |   2 +-
 civicrm/CRM/Export/Form/Select.php            |   4 +-
 civicrm/CRM/Extension/Browser.php             |  15 +
 civicrm/CRM/Extension/Info.php                |  15 +
 civicrm/CRM/Extension/Mapper.php              |   2 +-
 civicrm/CRM/Extension/MixinLoader.php         |   2 +-
 civicrm/CRM/Financial/BAO/Order.php           |   2 +-
 civicrm/CRM/Import/DataSource.php             |   6 +-
 civicrm/CRM/Import/DataSource/CSV.php         |  18 +-
 civicrm/CRM/Import/Form/DataSource.php        |  72 +-
 civicrm/CRM/Import/Form/DataSourceConfig.php  |  22 +
 civicrm/CRM/Import/Forms.php                  |   9 +-
 civicrm/CRM/Mailing/BAO/Mailing.php           |   2 -
 .../Mailing/Event/BAO/MailingEventQueue.php   |   4 +-
 .../Mailing/Event/BAO/MailingEventReply.php   |   4 +-
 civicrm/CRM/Mailing/MailStore.php             |  10 +-
 civicrm/CRM/Mailing/MailStore/Imap.php        |  14 +
 civicrm/CRM/Mailing/MailStore/Localdir.php    |  23 +-
 civicrm/CRM/Mailing/MailStore/Maildir.php     |  23 +-
 civicrm/CRM/Mailing/MailStore/Mbox.php        |  21 +
 civicrm/CRM/Mailing/MailStore/Pop3.php        |  14 +
 civicrm/CRM/Member/Form/Task.php              |   2 -
 civicrm/CRM/Member/Import/Form/DataSource.php |   3 -
 civicrm/CRM/Price/BAO/PriceSet.php            |   2 +-
 civicrm/CRM/Profile/Form/Dynamic.php          |   2 -
 civicrm/CRM/Profile/Form/Edit.php             |   2 -
 civicrm/CRM/UF/Form/Inline/PreviewById.php    |   2 -
 civicrm/CRM/UF/Form/Preview.php               |   2 -
 civicrm/CRM/UF/Page/Group.php                 |   6 +-
 civicrm/CRM/Upgrade/Incremental/Base.php      |  17 +
 civicrm/CRM/Upgrade/Incremental/General.php   |   2 +-
 .../Incremental/php/FiveFiftyEight.php        |  95 ++
 .../Incremental/php/FiveFiftySeven.php        |   2 +-
 .../Incremental/sql/5.58.alpha1.mysql.tpl     |   1 +
 .../CRM/Utils/Check/Component/Timestamps.php  |  48 +
 civicrm/CRM/Utils/Date.php                    |  54 +-
 civicrm/CRM/Utils/File.php                    |  30 -
 civicrm/CRM/Utils/Request.php                 |   2 +-
 civicrm/CRM/Utils/Signer.php                  |  20 +
 civicrm/CRM/Utils/Sort.php                    |   2 +-
 civicrm/CRM/Utils/String.php                  |   4 +-
 civicrm/CRM/Utils/System.php                  |   2 +-
 civicrm/Civi/API/Request.php                  |   1 +
 civicrm/Civi/Api4/DedupeRule.php              |   1 +
 civicrm/Civi/Api4/DedupeRuleGroup.php         |   1 +
 .../Traits/SavedSearchInspectorTrait.php      |  14 +-
 civicrm/Civi/Api4/Query/SqlEquation.php       |   2 +-
 civicrm/Civi/Api4/Query/SqlExpression.php     |   2 +-
 civicrm/Civi/Api4/Query/SqlFunction.php       |   4 +-
 .../ContributionAutocompleteProvider.php      |  84 ++
 civicrm/Civi/CCase/Events.php                 |   2 +-
 civicrm/Civi/Core/CiviEventDispatcher.php     |   2 +-
 civicrm/Civi/Payment/System.php               |   2 +-
 .../Civi/Test/CiviEnvBuilder/SqlFileStep.php  |   5 +-
 civicrm/Civi/Test/CiviEnvBuilder/SqlStep.php  |   5 +-
 .../Civi/Test/CiviTestListenerPHPUnit7.php    |   2 +
 civicrm/Civi/WorkflowMessage/FieldSpec.php    |   2 +
 civicrm/api/class.api.php                     |  85 +-
 civicrm/api/v3/utils.php                      |   6 +-
 civicrm/civicrm-version.php                   |   2 +-
 civicrm/composer.json                         |   6 +-
 civicrm/composer.lock                         |  70 +-
 .../admin/afformEntities/Membership.php       |   8 +
 civicrm/ext/afform/admin/info.xml             |   4 +-
 civicrm/ext/afform/core/info.xml              |   4 +-
 civicrm/ext/afform/html/info.xml              |   4 +-
 civicrm/ext/afform/mock/info.xml              |   4 +-
 civicrm/ext/authx/info.xml                    |   4 +-
 civicrm/ext/civicrm_admin_ui/info.xml         |   4 +-
 civicrm/ext/civigrant/CRM/Grant/Form/Task.php |   2 -
 civicrm/ext/civigrant/info.xml                |   4 +-
 civicrm/ext/civiimport/info.xml               |   4 +-
 civicrm/ext/ckeditor4/info.xml                |   4 +-
 .../ext/contributioncancelactions/info.xml    |   4 +-
 civicrm/ext/elavon/info.xml                   |   4 +-
 civicrm/ext/eventcart/info.xml                |   4 +-
 civicrm/ext/ewaysingle/info.xml               |   4 +-
 civicrm/ext/financialacls/info.xml            |   4 +-
 civicrm/ext/flexmailer/info.xml               |   4 +-
 civicrm/ext/greenwich/info.xml                |   4 +-
 .../Contact/Form/Search/Custom/FullText.php   |   6 +-
 .../CRM/Contact/Selector/Custom.php           |   0
 civicrm/ext/legacycustomsearches/info.xml     |   4 +-
 civicrm/ext/message_admin/info.xml            |   4 +-
 civicrm/ext/oauth-client/info.xml             |   4 +-
 .../phpunit/Civi/OAuth/AuthCodeFlowTest.php   |   2 +
 .../phpunit/api/v4/OAuthContactTokenTest.php  |   2 +
 civicrm/ext/payflowpro/info.xml               |   4 +-
 civicrm/ext/recaptcha/info.xml                |   4 +-
 .../Action/SearchDisplay/GetSearchTasks.php   |  23 +-
 .../Subscriber/DefaultDisplaySubscriber.php   |   4 +-
 .../SearchSegmentExtraFieldProvider.php       |   2 +-
 .../crmSearchTasks.component.js               |   9 +-
 civicrm/ext/search_kit/info.xml               |   4 +-
 civicrm/ext/search_kit/search_kit.php         |   2 +-
 civicrm/ext/sequentialcreditnotes/info.xml    |   4 +-
 civicrm/install/langs.php                     |   1 +
 civicrm/mixin/polyfill.php                    |   4 +-
 civicrm/packages/HTML/Common.php              |   2 +-
 .../HTML/QuickForm/advmultiselect.php         |   5 -
 civicrm/release-notes.md                      |  48 +
 civicrm/release-notes/5.55.1.md               |  37 +
 civicrm/release-notes/5.55.2.md               |  41 +
 civicrm/release-notes/5.56.1.md               |  43 +
 civicrm/release-notes/5.56.2.md               |  39 +
 civicrm/release-notes/5.57.0.md               |   1 +
 civicrm/release-notes/5.58.0.md               | 393 +++++++++
 civicrm/sql/civicrm.mysql                     |   2 +-
 civicrm/sql/civicrm_data.mysql                | 187 ++--
 civicrm/sql/civicrm_generated.mysql           |   2 +-
 .../CRM/Campaign/Page/Petition/ThankYou.tpl   |   2 +-
 civicrm/templates/CRM/Case/Form/Case.tpl      |   4 +-
 .../templates/CRM/Contact/Form/Selector.tpl   |   2 +-
 .../templates/CRM/Contact/Import/Form/CSV.tpl |   4 +
 .../CRM/Contact/Import/Form/DataSource.tpl    |  40 +-
 .../templates/CRM/Import/Form/DataSource.tpl  |  58 +-
 civicrm/vendor/autoload.php                   |   2 +-
 .../composer-compile-lib/composer.json        |   2 +-
 civicrm/vendor/composer/autoload_real.php     |  14 +-
 civicrm/vendor/composer/autoload_static.php   |  12 +-
 civicrm/vendor/composer/installed.json        |  74 +-
 civicrm/vendor/composer/installed.php         |  42 +-
 civicrm/vendor/composer/platform_check.php    |   4 +-
 .../cweagans/composer-patches/src/Patches.php |   5 +
 civicrm/vendor/dompdf/dompdf/VERSION          |   2 +-
 civicrm/vendor/dompdf/dompdf/lib/Cpdf.php     |   8 +-
 civicrm/vendor/dompdf/dompdf/lib/res/html.css |  34 +-
 .../vendor/dompdf/dompdf/src/Adapter/CPDF.php |   2 +-
 .../vendor/dompdf/dompdf/src/Adapter/GD.php   |   6 +-
 .../dompdf/dompdf/src/Adapter/PDFLib.php      |   2 +-
 civicrm/vendor/dompdf/dompdf/src/Canvas.php   |   4 +-
 .../dompdf/dompdf/src/CanvasFactory.php       |  10 +-
 .../dompdf/dompdf/src/Css/Stylesheet.php      | 488 +++++------
 civicrm/vendor/dompdf/dompdf/src/Dompdf.php   |   8 +-
 .../dompdf/dompdf/src/Frame/Factory.php       |  33 +-
 .../dompdf/dompdf/src/FrameReflower/Block.php |   1 -
 .../dompdf/src/FrameReflower/ListBullet.php   |   4 +
 .../dompdf/dompdf/src/FrameReflower/Text.php  |  36 +-
 .../vendor/dompdf/dompdf/src/Image/Cache.php  |   2 +-
 civicrm/vendor/dompdf/dompdf/src/Options.php  |  12 +-
 .../dompdf/dompdf/src/Renderer/Text.php       |   2 +-
 civicrm/vendor/masterminds/html5/README.md    |  16 +
 civicrm/vendor/masterminds/html5/RELEASE.md   |   4 +
 .../html5/src/HTML5/Parser/Scanner.php        |   2 +-
 .../html5/src/HTML5/Parser/Tokenizer.php      |  18 +-
 civicrm/vendor/phenx/php-svg-lib/LICENSE      | 827 ++++--------------
 civicrm/vendor/phenx/php-svg-lib/README.md    |   5 +-
 .../vendor/phenx/php-svg-lib/composer.json    |   2 +-
 .../phenx/php-svg-lib/src/Svg/CssLength.php   | 135 +++
 .../php-svg-lib/src/Svg/DefaultStyle.php      |   4 +-
 .../phenx/php-svg-lib/src/Svg/Document.php    |   9 +-
 .../phenx/php-svg-lib/src/Svg/Style.php       | 121 ++-
 .../php-svg-lib/src/Svg/Surface/CPdf.php      |   8 +-
 .../src/Svg/Surface/SurfaceCpdf.php           |  81 +-
 .../src/Svg/Surface/SurfaceInterface.php      |   4 +-
 .../src/Svg/Surface/SurfacePDFLib.php         |  20 +-
 .../php-svg-lib/src/Svg/Tag/AbstractTag.php   |  68 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Circle.php  |  11 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Ellipse.php |  13 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Image.php   |  20 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Line.php    |  13 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Path.php    |  39 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Polygon.php |  11 +-
 .../php-svg-lib/src/Svg/Tag/Polyline.php      |  11 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Rect.php    |  23 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Shape.php   |   4 +-
 .../phenx/php-svg-lib/src/Svg/Tag/Text.php    |  10 +-
 .../phenx/php-svg-lib/src/Svg/Tag/UseTag.php  |  14 +-
 .../vendor/phenx/php-svg-lib/src/autoload.php |  17 -
 civicrm/xml/schema/Core/OptionGroup.xml       |   3 +-
 civicrm/xml/templates/civicrm_data.tpl        | 265 +++---
 civicrm/xml/templates/languages.tpl           |   2 +-
 .../contribution_online_receipt_text.tpl      |   2 +-
 civicrm/xml/version.xml                       |   2 +-
 wp-rest/README.md                             |   2 +-
 234 files changed, 3146 insertions(+), 2310 deletions(-)
 create mode 100644 civicrm/CRM/Upgrade/Incremental/php/FiveFiftyEight.php
 create mode 100644 civicrm/CRM/Upgrade/Incremental/sql/5.58.alpha1.mysql.tpl
 create mode 100644 civicrm/Civi/Api4/Service/Autocomplete/ContributionAutocompleteProvider.php
 create mode 100644 civicrm/ext/afform/admin/afformEntities/Membership.php
 rename civicrm/{ => ext/legacycustomsearches}/CRM/Contact/Selector/Custom.php (100%)
 create mode 100644 civicrm/release-notes/5.55.1.md
 create mode 100644 civicrm/release-notes/5.55.2.md
 create mode 100644 civicrm/release-notes/5.56.1.md
 create mode 100644 civicrm/release-notes/5.56.2.md
 create mode 100644 civicrm/release-notes/5.58.0.md
 create mode 100644 civicrm/vendor/phenx/php-svg-lib/src/Svg/CssLength.php
 delete mode 100644 civicrm/vendor/phenx/php-svg-lib/src/autoload.php

diff --git a/civicrm.php b/civicrm.php
index 76f1df45cd..ede12b9f4f 100644
--- a/civicrm.php
+++ b/civicrm.php
@@ -2,9 +2,9 @@
 /**
  * Plugin Name: CiviCRM
  * Description: CiviCRM - Growing and Sustaining Relationships
- * Version: 5.57.3
+ * Version: 5.58.0
  * Requires at least: 4.9
- * Requires PHP:      7.2
+ * Requires PHP:      7.3
  * Author: CiviCRM LLC
  * Author URI: https://civicrm.org/
  * Plugin URI: https://docs.civicrm.org/sysadmin/en/latest/install/wordpress/
@@ -36,7 +36,7 @@ if (!defined('ABSPATH')) {
 }
 
 // Set version here: changing it forces Javascript and CSS to reload.
-define('CIVICRM_PLUGIN_VERSION', '5.57.3');
+define('CIVICRM_PLUGIN_VERSION', '5.58.0');
 
 // Store reference to this file.
 if (!defined('CIVICRM_PLUGIN_FILE')) {
@@ -65,7 +65,7 @@ if (!defined('CIVICRM_PLUGIN_DIR')) {
  * @see CiviWP\PhpVersionTest::testConstantMatch()
  */
 if (!defined('CIVICRM_WP_PHP_MINIMUM')) {
-  define('CIVICRM_WP_PHP_MINIMUM', '7.2.0');
+  define('CIVICRM_WP_PHP_MINIMUM', '7.3.0');
 }
 
 /*
diff --git a/civicrm/CRM/Activity/BAO/ICalendar.php b/civicrm/CRM/Activity/BAO/ICalendar.php
index 88b7676e1d..0df84cc26d 100644
--- a/civicrm/CRM/Activity/BAO/ICalendar.php
+++ b/civicrm/CRM/Activity/BAO/ICalendar.php
@@ -21,18 +21,25 @@
 class CRM_Activity_BAO_ICalendar {
 
   /**
-   * @var \CRM_Activity_BAO_ICalendar
    * The activity for which we're generating ical.
+   *
+   * @var CRM_Activity_BAO_Activity
    */
   protected $activity;
 
+  /**
+   * Path to temporary unique file,
+   * to hold generated .ics file
+   *
+   * @var string
+   */
+  protected $icsfile;
+
   /**
    * Constructor.
    *
-   * @param object $act
+   * @param CRM_Activity_BAO_Activity $act
    *   Reference to an activity object.
-   *
-   * @return \CRM_Activity_BAO_ICalendar
    */
   public function __construct(&$act) {
     $this->activity = $act;
diff --git a/civicrm/CRM/Activity/BAO/Query.php b/civicrm/CRM/Activity/BAO/Query.php
index a7eee549e7..d24a5fe15e 100644
--- a/civicrm/CRM/Activity/BAO/Query.php
+++ b/civicrm/CRM/Activity/BAO/Query.php
@@ -152,7 +152,6 @@ class CRM_Activity_BAO_Query {
         if ($query->_mode == CRM_Contact_BAO_Query::MODE_CONTACTS) {
           $query->_useDistinct = TRUE;
         }
-        $query->_params[$id][3];
         self::whereClauseSingle($query->_params[$id], $query);
       }
     }
diff --git a/civicrm/CRM/Activity/Form/Activity.php b/civicrm/CRM/Activity/Form/Activity.php
index ce069e8be4..c2e24fdcdb 100644
--- a/civicrm/CRM/Activity/Form/Activity.php
+++ b/civicrm/CRM/Activity/Form/Activity.php
@@ -127,6 +127,13 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
 
   public $submitOnce = TRUE;
 
+  /**
+   * @var array
+   */
+  public $_groupTree;
+
+  public $_entityTagValues;
+
   /**
    * Explicitly declare the entity api name.
    *
diff --git a/civicrm/CRM/Activity/Form/ActivityView.php b/civicrm/CRM/Activity/Form/ActivityView.php
index 0d51c0918c..310840b366 100644
--- a/civicrm/CRM/Activity/Form/ActivityView.php
+++ b/civicrm/CRM/Activity/Form/ActivityView.php
@@ -83,6 +83,13 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form {
       }
     }
 
+    // ensure these are set so that they get assigned to the template
+    $values['mailingId'] = $values['mailingId'] ?? NULL;
+    $values['campaign'] = $values['campaign'] ?? NULL;
+    $values['engagement_level'] = $values['engagement_level'] ?? NULL;
+    // also this which doesn't get set for bulk emails
+    $values['target_contact_value'] = $values['target_contact_value'] ?? NULL;
+
     // Get the campaign.
     if ($campaignId = CRM_Utils_Array::value('campaign_id', $defaults)) {
       $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns($campaignId);
diff --git a/civicrm/CRM/Activity/Form/Task/AddToTag.php b/civicrm/CRM/Activity/Form/Task/AddToTag.php
index 51af8f1b63..d3fa1d0e10 100644
--- a/civicrm/CRM/Activity/Form/Task/AddToTag.php
+++ b/civicrm/CRM/Activity/Form/Task/AddToTag.php
@@ -48,7 +48,7 @@ class CRM_Activity_Form_Task_AddToTag extends CRM_Activity_Form_Task {
     $this->_tags = CRM_Core_BAO_Tag::getTags('civicrm_activity');
 
     foreach ($this->_tags as $tagID => $tagName) {
-      $this->_tagElement = &$this->addElement('checkbox', "tag[$tagID]", NULL, $tagName);
+      $this->addElement('checkbox', "tag[$tagID]", NULL, $tagName);
     }
 
     $parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_activity');
diff --git a/civicrm/CRM/Activity/Form/Task/RemoveFromTag.php b/civicrm/CRM/Activity/Form/Task/RemoveFromTag.php
index 757c1c9525..db26fa0a20 100644
--- a/civicrm/CRM/Activity/Form/Task/RemoveFromTag.php
+++ b/civicrm/CRM/Activity/Form/Task/RemoveFromTag.php
@@ -46,7 +46,7 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task {
     // add select for tag
     $this->_tags = CRM_Core_BAO_Tag::getTags('civicrm_activity');
     foreach ($this->_tags as $tagID => $tagName) {
-      $this->_tagElement = &$this->addElement('checkbox', "tag[$tagID]", NULL, $tagName);
+      $this->addElement('checkbox', "tag[$tagID]", NULL, $tagName);
     }
 
     $parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_activity');
diff --git a/civicrm/CRM/Activity/Import/Parser/Activity.php b/civicrm/CRM/Activity/Import/Parser/Activity.php
index 13f18fca5a..4f31f50c7e 100644
--- a/civicrm/CRM/Activity/Import/Parser/Activity.php
+++ b/civicrm/CRM/Activity/Import/Parser/Activity.php
@@ -21,6 +21,8 @@
  */
 class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser {
 
+  protected $_newActivity;
+
   /**
    * Get information about the provided job.
    *  - name
@@ -200,7 +202,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser {
       ];
       $fieldsArray = CRM_Dedupe_BAO_DedupeRule::dedupeRuleFields($ruleParams);
 
-      $tmpConatctField = [];
+      $tmpContactField = [];
       if (is_array($fieldsArray)) {
         foreach ($fieldsArray as $value) {
           $customFieldId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField',
@@ -209,13 +211,13 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser {
             'column_name'
           );
           $value = trim($customFieldId ? 'custom_' . $customFieldId : $value);
-          $tmpConatctField[$value] = $contactFields[$value];
-          $tmpConatctField[$value]['title'] = $tmpConatctField[$value]['title'] . " (match to contact)";
+          $tmpContactField[$value] = $contactFields[$value];
+          $tmpContactField[$value]['title'] = $tmpContactField[$value]['title'] . " (match to contact)";
         }
       }
-      $tmpConatctField['external_identifier'] = $contactFields['external_identifier'];
-      $tmpConatctField['external_identifier']['title'] = $contactFields['external_identifier']['title'] . ' (match to contact)';
-      $fields = array_merge($fields, $tmpConatctField);
+      $tmpContactField['external_identifier'] = $contactFields['external_identifier'];
+      $tmpContactField['external_identifier']['title'] = $contactFields['external_identifier']['title'] . ' (match to contact)';
+      $fields = array_merge($fields, $tmpContactField);
       $fields = array_merge($fields, $tmpFields);
       $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Activity'));
 
diff --git a/civicrm/CRM/Batch/BAO/Batch.php b/civicrm/CRM/Batch/BAO/Batch.php
index d3bcba1467..34d20ec6f9 100644
--- a/civicrm/CRM/Batch/BAO/Batch.php
+++ b/civicrm/CRM/Batch/BAO/Batch.php
@@ -692,10 +692,9 @@ LEFT JOIN civicrm_contribution_soft ON civicrm_contribution_soft.contribution_id
 
     // If a custom field was passed as a param,
     // we'll take it into account.
-    $customSearchFields = [];
     if (!empty($params)) {
       foreach ($params as $name => $param) {
-        if (substr($name, 0, 6) == 'custom') {
+        if (strpos($name, 'custom') === 0) {
           $searchFields[] = $name;
         }
       }
@@ -704,7 +703,7 @@ LEFT JOIN civicrm_contribution_soft ON civicrm_contribution_soft.contribution_id
     foreach ($searchFields as $field) {
       if (isset($params[$field])) {
         $values[$field] = $params[$field];
-        if ($field == 'sort_name') {
+        if ($field === 'sort_name') {
           $from .= " LEFT JOIN civicrm_contact contact_b ON contact_b.id = civicrm_contribution.contact_id
           LEFT JOIN civicrm_email ON contact_b.id = civicrm_email.contact_id";
         }
diff --git a/civicrm/CRM/Campaign/Page/AJAX.php b/civicrm/CRM/Campaign/Page/AJAX.php
index 8f362d591d..fc667ded8b 100644
--- a/civicrm/CRM/Campaign/Page/AJAX.php
+++ b/civicrm/CRM/Campaign/Page/AJAX.php
@@ -127,7 +127,7 @@ class CRM_Campaign_Page_AJAX {
     CRM_Utils_JSON::output($result);
   }
 
-  public function voterList() {
+  public static function voterList() {
     //get the search criteria params.
     $searchCriteria = CRM_Utils_Request::retrieve('searchCriteria', 'String', CRM_Core_DAO::$_nullObject, FALSE, NULL, 'POST');
     $searchParams = explode(',', $searchCriteria);
diff --git a/civicrm/CRM/Case/Form/Activity.php b/civicrm/CRM/Case/Form/Activity.php
index 7b04c4a14b..e0ed82cf2e 100644
--- a/civicrm/CRM/Case/Form/Activity.php
+++ b/civicrm/CRM/Case/Form/Activity.php
@@ -23,14 +23,14 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity {
   /**
    * Cases this activity belongs to.
    *
-   * @var []int
+   * @var int[]
    */
   public $_caseId;
 
   /**
    * The default case type variable defined.
    *
-   * @var []int
+   * @var int[]
    */
   public $_caseType;
 
diff --git a/civicrm/CRM/Case/Form/Activity/OpenCase.php b/civicrm/CRM/Case/Form/Activity/OpenCase.php
index c159b6b2be..740e7cdb57 100644
--- a/civicrm/CRM/Case/Form/Activity/OpenCase.php
+++ b/civicrm/CRM/Case/Form/Activity/OpenCase.php
@@ -168,8 +168,8 @@ class CRM_Case_Form_Activity_OpenCase {
 
     if ($form->_currentlyViewedContactId) {
       list($displayName) = CRM_Contact_BAO_Contact::getDisplayAndImage($form->_currentlyViewedContactId);
-      $form->assign('clientName', $displayName);
     }
+    $form->assign('clientName', $displayName ?? NULL);
 
     $form->add('datepicker', 'start_date', ts('Case Start Date'), [], TRUE);
 
diff --git a/civicrm/CRM/Case/Form/Case.php b/civicrm/CRM/Case/Form/Case.php
index b22d709192..ec036cebc4 100644
--- a/civicrm/CRM/Case/Form/Case.php
+++ b/civicrm/CRM/Case/Form/Case.php
@@ -174,8 +174,8 @@ class CRM_Case_Form_Case extends CRM_Core_Form {
       if (!$contact->find(TRUE)) {
         CRM_Core_Error::statusBounce(ts('Client contact does not exist: %1', [1 => $this->_currentlyViewedContactId]));
       }
-      $this->assign('clientName', $contact->display_name);
     }
+    $this->assign('clientName', isset($this->_currentlyViewedContactId) ? $contact->display_name : NULL);
 
     $session = CRM_Core_Session::singleton();
     $this->_currentUserId = $session->get('userID');
diff --git a/civicrm/CRM/Case/Info.php b/civicrm/CRM/Case/Info.php
index d657e50d4e..5269af7a2d 100644
--- a/civicrm/CRM/Case/Info.php
+++ b/civicrm/CRM/Case/Info.php
@@ -112,7 +112,7 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
   public function getReferenceCounts($dao) {
     $result = [];
     if ($dao instanceof CRM_Core_DAO_OptionValue) {
-      /** @var $dao CRM_Core_DAO_OptionValue */
+      /** @var CRM_Core_DAO_OptionValue $dao */
       $activity_type_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'activity_type', 'id', 'name');
       if ($activity_type_gid == $dao->option_group_id) {
         $count = CRM_Case_XMLRepository::singleton()
@@ -127,7 +127,7 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
       }
     }
     elseif ($dao instanceof CRM_Contact_DAO_RelationshipType) {
-      /** @var $dao CRM_Contact_DAO_RelationshipType */
+      /** @var CRM_Contact_DAO_RelationshipType $dao  */
 
       // Need to look both directions, but no need to translate case role
       // direction from XML perspective to client-based perspective
diff --git a/civicrm/CRM/Case/Selector/Search.php b/civicrm/CRM/Case/Selector/Search.php
index 0d70d73967..9b430eea8b 100644
--- a/civicrm/CRM/Case/Selector/Search.php
+++ b/civicrm/CRM/Case/Selector/Search.php
@@ -244,12 +244,10 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base {
   /**
    * Returns total number of rows for the query.
    *
-   * @param
-   *
    * @return int
    *   Total number of rows
    */
-  public function getTotalCount($action) {
+  public function getTotalCount() {
     return $this->_query->searchQuery(0, 0, NULL,
       TRUE, FALSE,
       FALSE, FALSE,
diff --git a/civicrm/CRM/Case/XMLProcessor/Process.php b/civicrm/CRM/Case/XMLProcessor/Process.php
index 0d6c3ed976..97fc4e0459 100644
--- a/civicrm/CRM/Case/XMLProcessor/Process.php
+++ b/civicrm/CRM/Case/XMLProcessor/Process.php
@@ -78,7 +78,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
   }
 
   /**
-   * @param $xml
+   * @param SimpleXMLElement $xml
    * @param array $params
    *
    * @throws Exception
diff --git a/civicrm/CRM/Case/XMLProcessor/Report.php b/civicrm/CRM/Case/XMLProcessor/Report.php
index 3eed985011..745a299dd7 100644
--- a/civicrm/CRM/Case/XMLProcessor/Report.php
+++ b/civicrm/CRM/Case/XMLProcessor/Report.php
@@ -23,6 +23,13 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor {
    */
   protected $_isRedact;
 
+  /**
+   * Redaction Rules.
+   *
+   * @var array
+   */
+  protected $_redactionStringRules = [];
+
   /**
    */
   public function __construct() {
diff --git a/civicrm/CRM/Contact/BAO/ContactType.php b/civicrm/CRM/Contact/BAO/ContactType.php
index e867e13be9..d02752fe9d 100644
--- a/civicrm/CRM/Contact/BAO/ContactType.php
+++ b/civicrm/CRM/Contact/BAO/ContactType.php
@@ -526,7 +526,7 @@ WHERE contact_sub_type LIKE '%{$subType}%'";
    * @param array $params
    *   An assoc array of name/value pairs.
    *
-   * @return object|void
+   * @return CRM_Contact_DAO_ContactType|NULL
    * @throws \CRM_Core_Exception
    */
   public static function add($params) {
diff --git a/civicrm/CRM/Contact/BAO/RelationshipType.php b/civicrm/CRM/Contact/BAO/RelationshipType.php
index 0a24566a96..3daef9e626 100644
--- a/civicrm/CRM/Contact/BAO/RelationshipType.php
+++ b/civicrm/CRM/Contact/BAO/RelationshipType.php
@@ -129,7 +129,7 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType
    * We check that contact_type_a is Individual, but not contact_type_b because there's
    * nowhere in the code that requires it to be Organization.
    *
-   * @return int|string
+   * @return int
    *
    * @throws \CRM_Core_Exception
    */
diff --git a/civicrm/CRM/Contact/Form/Search.php b/civicrm/CRM/Contact/Form/Search.php
index 7a139d3b4a..475366a5b9 100644
--- a/civicrm/CRM/Contact/Form/Search.php
+++ b/civicrm/CRM/Contact/Form/Search.php
@@ -78,7 +78,6 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    * @var array
    */
   public $_tag;
-  public $_tagElement;
 
   /**
    * The params used for search.
diff --git a/civicrm/CRM/Contact/Form/Task/AddToTag.php b/civicrm/CRM/Contact/Form/Task/AddToTag.php
index 2aa3ed6ff6..2001a39ac7 100644
--- a/civicrm/CRM/Contact/Form/Task/AddToTag.php
+++ b/civicrm/CRM/Contact/Form/Task/AddToTag.php
@@ -46,7 +46,7 @@ class CRM_Contact_Form_Task_AddToTag extends CRM_Contact_Form_Task {
     $this->_tags = CRM_Core_BAO_Tag::getTags();
 
     foreach ($this->_tags as $tagID => $tagName) {
-      $this->_tagElement = &$this->addElement('checkbox', "tag[$tagID]", NULL, $tagName);
+      $this->addElement('checkbox', "tag[$tagID]", NULL, $tagName);
     }
 
     $parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_contact');
diff --git a/civicrm/CRM/Contact/Form/Task/EmailTrait.php b/civicrm/CRM/Contact/Form/Task/EmailTrait.php
index 268595325f..06764a1c09 100644
--- a/civicrm/CRM/Contact/Form/Task/EmailTrait.php
+++ b/civicrm/CRM/Contact/Form/Task/EmailTrait.php
@@ -80,6 +80,14 @@ trait CRM_Contact_Form_Task_EmailTrait {
    */
   protected $suppressedEmails = [];
 
+  public $_contactDetails = [];
+
+  public $_entityTagValues;
+
+  public $_caseId;
+
+  public $_context;
+
   /**
    * Getter for isSearchContext.
    *
diff --git a/civicrm/CRM/Contact/Form/Task/PDFLetterCommon.php b/civicrm/CRM/Contact/Form/Task/PDFLetterCommon.php
index 405fd7dd0f..eb2e058e99 100644
--- a/civicrm/CRM/Contact/Form/Task/PDFLetterCommon.php
+++ b/civicrm/CRM/Contact/Form/Task/PDFLetterCommon.php
@@ -109,88 +109,6 @@ class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetter
     return [$formValues, $categories, $html_message, $messageToken, $returnProperties];
   }
 
-  /**
-   * @param CRM_Core_Form $form
-   * @param string $html_message
-   * @param array $contactIds
-   * @param string $subject
-   * @param int $campaign_id
-   * @param array $perContactHtml
-   *
-   * @return array
-   *   List of activity IDs.
-   *   There may be 1 or more, depending on the system-settings
-   *   and use-case.
-   *
-   * @throws CRM_Core_Exception
-   *
-   * @deprecated
-   */
-  public static function createActivities($form, $html_message, $contactIds, $subject, $campaign_id, $perContactHtml = []) {
-    CRM_Core_Error::deprecatedFunctionWarning('no alternative');
-
-    $activityParams = [
-      'subject' => $subject,
-      'campaign_id' => $campaign_id,
-      'source_contact_id' => CRM_Core_Session::getLoggedInContactID(),
-      'activity_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Print PDF Letter'),
-      'activity_date_time' => date('YmdHis'),
-      'details' => $html_message,
-    ];
-    if (!empty($form->_activityId)) {
-      $activityParams += ['id' => $form->_activityId];
-    }
-
-    $activityIds = [];
-    switch (Civi::settings()->get('recordGeneratedLetters')) {
-      case 'none':
-        return [];
-
-      case 'multiple':
-        // One activity per contact.
-        foreach ($contactIds as $i => $contactId) {
-          $fullParams = [
-            'target_contact_id' => $contactId,
-          ] + $activityParams;
-          if (!empty($form->_caseId)) {
-            $fullParams['case_id'] = $form->_caseId;
-          }
-          elseif (!empty($form->_caseIds[$i])) {
-            $fullParams['case_id'] = $form->_caseIds[$i];
-          }
-
-          if (isset($perContactHtml[$contactId])) {
-            $fullParams['details'] = implode('<hr>', $perContactHtml[$contactId]);
-          }
-          $activity = civicrm_api3('Activity', 'create', $fullParams);
-          $activityIds[$contactId] = $activity['id'];
-        }
-
-        break;
-
-      case 'combined':
-      case 'combined-attached':
-        // One activity with all contacts.
-        $fullParams = [
-          'target_contact_id' => $contactIds,
-        ] + $activityParams;
-        if (!empty($form->_caseId)) {
-          $fullParams['case_id'] = $form->_caseId;
-        }
-        elseif (!empty($form->_caseIds)) {
-          $fullParams['case_id'] = $form->_caseIds;
-        }
-        $activity = civicrm_api3('Activity', 'create', $fullParams);
-        $activityIds[] = $activity['id'];
-        break;
-
-      default:
-        throw new CRM_Core_Exception("Unrecognized option in recordGeneratedLetters: " . Civi::settings()->get('recordGeneratedLetters'));
-    }
-
-    return $activityIds;
-  }
-
   /**
    * Convert from a vague-type/file-extension to mime-type.
    *
diff --git a/civicrm/CRM/Contact/Form/Task/RemoveFromTag.php b/civicrm/CRM/Contact/Form/Task/RemoveFromTag.php
index 957706f53a..2c2c4d6683 100644
--- a/civicrm/CRM/Contact/Form/Task/RemoveFromTag.php
+++ b/civicrm/CRM/Contact/Form/Task/RemoveFromTag.php
@@ -41,7 +41,7 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task {
     // add select for tag
     $this->_tags = CRM_Core_BAO_Tag::getTags();
     foreach ($this->_tags as $tagID => $tagName) {
-      $this->_tagElement = &$this->addElement('checkbox', "tag[$tagID]", NULL, $tagName);
+      $this->addElement('checkbox', "tag[$tagID]", NULL, $tagName);
     }
 
     $parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_contact');
diff --git a/civicrm/CRM/Contact/Import/Form/DataSource.php b/civicrm/CRM/Contact/Import/Form/DataSource.php
index ab86a34777..3c65435a90 100644
--- a/civicrm/CRM/Contact/Import/Form/DataSource.php
+++ b/civicrm/CRM/Contact/Import/Form/DataSource.php
@@ -42,39 +42,6 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Import_Form_DataSource {
     return ['disableUSPS'];
   }
 
-  /**
-   * Set variables up before form is built.
-   *
-   * @throws \CRM_Core_Exception
-   */
-  public function preProcess() {
-    $results = [];
-    $config = CRM_Core_Config::singleton();
-    $handler = opendir($config->uploadDir);
-    $errorFiles = ['sqlImport.errors', 'sqlImport.conflicts', 'sqlImport.duplicates', 'sqlImport.mismatch'];
-
-    // check for post max size avoid when called twice
-    $snippet = $_GET['snippet'] ?? 0;
-    if (empty($snippet)) {
-      CRM_Utils_Number::formatUnitSize(ini_get('post_max_size'), TRUE);
-    }
-
-    while ($file = readdir($handler)) {
-      if ($file !== '.' && $file !== '..' &&
-        in_array($file, $errorFiles) && !is_writable($config->uploadDir . $file)
-      ) {
-        $results[] = $file;
-      }
-    }
-    closedir($handler);
-    if (!empty($results)) {
-      $this->invalidConfig(ts('<b>%1</b> file(s) in %2 directory are not writable. Listed file(s) might be used during the import to log the errors occurred during Import process. Contact your site administrator for assistance.', [
-        1 => implode(', ', $results),
-        2 => $config->uploadDir,
-      ]));
-    }
-  }
-
   /**
    * Build the form object.
    *
@@ -98,8 +65,6 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Import_Form_DataSource {
     ]);
 
     $mappingArray = CRM_Core_BAO_Mapping::getMappings('Import Contact');
-
-    $this->assign('savedMapping', $mappingArray);
     $this->addElement('select', 'savedMapping', ts('Saved Field Mapping'), ['' => ts('- select -')] + $mappingArray);
 
     $js = ['onClick' => "buildSubTypes();buildDedupeRules();"];
@@ -124,14 +89,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Import_Form_DataSource {
 
     CRM_Core_Form_Date::buildAllowedDateFormats($this);
 
-    $geoCode = FALSE;
     if (CRM_Utils_GeocodeProvider::getUsableClassName()) {
-      $geoCode = TRUE;
       $this->addElement('checkbox', 'doGeocodeAddress', ts('Geocode addresses during import?'));
     }
-    $this->assign('geoCode', $geoCode);
-
-    $this->addElement('text', 'fieldSeparator', ts('Import Field Separator'), ['size' => 2]);
 
     if (Civi::settings()->get('address_standardization_provider') === 'USPS') {
       $this->addElement('checkbox', 'disableUSPS', ts('Disable USPS address validation during import?'));
@@ -159,13 +119,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Import_Form_DataSource {
    *   reference to the array of default values
    */
   public function setDefaultValues() {
-    $defaults = [
-      'dataSource' => $this->getDefaultDataSource(),
-      'onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP,
-      'contactType' => 'Individual',
-      'fieldSeparator' => CRM_Core_Config::singleton()->fieldSeparator,
-      'disableUSPS' => TRUE,
-    ];
+    $defaults = parent::setDefaultValues();
+    $defaults['contactType'] = 'Individual';
+    $defaults['disableUSPS'] = TRUE;
 
     if ($this->get('loadedMapping')) {
       $defaults['savedMapping'] = $this->get('loadedMapping');
diff --git a/civicrm/CRM/Contact/Page/View.php b/civicrm/CRM/Contact/Page/View.php
index 36cd8e0c98..76eec14737 100644
--- a/civicrm/CRM/Contact/Page/View.php
+++ b/civicrm/CRM/Contact/Page/View.php
@@ -46,7 +46,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
    *
    * @var string
    */
-  protected $_permission;
+  public $_permission;
 
   /**
    * Heart of the viewing process.
diff --git a/civicrm/CRM/Contact/Selector.php b/civicrm/CRM/Contact/Selector.php
index c5d8f8d26d..cb85daa4f2 100644
--- a/civicrm/CRM/Contact/Selector.php
+++ b/civicrm/CRM/Contact/Selector.php
@@ -46,6 +46,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
     'contact_id',
     'contact_type',
     'contact_sub_type',
+    'contact_is_deleted',
     'sort_name',
     'street_address',
     'city',
diff --git a/civicrm/CRM/Contribute/BAO/Contribution.php b/civicrm/CRM/Contribute/BAO/Contribution.php
index b9b696e4d7..ebc8c447f3 100644
--- a/civicrm/CRM/Contribute/BAO/Contribution.php
+++ b/civicrm/CRM/Contribute/BAO/Contribution.php
@@ -1833,7 +1833,22 @@ LEFT JOIN  civicrm_contribution contribution ON ( componentPayment.contribution_
       }
     }
 
-    $contribution->loadRelatedObjects($input, $ids);
+    $paymentProcessorID = CRM_Utils_Array::value('payment_processor_id', $input, CRM_Utils_Array::value(
+      'paymentProcessor',
+      $ids
+    ));
+
+    if (!isset($input['payment_processor_id']) && !$paymentProcessorID && $contribution->contribution_page_id) {
+      $paymentProcessorID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage',
+        $contribution->contribution_page_id,
+        'payment_processor'
+      );
+      if ($paymentProcessorID) {
+        $intentionalEnotice = $CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromContributionPage;
+      }
+    }
+
+    $contribution->loadRelatedObjects($paymentProcessorID, $ids);
 
     $memberships = $contribution->_relatedObjects['membership'] ?? [];
     $participant = $contribution->_relatedObjects['participant'] ?? [];
@@ -2310,38 +2325,20 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
    *
    * Note that the unit test for the BaseIPN class tests this function
    *
-   * @param array $input
-   *   Input as delivered from Payment Processor.
+   * @param int $paymentProcessorID
+   *   Payment Processor ID.
    * @param array $ids
    *   Ids as Loaded by Payment Processor.
    *
    * @return bool
    * @throws CRM_Core_Exception
    */
-  public function loadRelatedObjects($input, &$ids) {
-    // @todo deprecate this function - the steps should be
-    // 1) add additional functions like 'getRelatedMemberships'
-    // 2) switch all calls that refer to ->_relatedObjects to
-    // using the helper functions
-    // 3) make ->_relatedObjects noisy in some way (deprecation won't work for properties - hmm
-    // 4) make ->_relatedObjects protected
-    // 5) hone up the individual functions to not use rely on this having been called
-    // 6) deprecate like mad
-
-    $paymentProcessorID = CRM_Utils_Array::value('payment_processor_id', $input, CRM_Utils_Array::value(
-      'paymentProcessor',
-      $ids
-    ));
-
-    if (!isset($input['payment_processor_id']) && !$paymentProcessorID && $this->contribution_page_id) {
-      $paymentProcessorID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage',
-        $this->contribution_page_id,
-        'payment_processor'
-      );
-      if ($paymentProcessorID) {
-        $intentionalEnotice = $CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromContributionPage;
-      }
-    }
+  public function loadRelatedObjects($paymentProcessorID, &$ids) {
+    // @todo deprecate this function - we are slowly returning the functionality to
+    // the calling functions so this can be unravelled. It is only called from
+    // tests, composeMessage & transitionComponents. The last of these is itself
+    // deprecated, to be replaced by using Payment.create. Many parts of this are
+    // used by only one, or neither, of the actual calling functions.
 
     $ids['contributionType'] = $this->financial_type_id;
     $ids['financialType'] = $this->financial_type_id;
@@ -2468,7 +2465,23 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
     if (empty($this->financial_type_id)) {
       $this->find(TRUE);
     }
-    $this->loadRelatedObjects($input, $ids);
+
+    $paymentProcessorID = CRM_Utils_Array::value('payment_processor_id', $input, CRM_Utils_Array::value(
+      'paymentProcessor',
+      $ids
+    ));
+
+    if (!isset($input['payment_processor_id']) && !$paymentProcessorID && $this->contribution_page_id) {
+      $paymentProcessorID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage',
+        $this->contribution_page_id,
+        'payment_processor'
+      );
+      if ($paymentProcessorID) {
+        $intentionalEnotice = $CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromContributionPage;
+      }
+    }
+
+    $this->loadRelatedObjects($paymentProcessorID, $ids);
 
     if (empty($this->_component)) {
       $this->_component = $input['component'] ?? NULL;
diff --git a/civicrm/CRM/Contribute/Form/Contribution/Confirm.php b/civicrm/CRM/Contribute/Form/Contribution/Confirm.php
index 1fe1b7b8bb..891ebcbc5b 100644
--- a/civicrm/CRM/Contribute/Form/Contribution/Confirm.php
+++ b/civicrm/CRM/Contribute/Form/Contribution/Confirm.php
@@ -2851,11 +2851,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
         'payment_processor_id' => 0,
       ];
     }
-
-    CRM_Contribute_BAO_ContributionPage::sendMail($contactID,
-      $form->_values,
-      $contribution->is_test
-    );
+    throw new CRM_Core_Exception('code is unreachable, exception is for clarity for refactoring');
   }
 
   /**
diff --git a/civicrm/CRM/Contribute/Form/Contribution/Main.php b/civicrm/CRM/Contribute/Form/Contribution/Main.php
index 6376570e93..0056d1f727 100644
--- a/civicrm/CRM/Contribute/Form/Contribution/Main.php
+++ b/civicrm/CRM/Contribute/Form/Contribution/Main.php
@@ -362,10 +362,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
     if (empty($this->_values['pledge_id']) && empty($this->_ccid)) {
       $this->_separateMembershipPayment = FALSE;
       if (CRM_Core_Component::isEnabled('CiviMember')) {
-        $isTest = 0;
-        if ($this->_action & CRM_Core_Action::PREVIEW) {
-          $isTest = 1;
-        }
 
         if ($this->_priceSetId &&
           (CRM_Core_Component::getComponentID('CiviMember') == CRM_Utils_Array::value('extends', $this->_priceSet))
@@ -374,11 +370,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
           $this->set('useForMember', $this->_useForMember);
         }
 
-        $this->_separateMembershipPayment = $this->buildMembershipBlock(
-          $this->_membershipContactID,
-          NULL,
-          $isTest
-        );
+        $this->_separateMembershipPayment = $this->buildMembershipBlock();
       }
       $this->set('separateMembershipPayment', $this->_separateMembershipPayment);
     }
@@ -523,18 +515,15 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
    * @todo this was shared on CRM_Contribute_Form_ContributionBase but we are refactoring and simplifying for each
    *   step (main/confirm/thankyou)
    *
-   * @param int $cid
-   *   Contact checked for having a current membership for a particular membership.
-   * @param int|array $selectedMembershipTypeID
-   *   Selected membership id.
-   * @param null $isTest
-   *
    * @return bool
    *   Is this a separate membership payment
    *
    * @throws \CRM_Core_Exception
    */
-  private function buildMembershipBlock($cid, $selectedMembershipTypeID = NULL, $isTest = NULL) {
+  private function buildMembershipBlock() {
+    $cid = $this->_membershipContactID;
+    $isTest = (bool) ($this->_action & CRM_Core_Action::PREVIEW);
+    $selectedMembershipTypeID = NULL;
     $separateMembershipPayment = FALSE;
     $this->addOptionalQuickFormElement('auto_renew');
     if ($this->_membershipBlock) {
@@ -594,24 +583,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
         }
         foreach ($membershipTypeIds as $value) {
           $memType = $membershipTypeValues[$value];
-          if ($selectedMembershipTypeID != NULL) {
-            if ($memType['id'] == $selectedMembershipTypeID) {
-              $this->assign('minimum_fee', $memType['minimum_fee'] ?? NULL);
-              $this->assign('membership_name', $memType['name']);
-              if ($cid) {
-                $membership = new CRM_Member_DAO_Membership();
-                $membership->contact_id = $cid;
-                $membership->membership_type_id = $memType['id'];
-                if ($membership->find(TRUE)) {
-                  $this->assign('renewal_mode', TRUE);
-                  $memType['current_membership'] = $membership->end_date;
-                  $this->_currentMemberships[$membership->membership_type_id] = $membership->membership_type_id;
-                }
-              }
-              $membershipTypes[] = $memType;
-            }
-          }
-          elseif ($memType['is_active']) {
+          if ($memType['is_active']) {
 
             if ($allowAutoRenewOpt) {
               $javascriptMethod = ['onclick' => "return showHideAutoRenew( this.value );"];
@@ -679,14 +651,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
 
       // Assign autorenew option (0:hide,1:optional,2:required) so we can use it in confirmation etc.
       $autoRenewOption = CRM_Price_BAO_PriceSet::checkAutoRenewForPriceSet($this->_priceSetId);
-      //$selectedMembershipTypeID is retrieved as an array for membership priceset if multiple
-      //options for different organisation is selected on the contribution page.
-      if (is_numeric($selectedMembershipTypeID) && isset($membershipTypeValues[$selectedMembershipTypeID]['auto_renew'])) {
-        $this->assign('autoRenewOption', $membershipTypeValues[$selectedMembershipTypeID]['auto_renew']);
-      }
-      else {
-        $this->assign('autoRenewOption', $autoRenewOption);
-      }
+      $this->assign('autoRenewOption', $autoRenewOption);
 
       if (!$membershipPriceset) {
         if (!$this->_membershipBlock['is_required']) {
diff --git a/civicrm/CRM/Contribute/Form/ContributionBase.php b/civicrm/CRM/Contribute/Form/ContributionBase.php
index d75498099a..80a51f4cb9 100644
--- a/civicrm/CRM/Contribute/Form/ContributionBase.php
+++ b/civicrm/CRM/Contribute/Form/ContributionBase.php
@@ -360,8 +360,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
 
       // get price info
       // CRM-5095
-      $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id);
-      CRM_Price_BAO_PriceSet::initSet($this, 'civicrm_contribution_page', FALSE, $priceSetId);
+      $this->initSet($this);
 
       // this avoids getting E_NOTICE errors in php
       $setNullFields = [
@@ -374,27 +373,6 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
         }
       }
 
-      //check if Membership Block is enabled, if Membership Fields are included in profile
-      //get membership section for this contribution page
-      $this->_membershipBlock = CRM_Member_BAO_Membership::getMembershipBlock($this->_id);
-      $this->set('membershipBlock', $this->_membershipBlock);
-
-      if (!empty($this->_values['custom_pre_id'])) {
-        $preProfileType = CRM_Core_BAO_UFField::getProfileType($this->_values['custom_pre_id']);
-      }
-
-      if (!empty($this->_values['custom_post_id'])) {
-        $postProfileType = CRM_Core_BAO_UFField::getProfileType($this->_values['custom_post_id']);
-      }
-
-      if (((isset($postProfileType) && $postProfileType === 'Membership') ||
-          (isset($preProfileType) && $preProfileType === 'Membership')
-        ) &&
-        !$this->_membershipBlock['is_active']
-      ) {
-        CRM_Core_Error::statusBounce(ts('This page includes a Profile with Membership fields - but the Membership Block is NOT enabled. Please notify the site administrator.'));
-      }
-
       $pledgeBlock = CRM_Pledge_BAO_PledgeBlock::getPledgeBlock($this->_id);
 
       if ($pledgeBlock) {
@@ -421,6 +399,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
       $this->set('values', $this->_values);
       $this->set('fields', $this->_fields);
     }
+    $this->set('membershipBlock', $this->getMembershipBlock());
 
     // Handle PCP
     $pcpId = CRM_Utils_Request::retrieve('pcpId', 'Positive', $this);
@@ -446,9 +425,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
       $this->assign('pledgeBlock', TRUE);
     }
 
-    // check if one of the (amount , membership)  blocks is active or not.
-    $this->_membershipBlock = $this->get('membershipBlock');
-
+    // @todo - move this check to `getMembershipBlock`
     if (!$this->isFormSupportsNonMembershipContributions() &&
       !$this->_membershipBlock['is_active'] &&
       !$this->_priceSetId
@@ -490,11 +467,6 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
       $this->_values['campaign_id'] = $campID;
     }
 
-    //do check for cancel recurring and clean db, CRM-7696
-    if (CRM_Utils_Request::retrieve('cancel', 'Boolean')) {
-      self::cancelRecurring();
-    }
-
     // check if billing block is required for pay later
     if (!empty($this->_values['is_pay_later'])) {
       $this->_isBillingAddressRequiredForPayLater = $this->_values['is_billing_required'] ?? NULL;
@@ -502,6 +474,44 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
     }
   }
 
+  /**
+   * Initiate price set such that various non-BAO things are set on the form.
+   *
+   * This function is not really a BAO function so the location is misleading.
+   *
+   * @param CRM_Core_Form $form
+   *   Form entity id.
+   *
+   * @todo - removed unneeded code from previously-shared function
+   */
+  private function initSet($form) {
+    $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id);
+    //check if price set is is_config
+    if (is_numeric($priceSetId)) {
+      if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config') && $form->getVar('_name') != 'Participant') {
+        $form->assign('quickConfig', 1);
+      }
+    }
+    // get price info
+    if ($priceSetId) {
+      if ($form->_action & CRM_Core_Action::UPDATE) {
+        $form->_values['line_items'] = CRM_Price_BAO_LineItem::getLineItems($form->_id, 'contribution');
+        $required = FALSE;
+      }
+      else {
+        $required = TRUE;
+      }
+
+      $form->_priceSetId = $priceSetId;
+      $priceSet = CRM_Price_BAO_PriceSet::getSetDetail($priceSetId, $required);
+      $form->_priceSet = $priceSet[$priceSetId] ?? NULL;
+      $form->_values['fee'] = $form->_priceSet['fields'] ?? NULL;
+
+      $form->set('priceSetId', $form->_priceSetId);
+      $form->set('priceSet', $form->_priceSet);
+    }
+  }
+
   /**
    * Set the default values.
    */
@@ -1088,31 +1098,6 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
     }
   }
 
-  /**
-   * Cancel recurring contributions.
-   *
-   * In case user cancel recurring contribution,
-   * When we get the control back from payment gate way
-   * lets delete the recurring and related contribution.
-   *
-   * @throws \CRM_Core_Exception
-   */
-  public function cancelRecurring() {
-    $isCancel = CRM_Utils_Request::retrieve('cancel', 'Boolean');
-    if ($isCancel) {
-      $isRecur = CRM_Utils_Request::retrieve('isRecur', 'Boolean');
-      $recurId = CRM_Utils_Request::retrieve('recurId', 'Positive');
-      //clean db for recurring contribution.
-      if ($isRecur && $recurId) {
-        CRM_Contribute_BAO_ContributionRecur::deleteRecurContribution($recurId);
-      }
-      $contribId = CRM_Utils_Request::retrieve('contribId', 'Positive');
-      if ($contribId) {
-        CRM_Contribute_BAO_Contribution::deleteContribution($contribId);
-      }
-    }
-  }
-
   /**
    * Determine if recurring parameters need to be added to the form parameters.
    *
@@ -1249,4 +1234,29 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
     return (bool) ($this->_values['amount_block_is_active'] ?? FALSE);
   }
 
+  /**
+   * Get the membership block configured for the page, fetching if needed.
+   *
+   * The membership block is configured memberships are available to purchase via
+   * a quick-config price set.
+   *
+   * @return array|false
+   */
+  protected function getMembershipBlock() {
+    if (!isset($this->_membershipBlock)) {
+      //check if Membership Block is enabled, if Membership Fields are included in profile
+      //get membership section for this contribution page
+      $this->_membershipBlock = CRM_Member_BAO_Membership::getMembershipBlock($this->_id) ?? FALSE;
+      $preProfileType = empty($this->_values['custom_pre_id']) ? NULL : CRM_Core_BAO_UFField::getProfileType($this->_values['custom_pre_id']);
+      $postProfileType = empty($this->_values['custom_post_id']) ? NULL : CRM_Core_BAO_UFField::getProfileType($this->_values['custom_post_id']);
+
+      if ((($postProfileType === 'Membership') || ($preProfileType === 'Membership')) &&
+        !$this->_membershipBlock['is_active']
+      ) {
+        CRM_Core_Error::statusBounce(ts('This page includes a Profile with Membership fields - but the Membership Block is NOT enabled. Please notify the site administrator.'));
+      }
+    }
+    return $this->_membershipBlock;
+  }
+
 }
diff --git a/civicrm/CRM/Contribute/Import/Form/DataSource.php b/civicrm/CRM/Contribute/Import/Form/DataSource.php
index 6de2b35a8d..c161cc6529 100644
--- a/civicrm/CRM/Contribute/Import/Form/DataSource.php
+++ b/civicrm/CRM/Contribute/Import/Form/DataSource.php
@@ -44,8 +44,6 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Import_Form_DataSource {
       CRM_Import_Parser::DUPLICATE_UPDATE => ts('Update existing contributions'),
     ]);
 
-    $this->setDefaults(['onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP]);
-
     $this->addElement('xbutton', 'loadMapping', ts('Load Mapping'), [
       'type' => 'submit',
       'onclick' => 'checkSelect()',
diff --git a/civicrm/CRM/Contribute/Import/Parser/Contribution.php b/civicrm/CRM/Contribute/Import/Parser/Contribution.php
index 2f54ac9554..535c955621 100644
--- a/civicrm/CRM/Contribute/Import/Parser/Contribution.php
+++ b/civicrm/CRM/Contribute/Import/Parser/Contribution.php
@@ -501,7 +501,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
    *
    * @throws \CRM_Core_Exception
    *
-   * @return array|null
+   * @return array
    */
   private function lookupContribution(array $params): array {
     $where = [];
diff --git a/civicrm/CRM/Core/BAO/File.php b/civicrm/CRM/Core/BAO/File.php
index 5f1bca7f7c..9d8cb0ae30 100644
--- a/civicrm/CRM/Core/BAO/File.php
+++ b/civicrm/CRM/Core/BAO/File.php
@@ -763,15 +763,15 @@ HEREDOC;
   /**
    * Get a reference to the file-search service (if one is available).
    *
-   * @return CRM_Core_FileSearchInterface|NULL
+   * @return CRM_Core_FileSearchInterface|null
    */
   public static function getSearchService() {
     $fileSearches = [];
     CRM_Utils_Hook::fileSearches($fileSearches);
 
     // use the first available search
+    /** @var CRM_Core_FileSearchInterface $fileSearch */
     foreach ($fileSearches as $fileSearch) {
-      /** @var $fileSearch CRM_Core_FileSearchInterface */
       return $fileSearch;
     }
     return NULL;
diff --git a/civicrm/CRM/Core/BAO/OptionValue.php b/civicrm/CRM/Core/BAO/OptionValue.php
index 5b82142359..aeff6e50a4 100644
--- a/civicrm/CRM/Core/BAO/OptionValue.php
+++ b/civicrm/CRM/Core/BAO/OptionValue.php
@@ -126,18 +126,13 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue implements \Civi
    *
    * @param array $params
    *   Reference array contains the values submitted by the form.
-   * @param array $ids
-   *   deprecated Reference array contains the id.
    *
    * @return \CRM_Core_DAO_OptionValue
    *
    * @throws \CRM_Core_Exception
    */
-  public static function add(&$params, $ids = []) {
-    if (!empty($ids['optionValue']) && empty($params['id'])) {
-      CRM_Core_Error::deprecatedFunctionWarning('$params[\'id\'] should be set, $ids is deprecated');
-    }
-    $id = $params['id'] ?? $ids['optionValue'] ?? NULL;
+  public static function add(&$params) {
+    $id = $params['id'] ?? NULL;
 
     // Update custom field data to reflect the new value
     if ($id && isset($params['value'])) {
diff --git a/civicrm/CRM/Core/BAO/PrevNextCache.php b/civicrm/CRM/Core/BAO/PrevNextCache.php
index 9a88d6ec30..1b5ee2f3d8 100644
--- a/civicrm/CRM/Core/BAO/PrevNextCache.php
+++ b/civicrm/CRM/Core/BAO/PrevNextCache.php
@@ -295,53 +295,6 @@ FROM   civicrm_prevnext_cache pn
     return (@CRM_Utils_String::unserialize($string) !== FALSE);
   }
 
-  /**
-   * @param string $sqlValues string of SQLValues to insert
-   * @return array
-   */
-  public static function convertSetItemValues($sqlValues) {
-    CRM_Core_Error::deprecatedFunctionWarning('Deprecated function');
-    $closingBrace = strpos($sqlValues, ')') - strlen($sqlValues);
-    $valueArray = array_map('trim', explode(', ', substr($sqlValues, strpos($sqlValues, '(') + 1, $closingBrace - 1)));
-    foreach ($valueArray as $key => &$value) {
-      // remove any quotes from values.
-      if (substr($value, 0, 1) == "'") {
-        $valueArray[$key] = substr($value, 1, -1);
-      }
-    }
-    return $valueArray;
-  }
-
-  /**
-   * @deprecated
-   *
-   * @param array|string $entity_table
-   * @param int $entity_id1
-   * @param int $entity_id2
-   * @param string $cacheKey
-   * @param string $data
-   */
-  public static function setItem($entity_table = NULL, $entity_id1 = NULL, $entity_id2 = NULL, $cacheKey = NULL, $data = NULL) {
-    CRM_Core_Error::deprecatedFunctionWarning('Deprecated function');
-    // If entity table is an array we are passing in an older format where this function only had 1 param $values. We put a deprecation warning.
-    if (!empty($entity_table) && is_array($entity_table)) {
-      CRM_Core_Error::deprecatedWarning('Deprecated code path. Values should not be set this is going away in the future in favour of specific function params for each column.');
-      foreach ($values as $value) {
-        $valueArray = self::convertSetItemValues($value);
-        self::setItem($valueArray[0], $valueArray[1], $valueArray[2], $valueArray[3], $valueArray[4]);
-      }
-    }
-    else {
-      CRM_Core_DAO::executeQuery("INSERT INTO civicrm_prevnext_cache (entity_table, entity_id1, entity_id2, cacheKey, data) VALUES
-        (%1, %2, %3, %4, '{$data}')", [
-          1 => [$entity_table, 'String'],
-          2 => [$entity_id1, 'Integer'],
-          3 => [$entity_id2, 'Integer'],
-          4 => [$cacheKey, 'String'],
-        ]);
-    }
-  }
-
   /**
    * Get count of matching rows.
    *
@@ -436,30 +389,6 @@ WHERE (pn.cachekey $op %1 OR pn.cachekey $op %2)
     }
   }
 
-  /**
-   * Old function to clean up he cache.
-   *
-   * @deprecated.
-   */
-  public static function cleanupCache() {
-    CRM_Core_Error::deprecatedFunctionWarning('Deprecated function');
-    Civi::service('prevnext')->cleanup();
-  }
-
-  /**
-   * Get the selections.
-   *
-   * NOTE: This stub has been preserved because one extension in `universe`
-   * was referencing the function.
-   *
-   * @deprecated
-   * @see CRM_Core_PrevNextCache_Sql::getSelection()
-   */
-  public static function getSelection($cacheKey, $action = 'get') {
-    CRM_Core_Error::deprecatedFunctionWarning('Deprecated function');
-    return Civi::service('prevnext')->getSelection($cacheKey, $action);
-  }
-
   /**
    * Flip 2 contacts in the prevNext cache.
    *
diff --git a/civicrm/CRM/Core/BAO/UFGroup.php b/civicrm/CRM/Core/BAO/UFGroup.php
index 6987ebbff2..0c9d57caa2 100644
--- a/civicrm/CRM/Core/BAO/UFGroup.php
+++ b/civicrm/CRM/Core/BAO/UFGroup.php
@@ -1894,6 +1894,9 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
       }
     }
     elseif (substr($fieldName, 0, 9) === 'image_URL') {
+      if (!isset($attributes['accept'])) {
+        $attributes['accept'] = 'image/png, image/jpeg, image/gif';
+      }
       $form->add('file', $name, $title, $attributes, $required);
       $form->addUploadElement($name);
     }
diff --git a/civicrm/CRM/Core/BAO/UserJob.php b/civicrm/CRM/Core/BAO/UserJob.php
index 39acdb3dd5..036a4b4b9c 100644
--- a/civicrm/CRM/Core/BAO/UserJob.php
+++ b/civicrm/CRM/Core/BAO/UserJob.php
@@ -164,4 +164,34 @@ class CRM_Core_BAO_UserJob extends CRM_Core_DAO_UserJob implements \Civi\Core\Ho
     return array_values($types);
   }
 
+  /**
+   * Get user job type.
+   *
+   * @param string $type
+   *
+   * @return array
+   * @throws \CRM_Core_Exception
+   */
+  public static function getType(string $type): array {
+    foreach (self::getTypes() as $importType) {
+      if ($importType['id'] === $type) {
+        return $importType;
+      }
+    }
+    throw new CRM_Core_Exception($type . 'not found');
+  }
+
+  /**
+   * Get the specified value for the import job type.
+   *
+   * @param string $type
+   * @param string $key
+   *
+   * @return mixed
+   * @throws \CRM_Core_Exception
+   */
+  public static function getTypeValue(string $type, string $key) {
+    return self::getType($type)[$key];
+  }
+
 }
diff --git a/civicrm/CRM/Core/CodeGen/Schema.php b/civicrm/CRM/Core/CodeGen/Schema.php
index 7793dc5ae4..bc3e804626 100644
--- a/civicrm/CRM/Core/CodeGen/Schema.php
+++ b/civicrm/CRM/Core/CodeGen/Schema.php
@@ -5,6 +5,8 @@
  */
 class CRM_Core_CodeGen_Schema extends CRM_Core_CodeGen_BaseTask {
 
+  public $locales;
+
   /**
    * CRM_Core_CodeGen_Schema constructor.
    *
diff --git a/civicrm/CRM/Core/CodeGen/Specification.php b/civicrm/CRM/Core/CodeGen/Specification.php
index c336ef9ecb..9f3aaea737 100644
--- a/civicrm/CRM/Core/CodeGen/Specification.php
+++ b/civicrm/CRM/Core/CodeGen/Specification.php
@@ -9,6 +9,8 @@ class CRM_Core_CodeGen_Specification {
 
   protected $classNames;
 
+  public $buildVersion;
+
   /**
    * Read and parse.
    *
diff --git a/civicrm/CRM/Core/DAO/OptionGroup.php b/civicrm/CRM/Core/DAO/OptionGroup.php
index cb480b03e4..0b6a0d2de7 100644
--- a/civicrm/CRM/Core/DAO/OptionGroup.php
+++ b/civicrm/CRM/Core/DAO/OptionGroup.php
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/OptionGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:2ccb4ad1de88c89bdefe80c674d2bc67)
+ * (GenCodeChecksum:6d1ca6dc8aa693e7b26bb19b731b0b55)
  */
 
 /**
@@ -68,7 +68,7 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO {
    * Option group description.
    *
    * @var string|null
-   *   (SQL type: varchar(255))
+   *   (SQL type: text)
    *   Note that values will be retrieved from the database as a string.
    */
   public $description;
@@ -192,11 +192,9 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO {
         ],
         'description' => [
           'name' => 'description',
-          'type' => CRM_Utils_Type::T_STRING,
+          'type' => CRM_Utils_Type::T_TEXT,
           'title' => ts('Option Group Description'),
           'description' => ts('Option group description.'),
-          'maxlength' => 255,
-          'size' => CRM_Utils_Type::HUGE,
           'where' => 'civicrm_option_group.description',
           'table_name' => 'civicrm_option_group',
           'entity' => 'OptionGroup',
diff --git a/civicrm/CRM/Core/Form/Search.php b/civicrm/CRM/Core/Form/Search.php
index 001bd72dcd..aa2e13b5b1 100644
--- a/civicrm/CRM/Core/Form/Search.php
+++ b/civicrm/CRM/Core/Form/Search.php
@@ -94,6 +94,8 @@ class CRM_Core_Form_Search extends CRM_Core_Form {
    */
   protected $searchFieldMetadata = ['Contact' => []];
 
+  protected $_reset;
+
   /**
    * @return array
    */
diff --git a/civicrm/CRM/Core/I18n/SchemaStructure.php b/civicrm/CRM/Core/I18n/SchemaStructure.php
index cf193ca67b..1303857cc0 100644
--- a/civicrm/CRM/Core/I18n/SchemaStructure.php
+++ b/civicrm/CRM/Core/I18n/SchemaStructure.php
@@ -34,7 +34,7 @@ class CRM_Core_I18n_SchemaStructure {
         ],
         'civicrm_option_group' => [
           'title' => "varchar(255) COMMENT 'Option Group title.'",
-          'description' => "varchar(255) COMMENT 'Option group description.'",
+          'description' => "text COMMENT 'Option group description.'",
         ],
         'civicrm_relationship_type' => [
           'label_a_b' => "varchar(64) COMMENT 'label for relationship of contact_a to contact_b.'",
diff --git a/civicrm/CRM/Core/Page.php b/civicrm/CRM/Core/Page.php
index 806393cead..0507bd2dc1 100644
--- a/civicrm/CRM/Core/Page.php
+++ b/civicrm/CRM/Core/Page.php
@@ -134,6 +134,13 @@ class CRM_Core_Page {
     'beginHookFormElements',
   ];
 
+  /**
+   * The permission we have on this contact
+   *
+   * @var string
+   */
+  public $_permission;
+
   /**
    * Class constructor.
    *
diff --git a/civicrm/CRM/Core/Payment/FirstData.php b/civicrm/CRM/Core/Payment/FirstData.php
index e0e6cdd427..6623c43658 100644
--- a/civicrm/CRM/Core/Payment/FirstData.php
+++ b/civicrm/CRM/Core/Payment/FirstData.php
@@ -138,7 +138,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
    * This function sends request and receives response from
    * the processor
    *
-   * @param array|PropertyBag $params
+   * @param array|\Civi\Payment\PropertyBag $params
    *
    * @param string $component
    *
diff --git a/civicrm/CRM/Core/Payment/PayJunction.php b/civicrm/CRM/Core/Payment/PayJunction.php
index 2d0de55d3f..42f67140ea 100644
--- a/civicrm/CRM/Core/Payment/PayJunction.php
+++ b/civicrm/CRM/Core/Payment/PayJunction.php
@@ -41,7 +41,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment {
    * This function sends request and receives response from
    * PayJunction payment process
    *
-   * @param array|PropertyBag $params
+   * @param array|\Civi\Payment\PropertyBag $params
    *
    * @param string $component
    *
diff --git a/civicrm/CRM/Core/Selector/Controller.php b/civicrm/CRM/Core/Selector/Controller.php
index 05e1e09a90..a3723979b1 100644
--- a/civicrm/CRM/Core/Selector/Controller.php
+++ b/civicrm/CRM/Core/Selector/Controller.php
@@ -158,6 +158,8 @@ class CRM_Core_Selector_Controller {
    */
   protected $_dynamicAction = FALSE;
 
+  protected $_case;
+
   /**
    * Class constructor.
    *
diff --git a/civicrm/CRM/Core/Smarty/plugins/function.crmKey.php b/civicrm/CRM/Core/Smarty/plugins/function.crmKey.php
index c0ea442692..31a7128fb9 100644
--- a/civicrm/CRM/Core/Smarty/plugins/function.crmKey.php
+++ b/civicrm/CRM/Core/Smarty/plugins/function.crmKey.php
@@ -18,7 +18,7 @@
 /**
  * Generate a CRM_Core_Key of a given name
  *
- * @param string $params
+ * @param array $params
  *   Params of the {crmKey} call, with the ‘name’ key holding the name of the key.
  * @param CRM_Core_Smarty $smarty
  *   The Smarty object.
diff --git a/civicrm/CRM/Custom/Form/CustomDataByType.php b/civicrm/CRM/Custom/Form/CustomDataByType.php
index 2abfdf37ee..d7d22e9104 100644
--- a/civicrm/CRM/Custom/Form/CustomDataByType.php
+++ b/civicrm/CRM/Custom/Form/CustomDataByType.php
@@ -48,7 +48,8 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form {
     if (array_key_exists($this->_type, $contactTypes)) {
       $this->assign('contactId', $this->_entityId);
     }
-    if (!is_array($this->_subType) && strstr($this->_subType, CRM_Core_DAO::VALUE_SEPARATOR)) {
+    if (!is_array($this->_subType) && strstr($this->_subType ?? '', CRM_Core_DAO::VALUE_SEPARATOR)) {
+      CRM_Core_Error::deprecatedWarning('Using a CRM_Core_DAO::VALUE_SEPARATOR separated subType on civicrm/custom route is deprecated, use a comma-separated string instead.');
       $this->_subType = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($this->_subType, CRM_Core_DAO::VALUE_SEPARATOR));
     }
     CRM_Custom_Form_CustomData::setGroupTree($this, $this->_subType, $this->_groupID, $this->_onlySubtype);
diff --git a/civicrm/CRM/Custom/Import/Form/DataSource.php b/civicrm/CRM/Custom/Import/Form/DataSource.php
index 326a759a1c..4f780de882 100644
--- a/civicrm/CRM/Custom/Import/Form/DataSource.php
+++ b/civicrm/CRM/Custom/Import/Form/DataSource.php
@@ -99,13 +99,10 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Import_Form_DataSource {
    * @throws \CRM_Core_Exception
    */
   public function setDefaultValues(): array {
-    $config = CRM_Core_Config::singleton();
-    $defaults = [
-      'contactType' => 'Individual',
-      'fieldSeparator' => $config->fieldSeparator,
-      // Perhaps never used, but permits url passing of the group.
-      'multipleCustomData' => CRM_Utils_Request::retrieve('id', 'Positive', $this),
-    ];
+    parent::setDefaultValues();
+    $defaults['contactType'] = 'Individual';
+    // Perhaps never used, but permits url passing of the group.
+    $defaults['multipleCustomData'] = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     $loadedMapping = $this->get('loadedMapping');
     if ($loadedMapping) {
diff --git a/civicrm/CRM/Dedupe/Merger.php b/civicrm/CRM/Dedupe/Merger.php
index 9dfec97e9f..ca76a69c78 100644
--- a/civicrm/CRM/Dedupe/Merger.php
+++ b/civicrm/CRM/Dedupe/Merger.php
@@ -1783,7 +1783,9 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       $submitted = [];
     }
     foreach ($submitted as $key => $value) {
-      [$cFields, $submitted] = self::processCustomFields($mainId, $key, $cFields, $submitted, $value);
+      if (substr($key, 0, 7) === 'custom_') {
+        $submitted = self::processCustomFields($mainId, $key, $cFields, $submitted, $value);
+      }
     }
 
     // move view only custom fields CRM-5362
@@ -2203,81 +2205,79 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    * @throws \CRM_Core_Exception
    */
   protected static function processCustomFields($mainId, $key, $cFields, $submitted, $value) {
-    if (substr($key, 0, 7) === 'custom_') {
-      $fid = (int) substr($key, 7);
-      if (empty($cFields[$fid])) {
-        return [$cFields, $submitted];
-      }
-      $htmlType = $cFields[$fid]['attributes']['html_type'];
-      $isSerialized = CRM_Core_BAO_CustomField::isSerialized($cFields[$fid]['attributes']);
-
-      if ($htmlType === 'File') {
-        // Handled in CustomField->move(). Tested in testMergeCustomFields.
-        unset($submitted["custom_$fid"]);
-      }
-      elseif (!$isSerialized && ($htmlType === 'Select Country' || $htmlType === 'Select State/Province')) {
-        // @todo Test in testMergeCustomFields disabled as this does not work, Handle in CustomField->move().
-        $submitted[$key] = CRM_Core_BAO_CustomField::displayValue($value, $fid);
-      }
-      elseif ($htmlType === 'Select Date') {
-        if ($cFields[$fid]['attributes']['is_view']) {
-          $submitted[$key] = date('YmdHis', strtotime($submitted[$key]));
-        }
-      }
-      elseif ($isSerialized) {
-        // Merge values from both contacts for multivalue fields, CRM-4385
-        // get the existing custom values from db.
-        $customParams = ['entityID' => $mainId, $key => TRUE];
-        $customfieldValues = CRM_Core_BAO_CustomValueTable::getValues($customParams);
-        if (!empty($customfieldValues[$key])) {
-          $existingValue = explode(CRM_Core_DAO::VALUE_SEPARATOR, $customfieldValues[$key]);
-          if (is_array($existingValue) && !empty($existingValue)) {
-            $mergeValue = $submittedCustomFields = [];
-            if ($value === 'null') {
-              // CRM-19074 if someone has deliberately chosen to overwrite with 'null', respect it.
-              $submitted[$key] = $value;
+    $fid = (int) substr($key, 7);
+    if (empty($cFields[$fid])) {
+      return $submitted;
+    }
+    $htmlType = $cFields[$fid]['attributes']['html_type'];
+    $isSerialized = CRM_Core_BAO_CustomField::isSerialized($cFields[$fid]['attributes']);
+
+    if ($htmlType === 'File') {
+      // Handled in CustomField->move(). Tested in testMergeCustomFields.
+      unset($submitted["custom_$fid"]);
+    }
+    elseif (!$isSerialized && ($htmlType === 'Select Country' || $htmlType === 'Select State/Province')) {
+      // @todo Test in testMergeCustomFields disabled as this does not work, Handle in CustomField->move().
+      $submitted[$key] = CRM_Core_BAO_CustomField::displayValue($value, $fid);
+    }
+    elseif ($htmlType === 'Select Date') {
+      if ($cFields[$fid]['attributes']['is_view']) {
+        $submitted[$key] = date('YmdHis', strtotime($submitted[$key]));
+      }
+    }
+    elseif ($isSerialized) {
+      // Merge values from both contacts for multivalue fields, CRM-4385
+      // get the existing custom values from db.
+      $customParams = ['entityID' => $mainId, $key => TRUE];
+      $customfieldValues = CRM_Core_BAO_CustomValueTable::getValues($customParams);
+      if (!empty($customfieldValues[$key])) {
+        $existingValue = explode(CRM_Core_DAO::VALUE_SEPARATOR, $customfieldValues[$key]);
+        if (is_array($existingValue) && !empty($existingValue)) {
+          $mergeValue = $submittedCustomFields = [];
+          if ($value === 'null') {
+            // CRM-19074 if someone has deliberately chosen to overwrite with 'null', respect it.
+            $submitted[$key] = $value;
+          }
+          else {
+            if ($value) {
+              $submittedCustomFields = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
             }
-            else {
-              if ($value) {
-                $submittedCustomFields = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
-              }
 
-              // CRM-19653: overwrite or add the existing custom field value with dupicate contact's
-              // custom field value stored at $submittedCustomValue.
-              foreach ($submittedCustomFields as $k => $v) {
-                if ($v != '' && !in_array($v, $mergeValue)) {
-                  $mergeValue[] = $v;
-                }
+            // CRM-19653: overwrite or add the existing custom field value with dupicate contact's
+            // custom field value stored at $submittedCustomValue.
+            foreach ($submittedCustomFields as $k => $v) {
+              if ($v != '' && !in_array($v, $mergeValue)) {
+                $mergeValue[] = $v;
               }
+            }
 
-              //keep state and country as array format.
-              //for checkbox and m-select format w/ VALUE_SEPARATOR
-              if (in_array($htmlType, ['CheckBox', 'Select'])) {
-                $submitted[$key] = CRM_Utils_Array::implodePadded($mergeValue);
-              }
-              else {
-                $submitted[$key] = $mergeValue;
-              }
+            //keep state and country as array format.
+            //for checkbox and m-select format w/ VALUE_SEPARATOR
+            if (in_array($htmlType, ['CheckBox', 'Select'])) {
+              $submitted[$key] = CRM_Utils_Array::implodePadded($mergeValue);
+            }
+            else {
+              $submitted[$key] = $mergeValue;
             }
           }
         }
-        elseif (in_array($htmlType, ['Select Country', 'Select State/Province'])) {
-          //we require submitted values should be in array format
-          if ($value) {
-            $mergeValueArray = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
-            //hack to remove null values from array.
-            $mergeValue = [];
-            foreach ($mergeValueArray as $k => $v) {
-              if ($v != '') {
-                $mergeValue[] = $v;
-              }
+      }
+      elseif (in_array($htmlType, ['Select Country', 'Select State/Province'])) {
+        //we require submitted values should be in array format
+        if ($value) {
+          $mergeValueArray = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
+          //hack to remove null values from array.
+          $mergeValue = [];
+          foreach ($mergeValueArray as $k => $v) {
+            if ($v != '') {
+              $mergeValue[] = $v;
             }
-            $submitted[$key] = $mergeValue;
           }
+          $submitted[$key] = $mergeValue;
         }
       }
     }
-    return [$cFields, $submitted];
+    return $submitted;
   }
 
   /**
diff --git a/civicrm/CRM/Event/Form/ManageEvent/TabHeader.php b/civicrm/CRM/Event/Form/ManageEvent/TabHeader.php
index 260605871f..bd661efae4 100644
--- a/civicrm/CRM/Event/Form/ManageEvent/TabHeader.php
+++ b/civicrm/CRM/Event/Form/ManageEvent/TabHeader.php
@@ -66,7 +66,10 @@ class CRM_Event_Form_ManageEvent_TabHeader {
     $tabs = [];
     $tabs['settings'] = ['title' => ts('Info and Settings'), 'class' => 'ajaxForm livePage'] + $default;
     $tabs['location'] = ['title' => ts('Event Location')] + $default;
-    $tabs['fee'] = ['title' => ts('Fees')] + $default;
+    // If CiviContribute is active, create the Fees tab.
+    if (CRM_Core_Component::isEnabled('CiviContribute')) {
+      $tabs['fee'] = ['title' => ts('Fees')] + $default;
+    }
     $tabs['registration'] = ['title' => ts('Online Registration')] + $default;
     // @fixme I don't understand the event permissions check here - can we just get rid of it?
     $permissions = CRM_Event_BAO_Event::getAllPermissions();
diff --git a/civicrm/CRM/Event/Form/Registration.php b/civicrm/CRM/Event/Form/Registration.php
index 6da4f9dfa6..b22ac78543 100644
--- a/civicrm/CRM/Event/Form/Registration.php
+++ b/civicrm/CRM/Event/Form/Registration.php
@@ -586,7 +586,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
     else {
       $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $eventID);
     }
-    CRM_Price_BAO_PriceSet::initSet($form, 'civicrm_event', $doNotIncludeExpiredFields, $priceSetId);
+    self::initSet($form, 'civicrm_event', $doNotIncludeExpiredFields, $priceSetId);
 
     if (property_exists($form, '_context') && ($form->_context == 'standalone'
         || $form->_context == 'participant')
@@ -636,6 +636,106 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
     }
   }
 
+  /**
+   * Initiate price set such that various non-BAO things are set on the form.
+   *
+   * This function is not really a BAO function so the location is misleading.
+   *
+   * @param CRM_Core_Form $form
+   *   Form entity id.
+   * @param string $entityTable
+   * @param bool $doNotIncludeExpiredFields
+   * @param int $priceSetId
+   *   Price Set ID
+   *
+   * @todo - removed unneeded code from previously-shared function
+   */
+  private static function initSet(&$form, $entityTable = 'civicrm_event', $doNotIncludeExpiredFields = FALSE, $priceSetId = NULL) {
+
+    //check if price set is is_config
+    if (is_numeric($priceSetId)) {
+      if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config') && $form->getVar('_name') != 'Participant') {
+        $form->assign('quickConfig', 1);
+      }
+    }
+    // get price info
+    if ($priceSetId) {
+      if ($form->_action & CRM_Core_Action::UPDATE) {
+        $entityId = $entity = NULL;
+
+        switch ($entityTable) {
+          case 'civicrm_event':
+            $entity = 'participant';
+            if (in_array(CRM_Utils_System::getClassName($form), ['CRM_Event_Form_Participant', 'CRM_Event_Form_Task_Register'])) {
+              $entityId = $form->_id;
+            }
+            else {
+              $entityId = $form->_participantId;
+            }
+            break;
+
+          case 'civicrm_contribution_page':
+          case 'civicrm_contribution':
+            $entity = 'contribution';
+            $entityId = $form->_id;
+            break;
+        }
+
+        if ($entityId && $entity) {
+          $form->_values['line_items'] = CRM_Price_BAO_LineItem::getLineItems($entityId, $entity);
+        }
+        $required = FALSE;
+      }
+      else {
+        $required = TRUE;
+      }
+
+      $form->_priceSetId = $priceSetId;
+      $priceSet = CRM_Price_BAO_PriceSet::getSetDetail($priceSetId, $required, $doNotIncludeExpiredFields);
+      $form->_priceSet = $priceSet[$priceSetId] ?? NULL;
+      $form->_values['fee'] = $form->_priceSet['fields'] ?? NULL;
+
+      //get the price set fields participant count.
+      if ($entityTable == 'civicrm_event') {
+        //get option count info.
+        $form->_priceSet['optionsCountTotal'] = CRM_Price_BAO_PriceSet::getPricesetCount($priceSetId);
+        if ($form->_priceSet['optionsCountTotal']) {
+          $optionsCountDetails = [];
+          if (!empty($form->_priceSet['fields'])) {
+            foreach ($form->_priceSet['fields'] as $field) {
+              foreach ($field['options'] as $option) {
+                $count = CRM_Utils_Array::value('count', $option, 0);
+                $optionsCountDetails['fields'][$field['id']]['options'][$option['id']] = $count;
+              }
+            }
+          }
+          $form->_priceSet['optionsCountDetails'] = $optionsCountDetails;
+        }
+
+        //get option max value info.
+        $optionsMaxValueTotal = 0;
+        $optionsMaxValueDetails = [];
+
+        if (!empty($form->_priceSet['fields'])) {
+          foreach ($form->_priceSet['fields'] as $field) {
+            foreach ($field['options'] as $option) {
+              $maxVal = CRM_Utils_Array::value('max_value', $option, 0);
+              $optionsMaxValueDetails['fields'][$field['id']]['options'][$option['id']] = $maxVal;
+              $optionsMaxValueTotal += $maxVal;
+            }
+          }
+        }
+
+        $form->_priceSet['optionsMaxValueTotal'] = $optionsMaxValueTotal;
+        if ($optionsMaxValueTotal) {
+          $form->_priceSet['optionsMaxValueDetails'] = $optionsMaxValueDetails;
+        }
+      }
+      $form->set('priceSetId', $form->_priceSetId);
+      $form->set('priceSet', $form->_priceSet);
+    }
+  }
+
   /**
    * Handle process after the confirmation of payment by User.
    *
diff --git a/civicrm/CRM/Event/Form/Search.php b/civicrm/CRM/Event/Form/Search.php
index 7a2c720416..9a8f979f1f 100644
--- a/civicrm/CRM/Event/Form/Search.php
+++ b/civicrm/CRM/Event/Form/Search.php
@@ -348,8 +348,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
    * The processing consists of using a Selector / Controller framework for getting the
    * search results.
    *
-   * @param
-   *
    * @return void
    * @throws \CRM_Core_Exception
    */
diff --git a/civicrm/CRM/Event/Form/Task.php b/civicrm/CRM/Event/Form/Task.php
index 45c7f882bd..c6d0a12fe5 100644
--- a/civicrm/CRM/Event/Form/Task.php
+++ b/civicrm/CRM/Event/Form/Task.php
@@ -43,8 +43,6 @@ class CRM_Event_Form_Task extends CRM_Core_Form_Task {
   /**
    * Build all the data structures needed to build the form.
    *
-   * @param
-   *
    * @return void
    */
   public function preProcess() {
diff --git a/civicrm/CRM/Event/Form/Task/Badge.php b/civicrm/CRM/Event/Form/Task/Badge.php
index 501105c5c0..69496c9598 100644
--- a/civicrm/CRM/Event/Form/Task/Badge.php
+++ b/civicrm/CRM/Event/Form/Task/Badge.php
@@ -37,8 +37,6 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task {
   /**
    * Build all the data structures needed to build the form.
    *
-   * @param
-   *
    * @return void
    */
   public function preProcess() {
diff --git a/civicrm/CRM/Event/Import/Form/DataSource.php b/civicrm/CRM/Event/Import/Form/DataSource.php
index 70d9fb68fd..4817f05400 100644
--- a/civicrm/CRM/Event/Import/Form/DataSource.php
+++ b/civicrm/CRM/Event/Import/Form/DataSource.php
@@ -46,7 +46,6 @@ class CRM_Event_Import_Form_DataSource extends CRM_Import_Form_DataSource {
       CRM_Import_Parser::DUPLICATE_UPDATE => ts('Update'),
       CRM_Import_Parser::DUPLICATE_NOCHECK => ts('No Duplicate Checking'),
     ]);
-    $this->setDefaults(['onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP]);
 
     $this->addContactTypeSelector();
   }
diff --git a/civicrm/CRM/Event/Page/ManageEvent.php b/civicrm/CRM/Event/Page/ManageEvent.php
index bdcf956e25..657b1d037a 100644
--- a/civicrm/CRM/Event/Page/ManageEvent.php
+++ b/civicrm/CRM/Event/Page/ManageEvent.php
@@ -147,13 +147,16 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page {
           'url' => 'civicrm/event/manage/location',
           'field' => 'loc_block_id',
         ];
+      // If CiviContribute is active, create the Fees dropdown menu item.
+      if (CRM_Core_Component::isEnabled('CiviContribute')) {
+        self::$_tabLinks[$cacheKey]['fee']
+          = [
+            'title' => ts('Fees'),
+            'url' => 'civicrm/event/manage/fee',
+            'field' => 'is_monetary',
+          ];
+      }
 
-      self::$_tabLinks[$cacheKey]['fee']
-        = [
-          'title' => ts('Fees'),
-          'url' => 'civicrm/event/manage/fee',
-          'field' => 'is_monetary',
-        ];
       self::$_tabLinks[$cacheKey]['registration']
         = [
           'title' => ts('Online Registration'),
diff --git a/civicrm/CRM/Event/Page/ParticipantListing/Simple.php b/civicrm/CRM/Event/Page/ParticipantListing/Simple.php
index 5452d805dd..10d1f69e5a 100644
--- a/civicrm/CRM/Event/Page/ParticipantListing/Simple.php
+++ b/civicrm/CRM/Event/Page/ParticipantListing/Simple.php
@@ -22,6 +22,9 @@ class CRM_Event_Page_ParticipantListing_Simple extends CRM_Core_Page {
 
   protected $_eventTitle;
 
+  /**
+   * @var CRM_Utils_Pager
+   */
   protected $_pager;
 
   public function preProcess() {
diff --git a/civicrm/CRM/Event/Selector/Search.php b/civicrm/CRM/Event/Selector/Search.php
index 3ff31c429b..156caf5e73 100644
--- a/civicrm/CRM/Event/Selector/Search.php
+++ b/civicrm/CRM/Event/Selector/Search.php
@@ -516,7 +516,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
   }
 
   /**
-   * @return string
+   * @return CRM_Contact_BAO_Query
    */
   public function &getQuery() {
     return $this->_query;
diff --git a/civicrm/CRM/Export/Form/Select.php b/civicrm/CRM/Export/Form/Select.php
index 6a3198f275..7136d5eb51 100644
--- a/civicrm/CRM/Export/Form/Select.php
+++ b/civicrm/CRM/Export/Form/Select.php
@@ -64,8 +64,6 @@ class CRM_Export_Form_Select extends CRM_Core_Form_Task {
   /**
    * Build all the data structures needed to build the form.
    *
-   * @param
-   *
    * @return void
    */
   public function preProcess() {
@@ -428,7 +426,7 @@ FROM   {$this->_componentTable}
   /**
    * Get the name of the component.
    *
-   * @return array
+   * @return string
    */
   protected function getComponentName(): string {
     // CRM_Export_Controller_Standalone has this method
diff --git a/civicrm/CRM/Extension/Browser.php b/civicrm/CRM/Extension/Browser.php
index af1a0e84de..f61caf3152 100644
--- a/civicrm/CRM/Extension/Browser.php
+++ b/civicrm/CRM/Extension/Browser.php
@@ -44,6 +44,21 @@ class CRM_Extension_Browser {
    */
   protected $guzzleClient;
 
+  /**
+   * @var string
+   */
+  public $repoUrl;
+
+  /**
+   * @var string
+   */
+  public $indexPath;
+
+  /**
+   * @var array
+   */
+  protected $_remotesDiscovered;
+
   /**
    * @return \GuzzleHttp\Client
    */
diff --git a/civicrm/CRM/Extension/Info.php b/civicrm/CRM/Extension/Info.php
index 2c28779bfe..2546da5c5c 100644
--- a/civicrm/CRM/Extension/Info.php
+++ b/civicrm/CRM/Extension/Info.php
@@ -155,6 +155,21 @@ class CRM_Extension_Info {
    */
   public $version;
 
+  /**
+   * @var array
+   */
+  public $typeInfo;
+
+  /**
+   * @var string
+   */
+  public $url;
+
+  /**
+   * @var string
+   */
+  public $category;
+
   /**
    * Load extension info an XML file.
    *
diff --git a/civicrm/CRM/Extension/Mapper.php b/civicrm/CRM/Extension/Mapper.php
index 16a9e19def..87211fc062 100644
--- a/civicrm/CRM/Extension/Mapper.php
+++ b/civicrm/CRM/Extension/Mapper.php
@@ -355,8 +355,8 @@ class CRM_Extension_Mapper {
     // TODO optimization/caching
     $urls = [];
     $urls['civicrm'] = $this->keyToUrl('civicrm');
+    /** @var CRM_Core_Module $module */
     foreach ($this->getModules() as $module) {
-      /** @var $module CRM_Core_Module */
       if ($module->is_active) {
         try {
           $urls[$module->name] = $this->keyToUrl($module->name);
diff --git a/civicrm/CRM/Extension/MixinLoader.php b/civicrm/CRM/Extension/MixinLoader.php
index edb67a0814..272d962d96 100644
--- a/civicrm/CRM/Extension/MixinLoader.php
+++ b/civicrm/CRM/Extension/MixinLoader.php
@@ -64,8 +64,8 @@ class CRM_Extension_MixinLoader {
       }
     }
 
+    /** @var \CRM_Extension_MixInfo $ext */
     foreach ($mixInfos as $ext) {
-      /** @var \CRM_Extension_MixInfo $ext */
       foreach ($ext->mixins as $verExpr) {
         $doneId = $ext->longName . '::' . $verExpr;
         if (isset($this->done[$doneId])) {
diff --git a/civicrm/CRM/Financial/BAO/Order.php b/civicrm/CRM/Financial/BAO/Order.php
index 8e922722bf..6f4cbe9a8e 100644
--- a/civicrm/CRM/Financial/BAO/Order.php
+++ b/civicrm/CRM/Financial/BAO/Order.php
@@ -1125,7 +1125,7 @@ class CRM_Financial_BAO_Order {
   /**
    * Get the line items from a template.
    *
-   * @return \Civi\Api4\Generic\Result
+   * @return array
    *
    * @throws \CRM_Core_Exception
    */
diff --git a/civicrm/CRM/Import/DataSource.php b/civicrm/CRM/Import/DataSource.php
index ff671282d2..b6b1f00777 100644
--- a/civicrm/CRM/Import/DataSource.php
+++ b/civicrm/CRM/Import/DataSource.php
@@ -367,7 +367,7 @@ abstract class CRM_Import_DataSource {
   }
 
   /**
-   * Get the table name for the datajob.
+   * Get the table name for the import job.
    *
    * @return string|null
    *
@@ -416,8 +416,6 @@ abstract class CRM_Import_DataSource {
 
   /**
    * Initialize the datasource, based on the submitted values stored in the user job.
-   *
-   * @throws \CRM_Core_Exception
    */
   public function initialize(): void {
 
@@ -462,7 +460,7 @@ abstract class CRM_Import_DataSource {
    *   If the dataSource is being updated to another variant of the same
    *   class (eg. the csv upload was set to no column headers and they
    *   have resubmitted WITH skipColumnHeader (first row is a header) then
-   *   the dataSource is still CSV and the params for the new intance
+   *   the dataSource is still CSV and the params for the new instance
    *   are passed in. When changing from csv to SQL (for example) newParams is
    *   empty.
    *
diff --git a/civicrm/CRM/Import/DataSource/CSV.php b/civicrm/CRM/Import/DataSource/CSV.php
index 17a57912dd..bc87dcbba4 100644
--- a/civicrm/CRM/Import/DataSource/CSV.php
+++ b/civicrm/CRM/Import/DataSource/CSV.php
@@ -41,7 +41,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource {
    * It should add all fields necessary to get the data
    * uploaded to the temporary table in the DB.
    *
-   * @param CRM_Core_Form $form
+   * @param CRM_Contact_Import_Form_DataSource|\CRM_Import_Form_DataSourceConfig $form
    *
    * @throws \CRM_Core_Exception
    */
@@ -56,6 +56,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource {
     $uploadSize = round(($uploadFileSize / (1024 * 1024)), 2);
     $form->assign('uploadSize', $uploadSize);
     $form->add('File', 'uploadFile', ts('Import Data File'), NULL, TRUE);
+    $form->addElement('text', 'fieldSeparator', ts('Import Field Separator'), ['size' => 2]);
     $form->setMaxFileSize($uploadFileSize);
     $form->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', [
       1 => $uploadSize,
@@ -63,7 +64,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource {
     ]), 'maxfilesize', $uploadFileSize);
     $form->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
     $form->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
-
+    $form->setDataSourceDefaults($this->getDefaultValues());
     $form->addElement('checkbox', 'skipColumnHeader', ts('First row contains column headers'));
   }
 
@@ -260,4 +261,17 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource {
     return preg_replace("/^(\u{a0})+|(\u{a0})+$/", '', $string);
   }
 
+  /**
+   * Get default values for csv dataSource fields.
+   *
+   * @return array
+   */
+  public function getDefaultValues(): array {
+    return [
+      'fieldSeparator' => CRM_Core_Config::singleton()->fieldSeparator,
+      'skipColumnHeader' => 1,
+    ];
+
+  }
+
 }
diff --git a/civicrm/CRM/Import/Form/DataSource.php b/civicrm/CRM/Import/Form/DataSource.php
index 7e04646bdc..29008b234a 100644
--- a/civicrm/CRM/Import/Form/DataSource.php
+++ b/civicrm/CRM/Import/Form/DataSource.php
@@ -14,6 +14,8 @@
  * @copyright CiviCRM LLC https://civicrm.org/licensing
  */
 
+use Civi\Api4\Utils\CoreUtil;
+
 /**
  * Base class for upload-only import forms (all but Contact import).
  */
@@ -22,7 +24,7 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms {
   /**
    * Set variables up before form is built.
    */
-  public function preProcess() {
+  public function preProcess(): void {
     // check for post max size
     CRM_Utils_Number::formatUnitSize(ini_get('post_max_size'), TRUE);
     $this->assign('importEntity', $this->getTranslatedEntity());
@@ -37,7 +39,7 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms {
    * @return string
    */
   protected function getTranslatedEntity(): string {
-    return (string) Civi\Api4\Utils\CoreUtil::getInfoItem($this::IMPORT_ENTITY, 'title');
+    return (string) CoreUtil::getInfoItem($this->getBaseEntity(), 'title');
   }
 
   /**
@@ -48,45 +50,26 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms {
    * @return string
    */
   protected function getTranslatedEntities(): string {
-    return (string) Civi\Api4\Utils\CoreUtil::getInfoItem($this::IMPORT_ENTITY, 'title_plural');
+    return (string) CoreUtil::getInfoItem($this->getBaseEntity(), 'title_plural');
   }
 
   /**
    * Common form elements.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function buildQuickForm() {
     $this->assign('errorMessage', $this->getErrorMessage());
     $config = CRM_Core_Config::singleton();
-    // When we switch to using the DataSource.tpl used by Contact we can remove this in
-    // favour of the one used by Contact - I was trying to consolidate
-    // first & got stuck on https://github.com/civicrm/civicrm-core/pull/23458
-    $this->add('hidden', 'hidden_dataSource', 'CRM_Import_DataSource_CSV');
-    $uploadFileSize = CRM_Utils_Number::formatUnitSize($config->maxFileSize . 'm', TRUE);
-
-    //Fetch uploadFileSize from php_ini when $config->maxFileSize is set to "no limit".
-    if (empty($uploadFileSize)) {
-      $uploadFileSize = CRM_Utils_Number::formatUnitSize(ini_get('upload_max_filesize'), TRUE);
-    }
-    $uploadSize = round(($uploadFileSize / (1024 * 1024)), 2);
-
-    $this->assign('uploadSize', $uploadSize);
-
-    $this->add('File', 'uploadFile', ts('Import Data File'), NULL, TRUE);
-    $this->setMaxFileSize($uploadFileSize);
-    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', [
-      1 => $uploadSize,
-      2 => $uploadFileSize,
-    ]), 'maxfilesize', $uploadFileSize);
-    $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
-    $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
 
-    $this->addElement('checkbox', 'skipColumnHeader', ts('First row contains column headers'));
+    $this->assign('urlPath', 'civicrm/import/datasource');
+    $this->assign('urlPathVar', 'snippet=4&user_job_id=' . $this->get('user_job_id'));
 
-    $this->add('text', 'fieldSeparator', ts('Import Field Separator'), ['size' => 2], TRUE);
-    $this->setDefaults(['fieldSeparator' => $config->fieldSeparator]);
-    $mappingArray = CRM_Core_BAO_Mapping::getCreateMappingValues('Import ' . static::IMPORT_ENTITY);
+    $this->add('select', 'dataSource', ts('Data Source'), $this->getDataSources(), TRUE,
+      ['onchange' => 'buildDataSourceFormBlock(this.value);']
+    );
 
-    $this->assign('savedMapping', $mappingArray);
+    $mappingArray = CRM_Core_BAO_Mapping::getCreateMappingValues('Import ' . $this->getBaseEntity());
     $this->add('select', 'savedMapping', ts('Saved Field Mapping'), ['' => ts('- select -')] + $mappingArray);
 
     if ($loadedMapping = $this->get('loadedMapping')) {
@@ -96,6 +79,8 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms {
     //build date formats
     CRM_Core_Form_Date::buildAllowedDateFormats($this);
 
+    $this->buildDataSourceFields();
+
     $this->addButtons([
         [
           'type' => 'upload',
@@ -110,6 +95,14 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms {
     ]);
   }
 
+  public function setDefaultValues() {
+    return array_merge($this->dataSourceDefaults, [
+      'dataSource' => $this->getDefaultDataSource(),
+      'onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP,
+    ]);
+
+  }
+
   /**
    * Get an error message to assign to the template.
    *
@@ -197,4 +190,23 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms {
     $this->getDataSourceObject()->initialize();
   }
 
+  /**
+   * Default values for datasource fields.
+   *
+   * @var array
+   */
+  protected $dataSourceDefaults = [];
+
+  /**
+   * Set dataSource default values.
+   *
+   * @param array $dataSourceDefaults
+   *
+   * @return self
+   */
+  public function setDataSourceDefaults(array $dataSourceDefaults): self {
+    $this->dataSourceDefaults = $dataSourceDefaults;
+    return $this;
+  }
+
 }
diff --git a/civicrm/CRM/Import/Form/DataSourceConfig.php b/civicrm/CRM/Import/Form/DataSourceConfig.php
index 697de6c997..b8bd425ba4 100644
--- a/civicrm/CRM/Import/Form/DataSourceConfig.php
+++ b/civicrm/CRM/Import/Form/DataSourceConfig.php
@@ -20,6 +20,25 @@
  */
 class CRM_Import_Form_DataSourceConfig extends CRM_Import_Forms {
 
+  /**
+   * Default values for datasource fields.
+   *
+   * @var array
+   */
+  protected $dataSourceDefaults = [];
+
+  /**
+   * Set dataSource default values.
+   *
+   * @param array $dataSourceDefaults
+   *
+   * @return CRM_Import_Form_DataSourceConfig
+   */
+  public function setDataSourceDefaults(array $dataSourceDefaults): CRM_Import_Form_DataSourceConfig {
+    $this->dataSourceDefaults = $dataSourceDefaults;
+    return $this;
+  }
+
   /**
    * Set variables up before form is built.
    *
@@ -57,6 +76,9 @@ class CRM_Import_Form_DataSourceConfig extends CRM_Import_Forms {
         $defaults[$fieldName] = $this->getSubmittedValue($fieldName);
       }
     }
+    else {
+      $defaults = array_merge($this->dataSourceDefaults, $defaults);
+    }
     return $defaults;
   }
 
diff --git a/civicrm/CRM/Import/Forms.php b/civicrm/CRM/Import/Forms.php
index 0e59a70507..ff4da683aa 100644
--- a/civicrm/CRM/Import/Forms.php
+++ b/civicrm/CRM/Import/Forms.php
@@ -761,10 +761,15 @@ class CRM_Import_Forms extends CRM_Core_Form {
    * Get the base entity for the import.
    *
    * @return string
+   *
+   * @throws \CRM_Core_Exception
    */
   protected function getBaseEntity(): string {
-    $info = $this->getParser()->getUserJobInfo();
-    return reset($info)['entity'];
+    if ($this->getUserJobID()) {
+      $info = $this->getParser()->getUserJobInfo();
+      return reset($info)['entity'];
+    }
+    return CRM_Core_BAO_UserJob::getTypeValue($this->getUserJobType(), 'entity');
   }
 
   /**
diff --git a/civicrm/CRM/Mailing/BAO/Mailing.php b/civicrm/CRM/Mailing/BAO/Mailing.php
index 091141ece6..e772bac270 100644
--- a/civicrm/CRM/Mailing/BAO/Mailing.php
+++ b/civicrm/CRM/Mailing/BAO/Mailing.php
@@ -2153,8 +2153,6 @@ ORDER BY   civicrm_email.is_bulkmail DESC
   /**
    * Get the count of mailings.
    *
-   * @param
-   *
    * @return int
    *   Count
    */
diff --git a/civicrm/CRM/Mailing/Event/BAO/MailingEventQueue.php b/civicrm/CRM/Mailing/Event/BAO/MailingEventQueue.php
index 7f5a38a9c5..6b1d8b20d6 100644
--- a/civicrm/CRM/Mailing/Event/BAO/MailingEventQueue.php
+++ b/civicrm/CRM/Mailing/Event/BAO/MailingEventQueue.php
@@ -231,9 +231,7 @@ class CRM_Mailing_Event_BAO_MailingEventQueue extends CRM_Mailing_Event_DAO_Mail
   /**
    * Get the mailing object for this queue event instance.
    *
-   * @param
-   *
-   * @return object
+   * @return CRM_Mailing_BAO_Mailing
    *   Mailing BAO
    */
   public function &getMailing() {
diff --git a/civicrm/CRM/Mailing/Event/BAO/MailingEventReply.php b/civicrm/CRM/Mailing/Event/BAO/MailingEventReply.php
index abe1026cf5..15cf74d63f 100644
--- a/civicrm/CRM/Mailing/Event/BAO/MailingEventReply.php
+++ b/civicrm/CRM/Mailing/Event/BAO/MailingEventReply.php
@@ -34,7 +34,7 @@ class CRM_Mailing_Event_BAO_MailingEventReply extends CRM_Mailing_Event_DAO_Mail
    *
    * @param null $replyto
    *
-   * @return object|null
+   * @return CRM_Mailing_BAO_Mailing|null
    *   The mailing object, or null on failure
    */
   public static function &reply($job_id, $queue_id, $hash, $replyto = NULL) {
@@ -78,7 +78,7 @@ class CRM_Mailing_Event_BAO_MailingEventReply extends CRM_Mailing_Event_DAO_Mail
    *
    * @param int $queue_id
    *   Queue event ID of the sender.
-   * @param string $mailing
+   * @param CRM_Mailing_BAO_Mailing $mailing
    *   The mailing object.
    * @param string $bodyTxt
    *   Text part of the body (ignored if $fullEmail provided).
diff --git a/civicrm/CRM/Mailing/MailStore.php b/civicrm/CRM/Mailing/MailStore.php
index 8d6f0061cd..13626fcf1c 100644
--- a/civicrm/CRM/Mailing/MailStore.php
+++ b/civicrm/CRM/Mailing/MailStore.php
@@ -16,11 +16,19 @@
  */
 class CRM_Mailing_MailStore {
   /**
-   * flag to decide whether to print debug messages
+   * Flag to decide whether to print debug messages
+   *
    * @var bool
    */
   public $_debug = FALSE;
 
+  /**
+   * Holds the underlying mailbox transport implementation
+   *
+   * @var ezcMailImapTransport|ezcMailMboxTransport|ezcMailPop3Transport|null
+   */
+  protected $_transport;
+
   /**
    * Return the proper mail store implementation, based on config settings.
    *
diff --git a/civicrm/CRM/Mailing/MailStore/Imap.php b/civicrm/CRM/Mailing/MailStore/Imap.php
index c24943e2db..718dc8c067 100644
--- a/civicrm/CRM/Mailing/MailStore/Imap.php
+++ b/civicrm/CRM/Mailing/MailStore/Imap.php
@@ -20,6 +20,20 @@
  */
 class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore {
 
+  /**
+   * Path to a IMAP directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_ignored;
+
+  /**
+   * Path to a IMAP directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_processed;
+
   /**
    * Connect to the supplied IMAP server and make sure the two mailboxes exist.
    *
diff --git a/civicrm/CRM/Mailing/MailStore/Localdir.php b/civicrm/CRM/Mailing/MailStore/Localdir.php
index 3bacc73f16..5cdc3bd7c5 100644
--- a/civicrm/CRM/Mailing/MailStore/Localdir.php
+++ b/civicrm/CRM/Mailing/MailStore/Localdir.php
@@ -20,11 +20,32 @@
  */
 class CRM_Mailing_MailStore_Localdir extends CRM_Mailing_MailStore {
 
+  /**
+   * Directory to operate upon.
+   *
+   * @var string
+   */
+  private $_dir;
+
+  /**
+   * Path to a local directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_ignored;
+
+  /**
+   * Path to a local directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_processed;
+
   /**
    * Connect to the supplied dir and make sure the two mail dirs exist.
    *
    * @param string $dir
-   *   Dir to operate upon.
+   *   Directory to operate upon.
    *
    * @return \CRM_Mailing_MailStore_Localdir
    */
diff --git a/civicrm/CRM/Mailing/MailStore/Maildir.php b/civicrm/CRM/Mailing/MailStore/Maildir.php
index 32c0f54b28..8668ce12e6 100644
--- a/civicrm/CRM/Mailing/MailStore/Maildir.php
+++ b/civicrm/CRM/Mailing/MailStore/Maildir.php
@@ -20,11 +20,32 @@
  */
 class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore {
 
+  /**
+   * Directory to operate upon.
+   *
+   * @var string
+   */
+  private $_dir;
+
+  /**
+   * Path to a local directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_ignored;
+
+  /**
+   * Path to a local directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_processed;
+
   /**
    * Connect to the supplied dir and make sure the two mail dirs exist.
    *
    * @param string $dir
-   *   Dir to operate upon.
+   *   Directory to operate upon.
    *
    * @return \CRM_Mailing_MailStore_Maildir
    */
diff --git a/civicrm/CRM/Mailing/MailStore/Mbox.php b/civicrm/CRM/Mailing/MailStore/Mbox.php
index ea2fa6196d..d2f11f4348 100644
--- a/civicrm/CRM/Mailing/MailStore/Mbox.php
+++ b/civicrm/CRM/Mailing/MailStore/Mbox.php
@@ -20,6 +20,27 @@
  */
 class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore {
 
+  /**
+   * Path to a local directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_ignored;
+
+  /**
+   * Path to a local directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_processed;
+
+  /**
+   * Count of messages left to process
+   *
+   * @var int
+   */
+  private $_leftToProcess;
+
   /**
    * Connect to and lock the supplied file and make sure the two mail dirs exist.
    *
diff --git a/civicrm/CRM/Mailing/MailStore/Pop3.php b/civicrm/CRM/Mailing/MailStore/Pop3.php
index 9c38446cd5..716023417c 100644
--- a/civicrm/CRM/Mailing/MailStore/Pop3.php
+++ b/civicrm/CRM/Mailing/MailStore/Pop3.php
@@ -20,6 +20,20 @@
  */
 class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore {
 
+  /**
+   * Path to a local directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_ignored;
+
+  /**
+   * Path to a local directory to store ignored emails
+   *
+   * @var string
+   */
+  private $_processed;
+
   /**
    * Connect to the supplied POP3 server and make sure the two mail dirs exist
    *
diff --git a/civicrm/CRM/Member/Form/Task.php b/civicrm/CRM/Member/Form/Task.php
index 8374e85fdf..1f86f6d5ff 100644
--- a/civicrm/CRM/Member/Form/Task.php
+++ b/civicrm/CRM/Member/Form/Task.php
@@ -33,8 +33,6 @@ class CRM_Member_Form_Task extends CRM_Core_Form_Task {
   /**
    * Build all the data structures needed to build the form.
    *
-   * @param
-   *
    * @return void
    * @throws \CRM_Core_Exception
    */
diff --git a/civicrm/CRM/Member/Import/Form/DataSource.php b/civicrm/CRM/Member/Import/Form/DataSource.php
index 8eaabae047..d8a7da6d5a 100644
--- a/civicrm/CRM/Member/Import/Form/DataSource.php
+++ b/civicrm/CRM/Member/Import/Form/DataSource.php
@@ -45,9 +45,6 @@ class CRM_Member_Import_Form_DataSource extends CRM_Import_Form_DataSource {
       CRM_Import_Parser::DUPLICATE_SKIP => ts('Insert new Membership'),
       CRM_Import_Parser::DUPLICATE_UPDATE => ts('Update existing Membership'),
     ]);
-    $this->setDefaults([
-      'onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP,
-    ]);
 
     $this->addContactTypeSelector();
   }
diff --git a/civicrm/CRM/Price/BAO/PriceSet.php b/civicrm/CRM/Price/BAO/PriceSet.php
index a0aeb3bc09..bfa8565048 100644
--- a/civicrm/CRM/Price/BAO/PriceSet.php
+++ b/civicrm/CRM/Price/BAO/PriceSet.php
@@ -555,7 +555,7 @@ WHERE  id = %1";
    *   Price Set ID
    */
   public static function initSet(&$form, $entityTable = 'civicrm_event', $doNotIncludeExpiredFields = FALSE, $priceSetId = NULL) {
-
+    CRM_Core_Error::deprecatedFunctionWarning('no alternative');
     //check if price set is is_config
     if (is_numeric($priceSetId)) {
       if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config') && $form->getVar('_name') != 'Participant') {
diff --git a/civicrm/CRM/Profile/Form/Dynamic.php b/civicrm/CRM/Profile/Form/Dynamic.php
index 2d5c2b5c5f..1ed2119ce0 100644
--- a/civicrm/CRM/Profile/Form/Dynamic.php
+++ b/civicrm/CRM/Profile/Form/Dynamic.php
@@ -28,8 +28,6 @@ class CRM_Profile_Form_Dynamic extends CRM_Profile_Form {
   /**
    * Pre processing work done here.
    *
-   * @param
-   *
    */
   public function preProcess(): void {
     if ($this->get('register')) {
diff --git a/civicrm/CRM/Profile/Form/Edit.php b/civicrm/CRM/Profile/Form/Edit.php
index 367848abf2..4916638d5e 100644
--- a/civicrm/CRM/Profile/Form/Edit.php
+++ b/civicrm/CRM/Profile/Form/Edit.php
@@ -35,8 +35,6 @@ class CRM_Profile_Form_Edit extends CRM_Profile_Form {
   /**
    * Pre processing work done here.
    *
-   * @param
-   *
    */
   public function preProcess() {
     $this->_mode = CRM_Profile_Form::MODE_CREATE;
diff --git a/civicrm/CRM/UF/Form/Inline/PreviewById.php b/civicrm/CRM/UF/Form/Inline/PreviewById.php
index befda199d3..1a3f81f035 100644
--- a/civicrm/CRM/UF/Form/Inline/PreviewById.php
+++ b/civicrm/CRM/UF/Form/Inline/PreviewById.php
@@ -27,8 +27,6 @@ class CRM_UF_Form_Inline_PreviewById extends CRM_UF_Form_AbstractPreview {
    *
    * gets session variables for group or field id
    *
-   * @param
-   *
    * @return void
    * @throws \CRM_Core_Exception
    */
diff --git a/civicrm/CRM/UF/Form/Preview.php b/civicrm/CRM/UF/Form/Preview.php
index 822951c675..c1788f5be1 100644
--- a/civicrm/CRM/UF/Form/Preview.php
+++ b/civicrm/CRM/UF/Form/Preview.php
@@ -27,8 +27,6 @@ class CRM_UF_Form_Preview extends CRM_UF_Form_AbstractPreview {
    *
    * gets session variables for group or field id
    *
-   * @param
-   *
    * @return void
    */
   public function preProcess() {
diff --git a/civicrm/CRM/UF/Page/Group.php b/civicrm/CRM/UF/Page/Group.php
index e5bb967aae..7fa01478fc 100644
--- a/civicrm/CRM/UF/Page/Group.php
+++ b/civicrm/CRM/UF/Page/Group.php
@@ -35,8 +35,6 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
   /**
    * Get the action links for this page.
    *
-   * @param
-   *
    * @return array
    */
   public static function &actionLinks() {
@@ -286,11 +284,9 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
   /**
    * Browse all uf data groups.
    *
-   * @param
-   *
    * @return void
    */
-  public function browse($action = NULL) {
+  public function browse() {
     $ufGroup = [];
     $allUFGroups = CRM_Core_BAO_UFGroup::getModuleUFGroup();
     if (empty($allUFGroups)) {
diff --git a/civicrm/CRM/Upgrade/Incremental/Base.php b/civicrm/CRM/Upgrade/Incremental/Base.php
index fcc3f9104e..2dc039a4bd 100644
--- a/civicrm/CRM/Upgrade/Incremental/Base.php
+++ b/civicrm/CRM/Upgrade/Incremental/Base.php
@@ -585,4 +585,21 @@ class CRM_Upgrade_Incremental_Base {
     return TRUE;
   }
 
+  public static function alterColumn($ctx, $table, $column, $properties, $localizable = FALSE): bool {
+    $locales = CRM_Core_I18n::getMultilingual();
+    $queries = [];
+    if ($localizable && $locales) {
+      foreach ($locales as $locale) {
+        $queries[] = "ALTER TABLE `$table` CHANGE `{$column}_{$locale}` `{$column}_{$locale}` $properties";
+      }
+    }
+    else {
+      $queries[] = "ALTER TABLE `$table` CHANGE `$column` `$column` $properties";
+    }
+    foreach ($queries as $query) {
+      CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE);
+    }
+    return TRUE;
+  }
+
 }
diff --git a/civicrm/CRM/Upgrade/Incremental/General.php b/civicrm/CRM/Upgrade/Incremental/General.php
index 2c9ae583a8..9f7bf56080 100644
--- a/civicrm/CRM/Upgrade/Incremental/General.php
+++ b/civicrm/CRM/Upgrade/Incremental/General.php
@@ -40,7 +40,7 @@ class CRM_Upgrade_Incremental_General {
    *
    * @see install/index.php
    */
-  const MIN_INSTALL_PHP_VER = '7.2.0';
+  const MIN_INSTALL_PHP_VER = '7.3.0';
 
   /**
    * The minimum recommended MySQL version.
diff --git a/civicrm/CRM/Upgrade/Incremental/php/FiveFiftyEight.php b/civicrm/CRM/Upgrade/Incremental/php/FiveFiftyEight.php
new file mode 100644
index 0000000000..eb0dd44110
--- /dev/null
+++ b/civicrm/CRM/Upgrade/Incremental/php/FiveFiftyEight.php
@@ -0,0 +1,95 @@
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved.                        |
+ |                                                                    |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * Upgrade logic for the 5.58.x series.
+ *
+ * Each minor version in the series is handled by either a `5.58.x.mysql.tpl` file,
+ * or a function in this class named `upgrade_5_58_x`.
+ * If only a .tpl file exists for a version, it will be run automatically.
+ * If the function exists, it must explicitly add the 'runSql' task if there is a corresponding .mysql.tpl.
+ *
+ * This class may also implement `setPreUpgradeMessage()` and `setPostUpgradeMessage()` functions.
+ */
+class CRM_Upgrade_Incremental_php_FiveFiftyEight extends CRM_Upgrade_Incremental_Base {
+
+  /**
+   * Upgrade step; adds tasks including 'runSql'.
+   *
+   * @param string $rev
+   *   The version number matching this function name
+   */
+  public function upgrade_5_58_alpha1($rev): void {
+    $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
+    $this->addTask('Add option group descriptions', 'addOptionGroupDescriptions');
+  }
+
+  public static function addOptionGroupDescriptions($ctx): bool {
+    CRM_Upgrade_Incremental_Base::alterColumn($ctx, 'civicrm_option_group', 'description', "TEXT COMMENT 'Option group description.'", TRUE);
+    $schema = new CRM_Logging_Schema();
+    $schema->fixSchemaDifferences();
+    $values = [
+      [
+        'group' => 'gender',
+        'description' => ts('CiviCRM is pre-configured with standard options for individual gender (Male, Female, Other). Modify these options as needed for your installation.'),
+      ],
+      [
+        'group' => 'individual_prefix',
+        'description' => ts('CiviCRM is pre-configured with standard options for individual contact prefixes (Ms., Mr., Dr. etc.). Customize these options and add new ones as needed for your installation.'),
+      ],
+      [
+        'group' => 'mobile_provider',
+        'description' => ts('When recording mobile phone numbers for contacts, it may be useful to include the Mobile Phone Service Provider (e.g. Cingular, Sprint, etc.). CiviCRM is installed with the most commonly encountered service providers. Administrators may define as many additional providers as needed.'),
+      ],
+      [
+        'group' => 'instant_messenger_service',
+        'description' => ts('Commonly-used messaging apps are listed here. Administrators may define as many additional providers as needed.'),
+      ],
+      [
+        'group' => 'individual_suffix',
+        'description' => ts('CiviCRM is pre-configured with standard options for individual contact name suffixes (Jr., Sr., II etc.). Customize these options and add new ones as needed for your installation.'),
+      ],
+      [
+        'group' => 'activity_type',
+        'description' => ts('Activities track interactions with contacts. Some activity types are reserved for use by automated processes, others can be freely configured.'),
+      ],
+      [
+        'group' => 'payment_instrument',
+        'description' => ts('You may choose to record the payment method used for each contribution and fee. Reserved payment methods are required - you may modify their labels but they can not be deleted (e.g. Check, Credit Card, Debit Card). If your site requires additional payment methods, you can add them here. You can associate each payment method with a Financial Account which specifies where the payment is going (e.g. a bank account for checks and cash).'),
+      ],
+      [
+        'group' => 'accept_creditcard',
+        'description' => ts('The following credit card options will be offered to contributors using Online Contribution pages. You will need to verify which cards are accepted by your chosen Payment Processor and update these entries accordingly.')
+        . ts('IMPORTANT: These options do not control credit card/payment method choices for sites and/or contributors using the PayPal Express service (e.g. where billing information is collected on the Payment Processor\'s website).'),
+      ],
+      [
+        'group' => 'event_type',
+        'description' => ts('Use Event Types to categorize your events. Event feeds can be filtered by Event Type and participant searches can use Event Type as a criteria.'),
+      ],
+      [
+        'group' => 'participant_role',
+        'description' => ts('Define participant roles for events here (e.g. Attendee, Host, Speaker...). You can then assign roles and search for participants by role.'),
+      ],
+      [
+        'group' => 'from_email_address',
+        'description' => ts('By default, CiviCRM uses the primary email address of the logged in user as the FROM address when sending emails to contacts. However, you can use this page to define one or more general Email Addresses that can be selected as an alternative. EXAMPLE: "Client Services" <clientservices@example.org>.'),
+      ],
+    ];
+    foreach ($values as $value) {
+      \Civi\Api4\OptionGroup::update(FALSE)
+        ->addWhere('name', '=', $value['group'])
+        ->addValue('description', $value['description'])
+        ->execute();
+    }
+    return TRUE;
+  }
+
+}
diff --git a/civicrm/CRM/Upgrade/Incremental/php/FiveFiftySeven.php b/civicrm/CRM/Upgrade/Incremental/php/FiveFiftySeven.php
index eb0464079d..122cb6bbdd 100644
--- a/civicrm/CRM/Upgrade/Incremental/php/FiveFiftySeven.php
+++ b/civicrm/CRM/Upgrade/Incremental/php/FiveFiftySeven.php
@@ -72,7 +72,7 @@ class CRM_Upgrade_Incremental_php_FiveFiftySeven extends CRM_Upgrade_Incremental
    * @param string $rev
    *   The version number matching this function name
    */
-  public function upgrade_5_57_0($rev): void {
+  public function upgrade_5_57_beta1($rev): void {
     $this->addTask('Fix broken quicksearch options', 'fixQuicksearchOptions');
   }
 
diff --git a/civicrm/CRM/Upgrade/Incremental/sql/5.58.alpha1.mysql.tpl b/civicrm/CRM/Upgrade/Incremental/sql/5.58.alpha1.mysql.tpl
new file mode 100644
index 0000000000..99ec2d1264
--- /dev/null
+++ b/civicrm/CRM/Upgrade/Incremental/sql/5.58.alpha1.mysql.tpl
@@ -0,0 +1 @@
+{* file to handle db changes in 5.58.alpha1 during upgrade *}
diff --git a/civicrm/CRM/Utils/Check/Component/Timestamps.php b/civicrm/CRM/Utils/Check/Component/Timestamps.php
index 432a011e5f..0514ee4ca8 100644
--- a/civicrm/CRM/Utils/Check/Component/Timestamps.php
+++ b/civicrm/CRM/Utils/Check/Component/Timestamps.php
@@ -18,6 +18,54 @@ class CRM_Utils_Check_Component_Timestamps extends CRM_Utils_Check_Component {
 
   const DOCTOR_WHEN = 'https://github.com/civicrm/org.civicrm.doctorwhen';
 
+  /**
+   * Check that MySQL actually supports timezone operations.
+   *
+   * @return CRM_Utils_Check_Message[]
+   */
+  public function checkTimezoneAPIs() {
+    $messages = [];
+
+    try {
+      $convertedTimeNY = CRM_Core_DAO::singleValueQuery('SELECT CONVERT_TZ("2001-02-03 04:05:00", "GMT", "America/New_York")');
+    }
+    catch (\Exception $e) {
+      $convertedTimeNY = NULL;
+    }
+    $expectedTimeNY = '2001-02-02 23:05:00';
+
+    $oldTz = CRM_Core_DAO::singleValueQuery('SELECT @@time_zone');
+    try {
+      CRM_Core_DAO::singleValueQuery('SET @@time_zone = "Europe/Berlin"');
+      $convertedTimeDE = CRM_Core_DAO::singleValueQuery('SELECT FROM_UNIXTIME(981176700)');
+    }
+    catch (\Exception $e) {
+      $convertedTimeDE = NULL;
+    }
+    finally {
+      CRM_Core_DAO::singleValueQuery('SET @@time_zone = %1', [1 => [$oldTz, 'String']]);
+    }
+    $expectedTimeDE = '2001-02-03 06:05:00';
+
+    if ($convertedTimeNY !== $expectedTimeNY || $convertedTimeDE !== $expectedTimeDE) {
+      $messages[] = new CRM_Utils_Check_Message(
+        __FUNCTION__,
+        ts('The MySQL database does not fully support timezones. Please ask the database administrator to <a %1>load timezone data</a>.', [
+          // If we had a manual page, it would make sense to link to that. Such a page might
+          // (a) point out that the process is similar for MySQL 5.x/8.x and MariaDB,
+          // and (b) talk more about potential impacts (re: current code; extensions; future changes).
+          // We don't have that page. But this link gives the general gist.
+          1 => 'target="_blank" href="https://dev.mysql.com/doc/refman/8.0/en/mysql-tzinfo-to-sql.html"',
+        ]),
+        ts('MySQL Timezone Problem'),
+        \Psr\Log\LogLevel::WARNING,
+        'fa-clock-o'
+      );
+    }
+
+    return $messages;
+  }
+
   /**
    * Check that various columns are TIMESTAMP and not DATETIME. (CRM-9683, etal)
    *
diff --git a/civicrm/CRM/Utils/Date.php b/civicrm/CRM/Utils/Date.php
index 78539479b0..f97951a1ba 100644
--- a/civicrm/CRM/Utils/Date.php
+++ b/civicrm/CRM/Utils/Date.php
@@ -232,21 +232,16 @@ class CRM_Utils_Date {
   public static function &getAbbrMonthNames($month = FALSE) {
     $key = 'abbrMonthNames_' . \CRM_Core_I18n::getLocale();
     if (empty(\Civi::$statics[__CLASS__][$key])) {
-      $intl_formatter = IntlDateFormatter::create(CRM_Core_I18n::getLocale(), IntlDateFormatter::MEDIUM, IntlDateFormatter::MEDIUM, NULL, IntlDateFormatter::GREGORIAN, 'MMM');
-      \Civi::$statics[__CLASS__][$key] = [
-        1 => $intl_formatter->format(strtotime('1 January')),
-        2 => $intl_formatter->format(strtotime('1 February')),
-        3 => $intl_formatter->format(strtotime('1 March')),
-        4 => $intl_formatter->format(strtotime('1 April')),
-        5 => $intl_formatter->format(strtotime('1 May')),
-        6 => $intl_formatter->format(strtotime('1 June')),
-        7 => $intl_formatter->format(strtotime('1 July')),
-        8 => $intl_formatter->format(strtotime('1 August')),
-        9 => $intl_formatter->format(strtotime('1 September')),
-        10 => $intl_formatter->format(strtotime('1 October')),
-        11 => $intl_formatter->format(strtotime('1 November')),
-        12 => $intl_formatter->format(strtotime('1 December')),
-      ];
+      // Note: IntlDateFormatter provides even more strings than `strftime()` or `l10n/*/civicrm.mo`.
+      // Note: Consistently use UTC for all requests in resolving these names. Avoid edge-cases where TZ support is inconsistent.
+      $intlFormatter = IntlDateFormatter::create(CRM_Core_I18n::getLocale(), IntlDateFormatter::MEDIUM, IntlDateFormatter::MEDIUM, 'UTC', IntlDateFormatter::GREGORIAN, 'MMM');
+      $monthNums = range(1, 12);
+      \Civi::$statics[__CLASS__][$key] = array_combine($monthNums, array_map(
+        function(int $monthNum) use ($intlFormatter) {
+          return $intlFormatter->format(gmmktime(0, 0, 0, $monthNum, 1));
+        },
+        $monthNums
+      ));
     }
     if ($month) {
       return \Civi::$statics[__CLASS__][$key][$month];
@@ -264,23 +259,16 @@ class CRM_Utils_Date {
   public static function &getFullMonthNames() {
     $key = 'fullMonthNames_' . \CRM_Core_I18n::getLocale();
     if (empty(\Civi::$statics[__CLASS__][$key])) {
-      // Not relying on strftime because it depends on the operating system
-      // and most people will not have a non-US locale configured out of the box
-      // Ignoring other date names for now, since less visible by default
-      \Civi::$statics[__CLASS__][$key] = [
-        1 => ts('January'),
-        2 => ts('February'),
-        3 => ts('March'),
-        4 => ts('April'),
-        5 => ts('May'),
-        6 => ts('June'),
-        7 => ts('July'),
-        8 => ts('August'),
-        9 => ts('September'),
-        10 => ts('October'),
-        11 => ts('November'),
-        12 => ts('December'),
-      ];
+      // Note: IntlDateFormatter provides even more strings than `strftime()` or `l10n/*/civicrm.mo`.
+      // Note: Consistently use UTC for all requests in resolving these names. Avoid edge-cases where TZ support is inconsistent.
+      $intlFormatter = IntlDateFormatter::create(CRM_Core_I18n::getLocale(), IntlDateFormatter::MEDIUM, IntlDateFormatter::MEDIUM, 'UTC', IntlDateFormatter::GREGORIAN, 'MMMM');
+      $monthNums = range(1, 12);
+      \Civi::$statics[__CLASS__][$key] = array_combine($monthNums, array_map(
+        function(int $monthNum) use ($intlFormatter) {
+          return $intlFormatter->format(gmmktime(0, 0, 0, $monthNum, 1));
+        },
+        $monthNums
+      ));
     }
 
     return \Civi::$statics[__CLASS__][$key];
@@ -2243,7 +2231,7 @@ class CRM_Utils_Date {
   /**
    * Print out a date object in specified format in local timezone
    *
-   * @param DateTimeObject $dateObject
+   * @param DateTimeInterface $dateObject
    * @param string $format
    * @return string
    */
diff --git a/civicrm/CRM/Utils/File.php b/civicrm/CRM/Utils/File.php
index 4dbc7e47e3..bc882aa8f4 100644
--- a/civicrm/CRM/Utils/File.php
+++ b/civicrm/CRM/Utils/File.php
@@ -48,36 +48,6 @@ class CRM_Utils_File {
     return $ascii;
   }
 
-  /**
-   * Given a file name, determine if the file contents make it an html file
-   *
-   * @param string $name
-   *   Name of file.
-   *
-   * @return bool
-   *   true if file is html
-   */
-  public static function isHtml($name) {
-    $fd = fopen($name, "r");
-    if (!$fd) {
-      return FALSE;
-    }
-
-    $html = FALSE;
-    $lineCount = 0;
-    while (!feof($fd) & $lineCount <= 5) {
-      $lineCount++;
-      $line = fgets($fd, 8192);
-      if (!CRM_Utils_String::isHtml($line)) {
-        $html = TRUE;
-        break;
-      }
-    }
-
-    fclose($fd);
-    return $html;
-  }
-
   /**
    * Create a directory given a path name, creates parent directories
    * if needed
diff --git a/civicrm/CRM/Utils/Request.php b/civicrm/CRM/Utils/Request.php
index 0ab38f4898..b5f22a3f0f 100644
--- a/civicrm/CRM/Utils/Request.php
+++ b/civicrm/CRM/Utils/Request.php
@@ -130,7 +130,7 @@ class CRM_Utils_Request {
       return $method[$name];
     }
     // CRM-18384 - decode incorrect keys generated when &amp; is present in url
-    foreach ($method as $key => $value) {
+    foreach (($method ?? []) as $key => $value) {
       if (strpos($key, 'amp;') !== FALSE) {
         $method[str_replace('amp;', '', $key)] = $method[$key];
         if (isset($method[$name])) {
diff --git a/civicrm/CRM/Utils/Signer.php b/civicrm/CRM/Utils/Signer.php
index 2b6491f9d0..a8127ee1b9 100644
--- a/civicrm/CRM/Utils/Signer.php
+++ b/civicrm/CRM/Utils/Signer.php
@@ -39,6 +39,26 @@ class CRM_Utils_Signer {
    */
   const SALT_LEN = 4;
 
+  /**
+   * @var string
+   */
+  private $secret;
+
+  /**
+   * @var array
+   */
+  private $paramNames;
+
+  /**
+   * @var string
+   */
+  public $signDelim;
+
+  /**
+   * @var string
+   */
+  private $defaultSalt;
+
   /**
    * Instantiate a signature-processor
    *
diff --git a/civicrm/CRM/Utils/Sort.php b/civicrm/CRM/Utils/Sort.php
index 691aef877f..617e4c33e1 100644
--- a/civicrm/CRM/Utils/Sort.php
+++ b/civicrm/CRM/Utils/Sort.php
@@ -99,7 +99,7 @@ class CRM_Utils_Sort {
    *
    * @return \CRM_Utils_Sort
    */
-  public function __construct(&$vars, $defaultSortOrder = NULL) {
+  public function __construct($vars, $defaultSortOrder = NULL) {
     $this->_vars = [];
     $this->_response = [];
 
diff --git a/civicrm/CRM/Utils/String.php b/civicrm/CRM/Utils/String.php
index c167374625..e654e862a7 100644
--- a/civicrm/CRM/Utils/String.php
+++ b/civicrm/CRM/Utils/String.php
@@ -670,8 +670,8 @@ class CRM_Utils_String {
   /**
    * Generate a random string.
    *
-   * @param $len
-   * @param $alphabet
+   * @param int $len
+   * @param string $alphabet
    * @return string
    */
   public static function createRandom($len, $alphabet) {
diff --git a/civicrm/CRM/Utils/System.php b/civicrm/CRM/Utils/System.php
index 9ce478fe6f..10c0672734 100644
--- a/civicrm/CRM/Utils/System.php
+++ b/civicrm/CRM/Utils/System.php
@@ -38,7 +38,7 @@
  * @method static array synchronizeUsers() Create CRM contacts for all existing CMS users.
  * @method static void appendCoreResources(\Civi\Core\Event\GenericHookEvent $e) Callback for hook_civicrm_coreResourceList.
  * @method static void alterAssetUrl(\Civi\Core\Event\GenericHookEvent $e) Callback for hook_civicrm_getAssetUrl.
- * @method static exitAfterFatal() Should the current execution exit after a fatal error?
+ * @method static bool shouldExitAfterFatal() Should the current execution exit after a fatal error?
  */
 class CRM_Utils_System {
 
diff --git a/civicrm/Civi/API/Request.php b/civicrm/Civi/API/Request.php
index 62cd7605cd..8b7a087f2e 100644
--- a/civicrm/Civi/API/Request.php
+++ b/civicrm/Civi/API/Request.php
@@ -55,6 +55,7 @@ class Request {
         if ($daoName && !$daoName::isComponentEnabled()) {
           throw new \Civi\API\Exception\NotImplementedException("$entity API is not available because " . $daoName::COMPONENT . " component is disabled");
         }
+        // Extra arguments used e.g. by dynamic entities like Multi-Record custom groups & the ECK extension
         $args = (array) CoreUtil::getInfoItem($entity, 'class_args');
         $apiRequest = call_user_func_array($callable, $args);
         foreach ($params as $name => $param) {
diff --git a/civicrm/Civi/Api4/DedupeRule.php b/civicrm/Civi/Api4/DedupeRule.php
index 1080d704fc..530687bbff 100644
--- a/civicrm/Civi/Api4/DedupeRule.php
+++ b/civicrm/Civi/Api4/DedupeRule.php
@@ -21,5 +21,6 @@ namespace Civi\Api4;
  * @package Civi\Api4
  */
 class DedupeRule extends Generic\DAOEntity {
+  use Generic\Traits\ManagedEntity;
 
 }
diff --git a/civicrm/Civi/Api4/DedupeRuleGroup.php b/civicrm/Civi/Api4/DedupeRuleGroup.php
index e596b75323..9663ccc174 100644
--- a/civicrm/Civi/Api4/DedupeRuleGroup.php
+++ b/civicrm/Civi/Api4/DedupeRuleGroup.php
@@ -21,5 +21,6 @@ namespace Civi\Api4;
  * @package Civi\Api4
  */
 class DedupeRuleGroup extends Generic\DAOEntity {
+  use Generic\Traits\ManagedEntity;
 
 }
diff --git a/civicrm/Civi/Api4/Generic/Traits/SavedSearchInspectorTrait.php b/civicrm/Civi/Api4/Generic/Traits/SavedSearchInspectorTrait.php
index f40b384690..1e2b87ce66 100644
--- a/civicrm/Civi/Api4/Generic/Traits/SavedSearchInspectorTrait.php
+++ b/civicrm/Civi/Api4/Generic/Traits/SavedSearchInspectorTrait.php
@@ -56,7 +56,12 @@ trait SavedSearchInspectorTrait {
         ->execute()->single();
     }
     if (is_array($this->savedSearch)) {
-      $this->savedSearch += ['api_params' => []];
+      // Ensure array keys are always defined even for unsaved "preview" mode
+      $this->savedSearch += [
+        'id' => NULL,
+        'name' => NULL,
+        'api_params' => [],
+      ];
       $this->savedSearch['api_params'] += ['version' => 4, 'select' => [], 'where' => []];
     }
     $this->_apiParams = ($this->savedSearch['api_params'] ?? []) + ['select' => [], 'where' => []];
@@ -83,6 +88,13 @@ trait SavedSearchInspectorTrait {
         ->setType($this->_displayType ?? 'table')
         ->execute()->first();
     }
+    if (is_array($this->display)) {
+      // Ensure array keys are always defined even for unsaved "preview" mode
+      $this->display += [
+        'id' => NULL,
+        'name' => NULL,
+      ];
+    }
   }
 
   /**
diff --git a/civicrm/Civi/Api4/Query/SqlEquation.php b/civicrm/Civi/Api4/Query/SqlEquation.php
index 71e85d7ec4..da5e9d2f1c 100644
--- a/civicrm/Civi/Api4/Query/SqlEquation.php
+++ b/civicrm/Civi/Api4/Query/SqlEquation.php
@@ -76,7 +76,7 @@ class SqlEquation extends SqlExpression {
   /**
    * Render the expression for insertion into the sql query
    *
-   * @param Civi\Api4\Query\Api4SelectQuery $query
+   * @param \Civi\Api4\Query\Api4SelectQuery $query
    * @return string
    */
   public function render(Api4SelectQuery $query): string {
diff --git a/civicrm/Civi/Api4/Query/SqlExpression.php b/civicrm/Civi/Api4/Query/SqlExpression.php
index 4e4b4cf4bd..6f3e9ee10f 100644
--- a/civicrm/Civi/Api4/Query/SqlExpression.php
+++ b/civicrm/Civi/Api4/Query/SqlExpression.php
@@ -140,7 +140,7 @@ abstract class SqlExpression {
   /**
    * Renders expression to a sql string, replacing field names with column names.
    *
-   * @param Civi\Api4\Query\Api4SelectQuery $query
+   * @param \Civi\Api4\Query\Api4SelectQuery $query
    * @return string
    */
   abstract public function render(Api4SelectQuery $query): string;
diff --git a/civicrm/Civi/Api4/Query/SqlFunction.php b/civicrm/Civi/Api4/Query/SqlFunction.php
index 9f25b7a238..6b094eff3d 100644
--- a/civicrm/Civi/Api4/Query/SqlFunction.php
+++ b/civicrm/Civi/Api4/Query/SqlFunction.php
@@ -106,7 +106,7 @@ abstract class SqlFunction extends SqlExpression {
   /**
    * Render the expression for insertion into the sql query
    *
-   * @param Civi\Api4\Query\Api4SelectQuery $query
+   * @param \Civi\Api4\Query\Api4SelectQuery $query
    * @return string
    */
   public function render(Api4SelectQuery $query): string {
@@ -122,7 +122,7 @@ abstract class SqlFunction extends SqlExpression {
 
   /**
    * @param array $arg
-   * @param Civi\Api4\Query\Api4SelectQuery $query
+   * @param \Civi\Api4\Query\Api4SelectQuery $query
    * @return string
    */
   private function renderArg($arg, Api4SelectQuery $query): string {
diff --git a/civicrm/Civi/Api4/Service/Autocomplete/ContributionAutocompleteProvider.php b/civicrm/Civi/Api4/Service/Autocomplete/ContributionAutocompleteProvider.php
new file mode 100644
index 0000000000..0e05a824d4
--- /dev/null
+++ b/civicrm/Civi/Api4/Service/Autocomplete/ContributionAutocompleteProvider.php
@@ -0,0 +1,84 @@
+<?php
+
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved.                        |
+ |                                                                    |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
+ +--------------------------------------------------------------------+
+ */
+
+namespace Civi\Api4\Service\Autocomplete;
+
+use Civi\Core\Event\GenericHookEvent;
+use Civi\Core\HookInterface;
+
+/**
+ * @service
+ * @internal
+ */
+class ContributionAutocompleteProvider extends \Civi\Core\Service\AutoService implements HookInterface {
+
+  /**
+   * Provide default SavedSearch for Contribution autocompletes
+   *
+   * @param \Civi\Core\Event\GenericHookEvent $e
+   */
+  public static function on_civi_search_autocompleteDefault(GenericHookEvent $e) {
+    if (!is_array($e->savedSearch) || $e->savedSearch['api_entity'] !== 'Contribution') {
+      return;
+    }
+    $e->savedSearch['api_params'] = [
+      'version' => 4,
+      'select' => [
+        'id',
+        'contact_id.display_name',
+        'total_amount',
+        'receive_date',
+        'financial_type_id:label',
+      ],
+      'orderBy' => [],
+      'where' => [],
+      'groupBy' => [],
+      'join' => [],
+      'having' => [],
+    ];
+  }
+
+  /**
+   * Provide default SearchDisplay for Contribution autocompletes
+   *
+   * @param \Civi\Core\Event\GenericHookEvent $e
+   */
+  public static function on_civi_search_defaultDisplay(GenericHookEvent $e) {
+    if ($e->display['settings'] || $e->display['type'] !== 'autocomplete' || $e->savedSearch['api_entity'] !== 'Contribution') {
+      return;
+    }
+    $e->display['settings'] = [
+      'sort' => [
+        ['contact_id.sort_name', 'ASC'],
+        ['total_amount', 'ASC'],
+        ['receive_date', 'DESC'],
+      ],
+      'columns' => [
+        [
+          'type' => 'field',
+          'key' => 'contact_id.display_name',
+          'rewrite' => '[contact_id.display_name] - [total_amount]',
+        ],
+        [
+          'type' => 'field',
+          'key' => 'financial_type_id:label',
+          'rewrite' => '#[id] [financial_type_id:label]',
+        ],
+        [
+          'type' => 'field',
+          'key' => 'receive_date',
+        ],
+      ],
+    ];
+  }
+
+}
diff --git a/civicrm/Civi/CCase/Events.php b/civicrm/Civi/CCase/Events.php
index 114875f17e..7d0bea3295 100644
--- a/civicrm/Civi/CCase/Events.php
+++ b/civicrm/Civi/CCase/Events.php
@@ -96,8 +96,8 @@ class Events {
   public static function delegateToXmlListeners(\Civi\CCase\Event\CaseChangeEvent $event) {
     $p = new \CRM_Case_XMLProcessor_Process();
     $listeners = $p->getListeners($event->analyzer->getCaseType());
+    /** @var \Civi\CCase\CaseChangeListener $listener */
     foreach ($listeners as $listener) {
-      /** @var $listener \Civi\CCase\CaseChangeListener */
       $listener->onCaseChange($event);
     }
   }
diff --git a/civicrm/Civi/Core/CiviEventDispatcher.php b/civicrm/Civi/Core/CiviEventDispatcher.php
index 054bd76675..704fcd7ce8 100644
--- a/civicrm/Civi/Core/CiviEventDispatcher.php
+++ b/civicrm/Civi/Core/CiviEventDispatcher.php
@@ -21,7 +21,7 @@ class CiviEventDispatcher implements CiviEventDispatcherInterface {
   const DEFAULT_HOOK_PRIORITY = -100;
 
   /**
-   * @var Symfony\Component\EventDispatcher\EventDispatcher
+   * @var \Symfony\Component\EventDispatcher\EventDispatcher
    */
   private $dispatcher;
 
diff --git a/civicrm/Civi/Payment/System.php b/civicrm/Civi/Payment/System.php
index 1dfa4eaf4f..f32dee6ad9 100644
--- a/civicrm/Civi/Payment/System.php
+++ b/civicrm/Civi/Payment/System.php
@@ -156,7 +156,7 @@ class System {
    *
    * @param string $className
    *
-   * @return \Civi\Payment\CRM_Core_Payment|NULL
+   * @return \CRM_Core_Payment|NULL
    * @throws \CRM_Core_Exception
    */
   public function getByClass($className) {
diff --git a/civicrm/Civi/Test/CiviEnvBuilder/SqlFileStep.php b/civicrm/Civi/Test/CiviEnvBuilder/SqlFileStep.php
index ffb9ca1b0d..aa6d26e855 100644
--- a/civicrm/Civi/Test/CiviEnvBuilder/SqlFileStep.php
+++ b/civicrm/Civi/Test/CiviEnvBuilder/SqlFileStep.php
@@ -24,8 +24,11 @@ class SqlFileStep implements StepInterface {
     return is_file($this->file) && is_readable($this->file);
   }
 
+  /**
+   * @param \CiviEnvBuilder $ctx
+   * @throws \RuntimeException
+   */
   public function run($ctx) {
-    /** @var $ctx \CiviEnvBuilder */
     if (\Civi\Test::execute(@file_get_contents($this->file)) === FALSE) {
       throw new \RuntimeException("Cannot load {$this->file}. Aborting.");
     }
diff --git a/civicrm/Civi/Test/CiviEnvBuilder/SqlStep.php b/civicrm/Civi/Test/CiviEnvBuilder/SqlStep.php
index e892883e03..3055bc65a6 100644
--- a/civicrm/Civi/Test/CiviEnvBuilder/SqlStep.php
+++ b/civicrm/Civi/Test/CiviEnvBuilder/SqlStep.php
@@ -20,8 +20,11 @@ class SqlStep implements StepInterface {
     return TRUE;
   }
 
+  /**
+   * @param \CiviEnvBuilder $ctx
+   * @throws \RuntimeException
+   */
   public function run($ctx) {
-    /** @var $ctx \CiviEnvBuilder */
     if (\Civi\Test::execute($this->sql) === FALSE) {
       throw new \RuntimeException("Cannot execute: {$this->sql}");
     }
diff --git a/civicrm/Civi/Test/CiviTestListenerPHPUnit7.php b/civicrm/Civi/Test/CiviTestListenerPHPUnit7.php
index 97c122081a..8b4b9af92e 100644
--- a/civicrm/Civi/Test/CiviTestListenerPHPUnit7.php
+++ b/civicrm/Civi/Test/CiviTestListenerPHPUnit7.php
@@ -25,6 +25,8 @@ class CiviTestListenerPHPUnit7 implements \PHPUnit\Framework\TestListener {
    */
   private $cache = [];
 
+  public $errorScope;
+
   /**
    * @var \CRM_Core_Transaction|null
    */
diff --git a/civicrm/Civi/WorkflowMessage/FieldSpec.php b/civicrm/Civi/WorkflowMessage/FieldSpec.php
index 7672ed8802..2e3850f80d 100644
--- a/civicrm/Civi/WorkflowMessage/FieldSpec.php
+++ b/civicrm/Civi/WorkflowMessage/FieldSpec.php
@@ -43,6 +43,8 @@ class FieldSpec {
    */
   public $scope;
 
+  public $comment;
+
   /**
    * @return bool
    */
diff --git a/civicrm/api/class.api.php b/civicrm/api/class.api.php
index 21a4190b70..4def2f76d4 100644
--- a/civicrm/api/class.api.php
+++ b/civicrm/api/class.api.php
@@ -89,6 +89,89 @@
  */
 class civicrm_api3 {
 
+  /**
+   * Are we performing a local or remote API call?
+   *
+   * @var bool
+   */
+  public $local = TRUE;
+
+  /**
+   * Array of inputs to pass to `call`, if param not passed directly
+   *
+   * @var array
+   * @internal
+   */
+  public $input = [];
+
+  /**
+   * Holds the result of the last API request.
+   * If the request has not yet run, lastResult will be empty.
+   *
+   * @var \stdClass
+   * @internal
+   */
+  public $lastResult;
+
+  /**
+   * When making a remote API request,
+   * $uri will be the path to the remote server's API endpoint
+   *
+   * @var string|null
+   * @internal
+   */
+  public $uri = NULL;
+
+  /**
+   * When making a remote API request,
+   * $key will be sent as part of the request
+   *
+   * @var string|null
+   * @internal
+   */
+  public $key = NULL;
+
+  /**
+   * When making a remote API request,
+   * $api_key will be sent as part of the request
+   *
+   * @var string|null
+   * @internal
+   */
+  public $api_key = NULL;
+
+  /**
+   * When making a remote API request,
+   * $referer holds the Referer header value to be sent as part of the request
+   *
+   * @var string|null
+   * @internal
+   */
+  public $referer = NULL;
+
+  /**
+   * When making a remote API request,
+   * $useragent holds the User-Agent header value to be sent as part of the request
+   *
+   * @var string|null
+   * @internal
+   */
+  public $useragent = NULL;
+
+  /**
+   * Reference to the CRM_Core_Config singleton
+   *
+   * @var CRM_Core_Config
+   */
+  protected $cfg;
+
+  /**
+   * The current entity, which actions should be performed against
+   *
+   * @var string|null
+   */
+  protected $currentEntity = NULL;
+
   /**
    * Class constructor.
    *
@@ -97,7 +180,7 @@ class civicrm_api3 {
   public function __construct($config = NULL) {
     $this->local      = TRUE;
     $this->input      = [];
-    $this->lastResult = [];
+    $this->lastResult = new stdClass();
     if (!empty($config) && !empty($config['server'])) {
       // we are calling a remote server via REST
       $this->local = FALSE;
diff --git a/civicrm/api/v3/utils.php b/civicrm/api/v3/utils.php
index b4b5611269..2a03f8e4a7 100644
--- a/civicrm/api/v3/utils.php
+++ b/civicrm/api/v3/utils.php
@@ -1100,7 +1100,7 @@ function _civicrm_api3_custom_format_params($params, &$values, $extends, $entity
   foreach ($params as $key => $value) {
     [$customFieldID, $customValueID] = CRM_Core_BAO_CustomField::getKeyID($key, TRUE);
     if ($customFieldID && (!is_null($value))) {
-      if ($checkCheckBoxField && !empty($fields['custom_' . $customFieldID]) && $fields['custom_' . $customFieldID]['html_type'] == 'CheckBox') {
+      if ($checkCheckBoxField && isset($fields['custom_' . $customFieldID]) && $fields['custom_' . $customFieldID]['html_type'] == 'CheckBox') {
         formatCheckBoxField($value, 'custom_' . $customFieldID, $entity);
       }
 
@@ -1170,6 +1170,10 @@ function formatCheckBoxField(&$checkboxFieldValue, $customFieldLabel, $entity) {
     return;
   }
 
+  if (is_array($checkboxFieldValue) && empty($checkboxFieldValue)) {
+    $checkboxFieldValue = '';
+    return;
+  }
   $options = $options['values'];
   $validValue = TRUE;
   if (is_array($checkboxFieldValue)) {
diff --git a/civicrm/civicrm-version.php b/civicrm/civicrm-version.php
index 51f6baf896..9f43a6eb58 100644
--- a/civicrm/civicrm-version.php
+++ b/civicrm/civicrm-version.php
@@ -1,7 +1,7 @@
 <?php
 /** @deprecated */
 function civicrmVersion( ) {
-  return array( 'version'  => '5.57.3',
+  return array( 'version'  => '5.58.0',
                 'cms'      => 'Wordpress',
                 'revision' => '' );
 }
diff --git a/civicrm/composer.json b/civicrm/composer.json
index b0949dd2bf..c227b14e87 100644
--- a/civicrm/composer.json
+++ b/civicrm/composer.json
@@ -41,7 +41,7 @@
   "include-path": ["vendor/tecnickcom"],
   "config": {
     "platform": {
-      "php": "7.2.5"
+      "php": "7.3.0"
     },
     "allow-plugins": {
       "civicrm/composer-compile-plugin": true,
@@ -50,10 +50,10 @@
     }
   },
   "require": {
-    "php": "~7.2.5 || ~7.3 || ~8",
+    "php": "~7.3 || ~8",
     "composer-runtime-api": "~2.0",
     "cache/integration-tests": "~0.17.0",
-    "dompdf/dompdf" : "~2.0.1",
+    "dompdf/dompdf" : "~2.0.2",
     "firebase/php-jwt": ">=3 <6",
     "rubobaquero/phpquery": "^0.9.15",
     "symfony/config": "~4.4",
diff --git a/civicrm/composer.lock b/civicrm/composer.lock
index 8421ce8494..a7dada33e2 100644
--- a/civicrm/composer.lock
+++ b/civicrm/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "ea291fe135ab61b48ff4ca909c2d85de",
+    "content-hash": "7a2de17bbccf6b8df7e6fdb1f6d2480e",
     "packages": [
         {
             "name": "adrienrn/php-mimetyper",
@@ -335,23 +335,23 @@
         },
         {
             "name": "civicrm/composer-compile-lib",
-            "version": "v0.6",
+            "version": "v0.7",
             "source": {
                 "type": "git",
                 "url": "https://github.com/civicrm/composer-compile-lib.git",
-                "reference": "8bd52f0d2ba97eaa83853c3cfc37841376f5b903"
+                "reference": "658230901ee3fc2830e9f93239a635a086b6816d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/civicrm/composer-compile-lib/zipball/8bd52f0d2ba97eaa83853c3cfc37841376f5b903",
-                "reference": "8bd52f0d2ba97eaa83853c3cfc37841376f5b903",
+                "url": "https://api.github.com/repos/civicrm/composer-compile-lib/zipball/658230901ee3fc2830e9f93239a635a086b6816d",
+                "reference": "658230901ee3fc2830e9f93239a635a086b6816d",
                 "shasum": ""
             },
             "require": {
                 "civicrm/composer-compile-plugin": "~0.19 || ~1.0",
                 "padaliyajay/php-autoprefixer": "~1.2",
                 "scssphp/scssphp": "^1.8.1",
-                "symfony/filesystem": "~2.8 || ~3.4 || ~4.0 || ~5.0",
+                "symfony/filesystem": "~2.8 || ~3.4 || ~4.0 || ~5.0 || ~6.0",
                 "tubalmartin/cssmin": "^4.1"
             },
             "type": "library",
@@ -396,9 +396,9 @@
             "description": "Small library of compilation helpers",
             "support": {
                 "issues": "https://github.com/civicrm/composer-compile-lib/issues",
-                "source": "https://github.com/civicrm/composer-compile-lib/tree/v0.6"
+                "source": "https://github.com/civicrm/composer-compile-lib/tree/v0.7"
             },
-            "time": "2022-07-22T09:41:59+00:00"
+            "time": "2022-12-19T21:16:16+00:00"
         },
         {
             "name": "civicrm/composer-compile-plugin",
@@ -505,16 +505,16 @@
         },
         {
             "name": "cweagans/composer-patches",
-            "version": "1.7.2",
+            "version": "1.7.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/cweagans/composer-patches.git",
-                "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871"
+                "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e9969cfc0796e6dea9b4e52f77f18e1065212871",
-                "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871",
+                "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db",
+                "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db",
                 "shasum": ""
             },
             "require": {
@@ -547,9 +547,9 @@
             "description": "Provides a way to patch Composer packages.",
             "support": {
                 "issues": "https://github.com/cweagans/composer-patches/issues",
-                "source": "https://github.com/cweagans/composer-patches/tree/1.7.2"
+                "source": "https://github.com/cweagans/composer-patches/tree/1.7.3"
             },
-            "time": "2022-01-25T19:21:20+00:00"
+            "time": "2022-12-20T22:53:13+00:00"
         },
         {
             "name": "dflydev/apache-mime-types",
@@ -612,16 +612,16 @@
         },
         {
             "name": "dompdf/dompdf",
-            "version": "v2.0.1",
+            "version": "v2.0.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/dompdf/dompdf.git",
-                "reference": "c5310df0e22c758c85ea5288175fc6cd777bc085"
+                "reference": "ad4c631bf8897fc1ca7b566468a969cfd71a558a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/c5310df0e22c758c85ea5288175fc6cd777bc085",
-                "reference": "c5310df0e22c758c85ea5288175fc6cd777bc085",
+                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/ad4c631bf8897fc1ca7b566468a969cfd71a558a",
+                "reference": "ad4c631bf8897fc1ca7b566468a969cfd71a558a",
                 "shasum": ""
             },
             "require": {
@@ -668,9 +668,9 @@
             "homepage": "https://github.com/dompdf/dompdf",
             "support": {
                 "issues": "https://github.com/dompdf/dompdf/issues",
-                "source": "https://github.com/dompdf/dompdf/tree/v2.0.1"
+                "source": "https://github.com/dompdf/dompdf/tree/v2.0.2"
             },
-            "time": "2022-09-22T13:43:41+00:00"
+            "time": "2023-01-31T13:30:40+00:00"
         },
         {
             "name": "ezyang/htmlpurifier",
@@ -1756,16 +1756,16 @@
         },
         {
             "name": "masterminds/html5",
-            "version": "2.7.5",
+            "version": "2.7.6",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Masterminds/html5-php.git",
-                "reference": "f640ac1bdddff06ea333a920c95bbad8872429ab"
+                "reference": "897eb517a343a2281f11bc5556d6548db7d93947"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f640ac1bdddff06ea333a920c95bbad8872429ab",
-                "reference": "f640ac1bdddff06ea333a920c95bbad8872429ab",
+                "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/897eb517a343a2281f11bc5556d6548db7d93947",
+                "reference": "897eb517a343a2281f11bc5556d6548db7d93947",
                 "shasum": ""
             },
             "require": {
@@ -1819,9 +1819,9 @@
             ],
             "support": {
                 "issues": "https://github.com/Masterminds/html5-php/issues",
-                "source": "https://github.com/Masterminds/html5-php/tree/2.7.5"
+                "source": "https://github.com/Masterminds/html5-php/tree/2.7.6"
             },
-            "time": "2021-07-01T14:25:37+00:00"
+            "time": "2022-08-18T16:18:26+00:00"
         },
         {
             "name": "myclabs/php-enum",
@@ -2639,21 +2639,21 @@
         },
         {
             "name": "phenx/php-svg-lib",
-            "version": "0.4.1",
+            "version": "0.5.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/dompdf/php-svg-lib.git",
-                "reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02"
+                "reference": "76876c6cf3080bcb6f249d7d59705108166a6685"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/4498b5df7b08e8469f0f8279651ea5de9626ed02",
-                "reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02",
+                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/76876c6cf3080bcb6f249d7d59705108166a6685",
+                "reference": "76876c6cf3080bcb6f249d7d59705108166a6685",
                 "shasum": ""
             },
             "require": {
                 "ext-mbstring": "*",
-                "php": "^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0",
+                "php": "^7.1 || ^8.0",
                 "sabberworm/php-css-parser": "^8.4"
             },
             "require-dev": {
@@ -2679,9 +2679,9 @@
             "homepage": "https://github.com/PhenX/php-svg-lib",
             "support": {
                 "issues": "https://github.com/dompdf/php-svg-lib/issues",
-                "source": "https://github.com/dompdf/php-svg-lib/tree/0.4.1"
+                "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.0"
             },
-            "time": "2022-03-07T12:52:04+00:00"
+            "time": "2022-09-06T12:16:56+00:00"
         },
         {
             "name": "phpoffice/phpspreadsheet",
@@ -5737,7 +5737,7 @@
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": "~7.2.5 || ~7.3 || ~8",
+        "php": "~7.3 || ~8",
         "composer-runtime-api": "~2.0",
         "ext-intl": "*",
         "ext-json": "*",
@@ -5745,7 +5745,7 @@
     },
     "platform-dev": [],
     "platform-overrides": {
-        "php": "7.2.5"
+        "php": "7.3.0"
     },
     "plugin-api-version": "2.3.0"
 }
diff --git a/civicrm/ext/afform/admin/afformEntities/Membership.php b/civicrm/ext/afform/admin/afformEntities/Membership.php
new file mode 100644
index 0000000000..a7719defff
--- /dev/null
+++ b/civicrm/ext/afform/admin/afformEntities/Membership.php
@@ -0,0 +1,8 @@
+<?php
+return [
+  'type' => 'primary',
+  'defaults' => "{
+    actions: {create: true, update: true}
+  }",
+  'boilerplate' => [],
+];
diff --git a/civicrm/ext/afform/admin/info.xml b/civicrm/ext/afform/admin/info.xml
index 52cfafc1ab..b1fc0efe10 100644
--- a/civicrm/ext/afform/admin/info.xml
+++ b/civicrm/ext/afform/admin/info.xml
@@ -13,10 +13,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-09</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>beta</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>FormBuilder provides a UI to administer and edit forms. It is an optional admin tool and not required for the forms to function.</comments>
   <requires>
diff --git a/civicrm/ext/afform/core/info.xml b/civicrm/ext/afform/core/info.xml
index 9f5ff9bb84..e8247b5e43 100644
--- a/civicrm/ext/afform/core/info.xml
+++ b/civicrm/ext/afform/core/info.xml
@@ -13,10 +13,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-09</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>beta</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>The Form Core extension is required to use any dynamic form. To administer and edit forms, also install the FormBuilder extension.</comments>
   <civix>
diff --git a/civicrm/ext/afform/html/info.xml b/civicrm/ext/afform/html/info.xml
index d92fa2b04b..38c79d2e1b 100644
--- a/civicrm/ext/afform/html/info.xml
+++ b/civicrm/ext/afform/html/info.xml
@@ -13,10 +13,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-09</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>alpha</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <requires>
     <ext>org.civicrm.afform</ext>
diff --git a/civicrm/ext/afform/mock/info.xml b/civicrm/ext/afform/mock/info.xml
index daa5ae07d3..15cc1c62cc 100644
--- a/civicrm/ext/afform/mock/info.xml
+++ b/civicrm/ext/afform/mock/info.xml
@@ -12,13 +12,13 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-09</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
   <develStage>alpha</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <requires>
     <ext>org.civicrm.afform</ext>
diff --git a/civicrm/ext/authx/info.xml b/civicrm/ext/authx/info.xml
index 8d11fa48e1..b33d350433 100644
--- a/civicrm/ext/authx/info.xml
+++ b/civicrm/ext/authx/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-02-11</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>AuthX enables remote applications to connect to CiviCRM. Use it to enable and disable different forms of authentication (such as username-password, API key, and/or JWT).</comments>
   <classloader>
diff --git a/civicrm/ext/civicrm_admin_ui/info.xml b/civicrm/ext/civicrm_admin_ui/info.xml
index 1ab9385f4c..824a80e055 100644
--- a/civicrm/ext/civicrm_admin_ui/info.xml
+++ b/civicrm/ext/civicrm_admin_ui/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2022-01-02</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>alpha</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <requires>
     <ext>org.civicrm.search_kit</ext>
diff --git a/civicrm/ext/civigrant/CRM/Grant/Form/Task.php b/civicrm/ext/civigrant/CRM/Grant/Form/Task.php
index dceba5ac5f..5e5cddb7c4 100644
--- a/civicrm/ext/civigrant/CRM/Grant/Form/Task.php
+++ b/civicrm/ext/civigrant/CRM/Grant/Form/Task.php
@@ -25,8 +25,6 @@ class CRM_Grant_Form_Task extends CRM_Core_Form_Task {
   /**
    * Build all the data structures needed to build the form.
    *
-   * @param
-   *
    * @return void
    */
   public function preProcess() {
diff --git a/civicrm/ext/civigrant/info.xml b/civicrm/ext/civigrant/info.xml
index 13b598f09e..02faef117e 100644
--- a/civicrm/ext/civigrant/info.xml
+++ b/civicrm/ext/civigrant/info.xml
@@ -13,10 +13,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-11-11</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>CiviGrant was originally a core component before migrating to an extension</comments>
   <requires>
diff --git a/civicrm/ext/civiimport/info.xml b/civicrm/ext/civiimport/info.xml
index 4e5d61b864..a14b4566de 100644
--- a/civicrm/ext/civiimport/info.xml
+++ b/civicrm/ext/civiimport/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2022-08-11</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>alpha</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>Core extension for us to start moving import logic into, has more functionality</comments>
   <requires>
diff --git a/civicrm/ext/ckeditor4/info.xml b/civicrm/ext/ckeditor4/info.xml
index 44439f56a8..f8b075b332 100644
--- a/civicrm/ext/ckeditor4/info.xml
+++ b/civicrm/ext/ckeditor4/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">https://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-05-23</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>This is the version of CKEditor that originally shipped with CiviCRM core</comments>
   <classloader>
diff --git a/civicrm/ext/contributioncancelactions/info.xml b/civicrm/ext/contributioncancelactions/info.xml
index 19997af8a4..a93b4514a5 100644
--- a/civicrm/ext/contributioncancelactions/info.xml
+++ b/civicrm/ext/contributioncancelactions/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-10-12</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>This code has been moved from core to a separate extension in 5.32. Note that if you disable it failed or cancelled contributions will not cause related memberships and participant records to be updated</comments>
   <classloader>
diff --git a/civicrm/ext/elavon/info.xml b/civicrm/ext/elavon/info.xml
index 6dab1b1474..d97c229a39 100644
--- a/civicrm/ext/elavon/info.xml
+++ b/civicrm/ext/elavon/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2022-08-05</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments/>
   <classloader>
diff --git a/civicrm/ext/eventcart/info.xml b/civicrm/ext/eventcart/info.xml
index 2ac6f5bc61..b675a63654 100644
--- a/civicrm/ext/eventcart/info.xml
+++ b/civicrm/ext/eventcart/info.xml
@@ -13,13 +13,13 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-08-03</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <classloader>
     <psr0 prefix="CRM_" path="."/>
diff --git a/civicrm/ext/ewaysingle/info.xml b/civicrm/ext/ewaysingle/info.xml
index ed7b44e771..6c5d857922 100644
--- a/civicrm/ext/ewaysingle/info.xml
+++ b/civicrm/ext/ewaysingle/info.xml
@@ -15,13 +15,13 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-10-07</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>This is an extension to contain the eWAY Single Currency Payment Processor</comments>
   <classloader>
diff --git a/civicrm/ext/financialacls/info.xml b/civicrm/ext/financialacls/info.xml
index bee5608d6a..65029056bb 100644
--- a/civicrm/ext/financialacls/info.xml
+++ b/civicrm/ext/financialacls/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-08-27</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <tags>
     <tag>mgmt:hidden</tag>
diff --git a/civicrm/ext/flexmailer/info.xml b/civicrm/ext/flexmailer/info.xml
index 49dc9872cd..6a0f469e4e 100644
--- a/civicrm/ext/flexmailer/info.xml
+++ b/civicrm/ext/flexmailer/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-08-05</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <comments>
     FlexMailer is an email delivery engine which replaces the internal guts
@@ -23,7 +23,7 @@
     to provide richer email features.
   </comments>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <tags>
     <tag>mgmt:required</tag>
diff --git a/civicrm/ext/greenwich/info.xml b/civicrm/ext/greenwich/info.xml
index 8ab3bf9bbd..e063c2102d 100644
--- a/civicrm/ext/greenwich/info.xml
+++ b/civicrm/ext/greenwich/info.xml
@@ -15,13 +15,13 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-07-21</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <classloader>
     <psr0 prefix="CRM_" path="."/>
diff --git a/civicrm/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php b/civicrm/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php
index 9619ff36c4..f3a9fd78da 100644
--- a/civicrm/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php
+++ b/civicrm/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php
@@ -231,8 +231,8 @@ class CRM_Contact_Form_Search_Custom_FullText extends CRM_Contact_Form_Search_Cu
   }
 
   public function fillTable() {
+    /** @var CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery $partialQuery */
     foreach ($this->_partialQueries as $partialQuery) {
-      /** @var $partialQuery CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery */
       if (!$this->_table || $this->_table == $partialQuery->getName()) {
         if ($partialQuery->isActive()) {
           $result = $partialQuery->fillTempTable($this->_text, $this->_entityIDTableName, $this->_tableName, $this->_limitClause, $this->_limitDetailClause);
@@ -301,8 +301,8 @@ WHERE      t.table_name = 'Activity' AND
 
     // also add a select box to allow the search to be constrained
     $tables = ['' => ts('All tables')];
+    /** @var CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery $partialQuery */
     foreach ($this->_partialQueries as $partialQuery) {
-      /** @var $partialQuery CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery */
       if ($partialQuery->isActive()) {
         $tables[$partialQuery->getName()] = $partialQuery->getLabel();
       }
@@ -360,8 +360,8 @@ WHERE      t.table_name = 'Activity' AND
     $this->initialize();
 
     $summary = [];
+    /** @var CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery $partialQuery */
     foreach ($this->_partialQueries as $partialQuery) {
-      /** @var $partialQuery CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery */
       $summary[$partialQuery->getName()] = [];
     }
 
diff --git a/civicrm/CRM/Contact/Selector/Custom.php b/civicrm/ext/legacycustomsearches/CRM/Contact/Selector/Custom.php
similarity index 100%
rename from civicrm/CRM/Contact/Selector/Custom.php
rename to civicrm/ext/legacycustomsearches/CRM/Contact/Selector/Custom.php
diff --git a/civicrm/ext/legacycustomsearches/info.xml b/civicrm/ext/legacycustomsearches/info.xml
index 1357ce6c5a..fd2c926acf 100644
--- a/civicrm/ext/legacycustomsearches/info.xml
+++ b/civicrm/ext/legacycustomsearches/info.xml
@@ -15,13 +15,13 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-07-25</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>This is hidden on install to give extensions that require it time to add it to their requires and to allow us to get it out of GroupContact load</comments>
   <classloader>
diff --git a/civicrm/ext/message_admin/info.xml b/civicrm/ext/message_admin/info.xml
index 92a3bbd5f8..59bf012b17 100644
--- a/civicrm/ext/message_admin/info.xml
+++ b/civicrm/ext/message_admin/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-06-12</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>alpha</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <requires>
     <ext>org.civicrm.afform</ext>
diff --git a/civicrm/ext/oauth-client/info.xml b/civicrm/ext/oauth-client/info.xml
index 8aaf3011d2..aa0093af19 100644
--- a/civicrm/ext/oauth-client/info.xml
+++ b/civicrm/ext/oauth-client/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-10-23</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <requires>
     <ext version="~4.5">org.civicrm.afform</ext>
diff --git a/civicrm/ext/oauth-client/tests/phpunit/Civi/OAuth/AuthCodeFlowTest.php b/civicrm/ext/oauth-client/tests/phpunit/Civi/OAuth/AuthCodeFlowTest.php
index 8f30036b6c..bf0d37e50f 100644
--- a/civicrm/ext/oauth-client/tests/phpunit/Civi/OAuth/AuthCodeFlowTest.php
+++ b/civicrm/ext/oauth-client/tests/phpunit/Civi/OAuth/AuthCodeFlowTest.php
@@ -19,6 +19,8 @@ class AuthCodeFlowTest extends \PHPUnit\Framework\TestCase implements
 
   private $providers = [];
 
+  protected $ids = [];
+
   public function setUpHeadless() {
     // Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile().
     // See: https://docs.civicrm.org/dev/en/latest/testing/phpunit/#civitest
diff --git a/civicrm/ext/oauth-client/tests/phpunit/api/v4/OAuthContactTokenTest.php b/civicrm/ext/oauth-client/tests/phpunit/api/v4/OAuthContactTokenTest.php
index 360df66235..389edd8220 100644
--- a/civicrm/ext/oauth-client/tests/phpunit/api/v4/OAuthContactTokenTest.php
+++ b/civicrm/ext/oauth-client/tests/phpunit/api/v4/OAuthContactTokenTest.php
@@ -31,6 +31,8 @@ class api_v4_OAuthContactTokenTest extends \PHPUnit\Framework\TestCase implement
 
   private $hookEvents;
 
+  protected $ids = [];
+
   public function setUpHeadless(): \Civi\Test\CiviEnvBuilder {
     // Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile().
     // See: https://docs.civicrm.org/dev/en/latest/testing/phpunit/#civitest
diff --git a/civicrm/ext/payflowpro/info.xml b/civicrm/ext/payflowpro/info.xml
index 4518ef2287..a2ce72e813 100644
--- a/civicrm/ext/payflowpro/info.xml
+++ b/civicrm/ext/payflowpro/info.xml
@@ -15,10 +15,10 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-04-13</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>This extension is extraction of the original Core Payflow Pro Payment Processor</comments>
   <classloader>
diff --git a/civicrm/ext/recaptcha/info.xml b/civicrm/ext/recaptcha/info.xml
index 888b9910ad..4595946a29 100644
--- a/civicrm/ext/recaptcha/info.xml
+++ b/civicrm/ext/recaptcha/info.xml
@@ -13,13 +13,13 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-04-03</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <classloader>
     <psr0 prefix="CRM_" path="."/>
diff --git a/civicrm/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetSearchTasks.php b/civicrm/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetSearchTasks.php
index c0f03105bc..b2ca9c97c0 100644
--- a/civicrm/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetSearchTasks.php
+++ b/civicrm/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetSearchTasks.php
@@ -2,6 +2,7 @@
 
 namespace Civi\Api4\Action\SearchDisplay;
 
+use Civi\Api4\Generic\Traits\SavedSearchInspectorTrait;
 use CRM_Search_ExtensionUtil as E;
 use Civi\Api4\Entity;
 
@@ -12,6 +13,14 @@ use Civi\Api4\Entity;
  */
 class GetSearchTasks extends \Civi\Api4\Generic\AbstractAction {
 
+  use SavedSearchInspectorTrait;
+
+  /**
+   * An array containing the searchDisplay definition
+   * @var string|array
+   */
+  protected $display;
+
   /**
    * Name of entity
    * @var string
@@ -36,6 +45,10 @@ class GetSearchTasks extends \Civi\Api4\Generic\AbstractAction {
     if (!$entity) {
       return;
     }
+
+    $this->loadSavedSearch();
+    $this->loadSearchDisplay();
+
     $tasks = [$entity['name'] => []];
 
     if (array_key_exists($entity['name'], \CRM_Export_BAO_Export::getComponents())) {
@@ -138,10 +151,14 @@ class GetSearchTasks extends \Civi\Api4\Generic\AbstractAction {
             $task['title'] = E::ts('Profile Update');
           }
           $key = \CRM_Core_Key::get(\CRM_Utils_Array::first((array) $task['class']), TRUE);
+
+          // Print Labels action does not support popups, open full-screen
+          $actionType = $id == \CRM_Core_Task::LABEL_CONTACTS ? 'redirect' : 'crmPopup';
+
           $tasks[$entity['name']]['contact.' . $id] = [
             'title' => $task['title'],
             'icon' => $task['icon'] ?? 'fa-gear',
-            'crmPopup' => [
+            $actionType => [
               'path' => "'{$task['url']}'",
               'query' => "{reset: 1}",
               'data' => "{cids: ids.join(','), qfKey: '$key'}",
@@ -199,9 +216,9 @@ class GetSearchTasks extends \Civi\Api4\Generic\AbstractAction {
     $null = NULL;
     $checkPermissions = $this->checkPermissions;
     $userId = $this->checkPermissions ? \CRM_Core_Session::getLoggedInContactID() : NULL;
-    \CRM_Utils_Hook::singleton()->invoke(['tasks', 'checkPermissions', 'userId'],
+    \CRM_Utils_Hook::singleton()->invoke(['tasks', 'checkPermissions', 'userId', 'search', 'display'],
       $tasks, $checkPermissions, $userId,
-      $null, $null, $null, 'civicrm_searchKitTasks'
+      $this->savedSearch, $this->display, $null, 'civicrm_searchKitTasks'
     );
 
     foreach ($tasks[$entity['name']] as $name => &$task) {
diff --git a/civicrm/ext/search_kit/Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php b/civicrm/ext/search_kit/Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php
index c40f3ec251..f6711dd724 100644
--- a/civicrm/ext/search_kit/Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php
+++ b/civicrm/ext/search_kit/Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php
@@ -11,6 +11,7 @@
 
 namespace Civi\Api4\Event\Subscriber;
 
+use Civi\API\Request;
 use Civi\Api4\Utils\CoreUtil;
 use Civi\Core\Event\GenericHookEvent;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -66,7 +67,8 @@ class DefaultDisplaySubscriber extends \Civi\Core\Service\AutoService implements
     // Default sort order
     $e->display['settings']['sort'] = self::getDefaultSort($entityName);
 
-    $fields = CoreUtil::getApiClass($entityName)::get()->entityFields();
+    $apiGet = Request::create($entityName, 'get', ['version' => 4]);
+    $fields = $apiGet->entityFields();
     $columns = [$labelField];
     // Add grouping fields like "event_type_id" in the description
     $grouping = (array) (CoreUtil::getCustomGroupExtends($entityName)['grouping'] ?? []);
diff --git a/civicrm/ext/search_kit/Civi/Api4/Service/Spec/Provider/SearchSegmentExtraFieldProvider.php b/civicrm/ext/search_kit/Civi/Api4/Service/Spec/Provider/SearchSegmentExtraFieldProvider.php
index 37df93f86d..5662d023cd 100644
--- a/civicrm/ext/search_kit/Civi/Api4/Service/Spec/Provider/SearchSegmentExtraFieldProvider.php
+++ b/civicrm/ext/search_kit/Civi/Api4/Service/Spec/Provider/SearchSegmentExtraFieldProvider.php
@@ -71,7 +71,7 @@ class SearchSegmentExtraFieldProvider implements Generic\SpecProviderInterface {
    * Generates the sql case statement with a clause for each item.
    *
    * @param array $field
-   * @param Civi\Api4\Query\Api4SelectQuery $query
+   * @param \Civi\Api4\Query\Api4SelectQuery $query
    * @return string
    */
   public static function renderSql(array $field, Api4SelectQuery $query): string {
diff --git a/civicrm/ext/search_kit/ang/crmSearchTasks/crmSearchTasks.component.js b/civicrm/ext/search_kit/ang/crmSearchTasks/crmSearchTasks.component.js
index 83d189c5d6..b0f96effe0 100644
--- a/civicrm/ext/search_kit/ang/crmSearchTasks/crmSearchTasks.component.js
+++ b/civicrm/ext/search_kit/ang/crmSearchTasks/crmSearchTasks.component.js
@@ -11,7 +11,7 @@
       ids: '<'
     },
     templateUrl: '~/crmSearchTasks/crmSearchTasks.html',
-    controller: function($scope, crmApi4, dialogService) {
+    controller: function($scope, crmApi4, dialogService, $window) {
       var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'),
         ctrl = this,
         initialized = false,
@@ -31,7 +31,7 @@
         initialized = true;
         crmApi4({
           entityInfo: ['Entity', 'get', {select: ['name', 'title', 'title_plural', 'primary_key'], where: [['name', '=', ctrl.entity]]}, 0],
-          tasks: ['SearchDisplay', 'getSearchTasks', {entity: ctrl.entity}]
+          tasks: ['SearchDisplay', 'getSearchTasks', {entity: ctrl.entity, savedSearch: ctrl.search, display: ctrl.display}]
         }).then(function(result) {
           ctrl.entityInfo = result.entityInfo;
           ctrl.tasks = result.tasks;
@@ -72,6 +72,11 @@
           CRM.loadForm(CRM.url(path, query), {post: action.crmPopup.data && $scope.$eval(action.crmPopup.data, data)})
             .on('crmFormSuccess', ctrl.refresh);
         }
+        else if (action.redirect) {
+          var redirectPath = $scope.$eval(action.redirect.path, data),
+            redirectQuery = action.redirect.query && $scope.$eval(action.redirect.query, data) && $scope.$eval(action.redirect.data, data);
+          $window.open(CRM.url(redirectPath, redirectQuery), '_blank');
+        }
         // If action uses dialogService
         else {
           var options = CRM.utils.adjustDialogDefaults({
diff --git a/civicrm/ext/search_kit/info.xml b/civicrm/ext/search_kit/info.xml
index 62d7814392..45d85fb36c 100644
--- a/civicrm/ext/search_kit/info.xml
+++ b/civicrm/ext/search_kit/info.xml
@@ -15,13 +15,13 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-01-06</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <develStage>stable</develStage>
   <tags>
     <tag>mgmt:required</tag>
   </tags>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <comments>Click on the chat link above to discuss development, report problems or ask questions.</comments>
   <classloader>
diff --git a/civicrm/ext/search_kit/search_kit.php b/civicrm/ext/search_kit/search_kit.php
index 68c46e97b0..a17a0e35e9 100644
--- a/civicrm/ext/search_kit/search_kit.php
+++ b/civicrm/ext/search_kit/search_kit.php
@@ -70,7 +70,7 @@ function search_kit_civicrm_angularModules(&$angularModules) {
   $tasks = [];
   $null = NULL;
   $checkPermissions = FALSE;
-  \CRM_Utils_Hook::singleton()->invoke(['tasks', 'checkPermissions', 'userId'],
+  \CRM_Utils_Hook::singleton()->invoke(['tasks', 'checkPermissions', 'userId', 'search', 'display'],
     $tasks, $checkPermissions, $null,
     $null, $null, $null, 'civicrm_searchKitTasks'
   );
diff --git a/civicrm/ext/sequentialcreditnotes/info.xml b/civicrm/ext/sequentialcreditnotes/info.xml
index 86a3cf80d4..86f8b93090 100644
--- a/civicrm/ext/sequentialcreditnotes/info.xml
+++ b/civicrm/ext/sequentialcreditnotes/info.xml
@@ -15,13 +15,13 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-28</releaseDate>
-  <version>5.57.3</version>
+  <version>5.58.0</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
   <develStage>stable</develStage>
   <compatibility>
-    <ver>5.57</ver>
+    <ver>5.58</ver>
   </compatibility>
   <mixins>
     <mixin>setting-php@1.0.0</mixin>
diff --git a/civicrm/install/langs.php b/civicrm/install/langs.php
index 46a387fbab..627dccdad6 100644
--- a/civicrm/install/langs.php
+++ b/civicrm/install/langs.php
@@ -6,6 +6,7 @@
   'ca_ES' => 'Catalan; Valencian',
   'zh_CN' => 'Chinese (China)',
   'zh_TW' => 'Chinese (Taiwan)',
+  'hr_HR' => 'Croatian',
   'cs_CZ' => 'Czech',
   'da_DK' => 'Danish',
   'nl_NL' => 'Dutch (Netherlands)',
diff --git a/civicrm/mixin/polyfill.php b/civicrm/mixin/polyfill.php
index f57c5ebbf8..17ba1df3be 100644
--- a/civicrm/mixin/polyfill.php
+++ b/civicrm/mixin/polyfill.php
@@ -92,8 +92,8 @@ return function ($longName, $shortName, $basePath) {
   }
   foreach ($mixins as $mixin) {
     // If there's trickery about installs/uninstalls/resets, then we may need to register a second time.
-    if (!isset(\Civi::$statics[__FUNCTION__][$mixin])) {
-      \Civi::$statics[__FUNCTION__][$mixin] = 1;
+    if (!isset(\Civi::$statics[$longName][$mixin])) {
+      \Civi::$statics[$longName][$mixin] = 1;
       $func = $_CIVIX_MIXIN_POLYFILL[$mixin];
       $func($mixInfo, $bootCache);
     }
diff --git a/civicrm/packages/HTML/Common.php b/civicrm/packages/HTML/Common.php
index 487ca5e22f..b14fb9bff6 100644
--- a/civicrm/packages/HTML/Common.php
+++ b/civicrm/packages/HTML/Common.php
@@ -141,7 +141,7 @@ class HTML_Common
         if (is_array($attributes)) {
             $charset = HTML_Common::charset();
             foreach ($attributes as $key => $value) {
-                $strAttr .= ' ' . $key . '="' . htmlspecialchars(($value ?? ''), ENT_COMPAT, $charset) . '"';
+                $strAttr .= ' ' . $key . '="' . htmlspecialchars((is_array($value) ? '' : ($value ?? '')), ENT_COMPAT, $charset) . '"';
             }
         }
         return $strAttr;
diff --git a/civicrm/packages/HTML/QuickForm/advmultiselect.php b/civicrm/packages/HTML/QuickForm/advmultiselect.php
index 214e18bce4..5d5a37b5be 100644
--- a/civicrm/packages/HTML/QuickForm/advmultiselect.php
+++ b/civicrm/packages/HTML/QuickForm/advmultiselect.php
@@ -1169,9 +1169,4 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
         return $options;
     }
 }
-
-if (class_exists('HTML_QuickForm')) {
-    HTML_QuickForm::registerElementType('advmultiselect',
-        'HTML/QuickForm/advmultiselect.php', 'HTML_QuickForm_advmultiselect');
-}
 ?>
diff --git a/civicrm/release-notes.md b/civicrm/release-notes.md
index b06fe544eb..36908d4d8d 100644
--- a/civicrm/release-notes.md
+++ b/civicrm/release-notes.md
@@ -15,6 +15,18 @@ Other resources for identifying changes are:
     * https://github.com/civicrm/civicrm-joomla
     * https://github.com/civicrm/civicrm-wordpress
 
+## CiviCRM 5.58.0
+
+Released February 1, 2023
+
+- **[Synopsis](release-notes/5.58.0.md#synopsis)**
+- **[Security advisories](release-notes/5.58.0.md#security)**
+- **[Features](release-notes/5.58.0.md#features)**
+- **[Bugs resolved](release-notes/5.58.0.md#bugs)**
+- **[Miscellany](release-notes/5.58.0.md#misc)**
+- **[Credits](release-notes/5.58.0.md#credits)**
+- **[Feedback](release-notes/5.58.0.md#feedback)**
+
 ## CiviCRM 5.57.3
 
 Released January 30, 2023
@@ -54,6 +66,24 @@ Released January 4, 2023
 - **[Credits](release-notes/5.57.0.md#credits)**
 - **[Feedback](release-notes/5.57.0.md#feedback)**
 
+## CiviCRM 5.56.2
+
+Released January 4, 2023
+
+- **[Synopsis](release-notes/5.56.2.md#synopsis)**
+- **[Security advisories](release-notes/5.56.2.md#security)**
+- **[Credits](release-notes/5.56.2.md#credits)**
+- **[Feedback](release-notes/5.56.2.md#feedback)**
+
+## CiviCRM 5.56.1
+
+Released December 20, 2022
+
+- **[Synopsis](release-notes/5.56.1.md#synopsis)**
+- **[Bugs resolved](release-notes/5.56.1.md#bugs)**
+- **[Credits](release-notes/5.56.1.md#credits)**
+- **[Feedback](release-notes/5.56.1.md#feedback)**
+
 ## CiviCRM 5.56.0
 
 Released December 7, 2022
@@ -65,6 +95,24 @@ Released December 7, 2022
 - **[Credits](release-notes/5.56.0.md#credits)**
 - **[Feedback](release-notes/5.56.0.md#feedback)**
 
+## CiviCRM 5.55.2
+
+Released November 17, 2022
+
+- **[Synopsis](release-notes/5.55.2.md#synopsis)**
+- **[Bugs resolved](release-notes/5.55.2.md#bugs)**
+- **[Credits](release-notes/5.55.2.md#credits)**
+- **[Feedback](release-notes/5.55.2.md#feedback)**
+
+## CiviCRM 5.55.1
+
+Released November 8, 2022
+
+- **[Synopsis](release-notes/5.55.1.md#synopsis)**
+- **[Bugs resolved](release-notes/5.55.1.md#bugs)**
+- **[Credits](release-notes/5.55.1.md#credits)**
+- **[Feedback](release-notes/5.55.1.md#feedback)**
+
 ## CiviCRM 5.55.0
 
 Released November 2, 2022
diff --git a/civicrm/release-notes/5.55.1.md b/civicrm/release-notes/5.55.1.md
new file mode 100644
index 0000000000..0fdde64a02
--- /dev/null
+++ b/civicrm/release-notes/5.55.1.md
@@ -0,0 +1,37 @@
+# CiviCRM 5.55.1
+
+Released November 8, 2022
+
+- **[Synopsis](#synopsis)**
+- **[Bugs resolved](#bugs)**
+- **[Credits](#credits)**
+- **[Feedback](#feedback)**
+
+## <a name="synopsis"></a>Synopsis
+
+| *Does this version...?*                                         |          |
+| --------------------------------------------------------------- | -------- |
+| Change the database schema?                                     | no       |
+| Alter the API?                                                  | no       |
+| Require attention to configuration options?                     | no       |
+| Fix problems installing or upgrading to a previous version?     | no       |
+| Introduce features?                                             | no       |
+| **Fix bugs?**                                                   | **yes**  |
+
+## <a name="bugs"></a>Bugs resolved
+
+* **_CiviContribute_: Restore previous handling of "Country" (as a payment field). ([dev/core#3918](https://lab.civicrm.org/dev/core/-/issues/3918): [#24897](https://github.com/civicrm/civicrm-core/pull/24897))**
+* **_Navigation Menu_: Fix error in building menu ([dev/core#3968](https://lab.civicrm.org/dev/core/-/issues/3968): [#24904](https://github.com/civicrm/civicrm-core/pull/24904))**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wikimedia Foundation - Eileen McNaughton; ; MJW Consulting - Matthew Wire; jhungerford;
+Francesc Bassas i Bullich; civiservice.de - Sebastian Lisken; CiviCRM - Tim Otten, Coleman Watts
+
+## <a name="feedback"></a>Feedback
+
+These release notes are edited by Tim Otten and Andie Hunt.  If you'd like to
+provide feedback on them, please login to https://chat.civicrm.org/civicrm and
+contact `@agh1`.
diff --git a/civicrm/release-notes/5.55.2.md b/civicrm/release-notes/5.55.2.md
new file mode 100644
index 0000000000..1dab8a4275
--- /dev/null
+++ b/civicrm/release-notes/5.55.2.md
@@ -0,0 +1,41 @@
+# CiviCRM 5.55.2
+
+Released November 17, 2022
+
+- **[Synopsis](#synopsis)**
+- **[Bugs resolved](#bugs)**
+- **[Credits](#credits)**
+- **[Feedback](#feedback)**
+
+## <a name="synopsis"></a>Synopsis
+
+| *Does this version...?*                                         |          |
+| --------------------------------------------------------------- | -------- |
+| Change the database schema?                                     | no       |
+| Alter the API?                                                  | no       |
+| Require attention to configuration options?                     | no       |
+| **Fix problems installing or upgrading to a previous version?** | **yes**  |
+| Introduce features?                                             | no       |
+| **Fix bugs?**                                                   | **yes**  |
+
+## <a name="bugs"></a>Bugs resolved
+
+* **_Afform_: Error during installation ([#24962](https://github.com/civicrm/civicrm-core/pull/24962))**
+* **_Backdrop_: Popup displays with incorrect buttons ([dev/backdrop#76](https://lab.civicrm.org/dev/backdrop/-/issues/76): [#24930](https://github.com/civicrm/civicrm-core/pull/24930))**
+* **_Sample Data_: Invalid example of a "Price Set" ([dev/core#3978](https://lab.civicrm.org/dev/core/-/issues/3978): [#24926](https://github.com/civicrm/civicrm-core/pull/24926))**
+* **_WordPress_: Status-check for "Clean URLs" fails if CiviContribute is inactive ([#24950](https://github.com/civicrm/civicrm-core/pull/24950))**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wikimedia Foundation - Eileen McNaughton; Tadpole Collective - Kevin Cristiano; Megaphone
+Technology Consulting - Jon Goldberg; JMA Consulting - Seamus Lee; Freeform Solutions -
+Herb van den Dool; Dave D; CiviDesk - Yashodha Chaku; CiviCRM - Coleman Watts; Christian
+Wach; AGH Strategies - Alice Frumin
+
+## <a name="feedback"></a>Feedback
+
+These release notes are edited by Tim Otten and Andie Hunt.  If you'd like to
+provide feedback on them, please login to https://chat.civicrm.org/civicrm and
+contact `@agh1`.
diff --git a/civicrm/release-notes/5.56.1.md b/civicrm/release-notes/5.56.1.md
new file mode 100644
index 0000000000..c9c287ef89
--- /dev/null
+++ b/civicrm/release-notes/5.56.1.md
@@ -0,0 +1,43 @@
+# CiviCRM 5.56.1
+
+Released December 20, 2022
+
+- **[Synopsis](#synopsis)**
+- **[Bugs resolved](#bugs)**
+- **[Credits](#credits)**
+- **[Feedback](#feedback)**
+
+## <a name="synopsis"></a>Synopsis
+
+| *Does this version...?*                                         |          |
+| --------------------------------------------------------------- | -------- |
+| Change the database schema?                                     | no       |
+| Alter the API?                                                  | no       |
+| Require attention to configuration options?                     | no       |
+| Fix problems installing or upgrading to a previous version?     | no       |
+| Introduce features?                                             | no       |
+| **Fix bugs?**                                                   | **yes**  |
+
+## <a name="bugs"></a>Bugs resolved
+
+* **_CiviAccounts_: Closing a batch generates Javascript error (if authx is enabled) ([dev/core#3960](https://lab.civicrm.org/dev/core/-/issues/3960): [#25129](https://github.com/civicrm/civicrm-core/pull/25129))**
+* **_CiviAccounts_: "New Batch" page does not load ([dev/core#4036](https://lab.civicrm.org/dev/core/-/issues/4036): [#25189](https://github.com/civicrm/civicrm-core/pull/25189))**
+* **_CiviContribute_: Crash when displaying a contribution without any line-items ([dev/core#4027](https://lab.civicrm.org/dev/core/-/issues/4027): [#25145](https://github.com/civicrm/civicrm-core/pull/25145))**
+* **_CiviContribute_: Contribution amount sometimes displays extraneous dash ([#25033](https://github.com/civicrm/civicrm-core/pull/25033))**
+* **_CiviContribute_: Import error when using "update" mode ([dev/core#4038](https://lab.civicrm.org/dev/core/-/issues/4038): [#25204](https://github.com/civicrm/civicrm-core/pull/25204))**
+* **_Flexmailer_: Tracked URLs with hyphens do not work ([#25149](https://github.com/civicrm/civicrm-core/pull/25149))**
+* **_SearchKit_: Console error when loading options ([#25198](https://github.com/civicrm/civicrm-core/pull/25198))**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wildsight - Lars Sanders-Green; Wikimedia Foundation - Eileen McNaughton; Third Sector
+Design - Kurund Jalmi; Megaphone Technology Consulting - Jon Goldberg; JMA Consulting -
+Seamus Lee; Dave D; CiviDesk - Yashodha Chaku; CiviCRM - Coleman Watts, Tim Otten
+
+## <a name="feedback"></a>Feedback
+
+These release notes are edited by Tim Otten and Andie Hunt.  If you'd like to
+provide feedback on them, please login to https://chat.civicrm.org/civicrm and
+contact `@agh1`.
diff --git a/civicrm/release-notes/5.56.2.md b/civicrm/release-notes/5.56.2.md
new file mode 100644
index 0000000000..36cc8bbfd4
--- /dev/null
+++ b/civicrm/release-notes/5.56.2.md
@@ -0,0 +1,39 @@
+# CiviCRM 5.56.2
+
+Released January 4, 2023
+
+- **[Synopsis](#synopsis)**
+- **[Security advisories](#security)**
+- **[Credits](#credits)**
+- **[Feedback](#feedback)**
+
+## <a name="synopsis"></a>Synopsis
+
+| *Does this version...?*                                         |          |
+| --------------------------------------------------------------- | -------- |
+| Change the database schema?                                     | no       |
+| Alter the API?                                                  | no       |
+| Require attention to configuration options?                     | no       |
+| Fix problems installing or upgrading to a previous version?     | no       |
+| Introduce features?                                             | no       |
+| Fix bugs?                                                       | no       |
+| **Fix security vulnerabilities?**                               | **yes**  |
+
+## <a name="security"></a>Security advisories
+
+* **[CIVI-SA-2023-01](https://civicrm.org/advisory/civi-sa-2023-01-help-subsystem-rce): RCE via Help Subsystem**
+* **[CIVI-SA-2023-02](https://civicrm.org/advisory/civi-sa-2023-02-civievent-xss): XSS via CiviEvent**
+* **[CIVI-SA-2023-03](https://civicrm.org/advisory/civi-sa-2023-03-asset-builder-xss): XSS via Asset Builder**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wikimedia Foundation - Eileen McNaughton; John Kingsnorth; JMA Consulting - Seamus Lee;
+CiviCRM - Tim Otten; Artful Robot - Rich Lott
+
+## <a name="feedback"></a>Feedback
+
+These release notes are edited by Tim Otten and Andie Hunt.  If you'd like to
+provide feedback on them, please login to https://chat.civicrm.org/civicrm and
+contact `@agh1`.
diff --git a/civicrm/release-notes/5.57.0.md b/civicrm/release-notes/5.57.0.md
index 4bdc17ccb7..50164c96a1 100644
--- a/civicrm/release-notes/5.57.0.md
+++ b/civicrm/release-notes/5.57.0.md
@@ -14,6 +14,7 @@ Released January 4, 2023
 
 | *Does this version...?*                                         |         |
 |:--------------------------------------------------------------- |:-------:|
+| Fix security vulnerabilities?                                   |   no    |
 | **Change the database schema?**                                 | **yes** |
 | **Alter the API?**                                              | **yes** |
 | **Require attention to configuration options?**                 | **yes** |
diff --git a/civicrm/release-notes/5.58.0.md b/civicrm/release-notes/5.58.0.md
new file mode 100644
index 0000000000..cc7f33ecbc
--- /dev/null
+++ b/civicrm/release-notes/5.58.0.md
@@ -0,0 +1,393 @@
+# CiviCRM 5.58.0
+
+Released February 1, 2023
+
+- **[Synopsis](#synopsis)**
+- **[Security advisories](#security)**
+- **[Features](#features)**
+- **[Bugs resolved](#bugs)**
+- **[Miscellany](#misc)**
+- **[Credits](#credits)**
+- **[Feedback](#feedback)**
+
+## <a name="synopsis"></a>Synopsis
+
+| *Does this version...?*                                         |         |
+|:--------------------------------------------------------------- |:-------:|
+| Fix security vulnerabilities?                                   |   no    |
+| **Change the database schema?**                                 | **yes** |
+| **Alter the API?**                                              | **yes** |
+| Require attention to configuration options?                     |   no    |
+| **Fix problems installing or upgrading to a previous version?** | **yes** |
+| **Introduce features?**                                         | **yes** |
+| **Fix bugs?**                                                   | **yes** |
+
+## <a name="features"></a>Features
+
+### Core CiviCRM
+
+- **Support DedupeRules as Managed entities
+  ([25227](https://github.com/civicrm/civicrm-core/pull/25227))**
+
+  Adds support for Dedupe Rules as managed entities.
+
+- **Add search/display details to searchKitTasks hook - allows for eg. filtering
+  actions by search display
+  ([25123](https://github.com/civicrm/civicrm-core/pull/25123) and
+  [25482](https://github.com/civicrm/civicrm-core/pull/25482))**
+
+  Improves the searchKitTasks hook by making details regarding the search
+  display available.
+
+- **Add Option Group descriptions from templates/CRM/Admin/Page/Options.tpl
+  ([25143](https://github.com/civicrm/civicrm-core/pull/25143))**
+
+  Makes the Option Group -> description field accessible to APIv4/SearchKit etc.
+
+- **List of languages: Enable Croatian language by default
+  ([25192](https://github.com/civicrm/civicrm-core/pull/25192))**
+
+  Improves the list of languages by enabling Croatian by default.
+
+- **Status Check - Raise severity of the check for signing keys
+  ([25285](https://github.com/civicrm/civicrm-core/pull/25285))**
+
+  Changes the Status Check for missing CIVICRM_SIGN_KEYS to throw an error
+  instead of a notice.
+
+- **Drop php 7.2 support from CiviCRM 5.58 (after 5.57 ESR)
+  ([dev/core#3991](https://lab.civicrm.org/dev/core/-/issues/3991):
+  [25147](https://github.com/civicrm/civicrm-core/pull/25147),
+  [662](https://github.com/civicrm/civicrm-drupal/pull/662),
+  [68](https://github.com/civicrm/civicrm-joomla/pull/68),
+  [166](https://github.com/civicrm/civicrm-backdrop/pull/166) and
+  [286](https://github.com/civicrm/civicrm-wordpress/pull/286))**
+
+  Bumps the minimum PHP version to 7.3.0 (from 7.2).
+
+### CiviContribute
+
+- **Add datasource selector to generic import (so it can be used eg. with
+  contribution import)
+  ([25161](https://github.com/civicrm/civicrm-core/pull/25161) and
+  [25427](https://github.com/civicrm/civicrm-core/pull/25427))**
+
+  Makes CSV and SQL available as datasources for Contribution Imports.
+
+### CiviMember
+
+- **Add Membership entity to formbuilder
+  ([25144](https://github.com/civicrm/civicrm-core/pull/25144))**
+
+  Adds the Membership entity to Form Builder.
+
+## <a name="bugs"></a>Bugs resolved
+
+### Core CiviCRM
+
+- **htmlspecialchars() issue on PHP8 and CiviReport (Work Towards
+  [dev/core#4047](https://lab.civicrm.org/dev/core/-/issues/4047):
+  [356](https://github.com/civicrm/civicrm-packages/pull/356))**
+
+  Fixes fatal error when running a CiviReport on PHP8 when htmlspecialchars()
+  is called on an empty array.
+
+- **Avoid 5.57 upgrade taking hours on large activity tables
+  ([25380](https://github.com/civicrm/civicrm-core/pull/25380),
+  [25437](https://github.com/civicrm/civicrm-core/pull/25437), and
+  [25435](https://github.com/civicrm/civicrm-core/pull/25435))**
+
+  The queries on `is_current_revision` and `original_id` perform badly on large
+  activity tables. This change only runs them if you don't have a lot of
+  activities. If it can't run the queries then it points you to a snippet which
+  contains the queries you can run manually.
+
+- **Configure Event Fees tab
+  ([25120](https://github.com/civicrm/civicrm-core/pull/25120))**
+
+  Makes the Fees tab on the Configure Event page, as well as the link to the
+  Fees page from the Configure button on an event, conditionally dependent on
+  whether CiviContribute is enabled.
+
+- **Search Kit: Mailing labels don't work
+  ([dev/core#3470](https://lab.civicrm.org/dev/core/-/issues/3470):
+  [25164](https://github.com/civicrm/civicrm-core/pull/25164))**
+
+  Fixes the Mailing Labels action for SearchKit displays.
+
+- **Some renames missing from #24982
+  ([25467](https://github.com/civicrm/civicrm-core/pull/25467))**
+
+  This restores some class declarations that were changed in 5.57.0 without
+  changing the corresponding DAO file names.
+
+- **Cannot fill in FormBuilder fields when using Existing Contact autocomplete
+  ([dev/core#4083](https://lab.civicrm.org/dev/core/-/issues/4083):
+  [25374](https://github.com/civicrm/civicrm-core/pull/25374))**
+
+- **correct logic for handling empty-array values for checkboxes
+  ([23305](https://github.com/civicrm/civicrm-core/pull/23305))**
+
+- **Only allow valid image types to be uploaded to image_URL field on profiles
+  ([25217](https://github.com/civicrm/civicrm-core/pull/25217))**
+
+- **Remove conditionals that rely on NULL not being NULL
+  ([25183](https://github.com/civicrm/civicrm-core/pull/25183))**
+
+- **Remove incorrect usages of {localize} in civicrm_data.tpl
+  ([25172](https://github.com/civicrm/civicrm-core/pull/25172))**
+
+- **SearchKit - Ensure id & name are defined when loading saved searches
+  ([25146](https://github.com/civicrm/civicrm-core/pull/25146))**
+
+- **searchkit - fix broken update task in dropdown
+  ([25289](https://github.com/civicrm/civicrm-core/pull/25289))**
+
+- **PHP8: callback function on GOTV must be static
+  ([25200](https://github.com/civicrm/civicrm-core/pull/25200))**
+
+- **Smarty notice fix on contact search results
+  ([25261](https://github.com/civicrm/civicrm-core/pull/25261) and
+  [25269](https://github.com/civicrm/civicrm-core/pull/25269))**
+
+- **E_NOTICES on activity view
+  ([25169](https://github.com/civicrm/civicrm-core/pull/25169))**
+
+- **Enotice fixes, consolidation on Import datasource forms
+  ([25141](https://github.com/civicrm/civicrm-core/pull/25141))**
+
+- **Fix broken call to registerElementType in advmultiselect.php
+  ([357](https://github.com/civicrm/civicrm-packages/pull/357))**
+
+- **Fix `cv` failure on J3.
+  ([25320](https://github.com/civicrm/civicrm-core/pull/25320))**
+
+- **5.57.0 quotes typo: security 2x double quotes to 1x double quotes
+  ([25316](https://github.com/civicrm/civicrm-core/pull/25316))**
+
+- **Fix Civix not correctly loading Mixins
+  ([totten/civix#257](https://github.com/totten/civix/issues/257):
+  [25179](https://github.com/civicrm/civicrm-core/pull/25179))**
+
+- **5.58 rc upgrade error
+  ([dev/core#40095](https://lab.civicrm.org/dev/core/-/issues/4095):
+  [25421](https://github.com/civicrm/civicrm-core/pull/25421))**
+
+  If logging is enabled, this updates the schema of the logging table for
+  `civicrm_option_group` before adding description values to it.
+
+- **Fix APIv4 autocomplete for dynamic entities ([#25490](https://github.com/civicrm/civicrm-core/pull/25490))**
+
+### CiviCase
+
+- **Fix smarty notices on Open Case
+  ([25165](https://github.com/civicrm/civicrm-core/pull/25165))**
+
+### CiviContribute
+
+- **Pagination and counts for soft credits on contact contribution tab are
+  broken ([dev/core#4063](https://lab.civicrm.org/dev/core/-/issues/4063):
+  [25460](https://github.com/civicrm/civicrm-core/pull/25460))**
+
+- **Fix Contributions listing crash due to getLineItemTitle returning null
+  ([25300](https://github.com/civicrm/civicrm-core/pull/25300))**
+
+- **Fix APIv4 autocomplete for contributions ([dev/core#4104](https://lab.civicrm.org/dev/core/-/issues/4104): [#25485](https://github.com/civicrm/civicrm-core/pull/25485))**
+
+### CiviEvent
+
+- **Offline Event confirmation receipt prints waitlist message
+  ([dev/core#4087](https://lab.civicrm.org/dev/core/-/issues/4087):
+  [25370](https://github.com/civicrm/civicrm-core/pull/25370))**
+
+  The email sent from an offline event registration incorrectly included the
+  waitlist message.
+
+- **Fix missing default values for required fields in event registration setup
+  ([25410](https://github.com/civicrm/civicrm-core/pull/25410))**
+
+### CiviMail
+
+- **E_WARNING on bulk email activity view
+  ([25193](https://github.com/civicrm/civicrm-core/pull/25193))**
+
+### CiviPetition
+
+- **Petition ThankYou.tpl: fix strong typo
+  ([25275](https://github.com/civicrm/civicrm-core/pull/25275))**
+
+## <a name="misc"></a>Miscellany
+
+- **Status Check - Add check to ensure that MySQL timezones are
+  operational ([#25367](https://github.com/civicrm/civicrm-core/pull/25367))**
+
+- **Standardise method of getting entity in imports
+  ([25173](https://github.com/civicrm/civicrm-core/pull/25173))**
+
+- **Divide & conquer, `initSet` no longer shared as much code is not
+  ([25184](https://github.com/civicrm/civicrm-core/pull/25184))**
+
+- **Post code-divide tidy-up
+  ([25194](https://github.com/civicrm/civicrm-core/pull/25194))**
+
+- **Simplify params on now-private function
+  ([25182](https://github.com/civicrm/civicrm-core/pull/25182))**
+
+- **Remove legacy code payment processor handling
+  ([25240](https://github.com/civicrm/civicrm-core/pull/25240))**
+
+- **Remove broken method CRM_Utils_File::isHtml()
+  ([25233](https://github.com/civicrm/civicrm-core/pull/25233))**
+
+- **Remove deprecated ids from OptionValue::add
+  ([25223](https://github.com/civicrm/civicrm-core/pull/25223))**
+
+- **Remove unreachable code (since 2020)
+  ([25268](https://github.com/civicrm/civicrm-core/pull/25268))**
+
+- **Move legacy search selector file to legacy search extension
+  ([25264](https://github.com/civicrm/civicrm-core/pull/25264))**
+
+- **Remove Mar 2020 deprecated functions
+  ([25260](https://github.com/civicrm/civicrm-core/pull/25260))**
+
+- **AssetBuilder - Fix `testInvalid()` failure. Switch to JWT.
+  ([25305](https://github.com/civicrm/civicrm-core/pull/25305))**
+
+- **Move newly added Help Test to Inline folder to match Core Folder structure
+  ([25281](https://github.com/civicrm/civicrm-core/pull/25281))**
+
+- **Extract `getMembershipBlock`
+  ([25238](https://github.com/civicrm/civicrm-core/pull/25238))**
+
+- **Remove unnecessary pass-by-ref
+  ([25263](https://github.com/civicrm/civicrm-core/pull/25263))**
+
+- **Remove unused variable
+  ([25257](https://github.com/civicrm/civicrm-core/pull/25257))**
+
+- **Simplify dataProvider in queryTest
+  ([25255](https://github.com/civicrm/civicrm-core/pull/25255))**
+
+- **Php layer consolidation on Import DataSource form
+  ([25142](https://github.com/civicrm/civicrm-core/pull/25142))**
+
+- **Remove reference to 'dataArray' from text version of
+  contribution_online_receipt
+  ([25186](https://github.com/civicrm/civicrm-core/pull/25186))**
+
+- **Remove no-longer-used noisily deprecated function
+  `CRM_Contact_Form_Task_PDFLetterCommon::createActivities`
+  ([25152](https://github.com/civicrm/civicrm-core/pull/25152))**
+
+- **Move part of deprecated function `loadRelatedObjects` to calling functions
+  ([25267](https://github.com/civicrm/civicrm-core/pull/25267))**
+
+- **Remove empty param declarations in docblocks
+  ([25252](https://github.com/civicrm/civicrm-core/pull/25252))**
+
+- **PHPDoc corrections
+  ([25266](https://github.com/civicrm/civicrm-core/pull/25266))**
+
+- **[REF][PHP8.2] Avoid dynamic properties in civicrm_api3 class
+  ([25253](https://github.com/civicrm/civicrm-core/pull/25253))**
+
+- **[REF][PHP8.2] Avoid dynamic properties in CRM_Activity_BAO_ICalendar
+  ([25245](https://github.com/civicrm/civicrm-core/pull/25245))**
+
+- **[REF][PHP8.2] Avoid dynamic properties in mailstores
+  ([25243](https://github.com/civicrm/civicrm-core/pull/25243))**
+
+- **[REF][PHP8.2] Update Composer Patches to latest version to fix notice issue
+  in php8.2 ([25212](https://github.com/civicrm/civicrm-core/pull/25212))**
+
+- **[REF][PHP8.2] Avoid dynamic properties in CRM_Utils_Signer
+  ([25244](https://github.com/civicrm/civicrm-core/pull/25244))**
+
+- **[REF][PHP8.2] Further resolve some deprecation issues around dynamic class
+  properties ([25202](https://github.com/civicrm/civicrm-core/pull/25202))**
+
+- **[REF] Fix a couple of errors in PHP8.2
+  ([25196](https://github.com/civicrm/civicrm-core/pull/25196))**
+
+- **[REF] Update Composer Compile Lib with latest version
+  ([25203](https://github.com/civicrm/civicrm-core/pull/25203))**
+
+- **(REF) CiviUnitTestCase - Cleanup and simplify the DB-reset mechanism
+  ([25178](https://github.com/civicrm/civicrm-core/pull/25178))**
+
+- **[REF] Create Alter Column function in upgrade base class
+  ([25174](https://github.com/civicrm/civicrm-core/pull/25174))**
+
+- **[REF] [merge custom fields function] Stop returning unaltered cFields
+  parameter (good unit test cover)
+  ([25221](https://github.com/civicrm/civicrm-core/pull/25221))**
+
+- **[REF] Fix strstr deprecation in CustomDataByType class
+  ([25230](https://github.com/civicrm/civicrm-core/pull/25230))**
+
+- **(REF) Remove _tagElement dynamic property
+  ([25265](https://github.com/civicrm/civicrm-core/pull/25265))**
+
+- **[REF] [merge custom fields] Only call function when applicable  
+  (well tested code)
+  ([25222](https://github.com/civicrm/civicrm-core/pull/25222))**
+
+- **[NFC] Restore locale properly after test
+  ([25276](https://github.com/civicrm/civicrm-core/pull/25276))**
+
+- **NFC cleanup in test class
+  ([25258](https://github.com/civicrm/civicrm-core/pull/25258))**
+
+- **(NFC) Fix documented return type on getByClass method
+  ([25246](https://github.com/civicrm/civicrm-core/pull/25246))**
+
+- **(NFC) When using @var annotations, ensure type comes first
+  ([25242](https://github.com/civicrm/civicrm-core/pull/25242))**
+
+- **[NFC] Remove line that does nothing
+  ([25234](https://github.com/civicrm/civicrm-core/pull/25234))**
+
+- **[NFC] Fix @method documentation for shouldExitAfterFatal
+  ([25236](https://github.com/civicrm/civicrm-core/pull/25236))**
+
+- **[NFC] php8 - Unit test for empty checkbox array #23305
+  ([25201](https://github.com/civicrm/civicrm-core/pull/25201))**
+
+- **NFC: Fix variable name in activity import
+  ([25205](https://github.com/civicrm/civicrm-core/pull/25205))**
+
+- **(NFC) PrevNextTest - Fix warning about "@group"
+  ([25168](https://github.com/civicrm/civicrm-core/pull/25168))**
+
+- **[REF] Bump UA Parser to 0.7.33
+  ([25423](https://github.com/civicrm/civicrm-core/pull/25423))**
+
+- **distmaker - Fix 'WordPress' entry in JSON report
+  ([25424](https://github.com/civicrm/civicrm-core/pull/25424))**
+
+- **Update dompdf to 2.0.2 ([#25492](https://github.com/civicrm/civicrm-core/pull/25492))**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following code authors:
+
+AGH Strategies - Alice Frumin, Andie Hunt; BrightMinded Ltd - Bradley Taylor;
+CiviCoop - Jaap Jansma; CiviCRM - Coleman Watts, Tim Otten; CiviDesk - Yashodha
+Chaku; Coop SymbioTIC - Mathieu Lutfy; craft-coders.de - Sebastian Gellweiler;
+Dave D; Ginkgo Street Labs - Michael Z Daryabeygi; JMA Consulting - Monish Deb,
+Seamus Lee; Systopia - Johannes; Megaphone Technology Consulting - Jon Goldberg;
+MJW Consulting - Matthew Wire; Squiffle Consulting - Aidan Saunders; Third
+Sector Design - Kurund Jalmi; Wikimedia Foundation - Eileen McNaughton;
+Wildsight - Lars Sanders-Green
+
+Most authors also reviewed code for this release; in addition, the following
+reviewers contributed their comments:
+
+Artful Robot - Rich Lott; Tadpole Collective - Kevin Cristiano
+
+## <a name="feedback"></a>Feedback
+
+These release notes are edited by Alice Frumin and Andie Hunt.  If you'd like
+to provide feedback on them, please log in to https://chat.civicrm.org/civicrm
+and contact `@agh1`.
diff --git a/civicrm/sql/civicrm.mysql b/civicrm/sql/civicrm.mysql
index 97bd2e29db..ae12d364c3 100644
--- a/civicrm/sql/civicrm.mysql
+++ b/civicrm/sql/civicrm.mysql
@@ -301,7 +301,7 @@ CREATE TABLE `civicrm_option_group` (
   `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Option Group ID',
   `name` varchar(64) NOT NULL COMMENT 'Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.',
   `title` varchar(255) COMMENT 'Option Group title.',
-  `description` varchar(255) COMMENT 'Option group description.',
+  `description` text COMMENT 'Option group description.',
   `data_type` varchar(128) COMMENT 'Type of data stored by this option group.',
   `is_reserved` tinyint NOT NULL DEFAULT 1 COMMENT 'Is this a predefined system option group (i.e. it can not be deleted)?',
   `is_active` tinyint NOT NULL DEFAULT 1 COMMENT 'Is this option group active?',
diff --git a/civicrm/sql/civicrm_data.mysql b/civicrm/sql/civicrm_data.mysql
index 545d90e2e1..2dfca6f7c6 100644
--- a/civicrm/sql/civicrm_data.mysql
+++ b/civicrm/sql/civicrm_data.mysql
@@ -4744,91 +4744,102 @@ VALUES
 -- option groups and values for 'preferred communication methods' , 'activity types', 'gender', etc.
 
 INSERT INTO
-   `civicrm_option_group` (`name`, `title`, `data_type`, `is_reserved`, `is_active`, `is_locked`, `option_value_fields`)
+   `civicrm_option_group` (`name`, `title`, `data_type`, `is_reserved`, `is_active`, `is_locked`, `option_value_fields`, `description`)
 VALUES
-   ('preferred_communication_method', 'Preferred Communication Method'     , NULL,      1, 1, 0, 'name,label,description'),
-   ('activity_type'                 , 'Activity Type'                      , 'Integer', 1, 1, 0, 'name,label,description,icon'),
-   ('gender'                        , 'Gender'                             , 'Integer', 1, 1, 0, 'name,label,description'),
-   ('instant_messenger_service'     , 'Instant Messenger (IM) screen-names', NULL,      1, 1, 0, 'name,label,description'),
-   ('mobile_provider'               , 'Mobile Phone Providers'             , NULL,      1, 1, 0, 'name,label,description'),
-   ('individual_prefix'             , 'Individual contact prefixes'        , NULL,      1, 1, 0, 'name,label,description'),
-   ('individual_suffix'             , 'Individual contact suffixes'        , NULL,      1, 1, 0, 'name,label,description'),
-   ('acl_role'                      , 'ACL Role'                           , NULL,      1, 1, 0, 'name,label,description'),
-   ('accept_creditcard'             , 'Accepted Credit Cards'              , NULL,      1, 1, 0, 'name,label,description'),
-   ('payment_instrument'            , 'Payment Methods'                    , 'Integer', 1, 1, 0, 'name,label,description'),
-   ('contribution_status'           , 'Contribution Status'                , NULL,      1, 1, 1, 'name,label,description'),
-   ('pcp_status'                    , 'PCP Status'                         , NULL,      1, 1, 1, 'name,label,description'),
-   ('pcp_owner_notify'              , 'PCP owner notifications'            , NULL,      1, 1, 1, 'name,label,description'),
-   ('participant_role'              , 'Participant Role'                   , 'Integer', 1, 1, 0, 'name,label,description'),
-   ('event_type'                    , 'Event Type'                         , 'Integer', 1, 1, 0, 'name,label,description'),
-   ('contact_view_options'          , 'Contact View Options'               , NULL,      1, 1, 1, 'name,label,description'),
-   ('contact_smart_group_display'   , 'Contact Smart Group View Options'   , NULL,      1, 1, 1, 'name,label,description'),
-   ('contact_edit_options'          , 'Contact Edit Options'               , NULL,      1, 1, 1, 'name,label,description'),
-   ('advanced_search_options'       , 'Advanced Search Options'            , NULL,      1, 1, 1, 'name,label,description'),
-   ('user_dashboard_options'        , 'User Dashboard Options'             , NULL,      1, 1, 1, 'name,label,description'),
-   ('address_options'               , 'Addressing Options'                 , NULL,      1, 1, 0, 'name,label,description'),
-   ('group_type'                    , 'Group Type'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('custom_search'                 , 'Custom Search'                      , NULL,      1, 1, 0, 'name,label,description'),
-   ('activity_status'               , 'Activity Status'                    , 'Integer', 1, 1, 0, 'name,label,description,color'),
-   ('case_type'                     , 'Case Type'                          , NULL,      1, 1, 0, 'name,label,description'),
-   ('case_status'                   , 'Case Status'                        , NULL,      1, 1, 0, 'name,label,description,color'),
-   ('participant_listing'           , 'Participant Listing'                , NULL,      1, 1, 0, 'name,label,description'),
-   ('safe_file_extension'           , 'Safe File Extension'                , NULL,      1, 1, 0, 'name,label,description'),
-   ('from_email_address'            , 'From Email Address'                 , NULL,      1, 1, 0, 'name,label,description'),
-   ('mapping_type'                  , 'Mapping Type'                       , NULL,      1, 1, 1, 'name,label,description'),
-   ('wysiwyg_editor'                , 'WYSIWYG Editor'                     , NULL,      1, 1, 0, 'name,label,description'),
-   ('recur_frequency_units'         , 'Recurring Frequency Units'          , NULL,      1, 1, 0, 'name,label,description'),
-   ('phone_type'                    , 'Phone Type'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('custom_data_type'              , 'Custom Data Type'                   , NULL,      1, 1, 0, 'name,label,description'),
-   ('visibility'                    , 'Visibility'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('mail_protocol'                 , 'Mail Protocol'                      , NULL,      1, 1, 0, 'name,label,description'),
-   ('priority'                      , 'Priority'                           , NULL,      1, 1, 0, 'name,label,description'),
-   ('redaction_rule'                , 'Redaction Rule'                     , NULL,      1, 1, 0, 'name,label,description'),
-   ('report_template'               , 'Report Template'                    , NULL,      1, 1, 0, 'name,label,description'),
-   ('email_greeting'                , 'Email Greeting Type'                , NULL,      1, 1, 0, 'name,label,description'),
-   ('postal_greeting'               , 'Postal Greeting Type'               , NULL,      1, 1, 0, 'name,label,description'),
-   ('addressee'                     , 'Addressee Type'                     , NULL,      1, 1, 0, 'name,label,description'),
-   ('contact_autocomplete_options'  , 'Autocomplete Contact Search'        , NULL,      1, 1, 1, 'name,label,description'),
-   ('contact_reference_options'     , 'Contact Reference Autocomplete Options', NULL,   1, 1, 1, 'name,label,description'),
-   ('website_type'                  , 'Website Type'                       , NULL,      1, 1, 0, 'name,label,description'),
-   ('tag_used_for'                  , 'Tag Used For'                       , NULL,      1, 1, 1, 'name,label,description'),
-   ('note_used_for'                 , 'Note Used For'                      , NULL,      1, 1, 1, 'name,label,description'),
-   ('currencies_enabled'            , 'Currencies Enabled'                 , NULL,      1, 1, 0, 'name,label,description'),
-   ('event_badge'                   , 'Event Name Badge'                   , NULL,      1, 1, 0, 'name,label,description'),
-   ('note_privacy'                  , 'Privacy levels for notes'           , NULL,      1, 1, 0, 'name,label,description'),
-   ('campaign_type'                 , 'Campaign Type'                      , NULL,      1, 1, 0, 'name,label,description'),
-   ('campaign_status'               , 'Campaign Status'                    , NULL,      1, 1, 0, 'name,label,description'),
-   ('system_extensions'             , 'CiviCRM Extensions'                 , NULL,      1, 1, 0, 'name,label,description'),
-   ('mail_approval_status'          , 'CiviMail Approval Status'           , NULL,      1, 1, 0, 'name,label,description'),
-   ('engagement_index'              , 'Engagement Index'                   , NULL,      1, 1, 0, 'name,label,description'),
-   ('cg_extend_objects'             , 'Objects a custom group extends to'  , NULL,      1, 1, 0, 'name,label,description'),
-   ('paper_size'                    , 'Paper Size'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('pdf_format'                    , 'PDF Page Format'                    , NULL,      1, 1, 0, 'name,label,description'),
-   ('label_format'                  , 'Mailing Label Format'               , NULL,      1, 1, 0, 'name,label,description'),
-   ('activity_contacts'             , 'Activity Contacts'                  , NULL,      1, 1, 1, 'name,label,description'),
-   ('account_relationship'          , 'Account Relationship'               , NULL,      1, 1, 0, 'name,label,description'),
-   ('event_contacts'                , 'Event Recipients'                   , NULL,      1, 1, 0, 'name,label,description'),
-   ('conference_slot'               , 'Conference Slot'                    , NULL,      1, 1, 0, 'name,label,description'),
-   ('batch_type'                    , 'Batch Type'                         , NULL,      1, 1, 1, 'name,label,description'),
-   ('batch_mode'                    , 'Batch Mode'                         , NULL,      1, 1, 1, 'name,label,description'),
-   ('batch_status'                  , 'Batch Status'                       , NULL,      1, 1, 1, 'name,label,description'),
-   ('sms_api_type'                  , 'Api Type'                           , NULL,      1, 1, 0, 'name,label,description'),
-   ('sms_provider_name'             , 'Sms Provider Internal Name'         , NULL,      1, 1, 0, 'name,label,description'),
-   ('auto_renew_options'            , 'Auto Renew Options'                 , NULL,      1, 1, 1, 'name,label,description'),
-   ('financial_account_type'        , 'Financial Account Type'             , NULL,      1, 1, 0, 'name,label,description'),
-   ('financial_item_status'         , 'Financial Item Status'              , NULL,      1, 1, 1, 'name,label,description'),
-   ('label_type'                    , 'Label Type'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('name_badge'                    , 'Name Badge Format'                  , NULL,      1, 1, 0, 'name,label,description'),
-   ('communication_style'           , 'Communication Style'                , NULL,      1, 1, 0, 'name,label,description'),
-   ('msg_mode'                      , 'Message Mode'                       , NULL,      1, 1, 0, 'name,label,description'),
-   ('contact_date_reminder_options' , 'Contact Date Reminder Options'      , NULL,      1, 1, 1, 'name,label,description'),
-   ('wysiwyg_presets'               , 'WYSIWYG Editor Presets'             , NULL,      1, 1, 0, 'name,label,description'),
-   ('relative_date_filters'         , 'Relative Date Filters'              , NULL,      1, 1, 0, 'name,label,description'),
-   ('pledge_status'                 , 'Pledge Status'                      , NULL,      1, 1, 1, 'name,label,description'),
-   ('contribution_recur_status'     , 'Recurring Contribution Status'      , NULL,      1, 1, 1, 'name,label,description'),
-   ('environment'                   , 'Environment'                        , NULL,      1, 1, 0, 'name,label,description'),
-   ('activity_default_assignee'     , 'Activity default assignee'          , NULL,      1, 1, 0, 'name,label,description'),
-   ('entity_batch_extends'          , 'Entity Batch Extends'               , NULL,      1, 1, 0, 'name,label,description');
+   ('preferred_communication_method', 'Preferred Communication Method'     , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('activity_type'                 , 'Activity Type'                      , 'Integer', 1, 1, 0, 'name,label,description,icon',
+     'Activities track interactions with contacts. Some activity types are reserved for use by automated processes, others can be freely configured.'),
+   ('gender'                        , 'Gender'                             , 'Integer', 1, 1, 0, 'name,label,description',
+     'CiviCRM is pre-configured with standard options for individual gender (Male, Female, Other). Modify these options as needed for your installation.'),
+   ('instant_messenger_service'     , 'Instant Messenger (IM) screen-names', NULL,      1, 1, 0, 'name,label,description',
+     'Commonly-used messaging apps are listed here. Administrators may define as many additional providers as needed.'),
+   ('mobile_provider'               , 'Mobile Phone Providers'             , NULL,      1, 1, 0, 'name,label,description',
+     'When recording mobile phone numbers for contacts, it may be useful to include the Mobile Phone Service Provider (e.g. Cingular, Sprint, etc.). CiviCRM is installed with the most commonly encountered service providers. Administrators may define as many additional providers as needed.'),
+   ('individual_prefix'             , 'Individual contact prefixes'        , NULL,      1, 1, 0, 'name,label,description',
+     'CiviCRM is pre-configured with standard options for individual contact prefixes (Ms., Mr., Dr. etc.). Customize these options and add new ones as needed for your installation.'),
+   ('individual_suffix'             , 'Individual contact suffixes'        , NULL,      1, 1, 0, 'name,label,description',
+     'CiviCRM is pre-configured with standard options for individual contact name suffixes (Jr., Sr., II etc.). Customize these options and add new ones as needed for your installation.'),
+   ('acl_role'                      , 'ACL Role'                           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('accept_creditcard'             , 'Accepted Credit Cards'              , NULL,      1, 1, 0, 'name,label,description',
+     'The following credit card options will be offered to contributors using Online Contribution pages. You will need to verify which cards are accepted by your chosen Payment Processor and update these entries accordingly.IMPORTANT: These options do not control credit card/payment method choices for sites and/or contributors using the PayPal Express service (e.g. where billing information is collected on the Payment Processor\\\'s website).'),
+   ('payment_instrument'            , 'Payment Methods'                    , 'Integer', 1, 1, 0, 'name,label,description',
+     'You may choose to record the payment method used for each contribution and fee. Reserved payment methods are required - you may modify their labels but they can not be deleted (e.g. Check, Credit Card, Debit Card). If your site requires additional payment methods, you can add them here. You can associate each payment method with a Financial Account which specifies where the payment is going (e.g. a bank account for checks and cash).'),
+   ('contribution_status'           , 'Contribution Status'                , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('pcp_status'                    , 'PCP Status'                         , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('pcp_owner_notify'              , 'PCP owner notifications'            , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('participant_role'              , 'Participant Role'                   , 'Integer', 1, 1, 0, 'name,label,description',
+     'Define participant roles for events here (e.g. Attendee, Host, Speaker...). You can then assign roles and search for participants by role.'),
+   ('event_type'                    , 'Event Type'                         , 'Integer', 1, 1, 0, 'name,label,description',
+     'Use Event Types to categorize your events. Event feeds can be filtered by Event Type and participant searches can use Event Type as a criteria.'),
+   ('contact_view_options'          , 'Contact View Options'               , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('contact_smart_group_display'   , 'Contact Smart Group View Options'   , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('contact_edit_options'          , 'Contact Edit Options'               , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('advanced_search_options'       , 'Advanced Search Options'            , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('user_dashboard_options'        , 'User Dashboard Options'             , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('address_options'               , 'Addressing Options'                 , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('group_type'                    , 'Group Type'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('custom_search'                 , 'Custom Search'                      , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('activity_status'               , 'Activity Status'                    , 'Integer', 1, 1, 0, 'name,label,description,color', NULL),
+   ('case_type'                     , 'Case Type'                          , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('case_status'                   , 'Case Status'                        , NULL,      1, 1, 0, 'name,label,description,color', NULL),
+   ('participant_listing'           , 'Participant Listing'                , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('safe_file_extension'           , 'Safe File Extension'                , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('from_email_address'            , 'From Email Address'                 , NULL,      1, 1, 0, 'name,label,description',
+     'By default, CiviCRM uses the primary email address of the logged in user as the FROM address when sending emails to contacts. However, you can use this page to define one or more general Email Addresses that can be selected as an alternative. EXAMPLE: \"Client Services\" <clientservices@example.org>.'),
+   ('mapping_type'                  , 'Mapping Type'                       , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('wysiwyg_editor'                , 'WYSIWYG Editor'                     , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('recur_frequency_units'         , 'Recurring Frequency Units'          , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('phone_type'                    , 'Phone Type'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('custom_data_type'              , 'Custom Data Type'                   , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('visibility'                    , 'Visibility'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('mail_protocol'                 , 'Mail Protocol'                      , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('priority'                      , 'Priority'                           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('redaction_rule'                , 'Redaction Rule'                     , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('report_template'               , 'Report Template'                    , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('email_greeting'                , 'Email Greeting Type'                , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('postal_greeting'               , 'Postal Greeting Type'               , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('addressee'                     , 'Addressee Type'                     , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('contact_autocomplete_options'  , 'Autocomplete Contact Search'        , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('contact_reference_options'     , 'Contact Reference Autocomplete Options', NULL,   1, 1, 1, 'name,label,description', NULL),
+   ('website_type'                  , 'Website Type'                       , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('tag_used_for'                  , 'Tag Used For'                       , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('note_used_for'                 , 'Note Used For'                      , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('currencies_enabled'            , 'Currencies Enabled'                 , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('event_badge'                   , 'Event Name Badge'                   , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('note_privacy'                  , 'Privacy levels for notes'           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('campaign_type'                 , 'Campaign Type'                      , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('campaign_status'               , 'Campaign Status'                    , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('system_extensions'             , 'CiviCRM Extensions'                 , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('mail_approval_status'          , 'CiviMail Approval Status'           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('engagement_index'              , 'Engagement Index'                   , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('cg_extend_objects'             , 'Objects a custom group extends to'  , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('paper_size'                    , 'Paper Size'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('pdf_format'                    , 'PDF Page Format'                    , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('label_format'                  , 'Mailing Label Format'               , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('activity_contacts'             , 'Activity Contacts'                  , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('account_relationship'          , 'Account Relationship'               , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('event_contacts'                , 'Event Recipients'                   , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('conference_slot'               , 'Conference Slot'                    , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('batch_type'                    , 'Batch Type'                         , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('batch_mode'                    , 'Batch Mode'                         , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('batch_status'                  , 'Batch Status'                       , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('sms_api_type'                  , 'Api Type'                           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('sms_provider_name'             , 'Sms Provider Internal Name'         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('auto_renew_options'            , 'Auto Renew Options'                 , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('financial_account_type'        , 'Financial Account Type'             , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('financial_item_status'         , 'Financial Item Status'              , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('label_type'                    , 'Label Type'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('name_badge'                    , 'Name Badge Format'                  , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('communication_style'           , 'Communication Style'                , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('msg_mode'                      , 'Message Mode'                       , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('contact_date_reminder_options' , 'Contact Date Reminder Options'      , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('wysiwyg_presets'               , 'WYSIWYG Editor Presets'             , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('relative_date_filters'         , 'Relative Date Filters'              , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('pledge_status'                 , 'Pledge Status'                      , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('contribution_recur_status'     , 'Recurring Contribution Status'      , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('environment'                   , 'Environment'                        , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('activity_default_assignee'     , 'Activity default assignee'          , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('entity_batch_extends'          , 'Entity Batch Extends'               , NULL,      1, 1, 0, 'name,label,description', NULL);
 
 SELECT @option_group_id_pcm            := max(id) from civicrm_option_group where name = 'preferred_communication_method';
 SELECT @option_group_id_act            := max(id) from civicrm_option_group where name = 'activity_type';
@@ -5783,7 +5794,7 @@ VALUES
   (@option_group_id_languages, 0, 0, 'kw_GB', 'kw', 'Cornish', @counter := @counter + 1),
   (@option_group_id_languages, 0, 0, 'co_FR', 'co', 'Corsican', @counter := @counter + 1),
   (@option_group_id_languages, 0, 0, 'cr_CA', 'cr', 'Cree', @counter := @counter + 1),
-  (@option_group_id_languages, 0, 0, 'hr_HR', 'hr', 'Croatian', @counter := @counter + 1),
+  (@option_group_id_languages, 0, 1, 'hr_HR', 'hr', 'Croatian', @counter := @counter + 1),
   (@option_group_id_languages, 0, 1, 'cs_CZ', 'cs', 'Czech', @counter := @counter + 1),
   (@option_group_id_languages, 0, 1, 'da_DK', 'da', 'Danish', @counter := @counter + 1),
   (@option_group_id_languages, 0, 0, 'dv_MV', 'dv', 'Divehi; Dhivehi; Maldivian;', @counter := @counter + 1),
@@ -7948,7 +7959,7 @@ INSERT INTO civicrm_msg_template
 {$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $isShowTax && \'{contribution.tax_amount|raw}\' !== \'0.00\'} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"}
 ----------------------------------------------------------
 {foreach from=$lineItems item=line}
-{capture assign=ts_item}{$line.title}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($dataArray)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate || $line.tax_amount != ""}  {$line.tax_rate|string_format:"%.2f"} %  {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else}                  {/if}  {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}
+{capture assign=ts_item}{$line.title}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $isShowTax && \'{contribution.tax_amount|raw}\' !== \'0.00\'}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate || $line.tax_amount != ""}  {$line.tax_rate|string_format:"%.2f"} %  {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else}                  {/if}  {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}
 {/foreach}
 
 {if $isShowTax && \'{contribution.tax_amount|raw}\' !== \'0.00\'}
@@ -8603,7 +8614,7 @@ INSERT INTO civicrm_msg_template
 {$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $isShowTax && \'{contribution.tax_amount|raw}\' !== \'0.00\'} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"}
 ----------------------------------------------------------
 {foreach from=$lineItems item=line}
-{capture assign=ts_item}{$line.title}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($dataArray)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate || $line.tax_amount != ""}  {$line.tax_rate|string_format:"%.2f"} %  {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else}                  {/if}  {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}
+{capture assign=ts_item}{$line.title}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $isShowTax && \'{contribution.tax_amount|raw}\' !== \'0.00\'}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate || $line.tax_amount != ""}  {$line.tax_rate|string_format:"%.2f"} %  {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else}                  {/if}  {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}
 {/foreach}
 
 {if $isShowTax && \'{contribution.tax_amount|raw}\' !== \'0.00\'}
@@ -23654,4 +23665,4 @@ INSERT INTO `civicrm_report_instance`
     ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`)
 VALUES
     (  @domainID, 'Survey Details', 'survey/detail', 'Detailed report for canvassing, phone-banking, walk lists or other surveys.', 'access CiviReport', 'a:39:{s:6:"fields";a:2:{s:9:"sort_name";s:1:"1";s:6:"result";s:1:"1";}s:22:"assignee_contact_id_op";s:2:"eq";s:25:"assignee_contact_id_value";s:0:"";s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:17:"street_number_min";s:0:"";s:17:"street_number_max";s:0:"";s:16:"street_number_op";s:3:"lte";s:19:"street_number_value";s:0:"";s:14:"street_name_op";s:3:"has";s:17:"street_name_value";s:0:"";s:15:"postal_code_min";s:0:"";s:15:"postal_code_max";s:0:"";s:14:"postal_code_op";s:3:"lte";s:17:"postal_code_value";s:0:"";s:7:"city_op";s:3:"has";s:10:"city_value";s:0:"";s:20:"state_province_id_op";s:2:"in";s:23:"state_province_id_value";a:0:{}s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:12:"survey_id_op";s:2:"in";s:15:"survey_id_value";a:0:{}s:12:"status_id_op";s:2:"eq";s:15:"status_id_value";s:1:"1";s:11:"custom_1_op";s:2:"in";s:14:"custom_1_value";a:0:{}s:11:"custom_2_op";s:2:"in";s:14:"custom_2_value";a:0:{}s:17:"custom_3_relative";s:1:"0";s:13:"custom_3_from";s:0:"";s:11:"custom_3_to";s:0:"";s:11:"description";s:75:"Detailed report for canvassing, phone-banking, walk lists or other surveys.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviReport";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}');
-UPDATE civicrm_domain SET version = '5.57.3';
+UPDATE civicrm_domain SET version = '5.58.0';
diff --git a/civicrm/sql/civicrm_generated.mysql b/civicrm/sql/civicrm_generated.mysql
index 2711d97a6e..9804f8dbc1 100644
--- a/civicrm/sql/civicrm_generated.mysql
+++ b/civicrm/sql/civicrm_generated.mysql
@@ -3056,7 +3056,7 @@ UNLOCK TABLES;
 LOCK TABLES `civicrm_domain` WRITE;
 /*!40000 ALTER TABLE `civicrm_domain` DISABLE KEYS */;
 INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES
- (1,'Default Domain Name',NULL,'5.57.3',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
+ (1,'Default Domain Name',NULL,'5.58.0',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
 /*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */;
 UNLOCK TABLES;
 
diff --git a/civicrm/templates/CRM/Campaign/Page/Petition/ThankYou.tpl b/civicrm/templates/CRM/Campaign/Page/Petition/ThankYou.tpl
index 4f302253f2..17765567fb 100644
--- a/civicrm/templates/CRM/Campaign/Page/Petition/ThankYou.tpl
+++ b/civicrm/templates/CRM/Campaign/Page/Petition/ThankYou.tpl
@@ -20,7 +20,7 @@
 {/if}
 
 {if $status_id eq 4}
-  <p>{ts}You have already signed this petition but we<strong>need to confirm your email address</strong>.{/ts}</p>
+  <p><strong>{ts}You have already signed this petition but we need to confirm your email address.{/ts}</strong></p>
   <b>{ts}IMPORTANT{/ts}</b>
   : {ts}Before we can add your signature, you must validate your email address by clicking on the activation link in the confirmation e-mail. Sometimes our confirmation emails get flagged as spam and are moved to your spam folder.{/ts}
   <br/>
diff --git a/civicrm/templates/CRM/Case/Form/Case.tpl b/civicrm/templates/CRM/Case/Form/Case.tpl
index bcbef3b5f7..9f53ea0708 100644
--- a/civicrm/templates/CRM/Case/Form/Case.tpl
+++ b/civicrm/templates/CRM/Case/Form/Case.tpl
@@ -34,12 +34,12 @@
             <div class="help">{$activityTypeDescription}</div>
         </tr>
     {/if}
-{if !empty($clientName)}
+{if $clientName}
     <tr class="crm-case-form-block-clientName">
       <td class="label">{ts}Client{/ts}</td>
       <td class="bold view-value">{$clientName}</td>
     </tr>
-{elseif empty($clientName) and $action eq 1}
+{elseif $action eq 1}
     {if $context eq 'standalone'}
       <td class="label">{$form.client_id.label}</td>
       <td class="view-value">{$form.client_id.html}</td>
diff --git a/civicrm/templates/CRM/Contact/Form/Selector.tpl b/civicrm/templates/CRM/Contact/Form/Selector.tpl
index 697af67f61..f91ce6bd64 100644
--- a/civicrm/templates/CRM/Contact/Form/Selector.tpl
+++ b/civicrm/templates/CRM/Contact/Form/Selector.tpl
@@ -78,7 +78,7 @@
                 {$row.status}</td>
             {/if}
             <td>{$row.contact_type}</td>
-            <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&key=`$qfKey`&context=`$context`"}">{if !empty($row.is_deleted)}<del>{/if}{$row.sort_name}{if !empty($row.is_deleted)}</del>{/if}</a></td>
+            <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&key=`$qfKey`&context=`$context`"}">{if $row.contact_is_deleted}<del>{/if}{$row.sort_name}{if $row.contact_is_deleted}</del>{/if}</a></td>
             {if $action eq 512 or $action eq 256}
               {if !empty($columnHeaders.street_address)}
           <td><span title="{$row.street_address|escape}">{$row.street_address|mb_truncate:22:"...":true}{privacyFlag field=do_not_mail condition=$row.do_not_mail}</span></td>
diff --git a/civicrm/templates/CRM/Contact/Import/Form/CSV.tpl b/civicrm/templates/CRM/Contact/Import/Form/CSV.tpl
index 59c0cdee9a..18c838740d 100644
--- a/civicrm/templates/CRM/Contact/Import/Form/CSV.tpl
+++ b/civicrm/templates/CRM/Contact/Import/Form/CSV.tpl
@@ -22,5 +22,9 @@
             <div class="description">{ts}Check this box if the first row of your file consists of field names (Example: 'First Name','Last Name','Email'){/ts}</div>
         </td>
     </tr>
+    <tr class="crm-import-datasource-form-block-fieldSeparator">
+      <td class="label">{$form.fieldSeparator.label} {help id='id-fieldSeparator' file='CRM/Contact/Import/Form/DataSource'}</td>
+      <td>{$form.fieldSeparator.html}</td>
+    </tr>
   </table>
 
diff --git a/civicrm/templates/CRM/Contact/Import/Form/DataSource.tpl b/civicrm/templates/CRM/Contact/Import/Form/DataSource.tpl
index c09b930779..eb3c00a426 100644
--- a/civicrm/templates/CRM/Contact/Import/Form/DataSource.tpl
+++ b/civicrm/templates/CRM/Contact/Import/Form/DataSource.tpl
@@ -33,20 +33,26 @@
   <div id="common-form-controls" class="form-item">
     <h3>{ts}Import Options{/ts}</h3>
     <table class="form-layout-compressed">
-      <tr class="crm-import-datasource-form-block-contactType">
-        <td class="label">{$form.contactType.label}</td>
-        <td>{$form.contactType.html} {help id='contact-type'}&nbsp;&nbsp;&nbsp;
-          <span id="contact-subtype">{$form.contactSubType.label}&nbsp;&nbsp;&nbsp;{$form.contactSubType.html} {help id='contact-sub-type'}</span>
-        </td>
-      </tr>
-      <tr class="crm-import-datasource-form-block-onDuplicate">
-        <td class="label">{$form.onDuplicate.label}</td>
-        <td>{$form.onDuplicate.html} {help id='dupes'}</td>
-      </tr>
-      <tr class="crm-import-datasource-form-block-dedupe">
-        <td class="label">{$form.dedupe_rule_id.label}</td>
-        <td><span id="contact-dedupe_rule_id">{$form.dedupe_rule_id.html}</span> {help id='id-dedupe_rule'}</td>
-      </tr>
+      {if array_key_exists('contactType', $form)}
+        <tr class="crm-import-datasource-form-block-contactType">
+          <td class="label">{$form.contactType.label}</td>
+          <td>{$form.contactType.html} {help id='contact-type'}{if array_key_exists('contactSubType', $form)}&nbsp;&nbsp;&nbsp;
+            <span id="contact-subtype">{$form.contactSubType.label}&nbsp;&nbsp;&nbsp;{$form.contactSubType.html} {help id='contact-sub-type'}{/if}</span>
+          </td>
+        </tr>
+      {/if}
+      {if array_key_exists('onDuplicate', $form)}
+        <tr class="crm-import-datasource-form-block-onDuplicate">
+          <td class="label">{$form.onDuplicate.label}</td>
+          <td>{$form.onDuplicate.html} {help id='dupes'}</td>
+        </tr>
+      {/if}
+      {if array_key_exists('dedupe_rule_id', $form)}
+        <tr class="crm-import-datasource-form-block-dedupe">
+          <td class="label">{$form.dedupe_rule_id.label}</td>
+          <td><span id="contact-dedupe_rule_id">{$form.dedupe_rule_id.html}</span> {help id='id-dedupe_rule'}</td>
+        </tr>
+      {/if}
       <tr class="crm-import-datasource-form-block-fieldSeparator">
         <td class="label">{$form.fieldSeparator.label}</td>
         <td>{$form.fieldSeparator.html} {help id='id-fieldSeparator'}</td>
@@ -56,7 +62,7 @@
         <td></td><td class="description">{ts}Select the format that is used for date fields in your import data.{/ts}</td>
       </tr>
 
-      {if $geoCode}
+      {if array_key_exists('doGeocodeAddress', $form)}
         <tr class="crm-import-datasource-form-block-doGeocodeAddress">
           <td class="label"></td>
           <td>{$form.doGeocodeAddress.html} {$form.doGeocodeAddress.label}<br />
@@ -68,7 +74,7 @@
         </tr>
       {/if}
 
-      {if $savedMapping}
+      {if array_key_exists('savedMapping', $form)}
         <tr class="crm-import-datasource-form-block-savedMapping">
           <td class="label"><label for="savedMapping">{$form.savedMapping.label}</label></td>
           <td>{$form.savedMapping.html}<br />
@@ -77,7 +83,7 @@
         </tr>
       {/if}
 
-      {if $form.disableUSPS}
+      {if array_key_exists('disableUSPS', $form)}
         <tr class="crm-import-datasource-form-block-disableUSPS">
           <td class="label"></td>
           <td>{$form.disableUSPS.html} <label for="disableUSPS">{$form.disableUSPS.label}</label><br />
diff --git a/civicrm/templates/CRM/Import/Form/DataSource.tpl b/civicrm/templates/CRM/Import/Form/DataSource.tpl
index c125ab8ec6..5da2f56a9f 100644
--- a/civicrm/templates/CRM/Import/Form/DataSource.tpl
+++ b/civicrm/templates/CRM/Import/Form/DataSource.tpl
@@ -24,21 +24,20 @@
   </div>
 
   <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
-    <table class="form-layout-compressed">
-      <tr class="crm-import-uploadfile-from-block-uploadFile">
-        <td class="label">{$form.uploadFile.label}</td>
-        <td class="html-adjust"> {$form.uploadFile.html}<br />
-          <span class="description">{ts}File format must be comma-separated-values (CSV).{/ts}</span>
-          <br /><span>{ts 1=$uploadSize}Maximum Upload File Size: %1 MB{/ts}</span>
-        </td>
+  <div id="choose-data-source" class="form-item">
+    <h3>{ts}Choose Data Source{/ts}</h3>
+    <table class="form-layout">
+      <tr class="crm-import-datasource-form-block-dataSource">
+        <td class="label">{$form.dataSource.label}</td>
+        <td>{$form.dataSource.html} {help id='data-source-selection'}</td>
       </tr>
-       <tr class="crm-import-uploadfile-from-block-skipColumnHeader">
-         <td class="label"></td><td>{$form.skipColumnHeader.html}{$form.skipColumnHeader.label}<br />
-           <span class="description">
-             {ts}Check this box if the first row of your file consists of field names (Example: 'Contact ID', 'Amount').{/ts}
-           </span>
-         </td>
-       </tr>
+    </table>
+  </div>
+
+    {* Data source form pane is injected here when the data source is selected. *}
+  <div id="data-source-form-block">
+  </div>
+    <table class="form-layout-compressed">
       {if array_key_exists('contactType', $form)}
         <tr class="crm-import-uploadfile-from-block-contactType">
           <td class="label">{$form.contactType.label}</td>
@@ -62,12 +61,8 @@
           <td><span>{$form.multipleCustomData.html}</span> </td>
         </tr>
       {/if}
-        <tr class="crm-import-datasource-form-block-fieldSeparator">
-          <td class="label">{$form.fieldSeparator.label} {help id='id-fieldSeparator' file='CRM/Contact/Import/Form/DataSource'}</td>
-          <td>{$form.fieldSeparator.html}</td>
-        </tr>
        <tr class="crm-import-uploadfile-form-block-date">{include file="CRM/Core/Date.tpl"}</tr>
-       {if $savedMapping}
+       {if array_key_exists('savedMapping', $form)}
          <tr class="crm-import-uploadfile-form-block-savedMapping">
            <td>{$form.savedMapping.label}</td>
            <td>{$form.savedMapping.html}<br />
@@ -79,5 +74,30 @@
     <div class="spacer"></div>
 
   <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
+{literal}
+  <script type="text/javascript">
+    CRM.$(function($) {
+      // build data source form block
+      buildDataSourceFormBlock();
+    });
+
+    function buildDataSourceFormBlock(dataSource) {
+      var dataUrl = {/literal}"{crmURL p=$urlPath h=0 q=$urlPathVar|smarty:nodefaults}"{literal};
+
+      if (!dataSource) {
+        var dataSource = CRM.$("#dataSource").val();
+      }
+
+      if (dataSource) {
+        dataUrl = dataUrl + '&dataSource=' + dataSource;
+      } else {
+        CRM.$("#data-source-form-block").html('');
+        return;
+      }
+
+      CRM.$("#data-source-form-block").load(dataUrl);
+    }
+  </script>
+{/literal}
 </div>
 
diff --git a/civicrm/vendor/autoload.php b/civicrm/vendor/autoload.php
index 509f64a097..06c26c107e 100644
--- a/civicrm/vendor/autoload.php
+++ b/civicrm/vendor/autoload.php
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit410203b279dc82f6c58837c34a858504::getLoader();
+return ComposerAutoloaderInit0a6d5998695b3b88d8c91af1ab91d6ad::getLoader();
diff --git a/civicrm/vendor/civicrm/composer-compile-lib/composer.json b/civicrm/vendor/civicrm/composer-compile-lib/composer.json
index 8756de640e..1d9ae896d0 100644
--- a/civicrm/vendor/civicrm/composer-compile-lib/composer.json
+++ b/civicrm/vendor/civicrm/composer-compile-lib/composer.json
@@ -26,7 +26,7 @@
     },
     "require": {
         "civicrm/composer-compile-plugin": "~0.19 || ~1.0",
-        "symfony/filesystem": "~2.8 || ~3.4 || ~4.0 || ~5.0",
+        "symfony/filesystem": "~2.8 || ~3.4 || ~4.0 || ~5.0 || ~6.0",
         "scssphp/scssphp": "^1.8.1",
         "padaliyajay/php-autoprefixer": "~1.2",
         "tubalmartin/cssmin": "^4.1"
diff --git a/civicrm/vendor/composer/autoload_real.php b/civicrm/vendor/composer/autoload_real.php
index 5d430f616a..7b36999685 100644
--- a/civicrm/vendor/composer/autoload_real.php
+++ b/civicrm/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInit410203b279dc82f6c58837c34a858504
+class ComposerAutoloaderInit0a6d5998695b3b88d8c91af1ab91d6ad
 {
     private static $loader;
 
@@ -24,9 +24,9 @@ class ComposerAutoloaderInit410203b279dc82f6c58837c34a858504
 
         require __DIR__ . '/platform_check.php';
 
-        spl_autoload_register(array('ComposerAutoloaderInit410203b279dc82f6c58837c34a858504', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInit0a6d5998695b3b88d8c91af1ab91d6ad', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
-        spl_autoload_unregister(array('ComposerAutoloaderInit410203b279dc82f6c58837c34a858504', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInit0a6d5998695b3b88d8c91af1ab91d6ad', 'loadClassLoader'));
 
         $includePaths = require __DIR__ . '/include_paths.php';
         $includePaths[] = get_include_path();
@@ -36,7 +36,7 @@ class ComposerAutoloaderInit410203b279dc82f6c58837c34a858504
         if ($useStaticLoader) {
             require __DIR__ . '/autoload_static.php';
 
-            call_user_func(\Composer\Autoload\ComposerStaticInit410203b279dc82f6c58837c34a858504::getInitializer($loader));
+            call_user_func(\Composer\Autoload\ComposerStaticInit0a6d5998695b3b88d8c91af1ab91d6ad::getInitializer($loader));
         } else {
             $map = require __DIR__ . '/autoload_namespaces.php';
             foreach ($map as $namespace => $path) {
@@ -57,12 +57,12 @@ class ComposerAutoloaderInit410203b279dc82f6c58837c34a858504
         $loader->register(true);
 
         if ($useStaticLoader) {
-            $includeFiles = Composer\Autoload\ComposerStaticInit410203b279dc82f6c58837c34a858504::$files;
+            $includeFiles = Composer\Autoload\ComposerStaticInit0a6d5998695b3b88d8c91af1ab91d6ad::$files;
         } else {
             $includeFiles = require __DIR__ . '/autoload_files.php';
         }
         foreach ($includeFiles as $fileIdentifier => $file) {
-            composerRequire410203b279dc82f6c58837c34a858504($fileIdentifier, $file);
+            composerRequire0a6d5998695b3b88d8c91af1ab91d6ad($fileIdentifier, $file);
         }
 
         return $loader;
@@ -74,7 +74,7 @@ class ComposerAutoloaderInit410203b279dc82f6c58837c34a858504
  * @param string $file
  * @return void
  */
-function composerRequire410203b279dc82f6c58837c34a858504($fileIdentifier, $file)
+function composerRequire0a6d5998695b3b88d8c91af1ab91d6ad($fileIdentifier, $file)
 {
     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
         $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
diff --git a/civicrm/vendor/composer/autoload_static.php b/civicrm/vendor/composer/autoload_static.php
index a8bb8680cb..252be81cf2 100644
--- a/civicrm/vendor/composer/autoload_static.php
+++ b/civicrm/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit410203b279dc82f6c58837c34a858504
+class ComposerStaticInit0a6d5998695b3b88d8c91af1ab91d6ad
 {
     public static $files = array (
         'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@@ -738,11 +738,11 @@ class ComposerStaticInit410203b279dc82f6c58837c34a858504
     public static function getInitializer(ClassLoader $loader)
     {
         return \Closure::bind(function () use ($loader) {
-            $loader->prefixLengthsPsr4 = ComposerStaticInit410203b279dc82f6c58837c34a858504::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = ComposerStaticInit410203b279dc82f6c58837c34a858504::$prefixDirsPsr4;
-            $loader->prefixesPsr0 = ComposerStaticInit410203b279dc82f6c58837c34a858504::$prefixesPsr0;
-            $loader->fallbackDirsPsr0 = ComposerStaticInit410203b279dc82f6c58837c34a858504::$fallbackDirsPsr0;
-            $loader->classMap = ComposerStaticInit410203b279dc82f6c58837c34a858504::$classMap;
+            $loader->prefixLengthsPsr4 = ComposerStaticInit0a6d5998695b3b88d8c91af1ab91d6ad::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInit0a6d5998695b3b88d8c91af1ab91d6ad::$prefixDirsPsr4;
+            $loader->prefixesPsr0 = ComposerStaticInit0a6d5998695b3b88d8c91af1ab91d6ad::$prefixesPsr0;
+            $loader->fallbackDirsPsr0 = ComposerStaticInit0a6d5998695b3b88d8c91af1ab91d6ad::$fallbackDirsPsr0;
+            $loader->classMap = ComposerStaticInit0a6d5998695b3b88d8c91af1ab91d6ad::$classMap;
 
         }, null, ClassLoader::class);
     }
diff --git a/civicrm/vendor/composer/installed.json b/civicrm/vendor/composer/installed.json
index 8f1e44814d..d391cf0e34 100644
--- a/civicrm/vendor/composer/installed.json
+++ b/civicrm/vendor/composer/installed.json
@@ -352,27 +352,27 @@
         },
         {
             "name": "civicrm/composer-compile-lib",
-            "version": "v0.6",
-            "version_normalized": "0.6.0.0",
+            "version": "v0.7",
+            "version_normalized": "0.7.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/civicrm/composer-compile-lib.git",
-                "reference": "8bd52f0d2ba97eaa83853c3cfc37841376f5b903"
+                "reference": "658230901ee3fc2830e9f93239a635a086b6816d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/civicrm/composer-compile-lib/zipball/8bd52f0d2ba97eaa83853c3cfc37841376f5b903",
-                "reference": "8bd52f0d2ba97eaa83853c3cfc37841376f5b903",
+                "url": "https://api.github.com/repos/civicrm/composer-compile-lib/zipball/658230901ee3fc2830e9f93239a635a086b6816d",
+                "reference": "658230901ee3fc2830e9f93239a635a086b6816d",
                 "shasum": ""
             },
             "require": {
                 "civicrm/composer-compile-plugin": "~0.19 || ~1.0",
                 "padaliyajay/php-autoprefixer": "~1.2",
                 "scssphp/scssphp": "^1.8.1",
-                "symfony/filesystem": "~2.8 || ~3.4 || ~4.0 || ~5.0",
+                "symfony/filesystem": "~2.8 || ~3.4 || ~4.0 || ~5.0 || ~6.0",
                 "tubalmartin/cssmin": "^4.1"
             },
-            "time": "2022-07-22T09:41:59+00:00",
+            "time": "2022-12-19T21:16:16+00:00",
             "type": "library",
             "extra": {
                 "compile": [
@@ -416,7 +416,7 @@
             "description": "Small library of compilation helpers",
             "support": {
                 "issues": "https://github.com/civicrm/composer-compile-lib/issues",
-                "source": "https://github.com/civicrm/composer-compile-lib/tree/v0.6"
+                "source": "https://github.com/civicrm/composer-compile-lib/tree/v0.7"
             },
             "install-path": "../civicrm/composer-compile-lib"
         },
@@ -531,17 +531,17 @@
         },
         {
             "name": "cweagans/composer-patches",
-            "version": "1.7.2",
-            "version_normalized": "1.7.2.0",
+            "version": "1.7.3",
+            "version_normalized": "1.7.3.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/cweagans/composer-patches.git",
-                "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871"
+                "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e9969cfc0796e6dea9b4e52f77f18e1065212871",
-                "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871",
+                "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db",
+                "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db",
                 "shasum": ""
             },
             "require": {
@@ -552,7 +552,7 @@
                 "composer/composer": "~1.0 || ~2.0",
                 "phpunit/phpunit": "~4.6"
             },
-            "time": "2022-01-25T19:21:20+00:00",
+            "time": "2022-12-20T22:53:13+00:00",
             "type": "composer-plugin",
             "extra": {
                 "class": "cweagans\\Composer\\Patches"
@@ -576,7 +576,7 @@
             "description": "Provides a way to patch Composer packages.",
             "support": {
                 "issues": "https://github.com/cweagans/composer-patches/issues",
-                "source": "https://github.com/cweagans/composer-patches/tree/1.7.2"
+                "source": "https://github.com/cweagans/composer-patches/tree/1.7.3"
             },
             "install-path": "../cweagans/composer-patches"
         },
@@ -644,17 +644,17 @@
         },
         {
             "name": "dompdf/dompdf",
-            "version": "v2.0.1",
-            "version_normalized": "2.0.1.0",
+            "version": "v2.0.2",
+            "version_normalized": "2.0.2.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/dompdf/dompdf.git",
-                "reference": "c5310df0e22c758c85ea5288175fc6cd777bc085"
+                "reference": "ad4c631bf8897fc1ca7b566468a969cfd71a558a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/c5310df0e22c758c85ea5288175fc6cd777bc085",
-                "reference": "c5310df0e22c758c85ea5288175fc6cd777bc085",
+                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/ad4c631bf8897fc1ca7b566468a969cfd71a558a",
+                "reference": "ad4c631bf8897fc1ca7b566468a969cfd71a558a",
                 "shasum": ""
             },
             "require": {
@@ -678,7 +678,7 @@
                 "ext-imagick": "Improves image processing performance",
                 "ext-zlib": "Needed for pdf stream compression"
             },
-            "time": "2022-09-22T13:43:41+00:00",
+            "time": "2023-01-31T13:30:40+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
@@ -703,7 +703,7 @@
             "homepage": "https://github.com/dompdf/dompdf",
             "support": {
                 "issues": "https://github.com/dompdf/dompdf/issues",
-                "source": "https://github.com/dompdf/dompdf/tree/v2.0.1"
+                "source": "https://github.com/dompdf/dompdf/tree/v2.0.2"
             },
             "install-path": "../dompdf/dompdf"
         },
@@ -1848,17 +1848,17 @@
         },
         {
             "name": "masterminds/html5",
-            "version": "2.7.5",
-            "version_normalized": "2.7.5.0",
+            "version": "2.7.6",
+            "version_normalized": "2.7.6.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Masterminds/html5-php.git",
-                "reference": "f640ac1bdddff06ea333a920c95bbad8872429ab"
+                "reference": "897eb517a343a2281f11bc5556d6548db7d93947"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f640ac1bdddff06ea333a920c95bbad8872429ab",
-                "reference": "f640ac1bdddff06ea333a920c95bbad8872429ab",
+                "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/897eb517a343a2281f11bc5556d6548db7d93947",
+                "reference": "897eb517a343a2281f11bc5556d6548db7d93947",
                 "shasum": ""
             },
             "require": {
@@ -1870,7 +1870,7 @@
             "require-dev": {
                 "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7"
             },
-            "time": "2021-07-01T14:25:37+00:00",
+            "time": "2022-08-18T16:18:26+00:00",
             "type": "library",
             "extra": {
                 "branch-alias": {
@@ -1914,7 +1914,7 @@
             ],
             "support": {
                 "issues": "https://github.com/Masterminds/html5-php/issues",
-                "source": "https://github.com/Masterminds/html5-php/tree/2.7.5"
+                "source": "https://github.com/Masterminds/html5-php/tree/2.7.6"
             },
             "install-path": "../masterminds/html5"
         },
@@ -2811,28 +2811,28 @@
         },
         {
             "name": "phenx/php-svg-lib",
-            "version": "0.4.1",
-            "version_normalized": "0.4.1.0",
+            "version": "0.5.0",
+            "version_normalized": "0.5.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/dompdf/php-svg-lib.git",
-                "reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02"
+                "reference": "76876c6cf3080bcb6f249d7d59705108166a6685"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/4498b5df7b08e8469f0f8279651ea5de9626ed02",
-                "reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02",
+                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/76876c6cf3080bcb6f249d7d59705108166a6685",
+                "reference": "76876c6cf3080bcb6f249d7d59705108166a6685",
                 "shasum": ""
             },
             "require": {
                 "ext-mbstring": "*",
-                "php": "^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0",
+                "php": "^7.1 || ^8.0",
                 "sabberworm/php-css-parser": "^8.4"
             },
             "require-dev": {
                 "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
             },
-            "time": "2022-03-07T12:52:04+00:00",
+            "time": "2022-09-06T12:16:56+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
@@ -2854,7 +2854,7 @@
             "homepage": "https://github.com/PhenX/php-svg-lib",
             "support": {
                 "issues": "https://github.com/dompdf/php-svg-lib/issues",
-                "source": "https://github.com/dompdf/php-svg-lib/tree/0.4.1"
+                "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.0"
             },
             "install-path": "../phenx/php-svg-lib"
         },
diff --git a/civicrm/vendor/composer/installed.php b/civicrm/vendor/composer/installed.php
index 6945361790..fa86928f8c 100644
--- a/civicrm/vendor/composer/installed.php
+++ b/civicrm/vendor/composer/installed.php
@@ -1,11 +1,11 @@
 <?php return array(
     'root' => array(
-        'pretty_version' => '5.57.x-dev',
-        'version' => '5.57.9999999.9999999-dev',
+        'pretty_version' => '5.58.x-dev',
+        'version' => '5.58.9999999.9999999-dev',
         'type' => 'library',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
-        'reference' => 'fdf3573185d42552e69e72e803acfaab5b072997',
+        'reference' => 'cd24acea9d5cf85df3b0fe54fc5cadfcf60a8cef',
         'name' => 'civicrm/civicrm-core',
         'dev' => true,
     ),
@@ -56,12 +56,12 @@
             'dev_requirement' => false,
         ),
         'civicrm/civicrm-core' => array(
-            'pretty_version' => '5.57.x-dev',
-            'version' => '5.57.9999999.9999999-dev',
+            'pretty_version' => '5.58.x-dev',
+            'version' => '5.58.9999999.9999999-dev',
             'type' => 'library',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
-            'reference' => 'fdf3573185d42552e69e72e803acfaab5b072997',
+            'reference' => 'cd24acea9d5cf85df3b0fe54fc5cadfcf60a8cef',
             'dev_requirement' => false,
         ),
         'civicrm/civicrm-cxn-rpc' => array(
@@ -74,12 +74,12 @@
             'dev_requirement' => false,
         ),
         'civicrm/composer-compile-lib' => array(
-            'pretty_version' => 'v0.6',
-            'version' => '0.6.0.0',
+            'pretty_version' => 'v0.7',
+            'version' => '0.7.0.0',
             'type' => 'library',
             'install_path' => __DIR__ . '/../civicrm/composer-compile-lib',
             'aliases' => array(),
-            'reference' => '8bd52f0d2ba97eaa83853c3cfc37841376f5b903',
+            'reference' => '658230901ee3fc2830e9f93239a635a086b6816d',
             'dev_requirement' => false,
         ),
         'civicrm/composer-compile-plugin' => array(
@@ -101,12 +101,12 @@
             'dev_requirement' => false,
         ),
         'cweagans/composer-patches' => array(
-            'pretty_version' => '1.7.2',
-            'version' => '1.7.2.0',
+            'pretty_version' => '1.7.3',
+            'version' => '1.7.3.0',
             'type' => 'composer-plugin',
             'install_path' => __DIR__ . '/../cweagans/composer-patches',
             'aliases' => array(),
-            'reference' => 'e9969cfc0796e6dea9b4e52f77f18e1065212871',
+            'reference' => 'e190d4466fe2b103a55467dfa83fc2fecfcaf2db',
             'dev_requirement' => false,
         ),
         'dflydev/apache-mime-types' => array(
@@ -119,12 +119,12 @@
             'dev_requirement' => false,
         ),
         'dompdf/dompdf' => array(
-            'pretty_version' => 'v2.0.1',
-            'version' => '2.0.1.0',
+            'pretty_version' => 'v2.0.2',
+            'version' => '2.0.2.0',
             'type' => 'library',
             'install_path' => __DIR__ . '/../dompdf/dompdf',
             'aliases' => array(),
-            'reference' => 'c5310df0e22c758c85ea5288175fc6cd777bc085',
+            'reference' => 'ad4c631bf8897fc1ca7b566468a969cfd71a558a',
             'dev_requirement' => false,
         ),
         'ezyang/htmlpurifier' => array(
@@ -269,12 +269,12 @@
             'dev_requirement' => false,
         ),
         'masterminds/html5' => array(
-            'pretty_version' => '2.7.5',
-            'version' => '2.7.5.0',
+            'pretty_version' => '2.7.6',
+            'version' => '2.7.6.0',
             'type' => 'library',
             'install_path' => __DIR__ . '/../masterminds/html5',
             'aliases' => array(),
-            'reference' => 'f640ac1bdddff06ea333a920c95bbad8872429ab',
+            'reference' => '897eb517a343a2281f11bc5556d6548db7d93947',
             'dev_requirement' => false,
         ),
         'myclabs/php-enum' => array(
@@ -413,12 +413,12 @@
             'dev_requirement' => false,
         ),
         'phenx/php-svg-lib' => array(
-            'pretty_version' => '0.4.1',
-            'version' => '0.4.1.0',
+            'pretty_version' => '0.5.0',
+            'version' => '0.5.0.0',
             'type' => 'library',
             'install_path' => __DIR__ . '/../phenx/php-svg-lib',
             'aliases' => array(),
-            'reference' => '4498b5df7b08e8469f0f8279651ea5de9626ed02',
+            'reference' => '76876c6cf3080bcb6f249d7d59705108166a6685',
             'dev_requirement' => false,
         ),
         'phpoffice/phpspreadsheet' => array(
diff --git a/civicrm/vendor/composer/platform_check.php b/civicrm/vendor/composer/platform_check.php
index a8b98d5ceb..92370c5a0c 100644
--- a/civicrm/vendor/composer/platform_check.php
+++ b/civicrm/vendor/composer/platform_check.php
@@ -4,8 +4,8 @@
 
 $issues = array();
 
-if (!(PHP_VERSION_ID >= 70205)) {
-    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.';
+if (!(PHP_VERSION_ID >= 70300)) {
+    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.';
 }
 
 if ($issues) {
diff --git a/civicrm/vendor/cweagans/composer-patches/src/Patches.php b/civicrm/vendor/cweagans/composer-patches/src/Patches.php
index 52e4203a96..3d7d864a2e 100644
--- a/civicrm/vendor/cweagans/composer-patches/src/Patches.php
+++ b/civicrm/vendor/cweagans/composer-patches/src/Patches.php
@@ -48,6 +48,11 @@ class Patches implements PluginInterface, EventSubscriberInterface {
    */
   protected $patches;
 
+  /**
+   * @var array $installedPatches
+   */
+  protected $installedPatches;
+
   /**
    * Apply plugin modifications to composer
    *
diff --git a/civicrm/vendor/dompdf/dompdf/VERSION b/civicrm/vendor/dompdf/dompdf/VERSION
index 38f77a65b3..e9307ca575 100644
--- a/civicrm/vendor/dompdf/dompdf/VERSION
+++ b/civicrm/vendor/dompdf/dompdf/VERSION
@@ -1 +1 @@
-2.0.1
+2.0.2
diff --git a/civicrm/vendor/dompdf/dompdf/lib/Cpdf.php b/civicrm/vendor/dompdf/dompdf/lib/Cpdf.php
index 27bfa29815..0bbb74d153 100644
--- a/civicrm/vendor/dompdf/dompdf/lib/Cpdf.php
+++ b/civicrm/vendor/dompdf/dompdf/lib/Cpdf.php
@@ -4220,9 +4220,9 @@ EOT;
         $this->addContent(sprintf("\n%.3F %.3F %.3F %.3F re", $x1, $y1, $width, $height));
     }
 
-    function stroke()
+    function stroke(bool $close = false)
     {
-        $this->addContent("\nS");
+        $this->addContent("\n" . ($close ? "s" : "S"));
     }
 
     function fill()
@@ -4230,9 +4230,9 @@ EOT;
         $this->addContent("\nf" . ($this->fillRule === "evenodd" ? "*" : ""));
     }
 
-    function fillStroke()
+    function fillStroke(bool $close = false)
     {
-        $this->addContent("\nb" . ($this->fillRule === "evenodd" ? "*" : ""));
+        $this->addContent("\n" . ($close ? "b" : "B") . ($this->fillRule === "evenodd" ? "*" : ""));
     }
 
     /**
diff --git a/civicrm/vendor/dompdf/dompdf/lib/res/html.css b/civicrm/vendor/dompdf/dompdf/lib/res/html.css
index 89dcde633c..b3aae08bd6 100644
--- a/civicrm/vendor/dompdf/dompdf/lib/res/html.css
+++ b/civicrm/vendor/dompdf/dompdf/lib/res/html.css
@@ -10,7 +10,7 @@
  * @license http://mozilla.org/MPL/2.0/ Mozilla Public License, v. 2.0
  *
  * Portions from W3C
- * @link https://drafts.csswg.org/css-ui-3/#default-style-sheet
+ * @link https://www.w3.org/TR/css-ui-3/#default-style-sheet
  *
  */
 
@@ -219,11 +219,11 @@ th {
 
 /* inlines */
 
-q:before {
+q::before {
   content: open-quote;
 }
 
-q:after {
+q::after {
   content: close-quote;
 }
 
@@ -307,7 +307,7 @@ li {
   display: list-item;
 }
 
-/*li:before {
+/*li::before {
   display: -dompdf-list-bullet !important;
   content: counter(-dompdf-default-counter) ". ";
   padding-right: 0.5em;
@@ -339,7 +339,7 @@ li {
 }
 
 /* forms */
-/* From https://drafts.csswg.org/css-ui-3/#default-style-sheet */
+/* From https://www.w3.org/TR/css-ui-3/#default-style-sheet */
 form {
   display: block;
 }
@@ -383,18 +383,18 @@ input[type=file] {
   width: 8em;
 }
 
-input[type=text]:before,
-input[type=button]:before,
-input[type=submit]:before,
-input[type=reset]:before {
+input[type=text]::before,
+input[type=button]::before,
+input[type=submit]::before,
+input[type=reset]::before {
   content: attr(value);
 }
 
-input[type=file]:before {
+input[type=file]::before {
   content: "Choose a file";
 }
 
-input[type=password][value]:before {
+input[type=password][value]::before {
   font-family: "DejaVu Sans" !important;
   content: "\2022\2022\2022\2022\2022\2022\2022\2022";
   line-height: 1em;
@@ -402,25 +402,25 @@ input[type=password][value]:before {
 
 input[type=checkbox],
 input[type=radio],
-select:after {
+select::after {
   font-family: "DejaVu Sans" !important;
   font-size: 18px;
   line-height: 1;
 }
 
-input[type=checkbox]:before {
+input[type=checkbox]::before {
   content: "\2610";
 }
 
-input[type=checkbox][checked]:before {
+input[type=checkbox][checked]::before {
   content: "\2611";
 }
 
-input[type=radio]:before {
+input[type=radio]::before {
   content: "\25CB";
 }
 
-input[type=radio][checked]:before {
+input[type=radio][checked]::before {
   content: "\25C9";
 }
 
@@ -438,7 +438,7 @@ select {
   overflow: hidden!important;
 }
 
-select:after {
+select::after {
   position: absolute;
   right: 0;
   top: 0;
diff --git a/civicrm/vendor/dompdf/dompdf/src/Adapter/CPDF.php b/civicrm/vendor/dompdf/dompdf/src/Adapter/CPDF.php
index e8fc6ae4d7..13802b6c06 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Adapter/CPDF.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Adapter/CPDF.php
@@ -155,7 +155,7 @@ class CPDF implements Canvas
      */
     protected $_current_opacity = 1;
 
-    public function __construct($paper = "letter", $orientation = "portrait", ?Dompdf $dompdf = null)
+    public function __construct($paper = "letter", string $orientation = "portrait", ?Dompdf $dompdf = null)
     {
         if (is_array($paper)) {
             $size = array_map("floatval", $paper);
diff --git a/civicrm/vendor/dompdf/dompdf/src/Adapter/GD.php b/civicrm/vendor/dompdf/dompdf/src/Adapter/GD.php
index 8c10e4766a..269beb9ff6 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Adapter/GD.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Adapter/GD.php
@@ -106,7 +106,7 @@ class GD implements Canvas
     /**
      * Background color array
      *
-     * @var int
+     * @var array
      */
     protected $_bg_color_array;
 
@@ -131,11 +131,11 @@ class GD implements Canvas
      * @param string|float[] $paper       The paper size to use as either a standard paper size (see {@link CPDF::$PAPER_SIZES}) or
      *                                    an array of the form `[x1, y1, x2, y2]` (typically `[0, 0, width, height]`).
      * @param string         $orientation The paper orientation, either `portrait` or `landscape`.
-     * @param Dompdf         $dompdf      The Dompdf instance.
+     * @param Dompdf|null    $dompdf      The Dompdf instance.
      * @param float          $aa_factor   Anti-aliasing factor, 1 for no AA
      * @param array          $bg_color    Image background color: array(r,g,b,a), 0 <= r,g,b,a <= 1
      */
-    public function __construct($paper = "letter", $orientation = "portrait", ?Dompdf $dompdf = null, $aa_factor = 1.0, $bg_color = [1, 1, 1, 0])
+    public function __construct($paper = "letter", string $orientation = "portrait", ?Dompdf $dompdf = null, float $aa_factor = 1.0, array $bg_color = [1, 1, 1, 0])
     {
         if (is_array($paper)) {
             $size = array_map("floatval", $paper);
diff --git a/civicrm/vendor/dompdf/dompdf/src/Adapter/PDFLib.php b/civicrm/vendor/dompdf/dompdf/src/Adapter/PDFLib.php
index ee5ae8dd27..6467cf1a98 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Adapter/PDFLib.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Adapter/PDFLib.php
@@ -187,7 +187,7 @@ class PDFLib implements Canvas
      */
     protected $_pages;
 
-    public function __construct($paper = "letter", $orientation = "portrait", ?Dompdf $dompdf = null)
+    public function __construct($paper = "letter", string $orientation = "portrait", ?Dompdf $dompdf = null)
     {
         if (is_array($paper)) {
             $size = array_map("floatval", $paper);
diff --git a/civicrm/vendor/dompdf/dompdf/src/Canvas.php b/civicrm/vendor/dompdf/dompdf/src/Canvas.php
index 1812def58e..a3b486cca7 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Canvas.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Canvas.php
@@ -25,9 +25,9 @@ interface Canvas
      * @param string|float[] $paper       The paper size to use as either a standard paper size (see {@link Dompdf\Adapter\CPDF::$PAPER_SIZES})
      *                                    or an array of the form `[x1, y1, x2, y2]` (typically `[0, 0, width, height]`).
      * @param string         $orientation The paper orientation, either `portrait` or `landscape`.
-     * @param Dompdf         $dompdf      The Dompdf instance.
+     * @param Dompdf|null    $dompdf      The Dompdf instance.
      */
-    public function __construct($paper = "letter", $orientation = "portrait", ?Dompdf $dompdf = null);
+    public function __construct($paper = "letter", string $orientation = "portrait", ?Dompdf $dompdf = null);
 
     /**
      * @return Dompdf
diff --git a/civicrm/vendor/dompdf/dompdf/src/CanvasFactory.php b/civicrm/vendor/dompdf/dompdf/src/CanvasFactory.php
index 86352e1dc3..d89320c145 100644
--- a/civicrm/vendor/dompdf/dompdf/src/CanvasFactory.php
+++ b/civicrm/vendor/dompdf/dompdf/src/CanvasFactory.php
@@ -24,14 +24,14 @@ class CanvasFactory
     }
 
     /**
-     * @param Dompdf $dompdf
-     * @param string|array $paper
-     * @param string $orientation
-     * @param string $class
+     * @param Dompdf         $dompdf
+     * @param string|float[] $paper
+     * @param string         $orientation
+     * @param string|null    $class
      *
      * @return Canvas
      */
-    static function get_instance(Dompdf $dompdf, $paper = null, $orientation = null, $class = null)
+    static function get_instance(Dompdf $dompdf, $paper, string $orientation, ?string $class = null)
     {
         $backend = strtolower($dompdf->getOptions()->getPdfBackend());
 
diff --git a/civicrm/vendor/dompdf/dompdf/src/Css/Stylesheet.php b/civicrm/vendor/dompdf/dompdf/src/Css/Stylesheet.php
index 20e019ab02..6bb88137df 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Css/Stylesheet.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Css/Stylesheet.php
@@ -86,7 +86,7 @@ class Stylesheet
     /**
      * Array of currently defined styles
      *
-     * @var Style[]
+     * @var Style[][]
      */
     private $_styles;
 
@@ -368,42 +368,41 @@ class Stylesheet
     }
 
     /**
-     * @link http://www.w3.org/TR/CSS21/cascade.html#specificity
+     * @link https://www.w3.org/TR/CSS21/cascade.html#specificity
      *
      * @param string $selector
-     * @param int $origin :
+     * @param int    $origin
      *    - Stylesheet::ORIG_UA: user agent style sheet
      *    - Stylesheet::ORIG_USER: user style sheet
      *    - Stylesheet::ORIG_AUTHOR: author style sheet
      *
      * @return int
      */
-    private function _specificity($selector, $origin = self::ORIG_AUTHOR)
+    protected function specificity(string $selector, int $origin = self::ORIG_AUTHOR): int
     {
-        // http://www.w3.org/TR/CSS21/cascade.html#specificity
-        // ignoring the ":" pseudoclass modifiers
-        // also ignored in _css_selector_to_xpath
-
         $a = ($selector === "!attr") ? 1 : 0;
 
         $b = min(mb_substr_count($selector, "#"), 255);
 
         $c = min(mb_substr_count($selector, ".") +
-            mb_substr_count($selector, "["), 255);
+            mb_substr_count($selector, "[") +
+            mb_substr_count($selector, ":") -
+            2 * mb_substr_count($selector, "::"), 255);
 
         $d = min(mb_substr_count($selector, " ") +
             mb_substr_count($selector, ">") +
             mb_substr_count($selector, "+") +
             mb_substr_count($selector, "~") -
-            mb_substr_count($selector, "~="), 255);
+            mb_substr_count($selector, "~=") +
+            mb_substr_count($selector, "::"), 255);
 
         //If a normal element name is at the beginning of the string,
         //a leading whitespace might have been removed on whitespace collapsing and removal
         //therefore there might be one whitespace less as selected element names
         //this can lead to a too small specificity
-        //see _css_selector_to_xpath
+        //see selectorToXpath
 
-        if (!in_array($selector[0], [" ", ">", ".", "#", "+", "~", ":", "["]) && $selector !== "*") {
+        if (!in_array($selector[0], [" ", ">", ".", "#", "+", "~", ":", "["], true) && $selector !== "*") {
             $d++;
         }
 
@@ -411,7 +410,7 @@ class Stylesheet
             /*DEBUGCSS*/
             print "<pre>\n";
             /*DEBUGCSS*/
-            printf("_specificity(): 0x%08x \"%s\"\n", self::$_stylesheet_origins[$origin] + (($a << 24) | ($b << 16) | ($c << 8) | ($d)), $selector);
+            printf("specificity(): 0x%08x \"%s\"\n", self::$_stylesheet_origins[$origin] + (($a << 24) | ($b << 16) | ($c << 8) | ($d)), $selector);
             /*DEBUGCSS*/
             print "</pre>";
         }
@@ -423,45 +422,35 @@ class Stylesheet
      * Converts a CSS selector to an XPath query.
      *
      * @param string $selector
-     * @param bool $first_pass
+     * @param bool   $firstPass
      *
-     * @throws Exception
-     * @return array
+     * @return array|null
      */
-    private function _css_selector_to_xpath(string $selector, bool $first_pass = false): array
+    protected function selectorToXpath(string $selector, bool $firstPass = false): ?array
     {
         // Collapse white space and strip whitespace around delimiters
         //$search = array("/\\s+/", "/\\s+([.>#+:])\\s+/");
         //$replace = array(" ", "\\1");
         //$selector = preg_replace($search, $replace, trim($selector));
 
-        // Initial query (non-absolute)
-        $query = "//";
+        // Initial query, always expanded to // below (non-absolute)
+        $query = "/";
 
         // Will contain :before and :after
         $pseudo_elements = [];
 
-        // Will contain :link, etc
-        $pseudo_classes = [];
-
         // Parse the selector
         //$s = preg_split("/([ :>.#+])/", $selector, -1, PREG_SPLIT_DELIM_CAPTURE);
 
         $delimiters = [" ", ">", ".", "#", "+", "~", ":", "[", "("];
 
-        // Add an implicit * at the beginning of the selector
-        // if it begins with an attribute selector
-        if ($selector[0] === "[") {
-            $selector = "*$selector";
-        }
-
         // Add an implicit space at the beginning of the selector if there is no
         // delimiter there already.
-        if (!in_array($selector[0], $delimiters)) {
+        if (!in_array($selector[0], $delimiters, true)) {
             $selector = " $selector";
         }
 
-        $tok = "";
+        $name = "*";
         $len = mb_strlen($selector);
         $i = 0;
 
@@ -479,7 +468,7 @@ class Stylesheet
                 $c = $selector[$i];
                 $c_prev = $selector[$i - 1];
 
-                if (!$in_func && !$in_attr && in_array($c, $delimiters) && !(($c == $c_prev) == ":")) {
+                if (!$in_func && !$in_attr && in_array($c, $delimiters, true) && !($c === $c_prev && $c === ":")) {
                     break;
                 }
 
@@ -506,77 +495,71 @@ class Stylesheet
 
                 case " ":
                 case ">":
-                    // All elements matching the next token that are direct children of
-                    // the current token
+                    // All elements matching the next token that are descendants
+                    // or children of the current token
+                    // https://www.w3.org/TR/selectors-3/#descendant-combinators
+                    // https://www.w3.org/TR/selectors-3/#child-combinators
                     $expr = $s === " " ? "descendant" : "child";
 
-                    if (mb_substr($query, -1, 1) !== "/") {
-                        $query .= "/";
-                    }
-
                     // Tag names are case-insensitive
-                    $tok = strtolower($tok);
-
-                    if (!$tok) {
-                        $tok = "*";
-                    }
-
-                    $query .= "$expr::$tok";
-                    $tok = "";
+                    $name = $tok === "" ? "*" : strtolower($tok);
+                    $query .= "/$expr::$name";
                     break;
 
-                case ".":
-                case "#":
-                    // All elements matching the current token with a class/id equal to
-                    // the _next_ token.
+                case "+":
+                    // Next-sibling combinator
+                    // https://www.w3.org/TR/selectors-3/#sibling-combinators
 
-                    $attr = $s === "." ? "class" : "id";
+                    // Tag names are case-insensitive
+                    $name = $tok === "" ? "*" : strtolower($tok);
+                    $query .= "/following-sibling::*[1]";
 
-                    // empty class/id == *
-                    if (mb_substr($query, -1, 1) === "/") {
-                        $query .= "*";
+                    if ($name !== "*") {
+                        $query .= "[name() = '$name']";
                     }
-
-                    // Match multiple classes: $tok contains the current selected
-                    // class.  Search for class attributes with class="$tok",
-                    // class=".* $tok .*" and class=".* $tok"
-
-                    // This doesn't work because libxml only supports XPath 1.0...
-                    //$query .= "[matches(@$attr,\"^{$tok}\$|^{$tok}[ ]+|[ ]+{$tok}\$|[ ]+{$tok}[ ]+\")]";
-
-                    $query .= "[contains(concat(' ', normalize-space(@$attr), ' '), concat(' ', '$tok', ' '))]";
-                    $tok = "";
                     break;
 
-                case "+":
                 case "~":
-                    // Next-sibling combinator
                     // Subsequent-sibling combinator
                     // https://www.w3.org/TR/selectors-3/#sibling-combinators
-                    if (mb_substr($query, -1, 1) !== "/") {
-                        $query .= "/";
-                    }
 
                     // Tag names are case-insensitive
-                    $tok = strtolower($tok);
+                    $name = $tok === "" ? "*" : strtolower($tok);
+                    $query .= "/following-sibling::$name";
+                    break;
 
-                    if (!$tok) {
-                        $tok = "*";
+                case "#":
+                    // All elements matching the current token with id equal
+                    // to the _next_ token
+                    // https://www.w3.org/TR/selectors-3/#id-selectors
+                    if ($query === "/") {
+                        $query .= "/*";
                     }
 
-                    $query .= "following-sibling::$tok";
+                    $query .= "[@id=\"$tok\"]";
+                    break;
 
-                    if ($s === "+") {
-                        $query .= "[1]";
+                case ".":
+                    // All elements matching the current token with a class
+                    // equal to the _next_ token
+                    // https://www.w3.org/TR/selectors-3/#class-html
+                    if ($query === "/") {
+                        $query .= "/*";
                     }
 
-                    $tok = "";
+                    // Match multiple classes: $tok contains the current selected
+                    // class.  Search for class attributes with class="$tok",
+                    // class=".* $tok .*" and class=".* $tok"
+
+                    // This doesn't work because libxml only supports XPath 1.0...
+                    //$query .= "[matches(@$attr,\"^{$tok}\$|^{$tok}[ ]+|[ ]+{$tok}\$|[ ]+{$tok}[ ]+\")]";
+
+                    $query .= "[contains(concat(' ', normalize-space(@class), ' '), concat(' ', '$tok', ' '))]";
                     break;
 
                 case ":":
-                    $i2 = $i - strlen($tok) - 2; // the char before ":"
-                    if (($i2 < 0 || !isset($selector[$i2]) || (in_array($selector[$i2], $delimiters) && $selector[$i2] != ":")) && substr($query, -1) != "*") {
-                        $query .= "*";
+                    if ($query === "/") {
+                        $query .= "/*";
                     }
 
                     $last = false;
@@ -584,98 +567,75 @@ class Stylesheet
                     // Pseudo-classes
                     switch ($tok) {
 
+                        case "root":
+                            $query .= "[not(parent::*)]";
+                            break;
+
                         case "first-child":
                             $query .= "[not(preceding-sibling::*)]";
-                            $tok = "";
                             break;
 
                         case "last-child":
                             $query .= "[not(following-sibling::*)]";
-                            $tok = "";
                             break;
 
+                        case "only-child":
+                            $query .= "[not(preceding-sibling::*) and not(following-sibling::*)]";
+                            break;
+
+                        // https://www.w3.org/TR/selectors-3/#nth-child-pseudo
+                        /** @noinspection PhpMissingBreakStatementInspection */
+                        case "nth-last-child":
+                            $last = true;
+                        case "nth-child":
+                            $p = $i + 1;
+                            $nth = trim(mb_substr($selector, $p, strpos($selector, ")", $i) - $p));
+                            $position = $last
+                                ? "(count(following-sibling::*) + 1)"
+                                : "(count(preceding-sibling::*) + 1)";
+
+                            $condition = $this->selectorAnPlusB($nth, $position);
+                            $query .= "[$condition]";
+                            break;
+
+                        // TODO: `*:first-of-type`, `*:nth-of-type` etc.
+                        // (without fixed element name) are treated equivalent
+                        // to their `:*-child` counterparts here. They might
+                        // not be properly expressible in XPath 1.0
                         case "first-of-type":
-                            $query .= "[position() = 1]";
-                            $tok = "";
+                            $query .= "[not(preceding-sibling::$name)]";
                             break;
 
                         case "last-of-type":
-                            $query .= "[position() = last()]";
-                            $tok = "";
+                            $query .= "[not(following-sibling::$name)]";
                             break;
 
-                        // an+b, n, odd, and even
+                        case "only-of-type":
+                            $query .= "[not(preceding-sibling::$name) and not(following-sibling::$name)]";
+                            break;
+
+                        // https://www.w3.org/TR/selectors-3/#nth-of-type-pseudo
                         /** @noinspection PhpMissingBreakStatementInspection */
                         case "nth-last-of-type":
                             $last = true;
                         case "nth-of-type":
-                            //FIXME: this fix-up is pretty ugly, would parsing the selector in reverse work better generally?
-                            $descendant_delimeter = strrpos($query, "::");
-                            $isChild = substr($query, $descendant_delimeter-5, 5) == "child";
-                            $el = substr($query, $descendant_delimeter+2);
-                            $query = substr($query, 0, strrpos($query, "/")) . ($isChild ? "/" : "//") . $el;
-
-                            $pseudo_classes[$tok] = true;
                             $p = $i + 1;
                             $nth = trim(mb_substr($selector, $p, strpos($selector, ")", $i) - $p));
-                            $position = $last ? "(last()-position()+1)" : "position()";
-
-                            // 1
-                            if (preg_match("/^\d+$/", $nth)) {
-                                $condition = "$position = $nth";
-                            } // odd
-                            elseif ($nth === "odd") {
-                                $condition = "($position mod 2) = 1";
-                            } // even
-                            elseif ($nth === "even") {
-                                $condition = "($position mod 2) = 0";
-                            } // an+b
-                            else {
-                                $condition = $this->_selector_an_plus_b($nth, $last);
-                            }
+                            $position = $last
+                                ? "(count(following-sibling::$name) + 1)"
+                                : "(count(preceding-sibling::$name) + 1)";
 
+                            $condition = $this->selectorAnPlusB($nth, $position);
                             $query .= "[$condition]";
-                            $tok = "";
                             break;
-                        /** @noinspection PhpMissingBreakStatementInspection */
-                        case "nth-last-child":
-                            $last = true;
-                        case "nth-child":
-                            //FIXME: this fix-up is pretty ugly, would parsing the selector in reverse work better generally?
-                            $descendant_delimeter = strrpos($query, "::");
-                            $isChild = substr($query, $descendant_delimeter-5, 5) == "child";
-                            $el = substr($query, $descendant_delimeter+2);
-                            $query = substr($query, 0, strrpos($query, "/")) . ($isChild ? "/" : "//") . "*";
 
-                            $pseudo_classes[$tok] = true;
-                            $p = $i + 1;
-                            $nth = trim(mb_substr($selector, $p, strpos($selector, ")", $i) - $p));
-                            $position = $last ? "(last()-position()+1)" : "position()";
-
-                            // 1
-                            if (preg_match("/^\d+$/", $nth)) {
-                                $condition = "$position = $nth";
-                            } // odd
-                            elseif ($nth === "odd") {
-                                $condition = "($position mod 2) = 1";
-                            } // even
-                            elseif ($nth === "even") {
-                                $condition = "($position mod 2) = 0";
-                            } // an+b
-                            else {
-                                $condition = $this->_selector_an_plus_b($nth, $last);
-                            }
-
-                            $query .= "[$condition]";
-                            if ($el != "*") {
-                                $query .= "[name() = '$el']";
-                            }
-                            $tok = "";
+                        // https://www.w3.org/TR/selectors-4/#empty-pseudo
+                        case "empty":
+                            $query .= "[not(*) and not(normalize-space())]";
                             break;
 
-                        //TODO: bit of a hack attempt at matches support, currently only matches against elements
+                        // TODO: bit of a hack attempt at matches support, currently only matches against elements
                         case "matches":
-                            $pseudo_classes[$tok] = true;
                             $p = $i + 1;
                             $matchList = trim(mb_substr($selector, $p, strpos($selector, ")", $i) - $p));
 
@@ -686,74 +646,73 @@ class Stylesheet
                             }
 
                             $query .= "[" . implode(" or ", $elements) . "]";
-                            $tok = "";
                             break;
 
+                        // https://www.w3.org/TR/selectors-3/#UIstates
+                        case "disabled":
+                        case "checked":
+                            $query .= "[@$tok]";
+                            break;
+
+                        case "enabled":
+                            $query .= "[not(@disabled)]";
+                            break;
+
+                        // https://www.w3.org/TR/selectors-3/#dynamic-pseudos
+                        // https://www.w3.org/TR/selectors-4/#the-any-link-pseudo
                         case "link":
+                        case "any-link":
                             $query .= "[@href]";
-                            $tok = "";
                             break;
 
+                        // N/A
+                        case "visited":
+                        case "hover":
+                        case "active":
+                        case "focus":
+                        case "focus-visible":
+                        case "focus-within":
+                            $query .= "[false()]";
+                            break;
+
+                        // https://www.w3.org/TR/selectors-3/#first-line
+                        // https://www.w3.org/TR/selectors-3/#first-letter
                         case "first-line":
                         case ":first-line":
                         case "first-letter":
                         case ":first-letter":
                             // TODO
-                            $el = trim($tok, ":");
+                            $el = ltrim($tok, ":");
                             $pseudo_elements[$el] = true;
                             break;
 
-                            // N/A
-                        case "focus":
-                        case "active":
-                        case "hover":
-                        case "visited":
-                            $query .= "[false()]";
-                            $tok = "";
-                            break;
-
-                        /* Pseudo-elements */
+                        // https://www.w3.org/TR/selectors-3/#gen-content
                         case "before":
                         case ":before":
                         case "after":
                         case ":after":
-                            $pos = trim($tok, ":");
+                            $pos = ltrim($tok, ":");
                             $pseudo_elements[$pos] = true;
-                            if (!$first_pass) {
+                            if (!$firstPass) {
                                 $query .= "/*[@$pos]";
                             }
-
-                            $tok = "";
                             break;
 
-                        case "empty":
-                            $query .= "[not(*) and not(normalize-space())]";
-                            $tok = "";
-                            break;
-
-                        case "disabled":
-                        case "checked":
-                            $query .= "[@$tok]";
-                            $tok = "";
-                            break;
-
-                        case "enabled":
-                            $query .= "[not(@disabled)]";
-                            $tok = "";
-                            break;
-
-                        // the selector is not handled, until we support all possible selectors force an empty set (silent failure)
+                        // Invalid or unsupported pseudo-class or pseudo-element
                         default:
-                            $query = "/../.."; // go up two levels because generated content starts on the body element
-                            $tok = "";
-                            break;
+                            return null;
                     }
 
                     break;
 
                 case "[":
-                    // Attribute selectors.  All with an attribute matching the following token(s)
+                    // Attribute selectors.  All with an attribute matching the
+                    // following token(s)
                     // https://www.w3.org/TR/selectors-3/#attribute-selectors
+                    if ($query === "/") {
+                        $query .= "/*";
+                    }
+
                     $attr_delimiters = ["=", "]", "~", "|", "$", "^", "*"];
                     $tok_len = mb_strlen($tok);
                     $j = 0;
@@ -763,23 +722,34 @@ class Stylesheet
                     $value = "";
 
                     while ($j < $tok_len) {
-                        if (in_array($tok[$j], $attr_delimiters)) {
+                        if (in_array($tok[$j], $attr_delimiters, true)) {
                             break;
                         }
                         $attr .= $tok[$j++];
                     }
 
+                    if ($attr === "") {
+                        // Selector invalid: Missing attribute name
+                        return null;
+                    }
+
+                    if (!isset($tok[$j])) {
+                        // Selector invalid: Missing ] or operator
+                        return null;
+                    }
+
                     switch ($tok[$j]) {
 
                         case "~":
                         case "|":
-                        case "$":
                         case "^":
+                        case "$":
                         case "*":
                             $op .= $tok[$j++];
 
-                            if ($tok[$j] !== "=") {
-                                throw new Exception("Invalid CSS selector syntax: invalid attribute selector: $selector");
+                            if (!isset($tok[$j]) || $tok[$j] !== "=") {
+                                // Selector invalid: Incomplete attribute operator
+                                return null;
                             }
 
                             $op .= $tok[$j];
@@ -792,7 +762,7 @@ class Stylesheet
                     }
 
                     // Read the attribute value, if required
-                    if ($op != "") {
+                    if ($op !== "") {
                         $j++;
                         while ($j < $tok_len) {
                             if ($tok[$j] === "]") {
@@ -802,8 +772,9 @@ class Stylesheet
                         }
                     }
 
-                    if ($attr == "") {
-                        throw new Exception("Invalid CSS selector syntax: missing attribute name");
+                    if (!isset($tok[$j])) {
+                        // Selector invalid: Missing ]
+                        return null;
                     }
 
                     $value = trim($value, "\"'");
@@ -821,9 +792,9 @@ class Stylesheet
                         case "~=":
                             // FIXME: this will break if $value contains quoted strings
                             // (e.g. [type~="a b c" "d e f"])
-                            // FIXME: Don't match anything if value contains
-                            // whitespace or is the empty string
-                            $query .= "[contains(concat(' ', normalize-space(@$attr), ' '), concat(' ', '$value', ' '))]";
+                            $query .= $value !== "" && !preg_match("/\s+/", $value)
+                                ? "[contains(concat(' ', normalize-space(@$attr), ' '), concat(' ', \"$value\", ' '))]"
+                                : "[false()]";
                             break;
 
                         case "|=":
@@ -837,63 +808,57 @@ class Stylesheet
                             $query = rtrim($query, " or ") . "]";
                             break;
 
-                        case "$=":
-                            $query .= "[substring(@$attr, string-length(@$attr)-" . (strlen($value) - 1) . ")=\"$value\"]";
+                        case "^=":
+                            $query .= $value !== ""
+                                ? "[starts-with(@$attr,\"$value\")]"
+                                : "[false()]";
                             break;
 
-                        case "^=":
-                            $query .= "[starts-with(@$attr,\"$value\")]";
+                        case "$=":
+                            $query .= $value !== ""
+                                ? "[substring(@$attr, string-length(@$attr)-" . (strlen($value) - 1) . ")=\"$value\"]"
+                                : "[false()]";
                             break;
 
                         case "*=":
-                            $query .= "[contains(@$attr,\"$value\")]";
+                            $query .= $value !== ""
+                                ? "[contains(@$attr,\"$value\")]"
+                                : "[false()]";
                             break;
                     }
 
                     break;
             }
         }
-        $i++;
-
-//       case ":":
-//         // Pseudo selectors: ignore for now.  Partially handled directly
-//         // below.
-
-//         // Skip until the next special character, leaving the token as-is
-//         while ( $i < $len ) {
-//           if ( in_array($selector[$i], $delimiters) )
-//             break;
-//           $i++;
-//         }
-//         break;
-
-//       default:
-//         // Add the character to the token
-//         $tok .= $selector[$i++];
-//         break;
-//       }
-
-//    }
 
-
-        // Trim the trailing '/' from the query
-        if (mb_strlen($query) > 2) {
-            $query = rtrim($query, "/");
-        }
-
-        return ['query' => $query, 'pseudo_elements' => $pseudo_elements];
+        return ["query" => $query, "pseudo_elements" => $pseudo_elements];
     }
 
     /**
-     * https://github.com/tenderlove/nokogiri/blob/master/lib/nokogiri/css/xpath_visitor.rb
+     * Parse an `nth-child` expression of the form `an+b`, `odd`, or `even`.
      *
      * @param string $expr
-     * @param bool $last
+     * @param string $position
      *
      * @return string
+     *
+     * @link https://www.w3.org/TR/selectors-3/#nth-child-pseudo
      */
-    protected function _selector_an_plus_b(string $expr, bool $last = false): string
+    protected function selectorAnPlusB(string $expr, string $position): string
     {
+        // odd
+        if ($expr === "odd") {
+            return "($position mod 2) = 1";
+        } // even
+        elseif ($expr === "even") {
+            return "($position mod 2) = 0";
+        } // b
+        elseif (preg_match("/^\d+$/", $expr)) {
+            return "$position = $expr";
+        }
+
+        // an+b
+        // https://github.com/tenderlove/nokogiri/blob/master/lib/nokogiri/css/xpath_visitor.rb
         $expr = preg_replace("/\s/", "", $expr);
         if (!preg_match("/^(?P<a>-?[0-9]*)?n(?P<b>[-+]?[0-9]+)?$/", $expr, $matches)) {
             return "false()";
@@ -902,9 +867,7 @@ class Stylesheet
         $a = (isset($matches["a"]) && $matches["a"] !== "") ? ($matches["a"] !== "-" ? intval($matches["a"]) : -1) : 1;
         $b = (isset($matches["b"]) && $matches["b"] !== "") ? intval($matches["b"]) : 0;
 
-        $position = $last ? "(last()-position()+1)" : "position()";
-
-        if ($b == 0) {
+        if ($b === 0) {
             return "($position mod $a) = 0";
         } else {
             $compare = ($a < 0) ? "<=" : ">=";
@@ -923,7 +886,7 @@ class Stylesheet
      * {@link FrameTree}.  Aside from parsing CSS, this is the main purpose
      * of this class.
      *
-     * @param \Dompdf\Frame\FrameTree $tree
+     * @param FrameTree $tree
      */
     function apply_styles(FrameTree $tree)
     {
@@ -945,26 +908,28 @@ class Stylesheet
 
         // Add generated content
         foreach ($this->_styles as $selector => $selector_styles) {
-            /** @var Style $style */
-            foreach ($selector_styles as $style) {
-                if (strpos($selector, ":before") === false && strpos($selector, ":after") === false) {
-                    continue;
-                }
+            if (strpos($selector, ":before") === false && strpos($selector, ":after") === false) {
+                continue;
+            }
 
-                $query = $this->_css_selector_to_xpath($selector, true);
+            $query = $this->selectorToXpath($selector, true);
+            if ($query === null) {
+                Helpers::record_warnings(E_USER_WARNING, "The CSS selector '$selector' is not valid", __FILE__, __LINE__);
+                continue;
+            }
 
-                // Retrieve the nodes, limit to body for generated content
-                //TODO: If we use a context node can we remove the leading dot?
-                $nodes = @$xp->query('.' . $query["query"]);
-                if ($nodes === false) {
-                    Helpers::record_warnings(E_USER_WARNING, "The CSS selector '$selector' is not valid", __FILE__, __LINE__);
-                    continue;
-                }
+            // Retrieve the nodes, limit to body for generated content
+            // TODO: If we use a context node can we remove the leading dot?
+            $nodes = @$xp->query('.' . $query["query"]);
+            if ($nodes === false) {
+                Helpers::record_warnings(E_USER_WARNING, "The CSS selector '$selector' is not valid", __FILE__, __LINE__);
+                continue;
+            }
 
-                /** @var \DOMElement $node */
+            foreach ($selector_styles as $style) {
                 foreach ($nodes as $node) {
                     // Only DOMElements get styles
-                    if ($node->nodeType != XML_ELEMENT_NODE) {
+                    if (!($node instanceof DOMElement)) {
                         continue;
                     }
 
@@ -1000,23 +965,25 @@ class Stylesheet
 
         // Apply all styles in stylesheet
         foreach ($this->_styles as $selector => $selector_styles) {
-            /** @var Style $style */
-            foreach ($selector_styles as $style) {
-                $query = $this->_css_selector_to_xpath($selector);
+            $query = $this->selectorToXpath($selector);
+            if ($query === null) {
+                Helpers::record_warnings(E_USER_WARNING, "The CSS selector '$selector' is not valid", __FILE__, __LINE__);
+                continue;
+            }
 
-                // Retrieve the nodes
-                $nodes = @$xp->query($query["query"]);
-                if ($nodes === false) {
-                    Helpers::record_warnings(E_USER_WARNING, "The CSS selector '$selector' is not valid", __FILE__, __LINE__);
-                    continue;
-                }
+            // Retrieve the nodes
+            $nodes = @$xp->query($query["query"]);
+            if ($nodes === false) {
+                Helpers::record_warnings(E_USER_WARNING, "The CSS selector '$selector' is not valid", __FILE__, __LINE__);
+                continue;
+            }
 
-                $spec = $this->_specificity($selector, $style->get_origin());
+            foreach ($selector_styles as $style) {
+                $spec = $this->specificity($selector, $style->get_origin());
 
                 foreach ($nodes as $node) {
-                    // Retrieve the node id
                     // Only DOMElements get styles
-                    if ($node->nodeType != XML_ELEMENT_NODE) {
+                    if (!($node instanceof DOMElement)) {
                         continue;
                     }
 
@@ -1080,7 +1047,7 @@ class Stylesheet
                 // Destroy CSS comments
                 $str = preg_replace("'/\*.*?\*/'si", "", $str);
 
-                $spec = $this->_specificity("!attr", self::ORIG_AUTHOR);
+                $spec = $this->specificity("!attr", self::ORIG_AUTHOR);
                 $styles[$id][$spec][] = $this->_parse_properties($str);
             }
 
@@ -1614,7 +1581,7 @@ class Stylesheet
             foreach ($selectors as $selector) {
                 $selector = trim($selector);
 
-                if ($selector == "") {
+                if ($selector === "") {
                     if ($DEBUGCSS) print '#empty#';
                     continue;
                 }
@@ -1678,7 +1645,6 @@ class Stylesheet
     {
         $str = "";
         foreach ($this->_styles as $selector => $selector_styles) {
-            /** @var Style $style */
             foreach ($selector_styles as $style) {
                 $str .= "$selector => " . $style->__toString() . "\n";
             }
diff --git a/civicrm/vendor/dompdf/dompdf/src/Dompdf.php b/civicrm/vendor/dompdf/dompdf/src/Dompdf.php
index 6feec59a61..d0a6884780 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Dompdf.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Dompdf.php
@@ -104,7 +104,7 @@ class Dompdf
     /**
      * Desired paper size ('letter', 'legal', 'A4', etc.)
      *
-     * @var string|array
+     * @var string|float[]
      */
     private $paperSize;
 
@@ -965,7 +965,7 @@ class Dompdf
      * @param string $orientation 'portrait' or 'landscape'
      * @return $this
      */
-    public function setPaper($size, $orientation = "portrait")
+    public function setPaper($size, string $orientation = "portrait"): self
     {
         $this->paperSize = $size;
         $this->paperOrientation = $orientation;
@@ -977,7 +977,7 @@ class Dompdf
      *
      * @return float[] A four-element float array
      */
-    public function getPaperSize()
+    public function getPaperSize(): array
     {
         $paper = $this->paperSize;
         $orientation = $this->paperOrientation;
@@ -1001,7 +1001,7 @@ class Dompdf
      *
      * @return string Either "portrait" or "landscape"
      */
-    public function getPaperOrientation()
+    public function getPaperOrientation(): string
     {
         return $this->paperOrientation;
     }
diff --git a/civicrm/vendor/dompdf/dompdf/src/Frame/Factory.php b/civicrm/vendor/dompdf/dompdf/src/Frame/Factory.php
index b4bab8871c..be39ff3422 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Frame/Factory.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Frame/Factory.php
@@ -10,10 +10,10 @@ use Dompdf\Dompdf;
 use Dompdf\Exception;
 use Dompdf\Frame;
 use Dompdf\FrameDecorator\AbstractFrameDecorator;
-use DOMXPath;
 use Dompdf\FrameDecorator\Page as PageFrameDecorator;
 use Dompdf\FrameReflower\Page as PageFrameReflower;
 use Dompdf\Positioner\AbstractPositioner;
+use DOMXPath;
 
 /**
  * Contains frame decorating logic
@@ -28,7 +28,7 @@ use Dompdf\Positioner\AbstractPositioner;
 class Factory
 {
 
-     /**
+    /**
      * Array of positioners for specific frame types
      *
      * @var AbstractPositioner[]
@@ -38,12 +38,12 @@ class Factory
     /**
      * Decorate the root Frame
      *
-     * @param $root   Frame The frame to decorate
-     * @param $dompdf Dompdf The dompdf instance
+     * @param Frame  $root   The frame to decorate
+     * @param Dompdf $dompdf The dompdf instance
      *
      * @return PageFrameDecorator
      */
-    static function decorate_root(Frame $root, Dompdf $dompdf)
+    public static function decorate_root(Frame $root, Dompdf $dompdf): PageFrameDecorator
     {
         $frame = new PageFrameDecorator($root, $dompdf);
         $frame->set_reflower(new PageFrameReflower($frame));
@@ -55,15 +55,15 @@ class Factory
     /**
      * Decorate a Frame
      *
-     * @param Frame $frame   The frame to decorate
-     * @param Dompdf $dompdf The dompdf instance
-     * @param Frame $root    The root of the frame
+     * @param Frame      $frame  The frame to decorate
+     * @param Dompdf     $dompdf The dompdf instance
+     * @param Frame|null $root   The root of the frame
      *
      * @throws Exception
-     * @return AbstractFrameDecorator
+     * @return AbstractFrameDecorator|null
      * FIXME: this is admittedly a little smelly...
      */
-    static function decorate_frame(Frame $frame, Dompdf $dompdf, Frame $root = null)
+    public static function decorate_frame(Frame $frame, Dompdf $dompdf, ?Frame $root = null): ?AbstractFrameDecorator
     {
         $style = $frame->get_style();
         $display = $style->display;
@@ -164,7 +164,7 @@ class Factory
                 if ($style->_dompdf_keep !== "yes") {
                     // Remove the node and the frame
                     $frame->get_parent()->remove_child($frame);
-                    return;
+                    return null;
                 }
 
                 $positioner = "NullPositioner";
@@ -178,10 +178,8 @@ class Factory
 
         if ($position === "absolute") {
             $positioner = "Absolute";
-        } else {
-            if ($position === "fixed") {
-                $positioner = "Fixed";
-            }
+        } elseif ($position === "fixed") {
+            $positioner = "Fixed";
         }
 
         $node = $frame->get_node();
@@ -249,10 +247,11 @@ class Factory
     /**
      * Creates Positioners
      *
-     * @param string $type type of positioner to use
+     * @param string $type Type of positioner to use
+     *
      * @return AbstractPositioner
      */
-    protected static function getPositionerInstance($type)
+    protected static function getPositionerInstance(string $type): AbstractPositioner
     {
         if (!isset(self::$_positioners[$type])) {
             $class = '\\Dompdf\\Positioner\\'.$type;
diff --git a/civicrm/vendor/dompdf/dompdf/src/FrameReflower/Block.php b/civicrm/vendor/dompdf/dompdf/src/FrameReflower/Block.php
index f9e50a6783..9fb7184b6d 100644
--- a/civicrm/vendor/dompdf/dompdf/src/FrameReflower/Block.php
+++ b/civicrm/vendor/dompdf/dompdf/src/FrameReflower/Block.php
@@ -6,7 +6,6 @@
  */
 namespace Dompdf\FrameReflower;
 
-use Dompdf\Frame;
 use Dompdf\FrameDecorator\AbstractFrameDecorator;
 use Dompdf\FrameDecorator\Block as BlockFrameDecorator;
 use Dompdf\FrameDecorator\TableCell as TableCellFrameDecorator;
diff --git a/civicrm/vendor/dompdf/dompdf/src/FrameReflower/ListBullet.php b/civicrm/vendor/dompdf/dompdf/src/FrameReflower/ListBullet.php
index f735bae169..3618a28fad 100644
--- a/civicrm/vendor/dompdf/dompdf/src/FrameReflower/ListBullet.php
+++ b/civicrm/vendor/dompdf/dompdf/src/FrameReflower/ListBullet.php
@@ -31,6 +31,10 @@ class ListBullet extends AbstractFrameReflower
      */
     function reflow(BlockFrameDecorator $block = null)
     {
+        if ($block === null) {
+            return;
+        }
+
         /** @var ListBulletFrameDecorator */
         $frame = $this->_frame;
         $style = $frame->get_style();
diff --git a/civicrm/vendor/dompdf/dompdf/src/FrameReflower/Text.php b/civicrm/vendor/dompdf/dompdf/src/FrameReflower/Text.php
index 57439ae70c..19c79921f8 100644
--- a/civicrm/vendor/dompdf/dompdf/src/FrameReflower/Text.php
+++ b/civicrm/vendor/dompdf/dompdf/src/FrameReflower/Text.php
@@ -278,12 +278,10 @@ class Text extends AbstractFrameReflower
             $text = ltrim($text, " ");
         }
 
-        // Exclude wrapped white space. This handles white space between block
-        // elements in case white space is collapsed
         if ($text === "") {
             $frame->set_text("");
             $style->set_used("width", 0.0);
-            return null;
+            return false;
         }
 
         // Determine the next line break
@@ -397,6 +395,10 @@ class Text extends AbstractFrameReflower
         $text = $this->pre_process_text($frame->get_text());
         $frame->set_text($text);
 
+        if ($block === null) {
+            return;
+        }
+
         $add_line = $this->layout_line($block);
 
         if ($add_line === null) {
@@ -405,20 +407,24 @@ class Text extends AbstractFrameReflower
 
         $frame->position();
 
-        if ($block) {
-            $line = $block->add_frame_to_line($frame);
-            $trimmed = trim($frame->get_text());
+        // Skip wrapped white space between block-level elements in case white
+        // space is collapsed
+        if ($frame->get_text() === "" && $frame->get_margin_width() === 0.0) {
+            return;
+        }
 
-            // Split the text into words (used to determine spacing between
-            // words on justified lines)
-            if ($trimmed !== "") {
-                $words = preg_split(self::$_whitespace_pattern, $trimmed);
-                $line->wc += count($words);
-            }
+        $line = $block->add_frame_to_line($frame);
+        $trimmed = trim($frame->get_text());
 
-            if ($add_line) {
-                $block->add_line();
-            }
+        // Split the text into words (used to determine spacing between
+        // words on justified lines)
+        if ($trimmed !== "") {
+            $words = preg_split(self::$_whitespace_pattern, $trimmed);
+            $line->wc += count($words);
+        }
+
+        if ($add_line) {
+            $block->add_line();
         }
     }
 
diff --git a/civicrm/vendor/dompdf/dompdf/src/Image/Cache.php b/civicrm/vendor/dompdf/dompdf/src/Image/Cache.php
index f337bbb47c..6141cb503a 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Image/Cache.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Image/Cache.php
@@ -133,7 +133,7 @@ class Cache
                 xml_set_element_handler(
                     $parser,
                     function ($parser, $name, $attributes) use ($options, $parsed_url, $full_url) {
-                        if ($name === "image") {
+                        if (strtolower($name) === "image") {
                             $attributes = array_change_key_case($attributes, CASE_LOWER);
                             $url = $attributes["xlink:href"] ?? $attributes["href"];
                             if (!empty($url)) {
diff --git a/civicrm/vendor/dompdf/dompdf/src/Options.php b/civicrm/vendor/dompdf/dompdf/src/Options.php
index de127d2d5c..c065bff638 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Options.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Options.php
@@ -103,7 +103,7 @@ class Options
      * North America standard is "letter"; other countries generally "a4"
      * @see \Dompdf\Adapter\CPDF::PAPER_SIZES for valid sizes
      *
-     * @var string
+     * @var string|float[]
      */
     private $defaultPaperSize = "letter";
 
@@ -789,10 +789,10 @@ class Options
     }
 
     /**
-     * @param string $defaultPaperSize
+     * @param string|float[] $defaultPaperSize
      * @return $this
      */
-    public function setDefaultPaperSize($defaultPaperSize)
+    public function setDefaultPaperSize($defaultPaperSize): self
     {
         $this->defaultPaperSize = $defaultPaperSize;
         return $this;
@@ -802,14 +802,14 @@ class Options
      * @param string $defaultPaperOrientation
      * @return $this
      */
-    public function setDefaultPaperOrientation($defaultPaperOrientation)
+    public function setDefaultPaperOrientation(string $defaultPaperOrientation): self
     {
         $this->defaultPaperOrientation = $defaultPaperOrientation;
         return $this;
     }
 
     /**
-     * @return string
+     * @return string|float[]
      */
     public function getDefaultPaperSize()
     {
@@ -819,7 +819,7 @@ class Options
     /**
      * @return string
      */
-    public function getDefaultPaperOrientation()
+    public function getDefaultPaperOrientation(): string
     {
         return $this->defaultPaperOrientation;
     }
diff --git a/civicrm/vendor/dompdf/dompdf/src/Renderer/Text.php b/civicrm/vendor/dompdf/dompdf/src/Renderer/Text.php
index e7baa0a01c..2a2e5cc724 100644
--- a/civicrm/vendor/dompdf/dompdf/src/Renderer/Text.php
+++ b/civicrm/vendor/dompdf/dompdf/src/Renderer/Text.php
@@ -45,7 +45,7 @@ class Text extends AbstractRenderer
         $style = $frame->get_style();
         $text = $frame->get_text();
 
-        if (trim($text) === "") {
+        if ($text === "") {
             return;
         }
 
diff --git a/civicrm/vendor/masterminds/html5/README.md b/civicrm/vendor/masterminds/html5/README.md
index 546d3e24cf..b1ca1e3715 100644
--- a/civicrm/vendor/masterminds/html5/README.md
+++ b/civicrm/vendor/masterminds/html5/README.md
@@ -1,3 +1,19 @@
+> # UKRAINE NEEDS YOUR HELP NOW!
+>
+> On 24 February 2022, Russian [President Vladimir Putin ordered an invasion of Ukraine by Russian Armed Forces](https://www.bbc.com/news/world-europe-60504334).
+>
+> Your support is urgently needed.
+>
+> - Donate to the volunteers. Here is the volunteer fund helping the Ukrainian army to provide all the necessary equipment:
+>  https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi or https://savelife.in.ua/en/donate/
+> - Triple-check social media sources. Russian disinformation is attempting to coverup and distort the reality in Ukraine.
+> - Help Ukrainian refugees who are fleeing Russian attacks and shellings: https://www.globalcitizen.org/en/content/ways-to-help-ukraine-conflict/
+> -  Put pressure on your political representatives to provide help to Ukraine.
+> -  Believe in the Ukrainian people, they will not surrender, they don't have another Ukraine.
+>
+> THANK YOU!
+----
+
 # HTML5-PHP
 
 HTML5 is a standards-compliant HTML5 parser and writer written entirely in PHP.
diff --git a/civicrm/vendor/masterminds/html5/RELEASE.md b/civicrm/vendor/masterminds/html5/RELEASE.md
index 86c0dac3f6..33007ed691 100644
--- a/civicrm/vendor/masterminds/html5/RELEASE.md
+++ b/civicrm/vendor/masterminds/html5/RELEASE.md
@@ -1,5 +1,9 @@
 # Release Notes
 
+2.7.6  (2021-08-18)
+
+- #218: Address comment handling issues 
+
 2.7.5  (2021-07-01)
 
 - #204: Travis: Enable tests on PHP 8.0 
diff --git a/civicrm/vendor/masterminds/html5/src/HTML5/Parser/Scanner.php b/civicrm/vendor/masterminds/html5/src/HTML5/Parser/Scanner.php
index 1b52983e73..1b25888bc9 100644
--- a/civicrm/vendor/masterminds/html5/src/HTML5/Parser/Scanner.php
+++ b/civicrm/vendor/masterminds/html5/src/HTML5/Parser/Scanner.php
@@ -104,7 +104,7 @@ class Scanner
      */
     public function peek()
     {
-        if (($this->char + 1) <= $this->EOF) {
+        if (($this->char + 1) < $this->EOF) {
             return $this->data[$this->char + 1];
         }
 
diff --git a/civicrm/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php b/civicrm/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php
index 300a446264..016919ae2b 100644
--- a/civicrm/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php
+++ b/civicrm/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php
@@ -712,18 +712,24 @@ class Tokenizer
             return true;
         }
 
-        // If it doesn't start with -, not the end.
-        if ('-' != $tok) {
+        // If next two tokens are not '--', not the end.
+        if ('-' != $tok || '-' != $this->scanner->peek()) {
             return false;
         }
 
-        // Advance one, and test for '->'
-        if ('-' == $this->scanner->next() && '>' == $this->scanner->peek()) {
+        $this->scanner->consume(2); // Consume '-' and one of '!' or '>'
+
+        // Test for '>'
+        if ('>' == $this->scanner->current()) {
+            return true;
+        }
+        // Test for '!>'
+        if ('!' == $this->scanner->current() && '>' == $this->scanner->peek()) {
             $this->scanner->consume(); // Consume the last '>'
             return true;
         }
-        // Unread '-';
-        $this->scanner->unconsume(1);
+        // Unread '-' and one of '!' or '>';
+        $this->scanner->unconsume(2);
 
         return false;
     }
diff --git a/civicrm/vendor/phenx/php-svg-lib/LICENSE b/civicrm/vendor/phenx/php-svg-lib/LICENSE
index f288702d2f..0a041280bd 100644
--- a/civicrm/vendor/phenx/php-svg-lib/LICENSE
+++ b/civicrm/vendor/phenx/php-svg-lib/LICENSE
@@ -1,674 +1,165 @@
-                    GNU GENERAL PUBLIC LICENSE
+                   GNU LESSER GENERAL PUBLIC LICENSE
                        Version 3, 29 June 2007
 
  Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<https://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<https://www.gnu.org/licenses/why-not-lgpl.html>.
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/civicrm/vendor/phenx/php-svg-lib/README.md b/civicrm/vendor/phenx/php-svg-lib/README.md
index f11cde9eab..2b8e6f67e0 100644
--- a/civicrm/vendor/phenx/php-svg-lib/README.md
+++ b/civicrm/vendor/phenx/php-svg-lib/README.md
@@ -1,7 +1,6 @@
 # SVG file parsing / rendering library
 
-[![Build Status](https://travis-ci.org/PhenX/php-svg-lib.svg?branch=master)](https://travis-ci.org/PhenX/php-svg-lib)
-[![Coverage Status](https://coveralls.io/repos/PhenX/php-svg-lib/badge.svg)](https://coveralls.io/r/PhenX/php-svg-lib)
+[![Build Status](https://github.com/phenx/php-svg-lib/workflows/test/badge.svg)](https://github.com/phenx/php-svg-lib/actions)
 
 
 [![Latest Stable Version](https://poser.pugx.org/phenx/php-svg-lib/v/stable)](https://packagist.org/packages/phenx/php-svg-lib) 
@@ -11,4 +10,4 @@
 
 The main purpose of this lib is to rasterize SVG to a surface which can be an image or a PDF for example, through a `\Svg\Surface` PHP interface.
 
-This project was initialized by the need to render SVG documents inside PDF files for the [DomPdf](http://dompdf.github.io) project.
\ No newline at end of file
+This project was initialized by the need to render SVG documents inside PDF files for the [DomPdf](http://dompdf.github.io) project.
diff --git a/civicrm/vendor/phenx/php-svg-lib/composer.json b/civicrm/vendor/phenx/php-svg-lib/composer.json
index c2568dfbfa..a6ed9c5411 100644
--- a/civicrm/vendor/phenx/php-svg-lib/composer.json
+++ b/civicrm/vendor/phenx/php-svg-lib/composer.json
@@ -21,7 +21,7 @@
     }
   },
   "require": {
-    "php": "^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0",
+    "php": "^7.1 || ^8.0",
     "ext-mbstring": "*",
     "sabberworm/php-css-parser": "^8.4"
   },
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/CssLength.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/CssLength.php
new file mode 100644
index 0000000000..88eda8c6ff
--- /dev/null
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/CssLength.php
@@ -0,0 +1,135 @@
+<?php
+
+namespace Svg;
+
+class CssLength
+{
+    /**
+     * Array of valid css length units.
+     * Should be pre-sorted by unit text length so no earlier length can be
+     * contained within a latter (eg. 'in' within 'vmin').
+     *
+     * @var string[]
+     */
+    protected static $units = [
+        'vmax',
+        'vmin',
+        'rem',
+        'px',
+        'pt',
+        'cm',
+        'mm',
+        'in',
+        'pc',
+        'em',
+        'ex',
+        'ch',
+        'vw',
+        'vh',
+        '%',
+        'q',
+    ];
+
+    /**
+     * A list of units that are inch-relative, and their unit division within an inch.
+     *
+     * @var array<string, float>
+     */
+    protected static $inchDivisions = [
+        'in' => 1,
+        'cm' => 2.54,
+        'mm' => 25.4,
+        'q' => 101.6,
+        'pc' => 6,
+        'pt' => 72,
+    ];
+
+    /**
+     * The CSS length unit indicator.
+     * Will be lower-case and one of the units listed in the '$units' array or empty.
+     *
+     * @var string
+     */
+    protected $unit = '';
+
+    /**
+     * The numeric value of the given length.
+     *
+     * @var float
+     */
+    protected $value = 0;
+
+    /**
+     * The original unparsed length provided.
+     *
+     * @var string
+     */
+    protected $unparsed;
+
+    public function __construct(string $length)
+    {
+        $this->unparsed = $length;
+        $this->parseLengthComponents($length);
+    }
+
+    /**
+     * Parse out the unit and value components from the given string length.
+     */
+    protected function parseLengthComponents(string $length): void
+    {
+        $length = strtolower($length);
+
+        foreach (self::$units as $unit) {
+            $pos = strpos($length, $unit);
+            if ($pos) {
+                $this->value = floatval(substr($length, 0, $pos));
+                $this->unit = $unit;
+                return;
+            }
+        }
+
+        $this->unit = '';
+        $this->value = floatval($length);
+    }
+
+    /**
+     * Get the unit type of this css length.
+     * Units are standardised to be lower-cased.
+     *
+     * @return string
+     */
+    public function getUnit(): string
+    {
+        return $this->unit;
+    }
+
+    /**
+     * Get this CSS length in the equivalent pixel count size.
+     *
+     * @param float $referenceSize
+     * @param float $dpi
+     *
+     * @return float
+     */
+    public function toPixels(float $referenceSize = 11.0, float $dpi = 96.0): float
+    {
+        // Standard relative units
+        if (in_array($this->unit, ['em', 'rem', 'ex', 'ch'])) {
+            return $this->value * $referenceSize;
+        }
+
+        // Percentage relative units
+        if (in_array($this->unit, ['%', 'vw', 'vh', 'vmin', 'vmax'])) {
+            return $this->value * ($referenceSize / 100);
+        }
+
+        // Inch relative units
+        if (in_array($this->unit, array_keys(static::$inchDivisions))) {
+            $inchValue = $this->value * $dpi;
+            $division = static::$inchDivisions[$this->unit];
+            return $inchValue / $division;
+        }
+
+        return $this->value;
+    }
+}
\ No newline at end of file
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/DefaultStyle.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/DefaultStyle.php
index 2fe312b857..4e73d2948a 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/DefaultStyle.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/DefaultStyle.php
@@ -10,11 +10,11 @@ namespace Svg;
 
 class DefaultStyle extends Style
 {
-    public $color = '';
+    public $color = [0, 0, 0, 1];
     public $opacity = 1.0;
     public $display = 'inline';
 
-    public $fill = 'black';
+    public $fill = [0, 0, 0, 1];
     public $fillOpacity = 1.0;
     public $fillRule = 'nonzero';
 
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Document.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Document.php
index 2561e3aeb4..4de226e705 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Document.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Document.php
@@ -101,6 +101,11 @@ class Document extends AbstractTag
         return $this->height;
     }
 
+    public function getDiagonal()
+    {
+        return sqrt(($this->width)**2 + ($this->height)**2) / sqrt(2);
+    }
+
     public function getDimensions() {
         $rootAttributes = null;
 
@@ -135,12 +140,12 @@ class Document extends AbstractTag
     public function handleSizeAttributes($attributes){
         if ($this->width === null) {
             if (isset($attributes["width"])) {
-                $width = Style::convertSize($attributes["width"], 400);
+                $width = $this->convertSize($attributes["width"], 400);
                 $this->width  = $width;
             }
 
             if (isset($attributes["height"])) {
-                $height = Style::convertSize($attributes["height"], 300);
+                $height = $this->convertSize($attributes["height"], 300);
                 $this->height = $height;
             }
 
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Style.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Style.php
index 0c62633034..14b11e9029 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Style.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Style.php
@@ -18,6 +18,8 @@ class Style
     const TYPE_ANGLE = 4;
     const TYPE_NUMBER = 5;
 
+    private $_parentStyle;
+
     public $color;
     public $opacity;
     public $display;
@@ -88,7 +90,7 @@ class Style
         $group = $tag->getParentGroup();
         if ($group) {
             $parent_style = $group->getStyle();
-
+            $this->_parentStyle = $parent_style;
             foreach ($parent_style as $_key => $_value) {
                 if ($_value !== null) {
                     $this->$_key = $_value;
@@ -145,13 +147,24 @@ class Style
 
     protected function fillStyles($styles)
     {
-        foreach ($this->getStyleMap() as $from => $spec) {
+        $style_map = $this->getStyleMap();
+        foreach ($style_map as $from => $spec) {
             if (isset($styles[$from])) {
                 list($to, $type) = $spec;
                 $value = null;
                 switch ($type) {
                     case self::TYPE_COLOR:
                         $value = self::parseColor($styles[$from]);
+                        if ($value === "currentcolor") {
+                            if ($type === "color") {
+                                $value = $this->_parentStyle->color;
+                            } else {
+                                $value = $this->color;
+                            }
+                        }
+                        if ($value !== null && $value[3] !== 1 && array_key_exists("{$from}-opacity", $style_map) === true) {
+                            $styles["{$from}-opacity"] = $value[3];
+                        }
                         break;
 
                     case self::TYPE_NUMBER:
@@ -177,8 +190,7 @@ class Style
 
         if (count($parts) == 2) {
             $color = $parts[1];
-        }
-        else {
+        } else {
             $color = $parts[0];
         }
 
@@ -186,6 +198,10 @@ class Style
             return "none";
         }
 
+        if ($color === "currentcolor") {
+            return "currentcolor";
+        }
+
         // SVG color name
         if (isset(self::$colorNames[$color])) {
             return self::parseHexColor(self::$colorNames[$color]);
@@ -198,18 +214,18 @@ class Style
 
         // RGB color
         if (strpos($color, "rgb") !== false) {
-            return self::getTriplet($color);
+            return self::getQuad($color);
         }
 
         // RGB color
         if (strpos($color, "hsl") !== false) {
-            $triplet = self::getTriplet($color, true);
+            $quad = self::getQuad($color, true);
 
-            if ($triplet == null) {
+            if ($quad == null) {
                 return null;
             }
 
-            list($h, $s, $l) = $triplet;
+            list($h, $s, $l, $a) = $quad;
 
             $r = $l;
             $g = $l;
@@ -258,11 +274,13 @@ class Style
                         break;
                 }
             }
+            $a = $a * 255;
 
             return array(
                 $r * 255.0,
                 $g * 255.0,
                 $b * 255.0,
+                $a
             );
         }
 
@@ -282,7 +300,7 @@ class Style
         return null;
     }
 
-    static function getTriplet($color, $percent = false) {
+    static function getQuad($color, $percent = false) {
         $i = strpos($color, "(");
         $j = strpos($color, ")");
 
@@ -291,46 +309,60 @@ class Style
             return null;
         }
 
-        $triplet = preg_split("/\\s*,\\s*/", trim(substr($color, $i + 1, $j - $i - 1)));
+        $quad = preg_split("/\\s*[,\\/]\\s*/", trim(substr($color, $i + 1, $j - $i - 1)));
+        if (!isset($quad[3])) {
+            $quad[3] = 1;
+        }
 
-        if (count($triplet) != 3) {
+        if (count($quad) != 3 && count($quad) != 4) {
             return null;
         }
 
-        foreach (array_keys($triplet) as $c) {
-            $triplet[$c] = trim($triplet[$c]);
+        foreach (array_keys($quad) as $c) {
+            $quad[$c] = trim($quad[$c]);
 
             if ($percent) {
-                if ($triplet[$c][strlen($triplet[$c]) - 1] === "%") {
-                    $triplet[$c] = floatval($triplet[$c]) / 100;
+                if ($quad[$c][strlen($quad[$c]) - 1] === "%") {
+                    $quad[$c] = floatval($quad[$c]) / 100;
+                } else {
+                    $quad[$c] = $quad[$c] / 255;
                 }
-                else {
-                    $triplet[$c] = $triplet[$c] / 255;
-                }
-            }
-            else {
-                if ($triplet[$c][strlen($triplet[$c]) - 1] === "%") {
-                    $triplet[$c] = round(floatval($triplet[$c]) * 2.55);
+            } else {
+                if ($quad[$c][strlen($quad[$c]) - 1] === "%") {
+                    $quad[$c] = round(floatval($quad[$c]) * 2.55);
                 }
             }
         }
 
-        return $triplet;
+        return $quad;
     }
 
     static function parseHexColor($hex)
     {
-        $c = array(0, 0, 0);
+        $c = array(0, 0, 0, 1);
 
         // #FFFFFF
         if (isset($hex[6])) {
             $c[0] = hexdec(substr($hex, 1, 2));
             $c[1] = hexdec(substr($hex, 3, 2));
             $c[2] = hexdec(substr($hex, 5, 2));
+
+            if (isset($hex[7])) {
+                $alpha = substr($hex, 7, 2);
+                if (ctype_xdigit($alpha)) {
+                    $c[3] = round(hexdec($alpha)/255, 2);
+                }
+            }
         } else {
             $c[0] = hexdec($hex[1] . $hex[1]);
             $c[1] = hexdec($hex[2] . $hex[2]);
             $c[2] = hexdec($hex[3] . $hex[3]);
+
+            if (isset($hex[4])) {
+                if (ctype_xdigit($hex[4])) {
+                    $c[3] = round(hexdec($hex[4] . $hex[4])/255, 2);
+                }
+            }
         }
 
         return $c;
@@ -356,47 +388,6 @@ class Style
         return $styles;
     }
 
-    /**
-     * Convert a size to a float
-     *
-     * @param string $size          SVG size
-     * @param float  $dpi           DPI
-     * @param float  $referenceSize Reference size
-     *
-     * @return float|null
-     */
-    static function convertSize($size, $referenceSize = 11.0, $dpi = 96.0) {
-        $size = trim(strtolower($size));
-
-        if (is_numeric($size)) {
-            return $size;
-        }
-
-        if ($pos = strpos($size, "px")) {
-            return floatval(substr($size, 0, $pos));
-        }
-
-        if ($pos = strpos($size, "pt")) {
-            return floatval(substr($size, 0, $pos));
-        }
-
-        if ($pos = strpos($size, "cm")) {
-            return floatval(substr($size, 0, $pos)) * $dpi;
-        }
-
-        if ($pos = strpos($size, "%")) {
-            return $referenceSize * substr($size, 0, $pos) / 100;
-        }
-
-        if ($pos = strpos($size, "em")) {
-            return $referenceSize * substr($size, 0, $pos);
-        }
-
-        // TODO cm, mm, pc, in, etc
-
-        return null;
-    }
-
     static $colorNames = array(
         'antiquewhite'         => '#FAEBD7',
         'aqua'                 => '#00FFFF',
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/CPdf.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/CPdf.php
index 32ae8960b9..caa28a8903 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/CPdf.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/CPdf.php
@@ -4174,9 +4174,9 @@ EOT;
         $this->addContent(sprintf("\n%.3F %.3F %.3F %.3F re", $x1, $y1, $width, $height));
     }
 
-    function stroke()
+    function stroke(bool $close = false)
     {
-        $this->addContent("\nS");
+        $this->addContent("\n" . ($close ? "s" : "S"));
     }
 
     function fill()
@@ -4184,9 +4184,9 @@ EOT;
         $this->addContent("\nf" . ($this->fillRule === "evenodd" ? "*" : ""));
     }
 
-    function fillStroke()
+    function fillStroke(bool $close = false)
     {
-        $this->addContent("\nb" . ($this->fillRule === "evenodd" ? "*" : ""));
+        $this->addContent("\n" . ($close ? "b" : "B") . ($this->fillRule === "evenodd" ? "*" : ""));
     }
 
     /**
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php
index ab661d473e..62cc74a1d4 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php
@@ -122,10 +122,10 @@ class SurfaceCpdf implements SurfaceInterface
         $this->canvas->closePath();
     }
 
-    public function fillStroke()
+    public function fillStroke(bool $close = false)
     {
         if (self::DEBUG) echo __FUNCTION__ . "\n";
-        $this->canvas->fillStroke();
+        $this->canvas->fillStroke($close);
     }
 
     public function clip()
@@ -342,10 +342,10 @@ class SurfaceCpdf implements SurfaceInterface
         $this->stroke();
     }
 
-    public function stroke()
+    public function stroke(bool $close = false)
     {
         if (self::DEBUG) echo __FUNCTION__ . "\n";
-        $this->canvas->stroke();
+        $this->canvas->stroke($close);
     }
 
     public function endPath()
@@ -435,51 +435,52 @@ class SurfaceCpdf implements SurfaceInterface
 
     public function setFont($family, $style, $weight)
     {
-        $map = array(
-            "serif"      => "Times",
-            "sans-serif" => "Helvetica",
-            "fantasy"    => "Symbol",
-            "cursive"    => "Times",
-            "monospace"  => "Courier",
-
-            "arial"      => "Helvetica",
-            "verdana"    => "Helvetica",
-        );
-
-        $styleMap = array(
-            'Helvetica' => array(
-                'b'  => 'Helvetica-Bold',
-                'i'  => 'Helvetica-Oblique',
-                'bi' => 'Helvetica-BoldOblique',
-            ),
-            'Courier' => array(
-                'b'  => 'Courier-Bold',
-                'i'  => 'Courier-Oblique',
-                'bi' => 'Courier-BoldOblique',
-            ),
-            'Times' => array(
-                ''   => 'Times-Roman',
-                'b'  => 'Times-Bold',
-                'i'  => 'Times-Italic',
-                'bi' => 'Times-BoldItalic',
-            ),
-        );
-
-        $family = strtolower($family);
-        $style  = strtolower($style);
-        $weight = strtolower($weight);
-
-        if (isset($map[$family])) {
-            $family = $map[$family];
+        $map = [
+            "serif"      => "times",
+            "sans-serif" => "helvetica",
+            "fantasy"    => "symbol",
+            "cursive"    => "times",
+            "monospace"  => "courier"
+        ];
+
+        $styleMap = [
+            "courier" => [
+                ""   => "Courier",
+                "b"  => "Courier-Bold",
+                "i"  => "Courier-Oblique",
+                "bi" => "Courier-BoldOblique",
+            ],
+            "helvetica" => [
+                ""   => "Helvetica",
+                "b"  => "Helvetica-Bold",
+                "i"  => "Helvetica-Oblique",
+                "bi" => "Helvetica-BoldOblique",
+            ],
+            "symbol" => [
+                "" => "Symbol"
+            ],
+            "times" => [
+                ""   => "Times-Roman",
+                "b"  => "Times-Bold",
+                "i"  => "Times-Italic",
+                "bi" => "Times-BoldItalic",
+            ],
+        ];
+
+        $family_lc = strtolower($family);
+        if (isset($map[$family_lc])) {
+            $family = $map[$family_lc];
         }
 
         if (isset($styleMap[$family])) {
             $key = "";
 
+            $weight = strtolower($weight);
             if ($weight === "bold" || $weight === "bolder" || (is_numeric($weight) && $weight >= 600)) {
                 $key .= "b";
             }
 
+            $style = strtolower($style);
             if ($style === "italic" || $style === "oblique") {
                 $key .= "i";
             }
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceInterface.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceInterface.php
index e8edcf0864..25b30014d2 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceInterface.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceInterface.php
@@ -37,11 +37,11 @@ interface SurfaceInterface
 
     public function fill();
 
-    public function stroke();
+    public function stroke(bool $close = false);
 
     public function endPath();
 
-    public function fillStroke();
+    public function fillStroke(bool $close = false);
 
     public function clip();
 
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfacePDFLib.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfacePDFLib.php
index fc5e7143c7..3d25aef811 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfacePDFLib.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Surface/SurfacePDFLib.php
@@ -120,10 +120,14 @@ class SurfacePDFLib implements SurfaceInterface
         $this->canvas->closepath();
     }
 
-    public function fillStroke()
+    public function fillStroke(bool $close = false)
     {
         if (self::DEBUG) echo __FUNCTION__ . "\n";
-        $this->canvas->fill_stroke();
+        if ($close) {
+            $this->canvas->closepath_fill_stroke();
+        } else {
+            $this->canvas->fill_stroke();
+        }
     }
 
     public function clip()
@@ -281,10 +285,14 @@ class SurfacePDFLib implements SurfaceInterface
         $this->stroke();
     }
 
-    public function stroke()
+    public function stroke(bool $close = false)
     {
         if (self::DEBUG) echo __FUNCTION__ . "\n";
-        $this->canvas->stroke();
+        if ($close) {
+            $this->canvas->closepath_stroke();
+        } else {
+            $this->canvas->stroke();
+        }
     }
 
     public function endPath()
@@ -315,7 +323,7 @@ class SurfacePDFLib implements SurfaceInterface
         $this->style = $style;
         $canvas = $this->canvas;
 
-        if ($stroke = $style->stroke && is_array($style->stroke)) {
+        if (is_array($style->stroke) && $stroke = $style->stroke) {
             $canvas->setcolor(
                 "stroke",
                 "rgb",
@@ -326,7 +334,7 @@ class SurfacePDFLib implements SurfaceInterface
             );
         }
 
-        if ($fill = $style->fill && is_array($style->fill)) {
+        if (is_array($style->fill) && $fill = $style->fill) {
             $canvas->setcolor(
                 "fill",
                 "rgb",
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/AbstractTag.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/AbstractTag.php
index 8c464ddad5..9fa6793206 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/AbstractTag.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/AbstractTag.php
@@ -8,6 +8,7 @@
 
 namespace Svg\Tag;
 
+use Svg\CssLength;
 use Svg\Document;
 use Svg\Style;
 
@@ -134,21 +135,19 @@ abstract class AbstractTag
 
             $transform = $attributes["transform"];
 
-            $match = array();
+            $matches = array();
             preg_match_all(
-                '/(matrix|translate|scale|rotate|skewX|skewY)\((.*?)\)/is',
+                '/(matrix|translate|scale|rotate|skew|skewX|skewY)\((.*?)\)/is',
                 $transform,
-                $match,
+                $matches,
                 PREG_SET_ORDER
             );
 
             $transformations = array();
-            if (count($match[0])) {
-                foreach ($match as $_match) {
-                    $arguments = preg_split('/[ ,]+/', $_match[2]);
-                    array_unshift($arguments, $_match[1]);
-                    $transformations[] = $arguments;
-                }
+            foreach ($matches as $match) {
+                $arguments = preg_split('/[ ,]+/', $match[2]);
+                array_unshift($arguments, $match[1]);
+                $transformations[] = $arguments;
             }
 
             foreach ($transformations as $t) {
@@ -177,14 +176,61 @@ abstract class AbstractTag
                         break;
 
                     case "skewX":
-                        $surface->skewX($t[1]);
+                        $tan_x = tan(deg2rad($t[1]));
+                        $surface->transform(1, 0, $tan_x, 1, 0, 0);
                         break;
 
                     case "skewY":
-                        $surface->skewY($t[1]);
+                        $tan_y = tan(deg2rad($t[1]));
+                        $surface->transform(1, $tan_y, 0, 1, 0, 0);
                         break;
                 }
             }
         }
     }
+
+    /**
+     * Convert the given size for the context of this current tag.
+     * Takes a pixel-based reference, which is usually specific to the context of the size,
+     * but the actual reference size will be decided based upon the unit used.
+     *
+     * @param string $size
+     * @param float $pxReference
+     *
+     * @return float
+     */
+    protected function convertSize(string $size, float $pxReference): float
+    {
+        $length = new CssLength($size);
+        $reference = $pxReference;
+        $defaultFontSize = 12;
+
+        switch ($length->getUnit()) {
+            case "em":
+                $reference = $this->style->fontSize ?? $defaultFontSize;
+                break;
+            case "rem":
+                $reference = $this->document->style->fontSize ?? $defaultFontSize;
+                break;
+            case "ex":
+            case "ch":
+                $emRef = $this->style->fontSize ?? $defaultFontSize;
+                $reference = $emRef * 0.5;
+                break;
+            case "vw":
+                $reference = $this->getDocument()->getWidth();
+                break;
+            case "vh":
+                $reference = $this->getDocument()->getHeight();
+                break;
+            case "vmin":
+                $reference = min($this->getDocument()->getHeight(), $this->getDocument()->getWidth());
+                break;
+            case "vmax":
+                $reference = max($this->getDocument()->getHeight(), $this->getDocument()->getWidth());
+                break;
+        }
+
+        return (new CssLength($size))->toPixels($reference);
+    }
 } 
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php
index 3f8de2f6a2..e504ffe3aa 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php
@@ -8,6 +8,8 @@
 
 namespace Svg\Tag;
 
+use Svg\Style;
+
 class Circle extends Shape
 {
     protected $cx = 0;
@@ -17,13 +19,16 @@ class Circle extends Shape
     public function start($attributes)
     {
         if (isset($attributes['cx'])) {
-            $this->cx = $attributes['cx'];
+            $width = $this->document->getWidth();
+            $this->cx = $this->convertSize($attributes['cx'], $width);
         }
         if (isset($attributes['cy'])) {
-            $this->cy = $attributes['cy'];
+            $height = $this->document->getHeight();
+            $this->cy = $this->convertSize($attributes['cy'], $height);
         }
         if (isset($attributes['r'])) {
-            $this->r = $attributes['r'];
+            $diagonal = $this->document->getDiagonal();
+            $this->r = $this->convertSize($attributes['r'], $diagonal);
         }
 
         $this->document->getSurface()->circle($this->cx, $this->cy, $this->r);
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Ellipse.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Ellipse.php
index 1f567a00fd..42891e031f 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Ellipse.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Ellipse.php
@@ -8,6 +8,8 @@
 
 namespace Svg\Tag;
 
+use Svg\Style;
+
 class Ellipse extends Shape
 {
     protected $cx = 0;
@@ -19,17 +21,20 @@ class Ellipse extends Shape
     {
         parent::start($attributes);
 
+        $width = $this->document->getWidth();
+        $height = $this->document->getHeight();
+
         if (isset($attributes['cx'])) {
-            $this->cx = $attributes['cx'];
+            $this->cx = $this->convertSize($attributes['cx'], $width);
         }
         if (isset($attributes['cy'])) {
-            $this->cy = $attributes['cy'];
+            $this->cy = $this->convertSize($attributes['cy'], $height);
         }
         if (isset($attributes['rx'])) {
-            $this->rx = $attributes['rx'];
+            $this->rx = $this->convertSize($attributes['rx'], $width);
         }
         if (isset($attributes['ry'])) {
-            $this->ry = $attributes['ry'];
+            $this->ry = $this->convertSize($attributes['ry'], $height);
         }
 
         $this->document->getSurface()->ellipse($this->cx, $this->cy, $this->rx, $this->ry, 0, 0, 360, false);
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Image.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Image.php
index cce8a5e270..bda17ea314 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Image.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Image.php
@@ -8,6 +8,8 @@
 
 namespace Svg\Tag;
 
+use Svg\Style;
+
 class Image extends AbstractTag
 {
     protected $x = 0;
@@ -28,31 +30,35 @@ class Image extends AbstractTag
 
     public function start($attributes)
     {
-        $document = $this->document;
         $height = $this->document->getHeight();
+        $width = $this->document->getWidth();
         $this->y = $height;
 
         if (isset($attributes['x'])) {
-            $this->x = $attributes['x'];
+            $this->x = $this->convertSize($attributes['x'], $width);
         }
         if (isset($attributes['y'])) {
-            $this->y = $height - $attributes['y'];
+            $this->y = $height - $this->convertSize($attributes['y'], $height);
         }
 
         if (isset($attributes['width'])) {
-            $this->width = $attributes['width'];
+            $this->width = $this->convertSize($attributes['width'], $width);
         }
         if (isset($attributes['height'])) {
-            $this->height = $attributes['height'];
+            $this->height = $this->convertSize($attributes['height'], $height);
         }
 
         if (isset($attributes['xlink:href'])) {
             $this->href = $attributes['xlink:href'];
         }
 
-        $document->getSurface()->transform(1, 0, 0, -1, 0, $height);
+        if (isset($attributes['href'])) {
+            $this->href = $attributes['href'];
+        }
+
+        $this->document->getSurface()->transform(1, 0, 0, -1, 0, $height);
 
-        $document->getSurface()->drawImage($this->href, $this->x, $this->y, $this->width, $this->height);
+        $this->document->getSurface()->drawImage($this->href, $this->x, $this->y, $this->width, $this->height);
     }
 
     protected function after()
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Line.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Line.php
index 80997413cf..fb3b64c482 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Line.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Line.php
@@ -8,6 +8,8 @@
 
 namespace Svg\Tag;
 
+use Svg\Style;
+
 class Line extends Shape
 {
     protected $x1 = 0;
@@ -18,17 +20,20 @@ class Line extends Shape
 
     public function start($attributes)
     {
+        $height = $this->document->getHeight();
+        $width = $this->document->getWidth();
+
         if (isset($attributes['x1'])) {
-            $this->x1 = $attributes['x1'];
+            $this->x1 = $this->convertSize($attributes['x1'], $width);
         }
         if (isset($attributes['y1'])) {
-            $this->y1 = $attributes['y1'];
+            $this->y1 = $this->convertSize($attributes['y1'], $height);
         }
         if (isset($attributes['x2'])) {
-            $this->x2 = $attributes['x2'];
+            $this->x2 = $this->convertSize($attributes['x2'], $width);
         }
         if (isset($attributes['y2'])) {
-            $this->y2 = $attributes['y2'];
+            $this->y2 = $this->convertSize($attributes['y2'], $height);
         }
 
         $surface = $this->document->getSurface();
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Path.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Path.php
index c79ba658e5..3dce7a6195 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Path.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Path.php
@@ -61,7 +61,7 @@ class Path extends Shape
                 $commandLower = strtolower($c[1]);
 
                 // arcs have special flags that apparently don't require spaces.
-                if ($commandLower === 'a' && preg_match_all(static::ARC_REGEXP, $c[2], $matches)) {
+                if ($commandLower === 'a' && preg_match_all(static::ARC_REGEXP, $c[2], $matches, PREG_PATTERN_ORDER)) {
                     $numberOfMatches = count($matches[0]);
                     for ($k = 0; $k < $numberOfMatches; ++$k) {
                         $path[] = [
@@ -138,7 +138,6 @@ class Path extends Shape
         $tempControlY = null;
         $l = 0; //-((this.width / 2) + $this.pathOffset.x),
         $t = 0; //-((this.height / 2) + $this.pathOffset.y),
-        $methodName = null;
 
         foreach ($path as $current) {
             switch ($current[0]) { // first letter
@@ -333,23 +332,16 @@ class Path extends Shape
                     $tempX = $x + $current[1];
                     $tempY = $y + $current[2];
 
-                    if (preg_match("/[QqTt]/", $previous[0])) {
-                        // If there is no previous command or if the previous command was not a Q, q, T or t,
-                        // assume the control point is coincident with the current point
+                    // calculate reflection of previous control points
+                    if (preg_match('/[QqT]/', $previous[0])) {
+                        $controlX = 2 * $x - $controlX;
+                        $controlY = 2 * $y - $controlY;
+                    } elseif ($previous[0] === 't') {
+                        $controlX = 2 * $x - $tempControlX;
+                        $controlY = 2 * $y - $tempControlY;
+                    } else {
                         $controlX = $x;
                         $controlY = $y;
-                    } else {
-                        if ($previous[0] === 't') {
-                            // calculate reflection of previous control points for t
-                            $controlX = 2 * $x - $tempControlX;
-                            $controlY = 2 * $y - $tempControlY;
-                        } else {
-                            if ($previous[0] === 'q') {
-                                // calculate reflection of previous control points for q
-                                $controlX = 2 * $x - $controlX;
-                                $controlY = 2 * $y - $controlY;
-                            }
-                        }
                     }
 
                     $tempControlX = $controlX;
@@ -363,8 +355,6 @@ class Path extends Shape
                     );
                     $x = $tempX;
                     $y = $tempY;
-                    $controlX = $x + $current[1];
-                    $controlY = $y + $current[2];
                     break;
 
                 case 'T':
@@ -372,8 +362,14 @@ class Path extends Shape
                     $tempY = $current[2];
 
                     // calculate reflection of previous control points
-                    $controlX = 2 * $x - $controlX;
-                    $controlY = 2 * $y - $controlY;
+                    if (preg_match('/[QqTt]/', $previous[0])) {
+                        $controlX = 2 * $x - $controlX;
+                        $controlY = 2 * $y - $controlY;
+                    } else {
+                        $controlX = $x;
+                        $controlY = $y;
+                    }
+
                     $surface->quadraticCurveTo(
                         $controlX + $l,
                         $controlY + $t,
@@ -385,7 +381,6 @@ class Path extends Shape
                     break;
 
                 case 'a':
-                    // TODO: optimize this
                     $this->drawArc(
                         $surface,
                         $x + $l,
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php
index 6cef9f62da..e7ca92a1b6 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php
@@ -13,16 +13,25 @@ class Polygon extends Shape
     public function start($attributes)
     {
         $tmp = array();
-        preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp);
+        preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp, PREG_PATTERN_ORDER);
 
         $points = $tmp[0];
         $count = count($points);
 
+        if ($count < 4) {
+            // nothing to draw
+            return;
+        }
+
         $surface = $this->document->getSurface();
         list($x, $y) = $points;
         $surface->moveTo($x, $y);
 
         for ($i = 2; $i < $count; $i += 2) {
+            if ($i + 1 === $count) {
+                // invalid trailing point
+                continue;
+            }
             $x = $points[$i];
             $y = $points[$i + 1];
             $surface->lineTo($x, $y);
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Polyline.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Polyline.php
index 68751e1aae..45e2131ecb 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Polyline.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Polyline.php
@@ -13,16 +13,25 @@ class Polyline extends Shape
     public function start($attributes)
     {
         $tmp = array();
-        preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp);
+        preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp, PREG_PATTERN_ORDER);
 
         $points = $tmp[0];
         $count = count($points);
 
+        if ($count < 4) {
+            // nothing to draw
+            return;
+        }
+
         $surface = $this->document->getSurface();
         list($x, $y) = $points;
         $surface->moveTo($x, $y);
 
         for ($i = 2; $i < $count; $i += 2) {
+            if ($i + 1 === $count) {
+                // invalid trailing point
+                continue;
+            }
             $x = $points[$i];
             $y = $points[$i + 1];
             $surface->lineTo($x, $y);
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Rect.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Rect.php
index 2bff2131bd..b5f3f774b4 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Rect.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Rect.php
@@ -8,6 +8,8 @@
 
 namespace Svg\Tag;
 
+use Svg\Style;
+
 class Rect extends Shape
 {
     protected $x = 0;
@@ -19,28 +21,21 @@ class Rect extends Shape
 
     public function start($attributes)
     {
+        $width = $this->document->getWidth();
+        $height = $this->document->getHeight();
+
         if (isset($attributes['x'])) {
-            $this->x = $attributes['x'];
+            $this->x = $this->convertSize($attributes['x'], $width);
         }
         if (isset($attributes['y'])) {
-            $this->y = $attributes['y'];
+            $this->y = $this->convertSize($attributes['y'], $height);
         }
 
         if (isset($attributes['width'])) {
-            if ('%' === substr($attributes['width'], -1)) {
-                $factor = substr($attributes['width'], 0, -1) / 100;
-                $this->width = $this->document->getWidth() * $factor;
-            } else {
-                $this->width = $attributes['width'];
-            }
+            $this->width = $this->convertSize($attributes['width'], $width);
         }
         if (isset($attributes['height'])) {
-            if ('%' === substr($attributes['height'], -1)) {
-                $factor = substr($attributes['height'], 0, -1) / 100;
-                $this->height = $this->document->getHeight() * $factor;
-            } else {
-                $this->height = $attributes['height'];
-            }
+            $this->height = $this->convertSize($attributes['height'], $height);
         }
 
         if (isset($attributes['rx'])) {
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Shape.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Shape.php
index 0a2bfaef5d..767e81dbfe 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Shape.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Shape.php
@@ -38,7 +38,7 @@ class Shape extends AbstractTag
 
             if ($fill) {
                 if ($stroke) {
-                    $surface->fillStroke();
+                    $surface->fillStroke(false);
                 } else {
 //                    if (is_string($style->fill)) {
 //                        /** @var LinearGradient|RadialGradient $gradient */
@@ -51,7 +51,7 @@ class Shape extends AbstractTag
                 }
             }
             elseif ($stroke) {
-                $surface->stroke();
+                $surface->stroke(false);
             }
             else {
                 $surface->endPath();
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Text.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Text.php
index 83b5afe6a0..80e08a600e 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Text.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/Text.php
@@ -8,6 +8,8 @@
 
 namespace Svg\Tag;
 
+use Svg\Style;
+
 class Text extends Shape
 {
     protected $x = 0;
@@ -16,18 +18,18 @@ class Text extends Shape
 
     public function start($attributes)
     {
-        $document = $this->document;
         $height = $this->document->getHeight();
         $this->y = $height;
 
         if (isset($attributes['x'])) {
-            $this->x = $attributes['x'];
+            $width = $this->document->getWidth();
+            $this->x = $this->convertSize($attributes['x'], $width);
         }
         if (isset($attributes['y'])) {
-            $this->y = $height - $attributes['y'];
+            $this->y = $height - $this->convertSize($attributes['y'], $height);
         }
 
-        $document->getSurface()->transform(1, 0, 0, -1, 0, $height);
+        $this->document->getSurface()->transform(1, 0, 0, -1, 0, $height);
     }
 
     public function end()
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/UseTag.php b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/UseTag.php
index e5681a13d9..c5f00ea9d3 100644
--- a/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/UseTag.php
+++ b/civicrm/vendor/phenx/php-svg-lib/src/Svg/Tag/UseTag.php
@@ -38,7 +38,7 @@ class UseTag extends AbstractTag
 
         $document = $this->getDocument();
 
-        $link = $attributes["xlink:href"];
+        $link = $attributes["href"] ?? $attributes["xlink:href"];
         $this->reference = $document->getDef($link);
 
         if ($this->reference) {
@@ -69,12 +69,18 @@ class UseTag extends AbstractTag
             return;
         }
 
-        $attributes = array_merge($this->reference->attributes, $attributes);
+        $mergedAttributes = $this->reference->attributes;
+        $attributesToNotMerge = ['x', 'y', 'width', 'height'];
+        foreach ($attributes as $attrKey => $attrVal) {
+            if (!in_array($attrKey, $attributesToNotMerge) && !isset($mergedAttributes[$attrKey])) {
+                $mergedAttributes[$attrKey] = $attrVal;
+            }
+        }
 
-        $this->reference->handle($attributes);
+        $this->reference->handle($mergedAttributes);
 
         foreach ($this->reference->children as $_child) {
-            $_attributes = array_merge($_child->attributes, $attributes);
+            $_attributes = array_merge($_child->attributes, $mergedAttributes);
             $_child->handle($_attributes);
         }
     }
diff --git a/civicrm/vendor/phenx/php-svg-lib/src/autoload.php b/civicrm/vendor/phenx/php-svg-lib/src/autoload.php
deleted file mode 100644
index b0e2b9cc44..0000000000
--- a/civicrm/vendor/phenx/php-svg-lib/src/autoload.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/**
- * @package php-svg-lib
- * @link    http://github.com/PhenX/php-svg-lib
- * @author  Fabien Ménager <fabien.menager@gmail.com>
- * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html
- */
-
-spl_autoload_register(function($class) {
-  if (0 === strpos($class, "Svg")) {
-    $file = str_replace('\\', DIRECTORY_SEPARATOR, $class);
-    $file = realpath(__DIR__ . DIRECTORY_SEPARATOR . $file . '.php');
-    if (file_exists($file)) {
-      include_once $file;
-    }
-  }
-});
\ No newline at end of file
diff --git a/civicrm/xml/schema/Core/OptionGroup.xml b/civicrm/xml/schema/Core/OptionGroup.xml
index ae12e22995..f4e3f62031 100644
--- a/civicrm/xml/schema/Core/OptionGroup.xml
+++ b/civicrm/xml/schema/Core/OptionGroup.xml
@@ -42,8 +42,7 @@
   <field>
     <name>description</name>
     <title>Option Group Description</title>
-    <type>varchar</type>
-    <length>255</length>
+    <type>text</type>
     <localizable>true</localizable>
     <comment>Option group description.</comment>
     <add>1.5</add>
diff --git a/civicrm/xml/templates/civicrm_data.tpl b/civicrm/xml/templates/civicrm_data.tpl
index 2012ca4755..b9d4e7883a 100644
--- a/civicrm/xml/templates/civicrm_data.tpl
+++ b/civicrm/xml/templates/civicrm_data.tpl
@@ -119,91 +119,102 @@ VALUES
 -- option groups and values for 'preferred communication methods' , 'activity types', 'gender', etc.
 
 INSERT INTO
-   `civicrm_option_group` (`name`, `title`, `data_type`, `is_reserved`, `is_active`, `is_locked`, `option_value_fields`)
+   `civicrm_option_group` (`name`, `title`, `data_type`, `is_reserved`, `is_active`, `is_locked`, `option_value_fields`, `description`)
 VALUES
-   ('preferred_communication_method', '{ts escape="sql"}Preferred Communication Method{/ts}'     , NULL,      1, 1, 0, 'name,label,description'),
-   ('activity_type'                 , '{ts escape="sql"}Activity Type{/ts}'                      , 'Integer', 1, 1, 0, 'name,label,description,icon'),
-   ('gender'                        , '{ts escape="sql"}Gender{/ts}'                             , 'Integer', 1, 1, 0, 'name,label,description'),
-   ('instant_messenger_service'     , '{ts escape="sql"}Instant Messenger (IM) screen-names{/ts}', NULL,      1, 1, 0, 'name,label,description'),
-   ('mobile_provider'               , '{ts escape="sql"}Mobile Phone Providers{/ts}'             , NULL,      1, 1, 0, 'name,label,description'),
-   ('individual_prefix'             , '{ts escape="sql"}Individual contact prefixes{/ts}'        , NULL,      1, 1, 0, 'name,label,description'),
-   ('individual_suffix'             , '{ts escape="sql"}Individual contact suffixes{/ts}'        , NULL,      1, 1, 0, 'name,label,description'),
-   ('acl_role'                      , '{ts escape="sql"}ACL Role{/ts}'                           , NULL,      1, 1, 0, 'name,label,description'),
-   ('accept_creditcard'             , '{ts escape="sql"}Accepted Credit Cards{/ts}'              , NULL,      1, 1, 0, 'name,label,description'),
-   ('payment_instrument'            , '{ts escape="sql"}Payment Methods{/ts}'                    , 'Integer', 1, 1, 0, 'name,label,description'),
-   ('contribution_status'           , '{ts escape="sql"}Contribution Status{/ts}'                , NULL,      1, 1, 1, 'name,label,description'),
-   ('pcp_status'                    , '{ts escape="sql"}PCP Status{/ts}'                         , NULL,      1, 1, 1, 'name,label,description'),
-   ('pcp_owner_notify'              , '{ts escape="sql"}PCP owner notifications{/ts}'            , NULL,      1, 1, 1, 'name,label,description'),
-   ('participant_role'              , '{ts escape="sql"}Participant Role{/ts}'                   , 'Integer', 1, 1, 0, 'name,label,description'),
-   ('event_type'                    , '{ts escape="sql"}Event Type{/ts}'                         , 'Integer', 1, 1, 0, 'name,label,description'),
-   ('contact_view_options'          , '{ts escape="sql"}Contact View Options{/ts}'               , NULL,      1, 1, 1, 'name,label,description'),
-   ('contact_smart_group_display'   , '{ts escape="sql"}Contact Smart Group View Options{/ts}'   , NULL,      1, 1, 1, 'name,label,description'),
-   ('contact_edit_options'          , '{ts escape="sql"}Contact Edit Options{/ts}'               , NULL,      1, 1, 1, 'name,label,description'),
-   ('advanced_search_options'       , '{ts escape="sql"}Advanced Search Options{/ts}'            , NULL,      1, 1, 1, 'name,label,description'),
-   ('user_dashboard_options'        , '{ts escape="sql"}User Dashboard Options{/ts}'             , NULL,      1, 1, 1, 'name,label,description'),
-   ('address_options'               , '{ts escape="sql"}Addressing Options{/ts}'                 , NULL,      1, 1, 0, 'name,label,description'),
-   ('group_type'                    , '{ts escape="sql"}Group Type{/ts}'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('custom_search'                 , '{ts escape="sql"}Custom Search{/ts}'                      , NULL,      1, 1, 0, 'name,label,description'),
-   ('activity_status'               , '{ts escape="sql"}Activity Status{/ts}'                    , 'Integer', 1, 1, 0, 'name,label,description,color'),
-   ('case_type'                     , '{ts escape="sql"}Case Type{/ts}'                          , NULL,      1, 1, 0, 'name,label,description'),
-   ('case_status'                   , '{ts escape="sql"}Case Status{/ts}'                        , NULL,      1, 1, 0, 'name,label,description,color'),
-   ('participant_listing'           , '{ts escape="sql"}Participant Listing{/ts}'                , NULL,      1, 1, 0, 'name,label,description'),
-   ('safe_file_extension'           , '{ts escape="sql"}Safe File Extension{/ts}'                , NULL,      1, 1, 0, 'name,label,description'),
-   ('from_email_address'            , '{ts escape="sql"}From Email Address{/ts}'                 , NULL,      1, 1, 0, 'name,label,description'),
-   ('mapping_type'                  , '{ts escape="sql"}Mapping Type{/ts}'                       , NULL,      1, 1, 1, 'name,label,description'),
-   ('wysiwyg_editor'                , '{ts escape="sql"}WYSIWYG Editor{/ts}'                     , NULL,      1, 1, 0, 'name,label,description'),
-   ('recur_frequency_units'         , '{ts escape="sql"}Recurring Frequency Units{/ts}'          , NULL,      1, 1, 0, 'name,label,description'),
-   ('phone_type'                    , '{ts escape="sql"}Phone Type{/ts}'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('custom_data_type'              , '{ts escape="sql"}Custom Data Type{/ts}'                   , NULL,      1, 1, 0, 'name,label,description'),
-   ('visibility'                    , '{ts escape="sql"}Visibility{/ts}'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('mail_protocol'                 , '{ts escape="sql"}Mail Protocol{/ts}'                      , NULL,      1, 1, 0, 'name,label,description'),
-   ('priority'                      , '{ts escape="sql"}Priority{/ts}'                           , NULL,      1, 1, 0, 'name,label,description'),
-   ('redaction_rule'                , '{ts escape="sql"}Redaction Rule{/ts}'                     , NULL,      1, 1, 0, 'name,label,description'),
-   ('report_template'               , '{ts escape="sql"}Report Template{/ts}'                    , NULL,      1, 1, 0, 'name,label,description'),
-   ('email_greeting'                , '{ts escape="sql"}Email Greeting Type{/ts}'                , NULL,      1, 1, 0, 'name,label,description'),
-   ('postal_greeting'               , '{ts escape="sql"}Postal Greeting Type{/ts}'               , NULL,      1, 1, 0, 'name,label,description'),
-   ('addressee'                     , '{ts escape="sql"}Addressee Type{/ts}'                     , NULL,      1, 1, 0, 'name,label,description'),
-   ('contact_autocomplete_options'  , '{ts escape="sql"}Autocomplete Contact Search{/ts}'        , NULL,      1, 1, 1, 'name,label,description'),
-   ('contact_reference_options'     , '{ts escape="sql"}Contact Reference Autocomplete Options{/ts}', NULL,   1, 1, 1, 'name,label,description'),
-   ('website_type'                  , '{ts escape="sql"}Website Type{/ts}'                       , NULL,      1, 1, 0, 'name,label,description'),
-   ('tag_used_for'                  , '{ts escape="sql"}Tag Used For{/ts}'                       , NULL,      1, 1, 1, 'name,label,description'),
-   ('note_used_for'                 , '{ts escape="sql"}Note Used For{/ts}'                      , NULL,      1, 1, 1, 'name,label,description'),
-   ('currencies_enabled'            , '{ts escape="sql"}Currencies Enabled{/ts}'                 , NULL,      1, 1, 0, 'name,label,description'),
-   ('event_badge'                   , '{ts escape="sql"}Event Name Badge{/ts}'                   , NULL,      1, 1, 0, 'name,label,description'),
-   ('note_privacy'                  , '{ts escape="sql"}Privacy levels for notes{/ts}'           , NULL,      1, 1, 0, 'name,label,description'),
-   ('campaign_type'                 , '{ts escape="sql"}Campaign Type{/ts}'                      , NULL,      1, 1, 0, 'name,label,description'),
-   ('campaign_status'               , '{ts escape="sql"}Campaign Status{/ts}'                    , NULL,      1, 1, 0, 'name,label,description'),
-   ('system_extensions'             , '{ts escape="sql"}CiviCRM Extensions{/ts}'                 , NULL,      1, 1, 0, 'name,label,description'),
-   ('mail_approval_status'          , '{ts escape="sql"}CiviMail Approval Status{/ts}'           , NULL,      1, 1, 0, 'name,label,description'),
-   ('engagement_index'              , '{ts escape="sql"}Engagement Index{/ts}'                   , NULL,      1, 1, 0, 'name,label,description'),
-   ('cg_extend_objects'             , '{ts escape="sql"}Objects a custom group extends to{/ts}'  , NULL,      1, 1, 0, 'name,label,description'),
-   ('paper_size'                    , '{ts escape="sql"}Paper Size{/ts}'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('pdf_format'                    , '{ts escape="sql"}PDF Page Format{/ts}'                    , NULL,      1, 1, 0, 'name,label,description'),
-   ('label_format'                  , '{ts escape="sql"}Mailing Label Format{/ts}'               , NULL,      1, 1, 0, 'name,label,description'),
-   ('activity_contacts'             , '{ts escape="sql"}Activity Contacts{/ts}'                  , NULL,      1, 1, 1, 'name,label,description'),
-   ('account_relationship'          , '{ts escape="sql"}Account Relationship{/ts}'               , NULL,      1, 1, 0, 'name,label,description'),
-   ('event_contacts'                , '{ts escape="sql"}Event Recipients{/ts}'                   , NULL,      1, 1, 0, 'name,label,description'),
-   ('conference_slot'               , '{ts escape="sql"}Conference Slot{/ts}'                    , NULL,      1, 1, 0, 'name,label,description'),
-   ('batch_type'                    , '{ts escape="sql"}Batch Type{/ts}'                         , NULL,      1, 1, 1, 'name,label,description'),
-   ('batch_mode'                    , '{ts escape="sql"}Batch Mode{/ts}'                         , NULL,      1, 1, 1, 'name,label,description'),
-   ('batch_status'                  , '{ts escape="sql"}Batch Status{/ts}'                       , NULL,      1, 1, 1, 'name,label,description'),
-   ('sms_api_type'                  , '{ts escape="sql"}Api Type{/ts}'                           , NULL,      1, 1, 0, 'name,label,description'),
-   ('sms_provider_name'             , '{ts escape="sql"}Sms Provider Internal Name{/ts}'         , NULL,      1, 1, 0, 'name,label,description'),
-   ('auto_renew_options'            , '{ts escape="sql"}Auto Renew Options{/ts}'                 , NULL,      1, 1, 1, 'name,label,description'),
-   ('financial_account_type'        , '{ts escape="sql"}Financial Account Type{/ts}'             , NULL,      1, 1, 0, 'name,label,description'),
-   ('financial_item_status'         , '{ts escape="sql"}Financial Item Status{/ts}'              , NULL,      1, 1, 1, 'name,label,description'),
-   ('label_type'                    , '{ts escape="sql"}Label Type{/ts}'                         , NULL,      1, 1, 0, 'name,label,description'),
-   ('name_badge'                    , '{ts escape="sql"}Name Badge Format{/ts}'                  , NULL,      1, 1, 0, 'name,label,description'),
-   ('communication_style'           , '{ts escape="sql"}Communication Style{/ts}'                , NULL,      1, 1, 0, 'name,label,description'),
-   ('msg_mode'                      , '{ts escape="sql"}Message Mode{/ts}'                       , NULL,      1, 1, 0, 'name,label,description'),
-   ('contact_date_reminder_options' , '{ts escape="sql"}Contact Date Reminder Options{/ts}'      , NULL,      1, 1, 1, 'name,label,description'),
-   ('wysiwyg_presets'               , '{ts escape="sql"}WYSIWYG Editor Presets{/ts}'             , NULL,      1, 1, 0, 'name,label,description'),
-   ('relative_date_filters'         , '{ts escape="sql"}Relative Date Filters{/ts}'              , NULL,      1, 1, 0, 'name,label,description'),
-   ('pledge_status'                 , '{ts escape="sql"}Pledge Status{/ts}'                      , NULL,      1, 1, 1, 'name,label,description'),
-   ('contribution_recur_status'     , '{ts escape="sql"}Recurring Contribution Status{/ts}'      , NULL,      1, 1, 1, 'name,label,description'),
-   ('environment'                   , '{ts escape="sql"}Environment{/ts}'                        , NULL,      1, 1, 0, 'name,label,description'),
-   ('activity_default_assignee'     , '{ts escape="sql"}Activity default assignee{/ts}'          , NULL,      1, 1, 0, 'name,label,description'),
-   ('entity_batch_extends'          , '{ts escape="sql"}Entity Batch Extends{/ts}'               , NULL,      1, 1, 0, 'name,label,description');
+   ('preferred_communication_method', '{ts escape="sql"}Preferred Communication Method{/ts}'     , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('activity_type'                 , '{ts escape="sql"}Activity Type{/ts}'                      , 'Integer', 1, 1, 0, 'name,label,description,icon',
+     '{ts escape="sql"}Activities track interactions with contacts. Some activity types are reserved for use by automated processes, others can be freely configured.{/ts}'),
+   ('gender'                        , '{ts escape="sql"}Gender{/ts}'                             , 'Integer', 1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}CiviCRM is pre-configured with standard options for individual gender (Male, Female, Other). Modify these options as needed for your installation.{/ts}'),
+   ('instant_messenger_service'     , '{ts escape="sql"}Instant Messenger (IM) screen-names{/ts}', NULL,      1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}Commonly-used messaging apps are listed here. Administrators may define as many additional providers as needed.{/ts}'),
+   ('mobile_provider'               , '{ts escape="sql"}Mobile Phone Providers{/ts}'             , NULL,      1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}When recording mobile phone numbers for contacts, it may be useful to include the Mobile Phone Service Provider (e.g. Cingular, Sprint, etc.). CiviCRM is installed with the most commonly encountered service providers. Administrators may define as many additional providers as needed.{/ts}'),
+   ('individual_prefix'             , '{ts escape="sql"}Individual contact prefixes{/ts}'        , NULL,      1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}CiviCRM is pre-configured with standard options for individual contact prefixes (Ms., Mr., Dr. etc.). Customize these options and add new ones as needed for your installation.{/ts}'),
+   ('individual_suffix'             , '{ts escape="sql"}Individual contact suffixes{/ts}'        , NULL,      1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}CiviCRM is pre-configured with standard options for individual contact name suffixes (Jr., Sr., II etc.). Customize these options and add new ones as needed for your installation.{/ts}'),
+   ('acl_role'                      , '{ts escape="sql"}ACL Role{/ts}'                           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('accept_creditcard'             , '{ts escape="sql"}Accepted Credit Cards{/ts}'              , NULL,      1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}The following credit card options will be offered to contributors using Online Contribution pages. You will need to verify which cards are accepted by your chosen Payment Processor and update these entries accordingly.{/ts}{ts escape="sql"}IMPORTANT: These options do not control credit card/payment method choices for sites and/or contributors using the PayPal Express service (e.g. where billing information is collected on the Payment Processor\'s website).{/ts}'),
+   ('payment_instrument'            , '{ts escape="sql"}Payment Methods{/ts}'                    , 'Integer', 1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}You may choose to record the payment method used for each contribution and fee. Reserved payment methods are required - you may modify their labels but they can not be deleted (e.g. Check, Credit Card, Debit Card). If your site requires additional payment methods, you can add them here. You can associate each payment method with a Financial Account which specifies where the payment is going (e.g. a bank account for checks and cash).{/ts}'),
+   ('contribution_status'           , '{ts escape="sql"}Contribution Status{/ts}'                , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('pcp_status'                    , '{ts escape="sql"}PCP Status{/ts}'                         , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('pcp_owner_notify'              , '{ts escape="sql"}PCP owner notifications{/ts}'            , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('participant_role'              , '{ts escape="sql"}Participant Role{/ts}'                   , 'Integer', 1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}Define participant roles for events here (e.g. Attendee, Host, Speaker...). You can then assign roles and search for participants by role.{/ts}'),
+   ('event_type'                    , '{ts escape="sql"}Event Type{/ts}'                         , 'Integer', 1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}Use Event Types to categorize your events. Event feeds can be filtered by Event Type and participant searches can use Event Type as a criteria.{/ts}'),
+   ('contact_view_options'          , '{ts escape="sql"}Contact View Options{/ts}'               , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('contact_smart_group_display'   , '{ts escape="sql"}Contact Smart Group View Options{/ts}'   , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('contact_edit_options'          , '{ts escape="sql"}Contact Edit Options{/ts}'               , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('advanced_search_options'       , '{ts escape="sql"}Advanced Search Options{/ts}'            , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('user_dashboard_options'        , '{ts escape="sql"}User Dashboard Options{/ts}'             , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('address_options'               , '{ts escape="sql"}Addressing Options{/ts}'                 , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('group_type'                    , '{ts escape="sql"}Group Type{/ts}'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('custom_search'                 , '{ts escape="sql"}Custom Search{/ts}'                      , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('activity_status'               , '{ts escape="sql"}Activity Status{/ts}'                    , 'Integer', 1, 1, 0, 'name,label,description,color', NULL),
+   ('case_type'                     , '{ts escape="sql"}Case Type{/ts}'                          , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('case_status'                   , '{ts escape="sql"}Case Status{/ts}'                        , NULL,      1, 1, 0, 'name,label,description,color', NULL),
+   ('participant_listing'           , '{ts escape="sql"}Participant Listing{/ts}'                , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('safe_file_extension'           , '{ts escape="sql"}Safe File Extension{/ts}'                , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('from_email_address'            , '{ts escape="sql"}From Email Address{/ts}'                 , NULL,      1, 1, 0, 'name,label,description',
+     '{ts escape="sql"}By default, CiviCRM uses the primary email address of the logged in user as the FROM address when sending emails to contacts. However, you can use this page to define one or more general Email Addresses that can be selected as an alternative. EXAMPLE: "Client Services" <clientservices@example.org>.{/ts}'),
+   ('mapping_type'                  , '{ts escape="sql"}Mapping Type{/ts}'                       , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('wysiwyg_editor'                , '{ts escape="sql"}WYSIWYG Editor{/ts}'                     , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('recur_frequency_units'         , '{ts escape="sql"}Recurring Frequency Units{/ts}'          , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('phone_type'                    , '{ts escape="sql"}Phone Type{/ts}'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('custom_data_type'              , '{ts escape="sql"}Custom Data Type{/ts}'                   , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('visibility'                    , '{ts escape="sql"}Visibility{/ts}'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('mail_protocol'                 , '{ts escape="sql"}Mail Protocol{/ts}'                      , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('priority'                      , '{ts escape="sql"}Priority{/ts}'                           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('redaction_rule'                , '{ts escape="sql"}Redaction Rule{/ts}'                     , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('report_template'               , '{ts escape="sql"}Report Template{/ts}'                    , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('email_greeting'                , '{ts escape="sql"}Email Greeting Type{/ts}'                , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('postal_greeting'               , '{ts escape="sql"}Postal Greeting Type{/ts}'               , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('addressee'                     , '{ts escape="sql"}Addressee Type{/ts}'                     , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('contact_autocomplete_options'  , '{ts escape="sql"}Autocomplete Contact Search{/ts}'        , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('contact_reference_options'     , '{ts escape="sql"}Contact Reference Autocomplete Options{/ts}', NULL,   1, 1, 1, 'name,label,description', NULL),
+   ('website_type'                  , '{ts escape="sql"}Website Type{/ts}'                       , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('tag_used_for'                  , '{ts escape="sql"}Tag Used For{/ts}'                       , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('note_used_for'                 , '{ts escape="sql"}Note Used For{/ts}'                      , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('currencies_enabled'            , '{ts escape="sql"}Currencies Enabled{/ts}'                 , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('event_badge'                   , '{ts escape="sql"}Event Name Badge{/ts}'                   , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('note_privacy'                  , '{ts escape="sql"}Privacy levels for notes{/ts}'           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('campaign_type'                 , '{ts escape="sql"}Campaign Type{/ts}'                      , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('campaign_status'               , '{ts escape="sql"}Campaign Status{/ts}'                    , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('system_extensions'             , '{ts escape="sql"}CiviCRM Extensions{/ts}'                 , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('mail_approval_status'          , '{ts escape="sql"}CiviMail Approval Status{/ts}'           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('engagement_index'              , '{ts escape="sql"}Engagement Index{/ts}'                   , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('cg_extend_objects'             , '{ts escape="sql"}Objects a custom group extends to{/ts}'  , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('paper_size'                    , '{ts escape="sql"}Paper Size{/ts}'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('pdf_format'                    , '{ts escape="sql"}PDF Page Format{/ts}'                    , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('label_format'                  , '{ts escape="sql"}Mailing Label Format{/ts}'               , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('activity_contacts'             , '{ts escape="sql"}Activity Contacts{/ts}'                  , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('account_relationship'          , '{ts escape="sql"}Account Relationship{/ts}'               , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('event_contacts'                , '{ts escape="sql"}Event Recipients{/ts}'                   , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('conference_slot'               , '{ts escape="sql"}Conference Slot{/ts}'                    , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('batch_type'                    , '{ts escape="sql"}Batch Type{/ts}'                         , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('batch_mode'                    , '{ts escape="sql"}Batch Mode{/ts}'                         , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('batch_status'                  , '{ts escape="sql"}Batch Status{/ts}'                       , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('sms_api_type'                  , '{ts escape="sql"}Api Type{/ts}'                           , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('sms_provider_name'             , '{ts escape="sql"}Sms Provider Internal Name{/ts}'         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('auto_renew_options'            , '{ts escape="sql"}Auto Renew Options{/ts}'                 , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('financial_account_type'        , '{ts escape="sql"}Financial Account Type{/ts}'             , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('financial_item_status'         , '{ts escape="sql"}Financial Item Status{/ts}'              , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('label_type'                    , '{ts escape="sql"}Label Type{/ts}'                         , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('name_badge'                    , '{ts escape="sql"}Name Badge Format{/ts}'                  , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('communication_style'           , '{ts escape="sql"}Communication Style{/ts}'                , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('msg_mode'                      , '{ts escape="sql"}Message Mode{/ts}'                       , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('contact_date_reminder_options' , '{ts escape="sql"}Contact Date Reminder Options{/ts}'      , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('wysiwyg_presets'               , '{ts escape="sql"}WYSIWYG Editor Presets{/ts}'             , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('relative_date_filters'         , '{ts escape="sql"}Relative Date Filters{/ts}'              , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('pledge_status'                 , '{ts escape="sql"}Pledge Status{/ts}'                      , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('contribution_recur_status'     , '{ts escape="sql"}Recurring Contribution Status{/ts}'      , NULL,      1, 1, 1, 'name,label,description', NULL),
+   ('environment'                   , '{ts escape="sql"}Environment{/ts}'                        , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('activity_default_assignee'     , '{ts escape="sql"}Activity default assignee{/ts}'          , NULL,      1, 1, 0, 'name,label,description', NULL),
+   ('entity_batch_extends'          , '{ts escape="sql"}Entity Batch Extends{/ts}'               , NULL,      1, 1, 0, 'name,label,description', NULL);
 
 SELECT @option_group_id_pcm            := max(id) from civicrm_option_group where name = 'preferred_communication_method';
 SELECT @option_group_id_act            := max(id) from civicrm_option_group where name = 'activity_type';
@@ -601,24 +612,24 @@ VALUES
   (@option_group_id_report , '{ts escape="sql"}Database Log Report{/ts}',                     'contact/log',                    'CRM_Report_Form_Contact_Log',                    NULL, 0, 0, 27, '{ts escape="sql"}Log of contact and activity records created or updated in a given date range.{/ts}', 0, 0, 1, NULL, NULL, NULL),
   (@option_group_id_report , '{ts escape="sql"}Activity Summary Report{/ts}',                 'activitySummary',                'CRM_Report_Form_ActivitySummary',                NULL, 0, 0, 28, '{ts escape="sql"}Shows activity statistics by type / date{/ts}', 0, 0, 1, NULL, NULL, NULL),
   (@option_group_id_report, '{ts escape="sql"}Bookkeeping Transactions Report{/ts}',          'contribute/bookkeeping',         'CRM_Report_Form_Contribute_Bookkeeping',         NULL, 0, 0, 29,    '{ts escape="sql"}Shows Bookkeeping Transactions Report{/ts}', 0, 0, 1, 2, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Participant list Count Report{/ts}'{/localize}, 'event/participantlist', 'CRM_Report_Form_Event_ParticipantListCount', NULL, 0, 0, 31, {localize}'{ts escape="sql"}Shows the Participant list with Participant Count.{/ts}'{/localize}, 0, 0, 1, @eventCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Income Count Summary Report{/ts}'{/localize}, 'event/incomesummary', 'CRM_Report_Form_Event_IncomeCountSummary', NULL, 0, 0, 32, {localize}'{ts escape="sql"}Shows the Income Summary of events with Count.{/ts}'{/localize}, 0, 0, 1, @eventCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Case Detail Report{/ts}'{/localize}, 'case/detail', 'CRM_Report_Form_Case_Detail', NULL, 0, 0, 33, {localize}'{ts escape="sql"}Case Details{/ts}'{/localize}, 0, 0, 1, @caseCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Mail Bounce Report{/ts}'{/localize}, 'Mailing/bounce', 'CRM_Report_Form_Mailing_Bounce', NULL, 0, 0, 34, {localize}'{ts escape="sql"}Bounce Report for mailings{/ts}'{/localize}, 0, 0, 1, @mailCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Mail Summary Report{/ts}'{/localize}, 'Mailing/summary', 'CRM_Report_Form_Mailing_Summary', NULL, 0, 0, 35, {localize}'{ts escape="sql"}Summary statistics for mailings{/ts}'{/localize}, 0, 0, 1, @mailCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Mail Opened Report{/ts}'{/localize}, 'Mailing/opened', 'CRM_Report_Form_Mailing_Opened', NULL, 0, 0, 36, {localize}'{ts escape="sql"}Display contacts who opened emails from a mailing{/ts}'{/localize}, 0, 0, 1, @mailCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Mail Click-Through Report{/ts}'{/localize}, 'Mailing/clicks', 'CRM_Report_Form_Mailing_Clicks', NULL, 0, 0, 37, {localize}'{ts escape="sql"}Display clicks from each mailing{/ts}'{/localize}, 0, 0, 1, @mailCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Contact Logging Report (Summary){/ts}'{/localize}, 'logging/contact/summary', 'CRM_Report_Form_Contact_LoggingSummary', NULL, 0, 0, 38, {localize}'{ts escape="sql"}Contact modification report for the logging infrastructure (summary).{/ts}'{/localize}, 0, 0, 0, NULL, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Contact Logging Report (Detail){/ts}'{/localize}, 'logging/contact/detail', 'CRM_Report_Form_Contact_LoggingDetail', NULL, 0, 0, 39, {localize}'{ts escape="sql"}Contact modification report for the logging infrastructure (detail).{/ts}'{/localize}, 0, 0, 0, NULL, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Survey Report (Detail){/ts}'{/localize},    'survey/detail', 'CRM_Report_Form_Campaign_SurveyDetails',  NULL, 0, 0, 43, {localize}'{ts escape="sql"}Detailed report for canvassing, phone-banking, walk lists or other surveys.{/ts}'{/localize}, 0, 0, 1, @campaignCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Personal Campaign Page Report{/ts}'{/localize}, 'contribute/pcp', 'CRM_Report_Form_Contribute_PCP', NULL, 0, 0, 44, {localize}'{ts escape="sql"}Summarizes amount raised and number of contributors for each Personal Campaign Page.{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL),
-  (@option_group_id_report , {localize}'{ts escape="sql"}Pledge Summary Report{/ts}'{/localize}, 'pledge/summary', 'CRM_Report_Form_Pledge_Summary', NULL, 0, 0, 45, {localize}'{ts escape="sql"}Groups and totals pledges by criteria including contact, time period, pledge status, location, etc.{/ts}'{/localize}, 0, 0, 1, @pledgeCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Participant list Count Report{/ts}', 'event/participantlist', 'CRM_Report_Form_Event_ParticipantListCount', NULL, 0, 0, 31, '{ts escape="sql"}Shows the Participant list with Participant Count.{/ts}', 0, 0, 1, @eventCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Income Count Summary Report{/ts}', 'event/incomesummary', 'CRM_Report_Form_Event_IncomeCountSummary', NULL, 0, 0, 32, '{ts escape="sql"}Shows the Income Summary of events with Count.{/ts}', 0, 0, 1, @eventCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Case Detail Report{/ts}', 'case/detail', 'CRM_Report_Form_Case_Detail', NULL, 0, 0, 33, '{ts escape="sql"}Case Details{/ts}', 0, 0, 1, @caseCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Mail Bounce Report{/ts}', 'Mailing/bounce', 'CRM_Report_Form_Mailing_Bounce', NULL, 0, 0, 34, '{ts escape="sql"}Bounce Report for mailings{/ts}', 0, 0, 1, @mailCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Mail Summary Report{/ts}', 'Mailing/summary', 'CRM_Report_Form_Mailing_Summary', NULL, 0, 0, 35, '{ts escape="sql"}Summary statistics for mailings{/ts}', 0, 0, 1, @mailCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Mail Opened Report{/ts}', 'Mailing/opened', 'CRM_Report_Form_Mailing_Opened', NULL, 0, 0, 36, '{ts escape="sql"}Display contacts who opened emails from a mailing{/ts}', 0, 0, 1, @mailCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Mail Click-Through Report{/ts}', 'Mailing/clicks', 'CRM_Report_Form_Mailing_Clicks', NULL, 0, 0, 37, '{ts escape="sql"}Display clicks from each mailing{/ts}', 0, 0, 1, @mailCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Contact Logging Report (Summary){/ts}', 'logging/contact/summary', 'CRM_Report_Form_Contact_LoggingSummary', NULL, 0, 0, 38, '{ts escape="sql"}Contact modification report for the logging infrastructure (summary).{/ts}', 0, 0, 0, NULL, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Contact Logging Report (Detail){/ts}', 'logging/contact/detail', 'CRM_Report_Form_Contact_LoggingDetail', NULL, 0, 0, 39, '{ts escape="sql"}Contact modification report for the logging infrastructure (detail).{/ts}', 0, 0, 0, NULL, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Survey Report (Detail){/ts}',    'survey/detail', 'CRM_Report_Form_Campaign_SurveyDetails',  NULL, 0, 0, 43, '{ts escape="sql"}Detailed report for canvassing, phone-banking, walk lists or other surveys.{/ts}', 0, 0, 1, @campaignCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Personal Campaign Page Report{/ts}', 'contribute/pcp', 'CRM_Report_Form_Contribute_PCP', NULL, 0, 0, 44, '{ts escape="sql"}Summarizes amount raised and number of contributors for each Personal Campaign Page.{/ts}', 0, 0, 1, @contributeCompId, NULL, NULL),
+  (@option_group_id_report , '{ts escape="sql"}Pledge Summary Report{/ts}', 'pledge/summary', 'CRM_Report_Form_Pledge_Summary', NULL, 0, 0, 45, '{ts escape="sql"}Groups and totals pledges by criteria including contact, time period, pledge status, location, etc.{/ts}', 0, 0, 1, @pledgeCompId, NULL, NULL),
   (@option_group_id_report , '{ts escape="sql"}Contribution Aggregate by Relationship{/ts}',                   'contribute/history',              'CRM_Report_Form_Contribute_History',              NULL, 0, 0, 46,  '{ts escape="sql"}List contact's donation history, grouped by year, along with contributions attributed to any of the contact's related contacts.{/ts}', 0, 0, 1, @contributeCompId, NULL, NULL),
-  (@option_group_id_report,  {localize}'{ts escape="sql"}Mail Detail Report{/ts}'{/localize},                                            'mailing/detail',     'CRM_Report_Form_Mailing_Detail',          NULL, 0, 0, 47,  {localize}'{ts escape="sql"}Provides reporting on Intended and Successful Deliveries, Unsubscribes and Opt-outs, Replies and Forwards.{/ts}'{/localize},   0, 0, 1, @mailCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Contribution and Membership Details{/ts}'{/localize}, 'member/contributionDetail', 'CRM_Report_Form_Member_ContributionDetail', NULL, 0, 0, 48, {localize}'{ts escape="sql"}Contribution details for any type of contribution, plus associated membership information for contributions which are in payment for memberships.{/ts}'{/localize}, 0, 0, 1, @memberCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Recurring Contributions Report{/ts}'{/localize}, 'contribute/recur', 'CRM_Report_Form_Contribute_Recur',               NULL, 0, 0, 49, {localize}'{ts escape="sql"}Provides information about the status of recurring contributions{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Recurring Contributions Summary{/ts}'{/localize}, 'contribute/recursummary', 'CRM_Report_Form_Contribute_RecurSummary',               NULL, 0, 0, 49, {localize}'{ts escape="sql"}Provides simple summary for each payment instrument for which there are recurring contributions (e.g. Credit Card, Standing Order, Direct Debit, etc., NULL), showing within a given date range.{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL),
-  (@option_group_id_report, {localize}'{ts escape="sql"}Deferred Revenue Details{/ts}'{/localize}, 'contribute/deferredrevenue', 'CRM_Report_Form_Contribute_DeferredRevenue', NULL, 0, 0, 50, {localize}'{ts escape="sql"}Deferred Revenue Details Report{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL),
+  (@option_group_id_report,  '{ts escape="sql"}Mail Detail Report{/ts}',                                            'mailing/detail',     'CRM_Report_Form_Mailing_Detail',          NULL, 0, 0, 47,  '{ts escape="sql"}Provides reporting on Intended and Successful Deliveries, Unsubscribes and Opt-outs, Replies and Forwards.{/ts}',   0, 0, 1, @mailCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Contribution and Membership Details{/ts}', 'member/contributionDetail', 'CRM_Report_Form_Member_ContributionDetail', NULL, 0, 0, 48, '{ts escape="sql"}Contribution details for any type of contribution, plus associated membership information for contributions which are in payment for memberships.{/ts}', 0, 0, 1, @memberCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Recurring Contributions Report{/ts}', 'contribute/recur', 'CRM_Report_Form_Contribute_Recur',               NULL, 0, 0, 49, '{ts escape="sql"}Provides information about the status of recurring contributions{/ts}', 0, 0, 1, @contributeCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Recurring Contributions Summary{/ts}', 'contribute/recursummary', 'CRM_Report_Form_Contribute_RecurSummary',               NULL, 0, 0, 49, '{ts escape="sql"}Provides simple summary for each payment instrument for which there are recurring contributions (e.g. Credit Card, Standing Order, Direct Debit, etc., NULL), showing within a given date range.{/ts}', 0, 0, 1, @contributeCompId, NULL, NULL),
+  (@option_group_id_report, '{ts escape="sql"}Deferred Revenue Details{/ts}', 'contribute/deferredrevenue', 'CRM_Report_Form_Contribute_DeferredRevenue', NULL, 0, 0, 50, '{ts escape="sql"}Deferred Revenue Details Report{/ts}', 0, 0, 1, @contributeCompId, NULL, NULL),
 
   (@option_group_id_acs, '{ts escape="sql"}Scheduled{/ts}',    1, 'Scheduled',    NULL, 0, 1,    1, NULL, 0, 1, 1, NULL, NULL, NULL),
   (@option_group_id_acs, '{ts escape="sql"}Completed{/ts}',    2, 'Completed',    NULL, 1, 0, 2, NULL, 0, 1, 1, NULL, NULL, NULL),
@@ -1757,23 +1768,23 @@ INSERT INTO `civicrm_price_field_value` (  `price_field_id`, `name`, `label`, `a
 VALUES ( @fieldID, 'contribution_amount', 'Contribution Amount', '1', '1', '0', '1', 1);
 
 -- CRM-13833
-INSERT INTO civicrm_option_group (`name`, `title`, `is_reserved`, `is_active`) VALUES ('soft_credit_type', {localize}'{ts escape="sql"}Soft Credit Types{/ts}'{/localize}, 1, 1);
+INSERT INTO civicrm_option_group (`name`, `title`, `is_reserved`, `is_active`) VALUES ('soft_credit_type', '{ts escape="sql"}Soft Credit Types{/ts}', 1, 1);
 
 SELECT @option_group_id_soft_credit_type := max(id) from civicrm_option_group where name = 'soft_credit_type';
 
 INSERT INTO `civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `weight`, `is_default`, `is_active`, `is_reserved`)
 VALUES
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}In Honor of{/ts}'{/localize}, 1, 'in_honor_of', 1, 0, 1, 1),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}In Memory of{/ts}'{/localize}, 2, 'in_memory_of', 2, 0, 1, 1),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}Solicited{/ts}'{/localize}, 3, 'solicited', 3, 1, 1, 1),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}Household{/ts}'{/localize}, 4, 'household', 4, 0, 1, 0),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}Workplace Giving{/ts}'{/localize}, 5, 'workplace', 5, 0, 1, 0),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}Foundation Affiliate{/ts}'{/localize}, 6, 'foundation_affiliate', 6, 0, 1, 0),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}3rd-party Service{/ts}'{/localize}, 7, '3rd-party_service', 7, 0, 1, 0),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}Donor-advised Fund{/ts}'{/localize}, 8, 'donor-advised_fund', 8, 0, 1, 0),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}Matched Gift{/ts}'{/localize}, 9, 'matched_gift', 9, 0, 1, 0),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}Personal Campaign Page{/ts}'{/localize}, 10, 'pcp', 10, 0, 1, 1),
-  (@option_group_id_soft_credit_type   , {localize}'{ts escape="sql"}Gift{/ts}'{/localize}, 11, 'gift', 11, 0, 1, 1);
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}In Honor of{/ts}', 1, 'in_honor_of', 1, 0, 1, 1),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}In Memory of{/ts}', 2, 'in_memory_of', 2, 0, 1, 1),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}Solicited{/ts}', 3, 'solicited', 3, 1, 1, 1),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}Household{/ts}', 4, 'household', 4, 0, 1, 0),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}Workplace Giving{/ts}', 5, 'workplace', 5, 0, 1, 0),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}Foundation Affiliate{/ts}', 6, 'foundation_affiliate', 6, 0, 1, 0),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}3rd-party Service{/ts}', 7, '3rd-party_service', 7, 0, 1, 0),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}Donor-advised Fund{/ts}', 8, 'donor-advised_fund', 8, 0, 1, 0),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}Matched Gift{/ts}', 9, 'matched_gift', 9, 0, 1, 0),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}Personal Campaign Page{/ts}', 10, 'pcp', 10, 0, 1, 1),
+  (@option_group_id_soft_credit_type   , '{ts escape="sql"}Gift{/ts}', 11, 'gift', 11, 0, 1, 1);
 
 -- Auto-install core extension.
 -- Note this is a limited interim technique for installing core extensions -  the goal is that core extensions would be installed
@@ -1789,21 +1800,21 @@ INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_act
 INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_active) VALUES ('module', 'org.civicrm.flexmailer', 'FlexMailer', 'FlexMailer', 'flexmailer', 1);
 
 -- dev/core#3783 Recent Items providers
-INSERT INTO civicrm_option_group (`name`, `title`, `is_reserved`, `is_active`) VALUES ('recent_items_providers', {localize}'{ts escape="sql"}Recent Items Providers{/ts}'{/localize}, 1, 1);
+INSERT INTO civicrm_option_group (`name`, `title`, `is_reserved`, `is_active`) VALUES ('recent_items_providers', '{ts escape="sql"}Recent Items Providers{/ts}', 1, 1);
 
 SELECT @option_group_id_recent := max(id) from civicrm_option_group where name = 'recent_items_providers';
 
-INSERT INTO civicrm_option_value (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, {localize field='description'}description{/localize}, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`)
+INSERT INTO civicrm_option_value (`option_group_id`, label, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, description, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`)
  VALUES
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Contacts{/ts}'{/localize}, 'Contact', 'Contact', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Relationships{/ts}'{/localize}, 'Relationship', 'Relationship', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Activities{/ts}'{/localize}, 'Activity', 'Activity', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Notes{/ts}'{/localize}, 'Note', 'Note', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Groups{/ts}'{/localize}, 'Group', 'Group', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Cases{/ts}'{/localize}, 'Case', 'Case', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Contributions{/ts}'{/localize}, 'Contribution', 'Contribution', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Participants{/ts}'{/localize}, 'Participant', 'Participant', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Memberships{/ts}'{/localize}, 'Membership', 'Membership', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Pledges{/ts}'{/localize}, 'Pledge', 'Pledge', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Events{/ts}'{/localize}, 'Event', 'Event', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
-    (@option_group_id_recent, {localize}'{ts escape="sql"}Campaigns{/ts}'{/localize}, 'Campaign', 'Campaign', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL);
+    (@option_group_id_recent, '{ts escape="sql"}Contacts{/ts}', 'Contact', 'Contact', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Relationships{/ts}', 'Relationship', 'Relationship', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Activities{/ts}', 'Activity', 'Activity', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Notes{/ts}', 'Note', 'Note', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Groups{/ts}', 'Group', 'Group', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Cases{/ts}', 'Case', 'Case', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Contributions{/ts}', 'Contribution', 'Contribution', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Participants{/ts}', 'Participant', 'Participant', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Memberships{/ts}', 'Membership', 'Membership', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Pledges{/ts}', 'Pledge', 'Pledge', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Events{/ts}', 'Event', 'Event', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL),
+    (@option_group_id_recent, '{ts escape="sql"}Campaigns{/ts}', 'Campaign', 'Campaign', NULL, NULL, 0, 1, '', 0, 1, 1, NULL, NULL);
diff --git a/civicrm/xml/templates/languages.tpl b/civicrm/xml/templates/languages.tpl
index ee45a4ef8b..fce1b02a2a 100644
--- a/civicrm/xml/templates/languages.tpl
+++ b/civicrm/xml/templates/languages.tpl
@@ -52,7 +52,7 @@ VALUES
   (@option_group_id_languages, 0, 0, 'kw_GB', 'kw', {localize}'{ts escape="sql"}Cornish{/ts}'{/localize}, @counter := @counter + 1),
   (@option_group_id_languages, 0, 0, 'co_FR', 'co', {localize}'{ts escape="sql"}Corsican{/ts}'{/localize}, @counter := @counter + 1),
   (@option_group_id_languages, 0, 0, 'cr_CA', 'cr', {localize}'{ts escape="sql"}Cree{/ts}'{/localize}, @counter := @counter + 1),
-  (@option_group_id_languages, 0, 0, 'hr_HR', 'hr', {localize}'{ts escape="sql"}Croatian{/ts}'{/localize}, @counter := @counter + 1),
+  (@option_group_id_languages, 0, 1, 'hr_HR', 'hr', {localize}'{ts escape="sql"}Croatian{/ts}'{/localize}, @counter := @counter + 1),
   (@option_group_id_languages, 0, 1, 'cs_CZ', 'cs', {localize}'{ts escape="sql"}Czech{/ts}'{/localize}, @counter := @counter + 1),
   (@option_group_id_languages, 0, 1, 'da_DK', 'da', {localize}'{ts escape="sql"}Danish{/ts}'{/localize}, @counter := @counter + 1),
   (@option_group_id_languages, 0, 0, 'dv_MV', 'dv', {localize}'{ts escape="sql"}Divehi; Dhivehi; Maldivian;{/ts}'{/localize}, @counter := @counter + 1),
diff --git a/civicrm/xml/templates/message_templates/contribution_online_receipt_text.tpl b/civicrm/xml/templates/message_templates/contribution_online_receipt_text.tpl
index fb71552fc5..3927b5fed8 100644
--- a/civicrm/xml/templates/message_templates/contribution_online_receipt_text.tpl
+++ b/civicrm/xml/templates/message_templates/contribution_online_receipt_text.tpl
@@ -29,7 +29,7 @@
 {$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $isShowTax && '{contribution.tax_amount|raw}' !== '0.00'} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"}
 ----------------------------------------------------------
 {foreach from=$lineItems item=line}
-{capture assign=ts_item}{$line.title}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($dataArray)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate || $line.tax_amount != ""}  {$line.tax_rate|string_format:"%.2f"} %  {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else}                  {/if}  {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}
+{capture assign=ts_item}{$line.title}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $isShowTax && '{contribution.tax_amount|raw}' !== '0.00'}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate || $line.tax_amount != ""}  {$line.tax_rate|string_format:"%.2f"} %  {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else}                  {/if}  {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}
 {/foreach}
 
 {if $isShowTax && '{contribution.tax_amount|raw}' !== '0.00'}
diff --git a/civicrm/xml/version.xml b/civicrm/xml/version.xml
index 89a417b33f..06550a834c 100644
--- a/civicrm/xml/version.xml
+++ b/civicrm/xml/version.xml
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="iso-8859-1" ?>
 <version>
-  <version_no>5.57.3</version_no>
+  <version_no>5.58.0</version_no>
 </version>
diff --git a/wp-rest/README.md b/wp-rest/README.md
index e2b6446821..8f931104f3 100644
--- a/wp-rest/README.md
+++ b/wp-rest/README.md
@@ -4,7 +4,7 @@ This code exposes CiviCRM's [extern](https://github.com/civicrm/civicrm-core/tre
 
 ### Requirements
 
--   PHP 7.2+
+-   PHP 7.3+
 -   WordPress 4.7+
 -   CiviCRM to be installed and activated.
 
-- 
GitLab