diff --git a/integrations/vip-governance.php b/integrations/vip-governance.php new file mode 100644 index 00000000000..de9bdce5705 --- /dev/null +++ b/integrations/vip-governance.php @@ -0,0 +1,63 @@ +is_loaded() ) { + return; + } + + // Load the version of the plugin that should be set to the latest version, otherwise if it's not found deactivate the integration. + $load_path = WPMU_PLUGIN_DIR . '/vip-integrations/vip-governance-' . $this->version . '/vip-governance.php'; + if ( file_exists( $load_path ) ) { + require_once $load_path; + } else { + $this->is_active = false; + } + } ); + } + + /** + * Configure `VIP Governance` for VIP Platform. + */ + public function configure(): void {} +} diff --git a/jetpack.php b/jetpack.php index 2c9365ff3e7..d9e99e81c68 100644 --- a/jetpack.php +++ b/jetpack.php @@ -124,6 +124,388 @@ function vip_jetpack_token_send_signature_error_headers( $error ) { add_action( 'jetpack_verify_signature_error', 'vip_jetpack_token_send_signature_error_headers' ); +// Default plan object for all VIP sites. +define( 'VIP_JETPACK_DEFAULT_PLAN', array( + 'product_id' => 'vip', + 'product_slug' => 'vip', + 'product_name_short' => 'VIP', + 'product_variation' => 'vip', + 'supports' => array( + 'videopress', + 'akismet', + 'vaultpress', + 'seo-tools', + 'google-analytics', + 'wordads', + 'search', + ), + 'features' => array( + 'active' => array( + 'premium-themes', + 'google-analytics', + 'security-settings', + 'advanced-seo', + 'upload-video-files', + 'video-hosting', + 'send-a-message', + 'whatsapp-button', + 'social-previews', + 'donations', + 'core/audio', + 'republicize', + 'premium-content/container', + 'akismet', + 'vaultpress-backups', + 'vaultpress-backup-archive', + 'vaultpress-storage-space', + 'vaultpress-automated-restores', + 'vaultpress-security-scanning', + 'polldaddy', + 'simple-payments', + 'support', + 'wordads-jetpack', + ), + 'available' => array( + 'security-settings' => array( + 'jetpack_free', + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'advanced-seo' => array( + 'jetpack_free', + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'upload-video-files' => array( + 'jetpack_free', + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'akismet' => array( + 'jetpack_free', + 'jetpack_premium', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'send-a-message' => array( + 'jetpack_free', + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'whatsapp-button' => array( + 'jetpack_free', + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'social-previews' => array( + 'jetpack_free', + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'google-analytics' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'video-hosting' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'wordads-jetpack' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'vaultpress-backups' => array( + 'jetpack_premium', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + ), + 'vaultpress-backup-archive' => array( + 'jetpack_premium', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + ), + 'vaultpress-storage-space' => array( + 'jetpack_premium', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + ), + 'vaultpress-automated-restores' => array( + 'jetpack_premium', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + ), + 'simple-payments' => array( + 'jetpack_premium', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_business_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + ), + 'calendly' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + ), + 'opentable' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + ), + 'donations' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'core/video' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + ), + 'core/cover' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + ), + 'core/audio' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'republicize' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'premium-content/container' => array( + 'jetpack_premium', + 'jetpack_business', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'support' => array( + 'jetpack_premium', + 'jetpack_personal', + 'jetpack_premium_monthly', + 'jetpack_business_monthly', + 'jetpack_personal_monthly', + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_complete_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'premium-themes' => array( + 'jetpack_business', + 'jetpack_business_monthly', + ), + 'vaultpress-security-scanning' => array( + 'jetpack_business', + 'jetpack_business_monthly', + ), + 'polldaddy' => array( + 'jetpack_business', + 'jetpack_business_monthly', + ), + ), + ), +) ); + +/** + * Prevent the jetpack_active_plan from ever being overridden. + * + * All VIP sites should always have have a valid Jetpack plan. + * + * This will prevent issues from the plan option being corrupted, + * which can then break features like Jetpack Search. + */ +add_filter( 'pre_option_jetpack_active_plan', function ( $pre_option ) { + if ( true === WPCOM_IS_VIP_ENV && defined( 'VIP_JETPACK_DEFAULT_PLAN' ) ) { + return VIP_JETPACK_DEFAULT_PLAN; + } + + return $pre_option; +} ); + + /** * Load the jetpack plugin according to several defines: * - If VIP_JETPACK_SKIP_LOAD is true, Jetpack will not be loaded diff --git a/package-lock.json b/package-lock.json index e00c4082069..ab8b8b9f42f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20471,9 +20471,9 @@ } }, "node_modules/react-select": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.4.tgz", - "integrity": "sha512-NhuE56X+p9QDFh4BgeygHFIvJJszO1i1KSkg/JPcIJrbovyRtI+GuOEa4XzFCEpZRAEoEI8u/cAHK+jG/PgUzQ==", + "version": "5.7.7", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.7.tgz", + "integrity": "sha512-HhashZZJDRlfF/AKj0a0Lnfs3sRdw/46VJIRd8IbB9/Ovr74+ZIwkAdSBjSPXsFMG+u72c5xShqwLSKIJllzqw==", "dependencies": { "@babel/runtime": "^7.12.0", "@emotion/cache": "^11.4.0", diff --git a/search/elasticpress-next b/search/elasticpress-next index ee989ba581c..131e0083c64 160000 --- a/search/elasticpress-next +++ b/search/elasticpress-next @@ -1 +1 @@ -Subproject commit ee989ba581c21230b7ef11d2299574dd18833aae +Subproject commit 131e0083c64191fe20d989f89070790595367544 diff --git a/search/includes/classes/class-health.php b/search/includes/classes/class-health.php index a02f8e34212..bf8eb5c1502 100644 --- a/search/includes/classes/class-health.php +++ b/search/includes/classes/class-health.php @@ -56,9 +56,17 @@ class Health { * Instance of Search class * * Useful for overriding (dependency injection) for tests + * + * @var \Automattic\VIP\Search\Search */ public $search; + /** @var \ElasticPress\Indexables */ + public $indexables; + + /** @var \ElasticPress\Elasticsearch */ + public $elasticsearch; + public function __construct( \Automattic\VIP\Search\Search $search ) { $this->search = $search; $this->indexables = \ElasticPress\Indexables::factory(); diff --git a/search/includes/classes/class-healthjob.php b/search/includes/classes/class-healthjob.php index 0ece1bbbb59..46ea37e391b 100644 --- a/search/includes/classes/class-healthjob.php +++ b/search/includes/classes/class-healthjob.php @@ -30,6 +30,8 @@ class HealthJob { * Instance of the Health class * * Useful for overriding in tests via dependency injection + * + * @var Health */ public $health; @@ -37,6 +39,8 @@ class HealthJob { * Instance of Search class * * Useful for overriding (dependency injection) for tests + * + * @var \Automattic\VIP\Search\Search */ public $search; @@ -44,6 +48,8 @@ class HealthJob { * Instance of \ElasticPress\Indexables * * Useful for overriding (dependency injection) for tests + * + * @var \ElasticPress\Indexables */ public $indexables; diff --git a/search/includes/classes/class-queue.php b/search/includes/classes/class-queue.php index a84b7af0be5..66325c01aa6 100644 --- a/search/includes/classes/class-queue.php +++ b/search/includes/classes/class-queue.php @@ -14,7 +14,9 @@ class Queue { /** @var Queue\Schema */ public $schema; + /** @var Indexables */ public $indexables; + /** @var \Automattic\VIP\Logstash\Logger */ public $logger; /** @var Queue\Cron */ public $cron; diff --git a/search/includes/classes/class-search.php b/search/includes/classes/class-search.php index a598d21a87b..7940616b475 100644 --- a/search/includes/classes/class-search.php +++ b/search/includes/classes/class-search.php @@ -144,7 +144,7 @@ class Search { private static $query_count_ttl; private const DEFAULT_SEARCH_LENGTH = 80; - private const MAX_SEARCH_LENGTH = 255; + private const MAX_SEARCH_LENGTH = 510; private const DISABLE_POST_META_ALLOW_LIST = array(); private const STALE_QUEUE_WAIT_LIMIT = 3600; // 1 hour in seconds private const POST_FIELD_COUNT_LIMIT = 5000; @@ -186,6 +186,8 @@ class Search { public $concurrency_limiter; public $time; public static $stat_sampling_drop_value = 5; // Value to compare >= against rand( 1, 10 ). 5 should result in roughly half being true. + /** @var Cache */ + public $cache; /** * Maximum number of queries before rate-limiting kicks in. diff --git a/search/includes/classes/class-settingshealthjob.php b/search/includes/classes/class-settingshealthjob.php index 0a20fe1876c..a9988453130 100644 --- a/search/includes/classes/class-settingshealthjob.php +++ b/search/includes/classes/class-settingshealthjob.php @@ -39,6 +39,8 @@ class SettingsHealthJob { * Instance of the Health class * * Useful for overriding in tests via dependency injection + * + * @var Health */ public $health; @@ -46,6 +48,8 @@ class SettingsHealthJob { * Instance of Search class * * Useful for overriding (dependency injection) for tests + * + * @var \Automattic\VIP\Search\Search */ public $search; @@ -53,6 +57,8 @@ class SettingsHealthJob { * Instance of \ElasticPress\Indexables * * Useful for overriding (dependency injection) for tests + * + * @var \ElasticPress\Indexables */ public $indexables; diff --git a/search/includes/classes/class-versioningcleanupjob.php b/search/includes/classes/class-versioningcleanupjob.php index 835cdc4aae2..a7288fb3cb4 100644 --- a/search/includes/classes/class-versioningcleanupjob.php +++ b/search/includes/classes/class-versioningcleanupjob.php @@ -11,6 +11,9 @@ class VersioningCleanupJob { const SEARCH_ALERT_SLACK_CHAT = '#vip-go-es-alerts'; + public $indexables; + public $versioning; + public function __construct( $indexables, $versioning ) { $this->indexables = $indexables; $this->versioning = $versioning; diff --git a/search/includes/classes/commands/class-documentcommand.php b/search/includes/classes/commands/class-documentcommand.php index 7237624e077..29b18bebeb9 100644 --- a/search/includes/classes/commands/class-documentcommand.php +++ b/search/includes/classes/commands/class-documentcommand.php @@ -35,7 +35,7 @@ public function get( $args, $assoc_args ) { $type = $args[0]; $object_id = $args[1]; - $search = \Automattic\VIP\Search\Search::instance(); + \Automattic\VIP\Search\Search::instance(); $indexable = \ElasticPress\Indexables::factory()->get( $type ); diff --git a/search/search-dev-tools/build/bundle.js b/search/search-dev-tools/build/bundle.js index c053a4f0b88..53343708f50 100644 --- a/search/search-dev-tools/build/bundle.js +++ b/search/search-dev-tools/build/bundle.js @@ -1 +1 @@ -(()=>{function e(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return t[r].call(i.exports,i,i.exports,e),i.exports}var t={798:(e,t,n)=>{n.p=window.VIPSearchDevTools.__webpack_public_path__},184:(e,t)=>{var n;!function(){"use strict";function r(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=g(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=g(e.value,t):(n=y()(e),r("copy")),n},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,i=e.target,a=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==i){if(!i||"object"!==o(i)||1!==i.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(i.hasAttribute("readonly")||i.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return a?b(a,{container:r}):i?"cut"===n?m(i):b(i,{container:r}):void 0},k=function(e){function t(e,t){var n;return(n=s.call(this)).resolveOptions(t),n.listenClick(e),n}!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e);var n,r,o,s=u(t);return n=t,r=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===i(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=h()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=w({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return f("action",e)}},{key:"defaultTarget",value:function(e){var t=f("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return f("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],o=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return b(e,t)}},{key:"cut",value:function(e){return m(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t=!!document.queryCommandSupported;return("string"==typeof e?[e]:e).forEach((function(e){t=t&&!!document.queryCommandSupported(e)})),t}}],r&&a(n.prototype,r),o&&a(n,o),t}(p()),S=k},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){function r(e,t,n,r,i){var a=o.apply(this,arguments);return e.addEventListener(n,a,i),{destroy:function(){e.removeEventListener(n,a,i)}}}function o(e,t,n,r){return function(n){n.delegateTarget=i(n.target,t),n.delegateTarget&&r.call(e,n)}}var i=n(828);e.exports=function(e,t,n,o,i){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return r(e,t,n,o,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function r(){o.off(e,r),t.apply(n,arguments)}var o=this;return r._=t,this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r{"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function i(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function a(e){this.props=e}function l(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:o(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,M.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}function u(e){function t(t){var n=r({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=I,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}function s(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=r({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return s(e,t,n)}))),e}function c(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return c(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function f(){this.__u=0,this.t=null,this.__b=null}function _(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function p(e){function t(t){if(n||(n=e()).then((function(e){r=e.default||e}),(function(e){o=e})),o)throw o;if(!r)throw n;return(0,M.az)(r,t)}var n,r,o;return t.displayName="Lazy",t.__f=!0,t}function d(){this.u=null,this.o=null}function h(e){return this.getChildContext=function(){return e.context},e.children}function v(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,M.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,M.sY)((0,M.az)(h,{context:t.context},e.__v),t.l)}function y(e,t){var n=(0,M.az)(v,{__v:e,i:t});return n.containerInfo=t,n}function m(e,t,n){return null==t.__k&&(t.textContent=""),(0,M.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function g(e,t,n){return(0,M.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}function b(){}function w(){return this.cancelBubble}function k(){return this.defaultPrevented}function S(e){return M.az.bind(null,e)}function x(e){return!!e&&e.$$typeof===z}function C(e){return x(e)&&e.type===M.HY}function E(e){return x(e)?M.Tm.apply(null,arguments):e}function O(e){return!!e.__k&&((0,M.sY)(null,e),!0)}function P(e){return e&&(e.base||1===e.nodeType&&e)||null}function N(e){e()}function A(e){return e}function $(){return[!1,N]}function j(e,t){var n=t(),r=(0,L.eJ)({h:{__:n,v:t}}),o=r[0].h,a=r[1];return(0,L.bt)((function(){o.__=n,o.v=t,i(o.__,t())||a({h:o})}),[e,n,t]),(0,L.d4)((function(){return i(o.__,o.v())||a({h:o}),e((function(){i(o.__,o.v())||a({h:o})}))}),[e]),n}n.r(t),n.d(t,{Children:()=>q,Component:()=>M.wA,Fragment:()=>M.HY,PureComponent:()=>a,StrictMode:()=>oe,Suspense:()=>f,SuspenseList:()=>d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>ee,cloneElement:()=>E,createContext:()=>M.kr,createElement:()=>M.az,createFactory:()=>S,createPortal:()=>y,createRef:()=>M.Vf,default:()=>le,findDOMNode:()=>P,flushSync:()=>re,forwardRef:()=>u,hydrate:()=>g,isElement:()=>ae,isFragment:()=>C,isValidElement:()=>x,lazy:()=>p,memo:()=>l,render:()=>m,startTransition:()=>N,unmountComponentAtNode:()=>O,unstable_batchedUpdates:()=>ne,useCallback:()=>L.I4,useContext:()=>L.qp,useDebugValue:()=>L.Qb,useDeferredValue:()=>A,useEffect:()=>L.d4,useErrorBoundary:()=>L.cO,useId:()=>L.Me,useImperativeHandle:()=>L.aP,useInsertionEffect:()=>ie,useLayoutEffect:()=>L.bt,useMemo:()=>L.Ye,useReducer:()=>L._Y,useRef:()=>L.sO,useState:()=>L.eJ,useSyncExternalStore:()=>j,useTransition:()=>$,version:()=>te});var M=n(400),L=n(396);(a.prototype=new M.wA).isPureReactComponent=!0,a.prototype.shouldComponentUpdate=function(e,t){return o(this.props,e)||o(this.state,t)};var T=M.YM.__b;M.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),T&&T(e)};var I="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911,R=function(e,t){return null==e?null:(0,M.bR)((0,M.bR)(e).map(t))},q={map:R,forEach:R,count:function(e){return e?(0,M.bR)(e).length:0},only:function(e){var t=(0,M.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:M.bR},D=M.YM.__e;M.YM.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);D(e,t,n,r)};var H=M.YM.unmount;M.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),H&&H(e)},(f.prototype=new M.wA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=_(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=c(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},u=!0===t.__h;r.__u++||u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},f.prototype.componentWillUnmount=function(){this.t=[]},f.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=s(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,M.az)(M.HY,null,e.fallback);return o&&(o.__h=null),[(0,M.az)(M.HY,null,t.__a?null:e.children),o]};var Y=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]{"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function i(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?M.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return a(e,l,r,o,null)}function a(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++T:o};return null==o&&null!=L.vnode&&L.vnode(i),i}function l(){return{current:null}}function u(e){return e.children}function s(e,t){this.props=e,this.context=t}function c(e,t){if(null==t)return e.__?c(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&I.sort(D));p.__r=0}function d(e,t,n,r,o,i,l,s,f,_,p){var d,v,g,b,w,k,x,C,P,N=0,A=r&&r.__k||z,$=A.length,j=$,M=t.length;for(n.__k=[],d=0;d0?a(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)?(b.__=n,b.__b=n.__b+1,-1===(C=m(b,A,x=d+N,j))?g=Y:(g=A[C]||Y,A[C]=void 0,j--),S(e,b,g,o,i,l,s,f,_,p),w=b.__e,(v=b.ref)&&g.ref!=v&&(g.ref&&E(g.ref,null,b),p.push(v,b.__c||w,b)),null!=w&&(null==k&&(k=w),(P=g===Y||null===g.__v)?-1==C&&N--:C!==x&&(C===x+1?N++:C>x?j>M-x?N+=C-x:N--:N=C(null!=u?1:0))for(;a>=0||l=0){if((u=t[a])&&o==u.key&&i===u.type)return a;a--}if(l2&&(s.children=arguments.length>3?M.call(arguments,2):n),a(e.type,s,o||e.key,i||e.ref,null)}function j(e,t){var n={__c:t="__cC"+H++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,_(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}n.d(t,{HY:()=>u,Tm:()=>$,Vf:()=>l,YM:()=>L,ZB:()=>A,az:()=>i,bR:()=>v,h:()=>i,kr:()=>j,sY:()=>N,wA:()=>s});var M,L,T,I,R,q,D,H,Y={},z=[],U=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,W=Array.isArray;M=z.slice,L={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},T=0,s.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=r({},this.state),"function"==typeof e&&(e=e(r({},n),this.props)),e&&r(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),_(this))},s.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},s.prototype.render=u,I=[],q="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,D=function(e,t){return e.__v.__b-t.__v.__b},p.__r=0,H=0},396:(e,t,n)=>{"use strict";function r(e,t){E.YM.__h&&E.YM.__h(S,e,O||t),O=0;var n=S.__H||(S.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:N}),n.__[e]}function o(e){return O=1,i(w,e)}function i(e,t,n){var o=r(k++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):w(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=S,!S.u)){var i=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!a||a.call(this,e,t,n);var i=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&o.__c.props===e)&&(!a||a.call(this,e,t,n))};S.u=!0;var a=S.shouldComponentUpdate,l=S.componentWillUpdate;S.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}l&&l.call(this,e,t,n)},S.shouldComponentUpdate=i}return o.__N||o.__}function a(e,t){var n=r(k++,3);!E.YM.__s&&b(n.__H,t)&&(n.__=e,n.i=t,S.__H.__h.push(n))}function l(e,t){var n=r(k++,4);!E.YM.__s&&b(n.__H,t)&&(n.__=e,n.i=t,S.__h.push(n))}function u(e){return O=5,c((function(){return{current:e}}),[])}function s(e,t,n){O=6,l((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function c(e,t){var n=r(k++,7);return b(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function f(e,t){return O=8,c((function(){return e}),t)}function _(e){var t=S.context[e.__c],n=r(k++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(S)),t.props.value):e.__}function p(e,t){E.YM.useDebugValue&&E.YM.useDebugValue(t?t(e):e)}function d(e){var t=r(k++,10),n=o();return t.__=e,S.componentDidCatch||(S.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function h(){var e=r(k++,11);if(!e.__){for(var t=S.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function v(){for(var e;e=P.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(m),e.__H.__h.forEach(g),e.__H.__h=[]}catch(t){e.__H.__h=[],E.YM.__e(t,e.__v)}}function y(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function m(e){var t=S,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),S=t}function g(e){var t=S;e.__c=e.__(),S=t}function b(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function w(e,t){return"function"==typeof t?t(e):t}n.d(t,{I4:()=>f,Me:()=>h,Qb:()=>p,Ye:()=>c,_Y:()=>i,aP:()=>s,bt:()=>l,cO:()=>d,d4:()=>a,eJ:()=>o,qp:()=>_,sO:()=>u});var k,S,x,C,E=n(400),O=0,P=[],N=[],A=E.YM.__b,$=E.YM.__r,j=E.YM.diffed,M=E.YM.__c,L=E.YM.unmount;E.YM.__b=function(e){S=null,A&&A(e)},E.YM.__r=function(e){$&&$(e),k=0;var t=(S=e.__c).__H;t&&(x===S?(t.__h=[],S.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=N,e.__N=e.i=void 0}))):(t.__h.forEach(m),t.__h.forEach(g),t.__h=[],k=0)),x=S},E.YM.diffed=function(e){j&&j(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==P.push(t)&&C===E.YM.requestAnimationFrame||((C=E.YM.requestAnimationFrame)||y)(v)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==N&&(e.__=e.__V),e.i=void 0,e.__V=N}))),x=S=null},E.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(m),e.__h=e.__h.filter((function(e){return!e.__||g(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],E.YM.__e(n,e.__v)}})),M&&M(e,t)},E.YM.unmount=function(e){L&&L(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{m(e)}catch(e){t=e}})),n.__H=void 0,t&&E.YM.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame},325:(e,t,n)=>{var r=function(e){function t(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function n(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function r(e,o,l,u,s,c){for(var _ in l)if(l.hasOwnProperty(_)&&l[_]){var p=l[_];p=Array.isArray(p)?p:[p];for(var d=0;d=c.reach);S+=k.value.length,k=k.next){var x=k.value;if(o.length>e.length)return;if(!(x instanceof t)){var C,E=1;if(m){if(!(C=n(w,S,e,y))||C.index>=e.length)break;var O=C.index,P=C.index+C[0].length,N=S;for(N+=k.value.length;O>=N;)N+=(k=k.next).value.length;if(S=N-=k.value.length,k.value instanceof t)continue;for(var A=k;A!==o.tail&&(Nc.reach&&(c.reach=L);var T=k.prev;if(j&&(T=i(o,T,j),S+=j.length),a(o,T,E),k=i(o,T,new t(_,v?f.tokenize($,v):$,g,$)),M&&i(o,k,M),E>1){var I={cause:_+","+d,reach:L};r(e,o,l,k.prev,S,I),c&&I.reach>c.reach&&(c.reach=I.reach)}}}}}}function o(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function i(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function a(e,t,n){for(var r=t.next,o=0;o"+o.content+""},!e.document)return e.addEventListener?(f.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.immediateClose;e.postMessage(f.highlight(n.code,f.languages[r],r)),o&&e.close()}),!1),f):f;var _=f.util.currentScript();if(_&&(f.filename=_.src,_.hasAttribute("data-manual")&&(f.manual=!0)),!f.manual){var p=document.readyState;"loading"===p||"interactive"===p&&_&&_.defer?document.addEventListener("DOMContentLoaded",l):window.requestAnimationFrame?window.requestAnimationFrame(l):window.setTimeout(l,16)}return f}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r)},277:()=>{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},759:()=>{!function(){function e(e){if(0!=(e=e.filter((function(e){var t=function(e){if(!e)return null;return window.getComputedStyle?getComputedStyle(e):e.currentStyle||null}(e)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var t=e.map((function(e){var t=e.querySelector("code"),r=e.querySelector(".line-numbers-rows");if(t&&r){var o=e.querySelector(".line-numbers-sizer"),i=t.textContent.split(n);o||((o=document.createElement("span")).className="line-numbers-sizer",t.appendChild(o)),o.innerHTML="0",o.style.display="block";var a=o.getBoundingClientRect().height;return o.innerHTML="",{element:e,lines:i,lineHeights:[],oneLinerHeight:a,sizer:o}}})).filter(Boolean);t.forEach((function(e){var t=e.sizer,n=e.lines,r=e.lineHeights,o=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach((function(e,n){if(e&&e.length>1){var i=t.appendChild(document.createElement("span"));i.style.display="block",i.textContent=e}else r[n]=o}))})),t.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,r=0,o=0;oi&&(n=i),r.children[n-o]}}},resize:function(t){e([t])},assumeViewportIndependence:!0},o=void 0;window.addEventListener("resize",(function(){r.assumeViewportIndependence&&o===window.innerWidth||(o=window.innerWidth,e(Array.prototype.slice.call(document.querySelectorAll("pre."+t))))})),Prism.hooks.add("complete",(function(r){if(r.code){var o=r.element,i=o.parentNode;if(i&&/pre/i.test(i.nodeName)&&!o.querySelector(".line-numbers-rows")&&Prism.util.isActive(o,t)){o.classList.remove(t),i.classList.add(t);var a,l=r.code.match(n),u=new Array((l?l.length+1:1)+1).join("");(a=document.createElement("span")).setAttribute("aria-hidden","true"),a.className="line-numbers-rows",a.innerHTML=u,i.hasAttribute("data-start")&&(i.style.counterReset="linenumber "+(parseInt(i.getAttribute("data-start"),10)-1)),r.element.appendChild(a),e([i]),Prism.hooks.run("line-numbers",r)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}}()},460:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1){t._history.stack=u.slice(0,s+1);var c=t._history.stack.length;if(c>100){var f=c-100;t._history.stack=u.slice(f,c),t._history.offset=Math.max(t._history.offset-f,0)}}var _=Date.now();if(n){var p=t._history.stack[t._history.offset];if(p&&_-p.timestamp<3e3){var d=/[^a-z0-9]([a-z0-9]+)$/i,h=null===(r=t._getLines(p.value,p.selectionStart).pop())||void 0===r?void 0:r.match(d),v=null===(o=t._getLines(e.value,e.selectionStart).pop())||void 0===o?void 0:o.match(d);if((null==h?void 0:h[1])&&(null===(a=null==v?void 0:v[1])||void 0===a?void 0:a.startsWith(h[1])))return void(t._history.stack[t._history.offset]=i(i({},e),{timestamp:_}))}}t._history.stack.push(i(i({},e),{timestamp:_})),t._history.offset++},t._updateInput=function(e){var n=t._input;n&&(n.value=e.value,n.selectionStart=e.selectionStart,n.selectionEnd=e.selectionEnd,t.props.onValueChange(e.value))},t._applyEdits=function(e){var n=t._input,r=t._history.stack[t._history.offset];r&&n&&(t._history.stack[t._history.offset]=i(i({},r),{selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})),t._recordChange(e),t._updateInput(e)},t._undoEdit=function(){var e=t._history,n=e.offset,r=e.stack[n-1];r&&(t._updateInput(r),t._history.offset=Math.max(n-1,0))},t._redoEdit=function(){var e=t._history,n=e.stack,r=e.offset,o=n[r+1];o&&(t._updateInput(o),t._history.offset=Math.min(r+1,n.length-1))},t._handleKeyDown=function(e){var n=t.props,r=n.tabSize,o=n.insertSpaces,i=n.ignoreTabKey,a=n.onKeyDown;if(!a||(a(e),!e.defaultPrevented)){27===e.keyCode&&e.currentTarget.blur();var l=e.currentTarget,u=l.value,s=l.selectionStart,c=l.selectionEnd,p=(o?" ":"\t").repeat(r);if(9===e.keyCode&&!i&&t.state.capture)if(e.preventDefault(),e.shiftKey){var d=(y=t._getLines(u,s)).length-1,h=t._getLines(u,c).length-1,v=u.split("\n").map((function(e,t){return t>=d&&t<=h&&e.startsWith(p)?e.substring(p.length):e})).join("\n");if(u!==v)t._applyEdits({value:v,selectionStart:(null==(b=y[d])?void 0:b.startsWith(p))?s-p.length:s,selectionEnd:c-(u.length-v.length)})}else if(s!==c){var y,m=(y=t._getLines(u,s)).length-1,g=t._getLines(u,c).length-1,b=y[m];t._applyEdits({value:u.split("\n").map((function(e,t){return t>=m&&t<=g?p+e:e})).join("\n"),selectionStart:b&&/\S/.test(b)?s+p.length:s,selectionEnd:c+p.length*(g-m+1)})}else{var w=s+p.length;t._applyEdits({value:u.substring(0,s)+p+u.substring(c),selectionStart:w,selectionEnd:w})}else if(8===e.keyCode){var k=s!==c;if(u.substring(0,s).endsWith(p)&&!k){e.preventDefault();w=s-p.length;t._applyEdits({value:u.substring(0,s-p.length)+u.substring(c),selectionStart:w,selectionEnd:w})}}else if(13===e.keyCode){if(s===c){var S=t._getLines(u,s).pop(),x=null==S?void 0:S.match(/^\s+/);if(null==x?void 0:x[0]){e.preventDefault();var C="\n"+x[0];w=s+C.length;t._applyEdits({value:u.substring(0,s)+C+u.substring(c),selectionStart:w,selectionEnd:w})}}}else if(57===e.keyCode||219===e.keyCode||222===e.keyCode||192===e.keyCode){var E=void 0;57===e.keyCode&&e.shiftKey?E=["(",")"]:219===e.keyCode?E=e.shiftKey?["{","}"]:["[","]"]:222===e.keyCode?E=e.shiftKey?['"','"']:["'","'"]:192!==e.keyCode||e.shiftKey||(E=["`","`"]),s!==c&&E&&(e.preventDefault(),t._applyEdits({value:u.substring(0,s)+E[0]+u.substring(s,c)+E[1]+u.substring(c),selectionStart:s,selectionEnd:c+2}))}else!(_?e.metaKey&&90===e.keyCode:e.ctrlKey&&90===e.keyCode)||e.shiftKey||e.altKey?(_?e.metaKey&&90===e.keyCode&&e.shiftKey:f?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&90===e.keyCode&&e.shiftKey)&&!e.altKey?(e.preventDefault(),t._redoEdit()):77!==e.keyCode||!e.ctrlKey||_&&!e.shiftKey||(e.preventDefault(),t.setState((function(e){return{capture:!e.capture}}))):(e.preventDefault(),t._undoEdit())}},t._handleChange=function(e){var n=e.currentTarget,r=n.value;t._recordChange({value:r,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd},!0),t.props.onValueChange(r)},t._history={stack:[],offset:-1},t._input=null,t}return o(t,e),t.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(t.prototype,"session",{get:function(){return{history:this._history}},set:function(e){this._history=e.history},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props,n=t.value,r=t.style,o=t.padding,a=t.highlight,l=t.textareaId,u=t.textareaClassName,f=t.autoFocus,_=t.disabled,h=t.form,y=t.maxLength,m=t.minLength,g=t.name,b=t.placeholder,w=t.readOnly,k=t.required,S=t.onClick,x=t.onFocus,C=t.onBlur,E=t.onKeyUp,O=t.preClassName,P=s(t,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),N={paddingTop:o,paddingRight:o,paddingBottom:o,paddingLeft:o},A=a(n);return c.createElement("div",i({},P,{style:i(i({},v.container),r)}),c.createElement("textarea",{ref:function(t){return e._input=t},style:i(i(i({},v.editor),v.textarea),N),className:p+(u?" ".concat(u):""),id:l,value:n,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:S,onKeyUp:E,onFocus:x,onBlur:C,disabled:_,form:h,maxLength:y,minLength:m,name:g,placeholder:b,readOnly:w,required:k,autoFocus:f,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),c.createElement("pre",i({className:O,"aria-hidden":"true",style:i(i(i({},v.editor),v.highlight),N)},"string"==typeof A?{dangerouslySetInnerHTML:{__html:A+"
"}}:{children:A})),c.createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:d}}))},t.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},t}(c.Component);t.default=h;var v={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}}}},n={};e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.p="/",(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e,n,r){return(n=function(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(yield fetch(e,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":n},body:JSON.stringify(t)})).json()},function(){var t=this,n=arguments;return new Promise((function(r,o){function i(e){a(u,r,o,i,l,"next",e)}function l(e){a(u,r,o,i,l,"throw",e)}var u=e.apply(t,n);i(void 0)}))})).apply(this,arguments);var e}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===u(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2?"+ ".concat(E()("other",p-2,!0)):"";return(0,m.h)("div",{className:P()((t={},n(t,N.info_block,!0),n(t,N.info_block_collapsible,l.collapsible||!1),n(t,N.info_block_collapsed,s),t))},(0,m.h)("h5",{className:N.info_label,onClick:f},o),l.collapsible?(0,m.h)($,null,(0,m.h)("div",{className:P()(n({},N.info_block_inner,!0))},_?i.map((function(e){return(0,m.h)("span",{key:e,className:N.info_block_item},e)})):(0,m.h)("span",null,i)),(0,m.h)("span",{className:N.info_block_teaser,onClick:f},_?" ".concat(i.slice(0,2).join(", ")," ").concat(d):"Click to show")):(0,m.h)("span",null,_?i.join(", "):i))},L=e(325),T=(e(759),e(277),e(460)),I=e.n(T),R=e(152),q=e.n(R);const D="collapsible_list__PJS0Z",H="collapsible_list_details__u5Pq3",Y="visible__M2eJW";var z=function(e){var t,n=e.list,r=void 0===n?[]:n,o=e.title,i=void 0===o?"View":o,a=c((0,g.eJ)(!1),2),l=a[0],u=a[1],f=i.toLowerCase();return(0,m.h)("div",{className:P()((t={},s(t,D,!0),s(t,Y,l),t))},(0,m.h)("strong",{className:"".concat(f," vip-h4"),onClick:r.length?function(){u(!l)}:null},i," (","".concat(r.length),")"),(0,m.h)("ol",{className:"".concat(H," ").concat(f," vip-collapse-ol")},r.map((function(e,t){return(0,m.h)("li",{key:t},e)}))))};const U="query_wrap__uIeve",W="query_result__k_RWY",V="query_actions__ImK9_",F="query_handle__e0c8G",B="query_collapsed__PGXWS",K="grid_container__esEnb",J="query_src_header__wWAup",G="query_res_header__DMOpO",Z="query_src__MoJsW",Q="query_res__FZmqB",X="query_src_extra__aZwxj",ee="container_editor___Y1qC",te="container_editor_line_number__FU7Ow";var ne=e(400).HY,re=function(e){var t,n,r,o=e.request,i=e.url,a=e.query_args,u=e.backtrace,s=void 0===u?[]:u,c=JSON.stringify(e.args.body,null,2),f=JSON.stringify(o.body,null,2),h={editing:!1,query:c,result:f,collapsed:!0},v=d((0,g.eJ)(h),2),y=v[0],b=v[1],w="#query-response-copy-handle",k=(0,g.I4)((function(e){return(t=t||(n=function*(e){try{var t=yield l(window.VIPSearchDevTools.ajaxurl,{action:window.VIPSearchDevTools.action,url:i,query:e},window.VIPSearchDevTools.nonce);b((function(e){var n;return _({},e,{result:JSON.stringify(null==t||null===(n=t.result)||void 0===n?void 0:n.body,null,2)})}))}catch(e){console.log(e)}},function(){var e=this,t=arguments;return new Promise((function(r,o){function i(e){p(l,r,o,i,a,"next",e)}function a(e){p(l,r,o,i,a,"throw",e)}var l=n.apply(e,t);i(void 0)}))})).apply(this,arguments);var n}),[i]);(0,g.d4)((function(){var e=new(q())(w);return e.on("success",(function(e){document.querySelector(w).innerHTML="COPIED!",setTimeout((function(){document.querySelector(w).innerHTML="COPY"}),2e3),e.clearSelection()})),function(){return e.destroy()}}),[]),(0,g.d4)((function(){y.query!==h.query&&(y.editing||k(y.query))}),[y.query,y.editing,h.query,k]);var S;return(0,m.h)("div",{className:P()(U,y.collapsed?B:null)},(0,m.h)("div",{className:F,onClick:function(){return b(_({},y,{collapsed:!y.collapsed}))}},(0,m.h)("h3",{className:"vip-h3"},E()("result",(null==o||null===(n=o.body)||void 0===n||null===(n=n.hits)||void 0===n||null===(n=n.hits)||void 0===n?void 0:n.length)||0,!0),(0,m.h)("span",{style:"color: var(--vip-grey-60);"}," that took")," ",(0,m.h)("span",{style:{color:"var(--vip-".concat((S=o.body.took)<200?"green-60":S<500?"red-30":"red-60",")"),fontWeight:"bold"}},S,"ms"),(0,m.h)("small",null," (",(null==o||null===(r=o.response)||void 0===r?void 0:r.code)||"unknown",")"))),(0,m.h)("div",{className:K},(0,m.h)("div",{className:J},(0,m.h)("span",{style:"margin-right: auto;"},"Request"),(0,m.h)("div",{className:X},(0,m.h)(z,{title:"WP_Query",list:Object.entries(a).map((function(e){var t=d(e,2),n=t[1];return"".concat(t[0],": ").concat(JSON.stringify(n))}))}),(0,m.h)(z,{title:"Trace",list:s}))),(0,m.h)("div",{className:G},"Response"),(0,m.h)("div",{className:"".concat(Z," query-src-box")},(0,m.h)("div",{className:V},y.editing||y.result!==f?(0,m.h)(ne,null,(0,m.h)("button",{onClick:function(){return b(_({},y,{editing:!1}))},style:"background-color: var(--vip-green-40) !important"},"RUN"),(0,m.h)("button",{onClick:function(){return b(_({},h,{collapsed:!1}))},style:"background-color: var(--vip-blue-10) !important"},"RESET")):"Edit me!"),(0,m.h)(I(),{value:y.query,onValueChange:function(e){return b(_({},y,{query:e,editing:!0}))},highlight:function(e){return(0,L.highlight)(e,L.languages.json,"json").split("\n").map((function(e){return'').concat(e,"")})).join("\n")},padding:0,className:ee,style:{fontSize:"var(--vip-sdt-editor-font-size)",lineHeight:"1.2em"}})),(0,m.h)("div",{className:"".concat(Q," query-result-box")},(0,m.h)("div",{className:W},(0,m.h)("div",{className:V},(0,m.h)("button",{id:"query-response-copy-handle","data-clipboard-target":"#query-response-text"},"COPY")),(0,m.h)("pre",{className:"line-numbers"},(0,m.h)("code",{className:"language-json",id:"query-response-text"},y.result))))))},oe=function(){var e=(0,g.qp)(x).queries;return(0,m.h)("div",null,e.length<1?"No queries to show":e.map((function(e,t){return(0,m.h)(re,_({key:t},e))})))},ie=function(e){var t=(0,g.qp)(x).queries;return(0,m.h)("button",e,"Search: ",E()("query",t.length,!0))};const ae=function(){var e,t=v((0,g.eJ)(!1),2),n=t[0],r=t[1],o=(0,g.I4)((function(){return r(!1)}),[]),i=(0,g.I4)((function(){return r(!n)}),[n]);return(0,m.h)(x.Provider,{value:(null===(e=window)||void 0===e?void 0:e.VIPSearchDevTools)||{status:"disabled",queries:[],information:[]}},(0,m.h)("div",{className:"search-dev-tools__wrapper"},(0,m.h)(ie,{class:k,onClick:i}),(0,b.createPortal)((0,m.h)(S,{isVisible:n,closeOverlay:o,opacity:"100"},(0,m.h)("div",{className:w},(0,m.h)("h4",{className:"vip-h4 main_caption"},"Enterprise Search Dev Tools"),(0,m.h)(j,null),(0,m.h)(oe,null))),document.getElementById("search-dev-tools-portal"))))};var le=function(){return(0,m.sY)((0,m.h)(ae,null),document.querySelector('[data-widget-host="vip-search-dev-tools"]'))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",le):le()})()})(); \ No newline at end of file +(()=>{function e(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return t[r].call(i.exports,i,i.exports,e),i.exports}var t={798:(e,t,n)=>{n.p=window.VIPSearchDevTools.__webpack_public_path__},184:(e,t)=>{var n;!function(){"use strict";function r(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=g(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=g(e.value,t):(n=y()(e),r("copy")),n},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,i=e.target,a=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==i){if(!i||"object"!==o(i)||1!==i.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(i.hasAttribute("readonly")||i.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return a?b(a,{container:r}):i?"cut"===n?m(i):b(i,{container:r}):void 0},k=function(e){function t(e,t){var n;return(n=s.call(this)).resolveOptions(t),n.listenClick(e),n}!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e);var n,r,o,s=u(t);return n=t,r=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===i(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=h()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=w({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return f("action",e)}},{key:"defaultTarget",value:function(e){var t=f("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return f("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],o=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return b(e,t)}},{key:"cut",value:function(e){return m(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t=!!document.queryCommandSupported;return("string"==typeof e?[e]:e).forEach((function(e){t=t&&!!document.queryCommandSupported(e)})),t}}],r&&a(n.prototype,r),o&&a(n,o),t}(p()),S=k},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){function r(e,t,n,r,i){var a=o.apply(this,arguments);return e.addEventListener(n,a,i),{destroy:function(){e.removeEventListener(n,a,i)}}}function o(e,t,n,r){return function(n){n.delegateTarget=i(n.target,t),n.delegateTarget&&r.call(e,n)}}var i=n(828);e.exports=function(e,t,n,o,i){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return r(e,t,n,o,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function r(){o.off(e,r),t.apply(n,arguments)}var o=this;return r._=t,this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r{"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function i(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function a(e){this.props=e}function l(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:o(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,M.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}function u(e){function t(t){var n=r({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=I,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}function s(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=r({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return s(e,t,n)}))),e}function c(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return c(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function f(){this.__u=0,this.t=null,this.__b=null}function _(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function p(e){function t(t){if(n||(n=e()).then((function(e){r=e.default||e}),(function(e){o=e})),o)throw o;if(!r)throw n;return(0,M.az)(r,t)}var n,r,o;return t.displayName="Lazy",t.__f=!0,t}function d(){this.u=null,this.o=null}function h(e){return this.getChildContext=function(){return e.context},e.children}function v(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,M.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,M.sY)((0,M.az)(h,{context:t.context},e.__v),t.l)}function y(e,t){var n=(0,M.az)(v,{__v:e,i:t});return n.containerInfo=t,n}function m(e,t,n){return null==t.__k&&(t.textContent=""),(0,M.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function g(e,t,n){return(0,M.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}function b(){}function w(){return this.cancelBubble}function k(){return this.defaultPrevented}function S(e){return M.az.bind(null,e)}function x(e){return!!e&&e.$$typeof===z}function C(e){return x(e)&&e.type===M.HY}function E(e){return x(e)?M.Tm.apply(null,arguments):e}function O(e){return!!e.__k&&((0,M.sY)(null,e),!0)}function P(e){return e&&(e.base||1===e.nodeType&&e)||null}function N(e){e()}function A(e){return e}function $(){return[!1,N]}function j(e,t){var n=t(),r=(0,L.eJ)({h:{__:n,v:t}}),o=r[0].h,a=r[1];return(0,L.bt)((function(){o.__=n,o.v=t,i(o.__,t())||a({h:o})}),[e,n,t]),(0,L.d4)((function(){return i(o.__,o.v())||a({h:o}),e((function(){i(o.__,o.v())||a({h:o})}))}),[e]),n}n.r(t),n.d(t,{Children:()=>q,Component:()=>M.wA,Fragment:()=>M.HY,PureComponent:()=>a,StrictMode:()=>oe,Suspense:()=>f,SuspenseList:()=>d,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>ee,cloneElement:()=>E,createContext:()=>M.kr,createElement:()=>M.az,createFactory:()=>S,createPortal:()=>y,createRef:()=>M.Vf,default:()=>le,findDOMNode:()=>P,flushSync:()=>re,forwardRef:()=>u,hydrate:()=>g,isElement:()=>ae,isFragment:()=>C,isValidElement:()=>x,lazy:()=>p,memo:()=>l,render:()=>m,startTransition:()=>N,unmountComponentAtNode:()=>O,unstable_batchedUpdates:()=>ne,useCallback:()=>L.I4,useContext:()=>L.qp,useDebugValue:()=>L.Qb,useDeferredValue:()=>A,useEffect:()=>L.d4,useErrorBoundary:()=>L.cO,useId:()=>L.Me,useImperativeHandle:()=>L.aP,useInsertionEffect:()=>ie,useLayoutEffect:()=>L.bt,useMemo:()=>L.Ye,useReducer:()=>L._Y,useRef:()=>L.sO,useState:()=>L.eJ,useSyncExternalStore:()=>j,useTransition:()=>$,version:()=>te});var M=n(400),L=n(396);(a.prototype=new M.wA).isPureReactComponent=!0,a.prototype.shouldComponentUpdate=function(e,t){return o(this.props,e)||o(this.state,t)};var T=M.YM.__b;M.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),T&&T(e)};var I="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911,R=function(e,t){return null==e?null:(0,M.bR)((0,M.bR)(e).map(t))},q={map:R,forEach:R,count:function(e){return e?(0,M.bR)(e).length:0},only:function(e){var t=(0,M.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:M.bR},D=M.YM.__e;M.YM.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);D(e,t,n,r)};var H=M.YM.unmount;M.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),H&&H(e)},(f.prototype=new M.wA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=_(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=c(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},u=!0===t.__h;r.__u++||u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},f.prototype.componentWillUnmount=function(){this.t=[]},f.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=s(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,M.az)(M.HY,null,e.fallback);return o&&(o.__h=null),[(0,M.az)(M.HY,null,t.__a?null:e.children),o]};var Y=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]{"use strict";function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function i(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?M.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return a(e,l,r,o,null)}function a(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++T:o};return null==o&&null!=L.vnode&&L.vnode(i),i}function l(){return{current:null}}function u(e){return e.children}function s(e,t){this.props=e,this.context=t}function c(e,t){if(null==t)return e.__?c(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&I.sort(D));p.__r=0}function d(e,t,n,r,o,i,l,s,f,_,p){var d,v,g,b,w,k,x,C,P,N=0,A=r&&r.__k||z,$=A.length,j=$,M=t.length;for(n.__k=[],d=0;d0?a(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)?(b.__=n,b.__b=n.__b+1,-1===(C=m(b,A,x=d+N,j))?g=Y:(g=A[C]||Y,A[C]=void 0,j--),S(e,b,g,o,i,l,s,f,_,p),w=b.__e,(v=b.ref)&&g.ref!=v&&(g.ref&&E(g.ref,null,b),p.push(v,b.__c||w,b)),null!=w&&(null==k&&(k=w),(P=g===Y||null===g.__v)?-1==C&&N--:C!==x&&(C===x+1?N++:C>x?j>M-x?N+=C-x:N--:N=C(null!=u?1:0))for(;a>=0||l=0){if((u=t[a])&&o==u.key&&i===u.type)return a;a--}if(l2&&(s.children=arguments.length>3?M.call(arguments,2):n),a(e.type,s,o||e.key,i||e.ref,null)}function j(e,t){var n={__c:t="__cC"+H++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,_(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}n.d(t,{HY:()=>u,Tm:()=>$,Vf:()=>l,YM:()=>L,ZB:()=>A,az:()=>i,bR:()=>v,h:()=>i,kr:()=>j,sY:()=>N,wA:()=>s});var M,L,T,I,R,q,D,H,Y={},z=[],U=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,W=Array.isArray;M=z.slice,L={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},T=0,s.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=r({},this.state),"function"==typeof e&&(e=e(r({},n),this.props)),e&&r(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),_(this))},s.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},s.prototype.render=u,I=[],q="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,D=function(e,t){return e.__v.__b-t.__v.__b},p.__r=0,H=0},396:(e,t,n)=>{"use strict";function r(e,t){E.YM.__h&&E.YM.__h(S,e,O||t),O=0;var n=S.__H||(S.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:N}),n.__[e]}function o(e){return O=1,i(w,e)}function i(e,t,n){var o=r(k++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):w(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=S,!S.u)){var i=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!a||a.call(this,e,t,n);var i=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&o.__c.props===e)&&(!a||a.call(this,e,t,n))};S.u=!0;var a=S.shouldComponentUpdate,l=S.componentWillUpdate;S.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}l&&l.call(this,e,t,n)},S.shouldComponentUpdate=i}return o.__N||o.__}function a(e,t){var n=r(k++,3);!E.YM.__s&&b(n.__H,t)&&(n.__=e,n.i=t,S.__H.__h.push(n))}function l(e,t){var n=r(k++,4);!E.YM.__s&&b(n.__H,t)&&(n.__=e,n.i=t,S.__h.push(n))}function u(e){return O=5,c((function(){return{current:e}}),[])}function s(e,t,n){O=6,l((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function c(e,t){var n=r(k++,7);return b(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function f(e,t){return O=8,c((function(){return e}),t)}function _(e){var t=S.context[e.__c],n=r(k++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(S)),t.props.value):e.__}function p(e,t){E.YM.useDebugValue&&E.YM.useDebugValue(t?t(e):e)}function d(e){var t=r(k++,10),n=o();return t.__=e,S.componentDidCatch||(S.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function h(){var e=r(k++,11);if(!e.__){for(var t=S.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function v(){for(var e;e=P.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(m),e.__H.__h.forEach(g),e.__H.__h=[]}catch(t){e.__H.__h=[],E.YM.__e(t,e.__v)}}function y(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function m(e){var t=S,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),S=t}function g(e){var t=S;e.__c=e.__(),S=t}function b(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function w(e,t){return"function"==typeof t?t(e):t}n.d(t,{I4:()=>f,Me:()=>h,Qb:()=>p,Ye:()=>c,_Y:()=>i,aP:()=>s,bt:()=>l,cO:()=>d,d4:()=>a,eJ:()=>o,qp:()=>_,sO:()=>u});var k,S,x,C,E=n(400),O=0,P=[],N=[],A=E.YM.__b,$=E.YM.__r,j=E.YM.diffed,M=E.YM.__c,L=E.YM.unmount;E.YM.__b=function(e){S=null,A&&A(e)},E.YM.__r=function(e){$&&$(e),k=0;var t=(S=e.__c).__H;t&&(x===S?(t.__h=[],S.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=N,e.__N=e.i=void 0}))):(t.__h.forEach(m),t.__h.forEach(g),t.__h=[],k=0)),x=S},E.YM.diffed=function(e){j&&j(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==P.push(t)&&C===E.YM.requestAnimationFrame||((C=E.YM.requestAnimationFrame)||y)(v)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==N&&(e.__=e.__V),e.i=void 0,e.__V=N}))),x=S=null},E.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(m),e.__h=e.__h.filter((function(e){return!e.__||g(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],E.YM.__e(n,e.__v)}})),M&&M(e,t)},E.YM.unmount=function(e){L&&L(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{m(e)}catch(e){t=e}})),n.__H=void 0,t&&E.YM.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame},325:(e,t,n)=>{var r=function(e){function t(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function n(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function r(e,o,l,u,s,c){for(var _ in l)if(l.hasOwnProperty(_)&&l[_]){var p=l[_];p=Array.isArray(p)?p:[p];for(var d=0;d=c.reach);S+=k.value.length,k=k.next){var x=k.value;if(o.length>e.length)return;if(!(x instanceof t)){var C,E=1;if(m){if(!(C=n(w,S,e,y))||C.index>=e.length)break;var O=C.index,P=C.index+C[0].length,N=S;for(N+=k.value.length;O>=N;)N+=(k=k.next).value.length;if(S=N-=k.value.length,k.value instanceof t)continue;for(var A=k;A!==o.tail&&(Nc.reach&&(c.reach=L);var T=k.prev;if(j&&(T=i(o,T,j),S+=j.length),a(o,T,E),k=i(o,T,new t(_,v?f.tokenize($,v):$,g,$)),M&&i(o,k,M),E>1){var I={cause:_+","+d,reach:L};r(e,o,l,k.prev,S,I),c&&I.reach>c.reach&&(c.reach=I.reach)}}}}}}function o(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function i(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function a(e,t,n){for(var r=t.next,o=0;o"+o.content+""},!e.document)return e.addEventListener?(f.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.immediateClose;e.postMessage(f.highlight(n.code,f.languages[r],r)),o&&e.close()}),!1),f):f;var _=f.util.currentScript();if(_&&(f.filename=_.src,_.hasAttribute("data-manual")&&(f.manual=!0)),!f.manual){var p=document.readyState;"loading"===p||"interactive"===p&&_&&_.defer?document.addEventListener("DOMContentLoaded",l):window.requestAnimationFrame?window.requestAnimationFrame(l):window.setTimeout(l,16)}return f}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r)},277:()=>{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},759:()=>{!function(){function e(e){if(0!=(e=e.filter((function(e){var t=function(e){if(!e)return null;return window.getComputedStyle?getComputedStyle(e):e.currentStyle||null}(e)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var t=e.map((function(e){var t=e.querySelector("code"),r=e.querySelector(".line-numbers-rows");if(t&&r){var o=e.querySelector(".line-numbers-sizer"),i=t.textContent.split(n);o||((o=document.createElement("span")).className="line-numbers-sizer",t.appendChild(o)),o.innerHTML="0",o.style.display="block";var a=o.getBoundingClientRect().height;return o.innerHTML="",{element:e,lines:i,lineHeights:[],oneLinerHeight:a,sizer:o}}})).filter(Boolean);t.forEach((function(e){var t=e.sizer,n=e.lines,r=e.lineHeights,o=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach((function(e,n){if(e&&e.length>1){var i=t.appendChild(document.createElement("span"));i.style.display="block",i.textContent=e}else r[n]=o}))})),t.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,r=0,o=0;oi&&(n=i),r.children[n-o]}}},resize:function(t){e([t])},assumeViewportIndependence:!0},o=void 0;window.addEventListener("resize",(function(){r.assumeViewportIndependence&&o===window.innerWidth||(o=window.innerWidth,e(Array.prototype.slice.call(document.querySelectorAll("pre."+t))))})),Prism.hooks.add("complete",(function(r){if(r.code){var o=r.element,i=o.parentNode;if(i&&/pre/i.test(i.nodeName)&&!o.querySelector(".line-numbers-rows")&&Prism.util.isActive(o,t)){o.classList.remove(t),i.classList.add(t);var a,l=r.code.match(n),u=new Array((l?l.length+1:1)+1).join("");(a=document.createElement("span")).setAttribute("aria-hidden","true"),a.className="line-numbers-rows",a.innerHTML=u,i.hasAttribute("data-start")&&(i.style.counterReset="linenumber "+(parseInt(i.getAttribute("data-start"),10)-1)),r.element.appendChild(a),e([i]),Prism.hooks.run("line-numbers",r)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}}()},460:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1){t._history.stack=u.slice(0,s+1);var c=t._history.stack.length;if(c>100){var f=c-100;t._history.stack=u.slice(f,c),t._history.offset=Math.max(t._history.offset-f,0)}}var _=Date.now();if(n){var p=t._history.stack[t._history.offset];if(p&&_-p.timestamp<3e3){var d=/[^a-z0-9]([a-z0-9]+)$/i,h=null===(r=t._getLines(p.value,p.selectionStart).pop())||void 0===r?void 0:r.match(d),v=null===(o=t._getLines(e.value,e.selectionStart).pop())||void 0===o?void 0:o.match(d);if((null==h?void 0:h[1])&&(null===(a=null==v?void 0:v[1])||void 0===a?void 0:a.startsWith(h[1])))return void(t._history.stack[t._history.offset]=i(i({},e),{timestamp:_}))}}t._history.stack.push(i(i({},e),{timestamp:_})),t._history.offset++},t._updateInput=function(e){var n=t._input;n&&(n.value=e.value,n.selectionStart=e.selectionStart,n.selectionEnd=e.selectionEnd,t.props.onValueChange(e.value))},t._applyEdits=function(e){var n=t._input,r=t._history.stack[t._history.offset];r&&n&&(t._history.stack[t._history.offset]=i(i({},r),{selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})),t._recordChange(e),t._updateInput(e)},t._undoEdit=function(){var e=t._history,n=e.offset,r=e.stack[n-1];r&&(t._updateInput(r),t._history.offset=Math.max(n-1,0))},t._redoEdit=function(){var e=t._history,n=e.stack,r=e.offset,o=n[r+1];o&&(t._updateInput(o),t._history.offset=Math.min(r+1,n.length-1))},t._handleKeyDown=function(e){var n=t.props,r=n.tabSize,o=n.insertSpaces,i=n.ignoreTabKey,a=n.onKeyDown;if(!a||(a(e),!e.defaultPrevented)){27===e.keyCode&&e.currentTarget.blur();var l=e.currentTarget,u=l.value,s=l.selectionStart,c=l.selectionEnd,p=(o?" ":"\t").repeat(r);if(9===e.keyCode&&!i&&t.state.capture)if(e.preventDefault(),e.shiftKey){var d=(y=t._getLines(u,s)).length-1,h=t._getLines(u,c).length-1,v=u.split("\n").map((function(e,t){return t>=d&&t<=h&&e.startsWith(p)?e.substring(p.length):e})).join("\n");if(u!==v)t._applyEdits({value:v,selectionStart:(null==(b=y[d])?void 0:b.startsWith(p))?s-p.length:s,selectionEnd:c-(u.length-v.length)})}else if(s!==c){var y,m=(y=t._getLines(u,s)).length-1,g=t._getLines(u,c).length-1,b=y[m];t._applyEdits({value:u.split("\n").map((function(e,t){return t>=m&&t<=g?p+e:e})).join("\n"),selectionStart:b&&/\S/.test(b)?s+p.length:s,selectionEnd:c+p.length*(g-m+1)})}else{var w=s+p.length;t._applyEdits({value:u.substring(0,s)+p+u.substring(c),selectionStart:w,selectionEnd:w})}else if(8===e.keyCode){var k=s!==c;if(u.substring(0,s).endsWith(p)&&!k){e.preventDefault();w=s-p.length;t._applyEdits({value:u.substring(0,s-p.length)+u.substring(c),selectionStart:w,selectionEnd:w})}}else if(13===e.keyCode){if(s===c){var S=t._getLines(u,s).pop(),x=null==S?void 0:S.match(/^\s+/);if(null==x?void 0:x[0]){e.preventDefault();var C="\n"+x[0];w=s+C.length;t._applyEdits({value:u.substring(0,s)+C+u.substring(c),selectionStart:w,selectionEnd:w})}}}else if(57===e.keyCode||219===e.keyCode||222===e.keyCode||192===e.keyCode){var E=void 0;57===e.keyCode&&e.shiftKey?E=["(",")"]:219===e.keyCode?E=e.shiftKey?["{","}"]:["[","]"]:222===e.keyCode?E=e.shiftKey?['"','"']:["'","'"]:192!==e.keyCode||e.shiftKey||(E=["`","`"]),s!==c&&E&&(e.preventDefault(),t._applyEdits({value:u.substring(0,s)+E[0]+u.substring(s,c)+E[1]+u.substring(c),selectionStart:s,selectionEnd:c+2}))}else!(_?e.metaKey&&90===e.keyCode:e.ctrlKey&&90===e.keyCode)||e.shiftKey||e.altKey?(_?e.metaKey&&90===e.keyCode&&e.shiftKey:f?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&90===e.keyCode&&e.shiftKey)&&!e.altKey?(e.preventDefault(),t._redoEdit()):77!==e.keyCode||!e.ctrlKey||_&&!e.shiftKey||(e.preventDefault(),t.setState((function(e){return{capture:!e.capture}}))):(e.preventDefault(),t._undoEdit())}},t._handleChange=function(e){var n=e.currentTarget,r=n.value;t._recordChange({value:r,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd},!0),t.props.onValueChange(r)},t._history={stack:[],offset:-1},t._input=null,t}return o(t,e),t.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(t.prototype,"session",{get:function(){return{history:this._history}},set:function(e){this._history=e.history},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props,n=t.value,r=t.style,o=t.padding,a=t.highlight,l=t.textareaId,u=t.textareaClassName,f=t.autoFocus,_=t.disabled,h=t.form,y=t.maxLength,m=t.minLength,g=t.name,b=t.placeholder,w=t.readOnly,k=t.required,S=t.onClick,x=t.onFocus,C=t.onBlur,E=t.onKeyUp,O=t.preClassName,P=s(t,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),N={paddingTop:o,paddingRight:o,paddingBottom:o,paddingLeft:o},A=a(n);return c.createElement("div",i({},P,{style:i(i({},v.container),r)}),c.createElement("textarea",{ref:function(t){return e._input=t},style:i(i(i({},v.editor),v.textarea),N),className:p+(u?" ".concat(u):""),id:l,value:n,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:S,onKeyUp:E,onFocus:x,onBlur:C,disabled:_,form:h,maxLength:y,minLength:m,name:g,placeholder:b,readOnly:w,required:k,autoFocus:f,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),c.createElement("pre",i({className:O,"aria-hidden":"true",style:i(i(i({},v.editor),v.highlight),N)},"string"==typeof A?{dangerouslySetInnerHTML:{__html:A+"
"}}:{children:A})),c.createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:d}}))},t.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},t}(c.Component);t.default=h;var v={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}}}},n={};e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.p="/",(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e,n,r){return(n=function(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(yield fetch(e,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":n},body:JSON.stringify(t)})).json()},function(){var t=this,n=arguments;return new Promise((function(r,o){function i(e){a(u,r,o,i,l,"next",e)}function l(e){a(u,r,o,i,l,"throw",e)}var u=e.apply(t,n);i(void 0)}))})).apply(this,arguments);var e}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===u(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2?"+ ".concat(E()("other",p-2,!0)):"";return(0,m.h)("div",{className:P()((t={},n(t,N.info_block,!0),n(t,N.info_block_collapsible,l.collapsible||!1),n(t,N.info_block_collapsed,s),t))},(0,m.h)("h5",{className:N.info_label,onClick:f},o),l.collapsible?(0,m.h)($,null,(0,m.h)("div",{className:P()(n({},N.info_block_inner,!0))},_?i.map((function(e){return(0,m.h)("span",{key:e,className:N.info_block_item},e)})):(0,m.h)("span",null,i)),(0,m.h)("span",{className:N.info_block_teaser,onClick:f},_?" ".concat(i.slice(0,2).join(", ")," ").concat(d):"Click to show")):(0,m.h)("span",null,_?i.join(", "):i))},L=e(325),T=(e(759),e(277),e(460)),I=e.n(T),R=e(152),q=e.n(R);const D="collapsible_list__PJS0Z",H="collapsible_list_details__u5Pq3",Y="visible__M2eJW";var z=function(e){var t,n=e.list,r=void 0===n?[]:n,o=e.title,i=void 0===o?"View":o,a=c((0,g.eJ)(!1),2),l=a[0],u=a[1],f=i.toLowerCase();return(0,m.h)("div",{className:P()((t={},s(t,D,!0),s(t,Y,l),t))},(0,m.h)("strong",{className:"".concat(f," vip-h4"),onClick:r.length?function(){u(!l)}:null},i," (","".concat(r.length),")"),(0,m.h)("ol",{className:"".concat(H," ").concat(f," vip-collapse-ol")},r.map((function(e,t){return(0,m.h)("li",{key:t},e)}))))};const U="query_wrap__uIeve",W="query_result__k_RWY",V="query_actions__ImK9_",F="query_handle__e0c8G",B="query_collapsed__PGXWS",K="grid_container__esEnb",J="query_src_header__wWAup",G="query_res_header__DMOpO",Z="query_src__MoJsW",Q="query_res__FZmqB",X="query_src_extra__aZwxj",ee="container_editor___Y1qC",te="container_editor_line_number__FU7Ow";var ne=e(400).HY,re=function(e){var t,n,r,o=e.request,i=e.url,a=e.query_args,u=e.backtrace,s=void 0===u?[]:u,c=JSON.stringify(e.args.body,null,2),f=JSON.stringify(o.body,null,2),h={editing:!1,query:c,result:f,collapsed:!0},v=d((0,g.eJ)(h),2),y=v[0],b=v[1],w="#query-response-copy-handle",k=(0,g.I4)((function(e){return(t=t||(n=function*(e){try{var t=yield l(window.VIPSearchDevTools.ajaxurl,{action:window.VIPSearchDevTools.action,url:i,query:e},window.VIPSearchDevTools.nonce);b((function(e){var n;return _({},e,{result:JSON.stringify(null==t||null===(n=t.result)||void 0===n?void 0:n.body,null,2)})}))}catch(e){console.log(e)}},function(){var e=this,t=arguments;return new Promise((function(r,o){function i(e){p(l,r,o,i,a,"next",e)}function a(e){p(l,r,o,i,a,"throw",e)}var l=n.apply(e,t);i(void 0)}))})).apply(this,arguments);var n}),[i]);(0,g.d4)((function(){var e=new(q())(w);return e.on("success",(function(e){document.querySelector(w).innerHTML="COPIED!",setTimeout((function(){document.querySelector(w).innerHTML="COPY"}),2e3),e.clearSelection()})),function(){return e.destroy()}}),[]),(0,g.d4)((function(){y.query!==h.query&&(y.editing||k(y.query))}),[y.query,y.editing,h.query,k]);var S;return(0,m.h)("div",{className:P()(U,y.collapsed?B:null)},(0,m.h)("div",{className:F,onClick:function(){return b(_({},y,{collapsed:!y.collapsed}))}},(0,m.h)("h3",{className:"vip-h3"},E()("result",(null==o||null===(n=o.body)||void 0===n||null===(n=n.hits)||void 0===n||null===(n=n.hits)||void 0===n?void 0:n.length)||0,!0),(0,m.h)("span",{style:"color: var(--vip-grey-60);"}," that took")," ",(0,m.h)("span",{style:{color:"var(--vip-".concat((S=o.body.took)<200?"green-60":S<500?"red-30":"red-60",")"),fontWeight:"bold"}},S,"ms"),(0,m.h)("small",null," (",(null==o||null===(r=o.response)||void 0===r?void 0:r.code)||"unknown",")"))),(0,m.h)("div",{className:K},(0,m.h)("div",{className:J},(0,m.h)("span",{style:"margin-right: auto;"},"Request"),(0,m.h)("div",{className:X},(0,m.h)(z,{title:"WP_Query",list:Object.entries(a).map((function(e){var t=d(e,2),n=t[1];return"".concat(t[0],": ").concat(JSON.stringify(n))}))}),(0,m.h)(z,{title:"Trace",list:s}))),(0,m.h)("div",{className:G},"Response"),(0,m.h)("div",{className:"".concat(Z," query-src-box")},(0,m.h)("div",{className:V},y.editing||y.result!==f?(0,m.h)(ne,null,(0,m.h)("button",{onClick:function(){return b(_({},y,{editing:!1}))},style:"background-color: var(--vip-green-40) !important"},"RUN"),(0,m.h)("button",{onClick:function(){return b(_({},h,{collapsed:!1}))},style:"background-color: var(--vip-blue-10) !important"},"RESET")):"Edit me!"),(0,m.h)(I(),{value:y.query,onValueChange:function(e){return b(_({},y,{query:e,editing:!0}))},highlight:function(e){return(0,L.highlight)(e,L.languages.json,"json").split("\n").map((function(e){return'').concat(e,"")})).join("\n")},padding:0,className:ee,style:{fontSize:"var(--vip-sdt-editor-font-size)",lineHeight:"1.2em"}})),(0,m.h)("div",{className:"".concat(Q," query-result-box")},(0,m.h)("div",{className:W},(0,m.h)("div",{className:V},(0,m.h)("button",{id:"query-response-copy-handle","data-clipboard-target":"#query-response-text"},"COPY")),(0,m.h)("pre",{className:"line-numbers"},(0,m.h)("code",{className:"language-json",id:"query-response-text"},y.result))))))},oe=function(){var e=(0,g.qp)(x).queries;return(0,m.h)("div",null,e.length<1?"No queries to show":e.map((function(e,t){return(0,m.h)(re,_({key:t},e))})))},ie=function(e){var t=(0,g.qp)(x).queries;return(0,m.h)("button",e,"Search: ",E()("query",t.length,!0))};const ae=function(){var e,t=v((0,g.eJ)(!1),2),n=t[0],r=t[1],o=(0,g.I4)((function(){return r(!1)}),[]),i=(0,g.I4)((function(){return r(!n)}),[n]);return(0,m.h)(x.Provider,{value:(null===(e=window)||void 0===e?void 0:e.VIPSearchDevTools)||{status:"disabled",queries:[],information:[]}},(0,m.h)("div",{className:"search-dev-tools__wrapper"},(0,m.h)(ie,{class:k,onClick:i}),(0,b.createPortal)((0,m.h)(S,{isVisible:n,closeOverlay:o,opacity:"100"},(0,m.h)("div",{className:w},(0,m.h)("h4",{className:"vip-h4 main_caption"},"Enterprise Search Dev Tools"),(0,m.h)(j,null),(0,m.h)(oe,null))),document.getElementById("search-dev-tools-portal"))))};var le=function(){return(0,m.sY)((0,m.h)(ae,null),document.querySelector('[data-widget-host="vip-search-dev-tools"]'))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",le):le()})()})(); \ No newline at end of file diff --git a/search/search-dev-tools/package-lock.json b/search/search-dev-tools/package-lock.json index cf1471afef3..0d1ba2fa841 100644 --- a/search/search-dev-tools/package-lock.json +++ b/search/search-dev-tools/package-lock.json @@ -121,22 +121,22 @@ } }, "node_modules/@babel/core": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.20.tgz", - "integrity": "sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.0.tgz", + "integrity": "sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", + "@babel/generator": "^7.23.0", "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-module-transforms": "^7.22.20", - "@babel/helpers": "^7.22.15", - "@babel/parser": "^7.22.16", + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helpers": "^7.23.0", + "@babel/parser": "^7.23.0", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.22.20", - "@babel/types": "^7.22.19", - "convert-source-map": "^1.7.0", + "@babel/traverse": "^7.23.0", + "@babel/types": "^7.23.0", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", @@ -169,12 +169,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", - "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.22.15", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -289,13 +289,13 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -338,9 +338,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.20.tgz", - "integrity": "sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", + "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", @@ -489,14 +489,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.15.tgz", - "integrity": "sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.1.tgz", + "integrity": "sha512-chNpneuK18yW5Oxsr+t553UZzzAs3aZnFm4bxhebsNTeshrC95yA7l5yl7GBAG+JG1rF0F7zzD2EixK9mWSDoA==", "dev": true, "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/traverse": "^7.23.0", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -517,9 +517,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", - "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1793,19 +1793,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.20.tgz", - "integrity": "sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.0.tgz", + "integrity": "sha512-t/QaEvyIoIkwzpiZ7aoSKK8kObQYeF7T2v+dazAYCb8SXtp58zEVkWW7zAnju8FNKNdr4ScAOEDmMItbyOmEYw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", + "@babel/generator": "^7.23.0", "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.22.5", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.19", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1823,13 +1823,13 @@ } }, "node_modules/@babel/types": { - "version": "7.22.19", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.19.tgz", - "integrity": "sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.19", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -3469,9 +3469,9 @@ "dev": true }, "node_modules/autoprefixer": { - "version": "10.4.15", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.15.tgz", - "integrity": "sha512-KCuPB8ZCIqFdA4HwKXsvz7j6gvSDNhDP7WnUjBleRkKjPdvCmHFuQ77ocavI8FT6NdvlBnE2UFr2H4Mycn8Vew==", + "version": "10.4.16", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", + "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", "dev": true, "funding": [ { @@ -3489,8 +3489,8 @@ ], "dependencies": { "browserslist": "^4.21.10", - "caniuse-lite": "^1.0.30001520", - "fraction.js": "^4.2.0", + "caniuse-lite": "^1.0.30001538", + "fraction.js": "^4.3.6", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", "postcss-value-parser": "^4.2.0" @@ -3837,9 +3837,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001533", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001533.tgz", - "integrity": "sha512-9aY/b05NKU4Yl2sbcJhn4A7MsGwR1EPfW/nrqsnqVA0Oq50wpmPaGI+R1Z0UKlUl96oxUkGEOILWtOHck0eCWw==", + "version": "1.0.30001538", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz", + "integrity": "sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==", "dev": true, "funding": [ { @@ -4128,9 +4128,9 @@ } }, "node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, "node_modules/cookie": { @@ -9052,9 +9052,9 @@ } }, "node_modules/postcss": { - "version": "8.4.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", - "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -9620,9 +9620,9 @@ "dev": true }, "node_modules/preact": { - "version": "10.17.1", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.17.1.tgz", - "integrity": "sha512-X9BODrvQ4Ekwv9GURm9AKAGaomqXmip7NQTZgY7gcNmr7XE83adOMJvd3N42id1tMFU7ojiynRsYnY6/BRFxLA==", + "version": "10.18.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.1.tgz", + "integrity": "sha512-mKUD7RRkQQM6s7Rkmi7IFkoEHjuFqRQUaXamO61E6Nn7vqF/bo7EZCmSyrUnp2UWHw0O7XjZ2eeXis+m7tf4lg==", "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" @@ -10302,9 +10302,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.67.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.67.0.tgz", - "integrity": "sha512-SVrO9ZeX/QQyEGtuZYCVxoeAL5vGlYjJ9p4i4HFuekWl8y/LtJ7tJc10Z+ck1c8xOuoBm2MYzcLfTAffD0pl/A==", + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.68.0.tgz", + "integrity": "sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", diff --git a/security/class-private-sites.php b/security/class-private-sites.php index 8c43f280254..acc77b4f603 100644 --- a/security/class-private-sites.php +++ b/security/class-private-sites.php @@ -54,7 +54,10 @@ public function init() { add_filter( 'jetpack_active_modules', array( $this, 'filter_jetpack_active_modules' ) ); add_filter( 'jetpack_get_available_modules', array( $this, 'filter_jetpack_get_available_modules' ) ); + + // Force the blog_public option to be -1 and disable UI add_filter( 'option_blog_public', array( $this, 'filter_restrict_blog_public' ) ); + add_action( 'admin_enqueue_scripts', array( $this, 'disable_blog_public_ui' ) ); $this->disable_core_feeds(); $this->block_unnecessary_access(); @@ -71,6 +74,52 @@ public function disable_core_feeds() { add_action( 'do_feed_atom', array( $this, 'action_do_feed' ), -1 ); } + /** + * Disable checkbox/radio UI in Reading Settings + */ + public function disable_blog_public_ui() { + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $screen = get_current_screen(); + if ( 'options-reading' !== $screen->base ) { + return; + } + + wp_register_script( 'vip-disable-blog-public-option-ui', false, array(), '0.1', true ); + wp_enqueue_script( 'vip-disable-blog-public-option-ui' ); + $js_code = <<=' ) ) { + $this->setExpectedDeprecated( 'http_api_transports' ); + } + $expected_transport = 'WP_Http_Curl'; $wp_http = new \WP_Http(); diff --git a/tests/integrations/test-vip-block-data-api.php b/tests/integrations/test-vip-block-data-api.php new file mode 100644 index 00000000000..5d32c50489f --- /dev/null +++ b/tests/integrations/test-vip-block-data-api.php @@ -0,0 +1,30 @@ +slug ); + + $block_data_api_integration->load(); + + $this->assertFalse( $block_data_api_integration->is_active() ); + } + + public function test__if_is_loaded_gives_back_true_when_loaded(): void { + $block_data_api_integration = new BlockDataApiIntegration( $this->slug ); + + $this->assertFalse( $block_data_api_integration->is_loaded() ); + } +} diff --git a/tests/integrations/test-vip-governance.php b/tests/integrations/test-vip-governance.php new file mode 100644 index 00000000000..ab1754ef63c --- /dev/null +++ b/tests/integrations/test-vip-governance.php @@ -0,0 +1,30 @@ +slug ); + + $vip_governance_integration->load(); + + $this->assertFalse( $vip_governance_integration->is_active() ); + } + + public function test__if_is_loaded_gives_back_true_when_loaded(): void { + $vip_governance_integration = new VipGovernanceIntegration( $this->slug ); + + $this->assertFalse( $vip_governance_integration->is_loaded() ); + } +} diff --git a/tests/search/e2e/integration/features/woocommerce.spec.js b/tests/search/e2e/integration/features/woocommerce.spec.js index 517be589bfa..828ae4bbe46 100644 --- a/tests/search/e2e/integration/features/woocommerce.spec.js +++ b/tests/search/e2e/integration/features/woocommerce.spec.js @@ -110,11 +110,11 @@ describe('WooCommerce Feature', { tags: '@slow' }, () => { cy.get('.woocommerce-orders-table tbody tr').should('have.length', 1); // VIP: Use Search Dev Tools instead of Debug Bar - // cy.searchDevToolsResponseOK('shop_order'); + cy.searchDevToolsResponseOK('shop_order', 2); cy.get('#vip-search-dev-tools-mount').click(); - cy.get('h3.vip-h3').first().click(); - cy.get('strong.vip-h4.wp_query').first().click(); - cy.get('ol.wp_query.vip-collapse-ol').first().should('contain.text','orderby: "date"'); + cy.get('h3.vip-h3').eq(2).click(); + cy.get('strong.vip-h4.wp_query').eq(2).click(); + cy.get('ol.wp_query.vip-collapse-ol').eq(2).should('contain.text','orderby: "date"'); cy.get('#vip-search-dev-tools-mount').click(); cy.logout(); diff --git a/tests/search/e2e/support/commands.js b/tests/search/e2e/support/commands.js index b937fd8cad0..94ba01a5b2c 100644 --- a/tests/search/e2e/support/commands.js +++ b/tests/search/e2e/support/commands.js @@ -461,11 +461,12 @@ Cypress.Commands.add('createUser', (userData) => { }); // VIP: Check that Search Dev Tools returns a 200 status and a certain text in the response body -Cypress.Commands.add('searchDevToolsResponseOK', (bodyText) => { +// If there's more than one ES query, use the index to select the correct one +Cypress.Commands.add('searchDevToolsResponseOK', (bodyText, index = 0) => { cy.get('#vip-search-dev-tools-mount').click(); - cy.get('h3.vip-h3').first().should('contain.text','(200)'); + cy.get('h3.vip-h3').eq( index ).should('contain.text','(200)'); if ( bodyText ) { - cy.get('.line-numbers').first().should('contain.text', bodyText); + cy.get('.line-numbers').eq( index ).should('contain.text', bodyText); } cy.get('#vip-search-dev-tools-mount').click(); }); diff --git a/tests/search/includes/classes/test-class-search.php b/tests/search/includes/classes/test-class-search.php index 4dc1e7f8f83..64eb7840127 100644 --- a/tests/search/includes/classes/test-class-search.php +++ b/tests/search/includes/classes/test-class-search.php @@ -1162,7 +1162,7 @@ public function test__truncate_search_string_length__user_no_cap() { $es = new \Automattic\VIP\Search\Search(); $expected_search_string = '1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStX'; - $provided_search_string = '1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXBltNM9of2LKvwa1hNPOXLka1tyAi8PSZlS53RbGhv7egKOYPyyPpR6mZlzJhx6nXXlZ5t3BtRdQOIvGho6HjdYwdd1hMyHHv1qpggg5oMk1nWsx5fJ0B3bAFYKt1Y5dOA0Q4lQUqj8mf1LjcmR73wQwujc1GQfgCKj9X9Ktr6LrDtN5zAJFQboAJa7fZ9AiGxbJqUrLFs'; + $provided_search_string = '1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXBltNM9of2LKvwa1hNPOXLka1tyAi8PSZlS53RbGhv7egKOYPyyPpR6mZlzJhx6nXXlZ5t3BtRdQOIvGho6HjdYwdd1hMyHHv1qpggg5oMk1nWsx5fJ0B3bAFYKt1Y5dOA0Q4lQUqj8mf1LjcmR73wQwujc1GQfgCKj9X9Ktr6LrDtN5zAJFQboAJa7fZ9AiGxbJqUrLFs1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXBltNM9of2LKvwa1hNPOXLka1tyAi8PSZlS53RbGhv7egKOYPyyPpR6mZlzJhx6nXXlZ5t3BtRdQOIvGho6HjdYwdd1hMyHHv1qpggg5oMk1nWsx5fJ0B3bAFYKt1Y5dOA0Q4lQUqj8mf1LjcmR73wQwujc1GQfgCKj9X9Ktr6LrDtN5zAJFQboAJa7fZ9AiGxbJqUrLFs88'; $wp_query_mock = new \WP_Query(); @@ -1185,8 +1185,8 @@ public function test__truncate_search_string_length__user_with_cap() { $es = new \Automattic\VIP\Search\Search(); - $expected_search_string = '1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXBltNM9of2LKvwa1hNPOXLka1tyAi8PSZlS53RbGhv7egKOYPyyPpR6mZlzJhx6nXXlZ5t3BtRdQOIvGho6HjdYwdd1hMyHHv1qpgg'; - $provided_search_string = '1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXBltNM9of2LKvwa1hNPOXLka1tyAi8PSZlS53RbGhv7egKOYPyyPpR6mZlzJhx6nXXlZ5t3BtRdQOIvGho6HjdYwdd1hMyHHv1qpggg5oMk1nWsx5fJ0B3bAFYKt1Y5dOA0Q4lQUqj8mf1LjcmR73wQwujc1GQfgCKj9X9Ktr6LrDtN5zAJFQboAJa7fZ9AiGxbJqUrLFs'; + $expected_search_string = '1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXBltNM9of2LKvwa1hNPOXLka1tyAi8PSZlS53RbGhv7egKOYPyyPpR6mZlzJhx6nXXlZ5t3BtRdQOIvGho6HjdYwdd1hMyHHv1qpggg5oMk1nWsx5fJ0B3bAFYKt1Y5dOA0Q4lQUqj8mf1LjcmR73wQwujc1GQfgCKj9X9Ktr6LrDtN5zAJFQboAJa7fZ9AiGxbJqUrLFs1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXB'; + $provided_search_string = '1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXBltNM9of2LKvwa1hNPOXLka1tyAi8PSZlS53RbGhv7egKOYPyyPpR6mZlzJhx6nXXlZ5t3BtRdQOIvGho6HjdYwdd1hMyHHv1qpggg5oMk1nWsx5fJ0B3bAFYKt1Y5dOA0Q4lQUqj8mf1LjcmR73wQwujc1GQfgCKj9X9Ktr6LrDtN5zAJFQboAJa7fZ9AiGxbJqUrLFs1nAtu5t4QRo9XmU5VeKFOCTfQN62FrbvvoQXkU1782KOThAlt50NipM7V4dZNGG4eO54HsOQlJaBPStXPRoxWPHqdrHGsGkNQJJshYseaePxCJuGmY7kYp941TUoNF3GhSBEzjajNu0iwdCWrPMLxSJ5XXBltNM9of2LKvwa1hNPOXLka1tyAi8PSZlS53RbGhv7egKOYPyyPpR6mZlzJhx6nXXlZ5t3BtRdQOIvGho6HjdYwdd1hMyHHv1qpggg5oMk1nWsx5fJ0B3bAFYKt1Y5dOA0Q4lQUqj8mf1LjcmR73wQwujc1GQfgCKj9X9Ktr6LrDtN5zAJFQboAJa7fZ9AiGxbJqUrLFs88'; $wp_query_mock = new \WP_Query(); diff --git a/vip-helpers/vip-media.php b/vip-helpers/vip-media.php index e0b729dff89..8f142257955 100644 --- a/vip-helpers/vip-media.php +++ b/vip-helpers/vip-media.php @@ -84,7 +84,8 @@ function wpcom_vip_set_image_quality( $quality, $strip = false ) { add_filter( 'the_content', function ( $content ) use ( $quality, $strip ) { if ( false !== strpos( $content, 'files.wordpress.com' ) ) { - $content = preg_replace_callback( '#https?://\w+\.files\.WordPress\.com[^\s"\'>]+#', function ( $matches ) use ( $quality, $strip ) { + // phpcs:ignore WordPress.WP.CapitalPDangit.MisspelledInText + $content = preg_replace_callback( '#https?://\w+\.files\.wordpress\.com[^\s"\'>]+#', function ( $matches ) use ( $quality, $strip ) { return wpcom_vip_set_image_quality_for_url( $matches[0], $quality, $strip ); }, $content ); } diff --git a/vip-integrations.php b/vip-integrations.php index 207804117f0..07679485889 100644 --- a/vip-integrations.php +++ b/vip-integrations.php @@ -14,6 +14,8 @@ defined( 'ABSPATH' ) || die(); +// @codeCoverageIgnoreStart - the actual code here is tested individually in the unit tests. + require_once __DIR__ . '/integrations/integration.php'; require_once __DIR__ . '/integrations/integrations.php'; require_once __DIR__ . '/integrations/enums.php'; @@ -25,6 +27,14 @@ IntegrationsSingleton::instance()->register( new BlockDataApiIntegration( 'block-data-api' ) ); IntegrationsSingleton::instance()->register( new ParselyIntegration( 'parsely' ) ); +// ToDo: Remove this after the initial deployment of the VIP Governance integration. +if ( file_exists( __DIR__ . '/integrations/vip-governance.php' ) ) { + require_once __DIR__ . '/integrations/vip-governance.php'; + IntegrationsSingleton::instance()->register( new VipGovernanceIntegration( 'vip-governance' ) ); +} + +// @codeCoverageIgnoreEnd + /** * Activates an integration with an optional configuration value. * diff --git a/vip-jetpack/vip-jetpack.php b/vip-jetpack/vip-jetpack.php index fb6b0c5bbbf..27647c26a2c 100644 --- a/vip-jetpack/vip-jetpack.php +++ b/vip-jetpack/vip-jetpack.php @@ -46,371 +46,6 @@ define( 'VIP_JETPACK_FULL_SYNC_IMMEDIATELY', true ); } -// Default plan object for all VIP sites. -define( 'VIP_JETPACK_DEFAULT_PLAN', array( - 'product_id' => 'vip', - 'product_slug' => 'vip', - 'product_name_short' => 'VIP', - 'product_variation' => 'vip', - 'supports' => array( - 'videopress', - 'akismet', - 'vaultpress', - 'seo-tools', - 'google-analytics', - 'wordads', - 'search', - ), - 'features' => array( - 'active' => array( - 'premium-themes', - 'google-analytics', - 'security-settings', - 'advanced-seo', - 'upload-video-files', - 'video-hosting', - 'send-a-message', - 'whatsapp-button', - 'social-previews', - 'donations', - 'core/audio', - 'republicize', - 'premium-content/container', - 'akismet', - 'vaultpress-backups', - 'vaultpress-backup-archive', - 'vaultpress-storage-space', - 'vaultpress-automated-restores', - 'vaultpress-security-scanning', - 'polldaddy', - 'simple-payments', - 'support', - 'wordads-jetpack', - ), - 'available' => array( - 'security-settings' => array( - 'jetpack_free', - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'advanced-seo' => array( - 'jetpack_free', - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'upload-video-files' => array( - 'jetpack_free', - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'akismet' => array( - 'jetpack_free', - 'jetpack_premium', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'send-a-message' => array( - 'jetpack_free', - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'whatsapp-button' => array( - 'jetpack_free', - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'social-previews' => array( - 'jetpack_free', - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'google-analytics' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'video-hosting' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'wordads-jetpack' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'vaultpress-backups' => array( - 'jetpack_premium', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - ), - 'vaultpress-backup-archive' => array( - 'jetpack_premium', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - ), - 'vaultpress-storage-space' => array( - 'jetpack_premium', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - ), - 'vaultpress-automated-restores' => array( - 'jetpack_premium', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - ), - 'simple-payments' => array( - 'jetpack_premium', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_business_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - ), - 'calendly' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - ), - 'opentable' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - ), - 'donations' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'core/video' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - ), - 'core/cover' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - ), - 'core/audio' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'republicize' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'premium-content/container' => array( - 'jetpack_premium', - 'jetpack_business', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'support' => array( - 'jetpack_premium', - 'jetpack_personal', - 'jetpack_premium_monthly', - 'jetpack_business_monthly', - 'jetpack_personal_monthly', - 'jetpack_security_daily', - 'jetpack_security_daily_monthly', - 'jetpack_security_realtime', - 'jetpack_security_realtime_monthly', - 'jetpack_complete_monthly', - 'jetpack_security_t1_yearly', - 'jetpack_security_t1_monthly', - 'jetpack_security_t2_yearly', - 'jetpack_security_t2_monthly', - ), - 'premium-themes' => array( - 'jetpack_business', - 'jetpack_business_monthly', - ), - 'vaultpress-security-scanning' => array( - 'jetpack_business', - 'jetpack_business_monthly', - ), - 'polldaddy' => array( - 'jetpack_business', - 'jetpack_business_monthly', - ), - ), - ), -) ); - /** * Add the Connection Pilot. Ensures Jetpack is consistently connected. */ @@ -437,24 +72,6 @@ return $modules; }, 999 ); -/** - * Prevent the jetpack_active_plan from ever being overridden. - * - * All sites on VIP Go should always have have a valid VIP plan. - * - * This will prevent issues from the plan option being corrupted, - * which can then break features like Jetpack Search. - */ -add_filter( 'pre_option_jetpack_active_plan', function ( $pre_option ) { - if ( true === WPCOM_IS_VIP_ENV - && defined( 'VIP_JETPACK_DEFAULT_PLAN' ) - && Jetpack::is_active() ) { - return VIP_JETPACK_DEFAULT_PLAN; - } - - return $pre_option; -} ); - /** * Lock down the jetpack_sync_settings_max_queue_size to an allowed range * diff --git a/wp-cli/vip-two-factor.php b/wp-cli/vip-two-factor.php index 60975d70436..3aa22f46687 100644 --- a/wp-cli/vip-two-factor.php +++ b/wp-cli/vip-two-factor.php @@ -1,26 +1,128 @@ ] + * : Filter by whether 2FA is enabled or not. + * + * [--role=] + * : Filter by user role. + * + * [--2fa-provider=] + * : Filter by 2FA provider. Accepts values of: email, totp, fido_u2f, backup_codes, dummy + * + * [--user_login=] + * : Filter by user login, ID, or email. + * + * + * ## EXAMPLES + * + * # List 2FA status for all users. + * $ wp vip two-factor report + * + * # List users with 2FA enabled. + * $ wp vip two-factor report --2fa-enabled=true + * + * # List users who use email as their authentication factor. + * $ wp vip two-factor report --2fa-provider=email + * + * # List 2FA status for administrators. + * $ wp vip two-factor report --role=administrator + * + * # List administrators who don't have 2FA enabled. + * $ wp vip two-factor report --role=administrator --2fa-enabled=false + * + * # List 2FA status for administrators using the email authentication factor. + * $ wp vip two-factor report --role=administrator --2fa-enabled=true --2fa-provider=email + * + * # List 2FA status only for the wpvip user. + * $ wp vip two-factor report --user_login=wpvip + * + * @synopsis [--2fa-enabled=] [--role=] [--2fa-provider=] [--user_login=] + */ public function report( $args, $assoc_args ) { if ( ! apply_filters( 'wpcom_vip_enable_two_factor', true ) ) { WP_CLI::error( 'This site has disabled Two Factor.' ); } - $format = \WP_CLI\Utils\get_flag_value( $assoc_args, 'format', 'table' ); - $fields = array( 'ID', 'display_name', 'roles' ); + $twofa_enabled_flag = \WP_CLI\Utils\get_flag_value( $assoc_args, '2fa-enabled', null ); + $role_flag = \WP_CLI\Utils\get_flag_value( $assoc_args, 'role', null ); + $twofa_provider_flag = strtolower( \WP_CLI\Utils\get_flag_value( $assoc_args, '2fa-provider', null ) ); + $user_id_flag = \WP_CLI\Utils\get_flag_value( $assoc_args, 'user_login', null ); + $format = \WP_CLI\Utils\get_flag_value( $assoc_args, 'format', 'table' ); + if ( 'false' === $twofa_enabled_flag && $twofa_provider_flag ) { + WP_CLI::error( 'Cannot filter by Two Factor provider when searching for users without Two Factor.' ); + } + + + $providers = Two_Factor_Core::get_providers(); + $default_provider_map = [ + 'Two_Factor_Email' => 'email', + 'Two_Factor_Totp' => 'totp', + 'Two_Factor_FIDO_U2F' => 'fido_u2f', + 'Two_Factor_Backup_Codes' => 'backup_codes', + 'Two_Factor_Dummy' => 'dummy', + ]; + $providers_map = array_intersect_key( $default_provider_map, $providers ); + if ( $twofa_provider_flag ) { + if ( ! in_array( $twofa_provider_flag, $providers_map, true ) ) { + WP_CLI::error( + sprintf( + 'Invalid Two Factor provider "%s". Valid values are: %s', + $twofa_provider_flag, + implode( ', ', array_values( $providers_map ) ) + ) + ); + } - $users = get_users(); - $providers = Two_Factor_Core::get_providers(); + $twofa_enabled_flag = 'true'; // In case `--2fa-enabled` was not passed in. + $twofa_provider_flag = array_search( $twofa_provider_flag, $providers_map, true ); + } $cap = apply_filters( 'wpcom_vip_two_factor_enforcement_cap', 'manage_options' ); - foreach ( $users as $user ) { + + if ( $user_id_flag ) { + if ( is_numeric( $user_id_flag ) ) { + $user = get_user_by( 'id', $user_id_flag ); + } else { + $user = get_user_by( 'login', $user_id_flag ); + if ( ! $user ) { + $user = get_user_by( 'email', $user_id_flag ); + } + } + if ( ! $user ) { + WP_CLI::error( sprintf( 'User "%s" not found.', $user_id_flag ) ); + } + + $users = [ $user ]; + } else { + $user_args = []; + if ( $twofa_enabled_flag ) { + $user_args['capability__in'] = $cap; + } + if ( $role_flag ) { + $user_args['role'] = $role_flag; + } + + $users = get_users( $user_args ); + } + + foreach ( $users as $idx => $user ) { $user->two_factor_enabled = 'false'; $user->two_factor_providers = ''; if ( Two_Factor_Core::is_user_using_two_factor( $user->ID ) ) { $user->two_factor_enabled = 'true'; - $user_providers = Two_Factor_Core::get_enabled_providers_for_user( $user ); + $user_providers = Two_Factor_Core::get_enabled_providers_for_user( $user ); + if ( $twofa_provider_flag && ! in_array( $twofa_provider_flag, $user_providers, true ) ) { + unset( $users[ $idx ] ); + } $user_providers = array_map( function ( $provider ) use ( $providers ) { return $providers[ $provider ]->get_label(); }, $user_providers ); @@ -28,8 +130,13 @@ public function report( $args, $assoc_args ) { } elseif ( ! user_can( $user->ID, $cap ) ) { $user->two_factor_enabled = 'n/a'; } + + if ( $twofa_enabled_flag && $user->two_factor_enabled !== $twofa_enabled_flag ) { + unset( $users[ $idx ] ); + } } + $fields = array( 'ID', 'display_name', 'roles' ); $fields[] = 'two_factor_enabled'; $fields[] = 'two_factor_providers'; WP_CLI\Utils\format_items( $format, $users, $fields );