@wp-playground/blueprints 0.9.25 → 0.9.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1,12 +1,12 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@php-wasm/node-polyfills");const o=require("@php-wasm/util"),g=require("@php-wasm/logger"),N=require("@php-wasm/scopes"),V=require("@wp-playground/common"),G=require("@php-wasm/progress"),b=require("@php-wasm/universal"),we=require("ajv"),j=["db.php","plugins/akismet","plugins/hello.php","plugins/wordpress-importer","mu-plugins/sqlite-database-integration","mu-plugins/playground-includes","mu-plugins/0-playground.php","mu-plugins/0-sqlite.php","themes/twentytwenty","themes/twentytwentyone","themes/twentytwentytwo","themes/twentytwentythree","themes/twentytwentyfour","themes/twentytwentyfive","themes/twentytwentysix"],R=async(e,{pluginPath:t,pluginName:n},i)=>{i==null||i.tracker.setCaption(`Activating ${n||t}`);const r=await e.documentRoot,s=await e.run({code:`<?php
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@php-wasm/node-polyfills");const x=require("@php-wasm/util"),ce=require("@php-wasm/logger"),fr=require("@php-wasm/scopes"),cr=require("@wp-playground/common"),mr=require("@php-wasm/progress"),qe=require("@php-wasm/universal"),er=["db.php","plugins/akismet","plugins/hello.php","plugins/wordpress-importer","mu-plugins/sqlite-database-integration","mu-plugins/playground-includes","mu-plugins/0-playground.php","mu-plugins/0-sqlite.php","themes/twentytwenty","themes/twentytwentyone","themes/twentytwentytwo","themes/twentytwentythree","themes/twentytwentyfour","themes/twentytwentyfive","themes/twentytwentysix"],Ye=async(r,{pluginPath:t,pluginName:f},m)=>{m==null||m.tracker.setCaption(`Activating ${f||t}`);const u=await r.documentRoot,i=await r.run({code:`<?php
2
2
  define( 'WP_ADMIN', true );
3
- require_once( ${o.phpVar(r)}. "/wp-load.php" );
4
- require_once( ${o.phpVar(r)}. "/wp-admin/includes/plugin.php" );
3
+ require_once( ${x.phpVar(u)}. "/wp-load.php" );
4
+ require_once( ${x.phpVar(u)}. "/wp-admin/includes/plugin.php" );
5
5
 
6
6
  // Set current user to admin
7
7
  wp_set_current_user( get_users(array('role' => 'Administrator') )[0]->ID );
8
8
 
9
- $plugin_path = ${o.phpVar(t)};
9
+ $plugin_path = ${x.phpVar(t)};
10
10
  $response = false;
11
11
  if (!is_dir($plugin_path)) {
12
12
  $response = activate_plugin($plugin_path);
@@ -30,13 +30,13 @@
30
30
  }
31
31
 
32
32
  throw new Exception( 'Unable to activate plugin' );
33
- `});if(s.text!=="Plugin activated successfully")throw g.logger.debug(s),new Error(`Plugin ${t} could not be activated – WordPress exited with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in the console for more details`)},L=async(e,{themeFolderName:t},n)=>{n==null||n.tracker.setCaption(`Activating ${t}`);const i=await e.documentRoot,r=`${i}/wp-content/themes/${t}`;if(!await e.fileExists(r))throw new Error(`
33
+ `});if(i.text!=="Plugin activated successfully")throw ce.logger.debug(i),new Error(`Plugin ${t} could not be activated – WordPress exited with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in the console for more details`)},rr=async(r,{themeFolderName:t},f)=>{f==null||f.tracker.setCaption(`Activating ${t}`);const m=await r.documentRoot,u=`${m}/wp-content/themes/${t}`;if(!await r.fileExists(u))throw new Error(`
34
34
  Couldn't activate theme ${t}.
35
- Theme not found at the provided theme path: ${r}.
35
+ Theme not found at the provided theme path: ${u}.
36
36
  Check the theme path to ensure it's correct.
37
37
  If the theme is not installed, you can install it using the installTheme step.
38
38
  More info can be found in the Blueprint documentation: https://wordpress.github.io/wordpress-playground/blueprints-api/steps/#ActivateThemeStep
39
- `);const s=await e.run({code:`<?php
39
+ `);const i=await r.run({code:`<?php
40
40
  define( 'WP_ADMIN', true );
41
41
  require_once( getenv('docroot') . "/wp-load.php" );
42
42
 
@@ -49,10 +49,10 @@
49
49
  throw new Exception( 'Theme ' . getenv('themeFolderName') . ' could not be activated.' );
50
50
  }
51
51
  die('Theme activated successfully');
52
- `,env:{docroot:i,themeFolderName:t}});if(s.text!=="Theme activated successfully")throw g.logger.debug(s),new Error(`Theme ${t} could not be activated – WordPress exited with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in the console for more details`)},Q=async(e,{code:t})=>await e.run({code:t}),Y=async(e,{options:t})=>await e.run(t),q=async(e,{path:t})=>{await e.unlink(t)},Z=async(e,{sql:t},n)=>{n==null||n.tracker.setCaption("Executing SQL Queries");const i=`/tmp/${o.randomFilename()}.sql`;await e.writeFile(i,new Uint8Array(await t.arrayBuffer()));const r=await e.documentRoot,s=o.phpVars({docroot:r,sqlFilename:i}),a=await e.run({code:`<?php
53
- require_once ${s.docroot} . '/wp-load.php';
52
+ `,env:{docroot:m,themeFolderName:t}});if(i.text!=="Theme activated successfully")throw ce.logger.debug(i),new Error(`Theme ${t} could not be activated – WordPress exited with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in the console for more details`)},yr=async(r,{code:t})=>await r.run({code:t}),hr=async(r,{options:t})=>await r.run(t),tr=async(r,{path:t})=>{await r.unlink(t)},gr=async(r,{sql:t},f)=>{f==null||f.tracker.setCaption("Executing SQL Queries");const m=`/tmp/${x.randomFilename()}.sql`;await r.writeFile(m,new Uint8Array(await t.arrayBuffer()));const u=await r.documentRoot,i=x.phpVars({docroot:u,sqlFilename:m}),e=await r.run({code:`<?php
53
+ require_once ${i.docroot} . '/wp-load.php';
54
54
 
55
- $handle = fopen(${s.sqlFilename}, 'r');
55
+ $handle = fopen(${i.sqlFilename}, 'r');
56
56
  $buffer = '';
57
57
 
58
58
  global $wpdb;
@@ -68,7 +68,7 @@
68
68
  $wpdb->query($buffer);
69
69
  $buffer = '';
70
70
  }
71
- `});return await q(e,{path:i}),a},v=async(e,{request:t})=>{g.logger.warn('Deprecated: The Blueprint step "request" is deprecated and will be removed in a future release.');const n=await e.request(t);if(n.httpStatusCode>399||n.httpStatusCode<200)throw g.logger.warn("WordPress response was",{response:n}),new Error(`Request failed with status ${n.httpStatusCode}`);return n},ge=`<?php
71
+ `});return await tr(r,{path:m}),e},He=async(r,{request:t})=>{ce.logger.warn('Deprecated: The Blueprint step "request" is deprecated and will be removed in a future release.');const f=await r.request(t);if(f.httpStatusCode>399||f.httpStatusCode<200)throw ce.logger.warn("WordPress response was",{response:f}),new Error(`Request failed with status ${f.httpStatusCode}`);return f},Wr=`<?php
72
72
 
73
73
  /**
74
74
  * Rewrites the wp-config.php file to ensure specific constants are defined
@@ -399,33 +399,33 @@ function skip_whitespace($tokens) {
399
399
  }
400
400
  return $output;
401
401
  }
402
- `,P=async(e,{consts:t,method:n="define-before-run"})=>{switch(n){case"define-before-run":await ye(e,t);break;case"rewrite-wp-config":{const i=await e.documentRoot,r=o.joinPaths(i,"/wp-config.php"),s=await e.readFileAsText(r),a=await $e(e,s,t);await e.writeFile(r,a);break}default:throw new Error(`Invalid method: ${n}`)}};async function ye(e,t){for(const n in t)await e.defineConstant(n,t[n])}async function $e(e,t,n){await e.writeFile("/tmp/code.php",t);const i=o.phpVars({consts:n});return await e.run({code:`${ge}
402
+ `,Ae=async(r,{consts:t,method:f="define-before-run"})=>{switch(f){case"define-before-run":await Br(r,t);break;case"rewrite-wp-config":{const m=await r.documentRoot,u=x.joinPaths(m,"/wp-config.php"),i=await r.readFileAsText(u),e=await Vr(r,i,t);await r.writeFile(u,e);break}default:throw new Error(`Invalid method: ${f}`)}};async function Br(r,t){for(const f in t)await r.defineConstant(f,t[f])}async function Vr(r,t,f){await r.writeFile("/tmp/code.php",t);const m=x.phpVars({consts:f});return await r.run({code:`${Wr}
403
403
  $wp_config_path = '/tmp/code.php';
404
404
  $wp_config = file_get_contents($wp_config_path);
405
- $new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${i.consts});
405
+ $new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${m.consts});
406
406
  file_put_contents($wp_config_path, $new_wp_config);
407
- `}),await e.readFileAsText("/tmp/code.php")}const k=async(e,{username:t="admin",password:n="password"}={},i)=>{var s,a,l;i==null||i.tracker.setCaption((i==null?void 0:i.initialCaption)||"Logging in"),await e.request({url:"/wp-login.php"});const r=await e.request({url:"/wp-login.php",method:"POST",body:{log:t,pwd:n,rememberme:"forever"}});if(!((l=(a=(s=r.headers)==null?void 0:s.location)==null?void 0:a[0])!=null&&l.includes("/wp-admin/")))throw g.logger.warn("WordPress response was",{response:r,text:r.text}),new Error(`Failed to log in as ${t} with password ${n}`)},C=async(e,{options:t})=>{const n=await e.documentRoot;await e.run({code:`<?php
408
- include ${o.phpVar(n)} . '/wp-load.php';
409
- $site_options = ${o.phpVar(t)};
407
+ `}),await r.readFileAsText("/tmp/code.php")}const Ge=async(r,{username:t="admin",password:f="password"}={},m)=>{var i,e,c;m==null||m.tracker.setCaption((m==null?void 0:m.initialCaption)||"Logging in"),await r.request({url:"/wp-login.php"});const u=await r.request({url:"/wp-login.php",method:"POST",body:{log:t,pwd:f,rememberme:"forever"}});if(!((c=(e=(i=u.headers)==null?void 0:i.location)==null?void 0:e[0])!=null&&c.includes("/wp-admin/")))throw ce.logger.warn("WordPress response was",{response:u,text:u.text}),new Error(`Failed to log in as ${t} with password ${f}`)},sr=async(r,{options:t})=>{const f=await r.documentRoot;await r.run({code:`<?php
408
+ include ${x.phpVar(f)} . '/wp-load.php';
409
+ $site_options = ${x.phpVar(t)};
410
410
  foreach($site_options as $name => $value) {
411
411
  update_option($name, $value);
412
412
  }
413
413
  echo "Success";
414
- `})},X=async(e,{meta:t,userId:n})=>{const i=await e.documentRoot;await e.run({code:`<?php
415
- include ${o.phpVar(i)} . '/wp-load.php';
416
- $meta = ${o.phpVar(t)};
414
+ `})},br=async(r,{meta:t,userId:f})=>{const m=await r.documentRoot;await r.run({code:`<?php
415
+ include ${x.phpVar(m)} . '/wp-load.php';
416
+ $meta = ${x.phpVar(t)};
417
417
  foreach($meta as $name => $value) {
418
- update_user_meta(${o.phpVar(n)}, $name, $value);
418
+ update_user_meta(${x.phpVar(f)}, $name, $value);
419
419
  }
420
- `})},J=async e=>{var u;await P(e,{consts:{WP_ALLOW_MULTISITE:1}});const t=new URL(await e.absoluteUrl);if(t.port!==""){let m=`The current host is ${t.host}, but WordPress multisites do not support custom ports.`;throw t.hostname==="localhost"&&(m+=" For development, you can set up a playground.test domain using the instructions at https://wordpress.github.io/wordpress-playground/contributing/code."),new Error(m)}const n=t.pathname.replace(/\/$/,"")+"/",i=`${t.protocol}//${t.hostname}${n}`;await C(e,{options:{siteurl:i,home:i}}),await k(e,{});const r=await e.documentRoot,a=(await e.run({code:`<?php
420
+ `})},wr=async r=>{var R;await Ae(r,{consts:{WP_ALLOW_MULTISITE:1}});const t=new URL(await r.absoluteUrl);if(t.port!==""){let B=`The current host is ${t.host}, but WordPress multisites do not support custom ports.`;throw t.hostname==="localhost"&&(B+=" For development, you can set up a playground.test domain using the instructions at https://wordpress.github.io/wordpress-playground/contributing/code."),new Error(B)}const f=t.pathname.replace(/\/$/,"")+"/",m=`${t.protocol}//${t.hostname}${f}`;await sr(r,{options:{siteurl:m,home:m}}),await Ge(r,{});const u=await r.documentRoot,e=(await r.run({code:`<?php
421
421
  define( 'WP_ADMIN', true );
422
- require_once(${o.phpVar(r)} . "/wp-load.php");
422
+ require_once(${x.phpVar(u)} . "/wp-load.php");
423
423
 
424
424
  // Set current user to admin
425
425
  ( get_users(array('role' => 'Administrator') )[0] );
426
426
 
427
- require_once(${o.phpVar(r)} . "/wp-admin/includes/plugin.php");
428
- $plugins_root = ${o.phpVar(r)} . "/wp-content/plugins";
427
+ require_once(${x.phpVar(u)} . "/wp-admin/includes/plugin.php");
428
+ $plugins_root = ${x.phpVar(u)} . "/wp-content/plugins";
429
429
  $plugins = glob($plugins_root . "/*");
430
430
 
431
431
  $deactivated_plugins = [];
@@ -449,19 +449,19 @@ foreach($plugins as $plugin_path) {
449
449
  }
450
450
  }
451
451
  echo json_encode($deactivated_plugins);
452
- `})).json,c=(u=(await v(e,{request:{url:"/wp-admin/network.php"}})).text.match(/name="_wpnonce"\s+value="([^"]+)"/))==null?void 0:u[1],f=await v(e,{request:{url:"/wp-admin/network.php",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:_e({_wpnonce:c,_wp_http_referer:n+"wp-admin/network.php",sitename:"My WordPress Website Sites",email:"admin@localhost.com",submit:"Install"})}});if(f.httpStatusCode!==200)throw g.logger.warn("WordPress response was",{response:f,text:f.text,headers:f.headers}),new Error(`Failed to enable multisite. Response code was ${f.httpStatusCode}`);await P(e,{consts:{MULTISITE:!0,SUBDOMAIN_INSTALL:!1,SITE_ID_CURRENT_SITE:1,BLOG_ID_CURRENT_SITE:1,DOMAIN_CURRENT_SITE:t.hostname,PATH_CURRENT_SITE:n}});const h=new URL(await e.absoluteUrl),p=N.isURLScoped(h)?"scope:"+N.getURLScope(h):null;await e.writeFile("/internal/shared/preload/sunrise.php",`<?php
453
- $_SERVER['HTTP_HOST'] = ${o.phpVar(h.hostname)};
454
- $folder = ${o.phpVar(p)};
452
+ `})).json,_=(R=(await He(r,{request:{url:"/wp-admin/network.php"}})).text.match(/name="_wpnonce"\s+value="([^"]+)"/))==null?void 0:R[1],W=await He(r,{request:{url:"/wp-admin/network.php",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:Dr({_wpnonce:_,_wp_http_referer:f+"wp-admin/network.php",sitename:"My WordPress Website Sites",email:"admin@localhost.com",submit:"Install"})}});if(W.httpStatusCode!==200)throw ce.logger.warn("WordPress response was",{response:W,text:W.text,headers:W.headers}),new Error(`Failed to enable multisite. Response code was ${W.httpStatusCode}`);await Ae(r,{consts:{MULTISITE:!0,SUBDOMAIN_INSTALL:!1,SITE_ID_CURRENT_SITE:1,BLOG_ID_CURRENT_SITE:1,DOMAIN_CURRENT_SITE:t.hostname,PATH_CURRENT_SITE:f}});const U=new URL(await r.absoluteUrl),P=fr.isURLScoped(U)?"scope:"+fr.getURLScope(U):null;await r.writeFile("/internal/shared/preload/sunrise.php",`<?php
453
+ $_SERVER['HTTP_HOST'] = ${x.phpVar(U.hostname)};
454
+ $folder = ${x.phpVar(P)};
455
455
  if ($folder && strpos($_SERVER['REQUEST_URI'],"/$folder") === false) {
456
456
  $_SERVER['REQUEST_URI'] = "/$folder/" . ltrim($_SERVER['REQUEST_URI'], '/');
457
457
  }
458
- `),await e.writeFile("/internal/shared/mu-plugins/sunrise.php",`<?php
458
+ `),await r.writeFile("/internal/shared/mu-plugins/sunrise.php",`<?php
459
459
  if ( !defined( 'BLOG_ID_CURRENT_SITE' ) ) {
460
460
  define( 'BLOG_ID_CURRENT_SITE', 1 );
461
461
  }
462
- `),await k(e,{});for(const m of a)await R(e,{pluginPath:m})};function _e(e){return Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}const K=async(e,{fromPath:t,toPath:n})=>{await e.writeFile(n,await e.readFileAsBuffer(t))},ee=async(e,{fromPath:t,toPath:n})=>{await e.mv(t,n)},te=async(e,{path:t})=>{await e.mkdir(t)},ne=async(e,{path:t})=>{await e.rmdir(t)},O=async(e,{path:t,data:n})=>{n instanceof File&&(n=new Uint8Array(await n.arrayBuffer())),t.startsWith("/wordpress/wp-content/mu-plugins")&&!await e.fileExists("/wordpress/wp-content/mu-plugins")&&await e.mkdir("/wordpress/wp-content/mu-plugins"),await e.writeFile(t,n)},W=async(e,{siteUrl:t})=>{await P(e,{consts:{WP_HOME:t,WP_SITEURL:t}})},ie=async(e,{file:t},n)=>{var r;(r=n==null?void 0:n.tracker)==null||r.setCaption("Importing content"),await O(e,{path:"/tmp/import.wxr",data:t});const i=await e.documentRoot;await e.run({code:`<?php
463
- require ${o.phpVar(i)} . '/wp-load.php';
464
- require ${o.phpVar(i)} . '/wp-admin/includes/admin.php';
462
+ `),await Ge(r,{});for(const B of e)await Ye(r,{pluginPath:B})};function Dr(r){return Object.keys(r).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(r[t])).join("&")}const vr=async(r,{fromPath:t,toPath:f})=>{await r.writeFile(f,await r.readFileAsBuffer(t))},Pr=async(r,{fromPath:t,toPath:f})=>{await r.mv(t,f)},_r=async(r,{path:t})=>{await r.mkdir(t)},kr=async(r,{path:t})=>{await r.rmdir(t)},ir=async(r,{path:t,data:f})=>{f instanceof File&&(f=new Uint8Array(await f.arrayBuffer())),t.startsWith("/wordpress/wp-content/mu-plugins")&&!await r.fileExists("/wordpress/wp-content/mu-plugins")&&await r.mkdir("/wordpress/wp-content/mu-plugins"),await r.writeFile(t,f)},or=async(r,{siteUrl:t})=>{await Ae(r,{consts:{WP_HOME:t,WP_SITEURL:t}})},Or=async(r,{file:t},f)=>{var u;(u=f==null?void 0:f.tracker)==null||u.setCaption("Importing content"),await ir(r,{path:"/tmp/import.wxr",data:t});const m=await r.documentRoot;await r.run({code:`<?php
463
+ require ${x.phpVar(m)} . '/wp-load.php';
464
+ require ${x.phpVar(m)} . '/wp-admin/includes/admin.php';
465
465
 
466
466
  kses_remove_filters();
467
467
  $admin_id = get_users(array('role' => 'Administrator') )[0]->ID;
@@ -479,7 +479,7 @@ echo json_encode($deactivated_plugins);
479
479
  });
480
480
 
481
481
  $result = $importer->import( '/tmp/import.wxr' );
482
- `})},U=async(e,{themeSlug:t=""},n)=>{var r;(r=n==null?void 0:n.tracker)==null||r.setCaption("Importing theme starter content");const i=await e.documentRoot;await e.run({code:`<?php
482
+ `})},nr=async(r,{themeSlug:t=""},f)=>{var u;(u=f==null?void 0:f.tracker)==null||u.setCaption("Importing theme starter content");const m=await r.documentRoot;await r.run({code:`<?php
483
483
 
484
484
  /**
485
485
  * Ensure that the customizer loads as an admin user.
@@ -502,7 +502,7 @@ echo json_encode($deactivated_plugins);
502
502
  * See _wp_customize_include()
503
503
  */
504
504
  $_REQUEST['wp_customize'] = 'on';
505
- $_REQUEST['customize_theme'] = ${o.phpVar(t)} ?: get_stylesheet();
505
+ $_REQUEST['customize_theme'] = ${x.phpVar(t)} ?: get_stylesheet();
506
506
 
507
507
  /*
508
508
  * Claim this is a ajax request saving settings, to avoid the preview filters being applied.
@@ -514,7 +514,7 @@ echo json_encode($deactivated_plugins);
514
514
  }
515
515
  playground_add_filter( 'plugins_loaded', 'importThemeStarterContent_plugins_loaded', 0 );
516
516
 
517
- require ${o.phpVar(i)} . '/wp-load.php';
517
+ require ${x.phpVar(m)} . '/wp-load.php';
518
518
 
519
519
  // Return early if there's no starter content.
520
520
  if ( ! get_theme_starter_content() ) {
@@ -526,10 +526,10 @@ echo json_encode($deactivated_plugins);
526
526
 
527
527
  // Publish the changeset, which publishes the starter content.
528
528
  wp_publish_post( $wp_customize->changeset_post_id() );
529
- `})},S=async(e,{zipFile:t,zipPath:n,extractToPath:i})=>{if(n)g.logger.warn('The "zipPath" option of the unzip() Blueprint step is deprecated and will be removed. Use "zipFile" instead.');else if(!t)throw new Error("Either zipPath or zipFile must be provided");await V.unzipFile(e,t||n,i)},re=async(e,{wordPressFilesZip:t,pathInZip:n=""})=>{const i=await e.documentRoot;let r=o.joinPaths("/tmp","import");await e.mkdir(r),await S(e,{zipFile:t,extractToPath:r}),r=o.joinPaths(r,n);const s=o.joinPaths(r,"wp-content"),a=o.joinPaths(i,"wp-content");for(const h of j){const p=o.joinPaths(s,h);await z(e,p);const u=o.joinPaths(a,h);await e.fileExists(u)&&(await e.mkdir(o.dirname(p)),await e.mv(u,p))}const l=o.joinPaths(r,"wp-content","database");await e.fileExists(l)||await e.mv(o.joinPaths(i,"wp-content","database"),l);const c=await e.listFiles(r);for(const h of c)await z(e,o.joinPaths(i,h)),await e.mv(o.joinPaths(r,h),o.joinPaths(i,h));await e.rmdir(r),await W(e,{siteUrl:await e.absoluteUrl});const f=o.phpVar(o.joinPaths(i,"wp-admin","upgrade.php"));await e.run({code:`<?php
529
+ `})},Ze=async(r,{zipFile:t,zipPath:f,extractToPath:m})=>{if(f)ce.logger.warn('The "zipPath" option of the unzip() Blueprint step is deprecated and will be removed. Use "zipFile" instead.');else if(!t)throw new Error("Either zipPath or zipFile must be provided");await cr.unzipFile(r,t||f,m)},$r=async(r,{wordPressFilesZip:t,pathInZip:f=""})=>{const m=await r.documentRoot;let u=x.joinPaths("/tmp","import");await r.mkdir(u),await Ze(r,{zipFile:t,extractToPath:u}),u=x.joinPaths(u,f);const i=x.joinPaths(u,"wp-content"),e=x.joinPaths(m,"wp-content");for(const U of er){const P=x.joinPaths(i,U);await lr(r,P);const R=x.joinPaths(e,U);await r.fileExists(R)&&(await r.mkdir(x.dirname(P)),await r.mv(R,P))}const c=x.joinPaths(u,"wp-content","database");await r.fileExists(c)||await r.mv(x.joinPaths(m,"wp-content","database"),c);const _=await r.listFiles(u);for(const U of _)await lr(r,x.joinPaths(m,U)),await r.mv(x.joinPaths(u,U),x.joinPaths(m,U));await r.rmdir(u),await or(r,{siteUrl:await r.absoluteUrl});const W=x.phpVar(x.joinPaths(m,"wp-admin","upgrade.php"));await r.run({code:`<?php
530
530
  $_GET['step'] = 'upgrade_db';
531
- require ${f};
532
- `})};async function z(e,t){await e.fileExists(t)&&(await e.isDir(t)?await e.rmdir(t):await e.unlink(t))}async function se(e){const t=await e.request({url:"/wp-admin/export.php?download=true&content=all"});return new File([t.bytes],"export.xml")}async function oe(e,{targetPath:t,zipFile:n,ifAlreadyInstalled:i="overwrite"}){const s=n.name.replace(/\.zip$/,""),a=o.joinPaths(await e.documentRoot,"wp-content"),l=o.joinPaths(a,o.randomString()),c=o.joinPaths(l,"assets",s);await e.fileExists(c)&&await e.rmdir(l,{recursive:!0}),await e.mkdir(l);try{await S(e,{zipFile:n,extractToPath:c});let f=await e.listFiles(c,{prependPath:!0});f=f.filter(E=>!E.endsWith("/__MACOSX"));const h=f.length===1&&await e.isDir(f[0]);let p,u="";h?(u=f[0],p=f[0].split("/").pop()):(u=c,p=s);const m=`${t}/${p}`;if(await e.fileExists(m)){if(!await e.isDir(m))throw new Error(`Cannot install asset ${p} to ${m} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`);if(i==="overwrite")await e.rmdir(m,{recursive:!0});else{if(i==="skip")return{assetFolderPath:m,assetFolderName:p};throw new Error(`Cannot install asset ${p} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${i}`)}}return await e.mv(u,m),{assetFolderPath:m,assetFolderName:p}}finally{await e.rmdir(l,{recursive:!0})}}function x(e){const t=e.split(".").shift().replace(/-/g," ");return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}const ae=async(e,{pluginZipFile:t,ifAlreadyInstalled:n,options:i={}},r)=>{const s=t.name.split("/").pop()||"plugin.zip",a=x(s);r==null||r.tracker.setCaption(`Installing the ${a} plugin`);const{assetFolderPath:l}=await oe(e,{ifAlreadyInstalled:n,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/plugins`});("activate"in i?i.activate:!0)&&await R(e,{pluginPath:l,pluginName:a},r)},pe=async(e,{themeZipFile:t,ifAlreadyInstalled:n,options:i={}},r)=>{const s=x(t.name);r==null||r.tracker.setCaption(`Installing the ${s} theme`);const{assetFolderName:a}=await oe(e,{ifAlreadyInstalled:n,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/themes`});("activate"in i?i.activate:!0)&&await L(e,{themeFolderName:a},r),("importStarterContent"in i?i.importStarterContent:!1)&&await U(e,{themeSlug:a},r)},ce=async(e,t,n)=>{var r;(r=n==null?void 0:n.tracker)==null||r.setCaption("Resetting WordPress data");const i=await e.documentRoot;await e.run({env:{DOCROOT:i},code:`<?php
531
+ require ${W};
532
+ `})};async function lr(r,t){await r.fileExists(t)&&(await r.isDir(t)?await r.rmdir(t):await r.unlink(t))}async function Er(r){const t=await r.request({url:"/wp-admin/export.php?download=true&content=all"});return new File([t.bytes],"export.xml")}async function jr(r,{targetPath:t,zipFile:f,ifAlreadyInstalled:m="overwrite"}){const i=f.name.replace(/\.zip$/,""),e=x.joinPaths(await r.documentRoot,"wp-content"),c=x.joinPaths(e,x.randomString()),_=x.joinPaths(c,"assets",i);await r.fileExists(_)&&await r.rmdir(c,{recursive:!0}),await r.mkdir(c);try{await Ze(r,{zipFile:f,extractToPath:_});let W=await r.listFiles(_,{prependPath:!0});W=W.filter(C=>!C.endsWith("/__MACOSX"));const U=W.length===1&&await r.isDir(W[0]);let P,R="";U?(R=W[0],P=W[0].split("/").pop()):(R=_,P=i);const B=`${t}/${P}`;if(await r.fileExists(B)){if(!await r.isDir(B))throw new Error(`Cannot install asset ${P} to ${B} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`);if(m==="overwrite")await r.rmdir(B,{recursive:!0});else{if(m==="skip")return{assetFolderPath:B,assetFolderName:P};throw new Error(`Cannot install asset ${P} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${m}`)}}return await r.mv(R,B),{assetFolderPath:B,assetFolderName:P}}finally{await r.rmdir(c,{recursive:!0})}}function Qe(r){const t=r.split(".").shift().replace(/-/g," ");return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}const Tr=async(r,{pluginZipFile:t,ifAlreadyInstalled:f,options:m={}},u)=>{const i=t.name.split("/").pop()||"plugin.zip",e=Qe(i);u==null||u.tracker.setCaption(`Installing the ${e} plugin`);const{assetFolderPath:c}=await jr(r,{ifAlreadyInstalled:f,zipFile:t,targetPath:`${await r.documentRoot}/wp-content/plugins`});("activate"in m?m.activate:!0)&&await Ye(r,{pluginPath:c,pluginName:e},u)},qr=async(r,{themeZipFile:t,ifAlreadyInstalled:f,options:m={}},u)=>{const i=Qe(t.name);u==null||u.tracker.setCaption(`Installing the ${i} theme`);const{assetFolderName:e}=await jr(r,{ifAlreadyInstalled:f,zipFile:t,targetPath:`${await r.documentRoot}/wp-content/themes`});("activate"in m?m.activate:!0)&&await rr(r,{themeFolderName:e},u),("importStarterContent"in m?m.importStarterContent:!1)&&await nr(r,{themeSlug:e},u)},Ar=async(r,t,f)=>{var u;(u=f==null?void 0:f.tracker)==null||u.setCaption("Resetting WordPress data");const m=await r.documentRoot;await r.run({env:{DOCROOT:m},code:`<?php
533
533
  require getenv('DOCROOT') . '/wp-load.php';
534
534
 
535
535
  $GLOBALS['@pdo']->query('DELETE FROM wp_posts WHERE id > 0');
@@ -543,11 +543,11 @@ echo json_encode($deactivated_plugins);
543
543
 
544
544
  $GLOBALS['@pdo']->query('DELETE FROM wp_commentmeta');
545
545
  $GLOBALS['@pdo']->query("UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='wp_commentmeta'");
546
- `})},le=async(e,{options:t})=>{await e.request({url:"/wp-admin/install.php?step=2",method:"POST",body:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:t.adminPassword||"admin",admin_password:t.adminPassword||"password",admin_password2:t.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},de=async(e,{selfContained:t=!1}={})=>{const n="/tmp/wordpress-playground.zip",i=await e.documentRoot,r=o.joinPaths(i,"wp-content");let s=j;t&&(s=s.filter(c=>!c.startsWith("themes/twenty")).filter(c=>c!=="mu-plugins/sqlite-database-integration"));const a=o.phpVars({zipPath:n,wpContentPath:r,documentRoot:i,exceptPaths:s.map(c=>o.joinPaths(i,"wp-content",c)),additionalPaths:t?{[o.joinPaths(i,"wp-config.php")]:"wp-config.php"}:{}});await Pe(e,`zipDir(${a.wpContentPath}, ${a.zipPath}, array(
547
- 'exclude_paths' => ${a.exceptPaths},
548
- 'zip_root' => ${a.documentRoot},
549
- 'additional_paths' => ${a.additionalPaths}
550
- ));`);const l=await e.readFileAsBuffer(n);return e.unlink(n),l},be=`<?php
546
+ `})},Rr=async(r,{options:t})=>{await r.request({url:"/wp-admin/install.php?step=2",method:"POST",body:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:t.adminPassword||"admin",admin_password:t.adminPassword||"password",admin_password2:t.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},Sr=async(r,{selfContained:t=!1}={})=>{const f="/tmp/wordpress-playground.zip",m=await r.documentRoot,u=x.joinPaths(m,"wp-content");let i=er;t&&(i=i.filter(_=>!_.startsWith("themes/twenty")).filter(_=>_!=="mu-plugins/sqlite-database-integration"));const e=x.phpVars({zipPath:f,wpContentPath:u,documentRoot:m,exceptPaths:i.map(_=>x.joinPaths(m,"wp-content",_)),additionalPaths:t?{[x.joinPaths(m,"wp-config.php")]:"wp-config.php"}:{}});await zr(r,`zipDir(${e.wpContentPath}, ${e.zipPath}, array(
547
+ 'exclude_paths' => ${e.exceptPaths},
548
+ 'zip_root' => ${e.documentRoot},
549
+ 'additional_paths' => ${e.additionalPaths}
550
+ ));`);const c=await r.readFileAsBuffer(f);return r.unlink(f),c},Mr=`<?php
551
551
 
552
552
  function zipDir($root, $output, $options = array())
553
553
  {
@@ -606,7 +606,7 @@ function join_paths()
606
606
 
607
607
  return preg_replace('#/+#', '/', join('/', $paths));
608
608
  }
609
- `;async function Pe(e,t){return await e.run({code:be+t})}const ue=async(e,{command:t,wpCliPath:n="/tmp/wp-cli.phar"})=>{if(!await e.fileExists(n))throw new Error(`wp-cli.phar not found at ${n}`);let i;if(typeof t=="string"?(t=t.trim(),i=Ee(t)):i=t,i.shift()!=="wp")throw new Error('The first argument must be "wp".');await e.writeFile("/tmp/stdout",""),await e.writeFile("/tmp/stderr",""),await e.writeFile("/wordpress/run-cli.php",`<?php
609
+ `;async function zr(r,t){return await r.run({code:Mr+t})}const Lr=async(r,{command:t,wpCliPath:f="/tmp/wp-cli.phar"})=>{if(!await r.fileExists(f))throw new Error(`wp-cli.phar not found at ${f}`);let m;if(typeof t=="string"?(t=t.trim(),m=Hr(t)):m=t,m.shift()!=="wp")throw new Error('The first argument must be "wp".');await r.writeFile("/tmp/stdout",""),await r.writeFile("/tmp/stderr",""),await r.writeFile("/wordpress/run-cli.php",`<?php
610
610
  // Set up the environment to emulate a shell script
611
611
  // call.
612
612
 
@@ -619,7 +619,7 @@ function join_paths()
619
619
  $GLOBALS['argv'] = array_merge([
620
620
  "/tmp/wp-cli.phar",
621
621
  "--path=/wordpress"
622
- ], ${o.phpVar(i)});
622
+ ], ${x.phpVar(m)});
623
623
 
624
624
  // Provide stdin, stdout, stderr streams outside of
625
625
  // the CLI SAPI.
@@ -627,13 +627,13 @@ function join_paths()
627
627
  define('STDOUT', fopen('php://stdout', 'wb'));
628
628
  define('STDERR', fopen('php://stderr', 'wb'));
629
629
 
630
- require( ${o.phpVar(n)} );
631
- `);const s=await e.run({scriptPath:"/wordpress/run-cli.php"});if(s.errors)throw new Error(s.errors);return s};function Ee(e){let i=0,r="";const s=[];let a="";for(let l=0;l<e.length;l++){const c=e[l];i===0?c==='"'||c==="'"?(i=1,r=c):c.match(/\s/)?(a&&s.push(a),a=""):a+=c:i===1&&(c==="\\"?(l++,a+=e[l]):c===r?(i=0,r=""):a+=c)}return a&&s.push(a),s}const he=async(e,{language:t},n)=>{n==null||n.tracker.setCaption((n==null?void 0:n.initialCaption)||"Translating"),await e.defineConstant("WPLANG",t);const i=await e.documentRoot,s=[{url:`https://downloads.wordpress.org/translation/core/${(await e.run({code:`<?php
632
- require '${i}/wp-includes/version.php';
630
+ require( ${x.phpVar(f)} );
631
+ `);const i=await r.run({scriptPath:"/wordpress/run-cli.php"});if(i.errors)throw new Error(i.errors);return i};function Hr(r){let m=0,u="";const i=[];let e="";for(let c=0;c<r.length;c++){const _=r[c];m===0?_==='"'||_==="'"?(m=1,u=_):_.match(/\s/)?(e&&i.push(e),e=""):e+=_:m===1&&(_==="\\"?(c++,e+=r[c]):_===u?(m=0,u=""):e+=_)}return e&&i.push(e),i}const Nr=async(r,{language:t},f)=>{f==null||f.tracker.setCaption((f==null?void 0:f.initialCaption)||"Translating"),await r.defineConstant("WPLANG",t);const m=await r.documentRoot,i=[{url:`https://downloads.wordpress.org/translation/core/${(await r.run({code:`<?php
632
+ require '${m}/wp-includes/version.php';
633
633
  echo $wp_version;
634
- `})).text}/${t}.zip`,type:"core"}],l=(await e.run({code:`<?php
635
- require_once('${i}/wp-load.php');
636
- require_once('${i}/wp-admin/includes/plugin.php');
634
+ `})).text}/${t}.zip`,type:"core"}],c=(await r.run({code:`<?php
635
+ require_once('${m}/wp-load.php');
636
+ require_once('${m}/wp-admin/includes/plugin.php');
637
637
  echo json_encode(
638
638
  array_values(
639
639
  array_map(
@@ -651,9 +651,9 @@ function join_paths()
651
651
  )
652
652
  )
653
653
  )
654
- );`})).json;for(const{slug:h,version:p}of l)s.push({url:`https://downloads.wordpress.org/translation/plugin/${h}/${p}/${t}.zip`,type:"plugin"});const f=(await e.run({code:`<?php
655
- require_once('${i}/wp-load.php');
656
- require_once('${i}/wp-admin/includes/theme.php');
654
+ );`})).json;for(const{slug:U,version:P}of c)i.push({url:`https://downloads.wordpress.org/translation/plugin/${U}/${P}/${t}.zip`,type:"plugin"});const W=(await r.run({code:`<?php
655
+ require_once('${m}/wp-load.php');
656
+ require_once('${m}/wp-admin/includes/theme.php');
657
657
  echo json_encode(
658
658
  array_values(
659
659
  array_map(
@@ -666,7 +666,7 @@ function join_paths()
666
666
  wp_get_themes()
667
667
  )
668
668
  )
669
- );`})).json;for(const{slug:h,version:p}of f)s.push({url:`https://downloads.wordpress.org/translation/theme/${h}/${p}/${t}.zip`,type:"theme"});await e.isDir(`${i}/wp-content/languages/plugins`)||await e.mkdir(`${i}/wp-content/languages/plugins`),await e.isDir(`${i}/wp-content/languages/themes`)||await e.mkdir(`${i}/wp-content/languages/themes`);for(const{url:h,type:p}of s)try{const u=await fetch(h);if(!u.ok)throw new Error(`Failed to download translations for ${p}: ${u.statusText}`);let m=`${i}/wp-content/languages`;p==="plugin"?m+="/plugins":p==="theme"&&(m+="/themes"),await V.unzipFile(e,new File([await u.blob()],`${t}-${p}.zip`),m)}catch(u){if(p==="core")throw new Error(`Failed to download translations for WordPress. Please check if the language code ${t} is correct. You can find all available languages and translations on https://translate.wordpress.org/.`);g.logger.warn(`Error downloading translations for ${p}: ${u}`)}},Te=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:R,activateTheme:L,cp:K,defineSiteUrl:W,defineWpConfigConsts:P,enableMultisite:J,exportWXR:se,importThemeStarterContent:U,importWordPressFiles:re,importWxr:ie,installPlugin:ae,installTheme:pe,login:k,mkdir:te,mv:ee,request:v,resetData:ce,rm:q,rmdir:ne,runPHP:Q,runPHPWithOptions:Y,runSql:Z,runWpInstallationWizard:le,setSiteLanguage:he,setSiteOptions:C,unzip:S,updateUserMeta:X,wpCLI:ue,writeFile:O,zipWpContent:de},Symbol.toStringTag,{value:"Module"})),ve=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function ke(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&ve.includes(e.resource)}class _{static create(t,{semaphore:n,progress:i}){let r;switch(t.resource){case"vfs":r=new Re(t,i);break;case"literal":r=new Se(t,i);break;case"wordpress.org/themes":r=new Le(t,i);break;case"wordpress.org/plugins":r=new qe(t,i);break;case"url":r=new je(t,i);break;default:throw new Error(`Invalid resource: ${t}`)}return r=new Ce(r),n&&(r=new Oe(r,n)),r}setPlayground(t){this.playground=t}get isAsync(){return!1}}class Re extends _{constructor(t,n){super(),this.resource=t,this.progress=n}async resolve(){var n;const t=await this.playground.readFileAsBuffer(this.resource.path);return(n=this.progress)==null||n.set(100),new File([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class Se extends _{constructor(t,n){super(),this.resource=t,this.progress=n}async resolve(){var t;return(t=this.progress)==null||t.set(100),new File([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class I extends _{constructor(t){super(),this.progress=t}async resolve(){var n,i;(n=this.progress)==null||n.setCaption(this.caption);const t=this.getURL();try{let r=await fetch(t);if(!r.ok)throw new Error(`Could not download "${t}"`);if(r=await G.cloneResponseMonitorProgress(r,((i=this.progress)==null?void 0:i.loadingListener)??xe),r.status!==200)throw new Error(`Could not download "${t}"`);return new File([await r.blob()],this.name)}catch(r){throw new Error(`Could not download "${t}".
669
+ );`})).json;for(const{slug:U,version:P}of W)i.push({url:`https://downloads.wordpress.org/translation/theme/${U}/${P}/${t}.zip`,type:"theme"});await r.isDir(`${m}/wp-content/languages/plugins`)||await r.mkdir(`${m}/wp-content/languages/plugins`),await r.isDir(`${m}/wp-content/languages/themes`)||await r.mkdir(`${m}/wp-content/languages/themes`);for(const{url:U,type:P}of i)try{const R=await fetch(U);if(!R.ok)throw new Error(`Failed to download translations for ${P}: ${R.statusText}`);let B=`${m}/wp-content/languages`;P==="plugin"?B+="/plugins":P==="theme"&&(B+="/themes"),await cr.unzipFile(r,new File([await R.blob()],`${t}-${P}.zip`),B)}catch(R){if(P==="core")throw new Error(`Failed to download translations for WordPress. Please check if the language code ${t} is correct. You can find all available languages and translations on https://translate.wordpress.org/.`);ce.logger.warn(`Error downloading translations for ${P}: ${R}`)}},Gr=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Ye,activateTheme:rr,cp:vr,defineSiteUrl:or,defineWpConfigConsts:Ae,enableMultisite:wr,exportWXR:Er,importThemeStarterContent:nr,importWordPressFiles:$r,importWxr:Or,installPlugin:Tr,installTheme:qr,login:Ge,mkdir:_r,mv:Pr,request:He,resetData:Ar,rm:tr,rmdir:kr,runPHP:yr,runPHPWithOptions:hr,runSql:gr,runWpInstallationWizard:Rr,setSiteLanguage:Nr,setSiteOptions:sr,unzip:Ze,updateUserMeta:br,wpCLI:Lr,writeFile:ir,zipWpContent:Sr},Symbol.toStringTag,{value:"Module"})),Yr=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function Zr(r){return r&&typeof r=="object"&&typeof r.resource=="string"&&Yr.includes(r.resource)}class $e{static create(t,{semaphore:f,progress:m}){let u;switch(t.resource){case"vfs":u=new Qr(t,m);break;case"literal":u=new Xr(t,m);break;case"wordpress.org/themes":u=new et(t,m);break;case"wordpress.org/plugins":u=new rt(t,m);break;case"url":u=new Kr(t,m);break;default:throw new Error(`Invalid resource: ${t}`)}return u=new tt(u),f&&(u=new st(u,f)),u}setPlayground(t){this.playground=t}get isAsync(){return!1}}class Qr extends $e{constructor(t,f){super(),this.resource=t,this.progress=f}async resolve(){var f;const t=await this.playground.readFileAsBuffer(this.resource.path);return(f=this.progress)==null||f.set(100),new File([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class Xr extends $e{constructor(t,f){super(),this.resource=t,this.progress=f}async resolve(){var t;return(t=this.progress)==null||t.set(100),new File([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class ar extends $e{constructor(t){super(),this.progress=t}async resolve(){var f,m;(f=this.progress)==null||f.setCaption(this.caption);const t=this.getURL();try{let u=await fetch(t);if(!u.ok)throw new Error(`Could not download "${t}"`);if(u=await mr.cloneResponseMonitorProgress(u,((m=this.progress)==null?void 0:m.loadingListener)??Jr),u.status!==200)throw new Error(`Could not download "${t}"`);return new File([await u.blob()],this.name)}catch(u){throw new Error(`Could not download "${t}".
670
670
  Check if the URL is correct and the server is reachable.
671
671
  If it is reachable, the server might be blocking the request.
672
672
  Check the browser console and network tabs for more information.
@@ -690,10 +690,10 @@ function join_paths()
690
690
  https://raw.githubusercontent.com/username/repository/branch/filename
691
691
 
692
692
  Error:
693
- ${r}`)}}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}const xe=()=>{};class je extends I{constructor(t,n){super(n),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class Le extends I{constructor(t,n){super(n),this.resource=t}get name(){return x(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${fe(this.resource.slug)}`}}class qe extends I{constructor(t,n){super(n),this.resource=t}get name(){return x(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${fe(this.resource.slug)}`}}function fe(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class me extends _{constructor(t){super(),this.resource=t}async resolve(){return this.resource.resolve()}async setPlayground(t){return this.resource.setPlayground(t)}get progress(){return this.resource.progress}set progress(t){this.resource.progress=t}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class Ce extends me{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class Oe extends me{constructor(t,n){super(t),this.semaphore=n}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}const We="http://json-schema.org/schema",Ue="#/definitions/Blueprint",Ie={Blueprint:{type:"object",properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},description:{type:"string",description:"Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what.",deprecated:"Use meta.description instead."},meta:{type:"object",properties:{title:{type:"string",description:"A clear and concise name for your Blueprint."},description:{type:"string",description:"A brief explanation of what your Blueprint offers."},author:{type:"string",description:"A GitHub username of the author of this Blueprint."},categories:{type:"array",items:{type:"string"},description:"Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org."}},required:["title","author"],additionalProperties:!1,description:"Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints"},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/SupportedPHPVersion"},{type:"string",const:"latest"}],description:"The preferred PHP version to use. If not specified, the latest supported version will be used"},wp:{type:"string",description:"The preferred WordPress version to use. If not specified, the latest supported version will be used"}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},features:{type:"object",properties:{networking:{type:"boolean",description:"Should boot with support for network request via wp_safe_remote_get?"}},additionalProperties:!1},constants:{type:"object",additionalProperties:{type:"string"},description:"PHP Constants to define on every request"},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate"},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define"},login:{anyOf:[{type:"boolean"},{type:"object",properties:{username:{type:"string"},password:{type:"string"}},required:["username","password"],additionalProperties:!1}],description:"User to log in as. If true, logs the user in as admin/password."},phpExtensionBundles:{type:"array",items:{$ref:"#/definitions/SupportedPHPExtensionBundle"},description:"The PHP extensions to use."},steps:{type:"array",items:{anyOf:[{$ref:"#/definitions/StepDefinition"},{type:"string"},{not:{}},{type:"boolean",const:!1},{type:"null"}]},description:"The steps to run after every other operation in this Blueprint was executed."},$schema:{type:"string"}},additionalProperties:!1},SupportedPHPVersion:{type:"string",enum:["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"]},FileReference:{anyOf:[{$ref:"#/definitions/VFSReference"},{$ref:"#/definitions/LiteralReference"},{$ref:"#/definitions/CoreThemeReference"},{$ref:"#/definitions/CorePluginReference"},{$ref:"#/definitions/UrlReference"}]},VFSReference:{type:"object",properties:{resource:{type:"string",const:"vfs",description:"Identifies the file resource as Virtual File System (VFS)"},path:{type:"string",description:"The path to the file in the VFS"}},required:["resource","path"],additionalProperties:!1},LiteralReference:{type:"object",properties:{resource:{type:"string",const:"literal",description:"Identifies the file resource as a literal file"},name:{type:"string",description:"The name of the file"},contents:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The contents of the file"}},required:["resource","name","contents"],additionalProperties:!1},CoreThemeReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/themes",description:"Identifies the file resource as a WordPress Core theme"},slug:{type:"string",description:"The slug of the WordPress Core theme"}},required:["resource","slug"],additionalProperties:!1},CorePluginReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/plugins",description:"Identifies the file resource as a WordPress Core plugin"},slug:{type:"string",description:"The slug of the WordPress Core plugin"}},required:["resource","slug"],additionalProperties:!1},UrlReference:{type:"object",properties:{resource:{type:"string",const:"url",description:"Identifies the file resource as a URL"},url:{type:"string",description:"The URL of the file"},caption:{type:"string",description:"Optional caption for displaying a progress message"}},required:["resource","url"],additionalProperties:!1},SupportedPHPExtensionBundle:{type:"string",enum:["kitchen-sink","light"]},StepDefinition:{type:"object",discriminator:{propertyName:"step"},required:["step"],oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},method:{type:"string",enum:["rewrite-wp-config","define-before-run"],description:`The method of defining the constants in wp-config.php. Possible values are:
693
+ ${u}`)}}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}const Jr=()=>{};class Kr extends ar{constructor(t,f){super(f),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class et extends ar{constructor(t,f){super(f),this.resource=t}get name(){return Qe(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${Fr(this.resource.slug)}`}}class rt extends ar{constructor(t,f){super(f),this.resource=t}get name(){return Qe(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${Fr(this.resource.slug)}`}}function Fr(r){return!r||r.endsWith(".zip")?r:r+".latest-stable.zip"}class xr extends $e{constructor(t){super(),this.resource=t}async resolve(){return this.resource.resolve()}async setPlayground(t){return this.resource.setPlayground(t)}get progress(){return this.resource.progress}set progress(t){this.resource.progress=t}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class tt extends xr{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class st extends xr{constructor(t,f){super(t),this.semaphore=f}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}const it={type:"object",properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},description:{type:"string",description:"Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what.",deprecated:"Use meta.description instead."},meta:{type:"object",properties:{title:{type:"string",description:"A clear and concise name for your Blueprint."},description:{type:"string",description:"A brief explanation of what your Blueprint offers."},author:{type:"string",description:"A GitHub username of the author of this Blueprint."},categories:{type:"array",items:{type:"string"},description:"Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org."}},required:["title","author"],additionalProperties:!1,description:"Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints"},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/SupportedPHPVersion"},{type:"string",const:"latest"}],description:"The preferred PHP version to use. If not specified, the latest supported version will be used"},wp:{type:"string",description:"The preferred WordPress version to use. If not specified, the latest supported version will be used"}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},features:{type:"object",properties:{networking:{type:"boolean",description:"Should boot with support for network request via wp_safe_remote_get?"}},additionalProperties:!1},constants:{type:"object",additionalProperties:{type:"string"},description:"PHP Constants to define on every request"},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate"},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define"},login:{anyOf:[{type:"boolean"},{type:"object",properties:{username:{type:"string"},password:{type:"string"}},required:["username","password"],additionalProperties:!1}],description:"User to log in as. If true, logs the user in as admin/password."},phpExtensionBundles:{type:"array",items:{$ref:"#/definitions/SupportedPHPExtensionBundle"},description:"The PHP extensions to use."},steps:{type:"array",items:{anyOf:[{$ref:"#/definitions/StepDefinition"},{type:"string"},{not:{}},{type:"boolean",const:!1},{type:"null"}]},description:"The steps to run after every other operation in this Blueprint was executed."},$schema:{type:"string"}},additionalProperties:!1},ot={type:"string",enum:["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"]},nt={type:"string",enum:["kitchen-sink","light"]},Cr=Object.prototype.hasOwnProperty;function re(r,{instancePath:t="",parentData:f,parentDataProperty:m,rootData:u=r}={}){let i=null,e=0;const c=e;let _=!1;const W=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let F;if(r.resource===void 0&&(F="resource")||r.path===void 0&&(F="path")){const J={instancePath:t,schemaPath:"#/definitions/VFSReference/required",keyword:"required",params:{missingProperty:F},message:"must have required property '"+F+"'"};i===null?i=[J]:i.push(J),e++}else{const J=e;for(const d in r)if(!(d==="resource"||d==="path")){const T={instancePath:t,schemaPath:"#/definitions/VFSReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:d},message:"must NOT have additional properties"};i===null?i=[T]:i.push(T),e++;break}if(J===e){if(r.resource!==void 0){let d=r.resource;const T=e;if(typeof d!="string"){const H={instancePath:t+"/resource",schemaPath:"#/definitions/VFSReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),e++}if(d!=="vfs"){const H={instancePath:t+"/resource",schemaPath:"#/definitions/VFSReference/properties/resource/const",keyword:"const",params:{allowedValue:"vfs"},message:"must be equal to constant"};i===null?i=[H]:i.push(H),e++}var P=T===e}else var P=!0;if(P)if(r.path!==void 0){const d=e;if(typeof r.path!="string"){const H={instancePath:t+"/path",schemaPath:"#/definitions/VFSReference/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),e++}var P=d===e}else var P=!0}}}else{const F={instancePath:t,schemaPath:"#/definitions/VFSReference/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[F]:i.push(F),e++}var R=W===e;if(_=_||R,!_){const F=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let T;if(r.resource===void 0&&(T="resource")||r.name===void 0&&(T="name")||r.contents===void 0&&(T="contents")){const H={instancePath:t,schemaPath:"#/definitions/LiteralReference/required",keyword:"required",params:{missingProperty:T},message:"must have required property '"+T+"'"};i===null?i=[H]:i.push(H),e++}else{const H=e;for(const y in r)if(!(y==="resource"||y==="name"||y==="contents")){const v={instancePath:t,schemaPath:"#/definitions/LiteralReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:y},message:"must NOT have additional properties"};i===null?i=[v]:i.push(v),e++;break}if(H===e){if(r.resource!==void 0){let y=r.resource;const v=e;if(typeof y!="string"){const h={instancePath:t+"/resource",schemaPath:"#/definitions/LiteralReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[h]:i.push(h),e++}if(y!=="literal"){const h={instancePath:t+"/resource",schemaPath:"#/definitions/LiteralReference/properties/resource/const",keyword:"const",params:{allowedValue:"literal"},message:"must be equal to constant"};i===null?i=[h]:i.push(h),e++}var B=v===e}else var B=!0;if(B){if(r.name!==void 0){const y=e;if(typeof r.name!="string"){const h={instancePath:t+"/name",schemaPath:"#/definitions/LiteralReference/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[h]:i.push(h),e++}var B=y===e}else var B=!0;if(B)if(r.contents!==void 0){let y=r.contents;const v=e,h=e;let k=!1;const g=e;if(typeof y!="string"){const S={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[S]:i.push(S),e++}var C=g===e;if(k=k||C,!k){const S=e;if(e===S)if(y&&typeof y=="object"&&!Array.isArray(y)){let $;if(y.BYTES_PER_ELEMENT===void 0&&($="BYTES_PER_ELEMENT")||y.buffer===void 0&&($="buffer")||y.byteLength===void 0&&($="byteLength")||y.byteOffset===void 0&&($="byteOffset")||y.length===void 0&&($="length")){const V={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/required",keyword:"required",params:{missingProperty:$},message:"must have required property '"+$+"'"};i===null?i=[V]:i.push(V),e++}else{const V=e;for(const j in y)if(!(j==="BYTES_PER_ELEMENT"||j==="buffer"||j==="byteLength"||j==="byteOffset"||j==="length")){let G=y[j];const se=e;if(!(typeof G=="number"&&isFinite(G))){const Q={instancePath:t+"/contents/"+j.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Q]:i.push(Q),e++}var w=se===e;if(!w)break}if(V===e){if(y.BYTES_PER_ELEMENT!==void 0){let j=y.BYTES_PER_ELEMENT;const G=e;if(!(typeof j=="number"&&isFinite(j))){const se={instancePath:t+"/contents/BYTES_PER_ELEMENT",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[se]:i.push(se),e++}var I=G===e}else var I=!0;if(I){if(y.buffer!==void 0){let j=y.buffer;const G=e;if(e===G)if(j&&typeof j=="object"&&!Array.isArray(j)){let Q;if(j.byteLength===void 0&&(Q="byteLength")){const N={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:Q},message:"must have required property '"+Q+"'"};i===null?i=[N]:i.push(N),e++}else{const N=e;for(const M in j)if(M!=="byteLength"){const z={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:M},message:"must NOT have additional properties"};i===null?i=[z]:i.push(z),e++;break}if(N===e&&j.byteLength!==void 0){let M=j.byteLength;if(!(typeof M=="number"&&isFinite(M))){const z={instancePath:t+"/contents/buffer/byteLength",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[z]:i.push(z),e++}}}}else{const Q={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[Q]:i.push(Q),e++}var I=G===e}else var I=!0;if(I){if(y.byteLength!==void 0){let j=y.byteLength;const G=e;if(!(typeof j=="number"&&isFinite(j))){const Q={instancePath:t+"/contents/byteLength",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Q]:i.push(Q),e++}var I=G===e}else var I=!0;if(I){if(y.byteOffset!==void 0){let j=y.byteOffset;const G=e;if(!(typeof j=="number"&&isFinite(j))){const Q={instancePath:t+"/contents/byteOffset",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Q]:i.push(Q),e++}var I=G===e}else var I=!0;if(I)if(y.length!==void 0){let j=y.length;const G=e;if(!(typeof j=="number"&&isFinite(j))){const Q={instancePath:t+"/contents/length",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Q]:i.push(Q),e++}var I=G===e}else var I=!0}}}}}}else{const $={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[$]:i.push($),e++}var C=S===e;k=k||C}if(k)e=h,i!==null&&(h?i.length=h:i=null);else{const S={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};i===null?i=[S]:i.push(S),e++}var B=v===e}else var B=!0}}}}else{const T={instancePath:t,schemaPath:"#/definitions/LiteralReference/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[T]:i.push(T),e++}var R=F===e;if(_=_||R,!_){const T=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let v;if(r.resource===void 0&&(v="resource")||r.slug===void 0&&(v="slug")){const h={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/required",keyword:"required",params:{missingProperty:v},message:"must have required property '"+v+"'"};i===null?i=[h]:i.push(h),e++}else{const h=e;for(const k in r)if(!(k==="resource"||k==="slug")){const g={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:k},message:"must NOT have additional properties"};i===null?i=[g]:i.push(g),e++;break}if(h===e){if(r.resource!==void 0){let k=r.resource;const g=e;if(typeof k!="string"){const l={instancePath:t+"/resource",schemaPath:"#/definitions/CoreThemeReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[l]:i.push(l),e++}if(k!=="wordpress.org/themes"){const l={instancePath:t+"/resource",schemaPath:"#/definitions/CoreThemeReference/properties/resource/const",keyword:"const",params:{allowedValue:"wordpress.org/themes"},message:"must be equal to constant"};i===null?i=[l]:i.push(l),e++}var ee=g===e}else var ee=!0;if(ee)if(r.slug!==void 0){const k=e;if(typeof r.slug!="string"){const l={instancePath:t+"/slug",schemaPath:"#/definitions/CoreThemeReference/properties/slug/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[l]:i.push(l),e++}var ee=k===e}else var ee=!0}}}else{const v={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[v]:i.push(v),e++}var R=T===e;if(_=_||R,!_){const v=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let g;if(r.resource===void 0&&(g="resource")||r.slug===void 0&&(g="slug")){const l={instancePath:t,schemaPath:"#/definitions/CorePluginReference/required",keyword:"required",params:{missingProperty:g},message:"must have required property '"+g+"'"};i===null?i=[l]:i.push(l),e++}else{const l=e;for(const S in r)if(!(S==="resource"||S==="slug")){const q={instancePath:t,schemaPath:"#/definitions/CorePluginReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:S},message:"must NOT have additional properties"};i===null?i=[q]:i.push(q),e++;break}if(l===e){if(r.resource!==void 0){let S=r.resource;const q=e;if(typeof S!="string"){const $={instancePath:t+"/resource",schemaPath:"#/definitions/CorePluginReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[$]:i.push($),e++}if(S!=="wordpress.org/plugins"){const $={instancePath:t+"/resource",schemaPath:"#/definitions/CorePluginReference/properties/resource/const",keyword:"const",params:{allowedValue:"wordpress.org/plugins"},message:"must be equal to constant"};i===null?i=[$]:i.push($),e++}var A=q===e}else var A=!0;if(A)if(r.slug!==void 0){const S=e;if(typeof r.slug!="string"){const $={instancePath:t+"/slug",schemaPath:"#/definitions/CorePluginReference/properties/slug/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[$]:i.push($),e++}var A=S===e}else var A=!0}}}else{const g={instancePath:t,schemaPath:"#/definitions/CorePluginReference/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[g]:i.push(g),e++}var R=v===e;if(_=_||R,!_){const g=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let q;if(r.resource===void 0&&(q="resource")||r.url===void 0&&(q="url")){const $={instancePath:t,schemaPath:"#/definitions/UrlReference/required",keyword:"required",params:{missingProperty:q},message:"must have required property '"+q+"'"};i===null?i=[$]:i.push($),e++}else{const $=e;for(const V in r)if(!(V==="resource"||V==="url"||V==="caption")){const j={instancePath:t,schemaPath:"#/definitions/UrlReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties"};i===null?i=[j]:i.push(j),e++;break}if($===e){if(r.resource!==void 0){let V=r.resource;const j=e;if(typeof V!="string"){const G={instancePath:t+"/resource",schemaPath:"#/definitions/UrlReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[G]:i.push(G),e++}if(V!=="url"){const G={instancePath:t+"/resource",schemaPath:"#/definitions/UrlReference/properties/resource/const",keyword:"const",params:{allowedValue:"url"},message:"must be equal to constant"};i===null?i=[G]:i.push(G),e++}var b=j===e}else var b=!0;if(b){if(r.url!==void 0){const V=e;if(typeof r.url!="string"){const G={instancePath:t+"/url",schemaPath:"#/definitions/UrlReference/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[G]:i.push(G),e++}var b=V===e}else var b=!0;if(b)if(r.caption!==void 0){const V=e;if(typeof r.caption!="string"){const G={instancePath:t+"/caption",schemaPath:"#/definitions/UrlReference/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[G]:i.push(G),e++}var b=V===e}else var b=!0}}}}else{const q={instancePath:t,schemaPath:"#/definitions/UrlReference/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[q]:i.push(q),e++}var R=g===e;_=_||R}}}}if(_)e=c,i!==null&&(c?i.length=c:i=null);else{const F={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[F]:i.push(F),e++,re.errors=i,!1}return re.errors=i,e===0}const Ke={type:"object",discriminator:{propertyName:"step"},required:["step"],oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},method:{type:"string",enum:["rewrite-wp-config","define-before-run"],description:`The method of defining the constants in wp-config.php. Possible values are:
694
694
 
695
695
  - rewrite-wp-config: Default. Rewrites the wp-config.php file to explicitly call define() with the requested name and value. This method alters the file on the disk, but it doesn't conflict with existing define() calls in wp-config.php.
696
696
 
697
697
  - define-before-run: Defines the constant before running the requested script. It doesn't alter any files on the disk, but constants defined this way may conflict with existing define() calls in wp-config.php.`},virtualize:{type:"boolean",deprecated:`This option is noop and will be removed in a future version.
698
698
  This option is only kept in here to avoid breaking Blueprint schema validation
699
- for existing apps using this option.`}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"enableMultisite"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWxr"},file:{$ref:"#/definitions/FileReference",description:"The file to import"}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importThemeStarterContent",description:"The step identifier."},themeSlug:{type:"string",description:"The name of the theme to import content from."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWordPressFiles"},wordPressFilesZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the top-level WordPress files and directories."},pathInZip:{type:"string",description:"The path inside the zip file where the WordPress files are."}},required:["step","wordPressFilesZip"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginZipFile:{$ref:"#/definitions/FileReference",description:"The plugin zip file to install."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginZipFile","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},step:{type:"string",const:"installTheme",description:"The step identifier."},themeZipFile:{$ref:"#/definitions/FileReference",description:"The theme zip file to install."},options:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the theme after installing it."},importStarterContent:{type:"boolean",description:"Whether to import the theme's starter content after installing it."}},additionalProperties:!1,description:"Optional installation options."}},required:["step","themeZipFile"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"login"},username:{type:"string",description:"The user to log in as. Defaults to 'admin'."},password:{type:"string",description:"The password to log in with. Defaults to 'password'."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"resetData"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{type:"string",description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions/))"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runSql",description:"The step identifier."},sql:{$ref:"#/definitions/FileReference",description:"The SQL to run. Each non-empty line must contain a valid SQL query."}},required:["sql","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipFile:{$ref:"#/definitions/FileReference",description:"The zip file to extract"},zipPath:{type:"string",description:"The path of the zip file to extract",deprecated:"Use zipFile instead."},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"wp-cli",description:"The step identifier."},command:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"The WP CLI command to run."},wpCliPath:{type:"string",description:"wp-cli.phar path"}},required:["command","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteLanguage"},language:{type:"string",description:"The language to set, e.g. 'en_US'"}},required:["language","step"]}]},InstallPluginOptions:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the plugin after installing it."}},additionalProperties:!1},PHPRequest:{type:"object",properties:{method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},url:{type:"string",description:"Request path or absolute URL."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}},{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}},{type:"object",properties:{size:{type:"number"},type:{type:"string"},lastModified:{type:"number"},name:{type:"string"},webkitRelativePath:{type:"string"}},required:["lastModified","name","size","type","webkitRelativePath"],additionalProperties:!1}]}}],description:"Request body. If an object is given, the request will be encoded as multipart and sent with a `multipart/form-data` header."}},required:["url"],additionalProperties:!1},HTTPMethod:{type:"string",enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]},PHPRequestHeaders:{type:"object",additionalProperties:{type:"string"}},PHPRunOptions:{type:"object",properties:{relativeUri:{type:"string",description:"Request path following the domain:port part."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"Request body."},env:{type:"object",additionalProperties:{type:"string"},description:"Environment variables to set for this run."},$_SERVER:{type:"object",additionalProperties:{type:"string"},description:"$_SERVER entries to set for this run."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},Fe={$schema:We,$ref:Ue,definitions:Ie},{wpCLI:Be,...M}=Te,Ae={...M,"wp-cli":Be,importFile:M.importWxr};function De(e,{progress:t=new G.ProgressTracker,semaphore:n=new o.Semaphore({concurrency:3}),onStepCompleted:i=()=>{}}={}){var p,u,m,E,F,B,A;e={...e,steps:(e.steps||[]).filter(Ve).filter(Ge)};for(const d of e.steps)typeof d=="object"&&d.step==="importFile"&&(d.step="importWxr",g.logger.warn('The "importFile" step is deprecated. Use "importWxr" instead.'));if(e.constants&&e.steps.unshift({step:"defineWpConfigConsts",consts:e.constants}),e.siteOptions&&e.steps.unshift({step:"setSiteOptions",options:e.siteOptions}),e.plugins){const d=e.plugins.map(w=>typeof w=="string"?w.startsWith("https://")?{resource:"url",url:w}:{resource:"wordpress.org/plugins",slug:w}:w).map(w=>({step:"installPlugin",pluginZipFile:w}));e.steps.unshift(...d)}e.login&&e.steps.push({step:"login",...e.login===!0?{username:"admin",password:"password"}:e.login}),e.phpExtensionBundles||(e.phpExtensionBundles=[]),e.phpExtensionBundles||(e.phpExtensionBundles=[]),e.phpExtensionBundles.length===0&&e.phpExtensionBundles.push("kitchen-sink");const r=(p=e.steps)==null?void 0:p.findIndex(d=>typeof d=="object"&&(d==null?void 0:d.step)==="wp-cli");r!==void 0&&r>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter(d=>d!=="light"),g.logger.warn("The wpCli step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. ")),(u=e.steps)==null||u.splice(r,0,{step:"writeFile",data:{resource:"url",url:"https://playground.wordpress.net/wp-cli.phar"},path:"/tmp/wp-cli.phar"}));const s=(m=e.steps)==null?void 0:m.findIndex(d=>typeof d=="object"&&(d==null?void 0:d.step)==="importWxr");s!==void 0&&s>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter(d=>d!=="light"),g.logger.warn("The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. ")),(E=e.steps)==null||E.splice(s,0,{step:"installPlugin",pluginZipFile:{resource:"url",url:"https://playground.wordpress.net/wordpress-importer.zip",caption:"Downloading the WordPress Importer plugin"}}));const{valid:a,errors:l}=ze(e);if(!a){const d=new Error(`Invalid blueprint: ${l[0].message} at ${l[0].instancePath}`);throw d.errors=l,d}const c=e.steps||[],f=c.reduce((d,w)=>{var y;return d+(((y=w.progress)==null?void 0:y.weight)||1)},0),h=c.map(d=>Qe(d,{semaphore:n,rootProgressTracker:t,totalProgressWeight:f}));return{versions:{php:Me((F=e.preferredVersions)==null?void 0:F.php,b.SupportedPHPVersions,b.LatestSupportedPHPVersion),wp:((B=e.preferredVersions)==null?void 0:B.wp)||"latest"},phpExtensions:He([],e.phpExtensionBundles||[]),features:{networking:((A=e.features)==null?void 0:A.networking)??!1},run:async d=>{try{for(const{resources:w}of h)for(const y of w)y.setPlayground(d),y.isAsync&&y.resolve();for(const[w,{run:y,step:D}]of Object.entries(h))try{const $=await y(d);i($,D)}catch($){throw g.logger.error($),new Error(`Error when executing the blueprint step #${w} (${JSON.stringify(D)}) ${$ instanceof Error?`: ${$.message}`:$}`,{cause:$})}}finally{try{await d.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const Ne=new we({discriminator:!0});let T;function ze(e){var r;T=Ne.compile(Fe);const t=T(e);if(t)return{valid:t};const n=new Set;for(const s of T.errors)s.schemaPath.startsWith("#/properties/steps/items/anyOf")||n.add(s.instancePath);const i=(r=T.errors)==null?void 0:r.filter(s=>!(s.schemaPath.startsWith("#/properties/steps/items/anyOf")&&n.has(s.instancePath)));return{valid:t,errors:i}}function Me(e,t,n){return e&&t.includes(e)?e:n}function He(e,t){const n=b.SupportedPHPExtensionsList.filter(r=>e.includes(r)),i=t.flatMap(r=>r in b.SupportedPHPExtensionBundles?b.SupportedPHPExtensionBundles[r]:[]);return Array.from(new Set([...n,...i]))}function Ve(e){return!!(typeof e=="object"&&e)}function Ge(e){return["setPhpIniEntry","request"].includes(e.step)?(g.logger.warn(`The "${e.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`),!1):!0}function Qe(e,{semaphore:t,rootProgressTracker:n,totalProgressWeight:i}){var h;const r=n.stage((((h=e.progress)==null?void 0:h.weight)||1)/i),s={};for(const p of Object.keys(e)){let u=e[p];ke(u)&&(u=_.create(u,{semaphore:t})),s[p]=u}const a=async p=>{var u;try{return r.fillSlowly(),await Ae[e.step](p,await Ye(s),{tracker:r,initialCaption:(u=e.progress)==null?void 0:u.caption})}finally{r.finish()}},l=H(s),c=H(s).filter(p=>p.isAsync),f=1/(c.length+1);for(const p of c)p.progress=r.stage(f);return{run:a,step:e,resources:l}}function H(e){const t=[];for(const n in e){const i=e[n];i instanceof _&&t.push(i)}return t}async function Ye(e){const t={};for(const n in e){const i=e[n];i instanceof _?t[n]=await i.resolve():t[n]=i}return t}async function Ze(e,t){await e.run(t)}function Xe(){}exports.activatePlugin=R;exports.activateTheme=L;exports.compileBlueprint=De;exports.cp=K;exports.defineSiteUrl=W;exports.defineWpConfigConsts=P;exports.enableMultisite=J;exports.exportWXR=se;exports.importThemeStarterContent=U;exports.importWordPressFiles=re;exports.importWxr=ie;exports.installPlugin=ae;exports.installTheme=pe;exports.login=k;exports.mkdir=te;exports.mv=ee;exports.request=v;exports.resetData=ce;exports.rm=q;exports.rmdir=ne;exports.runBlueprintSteps=Ze;exports.runPHP=Q;exports.runPHPWithOptions=Y;exports.runSql=Z;exports.runWpInstallationWizard=le;exports.setPluginProxyURL=Xe;exports.setSiteLanguage=he;exports.setSiteOptions=C;exports.unzip=S;exports.updateUserMeta=X;exports.wpCLI=ue;exports.wpContentFilesExcludedFromExport=j;exports.writeFile=O;exports.zipWpContent=de;
699
+ for existing apps using this option.`}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"enableMultisite"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWxr"},file:{$ref:"#/definitions/FileReference",description:"The file to import"}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importThemeStarterContent",description:"The step identifier."},themeSlug:{type:"string",description:"The name of the theme to import content from."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWordPressFiles"},wordPressFilesZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the top-level WordPress files and directories."},pathInZip:{type:"string",description:"The path inside the zip file where the WordPress files are."}},required:["step","wordPressFilesZip"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginZipFile:{$ref:"#/definitions/FileReference",description:"The plugin zip file to install."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginZipFile","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},step:{type:"string",const:"installTheme",description:"The step identifier."},themeZipFile:{$ref:"#/definitions/FileReference",description:"The theme zip file to install."},options:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the theme after installing it."},importStarterContent:{type:"boolean",description:"Whether to import the theme's starter content after installing it."}},additionalProperties:!1,description:"Optional installation options."}},required:["step","themeZipFile"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"login"},username:{type:"string",description:"The user to log in as. Defaults to 'admin'."},password:{type:"string",description:"The password to log in with. Defaults to 'password'."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"resetData"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{type:"string",description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions/))"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runSql",description:"The step identifier."},sql:{$ref:"#/definitions/FileReference",description:"The SQL to run. Each non-empty line must contain a valid SQL query."}},required:["sql","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipFile:{$ref:"#/definitions/FileReference",description:"The zip file to extract"},zipPath:{type:"string",description:"The path of the zip file to extract",deprecated:"Use zipFile instead."},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"wp-cli",description:"The step identifier."},command:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"The WP CLI command to run."},wpCliPath:{type:"string",description:"wp-cli.phar path"}},required:["command","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteLanguage"},language:{type:"string",description:"The language to set, e.g. 'en_US'"}},required:["language","step"]}]},Ir={type:"string",enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]};function ue(r,{instancePath:t="",parentData:f,parentDataProperty:m,rootData:u=r}={}){let i=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){let ee;if(r.url===void 0&&(ee="url"))return ue.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:ee},message:"must have required property '"+ee+"'"}],!1;{const A=e;for(const b in r)if(!(b==="method"||b==="url"||b==="headers"||b==="body"))return ue.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:b},message:"must NOT have additional properties"}],!1;if(A===e){if(r.method!==void 0){let b=r.method;const F=e;if(typeof b!="string")return ue.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(b==="GET"||b==="POST"||b==="HEAD"||b==="OPTIONS"||b==="PATCH"||b==="PUT"||b==="DELETE"))return ue.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/enum",keyword:"enum",params:{allowedValues:Ir.enum},message:"must be equal to one of the allowed values"}],!1;var c=F===e}else var c=!0;if(c){if(r.url!==void 0){const b=e;if(typeof r.url!="string")return ue.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=b===e}else var c=!0;if(c){if(r.headers!==void 0){let b=r.headers;const F=e;if(e===e)if(b&&typeof b=="object"&&!Array.isArray(b))for(const T in b){const H=e;if(typeof b[T]!="string")return ue.errors=[{instancePath:t+"/headers/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/PHPRequestHeaders/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=H===e;if(!_)break}else return ue.errors=[{instancePath:t+"/headers",schemaPath:"#/definitions/PHPRequestHeaders/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=F===e}else var c=!0;if(c)if(r.body!==void 0){let b=r.body;const F=e,J=e;let d=!1;const T=e;if(typeof b!="string"){const y={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[y]:i.push(y),e++}var W=T===e;if(d=d||W,!d){const y=e;if(e===y)if(b&&typeof b=="object"&&!Array.isArray(b)){let h;if(b.BYTES_PER_ELEMENT===void 0&&(h="BYTES_PER_ELEMENT")||b.buffer===void 0&&(h="buffer")||b.byteLength===void 0&&(h="byteLength")||b.byteOffset===void 0&&(h="byteOffset")||b.length===void 0&&(h="length")){const k={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/required",keyword:"required",params:{missingProperty:h},message:"must have required property '"+h+"'"};i===null?i=[k]:i.push(k),e++}else{const k=e;for(const g in b)if(!(g==="BYTES_PER_ELEMENT"||g==="buffer"||g==="byteLength"||g==="byteOffset"||g==="length")){let l=b[g];const S=e;if(!(typeof l=="number"&&isFinite(l))){const q={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[q]:i.push(q),e++}var U=S===e;if(!U)break}if(k===e){if(b.BYTES_PER_ELEMENT!==void 0){let g=b.BYTES_PER_ELEMENT;const l=e;if(!(typeof g=="number"&&isFinite(g))){const S={instancePath:t+"/body/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[S]:i.push(S),e++}var P=l===e}else var P=!0;if(P){if(b.buffer!==void 0){let g=b.buffer;const l=e;if(e===l)if(g&&typeof g=="object"&&!Array.isArray(g)){let q;if(g.byteLength===void 0&&(q="byteLength")){const $={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:q},message:"must have required property '"+q+"'"};i===null?i=[$]:i.push($),e++}else{const $=e;for(const V in g)if(V!=="byteLength"){const j={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties"};i===null?i=[j]:i.push(j),e++;break}if($===e&&g.byteLength!==void 0){let V=g.byteLength;if(!(typeof V=="number"&&isFinite(V))){const j={instancePath:t+"/body/buffer/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[j]:i.push(j),e++}}}}else{const q={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[q]:i.push(q),e++}var P=l===e}else var P=!0;if(P){if(b.byteLength!==void 0){let g=b.byteLength;const l=e;if(!(typeof g=="number"&&isFinite(g))){const q={instancePath:t+"/body/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[q]:i.push(q),e++}var P=l===e}else var P=!0;if(P){if(b.byteOffset!==void 0){let g=b.byteOffset;const l=e;if(!(typeof g=="number"&&isFinite(g))){const q={instancePath:t+"/body/byteOffset",schemaPath:"#/properties/body/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[q]:i.push(q),e++}var P=l===e}else var P=!0;if(P)if(b.length!==void 0){let g=b.length;const l=e;if(!(typeof g=="number"&&isFinite(g))){const q={instancePath:t+"/body/length",schemaPath:"#/properties/body/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[q]:i.push(q),e++}var P=l===e}else var P=!0}}}}}}else{const h={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[h]:i.push(h),e++}var W=y===e;if(d=d||W,!d){const h=e;if(e===h)if(b&&typeof b=="object"&&!Array.isArray(b))for(const g in b){let l=b[g];const S=e,q=e;let $=!1;const V=e;if(typeof l!="string"){const j={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[j]:i.push(j),e++}var R=V===e;if($=$||R,!$){const j=e;if(e===j)if(l&&typeof l=="object"&&!Array.isArray(l)){let se;if(l.BYTES_PER_ELEMENT===void 0&&(se="BYTES_PER_ELEMENT")||l.buffer===void 0&&(se="buffer")||l.byteLength===void 0&&(se="byteLength")||l.byteOffset===void 0&&(se="byteOffset")||l.length===void 0&&(se="length")){const Q={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/required",keyword:"required",params:{missingProperty:se},message:"must have required property '"+se+"'"};i===null?i=[Q]:i.push(Q),e++}else{const Q=e;for(const N in l)if(!(N==="BYTES_PER_ELEMENT"||N==="buffer"||N==="byteLength"||N==="byteOffset"||N==="length")){let M=l[N];const z=e;if(!(typeof M=="number"&&isFinite(M))){const Y={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/"+N.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Y]:i.push(Y),e++}var B=z===e;if(!B)break}if(Q===e){if(l.BYTES_PER_ELEMENT!==void 0){let N=l.BYTES_PER_ELEMENT;const M=e;if(!(typeof N=="number"&&isFinite(N))){const z={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[z]:i.push(z),e++}var C=M===e}else var C=!0;if(C){if(l.buffer!==void 0){let N=l.buffer;const M=e;if(e===M)if(N&&typeof N=="object"&&!Array.isArray(N)){let Y;if(N.byteLength===void 0&&(Y="byteLength")){const te={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:Y},message:"must have required property '"+Y+"'"};i===null?i=[te]:i.push(te),e++}else{const te=e;for(const ne in N)if(ne!=="byteLength"){const ae={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:ne},message:"must NOT have additional properties"};i===null?i=[ae]:i.push(ae),e++;break}if(te===e&&N.byteLength!==void 0){let ne=N.byteLength;if(!(typeof ne=="number"&&isFinite(ne))){const ae={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer/byteLength",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[ae]:i.push(ae),e++}}}}else{const Y={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[Y]:i.push(Y),e++}var C=M===e}else var C=!0;if(C){if(l.byteLength!==void 0){let N=l.byteLength;const M=e;if(!(typeof N=="number"&&isFinite(N))){const Y={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/byteLength",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Y]:i.push(Y),e++}var C=M===e}else var C=!0;if(C){if(l.byteOffset!==void 0){let N=l.byteOffset;const M=e;if(!(typeof N=="number"&&isFinite(N))){const Y={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/byteOffset",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Y]:i.push(Y),e++}var C=M===e}else var C=!0;if(C)if(l.length!==void 0){let N=l.length;const M=e;if(!(typeof N=="number"&&isFinite(N))){const Y={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/length",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Y]:i.push(Y),e++}var C=M===e}else var C=!0}}}}}}else{const se={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[se]:i.push(se),e++}var R=j===e;if($=$||R,!$){const se=e;if(e===se)if(l&&typeof l=="object"&&!Array.isArray(l)){let N;if(l.lastModified===void 0&&(N="lastModified")||l.name===void 0&&(N="name")||l.size===void 0&&(N="size")||l.type===void 0&&(N="type")||l.webkitRelativePath===void 0&&(N="webkitRelativePath")){const M={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/required",keyword:"required",params:{missingProperty:N},message:"must have required property '"+N+"'"};i===null?i=[M]:i.push(M),e++}else{const M=e;for(const z in l)if(!(z==="size"||z==="type"||z==="lastModified"||z==="name"||z==="webkitRelativePath")){const Y={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:z},message:"must NOT have additional properties"};i===null?i=[Y]:i.push(Y),e++;break}if(M===e){if(l.size!==void 0){let z=l.size;const Y=e;if(!(typeof z=="number"&&isFinite(z))){const te={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/size",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/size/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[te]:i.push(te),e++}var w=Y===e}else var w=!0;if(w){if(l.type!==void 0){const z=e;if(typeof l.type!="string"){const te={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/type",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[te]:i.push(te),e++}var w=z===e}else var w=!0;if(w){if(l.lastModified!==void 0){let z=l.lastModified;const Y=e;if(!(typeof z=="number"&&isFinite(z))){const ne={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/lastModified",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/lastModified/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[ne]:i.push(ne),e++}var w=Y===e}else var w=!0;if(w){if(l.name!==void 0){const z=e;if(typeof l.name!="string"){const te={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/name",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[te]:i.push(te),e++}var w=z===e}else var w=!0;if(w)if(l.webkitRelativePath!==void 0){const z=e;if(typeof l.webkitRelativePath!="string"){const te={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/webkitRelativePath",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/webkitRelativePath/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[te]:i.push(te),e++}var w=z===e}else var w=!0}}}}}}else{const N={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[N]:i.push(N),e++}var R=se===e;$=$||R}}if($)e=q,i!==null&&(q?i.length=q:i=null);else{const j={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};i===null?i=[j]:i.push(j),e++}var I=S===e;if(!I)break}else{const g={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[g]:i.push(g),e++}var W=h===e;d=d||W}}if(d)e=J,i!==null&&(J?i.length=J:i=null);else{const y={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[y]:i.push(y),e++,ue.errors=i,!1}var c=F===e}else var c=!0}}}}}else return ue.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ue.errors=i,e===0}const at={type:"object",properties:{relativeUri:{type:"string",description:"Request path following the domain:port part."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"Request body."},env:{type:"object",additionalProperties:{type:"string"},description:"Environment variables to set for this run."},$_SERVER:{type:"object",additionalProperties:{type:"string"},description:"$_SERVER entries to set for this run."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1};function ie(r,{instancePath:t="",parentData:f,parentDataProperty:m,rootData:u=r}={}){let i=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){const C=e;for(const w in r)if(!Cr.call(at.properties,w))return ie.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:w},message:"must NOT have additional properties"}],!1;if(C===e){if(r.relativeUri!==void 0){const w=e;if(typeof r.relativeUri!="string")return ie.errors=[{instancePath:t+"/relativeUri",schemaPath:"#/properties/relativeUri/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=w===e}else var c=!0;if(c){if(r.scriptPath!==void 0){const w=e;if(typeof r.scriptPath!="string")return ie.errors=[{instancePath:t+"/scriptPath",schemaPath:"#/properties/scriptPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=w===e}else var c=!0;if(c){if(r.protocol!==void 0){const w=e;if(typeof r.protocol!="string")return ie.errors=[{instancePath:t+"/protocol",schemaPath:"#/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=w===e}else var c=!0;if(c){if(r.method!==void 0){let w=r.method;const I=e;if(typeof w!="string")return ie.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(w==="GET"||w==="POST"||w==="HEAD"||w==="OPTIONS"||w==="PATCH"||w==="PUT"||w==="DELETE"))return ie.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/enum",keyword:"enum",params:{allowedValues:Ir.enum},message:"must be equal to one of the allowed values"}],!1;var c=I===e}else var c=!0;if(c){if(r.headers!==void 0){let w=r.headers;const I=e;if(e===e)if(w&&typeof w=="object"&&!Array.isArray(w))for(const b in w){const F=e;if(typeof w[b]!="string")return ie.errors=[{instancePath:t+"/headers/"+b.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/PHPRequestHeaders/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=F===e;if(!_)break}else return ie.errors=[{instancePath:t+"/headers",schemaPath:"#/definitions/PHPRequestHeaders/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=I===e}else var c=!0;if(c){if(r.body!==void 0){let w=r.body;const I=e,ee=e;let A=!1;const b=e;if(typeof w!="string"){const J={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[J]:i.push(J),e++}var W=b===e;if(A=A||W,!A){const J=e;if(e===J)if(w&&typeof w=="object"&&!Array.isArray(w)){let T;if(w.BYTES_PER_ELEMENT===void 0&&(T="BYTES_PER_ELEMENT")||w.buffer===void 0&&(T="buffer")||w.byteLength===void 0&&(T="byteLength")||w.byteOffset===void 0&&(T="byteOffset")||w.length===void 0&&(T="length")){const H={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/required",keyword:"required",params:{missingProperty:T},message:"must have required property '"+T+"'"};i===null?i=[H]:i.push(H),e++}else{const H=e;for(const y in w)if(!(y==="BYTES_PER_ELEMENT"||y==="buffer"||y==="byteLength"||y==="byteOffset"||y==="length")){let v=w[y];const h=e;if(!(typeof v=="number"&&isFinite(v))){const k={instancePath:t+"/body/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[k]:i.push(k),e++}var U=h===e;if(!U)break}if(H===e){if(w.BYTES_PER_ELEMENT!==void 0){let y=w.BYTES_PER_ELEMENT;const v=e;if(!(typeof y=="number"&&isFinite(y))){const h={instancePath:t+"/body/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[h]:i.push(h),e++}var P=v===e}else var P=!0;if(P){if(w.buffer!==void 0){let y=w.buffer;const v=e;if(e===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let k;if(y.byteLength===void 0&&(k="byteLength")){const g={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:k},message:"must have required property '"+k+"'"};i===null?i=[g]:i.push(g),e++}else{const g=e;for(const l in y)if(l!=="byteLength"){const S={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:l},message:"must NOT have additional properties"};i===null?i=[S]:i.push(S),e++;break}if(g===e&&y.byteLength!==void 0){let l=y.byteLength;if(!(typeof l=="number"&&isFinite(l))){const S={instancePath:t+"/body/buffer/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[S]:i.push(S),e++}}}}else{const k={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[k]:i.push(k),e++}var P=v===e}else var P=!0;if(P){if(w.byteLength!==void 0){let y=w.byteLength;const v=e;if(!(typeof y=="number"&&isFinite(y))){const k={instancePath:t+"/body/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[k]:i.push(k),e++}var P=v===e}else var P=!0;if(P){if(w.byteOffset!==void 0){let y=w.byteOffset;const v=e;if(!(typeof y=="number"&&isFinite(y))){const k={instancePath:t+"/body/byteOffset",schemaPath:"#/properties/body/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[k]:i.push(k),e++}var P=v===e}else var P=!0;if(P)if(w.length!==void 0){let y=w.length;const v=e;if(!(typeof y=="number"&&isFinite(y))){const k={instancePath:t+"/body/length",schemaPath:"#/properties/body/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[k]:i.push(k),e++}var P=v===e}else var P=!0}}}}}}else{const T={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[T]:i.push(T),e++}var W=J===e;A=A||W}if(A)e=ee,i!==null&&(ee?i.length=ee:i=null);else{const J={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[J]:i.push(J),e++,ie.errors=i,!1}var c=I===e}else var c=!0;if(c){if(r.env!==void 0){let w=r.env;const I=e;if(e===I)if(w&&typeof w=="object"&&!Array.isArray(w))for(const A in w){const b=e;if(typeof w[A]!="string")return ie.errors=[{instancePath:t+"/env/"+A.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/env/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var R=b===e;if(!R)break}else return ie.errors=[{instancePath:t+"/env",schemaPath:"#/properties/env/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=I===e}else var c=!0;if(c){if(r.$_SERVER!==void 0){let w=r.$_SERVER;const I=e;if(e===I)if(w&&typeof w=="object"&&!Array.isArray(w))for(const A in w){const b=e;if(typeof w[A]!="string")return ie.errors=[{instancePath:t+"/$_SERVER/"+A.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/%24_SERVER/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var B=b===e;if(!B)break}else return ie.errors=[{instancePath:t+"/$_SERVER",schemaPath:"#/properties/%24_SERVER/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=I===e}else var c=!0;if(c)if(r.code!==void 0){const w=e;if(typeof r.code!="string")return ie.errors=[{instancePath:t+"/code",schemaPath:"#/properties/code/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=w===e}else var c=!0}}}}}}}}}else return ie.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ie.errors=i,e===0}function o(r,{instancePath:t="",parentData:f,parentDataProperty:m,rootData:u=r}={}){let i=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){let Je;if(r.step===void 0&&(Je="step"))return o.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:Je},message:"must have required property '"+Je+"'"}],!1;{const Z=r.step;if(typeof Z=="string")if(Z==="activatePlugin"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.pluginPath===void 0&&(p="pluginPath")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="pluginPath"||s==="pluginName"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/0/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/0/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var c=O===e}else var c=!0;if(c)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/0/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=n===e}else var c=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/0/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var _=a===e}else var _=!0;if(_){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/0/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="activatePlugin")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/0/properties/step/const",keyword:"const",params:{allowedValue:"activatePlugin"},message:"must be equal to constant"}],!1;var _=a===e}else var _=!0;if(_){if(r.pluginPath!==void 0){const s=e;if(typeof r.pluginPath!="string")return o.errors=[{instancePath:t+"/pluginPath",schemaPath:"#/oneOf/0/properties/pluginPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=s===e}else var _=!0;if(_)if(r.pluginName!==void 0){const s=e;if(typeof r.pluginName!="string")return o.errors=[{instancePath:t+"/pluginName",schemaPath:"#/oneOf/0/properties/pluginName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=s===e}else var _=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="activateTheme"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.step===void 0&&(p="step")||r.themeFolderName===void 0&&(p="themeFolderName"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="themeFolderName"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/1/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/1/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var W=O===e}else var W=!0;if(W)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/1/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var W=n===e}else var W=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/1/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var U=a===e}else var U=!0;if(U){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/1/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="activateTheme")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/1/properties/step/const",keyword:"const",params:{allowedValue:"activateTheme"},message:"must be equal to constant"}],!1;var U=a===e}else var U=!0;if(U)if(r.themeFolderName!==void 0){const s=e;if(typeof r.themeFolderName!="string")return o.errors=[{instancePath:t+"/themeFolderName",schemaPath:"#/oneOf/1/properties/themeFolderName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var U=s===e}else var U=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="cp"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.fromPath===void 0&&(p="fromPath")||r.step===void 0&&(p="step")||r.toPath===void 0&&(p="toPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="fromPath"||s==="toPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/2/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/2/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var P=O===e}else var P=!0;if(P)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/2/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var P=n===e}else var P=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/2/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var R=a===e}else var R=!0;if(R){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/2/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="cp")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/2/properties/step/const",keyword:"const",params:{allowedValue:"cp"},message:"must be equal to constant"}],!1;var R=a===e}else var R=!0;if(R){if(r.fromPath!==void 0){const s=e;if(typeof r.fromPath!="string")return o.errors=[{instancePath:t+"/fromPath",schemaPath:"#/oneOf/2/properties/fromPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var R=s===e}else var R=!0;if(R)if(r.toPath!==void 0){const s=e;if(typeof r.toPath!="string")return o.errors=[{instancePath:t+"/toPath",schemaPath:"#/oneOf/2/properties/toPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var R=s===e}else var R=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="defineWpConfigConsts"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.consts===void 0&&(p="consts")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="consts"||s==="method"||s==="virtualize"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/3/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/3/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var B=O===e}else var B=!0;if(B)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/3/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var B=n===e}else var B=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/3/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var C=a===e}else var C=!0;if(C){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/3/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="defineWpConfigConsts")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/3/properties/step/const",keyword:"const",params:{allowedValue:"defineWpConfigConsts"},message:"must be equal to constant"}],!1;var C=a===e}else var C=!0;if(C){if(r.consts!==void 0){let s=r.consts;const a=e;if(e===a&&!(s&&typeof s=="object"&&!Array.isArray(s)))return o.errors=[{instancePath:t+"/consts",schemaPath:"#/oneOf/3/properties/consts/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var C=a===e}else var C=!0;if(C){if(r.method!==void 0){let s=r.method;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/method",schemaPath:"#/oneOf/3/properties/method/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(s==="rewrite-wp-config"||s==="define-before-run"))return o.errors=[{instancePath:t+"/method",schemaPath:"#/oneOf/3/properties/method/enum",keyword:"enum",params:{allowedValues:Ke.oneOf[3].properties.method.enum},message:"must be equal to one of the allowed values"}],!1;var C=a===e}else var C=!0;if(C)if(r.virtualize!==void 0){const s=e;if(typeof r.virtualize!="boolean")return o.errors=[{instancePath:t+"/virtualize",schemaPath:"#/oneOf/3/properties/virtualize/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var C=s===e}else var C=!0}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="defineSiteUrl"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.siteUrl===void 0&&(p="siteUrl")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="siteUrl"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/4/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/4/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/4/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var w=O===e}else var w=!0;if(w)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/4/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var w=n===e}else var w=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/4/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var I=a===e}else var I=!0;if(I){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/4/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="defineSiteUrl")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/4/properties/step/const",keyword:"const",params:{allowedValue:"defineSiteUrl"},message:"must be equal to constant"}],!1;var I=a===e}else var I=!0;if(I)if(r.siteUrl!==void 0){const s=e;if(typeof r.siteUrl!="string")return o.errors=[{instancePath:t+"/siteUrl",schemaPath:"#/oneOf/4/properties/siteUrl/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var I=s===e}else var I=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/4/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="enableMultisite"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/5/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/5/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/5/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/5/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var ee=O===e}else var ee=!0;if(ee)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/5/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ee=n===e}else var ee=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/5/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var A=a===e}else var A=!0;if(A)if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/5/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="enableMultisite")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/5/properties/step/const",keyword:"const",params:{allowedValue:"enableMultisite"},message:"must be equal to constant"}],!1;var A=a===e}else var A=!0}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/5/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="importWxr"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.file===void 0&&(p="file")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="file"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/6/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/6/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/6/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var b=O===e}else var b=!0;if(b)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/6/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var b=n===e}else var b=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/6/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var F=a===e}else var F=!0;if(F){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/6/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="importWxr")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/6/properties/step/const",keyword:"const",params:{allowedValue:"importWxr"},message:"must be equal to constant"}],!1;var F=a===e}else var F=!0;if(F)if(r.file!==void 0){const s=e;re(r.file,{instancePath:t+"/file",parentData:r,parentDataProperty:"file",rootData:u})||(i=i===null?re.errors:i.concat(re.errors),e=i.length);var F=s===e}else var F=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/6/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="importThemeStarterContent"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="themeSlug"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/7/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/7/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/7/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var J=O===e}else var J=!0;if(J)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/7/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var J=n===e}else var J=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/7/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var d=a===e}else var d=!0;if(d){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/7/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="importThemeStarterContent")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/7/properties/step/const",keyword:"const",params:{allowedValue:"importThemeStarterContent"},message:"must be equal to constant"}],!1;var d=a===e}else var d=!0;if(d)if(r.themeSlug!==void 0){const s=e;if(typeof r.themeSlug!="string")return o.errors=[{instancePath:t+"/themeSlug",schemaPath:"#/oneOf/7/properties/themeSlug/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=s===e}else var d=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/7/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="importWordPressFiles"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.step===void 0&&(p="step")||r.wordPressFilesZip===void 0&&(p="wordPressFilesZip"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/8/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="wordPressFilesZip"||s==="pathInZip"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/8/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/8/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/8/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var T=O===e}else var T=!0;if(T)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/8/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var T=n===e}else var T=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/8/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var H=a===e}else var H=!0;if(H){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/8/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="importWordPressFiles")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/8/properties/step/const",keyword:"const",params:{allowedValue:"importWordPressFiles"},message:"must be equal to constant"}],!1;var H=a===e}else var H=!0;if(H){if(r.wordPressFilesZip!==void 0){const s=e;re(r.wordPressFilesZip,{instancePath:t+"/wordPressFilesZip",parentData:r,parentDataProperty:"wordPressFilesZip",rootData:u})||(i=i===null?re.errors:i.concat(re.errors),e=i.length);var H=s===e}else var H=!0;if(H)if(r.pathInZip!==void 0){const s=e;if(typeof r.pathInZip!="string")return o.errors=[{instancePath:t+"/pathInZip",schemaPath:"#/oneOf/8/properties/pathInZip/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var H=s===e}else var H=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/8/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="installPlugin"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.pluginZipFile===void 0&&(p="pluginZipFile")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="ifAlreadyInstalled"||s==="step"||s==="pluginZipFile"||s==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/9/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/9/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/9/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var y=O===e}else var y=!0;if(y)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/9/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var y=n===e}else var y=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/9/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var v=a===e}else var v=!0;if(v){if(r.ifAlreadyInstalled!==void 0){let s=r.ifAlreadyInstalled;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/9/properties/ifAlreadyInstalled/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(s==="overwrite"||s==="skip"||s==="error"))return o.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/9/properties/ifAlreadyInstalled/enum",keyword:"enum",params:{allowedValues:Ke.oneOf[9].properties.ifAlreadyInstalled.enum},message:"must be equal to one of the allowed values"}],!1;var v=a===e}else var v=!0;if(v){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/9/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="installPlugin")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/9/properties/step/const",keyword:"const",params:{allowedValue:"installPlugin"},message:"must be equal to constant"}],!1;var v=a===e}else var v=!0;if(v){if(r.pluginZipFile!==void 0){const s=e;re(r.pluginZipFile,{instancePath:t+"/pluginZipFile",parentData:r,parentDataProperty:"pluginZipFile",rootData:u})||(i=i===null?re.errors:i.concat(re.errors),e=i.length);var v=s===e}else var v=!0;if(v)if(r.options!==void 0){let s=r.options;const a=e;if(e===e)if(s&&typeof s=="object"&&!Array.isArray(s)){const O=e;for(const be in s)if(be!=="activate")return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallPluginOptions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:be},message:"must NOT have additional properties"}],!1;if(O===e&&s.activate!==void 0&&typeof s.activate!="boolean")return o.errors=[{instancePath:t+"/options/activate",schemaPath:"#/definitions/InstallPluginOptions/properties/activate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1}else return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallPluginOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var v=a===e}else var v=!0}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/9/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="installTheme"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.step===void 0&&(p="step")||r.themeZipFile===void 0&&(p="themeZipFile"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="ifAlreadyInstalled"||s==="step"||s==="themeZipFile"||s==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/10/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/10/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/10/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var h=O===e}else var h=!0;if(h)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/10/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var h=n===e}else var h=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/10/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var k=a===e}else var k=!0;if(k){if(r.ifAlreadyInstalled!==void 0){let s=r.ifAlreadyInstalled;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/10/properties/ifAlreadyInstalled/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(s==="overwrite"||s==="skip"||s==="error"))return o.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/10/properties/ifAlreadyInstalled/enum",keyword:"enum",params:{allowedValues:Ke.oneOf[10].properties.ifAlreadyInstalled.enum},message:"must be equal to one of the allowed values"}],!1;var k=a===e}else var k=!0;if(k){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/10/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="installTheme")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/10/properties/step/const",keyword:"const",params:{allowedValue:"installTheme"},message:"must be equal to constant"}],!1;var k=a===e}else var k=!0;if(k){if(r.themeZipFile!==void 0){const s=e;re(r.themeZipFile,{instancePath:t+"/themeZipFile",parentData:r,parentDataProperty:"themeZipFile",rootData:u})||(i=i===null?re.errors:i.concat(re.errors),e=i.length);var k=s===e}else var k=!0;if(k)if(r.options!==void 0){let s=r.options;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const n=e;for(const O in s)if(!(O==="activate"||O==="importStarterContent"))return o.errors=[{instancePath:t+"/options",schemaPath:"#/oneOf/10/properties/options/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:O},message:"must NOT have additional properties"}],!1;if(n===e){if(s.activate!==void 0){const O=e;if(typeof s.activate!="boolean")return o.errors=[{instancePath:t+"/options/activate",schemaPath:"#/oneOf/10/properties/options/properties/activate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var g=O===e}else var g=!0;if(g)if(s.importStarterContent!==void 0){const O=e;if(typeof s.importStarterContent!="boolean")return o.errors=[{instancePath:t+"/options/importStarterContent",schemaPath:"#/oneOf/10/properties/options/properties/importStarterContent/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var g=O===e}else var g=!0}}else return o.errors=[{instancePath:t+"/options",schemaPath:"#/oneOf/10/properties/options/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var k=a===e}else var k=!0}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/10/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="login"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/11/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="username"||s==="password"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/11/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/11/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/11/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var l=O===e}else var l=!0;if(l)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/11/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var l=n===e}else var l=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/11/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var S=a===e}else var S=!0;if(S){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/11/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="login")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/11/properties/step/const",keyword:"const",params:{allowedValue:"login"},message:"must be equal to constant"}],!1;var S=a===e}else var S=!0;if(S){if(r.username!==void 0){const s=e;if(typeof r.username!="string")return o.errors=[{instancePath:t+"/username",schemaPath:"#/oneOf/11/properties/username/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var S=s===e}else var S=!0;if(S)if(r.password!==void 0){const s=e;if(typeof r.password!="string")return o.errors=[{instancePath:t+"/password",schemaPath:"#/oneOf/11/properties/password/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var S=s===e}else var S=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/11/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="mkdir"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.path===void 0&&(p="path")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/12/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="path"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/12/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/12/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/12/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var q=O===e}else var q=!0;if(q)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/12/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var q=n===e}else var q=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/12/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var $=a===e}else var $=!0;if($){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/12/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="mkdir")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/12/properties/step/const",keyword:"const",params:{allowedValue:"mkdir"},message:"must be equal to constant"}],!1;var $=a===e}else var $=!0;if($)if(r.path!==void 0){const s=e;if(typeof r.path!="string")return o.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/12/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var $=s===e}else var $=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/12/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="mv"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.fromPath===void 0&&(p="fromPath")||r.step===void 0&&(p="step")||r.toPath===void 0&&(p="toPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/13/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="fromPath"||s==="toPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/13/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/13/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/13/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var V=O===e}else var V=!0;if(V)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/13/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var V=n===e}else var V=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/13/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var j=a===e}else var j=!0;if(j){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/13/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="mv")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/13/properties/step/const",keyword:"const",params:{allowedValue:"mv"},message:"must be equal to constant"}],!1;var j=a===e}else var j=!0;if(j){if(r.fromPath!==void 0){const s=e;if(typeof r.fromPath!="string")return o.errors=[{instancePath:t+"/fromPath",schemaPath:"#/oneOf/13/properties/fromPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var j=s===e}else var j=!0;if(j)if(r.toPath!==void 0){const s=e;if(typeof r.toPath!="string")return o.errors=[{instancePath:t+"/toPath",schemaPath:"#/oneOf/13/properties/toPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var j=s===e}else var j=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/13/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="resetData"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/14/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/14/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/14/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var G=O===e}else var G=!0;if(G)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/14/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var G=n===e}else var G=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/14/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var se=a===e}else var se=!0;if(se)if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/14/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="resetData")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/14/properties/step/const",keyword:"const",params:{allowedValue:"resetData"},message:"must be equal to constant"}],!1;var se=a===e}else var se=!0}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/14/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="request"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.request===void 0&&(p="request")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/15/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="request"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/15/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/15/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/15/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Q=O===e}else var Q=!0;if(Q)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/15/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Q=n===e}else var Q=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/15/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var N=a===e}else var N=!0;if(N){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/15/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="request")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/15/properties/step/const",keyword:"const",params:{allowedValue:"request"},message:"must be equal to constant"}],!1;var N=a===e}else var N=!0;if(N)if(r.request!==void 0){const s=e;ue(r.request,{instancePath:t+"/request",parentData:r,parentDataProperty:"request",rootData:u})||(i=i===null?ue.errors:i.concat(ue.errors),e=i.length);var N=s===e}else var N=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/15/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="rm"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.path===void 0&&(p="path")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/16/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="path"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/16/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/16/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/16/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var M=O===e}else var M=!0;if(M)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/16/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var M=n===e}else var M=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/16/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var z=a===e}else var z=!0;if(z){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/16/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="rm")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/16/properties/step/const",keyword:"const",params:{allowedValue:"rm"},message:"must be equal to constant"}],!1;var z=a===e}else var z=!0;if(z)if(r.path!==void 0){const s=e;if(typeof r.path!="string")return o.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/16/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var z=s===e}else var z=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/16/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="rmdir"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.path===void 0&&(p="path")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/17/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="path"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/17/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/17/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/17/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Y=O===e}else var Y=!0;if(Y)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/17/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Y=n===e}else var Y=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/17/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var te=a===e}else var te=!0;if(te){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/17/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="rmdir")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/17/properties/step/const",keyword:"const",params:{allowedValue:"rmdir"},message:"must be equal to constant"}],!1;var te=a===e}else var te=!0;if(te)if(r.path!==void 0){const s=e;if(typeof r.path!="string")return o.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/17/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var te=s===e}else var te=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/17/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="runPHP"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.code===void 0&&(p="code")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/18/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="code"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/18/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/18/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/18/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var ne=O===e}else var ne=!0;if(ne)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/18/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ne=n===e}else var ne=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/18/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ae=a===e}else var ae=!0;if(ae){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/18/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="runPHP")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/18/properties/step/const",keyword:"const",params:{allowedValue:"runPHP"},message:"must be equal to constant"}],!1;var ae=a===e}else var ae=!0;if(ae)if(r.code!==void 0){const s=e;if(typeof r.code!="string")return o.errors=[{instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ae=s===e}else var ae=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/18/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="runPHPWithOptions"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.options===void 0&&(p="options")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/19/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/19/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/19/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/19/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Re=O===e}else var Re=!0;if(Re)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/19/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Re=n===e}else var Re=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/19/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ve=a===e}else var ve=!0;if(ve){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/19/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="runPHPWithOptions")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/19/properties/step/const",keyword:"const",params:{allowedValue:"runPHPWithOptions"},message:"must be equal to constant"}],!1;var ve=a===e}else var ve=!0;if(ve)if(r.options!==void 0){const s=e;ie(r.options,{instancePath:t+"/options",parentData:r,parentDataProperty:"options",rootData:u})||(i=i===null?ie.errors:i.concat(ie.errors),e=i.length);var ve=s===e}else var ve=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/19/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="runWpInstallationWizard"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.options===void 0&&(p="options")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/20/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/20/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/20/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/20/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Se=O===e}else var Se=!0;if(Se)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/20/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Se=n===e}else var Se=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/20/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Pe=a===e}else var Pe=!0;if(Pe){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/20/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="runWpInstallationWizard")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/20/properties/step/const",keyword:"const",params:{allowedValue:"runWpInstallationWizard"},message:"must be equal to constant"}],!1;var Pe=a===e}else var Pe=!0;if(Pe)if(r.options!==void 0){let s=r.options;const a=e;if(e===e)if(s&&typeof s=="object"&&!Array.isArray(s)){const O=e;for(const be in s)if(!(be==="adminUsername"||be==="adminPassword"))return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/WordPressInstallationOptions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:be},message:"must NOT have additional properties"}],!1;if(O===e){if(s.adminUsername!==void 0){const be=e;if(typeof s.adminUsername!="string")return o.errors=[{instancePath:t+"/options/adminUsername",schemaPath:"#/definitions/WordPressInstallationOptions/properties/adminUsername/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Le=be===e}else var Le=!0;if(Le)if(s.adminPassword!==void 0){const be=e;if(typeof s.adminPassword!="string")return o.errors=[{instancePath:t+"/options/adminPassword",schemaPath:"#/definitions/WordPressInstallationOptions/properties/adminPassword/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Le=be===e}else var Le=!0}}else return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/WordPressInstallationOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Pe=a===e}else var Pe=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/20/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="runSql"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.sql===void 0&&(p="sql")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/21/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="sql"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/21/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/21/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/21/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Ne=O===e}else var Ne=!0;if(Ne)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/21/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Ne=n===e}else var Ne=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/21/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var _e=a===e}else var _e=!0;if(_e){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/21/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="runSql")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/21/properties/step/const",keyword:"const",params:{allowedValue:"runSql"},message:"must be equal to constant"}],!1;var _e=a===e}else var _e=!0;if(_e)if(r.sql!==void 0){const s=e;re(r.sql,{instancePath:t+"/sql",parentData:r,parentDataProperty:"sql",rootData:u})||(i=i===null?re.errors:i.concat(re.errors),e=i.length);var _e=s===e}else var _e=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/21/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="setSiteOptions"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.options===void 0&&(p="options")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/22/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/22/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/22/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/22/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Fe=O===e}else var Fe=!0;if(Fe)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/22/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Fe=n===e}else var Fe=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/22/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ke=a===e}else var ke=!0;if(ke){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/22/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="setSiteOptions")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/22/properties/step/const",keyword:"const",params:{allowedValue:"setSiteOptions"},message:"must be equal to constant"}],!1;var ke=a===e}else var ke=!0;if(ke)if(r.options!==void 0){let s=r.options;const a=e;if(e===a&&!(s&&typeof s=="object"&&!Array.isArray(s)))return o.errors=[{instancePath:t+"/options",schemaPath:"#/oneOf/22/properties/options/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ke=a===e}else var ke=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/22/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="unzip"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.extractToPath===void 0&&(p="extractToPath")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/23/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="zipFile"||s==="zipPath"||s==="extractToPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/23/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/23/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/23/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var xe=O===e}else var xe=!0;if(xe)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/23/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var xe=n===e}else var xe=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/23/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var pe=a===e}else var pe=!0;if(pe){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/23/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="unzip")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/23/properties/step/const",keyword:"const",params:{allowedValue:"unzip"},message:"must be equal to constant"}],!1;var pe=a===e}else var pe=!0;if(pe){if(r.zipFile!==void 0){const s=e;re(r.zipFile,{instancePath:t+"/zipFile",parentData:r,parentDataProperty:"zipFile",rootData:u})||(i=i===null?re.errors:i.concat(re.errors),e=i.length);var pe=s===e}else var pe=!0;if(pe){if(r.zipPath!==void 0){const s=e;if(typeof r.zipPath!="string")return o.errors=[{instancePath:t+"/zipPath",schemaPath:"#/oneOf/23/properties/zipPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var pe=s===e}else var pe=!0;if(pe)if(r.extractToPath!==void 0){const s=e;if(typeof r.extractToPath!="string")return o.errors=[{instancePath:t+"/extractToPath",schemaPath:"#/oneOf/23/properties/extractToPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var pe=s===e}else var pe=!0}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/23/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="updateUserMeta"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.meta===void 0&&(p="meta")||r.step===void 0&&(p="step")||r.userId===void 0&&(p="userId"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/24/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="meta"||s==="userId"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/24/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/24/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/24/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Ce=O===e}else var Ce=!0;if(Ce)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/24/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Ce=n===e}else var Ce=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/24/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ye=a===e}else var ye=!0;if(ye){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/24/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="updateUserMeta")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/24/properties/step/const",keyword:"const",params:{allowedValue:"updateUserMeta"},message:"must be equal to constant"}],!1;var ye=a===e}else var ye=!0;if(ye){if(r.meta!==void 0){let s=r.meta;const a=e;if(e===a&&!(s&&typeof s=="object"&&!Array.isArray(s)))return o.errors=[{instancePath:t+"/meta",schemaPath:"#/oneOf/24/properties/meta/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ye=a===e}else var ye=!0;if(ye)if(r.userId!==void 0){let s=r.userId;const a=e;if(!(typeof s=="number"&&isFinite(s)))return o.errors=[{instancePath:t+"/userId",schemaPath:"#/oneOf/24/properties/userId/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var ye=a===e}else var ye=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/24/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="writeFile"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.data===void 0&&(p="data")||r.path===void 0&&(p="path")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/25/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="path"||s==="data"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/25/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/25/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/25/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Ie=O===e}else var Ie=!0;if(Ie)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/25/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Ie=n===e}else var Ie=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/25/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var he=a===e}else var he=!0;if(he){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/25/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="writeFile")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/25/properties/step/const",keyword:"const",params:{allowedValue:"writeFile"},message:"must be equal to constant"}],!1;var he=a===e}else var he=!0;if(he){if(r.path!==void 0){const s=e;if(typeof r.path!="string")return o.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/25/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var he=s===e}else var he=!0;if(he)if(r.data!==void 0){let s=r.data;const a=e,E=e;let n=!1;const O=e;re(s,{instancePath:t+"/data",parentData:r,parentDataProperty:"data",rootData:u})||(i=i===null?re.errors:i.concat(re.errors),e=i.length);var Ee=O===e;if(n=n||Ee,!n){const le=e;if(typeof s!="string"){const we={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[we]:i.push(we),e++}var Ee=le===e;if(n=n||Ee,!n){const we=e;if(e===we)if(s&&typeof s=="object"&&!Array.isArray(s)){let me;if(s.BYTES_PER_ELEMENT===void 0&&(me="BYTES_PER_ELEMENT")||s.buffer===void 0&&(me="buffer")||s.byteLength===void 0&&(me="byteLength")||s.byteOffset===void 0&&(me="byteOffset")||s.length===void 0&&(me="length")){const Ve={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/2/required",keyword:"required",params:{missingProperty:me},message:"must have required property '"+me+"'"};i===null?i=[Ve]:i.push(Ve),e++}else{const Ve=e;for(const X in s)if(!(X==="BYTES_PER_ELEMENT"||X==="buffer"||X==="byteLength"||X==="byteOffset"||X==="length")){let de=s[X];const De=e;if(!(typeof de=="number"&&isFinite(de))){const oe={instancePath:t+"/data/"+X.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/oneOf/25/properties/data/anyOf/2/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[oe]:i.push(oe),e++}var Ur=De===e;if(!Ur)break}if(Ve===e){if(s.BYTES_PER_ELEMENT!==void 0){let X=s.BYTES_PER_ELEMENT;const de=e;if(!(typeof X=="number"&&isFinite(X))){const De={instancePath:t+"/data/BYTES_PER_ELEMENT",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[De]:i.push(De),e++}var fe=de===e}else var fe=!0;if(fe){if(s.buffer!==void 0){let X=s.buffer;const de=e;if(e===de)if(X&&typeof X=="object"&&!Array.isArray(X)){let oe;if(X.byteLength===void 0&&(oe="byteLength")){const Me={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/required",keyword:"required",params:{missingProperty:oe},message:"must have required property '"+oe+"'"};i===null?i=[Me]:i.push(Me),e++}else{const Me=e;for(const je in X)if(je!=="byteLength"){const Te={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:je},message:"must NOT have additional properties"};i===null?i=[Te]:i.push(Te),e++;break}if(Me===e&&X.byteLength!==void 0){let je=X.byteLength;if(!(typeof je=="number"&&isFinite(je))){const Te={instancePath:t+"/data/buffer/byteLength",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[Te]:i.push(Te),e++}}}}else{const oe={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[oe]:i.push(oe),e++}var fe=de===e}else var fe=!0;if(fe){if(s.byteLength!==void 0){let X=s.byteLength;const de=e;if(!(typeof X=="number"&&isFinite(X))){const oe={instancePath:t+"/data/byteLength",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[oe]:i.push(oe),e++}var fe=de===e}else var fe=!0;if(fe){if(s.byteOffset!==void 0){let X=s.byteOffset;const de=e;if(!(typeof X=="number"&&isFinite(X))){const oe={instancePath:t+"/data/byteOffset",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[oe]:i.push(oe),e++}var fe=de===e}else var fe=!0;if(fe)if(s.length!==void 0){let X=s.length;const de=e;if(!(typeof X=="number"&&isFinite(X))){const oe={instancePath:t+"/data/length",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};i===null?i=[oe]:i.push(oe),e++}var fe=de===e}else var fe=!0}}}}}}else{const me={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[me]:i.push(me),e++}var Ee=we===e;n=n||Ee}}if(n)e=E,i!==null&&(E?i.length=E:i=null);else{const le={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[le]:i.push(le),e++,o.errors=i,!1}var he=a===e}else var he=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/25/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="wp-cli"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.command===void 0&&(p="command")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/26/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="command"||s==="wpCliPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/26/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/26/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/26/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Ue=O===e}else var Ue=!0;if(Ue)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/26/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Ue=n===e}else var Ue=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/26/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ge=a===e}else var ge=!0;if(ge){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/26/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="wp-cli")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/26/properties/step/const",keyword:"const",params:{allowedValue:"wp-cli"},message:"must be equal to constant"}],!1;var ge=a===e}else var ge=!0;if(ge){if(r.command!==void 0){let s=r.command;const a=e,E=e;let n=!1;const O=e;if(typeof s!="string"){const le={instancePath:t+"/command",schemaPath:"#/oneOf/26/properties/command/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[le]:i.push(le),e++}var Xe=O===e;if(n=n||Xe,!n){const le=e;if(e===le)if(Array.isArray(s)){var pr=!0;const we=s.length;for(let Be=0;Be<we;Be++){const me=e;if(typeof s[Be]!="string"){const X={instancePath:t+"/command/"+Be,schemaPath:"#/oneOf/26/properties/command/anyOf/1/items/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[X]:i.push(X),e++}var pr=me===e;if(!pr)break}}else{const we={instancePath:t+"/command",schemaPath:"#/oneOf/26/properties/command/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[we]:i.push(we),e++}var Xe=le===e;n=n||Xe}if(n)e=E,i!==null&&(E?i.length=E:i=null);else{const le={instancePath:t+"/command",schemaPath:"#/oneOf/26/properties/command/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[le]:i.push(le),e++,o.errors=i,!1}var ge=a===e}else var ge=!0;if(ge)if(r.wpCliPath!==void 0){const s=e;if(typeof r.wpCliPath!="string")return o.errors=[{instancePath:t+"/wpCliPath",schemaPath:"#/oneOf/26/properties/wpCliPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ge=s===e}else var ge=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/26/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(Z==="setSiteLanguage"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let p;if(r.language===void 0&&(p="language")||r.step===void 0&&(p="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/27/required",keyword:"required",params:{missingProperty:p},message:"must have required property '"+p+"'"}],!1;{const L=e;for(const s in r)if(!(s==="progress"||s==="step"||s==="language"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/27/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"}],!1;if(L===e){if(r.progress!==void 0){let s=r.progress;const a=e;if(e===a)if(s&&typeof s=="object"&&!Array.isArray(s)){const E=e;for(const n in s)if(!(n==="weight"||n==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/27/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"}],!1;if(E===e){if(s.weight!==void 0){let n=s.weight;const O=e;if(!(typeof n=="number"&&isFinite(n)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/27/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var We=O===e}else var We=!0;if(We)if(s.caption!==void 0){const n=e;if(typeof s.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/27/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var We=n===e}else var We=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/27/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Oe=a===e}else var Oe=!0;if(Oe){if(r.step!==void 0){let s=r.step;const a=e;if(typeof s!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/27/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(s!=="setSiteLanguage")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/27/properties/step/const",keyword:"const",params:{allowedValue:"setSiteLanguage"},message:"must be equal to constant"}],!1;var Oe=a===e}else var Oe=!0;if(Oe)if(r.language!==void 0){const s=e;if(typeof r.language!="string")return o.errors=[{instancePath:t+"/language",schemaPath:"#/oneOf/27/properties/language/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Oe=s===e}else var Oe=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/27/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else return o.errors=[{instancePath:t,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"mapping",tag:"step",tagValue:Z},message:'value of tag "step" must be in oneOf'}],!1;else return o.errors=[{instancePath:t,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"tag",tag:"step",tagValue:Z},message:'tag "step" must be string'}],!1}}else return o.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return o.errors=i,e===0}function D(r,{instancePath:t="",parentData:f,parentDataProperty:m,rootData:u=r}={}){let i=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){const J=e;for(const d in r)if(!Cr.call(it.properties,d))return D.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:d},message:"must NOT have additional properties"}],!1;if(J===e){if(r.landingPage!==void 0){const d=e;if(typeof r.landingPage!="string")return D.errors=[{instancePath:t+"/landingPage",schemaPath:"#/properties/landingPage/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=d===e}else var c=!0;if(c){if(r.description!==void 0){const d=e;if(typeof r.description!="string")return D.errors=[{instancePath:t+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=d===e}else var c=!0;if(c){if(r.meta!==void 0){let d=r.meta;const T=e;if(e===T)if(d&&typeof d=="object"&&!Array.isArray(d)){let y;if(d.title===void 0&&(y="title")||d.author===void 0&&(y="author"))return D.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"}],!1;{const v=e;for(const h in d)if(!(h==="title"||h==="description"||h==="author"||h==="categories"))return D.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"}],!1;if(v===e){if(d.title!==void 0){const h=e;if(typeof d.title!="string")return D.errors=[{instancePath:t+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=h===e}else var _=!0;if(_){if(d.description!==void 0){const h=e;if(typeof d.description!="string")return D.errors=[{instancePath:t+"/meta/description",schemaPath:"#/properties/meta/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=h===e}else var _=!0;if(_){if(d.author!==void 0){const h=e;if(typeof d.author!="string")return D.errors=[{instancePath:t+"/meta/author",schemaPath:"#/properties/meta/properties/author/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=h===e}else var _=!0;if(_)if(d.categories!==void 0){let h=d.categories;const k=e;if(e===k)if(Array.isArray(h)){var W=!0;const l=h.length;for(let S=0;S<l;S++){const q=e;if(typeof h[S]!="string")return D.errors=[{instancePath:t+"/meta/categories/"+S,schemaPath:"#/properties/meta/properties/categories/items/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var W=q===e;if(!W)break}}else return D.errors=[{instancePath:t+"/meta/categories",schemaPath:"#/properties/meta/properties/categories/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var _=k===e}else var _=!0}}}}}else return D.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=T===e}else var c=!0;if(c){if(r.preferredVersions!==void 0){let d=r.preferredVersions;const T=e;if(e===T)if(d&&typeof d=="object"&&!Array.isArray(d)){let y;if(d.php===void 0&&(y="php")||d.wp===void 0&&(y="wp"))return D.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"}],!1;{const v=e;for(const h in d)if(!(h==="php"||h==="wp"))return D.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"}],!1;if(v===e){if(d.php!==void 0){let h=d.php;const k=e,g=e;let l=!1;const S=e;if(typeof h!="string"){const q={instancePath:t+"/preferredVersions/php",schemaPath:"#/definitions/SupportedPHPVersion/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[q]:i.push(q),e++}if(!(h==="8.3"||h==="8.2"||h==="8.1"||h==="8.0"||h==="7.4"||h==="7.3"||h==="7.2"||h==="7.1"||h==="7.0")){const q={instancePath:t+"/preferredVersions/php",schemaPath:"#/definitions/SupportedPHPVersion/enum",keyword:"enum",params:{allowedValues:ot.enum},message:"must be equal to one of the allowed values"};i===null?i=[q]:i.push(q),e++}var U=S===e;if(l=l||U,!l){const q=e;if(typeof h!="string"){const V={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[V]:i.push(V),e++}if(h!=="latest"){const V={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf/1/const",keyword:"const",params:{allowedValue:"latest"},message:"must be equal to constant"};i===null?i=[V]:i.push(V),e++}var U=q===e;l=l||U}if(l)e=g,i!==null&&(g?i.length=g:i=null);else{const q={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[q]:i.push(q),e++,D.errors=i,!1}var P=k===e}else var P=!0;if(P)if(d.wp!==void 0){const h=e;if(typeof d.wp!="string")return D.errors=[{instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var P=h===e}else var P=!0}}}else return D.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=T===e}else var c=!0;if(c){if(r.features!==void 0){let d=r.features;const T=e;if(e===T)if(d&&typeof d=="object"&&!Array.isArray(d)){const y=e;for(const v in d)if(v!=="networking")return D.errors=[{instancePath:t+"/features",schemaPath:"#/properties/features/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:v},message:"must NOT have additional properties"}],!1;if(y===e&&d.networking!==void 0&&typeof d.networking!="boolean")return D.errors=[{instancePath:t+"/features/networking",schemaPath:"#/properties/features/properties/networking/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1}else return D.errors=[{instancePath:t+"/features",schemaPath:"#/properties/features/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=T===e}else var c=!0;if(c){if(r.constants!==void 0){let d=r.constants;const T=e;if(e===T)if(d&&typeof d=="object"&&!Array.isArray(d))for(const y in d){const v=e;if(typeof d[y]!="string")return D.errors=[{instancePath:t+"/constants/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constants/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var R=v===e;if(!R)break}else return D.errors=[{instancePath:t+"/constants",schemaPath:"#/properties/constants/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=T===e}else var c=!0;if(c){if(r.plugins!==void 0){let d=r.plugins;const T=e;if(e===T)if(Array.isArray(d)){var B=!0;const y=d.length;for(let v=0;v<y;v++){let h=d[v];const k=e,g=e;let l=!1;const S=e;if(typeof h!="string"){const $={instancePath:t+"/plugins/"+v,schemaPath:"#/properties/plugins/items/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[$]:i.push($),e++}var C=S===e;if(l=l||C,!l){const $=e;re(h,{instancePath:t+"/plugins/"+v,parentData:d,parentDataProperty:v,rootData:u})||(i=i===null?re.errors:i.concat(re.errors),e=i.length);var C=$===e;l=l||C}if(l)e=g,i!==null&&(g?i.length=g:i=null);else{const $={instancePath:t+"/plugins/"+v,schemaPath:"#/properties/plugins/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),e++,D.errors=i,!1}var B=k===e;if(!B)break}}else return D.errors=[{instancePath:t+"/plugins",schemaPath:"#/properties/plugins/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var c=T===e}else var c=!0;if(c){if(r.siteOptions!==void 0){let d=r.siteOptions;const T=e;if(e===T)if(d&&typeof d=="object"&&!Array.isArray(d)){const y=e;for(const v in d)if(v!=="blogname"){const h=e;if(typeof d[v]!="string")return D.errors=[{instancePath:t+"/siteOptions/"+v.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/siteOptions/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var w=h===e;if(!w)break}if(y===e&&d.blogname!==void 0&&typeof d.blogname!="string")return D.errors=[{instancePath:t+"/siteOptions/blogname",schemaPath:"#/properties/siteOptions/properties/blogname/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1}else return D.errors=[{instancePath:t+"/siteOptions",schemaPath:"#/properties/siteOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var c=T===e}else var c=!0;if(c){if(r.login!==void 0){let d=r.login;const T=e,H=e;let y=!1;const v=e;if(typeof d!="boolean"){const k={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[k]:i.push(k),e++}var I=v===e;if(y=y||I,!y){const k=e;if(e===k)if(d&&typeof d=="object"&&!Array.isArray(d)){let l;if(d.username===void 0&&(l="username")||d.password===void 0&&(l="password")){const S={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/required",keyword:"required",params:{missingProperty:l},message:"must have required property '"+l+"'"};i===null?i=[S]:i.push(S),e++}else{const S=e;for(const q in d)if(!(q==="username"||q==="password")){const $={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:q},message:"must NOT have additional properties"};i===null?i=[$]:i.push($),e++;break}if(S===e){if(d.username!==void 0){const q=e;if(typeof d.username!="string"){const $={instancePath:t+"/login/username",schemaPath:"#/properties/login/anyOf/1/properties/username/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[$]:i.push($),e++}var ee=q===e}else var ee=!0;if(ee)if(d.password!==void 0){const q=e;if(typeof d.password!="string"){const V={instancePath:t+"/login/password",schemaPath:"#/properties/login/anyOf/1/properties/password/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[V]:i.push(V),e++}var ee=q===e}else var ee=!0}}}else{const l={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[l]:i.push(l),e++}var I=k===e;y=y||I}if(y)e=H,i!==null&&(H?i.length=H:i=null);else{const k={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[k]:i.push(k),e++,D.errors=i,!1}var c=T===e}else var c=!0;if(c){if(r.phpExtensionBundles!==void 0){let d=r.phpExtensionBundles;const T=e;if(e===T)if(Array.isArray(d)){var A=!0;const y=d.length;for(let v=0;v<y;v++){let h=d[v];const k=e;if(typeof h!="string")return D.errors=[{instancePath:t+"/phpExtensionBundles/"+v,schemaPath:"#/definitions/SupportedPHPExtensionBundle/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(h==="kitchen-sink"||h==="light"))return D.errors=[{instancePath:t+"/phpExtensionBundles/"+v,schemaPath:"#/definitions/SupportedPHPExtensionBundle/enum",keyword:"enum",params:{allowedValues:nt.enum},message:"must be equal to one of the allowed values"}],!1;var A=k===e;if(!A)break}}else return D.errors=[{instancePath:t+"/phpExtensionBundles",schemaPath:"#/properties/phpExtensionBundles/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var c=T===e}else var c=!0;if(c){if(r.steps!==void 0){let d=r.steps;const T=e;if(e===T)if(Array.isArray(d)){var b=!0;const y=d.length;for(let v=0;v<y;v++){let h=d[v];const k=e,g=e;let l=!1;const S=e;o(h,{instancePath:t+"/steps/"+v,parentData:d,parentDataProperty:v,rootData:u})||(i=i===null?o.errors:i.concat(o.errors),e=i.length);var F=S===e;if(l=l||F,!l){const $=e;if(typeof h!="string"){const j={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[j]:i.push(j),e++}var F=$===e;if(l=l||F,!l){const j=e,G={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};i===null?i=[G]:i.push(G),e++;var F=j===e;if(l=l||F,!l){const Q=e;if(typeof h!="boolean"){const M={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/3/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[M]:i.push(M),e++}if(h!==!1){const M={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/3/const",keyword:"const",params:{allowedValue:!1},message:"must be equal to constant"};i===null?i=[M]:i.push(M),e++}var F=Q===e;if(l=l||F,!l){const M=e;if(h!==null){const Y={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/4/type",keyword:"type",params:{type:"null"},message:"must be null"};i===null?i=[Y]:i.push(Y),e++}var F=M===e;l=l||F}}}}if(l)e=g,i!==null&&(g?i.length=g:i=null);else{const $={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),e++,D.errors=i,!1}var b=k===e;if(!b)break}}else return D.errors=[{instancePath:t+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var c=T===e}else var c=!0;if(c)if(r.$schema!==void 0){const d=e;if(typeof r.$schema!="string")return D.errors=[{instancePath:t+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=d===e}else var c=!0}}}}}}}}}}}}else return D.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return D.errors=i,e===0}function ze(r,{instancePath:t="",parentData:f,parentDataProperty:m,rootData:u=r}={}){let i=null,e=0;return D(r,{instancePath:t,parentData:f,parentDataProperty:m,rootData:u})||(i=i===null?D.errors:i.concat(D.errors),e=i.length),ze.errors=i,e===0}const{wpCLI:pt,...dr}=Gr,ft={...dr,"wp-cli":pt,importFile:dr.importWxr};function lt(r,{progress:t=new mr.ProgressTracker,semaphore:f=new x.Semaphore({concurrency:3}),onStepCompleted:m=()=>{}}={}){var P,R,B,C,w,I,ee;r={...r,steps:(r.steps||[]).filter(mt).filter(yt)};for(const A of r.steps)typeof A=="object"&&A.step==="importFile"&&(A.step="importWxr",ce.logger.warn('The "importFile" step is deprecated. Use "importWxr" instead.'));if(r.constants&&r.steps.unshift({step:"defineWpConfigConsts",consts:r.constants}),r.siteOptions&&r.steps.unshift({step:"setSiteOptions",options:r.siteOptions}),r.plugins){const A=r.plugins.map(b=>typeof b=="string"?b.startsWith("https://")?{resource:"url",url:b}:{resource:"wordpress.org/plugins",slug:b}:b).map(b=>({step:"installPlugin",pluginZipFile:b}));r.steps.unshift(...A)}r.login&&r.steps.push({step:"login",...r.login===!0?{username:"admin",password:"password"}:r.login}),r.phpExtensionBundles||(r.phpExtensionBundles=[]),r.phpExtensionBundles||(r.phpExtensionBundles=[]),r.phpExtensionBundles.length===0&&r.phpExtensionBundles.push("kitchen-sink");const u=(P=r.steps)==null?void 0:P.findIndex(A=>typeof A=="object"&&(A==null?void 0:A.step)==="wp-cli");u!==void 0&&u>-1&&(r.phpExtensionBundles.includes("light")&&(r.phpExtensionBundles=r.phpExtensionBundles.filter(A=>A!=="light"),ce.logger.warn("The wpCli step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. ")),(R=r.steps)==null||R.splice(u,0,{step:"writeFile",data:{resource:"url",url:"https://playground.wordpress.net/wp-cli.phar"},path:"/tmp/wp-cli.phar"}));const i=(B=r.steps)==null?void 0:B.findIndex(A=>typeof A=="object"&&(A==null?void 0:A.step)==="importWxr");i!==void 0&&i>-1&&(r.phpExtensionBundles.includes("light")&&(r.phpExtensionBundles=r.phpExtensionBundles.filter(A=>A!=="light"),ce.logger.warn("The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. ")),(C=r.steps)==null||C.splice(i,0,{step:"installPlugin",pluginZipFile:{resource:"url",url:"https://playground.wordpress.net/wordpress-importer.zip",caption:"Downloading the WordPress Importer plugin"}}));const{valid:e,errors:c}=dt(r);if(!e){const A=new Error(`Invalid blueprint: ${c[0].message} at ${c[0].instancePath}`);throw A.errors=c,A}const _=r.steps||[],W=_.reduce((A,b)=>{var F;return A+(((F=b.progress)==null?void 0:F.weight)||1)},0),U=_.map(A=>ht(A,{semaphore:f,rootProgressTracker:t,totalProgressWeight:W}));return{versions:{php:ut((w=r.preferredVersions)==null?void 0:w.php,qe.SupportedPHPVersions,qe.LatestSupportedPHPVersion),wp:((I=r.preferredVersions)==null?void 0:I.wp)||"latest"},phpExtensions:ct([],r.phpExtensionBundles||[]),features:{networking:((ee=r.features)==null?void 0:ee.networking)??!1},run:async A=>{try{for(const{resources:b}of U)for(const F of b)F.setPlayground(A),F.isAsync&&F.resolve();for(const[b,{run:F,step:J}]of Object.entries(U))try{const d=await F(A);m(d,J)}catch(d){throw ce.logger.error(d),new Error(`Error when executing the blueprint step #${b} (${JSON.stringify(J)}) ${d instanceof Error?`: ${d.message}`:d}`,{cause:d})}}finally{try{await A.goTo(r.landingPage||"/")}catch{}t.finish()}}}}function dt(r){var u;const t=ze(r);if(t)return{valid:t};const f=new Set;for(const i of ze.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||f.add(i.instancePath);const m=(u=ze.errors)==null?void 0:u.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&f.has(i.instancePath)));return{valid:t,errors:m}}function ut(r,t,f){return r&&t.includes(r)?r:f}function ct(r,t){const f=qe.SupportedPHPExtensionsList.filter(u=>r.includes(u)),m=t.flatMap(u=>u in qe.SupportedPHPExtensionBundles?qe.SupportedPHPExtensionBundles[u]:[]);return Array.from(new Set([...f,...m]))}function mt(r){return!!(typeof r=="object"&&r)}function yt(r){return["setPhpIniEntry","request"].includes(r.step)?(ce.logger.warn(`The "${r.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`),!1):!0}function ht(r,{semaphore:t,rootProgressTracker:f,totalProgressWeight:m}){var U;const u=f.stage((((U=r.progress)==null?void 0:U.weight)||1)/m),i={};for(const P of Object.keys(r)){let R=r[P];Zr(R)&&(R=$e.create(R,{semaphore:t})),i[P]=R}const e=async P=>{var R;try{return u.fillSlowly(),await ft[r.step](P,await gt(i),{tracker:u,initialCaption:(R=r.progress)==null?void 0:R.caption})}finally{u.finish()}},c=ur(i),_=ur(i).filter(P=>P.isAsync),W=1/(_.length+1);for(const P of _)P.progress=u.stage(W);return{run:e,step:r,resources:c}}function ur(r){const t=[];for(const f in r){const m=r[f];m instanceof $e&&t.push(m)}return t}async function gt(r){const t={};for(const f in r){const m=r[f];m instanceof $e?t[f]=await m.resolve():t[f]=m}return t}async function bt(r,t){await r.run(t)}function wt(){}exports.activatePlugin=Ye;exports.activateTheme=rr;exports.compileBlueprint=lt;exports.cp=vr;exports.defineSiteUrl=or;exports.defineWpConfigConsts=Ae;exports.enableMultisite=wr;exports.exportWXR=Er;exports.importThemeStarterContent=nr;exports.importWordPressFiles=$r;exports.importWxr=Or;exports.installPlugin=Tr;exports.installTheme=qr;exports.login=Ge;exports.mkdir=_r;exports.mv=Pr;exports.request=He;exports.resetData=Ar;exports.rm=tr;exports.rmdir=kr;exports.runBlueprintSteps=bt;exports.runPHP=yr;exports.runPHPWithOptions=hr;exports.runSql=gr;exports.runWpInstallationWizard=Rr;exports.setPluginProxyURL=wt;exports.setSiteLanguage=Nr;exports.setSiteOptions=sr;exports.unzip=Ze;exports.updateUserMeta=br;exports.wpCLI=Lr;exports.wpContentFilesExcludedFromExport=er;exports.writeFile=ir;exports.zipWpContent=Sr;