diff --git a/composer.json b/composer.json
index 4be83db..4eeb8ee 100644
--- a/composer.json
+++ b/composer.json
@@ -11,6 +11,7 @@
],
"require": {
"php": ">=7.1",
+ "10up/elasticpress": "~4.2.2",
"humanmade/debug-bar-elasticpress": "~1.6.3"
},
"autoload" : {
@@ -23,6 +24,7 @@
"extra": {
"altis": {
"install-overrides": [
+ "10up/elasticpress",
"humanmade/debug-bar-elasticpress"
]
}
diff --git a/inc/namespace.php b/inc/namespace.php
index e969d80..47c5d6e 100644
--- a/inc/namespace.php
+++ b/inc/namespace.php
@@ -164,7 +164,7 @@ function load_elasticpress() {
add_filter( 'pre_site_option_ep_last_sync', '__return_false' );
}
- require_once dirname( __DIR__ ) . '/lib/elasticpress/elasticpress.php';
+ require_once Altis\ROOT_DIR . '/vendor/10up/elasticpress/elasticpress.php';
// Now ElasticPress has been included, we can remove some of it's filters.
diff --git a/lib/elasticpress/assets/css/autosuggest.css b/lib/elasticpress/assets/css/autosuggest.css
deleted file mode 100644
index 6361838..0000000
--- a/lib/elasticpress/assets/css/autosuggest.css
+++ /dev/null
@@ -1,41 +0,0 @@
-.ep-autosuggest-container {
- position: relative;
-
- & .ep-autosuggest {
- background: #fff;
- border: 1px solid #ccc;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
- display: none;
- position: absolute;
-
- width: 100%;
- z-index: 200;
-
- & > ul {
- list-style: none;
- margin: 0 !important;
-
- & > li {
- font-family: sans-serif;
-
- & > a.autosuggest-link {
- color: #000;
- cursor: pointer;
- display: block;
- padding: 2px 10px;
-
- &:hover,
- &:active {
- background-color: #eee;
- text-decoration: none;
- }
- }
- }
- }
- }
-
- & .selected {
- background-color: #eee;
- text-decoration: none;
- }
-}
diff --git a/lib/elasticpress/assets/css/comments.css b/lib/elasticpress/assets/css/comments.css
deleted file mode 100644
index f0fdce6..0000000
--- a/lib/elasticpress/assets/css/comments.css
+++ /dev/null
@@ -1,13 +0,0 @@
-.ep-widget-search-comments-results {
- list-style-type: none;
- margin-left: 0;
-}
-
-.ep-widget-search-comments-result-item,
-.ep-widget-search-comments-result-item-not-found {
- margin-left: 0;
-}
-
-.ep-widget-search-comments-result-item.selected a {
- border: 2px dotted #171923;
-}
diff --git a/lib/elasticpress/assets/css/dashboard.css b/lib/elasticpress/assets/css/dashboard.css
deleted file mode 100644
index 7ed03b2..0000000
--- a/lib/elasticpress/assets/css/dashboard.css
+++ /dev/null
@@ -1,1186 +0,0 @@
-@import "@10up/component-tooltip";
-
-:root {
- --statusOk: #6aa000;
- --statusWarning: #e3e600;
- --statusError: #f00;
-}
-
-html.wp-toolbar {
- background: transparent;
-}
-
-@custom-media --tablet-min (min-width: 880px);
-@custom-media --wide-min (min-width: 1270px);
-@custom-media --tablet-max (max-width: 880px);
-@custom-media --wide-max (max-width: 1270px);
-
-/**
- * Layout
- */
-
-.wrap .notice,
-.wrap > h2 {
- position: relative;
- z-index: 2;
-}
-
-.wrap h1 {
- font-size: 23px;
- font-weight: 400;
- line-height: 29px;
- margin: 0;
- padding: 9px 0 4px;
-}
-
-.wrap h2 {
- color: #888;
- line-height: 1.75;
- margin: 0.5em 0 0.75em;
-}
-
-#wpbody #update-nag,
-#wpbody .update-nag {
- margin-bottom: 20px;
- margin-left: -20px;
- margin-top: 0;
- width: 100%;
-}
-
-h2.ep-list-features {
- display: none;
-}
-
-/**
- * Header
- */
-
-.ep-header-menu {
- background-color: #fff;
- border-bottom: 2px solid #ddd;
- margin-left: -20px;
- padding-bottom: 5px;
- padding-left: 20px;
- padding-right: 20px;
- padding-top: 5px;
- position: relative;
- z-index: 2;
-}
-
-.ep-header-menu::after {
- clear: both;
- content: " ";
- display: block;
-}
-
-.ep-header-menu img {
- float: left;
-}
-
-.ep-header-menu .icons {
- display: inline-block;
- float: right;
- height: 39px;
- line-height: 39px;
- padding-right: 3px;
-}
-
-.ep-header-menu .icons a {
- color: inherit;
- cursor: pointer;
- font-size: 27px;
- margin-left: 8px;
- position: relative;
- top: -3px;
- vertical-align: middle;
-}
-
-.ep-header-menu .icons .dashicons-no,
-.ep-header-menu .icons .dashicons-controls-play,
-.ep-header-menu .icons .dashicons-controls-pause,
-.ep-header-menu .icons .dashicons-update,
-.ep-header-menu .icons .dashicons-admin-generic {
- font-size: 30px;
- top: 1px;
-}
-
-.ep-header-menu .resume-sync,
-.ep-header-menu .pause-sync,
-.ep-header-menu .cancel-sync {
- display: none;
-}
-
-.ep-header-menu .sync-status {
- bottom: -1px;
- color: #666;
- display: none;
- font-style: italic;
- margin-right: 8px;
- position: relative;
- vertical-align: middle;
-}
-
-.ep-header-menu .progress-bar {
- background-color: #d84440;
- bottom: 0;
- height: 5px;
- left: 0;
- margin-bottom: -5px;
- position: absolute;
-}
-
-.ep-header-menu .icons .dashicons-update,
-.ep-header-menu .icons .dashicons-admin-generic {
- display: inline;
-}
-
-/**
- * Features
- */
-
-.ep-features {
- overflow: auto;
-}
-
-.error-overlay.cant-connect,
-.error-overlay.syncing {
- background-color: #fff;
- bottom: 0;
- content: " ";
- display: block;
- left: 0;
- opacity: 0.6;
- position: fixed;
- right: 0;
- top: 46px;
- z-index: 1;
-}
-
-@media (--tablet-min) {
-
- .error-overlay.cant-connect,
- .error-overlay.syncing,
- .error-overlay {
- left: 160px;
- top: 32px;
- }
-}
-
-.ep-feature .postbox {
- margin-bottom: 0;
-}
-
-.ep-feature .postbox .hndle {
- cursor: inherit;
-}
-
-.ep-feature .postbox .hndle .settings-button {
- background-color: #efefef;
- border: none;
- border-radius: 4px;
- color: inherit;
- cursor: pointer;
- display: inline-block;
- float: right;
- font-size: 13px;
- font-weight: 400;
- line-height: inherit;
- margin-top: -4px;
- padding: 4px 7px;
- padding-left: 23px;
- position: relative;
-}
-
-.ep-feature .settings-button::before {
- color: #72777c;
- content: "\f140";
- display: inline-block;
- font: 400 19px/1 dashicons;
- left: 1px;
- padding: 0 5px 0 0;
- position: absolute;
- top: 4px;
- vertical-align: middle;
-}
-
-.ep-feature .settings-button::after {
- border-radius: 50%;
- content: " ";
- display: inline-block;
- height: 8px;
- margin-left: 10px;
- margin-top: -2px;
- vertical-align: middle;
- width: 8px;
-}
-
-.feature-requirements-status-2.ep-feature {
-
- & .postbox .hndle .settings-button::after {
- background-color: transparent;
- border: 1px solid var(--statusError);
- }
-
- & .settings .requirements-status-notice {
- border-color: var(--statusError);
- }
-}
-
-.feature-requirements-status-1.ep-feature {
-
- & .postbox .hndle .settings-button::after {
- background-color: transparent;
- border: 1px solid var(--statusWarning);
- }
-
- &.feature-active .postbox .hndle .settings-button::after {
- background-color: var(--statusWarning);
- }
-
- & .settings .requirements-status-notice {
- border-color: var(--statusWarning);
- }
-}
-
-.feature-requirements-status-0.ep-feature {
-
- & .postbox .hndle .settings-button::after {
- background-color: transparent;
- border: 1px solid var(--statusOk);
- }
-
- &.feature-active .postbox .hndle .settings-button::after {
- background-color: var(--statusOk);
- }
-
- & .settings .requirements-status-notice {
- border-color: var(--statusOk);
- }
-}
-
-.ep-feature {
- margin-bottom: 20px;
- position: relative;
- vertical-align: top;
-}
-
-.ep-feature.saving .action-wrap::before {
- animation: load8 1.1s infinite linear;
- border-bottom: 5px solid #ccc;
- border-left: 5px solid #999;
- border-radius: 50%;
- border-right: 5px solid #ccc;
- border-top: 5px solid #ccc;
- content: " ";
- display: inline-block;
- font-size: 7px;
- height: 8px;
- margin-right: 1.4em;
- position: relative;
- text-indent: -9999em;
- top: 4px;
- transform: translateZ(0);
- vertical-align: middle;
- width: 8px;
-}
-
-.ep-feature .description,
-.ep-feature .settings {
- margin-bottom: 0;
- text-align: left;
-}
-
-.ep-feature .settings {
- display: none;
- overflow: auto;
-
- & h3 {
- font-size: inherit;
- font-weight: 700;
- margin-top: 0;
- }
-}
-
-.ep-feature.show-settings {
-
- & .settings {
- display: block;
- }
-
- & .description {
- display: none;
- }
-
- & .settings-button::before {
- content: "\f142";
- }
-}
-
-.ep-feature .settings .requirements-status-notice {
- background-color: #efefef;
- border-left: 4px solid var(--statusOk);
- margin-bottom: 10px;
- padding: 8px 12px;
-
- &.requirements-status-notice--reindex {
- border-color: var(--statusWarning);
- display: none; /* Controlled by JavaScript. */
- }
-}
-
-.ep-feature .settings .action-wrap {
- clear: both;
- padding-top: 15px;
- text-align: right;
- vertical-align: middle;
-
- & a {
- cursor: pointer;
- display: inline-block;
- }
-
- & .no-dash-sync {
- color: #aaa;
- display: none;
- line-height: 27px;
- padding-right: 8px;
- }
-
- & a.disabled {
- cursor: default;
- }
-
- & .cancel {
- margin-right: 6px;
- margin-top: 4px;
- }
-}
-
-.ep-feature.dash-sync-disabled .settings .action-wrap {
-
- & .no-dash-sync {
- display: inline;
- }
-}
-
-.ep-feature .settings .field {
- clear: both;
- overflow: initial;
- padding-top: 15px;
-
- &:first-child {
- padding-top: 0;
- }
-
- & label {
- display: inline-block;
- margin: 0.25em 0 0.5em;
- }
-
- & div {
- padding-top: 5px;
- }
-
- & > label,
- & .field-name {
- box-sizing: border-box;
- display: block;
- float: left;
- padding-right: 1.5em;
- width: 25%;
- }
-
- & .input-wrap {
- display: block;
- float: right;
- width: 75%;
- }
-
- & .field-description {
- color: #666;
- font-style: italic;
- margin-bottom: 0;
- margin-top: 4px;
- }
-
- & .disabled {
- color: #bbb;
-
- & input {
- cursor: default;
- }
- }
-
- & .components-form-token-field {
- padding-top: 0;
- }
-
- & .components-form-token-field__label {
- margin-top: 0;
- }
-
- & .components-form-token-field__input-container {
- padding: 2px 4px;
- }
-}
-
-.ep-feature .long {
- display: none;
-
- & p:last-child {
- margin-bottom: 0;
- }
-}
-
-.ep-feature.show-full .long {
- display: block;
-}
-
-.ep-feature.show-full .learn-more {
- display: none;
-}
-
-.ep-feature .learn-more::after {
- content: "\f140";
- font-family: dashicons;
- font-size: 1.5em;
- line-height: 1;
- position: relative;
- top: -0.07em;
- vertical-align: middle;
-}
-
-.ep-feature .collapse::after {
- content: "\f142";
- font-family: dashicons;
- font-size: 1.5em;
- line-height: 1;
- position: relative;
- top: -0.07em;
- vertical-align: middle;
-}
-
-/**
- * Intro Page
- */
-
-
-.intro h2 {
- line-height: 1.2;
- padding: 9px 0 4px 0;
-}
-
-.intro h1 {
- color: #626262;
- font-weight: 600;
- margin: 0.5em 0 2em;
- text-align: center;
-}
-
-.intro-container {
- display: flex;
- flex-direction: column;
- justify-content: center;
- position: relative;
- text-align: center;
-
- @media (--tablet-min) {
- flex-direction: row;
- }
-
- @media (--wide-min) {
- margin-left: 10%;
- margin-right: 10%;
- }
-
- & h2 {
- color: #626262;
- height: 8%;
- }
-
- & p {
- margin-left: auto;
- margin-right: auto;
- max-width: 300px;
- }
-}
-
-.ep-feature-list {
- display: inline-block;
- margin: 0;
- text-align: left;
- vertical-align: top;
-
- & li {
- align-items: center;
- display: flex;
- margin: 4px 3px;
- }
-
- & [role="tooltip"].a11y-tip__help--top {
- font-size: inherit;
- }
-}
-
-.ep-feature-info {
- text-decoration: none;
-
- & .dashicons {
- font-size: 14px;
- position: relative;
- top: 2px;
- }
-}
-
-.intro-box {
- flex-grow: 2;
- margin-bottom: 2em;
-}
-
-.intro-container-success {
- display: flex;
- flex-wrap: wrap;
- justify-content: center;
- text-align: center;
-}
-
-.intro-container-success p {
- margin-top: 23px;
- padding: 0 35% 0 35%;
-}
-
-@media (--tablet-max) {
-
- .intro-container-success p {
- margin-top: 23px;
- padding: 0 26%;
- }
-}
-
-.ep-config-success span {
- font-size: 6em;
- padding-right: 75px;
-}
-
-.setup-complete {
- font-size: 2em;
- margin-top: 0;
- padding-top: 0;
- width: 100%;
-}
-
-.setup-complete h2 {
- margin-top: 0;
- padding-top: 0;
-}
-
-.ep-copy-text {
-
- @media (--tablet-min) {
- padding: 0 9% 0 9%;
- }
-
- & a {
- font-weight: 700;
- }
-}
-
-.ep-circle {
- background: #fff;
- border-radius: 50%;
- color: #626262;
- display: inline-block;
- font-size: 16px;
- font-weight: 400;
- height: 6em;
- line-height: 2.8em;
- margin: 0 1em;
- text-align: center;
- width: 6em;
-
- & p {
- border: 0;
- font-size: 50px;
- font-weight: 700;
- line-height: 0.5em;
- margin: 0;
- }
-}
-
-.ep-circle--first {
-
- @media (--tablet-min) {
-
- &::after {
- background: #d4d4d4;
- content: "";
- height: 0.2em;
- left: 50%;
- position: absolute;
- top: 2.9em;
- transform: translateX(-50%);
- width: 75%;
- z-index: -1;
- }
- }
-}
-
-.ep-circle--active {
- background-color: #d73c38;
- color: #fff;
-}
-
-@media (--tablet-min) {
-
- .wrap h1 {
- line-height: 1.75;
- }
-}
-
-.wrap.intro {
- margin-bottom: 30px;
- margin-top: 30px;
- overflow: auto;
-
- & .updated,
- & .notice,
- & .error,
- & .is-dismissible {
- display: none !important;
- }
-}
-
-.features-screenshot {
- display: none;
-}
-
-.setup-message {
- clear: both;
- text-align: center;
-}
-
-.setup-button {
- -webkit-appearance: none;
- background-color: #e63e3b;
- border: none;
- border-radius: 10px;
- box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.25);
- color: #fff;
- display: inline-block;
- margin: 0 0.75em;
- padding: 1em 1.5em;
- text-decoration: none;
-}
-
-.setup-button:hover {
- background-color: #b93431;
- color: #ffe8ed;
-}
-
-.setup-message .setup-button-primary {
- background-color: #fff;
- color: #d84440;
-}
-
-/**
- * Weighting
- */
-
-.weighting-settings .postbox {
- box-sizing: border-box;
- max-width: 650px;
-
- & * {
- box-sizing: border-box;
- }
-}
-
-.weighting-settings .postbox h2.hndle {
- color: #444;
- cursor: inherit;
-}
-
-.weighting-settings fieldset {
- padding: 10px;
-}
-
-.weighting-settings fieldset legend {
- float: left; /* legend cannot use display */
- position: relative;
- top: 5px;
- width: 100px;
-}
-
-.weighting-settings fieldset p {
- display: inline-block;
- float: left;
- margin: 0;
-}
-
-.weighting-settings .field-group {
- margin: 10px 0 0;
-}
-
-.weighting-settings .field-group h3 {
- font-size: 1em;
- margin: 10px;
-}
-
-.weighting-settings .fields > fieldset:nth-of-type(odd) {
- background: #f9f9f9;
-}
-
-.weighting-settings .searchable {
- display: inline-block;
- width: 120px;
-}
-
-.weighting-settings .weighting {
- align-items: center;
- display: flex;
-}
-
-.weighting-settings .weighting label {
- margin-right: 10px;
- min-width: 80px;
-}
-
-.weighting-settings input[type="range"] {
- -webkit-appearance: none;
- background: transparent;
- display: inline-block;
- height: 1em;
- margin: 0;
- vertical-align: middle;
- width: 200px;
-}
-
-.weighting-settings input[type="range"]:focus {
- outline: none;
-}
-
-.weighting-settings input[type="range"]:disabled {
- opacity: 0.5;
- pointer-events: none;
-}
-
-.weighting-settings input[type="range"]::-webkit-slider-runnable-track {
- background: #ddd;
- border: 0 solid #000;
- border-radius: 1px;
- box-shadow: 0 0 0 #000;
- cursor: pointer;
- height: 3px;
- width: 100%;
-}
-
-.weighting-settings input[type="range"]::-webkit-slider-thumb {
- -webkit-appearance: none;
- background: #1e8cbe;
- border: 1px solid #1e8cbe;
- border-radius: 25px;
- box-shadow: 0 0 0 #000;
- cursor: pointer;
- height: 14px;
- margin-top: -6px;
- width: 14px;
-}
-
-.weighting-settings input[type="range"]:focus::-webkit-slider-runnable-track {
- background: #ddd;
-}
-
-.weighting-settings input[type="range"]:focus::-webkit-slider-thumb {
- background: #fff !important;
-}
-
-.weighting-settings input[type="range"]::-moz-range-track {
- background: #1e8cbe;
- border: 0 solid #000;
- border-radius: 1px;
- box-shadow: 0 0 0 #000;
- cursor: pointer;
- height: 3px;
- width: 100%;
-}
-
-.weighting-settings input[type="range"]::-moz-range-thumb {
- background: #1e8cbe;
- border: 1px solid #1e8cbe;
- border-radius: 25px;
- box-shadow: 0 0 0 #000;
- cursor: pointer;
- height: 14px;
- width: 14px;
-}
-
-.weighting-settings input[type="range"]::-ms-track {
- background: transparent;
- border-color: transparent;
- color: transparent;
- cursor: pointer;
- height: 3px;
- width: 100%;
-}
-
-.weighting-settings input[type="range"]::-ms-fill-lower {
- background: #1e8cbe;
- border: 0 solid #000;
- border-radius: 2px;
- box-shadow: 0 0 0 #000;
-}
-
-.weighting-settings input[type="range"]::-ms-fill-upper {
- background: #1e8cbe;
- border: 0 solid #000;
- border-radius: 2px;
- box-shadow: 0 0 0 #000;
-}
-
-.weighting-settings input[type="range"]::-ms-thumb {
- background: #a1d0ff;
- border: 1px solid #1e8cbe;
- border-radius: 25px;
- box-shadow: 0 0 0 #000;
- cursor: pointer;
- height: 14px;
- margin-top: 1px;
- width: 14px;
-}
-
-.weighting-settings input[type="range"]:focus::-ms-fill-lower {
- background: #1e8cbe;
-}
-
-.weighting-settings input[type="range"]:focus::-ms-fill-upper {
- background: #1e8cbe;
-}
-
-.ep-feature-search .wp-color-result.button {
- margin-bottom: 10px;
-}
-
-
-.ep-feature.ep-feature-search .settings .wp-picker-input-wrap > label {
- margin-right: 10px;
- margin-top: 0;
-}
-
-.ep-feature.ep-feature-search .settings.wp-picker-input-wrap label {
- align-items: center;
- display: flex;
-}
-
-.ep-feature.ep-feature-search .settings .wp-picker-open + .wp-picker-input-wrap {
- display: flex;
-}
-
-/**
- * Animations
- */
-
-@-webkit-keyframes load8 {
-
- 0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
-
- 100% {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
-
-@keyframes load8 {
-
- 0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
-
- 100% {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
-
-@media (--tablet-min) {
-
- .intro .left {
- float: left;
- width: 30%;
- }
-
- .features-screenshot {
- display: block;
- float: right;
- height: auto;
- margin: 0 auto;
- max-width: 1000px;
- width: 70%;
- }
-
- .ep-features .left {
- box-sizing: border-box;
- display: block;
- float: left;
- padding-right: 10px;
- width: 50%;
- }
-
- .ep-features .right {
- box-sizing: border-box;
- display: block;
- float: right;
- padding-left: 10px;
- width: 50%;
- }
-
- .ep-feature .feature-message {
- display: inline-block;
- float: left;
- padding: 0;
- padding-top: 0.5em;
- vertical-align: middle;
- }
-}
-
-/**
- * Settings page
- */
-
-/* @media screen and (max-width: 600px) { */
-.wrap h2.nav-tab-wrapper.ep-credentials-tabs {
- border-bottom: 1px solid #ccc;
-}
-
-/* } */
-
-.ep-credentials input[type="text"] {
- min-width: 250px;
-}
-
-h2 .nav-tab.ep-credentials-tab {
- cursor: pointer;
- margin-bottom: -1px;
-}
-
-.ep-credentials-tab.nav-tab-active {
- border-bottom-color: #f1f1f1;
-}
-
-.ep-credentials-tab img,
-.ep-credentials-tab span {
- display: inline-block;
- vertical-align: middle;
-}
-
-.ep-credentials fieldset {
- border-bottom: 1px solid #ccc;
- border-left: 1px solid #ccc;
- border-right: 1px solid #ccc;
- margin: 0;
- padding: 0 1rem;
-}
-
-.ep-credentials fieldset.predefined {
- border-top: 1px solid #ccc;
-}
-
-.ep-settings .description {
- font-size: 0.75rem;
- font-style: italic;
-}
-
-@media (--tablet-min) {
-
- .ep-credentials {
- display: inline-block;
- }
-
- .ep-credentials .form-table {
- width: auto;
- }
-
- .ep-credentials .form-table td {
- padding-left: 0;
- }
-}
-
-.ep-flex-container {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -ms-flex-wrap: wrap;
- flex-wrap: wrap;
- width: 100%;
-}
-
-.ep-flex-container-nowrap {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- width: 100%;
-}
-
-.stats-list {
- margin-right: 0;
- width: 100%;
-
- /* @media( --tablet-min ) {
- width: 48%;
- margin-right: 24px;
- } */
-
- @media (--wide-min) {
- background-color: #fff;
- margin-right: 28px;
- width: 37%;
- }
-}
-
-.stats-queries {
- background-color: #fff;
- width: 100%;
-
- /* @media( --tablet-min ) {
- width: 48%;
- } */
-
- @media (--wide-min) {
- width: 60%;
- }
-}
-
-.stats-list-th span:last-of-type {
- border-radius: 4px;
- color: inherit;
- cursor: pointer;
- display: inline-block;
- float: right;
- font-size: 13px;
- margin-top: -4px;
- padding: 4px 7px;
- padding-left: 23px;
- position: relative;
-}
-
-.status-circle {
- float: right;
- text-transform: capitalize;
-}
-
-.status-circle::after {
- border-radius: 50%;
- content: " ";
- display: inline-block;
- height: 8px;
- margin-left: 10px;
- margin-top: -2px;
- vertical-align: middle;
- width: 8px;
-}
-
-.green-status {
- color: var(--statusOk);
-}
-
-.yellow-status {
- color: var(--statusWarning);
-}
-
-.red-status {
- color: var(--statusError);
-}
-
-.green-status::after {
- background-color: var(--statusOk);
-}
-
-.yellow-status::after {
- background-color: var(--statusWarning);
-}
-
-.red-status::after {
- background-color: var(--statusError);
-}
-
-.doc-chart {
- margin-right: 0;
- width: 100%;
-
- @media (--tablet-min) {
- margin-right: 24px;
- width: 48%;
- }
-
- @media (--wide-min) {
- margin-right: 28px;
- width: 50%;
- }
-}
-
-.ep-qchart-container {
- margin: 0 auto;
- width: 90%;
-
- @media (--tablet-min) {
- width: 48%;
- }
-
- @media (--wide-min) {
- margin: 0 auto;
- width: 50%;
- }
-
-}
-
-.inside-totals {
- padding: 0 12px 12px;
-}
-
-.ep-totals {
- display: flex;
- flex-direction: column;
- width: 100%;
-
- @media (--tablet-min) {
- width: 48%;
- }
-
- @media (--wide-min) {
- width: 47%;
- }
-
- & .ep-flex-container {
- flex-direction: column;
- justify-content: center;
- margin-bottom: auto;
- margin-top: auto;
-
- @media (--wide-min) {
- flex-direction: row;
- }
- }
-}
-
-.ep-totals-column {
- box-sizing: border-box;
- text-align: center;
- width: 100%;
-
- @media (--wide-min) {
- width: 50%;
- }
-}
-
-p.ep-totals-title {
- font-weight: bolder;
- margin-top: 28px;
-}
-
-p.ep-totals-data {
- font-size: 3em;
- margin-top: 22px;
-}
diff --git a/lib/elasticpress/assets/css/facets-admin.css b/lib/elasticpress/assets/css/facets-admin.css
deleted file mode 100644
index 5a58aa0..0000000
--- a/lib/elasticpress/assets/css/facets-admin.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.widget-ep-facet label {
- margin-right: 5px;
-}
diff --git a/lib/elasticpress/assets/css/facets.css b/lib/elasticpress/assets/css/facets.css
deleted file mode 100644
index 59451e1..0000000
--- a/lib/elasticpress/assets/css/facets.css
+++ /dev/null
@@ -1,93 +0,0 @@
-.widget_ep-facet input[type="search"] {
- margin-bottom: 1rem;
-}
-
-.widget_ep-facet .searchable .inner {
- max-height: 20em;
- overflow: scroll;
-}
-
-.widget_ep-facet .term.hide {
- display: none;
-}
-
-.widget_ep-facet .empty-term {
- opacity: 0.5;
- position: relative;
-}
-
-.widget_ep-facet .empty-term::after {
- bottom: 0;
- content: " ";
- display: block;
- left: 0;
- position: absolute;
- right: 0;
- top: 0;
- width: 100%;
- z-index: 2;
-}
-
-.widget_ep-facet .level-1 {
- padding-left: 20px;
-}
-
-.widget_ep-facet .level-2 {
- padding-left: 40px;
-}
-
-.widget_ep-facet .level-3 {
- padding-left: 60px;
-}
-
-.widget_ep-facet .level-4 {
- padding-left: 80px;
-}
-
-.widget_ep-facet .level-5 {
- padding-left: 100px;
-}
-
-.widget_ep-facet input[disabled] {
- cursor: pointer;
- opacity: 1;
-}
-
-.widget_ep-facet .term a {
- align-items: center;
- display: flex;
- position: relative;
-}
-
-.ep-checkbox {
- align-items: center;
- background-color: #eee;
- display: flex;
- flex-shrink: 0;
- height: 1em;
- justify-content: center;
- margin-right: 0.25em;
- width: 1em;
-}
-
-.ep-checkbox::after {
- border: solid #fff;
- border-width: 0 0.125em 0.125em 0;
- content: "";
- display: none;
- height: 0.5em;
- transform: rotate(45deg);
- width: 0.25em;
-}
-
-.ep-checkbox.checked {
- background-color: #5e5e5e;
-}
-
-.ep-checkbox.checked::after {
- display: block;
-}
-
-.widget_ep-facet .term a:hover .ep-checkbox {
- background-color: #ccc;
-}
diff --git a/lib/elasticpress/assets/css/highlighting.css b/lib/elasticpress/assets/css/highlighting.css
deleted file mode 100644
index 96589c5..0000000
--- a/lib/elasticpress/assets/css/highlighting.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.ep-highlight {
- background-color: transparent;
- font-style: italic;
- font-weight: 700;
-}
diff --git a/lib/elasticpress/assets/css/instant-results.css b/lib/elasticpress/assets/css/instant-results.css
deleted file mode 100644
index ba17c2b..0000000
--- a/lib/elasticpress/assets/css/instant-results.css
+++ /dev/null
@@ -1,28 +0,0 @@
-@import "instant-results/utilities.css";
-@import "instant-results/checkbox.css";
-@import "instant-results/input.css";
-@import "instant-results/modal.css";
-@import "instant-results/options-list.css";
-@import "instant-results/page.css";
-@import "instant-results/panel.css";
-@import "instant-results/pagination.css";
-@import "instant-results/range-slider.css";
-@import "instant-results/result.css";
-@import "instant-results/results.css";
-@import "instant-results/sidebar.css";
-@import "instant-results/sidebar-toggle.css";
-@import "instant-results/sort.css";
-@import "instant-results/toolbar.css";
-
-:root {
- --ep-search-background-color: #fff;
- --ep-search-alternate-background-color: #efefef;
- --ep-search-border-color: #dfdfdf;
- --ep-search-range-thumb-size: 1.625em;
- --ep-search-range-track-size: 0.75em;
-
- @media ( min-width: 768px ) {
- --ep-search-range-thumb-size: 1.25em;
- --ep-search-range-track-size: 0.5em;
- }
-}
diff --git a/lib/elasticpress/assets/css/instant-results/checkbox.css b/lib/elasticpress/assets/css/instant-results/checkbox.css
deleted file mode 100644
index 1cc9ab4..0000000
--- a/lib/elasticpress/assets/css/instant-results/checkbox.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.ep-search-checkbox__count::before {
- content: "(";
-}
-
-.ep-search-checkbox__count::after {
- content: ")";
-}
diff --git a/lib/elasticpress/assets/css/instant-results/input.css b/lib/elasticpress/assets/css/instant-results/input.css
deleted file mode 100644
index 1b527ed..0000000
--- a/lib/elasticpress/assets/css/instant-results/input.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.ep-search-input {
- font-size: 1.25em;
- margin: 0 !important;
- width: 100%;
-}
diff --git a/lib/elasticpress/assets/css/instant-results/modal.css b/lib/elasticpress/assets/css/instant-results/modal.css
deleted file mode 100644
index 081dfff..0000000
--- a/lib/elasticpress/assets/css/instant-results/modal.css
+++ /dev/null
@@ -1,60 +0,0 @@
-.has-ep-search-modal {
- overflow: hidden;
-}
-
-.ep-search-modal {
- --ep-search-modal-focus-within: 0;
- background-color: rgba(43, 46, 56, 0.9);
- bottom: 0;
- display: flex;
- left: 0;
- position: fixed;
- right: 0;
- top: 0;
- z-index: 9999;
-
- @nest .rtl & {
- direction: rtl;
- text-align: right;
- }
-
- @nest .admin-bar & {
- top: 32px;
-
- @media ( max-width: 782px ) {
- top: 46px;
- }
- }
-
- &[aria-hidden="true"] {
- display: none;
- }
-
- &:focus-within {
- --ep-search-modal-focus-within: 1;
- }
-}
-
-.ep-search-modal__content {
- background-color: var(--ep-search-background-color);
- bottom: 0;
- display: flex;
- flex-direction: column;
- left: 0;
- position: absolute;
- right: 0;
- top: 0;
-
- @media ( min-width: 768px ) {
- bottom: 1em;
- margin: 0 auto;
- max-width: calc(100% - 2em);
- top: 1em;
- width: 80em;
- }
-}
-
-.ep-search-modal__close {
- align-self: flex-end;
- padding: 1em !important;
-}
diff --git a/lib/elasticpress/assets/css/instant-results/options-list.css b/lib/elasticpress/assets/css/instant-results/options-list.css
deleted file mode 100644
index 0624818..0000000
--- a/lib/elasticpress/assets/css/instant-results/options-list.css
+++ /dev/null
@@ -1,17 +0,0 @@
-.ep-search-options-list {
- list-style: none;
- margin: 0;
- padding: 0;
-}
-
-.ep-search-options-list__item {
- margin: 0.5em 0;
-
- &::before {
- content: none;
- }
-}
-
-.ep-search-options-list__sub-menu {
- padding-left: 1em;
-}
diff --git a/lib/elasticpress/assets/css/instant-results/page.css b/lib/elasticpress/assets/css/instant-results/page.css
deleted file mode 100644
index 5fba4e1..0000000
--- a/lib/elasticpress/assets/css/instant-results/page.css
+++ /dev/null
@@ -1,39 +0,0 @@
-.ep-search-page {
- display: flex;
- flex-direction: column;
- flex-grow: 2;
- margin: 0;
- overflow-y: auto;
- transition: opacity 300ms ease-out;
- width: 100%;
-
- @media ( min-width: 768px ) {
- overflow: hidden;
- }
-
- & *,
- & *::before,
- & *::after {
- box-sizing: border-box;
- }
-
- &.is-loading {
- opacity: 0.5;
- }
-}
-
-.ep-search-page__header,
-.ep-search-page__tools,
-.ep-search-page__body {
- padding: 0 1em;
-}
-
-.ep-search-page__body {
-
- @media ( min-width: 768px ) {
- align-items: flex-start;
- display: flex;
- flex-grow: 2;
- overflow: hidden;
- }
-}
diff --git a/lib/elasticpress/assets/css/instant-results/pagination.css b/lib/elasticpress/assets/css/instant-results/pagination.css
deleted file mode 100644
index c0eb1b2..0000000
--- a/lib/elasticpress/assets/css/instant-results/pagination.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.ep-search-pagination {
- align-items: center;
- display: grid;
- grid-template-columns: 1fr 1fr 1fr;
- margin-top: auto;
- text-align: center;
-
- @nest .rtl & {
- direction: rtl;
- }
-}
-
-.ep-search-pagination__next {
- justify-self: end;
-}
-
-.ep-search-pagination__previous {
- justify-self: start;
-}
diff --git a/lib/elasticpress/assets/css/instant-results/panel.css b/lib/elasticpress/assets/css/instant-results/panel.css
deleted file mode 100644
index cfa0620..0000000
--- a/lib/elasticpress/assets/css/instant-results/panel.css
+++ /dev/null
@@ -1,27 +0,0 @@
-.ep-search-panel {
- border: 1px solid var(--ep-search-border-color);
- margin: 0;
- padding: 0;
-
- @nest .ep-search-panel + & {
- border-top-width: 0;
- }
-}
-
-.ep-search-panel__heading {
- font-size: inherit;
- margin: 0;
-}
-
-.ep-search-panel__button {
- padding: 1em !important;
- width: 100% !important;
-}
-
-.ep-search-panel__content {
- padding: 0 1em 1em 1em;
-
- &[aria-hidden="true"] {
- display: none;
- }
-}
diff --git a/lib/elasticpress/assets/css/instant-results/range-slider.css b/lib/elasticpress/assets/css/instant-results/range-slider.css
deleted file mode 100644
index c224807..0000000
--- a/lib/elasticpress/assets/css/instant-results/range-slider.css
+++ /dev/null
@@ -1,26 +0,0 @@
-.ep-search-range-slider {
- align-items: center;
- display: flex;
- margin: 0.5em 0;
- min-height: var(--ep-search-range-thumb-size);
-}
-
-.ep-search-range-slider__track {
- background: var(--ep-search-alternate-background-color);
- border-radius: calc(var(--ep-search-range-track-size) / 2);
- height: var(--ep-search-range-track-size);
-}
-
-.ep-search-range-slider__track-1 {
- background-color: currentColor;
-}
-
-.ep-search-range-slider__thumb {
- background-color: currentColor;
- border-radius: calc(var(--ep-search-range-thumb-size) / 2);
- box-shadow:
- inset 0 0 0 calc(var(--ep-search-range-thumb-size) / 10) currentColor,
- inset 0 0 0 calc((var(--ep-search-range-thumb-size) - var(--ep-search-range-track-size)) / 2) var(--ep-search-background-color);
- height: var(--ep-search-range-thumb-size);
- width: var(--ep-search-range-thumb-size);
-}
diff --git a/lib/elasticpress/assets/css/instant-results/result.css b/lib/elasticpress/assets/css/instant-results/result.css
deleted file mode 100644
index cce353b..0000000
--- a/lib/elasticpress/assets/css/instant-results/result.css
+++ /dev/null
@@ -1,89 +0,0 @@
-.ep-search-result {
- align-items: flex-start;
- display: grid;
- grid-gap: 0.5em;
- grid-template-areas:
- "header"
- "footer";
- grid-template-rows: auto 1fr;
-
- @media ( min-width: 768px ) {
- grid-gap: 1em;
- grid-template-areas:
- "header"
- "description"
- "footer";
- grid-template-rows: auto auto 1fr;
- }
-}
-
-.ep-search-result--has-thumbnail {
- grid-template-areas:
- "thumbnail header"
- "thumbnail footer";
- grid-template-columns: min(300px, 34%) auto;
-
- @media ( min-width: 768px ) {
- grid-template-areas:
- "thumbnail header"
- "thumbnail description"
- "thumbnail footer";
- }
-}
-
-.ep-search-result__thumbnail {
- display: block;
- grid-area: thumbnail;
-
- & img {
- display: block;
- margin: 0;
- width: 100%;
- }
-}
-
-.ep-search-result__header {
- display: grid;
- grid-area: header;
- grid-gap: 0.5em;
- grid-template-columns: auto;
- justify-items: start;
-}
-
-.ep-search-result__title {
- font-size: 1em;
- margin: 0;
-
- @media ( min-width: 768px ) {
- font-size: 1.25em;
- }
-}
-
-.ep-search-result__type {
- background-color: var(--ep-search-alternate-background-color);
- border-radius: 0.25em;
- display: inline-block;
- font-size: 0.875em;
- line-height: 1.5;
- padding: 0 0.25em;
- vertical-align: text-bottom;
-}
-
-.ep-search-result__description {
- display: none;
- font-size: 0.875em;
- grid-area: description;
- margin: 0;
-
- @media ( min-width: 768px ) {
- display: block;
- font-size: 1em;
- }
-}
-
-.ep-search-result__footer {
- display: grid;
- grid-area: footer;
- grid-gap: 0.5em;
- justify-items: start;
-}
diff --git a/lib/elasticpress/assets/css/instant-results/results.css b/lib/elasticpress/assets/css/instant-results/results.css
deleted file mode 100644
index eb3dc3c..0000000
--- a/lib/elasticpress/assets/css/instant-results/results.css
+++ /dev/null
@@ -1,30 +0,0 @@
-.ep-search-results {
- display: grid;
- grid-gap: 2em;
- grid-template-columns: 100%;
- grid-template-rows: max-content;
- padding: 0 0 1em 0;
- width: 100%;
-
- @media ( min-width: 768px ) {
- height: 100%;
- overflow-y: auto;
- padding: 0 1em 1em 1em;
- }
-}
-
-.ep-search-results__header {
- align-items: center;
- display: flex;
- gap: 1em;
- justify-content: space-between;
-}
-
-.ep-search-results__title {
- font-size: 1.25em;
- margin: 0 !important;
-
- @media ( min-width: 768px ) {
- font-size: 1.5em;
- }
-}
diff --git a/lib/elasticpress/assets/css/instant-results/sidebar-toggle.css b/lib/elasticpress/assets/css/instant-results/sidebar-toggle.css
deleted file mode 100644
index 10c3200..0000000
--- a/lib/elasticpress/assets/css/instant-results/sidebar-toggle.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.ep-search-sidebar-toggle {
- width: 100%;
-
- @media ( min-width: 768px ) {
- display: none;
- }
-}
diff --git a/lib/elasticpress/assets/css/instant-results/sidebar.css b/lib/elasticpress/assets/css/instant-results/sidebar.css
deleted file mode 100644
index c3d2253..0000000
--- a/lib/elasticpress/assets/css/instant-results/sidebar.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.ep-search-sidebar {
- display: none;
- margin-bottom: 2em;
-
- &.is-open {
- display: block;
- }
-
- @media ( min-width: 768px ) {
- display: block;
- max-height: calc(100% - 1em);
- min-width: 25%;
- overflow-y: auto;
- }
-}
diff --git a/lib/elasticpress/assets/css/instant-results/sort.css b/lib/elasticpress/assets/css/instant-results/sort.css
deleted file mode 100644
index be9e085..0000000
--- a/lib/elasticpress/assets/css/instant-results/sort.css
+++ /dev/null
@@ -1,24 +0,0 @@
-.ep-search-sort {
- flex-shrink: 0;
- gap: 0.5em;
- margin: 0;
-
- @nest .ep-search-results & {
- display: none;
-
- @media ( min-width: 768px ) {
- align-items: center;
- display: flex;
- }
- }
-
- @nest .ep-search-sidebar & {
- display: flex;
- flex-direction: column;
- margin-bottom: 1em;
-
- @media ( min-width: 768px ) {
- display: none;
- }
- }
-}
diff --git a/lib/elasticpress/assets/css/instant-results/toolbar.css b/lib/elasticpress/assets/css/instant-results/toolbar.css
deleted file mode 100644
index ced39b1..0000000
--- a/lib/elasticpress/assets/css/instant-results/toolbar.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.ep-search-toolbar {
- align-items: start;
- display: flex;
- flex-wrap: wrap;
- gap: 0.25em;
- margin: 1em 0;
-
- @media ( min-width: 768px ) {
- align-items: center;
- }
-}
diff --git a/lib/elasticpress/assets/css/instant-results/utilities.css b/lib/elasticpress/assets/css/instant-results/utilities.css
deleted file mode 100644
index 38d3674..0000000
--- a/lib/elasticpress/assets/css/instant-results/utilities.css
+++ /dev/null
@@ -1,47 +0,0 @@
-.ep-search-reset-button {
- font: inherit !important;
- height: auto !important;
- letter-spacing: inherit !important;
- line-height: 1 !important;
- margin: 0 !important;
- padding: 0 !important;
- text-align: inherit !important;
- text-transform: inherit !important;
- width: auto !important;
-
- &,
- &:focus,
- &:hover {
- background: transparent !important;
- border: none !important;
- box-shadow: none !important;
- color: inherit !important;
- cursor: default !important;
- }
-
- &:focus {
- outline: medium auto Highlight !important;
- outline: medium auto -webkit-focus-ring-color !important;
- outline-offset: 0 !important;
- }
-}
-
-.ep-search-small-button {
- font-size: 0.875em !important;
- height: auto !important;
- line-height: 1 !important;
- padding: 0.5em !important;
-}
-
-.ep-search-icon-button {
- align-items: center;
- display: flex;
- justify-content: space-between;
-
- & svg {
- fill: currentColor;
- flex-shrink: 0;
- height: 1em;
- width: 1em;
- }
-}
diff --git a/lib/elasticpress/assets/css/ordering.css b/lib/elasticpress/assets/css/ordering.css
deleted file mode 100644
index ef15981..0000000
--- a/lib/elasticpress/assets/css/ordering.css
+++ /dev/null
@@ -1,143 +0,0 @@
-#ep-ordering {
- border-left-width: 0;
- border-right-width: 0;
-
- & .inside {
- background-color: #f1f1f1;
- margin: 0;
- padding: 0;
- }
-
- & .pointers,
- & .pointer-search,
- & .loading {
- background-color: #fff;
- border-left: 1px solid #eee;
- border-right: 1px solid #eee;
- }
-
- & .new-post {
- background: #fff;
- padding: 0 1em;
- }
-
- & .loading {
- padding: 1em;
-
- & .spinner {
- float: left;
- margin-left: 0;
- margin-top: 0;
- }
- }
-
- & .pointer-type {
- border: 2px solid #0073aa;
- border-radius: 2px;
- color: #0073aa;
- display: inline-block;
- font-size: 0.75em;
- font-weight: 700;
- margin-right: 8px;
- padding: 1px 2px;
- }
-
- & .pointers {
-
- & .pointer,
- & .post {
- padding: 1em;
-
- &:nth-child(odd) {
- background-color: #f9f9f9;
- }
- }
-
- & .title {
- color: #0073aa;
- }
-
- & .pointer-actions {
- float: right;
-
- & .handle {
- cursor: move;
- }
-
- & .delete-pointer {
- margin-left: 10px;
- }
- }
-
- & .next-page-notice {
- background-color: #fdeeca;
- padding: 1em 0;
- text-align: center;
- }
- }
-
- & .legend {
- background: #fff;
- border-bottom: 1px solid #eee;
- padding: 1em 0;
- text-align: center;
- }
-
- & .legend-item {
- display: inline-block;
- font-size: 0.875em;
- font-style: italic;
- margin: 0 0.5em;
- }
-
- & .pointer-search {
- margin-top: 2em;
-
- & .no-results {
- padding: 1em;
- }
-
- & .section-title {
- border-bottom: 1px solid #eee;
- border-top: 1px solid #eee;
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
- font-weight: 700;
- }
-
- & .search-wrapper {
- padding: 1em 0;
- }
-
- & .input-wrap {
- padding: 0 1em;
- }
-
- & .search-pointers {
- font-size: 18px;
- height: 1.7em;
- line-height: 100%;
- padding: 3px 8px;
- }
-
- & .pointer-results {
- padding: 1em 0 0;
- }
-
- & .pointer-result {
- padding: 10px 2em;
-
- & .dashicons {
- float: right;
- }
-
- &:hover {
- background-color: #f9f9f9;
- }
- }
- }
-
- & .delete-pointer,
- & .add-pointer {
- cursor: pointer;
- }
-}
diff --git a/lib/elasticpress/assets/css/related-posts-block.css b/lib/elasticpress/assets/css/related-posts-block.css
deleted file mode 100644
index 82babec..0000000
--- a/lib/elasticpress/assets/css/related-posts-block.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.editor-styles-wrapper .wp-block-elasticpress-related-posts ul,
-.wp-block-elasticpress-related-posts ul {
- list-style-type: none;
- padding: 0;
-}
-
-.editor-styles-wrapper .wp-block-elasticpress-related-posts ul li a > div {
- display: inline;
-}
diff --git a/lib/elasticpress/assets/css/sites-admin.css b/lib/elasticpress/assets/css/sites-admin.css
deleted file mode 100644
index 8b987d1..0000000
--- a/lib/elasticpress/assets/css/sites-admin.css
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Switch toggle on network admin sites page. */
-.switch {
- display: inline-block;
- height: 34px;
- position: relative;
- width: 60px;
-}
-
-.switch input {
- height: 0;
- opacity: 0;
- width: 0;
-}
-
-.slider {
- background-color: #ccc;
- bottom: 0;
- cursor: pointer;
- left: 0;
- position: absolute;
- right: 0;
- top: 0;
- -webkit-transition: 0.4s;
- transition: 0.4s;
-}
-
-.slider::before {
- background-color: #fff;
- bottom: 4px;
- content: "";
- height: 26px;
- left: 4px;
- position: absolute;
- -webkit-transition: 0.4s;
- transition: 0.4s;
- width: 26px;
-}
-
-input:checked + .slider {
- background-color: #2196f3;
-}
-
-input:focus + .slider {
- box-shadow: 0 0 1px #2196f3;
-}
-
-input:checked + .slider::before {
- -webkit-transform: translateX(26px);
- -ms-transform: translateX(26px);
- transform: translateX(26px);
-}
-
-/* Rounded sliders */
-.slider.round {
- border-radius: 34px;
-}
-
-.slider.round::before {
- border-radius: 50%;
-}
-
-.switch-label {
- padding-left: 20px;
- padding-top: 20px;
-}
diff --git a/lib/elasticpress/assets/css/sync.css b/lib/elasticpress/assets/css/sync.css
deleted file mode 100644
index ad438b1..0000000
--- a/lib/elasticpress/assets/css/sync.css
+++ /dev/null
@@ -1,329 +0,0 @@
-:root {
- --ep-admin-color-base-white: #fff;
- --ep-admin-color-blue-01: #00a0d2;
- --ep-admin-color-grey-01: #f1f1f1;
- --ep-admin-color-green-01: #46b450;
- --ep-admin-color-red-01: #b52727;
- --ep-admin-color-dark-01: #333;
- --ep-admin-max-width: 1200px;
-
- --ep-admin-box-title: #1d2327;
-
- --ep-admin-delete-sync-button-bg-color: rgba(181, 39, 39, 0.03);
-
- --ep-admin-progress-bar-bg-color: rgba(0, 160, 210, 0.3);
-
- --ep-admin-output-tab-color: #1e1e1e;
-
- --ep-admin-log-bg-color: #1a1e24;
- --ep-admin-log-line-number-color: #999;
- --ep-admin-log-line-number-bg-color: #303030;
-
-}
-
-.elasticpress_page_elasticpress-sync .button:disabled {
- cursor: not-allowed;
-}
-
-.ep-sync-box__progress-wrapper {
- display: none;
-}
-
-.ep-sync-box__output {
- background-color: var(--ep-admin-log-bg-color);
- display: none;
- margin-bottom: 20px;
- max-height: 200px;
- overflow-y: scroll;
- position: relative;
-}
-
-.ep-sync-box__output_active {
- display: block;
-}
-
-.ep-sync-box__output-wrapper {
- color: var(--ep-admin-color-base-white);
- margin-left: 30px;
- min-height: 200px;
-}
-
-.ep-sync-box__output-line {
- position: relative;
-}
-
-.ep-sync-box__output-line-number {
- background-color: var(--ep-admin-log-line-number-bg-color);
- color: var(--ep-admin-log-line-number-color);
- left: -30px;
- min-width: 20px;
- padding: 0 3px 0 5px;
- position: absolute;
- text-align: right;
- white-space: nowrap;
-}
-
-.ep-sync-box__output-line-text {
- font-size: 12px;
- padding-left: 14px;
-}
-
-.ep-sync-box__output-tabs {
- align-items: center;
- display: flex;
-}
-
-.ep-sync-box__output-tabs_hide {
- display: none;
-}
-
-.ep-sync-box__output-tab {
- color: var(--ep-admin-output-tab-color);
- padding: 16px;
-}
-
-.ep-sync-box__output-tab:hover {
- cursor: pointer;
-}
-
-.ep-sync-box__output-tab_active {
- border-bottom: 4px solid var(--ep-admin-color-blue-01);
- padding-bottom: 12px;
-}
-
-.ep-sync-box__output-tab_active:hover {
- cursor: default;
-}
-
-.ep-sync-box__button-text {
- height: 21px;
-}
-
-.elasticpress_page_elasticpress-sync .card {
- max-width: var(--ep-admin-max-width);
-
- & .ep-sync-box__description-actions {
- display: flex;
- flex-direction: column;
-
- @media (min-width: 768px) {
- flex-direction: row;
- justify-content: space-between;
- }
- }
-
- & .ep-sync-box__description {
-
- @media (min-width: 768px) {
- width: 69%;
- }
- }
-
- & .ep-sync-box__action {
- align-items: center;
- display: flex;
- flex-direction: column;
- margin-top: 40px;
-
- @media (min-width: 768px) {
- width: 30%;
- }
-
- & .ep-sync-box__button {
- align-items: center;
- display: flex;
- font-size: 24px;
- font-weight: 700;
- height: 68px;
- justify-content: space-between;
- padding: 20px 40px;
- width: 228px;
- }
-
- & .ep-sync-box__icon-button {
- font-size: 28px;
- height: 28px;
- width: 28px;
-
- }
-
- & .ep-sync-box__learn-more-link {
- margin-top: 19px;
- }
-
- }
-
- & .ep-sync-box__description_text {
- font-size: 18px;
- }
-
- & .ep-last-sync {
- margin-bottom: 12px;
- }
-
- & .ep-last-sync__title {
- font-size: 20px;
- font-weight: 700;
- margin-bottom: 0.5em;
- }
-
- & .ep-last-sync__date {
- background-color: var(--ep-admin-color-grey-01);
- padding: 6px;
- }
-
- & .ep-sync-box__buttons {
- display: flex;
-
- }
-
- & .ep-sync-box__button-resume,
- & .ep-sync-box__button-pause,
- & .ep-sync-box__button-stop {
- align-items: center;
- display: none;
- flex-direction: column;
- height: 68px;
- justify-content: center;
- width: 100px;
- }
-
- & .ep-sync-box__button-stop {
- background-color: var(--ep-admin-color-blue-01);
- border-color: var(--ep-admin-color-blue-01);
- margin-left: 24px;
- }
-
- & .ep-sync-box__progress {
- align-items: normal;
- display: flex;
- flex-direction: column;
- margin-bottom: 5px;
- margin-top: 19px;
-
- @media (min-width: 768px) {
- align-items: center;
- flex-direction: row;
- }
- }
-
- & .ep-sync-box__sync-in-progress {
- display: flex;
- flex-direction: row;
-
- @media (min-width: 768px) {
- width: 30%;
- }
- }
-
- & .ep-sync-box__progressbar {
- background-color: var(--ep-admin-color-grey-01);
- border-radius: 24px;
- height: 20px;
- margin: 15px 0;
- position: relative;
- width: 100%;
-
- @media (min-width: 768px) {
- margin: 0;
- width: 65%;
- }
- }
-
- & .ep-sync-box__progressbar_animated {
- background-color: var(--ep-admin-progress-bar-bg-color);
- color: var(--ep-admin-color-dark-01);
- display: block;
- height: 100%;
- margin: 0;
- text-align: center;
- transition: width 0.5s ease-in-out;
- width: 0;
- }
-
- & .ep-sync-box__progressbar_complete {
- background-color: var(--ep-admin-color-green-01);
- color: var(--ep-admin-color-base-white);
- }
-
- & .ep-sync-box__sync-in-progress-info {
- display: flex;
- flex-direction: column;
- margin-left: 12px;
- }
-
- & .ep-sync-box__progress-info {
- font-size: 14px;
- font-weight: 500;
- margin-bottom: 5px;
- }
-
- & .ep-sync-box__start-time {
- color: var(--ep-admin-color-blue-01);
- font-size: 14px;
- }
-
- & .ep-sync-box__start-time-date {
- color: var(--ep-admin-color-dark-01);
- }
-}
-
-.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync {
- margin-top: 40px;
-
- & .card {
- margin-top: 17px;
- }
-
- & .ep-delete-data-and-sync__title {
- color: var(--ep-admin-box-title);
- font-size: 18px;
- font-weight: 400;
- }
-
- & .ep-delete-data-and-sync__warning {
- align-items: flex-start;
- display: flex;
-
- @media (min-width: 768px) {
- width: 69%;
- }
- }
-
- & .ep-delete-data-and-sync__warning-icon {
- margin-right: 9px;
- margin-top: 17px;
- }
-
- & .ep-delete-data-and-sync__button {
- background-color: var(--ep-admin-delete-sync-button-bg-color);
- border: 1px solid var(--ep-admin-color-red-01);
- color: var(--ep-admin-color-red-01);
- margin: 5px 0 12px;
- }
-
- & .ep-delete-data-and-sync__button-cancel {
- display: none;
- }
-
- & .ep-sync-box__action {
- flex-direction: column;
- height: auto;
- justify-content: center;
- margin-top: 0;
- width: 100%;
-
- @media (min-width: 768px) {
- flex-direction: row;
- height: 68px;
- justify-content: space-between;
- }
- }
-
- & .ep-sync-box__buttons {
-
- @media (min-width: 768px) {
- margin-right: 5%;
- }
- }
-}
diff --git a/lib/elasticpress/assets/css/synonyms.css b/lib/elasticpress/assets/css/synonyms.css
deleted file mode 100644
index ac6f60f..0000000
--- a/lib/elasticpress/assets/css/synonyms.css
+++ /dev/null
@@ -1,97 +0,0 @@
-#synonym-root {
-
- & .page-title-action {
- margin-left: 10px;
- }
-
- & .postbox .hndle {
- cursor: default;
- }
-
- & h2 {
- color: #23282d;
- }
-}
-
-.synonym-alternatives-editor,
-.synonym-set-editor {
- display: flex;
-
- & > .postbox {
- width: 100%;
-
- & > .hndle {
- display: flex;
- }
- }
-
- & .synonym-alternative-editor {
- display: flex;
- }
-
- & .ep-synonyms__linked-multi-input {
- flex: 1;
- margin-bottom: 0.5em;
- }
-
- & .ep-synonyms__input {
- border: 1px solid hsl(0, 0%, 80%);
- margin-bottom: 0.5em;
- margin-right: 1em;
- width: 10em;
- }
-
- & .synonym-alternatives__primary-heading {
- width: 11em;
- }
-
- & .synonym-alternatives__input-heading {
- flex: 1;
- }
-
- & .ep-synonyms__linked-multi-input input:focus {
- box-shadow: none;
- }
-
- &.invalid input {
- border-color: #a00;
- }
-}
-
-.synonym-alternative-editor,
-.synonym-set-editor {
- margin-top: 0.625em;
-}
-
-button.synonym__remove {
- background-color: transparent;
- border: none;
- color: #a00;
- cursor: pointer;
- margin: -8px 0 0 10px;
- padding: 0;
-
- & .dashicons-dismiss {
- margin: -2px 2px 0 0;
- }
-}
-
-.synonym__validation::before {
- content: "";
- flex-basis: 100%;
- height: 0;
-}
-
-.synonym__validation,
-.synonym-solr-editor__validation p {
- color: #a00;
- font-style: italic;
-}
-
-.synonym__validation {
- margin: 0 0 0.625em 0.5em;
-}
-
-.synonym-btn-group button.button {
- margin-right: 0.625em;
-}
diff --git a/lib/elasticpress/assets/js/autosuggest.js b/lib/elasticpress/assets/js/autosuggest.js
deleted file mode 100644
index 5ed53da..0000000
--- a/lib/elasticpress/assets/js/autosuggest.js
+++ /dev/null
@@ -1,782 +0,0 @@
-/* eslint-disable camelcase, no-underscore-dangle, no-use-before-define */
-import {
- findAncestorByClass,
- escapeDoubleQuotes,
- replaceGlobally,
- debounce,
- domReady,
-} from './utils/helpers';
-import 'element-closest';
-import 'promise-polyfill/src/polyfill';
-import 'whatwg-fetch';
-
-const { epas } = window;
-
-// Ensure we have an endpoint URL, or
-// else this shouldn't happen
-if (epas.endpointUrl && epas.endpointUrl !== '') {
- init();
-
- // Publically expose API
- window.epasAPI = {
- hideAutosuggestBox,
- updateAutosuggestBox,
- esSearch,
- buildSearchQuery,
- };
-}
-
-/**
- * Submit the search form
- *
- * @param {Node} input - input element
- */
-function submitSearchForm(input) {
- input.closest('form').submit();
-}
-
-/**
- * Set the expanded aria state on the input
- *
- * @param {boolean} haveOptions - whether or not the autosuggest list contains results
- * @param {Node} input - search input
- */
-function toggleInputAria(haveOptions, input) {
- input.setAttribute('aria-expanded', haveOptions);
-}
-
-/**
- * Set the active descendant aria attribute input
- *
- * @param {string} id - id of the currently selected element
- * @param {Node} input - search input
- */
-function setInputActiveDescendant(id, input) {
- input.setAttribute('aria-activedescendant', id);
-}
-
-/**
- * Take selected item and fill the search input
- *
- * @param {Node} input - input element
- * @param {string} text - new input value
- */
-function selectAutosuggestItem(input, text) {
- input.value = text; // eslint-disable-line no-param-reassign
-}
-
-/**
- * Fires events when autosuggest results are clicked,
- * and if GA tracking is activated
- *
- * @param {object} detail - value to pass on to the Custom Event
- */
-function triggerAutosuggestEvent(detail) {
- const event = new CustomEvent('ep-autosuggest-click', { detail });
- window.dispatchEvent(event);
-
- if (
- detail.searchTerm &&
- parseInt(epas.triggerAnalytics, 10) === 1 &&
- typeof gtag === 'function'
- ) {
- const action = `click - ${detail.searchTerm}`;
- // eslint-disable-next-line no-undef
- gtag('event', action, {
- event_category: 'EP :: Autosuggest',
- event_label: detail.url,
- transport_type: 'beacon',
- });
- }
-}
-
-/**
- * Navigate to the selected item, and provides
- * event hook for JS customizations, like GA
- *
- * @param {string} searchTerm - user defined search term
- * @param {string} url - post url from dataset in search result
- */
-function goToAutosuggestItem(searchTerm, url) {
- const detail = {
- searchTerm,
- url,
- };
-
- triggerAutosuggestEvent(detail);
- window.location.href = url;
-}
-
-/**
- * Respond to an item selection based on the predefined behavior.
- * If epas.action is set to "navigate" (the default), redirects the browser to the URL of the selected item
- * If epas.action is set to any other value (such as "search"), fill in the value and perform the search
- *
- * @param {Node} input - search input
- * @param {Node} element - search term result item
- * @returns {Function} calls the submitSearchForm function
- */
-function selectItem(input, element) {
- if (epas.action === 'navigate') {
- return goToAutosuggestItem(input.value, element.dataset.url);
- }
-
- selectAutosuggestItem(input, element.innerText);
- return submitSearchForm(input);
-}
-
-/**
- * Build the search query from the search text - the query is generated in PHP
- * and passed into the front end as window.epas = { "query...
- *
- * @returns {string} json string
- */
-function getJsonQuery() {
- if (typeof window.epas === 'undefined') {
- const error = 'No epas object defined';
-
- // eslint-disable-next-line no-console
- console.warn(error);
- return { error };
- }
-
- return window.epas;
-}
-
-/**
- * Build the search query from the search text
- *
- * @param {string} searchText - user search string
- * @param {string} placeholder - placeholder text to replace
- * @param {object} options - Autosuggest settings
- * @param {string} options.query - JSON query string to pass to ElasticSearch
- * @returns {string} json representation of search query
- */
-function buildSearchQuery(searchText, placeholder, { query }) {
- const newQuery = replaceGlobally(query, placeholder, searchText);
- return newQuery;
-}
-
-/**
- * Build the ajax request
- *
- * @param {string} query - json string
- * @param {string} searchTerm - user search term
- * @returns {object} AJAX object request
- */
-async function esSearch(query, searchTerm) {
- const fetchConfig = {
- body: query,
- method: 'POST',
- mode: 'cors',
- headers: {
- 'Content-Type': 'application/json; charset=utf-8',
- },
- };
-
- if (epas?.http_headers && typeof epas.http_headers === 'object') {
- Object.keys(epas.http_headers).forEach((name) => {
- fetchConfig.headers[name] = epas.http_headers[name];
- });
- }
-
- // only applies headers if using ep.io endpoint
- if (epas.addSearchTermHeader) {
- fetchConfig.headers['EP-Search-Term'] = encodeURI(searchTerm);
- }
-
- try {
- const response = await window.fetch(epas.endpointUrl, fetchConfig);
- if (!response.ok) {
- throw Error(response.statusText);
- }
-
- const data = await response.json();
-
- // allow for filtered data before returning it to
- // be output on the front end
- if (typeof window.epDataFilter !== 'undefined') {
- return window.epDataFilter(data, searchTerm);
- }
-
- return data;
- } catch (error) {
- // eslint-disable-next-line no-console
- console.error(error);
- return error;
- }
-}
-
-/**
- * Update the auto suggest box with new options or hide if none
- *
- * @param {Array} options - search results
- * @param {string} input - search string
- * @returns {boolean} return true
- */
-function updateAutosuggestBox(options, input) {
- let i;
- let itemString = '';
-
- // get the search term for use later on
- const { value } = input;
- const container = findAncestorByClass(input, 'ep-autosuggest-container');
- const resultsContainer = container.querySelector('.ep-autosuggest');
- const suggestList = resultsContainer.querySelector('.autosuggest-list');
-
- // empty the the list of all child nodes
- while (suggestList.firstChild) {
- suggestList.removeChild(suggestList.firstChild);
- }
-
- if (options.length > 0) {
- resultsContainer.style = 'display: block;';
- } else {
- resultsContainer.style = 'display: none;';
- }
-
- // anticipating the future... a setting where we configure
- // a limit of results to show, and optionally append a
- // link to "all results" or something of that nature
- const resultsLimit = options.length;
-
- // create markup for list items
- // eslint-disable-next-line
- for ( i = 0; resultsLimit > i; ++i ) {
- const text = options[i]._source.post_title;
- const url = options[i]._source.permalink;
- const escapedText = escapeDoubleQuotes(text);
-
- const searchParts = value.trim().split(' ');
- let resultsText = escapedText;
-
- if (epas.highlightingEnabled) {
- // uses some regex magic to match upper/lower/capital case
- const regex = new RegExp(`\\b(${searchParts.join('|')})`, 'gi');
- resultsText = resultsText.replace(
- regex,
- (word) =>
- `<${epas.highlightingTag} class="${epas.highlightingClass} ep-autosuggest-highlight">${word}${epas.highlightingTag}>`,
- );
- }
-
- let itemHTML = `
-
- ${resultsText}
-
- `;
-
- if (typeof window.epAutosuggestItemHTMLFilter !== 'undefined') {
- itemHTML = window.epAutosuggestItemHTMLFilter(itemHTML, options[i], i, value);
- }
-
- itemString += itemHTML;
- }
-
- // append list items to the list
- suggestList.innerHTML = itemString;
-
- const autosuggestItems = Array.from(document.querySelectorAll('.autosuggest-link'));
-
- suggestList.addEventListener('click', (event) => {
- event.preventDefault();
- const target =
- event.target.tagName === epas.highlightingTag?.toUpperCase()
- ? event.target.parentElement
- : event.target;
-
- if (autosuggestItems.includes(target)) {
- selectItem(input, target);
- }
- });
-
- return true;
-}
-
-/**
- * Hide the auto suggest box
- *
- * @returns {boolean} returns true
- */
-function hideAutosuggestBox() {
- const lists = document.querySelectorAll('.autosuggest-list');
- const containers = document.querySelectorAll('.ep-autosuggest');
-
- // empty all EP results lists
- lists.forEach((list) => {
- while (list.firstChild) {
- list.removeChild(list.firstChild);
- }
- });
-
- // hide all EP results containers
- containers.forEach((container) => {
- // eslint-disable-next-line
- container.style = 'display: none;';
- });
-
- return true;
-}
-
-/**
- * Checks for any manually ordered posts and puts them in the correct place
- *
- * @param {Array} hits - ES results
- * @param {string} searchTerm - user search term
- * @returns {object} formatted hits
- */
-function checkForOrderedPosts(hits, searchTerm) {
- const toInsert = {};
- const taxName = 'ep_custom_result';
- const lowerCaseSearchTerm = searchTerm.toLowerCase();
-
- const filteredHits = hits.filter((hit) => {
- // Should we retain this hit in its current position?
- let retain = true;
-
- if (undefined !== hit._source.terms && undefined !== hit._source.terms[taxName]) {
- hit._source.terms[taxName].forEach((currentTerm) => {
- if (currentTerm.name.toLowerCase() === lowerCaseSearchTerm) {
- toInsert[currentTerm.term_order] = hit;
-
- retain = false;
- }
- });
- }
-
- return retain;
- });
-
- const orderedInserts = {};
-
- Object.keys(toInsert)
- .sort()
- .forEach((key) => {
- orderedInserts[key] = toInsert[key];
- });
-
- if (Object.keys(orderedInserts).length > 0) {
- Object.keys(orderedInserts).forEach((key) => {
- const insertItem = orderedInserts[key];
-
- filteredHits.splice(key - 1, 0, insertItem);
- });
- }
-
- return filteredHits;
-}
-
-/**
- * Add class to the form element while suggestions are being loaded
- *
- * @param {boolean} isLoading - whether suggestions are loading
- * @param {Node} input - search input field
- */
-function setFormIsLoading(isLoading, input) {
- const form = input.closest('form');
-
- if (isLoading) {
- form.classList.add('is-loading');
- } else {
- form.classList.remove('is-loading');
- }
-}
-
-/**
- * init method called if the epas endpoint is defined
- */
-function init() {
- const selectors = [epas.defaultSelectors, epas.selector].filter(Boolean).join(',');
-
- if (!selectors) {
- return;
- }
-
- // For the Autosuggest element that will be cloned.
- let autosuggestElement;
-
- // to be used by the handleUpDown function
- // to keep track of the currently selected result
- let currentIndex;
-
- // these are the keycodes we listen for in handleUpDown,
- // and in handleKeyup
- const keyCodes = [
- 38, // up
- 40, // down
- 13, // enter
- ];
-
- /**
- * Handles keyup event on the search input
- *
- * @param {event} event - keyup event
- */
- const handleUpDown = (event) => {
- if (!keyCodes.includes(event.keyCode)) {
- return;
- }
-
- const input = event.target;
- const container = findAncestorByClass(input, 'ep-autosuggest-container');
- const suggestList = container.querySelector('.autosuggest-list');
- const results = suggestList.children;
-
- /**
- * helper function to get the currently selected result
- *
- * @returns {number} index of the selected search result
- */
- const getSelectedResultIndex = () => {
- const resultsArr = Array.from(results);
- return resultsArr.findIndex((result) => result.classList.contains('selected'));
- };
-
- /**
- * helper function to deselect results
- */
- const deSelectResults = () => {
- Array.from(results).forEach((result) => {
- result.classList.remove('selected');
- result.setAttribute('aria-selected', 'false');
- });
- };
-
- /**
- * helper function to selected the next result
- */
- const selectNextResult = () => {
- if (currentIndex >= 0) {
- const el = results[currentIndex];
- el.classList.add('selected');
- el.setAttribute('aria-selected', 'true');
- setInputActiveDescendant(el.id, input);
- }
- };
-
- // select next or previous based on keyCode
- // if enter, navigate to that element
- switch (event.keyCode) {
- case 38: // Up
- // don't go less than the 0th index
- currentIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : 0;
- deSelectResults();
- break;
- case 40: // Down
- if (typeof currentIndex === 'undefined') {
- // index is not yet defined, so let's
- // start with the first one
- currentIndex = 0;
- } else {
- const current = getSelectedResultIndex();
-
- // check for existence of next result
- if (results[current + 1]) {
- currentIndex = current + 1;
- deSelectResults();
- }
- }
- break;
- case 13: // Enter
- if (results[currentIndex].classList.contains('selected')) {
- // navigate to the item defined in the span's data-url attribute
- selectItem(input, results[currentIndex].querySelector('.autosuggest-link'));
- }
- break;
- default:
- // No item selected
- break;
- }
-
- // only check next element if up and down key pressed
- if (results[currentIndex] && results[currentIndex].classList.contains('autosuggest-item')) {
- selectNextResult();
- } else {
- deSelectResults();
- }
-
- // keep cursor from heading back to the beginning in the input
- if (event.keyCode === 38) {
- // return false;
- event.preventDefault();
- }
- };
-
- /**
- * Get the searched post types from the search form.
- *
- * @param {HTMLFormElement} form - form containing the search input field
- * @returns {Array} - post types
- * @since 3.6.0
- */
- function getPostTypesFromForm(form) {
- const data = new FormData(form);
-
- if (data.has('post_type')) {
- return data.getAll('post_type').slice(-1);
- }
-
- if (data.has('post_type[]')) {
- return data.getAll('post_type[]');
- }
-
- return [];
- }
-
- /**
- * Calls the ajax request, and outputs the results.
- * Called by the handleKeyup callback, debounced.
- *
- * @param {Node} input - search input field
- */
- const fetchResults = async (input) => {
- // retrieves the PHP-genereated query to pass to ElasticSearch
- const queryJSON = getJsonQuery();
-
- if (queryJSON.error) {
- return;
- }
-
- const searchText = input.value;
- const placeholder = 'ep_autosuggest_placeholder';
- const postTypes = getPostTypesFromForm(input.form);
-
- if (searchText.length >= 2) {
- setFormIsLoading(true, input);
-
- let query = buildSearchQuery(searchText, placeholder, queryJSON);
-
- if (postTypes.length > 0) {
- query = JSON.parse(query);
-
- if (typeof query.post_filter.bool.must !== 'undefined') {
- query.post_filter.bool.must.push({
- terms: {
- 'post_type.raw': postTypes,
- },
- });
- }
-
- query = JSON.stringify(query);
- }
-
- // fetch the results
- const response = await esSearch(query, searchText);
-
- if (response && response._shards && response._shards.successful > 0) {
- const hits = checkForOrderedPosts(response.hits.hits, searchText);
-
- if (hits.length === 0) {
- hideAutosuggestBox();
- } else {
- updateAutosuggestBox(hits, input);
- }
- } else {
- hideAutosuggestBox();
- }
-
- setFormIsLoading(false, input);
- } else if (searchText.length === 0) {
- hideAutosuggestBox();
- }
- };
-
- const debounceFetchResults = debounce(fetchResults, 200);
-
- /**
- * Callback for keyup in Autosuggest container.
- *
- * Calls a debounced function to get the search results via
- * ajax request.
- *
- * @param {event} event - keyup event
- */
- const handleKeyup = (event) => {
- event.preventDefault();
- const { target, key, keyCode } = event;
-
- if (key === 'Escape' || key === 'Esc' || keyCode === 27) {
- hideAutosuggestBox();
- toggleInputAria(false, target);
- setInputActiveDescendant('', target);
- return;
- }
-
- if (keyCodes.includes(keyCode) && target.value !== '') {
- handleUpDown(event);
- return;
- }
-
- const input = event.target;
- debounceFetchResults(input);
- };
-
- /**
- * Wrap an element with an autosuggest container.
- *
- * @param {Element} element Element to wrap.
- * @returns {void}
- */
- const wrapInAutosuggestContainer = (element) => {
- const epContainer = document.createElement('div');
-
- epContainer.classList.add('ep-autosuggest-container');
-
- element.insertAdjacentElement('afterend', epContainer);
-
- epContainer.appendChild(element);
- };
-
- /**
- * Insert an autosuggest list after an element.
- *
- * @param {Element} element Element to add the autosuggest list after.
- * @returns {void}
- */
- const insertAutosuggestElement = (element) => {
- if (!autosuggestElement) {
- autosuggestElement = document.createElement('div');
- autosuggestElement.classList.add('ep-autosuggest');
-
- const autosuggestList = document.createElement('ul');
-
- autosuggestList.classList.add('autosuggest-list');
- autosuggestList.setAttribute('role', 'listbox');
-
- autosuggestElement.appendChild(autosuggestList);
- }
-
- const clonedElement = autosuggestElement.cloneNode(true);
-
- element.insertAdjacentElement('afterend', clonedElement);
- };
-
- /**
- * Prepare an input for Autosuggest.
- *
- * @param {Element} input Input to prepare.
- * @returns {void}
- */
- const prepareInputForAutosuggest = (input) => {
- /**
- * Skip facet widget search fields.
- */
- if (input.classList.contains('facet-search')) {
- return;
- }
-
- /**
- * Disable autocomplete.
- */
- input.setAttribute('autocomplete', 'off');
-
- /**
- * We know the markup of the Search block, so we don't need to add a
- * wrapper.
- */
- if (input.classList.contains('wp-block-search__input')) {
- input.form.classList.add('ep-autosuggest-container');
- insertAutosuggestElement(input.parentElement);
- } else {
- wrapInAutosuggestContainer(input);
- insertAutosuggestElement(input);
- }
-
- /**
- * Dispatch an event announcing the input has moved.
- */
- const event = new CustomEvent('elasticpress.input.moved');
-
- input.dispatchEvent(event);
-
- /**
- * Listen for any events:
- *
- * keyup
- * send them for a query to the Elasticsearch server
- * handle up and down keys to move between results
- *
- * blur
- * hide the autosuggest box
- */
- input.addEventListener('keyup', handleKeyup);
- input.addEventListener('blur', function () {
- window.setTimeout(hideAutosuggestBox, 200);
- });
- };
-
- /**
- * Find inputs within an element and prepare them for Autosuggest.
- *
- * @param {Element} element Element to find inputs within.
- * @returns {void}
- */
- const findAndPrepareInputsForAutosuggest = (element) => {
- const inputs = element.querySelectorAll(selectors);
-
- if (inputs) {
- Array.from(inputs).forEach(prepareInputForAutosuggest);
- }
- };
-
- /**
- * Observe the document for new potential Autosuggest inputs, and add
- * Autosuggest to any found inputs.
- *
- * @returns {void}
- */
- const observeDocumentForInputs = () => {
- const target = document.body;
- const config = {
- subtree: true,
- childList: true,
- };
-
- const observer = new MutationObserver((mutations, observer) => {
- mutations.forEach((mutation) => {
- Array.from(mutation.addedNodes).forEach((node) => {
- if (node.nodeType !== Node.ELEMENT_NODE) {
- return;
- }
-
- /**
- * Adding autosuggest to an input moves it in the DOM,
- * which would trigger our observer, so we need to
- * stop observing until it's been prepared.
- */
- observer.disconnect();
-
- /**
- * If the node is an input, prepare it for Autosuggest if
- * it matches the selectors, otherwise search the node for
- * inputs.
- */
- if (node.tagName === 'INPUT') {
- if (node.matches(selectors)) {
- prepareInputForAutosuggest(node);
- }
- } else {
- findAndPrepareInputsForAutosuggest(node);
- }
-
- /**
- * Resume observing.
- */
- observer.observe(target, config);
- });
- });
- });
-
- observer.observe(target, config);
- };
-
- /**
- * Add autosuggest to any inputs in the document.
- */
- findAndPrepareInputsForAutosuggest(document.body);
-
- /**
- * When the DOM is ready start observing for new inputs.
- */
- domReady(observeDocumentForInputs);
-}
diff --git a/lib/elasticpress/assets/js/blocks/related-posts/Edit.js b/lib/elasticpress/assets/js/blocks/related-posts/Edit.js
deleted file mode 100644
index c734faa..0000000
--- a/lib/elasticpress/assets/js/blocks/related-posts/Edit.js
+++ /dev/null
@@ -1,106 +0,0 @@
-const { __ } = wp.i18n;
-
-const { AlignmentToolbar, BlockControls, InspectorControls } = wp.editor;
-
-const { PanelBody, Placeholder, Spinner, QueryControls } = wp.components;
-
-const { Fragment, Component, RawHTML } = wp.element;
-
-const { addQueryArgs } = wp.url;
-
-/**
- * Edit component
- */
-class Edit extends Component {
- /**
- * Setup class
- *
- * @param {object} props Component properties
- */
- constructor(props) {
- super(props);
-
- this.state = {
- posts: false,
- };
- }
-
- /**
- * Load preview data
- */
- componentDidMount() {
- const urlArgs = {
- number: 100,
- };
-
- // Use 0 if in the Widgets Screen
- const postId = wp.data.select('core/editor').getCurrentPostId() ?? 0;
-
- wp.apiFetch({
- path: addQueryArgs(`/wp/v2/posts/${postId}/related`, urlArgs),
- })
- .then((posts) => {
- this.setState({ posts });
- })
- .catch(() => {
- this.setState({ posts: false });
- });
- }
-
- render() {
- const {
- attributes: { alignment, number },
- setAttributes,
- className,
- } = this.props;
- const { posts } = this.state;
-
- const displayPosts = posts.length > number ? posts.slice(0, number) : posts;
-
- return (
-
-
- setAttributes({ alignment: newValue })}
- />
-
-
-
- setAttributes({ number: value })}
- />
-
-
-
-
- {displayPosts === false || displayPosts.length === 0 ? (
-
- {posts === false ? : __('No related posts yet.')}
-
- ) : (
-
- )}
-
-
- );
- }
-}
-
-export default Edit;
diff --git a/lib/elasticpress/assets/js/blocks/related-posts/block.js b/lib/elasticpress/assets/js/blocks/related-posts/block.js
deleted file mode 100644
index 647c8f9..0000000
--- a/lib/elasticpress/assets/js/blocks/related-posts/block.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import Edit from './Edit';
-
-const { registerBlockType } = wp.blocks;
-
-registerBlockType('elasticpress/related-posts', {
- title: 'Related Posts (ElasticPress)',
- supports: {
- align: true,
- },
- category: 'widgets',
- attributes: {
- alignment: {
- type: 'string',
- default: 'none',
- },
- number: {
- type: 'number',
- default: 5,
- },
- },
-
- /**
- * Handle edit
- *
- * @param {object} props Component properties
- * @returns {object}
- */
- edit(props) {
- return ;
- },
-
- /**
- * Handle save
- *
- * @returns {void}
- */
- save() {
- return null;
- },
-});
diff --git a/lib/elasticpress/assets/js/comments.js b/lib/elasticpress/assets/js/comments.js
deleted file mode 100644
index e59440a..0000000
--- a/lib/elasticpress/assets/js/comments.js
+++ /dev/null
@@ -1,288 +0,0 @@
-import { findAncestorByClass, debounce } from './utils/helpers';
-
-const widgetSearchComments = document.querySelectorAll('.ep-widget-search-comments');
-
-let selectedResultIndex;
-
-widgetSearchComments.forEach((element) => {
- const input = document.createElement('input');
- input.setAttribute('autocomplete', 'off');
- input.setAttribute('type', 'search');
- input.setAttribute('class', 'ep-widget-search-comments-input');
-
- const resultList = document.createElement('ul');
- resultList.setAttribute('class', 'ep-widget-search-comments-results');
-
- element.appendChild(input);
- element.appendChild(resultList);
-});
-
-// these are the keycodes we listen for in handleUpDown,
-// and in handleKeyup
-const keyCodes = [
- 38, // up
- 40, // down
- 13, // enter
-];
-
-/**
- * Hide the result list
- *
- * @param {HTMLInputElement} inputElement The input element used in the widget
- */
-function hideResultsBox(inputElement) {
- selectedResultIndex = undefined;
-
- const widget = findAncestorByClass(inputElement, 'ep-widget-search-comments');
- const resultList = widget.querySelector('.ep-widget-search-comments-results');
-
- while (resultList.firstChild) {
- resultList.removeChild(resultList.firstChild);
- }
-}
-
-/**
- * Update the result list
- *
- * @param {object} comments Comments to be showed
- * @param {HTMLInputElement} inputElement The input element used in the widget
- */
-const updateResultsBox = (comments, inputElement) => {
- let items = '';
- let itemHTML = '';
-
- Object.keys(comments).forEach((id, index) => {
- if (comments[id]?.content && comments[id]?.link) {
- itemHTML = `
-
- `;
-
- if (typeof window.epCommentWidgetItemHTMLFilter !== 'undefined') {
- itemHTML = window.epCommentWidgetItemHTMLFilter(
- itemHTML,
- comments[id],
- index,
- inputElement.value,
- );
- }
-
- items += itemHTML;
- }
- });
-
- const widget = findAncestorByClass(inputElement, 'ep-widget-search-comments');
- const resultList = widget.querySelector('.ep-widget-search-comments-results');
-
- if (typeof window.epCommentWidgetItemsHTMLFilter !== 'undefined') {
- items = window.epCommentWidgetItemsHTMLFilter(items, inputElement.value);
- }
-
- resultList.innerHTML = items;
-};
-
-/**
- * Update the result list to inform the user that no results were found
- *
- * @param {HTMLInputElement} inputElement The input element used in the widget
- */
-const showNotFoundInResultsBox = (inputElement) => {
- const widget = findAncestorByClass(inputElement, 'ep-widget-search-comments');
- const resultList = widget.querySelector('.ep-widget-search-comments-results');
-
- let itemHTML = ``;
-
- if (typeof window.epCommentWidgetItemNotFoundHTMLFilter !== 'undefined') {
- itemHTML = window.epCommentWidgetItemNotFoundHTMLFilter(
- itemHTML,
- window.epc.noResultsFoundText,
- inputElement.value,
- );
- }
-
- resultList.innerHTML = itemHTML;
-};
-
-function hasMinimumLength(inputElement) {
- const minimumLength = window.epc.minimumLengthToSearch || 2;
- return inputElement?.value?.trim().length >= minimumLength;
-}
-
-/**
- * Add class to the widget element while results are being loaded
- *
- * @param {boolean} isLoading Whether results are loading
- * @param {Node} inputElement Search input field
- */
-function setIsLoading(isLoading, inputElement) {
- const widget = findAncestorByClass(inputElement, 'ep-widget-search-comments');
-
- if (isLoading) {
- widget.classList.add('ep-widget-search-comments-is-loading');
- } else {
- widget.classList.remove('ep-widget-search-comments-is-loading');
- }
-}
-
-/**
- * Fetch comments
- *
- * @param {HTMLInputElement} inputElement The input element used in the widget
- * @returns {(false|Promise)} Try to fetch comments
- */
-function fetchResults(inputElement) {
- if (hasMinimumLength(inputElement)) {
- const widget = findAncestorByClass(inputElement, 'ep-widget-search-comments');
- const postTypeElement = widget.querySelector('#ep-widget-search-comments-post-type');
- const postTypeQueryParameter = postTypeElement?.value
- ? `&post_type=${postTypeElement.value.trim()}`
- : '';
-
- setIsLoading(true, inputElement);
- return fetch(
- `${window.epc.restApiEndpoint}?s=${inputElement.value.trim()}${postTypeQueryParameter}`,
- )
- .then((response) => {
- if (!response.ok) {
- throw response;
- }
-
- return response.json();
- })
- .then((comments) => {
- if (Object.keys(comments).length === 0) {
- if (inputElement.value.trim()) {
- showNotFoundInResultsBox(inputElement);
- } else {
- hideResultsBox(inputElement);
- }
- } else {
- updateResultsBox(comments, inputElement);
- }
- })
- .catch(() => {
- hideResultsBox(inputElement);
- })
- .finally(() => {
- setIsLoading(false, inputElement);
- });
- }
- return false;
-}
-
-/**
- * Handle up, down and enter key
- *
- * @param {Event} event keyup event
- */
-const handleUpDownEnter = (event) => {
- if (!keyCodes.includes(event.keyCode)) {
- return;
- }
-
- const widget = findAncestorByClass(event.target, 'ep-widget-search-comments');
- const resultList = widget.querySelector('.ep-widget-search-comments-results');
- const sizeResult = resultList.querySelectorAll('.ep-widget-search-comments-result-item').length;
- const results = resultList.children;
-
- const previousSelectedResultIndex = selectedResultIndex;
-
- switch (event.keyCode) {
- case 38: // Up
- selectedResultIndex =
- selectedResultIndex - 1 < 0 || typeof selectedResultIndex === 'undefined'
- ? sizeResult - 1
- : selectedResultIndex - 1;
-
- break;
-
- case 40: // Down
- if (
- typeof selectedResultIndex === 'undefined' ||
- selectedResultIndex + 1 > sizeResult - 1
- ) {
- selectedResultIndex = 0;
- } else {
- selectedResultIndex += 1;
- }
-
- break;
-
- case 13: // Enter
- if (results[selectedResultIndex]?.classList.contains('selected') || sizeResult === 1) {
- const indexItem = selectedResultIndex || 0;
-
- if (results[indexItem]) {
- const linkToComment = results[indexItem]
- .querySelector('a')
- ?.getAttribute('href');
-
- window.location.href = linkToComment;
- }
- }
-
- break;
-
- default:
- break;
- }
-
- if (typeof previousSelectedResultIndex === 'number') {
- results[previousSelectedResultIndex].classList.remove('selected');
- results[previousSelectedResultIndex].setAttribute('aria-selected', 'false');
- }
-
- results[selectedResultIndex]?.classList.add('selected');
- results[selectedResultIndex]?.setAttribute('aria-selected', 'true');
-};
-
-const debounceFetchResults = debounce(fetchResults, 500);
-
-/**
- * Callback for keyup in Widget Search Comment container.
- *
- * Calls a debounced function to get the search results via
- * api rest request.
- *
- * @param {event} event - keyup event
- */
-const handleKeyup = (event) => {
- event.preventDefault();
- const { target, key, keyCode } = event;
-
- if (key === 'Escape' || key === 'Esc' || keyCode === 27) {
- hideResultsBox(target);
- target.setAttribute('aria-expanded', false);
-
- return;
- }
-
- if (keyCodes.includes(keyCode) && target.value !== '') {
- handleUpDownEnter(event);
-
- return;
- }
-
- if (hasMinimumLength(target)) {
- debounceFetchResults(target);
- } else {
- hideResultsBox(target);
- }
-};
-
-widgetSearchComments.forEach((element) => {
- const input = element.querySelector('.ep-widget-search-comments-input');
-
- input.addEventListener('keyup', handleKeyup);
- input.addEventListener('keydown', (event) => {
- if (event.keyCode === 38) {
- event.preventDefault();
- }
- });
- input.addEventListener('blur', function () {
- setTimeout(() => hideResultsBox(input), 200);
- });
-});
diff --git a/lib/elasticpress/assets/js/dashboard.js b/lib/elasticpress/assets/js/dashboard.js
deleted file mode 100644
index b7f0b1f..0000000
--- a/lib/elasticpress/assets/js/dashboard.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * Internal dependencies.
- */
-import Tooltip from '@10up/component-tooltip';
-
-/**
- * WordPress dependencies.
- */
-import { __ } from '@wordpress/i18n';
-
-/**
- * Window dependencies.
- */
-const {
- ajaxurl,
- epDash: { syncUrl },
-} = window;
-
-/**
- * Determine whether a Feature's new settings will require a reindex.
- *
- * @param {FormData} data Form data.
- * @returns {boolean} Whether a reindex will need to occur when saved.
- */
-const willChangeTriggerReindex = (data) => {
- return (
- data.get('requires_reindex') === '1' &&
- data.get('was_active') === '0' &&
- data.get('settings[active]') === '1'
- );
-};
-
-/**
- * Handle Feature settings being submitted.
- *
- * @param {Event} event Submit event.
- */
-const onSubmit = async (event) => {
- event.preventDefault();
-
- const form = event.target;
- const data = new FormData(form);
- const requiresConfirmation = willChangeTriggerReindex(data);
-
- if (requiresConfirmation) {
- /* eslint-disable no-alert */
- const isConfirmed = window.confirm(
- __(
- 'Enabling this feature will begin re-indexing your content. Do you wish to proceed?',
- 'elasticpress',
- ),
- );
-
- if (!isConfirmed) {
- return;
- }
- }
-
- const feature = form.closest('.ep-feature');
-
- feature.classList.add('saving');
- form.submit.disabled = true;
-
- const request = await fetch(ajaxurl, { method: 'POST', body: data });
- const response = await request.json();
-
- feature.classList.toggle('feature-active', response.data.active);
-
- if (response.data.reindex) {
- window.location = syncUrl;
- } else {
- feature.classList.remove('saving');
- form.submit.disabled = false;
- form.was_active.value = response.data.active ? '1' : '0';
- }
-};
-
-/**
- * Handle a Feature being set to be turned on or off.
- *
- * @param {Event} event Change event.
- */
-const onToggle = (event) => {
- const { form } = event.target;
- const data = new FormData(form);
-
- const notice = form.querySelector('.requirements-status-notice--reindex');
- const requiresConfirmation = willChangeTriggerReindex(data);
-
- if (notice) {
- notice.style.display = requiresConfirmation ? 'block' : null;
- }
-};
-
-/**
- * Handle click events within a Feature.
- *
- * @param {Event} event Click event.
- */
-const onClick = (event) => {
- const { target } = event;
-
- /**
- * Handle toggling settings.
- */
- if (target.classList.contains('settings-button')) {
- const feature = target.closest('.ep-feature');
-
- feature.classList.toggle('show-settings');
- target.setAttribute('aria-expanded', feature.classList.contains('show-settings'));
- }
-
- /**
- * Handle toggling description.
- */
- if (target.classList.contains('learn-more') || target.classList.contains('collapse')) {
- target.closest('.ep-feature').classList.toggle('show-full');
- }
-};
-
-/**
- * Bind events.
- */
-const featuresEl = document.querySelector('.ep-features');
-
-if (featuresEl) {
- featuresEl.addEventListener('change', onToggle);
- featuresEl.addEventListener('submit', onSubmit);
- featuresEl.addEventListener('click', onClick);
-}
-
-/**
- * Tooltips.
- */
-// eslint-disable-next-line no-new
-new Tooltip('.a11y-tip');
diff --git a/lib/elasticpress/assets/js/facets.js b/lib/elasticpress/assets/js/facets.js
deleted file mode 100644
index daa4ac6..0000000
--- a/lib/elasticpress/assets/js/facets.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import { debounce } from './utils/helpers';
-
-/**
- * Filters the facets to match the input search term when
- * the number of terms exceeds the threshold determined
- * by the ep_facet_search_threshold filter
- *
- * @param {event} event - keyup
- * @param {Node} facetTerms - terms node
- */
-const handleFacetSearch = (event, facetTerms) => {
- const { target } = event;
- const searchTerm = target.value.toLowerCase();
- const terms = facetTerms.querySelectorAll('.term');
-
- terms.forEach((term) => {
- const slug = term.getAttribute('data-term-slug');
- const name = term.getAttribute('data-term-name');
-
- if (name.includes(searchTerm) || slug.includes(searchTerm)) {
- term.classList.remove('hide');
- } else {
- term.classList.add('hide');
- }
- });
-};
-
-/**
- * Filter facet choices to match the search field term
- */
-const facets = document.querySelectorAll('.widget_ep-facet');
-
-facets.forEach((facet) => {
- const facetSearchInput = facet.querySelector('.facet-search');
-
- if (!facetSearchInput) {
- return;
- }
-
- const facetTerms = facet.querySelector('.terms');
-
- facet.querySelector('.facet-search').addEventListener(
- 'keyup',
- debounce((event) => {
- if (event.keyCode === 13) {
- return;
- }
-
- handleFacetSearch(event, facetTerms);
- }, 200),
- );
-});
diff --git a/lib/elasticpress/assets/js/instant-results/admin/components/facet-selector.js b/lib/elasticpress/assets/js/instant-results/admin/components/facet-selector.js
deleted file mode 100644
index bdcb2ae..0000000
--- a/lib/elasticpress/assets/js/instant-results/admin/components/facet-selector.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { FormTokenField } from '@wordpress/components';
-import { useMemo, useState, WPElement } from '@wordpress/element';
-import { __ } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import { facets } from '../config';
-
-/**
- * Facet selector component.
- *
- * @param {object} props Props.
- * @param {string} props.defaultValue Default value.
- * @returns {WPElement} Element.
- */
-export default ({ defaultValue, ...props }) => {
- const defaultValues = defaultValue.split(',');
- const [selectedFacets, setSelectedFacets] = useState(defaultValues);
-
- /**
- * Get the label for a facet from the facet key.
- *
- * @param {string} key Facet key.
- * @returns {string} Facet label.
- */
- const getLabelFromKey = (key) => {
- return facets[key]?.label;
- };
-
- /**
- * Get the key for a facet from the facet label.
- *
- * @param {string} label Facet label.
- * @returns {string} Facet key.
- */
- const getKeyFromLabel = (label) => {
- return Object.keys(facets).find((key) => {
- return label === facets[key].label;
- });
- };
-
- /**
- * Suggestions for the token field.
- */
- const suggestions = useMemo(() => Object.keys(facets).map(getLabelFromKey).filter(Boolean), []);
-
- /**
- * Values for the token field.
- */
- const value = useMemo(
- () => selectedFacets.map(getLabelFromKey).filter(Boolean),
- [selectedFacets],
- );
-
- /**
- * Handle change to token field.
- *
- * @param {Array} tokens Selected tokens.
- */
- const onChange = (tokens) => {
- setSelectedFacets(tokens.map(getKeyFromLabel).filter(Boolean));
- };
-
- return (
- <>
-
-
- >
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/admin/config.js b/lib/elasticpress/assets/js/instant-results/admin/config.js
deleted file mode 100644
index ba3d3fb..0000000
--- a/lib/elasticpress/assets/js/instant-results/admin/config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Window dependencies.
- */
-const { facets } = window.epInstantResultsAdmin;
-
-export { facets };
diff --git a/lib/elasticpress/assets/js/instant-results/admin/index.js b/lib/elasticpress/assets/js/instant-results/admin/index.js
deleted file mode 100644
index 781fb57..0000000
--- a/lib/elasticpress/assets/js/instant-results/admin/index.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { render } from '@wordpress/element';
-
-/**
- * Internal dependences.
- */
-import FacetSelector from './components/facet-selector';
-
-document.addEventListener('DOMContentLoaded', () => {
- const input = document.getElementById('feature_instant_results_facets');
-
- const {
- className,
- dataset: { fieldName },
- id,
- name,
- value,
- } = input;
-
- render(
- ,
- input.parentElement,
- );
-});
diff --git a/lib/elasticpress/assets/js/instant-results/components/common/checkbox-list.js b/lib/elasticpress/assets/js/instant-results/components/common/checkbox-list.js
deleted file mode 100644
index 9a0fbb8..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/common/checkbox-list.js
+++ /dev/null
@@ -1,240 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { Fragment, useRef, useState, WPElement } from '@wordpress/element';
-import { __, _n, sprintf } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import Checkbox from './checkbox';
-import SmallButton from './small-button';
-
-/**
- * Checkbox list component.
- *
- * @typedef {object} Option
- * @property {number} count Number associated with option.
- * @property {string} id Option ID.
- * @property {string} label Option label.
- * @property {number} order Option order.
- * @property {string} parent Parent option value.
- * @property {any} value Option value.
- *
- * @param {object} props Component props.
- * @param {boolean} props.disabled Whether the checkboxes should be disabled.
- * @param {boolean} props.label List label.
- * @param {Function} props.onChange Checkbox change event callback function.
- * @param {Option[]} props.options Checkbox options.
- * @param {string} props.selected Selected values.
- * @param {string} props.sortBy How to sort options.
- * @returns {WPElement} A React element.
- */
-export default ({ disabled, label, options, onChange, selected, sortBy }) => {
- /**
- * Outermost list element.
- */
- const listEl = useRef(null);
-
- /**
- * Whether all items are displayed and a setter.
- */
- const [showAll, setShowAll] = useState(false);
-
- /**
- * Reducer to group options by parent.
- *
- * @param {object} items Options grouped by parent.
- * @param {Option} option Option details.
- * @param {string} option.parent Option parent value.
- * @returns {object} Options grouped by parent.
- */
- const reduceOptionsByParent = (items, { parent, ...option }) => {
- // eslint-disable-next-line eqeqeq
- if (parent != false) {
- items[parent] = items[parent] || [];
- items[parent].push(option);
- }
-
- return items;
- };
-
- /**
- * Options grouped by parent value.
- */
- const childOptions = options.reduce(reduceOptionsByParent, {});
-
- /**
- * Reducer to group top level options. Top level options are options
- * with a parent of '0' or without a parent.
- *
- * @param {Array} items Options without a parent.
- * @param {Option} option Option details.
- * @param {string} option.parent Option parent value.
- * @returns {object} Options without a parent.
- */
- const reduceTopLevelOptions = (items, { parent, ...option }) => {
- // eslint-disable-next-line eqeqeq
- if (parent == false || parent === '0') {
- items.push(option);
- }
-
- return items;
- };
-
- /**
- * Top level options.
- */
- const topLevelOptions = options.reduce(reduceTopLevelOptions, []);
-
- /**
- * How many options should be displayed by default.
- */
- const optionsLimit = options.length > 8 ? 5 : 8;
-
- /**
- * How many options have been displayed.
- *
- * Incremented each time an item is displayed. Used to limit the number of
- * items displayed by default until the show more button is pressed.
- */
- let optionsShown = 0;
-
- /**
- * Handle checkbox change event.
- *
- * @param {Event} event Change event.
- */
- const onCheck = (event) => {
- const { checked, value } = event.target;
-
- let values = checked ? [...selected, value] : selected.filter((v) => v !== value);
-
- /* Only send selected values that are in the available options. */
- values = values.filter((v) => options.some((o) => o.value === v));
-
- onChange(values);
- };
-
- /**
- * Render an option.
- *
- * @param {Option} option Option.
- * @returns {WPElement} Render function.
- */
- const displayOption = ({ count, id, label, value }) => {
- const children = childOptions[value];
-
- if (!showAll && optionsShown >= optionsLimit) {
- return ;
- }
-
- const option = (
-
-
-
- {children && (showAll || optionsShown < optionsLimit) && (
-
- {
- /* eslint-disable-next-line no-use-before-define */
- displayOptions(children)
- }
-
- )}
-
- );
-
- optionsShown++;
-
- return option;
- };
-
- /**
- * Sort option callback.
- *
- * @param {Option} a First option to compare.
- * @param {Option} b second option to compare.
- * @returns {number} Comparison number.
- */
- const sortOptions = (a, b) => {
- let comparison = 0;
-
- if (sortBy === 'count') {
- comparison = b.count - a.count;
- }
-
- if (sortBy === 'name' || comparison === 0) {
- comparison = a.label.localeCompare(b.label);
- }
-
- return comparison;
- };
-
- /**
- * Render a list of options.
- *
- * @param {Option[]} options Options to display.
- * @returns {WPElement[]} Array of elements.
- */
- const displayOptions = (options) => {
- return options.splice(0).sort(sortOptions).map(displayOption);
- };
-
- /**
- * Handle clicking the show more/fewer button.
- *
- * @returns {void}
- */
- const onToggleShowAll = () => {
- setShowAll(!showAll);
-
- listEl.current.focus();
- };
-
- return (
- <>
- {options.length > 0 && (
-
- {
- /* Display top level options and their children. */
- displayOptions(topLevelOptions)
- }
- {
- /* Display remaining orphaned options. */
- Object.values(childOptions).map(displayOptions)
- }
-
- )}
-
- {options.length > optionsLimit && (
-
- {showAll
- ? __('Show fewer options', 'elasticpress')
- : sprintf(
- /* translators: %d: Number of additional options available. */
- _n(
- 'Show %d more option',
- 'Show %d more options',
- options.length - optionsLimit,
- 'elasticpress',
- ),
- options.length - optionsLimit,
- )}
-
- )}
- >
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/common/checkbox.js b/lib/elasticpress/assets/js/instant-results/components/common/checkbox.js
deleted file mode 100644
index 289c6b9..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/common/checkbox.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { WPElement } from '@wordpress/element';
-
-/**
- * Checkbox component.
- *
- * @param {Option} props Component props.
- * @param {string} props.count Checkbox count.
- * @param {string} props.id Checkbox ID.
- * @param {string} props.label Checkbox label.
- *
- * @returns {WPElement} Component element.
- */
-export default ({ count, id, label, ...props }) => {
- return (
-
- {' '}
-
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/common/image.js b/lib/elasticpress/assets/js/instant-results/components/common/image.js
deleted file mode 100644
index c4fcd9a..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/common/image.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { WPElement } from '@wordpress/element';
-
-/**
- * Image component.
- *
- * @param {Option} props Component props.
- *
- * @returns {WPElement} Component element.
- */
-export default ({ alt, height, ID, src, width, ...props }) => {
- return ;
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/common/modal.js b/lib/elasticpress/assets/js/instant-results/components/common/modal.js
deleted file mode 100644
index 8e96a38..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/common/modal.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * External dependencies.
- */
-import FocusTrap from 'focus-trap-react';
-
-/**
- * WordPress dependencies.
- */
-import { forwardRef, useCallback, useEffect, useRef, WPElement } from '@wordpress/element';
-import { closeSmall, Icon } from '@wordpress/icons';
-import { __ } from '@wordpress/i18n';
-
-/**
- * Modal components.
- *
- * @param {object} props Component props.
- * @param {WPElement} props.children Component children.
- * @param {boolean} props.isOpen Whether the modal is open.
- * @param {Function} props.onClose Callback to run when modal is closed.
- * @param {object} ref Ref.
- * @returns {WPElement} React element.
- */
-const Modal = ({ children, isOpen, onClose, ...props }, ref) => {
- /**
- * Reference to close button element.
- */
- const closeRef = useRef(null);
-
- /**
- * Handle key down.
- *
- * @param {Event} event Keydown event.
- */
- const onKeyDown = useCallback(
- (event) => {
- if (event.key === 'Escape' || event.key === 'Esc') {
- onClose();
- }
- },
- [onClose],
- );
-
- /**
- * Handle binding events to outside DOM elements.
- *
- * @returns {Function} Clean up function that removes events.
- */
- const handleEvents = () => {
- const { current: modalEl } = ref;
-
- modalEl.ownerDocument.body.addEventListener('keydown', onKeyDown);
-
- return () => {
- modalEl.ownerDocument.body.removeEventListener('keydown', onKeyDown);
- };
- };
-
- /**
- * Handle the model being opened or closed.
- *
- * Adds a class to the body element to allow controlling scrolling.
- */
- const handleOpen = () => {
- const { current: modalEl } = ref;
-
- if (isOpen) {
- modalEl.ownerDocument.body.classList.add('has-ep-search-modal');
- closeRef.current.focus();
- } else {
- modalEl.ownerDocument.body.classList.remove('has-ep-search-modal');
- }
- };
-
- useEffect(handleEvents, [onKeyDown, ref]);
- useEffect(handleOpen, [isOpen, ref]);
-
- return (
-
- {isOpen && (
-
-
-
- {children}
-
-
- )}
-
- );
-};
-
-export default forwardRef(Modal);
diff --git a/lib/elasticpress/assets/js/instant-results/components/common/panel.js b/lib/elasticpress/assets/js/instant-results/components/common/panel.js
deleted file mode 100644
index 11a20b6..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/common/panel.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { useState, WPElement } from '@wordpress/element';
-import { chevronDown, chevronUp, Icon } from '@wordpress/icons';
-
-/**
- * Facet wrapper component.
- *
- * @param {object} props Component props.
- * @param {WPElement} props.children Component children.
- * @param {boolean} props.defaultIsOpen Whether the panel is open by default.
- * @param {string} props.label Facet label.
- * @returns {WPElement} Component element.
- */
-export default ({ children, defaultIsOpen, label }) => {
- const [isOpen, setIsOpen] = useState(defaultIsOpen);
-
- /**
- * Handle click event on the header.
- */
- const onClick = () => {
- setIsOpen(!isOpen);
- };
-
- return (
-
-
-
-
-
- {children(isOpen)}
-
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/common/range-slider.js b/lib/elasticpress/assets/js/instant-results/components/common/range-slider.js
deleted file mode 100644
index 1ee67e9..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/common/range-slider.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * External dependencies.
- */
-import ReactSlider from 'react-slider';
-
-/**
- * WordPress dependencies.
- */
-import { WPElement } from '@wordpress/element';
-
-/**
- * Range slider component.
- *
- * @param {object} props Props.
- * @returns {WPElement} Element.
- */
-export default ({ ...props }) => {
- return (
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/common/small-button.js b/lib/elasticpress/assets/js/instant-results/components/common/small-button.js
deleted file mode 100644
index 71ccd7e..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/common/small-button.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { WPElement } from '@wordpress/element';
-
-/**
- * Small button component.
- *
- * @param {object} props Props.
- * @param {WPElement} props.children Children.
- * @param {string} props.className Class attribute.
- * @returns {WPElement} Element.
- */
-export default ({ children, className, ...props }) => {
- return (
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/common/star-rating.js b/lib/elasticpress/assets/js/instant-results/components/common/star-rating.js
deleted file mode 100644
index 8685ed6..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/common/star-rating.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { __, sprintf } from '@wordpress/i18n';
-import { WPElement } from '@wordpress/element';
-
-/**
- * Star rating component.
- *
- * @param {Option} props Component props.
- * @param {string} props.rating Rating.
- *
- * @returns {WPElement} Component element.
- */
-export default ({ rating }) => {
- const label = sprintf(
- /* translators: %1$f Rating. %2$d Max rating. */
- __('Rated %1$f out of %2$d', 'elasticpress'),
- rating,
- 5,
- );
-
- return (
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/facets/facet.js b/lib/elasticpress/assets/js/instant-results/components/facets/facet.js
deleted file mode 100644
index 8c3a40f..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/facets/facet.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { WPElement } from '@wordpress/element';
-
-/**
- * Internal dependencies.
- */
-import PostTypeFacet from './post-type-facet';
-import PriceRangeFacet from './price-range-facet';
-import TaxonomyTermsFacet from './taxonomy-terms-facet';
-
-/**
- * Facet component.
- *
- * @param {object} props Props.
- * @param {number} props.index Facet index.
- * @param {string} props.name Facet name.
- * @param {string} props.label Facet label.
- * @param {string} props.postTypes Facet post types.
- * @param {'post_type'|'price_range'|'taxonomy'} props.type Facet type.
- * @returns {WPElement} Component element.
- */
-export default ({ index, label, name, postTypes, type }) => {
- const defaultIsOpen = index < 2;
-
- switch (type) {
- case 'post_type':
- return ;
- case 'price_range':
- return ;
- case 'taxonomy':
- return (
-
- );
- default:
- return null;
- }
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/facets/post-type-facet.js b/lib/elasticpress/assets/js/instant-results/components/facets/post-type-facet.js
deleted file mode 100644
index f64fea8..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/facets/post-type-facet.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { useCallback, useContext, useMemo, WPElement } from '@wordpress/element';
-import { __ } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import { postTypeLabels } from '../../config';
-import Context from '../../context';
-import Panel from '../common/panel';
-import CheckboxList from '../common/checkbox-list';
-import { ActiveContraint } from '../tools/active-constraints';
-
-/**
- * Post type facet component.
- *
- * @param {object} props Props.
- * @param {boolean} props.defaultIsOpen Whether the panel is open by default.
- * @param {string} props.label Facet label.
- * @returns {WPElement} Component element.
- */
-export default ({ defaultIsOpen, label }) => {
- const {
- state: {
- aggregations: { post_type: { post_type: { buckets = [] } = {} } = {} },
- args: { post_type: selectedPostTypes = [] },
- isLoading,
- },
- dispatch,
- } = useContext(Context);
-
- /**
- * Create list of filter options from aggregation buckets.
- *
- * @param {Array} options List of options.
- * @param {object} bucket Aggregation bucket.
- * @param {string} bucket.key Aggregation key.
- * @param {number} index Bucket index.
- * @returns {Array} Array of options.
- */
- const reduceOptions = useCallback(
- (options, { doc_count, key }, index) => {
- if (!Object.prototype.hasOwnProperty.call(postTypeLabels, key)) {
- return options;
- }
-
- options.push({
- checked: selectedPostTypes.includes(key),
- count: doc_count,
- id: `ep-search-post-type-${key}`,
- label: postTypeLabels[key].singular,
- order: index,
- value: key,
- });
-
- return options;
- },
- [selectedPostTypes],
- );
-
- /**
- * Reduce buckets to options.
- */
- const options = useMemo(() => buckets.reduce(reduceOptions, []), [buckets, reduceOptions]);
-
- /**
- * Handle checkbox change event.
- *
- * @param {string[]} postTypes Selected post types.
- */
- const onChange = (postTypes) => {
- dispatch({ type: 'APPLY_ARGS', payload: { post_type: postTypes } });
- };
-
- /**
- * Handle clearing a post type.
- *
- * @param {string} postType Post type being cleared.
- */
- const onClear = (postType) => {
- const postTypes = [...selectedPostTypes];
- const index = postTypes.indexOf(postType);
-
- postTypes.splice(index, 1);
-
- dispatch({ type: 'APPLY_ARGS', payload: { post_type: postTypes } });
- };
-
- return (
- options.length > 0 && (
-
- {() => (
- <>
-
-
- {selectedPostTypes.map((value) => (
- onClear(value)}
- />
- ))}
- >
- )}
-
- )
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/facets/price-range-facet.js b/lib/elasticpress/assets/js/instant-results/components/facets/price-range-facet.js
deleted file mode 100644
index 643fe79..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/facets/price-range-facet.js
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { useContext, useLayoutEffect, useState, WPElement } from '@wordpress/element';
-import { __, sprintf } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import Context from '../../context';
-import { formatPrice } from '../../functions';
-import Panel from '../common/panel';
-import RangeSlider from '../common/range-slider';
-import { ActiveContraint } from '../tools/active-constraints';
-
-/**
- * Price range facet.
- *
- * @param {object} props Props.
- * @param {boolean} props.defaultIsOpen Whether the panel is open by default.
- * @param {string} props.label Facet label.
- * @returns {WPElement} Component element.
- */
-export default ({ defaultIsOpen, label }) => {
- const {
- state: {
- aggregations: {
- price_range: {
- max_price: { value: maxAgg = null } = {},
- min_price: { value: minAgg = null } = {},
- } = {},
- },
- args: { max_price: maxArg = null, min_price: minArg = null },
- isLoading,
- },
- dispatch,
- } = useContext(Context);
-
- /**
- * Minimum and maximum possible values.
- */
- const max = Math.ceil(maxAgg);
- const min = Math.floor(minAgg);
-
- /**
- * Current minimum and maximum values.
- */
- const [currentMaxValue, setCurrentMaxValue] = useState(0);
- const [currentMinValue, setCurrentMinValue] = useState(0);
-
- /**
- * Current minimum and maximum prices, formatted.
- */
- const currentMaxPrice = formatPrice(currentMaxValue, { maximumFractionDigits: 0 });
- const currentMinPrice = formatPrice(currentMinValue, { maximumFractionDigits: 0 });
-
- /**
- * Applied minimum and maximum values.
- */
- const maxValue = maxArg || max;
- const minValue = minArg || min;
-
- /**
- * Applied minimum and maximum prices, formatted.
- */
- const maxPrice = formatPrice(maxValue, { maximumFractionDigits: 0 });
- const minPrice = formatPrice(minValue, { maximumFractionDigits: 0 });
-
- /**
- * Handle completed slider change.
- *
- * @param {number[]} values Lowest and highest values.
- */
- const onAfterChange = (values) => {
- const [min_price, max_price] = values;
-
- dispatch({ type: 'APPLY_ARGS', payload: { min_price, max_price } });
- };
-
- /**
- * Handle slider changes as they're made.
- *
- * @param {number[]} values Lowest and highest values.
- */
- const onChange = ([min, max]) => {
- setCurrentMinValue(min);
- setCurrentMaxValue(max);
- };
-
- /**
- * Handle clearing the filter.
- */
- const onClear = () => {
- dispatch({ type: 'APPLY_ARGS', payload: { max_price: null, min_price: null } });
- };
-
- /**
- * Effects.
- */
- useLayoutEffect(() => {
- const currentMaxValue = Math.min(max, maxValue);
- const currentMinValue = Math.max(min, minValue);
-
- setCurrentMaxValue(currentMaxValue);
- setCurrentMinValue(currentMinValue);
- }, [min, max, minValue, maxValue]);
-
- return (
- maxAgg !== null &&
- minAgg !== null && (
-
- {(isOpen) => (
- <>
-
-
- {isOpen && (
-
- )}
-
-
-
- {currentMinPrice} — {currentMaxPrice}
-
-
-
- {maxArg !== null && minArg !== null && (
-
- )}
- >
- )}
-
- )
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/facets/search-term-facet.js b/lib/elasticpress/assets/js/instant-results/components/facets/search-term-facet.js
deleted file mode 100644
index 637273c..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/facets/search-term-facet.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { useContext, useEffect, useState, WPElement } from '@wordpress/element';
-import { __, sprintf } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import Context from '../../context';
-import { useDebounce } from '../../hooks';
-import { ActiveContraint } from '../tools/active-constraints';
-
-/**
- * Search field component.
- *
- * @returns {WPElement} Component element.
- */
-export default () => {
- const {
- state: {
- args: { search },
- searchedTerm,
- },
- dispatch,
- } = useContext(Context);
-
- const [value, setValue] = useState(search);
-
- /**
- * Dispatch the change, with debouncing.
- */
- const dispatchChange = useDebounce((value) => {
- dispatch({ type: 'NEW_SEARCH_TERM', payload: value });
- }, 300);
-
- /**
- * Handle input changes.
- *
- * @param {Event} event Change event.
- */
- const onChange = (event) => {
- setValue(event.target.value);
- dispatchChange(event.target.value);
- };
-
- /**
- * Handle clearing.
- */
- const onClear = () => {
- dispatch({ type: 'NEW_SEARCH_TERM', payload: '' });
- };
-
- /**
- * Handle an external change to the search value, such as from popping
- * state.
- */
- const handleSearch = () => {
- setValue(search);
- };
-
- /**
- * Effects.
- */
- useEffect(handleSearch, [search]);
-
- return (
- <>
-
- {searchedTerm && (
-
- )}
- >
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/facets/taxonomy-terms-facet.js b/lib/elasticpress/assets/js/instant-results/components/facets/taxonomy-terms-facet.js
deleted file mode 100644
index eea74ba..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/facets/taxonomy-terms-facet.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { useCallback, useContext, useMemo, WPElement } from '@wordpress/element';
-import { __, sprintf } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import { facets, postTypeLabels } from '../../config';
-import Context from '../../context';
-import Panel from '../common/panel';
-import CheckboxList from '../common/checkbox-list';
-import { ActiveContraint } from '../tools/active-constraints';
-
-/**
- * Taxonomy filter component.
- *
- * @param {object} props Components props.
- * @param {boolean} props.defaultIsOpen Whether the panel is open by default.
- * @param {string} props.label Facet label.
- * @param {string} props.name Facet name.
- * @param {Array} props.postTypes Facet post types.
- * @returns {WPElement} Component element.
- */
-export default ({ defaultIsOpen, label, postTypes, name }) => {
- const {
- state: {
- isLoading,
- args: { [name]: selectedTerms = [] },
- aggregations: { [name]: { [name]: { buckets = [] } = {} } = {} } = {},
- },
- dispatch,
- } = useContext(Context);
-
- /**
- * A unique label for the facet. Adds additional context to the label if
- * another facet with the same label is being used.
- */
- const uniqueLabel = useMemo(() => {
- const isNotUnique = facets.some((facet) => facet.label === label && facet.name !== name);
- const typeLabels = postTypes.map((postType) => postTypeLabels[postType].plural);
- const typeSeparator = __(', ', 'elasticpress');
-
- return isNotUnique
- ? sprintf(
- /* translators: %1$s: Facet label. $2$s: Facet post types. */
- __('%1$s (%2$s)', 'elasticpress'),
- label,
- typeLabels.join(typeSeparator),
- )
- : label;
- }, [label, postTypes, name]);
-
- /**
- * Create list of filter options from aggregation buckets.
- *
- * @param {Array} options List of options.
- * @param {object} bucket Aggregation bucket.
- * @param {string} bucket.key Aggregation key.
- * @returns {Array} Array of options.
- */
- const reduceOptions = useCallback(
- (options, { doc_count, key }) => {
- const { name: label, parent, term_id, term_order } = JSON.parse(key);
-
- options.push({
- checked: selectedTerms.includes(term_id),
- count: doc_count,
- id: `ep-search-${name}-${term_id}`,
- label,
- parent: parent.toString(),
- order: term_order,
- value: term_id.toString(),
- });
-
- return options;
- },
- [selectedTerms, name],
- );
-
- /**
- * Reduce buckets to options.
- */
- const options = useMemo(() => buckets.reduce(reduceOptions, []), [buckets, reduceOptions]);
-
- /**
- * Reduce options to labels.
- *
- * @param {object} labels List of options.
- * @param {object} bucket Aggregation bucket.
- * @param {string} bucket.key Aggregation key.
- * @returns {object} Options and their labels.
- */
- const reduceLabels = useCallback((labels, { label, value }) => {
- labels[value] = label;
-
- return labels;
- }, []);
-
- /**
- * Reduce buckets to labels.
- */
- const labels = options.reduce(reduceLabels, {});
-
- /**
- * Handle checkbox change event.
- *
- * @param {string[]} terms Selected terms.
- */
- const onChange = (terms) => {
- dispatch({ type: 'APPLY_ARGS', payload: { [name]: terms } });
- };
-
- /**
- * Handle clearing a term.
- *
- * @param {string} term Term being cleared.
- */
- const onClear = (term) => {
- const terms = [...selectedTerms];
-
- terms.splice(terms.indexOf(term), 1);
-
- dispatch({ type: 'APPLY_ARGS', payload: { [name]: terms } });
- };
-
- return (
- options.length > 0 && (
-
- {(isOpen) => (
- <>
- {isOpen && (
-
- )}
-
- {selectedTerms.map(
- (value) =>
- labels?.[value] && (
- onClear(value)}
- />
- ),
- )}
- >
- )}
-
- )
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/layout.js b/lib/elasticpress/assets/js/instant-results/components/layout.js
deleted file mode 100644
index a567cd6..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/layout.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { useContext, WPElement } from '@wordpress/element';
-
-/**
- * Internal dependencies.
- */
-import { facets } from '../config';
-import Context from '../context';
-import Facet from './facets/facet';
-import SearchTermFacet from './facets/search-term-facet';
-import Results from './layout/results';
-import Sidebar from './layout/sidebar';
-import Toolbar from './layout/toolbar';
-import ActiveConstraints from './tools/active-constraints';
-import ClearConstraints from './tools/clear-constraints';
-import SidebarToggle from './tools/sidebar-toggle';
-import Sort from './tools/sort';
-
-/**
- * Search dialog.
- *
- * @returns {WPElement} Component element.
- */
-export default () => {
- const {
- state: { isLoading },
- } = useContext(Context);
-
- return (
-
-
-
-
-
-
- {facets.map(({ label, name, postTypes, type }, index) => (
-
- ))}
-
-
-
-
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/layout/results.js b/lib/elasticpress/assets/js/instant-results/components/layout/results.js
deleted file mode 100644
index c28337e..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/layout/results.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Internal depenencies.
- */
-import { useContext, useEffect, useRef, WPElement } from '@wordpress/element';
-import { _n, sprintf } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import Context from '../../context';
-import Pagination from '../results/pagination';
-import Result from '../results/result';
-import Sort from '../tools/sort';
-
-/**
- * Search results component.
- *
- * @returns {WPElement} Component element.
- */
-export default () => {
- const {
- state: {
- args: { offset, per_page },
- searchResults,
- searchedTerm,
- totalResults,
- },
- dispatch,
- } = useContext(Context);
-
- const headingRef = useRef();
-
- /**
- * Handle clicking next.
- */
- const onNext = () => {
- dispatch({ type: 'NEXT_PAGE' });
- };
-
- /**
- * Handle clicking previous.
- */
- const onPrevious = () => {
- dispatch({ type: 'PREVIOUS_PAGE' });
- };
-
- /**
- * Effects.
- */
- useEffect(() => {
- headingRef.current.scrollIntoView({ behavior: 'smooth' });
- }, [offset]);
-
- return (
-
-
-
- {searchedTerm
- ? sprintf(
- /* translators: %1$d: results count. %2$s: Search term. */
- _n(
- '%1$d result for “%2$s“',
- '%1$d results for “%2$s“',
- totalResults,
- 'elasticpress',
- ),
- totalResults,
- searchedTerm,
- )
- : sprintf(
- /* translators: %d: results count. */
- _n('%d result', '%d results', totalResults, 'elasticpress'),
- totalResults,
- )}
-
-
-
-
-
- {searchResults.map((hit) => (
-
- ))}
-
-
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/layout/sidebar.js b/lib/elasticpress/assets/js/instant-results/components/layout/sidebar.js
deleted file mode 100644
index 5c26ff1..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/layout/sidebar.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { useContext, WPElement } from '@wordpress/element';
-
-/**
- * Internal dependencies.
- */
-import Context from '../../context';
-
-/**
- * Search field component.
- *
- * @param {object} props Props.
- * @param {WPElement} props.children Children.
- * @returns {WPElement} Element.
- */
-export default ({ children }) => {
- const {
- state: { isSidebarOpen },
- } = useContext(Context);
-
- return (
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/layout/toolbar.js b/lib/elasticpress/assets/js/instant-results/components/layout/toolbar.js
deleted file mode 100644
index dba407b..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/layout/toolbar.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { WPElement } from '@wordpress/element';
-
-/**
- * Search field component.
- *
- * @param {object} props Props.
- * @param {WPElement} props.children Children.
- * @returns {WPElement} Element.
- */
-export default ({ children }) => {
- return {children}
;
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/results/pagination.js b/lib/elasticpress/assets/js/instant-results/components/results/pagination.js
deleted file mode 100644
index 65d82d0..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/results/pagination.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { __, sprintf } from '@wordpress/i18n';
-import { WPElement } from '@wordpress/element';
-
-/**
- * Search results component.
- *
- * @param {object} props Props.
- * @param {number} props.offset Current items offset.
- * @param {Function} props.onNext Next button handler.
- * @param {Function} props.onPrevious Previous button handler.
- * @param {number} props.perPage Items per page.
- * @param {number} props.total Total number of items.
- * @returns {WPElement} Element.
- */
-export default ({ offset, onNext, onPrevious, perPage, total }) => {
- /**
- * Current page number.
- */
- const currentPage = (offset + perPage) / perPage;
-
- /**
- * Whether there are more pages.
- */
- const nextIsAvailable = total > offset + perPage;
-
- /**
- * Whether the are previous pages.
- */
- const previousIsAvailable = offset > 0;
-
- /**
- * Total pages.
- */
- const totalPages = Math.ceil(total / perPage);
-
- return (
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/results/result.js b/lib/elasticpress/assets/js/instant-results/components/results/result.js
deleted file mode 100644
index 5d24652..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/results/result.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { WPElement } from '@wordpress/element';
-
-/**
- * Internal dependencies.
- */
-import { postTypeLabels, isWooCommerce } from '../../config';
-import StarRating from '../common/star-rating';
-import Image from '../common/image';
-
-const { gmdateI18n } = wp.date;
-
-/**
- * Search result.
- *
- * @param {object} props Component props.
- * @param {object} props.hit Elasticsearch hit.
- * @returns {WPElement} Component element.
- */
-export default ({ hit }) => {
- const {
- highlight: { post_title: resultTitle, post_content_plain: resultContent = [] },
- _source: {
- meta: { _wc_average_rating: [{ value: resultRating = 0 } = {}] = [] },
- post_date_gmt: resultDateGmt,
- permalink: resultPermalink,
- post_type: resultPostType,
- price_html: priceHtml,
- thumbnail: resultThumbnail = false,
- },
- } = hit;
-
- const postTypeLabel = postTypeLabels[resultPostType]?.singular;
-
- return (
-
- {resultThumbnail && (
-
-
-
- )}
-
-
- {postTypeLabel && {postTypeLabel}}
-
-
- {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
-
-
-
- {isWooCommerce && priceHtml && (
- // eslint-disable-next-line react/no-danger
-
- )}
-
-
- {resultContent.length > 0 && (
-
- )}
-
-
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/tools/active-constraints.js b/lib/elasticpress/assets/js/instant-results/components/tools/active-constraints.js
deleted file mode 100644
index f1b97f9..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/tools/active-constraints.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { createSlotFill } from '@wordpress/components';
-import { WPElement } from '@wordpress/element';
-import { closeSmall, Icon } from '@wordpress/icons';
-import { __, sprintf } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import SmallButton from '../common/small-button';
-
-/**
- * Create SlotFill.
- */
-const { Fill, Slot } = createSlotFill('ActiveContraints');
-
-/**
- * Active filter component.
- *
- * @param {object} props Props.
- * @param {string} props.label Constraint label.
- * @param {Function} props.onClick Click handler.
- * @returns {WPElement} Element.
- */
-export const ActiveContraint = ({ label, onClick }) => {
- return (
-
-
-
- {label}
-
-
- );
-};
-
-/**
- * Active constraints component.
- *
- * @returns {WPElement} Element.
- */
-export default () => {
- return {(fills) => fills};
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/tools/clear-constraints.js b/lib/elasticpress/assets/js/instant-results/components/tools/clear-constraints.js
deleted file mode 100644
index 97cd275..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/tools/clear-constraints.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { useContext, useMemo, WPElement } from '@wordpress/element';
-import { __ } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import { facets } from '../../config';
-import Context from '../../context';
-import SmallButton from '../common/small-button';
-
-/**
- * Active constraints component.
- *
- * @returns {WPElement} Element.
- */
-export default () => {
- const {
- state: { args },
- dispatch,
- } = useContext(Context);
-
- /**
- * Return whether there are active filters.
- *
- * Only filters that are available as facets are checked, as these are the
- * only filters that will be cleared. This is to support applying filters
- * that cannot be modified by the user.
- *
- * @returns {boolean} Whether there are active filters.
- */
- const hasFilters = useMemo(() => {
- return facets.some(({ name, type }) => {
- switch (type) {
- case 'post_type':
- case 'taxonomy':
- return args[name]?.length > 0;
- case 'price_range':
- return args.max_price || args.min_price;
- default:
- return args[name];
- }
- });
- }, [args]);
-
- /**
- * Handle clicking button.
- *
- * @returns {void}
- */
- const onClick = () => {
- dispatch({ type: 'CLEAR_FACETS' });
- };
-
- return (
- hasFilters && (
- {__('Clear filters', 'elasticpress')}
- )
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/tools/sidebar-toggle.js b/lib/elasticpress/assets/js/instant-results/components/tools/sidebar-toggle.js
deleted file mode 100644
index f3aa5e9..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/tools/sidebar-toggle.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * WordPress deendencies.
- */
-import { useContext, WPElement } from '@wordpress/element';
-import { chevronDown, chevronUp, Icon } from '@wordpress/icons';
-import { __ } from '@wordpress/i18n';
-
-/**
- * Internal deendencies.
- */
-import Context from '../../context';
-
-/**
- * Open sidebar component.
- *
- * @returns {WPElement} Element.
- */
-export default () => {
- const {
- state: { isSidebarOpen },
- dispatch,
- } = useContext(Context);
-
- /**
- * Handle click.
- */
- const onClick = () => {
- dispatch({ type: 'TOGGLE_SIDEBAR' });
- };
-
- return (
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/components/tools/sort.js b/lib/elasticpress/assets/js/instant-results/components/tools/sort.js
deleted file mode 100644
index 865edc1..0000000
--- a/lib/elasticpress/assets/js/instant-results/components/tools/sort.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * WordPress deendencies.
- */
-import { useContext, useMemo, WPElement } from '@wordpress/element';
-import { __ } from '@wordpress/i18n';
-
-/**
- * Internal deendencies.
- */
-import { sortOptions } from '../../config';
-import Context from '../../context';
-
-/**
- * Search results component.
- *
- * @returns {WPElement} Component element.
- */
-export default () => {
- const {
- state: {
- args: { orderby, order },
- },
- dispatch,
- } = useContext(Context);
-
- /**
- * The key for the current sorting option.
- */
- const currentOption = useMemo(() => {
- return Object.keys(sortOptions).find((key) => {
- return sortOptions[key].orderby === orderby && sortOptions[key].order === order;
- });
- }, [orderby, order]);
-
- /**
- * Handle sorting option change.
- *
- * @param {Event} event Change event.
- */
- const onChange = (event) => {
- const { orderby, order } = sortOptions[event.target.value];
-
- dispatch({ type: 'APPLY_ARGS', payload: { orderby, order } });
- };
-
- return (
-
- );
-};
diff --git a/lib/elasticpress/assets/js/instant-results/config.js b/lib/elasticpress/assets/js/instant-results/config.js
deleted file mode 100644
index 735fcef..0000000
--- a/lib/elasticpress/assets/js/instant-results/config.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { __ } from '@wordpress/i18n';
-
-/**
- * Window dependencies.
- */
-const {
- apiEndpoint,
- apiHost,
- argsSchema,
- currencyCode,
- facets,
- isWooCommerce,
- matchType,
- paramPrefix,
- postTypeLabels,
- taxonomyLabels,
-} = window.epInstantResults;
-
-/**
- * Sorting options configuration.
- */
-const sortOptions = {
- relevance_desc: {
- name: __('Most relevant', 'elasticpress'),
- orderby: 'relevance',
- order: 'desc',
- currencyCode,
- },
- date_desc: {
- name: __('Date, newest to oldest', 'elasticpress'),
- orderby: 'date',
- order: 'desc',
- },
- date_asc: {
- name: __('Date, oldest to newest', 'elasticpress'),
- orderby: 'date',
- order: 'asc',
- },
-};
-
-/**
- * Sort by price is only available for WooCommerce.
- */
-if (isWooCommerce) {
- sortOptions.price_desc = {
- name: __('Price, highest to lowest', 'elasticpress'),
- orderby: 'price',
- order: 'desc',
- };
-
- sortOptions.price_asc = {
- name: __('Price, lowest to highest', 'elasticpress'),
- orderby: 'price',
- order: 'asc',
- };
-}
-
-export {
- apiEndpoint,
- apiHost,
- argsSchema,
- currencyCode,
- facets,
- isWooCommerce,
- matchType,
- paramPrefix,
- postTypeLabels,
- sortOptions,
- taxonomyLabels,
-};
diff --git a/lib/elasticpress/assets/js/instant-results/context.js b/lib/elasticpress/assets/js/instant-results/context.js
deleted file mode 100644
index 05f9cf5..0000000
--- a/lib/elasticpress/assets/js/instant-results/context.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Internal dependencies.
- */
-import { createContext } from '@wordpress/element';
-
-export default createContext();
diff --git a/lib/elasticpress/assets/js/instant-results/functions.js b/lib/elasticpress/assets/js/instant-results/functions.js
deleted file mode 100644
index 6b87893..0000000
--- a/lib/elasticpress/assets/js/instant-results/functions.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Internal deendencies.
- */
-import { currencyCode, facets } from './config';
-import { sanitizeArg, sanitizeParam } from './utilities';
-
-/**
- * Clear facet filters from a set of args.
- *
- * @param {object} args Args to clear facets from.
- * @returns {object} Cleared args.
- */
-export const clearFacetsFromArgs = (args) => {
- const clearedArgs = { ...args };
-
- facets.forEach(({ name, type }) => {
- switch (type) {
- case 'price_range':
- delete clearedArgs.max_price;
- delete clearedArgs.min_price;
- break;
- default:
- delete clearedArgs[name];
- break;
- }
- });
-
- return clearedArgs;
-};
-
-/**
- * Format a number as a price.
- *
- * @param {number} number Number to format.
- * @param {object} options Formatter options.
- * @returns {string} Formatted number.
- */
-export const formatPrice = (number, options) => {
- const format = new Intl.NumberFormat(navigator.language, {
- style: 'currency',
- currency: currencyCode,
- currencyDisplay: 'narrowSymbol',
- ...options,
- });
-
- return format.format(number);
-};
-
-/**
- * Get the post types from a search form.
- *
- * @param {HTMLFormElement} form Form element.
- * @returns {Array} Post types.
- */
-export const getPostTypesFromForm = (form) => {
- const data = new FormData(form);
-
- if (data.has('post_type')) {
- return data.getAll('post_type').slice(-1);
- }
-
- if (data.has('post_type[]')) {
- return data.getAll('post_type[]');
- }
-
- return [];
-};
-
-/**
- * Get permalink URL parameters from args.
- *
- * @typedef {object} ArgSchema
- * @property {string} type Arg type.
- * @property {any} [default] Default arg value.
- * @property {Array} [allowedValues] Array of allowed values.
- *
- * @param {object} args Args
- * @param {ArgSchema} schema Args schema.
- * @param {string} [prefix] Prefix to prepend to args.
- * @returns {URLSearchParams} URLSearchParams instance.
- */
-export const getUrlParamsFromArgs = (args, schema, prefix = '') => {
- const urlParams = new URLSearchParams();
-
- Object.entries(schema).forEach(([arg, options]) => {
- const param = prefix + arg;
- const value = typeof args[arg] !== 'undefined' ? sanitizeParam(args[arg], options) : null;
-
- if (value !== null) {
- urlParams.set(param, value);
- }
- });
-
- return urlParams;
-};
-
-/**
- * Build request args from URL parameters using a given schema.
- *
- * @typedef {object} ArgSchema
- * @property {string} type Arg type.
- * @property {any} [default] Default arg value.
- * @property {Array} [allowedValues] Array of allowed values.
- *
- * @param {URLSearchParams} urlParams URL parameters.
- * @param {object.} schema Schema to build args from.
- * @param {string} [prefix] Parameter prefix.
- * @param {boolean} [useDefaults] Whether to populate params with default values.
- * @returns {object.} Query args.
- */
-export const getArgsFromUrlParams = (urlParams, schema, prefix = '', useDefaults = true) => {
- const args = Object.entries(schema).reduce((args, [arg, options]) => {
- const param = urlParams.get(prefix + arg);
- const value =
- typeof param !== 'undefined' ? sanitizeArg(param, options, useDefaults) : null;
-
- if (value !== null) {
- args[arg] = value;
- }
-
- return args;
- }, {});
-
- return args;
-};
diff --git a/lib/elasticpress/assets/js/instant-results/hooks.js b/lib/elasticpress/assets/js/instant-results/hooks.js
deleted file mode 100644
index b1f16c6..0000000
--- a/lib/elasticpress/assets/js/instant-results/hooks.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import { useCallback, useRef } from '@wordpress/element';
-import { apiEndpoint, apiHost } from './config';
-
-/**
- * Get debounced version of a function that only runs a given ammount of time
- * after the last time it was run.
- *
- * @param {Function} callback Function to debounce.
- * @param {number} delay Milliseconds to delay.
- * @returns {Function} Debounced function.
- */
-export const useDebounce = (callback, delay) => {
- const timeout = useRef(null);
-
- return useCallback(
- (...args) => {
- window.clearTimeout(timeout.current);
-
- timeout.current = window.setTimeout(() => {
- callback(...args);
- }, delay);
- },
- [callback, delay],
- );
-};
-
-/**
- * Get a callback function for retrieving search results.
- *
- * @returns {Function} Memoized callback function for retrieving search results.
- */
-export const useGetResults = () => {
- const abort = useRef(new AbortController());
- const request = useRef(null);
-
- /**
- * Get new search results from the API.
- *
- * @param {URLSearchParams} urlParams Query arguments.
- * @returns {Promise} Request promise.
- */
- const getResults = async (urlParams) => {
- const url = `${apiHost}${apiEndpoint}?${urlParams.toString()}`;
-
- abort.current.abort();
- abort.current = new AbortController();
-
- request.current = fetch(url, {
- signal: abort.current.signal,
- headers: {
- Accept: 'application/json',
- },
- })
- .then((response) => {
- return response.json();
- })
- .catch((error) => {
- if (error?.name !== 'AbortError' && !request.current) {
- throw error;
- }
- })
- .finally(() => {
- request.current = null;
- });
-
- return request.current;
- };
-
- return useCallback(getResults, []);
-};
diff --git a/lib/elasticpress/assets/js/instant-results/index.js b/lib/elasticpress/assets/js/instant-results/index.js
deleted file mode 100644
index 0cd3a08..0000000
--- a/lib/elasticpress/assets/js/instant-results/index.js
+++ /dev/null
@@ -1,242 +0,0 @@
-/**
- * WordPress dependencies.
- */
-import { SlotFillProvider } from '@wordpress/components';
-import {
- render,
- useCallback,
- useEffect,
- useMemo,
- useReducer,
- useRef,
- WPElement,
-} from '@wordpress/element';
-import { __ } from '@wordpress/i18n';
-
-/**
- * Internal dependencies.
- */
-import { argsSchema, paramPrefix } from './config';
-import Context from './context';
-import { getArgsFromUrlParams, getUrlParamsFromArgs, getPostTypesFromForm } from './functions';
-import { useGetResults } from './hooks';
-import { reducer, initialState } from './reducer';
-import Layout from './components/layout';
-import Modal from './components/common/modal';
-
-/**
- * component.
- *
- * @returns {WPElement} Element.
- */
-const App = () => {
- const getResults = useGetResults();
- const [state, dispatch] = useReducer(reducer, initialState);
- const inputRef = useRef();
- const modalRef = useRef();
- const stateRef = useRef(state);
-
- stateRef.current = state;
-
- /**
- * Close the modal.
- */
- const closeModal = useCallback(() => {
- dispatch({ type: 'CLOSE_MODAL' });
-
- if (inputRef.current) {
- inputRef.current.focus();
- }
- }, []);
-
- /**
- * Start loading.
- */
- const startLoading = useCallback(() => {
- dispatch({ type: 'START_LOADING' });
- }, []);
-
- /**
- * Finish loading.
- */
- const finishLoading = useCallback(() => {
- dispatch({ type: 'FINISH_LOADING' });
- }, []);
-
- /**
- * Update search results.
- *
- * @param {object} response Search results.
- */
- const updateResults = useCallback((response) => {
- if (response) {
- dispatch({ type: 'NEW_SEARCH_RESULTS', payload: response });
- }
- }, []);
-
- /**
- * Perform a search.
- */
- const doSearch = useCallback(async () => {
- const urlParams = getUrlParamsFromArgs(stateRef.current.args, argsSchema);
-
- startLoading();
-
- const response = await getResults(urlParams);
-
- updateResults(response);
-
- finishLoading();
- }, [finishLoading, getResults, startLoading, updateResults]);
-
- /**
- * Push state to history.
- */
- const pushState = useCallback(() => {
- const { history } = modalRef.current.ownerDocument.defaultView;
- const { args, isOpen, isPoppingState } = stateRef.current;
-
- if (isPoppingState) {
- return;
- }
-
- const state = JSON.stringify({ ...args, isOpen });
- const params = getUrlParamsFromArgs(args, argsSchema, paramPrefix).toString();
- const url = isOpen ? `?${params}` : window.location.origin + window.location.pathname;
-
- if (history.state) {
- history.pushState(state, document.title, url);
- } else {
- history.replaceState(state, document.title, window.location.href);
- }
- }, []);
-
- /**
- * Handle escape key press.
- *
- * @param {Event} event Key down event.
- */
- const onEscape = useCallback(
- (event) => {
- if (event.key === 'Escape') {
- closeModal();
- }
- },
- [closeModal],
- );
-
- /**
- * Handle popstate event.
- *
- * @param {Event} event popstate event.
- */
- const onPopState = useCallback((event) => {
- if (event.state) {
- dispatch({ type: 'POP_STATE', payload: JSON.parse(event.state) });
- }
- }, []);
-
- /**
- * Handle submitting the search form.
- *
- * @param {Event} event Input event.
- */
- const onSubmit = useCallback((event) => {
- event.preventDefault();
-
- inputRef.current = event.target.s;
-
- const search = inputRef.current.value;
- const post_type = getPostTypesFromForm(inputRef.current.form);
-
- dispatch({ type: 'APPLY_ARGS', payload: { search, post_type } });
- }, []);
-
- /**
- * Handle changes to search parameters.
- */
- const handleChanges = () => {
- const { isOpen } = stateRef.current;
-
- pushState();
-
- if (!isOpen) {
- return;
- }
-
- doSearch();
- };
-
- /**
- * Bind events to outside elements.
- *
- * @returns {Function} A cleanup function that unbinds the events.
- */
- const handleEvents = () => {
- const inputs = document.querySelectorAll('form input[type="search"');
- const modal = modalRef.current;
-
- inputs.forEach((input) => {
- input.form.addEventListener('submit', onSubmit);
- });
-
- modal.ownerDocument.defaultView.addEventListener('popstate', onPopState);
-
- return () => {
- inputs.forEach((input) => {
- input.form.removeEventListener('submit', onSubmit);
- });
-
- modal.ownerDocument.defaultView.removeEventListener('popstate', onPopState);
- };
- };
-
- /**
- * Open modal with pre-defined args if they are found in the URL.
- */
- const handleInit = () => {
- const urlParams = new URLSearchParams(window.location.search);
- const args = getArgsFromUrlParams(urlParams, argsSchema, paramPrefix, false);
-
- if (Object.keys(args).length > 0) {
- dispatch({ type: 'APPLY_ARGS', payload: args });
- }
- };
-
- /**
- * Effects.
- */
- useEffect(handleInit, []);
- useEffect(handleEvents, [onEscape, onPopState, onSubmit]);
- useEffect(handleChanges, [
- doSearch,
- pushState,
- state.args,
- state.args.orderby,
- state.args.order,
- state.args.offset,
- state.args.search,
- ]);
-
- /**
- * Create context.
- */
- const context = useMemo(() => ({ state, dispatch }), [state, dispatch]);
-
- return (
-
-
-
-
-
-
-
- );
-};
-
-render(, document.getElementById('ep-instant-results'));
diff --git a/lib/elasticpress/assets/js/instant-results/reducer.js b/lib/elasticpress/assets/js/instant-results/reducer.js
deleted file mode 100644
index adfa333..0000000
--- a/lib/elasticpress/assets/js/instant-results/reducer.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * Internal dependencies.
- */
-import { matchType } from './config';
-import { clearFacetsFromArgs } from './functions';
-
-/**
- * Initial state.
- */
-export const initialState = {
- aggregations: {},
- args: {
- highlight: '',
- offset: 0,
- orderby: 'relevance',
- order: 'desc',
- per_page: 6,
- relation: matchType === 'all' ? 'and' : 'or',
- search: '',
- },
- isLoading: false,
- isOpen: false,
- isSidebarOpen: false,
- isPoppingState: false,
- searchResults: [],
- searchedTerm: '',
- totalResults: 0,
-};
-
-/**
- * Reducer function for handling state changes.
- *
- * @param {object} state The current state.
- * @param {object} action Action data.
- * @param {string} action.type The action name.
- * @param {object} action.payload New state data from the action.
- * @returns {object} Updated state.
- */
-export const reducer = (state, { type, payload }) => {
- const newState = { ...state, isPoppingState: false };
-
- switch (type) {
- case 'APPLY_ARGS': {
- newState.args = { ...newState.args, ...payload, offset: 0 };
- newState.isOpen = true;
- break;
- }
- case 'CLEAR_FACETS': {
- newState.args = clearFacetsFromArgs(newState.args);
- break;
- }
- case 'NEW_SEARCH_TERM': {
- newState.args = clearFacetsFromArgs(newState.args);
- newState.args.offset = 0;
- newState.args.search = payload;
-
- break;
- }
- case 'NEW_SEARCH_RESULTS': {
- const {
- hits: { hits, total },
- aggregations,
- } = payload;
-
- /**
- * Total number of items.
- */
- const totalNumber = typeof total === 'number' ? total : total.value;
-
- newState.aggregations = aggregations;
- newState.searchResults = hits;
- newState.searchedTerm = newState.args.search;
- newState.totalResults = totalNumber;
-
- break;
- }
- case 'NEXT_PAGE': {
- newState.args.offset += newState.args.per_page;
- break;
- }
- case 'PREVIOUS_PAGE': {
- newState.args.offset = Math.max(newState.args.offset - newState.args.per_page, 0);
- break;
- }
- case 'START_LOADING': {
- newState.isLoading = true;
- break;
- }
- case 'FINISH_LOADING': {
- newState.isLoading = false;
- break;
- }
- case 'TOGGLE_SIDEBAR': {
- newState.isSidebarOpen = !state.isSidebarOpen;
- break;
- }
- case 'CLOSE_MODAL': {
- newState.args = clearFacetsFromArgs(newState.args);
- newState.isOpen = false;
- break;
- }
- case 'POP_STATE': {
- const { isOpen, ...args } = payload;
-
- newState.args = args;
- newState.isOpen = isOpen;
- newState.isPoppingState = true;
-
- break;
- }
- default:
- break;
- }
-
- return newState;
-};
diff --git a/lib/elasticpress/assets/js/instant-results/utilities.js b/lib/elasticpress/assets/js/instant-results/utilities.js
deleted file mode 100644
index 7b60c83..0000000
--- a/lib/elasticpress/assets/js/instant-results/utilities.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * Sanitize an argument value based on its type.
- *
- * @param {*} value The value.
- * @param {object} options Sanitization options.
- * @param {'number'|'numbers'|'string'|'strings'} options.type (optional) Value type.
- * @param {Array} options.allowedValues (optional) Allowed values.
- * @param {*} options.default (optional) Default value.
- * @param {boolean} [useDefaults] Whether to return default values.
- * @returns {*} Sanitized value.
- */
-export const sanitizeArg = (value, options, useDefaults = true) => {
- let sanitizedValue = null;
-
- switch (value && options.type) {
- case 'number':
- sanitizedValue = parseFloat(value, 10) || null;
- break;
- case 'numbers':
- sanitizedValue = decodeURIComponent(value)
- .split(',')
- .map((v) => parseFloat(v, 10))
- .filter(Boolean);
- break;
- case 'string':
- sanitizedValue = value.toString();
- break;
- case 'strings':
- sanitizedValue = decodeURIComponent(value)
- .split(',')
- .map((v) => v.toString().trim());
- break;
- default:
- break;
- }
-
- /**
- * If there is a list of allowed values, make sure the value is
- * allowed.
- */
- if (options.allowedValues) {
- sanitizedValue = options.allowedValues.includes(sanitizedValue) ? sanitizedValue : null;
- }
-
- /**
- * Populate a default value if one is available and we still don't
- * have a value.
- */
- if (useDefaults && sanitizedValue === null && typeof options.default !== 'undefined') {
- sanitizedValue = options.default;
- }
-
- return sanitizedValue;
-};
-
-/**
- * Sanitize a parameter value based on its type.
- *
- * @param {*} value The value.
- * @param {object} options Sanitization options.
- * @param {'number'|'numbers'|'string'|'strings'} options.type (optional) Value type.
- * @param {Array} options.allowedValues (optional) Allowed values.
- * @param {*} options.default (optional) Default value.
- * @param {boolean} [useDefaults] Whether to return default values.
- * @returns {*} Sanitized value.
- */
-export const sanitizeParam = (value, options, useDefaults = true) => {
- let sanitizedValue = null;
-
- switch (value && options.type) {
- case 'number':
- case 'string':
- sanitizedValue = value;
- break;
- case 'numbers':
- case 'strings':
- sanitizedValue = value.join(',');
- break;
- default:
- break;
- }
-
- /**
- * If there is a list of allowed values, make sure the value is
- * allowed.
- */
- if (options.allowedValues) {
- sanitizedValue = options.allowedValues.includes(sanitizedValue) ? sanitizedValue : null;
- }
-
- /**
- * Populate a default value if one is available and we still don't
- * have a value.
- */
- if (useDefaults && sanitizedValue === null && typeof options.default !== 'undefined') {
- sanitizedValue = options.default;
- }
-
- return sanitizedValue;
-};
diff --git a/lib/elasticpress/assets/js/notice.js b/lib/elasticpress/assets/js/notice.js
deleted file mode 100644
index 035d9c5..0000000
--- a/lib/elasticpress/assets/js/notice.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import jQuery from 'jquery';
-
-const { epAdmin, ajaxurl } = window;
-
-jQuery('.notice').on('click', '.notice-dismiss', (event) => {
- const notice = event.delegateTarget.getAttribute('data-ep-notice');
-
- if (!notice) {
- return;
- }
-
- jQuery.ajax({
- method: 'post',
- data: {
- nonce: epAdmin.nonce,
- action: 'ep_notice_dismiss',
- notice,
- },
- url: ajaxurl,
- });
-});
diff --git a/lib/elasticpress/assets/js/ordering/index.js b/lib/elasticpress/assets/js/ordering/index.js
deleted file mode 100644
index 37312cc..0000000
--- a/lib/elasticpress/assets/js/ordering/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import ReactDOM from 'react-dom';
-
-import { Pointers } from './pointers';
-
-ReactDOM.render(, document.getElementById('ordering-app'));
diff --git a/lib/elasticpress/assets/js/ordering/pointers.js b/lib/elasticpress/assets/js/ordering/pointers.js
deleted file mode 100644
index 13f4c0f..0000000
--- a/lib/elasticpress/assets/js/ordering/pointers.js
+++ /dev/null
@@ -1,503 +0,0 @@
-// External
-import React, { Component } from 'react';
-import apiFetch from '@wordpress/api-fetch';
-import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
-import { __ } from '@wordpress/i18n';
-import { pluck, debounce } from '../utils/helpers';
-
-apiFetch.use(apiFetch.createRootURLMiddleware(window.epOrdering.restApiRoot));
-
-export class Pointers extends Component {
- titleInput = null;
-
- debouncedDefaultResults = debounce(() => {
- this.getDefaultResults();
- }, 200);
-
- doSearch = debounce(() => {
- const { searchText, searchResults } = this.state;
- const searchTerm = searchText;
-
- // Set loading state
- searchResults[searchTerm] = false;
- this.setState({ searchResults });
-
- apiFetch({
- path: `/elasticpress/v1/pointer_search?s=${searchTerm}`,
- }).then((result) => {
- searchResults[searchTerm] = result;
-
- this.setState({ searchResults });
- });
- }, 200);
-
- debouncedHandleTitleChange = debounce(() => {
- this.handleTitleChange();
- }, 200);
-
- /**
- * Initializes the component with initial state set by WP
- *
- * @param {object} props Component props
- */
- constructor(props) {
- super(props);
-
- // We need to know the title of the page and react to changes since this is the query we search for
- this.titleInput = document.getElementById('title');
-
- this.state = {
- pointers: window.epOrdering.pointers,
- posts: window.epOrdering.posts,
- title: this.titleInput.value,
- defaultResults: {},
- searchText: '',
- searchResults: {},
- };
- }
-
- componentDidMount() {
- this.titleInput.addEventListener('keyup', this.debouncedHandleTitleChange);
-
- const { title } = this.state;
-
- if (title?.length > 0) {
- this.getDefaultResults();
- }
- }
-
- componentWillUnmount() {
- this.titleInput.removeEventListener('keyup', this.debouncedHandleTitleChange);
- }
-
- handleTitleChange = () => {
- this.setState({ title: this.titleInput.value });
- this.debouncedDefaultResults();
- };
-
- getDefaultResults = () => {
- const { title: searchTerm } = this.state;
-
- apiFetch({
- path: `/elasticpress/v1/pointer_preview?s=${searchTerm}`,
- }).then((result) => {
- const { defaultResults } = this.state;
-
- defaultResults[searchTerm] = result;
-
- this.setState({ defaultResults });
- });
- };
-
- removePointer = (pointer) => {
- let { pointers } = this.state;
-
- delete pointers[pointers.indexOf(pointer)];
- pointers = pointers.filter((item) => item !== null);
-
- this.setState({ pointers });
- };
-
- getMergedPosts = () => {
- let { pointers } = this.state;
- const { title, defaultResults } = this.state;
- let merged = defaultResults[title].slice();
-
- const setIds = {};
- merged.forEach((item) => {
- setIds[item.ID] = item;
- });
-
- pointers = pointers.sort((a, b) => {
- return a.order > b.order ? 1 : -1;
- });
-
- pointers.forEach((pointer) => {
- // Remove the original if a duplicate
- if (setIds[pointer.ID]) {
- delete merged[merged.indexOf(setIds[pointer.ID])];
- merged = merged.filter((item) => item);
- }
-
- // Insert into proper location
- merged.splice(parseInt(pointer.order, 10) - 1, 0, pointer);
- });
-
- return merged;
- };
-
- /**
- * Gets the next available position for a pointer
- *
- * @returns {number|false} The available position
- */
- getNextAvailablePosition = () => {
- const { pointers } = this.state;
- const availablePositions = {};
-
- for (let i = 1; i <= window.epOrdering.postsPerPage; i++) {
- availablePositions[i] = true;
- }
-
- pointers.forEach((item) => {
- delete availablePositions[item.order];
- });
-
- const keys = Object.keys(availablePositions);
-
- if (keys.length === 0) {
- return false;
- }
-
- return parseInt(keys[0], 10);
- };
-
- /**
- * Adds a new pointer. We place the new pointer at the highest available position
- *
- * @param {object} post Post object
- */
- addPointer = (post) => {
- const id = post.ID;
- const { posts, pointers } = this.state;
-
- if (!posts[id]) {
- posts[id] = post;
- this.setState({ posts });
- }
-
- const position = this.getNextAvailablePosition();
-
- if (!position) {
- /* eslint-disable no-alert */
- window.alert(
- __('You have added the maximum number of custom results.', 'elasticpress'),
- );
- /* eslint-enable no-alert */
- return;
- }
-
- pointers.push({
- ID: id,
- order: position,
- });
-
- this.setState({ pointers });
- };
-
- /**
- * Callback when drag/drop is complete.
- *
- * Only the pointers are able to be dragged around, so all we need to do is increase any pointer by one that is
- * either at the current position or greater
- *
- * @param {object} result Dragged object
- */
- onDragComplete = (result) => {
- // dropped outside the list
- if (!result.destination) {
- return;
- }
-
- const items = this.getMergedPosts();
-
- // Offsetting indexes when over posts per page to account for the non-sortable notice
- const ppp = parseInt(window.epOrdering.postsPerPage, 10);
- const startIndex =
- result.source.index >= ppp ? result.source.index - 1 : result.source.index;
- const endIndex =
- result.destination.index > ppp
- ? result.destination.index - 1
- : result.destination.index;
-
- const [removed] = items.splice(startIndex, 1);
- items.splice(endIndex, 0, removed);
-
- // Now _all_ the items are in order - grab the pointers and set the new positions to state
- const pointers = [];
-
- items.forEach((item, index) => {
- if (item.order) {
- // Reordering an existing pointer
- pointers.push({
- ID: item.ID,
- order: index + 1,
- });
- } else if (item.ID === result.draggableId) {
- // Adding a default post to the pointers array
- pointers.push({
- ID: item.ID,
- order: index + 1,
- });
- }
- });
-
- this.setState({ pointers });
- };
-
- searchResults = (searchResults) => {
- const { searchText } = this.state;
-
- if (searchText === '') {
- return null;
- }
-
- if (searchResults === false) {
- return (
-
- );
- }
-
- if (searchResults.length === 0) {
- return {__('No results found.', 'elasticpress')}
;
- }
-
- return searchResults.map((result) => {
- return (
-
- {result.post_title}
- {
- event.preventDefault();
- this.addPointer(result);
- }}
- onKeyDown={(event) => {
- event.preventDefault();
- this.addPointer(result);
- }}
- >
- {__('Add Post', 'elasticpress')}
-
-
- );
- });
- };
-
- /**
- * Renders the component
- *
- * @returns {*} The component
- */
- render() {
- const {
- posts,
- defaultResults,
- title,
- pointers,
- searchText,
- searchResults: searchResultsFromState,
- } = this.state;
-
- if (title.length === 0) {
- return (
-
-
- {__(
- 'Enter your search query above to preview the results.',
- 'elasticpress',
- )}
-
-
- );
- }
-
- if (!defaultResults[title]) {
- return (
-
-
-
{__('Loading Result Preview…', 'elasticpress')}
-
- );
- }
-
- // We need to reference these by ID later
- const defaultResultsById = {};
- defaultResults[title].forEach((item) => {
- defaultResultsById[item.ID] = item;
- });
-
- const mergedPosts = this.getMergedPosts();
- const renderedIds = pluck(pointers, 'ID');
-
- const searchResults = searchResultsFromState[searchText]
- ? searchResultsFromState[searchText].filter(
- (item) => renderedIds.indexOf(item.ID) === -1,
- )
- : false;
-
- return (
-
-
-
-
-
- {(provided) => (
-
- {mergedPosts.map((item, index) => {
- const draggableIndex =
- parseInt(window.epOrdering.postsPerPage, 10) <= index
- ? index + 1
- : index;
-
- let { title } = item;
- if (undefined === title) {
- title =
- undefined !== posts[item.ID]
- ? posts[item.ID].post_title
- : defaultResultsById[item.ID].post_title;
- }
-
- // Determine if this result is part of default search results or not
- const isDefaultResult =
- undefined !== defaultResultsById[item.ID];
- const tooltipText =
- isDefaultResult === true
- ? __('Return to original position', 'elasticpress')
- : __(
- 'Remove custom result from results list',
- 'elasticpress',
- );
-
- return (
-
- {parseInt(window.epOrdering.postsPerPage, 10) ===
- index && (
-
- {(component) => (
-
-
- {__(
- 'The following posts have been displaced to the next page of search results.',
- 'elasticpress',
- )}
-
-
- )}
-
- )}
-
-
- {(provided2) => (
-
- {item.order && isDefaultResult === true && (
-
RD
- )}
- {item.order &&
- isDefaultResult === false && (
-
- CR
-
- )}
-
{title}
-
-
- {item.order && (
- {
- event.preventDefault();
- this.removePointer(item);
- }}
- onKeyDown={(event) => {
- event.preventDefault();
- this.removePointer(item);
- }}
- >
-
- Remove Post
-
-
- )}
-
-
- )}
-
-
- );
- })}
- {provided.placeholder}
-
- )}
-
-
-
-
-
- CR
-
- {__('Custom Result (manually added to list)', 'elasticpress')}
-
-
-
- RD
-
- {__(
- 'Reordered Default (originally in results, but repositioned)',
- 'elasticpress',
- )}
-
-
-
-
-
-
{__('Add to results', 'elasticpress')}
-
-
-
- {
- this.setState({ searchText: e.target.value });
- this.doSearch();
- }}
- />
-
-
-
{this.searchResults(searchResults)}
-
-
-
- );
- }
-}
diff --git a/lib/elasticpress/assets/js/settings.js b/lib/elasticpress/assets/js/settings.js
deleted file mode 100644
index 5fd3591..0000000
--- a/lib/elasticpress/assets/js/settings.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import jQuery from 'jquery';
-
-const $epCredentialsTab = jQuery(document.getElementsByClassName('ep-credentials-tab'));
-const $epCredentialsHostLabel = jQuery('.ep-host-row label');
-const $epCredentialsHostLegend = jQuery(document.getElementsByClassName('ep-host-legend'));
-const $epCredentialsAdditionalFields = jQuery(
- document.getElementsByClassName('ep-additional-fields'),
-);
-const epHostField = document.getElementById('ep_host');
-const epHost = epHostField ? epHostField.value : null;
-let epHostNewValue = '';
-
-if (epHostField) {
- epHostField.addEventListener('input', (e) => {
- epHostNewValue = e.target.value;
- });
-}
-
-$epCredentialsTab.on('click', (e) => {
- const epio = e.currentTarget.getAttribute('data-epio') !== null;
- const $target = jQuery(e.currentTarget);
- const initial = $target.hasClass('initial');
-
- e.preventDefault();
-
- if (initial && !epHostField.disabled) {
- epHostField.value = epHost;
- } else {
- epHostField.value = epHostNewValue;
- }
-
- $epCredentialsTab.removeClass('nav-tab-active');
- $target.addClass('nav-tab-active');
-
- if (epio) {
- $epCredentialsHostLabel.text('ElasticPress.io Host URL');
- $epCredentialsHostLegend.text('Plug in your ElasticPress.io server here!');
- $epCredentialsAdditionalFields.show();
- $epCredentialsAdditionalFields.attr('aria-hidden', 'false');
- } else {
- $epCredentialsHostLabel.text('Elasticsearch Host URL');
- $epCredentialsHostLegend.text('Plug in your Elasticsearch server here!');
- $epCredentialsAdditionalFields.hide();
- $epCredentialsAdditionalFields.attr('aria-hidden', 'true');
- }
-});
diff --git a/lib/elasticpress/assets/js/sites-admin.js b/lib/elasticpress/assets/js/sites-admin.js
deleted file mode 100644
index e97da24..0000000
--- a/lib/elasticpress/assets/js/sites-admin.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import jQuery from 'jquery';
-
-const { epsa } = window;
-
-window.addEventListener('load', function () {
- const toggles = document.getElementsByClassName('index-toggle');
- for (let i = 0; i < toggles.length; i++) {
- toggles[i].addEventListener('click', function () {
- const checked = this.checked ? 'yes' : 'no';
-
- jQuery.get(
- epsa.ajax_url,
- {
- action: 'ep_site_admin',
- blog_id: this.dataset.blogid,
- nonce: epsa.nonce,
- checked,
- },
- () => {
- document.getElementById(`switch-label-${this.dataset.blogid}`).innerHTML = this
- .checked
- ? 'On'
- : 'Off';
- },
- );
- });
- }
-});
diff --git a/lib/elasticpress/assets/js/stats.js b/lib/elasticpress/assets/js/stats.js
deleted file mode 100644
index 9d27046..0000000
--- a/lib/elasticpress/assets/js/stats.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/* eslint-disable no-new */
-
-import Chart from 'chart.js';
-
-const { epChartData } = window;
-
-/**
- * Generates a random string representing a color.
- *
- * @returns {string} Random color
- */
-function getRandomColor() {
- const letters = '0123456789ABCDEF';
- let color = '#';
-
- for (let i = 0; i < 6; i += 1) {
- color += letters[Math.floor(Math.random() * 16)];
- }
-
- return color;
-}
-
-const barData = Object.entries(epChartData.indices_data);
-const barLabels = [];
-const barDocs = [];
-const barColors = [];
-
-Chart.defaults.global.legend.labels.usePointStyle = true;
-
-barData.forEach(function (data) {
- barLabels.push(data[1].name);
- barDocs.push(data[1].docs);
- barColors.push(getRandomColor());
-});
-
-const documentChart = document.getElementById('documentChart');
-if (documentChart) {
- new Chart(documentChart, {
- type: 'horizontalBar',
- data: {
- labels: barLabels,
- datasets: [
- {
- label: 'Documents',
- backgroundColor: barColors,
- data: barDocs,
- },
- ],
- },
- options: {
- legend: {
- display: false,
- },
- title: {
- display: true,
- },
- },
- });
-}
-
-const queriesTotalChart = document.getElementById('queriesTotalChart');
-if (queriesTotalChart) {
- new Chart(document.getElementById('queriesTotalChart'), {
- type: 'pie',
- data: {
- labels: ['Indexing operations', 'Total Query operations'],
- datasets: [
- {
- label: '',
- backgroundColor: ['#5ba9a7', '#2e7875', '#a980a4'],
- data: [epChartData.index_total, epChartData.query_total],
- },
- ],
- },
- options: {
- responsive: false,
- title: {
- display: true,
- },
- legend: {
- position: 'right',
- },
- tooltips: {
- callbacks: {
- /**
- * Appends the string operations before tooltip value
- *
- * @param {object} item Chat item
- * @param {object} data Data
- * @returns {string} Operations
- */
- label(item, data) {
- const dataset = data.datasets[item.datasetIndex];
- const currentValue = dataset.data[item.index];
-
- return `Operations: ${currentValue}`;
- },
- },
- },
- },
- });
-}
-
-const queriesTimeChart = document.getElementById('queriesTimeChart');
-if (queriesTimeChart) {
- new Chart(queriesTimeChart, {
- type: 'pie',
- data: {
- labels: ['Avg indexing time in ms', 'Avg query time in ms'],
- datasets: [
- {
- label: '',
- backgroundColor: ['#9ea6c7', '#93b3d5'],
- data: [epChartData.index_time_in_millis, epChartData.query_time_in_millis],
- },
- ],
- },
- options: {
- responsive: false,
- title: {
- display: true,
- },
- legend: {
- position: 'right',
- },
- tooltips: {
- callbacks: {
- /**
- * Appends the string milliseconds after tooltip value
- *
- * @param {object} item Tooltip item
- * @param {object} data Tooltip data
- * @returns {string} current value in milliseconds
- */
- label(item, data) {
- const dataset = data.datasets[item.datasetIndex];
- const currentValue = dataset.data[item.index];
-
- return `${+currentValue} milliseconds`;
- },
- },
- },
- },
- });
-}
diff --git a/lib/elasticpress/assets/js/sync.js b/lib/elasticpress/assets/js/sync.js
deleted file mode 100644
index a0389af..0000000
--- a/lib/elasticpress/assets/js/sync.js
+++ /dev/null
@@ -1,829 +0,0 @@
-import apiFetch from '@wordpress/api-fetch';
-import { dateI18n } from '@wordpress/date';
-
-/* eslint-disable camelcase, no-use-before-define */
-const { epDash, history } = window;
-const { __, sprintf } = wp.i18n;
-
-const { ajax_url: ajaxurl = '', is_epio } = epDash;
-
-// Main elements of sync page
-const syncBox = document.querySelector('.ep-sync-data');
-const deleteAndSyncBox = document.querySelector('.ep-delete-data-and-sync');
-
-// It could be the syncBox or deleteAndSyncBox
-let activeBox;
-
-// Buttons to start a sync or delete data
-const syncButton = syncBox.querySelector('.ep-sync-box__button-sync');
-const deleteAndSyncButton = deleteAndSyncBox.querySelector(
- '.ep-delete-data-and-sync__button-delete',
-);
-
-// Log elements
-const syncBoxFulllogTab = document.querySelector('.ep-sync-data .ep-sync-box__output-tab-fulllog');
-const syncBoxOutputFulllog = document.querySelector('.ep-sync-data .ep-sync-box__output-fulllog');
-const syncBoxErrorTab = document.querySelector('.ep-sync-data .ep-sync-box__output-tab-error');
-const syncBoxOutputError = document.querySelector('.ep-sync-data .ep-sync-box__output-error');
-
-const deleteBoxFulllogTab = document.querySelector(
- '.ep-delete-data-and-sync .ep-sync-box__output-tab-fulllog',
-);
-const deleteBoxErrorTab = document.querySelector(
- '.ep-delete-data-and-sync .ep-sync-box__output-tab-error',
-);
-const deleteBoxOutputFulllog = document.querySelector(
- '.ep-delete-data-and-sync .ep-sync-box__output-fulllog',
-);
-const deleteBoxOutputError = document.querySelector(
- '.ep-delete-data-and-sync .ep-sync-box__output-error',
-);
-
-syncButton.addEventListener('click', function () {
- activeBox = syncBox;
-
- disableButtonsInDeleteBox();
-
- syncButton.style.display = 'none';
- updateDisabledAttribute(syncButton, true);
-
- const learnMoreLink = activeBox.querySelector('.ep-sync-box__learn-more-link');
- learnMoreLink.style.display = 'none';
-
- showPauseStopButtons();
- showProgress();
- addLineToOutput(__('Indexing data…', 'elasticpress'));
-
- const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');
- const progressBar = activeBox.querySelector('.ep-sync-box__progressbar_animated');
- const startDateTime = activeBox.querySelector('.ep-sync-box__start-time-date');
-
- progressInfoElement.innerText = __('Sync in progress', 'elasticpress');
-
- progressBar.style.width = `0`;
- progressBar.innerText = ``;
-
- startDateTime.innerText = '';
-
- startSyncProcess();
-});
-
-deleteAndSyncButton.addEventListener('click', deleteAndSync);
-
-function deleteAndSync() {
- activeBox = deleteAndSyncBox;
-
- disableButtonsInSyncBox();
- updateDisabledAttribute(deleteAndSyncButton, true);
- showPauseStopButtons();
- showProgress();
-
- addLineToOutput(__('Deleting data…', 'elasticpress'));
-
- const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');
- const progressBar = activeBox.querySelector('.ep-sync-box__progressbar_animated');
- const startDateTime = activeBox.querySelector('.ep-sync-box__start-time-date');
-
- progressInfoElement.innerText = __('Deleting in progress', 'elasticpress');
-
- progressBar.style.width = `0`;
- progressBar.innerText = ``;
-
- startDateTime.innerText = '';
-
- startSyncProcess(true);
-}
-
-/**
- * Show Pause and Stop buttons on the active box
- */
-function showPauseStopButtons() {
- if (activeBox) {
- showStopButton();
- showPauseButton();
- }
-}
-
-/**
- * Hide Pause and Stop buttons on the active box
- */
-function hidePauseStopButtons() {
- hideStopButton();
- hidePauseButton();
-}
-
-/**
- * Show Pause button on the active box
- */
-function showPauseButton() {
- if (activeBox) {
- const pauseButton = activeBox.querySelector('.ep-sync-box__button-pause');
-
- updateDisabledAttribute(pauseButton, false);
-
- pauseButton.style.display = 'flex';
- }
-}
-
-/**
- * Hide Pause button on the active box
- */
-function hidePauseButton() {
- if (activeBox) {
- const pauseButton = activeBox.querySelector('.ep-sync-box__button-pause');
-
- pauseButton.style.display = 'none';
- }
-}
-
-/**
- * Show Resume button on the active box
- */
-function showResumeButton() {
- if (activeBox) {
- const resumeButton = activeBox.querySelector('.ep-sync-box__button-resume');
-
- updateDisabledAttribute(resumeButton, false);
-
- resumeButton.style.display = 'flex';
- }
-}
-
-/**
- * Hide Pause button on the active box
- */
-function hideResumeButton() {
- if (activeBox) {
- const resumeButton = activeBox.querySelector('.ep-sync-box__button-resume');
-
- resumeButton.style.display = 'none';
- }
-}
-
-/**
- * Show Stop button on the active box
- */
-function showStopButton() {
- if (activeBox) {
- const stopButton = activeBox.querySelector('.ep-sync-box__button-stop');
-
- updateDisabledAttribute(stopButton, false);
-
- stopButton.style.display = 'flex';
- }
-}
-
-/**
- * Hide Stop button on the active box
- */
-function hideStopButton() {
- if (activeBox) {
- const stopButton = activeBox.querySelector('.ep-sync-box__button-stop');
-
- stopButton.style.display = 'none';
- }
-}
-
-function showProgress() {
- const progressWrapper = activeBox?.querySelector('.ep-sync-box__progress-wrapper');
-
- if (progressWrapper?.style) {
- progressWrapper.style.display = 'block';
- }
-}
-
-let syncStatus = 'sync';
-let syncStack;
-let processed = 0;
-let toProcess = 0;
-let totalProcessed = 0;
-
-updateLastSyncDateTime(epDash?.ep_last_sync_date);
-
-if (epDash.index_meta) {
- if (epDash.index_meta.method === 'cli') {
- syncStatus = 'wpcli';
- processed = epDash?.index_meta?.items_indexed;
- toProcess = epDash?.index_meta?.total_items;
-
- activeBox = epDash.index_meta.put_mapping ? deleteAndSyncBox : syncBox;
-
- const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');
-
- progressInfoElement.innerText = __('WP-CLI sync in progress', 'elasticpress');
-
- updateStartDateTime(epDash?.index_meta?.start_date_time);
-
- updateDisabledAttribute(syncButton, true);
- updateDisabledAttribute(deleteAndSyncButton, true);
-
- showProgress();
-
- updateSyncDash();
- cliSync();
- } else {
- processed = epDash.index_meta.offset;
- toProcess = epDash.index_meta.found_items;
-
- if (epDash.index_meta.sync_stack) {
- syncStack = epDash.index_meta.sync_stack;
- }
-
- if ((!syncStack || !syncStack.length) && toProcess === 0 && !epDash.index_meta.start) {
- // Sync finished
- syncStatus = 'finished';
- } else {
- syncStatus = 'pause';
- }
- activeBox = epDash.index_meta?.put_mapping ? deleteAndSyncBox : syncBox;
-
- disableButtonsInSyncBox();
- disableButtonsInDeleteBox();
-
- if (activeBox === syncBox) {
- syncButton.style.display = 'none';
-
- const learnMoreLink = activeBox.querySelector('.ep-sync-box__learn-more-link');
-
- learnMoreLink.style.display = 'none';
- }
-
- showResumeButton();
- showStopButton();
-
- showProgress();
-
- updateSyncDash();
- }
-} else if (epDash.auto_start_index) {
- deleteAndSync();
-
- history.pushState(
- {},
- document.title,
- document.location.pathname + document.location.search.replace(/&do_sync/, ''),
- );
-}
-
-/**
- * Change the disabled attribute of an element
- *
- * @param {HTMLElement} element Element to be updated
- * @param {boolean} value The value used in disabled attribute
- */
-function updateDisabledAttribute(element, value) {
- element.disabled = value;
-}
-
-/**
- * Update dashboard with syncing information
- */
-function updateSyncDash() {
- const progressBar = activeBox.querySelector('.ep-sync-box__progressbar_animated');
-
- const isSyncing = ['initialsync', 'sync', 'pause', 'wpcli'].includes(syncStatus);
-
- let progressBarWidth;
- if (isSyncing) {
- progressBarWidth =
- toProcess === 0 ? 0 : (parseInt(processed, 10) / parseInt(toProcess, 10)) * 100;
- } else {
- progressBarWidth = 100;
- }
-
- if (
- typeof progressBarWidth === 'number' &&
- !Number.isNaN(progressBarWidth) &&
- Number.isFinite(progressBarWidth)
- ) {
- const width = Math.min(100, progressBarWidth);
- progressBar.style.width = `${width}%`;
- progressBar.innerText = `${Math.trunc(width)}%`;
- }
-
- if (isSyncing) {
- progressBar.classList.remove('ep-sync-box__progressbar_complete');
- } else if (syncStatus === 'interrupt') {
- const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');
-
- progressInfoElement.innerText = __('Sync interrupted', 'elasticpress');
-
- updateDisabledAttribute(deleteAndSyncButton, false);
- updateDisabledAttribute(syncButton, false);
-
- hidePauseStopButtons();
- hideResumeButton();
-
- syncButton.style.display = 'flex';
-
- const learnMoreLink = activeBox.querySelector('.ep-sync-box__learn-more-link');
-
- if (learnMoreLink?.style) {
- learnMoreLink.style.display = 'block';
- }
- } else {
- const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');
-
- progressInfoElement.innerText = __('Sync completed', 'elasticpress');
-
- progressBar.classList.add('ep-sync-box__progressbar_complete');
-
- updateDisabledAttribute(deleteAndSyncButton, false);
- updateDisabledAttribute(syncButton, false);
-
- hidePauseStopButtons();
- hideResumeButton();
-
- syncButton.style.display = 'flex';
-
- const learnMoreLink = activeBox.querySelector('.ep-sync-box__learn-more-link');
-
- if (learnMoreLink?.style) {
- learnMoreLink.style.display = 'block';
- }
- }
-}
-
-/**
- * Cancel a sync
- */
-function cancelSync() {
- toProcess = 0;
- processed = 0;
- totalProcessed = 0;
-
- apiFetch({
- url: ajaxurl,
- method: 'POST',
- body: new URLSearchParams({
- action: 'ep_cancel_index',
- nonce: epDash.nonce,
- }),
- });
-}
-
-function cliSync() {
- const requestSettings = {
- url: ajaxurl,
- method: 'POST',
- body: new URLSearchParams({
- action: 'ep_cli_index',
- nonce: epDash.nonce,
- }),
- };
-
- apiFetch(requestSettings).then((response) => {
- if (syncStatus === 'interrupt') {
- return;
- }
-
- if (syncStatus === 'wpcli') {
- toProcess = response.data?.index_meta?.total_items;
- processed = response.data?.index_meta?.items_indexed;
-
- if (response.data.index_meta?.current_sync_item?.failed) {
- const message = response.data?.message;
- if (Array.isArray(message)) {
- message.forEach((item) => {
- addErrorToOutput(item);
- addLineToOutput(item);
- });
- } else if (typeof message === 'string') {
- addErrorToOutput(message);
- addLineToOutput(message);
- }
- } else {
- addLineToOutput(response.data.message);
- }
-
- updateSyncDash();
-
- if (response.data?.index_meta?.indexing) {
- cliSync();
- return;
- }
- }
-
- syncStatus = 'finished';
- addLineToOutput('===============================');
- addLineToOutput(__('WP-CLI sync is finished', 'elasticpress'));
- updateSyncDash();
- });
-}
-
-/**
- * Add a line to the active output
- *
- * @param {string} text Message to show on output
- */
-function addLineToOutput(text) {
- if (activeBox && text) {
- const wrapperElement = activeBox.querySelector('.ep-sync-box__output-wrapper');
-
- const lastLineNumberElement = activeBox.querySelector(
- '.ep-sync-box__output-line:last-child .ep-sync-box__output-line-number',
- );
- const lastLineNumber = Number(lastLineNumberElement?.innerText);
-
- const lineNumber = document.createElement('div');
- lineNumber.className = 'ep-sync-box__output-line-number';
- lineNumber.innerText =
- typeof lastLineNumber === 'number' && !Number.isNaN(lastLineNumber)
- ? lastLineNumber + 1
- : 1;
-
- const lineText = document.createElement('div');
- lineText.className = 'ep-sync-box__output-line-text';
- lineText.innerText = text;
-
- const line = document.createElement('div');
- line.className = 'ep-sync-box__output-line';
- line.append(lineNumber);
- line.append(lineText);
-
- wrapperElement.append(line);
-
- const outputElement = activeBox.querySelector('.ep-sync-box__output_active');
- outputElement.scrollTo(0, wrapperElement.scrollHeight);
- }
-}
-
-function addErrorToOutput(text) {
- if (activeBox) {
- const wrapperElement = activeBox.querySelector(
- '.ep-sync-box__output-error .ep-sync-box__output-wrapper',
- );
-
- const lastLineNumberElement = activeBox.querySelector(
- '.ep-sync-box__output-error .ep-sync-box__output-line:last-child .ep-sync-box__output-line-number',
- );
- const lastLineNumber = Number(lastLineNumberElement?.innerText);
-
- const lineNumber = document.createElement('div');
- lineNumber.className = 'ep-sync-box__output-line-number';
- lineNumber.innerText =
- typeof lastLineNumber === 'number' && !Number.isNaN(lastLineNumber)
- ? lastLineNumber + 1
- : 1;
-
- const lineText = document.createElement('div');
- lineText.className = 'ep-sync-box__output-line-text';
- lineText.innerText = text;
-
- const line = document.createElement('div');
- line.className = 'ep-sync-box__output-line';
- line.append(lineNumber);
- line.append(lineText);
-
- wrapperElement.append(line);
-
- const errorTab = activeBox.querySelector('.ep-sync-box__output-tab-error');
-
- errorTab.innerText = sprintf(
- // translators: Number of errors
- __('Errors (%d)', 'elasticpress'),
- lineNumber.innerText,
- );
-
- const outputElement = activeBox.querySelector('.ep-sync-box__output-error');
- outputElement.scrollTo(0, wrapperElement.scrollHeight);
- }
-}
-
-/**
- * Update the start datetime on active box
- *
- * @param {Date | string} dateValue The datetime value
- */
-function updateStartDateTime(dateValue) {
- if (dateValue) {
- const startDateTime = activeBox.querySelector('.ep-sync-box__start-time-date');
-
- if (startDateTime) {
- startDateTime.innerText = dateI18n(
- // translators: index start date format, see https://wordpress.org/support/article/formatting-date-and-time/
- __('D, F d, Y H:i', 'elasticpress'),
- dateValue,
- );
- }
- }
-}
-
-/**
- * Update the last sync datetime
- *
- * @param {Date | string} dateValue Date object or string, parsable by moment.js.
- */
-function updateLastSyncDateTime(dateValue) {
- if (dateValue) {
- const lastSyncDate = document.querySelector('.ep-last-sync__date');
-
- if (lastSyncDate) {
- lastSyncDate.innerText = dateI18n(
- // translators: last sync datetime format, see https://wordpress.org/support/article/formatting-date-and-time/
- __('D, F d, Y H:i', 'elasticpress'),
- dateValue,
- );
- }
- }
-}
-
-/**
- * Check if a destructive index is running
- *
- * @returns {boolean} Wheter or not is a destructive index
- */
-function isDestructiveIndex() {
- return activeBox === deleteAndSyncBox;
-}
-
-/**
- * Interrupt the sync process
- *
- * @param {boolean} value True to interrupt the sync process
- */
-function shouldInterruptSync(value) {
- if (!value) {
- return;
- }
-
- syncStatus = 'interrupt';
-
- let logMessage = __('Sync interrupted by WP-CLI command', 'elasticpress');
- if (isDestructiveIndex()) {
- logMessage = sprintf(
- // translators: ElasticPress.io or Elasticsearch
- __(
- 'Your indexing process has been stopped by WP-CLI and your %s index could be missing content. To restart indexing, please click the Start button or use WP-CLI commands to perform the reindex. Please note that search results could be incorrect or incomplete until the reindex finishes.',
- 'elasticpress',
- ),
- is_epio ? 'ElasticPress.io' : 'Elasticsearch',
- );
- }
- stopIndex(__('Sync interrupted', 'elasticpress'), logMessage);
-}
-
-/**
- * Perform an elasticpress sync
- *
- * @param {boolean} putMapping Whetever mapping should be sent or not.
- */
-function sync(putMapping = false) {
- const requestSettings = {
- url: ajaxurl,
- method: 'POST',
- body: new URLSearchParams({
- action: 'ep_index',
- put_mapping: putMapping ? 1 : 0,
- nonce: epDash.nonce,
- }),
- };
-
- apiFetch(requestSettings)
- .then((response) => {
- if (response.data.index_meta?.current_sync_item?.failed) {
- const message = response.data?.message;
- if (Array.isArray(message)) {
- message.forEach((item) => {
- addErrorToOutput(item);
- addLineToOutput(item);
- });
- } else if (typeof message === 'string') {
- addErrorToOutput(message);
- addLineToOutput(message);
- }
- } else {
- addLineToOutput(response.data.message);
- }
- updateStartDateTime(response?.data?.index_meta?.start_date_time);
- shouldInterruptSync(response.data?.index_meta?.should_interrupt_sync);
-
- if (response.data?.method === 'cli') {
- syncStatus = 'wpcli';
- cliSync();
- return;
- }
-
- if (syncStatus !== 'sync') {
- return;
- }
-
- if (!response.data.index_meta) {
- syncStatus = 'finished';
-
- const lastSyncStatusIcon = document.querySelector('.ep-last-sync__icon-status');
- const lastSyncStatus = document.querySelector('.ep-last-sync__status');
-
- lastSyncStatusIcon.src = response.data.totals.failed
- ? lastSyncStatusIcon.src?.replace(/thumbsup/, 'thumbsdown')
- : lastSyncStatusIcon.src?.replace(/thumbsdown/, 'thumbsup');
- lastSyncStatus.innerText = response.data.totals.failed
- ? __('Sync unsuccessful on ', 'elasticpress')
- : __('Sync success on ', 'elasticpress');
-
- updateLastSyncDateTime(response.data?.totals?.end_date_time);
-
- updateSyncDash();
-
- addLineToOutput('===============================');
-
- if (epDash.install_sync) {
- document.location.replace(epDash.install_complete_url);
- }
-
- activeBox = undefined;
-
- processed = 0;
- toProcess = 0;
- totalProcessed = 0;
-
- return;
- }
-
- if (!toProcess) {
- toProcess = response.data?.index_meta?.current_sync_item?.found_items;
-
- if (response.data?.index_meta?.sync_stack) {
- syncStack = response.data.index_meta.sync_stack;
-
- toProcess = syncStack?.reduce((previousValue, currentSync) => {
- return previousValue + currentSync.found_items;
- }, toProcess);
- }
- }
-
- if (response.data.index_meta.offset === 0 && processed > 0) {
- totalProcessed = processed;
- }
-
- processed = totalProcessed + response.data.index_meta.offset;
-
- updateSyncDash();
- sync(putMapping);
- })
- .catch((response) => {
- if (
- response &&
- response.status &&
- parseInt(response.status, 10) >= 400 &&
- parseInt(response.status, 10) < 600
- ) {
- syncStatus = 'error';
- updateSyncDash();
-
- cancelSync();
- }
-
- updateDisabledAttribute(syncButton, false);
- updateDisabledAttribute(deleteAndSyncButton, false);
- });
-}
-
-/**
- * Start sync process
- *
- * @param {boolean} putMapping Determines whether to send the mapping and delete all data before sync.
- */
-function startSyncProcess(putMapping) {
- syncStatus = 'initialsync';
-
- const progressWrapperElement = activeBox.querySelector('.ep-sync-box__progress-wrapper');
- const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');
- const progressBar = activeBox.querySelector('.ep-sync-box__progressbar_animated');
- const startDateTime = activeBox.querySelector('.ep-sync-box__start-time-date');
-
- progressWrapperElement.style.display = 'block';
- progressInfoElement.innerText = __('Sync in progress', 'elasticpress');
-
- progressBar.style.width = `0`;
- progressBar.innerText = ``;
-
- startDateTime.innerText = '';
-
- updateSyncDash();
-
- syncStatus = 'sync';
-
- sync(putMapping);
-}
-
-/**
- * Disable buttons in the Sync box
- */
-function disableButtonsInSyncBox() {
- const buttons = syncBox.querySelectorAll('.ep-sync-data button');
-
- buttons.forEach((button) => updateDisabledAttribute(button, true));
-}
-
-/**
- * Disable buttons in the Delete box
- */
-function disableButtonsInDeleteBox() {
- const buttons = deleteAndSyncBox.querySelectorAll('.ep-delete-data-and-sync button');
-
- buttons.forEach((button) => updateDisabledAttribute(button, true));
-}
-
-document.querySelectorAll('.ep-sync-box__button-pause')?.forEach((button) => {
- button?.addEventListener('click', function () {
- syncStatus = 'pause';
-
- const progressInfoElement = activeBox?.querySelector('.ep-sync-box__progress-info');
-
- if (progressInfoElement?.innerText) {
- progressInfoElement.innerText = __('Sync paused', 'elasticpress');
- }
-
- updateSyncDash();
-
- hidePauseButton();
- showResumeButton();
-
- addLineToOutput(__('Sync paused', 'elasticpress'));
- });
-});
-
-document.querySelectorAll('.ep-sync-box__button-resume')?.forEach((button) => {
- button?.addEventListener('click', function () {
- syncStatus = 'sync';
-
- const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');
-
- progressInfoElement.innerText = __('Sync in progress', 'elasticpress');
-
- updateSyncDash();
-
- hideResumeButton();
- showPauseButton();
-
- sync();
- });
-});
-
-function stopIndex(syncMessage, logMessage) {
- syncStatus = syncStatus === 'wpcli' ? 'interrupt' : 'cancel';
-
- const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');
- const progressBar = activeBox.querySelector('.ep-sync-box__progressbar_animated');
-
- updateSyncDash();
-
- cancelSync();
-
- progressInfoElement.innerText = syncMessage;
-
- progressBar.style.width = `0`;
- progressBar.innerText = ``;
-
- addLineToOutput(logMessage);
-}
-document.querySelectorAll('.ep-sync-box__button-stop')?.forEach((button) => {
- button?.addEventListener('click', () => {
- stopIndex(__('Sync stopped', 'elasticpress'), __('Sync stopped', 'elasticpress'));
- });
-});
-
-document.querySelectorAll('.ep-sync-box__show-hide-log')?.forEach((element) => {
- element.addEventListener('click', function (event) {
- event.preventDefault();
-
- if (element.nextElementSibling?.classList?.toggle('ep-sync-box__output-tabs_hide')) {
- element.innerText = __('Show log', 'elasticpress');
- } else {
- element.innerText = __('Hide log', 'elasticpress');
- }
- });
-});
-
-syncBoxFulllogTab.addEventListener('click', function () {
- syncBoxFulllogTab.classList.add('ep-sync-box__output-tab_active');
- syncBoxOutputFulllog.classList.add('ep-sync-box__output_active');
-
- syncBoxErrorTab.classList.remove('ep-sync-box__output-tab_active');
- syncBoxOutputError.classList.remove('ep-sync-box__output_active');
-});
-
-syncBoxErrorTab.addEventListener('click', function () {
- syncBoxErrorTab.classList.add('ep-sync-box__output-tab_active');
- syncBoxOutputError.classList.add('ep-sync-box__output_active');
-
- syncBoxFulllogTab.classList.remove('ep-sync-box__output-tab_active');
- syncBoxOutputFulllog.classList.remove('ep-sync-box__output_active');
-});
-
-deleteBoxFulllogTab.addEventListener('click', function () {
- deleteBoxFulllogTab.classList.add('ep-sync-box__output-tab_active');
- deleteBoxOutputFulllog.classList.add('ep-sync-box__output_active');
-
- deleteBoxErrorTab.classList.remove('ep-sync-box__output-tab_active');
- deleteBoxOutputError.classList.remove('ep-sync-box__output_active');
-});
-
-deleteBoxErrorTab.addEventListener('click', function () {
- deleteBoxErrorTab.classList.add('ep-sync-box__output-tab_active');
- deleteBoxOutputError.classList.add('ep-sync-box__output_active');
-
- deleteBoxFulllogTab.classList.remove('ep-sync-box__output-tab_active');
- deleteBoxOutputFulllog.classList.remove('ep-sync-box__output_active');
-});
diff --git a/lib/elasticpress/assets/js/synonyms/components/SynonymsEditor.js b/lib/elasticpress/assets/js/synonyms/components/SynonymsEditor.js
deleted file mode 100644
index 4e706fb..0000000
--- a/lib/elasticpress/assets/js/synonyms/components/SynonymsEditor.js
+++ /dev/null
@@ -1,120 +0,0 @@
-import React, { useContext, useEffect } from 'react';
-import { State, Dispatch } from '../context';
-import SetsEditor from './editors/SetsEditor';
-import AlterativesEditor from './editors/AlternativesEditor';
-import SolrEditor from './editors/SolrEditor';
-
-/**
- * Synonyms editor component.
- *
- * @returns {React.FC} Synonyms component
- */
-const SynonymsEditor = () => {
- const state = useContext(State);
- const dispatch = useContext(Dispatch);
- const { alternatives, sets, isSolrEditable, isSolrVisible, dirty, submit } = state;
- const {
- pageHeading,
- pageDescription,
- pageToggleAdvanceText,
- pageToggleSimpleText,
- alternativesTitle,
- alternativesDescription,
- setsTitle,
- setsDescription,
- solrTitle,
- solrDescription,
- submitText,
- } = window.epSynonyms.i18n;
-
- /**
- * Checks if the form is valid.
- *
- * @param {object} _state Current state.
- * @returns {boolean} If the form is valid
- */
- const isValid = (_state) => {
- return [..._state.sets, ..._state.alternatives].reduce((valid, item) => {
- return !valid ? valid : item.valid;
- }, true);
- };
-
- /**
- * Handles submitting the form.
- */
- const handleSubmit = () => {
- if (isSolrEditable) {
- dispatch({ type: 'REDUCE_SOLR_TO_STATE' });
- }
-
- dispatch({ type: 'VALIDATE_ALL' });
- dispatch({ type: 'REDUCE_STATE_TO_SOLR' });
- dispatch({ type: 'SUBMIT' });
- };
-
- /**
- * Handle toggling the editor type.
- */
- const handleToggleAdvance = () => {
- if (isSolrEditable) {
- dispatch({ type: 'REDUCE_SOLR_TO_STATE' });
- } else {
- dispatch({ type: 'REDUCE_STATE_TO_SOLR' });
- }
-
- dispatch({ type: 'SET_SOLR_EDITABLE', data: !isSolrEditable });
- };
-
- useEffect(() => {
- if (submit && !dirty && isValid(state)) {
- document.querySelector('.wrap form').submit();
- }
- }, [submit, dirty, state]);
-
- return (
- <>
-
- {pageHeading}{' '}
-
-
- {pageDescription}
-
- {!isSolrEditable && (
- <>
-
-
{`${setsTitle} (${sets.length})`}
-
{setsDescription}
-
-
-
-
{`${alternativesTitle} (${alternatives.length})`}
-
{alternativesDescription}
-
-
- >
- )}
-
-
- {isSolrVisible &&
{solrTitle}
}
- {isSolrVisible &&
{solrDescription}
}
-
-
-
-
-
-
-
-
- >
- );
-};
-
-export default SynonymsEditor;
diff --git a/lib/elasticpress/assets/js/synonyms/components/editors/AlternativeEditor.js b/lib/elasticpress/assets/js/synonyms/components/editors/AlternativeEditor.js
deleted file mode 100644
index 5cbf934..0000000
--- a/lib/elasticpress/assets/js/synonyms/components/editors/AlternativeEditor.js
+++ /dev/null
@@ -1,81 +0,0 @@
-import React, { useState, useEffect, useContext, useRef } from 'react';
-import LinkedMultiInput from '../shared/LinkedMultiInput';
-import { Dispatch } from '../../context';
-
-/**
- * Alternative Editor
- *
- * @param {object} props Props.
- * @returns {React.FC} AlternativeEditor component
- */
-const AlternativeEditor = (props) => {
- const { id, synonyms, removeAction, updateAction } = props;
- const primary = synonyms.find((item) => item.primary);
- const [primaryTerm, setPrimaryTerm] = useState(primary ? primary.value : '');
- const dispatch = useContext(Dispatch);
- const primaryRef = useRef(null);
-
- /**
- * Create primary token
- *
- * @param {string} label Label.
- * @returns {object} Primary token
- */
- const createPrimaryToken = (label) => {
- return {
- label,
- value: label,
- primary: true,
- };
- };
-
- /**
- * Handle key down.
- *
- * @param {React.SyntheticEvent} event Keydown event.
- */
- const handleKeyDown = (event) => {
- switch (event.key) {
- case 'Enter':
- event.preventDefault();
- break;
- default:
- }
- };
-
- useEffect(() => {
- dispatch({
- type: 'UPDATE_ALTERNATIVE_PRIMARY',
- data: { id, token: createPrimaryToken(primaryTerm) },
- });
- }, [primaryTerm, id, dispatch]);
-
- useEffect(() => {
- primaryRef.current.focus();
- }, [primaryRef]);
-
- const memoizedSynonyms = React.useMemo(() => {
- return synonyms.filter((item) => !item.primary);
- }, [synonyms]);
-
- return (
- <>
- setPrimaryTerm(e.target.value)}
- value={primaryTerm}
- onKeyDown={handleKeyDown}
- ref={primaryRef}
- />
-
- >
- );
-};
-
-export default AlternativeEditor;
diff --git a/lib/elasticpress/assets/js/synonyms/components/editors/AlternativesEditor.js b/lib/elasticpress/assets/js/synonyms/components/editors/AlternativesEditor.js
deleted file mode 100644
index 2d211ff..0000000
--- a/lib/elasticpress/assets/js/synonyms/components/editors/AlternativesEditor.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import React, { Fragment, useContext } from 'react';
-import AlternativeEditor from './AlternativeEditor';
-import { Dispatch, State } from '../../context';
-
-/**
- * Synonyms editor component.
- *
- * @param {object} props Props.
- * @param {object[]} props.alternatives Defined alternatives (explicit mappings).
- * @returns {React.FC} AlternativesEditor component
- */
-const AlternativesEditor = ({ alternatives }) => {
- const dispatch = useContext(Dispatch);
- const state = useContext(State);
- const {
- alternativesInputHeading,
- alternativesPrimaryHeading,
- alternativesAddButtonText,
- alternativesErrorMessage,
- } = window.epSynonyms.i18n;
-
- /**
- * Handle click.
- *
- * @param {React.SyntheticEvent} e Event.
- */
- const handleClick = (e) => {
- const [lastItem] = state.alternatives.slice(-1);
- if (!alternatives.length || lastItem.synonyms.filter(({ value }) => value.length).length) {
- dispatch({ type: 'ADD_ALTERNATIVE' });
- }
- e.preventDefault();
- };
-
- return (
-
-
-
-
- {alternativesPrimaryHeading}
-
-
- {alternativesInputHeading}
-
-
-
- {alternatives.map((props) => (
-
-
- {!props.valid && (
- {alternativesErrorMessage}
- )}
-
- ))}
-
-
-
-
- );
-};
-
-export default AlternativesEditor;
diff --git a/lib/elasticpress/assets/js/synonyms/components/editors/SetsEditor.js b/lib/elasticpress/assets/js/synonyms/components/editors/SetsEditor.js
deleted file mode 100644
index 557f94b..0000000
--- a/lib/elasticpress/assets/js/synonyms/components/editors/SetsEditor.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import React, { useContext, Fragment } from 'react';
-import LinkedMultiInput from '../shared/LinkedMultiInput';
-import { Dispatch, State } from '../../context';
-
-/**
- * Synonyms editor component.
- *
- * @param {object} props Props
- * @param {object[]} props.sets Defined sets (equivalent synonyms).
- * @returns {React.FC} SetsEditor component
- */
-const SetsEditor = ({ sets }) => {
- const dispatch = useContext(Dispatch);
- const state = useContext(State);
- const { setsInputHeading, setsAddButtonText, setsErrorMessage } = window.epSynonyms.i18n;
-
- /**
- * Handle click.
- *
- * @param {React.SyntheticEvent} e Event
- */
- const handleClick = (e) => {
- const [lastSet] = state.sets.slice(-1);
- if (!sets.length || lastSet.synonyms.length) {
- dispatch({ type: 'ADD_SET' });
- }
- e.preventDefault();
- };
-
- return (
-
-
-
- {setsInputHeading}
-
-
- {sets.map((props) => (
-
-
-
-
- {!props.valid && (
- {setsErrorMessage}
- )}
-
- ))}
-
-
-
-
- );
-};
-
-export default SetsEditor;
diff --git a/lib/elasticpress/assets/js/synonyms/components/editors/SolrEditor.js b/lib/elasticpress/assets/js/synonyms/components/editors/SolrEditor.js
deleted file mode 100644
index a960e0e..0000000
--- a/lib/elasticpress/assets/js/synonyms/components/editors/SolrEditor.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import React, { useContext } from 'react';
-import { State, Dispatch } from '../../context';
-
-/**
- * Synonym Inspector
- *
- * @returns {React.FC} SolrEditor Component
- */
-const SolrEditor = () => {
- const state = useContext(State);
- const dispatch = useContext(Dispatch);
- const { alternatives, isSolrEditable, isSolrVisible, sets, solr } = state;
- const {
- synonymsTextareaInputName,
- solrInputHeading,
- solrAlternativesErrorMessage,
- solrSetsErrorMessage,
- } = window.epSynonyms.i18n;
-
- return (
-
-
-
- {solrInputHeading}
-
-
-
-
- );
-};
-
-export default SolrEditor;
diff --git a/lib/elasticpress/assets/js/synonyms/components/shared/LinkedMultiInput.js b/lib/elasticpress/assets/js/synonyms/components/shared/LinkedMultiInput.js
deleted file mode 100644
index 536458f..0000000
--- a/lib/elasticpress/assets/js/synonyms/components/shared/LinkedMultiInput.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import React, { useContext } from 'react';
-import MultiInput from './MultiInput';
-import { Dispatch } from '../../context';
-
-/**
- * Linked MultiInput
- *
- * @param {object} props Props.
- * @param {string} props.id Set/Alternative id.
- * @param {object[]} props.synonyms Array of synonyms.
- * @param {string} props.removeAction Name of action to dispatch on remove.
- * @param {string} props.updateAction Name of action to dispatch on update.
- * @returns {React.FC} LinkedMultiInput component
- */
-const LinkedMultiInput = ({ id, synonyms, removeAction, updateAction }) => {
- const dispatch = useContext(Dispatch);
- const { removeItemText } = window.epSynonyms.i18n;
-
- /**
- * Handle clearing the synonym.
- */
- const handleClear = () => {
- dispatch({ type: removeAction, data: id });
- };
-
- return (
- <>
- dispatch({ type: updateAction, data: { id, tokens } })}
- />
-
- >
- );
-};
-
-export default LinkedMultiInput;
diff --git a/lib/elasticpress/assets/js/synonyms/components/shared/MultiInput.js b/lib/elasticpress/assets/js/synonyms/components/shared/MultiInput.js
deleted file mode 100644
index 5ad13bb..0000000
--- a/lib/elasticpress/assets/js/synonyms/components/shared/MultiInput.js
+++ /dev/null
@@ -1,109 +0,0 @@
-import React, { useState } from 'react';
-import CreatableSelect from 'react-select/creatable';
-
-/**
- * Synonyms editor component.
- *
- * @param {object} props Props.
- * @returns {React.FC} MultiInput component
- */
-const MultiInput = (props) => {
- const { tokens, setTokens } = props;
- const [inputValue, setInputValue] = useState('');
-
- /**
- * Create option.
- *
- * @param {string} label Option label.
- * @returns {object} Option object
- */
- const createOption = (label) => ({
- label,
- value: label,
- });
-
- /**
- * Handle key down.
- *
- * @param {React.SyntheticEvent} event Keydown event.
- */
- const handleKeyDown = (event) => {
- switch (event.key) {
- case ',':
- case 'Enter':
- if (!tokens || !inputValue.length) {
- event.preventDefault();
- break;
- }
- if (tokens.map(({ value }) => value).indexOf(inputValue.trim()) === -1) {
- setTokens([...tokens, createOption(inputValue)]);
- }
- setInputValue('');
- event.preventDefault();
- break;
- default:
- }
- };
-
- /**
- * Handle change.
- *
- * @param {string} _value The value.
- * @param {object} data Data with the action.
- */
- const handleChange = (_value, data) => {
- switch (data.action) {
- case 'remove-value':
- setTokens([...tokens.filter(({ value }) => value !== data.removedValue.value)]);
- break;
- default:
- break;
- }
- };
-
- const customStyles = {
- input: (styles) => ({
- ...styles,
- cursor: 'text',
- fontSize: '14px',
- padding: 0,
- }),
- control: (styles) => ({
- ...styles,
- cursor: 'text',
- }),
- multiValue: (styles) => ({
- ...styles,
- padding: '4px',
- }),
- multiValueLabel: (styles) => ({
- ...styles,
- fontSize: '14px',
- }),
- multiValueRemove: (styles) => ({
- ...styles,
- cursor: 'pointer',
- paddingTop: '2px',
- }),
- };
-
- return (
- setInputValue(val)}
- onKeyDown={handleKeyDown}
- placeholder="Type a synonym and press enter..."
- value={tokens}
- styles={customStyles}
- />
- );
-};
-
-export default MultiInput;
diff --git a/lib/elasticpress/assets/js/synonyms/context.js b/lib/elasticpress/assets/js/synonyms/context.js
deleted file mode 100644
index f6d6780..0000000
--- a/lib/elasticpress/assets/js/synonyms/context.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import React, { createContext, useReducer } from 'react';
-import { editorReducer, initialState } from './reducers/editorReducer';
-
-const State = createContext();
-const Dispatch = createContext();
-
-/**
- * App Context.
- *
- * @param {object} props Props.
- * @returns {React.FC} AppContext component
- */
-const AppContext = (props) => {
- const { children } = props;
- const [state, dispatch] = useReducer(editorReducer, initialState);
-
- return (
-
- {children}
-
- );
-};
-
-export { AppContext, State, Dispatch };
diff --git a/lib/elasticpress/assets/js/synonyms/index.js b/lib/elasticpress/assets/js/synonyms/index.js
deleted file mode 100644
index f30d67e..0000000
--- a/lib/elasticpress/assets/js/synonyms/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import ReactDOM from 'react-dom';
-import { AppContext } from './context';
-import SynonymsEditor from './components/SynonymsEditor';
-
-const SELECTOR = '#synonym-root';
-
-/**
- * Get Root.
- *
- * @returns {Element|false} Root element
- */
-const getRoot = () => document.querySelector(SELECTOR) || false;
-
-ReactDOM.render(
-
-
- ,
- getRoot(),
-);
diff --git a/lib/elasticpress/assets/js/synonyms/reducers/editorReducer.js b/lib/elasticpress/assets/js/synonyms/reducers/editorReducer.js
deleted file mode 100644
index 89feaaf..0000000
--- a/lib/elasticpress/assets/js/synonyms/reducers/editorReducer.js
+++ /dev/null
@@ -1,145 +0,0 @@
-import { reduceSolrToState, reduceStateToSolr, mapEntry } from '../utils';
-
-/**
- * The synonym editor reducer.
- */
-
-const { alternatives, sets, initialMode } = window.epSynonyms.data;
-const mappedSets = sets ? sets.map(mapEntry) : [mapEntry()];
-const mappedAlternatives = alternatives ? alternatives.map(mapEntry) : [mapEntry()];
-const initialState = {
- isSolrEditable: initialMode === 'advanced',
- isSolrVisible: initialMode === 'advanced',
- alternatives: mappedAlternatives,
- sets: mappedSets,
- solr: reduceStateToSolr({ sets: mappedSets, alternatives: mappedAlternatives }),
- dirty: false,
- submit: false,
-};
-
-/**
- * editorReducer
- *
- * @param {object} state Current state.
- * @param {object} action The action.
- * @returns {object} New state.
- */
-const editorReducer = (state, action) => {
- switch (action.type) {
- case 'ADD_SET':
- return {
- ...state,
- sets: [...state.sets, mapEntry()],
- dirty: true,
- };
- case 'UPDATE_SET':
- return {
- ...state,
- sets: state.sets.map((entry) => {
- if (entry.id !== action.data.id) {
- return entry;
- }
- return mapEntry(action.data.tokens, action.data.id);
- }),
- dirty: true,
- };
- case 'REMOVE_SET':
- return {
- ...state,
- sets: state.sets.filter(({ id }) => id !== action.data),
- dirty: true,
- };
- case 'ADD_ALTERNATIVE':
- return {
- ...state,
- alternatives: [...state.alternatives, mapEntry()],
- dirty: true,
- };
- case 'UPDATE_ALTERNATIVE':
- return {
- ...state,
- alternatives: [
- ...state.alternatives.map((entry) => {
- if (entry.id !== action.data.id) {
- return entry;
- }
- return mapEntry(
- [...action.data.tokens, ...entry.synonyms.filter((t) => t.primary)],
- action.data.id,
- );
- }),
- ],
- dirty: true,
- };
- case 'UPDATE_ALTERNATIVE_PRIMARY':
- return {
- ...state,
- alternatives: [
- ...state.alternatives.map((entry) => {
- if (entry.id !== action.data.id) {
- return entry;
- }
- return mapEntry(
- [action.data.token, ...entry.synonyms.filter((t) => !t.primary)],
- action.data.id,
- );
- }),
- ],
- dirty: true,
- };
- case 'REMOVE_ALTERNATIVE':
- return {
- ...state,
- alternatives: state.alternatives.filter(({ id }) => id !== action.data),
- dirty: true,
- };
- case 'SET_SOLR_EDITABLE':
- return {
- ...state,
- isSolrEditable: !!action.data,
- isSolrVisible: !!action.data,
- };
- case 'UPDATE_SOLR':
- return {
- ...state,
- solr: action.data,
- dirty: true,
- };
- case 'REDUCE_SOLR_TO_STATE':
- return {
- ...reduceSolrToState(state.solr, state),
- dirty: true,
- };
- case 'REDUCE_STATE_TO_SOLR':
- return {
- ...state,
- solr: reduceStateToSolr(state),
- };
- case 'VALIDATE_ALL':
- return {
- ...state,
- sets: state.sets.map((set) => ({
- ...set,
- valid: set.synonyms.length > 1,
- })),
- alternatives: state.alternatives.map((alternative) => ({
- ...alternative,
- valid:
- alternative.synonyms.length > 1 &&
- !!alternative.synonyms.filter(
- ({ primary, value }) => primary && value.length,
- ).length,
- })),
- dirty: false,
- };
- case 'SUBMIT':
- return {
- ...state,
- submit: true,
- };
- default:
- return state;
- }
-};
-
-export { editorReducer, initialState };
diff --git a/lib/elasticpress/assets/js/synonyms/utils.js b/lib/elasticpress/assets/js/synonyms/utils.js
deleted file mode 100644
index ae00c59..0000000
--- a/lib/elasticpress/assets/js/synonyms/utils.js
+++ /dev/null
@@ -1,130 +0,0 @@
-import { v4 as uuidv4 } from 'uuid';
-
-/**
- * Generate universally unique identifier.
- *
- * @returns {string} A universally unique identifier
- */
-const uuid = () => {
- return uuidv4();
-};
-
-/**
- * Map entry
- *
- * @param {Array} synonyms Array of synonyms.
- * @param {string} id The id, default generated by the application.
- * @returns {object} Map entry
- */
-const mapEntry = (synonyms = [], id = '') => {
- return {
- id: id.length ? id : uuidv4(),
- synonyms,
- valid: true,
- };
-};
-
-/**
- * Reduce state to Solr spec.
- *
- * @param {object} state Current state.
- * @param {object[]} state.sets Array of synonym sets.
- * @param {object[]} state.alternatives Array of alternative sets.
- * @returns {string} new state
- */
-const reduceStateToSolr = ({ sets, alternatives }) => {
- const synonymsList = [];
-
- // Handle sets.
- synonymsList.push('# Defined sets ( equivalent synonyms).');
- synonymsList.push(...sets.map(({ synonyms }) => synonyms.map(({ value }) => value).join(', ')));
-
- // Handle alternatives.
- synonymsList.push('\r');
- synonymsList.push('# Defined alternatives (explicit mappings).');
- synonymsList.push(
- ...alternatives.map((alternative) =>
- alternative.synonyms.find((item) => item.primary && item.value.length)
- ? alternative.synonyms
- .find((item) => item.primary)
- .value.concat(' => ')
- .concat(
- alternative.synonyms
- .filter((i) => !i.primary)
- .map(({ value }) => value)
- .join(', '),
- )
- : false,
- ),
- );
-
- return synonymsList.filter(Boolean).join('\n');
-};
-
-/**
- * Reduce Solr text file to State.
- *
- * @param {string} solr A string in the Solr parseable synonym format.
- * @param {object} currentState The current sate.
- * @returns {object} State
- */
-const reduceSolrToState = (solr, currentState) => {
- /**
- * Format token.
- *
- * @param {string} value The value.
- * @param {boolean} primary Whether it's a primary.
- * @returns {object} Formated token
- */
- const formatToken = (value, primary = false) => {
- return {
- label: value,
- value,
- primary,
- };
- };
-
- return {
- ...currentState,
- ...solr.split(/\r?\n/).reduce(
- (newState, line) => {
- if (line.indexOf('#') === 0 || !line.trim().length) {
- return newState;
- }
-
- if (line.indexOf('=>') !== -1) {
- const parts = line.split('=>');
- return {
- ...newState,
- alternatives: [
- ...newState.alternatives,
- mapEntry([
- formatToken(parts[0].trim(), true),
- ...parts[1]
- .split(',')
- .filter((v) => v.trim())
- .map((token) => formatToken(token.trim())),
- ]),
- ],
- };
- }
-
- return {
- ...newState,
- sets: [
- ...newState.sets,
- mapEntry([
- ...line
- .split(',')
- .filter((v) => v.trim())
- .map((token) => formatToken(token.trim())),
- ]),
- ],
- };
- },
- { alternatives: [], sets: [] },
- ),
- };
-};
-
-export { reduceStateToSolr, reduceSolrToState, uuid, mapEntry };
diff --git a/lib/elasticpress/assets/js/utils/helpers.js b/lib/elasticpress/assets/js/utils/helpers.js
deleted file mode 100644
index 55754b7..0000000
--- a/lib/elasticpress/assets/js/utils/helpers.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * Simple throttling function for waiting a set amount of time after the last keypress
- * So we don't overload the server with too many requests at once
- *
- * @param {Function} fn - function to be debounced
- * @param {number} delay - integer
- * @returns {Function} - new function, with the provided function wrapped in a timeout
- */
-export const debounce = (fn, delay) => {
- let timer = null;
-
- // don't use a fat arrow in order to preserve the proper context
- return function debouncedFunction(...args) {
- const context = this;
- window.clearTimeout(timer);
-
- timer = window.setTimeout(() => {
- fn.apply(context, args);
- }, delay);
- };
-};
-
-/**
- * Helper function to escape input to be treated as a literal string with a RegEx
- *
- * @param {string} string - string to be escaped
- * @returns {string} escaped string
- */
-export const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
-
-/**
- * Helper function to escape input to be treated as a literal string with a RegEx
- *
- * @param {string} string - string to replace
- * @param {string} term - tearm to search for
- * @param {string} replacement replace value to use
- * @returns {string} replaced string
- */
-export const replaceGlobally = (string, term, replacement) => {
- return string.replace(new RegExp(escapeRegExp(term), 'g'), replacement);
-};
-
-/**
- * Escapes double quotes for specific data-attr
- *
- * @param {string} str The provided string containing double quotes
- * @returns {string} The escaped string
- */
-export const escapeDoubleQuotes = (str) => str.replace(/\\([\s\S])|(")/g, '"');
-
-/**
- * Finds parent node with the provided class param
- *
- * @param {*} el - node to search for its ancestor
- * @param {*} className - class attribute to search for
- * @returns {Element} - ancestor element of provided el
- */
-export const findAncestorByClass = (el, className) => {
- // eslint-disable-next-line
- while ( ( el = el.parentElement ) && !el.classList.contains( className ) );
- return el;
-};
-
-/**
- * Array pluck
- *
- * @param {Array} array - array to search
- * @param {string} key - array to search
- * @returns {Array} - new array
- */
-export const pluck = (array, key) => {
- return array.map((o) => o[key]);
-};
-
-/**
- * Formats object like a url query string, which is how ajax methods
- * in PHP expect to receive the data, e.g. action_wp_ajax_ep_save_feature
- * from dashboard.php
- *
- * @param {object} obj - js object
- * @returns {string} urlencoded string for POST ajax request
- */
-export const formatPostBody = (obj) => {
- return Object.keys(obj)
- .map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`)
- .join('&')
- .replace(/%20/g, '+');
-};
-
-/**
- * Helper method to wrap show/hide elements. Not exported.
- *
- * @param {Array} els - could possibly be a single node, or an array of nodes
- * @param {string} display - css display property to set
- */
-const showOrHideNodes = (els, display) => {
- let nodes = [];
-
- // convert nodelist to array
- // eslint-disable-next-line no-prototype-builtins
- if (NodeList.prototype.isPrototypeOf(els)) {
- nodes = Array.from(els);
- }
-
- // if not converted, then it was a single node,
- // so create an array
- if (!nodes.length) {
- if (Array.isArray(els)) {
- nodes = [...els, ...nodes];
- } else {
- nodes.push(els);
- }
- }
-
- nodes.forEach((el) => {
- el.style.display = display; // eslint-disable-line no-param-reassign
- });
-};
-
-/**
- * Decorated helper function to show node/NodeList/array of nodes
- *
- * @param {Array} els - Nodelist/array of Nodes to show
- * @returns {Function} - showOrHideNodes
- */
-export const showElements = (els) => showOrHideNodes(els, 'inline-block');
-
-/**
- * Decorated helper function to hide node/NodeList/array of nodes
- *
- * @param {Array} els - Nodelist/array of Nodes to show
- * @returns {Function} - showOrHideNodes
- */
-export const hideElements = (els) => showOrHideNodes(els, 'none');
-
-/**
- * Specify a function to execute when the DOM is fully loaded.
- *
- * @param {Function} callback A function to execute after the DOM is ready.
- * @returns {void}
- */
-export const domReady = (callback) => {
- if (typeof document === 'undefined') {
- return;
- }
-
- if (
- document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
- document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
- ) {
- callback();
- return;
- }
-
- // DOMContentLoaded has not fired yet, delay callback until then.
- document.addEventListener('DOMContentLoaded', callback);
-};
diff --git a/lib/elasticpress/assets/js/weighting.js b/lib/elasticpress/assets/js/weighting.js
deleted file mode 100644
index 732f5ba..0000000
--- a/lib/elasticpress/assets/js/weighting.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import jQuery from 'jquery';
-
-jQuery('.weighting-settings input[type=range]').on('input', function () {
- const el = jQuery(this);
-
- el.prev('label').find('.weighting-value').text(el.val());
-});
-
-jQuery('.weighting-settings .searchable input[type=checkbox]').change(function () {
- const $checkbox = jQuery(this);
- const $rangeInput = $checkbox.parent().next('.weighting').find('input[type=range]');
- const $weightDisplay = $rangeInput.prev('label').find('.weighting-value');
-
- // toggle range input
- $rangeInput.prop('disabled', !this.checked);
-
- // get new weight display value, and set it
- const newWeightDisplay = !this.checked ? '0' : $rangeInput.val();
- $weightDisplay.text(newWeightDisplay);
-});
diff --git a/lib/elasticpress/dist/css/autosuggest-styles.min.asset.php b/lib/elasticpress/dist/css/autosuggest-styles.min.asset.php
deleted file mode 100644
index 94e3af6..0000000
--- a/lib/elasticpress/dist/css/autosuggest-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => '26e3c1cd915b73e742ab41d02cd86563');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/autosuggest-styles.min.css b/lib/elasticpress/dist/css/autosuggest-styles.min.css
deleted file mode 100644
index 4453af2..0000000
--- a/lib/elasticpress/dist/css/autosuggest-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.ep-autosuggest-container{position:relative}.ep-autosuggest-container .ep-autosuggest{background:#fff;border:1px solid #ccc;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px rgba(0,0,0,.2);display:none;position:absolute;width:100%;z-index:200}.ep-autosuggest-container .ep-autosuggest>ul{list-style:none;margin:0!important}.ep-autosuggest-container .ep-autosuggest>ul>li{font-family:sans-serif}.ep-autosuggest-container .ep-autosuggest>ul>li>a.autosuggest-link{color:#000;cursor:pointer;display:block;padding:2px 10px}.ep-autosuggest-container .ep-autosuggest>ul>li>a.autosuggest-link:active,.ep-autosuggest-container .ep-autosuggest>ul>li>a.autosuggest-link:hover{background-color:#eee;text-decoration:none}.ep-autosuggest-container .selected{background-color:#eee;text-decoration:none}
diff --git a/lib/elasticpress/dist/css/comments-styles.min.asset.php b/lib/elasticpress/dist/css/comments-styles.min.asset.php
deleted file mode 100644
index 0766678..0000000
--- a/lib/elasticpress/dist/css/comments-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => 'd5cf29bd60b0dd4480724d7b606e458f');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/comments-styles.min.css b/lib/elasticpress/dist/css/comments-styles.min.css
deleted file mode 100644
index 421ce00..0000000
--- a/lib/elasticpress/dist/css/comments-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.ep-widget-search-comments-results{list-style-type:none;margin-left:0}.ep-widget-search-comments-result-item,.ep-widget-search-comments-result-item-not-found{margin-left:0}.ep-widget-search-comments-result-item.selected a{border:2px dotted #171923}
diff --git a/lib/elasticpress/dist/css/dashboard-styles.min.asset.php b/lib/elasticpress/dist/css/dashboard-styles.min.asset.php
deleted file mode 100644
index d495485..0000000
--- a/lib/elasticpress/dist/css/dashboard-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => '7c1412d29cdf1a058244dad9ebf91fbf');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/dashboard-styles.min.css b/lib/elasticpress/dist/css/dashboard-styles.min.css
deleted file mode 100644
index 97bf2e1..0000000
--- a/lib/elasticpress/dist/css/dashboard-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.a11y-tip{display:inline-block;position:relative}.a11y-tip__trigger[tabindex]{border-bottom:1px dotted #666}.a11y-tip__trigger[aria-describedby]:hover+.a11y-tip__help,.a11y-tip__trigger[aria-describedby]:hover+.a11y-tip__help:after,.a11y-tip__trigger[aria-describedby]:not(.a11y-tip__trigger--toggle):focus+.a11y-tip__help,.a11y-tip__trigger[aria-describedby]:not(.a11y-tip__trigger--toggle):focus+.a11y-tip__help:after,.a11y-tip__trigger[aria-describedby][aria-expanded=true] .a11y-tip__help,.a11y-tip__trigger[aria-describedby][aria-expanded=true] .a11y-tip__help:after{opacity:1;pointer-events:auto;-webkit-transform:translate(-50%);transform:translate(-50%);visibility:visible}@media screen and (min-width:40.625em){.a11y-tip__trigger[aria-describedby]:hover+.a11y-tip__help--left,.a11y-tip__trigger[aria-describedby]:hover+.a11y-tip__help--left:after,.a11y-tip__trigger[aria-describedby]:hover+.a11y-tip__help--right,.a11y-tip__trigger[aria-describedby]:hover+.a11y-tip__help--right:after,.a11y-tip__trigger[aria-describedby]:not(.a11y-tip__trigger--toggle):focus+.a11y-tip__help--left,.a11y-tip__trigger[aria-describedby]:not(.a11y-tip__trigger--toggle):focus+.a11y-tip__help--left:after,.a11y-tip__trigger[aria-describedby]:not(.a11y-tip__trigger--toggle):focus+.a11y-tip__help--right,.a11y-tip__trigger[aria-describedby]:not(.a11y-tip__trigger--toggle):focus+.a11y-tip__help--right:after,.a11y-tip__trigger[aria-describedby][aria-expanded=true] .a11y-tip__help--left,.a11y-tip__trigger[aria-describedby][aria-expanded=true] .a11y-tip__help--left:after,.a11y-tip__trigger[aria-describedby][aria-expanded=true] .a11y-tip__help--right,.a11y-tip__trigger[aria-describedby][aria-expanded=true] .a11y-tip__help--right:after{-webkit-transform:translateY(-50%);transform:translateY(-50%)}}.a11y-tip__trigger[aria-describedby].a11y-tip__trigger--toggle:hover+.a11y-tip__help,.a11y-tip__trigger[aria-describedby].a11y-tip__trigger--toggle:hover+.a11y-tip__help:after{opacity:0;pointer-events:none;visibility:hidden}.a11y-tip__trigger[aria-expanded=true].a11y-tip__trigger--toggle:hover+.a11y-tip__help,.a11y-tip__trigger[aria-expanded=true].a11y-tip__trigger--toggle:hover+.a11y-tip__help:after{opacity:1!important;pointer-events:auto!important;-webkit-transition:opacity .18s ease-in-out,-webkit-transform .18s ease-in-out;transition:opacity .18s ease-in-out,-webkit-transform .18s ease-in-out;transition:opacity .18s ease-in-out,transform .18s ease-in-out;transition:opacity .18s ease-in-out,transform .18s ease-in-out,-webkit-transform .18s ease-in-out;visibility:visible!important}.a11y-tip--no-delay .a11y-tip__help,.a11y-tip--no-delay .a11y-tip__help:after{-webkit-transition:opacity .18s ease-in-out,-webkit-transform .18s ease-in-out;transition:opacity .18s ease-in-out,-webkit-transform .18s ease-in-out;transition:opacity .18s ease-in-out,transform .18s ease-in-out;transition:opacity .18s ease-in-out,transform .18s ease-in-out,-webkit-transform .18s ease-in-out}[role=tooltip].a11y-tip__help{background:rgba(0,0,0,.9);border-radius:4px;color:#fff;font-size:14px;margin-top:9pt;max-width:25pc;min-width:220px;padding:.5em 1em;text-align:left;top:100%;width:100%}[role=tooltip].a11y-tip__help,[role=tooltip].a11y-tip__help:after{left:50%;opacity:0;pointer-events:none;position:absolute;-webkit-transform:translate(-50%,10px);transform:translate(-50%,10px);-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition:opacity .2s ease-in-out 1s;transition:opacity .2s ease-in-out 1s;visibility:hidden;z-index:10}[role=tooltip].a11y-tip__help:after{speak:none;border:6px inset transparent;border-bottom:6px solid rgba(0,0,0,.9);bottom:100%;content:"";display:inline-block;height:0;margin-top:6px;width:0}[role=tooltip].a11y-tip__help--top{bottom:100%;left:50%;margin-bottom:9pt;margin-top:0;top:auto;-webkit-transform:translate(-50%,10px);transform:translate(-50%,10px);-webkit-transform-origin:center top;transform-origin:center top}[role=tooltip].a11y-tip__help--top:after{speak:none;border:6px inset transparent;border-top:6px solid rgba(0,0,0,.9);content:"";display:inline-block;height:0;left:50%;margin-bottom:6px;margin-top:0;top:100%;-webkit-transform:translate(-50%,-10px);transform:translate(-50%,-10px);-webkit-transform-origin:center top;transform-origin:center top;width:0}@media screen and (min-width:40.625em){[role=tooltip].a11y-tip__help--left{left:auto;margin-right:11px;margin-top:0;right:100%;top:50%;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%)}[role=tooltip].a11y-tip__help--left:after{speak:none;border:6px inset transparent;border-left:6px solid rgba(0,0,0,.9);content:"";display:inline-block;height:0;left:100%;margin-right:5px;margin-top:0;top:50%;-webkit-transform:translate(-10px,-50%);transform:translate(-10px,-50%);width:0}[role=tooltip].a11y-tip__help--right{left:100%;margin-left:11px;margin-top:0;top:50%;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%)}[role=tooltip].a11y-tip__help--right:after{speak:none;border:6px inset transparent;border-right:6px solid rgba(0,0,0,.9);bottom:auto;content:"";display:inline-block;height:0;left:auto;margin-left:5px;margin-top:0;right:100%;top:50%;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%);width:0}}.a11y-tip--hide~.a11y-tip__help{display:none}.no-js .a11y-tip__help:not([role]){font-size:.85em}.no-js .a11y-tip__help:not([role]):before{content:"("}.no-js .a11y-tip__help:not([role]):after{content:")"}:root{--statusOk:#6aa000;--statusWarning:#e3e600;--statusError:red}html.wp-toolbar{background:transparent}.wrap .notice,.wrap>h2{position:relative;z-index:2}.wrap h1{font-size:23px;font-weight:400;line-height:29px;margin:0;padding:9px 0 4px}.wrap h2{color:#888;line-height:1.75;margin:.5em 0 .75em}#wpbody #update-nag,#wpbody .update-nag{margin-bottom:20px;margin-left:-20px;margin-top:0;width:100%}h2.ep-list-features{display:none}.ep-header-menu{background-color:#fff;border-bottom:2px solid #ddd;margin-left:-20px;padding-bottom:5px;padding-left:20px;padding-right:20px;padding-top:5px;position:relative;z-index:2}.ep-header-menu:after{clear:both;content:" ";display:block}.ep-header-menu img{float:left}.ep-header-menu .icons{display:inline-block;float:right;height:39px;line-height:39px;padding-right:3px}.ep-header-menu .icons a{color:inherit;cursor:pointer;font-size:27px;margin-left:8px;position:relative;top:-3px;vertical-align:middle}.ep-header-menu .icons .dashicons-admin-generic,.ep-header-menu .icons .dashicons-controls-pause,.ep-header-menu .icons .dashicons-controls-play,.ep-header-menu .icons .dashicons-no,.ep-header-menu .icons .dashicons-update{font-size:30px;top:1px}.ep-header-menu .cancel-sync,.ep-header-menu .pause-sync,.ep-header-menu .resume-sync{display:none}.ep-header-menu .sync-status{bottom:-1px;color:#666;display:none;font-style:italic;margin-right:8px;position:relative;vertical-align:middle}.ep-header-menu .progress-bar{background-color:#d84440;bottom:0;height:5px;left:0;margin-bottom:-5px;position:absolute}.ep-header-menu .icons .dashicons-admin-generic,.ep-header-menu .icons .dashicons-update{display:inline}.ep-features{overflow:auto}.error-overlay.cant-connect,.error-overlay.syncing{background-color:#fff;bottom:0;content:" ";display:block;left:0;opacity:.6;position:fixed;right:0;top:46px;z-index:1}@media (min-width:880px){.error-overlay,.error-overlay.cant-connect,.error-overlay.syncing{left:10pc;top:2pc}}.ep-feature .postbox{margin-bottom:0}.ep-feature .postbox .hndle{cursor:inherit}.ep-feature .postbox .hndle .settings-button{background-color:#efefef;border:none;border-radius:4px;color:inherit;cursor:pointer;display:inline-block;float:right;font-size:13px;font-weight:400;line-height:inherit;margin-top:-4px;padding:4px 7px;padding-left:23px;position:relative}.ep-feature .settings-button:before{color:#72777c;content:"\f140";display:inline-block;font:400 19px/1 dashicons;left:1px;padding:0 5px 0 0;position:absolute;top:4px;vertical-align:middle}.ep-feature .settings-button:after{border-radius:50%;content:" ";display:inline-block;height:8px;margin-left:10px;margin-top:-2px;vertical-align:middle;width:8px}.feature-requirements-status-2.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid red;border:1px solid var(--statusError)}.feature-requirements-status-2.ep-feature .settings .requirements-status-notice{border-color:red;border-color:var(--statusError)}.feature-requirements-status-1.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #e3e600;border:1px solid var(--statusWarning)}.feature-requirements-status-1.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#e3e600;background-color:var(--statusWarning)}.feature-requirements-status-1.ep-feature .settings .requirements-status-notice{border-color:#e3e600;border-color:var(--statusWarning)}.feature-requirements-status-0.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #6aa000;border:1px solid var(--statusOk)}.feature-requirements-status-0.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#6aa000;background-color:var(--statusOk)}.feature-requirements-status-0.ep-feature .settings .requirements-status-notice{border-color:#6aa000;border-color:var(--statusOk)}.ep-feature{margin-bottom:20px;position:relative;vertical-align:top}.ep-feature.saving .action-wrap:before{-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite;border-bottom:5px solid #ccc;border-left:5px solid #999;border-radius:50%;border-right:5px solid #ccc;border-top:5px solid #ccc;content:" ";display:inline-block;font-size:7px;height:8px;margin-right:1.4em;position:relative;text-indent:-9999em;top:4px;-webkit-transform:translateZ(0);transform:translateZ(0);vertical-align:middle;width:8px}.ep-feature .description,.ep-feature .settings{margin-bottom:0;text-align:left}.ep-feature .settings{display:none;overflow:auto}.ep-feature .settings h3{font-size:inherit;font-weight:700;margin-top:0}.ep-feature.show-settings .settings{display:block}.ep-feature.show-settings .description{display:none}.ep-feature.show-settings .settings-button:before{content:"\f142"}.ep-feature .settings .requirements-status-notice{background-color:#efefef;border-left:4px solid #6aa000;border-left:4px solid var(--statusOk);margin-bottom:10px;padding:8px 9pt}.ep-feature .settings .requirements-status-notice.requirements-status-notice--reindex{border-color:#e3e600;border-color:var(--statusWarning);display:none}.ep-feature .settings .action-wrap{clear:both;padding-top:15px;text-align:right;vertical-align:middle}.ep-feature .settings .action-wrap a{cursor:pointer;display:inline-block}.ep-feature .settings .action-wrap .no-dash-sync{color:#aaa;display:none;line-height:27px;padding-right:8px}.ep-feature .settings .action-wrap a.disabled{cursor:default}.ep-feature .settings .action-wrap .cancel{margin-right:6px;margin-top:4px}.ep-feature.dash-sync-disabled .settings .action-wrap .no-dash-sync{display:inline}.ep-feature .settings .field{clear:both;overflow:visible;overflow:initial;padding-top:15px}.ep-feature .settings .field:first-child{padding-top:0}.ep-feature .settings .field label{display:inline-block;margin:.25em 0 .5em}.ep-feature .settings .field div{padding-top:5px}.ep-feature .settings .field .field-name,.ep-feature .settings .field>label{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;float:left;padding-right:1.5em;width:25%}.ep-feature .settings .field .input-wrap{display:block;float:right;width:75%}.ep-feature .settings .field .field-description{color:#666;font-style:italic;margin-bottom:0;margin-top:4px}.ep-feature .settings .field .disabled{color:#bbb}.ep-feature .settings .field .disabled input{cursor:default}.ep-feature .settings .field .components-form-token-field{padding-top:0}.ep-feature .settings .field .components-form-token-field__label{margin-top:0}.ep-feature .settings .field .components-form-token-field__input-container{padding:2px 4px}.ep-feature .long{display:none}.ep-feature .long p:last-child{margin-bottom:0}.ep-feature.show-full .long{display:block}.ep-feature.show-full .learn-more{display:none}.ep-feature .learn-more:after{content:"\f140";font-family:dashicons;font-size:1.5em;line-height:1;position:relative;top:-.07em;vertical-align:middle}.ep-feature .collapse:after{content:"\f142";font-family:dashicons;font-size:1.5em;line-height:1;position:relative;top:-.07em;vertical-align:middle}.intro h2{line-height:1.2;padding:9px 0 4px 0}.intro h1{color:#626262;font-weight:600;margin:.5em 0 2em;text-align:center}.intro-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:center;-ms-flex-pack:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;justify-content:center;position:relative;text-align:center}@media (min-width:880px){.intro-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}}@media (min-width:1270px){.intro-container{margin-left:10%;margin-right:10%}}.intro-container h2{color:#626262;height:8%}.intro-container p{margin-left:auto;margin-right:auto;max-width:300px}.ep-feature-list{display:inline-block;margin:0;text-align:left;vertical-align:top}.ep-feature-list li{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;margin:4px 3px}.ep-feature-list .a11y-tip__help--top[role=tooltip]{font-size:inherit}.ep-feature-info{text-decoration:none}.ep-feature-info .dashicons{font-size:14px;position:relative;top:2px}.intro-box{-webkit-box-flex:2;-ms-flex-positive:2;flex-grow:2;margin-bottom:2em}.intro-container-success{-webkit-box-pack:center;-ms-flex-pack:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-content:center;text-align:center}.intro-container-success p{margin-top:23px;padding:0 35% 0 35%}@media (max-width:880px){.intro-container-success p{margin-top:23px;padding:0 26%}}.ep-config-success span{font-size:6em;padding-right:75px}.setup-complete{font-size:2em;margin-top:0;padding-top:0;width:100%}.setup-complete h2{margin-top:0;padding-top:0}@media (min-width:880px){.ep-copy-text{padding:0 9% 0 9%}}.ep-copy-text a{font-weight:700}.ep-circle{background:#fff;border-radius:50%;color:#626262;display:inline-block;font-size:1pc;font-weight:400;height:6em;line-height:2.8em;margin:0 1em;text-align:center;width:6em}.ep-circle p{border:0;font-size:50px;font-weight:700;line-height:.5em;margin:0}@media (min-width:880px){.ep-circle--first:after{background:#d4d4d4;content:"";height:.2em;left:50%;position:absolute;top:2.9em;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:75%;z-index:-1}}.ep-circle--active{background-color:#d73c38;color:#fff}@media (min-width:880px){.wrap h1{line-height:1.75}}.wrap.intro{margin-bottom:30px;margin-top:30px;overflow:auto}.wrap.intro .error,.wrap.intro .is-dismissible,.wrap.intro .notice,.wrap.intro .updated{display:none!important}.features-screenshot{display:none}.setup-message{clear:both;text-align:center}.setup-button{-webkit-appearance:none;background-color:#e63e3b;border:none;border-radius:10px;-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.25);box-shadow:1px 1px 3px 1px rgba(0,0,0,.25);color:#fff;display:inline-block;margin:0 .75em;padding:1em 1.5em;text-decoration:none}.setup-button:hover{background-color:#b93431;color:#ffe8ed}.setup-message .setup-button-primary{background-color:#fff;color:#d84440}.weighting-settings .postbox{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.weighting-settings .postbox *{-webkit-box-sizing:border-box;box-sizing:border-box}.weighting-settings .postbox h2.hndle{color:#444;cursor:inherit}.weighting-settings fieldset{padding:10px}.weighting-settings fieldset legend{float:left;position:relative;top:5px;width:75pt}.weighting-settings fieldset p{display:inline-block;float:left;margin:0}.weighting-settings .field-group{margin:10px 0 0}.weighting-settings .field-group h3{font-size:1em;margin:10px}.weighting-settings .fields>fieldset:nth-of-type(odd){background:#f9f9f9}.weighting-settings .searchable{display:inline-block;width:90pt}.weighting-settings .weighting{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.weighting-settings .weighting label{margin-right:10px;min-width:5pc}.weighting-settings input[type=range]{-webkit-appearance:none;background:transparent;display:inline-block;height:1em;margin:0;vertical-align:middle;width:200px}.weighting-settings input[type=range]:focus{outline:none}.weighting-settings input[type=range]:disabled{opacity:.5;pointer-events:none}.weighting-settings input[type=range]::-webkit-slider-runnable-track{background:#ddd;border:0 solid #000;border-radius:1px;-webkit-box-shadow:0 0 0 #000;box-shadow:0 0 0 #000;cursor:pointer;height:3px;width:100%}.weighting-settings input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:#1e8cbe;border:1px solid #1e8cbe;border-radius:25px;-webkit-box-shadow:0 0 0 #000;box-shadow:0 0 0 #000;cursor:pointer;height:14px;margin-top:-6px;width:14px}.weighting-settings input[type=range]:focus::-webkit-slider-runnable-track{background:#ddd}.weighting-settings input[type=range]:focus::-webkit-slider-thumb{background:#fff!important}.weighting-settings input[type=range]::-moz-range-track{background:#1e8cbe;border:0 solid #000;border-radius:1px;box-shadow:0 0 0 #000;cursor:pointer;height:3px;width:100%}.weighting-settings input[type=range]::-moz-range-thumb{background:#1e8cbe;border:1px solid #1e8cbe;border-radius:25px;box-shadow:0 0 0 #000;cursor:pointer;height:14px;width:14px}.weighting-settings input[type=range]::-ms-track{background:transparent;border-color:transparent;color:transparent;cursor:pointer;height:3px;width:100%}.weighting-settings input[type=range]::-ms-fill-lower{background:#1e8cbe;border:0 solid #000;border-radius:2px;box-shadow:0 0 0 #000}.weighting-settings input[type=range]::-ms-fill-upper{background:#1e8cbe;border:0 solid #000;border-radius:2px;box-shadow:0 0 0 #000}.weighting-settings input[type=range]::-ms-thumb{background:#a1d0ff;border:1px solid #1e8cbe;border-radius:25px;box-shadow:0 0 0 #000;cursor:pointer;height:14px;margin-top:1px;width:14px}.weighting-settings input[type=range]:focus::-ms-fill-lower{background:#1e8cbe}.weighting-settings input[type=range]:focus::-ms-fill-upper{background:#1e8cbe}.ep-feature-search .wp-color-result.button{margin-bottom:10px}.ep-feature.ep-feature-search .settings .wp-picker-input-wrap>label{margin-right:10px;margin-top:0}.ep-feature.ep-feature-search .settings.wp-picker-input-wrap label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.ep-feature.ep-feature-search .settings .wp-picker-open+.wp-picker-input-wrap{display:-webkit-box;display:-ms-flexbox;display:flex}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@media (min-width:880px){.intro .left{float:left;width:30%}.features-screenshot{display:block;float:right;height:auto;margin:0 auto;max-width:750pt;width:70%}.ep-features .left{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;float:left;padding-right:10px;width:50%}.ep-features .right{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;float:right;padding-left:10px;width:50%}.ep-feature .feature-message{display:inline-block;float:left;padding:0;padding-top:.5em;vertical-align:middle}}.wrap h2.nav-tab-wrapper.ep-credentials-tabs{border-bottom:1px solid #ccc}.ep-credentials input[type=text]{min-width:250px}h2 .nav-tab.ep-credentials-tab{cursor:pointer;margin-bottom:-1px}.ep-credentials-tab.nav-tab-active{border-bottom-color:#f1f1f1}.ep-credentials-tab img,.ep-credentials-tab span{display:inline-block;vertical-align:middle}.ep-credentials fieldset{border-bottom:1px solid #ccc;border-left:1px solid #ccc;border-right:1px solid #ccc;margin:0;padding:0 1rem}.ep-credentials fieldset.predefined{border-top:1px solid #ccc}.ep-settings .description{font-size:.75rem;font-style:italic}@media (min-width:880px){.ep-credentials{display:inline-block}.ep-credentials .form-table{width:auto}.ep-credentials .form-table td{padding-left:0}}.ep-flex-container{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%}.ep-flex-container-nowrap{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.stats-list{margin-right:0;width:100%}@media (min-width:1270px){.stats-list{background-color:#fff;margin-right:28px;width:37%}}.stats-queries{background-color:#fff;width:100%}@media (min-width:1270px){.stats-queries{width:60%}}.stats-list-th span:last-of-type{border-radius:4px;color:inherit;cursor:pointer;display:inline-block;float:right;font-size:13px;margin-top:-4px;padding:4px 7px;padding-left:23px;position:relative}.status-circle{float:right;text-transform:capitalize}.status-circle:after{border-radius:50%;content:" ";display:inline-block;height:8px;margin-left:10px;margin-top:-2px;vertical-align:middle;width:8px}.green-status{color:#6aa000;color:var(--statusOk)}.yellow-status{color:#e3e600;color:var(--statusWarning)}.red-status{color:red;color:var(--statusError)}.green-status:after{background-color:#6aa000;background-color:var(--statusOk)}.yellow-status:after{background-color:#e3e600;background-color:var(--statusWarning)}.red-status:after{background-color:red;background-color:var(--statusError)}.doc-chart{margin-right:0;width:100%}@media (min-width:880px){.doc-chart{margin-right:24px;width:48%}}@media (min-width:1270px){.doc-chart{margin-right:28px;width:50%}}.ep-qchart-container{margin:0 auto;width:90%}@media (min-width:880px){.ep-qchart-container{width:48%}}@media (min-width:1270px){.ep-qchart-container{margin:0 auto;width:50%}}.inside-totals{padding:0 9pt 9pt}.ep-totals{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%}@media (min-width:880px){.ep-totals{width:48%}}@media (min-width:1270px){.ep-totals{width:47%}}.ep-totals .ep-flex-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:center;-ms-flex-pack:center;-ms-flex-direction:column;flex-direction:column;justify-content:center;margin-bottom:auto;margin-top:auto}@media (min-width:1270px){.ep-totals .ep-flex-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}}.ep-totals-column{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;width:100%}@media (min-width:1270px){.ep-totals-column{width:50%}}p.ep-totals-title{font-weight:bolder;margin-top:28px}p.ep-totals-data{font-size:3em;margin-top:22px}
diff --git a/lib/elasticpress/dist/css/facets-admin-styles.min.asset.php b/lib/elasticpress/dist/css/facets-admin-styles.min.asset.php
deleted file mode 100644
index 266a042..0000000
--- a/lib/elasticpress/dist/css/facets-admin-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => 'f8e36dd4c8462c8408ca6f064bb7d277');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/facets-admin-styles.min.css b/lib/elasticpress/dist/css/facets-admin-styles.min.css
deleted file mode 100644
index c816d52..0000000
--- a/lib/elasticpress/dist/css/facets-admin-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.widget-ep-facet label{margin-right:5px}
diff --git a/lib/elasticpress/dist/css/facets-styles.min.asset.php b/lib/elasticpress/dist/css/facets-styles.min.asset.php
deleted file mode 100644
index 2cf47a4..0000000
--- a/lib/elasticpress/dist/css/facets-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => '02a2c2436ec1a4c85887dfeac772bd63');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/facets-styles.min.css b/lib/elasticpress/dist/css/facets-styles.min.css
deleted file mode 100644
index b3c2a0b..0000000
--- a/lib/elasticpress/dist/css/facets-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.widget_ep-facet input[type=search]{margin-bottom:1rem}.widget_ep-facet .searchable .inner{max-height:20em;overflow:scroll}.widget_ep-facet .term.hide{display:none}.widget_ep-facet .empty-term{opacity:.5;position:relative}.widget_ep-facet .empty-term:after{bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0;width:100%;z-index:2}.widget_ep-facet .level-1{padding-left:20px}.widget_ep-facet .level-2{padding-left:40px}.widget_ep-facet .level-3{padding-left:60px}.widget_ep-facet .level-4{padding-left:5pc}.widget_ep-facet .level-5{padding-left:75pt}.widget_ep-facet input[disabled]{cursor:pointer;opacity:1}.widget_ep-facet .term a{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.ep-checkbox{-webkit-box-align:center;-ms-flex-align:center;-ms-flex-negative:0;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#eee;display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:1em;justify-content:center;margin-right:.25em;width:1em}.ep-checkbox:after{border:solid #fff;border-width:0 .125em .125em 0;content:"";display:none;height:.5em;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:.25em}.ep-checkbox.checked{background-color:#5e5e5e}.ep-checkbox.checked:after{display:block}.widget_ep-facet .term a:hover .ep-checkbox{background-color:#ccc}
diff --git a/lib/elasticpress/dist/css/highlighting-styles.min.asset.php b/lib/elasticpress/dist/css/highlighting-styles.min.asset.php
deleted file mode 100644
index ea62a95..0000000
--- a/lib/elasticpress/dist/css/highlighting-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => '48ac6df2f0406f2e2d5d4ea06f5759b5');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/highlighting-styles.min.css b/lib/elasticpress/dist/css/highlighting-styles.min.css
deleted file mode 100644
index 9a18e84..0000000
--- a/lib/elasticpress/dist/css/highlighting-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.ep-highlight{background-color:transparent;font-style:italic;font-weight:700}
diff --git a/lib/elasticpress/dist/css/instant-results-styles.min.asset.php b/lib/elasticpress/dist/css/instant-results-styles.min.asset.php
deleted file mode 100644
index 6c26536..0000000
--- a/lib/elasticpress/dist/css/instant-results-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => '4d9555f6e408050b54f5deb3b788ec0b');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/instant-results-styles.min.css b/lib/elasticpress/dist/css/instant-results-styles.min.css
deleted file mode 100644
index 579bb14..0000000
--- a/lib/elasticpress/dist/css/instant-results-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.ep-search-reset-button{font:inherit!important;height:auto!important;letter-spacing:inherit!important;line-height:1!important;margin:0!important;padding:0!important;text-align:inherit!important;text-transform:inherit!important;width:auto!important}.ep-search-reset-button,.ep-search-reset-button:focus,.ep-search-reset-button:hover{background:transparent!important;border:none!important;-webkit-box-shadow:none!important;box-shadow:none!important;color:inherit!important;cursor:default!important}.ep-search-reset-button:focus{outline:medium auto Highlight!important;outline:medium auto -webkit-focus-ring-color!important;outline-offset:0!important}.ep-search-small-button{font-size:.875em!important;height:auto!important;line-height:1!important;padding:.5em!important}.ep-search-icon-button{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between}.ep-search-icon-button svg{fill:currentColor;-ms-flex-negative:0;flex-shrink:0;height:1em;width:1em}.ep-search-checkbox__count:before{content:"("}.ep-search-checkbox__count:after{content:")"}.ep-search-input{font-size:1.25em;margin:0!important;width:100%}.has-ep-search-modal{overflow:hidden}.ep-search-modal{--ep-search-modal-focus-within:0;background-color:rgba(43,46,56,.9);bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;left:0;position:fixed;right:0;top:0;z-index:9999}.rtl .ep-search-modal{direction:rtl;text-align:right}.admin-bar .ep-search-modal{top:2pc}@media (max-width:782px){.admin-bar .ep-search-modal{top:46px}}.ep-search-modal[aria-hidden=true]{display:none}.ep-search-modal[focus-within]{--ep-search-modal-focus-within:1}.ep-search-modal:focus-within{--ep-search-modal-focus-within:1}.ep-search-modal__content{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#fff;background-color:var(--ep-search-background-color);bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:0;position:absolute;right:0;top:0}@media (min-width:768px){.ep-search-modal__content{bottom:1em;margin:0 auto;max-width:calc(100% - 2em);top:1em;width:80em}}.ep-search-modal__close{-ms-flex-item-align:end;align-self:flex-end;padding:1em!important}.ep-search-options-list{list-style:none;margin:0;padding:0}.ep-search-options-list__item{margin:.5em 0}.ep-search-options-list__item:before{content:none}.ep-search-options-list__sub-menu{padding-left:1em}.ep-search-page{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-flex:2;-ms-flex-positive:2;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;flex-grow:2;margin:0;overflow-y:auto;-webkit-transition:opacity .3s ease-out;transition:opacity .3s ease-out;width:100%}@media (min-width:768px){.ep-search-page{overflow:hidden}}.ep-search-page *,.ep-search-page :after,.ep-search-page :before{-webkit-box-sizing:border-box;box-sizing:border-box}.ep-search-page.is-loading{opacity:.5}.ep-search-page__body,.ep-search-page__header,.ep-search-page__tools{padding:0 1em}@media (min-width:768px){.ep-search-page__body{-webkit-box-align:start;-ms-flex-align:start;-webkit-box-flex:2;-ms-flex-positive:2;align-items:flex-start;display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:2;overflow:hidden}}.ep-search-panel{border:1px solid #dfdfdf;border:1px solid var(--ep-search-border-color);margin:0;padding:0}.ep-search-panel+.ep-search-panel{border-top-width:0}.ep-search-panel__heading{font-size:inherit;margin:0}.ep-search-panel__button{padding:1em!important;width:100%!important}.ep-search-panel__content{padding:0 1em 1em 1em}.ep-search-panel__content[aria-hidden=true]{display:none}.ep-search-pagination{-webkit-box-align:center;-ms-flex-align:center;-ms-grid-columns:1fr 1fr 1fr;align-items:center;display:-ms-grid;display:grid;grid-template-columns:1fr 1fr 1fr;margin-top:auto;text-align:center}.rtl .ep-search-pagination{direction:rtl}.ep-search-pagination__next{-ms-grid-column-align:end;justify-self:end}.ep-search-pagination__previous{-ms-grid-column-align:start;justify-self:start}.ep-search-range-slider{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;margin:.5em 0;min-height:1.625em;min-height:var(--ep-search-range-thumb-size)}.ep-search-range-slider__track{background:#efefef;background:var(--ep-search-alternate-background-color);border-radius:.375em;border-radius:calc(var(--ep-search-range-track-size)/2);height:.75em;height:var(--ep-search-range-track-size)}.ep-search-range-slider__track-1{background-color:currentColor}.ep-search-range-slider__thumb{background-color:currentColor;border-radius:.8125em;border-radius:calc(var(--ep-search-range-thumb-size)/2);-webkit-box-shadow:inset 0 0 0 .1625em currentColor,inset 0 0 0 .4375em #fff;box-shadow:inset 0 0 0 .1625em currentColor,inset 0 0 0 .4375em #fff;-webkit-box-shadow:inset 0 0 0 calc(var(--ep-search-range-thumb-size)/10) currentColor,inset 0 0 0 calc((var(--ep-search-range-thumb-size) - var(--ep-search-range-track-size))/2) var(--ep-search-background-color);box-shadow:inset 0 0 0 calc(var(--ep-search-range-thumb-size)/10) currentColor,inset 0 0 0 calc((var(--ep-search-range-thumb-size) - var(--ep-search-range-track-size))/2) var(--ep-search-background-color);height:1.625em;height:var(--ep-search-range-thumb-size);width:1.625em;width:var(--ep-search-range-thumb-size)}.ep-search-result{-webkit-box-align:start;-ms-flex-align:start;grid-gap:.5em;-ms-grid-rows:auto .5em 1fr;align-items:flex-start;display:-ms-grid;display:grid;grid-template-areas:"header" "footer";grid-template-rows:auto 1fr}@media (min-width:768px){.ep-search-result{grid-gap:1em;-ms-grid-rows:auto 1em auto 1em 1fr;grid-template-areas:"header" "description" "footer";grid-template-rows:auto auto 1fr}}.ep-search-result--has-thumbnail{-ms-grid-columns:min(300px,34%) auto;grid-template-areas:"thumbnail header" "thumbnail footer";grid-template-columns:min(300px,34%) auto}@media (min-width:768px){.ep-search-result--has-thumbnail{grid-template-areas:"thumbnail header" "thumbnail description" "thumbnail footer"}}.ep-search-result__thumbnail{-ms-grid-row-span:2;display:block;grid-area:thumbnail;-ms-grid-column:1;-ms-grid-row:1}.ep-search-result__thumbnail img{display:block;margin:0;width:100%}.ep-search-result__header{grid-gap:.5em;-ms-grid-columns:auto;display:-ms-grid;display:grid;grid-area:header;-ms-grid-column:1;-ms-grid-row:1;grid-template-columns:auto;justify-items:start}.ep-search-result--has-thumbnail>.ep-search-result__header{-ms-grid-column:2;-ms-grid-row:1}.ep-search-result__title{font-size:1em;margin:0}@media (min-width:768px){.ep-search-result__title{font-size:1.25em}}.ep-search-result__type{background-color:#efefef;background-color:var(--ep-search-alternate-background-color);border-radius:.25em;display:inline-block;font-size:.875em;line-height:1.5;padding:0 .25em;vertical-align:text-bottom}.ep-search-result__description{display:none;font-size:.875em;grid-area:description;margin:0}@media (min-width:768px){.ep-search-result__description{display:block;font-size:1em}}.ep-search-result__footer{grid-gap:.5em;display:-ms-grid;display:grid;grid-area:footer;-ms-grid-column:1;-ms-grid-row:3;justify-items:start}.ep-search-result--has-thumbnail>.ep-search-result__footer{-ms-grid-column:2;-ms-grid-row:2}@media (min-width:768px){.ep-search-result__thumbnail{-ms-grid-row-span:3;-ms-grid-column:1;-ms-grid-row:1}.ep-search-result__header{-ms-grid-column:1;-ms-grid-row:1}.ep-search-result--has-thumbnail>.ep-search-result__header{-ms-grid-column:2;-ms-grid-row:1}.ep-search-result__description{-ms-grid-column:1;-ms-grid-row:3}.ep-search-result__description{-ms-grid-column:2;-ms-grid-row:2}.ep-search-result__footer{-ms-grid-column:1;-ms-grid-row:5}.ep-search-result--has-thumbnail>.ep-search-result__footer{-ms-grid-column:2;-ms-grid-row:3}}.ep-search-results{grid-gap:2em;-ms-grid-columns:100%;-ms-grid-rows:-webkit-max-content;-ms-grid-rows:max-content;display:-ms-grid;display:grid;grid-template-columns:100%;grid-template-rows:-webkit-max-content;grid-template-rows:max-content;padding:0 0 1em 0;width:100%}@media (min-width:768px){.ep-search-results{height:100%;overflow-y:auto;padding:0 1em 1em 1em}}.ep-search-results__header{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;gap:1em;justify-content:space-between}.ep-search-results__title{font-size:1.25em;margin:0!important}@media (min-width:768px){.ep-search-results__title{font-size:1.5em}}.ep-search-sidebar{display:none;margin-bottom:2em}.ep-search-sidebar.is-open{display:block}@media (min-width:768px){.ep-search-sidebar{display:block;max-height:calc(100% - 1em);min-width:25%;overflow-y:auto}}.ep-search-sidebar-toggle{width:100%}@media (min-width:768px){.ep-search-sidebar-toggle{display:none}}.ep-search-sort{-ms-flex-negative:0;flex-shrink:0;gap:.5em;margin:0}.ep-search-results .ep-search-sort{display:none}@media (min-width:768px){.ep-search-results .ep-search-sort{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}}.ep-search-sidebar .ep-search-sort{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-bottom:1em}@media (min-width:768px){.ep-search-sidebar .ep-search-sort{display:none}}.ep-search-toolbar{-webkit-box-align:start;-ms-flex-align:start;align-items:start;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:.25em;margin:1em 0}@media (min-width:768px){.ep-search-toolbar{-webkit-box-align:center;-ms-flex-align:center;align-items:center}}:root{--ep-search-background-color:#fff;--ep-search-alternate-background-color:#efefef;--ep-search-border-color:#dfdfdf;--ep-search-range-thumb-size:1.625em;--ep-search-range-track-size:0.75em}@media (min-width:768px){:root{--ep-search-range-thumb-size:1.25em;--ep-search-range-track-size:0.5em}}
diff --git a/lib/elasticpress/dist/css/ordering-styles.min.asset.php b/lib/elasticpress/dist/css/ordering-styles.min.asset.php
deleted file mode 100644
index e08609a..0000000
--- a/lib/elasticpress/dist/css/ordering-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => '1310e7d723dab4632cfce851ad418485');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/ordering-styles.min.css b/lib/elasticpress/dist/css/ordering-styles.min.css
deleted file mode 100644
index fa5543f..0000000
--- a/lib/elasticpress/dist/css/ordering-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-#ep-ordering{border-left-width:0;border-right-width:0}#ep-ordering .inside{background-color:#f1f1f1;margin:0;padding:0}#ep-ordering .loading,#ep-ordering .pointer-search,#ep-ordering .pointers{background-color:#fff;border-left:1px solid #eee;border-right:1px solid #eee}#ep-ordering .new-post{background:#fff;padding:0 1em}#ep-ordering .loading{padding:1em}#ep-ordering .loading .spinner{float:left;margin-left:0;margin-top:0}#ep-ordering .pointer-type{border:2px solid #0073aa;border-radius:2px;color:#0073aa;display:inline-block;font-size:.75em;font-weight:700;margin-right:8px;padding:1px 2px}#ep-ordering .pointers .pointer,#ep-ordering .pointers .post{padding:1em}#ep-ordering .pointers .pointer:nth-child(odd),#ep-ordering .pointers .post:nth-child(odd){background-color:#f9f9f9}#ep-ordering .pointers .title{color:#0073aa}#ep-ordering .pointers .pointer-actions{float:right}#ep-ordering .pointers .pointer-actions .handle{cursor:move}#ep-ordering .pointers .pointer-actions .delete-pointer{margin-left:10px}#ep-ordering .pointers .next-page-notice{background-color:#fdeeca;padding:1em 0;text-align:center}#ep-ordering .legend{background:#fff;border-bottom:1px solid #eee;padding:1em 0;text-align:center}#ep-ordering .legend-item{display:inline-block;font-size:.875em;font-style:italic;margin:0 .5em}#ep-ordering .pointer-search{margin-top:2em}#ep-ordering .pointer-search .no-results{padding:1em}#ep-ordering .pointer-search .section-title{border-bottom:1px solid #eee;border-top:1px solid #eee;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);font-weight:700}#ep-ordering .pointer-search .search-wrapper{padding:1em 0}#ep-ordering .pointer-search .input-wrap{padding:0 1em}#ep-ordering .pointer-search .search-pointers{font-size:18px;height:1.7em;line-height:100%;padding:3px 8px}#ep-ordering .pointer-search .pointer-results{padding:1em 0 0}#ep-ordering .pointer-search .pointer-result{padding:10px 2em}#ep-ordering .pointer-search .pointer-result .dashicons{float:right}#ep-ordering .pointer-search .pointer-result:hover{background-color:#f9f9f9}#ep-ordering .add-pointer,#ep-ordering .delete-pointer{cursor:pointer}
diff --git a/lib/elasticpress/dist/css/related-posts-block-styles.min.asset.php b/lib/elasticpress/dist/css/related-posts-block-styles.min.asset.php
deleted file mode 100644
index e944c51..0000000
--- a/lib/elasticpress/dist/css/related-posts-block-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => '57ed3b8acc523fe9b9e9a53dae101978');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/related-posts-block-styles.min.css b/lib/elasticpress/dist/css/related-posts-block-styles.min.css
deleted file mode 100644
index 7addbc4..0000000
--- a/lib/elasticpress/dist/css/related-posts-block-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.editor-styles-wrapper .wp-block-elasticpress-related-posts ul,.wp-block-elasticpress-related-posts ul{list-style-type:none;padding:0}.editor-styles-wrapper .wp-block-elasticpress-related-posts ul li a>div{display:inline}
diff --git a/lib/elasticpress/dist/css/sites-admin-styles.min.asset.php b/lib/elasticpress/dist/css/sites-admin-styles.min.asset.php
deleted file mode 100644
index b18759b..0000000
--- a/lib/elasticpress/dist/css/sites-admin-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => 'd8a054f704ad38cde18f937e9b30d347');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/sites-admin-styles.min.css b/lib/elasticpress/dist/css/sites-admin-styles.min.css
deleted file mode 100644
index e497315..0000000
--- a/lib/elasticpress/dist/css/sites-admin-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.switch{display:inline-block;height:34px;position:relative;width:60px}.switch input{height:0;opacity:0;width:0}.slider{background-color:#ccc;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;-webkit-transition:.4s;transition:.4s}.slider:before{background-color:#fff;bottom:4px;content:"";height:26px;left:4px;position:absolute;-webkit-transition:.4s;transition:.4s;width:26px}input:checked+.slider{background-color:#2196f3}input:focus+.slider{-webkit-box-shadow:0 0 1px #2196f3;box-shadow:0 0 1px #2196f3}input:checked+.slider:before{-webkit-transform:translateX(26px);transform:translateX(26px)}.slider.round{border-radius:34px}.slider.round:before{border-radius:50%}.switch-label{padding-left:20px;padding-top:20px}
diff --git a/lib/elasticpress/dist/css/sync-styles.min.asset.php b/lib/elasticpress/dist/css/sync-styles.min.asset.php
deleted file mode 100644
index a95bf22..0000000
--- a/lib/elasticpress/dist/css/sync-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => '0f2b1196a3e65ef4da1a162d7de0344c');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/sync-styles.min.css b/lib/elasticpress/dist/css/sync-styles.min.css
deleted file mode 100644
index f344d16..0000000
--- a/lib/elasticpress/dist/css/sync-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-:root{--ep-admin-color-base-white:#fff;--ep-admin-color-blue-01:#00a0d2;--ep-admin-color-grey-01:#f1f1f1;--ep-admin-color-green-01:#46b450;--ep-admin-color-red-01:#b52727;--ep-admin-color-dark-01:#333;--ep-admin-max-width:1200px;--ep-admin-box-title:#1d2327;--ep-admin-delete-sync-button-bg-color:rgba(181,39,39,.03);--ep-admin-progress-bar-bg-color:rgba(0,160,210,.3);--ep-admin-output-tab-color:#1e1e1e;--ep-admin-log-bg-color:#1a1e24;--ep-admin-log-line-number-color:#999;--ep-admin-log-line-number-bg-color:#303030}.elasticpress_page_elasticpress-sync .button:disabled{cursor:not-allowed}.ep-sync-box__progress-wrapper{display:none}.ep-sync-box__output{background-color:#1a1e24;background-color:var(--ep-admin-log-bg-color);display:none;margin-bottom:20px;max-height:200px;overflow-y:scroll;position:relative}.ep-sync-box__output_active{display:block}.ep-sync-box__output-wrapper{color:#fff;color:var(--ep-admin-color-base-white);margin-left:30px;min-height:200px}.ep-sync-box__output-line{position:relative}.ep-sync-box__output-line-number{background-color:#303030;background-color:var(--ep-admin-log-line-number-bg-color);color:#999;color:var(--ep-admin-log-line-number-color);left:-30px;min-width:20px;padding:0 3px 0 5px;position:absolute;text-align:right;white-space:nowrap}.ep-sync-box__output-line-text{font-size:9pt;padding-left:14px}.ep-sync-box__output-tabs{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.ep-sync-box__output-tabs_hide{display:none}.ep-sync-box__output-tab{color:#1e1e1e;color:var(--ep-admin-output-tab-color);padding:1pc}.ep-sync-box__output-tab:hover{cursor:pointer}.ep-sync-box__output-tab_active{border-bottom:4px solid #00a0d2;border-bottom:4px solid var(--ep-admin-color-blue-01);padding-bottom:9pt}.ep-sync-box__output-tab_active:hover{cursor:default}.ep-sync-box__button-text{height:21px}.elasticpress_page_elasticpress-sync .card{max-width:75pc;max-width:var(--ep-admin-max-width)}.elasticpress_page_elasticpress-sync .card .ep-sync-box__description-actions{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}@media (min-width:768px){.elasticpress_page_elasticpress-sync .card .ep-sync-box__description-actions{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:justify;-ms-flex-pack:justify;-ms-flex-direction:row;flex-direction:row;justify-content:space-between}}@media (min-width:768px){.elasticpress_page_elasticpress-sync .card .ep-sync-box__description{width:69%}}.elasticpress_page_elasticpress-sync .card .ep-sync-box__action{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-top:40px}@media (min-width:768px){.elasticpress_page_elasticpress-sync .card .ep-sync-box__action{width:30%}}.elasticpress_page_elasticpress-sync .card .ep-sync-box__action .ep-sync-box__button{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:24px;font-weight:700;height:68px;justify-content:space-between;padding:20px 40px;width:228px}.elasticpress_page_elasticpress-sync .card .ep-sync-box__action .ep-sync-box__icon-button{font-size:28px;height:28px;width:28px}.elasticpress_page_elasticpress-sync .card .ep-sync-box__action .ep-sync-box__learn-more-link{margin-top:19px}.elasticpress_page_elasticpress-sync .card .ep-sync-box__description_text{font-size:18px}.elasticpress_page_elasticpress-sync .card .ep-last-sync{margin-bottom:9pt}.elasticpress_page_elasticpress-sync .card .ep-last-sync__title{font-size:20px;font-weight:700;margin-bottom:.5em}.elasticpress_page_elasticpress-sync .card .ep-last-sync__date{background-color:#f1f1f1;background-color:var(--ep-admin-color-grey-01);padding:6px}.elasticpress_page_elasticpress-sync .card .ep-sync-box__buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.elasticpress_page_elasticpress-sync .card .ep-sync-box__button-pause,.elasticpress_page_elasticpress-sync .card .ep-sync-box__button-resume,.elasticpress_page_elasticpress-sync .card .ep-sync-box__button-stop{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:none;-ms-flex-direction:column;flex-direction:column;height:68px;justify-content:center;width:75pt}.elasticpress_page_elasticpress-sync .card .ep-sync-box__button-stop{background-color:#00a0d2;background-color:var(--ep-admin-color-blue-01);border-color:#00a0d2;border-color:var(--ep-admin-color-blue-01);margin-left:24px}.elasticpress_page_elasticpress-sync .card .ep-sync-box__progress{-webkit-box-align:normal;-ms-flex-align:normal;-webkit-box-orient:vertical;-webkit-box-direction:normal;align-items:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-bottom:5px;margin-top:19px}@media (min-width:768px){.elasticpress_page_elasticpress-sync .card .ep-sync-box__progress{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;align-items:center;-ms-flex-direction:row;flex-direction:row}}.elasticpress_page_elasticpress-sync .card .ep-sync-box__sync-in-progress{-webkit-box-orient:horizontal;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}@media (min-width:768px){.elasticpress_page_elasticpress-sync .card .ep-sync-box__sync-in-progress{width:30%}}.elasticpress_page_elasticpress-sync .card .ep-sync-box__progressbar{background-color:#f1f1f1;background-color:var(--ep-admin-color-grey-01);border-radius:24px;height:20px;margin:15px 0;position:relative;width:100%}@media (min-width:768px){.elasticpress_page_elasticpress-sync .card .ep-sync-box__progressbar{margin:0;width:65%}}.elasticpress_page_elasticpress-sync .card .ep-sync-box__progressbar_animated{background-color:rgba(0,160,210,.3);background-color:var(--ep-admin-progress-bar-bg-color);color:#333;color:var(--ep-admin-color-dark-01);display:block;height:100%;margin:0;text-align:center;-webkit-transition:width .5s ease-in-out;transition:width .5s ease-in-out;width:0}.elasticpress_page_elasticpress-sync .card .ep-sync-box__progressbar_complete{background-color:#46b450;background-color:var(--ep-admin-color-green-01);color:#fff;color:var(--ep-admin-color-base-white)}.elasticpress_page_elasticpress-sync .card .ep-sync-box__sync-in-progress-info{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:9pt}.elasticpress_page_elasticpress-sync .card .ep-sync-box__progress-info{font-size:14px;font-weight:500;margin-bottom:5px}.elasticpress_page_elasticpress-sync .card .ep-sync-box__start-time{color:#00a0d2;color:var(--ep-admin-color-blue-01);font-size:14px}.elasticpress_page_elasticpress-sync .card .ep-sync-box__start-time-date{color:#333;color:var(--ep-admin-color-dark-01)}.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync{margin-top:40px}.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .card{margin-top:17px}.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-delete-data-and-sync__title{color:#1d2327;color:var(--ep-admin-box-title);font-size:18px;font-weight:400}.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-delete-data-and-sync__warning{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;display:-webkit-box;display:-ms-flexbox;display:flex}@media (min-width:768px){.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-delete-data-and-sync__warning{width:69%}}.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-delete-data-and-sync__warning-icon{margin-right:9px;margin-top:17px}.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-delete-data-and-sync__button{background-color:rgba(181,39,39,.03);background-color:var(--ep-admin-delete-sync-button-bg-color);border:1px solid #b52727;border:1px solid var(--ep-admin-color-red-01);color:#b52727;color:var(--ep-admin-color-red-01);margin:5px 0 9pt}.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-delete-data-and-sync__button-cancel{display:none}.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-sync-box__action{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:center;-ms-flex-pack:center;-ms-flex-direction:column;flex-direction:column;height:auto;justify-content:center;margin-top:0;width:100%}@media (min-width:768px){.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-sync-box__action{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:justify;-ms-flex-pack:justify;-ms-flex-direction:row;flex-direction:row;height:68px;justify-content:space-between}}@media (min-width:768px){.elasticpress_page_elasticpress-sync .ep-delete-data-and-sync .ep-sync-box__buttons{margin-right:5%}}
diff --git a/lib/elasticpress/dist/css/synonyms-styles.min.asset.php b/lib/elasticpress/dist/css/synonyms-styles.min.asset.php
deleted file mode 100644
index 8be9924..0000000
--- a/lib/elasticpress/dist/css/synonyms-styles.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array(), 'version' => 'd080204bc90eda211961edfc1602e1e4');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/css/synonyms-styles.min.css b/lib/elasticpress/dist/css/synonyms-styles.min.css
deleted file mode 100644
index a018e87..0000000
--- a/lib/elasticpress/dist/css/synonyms-styles.min.css
+++ /dev/null
@@ -1 +0,0 @@
-#synonym-root .page-title-action{margin-left:10px}#synonym-root .postbox .hndle{cursor:default}#synonym-root h2{color:#23282d}.synonym-alternatives-editor,.synonym-set-editor{display:-webkit-box;display:-ms-flexbox;display:flex}.synonym-alternatives-editor>.postbox,.synonym-set-editor>.postbox{width:100%}.synonym-alternatives-editor>.postbox>.hndle,.synonym-set-editor>.postbox>.hndle{display:-webkit-box;display:-ms-flexbox;display:flex}.synonym-alternatives-editor .synonym-alternative-editor,.synonym-set-editor .synonym-alternative-editor{display:-webkit-box;display:-ms-flexbox;display:flex}.synonym-alternatives-editor .ep-synonyms__linked-multi-input,.synonym-set-editor .ep-synonyms__linked-multi-input{-webkit-box-flex:1;-ms-flex:1;flex:1;margin-bottom:.5em}.synonym-alternatives-editor .ep-synonyms__input,.synonym-set-editor .ep-synonyms__input{border:1px solid #ccc;margin-bottom:.5em;margin-right:1em;width:10em}.synonym-alternatives-editor .synonym-alternatives__primary-heading,.synonym-set-editor .synonym-alternatives__primary-heading{width:11em}.synonym-alternatives-editor .synonym-alternatives__input-heading,.synonym-set-editor .synonym-alternatives__input-heading{-webkit-box-flex:1;-ms-flex:1;flex:1}.synonym-alternatives-editor .ep-synonyms__linked-multi-input input:focus,.synonym-set-editor .ep-synonyms__linked-multi-input input:focus{-webkit-box-shadow:none;box-shadow:none}.synonym-alternatives-editor.invalid input,.synonym-set-editor.invalid input{border-color:#a00}.synonym-alternative-editor,.synonym-set-editor{margin-top:.625em}button.synonym__remove{background-color:transparent;border:none;color:#a00;cursor:pointer;margin:-8px 0 0 10px;padding:0}button.synonym__remove .dashicons-dismiss{margin:-2px 2px 0 0}.synonym__validation:before{-ms-flex-preferred-size:100%;content:"";flex-basis:100%;height:0}.synonym-solr-editor__validation p,.synonym__validation{color:#a00;font-style:italic}.synonym__validation{margin:0 0 .625em .5em}.synonym-btn-group button.button{margin-right:.625em}
diff --git a/lib/elasticpress/dist/js/autosuggest-script.min.asset.php b/lib/elasticpress/dist/js/autosuggest-script.min.asset.php
deleted file mode 100644
index 77a544e..0000000
--- a/lib/elasticpress/dist/js/autosuggest-script.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array('wp-polyfill'), 'version' => '3687efa83adfed0fd229e84da362c739');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/js/autosuggest-script.min.js b/lib/elasticpress/dist/js/autosuggest-script.min.js
deleted file mode 100644
index d0f54c9..0000000
--- a/lib/elasticpress/dist/js/autosuggest-script.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){"use strict";var t={};t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}();const e=(t,e)=>{let r=null;return function(...n){const o=this;window.clearTimeout(r),r=window.setTimeout((()=>{t.apply(o,n)}),e)}},r=(t,e)=>{for(;(t=t.parentElement)&&!t.classList.contains(e););return t};var n=function(t){var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){return e.reject(r)}))}))};var o=function(t){return new this((function(e,r){if(!t||"undefined"===typeof t.length)return r(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(t);if(0===n.length)return e([]);var o=n.length;function i(t,r){if(r&&("object"===typeof r||"function"===typeof r)){var s=r.then;if("function"===typeof s)return void s.call(r,(function(e){i(t,e)}),(function(r){n[t]={status:"rejected",reason:r},0===--o&&e(n)}))}n[t]={status:"fulfilled",value:r},0===--o&&e(n)}for(var s=0;s-1};function P(t){if("string"!==typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function B(t){return"string"!==typeof t&&(t=String(t)),t}function S(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return v&&(e[Symbol.iterator]=function(){return e}),e}function x(t){this.map={},t instanceof x?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function L(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function O(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function U(t){var e=new FileReader,r=O(e);return e.readAsArrayBuffer(t),r}function C(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"===typeof t?this._bodyText=t:_&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:E&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:w&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():T&&_&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=C(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):T&&(ArrayBuffer.prototype.isPrototypeOf(t)||j(t))?this._bodyArrayBuffer=C(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"===typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):w&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},_&&(this.blob=function(){var t=L(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=L(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(U)}),this.text=function(){var t=L(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=O(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),("GET"===this.method||"HEAD"===this.method)&&("no-store"===e.cache||"no-cache"===e.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function R(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function I(t){var e=new x;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}})),e}function q(t,e){if(!(this instanceof q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new x(e.headers),this.url=e.url||"",this._initBody(t)}F.prototype.clone=function(){return new F(this,{body:this._bodyInit})},k.call(F.prototype),k.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},q.error=function(){var t=new q(null,{status:0,statusText:""});return t.type="error",t};var N=[301,302,303,307,308];q.redirect=function(t,e){if(-1===N.indexOf(e))throw new RangeError("Invalid status code");return new q(null,{status:e,headers:{location:t}})};var $=g.DOMException;try{new $}catch(t){($=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),$.prototype.constructor=$}function H(t,e){return new Promise((function(r,n){var o=new F(t,e);if(o.signal&&o.signal.aborted)return n(new $("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:I(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var e="response"in i?i.response:i.responseText;setTimeout((function(){r(new q(e,t))}),0)},i.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.onabort=function(){setTimeout((function(){n(new $("Aborted","AbortError"))}),0)},i.open(o.method,function(t){try{return""===t&&g.location.href?g.location.href:t}catch(e){return t}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(_?i.responseType="blob":T&&o.headers.get("Content-Type")&&-1!==o.headers.get("Content-Type").indexOf("application/octet-stream")&&(i.responseType="arraybuffer")),!e||"object"!==typeof e.headers||e.headers instanceof x?o.headers.forEach((function(t,e){i.setRequestHeader(e,t)})):Object.getOwnPropertyNames(e.headers).forEach((function(t){i.setRequestHeader(t,B(e.headers[t]))})),o.signal&&(o.signal.addEventListener("abort",s),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",s)}),i.send("undefined"===typeof o._bodyInit?null:o._bodyInit)}))}H.polyfill=!0,g.fetch||(g.fetch=H,g.Headers=x,g.Request=F,g.Response=q);const{epas:M}=window;function G(t,e){e.setAttribute("aria-activedescendant",t)}function J(t,e){!function(t){const e=new CustomEvent("ep-autosuggest-click",{detail:t});if(window.dispatchEvent(e),t.searchTerm&&1===parseInt(M.triggerAnalytics,10)&&"function"===typeof gtag){const e=`click - ${t.searchTerm}`;gtag("event",e,{event_category:"EP :: Autosuggest",event_label:t.url,transport_type:"beacon"})}}({searchTerm:t,url:e}),window.location.href=e}function V(t,e){return"navigate"===M.action?J(t.value,e.dataset.url):(function(t,e){t.value=e}(t,e.innerText),function(t){t.closest("form").submit()}(t))}function X(t,e,{query:r}){const n=(o=e,i=t,r.replace(new RegExp((t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(o),"g"),i));var o,i;return n}async function z(t,e){const r={body:t,method:"POST",mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};M?.http_headers&&"object"===typeof M.http_headers&&Object.keys(M.http_headers).forEach((t=>{r.headers[t]=M.http_headers[t]})),M.addSearchTermHeader&&(r.headers["EP-Search-Term"]=encodeURI(e));try{const t=await window.fetch(M.endpointUrl,r);if(!t.ok)throw Error(t.statusText);const n=await t.json();return"undefined"!==typeof window.epDataFilter?window.epDataFilter(n,e):n}catch(t){return console.error(t),t}}function Q(t,e){let n,o="";const{value:i}=e,s=r(e,"ep-autosuggest-container").querySelector(".ep-autosuggest"),a=s.querySelector(".autosuggest-list");for(;a.firstChild;)a.removeChild(a.firstChild);t.length>0?s.style="display: block;":s.style="display: none;";const u=t.length;for(n=0;u>n;++n){const e=t[n]._source.post_title,r=t[n]._source.permalink,s=e.replace(/\\([\s\S])|(")/g,"""),a=i.trim().split(" ");let u=s;if(M.highlightingEnabled){const t=new RegExp(`\\b(${a.join("|")})`,"gi");u=u.replace(t,(t=>`<${M.highlightingTag} class="${M.highlightingClass} ep-autosuggest-highlight">${t}${M.highlightingTag}>`))}let c=`\n\t\t\t\t\n\t\t\t\t\t${u}\n\t\t\t\t\n\t\t\t`;"undefined"!==typeof window.epAutosuggestItemHTMLFilter&&(c=window.epAutosuggestItemHTMLFilter(c,t[n],n,i)),o+=c}a.innerHTML=o;const c=Array.from(document.querySelectorAll(".autosuggest-link"));return a.addEventListener("click",(t=>{t.preventDefault();const r=t.target.tagName===M.highlightingTag?.toUpperCase()?t.target.parentElement:t.target;c.includes(r)&&V(e,r)})),!0}function K(){const t=document.querySelectorAll(".autosuggest-list"),e=document.querySelectorAll(".ep-autosuggest");return t.forEach((t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})),e.forEach((t=>{t.style="display: none;"})),!0}function W(t,e){const r=e.closest("form");t?r.classList.add("is-loading"):r.classList.remove("is-loading")}M.endpointUrl&&""!==M.endpointUrl&&(!function(){const t=[M.defaultSelectors,M.selector].filter(Boolean).join(",");if(!t)return;let n,o;const i=[38,40,13],s=t=>{if(!i.includes(t.keyCode))return;const e=t.target,n=r(e,"ep-autosuggest-container").querySelector(".autosuggest-list").children,s=()=>Array.from(n).findIndex((t=>t.classList.contains("selected"))),a=()=>{Array.from(n).forEach((t=>{t.classList.remove("selected"),t.setAttribute("aria-selected","false")}))},u=()=>{if(o>=0){const t=n[o];t.classList.add("selected"),t.setAttribute("aria-selected","true"),G(t.id,e)}};switch(t.keyCode){case 38:o=o-1>=0?o-1:0,a();break;case 40:if("undefined"===typeof o)o=0;else{const t=s();n[t+1]&&(o=t+1,a())}break;case 13:n[o].classList.contains("selected")&&V(e,n[o].querySelector(".autosuggest-link"))}n[o]&&n[o].classList.contains("autosuggest-item")?u():a(),38===t.keyCode&&t.preventDefault()};function a(t){const e=new FormData(t);return e.has("post_type")?e.getAll("post_type").slice(-1):e.has("post_type[]")?e.getAll("post_type[]"):[]}const u=e((async t=>{const e=function(){if("undefined"===typeof window.epas){const t="No epas object defined";return console.warn(t),{error:t}}return window.epas}();if(e.error)return;const r=t.value,n="ep_autosuggest_placeholder",o=a(t.form);if(r.length>=2){W(!0,t);let i=X(r,n,e);o.length>0&&(i=JSON.parse(i),"undefined"!==typeof i.post_filter.bool.must&&i.post_filter.bool.must.push({terms:{"post_type.raw":o}}),i=JSON.stringify(i));const s=await z(i,r);if(s&&s._shards&&s._shards.successful>0){const e=function(t,e){const r={},n="ep_custom_result",o=e.toLowerCase(),i=t.filter((t=>{let e=!0;return void 0!==t._source.terms&&void 0!==t._source.terms[n]&&t._source.terms[n].forEach((n=>{n.name.toLowerCase()===o&&(r[n.term_order]=t,e=!1)})),e})),s={};Object.keys(r).sort().forEach((t=>{s[t]=r[t]})),Object.keys(s).length>0&&Object.keys(s).forEach((t=>{const e=s[t];i.splice(t-1,0,e)}));return i}(s.hits.hits,r);0===e.length?K():Q(e,t)}else K();W(!1,t)}else 0===r.length&&K()}),200),c=t=>{t.preventDefault();const{target:e,key:r,keyCode:n}=t;if("Escape"===r||"Esc"===r||27===n)return K(),function(t,e){e.setAttribute("aria-expanded",t)}(!1,e),void G("",e);if(i.includes(n)&&""!==e.value)return void s(t);const o=t.target;u(o)},l=t=>{const e=document.createElement("div");e.classList.add("ep-autosuggest-container"),t.insertAdjacentElement("afterend",e),e.appendChild(t)},f=t=>{if(!n){n=document.createElement("div"),n.classList.add("ep-autosuggest");const t=document.createElement("ul");t.classList.add("autosuggest-list"),t.setAttribute("role","listbox"),n.appendChild(t)}const e=n.cloneNode(!0);t.insertAdjacentElement("afterend",e)},d=t=>{if(t.classList.contains("facet-search"))return;t.setAttribute("autocomplete","off"),t.classList.contains("wp-block-search__input")?(t.form.classList.add("ep-autosuggest-container"),f(t.parentElement)):(l(t),f(t));const e=new CustomEvent("elasticpress.input.moved");t.dispatchEvent(e),t.addEventListener("keyup",c),t.addEventListener("blur",(function(){window.setTimeout(K,200)}))},h=e=>{const r=e.querySelectorAll(t);r&&Array.from(r).forEach(d)},p=()=>{const e=document.body,r={subtree:!0,childList:!0};new MutationObserver(((n,o)=>{n.forEach((n=>{Array.from(n.addedNodes).forEach((n=>{n.nodeType===Node.ELEMENT_NODE&&(o.disconnect(),"INPUT"===n.tagName?n.matches(t)&&d(n):h(n),o.observe(e,r))}))}))})).observe(e,r)};h(document.body),y=p,"undefined"!==typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",y):y());var y}(),window.epasAPI={hideAutosuggestBox:K,updateAutosuggestBox:Q,esSearch:z,buildSearchQuery:X})}();
\ No newline at end of file
diff --git a/lib/elasticpress/dist/js/comments-script.min.asset.php b/lib/elasticpress/dist/js/comments-script.min.asset.php
deleted file mode 100644
index f0f6a6d..0000000
--- a/lib/elasticpress/dist/js/comments-script.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array('wp-polyfill'), 'version' => '1e0e945692ffaa2ddd6377c7ff11fea6');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/js/comments-script.min.js b/lib/elasticpress/dist/js/comments-script.min.js
deleted file mode 100644
index 4383dfb..0000000
--- a/lib/elasticpress/dist/js/comments-script.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){"use strict";const e=(e,t)=>{for(;(e=e.parentElement)&&!e.classList.contains(t););return e},t=document.querySelectorAll(".ep-widget-search-comments");let n;t.forEach((e=>{const t=document.createElement("input");t.setAttribute("autocomplete","off"),t.setAttribute("type","search"),t.setAttribute("class","ep-widget-search-comments-input");const n=document.createElement("ul");n.setAttribute("class","ep-widget-search-comments-results"),e.appendChild(t),e.appendChild(n)}));const s=[38,40,13];function i(t){n=void 0;const s=e(t,"ep-widget-search-comments").querySelector(".ep-widget-search-comments-results");for(;s.firstChild;)s.removeChild(s.firstChild)}function o(e){const t=window.epc.minimumLengthToSearch||2;return e?.value?.trim().length>=t}function c(t,n){const s=e(n,"ep-widget-search-comments");t?s.classList.add("ep-widget-search-comments-is-loading"):s.classList.remove("ep-widget-search-comments-is-loading")}const r=((e,t)=>{let n=null;return function(...s){const i=this;window.clearTimeout(n),n=window.setTimeout((()=>{e.apply(i,s)}),t)}})((function(t){if(o(t)){const n=e(t,"ep-widget-search-comments").querySelector("#ep-widget-search-comments-post-type"),s=n?.value?`&post_type=${n.value.trim()}`:"";return c(!0,t),fetch(`${window.epc.restApiEndpoint}?s=${t.value.trim()}${s}`).then((e=>{if(!e.ok)throw e;return e.json()})).then((n=>{0===Object.keys(n).length?t.value.trim()?(t=>{const n=e(t,"ep-widget-search-comments").querySelector(".ep-widget-search-comments-results");let s=``;"undefined"!==typeof window.epCommentWidgetItemNotFoundHTMLFilter&&(s=window.epCommentWidgetItemNotFoundHTMLFilter(s,window.epc.noResultsFoundText,t.value)),n.innerHTML=s})(t):i(t):((t,n)=>{let s="",i="";Object.keys(t).forEach(((e,o)=>{t[e]?.content&&t[e]?.link&&(i=`\n\t\t\t\t\n\t\t\t`,"undefined"!==typeof window.epCommentWidgetItemHTMLFilter&&(i=window.epCommentWidgetItemHTMLFilter(i,t[e],o,n.value)),s+=i)}));const o=e(n,"ep-widget-search-comments").querySelector(".ep-widget-search-comments-results");"undefined"!==typeof window.epCommentWidgetItemsHTMLFilter&&(s=window.epCommentWidgetItemsHTMLFilter(s,n.value)),o.innerHTML=s})(n,t)})).catch((()=>{i(t)})).finally((()=>{c(!1,t)}))}return!1}),500),d=t=>{t.preventDefault();const{target:c,key:d,keyCode:l}=t;if("Escape"===d||"Esc"===d||27===l)return i(c),void c.setAttribute("aria-expanded",!1);s.includes(l)&&""!==c.value?(t=>{if(!s.includes(t.keyCode))return;const i=e(t.target,"ep-widget-search-comments").querySelector(".ep-widget-search-comments-results"),o=i.querySelectorAll(".ep-widget-search-comments-result-item").length,c=i.children,r=n;switch(t.keyCode){case 38:n=n-1<0||"undefined"===typeof n?o-1:n-1;break;case 40:"undefined"===typeof n||n+1>o-1?n=0:n+=1;break;case 13:if(c[n]?.classList.contains("selected")||1===o){const e=n||0;if(c[e]){const t=c[e].querySelector("a")?.getAttribute("href");window.location.href=t}}}"number"===typeof r&&(c[r].classList.remove("selected"),c[r].setAttribute("aria-selected","false")),c[n]?.classList.add("selected"),c[n]?.setAttribute("aria-selected","true")})(t):o(c)?r(c):i(c)};t.forEach((e=>{const t=e.querySelector(".ep-widget-search-comments-input");t.addEventListener("keyup",d),t.addEventListener("keydown",(e=>{38===e.keyCode&&e.preventDefault()})),t.addEventListener("blur",(function(){setTimeout((()=>i(t)),200)}))}))}();
\ No newline at end of file
diff --git a/lib/elasticpress/dist/js/dashboard-script.min.asset.php b/lib/elasticpress/dist/js/dashboard-script.min.asset.php
deleted file mode 100644
index 7d07393..0000000
--- a/lib/elasticpress/dist/js/dashboard-script.min.asset.php
+++ /dev/null
@@ -1 +0,0 @@
- array('wp-i18n', 'wp-polyfill'), 'version' => '0a6f6d35a11b2b1adae735e1bc96e9f2');
\ No newline at end of file
diff --git a/lib/elasticpress/dist/js/dashboard-script.min.js b/lib/elasticpress/dist/js/dashboard-script.min.js
deleted file mode 100644
index d8c1fc6..0000000
--- a/lib/elasticpress/dist/js/dashboard-script.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){var t={3462:function(t,e,n){n(6699);var r=n(2649);t.exports=r("Array","includes")},9116:function(t,e,n){n(9601);var r=n(857);t.exports=r.Object.assign},9662:function(t,e,n){var r=n(7854),o=n(614),i=n(6330),c=r.TypeError;t.exports=function(t){if(o(t))return t;throw c(i(t)+" is not a function")}},6077:function(t,e,n){var r=n(7854),o=n(614),i=r.String,c=r.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw c("Can't set "+i(t)+" as a prototype")}},1223:function(t,e,n){var r=n(5112),o=n(30),i=n(3070),c=r("unscopables"),s=Array.prototype;void 0==s[c]&&i.f(s,c,{configurable:!0,value:o(null)}),t.exports=function(t){s[c][t]=!0}},9670:function(t,e,n){var r=n(7854),o=n(111),i=r.String,c=r.TypeError;t.exports=function(t){if(o(t))return t;throw c(i(t)+" is not an object")}},8533:function(t,e,n){"use strict";var r=n(2092).forEach,o=n(9341)("forEach");t.exports=o?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},1318:function(t,e,n){var r=n(5656),o=n(1400),i=n(6244),c=function(t){return function(e,n,c){var s,a=r(e),u=i(a),f=o(c,u);if(t&&n!=n){for(;u>f;)if((s=a[f++])!=s)return!0}else for(;u>f;f++)if((t||f in a)&&a[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},2092:function(t,e,n){var r=n(9974),o=n(1702),i=n(8361),c=n(7908),s=n(6244),a=n(5417),u=o([].push),f=function(t){var e=1==t,n=2==t,o=3==t,f=4==t,l=6==t,p=7==t,v=5==t||l;return function(g,y,d,h){for(var b,m,x=c(g),O=i(x),w=r(y,d),S=s(O),L=0,j=h||a,E=e?j(g,S):n||p?j(g,0):void 0;S>L;L++)if((v||L in O)&&(m=w(b=O[L],L,x),t))if(e)E[L]=m;else if(m)switch(t){case 3:return!0;case 5:return b;case 6:return L;case 2:u(E,b)}else switch(t){case 4:return!1;case 7:u(E,b)}return l?-1:o||f?f:E}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},9341:function(t,e,n){"use strict";var r=n(7293);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){return 1},1)}))}},7475:function(t,e,n){var r=n(7854),o=n(3157),i=n(4411),c=n(111),s=n(5112)("species"),a=r.Array;t.exports=function(t){var e;return o(t)&&(e=t.constructor,(i(e)&&(e===a||o(e.prototype))||c(e)&&null===(e=e[s]))&&(e=void 0)),void 0===e?a:e}},5417:function(t,e,n){var r=n(7475);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},4326:function(t,e,n){var r=n(1702),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:function(t,e,n){var r=n(7854),o=n(1694),i=n(614),c=n(4326),s=n(5112)("toStringTag"),a=r.Object,u="Arguments"==c(function(){return arguments}());t.exports=o?c:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?n:u?c(e):"Object"==(r=c(e))&&i(e.callee)?"Arguments":r}},9920:function(t,e,n){var r=n(2597),o=n(3887),i=n(1236),c=n(3070);t.exports=function(t,e,n){for(var s=o(e),a=c.f,u=i.f,f=0;f0&&r[0]<4?1:+(r[0]+r[1])),!o&&c&&(!(r=c.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},2649:function(t,e,n){var r=n(7854),o=n(1702);t.exports=function(t,e){return o(r[t].prototype[e])}},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,e,n){var r=n(7854),o=n(1236).f,i=n(8880),c=n(1320),s=n(3505),a=n(9920),u=n(4705);t.exports=function(t,e){var n,f,l,p,v,g=t.target,y=t.global,d=t.stat;if(n=y?r:d?r[g]||s(g,{}):(r[g]||{}).prototype)for(f in e){if(p=e[f],l=t.noTargetGet?(v=o(n,f))&&v.value:n[f],!u(y?f:g+(d?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;a(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),c(n,f,p,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},9974:function(t,e,n){var r=n(1702),o=n(9662),i=n(4374),c=r(r.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?c(t,e):function(){return t.apply(e,arguments)}}},4374:function(t,e,n){var r=n(7293);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:function(t,e,n){var r=n(4374),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},6530:function(t,e,n){var r=n(9781),o=n(2597),i=Function.prototype,c=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),a=s&&"something"===function(){}.name,u=s&&(!r||r&&c(i,"name").configurable);t.exports={EXISTS:s,PROPER:a,CONFIGURABLE:u}},1702:function(t,e,n){var r=n(4374),o=Function.prototype,i=o.bind,c=o.call,s=r&&i.bind(c,c);t.exports=r?function(t){return t&&s(t)}:function(t){return t&&function(){return c.apply(t,arguments)}}},5005:function(t,e,n){var r=n(7854),o=n(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},8173:function(t,e,n){var r=n(9662);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},7854:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:function(t,e,n){var r=n(1702),o=n(7908),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:function(t){t.exports={}},490:function(t,e,n){var r=n(5005);t.exports=r("document","documentElement")},4664:function(t,e,n){var r=n(9781),o=n(7293),i=n(317);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:function(t,e,n){var r=n(7854),o=n(1702),i=n(7293),c=n(4326),s=r.Object,a=o("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==c(t)?a(t,""):s(t)}:s},2788:function(t,e,n){var r=n(1702),o=n(614),i=n(5465),c=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return c(t)}),t.exports=i.inspectSource},9909:function(t,e,n){var r,o,i,c=n(8536),s=n(7854),a=n(1702),u=n(111),f=n(8880),l=n(2597),p=n(5465),v=n(6200),g=n(3501),y="Object already initialized",d=s.TypeError,h=s.WeakMap;if(c||p.state){var b=p.state||(p.state=new h),m=a(b.get),x=a(b.has),O=a(b.set);r=function(t,e){if(x(b,t))throw new d(y);return e.facade=t,O(b,t,e),e},o=function(t){return m(b,t)||{}},i=function(t){return x(b,t)}}else{var w=v("state");g[w]=!0,r=function(t,e){if(l(t,w))throw new d(y);return e.facade=t,f(t,w,e),e},o=function(t){return l(t,w)?t[w]:{}},i=function(t){return l(t,w)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw d("Incompatible receiver, "+t+" required");return n}}}},3157:function(t,e,n){var r=n(4326);t.exports=Array.isArray||function(t){return"Array"==r(t)}},614:function(t){t.exports=function(t){return"function"==typeof t}},4411:function(t,e,n){var r=n(1702),o=n(7293),i=n(614),c=n(648),s=n(5005),a=n(2788),u=function(){},f=[],l=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,v=r(p.exec),g=!p.exec(u),y=function(t){if(!i(t))return!1;try{return l(u,f,t),!0}catch(t){return!1}},d=function(t){if(!i(t))return!1;switch(c(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return g||!!v(p,a(t))}catch(t){return!0}};d.sham=!0,t.exports=!l||o((function(){var t;return y(y.call)||!y(Object)||!y((function(){t=!0}))||t}))?d:y},4705:function(t,e,n){var r=n(7293),o=n(614),i=/#|\.prototype\./,c=function(t,e){var n=a[s(t)];return n==f||n!=u&&(o(e)?r(e):!!e)},s=c.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=c.data={},u=c.NATIVE="N",f=c.POLYFILL="P";t.exports=c},111:function(t,e,n){var r=n(614);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},1913:function(t){t.exports=!1},2190:function(t,e,n){var r=n(7854),o=n(5005),i=n(614),c=n(7976),s=n(3307),a=r.Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&c(e.prototype,a(t))}},3383:function(t,e,n){"use strict";var r,o,i,c=n(7293),s=n(614),a=n(30),u=n(9518),f=n(1320),l=n(5112),p=n(1913),v=l("iterator"),g=!1;[].keys&&("next"in(i=[].keys())?(o=u(u(i)))!==Object.prototype&&(r=o):g=!0),void 0==r||c((function(){var t={};return r[v].call(t)!==t}))?r={}:p&&(r=a(r)),s(r[v])||f(r,v,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:g}},7497:function(t){t.exports={}},6244:function(t,e,n){var r=n(7466);t.exports=function(t){return r(t.length)}},133:function(t,e,n){var r=n(7392),o=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8536:function(t,e,n){var r=n(7854),o=n(614),i=n(2788),c=r.WeakMap;t.exports=o(c)&&/native code/.test(i(c))},1574:function(t,e,n){"use strict";var r=n(9781),o=n(1702),i=n(6916),c=n(7293),s=n(1956),a=n(5181),u=n(5296),f=n(7908),l=n(8361),p=Object.assign,v=Object.defineProperty,g=o([].concat);t.exports=!p||c((function(){if(r&&1!==p({b:1},p(v({},"a",{enumerable:!0,get:function(){v(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=p({},t)[n]||s(p({},e)).join("")!=o}))?function(t,e){for(var n=f(t),o=arguments.length,c=1,p=a.f,v=u.f;o>c;)for(var y,d=l(arguments[c++]),h=p?g(s(d),p(d)):s(d),b=h.length,m=0;b>m;)y=h[m++],r&&!i(v,d,y)||(n[y]=d[y]);return n}:p},30:function(t,e,n){var r,o=n(9670),i=n(6048),c=n(748),s=n(3501),a=n(490),u=n(317),f=n(6200),l=f("IE_PROTO"),p=function(){},v=function(t){return"