@wp-playground/blueprints 0.9.1 → 0.9.4
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 +26 -26
- package/index.js +983 -983
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`):JSON.stringify(e,null,2),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const us=function(){var e;return typeof process<"u"&&((e=process.release)==null?void 0:e.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"}();if(us==="NODE"){let e=function(r){return new Promise(function(s,n){r.onload=r.onerror=function(i){r.onload=r.onerror=null,i.type==="load"?s(r.result):n(new Error("Failed to read the blob/file"))}})},t=function(){const r=new Uint8Array([1,2,3,4]),n=new File([r],"test").stream();try{return n.getReader({mode:"byob"}),!0}catch{return!1}};if(typeof File>"u"){class r extends Blob{constructor(n,i,c){super(n);let a;c!=null&&c.lastModified&&(a=new Date),(!a||isNaN(a.getFullYear()))&&(a=new Date),this.lastModifiedDate=a,this.lastModified=a.getMilliseconds(),this.name=i||""}}global.File=r}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const s=new FileReader;return s.readAsArrayBuffer(this),e(s)}),typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const s=new FileReader;return s.readAsText(this),e(s)}),(typeof Blob.prototype.stream>"u"||!t())&&(Blob.prototype.stream=function(){let r=0;const s=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(n){const i=n.byobRequest.view,a=await s.slice(r,r+i.byteLength).arrayBuffer(),u=new Uint8Array(a);new Uint8Array(i.buffer).set(u);const d=u.byteLength;n.byobRequest.respond(d),r+=d,r>=s.size&&n.close()}})})}if(us==="NODE"&&typeof CustomEvent>"u"){class e extends Event{constructor(r,s={}){super(r,s),this.detail=s.detail}initCustomEvent(){}}globalThis.CustomEvent=e}const Mr=["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"],ds=Symbol("SleepFinished");function gi(e){return new Promise(t=>{setTimeout(()=>t(ds),e)})}class $i extends Error{constructor(){super("Acquiring lock timed out")}}class _i{constructor({concurrency:t,timeout:r}){this._running=0,this.concurrency=t,this.timeout=r,this.queue=[]}get remaining(){return this.concurrency-this.running}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency){const t=new Promise(r=>{this.queue.push(r)});this.timeout!==void 0?await Promise.race([t,gi(this.timeout)]).then(r=>{if(r===ds)throw new $i}):await t}else{this._running++;let t=!1;return()=>{t||(t=!0,this._running--,this.queue.length>0&&this.queue.shift()())}}}async run(t){const r=await this.acquire();try{return await t()}finally{r()}}}function ye(...e){let t=e.join("/");const r=t[0]==="/",s=t.substring(t.length-1)==="/";return t=ps(t),!t&&!r&&(t="."),t&&s&&(t+="/"),t}function fs(e){if(e==="/")return"/";e=ps(e);const t=e.lastIndexOf("/");return t===-1?"":t===0?"/":e.substr(0,t)}function ps(e){const t=e[0]==="/";return e=vi(e.split("/").filter(r=>!!r),!t).join("/"),(t?"/":"")+e.replace(/\/$/,"")}function vi(e,t){let r=0;for(let s=e.length-1;s>=0;s--){const n=e[s];n==="."?e.splice(s,1):n===".."?(e.splice(s,1),r++):r&&(e.splice(s,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function hs(e=36,t="!@#$%^&*()_+=-[]/.,<>?"){const r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"+t;let s="";for(let n=e;n>0;--n)s+=r[Math.floor(Math.random()*r.length)];return s}function wi(){return hs(36,"-_")}function ve(e){return`json_decode(base64_decode('${bi(JSON.stringify(e))}'), true)`}function fr(e){const t={};for(const r in e)t[r]=ve(e[r]);return t}function bi(e){return Ei(new TextEncoder().encode(e))}function Ei(e){const t=String.fromCodePoint(...e);return btoa(t)}const Pi="playground-log",Ln=(e,...t)=>{Te.dispatchEvent(new CustomEvent(Pi,{detail:{log:e,args:t}}))},Si=(e,...t)=>{switch(typeof e.message=="string"?e.message=kr(e.message):e.message.message&&typeof e.message.message=="string"&&(e.message.message=kr(e.message.message)),e.severity){case"Debug":console.debug(e.message,...t);break;case"Info":console.info(e.message,...t);break;case"Warn":console.warn(e.message,...t);break;case"Error":console.error(e.message,...t);break;case"Fatal":console.error(e.message,...t);break;default:console.log(e.message,...t)}},Ti=e=>e instanceof Error?[e.message,e.stack].join(`
|
|
2
|
+
`):JSON.stringify(e,null,2),ms=[],Un=e=>{ms.push(e)},Rr=e=>{if(e.raw===!0)Un(e.message);else{const t=Oi(typeof e.message=="object"?Ti(e.message):e.message,e.severity??"Info",e.prefix??"JavaScript");Un(t)}};class Ri extends EventTarget{constructor(t=[]){super(),this.handlers=t,this.fatalErrorEvent="playground-fatal-error"}getLogs(){return this.handlers.includes(Rr)?[...ms]:(this.error(`Logs aren't stored because the logToMemory handler isn't registered.
|
|
3
3
|
If you're using a custom logger instance, make sure to register logToMemory handler.
|
|
4
|
-
`),[])}logMessage(t,...r){for(const s of this.handlers)s(t,...r)}log(t,...r){this.logMessage({message:t,severity:void 0,prefix:"JavaScript",raw:!1},...r)}debug(t,...r){this.logMessage({message:t,severity:"Debug",prefix:"JavaScript",raw:!1},...r)}info(t,...r){this.logMessage({message:t,severity:"Info",prefix:"JavaScript",raw:!1},...r)}warn(t,...r){this.logMessage({message:t,severity:"Warn",prefix:"JavaScript",raw:!1},...r)}error(t,...r){this.logMessage({message:t,severity:"Error",prefix:"JavaScript",raw:!1},...r)}}const
|
|
4
|
+
`),[])}logMessage(t,...r){for(const s of this.handlers)s(t,...r)}log(t,...r){this.logMessage({message:t,severity:void 0,prefix:"JavaScript",raw:!1},...r)}debug(t,...r){this.logMessage({message:t,severity:"Debug",prefix:"JavaScript",raw:!1},...r)}info(t,...r){this.logMessage({message:t,severity:"Info",prefix:"JavaScript",raw:!1},...r)}warn(t,...r){this.logMessage({message:t,severity:"Warn",prefix:"JavaScript",raw:!1},...r)}error(t,...r){this.logMessage({message:t,severity:"Error",prefix:"JavaScript",raw:!1},...r)}}const ki=()=>{try{if(process.env.NODE_ENV==="test")return[Rr,Ln]}catch{}return[Rr,Si,Ln]},Te=new Ri(ki()),kr=e=>e.replace(/\t/g,""),Oi=(e,t,r)=>{const s=new Date,n=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}).format(s).replace(/ /g,"-"),i=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"UTC",timeZoneName:"short"}).format(s),c=n+" "+i;return e=kr(e),`[${c}] ${r} ${t}: ${e}`},pr=async(e,{pluginPath:t,pluginName:r},s)=>{s==null||s.tracker.setCaption(`Activating ${r||t}`);const n=await e.documentRoot,i=await e.run({code:`<?php
|
|
5
5
|
define( 'WP_ADMIN', true );
|
|
6
6
|
require_once( ${ve(n)}. "/wp-load.php" );
|
|
7
7
|
require_once( ${ve(n)}. "/wp-admin/includes/plugin.php" );
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
throw new Exception( 'Theme ' . getenv('themeFolderName') . ' could not be activated.' );
|
|
53
53
|
}
|
|
54
54
|
die('Theme activated successfully');
|
|
55
|
-
`,env:{docroot:s,themeFolderName:t}});if(i.text!=="Theme activated successfully")throw Te.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`)},
|
|
55
|
+
`,env:{docroot:s,themeFolderName:t}});if(i.text!=="Theme activated successfully")throw Te.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`)},ys=async(e,{code:t})=>await e.run({code:t}),gs=async(e,{options:t})=>await e.run(t),qr=async(e,{path:t})=>{await e.unlink(t)},$s=async(e,{sql:t},r)=>{r==null||r.tracker.setCaption("Executing SQL Queries");const s=`/tmp/${wi()}.sql`;await e.writeFile(s,new Uint8Array(await t.arrayBuffer()));const n=await e.documentRoot,i=fr({docroot:n,sqlFilename:s}),c=await e.run({code:`<?php
|
|
56
56
|
require_once ${i.docroot} . '/wp-load.php';
|
|
57
57
|
|
|
58
58
|
$handle = fopen(${i.sqlFilename}, 'r');
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
$wpdb->query($buffer);
|
|
72
72
|
$buffer = '';
|
|
73
73
|
}
|
|
74
|
-
`});return await qr(e,{path:s}),
|
|
74
|
+
`});return await qr(e,{path:s}),c},ir=async(e,{request:t})=>{Te.warn('Deprecated: The Blueprint step "request" is deprecated and will be removed in a future release.');const r=await e.request(t);if(r.httpStatusCode>399||r.httpStatusCode<200)throw Te.warn("WordPress response was",{response:r}),new Error(`Request failed with status ${r.httpStatusCode}`);return r},Ni=`<?php
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Rewrites the wp-config.php file to ensure specific constants are defined
|
|
@@ -402,25 +402,25 @@ function skip_whitespace($tokens) {
|
|
|
402
402
|
}
|
|
403
403
|
return $output;
|
|
404
404
|
}
|
|
405
|
-
`,qt=async(e,{consts:t,method:r="define-before-run"})=>{switch(r){case"define-before-run":await
|
|
405
|
+
`,qt=async(e,{consts:t,method:r="define-before-run"})=>{switch(r){case"define-before-run":await Ci(e,t);break;case"rewrite-wp-config":{const s=await e.documentRoot,n=ye(s,"/wp-config.php"),i=await e.readFileAsText(n),c=await Ii(e,i,t);await e.writeFile(n,c);break}default:throw new Error(`Invalid method: ${r}`)}};async function Ci(e,t){for(const r in t)await e.defineConstant(r,t[r])}async function Ii(e,t,r){await e.writeFile("/tmp/code.php",t);const s=fr({consts:r});return await e.run({code:`${Ni}
|
|
406
406
|
$wp_config_path = '/tmp/code.php';
|
|
407
407
|
$wp_config = file_get_contents($wp_config_path);
|
|
408
408
|
$new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${s.consts});
|
|
409
409
|
file_put_contents($wp_config_path, $new_wp_config);
|
|
410
|
-
`}),await e.readFileAsText("/tmp/code.php")}const or=async(e,{username:t="admin",password:r="password"}={},s)=>{var i,
|
|
410
|
+
`}),await e.readFileAsText("/tmp/code.php")}const or=async(e,{username:t="admin",password:r="password"}={},s)=>{var i,c,a;s==null||s.tracker.setCaption((s==null?void 0:s.initialCaption)||"Logging in"),await e.request({url:"/wp-login.php"});const n=await e.request({url:"/wp-login.php",method:"POST",body:{log:t,pwd:r,rememberme:"forever"}});if(!((a=(c=(i=n.headers)==null?void 0:i.location)==null?void 0:c[0])!=null&&a.includes("/wp-admin/")))throw Te.warn("WordPress response was",{response:n,text:n.text}),new Error(`Failed to log in as ${t} with password ${r}`)},Lr=async(e,{options:t})=>{const r=await e.documentRoot;await e.run({code:`<?php
|
|
411
411
|
include ${ve(r)} . '/wp-load.php';
|
|
412
412
|
$site_options = ${ve(t)};
|
|
413
413
|
foreach($site_options as $name => $value) {
|
|
414
414
|
update_option($name, $value);
|
|
415
415
|
}
|
|
416
416
|
echo "Success";
|
|
417
|
-
`})},
|
|
417
|
+
`})},_s=async(e,{meta:t,userId:r})=>{const s=await e.documentRoot;await e.run({code:`<?php
|
|
418
418
|
include ${ve(s)} . '/wp-load.php';
|
|
419
419
|
$meta = ${ve(t)};
|
|
420
420
|
foreach($meta as $name => $value) {
|
|
421
421
|
update_user_meta(${ve(r)}, $name, $value);
|
|
422
422
|
}
|
|
423
|
-
`})};function
|
|
423
|
+
`})};function vs(e){return e.pathname.startsWith("/scope:")}function ji(e){return vs(e)?e.pathname.split("/")[1].split(":")[1]:null}const ws=async e=>{var P;await qt(e,{consts:{WP_ALLOW_MULTISITE:1}});const t=new URL(await e.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 r=t.pathname.replace(/\/$/,"")+"/",s=`${t.protocol}//${t.hostname}${r}`;await Lr(e,{options:{siteurl:s,home:s}}),await or(e,{});const n=await e.documentRoot,c=(await e.run({code:`<?php
|
|
424
424
|
define( 'WP_ADMIN', true );
|
|
425
425
|
require_once(${ve(n)} . "/wp-load.php");
|
|
426
426
|
|
|
@@ -452,7 +452,7 @@ foreach($plugins as $plugin_path) {
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
echo json_encode($deactivated_plugins);
|
|
455
|
-
`})).json,u=(P=(await ir(e,{request:{url:"/wp-admin/network.php"}})).text.match(/name="_wpnonce"\s+value="([^"]+)"/))==null?void 0:P[1],d=await ir(e,{request:{url:"/wp-admin/network.php",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:
|
|
455
|
+
`})).json,u=(P=(await ir(e,{request:{url:"/wp-admin/network.php"}})).text.match(/name="_wpnonce"\s+value="([^"]+)"/))==null?void 0:P[1],d=await ir(e,{request:{url:"/wp-admin/network.php",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:Di({_wpnonce:u,_wp_http_referer:r+"wp-admin/network.php",sitename:"My WordPress Website Sites",email:"admin@localhost.com",submit:"Install"})}});if(d.httpStatusCode!==200)throw Te.warn("WordPress response was",{response:d,text:d.text,headers:d.headers}),new Error(`Failed to enable multisite. Response code was ${d.httpStatusCode}`);await qt(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:r}});const f=new URL(await e.absoluteUrl),y=vs(f)?"scope:"+ji(f):null;await e.writeFile("/internal/shared/preload/sunrise.php",`<?php
|
|
456
456
|
$_SERVER['HTTP_HOST'] = ${ve(f.hostname)};
|
|
457
457
|
$folder = ${ve(y)};
|
|
458
458
|
if ($folder && strpos($_SERVER['REQUEST_URI'],"/$folder") === false) {
|
|
@@ -462,7 +462,7 @@ echo json_encode($deactivated_plugins);
|
|
|
462
462
|
if ( !defined( 'BLOG_ID_CURRENT_SITE' ) ) {
|
|
463
463
|
define( 'BLOG_ID_CURRENT_SITE', 1 );
|
|
464
464
|
}
|
|
465
|
-
`),await or(e,{});for(const b of
|
|
465
|
+
`),await or(e,{});for(const b of c)await pr(e,{pluginPath:b})};function Di(e){return Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}const bs=async(e,{fromPath:t,toPath:r})=>{await e.writeFile(r,await e.readFileAsBuffer(t))},Es=async(e,{fromPath:t,toPath:r})=>{await e.mv(t,r)},Ps=async(e,{path:t})=>{await e.mkdir(t)},Ss=async(e,{path:t})=>{await e.rmdir(t)},Ur=async(e,{path:t,data:r})=>{r instanceof File&&(r=new Uint8Array(await r.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,r)},Vr=async(e,{siteUrl:t})=>{await qt(e,{consts:{WP_HOME:t,WP_SITEURL:t}})},Ts=async(e,{file:t},r)=>{var n;(n=r==null?void 0:r.tracker)==null||n.setCaption("Importing content"),await Ur(e,{path:"/tmp/import.wxr",data:t});const s=await e.documentRoot;await e.run({code:`<?php
|
|
466
466
|
require ${ve(s)} . '/wp-load.php';
|
|
467
467
|
require ${ve(s)} . '/wp-admin/includes/admin.php';
|
|
468
468
|
|
|
@@ -482,7 +482,7 @@ echo json_encode($deactivated_plugins);
|
|
|
482
482
|
});
|
|
483
483
|
|
|
484
484
|
$result = $importer->import( '/tmp/import.wxr' );
|
|
485
|
-
`})},wr="/tmp/file.zip",
|
|
485
|
+
`})},wr="/tmp/file.zip",Ai=async(e,t,r)=>{if(t instanceof File){const n=t;t=wr,await e.writeFile(t,new Uint8Array(await n.arrayBuffer()))}const s=fr({zipPath:t,extractToPath:r});await e.run({code:`<?php
|
|
486
486
|
function unzip($zipPath, $extractTo, $overwrite = true)
|
|
487
487
|
{
|
|
488
488
|
if (!is_dir($extractTo)) {
|
|
@@ -499,10 +499,10 @@ echo json_encode($deactivated_plugins);
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
unzip(${s.zipPath}, ${s.extractToPath});
|
|
502
|
-
`}),await e.fileExists(wr)&&await e.unlink(wr)},hr=async(e,{zipFile:t,zipPath:r,extractToPath:s})=>{if(r)Te.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
|
|
502
|
+
`}),await e.fileExists(wr)&&await e.unlink(wr)},hr=async(e,{zipFile:t,zipPath:r,extractToPath:s})=>{if(r)Te.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 Ai(e,t||r,s)},Rs=async(e,{wordPressFilesZip:t,pathInZip:r=""})=>{const s=await e.documentRoot;let n=ye("/tmp","import");await e.mkdir(n),await hr(e,{zipFile:t,extractToPath:n}),n=ye(n,r);const i=ye(n,"wp-content"),c=ye(s,"wp-content");for(const f of Mr){const y=ye(i,f);await Vn(e,y);const P=ye(c,f);await e.fileExists(P)&&(await e.mkdir(fs(y)),await e.mv(P,y))}const a=ye(n,"wp-content","database");await e.fileExists(a)||await e.mv(ye(s,"wp-content","database"),a);const u=await e.listFiles(n);for(const f of u)await Vn(e,ye(s,f)),await e.mv(ye(n,f),ye(s,f));await e.rmdir(n),await Vr(e,{siteUrl:await e.absoluteUrl});const d=ve(ye(s,"wp-admin","upgrade.php"));await e.run({code:`<?php
|
|
503
503
|
$_GET['step'] = 'upgrade_db';
|
|
504
504
|
require ${d};
|
|
505
|
-
`})};async function
|
|
505
|
+
`})};async function Vn(e,t){await e.fileExists(t)&&(await e.isDir(t)?await e.rmdir(t):await e.unlink(t))}async function ks(e){const t=await e.request({url:"/wp-admin/export.php?download=true&content=all"});return new File([t.bytes],"export.xml")}async function Os(e,{targetPath:t,zipFile:r,ifAlreadyInstalled:s="overwrite"}){const i=r.name.replace(/\.zip$/,""),c=ye(await e.documentRoot,"wp-content"),a=ye(c,hs()),u=ye(a,"assets",i);await e.fileExists(u)&&await e.rmdir(a,{recursive:!0}),await e.mkdir(a);try{await hr(e,{zipFile:r,extractToPath:u});let d=await e.listFiles(u,{prependPath:!0});d=d.filter(_=>!_.endsWith("/__MACOSX"));const f=d.length===1&&await e.isDir(d[0]);let y,P="";f?(P=d[0],y=d[0].split("/").pop()):(P=u,y=i);const b=`${t}/${y}`;if(await e.fileExists(b)){if(!await e.isDir(b))throw new Error(`Cannot install asset ${y} to ${b} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`);if(s==="overwrite")await e.rmdir(b,{recursive:!0});else{if(s==="skip")return{assetFolderPath:b,assetFolderName:y};throw new Error(`Cannot install asset ${y} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${s}`)}}return await e.mv(P,b),{assetFolderPath:b,assetFolderName:y}}finally{await e.rmdir(a,{recursive:!0})}}function mr(e){const t=e.split(".").shift().replace(/-/g," ");return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}const Ns=async(e,{pluginZipFile:t,ifAlreadyInstalled:r,options:s={}},n)=>{const i=t.name.split("/").pop()||"plugin.zip",c=mr(i);n==null||n.tracker.setCaption(`Installing the ${c} plugin`);const{assetFolderPath:a}=await Os(e,{ifAlreadyInstalled:r,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/plugins`});("activate"in s?s.activate:!0)&&await pr(e,{pluginPath:a,pluginName:c},n)},Cs=async(e,{themeZipFile:t,ifAlreadyInstalled:r,options:s={}},n)=>{const i=mr(t.name);n==null||n.tracker.setCaption(`Installing the ${i} theme`);const{assetFolderName:c}=await Os(e,{ifAlreadyInstalled:r,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/themes`});("activate"in s?s.activate:!0)&&await Fr(e,{themeFolderName:c},n)},Is=async(e,t,r)=>{var n;(n=r==null?void 0:r.tracker)==null||n.setCaption("Resetting WordPress data");const s=await e.documentRoot;await e.run({env:{DOCROOT:s},code:`<?php
|
|
506
506
|
require getenv('DOCROOT') . '/wp-load.php';
|
|
507
507
|
|
|
508
508
|
$GLOBALS['@pdo']->query('DELETE FROM wp_posts WHERE id > 0');
|
|
@@ -516,11 +516,11 @@ echo json_encode($deactivated_plugins);
|
|
|
516
516
|
|
|
517
517
|
$GLOBALS['@pdo']->query('DELETE FROM wp_commentmeta');
|
|
518
518
|
$GLOBALS['@pdo']->query("UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='wp_commentmeta'");
|
|
519
|
-
`})},
|
|
520
|
-
'exclude_paths' => ${
|
|
521
|
-
'zip_root' => ${
|
|
522
|
-
'additional_paths' => ${
|
|
523
|
-
));`);const a=await e.readFileAsBuffer(r);return e.unlink(r),a},
|
|
519
|
+
`})},js=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"}})},Ds=async(e,{selfContained:t=!1}={})=>{const r="/tmp/wordpress-playground.zip",s=await e.documentRoot,n=ye(s,"wp-content");let i=Mr;t&&(i=i.filter(u=>!u.startsWith("themes/twenty")).filter(u=>u!=="mu-plugins/sqlite-database-integration"));const c=fr({zipPath:r,wpContentPath:n,documentRoot:s,exceptPaths:i.map(u=>ye(s,"wp-content",u)),additionalPaths:t?{[ye(s,"wp-config.php")]:"wp-config.php"}:{}});await Fi(e,`zipDir(${c.wpContentPath}, ${c.zipPath}, array(
|
|
520
|
+
'exclude_paths' => ${c.exceptPaths},
|
|
521
|
+
'zip_root' => ${c.documentRoot},
|
|
522
|
+
'additional_paths' => ${c.additionalPaths}
|
|
523
|
+
));`);const a=await e.readFileAsBuffer(r);return e.unlink(r),a},Mi=`<?php
|
|
524
524
|
|
|
525
525
|
function zipDir($root, $output, $options = array())
|
|
526
526
|
{
|
|
@@ -579,7 +579,7 @@ function join_paths()
|
|
|
579
579
|
|
|
580
580
|
return preg_replace('#/+#', '/', join('/', $paths));
|
|
581
581
|
}
|
|
582
|
-
`;async function
|
|
582
|
+
`;async function Fi(e,t){return await e.run({code:Mi+t})}const As=async(e,{command:t,wpCliPath:r="/tmp/wp-cli.phar"})=>{if(!await e.fileExists(r))throw new Error(`wp-cli.phar not found at ${r}`);let s;if(typeof t=="string"?(t=t.trim(),s=qi(t)):s=t,s.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
|
|
583
583
|
// Set up the environment to emulate a shell script
|
|
584
584
|
// call.
|
|
585
585
|
|
|
@@ -601,7 +601,7 @@ function join_paths()
|
|
|
601
601
|
define('STDERR', fopen('php://stderr', 'wb'));
|
|
602
602
|
|
|
603
603
|
require( ${ve(r)} );
|
|
604
|
-
`);const i=await e.run({scriptPath:"/wordpress/run-cli.php"});if(i.errors)throw new Error(i.errors);return i};function Ui(e){let s=0,n="";const i=[];let l="";for(let a=0;a<e.length;a++){const u=e[a];s===0?u==='"'||u==="'"?(s=1,n=u):u.match(/\s/)?(l&&i.push(l),l=""):l+=u:s===1&&(u==="\\"?(a++,l+=e[a]):u===n?(s=0,n=""):l+=u)}return l&&i.push(l),i}const Vi=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:pr,activateTheme:Fr,cp:Es,defineSiteUrl:Vr,defineWpConfigConsts:qt,enableMultisite:bs,exportWXR:Os,importWordPressFiles:ks,importWxr:Rs,installPlugin:Cs,installTheme:Is,login:or,mkdir:Ss,mv:Ps,request:ir,resetData:js,rm:qr,rmdir:Ts,runPHP:gs,runPHPWithOptions:$s,runSql:_s,runWpInstallationWizard:Ds,setSiteOptions:Lr,unzip:hr,updateUserMeta:vs,wpCLI:Ms,writeFile:Ur,zipWpContent:As},Symbol.toStringTag,{value:"Module"})),zi=5*1024*1024;function Wi(e,t){const r=e.headers.get("content-length")||"",s=parseInt(r,10)||zi;function n(i,l){t(new CustomEvent("progress",{detail:{loaded:i,total:l}}))}return new Response(new ReadableStream({async start(i){if(!e.body){i.close();return}const l=e.body.getReader();let a=0;for(;;)try{const{done:u,value:d}=await l.read();if(d&&(a+=d.byteLength),u){n(a,a),i.close();break}else n(a,s),i.enqueue(d)}catch(u){Te.error({e:u}),i.error(u);break}}}),{status:e.status,statusText:e.statusText,headers:e.headers})}const br=1e-5;class zr extends EventTarget{constructor({weight:t=1,caption:r="",fillTime:s=4}={}){super(),this._selfWeight=1,this._selfDone=!1,this._selfProgress=0,this._selfCaption="",this._isFilling=!1,this._subTrackers=[],this._weight=t,this._selfCaption=r,this._fillTime=s}stage(t,r=""){if(t||(t=this._selfWeight),this._selfWeight-t<-br)throw new Error(`Cannot add a stage with weight ${t} as the total weight of registered stages would exceed 1.`);this._selfWeight-=t;const s=new zr({caption:r,weight:t,fillTime:this._fillTime});return this._subTrackers.push(s),s.addEventListener("progress",()=>this.notifyProgress()),s.addEventListener("done",()=>{this.done&&this.notifyDone()}),s}fillSlowly({stopBeforeFinishing:t=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,s=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),t&&this._selfProgress>=99&&clearInterval(this._fillInterval)},s)}set(t){this._selfProgress=Math.min(t,100),this.notifyProgress(),this._selfProgress+br>=100&&this.finish()}finish(){this._fillInterval&&clearInterval(this._fillInterval),this._selfDone=!0,this._selfProgress=100,this._isFilling=!1,this._fillInterval=void 0,this.notifyProgress(),this.notifyDone()}get caption(){for(let t=this._subTrackers.length-1;t>=0;t--)if(!this._subTrackers[t].done){const r=this._subTrackers[t].caption;if(r)return r}return this._selfCaption}setCaption(t){this._selfCaption=t,this.notifyProgress()}get done(){return this.progress+br>=100}get progress(){if(this._selfDone)return 100;const t=this._subTrackers.reduce((r,s)=>r+s.progress*s.weight,this._selfProgress*this._selfWeight);return Math.round(t*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=t=>{this.set(t)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=t=>{this.set(t.detail.loaded/t.detail.total*100)}),this._loadingListener}pipe(t){t.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{t.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{t.setLoaded()})}addEventListener(t,r){super.addEventListener(t,r)}removeEventListener(t,r){super.removeEventListener(t,r)}notifyProgress(){const t=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return t.progress},get caption(){return t.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const ar={0:"No error occurred. System call completed successfully.",1:"Argument list too long.",2:"Permission denied.",3:"Address in use.",4:"Address not available.",5:"Address family not supported.",6:"Resource unavailable, or operation would block.",7:"Connection already in progress.",8:"Bad file descriptor.",9:"Bad message.",10:"Device or resource busy.",11:"Operation canceled.",12:"No child processes.",13:"Connection aborted.",14:"Connection refused.",15:"Connection reset.",16:"Resource deadlock would occur.",17:"Destination address required.",18:"Mathematics argument out of domain of function.",19:"Reserved.",20:"File exists.",21:"Bad address.",22:"File too large.",23:"Host is unreachable.",24:"Identifier removed.",25:"Illegal byte sequence.",26:"Operation in progress.",27:"Interrupted function.",28:"Invalid argument.",29:"I/O error.",30:"Socket is connected.",31:"There is a directory under that path.",32:"Too many levels of symbolic links.",33:"File descriptor value too large.",34:"Too many links.",35:"Message too large.",36:"Reserved.",37:"Filename too long.",38:"Network is down.",39:"Connection aborted by network.",40:"Network unreachable.",41:"Too many files open in system.",42:"No buffer space available.",43:"No such device.",44:"There is no such file or directory OR the parent directory does not exist.",45:"Executable file format error.",46:"No locks available.",47:"Reserved.",48:"Not enough space.",49:"No message of the desired type.",50:"Protocol not available.",51:"No space left on device.",52:"Function not supported.",53:"The socket is not connected.",54:"Not a directory or a symbolic link to a directory.",55:"Directory not empty.",56:"State not recoverable.",57:"Not a socket.",58:"Not supported, or operation not supported on socket.",59:"Inappropriate I/O control operation.",60:"No such device or address.",61:"Value too large to be stored in data type.",62:"Previous owner died.",63:"Operation not permitted.",64:"Broken pipe.",65:"Protocol error.",66:"Protocol not supported.",67:"Protocol wrong type for socket.",68:"Result too large.",69:"Read-only file system.",70:"Invalid seek.",71:"No such process.",72:"Reserved.",73:"Connection timed out.",74:"Text file busy.",75:"Cross-device link.",76:"Extension: Capabilities insufficient."};function Bi(e){const t=typeof e=="object"?e==null?void 0:e.errno:null;if(t in ar)return ar[t]}function He(e=""){return function(r,s,n){const i=n.value;n.value=function(...l){try{return i.apply(this,l)}catch(a){const u=typeof a=="object"?a==null?void 0:a.errno:null;if(u in ar){const d=ar[u],f=typeof l[1]=="string"?l[1]:null,y=f!==null?e.replaceAll("{path}",f):e;throw new Error(`${y}: ${d}`,{cause:a})}throw a}}}}var Hi=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Ge=(e,t,r,s)=>{for(var n=s>1?void 0:s?Gi(t,r):t,i=e.length-1,l;i>=0;i--)(l=e[i])&&(n=(s?l(t,r,n):l(n))||n);return s&&n&&Hi(t,r,n),n};const xe=class je{static readFileAsText(t,r){return new TextDecoder().decode(je.readFileAsBuffer(t,r))}static readFileAsBuffer(t,r){return t.readFile(r)}static writeFile(t,r,s){t.writeFile(r,s)}static unlink(t,r){t.unlink(r)}static mv(t,r,s){try{const n=t.lookupPath(r).node.mount,i=je.fileExists(t,s)?t.lookupPath(s).node.mount:t.lookupPath(ps(s)).node.mount;n.mountpoint!==i.mountpoint?(je.copyRecursive(t,r,s),je.rmdir(t,r,{recursive:!0})):t.rename(r,s)}catch(n){const i=Bi(n);throw i?new Error(`Could not move ${r} to ${s}: ${i}`,{cause:n}):n}}static rmdir(t,r,s={recursive:!0}){s!=null&&s.recursive&&je.listFiles(t,r).forEach(n=>{const i=`${r}/${n}`;je.isDir(t,i)?je.rmdir(t,i,s):je.unlink(t,i)}),t.rmdir(r)}static listFiles(t,r,s={prependPath:!1}){if(!je.fileExists(t,r))return[];try{const n=t.readdir(r).filter(i=>i!=="."&&i!=="..");if(s.prependPath){const i=r.replace(/\/$/,"");return n.map(l=>`${i}/${l}`)}return n}catch(n){return Te.error(n,{path:r}),[]}}static isDir(t,r){return je.fileExists(t,r)?t.isDir(t.lookupPath(r).node.mode):!1}static fileExists(t,r){try{return t.lookupPath(r),!0}catch{return!1}}static mkdir(t,r){t.mkdirTree(r)}static copyRecursive(t,r,s){const n=t.lookupPath(r).node;if(t.isDir(n.mode)){t.mkdirTree(s);const i=t.readdir(r).filter(l=>l!=="."&&l!=="..");for(const l of i)je.copyRecursive(t,ye(r,l),ye(s,l))}else t.writeFile(s,t.readFile(r))}};Ge([He('Could not read "{path}"')],xe,"readFileAsText",1);Ge([He('Could not read "{path}"')],xe,"readFileAsBuffer",1);Ge([He('Could not write to "{path}"')],xe,"writeFile",1);Ge([He('Could not unlink "{path}"')],xe,"unlink",1);Ge([He('Could not remove directory "{path}"')],xe,"rmdir",1);Ge([He('Could not list files in "{path}"')],xe,"listFiles",1);Ge([He('Could not stat "{path}"')],xe,"isDir",1);Ge([He('Could not stat "{path}"')],xe,"fileExists",1);Ge([He('Could not create directory "{path}"')],xe,"mkdir",1);Ge([He('Could not copy files from "{path}"')],xe,"copyRecursive",1);(function(){var e;return typeof process<"u"&&((e=process.release)==null?void 0:e.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();var xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ki(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ReadableStream.prototype[Symbol.asyncIterator]||(ReadableStream.prototype[Symbol.asyncIterator]=async function*(){const e=this.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)return;yield r}}finally{e.releaseLock()}},ReadableStream.prototype.iterate=ReadableStream.prototype[Symbol.asyncIterator]);const Fs=["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"],Ji=Fs[0],qs=["iconv","mbstring","xml-bundle","gd"],Wn={"kitchen-sink":qs,light:[]},Qi=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function Zi(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&Qi.includes(e.resource)}class yt{static create(t,{semaphore:r,progress:s}){let n;switch(t.resource){case"vfs":n=new Yi(t,s);break;case"literal":n=new Xi(t,s);break;case"wordpress.org/themes":n=new ro(t,s);break;case"wordpress.org/plugins":n=new no(t,s);break;case"url":n=new to(t,s);break;default:throw new Error(`Invalid resource: ${t}`)}return n=new so(n),r&&(n=new io(n,r)),n}setPlayground(t){this.playground=t}get isAsync(){return!1}}class Yi extends yt{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){var r;const t=await this.playground.readFileAsBuffer(this.resource.path);return(r=this.progress)==null||r.set(100),new File([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class Xi extends yt{constructor(t,r){super(),this.resource=t,this.progress=r}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 Wr extends yt{constructor(t){super(),this.progress=t}async resolve(){var r,s;(r=this.progress)==null||r.setCaption(this.caption);const t=this.getURL();try{let n=await fetch(t);if(!n.ok)throw new Error(`Could not download "${t}"`);if(n=await Wi(n,((s=this.progress)==null?void 0:s.loadingListener)??eo),n.status!==200)throw new Error(`Could not download "${t}"`);return new File([await n.blob()],this.name)}catch(n){throw new Error(`Could not download "${t}".
|
|
604
|
+
`);const i=await e.run({scriptPath:"/wordpress/run-cli.php"});if(i.errors)throw new Error(i.errors);return i};function qi(e){let s=0,n="";const i=[];let c="";for(let a=0;a<e.length;a++){const u=e[a];s===0?u==='"'||u==="'"?(s=1,n=u):u.match(/\s/)?(c&&i.push(c),c=""):c+=u:s===1&&(u==="\\"?(a++,c+=e[a]):u===n?(s=0,n=""):c+=u)}return c&&i.push(c),i}const Li=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:pr,activateTheme:Fr,cp:bs,defineSiteUrl:Vr,defineWpConfigConsts:qt,enableMultisite:ws,exportWXR:ks,importWordPressFiles:Rs,importWxr:Ts,installPlugin:Ns,installTheme:Cs,login:or,mkdir:Ps,mv:Es,request:ir,resetData:Is,rm:qr,rmdir:Ss,runPHP:ys,runPHPWithOptions:gs,runSql:$s,runWpInstallationWizard:js,setSiteOptions:Lr,unzip:hr,updateUserMeta:_s,wpCLI:As,writeFile:Ur,zipWpContent:Ds},Symbol.toStringTag,{value:"Module"})),Ui=5*1024*1024;function Vi(e,t){const r=e.headers.get("content-length")||"",s=parseInt(r,10)||Ui;function n(i,c){t(new CustomEvent("progress",{detail:{loaded:i,total:c}}))}return new Response(new ReadableStream({async start(i){if(!e.body){i.close();return}const c=e.body.getReader();let a=0;for(;;)try{const{done:u,value:d}=await c.read();if(d&&(a+=d.byteLength),u){n(a,a),i.close();break}else n(a,s),i.enqueue(d)}catch(u){Te.error({e:u}),i.error(u);break}}}),{status:e.status,statusText:e.statusText,headers:e.headers})}const br=1e-5;class zr extends EventTarget{constructor({weight:t=1,caption:r="",fillTime:s=4}={}){super(),this._selfWeight=1,this._selfDone=!1,this._selfProgress=0,this._selfCaption="",this._isFilling=!1,this._subTrackers=[],this._weight=t,this._selfCaption=r,this._fillTime=s}stage(t,r=""){if(t||(t=this._selfWeight),this._selfWeight-t<-br)throw new Error(`Cannot add a stage with weight ${t} as the total weight of registered stages would exceed 1.`);this._selfWeight-=t;const s=new zr({caption:r,weight:t,fillTime:this._fillTime});return this._subTrackers.push(s),s.addEventListener("progress",()=>this.notifyProgress()),s.addEventListener("done",()=>{this.done&&this.notifyDone()}),s}fillSlowly({stopBeforeFinishing:t=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,s=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),t&&this._selfProgress>=99&&clearInterval(this._fillInterval)},s)}set(t){this._selfProgress=Math.min(t,100),this.notifyProgress(),this._selfProgress+br>=100&&this.finish()}finish(){this._fillInterval&&clearInterval(this._fillInterval),this._selfDone=!0,this._selfProgress=100,this._isFilling=!1,this._fillInterval=void 0,this.notifyProgress(),this.notifyDone()}get caption(){for(let t=this._subTrackers.length-1;t>=0;t--)if(!this._subTrackers[t].done){const r=this._subTrackers[t].caption;if(r)return r}return this._selfCaption}setCaption(t){this._selfCaption=t,this.notifyProgress()}get done(){return this.progress+br>=100}get progress(){if(this._selfDone)return 100;const t=this._subTrackers.reduce((r,s)=>r+s.progress*s.weight,this._selfProgress*this._selfWeight);return Math.round(t*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=t=>{this.set(t)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=t=>{this.set(t.detail.loaded/t.detail.total*100)}),this._loadingListener}pipe(t){t.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{t.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{t.setLoaded()})}addEventListener(t,r){super.addEventListener(t,r)}removeEventListener(t,r){super.removeEventListener(t,r)}notifyProgress(){const t=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return t.progress},get caption(){return t.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const ar={0:"No error occurred. System call completed successfully.",1:"Argument list too long.",2:"Permission denied.",3:"Address in use.",4:"Address not available.",5:"Address family not supported.",6:"Resource unavailable, or operation would block.",7:"Connection already in progress.",8:"Bad file descriptor.",9:"Bad message.",10:"Device or resource busy.",11:"Operation canceled.",12:"No child processes.",13:"Connection aborted.",14:"Connection refused.",15:"Connection reset.",16:"Resource deadlock would occur.",17:"Destination address required.",18:"Mathematics argument out of domain of function.",19:"Reserved.",20:"File exists.",21:"Bad address.",22:"File too large.",23:"Host is unreachable.",24:"Identifier removed.",25:"Illegal byte sequence.",26:"Operation in progress.",27:"Interrupted function.",28:"Invalid argument.",29:"I/O error.",30:"Socket is connected.",31:"There is a directory under that path.",32:"Too many levels of symbolic links.",33:"File descriptor value too large.",34:"Too many links.",35:"Message too large.",36:"Reserved.",37:"Filename too long.",38:"Network is down.",39:"Connection aborted by network.",40:"Network unreachable.",41:"Too many files open in system.",42:"No buffer space available.",43:"No such device.",44:"There is no such file or directory OR the parent directory does not exist.",45:"Executable file format error.",46:"No locks available.",47:"Reserved.",48:"Not enough space.",49:"No message of the desired type.",50:"Protocol not available.",51:"No space left on device.",52:"Function not supported.",53:"The socket is not connected.",54:"Not a directory or a symbolic link to a directory.",55:"Directory not empty.",56:"State not recoverable.",57:"Not a socket.",58:"Not supported, or operation not supported on socket.",59:"Inappropriate I/O control operation.",60:"No such device or address.",61:"Value too large to be stored in data type.",62:"Previous owner died.",63:"Operation not permitted.",64:"Broken pipe.",65:"Protocol error.",66:"Protocol not supported.",67:"Protocol wrong type for socket.",68:"Result too large.",69:"Read-only file system.",70:"Invalid seek.",71:"No such process.",72:"Reserved.",73:"Connection timed out.",74:"Text file busy.",75:"Cross-device link.",76:"Extension: Capabilities insufficient."};function zi(e){const t=typeof e=="object"?e==null?void 0:e.errno:null;if(t in ar)return ar[t]}function He(e=""){return function(r,s,n){const i=n.value;n.value=function(...c){try{return i.apply(this,c)}catch(a){const u=typeof a=="object"?a==null?void 0:a.errno:null;if(u in ar){const d=ar[u],f=typeof c[1]=="string"?c[1]:null,y=f!==null?e.replaceAll("{path}",f):e;throw new Error(`${y}: ${d}`,{cause:a})}throw a}}}}var Wi=Object.defineProperty,Bi=Object.getOwnPropertyDescriptor,Ge=(e,t,r,s)=>{for(var n=s>1?void 0:s?Bi(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(n=(s?c(t,r,n):c(n))||n);return s&&n&&Wi(t,r,n),n};const xe=class je{static readFileAsText(t,r){return new TextDecoder().decode(je.readFileAsBuffer(t,r))}static readFileAsBuffer(t,r){return t.readFile(r)}static writeFile(t,r,s){t.writeFile(r,s)}static unlink(t,r){t.unlink(r)}static mv(t,r,s){try{const n=t.lookupPath(r).node.mount,i=je.fileExists(t,s)?t.lookupPath(s).node.mount:t.lookupPath(fs(s)).node.mount;n.mountpoint!==i.mountpoint?(je.copyRecursive(t,r,s),je.rmdir(t,r,{recursive:!0})):t.rename(r,s)}catch(n){const i=zi(n);throw i?new Error(`Could not move ${r} to ${s}: ${i}`,{cause:n}):n}}static rmdir(t,r,s={recursive:!0}){s!=null&&s.recursive&&je.listFiles(t,r).forEach(n=>{const i=`${r}/${n}`;je.isDir(t,i)?je.rmdir(t,i,s):je.unlink(t,i)}),t.rmdir(r)}static listFiles(t,r,s={prependPath:!1}){if(!je.fileExists(t,r))return[];try{const n=t.readdir(r).filter(i=>i!=="."&&i!=="..");if(s.prependPath){const i=r.replace(/\/$/,"");return n.map(c=>`${i}/${c}`)}return n}catch(n){return Te.error(n,{path:r}),[]}}static isDir(t,r){return je.fileExists(t,r)?t.isDir(t.lookupPath(r).node.mode):!1}static fileExists(t,r){try{return t.lookupPath(r),!0}catch{return!1}}static mkdir(t,r){t.mkdirTree(r)}static copyRecursive(t,r,s){const n=t.lookupPath(r).node;if(t.isDir(n.mode)){t.mkdirTree(s);const i=t.readdir(r).filter(c=>c!=="."&&c!=="..");for(const c of i)je.copyRecursive(t,ye(r,c),ye(s,c))}else t.writeFile(s,t.readFile(r))}};Ge([He('Could not read "{path}"')],xe,"readFileAsText",1);Ge([He('Could not read "{path}"')],xe,"readFileAsBuffer",1);Ge([He('Could not write to "{path}"')],xe,"writeFile",1);Ge([He('Could not unlink "{path}"')],xe,"unlink",1);Ge([He('Could not remove directory "{path}"')],xe,"rmdir",1);Ge([He('Could not list files in "{path}"')],xe,"listFiles",1);Ge([He('Could not stat "{path}"')],xe,"isDir",1);Ge([He('Could not stat "{path}"')],xe,"fileExists",1);Ge([He('Could not create directory "{path}"')],xe,"mkdir",1);Ge([He('Could not copy files from "{path}"')],xe,"copyRecursive",1);(function(){var e;return typeof process<"u"&&((e=process.release)==null?void 0:e.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ReadableStream.prototype[Symbol.asyncIterator]||(ReadableStream.prototype[Symbol.asyncIterator]=async function*(){const e=this.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)return;yield r}}finally{e.releaseLock()}},ReadableStream.prototype.iterate=ReadableStream.prototype[Symbol.asyncIterator]);const Ms=["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"],xi=Ms[0],Fs=["iconv","mbstring","xml-bundle","gd"],zn={"kitchen-sink":Fs,light:[]},Ki=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function Ji(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&Ki.includes(e.resource)}class yt{static create(t,{semaphore:r,progress:s}){let n;switch(t.resource){case"vfs":n=new Qi(t,s);break;case"literal":n=new Zi(t,s);break;case"wordpress.org/themes":n=new eo(t,s);break;case"wordpress.org/plugins":n=new to(t,s);break;case"url":n=new Xi(t,s);break;default:throw new Error(`Invalid resource: ${t}`)}return n=new ro(n),r&&(n=new no(n,r)),n}setPlayground(t){this.playground=t}get isAsync(){return!1}}class Qi extends yt{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){var r;const t=await this.playground.readFileAsBuffer(this.resource.path);return(r=this.progress)==null||r.set(100),new File([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class Zi extends yt{constructor(t,r){super(),this.resource=t,this.progress=r}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 Wr extends yt{constructor(t){super(),this.progress=t}async resolve(){var r,s;(r=this.progress)==null||r.setCaption(this.caption);const t=this.getURL();try{let n=await fetch(t);if(!n.ok)throw new Error(`Could not download "${t}"`);if(n=await Vi(n,((s=this.progress)==null?void 0:s.loadingListener)??Yi),n.status!==200)throw new Error(`Could not download "${t}"`);return new File([await n.blob()],this.name)}catch(n){throw new Error(`Could not download "${t}".
|
|
605
605
|
Check if the URL is correct and the server is reachable.
|
|
606
606
|
If it is reachable, the server might be blocking the request.
|
|
607
607
|
Check the browser console and network tabs for more information.
|
|
@@ -625,17 +625,17 @@ function join_paths()
|
|
|
625
625
|
https://raw.githubusercontent.com/username/repository/branch/filename
|
|
626
626
|
|
|
627
627
|
Error:
|
|
628
|
-
${n}`)}}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 eo=()=>{};class to extends Wr{constructor(t,r){super(r),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class ro extends Wr{constructor(t,r){super(r),this.resource=t}get name(){return mr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${Ls(this.resource.slug)}`}}class no extends Wr{constructor(t,r){super(r),this.resource=t}get name(){return mr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${Ls(this.resource.slug)}`}}function Ls(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class Us extends yt{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 so extends Us{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class io extends Us{constructor(t,r){super(t),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var Or={exports:{}},Vs={},Ze={},ut={},Vt={},ee={},Lt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(v){if(super(),!e.IDENTIFIER.test(v))throw new Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class s extends t{constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((T,j)=>`${T}${j}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((T,j)=>(j instanceof r&&(T[j.str]=(T[j.str]||0)+1),T),{})}}e._Code=s,e.nil=new s("");function n(g,...v){const T=[g[0]];let j=0;for(;j<v.length;)a(T,v[j]),T.push(g[++j]);return new s(T)}e._=n;const i=new s("+");function l(g,...v){const T=[b(g[0])];let j=0;for(;j<v.length;)T.push(i),a(T,v[j]),T.push(i,b(g[++j]));return u(T),new s(T)}e.str=l;function a(g,v){v instanceof s?g.push(...v._items):v instanceof r?g.push(v):g.push(y(v))}e.addCodeArg=a;function u(g){let v=1;for(;v<g.length-1;){if(g[v]===i){const T=d(g[v-1],g[v+1]);if(T!==void 0){g.splice(v-1,3,T);continue}g[v++]="+"}v++}}function d(g,v){if(v==='""')return g;if(g==='""')return v;if(typeof g=="string")return v instanceof r||g[g.length-1]!=='"'?void 0:typeof v!="string"?`${g.slice(0,-1)}${v}"`:v[0]==='"'?g.slice(0,-1)+v.slice(1):void 0;if(typeof v=="string"&&v[0]==='"'&&!(g instanceof r))return`"${g}${v.slice(1)}`}function f(g,v){return v.emptyStr()?g:g.emptyStr()?v:l`${g}${v}`}e.strConcat=f;function y(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:b(Array.isArray(g)?g.join(","):g)}function P(g){return new s(b(g))}e.stringify=P;function b(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=b;function _(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new s(`.${g}`):n`[${g}]`}e.getProperty=_;function E(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new s(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=E;function w(g){return new s(g.toString())}e.regexpCode=w})(Lt);var Nr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Lt;class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var s;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(s=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class n{constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,y;if(!((y=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||y===void 0)&&y.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=n;class i extends t.Name{constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:y}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(f)}[${y}]`}}e.ValueScopeName=i;const l=(0,t._)`\n`;class a extends n{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?l:t.nil}}get(){return this._scope}name(d){return new i(d,this._newName(d))}value(d,f){var y;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const P=this.toName(d),{prefix:b}=P,_=(y=f.key)!==null&&y!==void 0?y:f.ref;let E=this._values[b];if(E){const v=E.get(_);if(v)return v}else E=this._values[b]=new Map;E.set(_,P);const w=this._scope[b]||(this._scope[b]=[]),g=w.length;return w[g]=f.ref,P.setValue(f,{property:b,itemIndex:g}),P}getValue(d,f){const y=this._values[d];if(y)return y.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,y=>{if(y.scopePath===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return(0,t._)`${d}${y.scopePath}`})}scopeCode(d=this._values,f,y){return this._reduceValues(d,P=>{if(P.value===void 0)throw new Error(`CodeGen: name "${P}" has no value`);return P.value.code},f,y)}_reduceValues(d,f,y={},P){let b=t.nil;for(const _ in d){const E=d[_];if(!E)continue;const w=y[_]=y[_]||new Map;E.forEach(g=>{if(w.has(g))return;w.set(g,s.Started);let v=f(g);if(v){const T=this.opts.es5?e.varKinds.var:e.varKinds.const;b=(0,t._)`${b}${T} ${g} = ${v};${this.opts._n}`}else if(v=P==null?void 0:P(g))b=(0,t._)`${b}${v}${this.opts._n}`;else throw new r(g);w.set(g,s.Completed)})}return b}}e.ValueScope=a})(Nr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Lt,r=Nr;var s=Lt;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return s.Name}});var n=Nr;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(o,h){return this}}class l extends i{constructor(o,h,D){super(),this.varKind=o,this.name=h,this.rhs=D}render({es5:o,_n:h}){const D=o?r.varKinds.var:this.varKind,V=this.rhs===void 0?"":` = ${this.rhs}`;return`${D} ${this.name}${V};`+h}optimizeNames(o,h){if(o[this.name.str])return this.rhs&&(this.rhs=se(this.rhs,o,h)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(o,h,D){super(),this.lhs=o,this.rhs=h,this.sideEffects=D}render({_n:o}){return`${this.lhs} = ${this.rhs};`+o}optimizeNames(o,h){if(!(this.lhs instanceof t.Name&&!o[this.lhs.str]&&!this.sideEffects))return this.rhs=se(this.rhs,o,h),this}get names(){const o=this.lhs instanceof t.Name?{}:{...this.lhs.names};return oe(o,this.rhs)}}class u extends a{constructor(o,h,D,V){super(o,D,V),this.op=h}render({_n:o}){return`${this.lhs} ${this.op}= ${this.rhs};`+o}}class d extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`${this.label}:`+o}}class f extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`break${this.label?` ${this.label}`:""};`+o}}class y extends i{constructor(o){super(),this.error=o}render({_n:o}){return`throw ${this.error};`+o}get names(){return this.error.names}}class P extends i{constructor(o){super(),this.code=o}render({_n:o}){return`${this.code};`+o}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(o,h){return this.code=se(this.code,o,h),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class b extends i{constructor(o=[]){super(),this.nodes=o}render(o){return this.nodes.reduce((h,D)=>h+D.render(o),"")}optimizeNodes(){const{nodes:o}=this;let h=o.length;for(;h--;){const D=o[h].optimizeNodes();Array.isArray(D)?o.splice(h,1,...D):D?o[h]=D:o.splice(h,1)}return o.length>0?this:void 0}optimizeNames(o,h){const{nodes:D}=this;let V=D.length;for(;V--;){const z=D[V];z.optimizeNames(o,h)||(Ae(o,z.names),D.splice(V,1))}return D.length>0?this:void 0}get names(){return this.nodes.reduce((o,h)=>Q(o,h.names),{})}}class _ extends b{render(o){return"{"+o._n+super.render(o)+"}"+o._n}}class E extends b{}class w extends _{}w.kind="else";class g extends _{constructor(o,h){super(h),this.condition=o}render(o){let h=`if(${this.condition})`+super.render(o);return this.else&&(h+="else "+this.else.render(o)),h}optimizeNodes(){super.optimizeNodes();const o=this.condition;if(o===!0)return this.nodes;let h=this.else;if(h){const D=h.optimizeNodes();h=this.else=Array.isArray(D)?new w(D):D}if(h)return o===!1?h instanceof g?h:h.nodes:this.nodes.length?this:new g(Ue(o),h instanceof g?[h]:h.nodes);if(!(o===!1||!this.nodes.length))return this}optimizeNames(o,h){var D;if(this.else=(D=this.else)===null||D===void 0?void 0:D.optimizeNames(o,h),!!(super.optimizeNames(o,h)||this.else))return this.condition=se(this.condition,o,h),this}get names(){const o=super.names;return oe(o,this.condition),this.else&&Q(o,this.else.names),o}}g.kind="if";class v extends _{}v.kind="for";class T extends v{constructor(o){super(),this.iteration=o}render(o){return`for(${this.iteration})`+super.render(o)}optimizeNames(o,h){if(super.optimizeNames(o,h))return this.iteration=se(this.iteration,o,h),this}get names(){return Q(super.names,this.iteration.names)}}class j extends v{constructor(o,h,D,V){super(),this.varKind=o,this.name=h,this.from=D,this.to=V}render(o){const h=o.es5?r.varKinds.var:this.varKind,{name:D,from:V,to:z}=this;return`for(${h} ${D}=${V}; ${D}<${z}; ${D}++)`+super.render(o)}get names(){const o=oe(super.names,this.from);return oe(o,this.to)}}class F extends v{constructor(o,h,D,V){super(),this.loop=o,this.varKind=h,this.name=D,this.iterable=V}render(o){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(o)}optimizeNames(o,h){if(super.optimizeNames(o,h))return this.iterable=se(this.iterable,o,h),this}get names(){return Q(super.names,this.iterable.names)}}class S extends _{constructor(o,h,D){super(),this.name=o,this.args=h,this.async=D}render(o){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(o)}}S.kind="func";class I extends b{render(o){return"return "+super.render(o)}}I.kind="return";class q extends _{render(o){let h="try"+super.render(o);return this.catch&&(h+=this.catch.render(o)),this.finally&&(h+=this.finally.render(o)),h}optimizeNodes(){var o,h;return super.optimizeNodes(),(o=this.catch)===null||o===void 0||o.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(o,h){var D,V;return super.optimizeNames(o,h),(D=this.catch)===null||D===void 0||D.optimizeNames(o,h),(V=this.finally)===null||V===void 0||V.optimizeNames(o,h),this}get names(){const o=super.names;return this.catch&&Q(o,this.catch.names),this.finally&&Q(o,this.finally.names),o}}class G extends _{constructor(o){super(),this.error=o}render(o){return`catch(${this.error})`+super.render(o)}}G.kind="catch";class J extends _{render(o){return"finally"+super.render(o)}}J.kind="finally";class ie{constructor(o,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...h,_n:h.lines?`
|
|
629
|
-
`:""},this._extScope=o,this._scope=new r.Scope({parent:o}),this._nodes=[new E]}toString(){return this._root.render(this.opts)}name(o){return this._scope.name(o)}scopeName(o){return this._extScope.name(o)}scopeValue(o,h){const D=this._extScope.value(o,h);return(this._values[D.prefix]||(this._values[D.prefix]=new Set)).add(D),D}getScopeValue(o,h){return this._extScope.getValue(o,h)}scopeRefs(o){return this._extScope.scopeRefs(o,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(o,h,D,V){const z=this._scope.toName(h);return D!==void 0&&V&&(this._constants[z.str]=D),this._leafNode(new l(o,z,D)),z}const(o,h,D){return this._def(r.varKinds.const,o,h,D)}let(o,h,D){return this._def(r.varKinds.let,o,h,D)}var(o,h,D){return this._def(r.varKinds.var,o,h,D)}assign(o,h,D){return this._leafNode(new a(o,h,D))}add(o,h){return this._leafNode(new u(o,e.operators.ADD,h))}code(o){return typeof o=="function"?o():o!==t.nil&&this._leafNode(new P(o)),this}object(...o){const h=["{"];for(const[D,V]of o)h.length>1&&h.push(","),h.push(D),(D!==V||this.opts.es5)&&(h.push(":"),(0,t.addCodeArg)(h,V));return h.push("}"),new t._Code(h)}if(o,h,D){if(this._blockNode(new g(o)),h&&D)this.code(h).else().code(D).endIf();else if(h)this.code(h).endIf();else if(D)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(o){return this._elseNode(new g(o))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(g,w)}_for(o,h){return this._blockNode(o),h&&this.code(h).endFor(),this}for(o,h){return this._for(new T(o),h)}forRange(o,h,D,V,z=this.opts.es5?r.varKinds.var:r.varKinds.let){const Z=this._scope.toName(o);return this._for(new j(z,Z,h,D),()=>V(Z))}forOf(o,h,D,V=r.varKinds.const){const z=this._scope.toName(o);if(this.opts.es5){const Z=h instanceof t.Name?h:this.var("_arr",h);return this.forRange("_i",0,(0,t._)`${Z}.length`,Y=>{this.var(z,(0,t._)`${Z}[${Y}]`),D(z)})}return this._for(new F("of",V,z,h),()=>D(z))}forIn(o,h,D,V=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(o,(0,t._)`Object.keys(${h})`,D);const z=this._scope.toName(o);return this._for(new F("in",V,z,h),()=>D(z))}endFor(){return this._endBlockNode(v)}label(o){return this._leafNode(new d(o))}break(o){return this._leafNode(new f(o))}return(o){const h=new I;if(this._blockNode(h),this.code(o),h.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(o,h,D){if(!h&&!D)throw new Error('CodeGen: "try" without "catch" and "finally"');const V=new q;if(this._blockNode(V),this.code(o),h){const z=this.name("e");this._currNode=V.catch=new G(z),h(z)}return D&&(this._currNode=V.finally=new J,this.code(D)),this._endBlockNode(G,J)}throw(o){return this._leafNode(new y(o))}block(o,h){return this._blockStarts.push(this._nodes.length),o&&this.code(o).endBlock(h),this}endBlock(o){const h=this._blockStarts.pop();if(h===void 0)throw new Error("CodeGen: not in self-balancing block");const D=this._nodes.length-h;if(D<0||o!==void 0&&D!==o)throw new Error(`CodeGen: wrong number of nodes: ${D} vs ${o} expected`);return this._nodes.length=h,this}func(o,h=t.nil,D,V){return this._blockNode(new S(o,h,D)),V&&this.code(V).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(o=1){for(;o-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(o){return this._currNode.nodes.push(o),this}_blockNode(o){this._currNode.nodes.push(o),this._nodes.push(o)}_endBlockNode(o,h){const D=this._currNode;if(D instanceof o||h&&D instanceof h)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${h?`${o.kind}/${h.kind}`:o.kind}"`)}_elseNode(o){const h=this._currNode;if(!(h instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=h.else=o,this}get _root(){return this._nodes[0]}get _currNode(){const o=this._nodes;return o[o.length-1]}set _currNode(o){const h=this._nodes;h[h.length-1]=o}}e.CodeGen=ie;function Q(O,o){for(const h in o)O[h]=(O[h]||0)+(o[h]||0);return O}function oe(O,o){return o instanceof t._CodeOrName?Q(O,o.names):O}function se(O,o,h){if(O instanceof t.Name)return D(O);if(!V(O))return O;return new t._Code(O._items.reduce((z,Z)=>(Z instanceof t.Name&&(Z=D(Z)),Z instanceof t._Code?z.push(...Z._items):z.push(Z),z),[]));function D(z){const Z=h[z.str];return Z===void 0||o[z.str]!==1?z:(delete o[z.str],Z)}function V(z){return z instanceof t._Code&&z._items.some(Z=>Z instanceof t.Name&&o[Z.str]===1&&h[Z.str]!==void 0)}}function Ae(O,o){for(const h in o)O[h]=(O[h]||0)-(o[h]||0)}function Ue(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,t._)`!${M(O)}`}e.not=Ue;const Je=R(e.operators.AND);function it(...O){return O.reduce(Je)}e.and=it;const et=R(e.operators.OR);function U(...O){return O.reduce(et)}e.or=U;function R(O){return(o,h)=>o===t.nil?h:h===t.nil?o:(0,t._)`${M(o)} ${O} ${M(h)}`}function M(O){return O instanceof t.Name?O:(0,t._)`(${O})`}})(ee);var ne={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=ee,r=Lt;function s(S){const I={};for(const q of S)I[q]=!0;return I}e.toHash=s;function n(S,I){return typeof I=="boolean"?I:Object.keys(I).length===0?!0:(i(S,I),!l(I,S.self.RULES.all))}e.alwaysValidSchema=n;function i(S,I=S.schema){const{opts:q,self:G}=S;if(!q.strictSchema||typeof I=="boolean")return;const J=G.RULES.keywords;for(const ie in I)J[ie]||F(S,`unknown keyword: "${ie}"`)}e.checkUnknownRules=i;function l(S,I){if(typeof S=="boolean")return!S;for(const q in S)if(I[q])return!0;return!1}e.schemaHasRules=l;function a(S,I){if(typeof S=="boolean")return!S;for(const q in S)if(q!=="$ref"&&I.all[q])return!0;return!1}e.schemaHasRulesButRef=a;function u({topSchemaRef:S,schemaPath:I},q,G,J){if(!J){if(typeof q=="number"||typeof q=="boolean")return q;if(typeof q=="string")return(0,t._)`${q}`}return(0,t._)`${S}${I}${(0,t.getProperty)(G)}`}e.schemaRefOrVal=u;function d(S){return P(decodeURIComponent(S))}e.unescapeFragment=d;function f(S){return encodeURIComponent(y(S))}e.escapeFragment=f;function y(S){return typeof S=="number"?`${S}`:S.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=y;function P(S){return S.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=P;function b(S,I){if(Array.isArray(S))for(const q of S)I(q);else I(S)}e.eachItem=b;function _({mergeNames:S,mergeToName:I,mergeValues:q,resultToName:G}){return(J,ie,Q,oe)=>{const se=Q===void 0?ie:Q instanceof t.Name?(ie instanceof t.Name?S(J,ie,Q):I(J,ie,Q),Q):ie instanceof t.Name?(I(J,Q,ie),ie):q(ie,Q);return oe===t.Name&&!(se instanceof t.Name)?G(J,se):se}}e.mergeEvaluated={props:_({mergeNames:(S,I,q)=>S.if((0,t._)`${q} !== true && ${I} !== undefined`,()=>{S.if((0,t._)`${I} === true`,()=>S.assign(q,!0),()=>S.assign(q,(0,t._)`${q} || {}`).code((0,t._)`Object.assign(${q}, ${I})`))}),mergeToName:(S,I,q)=>S.if((0,t._)`${q} !== true`,()=>{I===!0?S.assign(q,!0):(S.assign(q,(0,t._)`${q} || {}`),w(S,q,I))}),mergeValues:(S,I)=>S===!0?!0:{...S,...I},resultToName:E}),items:_({mergeNames:(S,I,q)=>S.if((0,t._)`${q} !== true && ${I} !== undefined`,()=>S.assign(q,(0,t._)`${I} === true ? true : ${q} > ${I} ? ${q} : ${I}`)),mergeToName:(S,I,q)=>S.if((0,t._)`${q} !== true`,()=>S.assign(q,I===!0?!0:(0,t._)`${q} > ${I} ? ${q} : ${I}`)),mergeValues:(S,I)=>S===!0?!0:Math.max(S,I),resultToName:(S,I)=>S.var("items",I)})};function E(S,I){if(I===!0)return S.var("props",!0);const q=S.var("props",(0,t._)`{}`);return I!==void 0&&w(S,q,I),q}e.evaluatedPropsToName=E;function w(S,I,q){Object.keys(q).forEach(G=>S.assign((0,t._)`${I}${(0,t.getProperty)(G)}`,!0))}e.setEvaluated=w;const g={};function v(S,I){return S.scopeValue("func",{ref:I,code:g[I.code]||(g[I.code]=new r._Code(I.code))})}e.useFunc=v;var T;(function(S){S[S.Num=0]="Num",S[S.Str=1]="Str"})(T=e.Type||(e.Type={}));function j(S,I,q){if(S instanceof t.Name){const G=I===T.Num;return q?G?(0,t._)`"[" + ${S} + "]"`:(0,t._)`"['" + ${S} + "']"`:G?(0,t._)`"/" + ${S}`:(0,t._)`"/" + ${S}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return q?(0,t.getProperty)(S).toString():"/"+y(S)}e.getErrorPath=j;function F(S,I,q=S.opts.strictSchema){if(q){if(I=`strict mode: ${I}`,q===!0)throw new Error(I);S.self.logger.warn(I)}}e.checkStrictMode=F})(ne);var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});const Se=ee,oo={data:new Se.Name("data"),valCxt:new Se.Name("valCxt"),instancePath:new Se.Name("instancePath"),parentData:new Se.Name("parentData"),parentDataProperty:new Se.Name("parentDataProperty"),rootData:new Se.Name("rootData"),dynamicAnchors:new Se.Name("dynamicAnchors"),vErrors:new Se.Name("vErrors"),errors:new Se.Name("errors"),this:new Se.Name("this"),self:new Se.Name("self"),scope:new Se.Name("scope"),json:new Se.Name("json"),jsonPos:new Se.Name("jsonPos"),jsonLen:new Se.Name("jsonLen"),jsonPart:new Se.Name("jsonPart")};Ke.default=oo;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ee,r=ne,s=Ke;e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:g})=>g?(0,t.str)`"${w}" keyword must be ${g} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function n(w,g=e.keywordError,v,T){const{it:j}=w,{gen:F,compositeRule:S,allErrors:I}=j,q=y(w,g,v);T??(S||I)?u(F,q):d(j,(0,t._)`[${q}]`)}e.reportError=n;function i(w,g=e.keywordError,v){const{it:T}=w,{gen:j,compositeRule:F,allErrors:S}=T,I=y(w,g,v);u(j,I),F||S||d(T,s.default.vErrors)}e.reportExtraError=i;function l(w,g){w.assign(s.default.errors,g),w.if((0,t._)`${s.default.vErrors} !== null`,()=>w.if(g,()=>w.assign((0,t._)`${s.default.vErrors}.length`,g),()=>w.assign(s.default.vErrors,null)))}e.resetErrorsCount=l;function a({gen:w,keyword:g,schemaValue:v,data:T,errsCount:j,it:F}){if(j===void 0)throw new Error("ajv implementation error");const S=w.name("err");w.forRange("i",j,s.default.errors,I=>{w.const(S,(0,t._)`${s.default.vErrors}[${I}]`),w.if((0,t._)`${S}.instancePath === undefined`,()=>w.assign((0,t._)`${S}.instancePath`,(0,t.strConcat)(s.default.instancePath,F.errorPath))),w.assign((0,t._)`${S}.schemaPath`,(0,t.str)`${F.errSchemaPath}/${g}`),F.opts.verbose&&(w.assign((0,t._)`${S}.schema`,v),w.assign((0,t._)`${S}.data`,T))})}e.extendErrors=a;function u(w,g){const v=w.const("err",g);w.if((0,t._)`${s.default.vErrors} === null`,()=>w.assign(s.default.vErrors,(0,t._)`[${v}]`),(0,t._)`${s.default.vErrors}.push(${v})`),w.code((0,t._)`${s.default.errors}++`)}function d(w,g){const{gen:v,validateName:T,schemaEnv:j}=w;j.$async?v.throw((0,t._)`new ${w.ValidationError}(${g})`):(v.assign((0,t._)`${T}.errors`,g),v.return(!1))}const f={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function y(w,g,v){const{createErrors:T}=w.it;return T===!1?(0,t._)`{}`:P(w,g,v)}function P(w,g,v={}){const{gen:T,it:j}=w,F=[b(j,v),_(w,v)];return E(w,g,F),T.object(...F)}function b({errorPath:w},{instancePath:g}){const v=g?(0,t.str)`${w}${(0,r.getErrorPath)(g,r.Type.Str)}`:w;return[s.default.instancePath,(0,t.strConcat)(s.default.instancePath,v)]}function _({keyword:w,it:{errSchemaPath:g}},{schemaPath:v,parentSchema:T}){let j=T?g:(0,t.str)`${g}/${w}`;return v&&(j=(0,t.str)`${j}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,j]}function E(w,{params:g,message:v},T){const{keyword:j,data:F,schemaValue:S,it:I}=w,{opts:q,propertyName:G,topSchemaRef:J,schemaPath:ie}=I;T.push([f.keyword,j],[f.params,typeof g=="function"?g(w):g||(0,t._)`{}`]),q.messages&&T.push([f.message,typeof v=="function"?v(w):v]),q.verbose&&T.push([f.schema,S],[f.parentSchema,(0,t._)`${J}${ie}`],[s.default.data,F]),G&&T.push([f.propertyName,G])}})(Vt);var Bn;function ao(){if(Bn)return ut;Bn=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.boolOrEmptySchema=ut.topBoolOrEmptySchema=void 0;const e=Vt,t=ee,r=Ke,s={message:"boolean schema is false"};function n(a){const{gen:u,schema:d,validateName:f}=a;d===!1?l(a,!1):typeof d=="object"&&d.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${f}.errors`,null),u.return(!0))}ut.topBoolOrEmptySchema=n;function i(a,u){const{gen:d,schema:f}=a;f===!1?(d.var(u,!1),l(a)):d.var(u,!0)}ut.boolOrEmptySchema=i;function l(a,u){const{gen:d,data:f}=a,y={gen:d,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(y,s,void 0,u)}return ut}var Ut={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.getRules=ht.isJSONType=void 0;const co=["string","number","integer","boolean","null","object","array"],lo=new Set(co);function uo(e){return typeof e=="string"&&lo.has(e)}ht.isJSONType=uo;function fo(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}ht.getRules=fo;var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.shouldUseRule=Xe.shouldUseGroup=Xe.schemaHasRulesForType=void 0;function po({schema:e,self:t},r){const s=t.RULES.types[r];return s&&s!==!0&&zs(e,s)}Xe.schemaHasRulesForType=po;function zs(e,t){return t.rules.some(r=>Ws(e,r))}Xe.shouldUseGroup=zs;function Ws(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(s=>e[s]!==void 0))}Xe.shouldUseRule=Ws;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=ht,r=Xe,s=Vt,n=ee,i=ne;var l;(function(T){T[T.Correct=0]="Correct",T[T.Wrong=1]="Wrong"})(l=e.DataType||(e.DataType={}));function a(T){const j=u(T.type);if(j.includes("null")){if(T.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&T.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');T.nullable===!0&&j.push("null")}return j}e.getSchemaTypes=a;function u(T){const j=Array.isArray(T)?T:T?[T]:[];if(j.every(t.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}e.getJSONTypes=u;function d(T,j){const{gen:F,data:S,opts:I}=T,q=y(j,I.coerceTypes),G=j.length>0&&!(q.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(T,j[0]));if(G){const J=E(j,S,I.strictNumbers,l.Wrong);F.if(J,()=>{q.length?P(T,j,q):g(T)})}return G}e.coerceAndCheckDataType=d;const f=new Set(["string","number","integer","boolean","null"]);function y(T,j){return j?T.filter(F=>f.has(F)||j==="array"&&F==="array"):[]}function P(T,j,F){const{gen:S,data:I,opts:q}=T,G=S.let("dataType",(0,n._)`typeof ${I}`),J=S.let("coerced",(0,n._)`undefined`);q.coerceTypes==="array"&&S.if((0,n._)`${G} == 'object' && Array.isArray(${I}) && ${I}.length == 1`,()=>S.assign(I,(0,n._)`${I}[0]`).assign(G,(0,n._)`typeof ${I}`).if(E(j,I,q.strictNumbers),()=>S.assign(J,I))),S.if((0,n._)`${J} !== undefined`);for(const Q of F)(f.has(Q)||Q==="array"&&q.coerceTypes==="array")&&ie(Q);S.else(),g(T),S.endIf(),S.if((0,n._)`${J} !== undefined`,()=>{S.assign(I,J),b(T,J)});function ie(Q){switch(Q){case"string":S.elseIf((0,n._)`${G} == "number" || ${G} == "boolean"`).assign(J,(0,n._)`"" + ${I}`).elseIf((0,n._)`${I} === null`).assign(J,(0,n._)`""`);return;case"number":S.elseIf((0,n._)`${G} == "boolean" || ${I} === null
|
|
628
|
+
${n}`)}}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 Yi=()=>{};class Xi extends Wr{constructor(t,r){super(r),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class eo extends Wr{constructor(t,r){super(r),this.resource=t}get name(){return mr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${qs(this.resource.slug)}`}}class to extends Wr{constructor(t,r){super(r),this.resource=t}get name(){return mr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${qs(this.resource.slug)}`}}function qs(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class Ls extends yt{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 ro extends Ls{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class no extends Ls{constructor(t,r){super(t),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var Or={exports:{}},Us={},Ze={},ut={},Vt={},ee={},Lt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(v){if(super(),!e.IDENTIFIER.test(v))throw new Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class s extends t{constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((T,j)=>`${T}${j}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((T,j)=>(j instanceof r&&(T[j.str]=(T[j.str]||0)+1),T),{})}}e._Code=s,e.nil=new s("");function n(g,...v){const T=[g[0]];let j=0;for(;j<v.length;)a(T,v[j]),T.push(g[++j]);return new s(T)}e._=n;const i=new s("+");function c(g,...v){const T=[b(g[0])];let j=0;for(;j<v.length;)T.push(i),a(T,v[j]),T.push(i,b(g[++j]));return u(T),new s(T)}e.str=c;function a(g,v){v instanceof s?g.push(...v._items):v instanceof r?g.push(v):g.push(y(v))}e.addCodeArg=a;function u(g){let v=1;for(;v<g.length-1;){if(g[v]===i){const T=d(g[v-1],g[v+1]);if(T!==void 0){g.splice(v-1,3,T);continue}g[v++]="+"}v++}}function d(g,v){if(v==='""')return g;if(g==='""')return v;if(typeof g=="string")return v instanceof r||g[g.length-1]!=='"'?void 0:typeof v!="string"?`${g.slice(0,-1)}${v}"`:v[0]==='"'?g.slice(0,-1)+v.slice(1):void 0;if(typeof v=="string"&&v[0]==='"'&&!(g instanceof r))return`"${g}${v.slice(1)}`}function f(g,v){return v.emptyStr()?g:g.emptyStr()?v:c`${g}${v}`}e.strConcat=f;function y(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:b(Array.isArray(g)?g.join(","):g)}function P(g){return new s(b(g))}e.stringify=P;function b(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=b;function _(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new s(`.${g}`):n`[${g}]`}e.getProperty=_;function E(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new s(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=E;function w(g){return new s(g.toString())}e.regexpCode=w})(Lt);var Nr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Lt;class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var s;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(s=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class n{constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,y;if(!((y=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||y===void 0)&&y.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=n;class i extends t.Name{constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:y}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(f)}[${y}]`}}e.ValueScopeName=i;const c=(0,t._)`\n`;class a extends n{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?c:t.nil}}get(){return this._scope}name(d){return new i(d,this._newName(d))}value(d,f){var y;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const P=this.toName(d),{prefix:b}=P,_=(y=f.key)!==null&&y!==void 0?y:f.ref;let E=this._values[b];if(E){const v=E.get(_);if(v)return v}else E=this._values[b]=new Map;E.set(_,P);const w=this._scope[b]||(this._scope[b]=[]),g=w.length;return w[g]=f.ref,P.setValue(f,{property:b,itemIndex:g}),P}getValue(d,f){const y=this._values[d];if(y)return y.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,y=>{if(y.scopePath===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return(0,t._)`${d}${y.scopePath}`})}scopeCode(d=this._values,f,y){return this._reduceValues(d,P=>{if(P.value===void 0)throw new Error(`CodeGen: name "${P}" has no value`);return P.value.code},f,y)}_reduceValues(d,f,y={},P){let b=t.nil;for(const _ in d){const E=d[_];if(!E)continue;const w=y[_]=y[_]||new Map;E.forEach(g=>{if(w.has(g))return;w.set(g,s.Started);let v=f(g);if(v){const T=this.opts.es5?e.varKinds.var:e.varKinds.const;b=(0,t._)`${b}${T} ${g} = ${v};${this.opts._n}`}else if(v=P==null?void 0:P(g))b=(0,t._)`${b}${v}${this.opts._n}`;else throw new r(g);w.set(g,s.Completed)})}return b}}e.ValueScope=a})(Nr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Lt,r=Nr;var s=Lt;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return s.Name}});var n=Nr;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(o,h){return this}}class c extends i{constructor(o,h,D){super(),this.varKind=o,this.name=h,this.rhs=D}render({es5:o,_n:h}){const D=o?r.varKinds.var:this.varKind,V=this.rhs===void 0?"":` = ${this.rhs}`;return`${D} ${this.name}${V};`+h}optimizeNames(o,h){if(o[this.name.str])return this.rhs&&(this.rhs=se(this.rhs,o,h)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(o,h,D){super(),this.lhs=o,this.rhs=h,this.sideEffects=D}render({_n:o}){return`${this.lhs} = ${this.rhs};`+o}optimizeNames(o,h){if(!(this.lhs instanceof t.Name&&!o[this.lhs.str]&&!this.sideEffects))return this.rhs=se(this.rhs,o,h),this}get names(){const o=this.lhs instanceof t.Name?{}:{...this.lhs.names};return oe(o,this.rhs)}}class u extends a{constructor(o,h,D,V){super(o,D,V),this.op=h}render({_n:o}){return`${this.lhs} ${this.op}= ${this.rhs};`+o}}class d extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`${this.label}:`+o}}class f extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`break${this.label?` ${this.label}`:""};`+o}}class y extends i{constructor(o){super(),this.error=o}render({_n:o}){return`throw ${this.error};`+o}get names(){return this.error.names}}class P extends i{constructor(o){super(),this.code=o}render({_n:o}){return`${this.code};`+o}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(o,h){return this.code=se(this.code,o,h),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class b extends i{constructor(o=[]){super(),this.nodes=o}render(o){return this.nodes.reduce((h,D)=>h+D.render(o),"")}optimizeNodes(){const{nodes:o}=this;let h=o.length;for(;h--;){const D=o[h].optimizeNodes();Array.isArray(D)?o.splice(h,1,...D):D?o[h]=D:o.splice(h,1)}return o.length>0?this:void 0}optimizeNames(o,h){const{nodes:D}=this;let V=D.length;for(;V--;){const z=D[V];z.optimizeNames(o,h)||(Ae(o,z.names),D.splice(V,1))}return D.length>0?this:void 0}get names(){return this.nodes.reduce((o,h)=>Q(o,h.names),{})}}class _ extends b{render(o){return"{"+o._n+super.render(o)+"}"+o._n}}class E extends b{}class w extends _{}w.kind="else";class g extends _{constructor(o,h){super(h),this.condition=o}render(o){let h=`if(${this.condition})`+super.render(o);return this.else&&(h+="else "+this.else.render(o)),h}optimizeNodes(){super.optimizeNodes();const o=this.condition;if(o===!0)return this.nodes;let h=this.else;if(h){const D=h.optimizeNodes();h=this.else=Array.isArray(D)?new w(D):D}if(h)return o===!1?h instanceof g?h:h.nodes:this.nodes.length?this:new g(Ue(o),h instanceof g?[h]:h.nodes);if(!(o===!1||!this.nodes.length))return this}optimizeNames(o,h){var D;if(this.else=(D=this.else)===null||D===void 0?void 0:D.optimizeNames(o,h),!!(super.optimizeNames(o,h)||this.else))return this.condition=se(this.condition,o,h),this}get names(){const o=super.names;return oe(o,this.condition),this.else&&Q(o,this.else.names),o}}g.kind="if";class v extends _{}v.kind="for";class T extends v{constructor(o){super(),this.iteration=o}render(o){return`for(${this.iteration})`+super.render(o)}optimizeNames(o,h){if(super.optimizeNames(o,h))return this.iteration=se(this.iteration,o,h),this}get names(){return Q(super.names,this.iteration.names)}}class j extends v{constructor(o,h,D,V){super(),this.varKind=o,this.name=h,this.from=D,this.to=V}render(o){const h=o.es5?r.varKinds.var:this.varKind,{name:D,from:V,to:z}=this;return`for(${h} ${D}=${V}; ${D}<${z}; ${D}++)`+super.render(o)}get names(){const o=oe(super.names,this.from);return oe(o,this.to)}}class F extends v{constructor(o,h,D,V){super(),this.loop=o,this.varKind=h,this.name=D,this.iterable=V}render(o){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(o)}optimizeNames(o,h){if(super.optimizeNames(o,h))return this.iterable=se(this.iterable,o,h),this}get names(){return Q(super.names,this.iterable.names)}}class S extends _{constructor(o,h,D){super(),this.name=o,this.args=h,this.async=D}render(o){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(o)}}S.kind="func";class I extends b{render(o){return"return "+super.render(o)}}I.kind="return";class q extends _{render(o){let h="try"+super.render(o);return this.catch&&(h+=this.catch.render(o)),this.finally&&(h+=this.finally.render(o)),h}optimizeNodes(){var o,h;return super.optimizeNodes(),(o=this.catch)===null||o===void 0||o.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(o,h){var D,V;return super.optimizeNames(o,h),(D=this.catch)===null||D===void 0||D.optimizeNames(o,h),(V=this.finally)===null||V===void 0||V.optimizeNames(o,h),this}get names(){const o=super.names;return this.catch&&Q(o,this.catch.names),this.finally&&Q(o,this.finally.names),o}}class G extends _{constructor(o){super(),this.error=o}render(o){return`catch(${this.error})`+super.render(o)}}G.kind="catch";class J extends _{render(o){return"finally"+super.render(o)}}J.kind="finally";class ie{constructor(o,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...h,_n:h.lines?`
|
|
629
|
+
`:""},this._extScope=o,this._scope=new r.Scope({parent:o}),this._nodes=[new E]}toString(){return this._root.render(this.opts)}name(o){return this._scope.name(o)}scopeName(o){return this._extScope.name(o)}scopeValue(o,h){const D=this._extScope.value(o,h);return(this._values[D.prefix]||(this._values[D.prefix]=new Set)).add(D),D}getScopeValue(o,h){return this._extScope.getValue(o,h)}scopeRefs(o){return this._extScope.scopeRefs(o,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(o,h,D,V){const z=this._scope.toName(h);return D!==void 0&&V&&(this._constants[z.str]=D),this._leafNode(new c(o,z,D)),z}const(o,h,D){return this._def(r.varKinds.const,o,h,D)}let(o,h,D){return this._def(r.varKinds.let,o,h,D)}var(o,h,D){return this._def(r.varKinds.var,o,h,D)}assign(o,h,D){return this._leafNode(new a(o,h,D))}add(o,h){return this._leafNode(new u(o,e.operators.ADD,h))}code(o){return typeof o=="function"?o():o!==t.nil&&this._leafNode(new P(o)),this}object(...o){const h=["{"];for(const[D,V]of o)h.length>1&&h.push(","),h.push(D),(D!==V||this.opts.es5)&&(h.push(":"),(0,t.addCodeArg)(h,V));return h.push("}"),new t._Code(h)}if(o,h,D){if(this._blockNode(new g(o)),h&&D)this.code(h).else().code(D).endIf();else if(h)this.code(h).endIf();else if(D)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(o){return this._elseNode(new g(o))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(g,w)}_for(o,h){return this._blockNode(o),h&&this.code(h).endFor(),this}for(o,h){return this._for(new T(o),h)}forRange(o,h,D,V,z=this.opts.es5?r.varKinds.var:r.varKinds.let){const Z=this._scope.toName(o);return this._for(new j(z,Z,h,D),()=>V(Z))}forOf(o,h,D,V=r.varKinds.const){const z=this._scope.toName(o);if(this.opts.es5){const Z=h instanceof t.Name?h:this.var("_arr",h);return this.forRange("_i",0,(0,t._)`${Z}.length`,Y=>{this.var(z,(0,t._)`${Z}[${Y}]`),D(z)})}return this._for(new F("of",V,z,h),()=>D(z))}forIn(o,h,D,V=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(o,(0,t._)`Object.keys(${h})`,D);const z=this._scope.toName(o);return this._for(new F("in",V,z,h),()=>D(z))}endFor(){return this._endBlockNode(v)}label(o){return this._leafNode(new d(o))}break(o){return this._leafNode(new f(o))}return(o){const h=new I;if(this._blockNode(h),this.code(o),h.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(o,h,D){if(!h&&!D)throw new Error('CodeGen: "try" without "catch" and "finally"');const V=new q;if(this._blockNode(V),this.code(o),h){const z=this.name("e");this._currNode=V.catch=new G(z),h(z)}return D&&(this._currNode=V.finally=new J,this.code(D)),this._endBlockNode(G,J)}throw(o){return this._leafNode(new y(o))}block(o,h){return this._blockStarts.push(this._nodes.length),o&&this.code(o).endBlock(h),this}endBlock(o){const h=this._blockStarts.pop();if(h===void 0)throw new Error("CodeGen: not in self-balancing block");const D=this._nodes.length-h;if(D<0||o!==void 0&&D!==o)throw new Error(`CodeGen: wrong number of nodes: ${D} vs ${o} expected`);return this._nodes.length=h,this}func(o,h=t.nil,D,V){return this._blockNode(new S(o,h,D)),V&&this.code(V).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(o=1){for(;o-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(o){return this._currNode.nodes.push(o),this}_blockNode(o){this._currNode.nodes.push(o),this._nodes.push(o)}_endBlockNode(o,h){const D=this._currNode;if(D instanceof o||h&&D instanceof h)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${h?`${o.kind}/${h.kind}`:o.kind}"`)}_elseNode(o){const h=this._currNode;if(!(h instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=h.else=o,this}get _root(){return this._nodes[0]}get _currNode(){const o=this._nodes;return o[o.length-1]}set _currNode(o){const h=this._nodes;h[h.length-1]=o}}e.CodeGen=ie;function Q(O,o){for(const h in o)O[h]=(O[h]||0)+(o[h]||0);return O}function oe(O,o){return o instanceof t._CodeOrName?Q(O,o.names):O}function se(O,o,h){if(O instanceof t.Name)return D(O);if(!V(O))return O;return new t._Code(O._items.reduce((z,Z)=>(Z instanceof t.Name&&(Z=D(Z)),Z instanceof t._Code?z.push(...Z._items):z.push(Z),z),[]));function D(z){const Z=h[z.str];return Z===void 0||o[z.str]!==1?z:(delete o[z.str],Z)}function V(z){return z instanceof t._Code&&z._items.some(Z=>Z instanceof t.Name&&o[Z.str]===1&&h[Z.str]!==void 0)}}function Ae(O,o){for(const h in o)O[h]=(O[h]||0)-(o[h]||0)}function Ue(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,t._)`!${M(O)}`}e.not=Ue;const Je=R(e.operators.AND);function it(...O){return O.reduce(Je)}e.and=it;const et=R(e.operators.OR);function U(...O){return O.reduce(et)}e.or=U;function R(O){return(o,h)=>o===t.nil?h:h===t.nil?o:(0,t._)`${M(o)} ${O} ${M(h)}`}function M(O){return O instanceof t.Name?O:(0,t._)`(${O})`}})(ee);var ne={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=ee,r=Lt;function s(S){const I={};for(const q of S)I[q]=!0;return I}e.toHash=s;function n(S,I){return typeof I=="boolean"?I:Object.keys(I).length===0?!0:(i(S,I),!c(I,S.self.RULES.all))}e.alwaysValidSchema=n;function i(S,I=S.schema){const{opts:q,self:G}=S;if(!q.strictSchema||typeof I=="boolean")return;const J=G.RULES.keywords;for(const ie in I)J[ie]||F(S,`unknown keyword: "${ie}"`)}e.checkUnknownRules=i;function c(S,I){if(typeof S=="boolean")return!S;for(const q in S)if(I[q])return!0;return!1}e.schemaHasRules=c;function a(S,I){if(typeof S=="boolean")return!S;for(const q in S)if(q!=="$ref"&&I.all[q])return!0;return!1}e.schemaHasRulesButRef=a;function u({topSchemaRef:S,schemaPath:I},q,G,J){if(!J){if(typeof q=="number"||typeof q=="boolean")return q;if(typeof q=="string")return(0,t._)`${q}`}return(0,t._)`${S}${I}${(0,t.getProperty)(G)}`}e.schemaRefOrVal=u;function d(S){return P(decodeURIComponent(S))}e.unescapeFragment=d;function f(S){return encodeURIComponent(y(S))}e.escapeFragment=f;function y(S){return typeof S=="number"?`${S}`:S.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=y;function P(S){return S.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=P;function b(S,I){if(Array.isArray(S))for(const q of S)I(q);else I(S)}e.eachItem=b;function _({mergeNames:S,mergeToName:I,mergeValues:q,resultToName:G}){return(J,ie,Q,oe)=>{const se=Q===void 0?ie:Q instanceof t.Name?(ie instanceof t.Name?S(J,ie,Q):I(J,ie,Q),Q):ie instanceof t.Name?(I(J,Q,ie),ie):q(ie,Q);return oe===t.Name&&!(se instanceof t.Name)?G(J,se):se}}e.mergeEvaluated={props:_({mergeNames:(S,I,q)=>S.if((0,t._)`${q} !== true && ${I} !== undefined`,()=>{S.if((0,t._)`${I} === true`,()=>S.assign(q,!0),()=>S.assign(q,(0,t._)`${q} || {}`).code((0,t._)`Object.assign(${q}, ${I})`))}),mergeToName:(S,I,q)=>S.if((0,t._)`${q} !== true`,()=>{I===!0?S.assign(q,!0):(S.assign(q,(0,t._)`${q} || {}`),w(S,q,I))}),mergeValues:(S,I)=>S===!0?!0:{...S,...I},resultToName:E}),items:_({mergeNames:(S,I,q)=>S.if((0,t._)`${q} !== true && ${I} !== undefined`,()=>S.assign(q,(0,t._)`${I} === true ? true : ${q} > ${I} ? ${q} : ${I}`)),mergeToName:(S,I,q)=>S.if((0,t._)`${q} !== true`,()=>S.assign(q,I===!0?!0:(0,t._)`${q} > ${I} ? ${q} : ${I}`)),mergeValues:(S,I)=>S===!0?!0:Math.max(S,I),resultToName:(S,I)=>S.var("items",I)})};function E(S,I){if(I===!0)return S.var("props",!0);const q=S.var("props",(0,t._)`{}`);return I!==void 0&&w(S,q,I),q}e.evaluatedPropsToName=E;function w(S,I,q){Object.keys(q).forEach(G=>S.assign((0,t._)`${I}${(0,t.getProperty)(G)}`,!0))}e.setEvaluated=w;const g={};function v(S,I){return S.scopeValue("func",{ref:I,code:g[I.code]||(g[I.code]=new r._Code(I.code))})}e.useFunc=v;var T;(function(S){S[S.Num=0]="Num",S[S.Str=1]="Str"})(T=e.Type||(e.Type={}));function j(S,I,q){if(S instanceof t.Name){const G=I===T.Num;return q?G?(0,t._)`"[" + ${S} + "]"`:(0,t._)`"['" + ${S} + "']"`:G?(0,t._)`"/" + ${S}`:(0,t._)`"/" + ${S}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return q?(0,t.getProperty)(S).toString():"/"+y(S)}e.getErrorPath=j;function F(S,I,q=S.opts.strictSchema){if(q){if(I=`strict mode: ${I}`,q===!0)throw new Error(I);S.self.logger.warn(I)}}e.checkStrictMode=F})(ne);var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});const Se=ee,so={data:new Se.Name("data"),valCxt:new Se.Name("valCxt"),instancePath:new Se.Name("instancePath"),parentData:new Se.Name("parentData"),parentDataProperty:new Se.Name("parentDataProperty"),rootData:new Se.Name("rootData"),dynamicAnchors:new Se.Name("dynamicAnchors"),vErrors:new Se.Name("vErrors"),errors:new Se.Name("errors"),this:new Se.Name("this"),self:new Se.Name("self"),scope:new Se.Name("scope"),json:new Se.Name("json"),jsonPos:new Se.Name("jsonPos"),jsonLen:new Se.Name("jsonLen"),jsonPart:new Se.Name("jsonPart")};Ke.default=so;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ee,r=ne,s=Ke;e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:g})=>g?(0,t.str)`"${w}" keyword must be ${g} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function n(w,g=e.keywordError,v,T){const{it:j}=w,{gen:F,compositeRule:S,allErrors:I}=j,q=y(w,g,v);T??(S||I)?u(F,q):d(j,(0,t._)`[${q}]`)}e.reportError=n;function i(w,g=e.keywordError,v){const{it:T}=w,{gen:j,compositeRule:F,allErrors:S}=T,I=y(w,g,v);u(j,I),F||S||d(T,s.default.vErrors)}e.reportExtraError=i;function c(w,g){w.assign(s.default.errors,g),w.if((0,t._)`${s.default.vErrors} !== null`,()=>w.if(g,()=>w.assign((0,t._)`${s.default.vErrors}.length`,g),()=>w.assign(s.default.vErrors,null)))}e.resetErrorsCount=c;function a({gen:w,keyword:g,schemaValue:v,data:T,errsCount:j,it:F}){if(j===void 0)throw new Error("ajv implementation error");const S=w.name("err");w.forRange("i",j,s.default.errors,I=>{w.const(S,(0,t._)`${s.default.vErrors}[${I}]`),w.if((0,t._)`${S}.instancePath === undefined`,()=>w.assign((0,t._)`${S}.instancePath`,(0,t.strConcat)(s.default.instancePath,F.errorPath))),w.assign((0,t._)`${S}.schemaPath`,(0,t.str)`${F.errSchemaPath}/${g}`),F.opts.verbose&&(w.assign((0,t._)`${S}.schema`,v),w.assign((0,t._)`${S}.data`,T))})}e.extendErrors=a;function u(w,g){const v=w.const("err",g);w.if((0,t._)`${s.default.vErrors} === null`,()=>w.assign(s.default.vErrors,(0,t._)`[${v}]`),(0,t._)`${s.default.vErrors}.push(${v})`),w.code((0,t._)`${s.default.errors}++`)}function d(w,g){const{gen:v,validateName:T,schemaEnv:j}=w;j.$async?v.throw((0,t._)`new ${w.ValidationError}(${g})`):(v.assign((0,t._)`${T}.errors`,g),v.return(!1))}const f={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function y(w,g,v){const{createErrors:T}=w.it;return T===!1?(0,t._)`{}`:P(w,g,v)}function P(w,g,v={}){const{gen:T,it:j}=w,F=[b(j,v),_(w,v)];return E(w,g,F),T.object(...F)}function b({errorPath:w},{instancePath:g}){const v=g?(0,t.str)`${w}${(0,r.getErrorPath)(g,r.Type.Str)}`:w;return[s.default.instancePath,(0,t.strConcat)(s.default.instancePath,v)]}function _({keyword:w,it:{errSchemaPath:g}},{schemaPath:v,parentSchema:T}){let j=T?g:(0,t.str)`${g}/${w}`;return v&&(j=(0,t.str)`${j}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,j]}function E(w,{params:g,message:v},T){const{keyword:j,data:F,schemaValue:S,it:I}=w,{opts:q,propertyName:G,topSchemaRef:J,schemaPath:ie}=I;T.push([f.keyword,j],[f.params,typeof g=="function"?g(w):g||(0,t._)`{}`]),q.messages&&T.push([f.message,typeof v=="function"?v(w):v]),q.verbose&&T.push([f.schema,S],[f.parentSchema,(0,t._)`${J}${ie}`],[s.default.data,F]),G&&T.push([f.propertyName,G])}})(Vt);var Wn;function io(){if(Wn)return ut;Wn=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.boolOrEmptySchema=ut.topBoolOrEmptySchema=void 0;const e=Vt,t=ee,r=Ke,s={message:"boolean schema is false"};function n(a){const{gen:u,schema:d,validateName:f}=a;d===!1?c(a,!1):typeof d=="object"&&d.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${f}.errors`,null),u.return(!0))}ut.topBoolOrEmptySchema=n;function i(a,u){const{gen:d,schema:f}=a;f===!1?(d.var(u,!1),c(a)):d.var(u,!0)}ut.boolOrEmptySchema=i;function c(a,u){const{gen:d,data:f}=a,y={gen:d,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(y,s,void 0,u)}return ut}var Ut={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.getRules=ht.isJSONType=void 0;const oo=["string","number","integer","boolean","null","object","array"],ao=new Set(oo);function co(e){return typeof e=="string"&&ao.has(e)}ht.isJSONType=co;function lo(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}ht.getRules=lo;var Ye={},Bn;function Vs(){if(Bn)return Ye;Bn=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.shouldUseRule=Ye.shouldUseGroup=Ye.schemaHasRulesForType=void 0;function e({schema:s,self:n},i){const c=n.RULES.types[i];return c&&c!==!0&&t(s,c)}Ye.schemaHasRulesForType=e;function t(s,n){return n.rules.some(i=>r(s,i))}Ye.shouldUseGroup=t;function r(s,n){var i;return s[n.keyword]!==void 0||((i=n.definition.implements)===null||i===void 0?void 0:i.some(c=>s[c]!==void 0))}return Ye.shouldUseRule=r,Ye}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=ht,r=Vs(),s=Vt,n=ee,i=ne;var c;(function(T){T[T.Correct=0]="Correct",T[T.Wrong=1]="Wrong"})(c=e.DataType||(e.DataType={}));function a(T){const j=u(T.type);if(j.includes("null")){if(T.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&T.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');T.nullable===!0&&j.push("null")}return j}e.getSchemaTypes=a;function u(T){const j=Array.isArray(T)?T:T?[T]:[];if(j.every(t.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}e.getJSONTypes=u;function d(T,j){const{gen:F,data:S,opts:I}=T,q=y(j,I.coerceTypes),G=j.length>0&&!(q.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(T,j[0]));if(G){const J=E(j,S,I.strictNumbers,c.Wrong);F.if(J,()=>{q.length?P(T,j,q):g(T)})}return G}e.coerceAndCheckDataType=d;const f=new Set(["string","number","integer","boolean","null"]);function y(T,j){return j?T.filter(F=>f.has(F)||j==="array"&&F==="array"):[]}function P(T,j,F){const{gen:S,data:I,opts:q}=T,G=S.let("dataType",(0,n._)`typeof ${I}`),J=S.let("coerced",(0,n._)`undefined`);q.coerceTypes==="array"&&S.if((0,n._)`${G} == 'object' && Array.isArray(${I}) && ${I}.length == 1`,()=>S.assign(I,(0,n._)`${I}[0]`).assign(G,(0,n._)`typeof ${I}`).if(E(j,I,q.strictNumbers),()=>S.assign(J,I))),S.if((0,n._)`${J} !== undefined`);for(const Q of F)(f.has(Q)||Q==="array"&&q.coerceTypes==="array")&&ie(Q);S.else(),g(T),S.endIf(),S.if((0,n._)`${J} !== undefined`,()=>{S.assign(I,J),b(T,J)});function ie(Q){switch(Q){case"string":S.elseIf((0,n._)`${G} == "number" || ${G} == "boolean"`).assign(J,(0,n._)`"" + ${I}`).elseIf((0,n._)`${I} === null`).assign(J,(0,n._)`""`);return;case"number":S.elseIf((0,n._)`${G} == "boolean" || ${I} === null
|
|
630
630
|
|| (${G} == "string" && ${I} && ${I} == +${I})`).assign(J,(0,n._)`+${I}`);return;case"integer":S.elseIf((0,n._)`${G} === "boolean" || ${I} === null
|
|
631
631
|
|| (${G} === "string" && ${I} && ${I} == +${I} && !(${I} % 1))`).assign(J,(0,n._)`+${I}`);return;case"boolean":S.elseIf((0,n._)`${I} === "false" || ${I} === 0 || ${I} === null`).assign(J,!1).elseIf((0,n._)`${I} === "true" || ${I} === 1`).assign(J,!0);return;case"null":S.elseIf((0,n._)`${I} === "" || ${I} === 0 || ${I} === false`),S.assign(J,null);return;case"array":S.elseIf((0,n._)`${G} === "string" || ${G} === "number"
|
|
632
|
-
|| ${G} === "boolean" || ${I} === null`).assign(J,(0,n._)`[${I}]`)}}}function b({gen:T,parentData:j,parentDataProperty:F},S){T.if((0,n._)`${j} !== undefined`,()=>T.assign((0,n._)`${j}[${F}]`,S))}function _(T,j,F,S=l.Correct){const I=S===l.Correct?n.operators.EQ:n.operators.NEQ;let q;switch(T){case"null":return(0,n._)`${j} ${I} null`;case"array":q=(0,n._)`Array.isArray(${j})`;break;case"object":q=(0,n._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":q=G((0,n._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":q=G();break;default:return(0,n._)`typeof ${j} ${I} ${T}`}return S===l.Correct?q:(0,n.not)(q);function G(J=n.nil){return(0,n.and)((0,n._)`typeof ${j} == "number"`,J,F?(0,n._)`isFinite(${j})`:n.nil)}}e.checkDataType=_;function E(T,j,F,S){if(T.length===1)return _(T[0],j,F,S);let I;const q=(0,i.toHash)(T);if(q.array&&q.object){const G=(0,n._)`typeof ${j} != "object"`;I=q.null?G:(0,n._)`!${j} || ${G}`,delete q.null,delete q.array,delete q.object}else I=n.nil;q.number&&delete q.integer;for(const G in q)I=(0,n.and)(I,_(G,j,F,S));return I}e.checkDataTypes=E;const w={message:({schema:T})=>`must be ${T}`,params:({schema:T,schemaValue:j})=>typeof T=="string"?(0,n._)`{type: ${T}}`:(0,n._)`{type: ${j}}`};function g(T){const j=v(T);(0,s.reportError)(j,w)}e.reportTypeError=g;function v(T){const{gen:j,data:F,schema:S}=T,I=(0,i.schemaRefOrVal)(T,S,"type");return{gen:j,keyword:"type",data:F,schema:S.type,schemaCode:I,schemaValue:I,parentSchema:S,params:{},it:T}}})(Ut);var Ct={},Hn;function ho(){if(Hn)return Ct;Hn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.assignDefaults=void 0;const e=ee,t=ne;function r(n,i){const{properties:l,items:a}=n.schema;if(i==="object"&&l)for(const u in l)s(n,u,l[u].default);else i==="array"&&Array.isArray(a)&&a.forEach((u,d)=>s(n,d,u.default))}Ct.assignDefaults=r;function s(n,i,l){const{gen:a,compositeRule:u,data:d,opts:f}=n;if(l===void 0)return;const y=(0,e._)`${d}${(0,e.getProperty)(i)}`;if(u){(0,t.checkStrictMode)(n,`default is ignored for: ${y}`);return}let P=(0,e._)`${y} === undefined`;f.useDefaults==="empty"&&(P=(0,e._)`${P} || ${y} === null || ${y} === ""`),a.if(P,(0,e._)`${y} = ${(0,e.stringify)(l)}`)}return Ct}var Me={},X={};Object.defineProperty(X,"__esModule",{value:!0});X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const le=ee,Br=ne,rt=Ke,mo=ne;function yo(e,t){const{gen:r,data:s,it:n}=e;r.if(Gr(r,s,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:(0,le._)`${t}`},!0),e.error()})}X.checkReportMissingProp=yo;function go({gen:e,data:t,it:{opts:r}},s,n){return(0,le.or)(...s.map(i=>(0,le.and)(Gr(e,t,i,r.ownProperties),(0,le._)`${n} = ${i}`)))}X.checkMissingProp=go;function $o(e,t){e.setParams({missingProperty:t},!0),e.error()}X.reportMissingProp=$o;function Bs(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,le._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=Bs;function Hr(e,t,r){return(0,le._)`${Bs(e)}.call(${t}, ${r})`}X.isOwnProperty=Hr;function _o(e,t,r,s){const n=(0,le._)`${t}${(0,le.getProperty)(r)} !== undefined`;return s?(0,le._)`${n} && ${Hr(e,t,r)}`:n}X.propertyInData=_o;function Gr(e,t,r,s){const n=(0,le._)`${t}${(0,le.getProperty)(r)} === undefined`;return s?(0,le.or)(n,(0,le.not)(Hr(e,t,r))):n}X.noPropertyInData=Gr;function Hs(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}X.allSchemaProperties=Hs;function vo(e,t){return Hs(t).filter(r=>!(0,Br.alwaysValidSchema)(e,t[r]))}X.schemaProperties=vo;function wo({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:i},it:l},a,u,d){const f=d?(0,le._)`${e}, ${t}, ${s}${n}`:t,y=[[rt.default.instancePath,(0,le.strConcat)(rt.default.instancePath,i)],[rt.default.parentData,l.parentData],[rt.default.parentDataProperty,l.parentDataProperty],[rt.default.rootData,rt.default.rootData]];l.opts.dynamicRef&&y.push([rt.default.dynamicAnchors,rt.default.dynamicAnchors]);const P=(0,le._)`${f}, ${r.object(...y)}`;return u!==le.nil?(0,le._)`${a}.call(${u}, ${P})`:(0,le._)`${a}(${P})`}X.callValidateCode=wo;const bo=(0,le._)`new RegExp`;function Eo({gen:e,it:{opts:t}},r){const s=t.unicodeRegExp?"u":"",{regExp:n}=t.code,i=n(r,s);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,le._)`${n.code==="new RegExp"?bo:(0,mo.useFunc)(e,n)}(${r}, ${s})`})}X.usePattern=Eo;function Po(e){const{gen:t,data:r,keyword:s,it:n}=e,i=t.name("valid");if(n.allErrors){const a=t.let("valid",!0);return l(()=>t.assign(a,!1)),a}return t.var(i,!0),l(()=>t.break()),i;function l(a){const u=t.const("len",(0,le._)`${r}.length`);t.forRange("i",0,u,d=>{e.subschema({keyword:s,dataProp:d,dataPropType:Br.Type.Num},i),t.if((0,le.not)(i),a)})}}X.validateArray=Po;function So(e){const{gen:t,schema:r,keyword:s,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Br.alwaysValidSchema)(n,u))&&!n.opts.unevaluated)return;const l=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((u,d)=>{const f=e.subschema({keyword:s,schemaProp:d,compositeRule:!0},a);t.assign(l,(0,le._)`${l} || ${a}`),e.mergeValidEvaluated(f,a)||t.if((0,le.not)(l))})),e.result(l,()=>e.reset(),()=>e.error(!0))}X.validateUnion=So;var Gn;function To(){if(Gn)return Me;Gn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.validateKeywordUsage=Me.validSchemaType=Me.funcKeywordCode=Me.macroKeywordCode=void 0;const e=ee,t=Ke,r=X,s=Vt;function n(P,b){const{gen:_,keyword:E,schema:w,parentSchema:g,it:v}=P,T=b.macro.call(v.self,w,g,v),j=d(_,E,T);v.opts.validateSchema!==!1&&v.self.validateSchema(T,!0);const F=_.name("valid");P.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${v.errSchemaPath}/${E}`,topSchemaRef:j,compositeRule:!0},F),P.pass(F,()=>P.error(!0))}Me.macroKeywordCode=n;function i(P,b){var _;const{gen:E,keyword:w,schema:g,parentSchema:v,$data:T,it:j}=P;u(j,b);const F=!T&&b.compile?b.compile.call(j.self,g,v,j):b.validate,S=d(E,w,F),I=E.let("valid");P.block$data(I,q),P.ok((_=b.valid)!==null&&_!==void 0?_:I);function q(){if(b.errors===!1)ie(),b.modifying&&l(P),Q(()=>P.error());else{const oe=b.async?G():J();b.modifying&&l(P),Q(()=>a(P,oe))}}function G(){const oe=E.let("ruleErrs",null);return E.try(()=>ie((0,e._)`await `),se=>E.assign(I,!1).if((0,e._)`${se} instanceof ${j.ValidationError}`,()=>E.assign(oe,(0,e._)`${se}.errors`),()=>E.throw(se))),oe}function J(){const oe=(0,e._)`${S}.errors`;return E.assign(oe,null),ie(e.nil),oe}function ie(oe=b.async?(0,e._)`await `:e.nil){const se=j.opts.passContext?t.default.this:t.default.self,Ae=!("compile"in b&&!T||b.schema===!1);E.assign(I,(0,e._)`${oe}${(0,r.callValidateCode)(P,S,se,Ae)}`,b.modifying)}function Q(oe){var se;E.if((0,e.not)((se=b.valid)!==null&&se!==void 0?se:I),oe)}}Me.funcKeywordCode=i;function l(P){const{gen:b,data:_,it:E}=P;b.if(E.parentData,()=>b.assign(_,(0,e._)`${E.parentData}[${E.parentDataProperty}]`))}function a(P,b){const{gen:_}=P;_.if((0,e._)`Array.isArray(${b})`,()=>{_.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${b} : ${t.default.vErrors}.concat(${b})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,s.extendErrors)(P)},()=>P.error())}function u({schemaEnv:P},b){if(b.async&&!P.$async)throw new Error("async keyword in sync schema")}function d(P,b,_){if(_===void 0)throw new Error(`keyword "${b}" failed to compile`);return P.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,e.stringify)(_)})}function f(P,b,_=!1){return!b.length||b.some(E=>E==="array"?Array.isArray(P):E==="object"?P&&typeof P=="object"&&!Array.isArray(P):typeof P==E||_&&typeof P>"u")}Me.validSchemaType=f;function y({schema:P,opts:b,self:_,errSchemaPath:E},w,g){if(Array.isArray(w.keyword)?!w.keyword.includes(g):w.keyword!==g)throw new Error("ajv implementation error");const v=w.dependencies;if(v!=null&&v.some(T=>!Object.prototype.hasOwnProperty.call(P,T)))throw new Error(`parent schema must have dependencies of ${g}: ${v.join(",")}`);if(w.validateSchema&&!w.validateSchema(P[g])){const j=`keyword "${g}" value is invalid at path "${E}": `+_.errorsText(w.validateSchema.errors);if(b.validateSchema==="log")_.logger.error(j);else throw new Error(j)}}return Me.validateKeywordUsage=y,Me}var Ye={},xn;function Ro(){if(xn)return Ye;xn=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.extendSubschemaMode=Ye.extendSubschemaData=Ye.getSubschema=void 0;const e=ee,t=ne;function r(i,{keyword:l,schemaProp:a,schema:u,schemaPath:d,errSchemaPath:f,topSchemaRef:y}){if(l!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){const P=i.schema[l];return a===void 0?{schema:P,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${i.errSchemaPath}/${l}`}:{schema:P[a],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${l}/${(0,t.escapeFragment)(a)}`}}if(u!==void 0){if(d===void 0||f===void 0||y===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:d,topSchemaRef:y,errSchemaPath:f}}throw new Error('either "keyword" or "schema" must be passed')}Ye.getSubschema=r;function s(i,l,{dataProp:a,dataPropType:u,data:d,dataTypes:f,propertyName:y}){if(d!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:P}=l;if(a!==void 0){const{errorPath:_,dataPathArr:E,opts:w}=l,g=P.let("data",(0,e._)`${l.data}${(0,e.getProperty)(a)}`,!0);b(g),i.errorPath=(0,e.str)`${_}${(0,t.getErrorPath)(a,u,w.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${a}`,i.dataPathArr=[...E,i.parentDataProperty]}if(d!==void 0){const _=d instanceof e.Name?d:P.let("data",d,!0);b(_),y!==void 0&&(i.propertyName=y)}f&&(i.dataTypes=f);function b(_){i.data=_,i.dataLevel=l.dataLevel+1,i.dataTypes=[],l.definedProperties=new Set,i.parentData=l.data,i.dataNames=[...l.dataNames,_]}}Ye.extendSubschemaData=s;function n(i,{jtdDiscriminator:l,jtdMetadata:a,compositeRule:u,createErrors:d,allErrors:f}){u!==void 0&&(i.compositeRule=u),d!==void 0&&(i.createErrors=d),f!==void 0&&(i.allErrors=f),i.jtdDiscriminator=l,i.jtdMetadata=a}return Ye.extendSubschemaMode=n,Ye}var Pe={},Gs=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,n,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=s;n--!==0;){var l=i[n];if(!e(t[l],r[l]))return!1}return!0}return t!==t&&r!==r},xs={exports:{}},st=xs.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var s=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};tr(t,s,n,e,"",e)};st.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};st.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};st.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};st.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function tr(e,t,r,s,n,i,l,a,u,d){if(s&&typeof s=="object"&&!Array.isArray(s)){t(s,n,i,l,a,u,d);for(var f in s){var y=s[f];if(Array.isArray(y)){if(f in st.arrayKeywords)for(var P=0;P<y.length;P++)tr(e,t,r,y[P],n+"/"+f+"/"+P,i,n,f,s,P)}else if(f in st.propsKeywords){if(y&&typeof y=="object")for(var b in y)tr(e,t,r,y[b],n+"/"+f+"/"+ko(b),i,n,f,s,b)}else(f in st.keywords||e.allKeys&&!(f in st.skipKeywords))&&tr(e,t,r,y,n+"/"+f,i,n,f,s)}r(s,n,i,l,a,u,d)}}function ko(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var Oo=xs.exports;Object.defineProperty(Pe,"__esModule",{value:!0});Pe.getSchemaRefs=Pe.resolveUrl=Pe.normalizeId=Pe._getFullPath=Pe.getFullPath=Pe.inlineRef=void 0;const No=ne,Co=Gs,Io=Oo,jo=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Do(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Cr(e):t?Ks(e)<=t:!1}Pe.inlineRef=Do;const Ao=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Cr(e){for(const t in e){if(Ao.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Cr)||typeof r=="object"&&Cr(r))return!0}return!1}function Ks(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!jo.has(r)&&(typeof e[r]=="object"&&(0,No.eachItem)(e[r],s=>t+=Ks(s)),t===1/0))return 1/0}return t}function Js(e,t="",r){r!==!1&&(t=bt(t));const s=e.parse(t);return Qs(e,s)}Pe.getFullPath=Js;function Qs(e,t){return e.serialize(t).split("#")[0]+"#"}Pe._getFullPath=Qs;const Mo=/#\/?$/;function bt(e){return e?e.replace(Mo,""):""}Pe.normalizeId=bt;function Fo(e,t,r){return r=bt(r),e.resolve(t,r)}Pe.resolveUrl=Fo;const qo=/^[a-z_][-a-z0-9._]*$/i;function Lo(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:s}=this.opts,n=bt(e[r]||t),i={"":n},l=Js(s,n,!1),a={},u=new Set;return Io(e,{allKeys:!0},(y,P,b,_)=>{if(_===void 0)return;const E=l+P;let w=i[_];typeof y[r]=="string"&&(w=g.call(this,y[r])),v.call(this,y.$anchor),v.call(this,y.$dynamicAnchor),i[P]=w;function g(T){const j=this.opts.uriResolver.resolve;if(T=bt(w?j(w,T):T),u.has(T))throw f(T);u.add(T);let F=this.refs[T];return typeof F=="string"&&(F=this.refs[F]),typeof F=="object"?d(y,F.schema,T):T!==bt(E)&&(T[0]==="#"?(d(y,a[T],T),a[T]=y):this.refs[T]=E),T}function v(T){if(typeof T=="string"){if(!qo.test(T))throw new Error(`invalid anchor "${T}"`);g.call(this,`#${T}`)}}}),a;function d(y,P,b){if(P!==void 0&&!Co(y,P))throw f(b)}function f(y){return new Error(`reference "${y}" resolves to more than one schema`)}}Pe.getSchemaRefs=Lo;var Kn;function yr(){if(Kn)return Ze;Kn=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.getData=Ze.KeywordCxt=Ze.validateFunctionCode=void 0;const e=ao(),t=Ut,r=Xe,s=Ut,n=ho(),i=To(),l=Ro(),a=ee,u=Ke,d=Pe,f=ne,y=Vt;function P($){if(F($)&&(I($),j($))){w($);return}b($,()=>(0,e.topBoolOrEmptySchema)($))}Ze.validateFunctionCode=P;function b({gen:$,validateName:k,schema:A,schemaEnv:L,opts:W},x){W.code.es5?$.func(k,(0,a._)`${u.default.data}, ${u.default.valCxt}`,L.$async,()=>{$.code((0,a._)`"use strict"; ${v(A,W)}`),E($,W),$.code(x)}):$.func(k,(0,a._)`${u.default.data}, ${_(W)}`,L.$async,()=>$.code(v(A,W)).code(x))}function _($){return(0,a._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${$.dynamicRef?(0,a._)`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function E($,k){$.if(u.default.valCxt,()=>{$.var(u.default.instancePath,(0,a._)`${u.default.valCxt}.${u.default.instancePath}`),$.var(u.default.parentData,(0,a._)`${u.default.valCxt}.${u.default.parentData}`),$.var(u.default.parentDataProperty,(0,a._)`${u.default.valCxt}.${u.default.parentDataProperty}`),$.var(u.default.rootData,(0,a._)`${u.default.valCxt}.${u.default.rootData}`),k.dynamicRef&&$.var(u.default.dynamicAnchors,(0,a._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{$.var(u.default.instancePath,(0,a._)`""`),$.var(u.default.parentData,(0,a._)`undefined`),$.var(u.default.parentDataProperty,(0,a._)`undefined`),$.var(u.default.rootData,u.default.data),k.dynamicRef&&$.var(u.default.dynamicAnchors,(0,a._)`{}`)})}function w($){const{schema:k,opts:A,gen:L}=$;b($,()=>{A.$comment&&k.$comment&&oe($),J($),L.let(u.default.vErrors,null),L.let(u.default.errors,0),A.unevaluated&&g($),q($),se($)})}function g($){const{gen:k,validateName:A}=$;$.evaluated=k.const("evaluated",(0,a._)`${A}.evaluated`),k.if((0,a._)`${$.evaluated}.dynamicProps`,()=>k.assign((0,a._)`${$.evaluated}.props`,(0,a._)`undefined`)),k.if((0,a._)`${$.evaluated}.dynamicItems`,()=>k.assign((0,a._)`${$.evaluated}.items`,(0,a._)`undefined`))}function v($,k){const A=typeof $=="object"&&$[k.schemaId];return A&&(k.code.source||k.code.process)?(0,a._)`/*# sourceURL=${A} */`:a.nil}function T($,k){if(F($)&&(I($),j($))){S($,k);return}(0,e.boolOrEmptySchema)($,k)}function j({schema:$,self:k}){if(typeof $=="boolean")return!$;for(const A in $)if(k.RULES.all[A])return!0;return!1}function F($){return typeof $.schema!="boolean"}function S($,k){const{schema:A,gen:L,opts:W}=$;W.$comment&&A.$comment&&oe($),ie($),Q($);const x=L.const("_errs",u.default.errors);q($,x),L.var(k,(0,a._)`${x} === ${u.default.errors}`)}function I($){(0,f.checkUnknownRules)($),G($)}function q($,k){if($.opts.jtd)return Ue($,[],!1,k);const A=(0,t.getSchemaTypes)($.schema),L=(0,t.coerceAndCheckDataType)($,A);Ue($,A,!L,k)}function G($){const{schema:k,errSchemaPath:A,opts:L,self:W}=$;k.$ref&&L.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(k,W.RULES)&&W.logger.warn(`$ref: keywords ignored in schema at path "${A}"`)}function J($){const{schema:k,opts:A}=$;k.default!==void 0&&A.useDefaults&&A.strictSchema&&(0,f.checkStrictMode)($,"default is ignored in the schema root")}function ie($){const k=$.schema[$.opts.schemaId];k&&($.baseId=(0,d.resolveUrl)($.opts.uriResolver,$.baseId,k))}function Q($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function oe({gen:$,schemaEnv:k,schema:A,errSchemaPath:L,opts:W}){const x=A.$comment;if(W.$comment===!0)$.code((0,a._)`${u.default.self}.logger.log(${x})`);else if(typeof W.$comment=="function"){const $e=(0,a.str)`${L}/$comment`,Re=$.scopeValue("root",{ref:k.root});$.code((0,a._)`${u.default.self}.opts.$comment(${x}, ${$e}, ${Re}.schema)`)}}function se($){const{gen:k,schemaEnv:A,validateName:L,ValidationError:W,opts:x}=$;A.$async?k.if((0,a._)`${u.default.errors} === 0`,()=>k.return(u.default.data),()=>k.throw((0,a._)`new ${W}(${u.default.vErrors})`)):(k.assign((0,a._)`${L}.errors`,u.default.vErrors),x.unevaluated&&Ae($),k.return((0,a._)`${u.default.errors} === 0`))}function Ae({gen:$,evaluated:k,props:A,items:L}){A instanceof a.Name&&$.assign((0,a._)`${k}.props`,A),L instanceof a.Name&&$.assign((0,a._)`${k}.items`,L)}function Ue($,k,A,L){const{gen:W,schema:x,data:$e,allErrors:Re,opts:we,self:be}=$,{RULES:_e}=be;if(x.$ref&&(we.ignoreKeywordsWithRef||!(0,f.schemaHasRulesButRef)(x,_e))){W.block(()=>V($,"$ref",_e.all.$ref.definition));return}we.jtd||it($,k),W.block(()=>{for(const fe of _e.rules)Ne(fe);Ne(_e.post)});function Ne(fe){(0,r.shouldUseGroup)(x,fe)&&(fe.type?(W.if((0,s.checkDataType)(fe.type,$e,we.strictNumbers)),Je($,fe),k.length===1&&k[0]===fe.type&&A&&(W.else(),(0,s.reportTypeError)($)),W.endIf()):Je($,fe),Re||W.if((0,a._)`${u.default.errors} === ${L||0}`))}}function Je($,k){const{gen:A,schema:L,opts:{useDefaults:W}}=$;W&&(0,n.assignDefaults)($,k.type),A.block(()=>{for(const x of k.rules)(0,r.shouldUseRule)(L,x)&&V($,x.keyword,x.definition,k.type)})}function it($,k){$.schemaEnv.meta||!$.opts.strictTypes||(et($,k),$.opts.allowUnionTypes||U($,k),R($,$.dataTypes))}function et($,k){if(k.length){if(!$.dataTypes.length){$.dataTypes=k;return}k.forEach(A=>{O($.dataTypes,A)||h($,`type "${A}" not allowed by context "${$.dataTypes.join(",")}"`)}),o($,k)}}function U($,k){k.length>1&&!(k.length===2&&k.includes("null"))&&h($,"use allowUnionTypes to allow union type keyword")}function R($,k){const A=$.self.RULES.all;for(const L in A){const W=A[L];if(typeof W=="object"&&(0,r.shouldUseRule)($.schema,W)){const{type:x}=W.definition;x.length&&!x.some($e=>M(k,$e))&&h($,`missing type "${x.join(",")}" for keyword "${L}"`)}}}function M($,k){return $.includes(k)||k==="number"&&$.includes("integer")}function O($,k){return $.includes(k)||k==="integer"&&$.includes("number")}function o($,k){const A=[];for(const L of $.dataTypes)O(k,L)?A.push(L):k.includes("integer")&&L==="number"&&A.push("integer");$.dataTypes=A}function h($,k){const A=$.schemaEnv.baseId+$.errSchemaPath;k+=` at "${A}" (strictTypes)`,(0,f.checkStrictMode)($,k,$.opts.strictTypes)}class D{constructor(k,A,L){if((0,i.validateKeywordUsage)(k,A,L),this.gen=k.gen,this.allErrors=k.allErrors,this.keyword=L,this.data=k.data,this.schema=k.schema[L],this.$data=A.$data&&k.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(k,this.schema,L,this.$data),this.schemaType=A.schemaType,this.parentSchema=k.schema,this.params={},this.it=k,this.def=A,this.$data)this.schemaCode=k.gen.const("vSchema",Y(this.$data,k));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,A.schemaType,A.allowUndefined))throw new Error(`${L} value must be ${JSON.stringify(A.schemaType)}`);("code"in A?A.trackErrors:A.errors!==!1)&&(this.errsCount=k.gen.const("_errs",u.default.errors))}result(k,A,L){this.failResult((0,a.not)(k),A,L)}failResult(k,A,L){this.gen.if(k),L?L():this.error(),A?(this.gen.else(),A(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(k,A){this.failResult((0,a.not)(k),void 0,A)}fail(k){if(k===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(k),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(k){if(!this.$data)return this.fail(k);const{schemaCode:A}=this;this.fail((0,a._)`${A} !== undefined && (${(0,a.or)(this.invalid$data(),k)})`)}error(k,A,L){if(A){this.setParams(A),this._error(k,L),this.setParams({});return}this._error(k,L)}_error(k,A){(k?y.reportExtraError:y.reportError)(this,this.def.error,A)}$dataError(){(0,y.reportError)(this,this.def.$dataError||y.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,y.resetErrorsCount)(this.gen,this.errsCount)}ok(k){this.allErrors||this.gen.if(k)}setParams(k,A){A?Object.assign(this.params,k):this.params=k}block$data(k,A,L=a.nil){this.gen.block(()=>{this.check$data(k,L),A()})}check$data(k=a.nil,A=a.nil){if(!this.$data)return;const{gen:L,schemaCode:W,schemaType:x,def:$e}=this;L.if((0,a.or)((0,a._)`${W} === undefined`,A)),k!==a.nil&&L.assign(k,!0),(x.length||$e.validateSchema)&&(L.elseIf(this.invalid$data()),this.$dataError(),k!==a.nil&&L.assign(k,!1)),L.else()}invalid$data(){const{gen:k,schemaCode:A,schemaType:L,def:W,it:x}=this;return(0,a.or)($e(),Re());function $e(){if(L.length){if(!(A instanceof a.Name))throw new Error("ajv implementation error");const we=Array.isArray(L)?L:[L];return(0,a._)`${(0,s.checkDataTypes)(we,A,x.opts.strictNumbers,s.DataType.Wrong)}`}return a.nil}function Re(){if(W.validateSchema){const we=k.scopeValue("validate$data",{ref:W.validateSchema});return(0,a._)`!${we}(${A})`}return a.nil}}subschema(k,A){const L=(0,l.getSubschema)(this.it,k);(0,l.extendSubschemaData)(L,this.it,k),(0,l.extendSubschemaMode)(L,k);const W={...this.it,...L,items:void 0,props:void 0};return T(W,A),W}mergeEvaluated(k,A){const{it:L,gen:W}=this;L.opts.unevaluated&&(L.props!==!0&&k.props!==void 0&&(L.props=f.mergeEvaluated.props(W,k.props,L.props,A)),L.items!==!0&&k.items!==void 0&&(L.items=f.mergeEvaluated.items(W,k.items,L.items,A)))}mergeValidEvaluated(k,A){const{it:L,gen:W}=this;if(L.opts.unevaluated&&(L.props!==!0||L.items!==!0))return W.if(A,()=>this.mergeEvaluated(k,a.Name)),!0}}Ze.KeywordCxt=D;function V($,k,A,L){const W=new D($,A,k);"code"in A?A.code(W,L):W.$data&&A.validate?(0,i.funcKeywordCode)(W,A):"macro"in A?(0,i.macroKeywordCode)(W,A):(A.compile||A.validate)&&(0,i.funcKeywordCode)(W,A)}const z=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y($,{dataLevel:k,dataNames:A,dataPathArr:L}){let W,x;if($==="")return u.default.rootData;if($[0]==="/"){if(!z.test($))throw new Error(`Invalid JSON-pointer: ${$}`);W=$,x=u.default.rootData}else{const be=Z.exec($);if(!be)throw new Error(`Invalid JSON-pointer: ${$}`);const _e=+be[1];if(W=be[2],W==="#"){if(_e>=k)throw new Error(we("property/index",_e));return L[k-_e]}if(_e>k)throw new Error(we("data",_e));if(x=A[k-_e],!W)return x}let $e=x;const Re=W.split("/");for(const be of Re)be&&(x=(0,a._)`${x}${(0,a.getProperty)((0,f.unescapeJsonPointer)(be))}`,$e=(0,a._)`${$e} && ${x}`);return $e;function we(be,_e){return`Cannot access ${be} ${_e} levels up, current level is ${k}`}}return Ze.getData=Y,Ze}var Kt={},Jn;function xr(){if(Jn)return Kt;Jn=1,Object.defineProperty(Kt,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Kt.default=e,Kt}var zt={};Object.defineProperty(zt,"__esModule",{value:!0});const Er=Pe;class Uo extends Error{constructor(t,r,s,n){super(n||`can't resolve reference ${s} from id ${r}`),this.missingRef=(0,Er.resolveUrl)(t,r,s),this.missingSchema=(0,Er.normalizeId)((0,Er.getFullPath)(t,this.missingRef))}}zt.default=Uo;var Oe={};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.resolveSchema=Oe.getCompilingSchema=Oe.resolveRef=Oe.compileSchema=Oe.SchemaEnv=void 0;const Fe=ee,Vo=xr(),dt=Ke,Le=Pe,Qn=ne,zo=yr();class gr{constructor(t){var r;this.refs={},this.dynamicAnchors={};let s;typeof t.schema=="object"&&(s=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Le.normalizeId)(s==null?void 0:s[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=s==null?void 0:s.$async,this.refs={}}}Oe.SchemaEnv=gr;function Kr(e){const t=Zs.call(this,e);if(t)return t;const r=(0,Le.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:n}=this.opts.code,{ownProperties:i}=this.opts,l=new Fe.CodeGen(this.scope,{es5:s,lines:n,ownProperties:i});let a;e.$async&&(a=l.scopeValue("Error",{ref:Vo.default,code:(0,Fe._)`require("ajv/dist/runtime/validation_error").default`}));const u=l.scopeName("validate");e.validateName=u;const d={gen:l,allErrors:this.opts.allErrors,data:dt.default.data,parentData:dt.default.parentData,parentDataProperty:dt.default.parentDataProperty,dataNames:[dt.default.data],dataPathArr:[Fe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Fe.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Fe.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Fe._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,zo.validateFunctionCode)(d),l.optimize(this.opts.code.optimize);const y=l.toString();f=`${l.scopeRefs(dt.default.scope)}return ${y}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const b=new Function(`${dt.default.self}`,`${dt.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:b}),b.errors=null,b.schema=e.schema,b.schemaEnv=e,e.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:u,validateCode:y,scopeValues:l._values}),this.opts.unevaluated){const{props:_,items:E}=d;b.evaluated={props:_ instanceof Fe.Name?void 0:_,items:E instanceof Fe.Name?void 0:E,dynamicProps:_ instanceof Fe.Name,dynamicItems:E instanceof Fe.Name},b.source&&(b.source.evaluated=(0,Fe.stringify)(b.evaluated))}return e.validate=b,e}catch(y){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),y}finally{this._compilations.delete(e)}}Oe.compileSchema=Kr;function Wo(e,t,r){var s;r=(0,Le.resolveUrl)(this.opts.uriResolver,t,r);const n=e.refs[r];if(n)return n;let i=Go.call(this,e,r);if(i===void 0){const l=(s=e.localRefs)===null||s===void 0?void 0:s[r],{schemaId:a}=this.opts;l&&(i=new gr({schema:l,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Bo.call(this,i)}Oe.resolveRef=Wo;function Bo(e){return(0,Le.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Kr.call(this,e)}function Zs(e){for(const t of this._compilations)if(Ho(t,e))return t}Oe.getCompilingSchema=Zs;function Ho(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Go(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||$r.call(this,e,t)}function $r(e,t){const r=this.opts.uriResolver.parse(t),s=(0,Le._getFullPath)(this.opts.uriResolver,r);let n=(0,Le.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===n)return Pr.call(this,r,e);const i=(0,Le.normalizeId)(s),l=this.refs[i]||this.schemas[i];if(typeof l=="string"){const a=$r.call(this,e,l);return typeof(a==null?void 0:a.schema)!="object"?void 0:Pr.call(this,r,a)}if(typeof(l==null?void 0:l.schema)=="object"){if(l.validate||Kr.call(this,l),i===(0,Le.normalizeId)(t)){const{schema:a}=l,{schemaId:u}=this.opts,d=a[u];return d&&(n=(0,Le.resolveUrl)(this.opts.uriResolver,n,d)),new gr({schema:a,schemaId:u,root:e,baseId:n})}return Pr.call(this,r,l)}}Oe.resolveSchema=$r;const xo=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Pr(e,{baseId:t,schema:r,root:s}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const u=r[(0,Qn.unescapeFragment)(a)];if(u===void 0)return;r=u;const d=typeof r=="object"&&r[this.opts.schemaId];!xo.has(a)&&d&&(t=(0,Le.resolveUrl)(this.opts.uriResolver,t,d))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Qn.schemaHasRulesButRef)(r,this.RULES)){const a=(0,Le.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=$r.call(this,s,a)}const{schemaId:l}=this.opts;if(i=i||new gr({schema:r,schemaId:l,root:s,baseId:t}),i.schema!==i.root.schema)return i}const Ko="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Jo="Meta-schema for $data reference (JSON AnySchema extension proposal)",Qo="object",Zo=["$data"],Yo={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Xo=!1,ea={$id:Ko,description:Jo,type:Qo,required:Zo,properties:Yo,additionalProperties:Xo};var Jr={},Ir={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(r,s){s(t)})(xi,function(r){function s(){for(var p=arguments.length,c=Array(p),m=0;m<p;m++)c[m]=arguments[m];if(c.length>1){c[0]=c[0].slice(0,-1);for(var C=c.length-1,N=1;N<C;++N)c[N]=c[N].slice(1,-1);return c[C]=c[C].slice(1),c.join("")}else return c[0]}function n(p){return"(?:"+p+")"}function i(p){return p===void 0?"undefined":p===null?"null":Object.prototype.toString.call(p).split(" ").pop().split("]").shift().toLowerCase()}function l(p){return p.toUpperCase()}function a(p){return p!=null?p instanceof Array?p:typeof p.length!="number"||p.split||p.setInterval||p.call?[p]:Array.prototype.slice.call(p):[]}function u(p,c){var m=p;if(c)for(var C in c)m[C]=c[C];return m}function d(p){var c="[A-Za-z]",m="[0-9]",C=s(m,"[A-Fa-f]"),N=n(n("%[EFef]"+C+"%"+C+C+"%"+C+C)+"|"+n("%[89A-Fa-f]"+C+"%"+C+C)+"|"+n("%"+C+C)),B="[\\:\\/\\?\\#\\[\\]\\@]",H="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",re=s(B,H),ce=p?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",pe=p?"[\\uE000-\\uF8FF]":"[]",te=s(c,m,"[\\-\\.\\_\\~]",ce);n(c+s(c,m,"[\\+\\-\\.]")+"*"),n(n(N+"|"+s(te,H,"[\\:]"))+"*");var ae=n(n("25[0-5]")+"|"+n("2[0-4]"+m)+"|"+n("1"+m+m)+"|"+n("0?[1-9]"+m)+"|0?0?"+m),he=n(ae+"\\."+ae+"\\."+ae+"\\."+ae),K=n(C+"{1,4}"),ue=n(n(K+"\\:"+K)+"|"+he),ge=n(n(K+"\\:")+"{6}"+ue),de=n("\\:\\:"+n(K+"\\:")+"{5}"+ue),tt=n(n(K)+"?\\:\\:"+n(K+"\\:")+"{4}"+ue),ze=n(n(n(K+"\\:")+"{0,1}"+K)+"?\\:\\:"+n(K+"\\:")+"{3}"+ue),We=n(n(n(K+"\\:")+"{0,2}"+K)+"?\\:\\:"+n(K+"\\:")+"{2}"+ue),_t=n(n(n(K+"\\:")+"{0,3}"+K)+"?\\:\\:"+K+"\\:"+ue),ct=n(n(n(K+"\\:")+"{0,4}"+K)+"?\\:\\:"+ue),Ie=n(n(n(K+"\\:")+"{0,5}"+K)+"?\\:\\:"+K),Be=n(n(n(K+"\\:")+"{0,6}"+K)+"?\\:\\:"),lt=n([ge,de,tt,ze,We,_t,ct,Ie,Be].join("|")),Qe=n(n(te+"|"+N)+"+");n("[vV]"+C+"+\\."+s(te,H,"[\\:]")+"+"),n(n(N+"|"+s(te,H))+"*");var Ot=n(N+"|"+s(te,H,"[\\:\\@]"));return n(n(N+"|"+s(te,H,"[\\@]"))+"+"),n(n(Ot+"|"+s("[\\/\\?]",pe))+"*"),{NOT_SCHEME:new RegExp(s("[^]",c,m,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(s("[^\\%\\:]",te,H),"g"),NOT_HOST:new RegExp(s("[^\\%\\[\\]\\:]",te,H),"g"),NOT_PATH:new RegExp(s("[^\\%\\/\\:\\@]",te,H),"g"),NOT_PATH_NOSCHEME:new RegExp(s("[^\\%\\/\\@]",te,H),"g"),NOT_QUERY:new RegExp(s("[^\\%]",te,H,"[\\:\\@\\/\\?]",pe),"g"),NOT_FRAGMENT:new RegExp(s("[^\\%]",te,H,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(s("[^]",te,H),"g"),UNRESERVED:new RegExp(te,"g"),OTHER_CHARS:new RegExp(s("[^\\%]",te,re),"g"),PCT_ENCODED:new RegExp(N,"g"),IPV4ADDRESS:new RegExp("^("+he+")$"),IPV6ADDRESS:new RegExp("^\\[?("+lt+")"+n(n("\\%25|\\%(?!"+C+"{2})")+"("+Qe+")")+"?\\]?$")}}var f=d(!1),y=d(!0),P=function(){function p(c,m){var C=[],N=!0,B=!1,H=void 0;try{for(var re=c[Symbol.iterator](),ce;!(N=(ce=re.next()).done)&&(C.push(ce.value),!(m&&C.length===m));N=!0);}catch(pe){B=!0,H=pe}finally{try{!N&&re.return&&re.return()}finally{if(B)throw H}}return C}return function(c,m){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return p(c,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(p){if(Array.isArray(p)){for(var c=0,m=Array(p.length);c<p.length;c++)m[c]=p[c];return m}else return Array.from(p)},_=2147483647,E=36,w=1,g=26,v=38,T=700,j=72,F=128,S="-",I=/^xn--/,q=/[^\0-\x7E]/,G=/[\x2E\u3002\uFF0E\uFF61]/g,J={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ie=E-w,Q=Math.floor,oe=String.fromCharCode;function se(p){throw new RangeError(J[p])}function Ae(p,c){for(var m=[],C=p.length;C--;)m[C]=c(p[C]);return m}function Ue(p,c){var m=p.split("@"),C="";m.length>1&&(C=m[0]+"@",p=m[1]),p=p.replace(G,".");var N=p.split("."),B=Ae(N,c).join(".");return C+B}function Je(p){for(var c=[],m=0,C=p.length;m<C;){var N=p.charCodeAt(m++);if(N>=55296&&N<=56319&&m<C){var B=p.charCodeAt(m++);(B&64512)==56320?c.push(((N&1023)<<10)+(B&1023)+65536):(c.push(N),m--)}else c.push(N)}return c}var it=function(c){return String.fromCodePoint.apply(String,b(c))},et=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:E},U=function(c,m){return c+22+75*(c<26)-((m!=0)<<5)},R=function(c,m,C){var N=0;for(c=C?Q(c/T):c>>1,c+=Q(c/m);c>ie*g>>1;N+=E)c=Q(c/ie);return Q(N+(ie+1)*c/(c+v))},M=function(c){var m=[],C=c.length,N=0,B=F,H=j,re=c.lastIndexOf(S);re<0&&(re=0);for(var ce=0;ce<re;++ce)c.charCodeAt(ce)>=128&&se("not-basic"),m.push(c.charCodeAt(ce));for(var pe=re>0?re+1:0;pe<C;){for(var te=N,ae=1,he=E;;he+=E){pe>=C&&se("invalid-input");var K=et(c.charCodeAt(pe++));(K>=E||K>Q((_-N)/ae))&&se("overflow"),N+=K*ae;var ue=he<=H?w:he>=H+g?g:he-H;if(K<ue)break;var ge=E-ue;ae>Q(_/ge)&&se("overflow"),ae*=ge}var de=m.length+1;H=R(N-te,de,te==0),Q(N/de)>_-B&&se("overflow"),B+=Q(N/de),N%=de,m.splice(N++,0,B)}return String.fromCodePoint.apply(String,m)},O=function(c){var m=[];c=Je(c);var C=c.length,N=F,B=0,H=j,re=!0,ce=!1,pe=void 0;try{for(var te=c[Symbol.iterator](),ae;!(re=(ae=te.next()).done);re=!0){var he=ae.value;he<128&&m.push(oe(he))}}catch(Nt){ce=!0,pe=Nt}finally{try{!re&&te.return&&te.return()}finally{if(ce)throw pe}}var K=m.length,ue=K;for(K&&m.push(S);ue<C;){var ge=_,de=!0,tt=!1,ze=void 0;try{for(var We=c[Symbol.iterator](),_t;!(de=(_t=We.next()).done);de=!0){var ct=_t.value;ct>=N&&ct<ge&&(ge=ct)}}catch(Nt){tt=!0,ze=Nt}finally{try{!de&&We.return&&We.return()}finally{if(tt)throw ze}}var Ie=ue+1;ge-N>Q((_-B)/Ie)&&se("overflow"),B+=(ge-N)*Ie,N=ge;var Be=!0,lt=!1,Qe=void 0;try{for(var Ot=c[Symbol.iterator](),Mn;!(Be=(Mn=Ot.next()).done);Be=!0){var Fn=Mn.value;if(Fn<N&&++B>_&&se("overflow"),Fn==N){for(var Ht=B,Gt=E;;Gt+=E){var xt=Gt<=H?w:Gt>=H+g?g:Gt-H;if(Ht<xt)break;var qn=Ht-xt,Ln=E-xt;m.push(oe(U(xt+qn%Ln,0))),Ht=Q(qn/Ln)}m.push(oe(U(Ht,0))),H=R(B,Ie,ue==K),B=0,++ue}}}catch(Nt){lt=!0,Qe=Nt}finally{try{!Be&&Ot.return&&Ot.return()}finally{if(lt)throw Qe}}++B,++N}return m.join("")},o=function(c){return Ue(c,function(m){return I.test(m)?M(m.slice(4).toLowerCase()):m})},h=function(c){return Ue(c,function(m){return q.test(m)?"xn--"+O(m):m})},D={version:"2.1.0",ucs2:{decode:Je,encode:it},decode:M,encode:O,toASCII:h,toUnicode:o},V={};function z(p){var c=p.charCodeAt(0),m=void 0;return c<16?m="%0"+c.toString(16).toUpperCase():c<128?m="%"+c.toString(16).toUpperCase():c<2048?m="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase():m="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase(),m}function Z(p){for(var c="",m=0,C=p.length;m<C;){var N=parseInt(p.substr(m+1,2),16);if(N<128)c+=String.fromCharCode(N),m+=3;else if(N>=194&&N<224){if(C-m>=6){var B=parseInt(p.substr(m+4,2),16);c+=String.fromCharCode((N&31)<<6|B&63)}else c+=p.substr(m,6);m+=6}else if(N>=224){if(C-m>=9){var H=parseInt(p.substr(m+4,2),16),re=parseInt(p.substr(m+7,2),16);c+=String.fromCharCode((N&15)<<12|(H&63)<<6|re&63)}else c+=p.substr(m,9);m+=9}else c+=p.substr(m,3),m+=3}return c}function Y(p,c){function m(C){var N=Z(C);return N.match(c.UNRESERVED)?N:C}return p.scheme&&(p.scheme=String(p.scheme).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_SCHEME,"")),p.userinfo!==void 0&&(p.userinfo=String(p.userinfo).replace(c.PCT_ENCODED,m).replace(c.NOT_USERINFO,z).replace(c.PCT_ENCODED,l)),p.host!==void 0&&(p.host=String(p.host).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_HOST,z).replace(c.PCT_ENCODED,l)),p.path!==void 0&&(p.path=String(p.path).replace(c.PCT_ENCODED,m).replace(p.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,z).replace(c.PCT_ENCODED,l)),p.query!==void 0&&(p.query=String(p.query).replace(c.PCT_ENCODED,m).replace(c.NOT_QUERY,z).replace(c.PCT_ENCODED,l)),p.fragment!==void 0&&(p.fragment=String(p.fragment).replace(c.PCT_ENCODED,m).replace(c.NOT_FRAGMENT,z).replace(c.PCT_ENCODED,l)),p}function $(p){return p.replace(/^0*(.*)/,"$1")||"0"}function k(p,c){var m=p.match(c.IPV4ADDRESS)||[],C=P(m,2),N=C[1];return N?N.split(".").map($).join("."):p}function A(p,c){var m=p.match(c.IPV6ADDRESS)||[],C=P(m,3),N=C[1],B=C[2];if(N){for(var H=N.toLowerCase().split("::").reverse(),re=P(H,2),ce=re[0],pe=re[1],te=pe?pe.split(":").map($):[],ae=ce.split(":").map($),he=c.IPV4ADDRESS.test(ae[ae.length-1]),K=he?7:8,ue=ae.length-K,ge=Array(K),de=0;de<K;++de)ge[de]=te[de]||ae[ue+de]||"";he&&(ge[K-1]=k(ge[K-1],c));var tt=ge.reduce(function(Ie,Be,lt){if(!Be||Be==="0"){var Qe=Ie[Ie.length-1];Qe&&Qe.index+Qe.length===lt?Qe.length++:Ie.push({index:lt,length:1})}return Ie},[]),ze=tt.sort(function(Ie,Be){return Be.length-Ie.length})[0],We=void 0;if(ze&&ze.length>1){var _t=ge.slice(0,ze.index),ct=ge.slice(ze.index+ze.length);We=_t.join(":")+"::"+ct.join(":")}else We=ge.join(":");return B&&(We+="%"+B),We}else return p}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,W="".match(/(){0}/)[1]===void 0;function x(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m={},C=c.iri!==!1?y:f;c.reference==="suffix"&&(p=(c.scheme?c.scheme+":":"")+"//"+p);var N=p.match(L);if(N){W?(m.scheme=N[1],m.userinfo=N[3],m.host=N[4],m.port=parseInt(N[5],10),m.path=N[6]||"",m.query=N[7],m.fragment=N[8],isNaN(m.port)&&(m.port=N[5])):(m.scheme=N[1]||void 0,m.userinfo=p.indexOf("@")!==-1?N[3]:void 0,m.host=p.indexOf("//")!==-1?N[4]:void 0,m.port=parseInt(N[5],10),m.path=N[6]||"",m.query=p.indexOf("?")!==-1?N[7]:void 0,m.fragment=p.indexOf("#")!==-1?N[8]:void 0,isNaN(m.port)&&(m.port=p.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?N[4]:void 0)),m.host&&(m.host=A(k(m.host,C),C)),m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&!m.path&&m.query===void 0?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference="uri",c.reference&&c.reference!=="suffix"&&c.reference!==m.reference&&(m.error=m.error||"URI is not a "+c.reference+" reference.");var B=V[(c.scheme||m.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!B||!B.unicodeSupport)){if(m.host&&(c.domainHost||B&&B.domainHost))try{m.host=D.toASCII(m.host.replace(C.PCT_ENCODED,Z).toLowerCase())}catch(H){m.error=m.error||"Host's domain name can not be converted to ASCII via punycode: "+H}Y(m,f)}else Y(m,C);B&&B.parse&&B.parse(m,c)}else m.error=m.error||"URI can not be parsed.";return m}function $e(p,c){var m=c.iri!==!1?y:f,C=[];return p.userinfo!==void 0&&(C.push(p.userinfo),C.push("@")),p.host!==void 0&&C.push(A(k(String(p.host),m),m).replace(m.IPV6ADDRESS,function(N,B,H){return"["+B+(H?"%25"+H:"")+"]"})),(typeof p.port=="number"||typeof p.port=="string")&&(C.push(":"),C.push(String(p.port))),C.length?C.join(""):void 0}var Re=/^\.\.?\//,we=/^\/\.(\/|$)/,be=/^\/\.\.(\/|$)/,_e=/^\/?(?:.|\n)*?(?=\/|$)/;function Ne(p){for(var c=[];p.length;)if(p.match(Re))p=p.replace(Re,"");else if(p.match(we))p=p.replace(we,"/");else if(p.match(be))p=p.replace(be,"/"),c.pop();else if(p==="."||p==="..")p="";else{var m=p.match(_e);if(m){var C=m[0];p=p.slice(C.length),c.push(C)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function fe(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=c.iri?y:f,C=[],N=V[(c.scheme||p.scheme||"").toLowerCase()];if(N&&N.serialize&&N.serialize(p,c),p.host&&!m.IPV6ADDRESS.test(p.host)){if(c.domainHost||N&&N.domainHost)try{p.host=c.iri?D.toUnicode(p.host):D.toASCII(p.host.replace(m.PCT_ENCODED,Z).toLowerCase())}catch(re){p.error=p.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+re}}Y(p,m),c.reference!=="suffix"&&p.scheme&&(C.push(p.scheme),C.push(":"));var B=$e(p,c);if(B!==void 0&&(c.reference!=="suffix"&&C.push("//"),C.push(B),p.path&&p.path.charAt(0)!=="/"&&C.push("/")),p.path!==void 0){var H=p.path;!c.absolutePath&&(!N||!N.absolutePath)&&(H=Ne(H)),B===void 0&&(H=H.replace(/^\/\//,"/%2F")),C.push(H)}return p.query!==void 0&&(C.push("?"),C.push(p.query)),p.fragment!==void 0&&(C.push("#"),C.push(p.fragment)),C.join("")}function gt(p,c){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=arguments[3],N={};return C||(p=x(fe(p,m),m),c=x(fe(c,m),m)),m=m||{},!m.tolerant&&c.scheme?(N.scheme=c.scheme,N.userinfo=c.userinfo,N.host=c.host,N.port=c.port,N.path=Ne(c.path||""),N.query=c.query):(c.userinfo!==void 0||c.host!==void 0||c.port!==void 0?(N.userinfo=c.userinfo,N.host=c.host,N.port=c.port,N.path=Ne(c.path||""),N.query=c.query):(c.path?(c.path.charAt(0)==="/"?N.path=Ne(c.path):((p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?N.path="/"+c.path:p.path?N.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+c.path:N.path=c.path,N.path=Ne(N.path)),N.query=c.query):(N.path=p.path,c.query!==void 0?N.query=c.query:N.query=p.query),N.userinfo=p.userinfo,N.host=p.host,N.port=p.port),N.scheme=p.scheme),N.fragment=c.fragment,N}function Tt(p,c,m){var C=u({scheme:"null"},m);return fe(gt(x(p,C),x(c,C),C,!0),C)}function ot(p,c){return typeof p=="string"?p=fe(x(p,c),c):i(p)==="object"&&(p=x(fe(p,c),c)),p}function Rt(p,c,m){return typeof p=="string"?p=fe(x(p,m),m):i(p)==="object"&&(p=fe(p,m)),typeof c=="string"?c=fe(x(c,m),m):i(c)==="object"&&(c=fe(c,m)),p===c}function Bt(p,c){return p&&p.toString().replace(!c||!c.iri?f.ESCAPE:y.ESCAPE,z)}function Ce(p,c){return p&&p.toString().replace(!c||!c.iri?f.PCT_ENCODED:y.PCT_ENCODED,Z)}var at={scheme:"http",domainHost:!0,parse:function(c,m){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c},serialize:function(c,m){var C=String(c.scheme).toLowerCase()==="https";return(c.port===(C?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},kn={scheme:"https",domainHost:at.domainHost,parse:at.parse,serialize:at.serialize};function On(p){return typeof p.secure=="boolean"?p.secure:String(p.scheme).toLowerCase()==="wss"}var kt={scheme:"ws",domainHost:!0,parse:function(c,m){var C=c;return C.secure=On(C),C.resourceName=(C.path||"/")+(C.query?"?"+C.query:""),C.path=void 0,C.query=void 0,C},serialize:function(c,m){if((c.port===(On(c)?443:80)||c.port==="")&&(c.port=void 0),typeof c.secure=="boolean"&&(c.scheme=c.secure?"wss":"ws",c.secure=void 0),c.resourceName){var C=c.resourceName.split("?"),N=P(C,2),B=N[0],H=N[1];c.path=B&&B!=="/"?B:void 0,c.query=H,c.resourceName=void 0}return c.fragment=void 0,c}},Nn={scheme:"wss",domainHost:kt.domainHost,parse:kt.parse,serialize:kt.serialize},ci={},Cn="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ve="[0-9A-Fa-f]",li=n(n("%[EFef]"+Ve+"%"+Ve+Ve+"%"+Ve+Ve)+"|"+n("%[89A-Fa-f]"+Ve+"%"+Ve+Ve)+"|"+n("%"+Ve+Ve)),ui="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",di="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",fi=s(di,'[\\"\\\\]'),pi="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",hi=new RegExp(Cn,"g"),$t=new RegExp(li,"g"),mi=new RegExp(s("[^]",ui,"[\\.]",'[\\"]',fi),"g"),In=new RegExp(s("[^]",Cn,pi),"g"),yi=In;function vr(p){var c=Z(p);return c.match(hi)?c:p}var jn={scheme:"mailto",parse:function(c,m){var C=c,N=C.to=C.path?C.path.split(","):[];if(C.path=void 0,C.query){for(var B=!1,H={},re=C.query.split("&"),ce=0,pe=re.length;ce<pe;++ce){var te=re[ce].split("=");switch(te[0]){case"to":for(var ae=te[1].split(","),he=0,K=ae.length;he<K;++he)N.push(ae[he]);break;case"subject":C.subject=Ce(te[1],m);break;case"body":C.body=Ce(te[1],m);break;default:B=!0,H[Ce(te[0],m)]=Ce(te[1],m);break}}B&&(C.headers=H)}C.query=void 0;for(var ue=0,ge=N.length;ue<ge;++ue){var de=N[ue].split("@");if(de[0]=Ce(de[0]),m.unicodeSupport)de[1]=Ce(de[1],m).toLowerCase();else try{de[1]=D.toASCII(Ce(de[1],m).toLowerCase())}catch(tt){C.error=C.error||"Email address's domain name can not be converted to ASCII via punycode: "+tt}N[ue]=de.join("@")}return C},serialize:function(c,m){var C=c,N=a(c.to);if(N){for(var B=0,H=N.length;B<H;++B){var re=String(N[B]),ce=re.lastIndexOf("@"),pe=re.slice(0,ce).replace($t,vr).replace($t,l).replace(mi,z),te=re.slice(ce+1);try{te=m.iri?D.toUnicode(te):D.toASCII(Ce(te,m).toLowerCase())}catch(ue){C.error=C.error||"Email address's domain name can not be converted to "+(m.iri?"Unicode":"ASCII")+" via punycode: "+ue}N[B]=pe+"@"+te}C.path=N.join(",")}var ae=c.headers=c.headers||{};c.subject&&(ae.subject=c.subject),c.body&&(ae.body=c.body);var he=[];for(var K in ae)ae[K]!==ci[K]&&he.push(K.replace($t,vr).replace($t,l).replace(In,z)+"="+ae[K].replace($t,vr).replace($t,l).replace(yi,z));return he.length&&(C.query=he.join("&")),C}},gi=/^([^\:]+)\:(.*)/,Dn={scheme:"urn",parse:function(c,m){var C=c.path&&c.path.match(gi),N=c;if(C){var B=m.scheme||N.scheme||"urn",H=C[1].toLowerCase(),re=C[2],ce=B+":"+(m.nid||H),pe=V[ce];N.nid=H,N.nss=re,N.path=void 0,pe&&(N=pe.parse(N,m))}else N.error=N.error||"URN can not be parsed.";return N},serialize:function(c,m){var C=m.scheme||c.scheme||"urn",N=c.nid,B=C+":"+(m.nid||N),H=V[B];H&&(c=H.serialize(c,m));var re=c,ce=c.nss;return re.path=(N||m.nid)+":"+ce,re}},$i=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,An={scheme:"urn:uuid",parse:function(c,m){var C=c;return C.uuid=C.nss,C.nss=void 0,!m.tolerant&&(!C.uuid||!C.uuid.match($i))&&(C.error=C.error||"UUID is not valid."),C},serialize:function(c,m){var C=c;return C.nss=(c.uuid||"").toLowerCase(),C}};V[at.scheme]=at,V[kn.scheme]=kn,V[kt.scheme]=kt,V[Nn.scheme]=Nn,V[jn.scheme]=jn,V[Dn.scheme]=Dn,V[An.scheme]=An,r.SCHEMES=V,r.pctEncChar=z,r.pctDecChars=Z,r.parse=x,r.removeDotSegments=Ne,r.serialize=fe,r.resolveComponents=gt,r.resolve=Tt,r.normalize=ot,r.equal=Rt,r.escapeComponent=Bt,r.unescapeComponent=Ce,Object.defineProperty(r,"__esModule",{value:!0})})})(Ir,Ir.exports);var ta=Ir.exports;Object.defineProperty(Jr,"__esModule",{value:!0});const Ys=ta;Ys.code='require("ajv/dist/runtime/uri").default';Jr.default=Ys;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=yr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ee;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const s=xr(),n=zt,i=ht,l=Oe,a=ee,u=Pe,d=Ut,f=ne,y=ea,P=Jr,b=(U,R)=>new RegExp(U,R);b.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],E=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function T(U){var R,M,O,o,h,D,V,z,Z,Y,$,k,A,L,W,x,$e,Re,we,be,_e,Ne,fe,gt,Tt;const ot=U.strict,Rt=(R=U.code)===null||R===void 0?void 0:R.optimize,Bt=Rt===!0||Rt===void 0?1:Rt||0,Ce=(O=(M=U.code)===null||M===void 0?void 0:M.regExp)!==null&&O!==void 0?O:b,at=(o=U.uriResolver)!==null&&o!==void 0?o:P.default;return{strictSchema:(D=(h=U.strictSchema)!==null&&h!==void 0?h:ot)!==null&&D!==void 0?D:!0,strictNumbers:(z=(V=U.strictNumbers)!==null&&V!==void 0?V:ot)!==null&&z!==void 0?z:!0,strictTypes:(Y=(Z=U.strictTypes)!==null&&Z!==void 0?Z:ot)!==null&&Y!==void 0?Y:"log",strictTuples:(k=($=U.strictTuples)!==null&&$!==void 0?$:ot)!==null&&k!==void 0?k:"log",strictRequired:(L=(A=U.strictRequired)!==null&&A!==void 0?A:ot)!==null&&L!==void 0?L:!1,code:U.code?{...U.code,optimize:Bt,regExp:Ce}:{optimize:Bt,regExp:Ce},loopRequired:(W=U.loopRequired)!==null&&W!==void 0?W:v,loopEnum:(x=U.loopEnum)!==null&&x!==void 0?x:v,meta:($e=U.meta)!==null&&$e!==void 0?$e:!0,messages:(Re=U.messages)!==null&&Re!==void 0?Re:!0,inlineRefs:(we=U.inlineRefs)!==null&&we!==void 0?we:!0,schemaId:(be=U.schemaId)!==null&&be!==void 0?be:"$id",addUsedSchema:(_e=U.addUsedSchema)!==null&&_e!==void 0?_e:!0,validateSchema:(Ne=U.validateSchema)!==null&&Ne!==void 0?Ne:!0,validateFormats:(fe=U.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(gt=U.unicodeRegExp)!==null&>!==void 0?gt:!0,int32range:(Tt=U.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:at}}class j{constructor(R={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,R=this.opts={...R,...T(R)};const{es5:M,lines:O}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:E,es5:M,lines:O}),this.logger=Q(R.logger);const o=R.validateFormats;R.validateFormats=!1,this.RULES=(0,i.getRules)(),F.call(this,w,R,"NOT SUPPORTED"),F.call(this,g,R,"DEPRECATED","warn"),this._metaOpts=J.call(this),R.formats&&q.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),R.keywords&&G.call(this,R.keywords),typeof R.meta=="object"&&this.addMetaSchema(R.meta),I.call(this),R.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:R,meta:M,schemaId:O}=this.opts;let o=y;O==="id"&&(o={...y},o.id=o.$id,delete o.$id),M&&R&&this.addMetaSchema(o,o[O],!1)}defaultMeta(){const{meta:R,schemaId:M}=this.opts;return this.opts.defaultMeta=typeof R=="object"?R[M]||R:void 0}validate(R,M){let O;if(typeof R=="string"){if(O=this.getSchema(R),!O)throw new Error(`no schema with key or ref "${R}"`)}else O=this.compile(R);const o=O(M);return"$async"in O||(this.errors=O.errors),o}compile(R,M){const O=this._addSchema(R,M);return O.validate||this._compileSchemaEnv(O)}compileAsync(R,M){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return o.call(this,R,M);async function o(Y,$){await h.call(this,Y.$schema);const k=this._addSchema(Y,$);return k.validate||D.call(this,k)}async function h(Y){Y&&!this.getSchema(Y)&&await o.call(this,{$ref:Y},!0)}async function D(Y){try{return this._compileSchemaEnv(Y)}catch($){if(!($ instanceof n.default))throw $;return V.call(this,$),await z.call(this,$.missingSchema),D.call(this,Y)}}function V({missingSchema:Y,missingRef:$}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${$} cannot be resolved`)}async function z(Y){const $=await Z.call(this,Y);this.refs[Y]||await h.call(this,$.$schema),this.refs[Y]||this.addSchema($,Y,M)}async function Z(Y){const $=this._loading[Y];if($)return $;try{return await(this._loading[Y]=O(Y))}finally{delete this._loading[Y]}}}addSchema(R,M,O,o=this.opts.validateSchema){if(Array.isArray(R)){for(const D of R)this.addSchema(D,void 0,O,o);return this}let h;if(typeof R=="object"){const{schemaId:D}=this.opts;if(h=R[D],h!==void 0&&typeof h!="string")throw new Error(`schema ${D} must be string`)}return M=(0,u.normalizeId)(M||h),this._checkUnique(M),this.schemas[M]=this._addSchema(R,O,M,o,!0),this}addMetaSchema(R,M,O=this.opts.validateSchema){return this.addSchema(R,M,!0,O),this}validateSchema(R,M){if(typeof R=="boolean")return!0;let O;if(O=R.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const o=this.validate(O,R);if(!o&&M){const h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw new Error(h)}return o}getSchema(R){let M;for(;typeof(M=S.call(this,R))=="string";)R=M;if(M===void 0){const{schemaId:O}=this.opts,o=new l.SchemaEnv({schema:{},schemaId:O});if(M=l.resolveSchema.call(this,o,R),!M)return;this.refs[R]=M}return M.validate||this._compileSchemaEnv(M)}removeSchema(R){if(R instanceof RegExp)return this._removeAllSchemas(this.schemas,R),this._removeAllSchemas(this.refs,R),this;switch(typeof R){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const M=S.call(this,R);return typeof M=="object"&&this._cache.delete(M.schema),delete this.schemas[R],delete this.refs[R],this}case"object":{const M=R;this._cache.delete(M);let O=R[this.opts.schemaId];return O&&(O=(0,u.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(R){for(const M of R)this.addKeyword(M);return this}addKeyword(R,M){let O;if(typeof R=="string")O=R,typeof M=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),M.keyword=O);else if(typeof R=="object"&&M===void 0){if(M=R,O=M.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(se.call(this,O,M),!M)return(0,f.eachItem)(O,h=>Ae.call(this,h)),this;Je.call(this,M);const o={...M,type:(0,d.getJSONTypes)(M.type),schemaType:(0,d.getJSONTypes)(M.schemaType)};return(0,f.eachItem)(O,o.type.length===0?h=>Ae.call(this,h,o):h=>o.type.forEach(D=>Ae.call(this,h,o,D))),this}getKeyword(R){const M=this.RULES.all[R];return typeof M=="object"?M.definition:!!M}removeKeyword(R){const{RULES:M}=this;delete M.keywords[R],delete M.all[R];for(const O of M.rules){const o=O.rules.findIndex(h=>h.keyword===R);o>=0&&O.rules.splice(o,1)}return this}addFormat(R,M){return typeof M=="string"&&(M=new RegExp(M)),this.formats[R]=M,this}errorsText(R=this.errors,{separator:M=", ",dataVar:O="data"}={}){return!R||R.length===0?"No errors":R.map(o=>`${O}${o.instancePath} ${o.message}`).reduce((o,h)=>o+M+h)}$dataMetaSchema(R,M){const O=this.RULES.all;R=JSON.parse(JSON.stringify(R));for(const o of M){const h=o.split("/").slice(1);let D=R;for(const V of h)D=D[V];for(const V in O){const z=O[V];if(typeof z!="object")continue;const{$data:Z}=z.definition,Y=D[V];Z&&Y&&(D[V]=et(Y))}}return R}_removeAllSchemas(R,M){for(const O in R){const o=R[O];(!M||M.test(O))&&(typeof o=="string"?delete R[O]:o&&!o.meta&&(this._cache.delete(o.schema),delete R[O]))}}_addSchema(R,M,O,o=this.opts.validateSchema,h=this.opts.addUsedSchema){let D;const{schemaId:V}=this.opts;if(typeof R=="object")D=R[V];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof R!="boolean")throw new Error("schema must be object or boolean")}let z=this._cache.get(R);if(z!==void 0)return z;O=(0,u.normalizeId)(D||O);const Z=u.getSchemaRefs.call(this,R,O);return z=new l.SchemaEnv({schema:R,schemaId:V,meta:M,baseId:O,localRefs:Z}),this._cache.set(z.schema,z),h&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=z),o&&this.validateSchema(R,!0),z}_checkUnique(R){if(this.schemas[R]||this.refs[R])throw new Error(`schema with key or id "${R}" already exists`)}_compileSchemaEnv(R){if(R.meta?this._compileMetaSchema(R):l.compileSchema.call(this,R),!R.validate)throw new Error("ajv implementation error");return R.validate}_compileMetaSchema(R){const M=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,R)}finally{this.opts=M}}}e.default=j,j.ValidationError=s.default,j.MissingRefError=n.default;function F(U,R,M,O="error"){for(const o in U){const h=o;h in R&&this.logger[O](`${M}: option ${o}. ${U[h]}`)}}function S(U){return U=(0,u.normalizeId)(U),this.schemas[U]||this.refs[U]}function I(){const U=this.opts.schemas;if(U)if(Array.isArray(U))this.addSchema(U);else for(const R in U)this.addSchema(U[R],R)}function q(){for(const U in this.opts.formats){const R=this.opts.formats[U];R&&this.addFormat(U,R)}}function G(U){if(Array.isArray(U)){this.addVocabulary(U);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const R in U){const M=U[R];M.keyword||(M.keyword=R),this.addKeyword(M)}}function J(){const U={...this.opts};for(const R of _)delete U[R];return U}const ie={log(){},warn(){},error(){}};function Q(U){if(U===!1)return ie;if(U===void 0)return console;if(U.log&&U.warn&&U.error)return U;throw new Error("logger must implement log, warn and error methods")}const oe=/^[a-z_$][a-z0-9_$:-]*$/i;function se(U,R){const{RULES:M}=this;if((0,f.eachItem)(U,O=>{if(M.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!oe.test(O))throw new Error(`Keyword ${O} has invalid name`)}),!!R&&R.$data&&!("code"in R||"validate"in R))throw new Error('$data keyword must have "code" or "validate" function')}function Ae(U,R,M){var O;const o=R==null?void 0:R.post;if(M&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:h}=this;let D=o?h.post:h.rules.find(({type:z})=>z===M);if(D||(D={type:M,rules:[]},h.rules.push(D)),h.keywords[U]=!0,!R)return;const V={keyword:U,definition:{...R,type:(0,d.getJSONTypes)(R.type),schemaType:(0,d.getJSONTypes)(R.schemaType)}};R.before?Ue.call(this,D,V,R.before):D.rules.push(V),h.all[U]=V,(O=R.implements)===null||O===void 0||O.forEach(z=>this.addKeyword(z))}function Ue(U,R,M){const O=U.rules.findIndex(o=>o.keyword===M);O>=0?U.rules.splice(O,0,R):(U.rules.push(R),this.logger.warn(`rule ${M} is not defined`))}function Je(U){let{metaSchema:R}=U;R!==void 0&&(U.$data&&this.opts.$data&&(R=et(R)),U.validateSchema=this.compile(R,!0))}const it={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function et(U){return{anyOf:[U,it]}}})(Vs);var Qr={},Zr={},Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});const ra={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Yr.default=ra;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.callRef=mt.getValidate=void 0;const na=zt,Zn=X,ke=ee,vt=Ke,Yn=Oe,Jt=ne,sa={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:s}=e,{baseId:n,schemaEnv:i,validateName:l,opts:a,self:u}=s,{root:d}=i;if((r==="#"||r==="#/")&&n===d.baseId)return y();const f=Yn.resolveRef.call(u,d,n,r);if(f===void 0)throw new na.default(s.opts.uriResolver,n,r);if(f instanceof Yn.SchemaEnv)return P(f);return b(f);function y(){if(i===d)return rr(e,l,i,i.$async);const _=t.scopeValue("root",{ref:d});return rr(e,(0,ke._)`${_}.validate`,d,d.$async)}function P(_){const E=Xs(e,_);rr(e,E,_,_.$async)}function b(_){const E=t.scopeValue("schema",a.code.source===!0?{ref:_,code:(0,ke.stringify)(_)}:{ref:_}),w=t.name("valid"),g=e.subschema({schema:_,dataTypes:[],schemaPath:ke.nil,topSchemaRef:E,errSchemaPath:r},w);e.mergeEvaluated(g),e.ok(w)}}};function Xs(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,ke._)`${r.scopeValue("wrapper",{ref:t})}.validate`}mt.getValidate=Xs;function rr(e,t,r,s){const{gen:n,it:i}=e,{allErrors:l,schemaEnv:a,opts:u}=i,d=u.passContext?vt.default.this:ke.nil;s?f():y();function f(){if(!a.$async)throw new Error("async schema referenced by sync schema");const _=n.let("valid");n.try(()=>{n.code((0,ke._)`await ${(0,Zn.callValidateCode)(e,t,d)}`),b(t),l||n.assign(_,!0)},E=>{n.if((0,ke._)`!(${E} instanceof ${i.ValidationError})`,()=>n.throw(E)),P(E),l||n.assign(_,!1)}),e.ok(_)}function y(){e.result((0,Zn.callValidateCode)(e,t,d),()=>b(t),()=>P(t))}function P(_){const E=(0,ke._)`${_}.errors`;n.assign(vt.default.vErrors,(0,ke._)`${vt.default.vErrors} === null ? ${E} : ${vt.default.vErrors}.concat(${E})`),n.assign(vt.default.errors,(0,ke._)`${vt.default.vErrors}.length`)}function b(_){var E;if(!i.opts.unevaluated)return;const w=(E=r==null?void 0:r.validate)===null||E===void 0?void 0:E.evaluated;if(i.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(i.props=Jt.mergeEvaluated.props(n,w.props,i.props));else{const g=n.var("props",(0,ke._)`${_}.evaluated.props`);i.props=Jt.mergeEvaluated.props(n,g,i.props,ke.Name)}if(i.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(i.items=Jt.mergeEvaluated.items(n,w.items,i.items));else{const g=n.var("items",(0,ke._)`${_}.evaluated.items`);i.items=Jt.mergeEvaluated.items(n,g,i.items,ke.Name)}}}mt.callRef=rr;mt.default=sa;Object.defineProperty(Zr,"__esModule",{value:!0});const ia=Yr,oa=mt,aa=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",ia.default,oa.default];Zr.default=aa;var Xr={},en={};Object.defineProperty(en,"__esModule",{value:!0});const cr=ee,nt=cr.operators,lr={maximum:{okStr:"<=",ok:nt.LTE,fail:nt.GT},minimum:{okStr:">=",ok:nt.GTE,fail:nt.LT},exclusiveMaximum:{okStr:"<",ok:nt.LT,fail:nt.GTE},exclusiveMinimum:{okStr:">",ok:nt.GT,fail:nt.LTE}},ca={message:({keyword:e,schemaCode:t})=>(0,cr.str)`must be ${lr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,cr._)`{comparison: ${lr[e].okStr}, limit: ${t}}`},la={keyword:Object.keys(lr),type:"number",schemaType:"number",$data:!0,error:ca,code(e){const{keyword:t,data:r,schemaCode:s}=e;e.fail$data((0,cr._)`${r} ${lr[t].fail} ${s} || isNaN(${r})`)}};en.default=la;var tn={};Object.defineProperty(tn,"__esModule",{value:!0});const Dt=ee,ua={message:({schemaCode:e})=>(0,Dt.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Dt._)`{multipleOf: ${e}}`},da={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ua,code(e){const{gen:t,data:r,schemaCode:s,it:n}=e,i=n.opts.multipleOfPrecision,l=t.let("res"),a=i?(0,Dt._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${i}`:(0,Dt._)`${l} !== parseInt(${l})`;e.fail$data((0,Dt._)`(${s} === 0 || (${l} = ${r}/${s}, ${a}))`)}};tn.default=da;var rn={},nn={};Object.defineProperty(nn,"__esModule",{value:!0});function ei(e){const t=e.length;let r=0,s=0,n;for(;s<t;)r++,n=e.charCodeAt(s++),n>=55296&&n<=56319&&s<t&&(n=e.charCodeAt(s),(n&64512)===56320&&s++);return r}nn.default=ei;ei.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(rn,"__esModule",{value:!0});const ft=ee,fa=ne,pa=nn,ha={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,ft.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,ft._)`{limit: ${e}}`},ma={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ha,code(e){const{keyword:t,data:r,schemaCode:s,it:n}=e,i=t==="maxLength"?ft.operators.GT:ft.operators.LT,l=n.opts.unicode===!1?(0,ft._)`${r}.length`:(0,ft._)`${(0,fa.useFunc)(e.gen,pa.default)}(${r})`;e.fail$data((0,ft._)`${l} ${i} ${s}`)}};rn.default=ma;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});const ya=X,ur=ee,ga={message:({schemaCode:e})=>(0,ur.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ur._)`{pattern: ${e}}`},$a={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:ga,code(e){const{data:t,$data:r,schema:s,schemaCode:n,it:i}=e,l=i.opts.unicodeRegExp?"u":"",a=r?(0,ur._)`(new RegExp(${n}, ${l}))`:(0,ya.usePattern)(e,s);e.fail$data((0,ur._)`!${a}.test(${t})`)}};sn.default=$a;var on={};Object.defineProperty(on,"__esModule",{value:!0});const At=ee,_a={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,At.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,At._)`{limit: ${e}}`},va={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:_a,code(e){const{keyword:t,data:r,schemaCode:s}=e,n=t==="maxProperties"?At.operators.GT:At.operators.LT;e.fail$data((0,At._)`Object.keys(${r}).length ${n} ${s}`)}};on.default=va;var an={};Object.defineProperty(an,"__esModule",{value:!0});const It=X,Mt=ee,wa=ne,ba={message:({params:{missingProperty:e}})=>(0,Mt.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Mt._)`{missingProperty: ${e}}`},Ea={keyword:"required",type:"object",schemaType:"array",$data:!0,error:ba,code(e){const{gen:t,schema:r,schemaCode:s,data:n,$data:i,it:l}=e,{opts:a}=l;if(!i&&r.length===0)return;const u=r.length>=a.loopRequired;if(l.allErrors?d():f(),a.strictRequired){const b=e.parentSchema.properties,{definedProperties:_}=e.it;for(const E of r)if((b==null?void 0:b[E])===void 0&&!_.has(E)){const w=l.schemaEnv.baseId+l.errSchemaPath,g=`required property "${E}" is not defined at "${w}" (strictRequired)`;(0,wa.checkStrictMode)(l,g,l.opts.strictRequired)}}function d(){if(u||i)e.block$data(Mt.nil,y);else for(const b of r)(0,It.checkReportMissingProp)(e,b)}function f(){const b=t.let("missing");if(u||i){const _=t.let("valid",!0);e.block$data(_,()=>P(b,_)),e.ok(_)}else t.if((0,It.checkMissingProp)(e,r,b)),(0,It.reportMissingProp)(e,b),t.else()}function y(){t.forOf("prop",s,b=>{e.setParams({missingProperty:b}),t.if((0,It.noPropertyInData)(t,n,b,a.ownProperties),()=>e.error())})}function P(b,_){e.setParams({missingProperty:b}),t.forOf(b,s,()=>{t.assign(_,(0,It.propertyInData)(t,n,b,a.ownProperties)),t.if((0,Mt.not)(_),()=>{e.error(),t.break()})},Mt.nil)}}};an.default=Ea;var cn={};Object.defineProperty(cn,"__esModule",{value:!0});const Ft=ee,Pa={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Ft.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Ft._)`{limit: ${e}}`},Sa={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Pa,code(e){const{keyword:t,data:r,schemaCode:s}=e,n=t==="maxItems"?Ft.operators.GT:Ft.operators.LT;e.fail$data((0,Ft._)`${r}.length ${n} ${s}`)}};cn.default=Sa;var ln={},Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});const ti=Gs;ti.code='require("ajv/dist/runtime/equal").default';Wt.default=ti;Object.defineProperty(ln,"__esModule",{value:!0});const Sr=Ut,Ee=ee,Ta=ne,Ra=Wt,ka={message:({params:{i:e,j:t}})=>(0,Ee.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ee._)`{i: ${e}, j: ${t}}`},Oa={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:ka,code(e){const{gen:t,data:r,$data:s,schema:n,parentSchema:i,schemaCode:l,it:a}=e;if(!s&&!n)return;const u=t.let("valid"),d=i.items?(0,Sr.getSchemaTypes)(i.items):[];e.block$data(u,f,(0,Ee._)`${l} === false`),e.ok(u);function f(){const _=t.let("i",(0,Ee._)`${r}.length`),E=t.let("j");e.setParams({i:_,j:E}),t.assign(u,!0),t.if((0,Ee._)`${_} > 1`,()=>(y()?P:b)(_,E))}function y(){return d.length>0&&!d.some(_=>_==="object"||_==="array")}function P(_,E){const w=t.name("item"),g=(0,Sr.checkDataTypes)(d,w,a.opts.strictNumbers,Sr.DataType.Wrong),v=t.const("indices",(0,Ee._)`{}`);t.for((0,Ee._)`;${_}--;`,()=>{t.let(w,(0,Ee._)`${r}[${_}]`),t.if(g,(0,Ee._)`continue`),d.length>1&&t.if((0,Ee._)`typeof ${w} == "string"`,(0,Ee._)`${w} += "_"`),t.if((0,Ee._)`typeof ${v}[${w}] == "number"`,()=>{t.assign(E,(0,Ee._)`${v}[${w}]`),e.error(),t.assign(u,!1).break()}).code((0,Ee._)`${v}[${w}] = ${_}`)})}function b(_,E){const w=(0,Ta.useFunc)(t,Ra.default),g=t.name("outer");t.label(g).for((0,Ee._)`;${_}--;`,()=>t.for((0,Ee._)`${E} = ${_}; ${E}--;`,()=>t.if((0,Ee._)`${w}(${r}[${_}], ${r}[${E}])`,()=>{e.error(),t.assign(u,!1).break(g)})))}}};ln.default=Oa;var un={};Object.defineProperty(un,"__esModule",{value:!0});const jr=ee,Na=ne,Ca=Wt,Ia={message:"must be equal to constant",params:({schemaCode:e})=>(0,jr._)`{allowedValue: ${e}}`},ja={keyword:"const",$data:!0,error:Ia,code(e){const{gen:t,data:r,$data:s,schemaCode:n,schema:i}=e;s||i&&typeof i=="object"?e.fail$data((0,jr._)`!${(0,Na.useFunc)(t,Ca.default)}(${r}, ${n})`):e.fail((0,jr._)`${i} !== ${r}`)}};un.default=ja;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});const jt=ee,Da=ne,Aa=Wt,Ma={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,jt._)`{allowedValues: ${e}}`},Fa={keyword:"enum",schemaType:"array",$data:!0,error:Ma,code(e){const{gen:t,data:r,$data:s,schema:n,schemaCode:i,it:l}=e;if(!s&&n.length===0)throw new Error("enum must have non-empty array");const a=n.length>=l.opts.loopEnum;let u;const d=()=>u??(u=(0,Da.useFunc)(t,Aa.default));let f;if(a||s)f=t.let("valid"),e.block$data(f,y);else{if(!Array.isArray(n))throw new Error("ajv implementation error");const b=t.const("vSchema",i);f=(0,jt.or)(...n.map((_,E)=>P(b,E)))}e.pass(f);function y(){t.assign(f,!1),t.forOf("v",i,b=>t.if((0,jt._)`${d()}(${r}, ${b})`,()=>t.assign(f,!0).break()))}function P(b,_){const E=n[_];return typeof E=="object"&&E!==null?(0,jt._)`${d()}(${r}, ${b}[${_}])`:(0,jt._)`${r} === ${E}`}}};dn.default=Fa;Object.defineProperty(Xr,"__esModule",{value:!0});const qa=en,La=tn,Ua=rn,Va=sn,za=on,Wa=an,Ba=cn,Ha=ln,Ga=un,xa=dn,Ka=[qa.default,La.default,Ua.default,Va.default,za.default,Wa.default,Ba.default,Ha.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ga.default,xa.default];Xr.default=Ka;var fn={},Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.validateAdditionalItems=void 0;const pt=ee,Dr=ne,Ja={message:({params:{len:e}})=>(0,pt.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,pt._)`{limit: ${e}}`},Qa={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Ja,code(e){const{parentSchema:t,it:r}=e,{items:s}=t;if(!Array.isArray(s)){(0,Dr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ri(e,s)}};function ri(e,t){const{gen:r,schema:s,data:n,keyword:i,it:l}=e;l.items=!0;const a=r.const("len",(0,pt._)`${n}.length`);if(s===!1)e.setParams({len:t.length}),e.pass((0,pt._)`${a} <= ${t.length}`);else if(typeof s=="object"&&!(0,Dr.alwaysValidSchema)(l,s)){const d=r.var("valid",(0,pt._)`${a} <= ${t.length}`);r.if((0,pt.not)(d),()=>u(d)),e.ok(d)}function u(d){r.forRange("i",t.length,a,f=>{e.subschema({keyword:i,dataProp:f,dataPropType:Dr.Type.Num},d),l.allErrors||r.if((0,pt.not)(d),()=>r.break())})}}Pt.validateAdditionalItems=ri;Pt.default=Qa;var pn={},St={};Object.defineProperty(St,"__esModule",{value:!0});St.validateTuple=void 0;const Xn=ee,nr=ne,Za=X,Ya={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return ni(e,"additionalItems",t);r.items=!0,!(0,nr.alwaysValidSchema)(r,t)&&e.ok((0,Za.validateArray)(e))}};function ni(e,t,r=e.schema){const{gen:s,parentSchema:n,data:i,keyword:l,it:a}=e;f(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=nr.mergeEvaluated.items(s,r.length,a.items));const u=s.name("valid"),d=s.const("len",(0,Xn._)`${i}.length`);r.forEach((y,P)=>{(0,nr.alwaysValidSchema)(a,y)||(s.if((0,Xn._)`${d} > ${P}`,()=>e.subschema({keyword:l,schemaProp:P,dataProp:P},u)),e.ok(u))});function f(y){const{opts:P,errSchemaPath:b}=a,_=r.length,E=_===y.minItems&&(_===y.maxItems||y[t]===!1);if(P.strictTuples&&!E){const w=`"${l}" is ${_}-tuple, but minItems or maxItems/${t} are not specified or different at path "${b}"`;(0,nr.checkStrictMode)(a,w,P.strictTuples)}}}St.validateTuple=ni;St.default=Ya;Object.defineProperty(pn,"__esModule",{value:!0});const Xa=St,ec={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Xa.validateTuple)(e,"items")};pn.default=ec;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});const es=ee,tc=ne,rc=X,nc=Pt,sc={message:({params:{len:e}})=>(0,es.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,es._)`{limit: ${e}}`},ic={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:sc,code(e){const{schema:t,parentSchema:r,it:s}=e,{prefixItems:n}=r;s.items=!0,!(0,tc.alwaysValidSchema)(s,t)&&(n?(0,nc.validateAdditionalItems)(e,n):e.ok((0,rc.validateArray)(e)))}};hn.default=ic;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});const De=ee,Qt=ne,oc={message:({params:{min:e,max:t}})=>t===void 0?(0,De.str)`must contain at least ${e} valid item(s)`:(0,De.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,De._)`{minContains: ${e}}`:(0,De._)`{minContains: ${e}, maxContains: ${t}}`},ac={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:oc,code(e){const{gen:t,schema:r,parentSchema:s,data:n,it:i}=e;let l,a;const{minContains:u,maxContains:d}=s;i.opts.next?(l=u===void 0?1:u,a=d):l=1;const f=t.const("len",(0,De._)`${n}.length`);if(e.setParams({min:l,max:a}),a===void 0&&l===0){(0,Qt.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&l>a){(0,Qt.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Qt.alwaysValidSchema)(i,r)){let E=(0,De._)`${f} >= ${l}`;a!==void 0&&(E=(0,De._)`${E} && ${f} <= ${a}`),e.pass(E);return}i.items=!0;const y=t.name("valid");a===void 0&&l===1?b(y,()=>t.if(y,()=>t.break())):l===0?(t.let(y,!0),a!==void 0&&t.if((0,De._)`${n}.length > 0`,P)):(t.let(y,!1),P()),e.result(y,()=>e.reset());function P(){const E=t.name("_valid"),w=t.let("count",0);b(E,()=>t.if(E,()=>_(w)))}function b(E,w){t.forRange("i",0,f,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:Qt.Type.Num,compositeRule:!0},E),w()})}function _(E){t.code((0,De._)`${E}++`),a===void 0?t.if((0,De._)`${E} >= ${l}`,()=>t.assign(y,!0).break()):(t.if((0,De._)`${E} > ${a}`,()=>t.assign(y,!1).break()),l===1?t.assign(y,!0):t.if((0,De._)`${E} >= ${l}`,()=>t.assign(y,!0)))}}};mn.default=ac;var si={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ee,r=ne,s=X;e.error={message:({params:{property:u,depsCount:d,deps:f}})=>{const y=d===1?"property":"properties";return(0,t.str)`must have ${y} ${f} when property ${u} is present`},params:({params:{property:u,depsCount:d,deps:f,missingProperty:y}})=>(0,t._)`{property: ${u},
|
|
632
|
+
|| ${G} === "boolean" || ${I} === null`).assign(J,(0,n._)`[${I}]`)}}}function b({gen:T,parentData:j,parentDataProperty:F},S){T.if((0,n._)`${j} !== undefined`,()=>T.assign((0,n._)`${j}[${F}]`,S))}function _(T,j,F,S=c.Correct){const I=S===c.Correct?n.operators.EQ:n.operators.NEQ;let q;switch(T){case"null":return(0,n._)`${j} ${I} null`;case"array":q=(0,n._)`Array.isArray(${j})`;break;case"object":q=(0,n._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":q=G((0,n._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":q=G();break;default:return(0,n._)`typeof ${j} ${I} ${T}`}return S===c.Correct?q:(0,n.not)(q);function G(J=n.nil){return(0,n.and)((0,n._)`typeof ${j} == "number"`,J,F?(0,n._)`isFinite(${j})`:n.nil)}}e.checkDataType=_;function E(T,j,F,S){if(T.length===1)return _(T[0],j,F,S);let I;const q=(0,i.toHash)(T);if(q.array&&q.object){const G=(0,n._)`typeof ${j} != "object"`;I=q.null?G:(0,n._)`!${j} || ${G}`,delete q.null,delete q.array,delete q.object}else I=n.nil;q.number&&delete q.integer;for(const G in q)I=(0,n.and)(I,_(G,j,F,S));return I}e.checkDataTypes=E;const w={message:({schema:T})=>`must be ${T}`,params:({schema:T,schemaValue:j})=>typeof T=="string"?(0,n._)`{type: ${T}}`:(0,n._)`{type: ${j}}`};function g(T){const j=v(T);(0,s.reportError)(j,w)}e.reportTypeError=g;function v(T){const{gen:j,data:F,schema:S}=T,I=(0,i.schemaRefOrVal)(T,S,"type");return{gen:j,keyword:"type",data:F,schema:S.type,schemaCode:I,schemaValue:I,parentSchema:S,params:{},it:T}}})(Ut);var Ct={},Hn;function uo(){if(Hn)return Ct;Hn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.assignDefaults=void 0;const e=ee,t=ne;function r(n,i){const{properties:c,items:a}=n.schema;if(i==="object"&&c)for(const u in c)s(n,u,c[u].default);else i==="array"&&Array.isArray(a)&&a.forEach((u,d)=>s(n,d,u.default))}Ct.assignDefaults=r;function s(n,i,c){const{gen:a,compositeRule:u,data:d,opts:f}=n;if(c===void 0)return;const y=(0,e._)`${d}${(0,e.getProperty)(i)}`;if(u){(0,t.checkStrictMode)(n,`default is ignored for: ${y}`);return}let P=(0,e._)`${y} === undefined`;f.useDefaults==="empty"&&(P=(0,e._)`${P} || ${y} === null || ${y} === ""`),a.if(P,(0,e._)`${y} = ${(0,e.stringify)(c)}`)}return Ct}var Me={},X={};Object.defineProperty(X,"__esModule",{value:!0});X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const le=ee,Br=ne,rt=Ke,fo=ne;function po(e,t){const{gen:r,data:s,it:n}=e;r.if(Gr(r,s,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:(0,le._)`${t}`},!0),e.error()})}X.checkReportMissingProp=po;function ho({gen:e,data:t,it:{opts:r}},s,n){return(0,le.or)(...s.map(i=>(0,le.and)(Gr(e,t,i,r.ownProperties),(0,le._)`${n} = ${i}`)))}X.checkMissingProp=ho;function mo(e,t){e.setParams({missingProperty:t},!0),e.error()}X.reportMissingProp=mo;function zs(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,le._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=zs;function Hr(e,t,r){return(0,le._)`${zs(e)}.call(${t}, ${r})`}X.isOwnProperty=Hr;function yo(e,t,r,s){const n=(0,le._)`${t}${(0,le.getProperty)(r)} !== undefined`;return s?(0,le._)`${n} && ${Hr(e,t,r)}`:n}X.propertyInData=yo;function Gr(e,t,r,s){const n=(0,le._)`${t}${(0,le.getProperty)(r)} === undefined`;return s?(0,le.or)(n,(0,le.not)(Hr(e,t,r))):n}X.noPropertyInData=Gr;function Ws(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}X.allSchemaProperties=Ws;function go(e,t){return Ws(t).filter(r=>!(0,Br.alwaysValidSchema)(e,t[r]))}X.schemaProperties=go;function $o({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:i},it:c},a,u,d){const f=d?(0,le._)`${e}, ${t}, ${s}${n}`:t,y=[[rt.default.instancePath,(0,le.strConcat)(rt.default.instancePath,i)],[rt.default.parentData,c.parentData],[rt.default.parentDataProperty,c.parentDataProperty],[rt.default.rootData,rt.default.rootData]];c.opts.dynamicRef&&y.push([rt.default.dynamicAnchors,rt.default.dynamicAnchors]);const P=(0,le._)`${f}, ${r.object(...y)}`;return u!==le.nil?(0,le._)`${a}.call(${u}, ${P})`:(0,le._)`${a}(${P})`}X.callValidateCode=$o;const _o=(0,le._)`new RegExp`;function vo({gen:e,it:{opts:t}},r){const s=t.unicodeRegExp?"u":"",{regExp:n}=t.code,i=n(r,s);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,le._)`${n.code==="new RegExp"?_o:(0,fo.useFunc)(e,n)}(${r}, ${s})`})}X.usePattern=vo;function wo(e){const{gen:t,data:r,keyword:s,it:n}=e,i=t.name("valid");if(n.allErrors){const a=t.let("valid",!0);return c(()=>t.assign(a,!1)),a}return t.var(i,!0),c(()=>t.break()),i;function c(a){const u=t.const("len",(0,le._)`${r}.length`);t.forRange("i",0,u,d=>{e.subschema({keyword:s,dataProp:d,dataPropType:Br.Type.Num},i),t.if((0,le.not)(i),a)})}}X.validateArray=wo;function bo(e){const{gen:t,schema:r,keyword:s,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Br.alwaysValidSchema)(n,u))&&!n.opts.unevaluated)return;const c=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((u,d)=>{const f=e.subschema({keyword:s,schemaProp:d,compositeRule:!0},a);t.assign(c,(0,le._)`${c} || ${a}`),e.mergeValidEvaluated(f,a)||t.if((0,le.not)(c))})),e.result(c,()=>e.reset(),()=>e.error(!0))}X.validateUnion=bo;var Gn;function Eo(){if(Gn)return Me;Gn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.validateKeywordUsage=Me.validSchemaType=Me.funcKeywordCode=Me.macroKeywordCode=void 0;const e=ee,t=Ke,r=X,s=Vt;function n(P,b){const{gen:_,keyword:E,schema:w,parentSchema:g,it:v}=P,T=b.macro.call(v.self,w,g,v),j=d(_,E,T);v.opts.validateSchema!==!1&&v.self.validateSchema(T,!0);const F=_.name("valid");P.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${v.errSchemaPath}/${E}`,topSchemaRef:j,compositeRule:!0},F),P.pass(F,()=>P.error(!0))}Me.macroKeywordCode=n;function i(P,b){var _;const{gen:E,keyword:w,schema:g,parentSchema:v,$data:T,it:j}=P;u(j,b);const F=!T&&b.compile?b.compile.call(j.self,g,v,j):b.validate,S=d(E,w,F),I=E.let("valid");P.block$data(I,q),P.ok((_=b.valid)!==null&&_!==void 0?_:I);function q(){if(b.errors===!1)ie(),b.modifying&&c(P),Q(()=>P.error());else{const oe=b.async?G():J();b.modifying&&c(P),Q(()=>a(P,oe))}}function G(){const oe=E.let("ruleErrs",null);return E.try(()=>ie((0,e._)`await `),se=>E.assign(I,!1).if((0,e._)`${se} instanceof ${j.ValidationError}`,()=>E.assign(oe,(0,e._)`${se}.errors`),()=>E.throw(se))),oe}function J(){const oe=(0,e._)`${S}.errors`;return E.assign(oe,null),ie(e.nil),oe}function ie(oe=b.async?(0,e._)`await `:e.nil){const se=j.opts.passContext?t.default.this:t.default.self,Ae=!("compile"in b&&!T||b.schema===!1);E.assign(I,(0,e._)`${oe}${(0,r.callValidateCode)(P,S,se,Ae)}`,b.modifying)}function Q(oe){var se;E.if((0,e.not)((se=b.valid)!==null&&se!==void 0?se:I),oe)}}Me.funcKeywordCode=i;function c(P){const{gen:b,data:_,it:E}=P;b.if(E.parentData,()=>b.assign(_,(0,e._)`${E.parentData}[${E.parentDataProperty}]`))}function a(P,b){const{gen:_}=P;_.if((0,e._)`Array.isArray(${b})`,()=>{_.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${b} : ${t.default.vErrors}.concat(${b})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,s.extendErrors)(P)},()=>P.error())}function u({schemaEnv:P},b){if(b.async&&!P.$async)throw new Error("async keyword in sync schema")}function d(P,b,_){if(_===void 0)throw new Error(`keyword "${b}" failed to compile`);return P.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,e.stringify)(_)})}function f(P,b,_=!1){return!b.length||b.some(E=>E==="array"?Array.isArray(P):E==="object"?P&&typeof P=="object"&&!Array.isArray(P):typeof P==E||_&&typeof P>"u")}Me.validSchemaType=f;function y({schema:P,opts:b,self:_,errSchemaPath:E},w,g){if(Array.isArray(w.keyword)?!w.keyword.includes(g):w.keyword!==g)throw new Error("ajv implementation error");const v=w.dependencies;if(v!=null&&v.some(T=>!Object.prototype.hasOwnProperty.call(P,T)))throw new Error(`parent schema must have dependencies of ${g}: ${v.join(",")}`);if(w.validateSchema&&!w.validateSchema(P[g])){const j=`keyword "${g}" value is invalid at path "${E}": `+_.errorsText(w.validateSchema.errors);if(b.validateSchema==="log")_.logger.error(j);else throw new Error(j)}}return Me.validateKeywordUsage=y,Me}var Xe={},xn;function Po(){if(xn)return Xe;xn=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.extendSubschemaMode=Xe.extendSubschemaData=Xe.getSubschema=void 0;const e=ee,t=ne;function r(i,{keyword:c,schemaProp:a,schema:u,schemaPath:d,errSchemaPath:f,topSchemaRef:y}){if(c!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(c!==void 0){const P=i.schema[c];return a===void 0?{schema:P,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${c}`}:{schema:P[a],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(c)}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${c}/${(0,t.escapeFragment)(a)}`}}if(u!==void 0){if(d===void 0||f===void 0||y===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:d,topSchemaRef:y,errSchemaPath:f}}throw new Error('either "keyword" or "schema" must be passed')}Xe.getSubschema=r;function s(i,c,{dataProp:a,dataPropType:u,data:d,dataTypes:f,propertyName:y}){if(d!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:P}=c;if(a!==void 0){const{errorPath:_,dataPathArr:E,opts:w}=c,g=P.let("data",(0,e._)`${c.data}${(0,e.getProperty)(a)}`,!0);b(g),i.errorPath=(0,e.str)`${_}${(0,t.getErrorPath)(a,u,w.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${a}`,i.dataPathArr=[...E,i.parentDataProperty]}if(d!==void 0){const _=d instanceof e.Name?d:P.let("data",d,!0);b(_),y!==void 0&&(i.propertyName=y)}f&&(i.dataTypes=f);function b(_){i.data=_,i.dataLevel=c.dataLevel+1,i.dataTypes=[],c.definedProperties=new Set,i.parentData=c.data,i.dataNames=[...c.dataNames,_]}}Xe.extendSubschemaData=s;function n(i,{jtdDiscriminator:c,jtdMetadata:a,compositeRule:u,createErrors:d,allErrors:f}){u!==void 0&&(i.compositeRule=u),d!==void 0&&(i.createErrors=d),f!==void 0&&(i.allErrors=f),i.jtdDiscriminator=c,i.jtdMetadata=a}return Xe.extendSubschemaMode=n,Xe}var Pe={},Bs=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,n,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=s;n--!==0;){var c=i[n];if(!e(t[c],r[c]))return!1}return!0}return t!==t&&r!==r},Hs={exports:{}},st=Hs.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var s=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};tr(t,s,n,e,"",e)};st.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};st.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};st.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};st.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function tr(e,t,r,s,n,i,c,a,u,d){if(s&&typeof s=="object"&&!Array.isArray(s)){t(s,n,i,c,a,u,d);for(var f in s){var y=s[f];if(Array.isArray(y)){if(f in st.arrayKeywords)for(var P=0;P<y.length;P++)tr(e,t,r,y[P],n+"/"+f+"/"+P,i,n,f,s,P)}else if(f in st.propsKeywords){if(y&&typeof y=="object")for(var b in y)tr(e,t,r,y[b],n+"/"+f+"/"+So(b),i,n,f,s,b)}else(f in st.keywords||e.allKeys&&!(f in st.skipKeywords))&&tr(e,t,r,y,n+"/"+f,i,n,f,s)}r(s,n,i,c,a,u,d)}}function So(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var To=Hs.exports;Object.defineProperty(Pe,"__esModule",{value:!0});Pe.getSchemaRefs=Pe.resolveUrl=Pe.normalizeId=Pe._getFullPath=Pe.getFullPath=Pe.inlineRef=void 0;const Ro=ne,ko=Bs,Oo=To,No=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Co(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Cr(e):t?Gs(e)<=t:!1}Pe.inlineRef=Co;const Io=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Cr(e){for(const t in e){if(Io.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Cr)||typeof r=="object"&&Cr(r))return!0}return!1}function Gs(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!No.has(r)&&(typeof e[r]=="object"&&(0,Ro.eachItem)(e[r],s=>t+=Gs(s)),t===1/0))return 1/0}return t}function xs(e,t="",r){r!==!1&&(t=bt(t));const s=e.parse(t);return Ks(e,s)}Pe.getFullPath=xs;function Ks(e,t){return e.serialize(t).split("#")[0]+"#"}Pe._getFullPath=Ks;const jo=/#\/?$/;function bt(e){return e?e.replace(jo,""):""}Pe.normalizeId=bt;function Do(e,t,r){return r=bt(r),e.resolve(t,r)}Pe.resolveUrl=Do;const Ao=/^[a-z_][-a-z0-9._]*$/i;function Mo(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:s}=this.opts,n=bt(e[r]||t),i={"":n},c=xs(s,n,!1),a={},u=new Set;return Oo(e,{allKeys:!0},(y,P,b,_)=>{if(_===void 0)return;const E=c+P;let w=i[_];typeof y[r]=="string"&&(w=g.call(this,y[r])),v.call(this,y.$anchor),v.call(this,y.$dynamicAnchor),i[P]=w;function g(T){const j=this.opts.uriResolver.resolve;if(T=bt(w?j(w,T):T),u.has(T))throw f(T);u.add(T);let F=this.refs[T];return typeof F=="string"&&(F=this.refs[F]),typeof F=="object"?d(y,F.schema,T):T!==bt(E)&&(T[0]==="#"?(d(y,a[T],T),a[T]=y):this.refs[T]=E),T}function v(T){if(typeof T=="string"){if(!Ao.test(T))throw new Error(`invalid anchor "${T}"`);g.call(this,`#${T}`)}}}),a;function d(y,P,b){if(P!==void 0&&!ko(y,P))throw f(b)}function f(y){return new Error(`reference "${y}" resolves to more than one schema`)}}Pe.getSchemaRefs=Mo;var Kn;function yr(){if(Kn)return Ze;Kn=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.getData=Ze.KeywordCxt=Ze.validateFunctionCode=void 0;const e=io(),t=Ut,r=Vs(),s=Ut,n=uo(),i=Eo(),c=Po(),a=ee,u=Ke,d=Pe,f=ne,y=Vt;function P($){if(F($)&&(I($),j($))){w($);return}b($,()=>(0,e.topBoolOrEmptySchema)($))}Ze.validateFunctionCode=P;function b({gen:$,validateName:k,schema:A,schemaEnv:L,opts:W},x){W.code.es5?$.func(k,(0,a._)`${u.default.data}, ${u.default.valCxt}`,L.$async,()=>{$.code((0,a._)`"use strict"; ${v(A,W)}`),E($,W),$.code(x)}):$.func(k,(0,a._)`${u.default.data}, ${_(W)}`,L.$async,()=>$.code(v(A,W)).code(x))}function _($){return(0,a._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${$.dynamicRef?(0,a._)`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function E($,k){$.if(u.default.valCxt,()=>{$.var(u.default.instancePath,(0,a._)`${u.default.valCxt}.${u.default.instancePath}`),$.var(u.default.parentData,(0,a._)`${u.default.valCxt}.${u.default.parentData}`),$.var(u.default.parentDataProperty,(0,a._)`${u.default.valCxt}.${u.default.parentDataProperty}`),$.var(u.default.rootData,(0,a._)`${u.default.valCxt}.${u.default.rootData}`),k.dynamicRef&&$.var(u.default.dynamicAnchors,(0,a._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{$.var(u.default.instancePath,(0,a._)`""`),$.var(u.default.parentData,(0,a._)`undefined`),$.var(u.default.parentDataProperty,(0,a._)`undefined`),$.var(u.default.rootData,u.default.data),k.dynamicRef&&$.var(u.default.dynamicAnchors,(0,a._)`{}`)})}function w($){const{schema:k,opts:A,gen:L}=$;b($,()=>{A.$comment&&k.$comment&&oe($),J($),L.let(u.default.vErrors,null),L.let(u.default.errors,0),A.unevaluated&&g($),q($),se($)})}function g($){const{gen:k,validateName:A}=$;$.evaluated=k.const("evaluated",(0,a._)`${A}.evaluated`),k.if((0,a._)`${$.evaluated}.dynamicProps`,()=>k.assign((0,a._)`${$.evaluated}.props`,(0,a._)`undefined`)),k.if((0,a._)`${$.evaluated}.dynamicItems`,()=>k.assign((0,a._)`${$.evaluated}.items`,(0,a._)`undefined`))}function v($,k){const A=typeof $=="object"&&$[k.schemaId];return A&&(k.code.source||k.code.process)?(0,a._)`/*# sourceURL=${A} */`:a.nil}function T($,k){if(F($)&&(I($),j($))){S($,k);return}(0,e.boolOrEmptySchema)($,k)}function j({schema:$,self:k}){if(typeof $=="boolean")return!$;for(const A in $)if(k.RULES.all[A])return!0;return!1}function F($){return typeof $.schema!="boolean"}function S($,k){const{schema:A,gen:L,opts:W}=$;W.$comment&&A.$comment&&oe($),ie($),Q($);const x=L.const("_errs",u.default.errors);q($,x),L.var(k,(0,a._)`${x} === ${u.default.errors}`)}function I($){(0,f.checkUnknownRules)($),G($)}function q($,k){if($.opts.jtd)return Ue($,[],!1,k);const A=(0,t.getSchemaTypes)($.schema),L=(0,t.coerceAndCheckDataType)($,A);Ue($,A,!L,k)}function G($){const{schema:k,errSchemaPath:A,opts:L,self:W}=$;k.$ref&&L.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(k,W.RULES)&&W.logger.warn(`$ref: keywords ignored in schema at path "${A}"`)}function J($){const{schema:k,opts:A}=$;k.default!==void 0&&A.useDefaults&&A.strictSchema&&(0,f.checkStrictMode)($,"default is ignored in the schema root")}function ie($){const k=$.schema[$.opts.schemaId];k&&($.baseId=(0,d.resolveUrl)($.opts.uriResolver,$.baseId,k))}function Q($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function oe({gen:$,schemaEnv:k,schema:A,errSchemaPath:L,opts:W}){const x=A.$comment;if(W.$comment===!0)$.code((0,a._)`${u.default.self}.logger.log(${x})`);else if(typeof W.$comment=="function"){const $e=(0,a.str)`${L}/$comment`,Re=$.scopeValue("root",{ref:k.root});$.code((0,a._)`${u.default.self}.opts.$comment(${x}, ${$e}, ${Re}.schema)`)}}function se($){const{gen:k,schemaEnv:A,validateName:L,ValidationError:W,opts:x}=$;A.$async?k.if((0,a._)`${u.default.errors} === 0`,()=>k.return(u.default.data),()=>k.throw((0,a._)`new ${W}(${u.default.vErrors})`)):(k.assign((0,a._)`${L}.errors`,u.default.vErrors),x.unevaluated&&Ae($),k.return((0,a._)`${u.default.errors} === 0`))}function Ae({gen:$,evaluated:k,props:A,items:L}){A instanceof a.Name&&$.assign((0,a._)`${k}.props`,A),L instanceof a.Name&&$.assign((0,a._)`${k}.items`,L)}function Ue($,k,A,L){const{gen:W,schema:x,data:$e,allErrors:Re,opts:we,self:be}=$,{RULES:_e}=be;if(x.$ref&&(we.ignoreKeywordsWithRef||!(0,f.schemaHasRulesButRef)(x,_e))){W.block(()=>V($,"$ref",_e.all.$ref.definition));return}we.jtd||it($,k),W.block(()=>{for(const fe of _e.rules)Ne(fe);Ne(_e.post)});function Ne(fe){(0,r.shouldUseGroup)(x,fe)&&(fe.type?(W.if((0,s.checkDataType)(fe.type,$e,we.strictNumbers)),Je($,fe),k.length===1&&k[0]===fe.type&&A&&(W.else(),(0,s.reportTypeError)($)),W.endIf()):Je($,fe),Re||W.if((0,a._)`${u.default.errors} === ${L||0}`))}}function Je($,k){const{gen:A,schema:L,opts:{useDefaults:W}}=$;W&&(0,n.assignDefaults)($,k.type),A.block(()=>{for(const x of k.rules)(0,r.shouldUseRule)(L,x)&&V($,x.keyword,x.definition,k.type)})}function it($,k){$.schemaEnv.meta||!$.opts.strictTypes||(et($,k),$.opts.allowUnionTypes||U($,k),R($,$.dataTypes))}function et($,k){if(k.length){if(!$.dataTypes.length){$.dataTypes=k;return}k.forEach(A=>{O($.dataTypes,A)||h($,`type "${A}" not allowed by context "${$.dataTypes.join(",")}"`)}),o($,k)}}function U($,k){k.length>1&&!(k.length===2&&k.includes("null"))&&h($,"use allowUnionTypes to allow union type keyword")}function R($,k){const A=$.self.RULES.all;for(const L in A){const W=A[L];if(typeof W=="object"&&(0,r.shouldUseRule)($.schema,W)){const{type:x}=W.definition;x.length&&!x.some($e=>M(k,$e))&&h($,`missing type "${x.join(",")}" for keyword "${L}"`)}}}function M($,k){return $.includes(k)||k==="number"&&$.includes("integer")}function O($,k){return $.includes(k)||k==="integer"&&$.includes("number")}function o($,k){const A=[];for(const L of $.dataTypes)O(k,L)?A.push(L):k.includes("integer")&&L==="number"&&A.push("integer");$.dataTypes=A}function h($,k){const A=$.schemaEnv.baseId+$.errSchemaPath;k+=` at "${A}" (strictTypes)`,(0,f.checkStrictMode)($,k,$.opts.strictTypes)}class D{constructor(k,A,L){if((0,i.validateKeywordUsage)(k,A,L),this.gen=k.gen,this.allErrors=k.allErrors,this.keyword=L,this.data=k.data,this.schema=k.schema[L],this.$data=A.$data&&k.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(k,this.schema,L,this.$data),this.schemaType=A.schemaType,this.parentSchema=k.schema,this.params={},this.it=k,this.def=A,this.$data)this.schemaCode=k.gen.const("vSchema",Y(this.$data,k));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,A.schemaType,A.allowUndefined))throw new Error(`${L} value must be ${JSON.stringify(A.schemaType)}`);("code"in A?A.trackErrors:A.errors!==!1)&&(this.errsCount=k.gen.const("_errs",u.default.errors))}result(k,A,L){this.failResult((0,a.not)(k),A,L)}failResult(k,A,L){this.gen.if(k),L?L():this.error(),A?(this.gen.else(),A(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(k,A){this.failResult((0,a.not)(k),void 0,A)}fail(k){if(k===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(k),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(k){if(!this.$data)return this.fail(k);const{schemaCode:A}=this;this.fail((0,a._)`${A} !== undefined && (${(0,a.or)(this.invalid$data(),k)})`)}error(k,A,L){if(A){this.setParams(A),this._error(k,L),this.setParams({});return}this._error(k,L)}_error(k,A){(k?y.reportExtraError:y.reportError)(this,this.def.error,A)}$dataError(){(0,y.reportError)(this,this.def.$dataError||y.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,y.resetErrorsCount)(this.gen,this.errsCount)}ok(k){this.allErrors||this.gen.if(k)}setParams(k,A){A?Object.assign(this.params,k):this.params=k}block$data(k,A,L=a.nil){this.gen.block(()=>{this.check$data(k,L),A()})}check$data(k=a.nil,A=a.nil){if(!this.$data)return;const{gen:L,schemaCode:W,schemaType:x,def:$e}=this;L.if((0,a.or)((0,a._)`${W} === undefined`,A)),k!==a.nil&&L.assign(k,!0),(x.length||$e.validateSchema)&&(L.elseIf(this.invalid$data()),this.$dataError(),k!==a.nil&&L.assign(k,!1)),L.else()}invalid$data(){const{gen:k,schemaCode:A,schemaType:L,def:W,it:x}=this;return(0,a.or)($e(),Re());function $e(){if(L.length){if(!(A instanceof a.Name))throw new Error("ajv implementation error");const we=Array.isArray(L)?L:[L];return(0,a._)`${(0,s.checkDataTypes)(we,A,x.opts.strictNumbers,s.DataType.Wrong)}`}return a.nil}function Re(){if(W.validateSchema){const we=k.scopeValue("validate$data",{ref:W.validateSchema});return(0,a._)`!${we}(${A})`}return a.nil}}subschema(k,A){const L=(0,c.getSubschema)(this.it,k);(0,c.extendSubschemaData)(L,this.it,k),(0,c.extendSubschemaMode)(L,k);const W={...this.it,...L,items:void 0,props:void 0};return T(W,A),W}mergeEvaluated(k,A){const{it:L,gen:W}=this;L.opts.unevaluated&&(L.props!==!0&&k.props!==void 0&&(L.props=f.mergeEvaluated.props(W,k.props,L.props,A)),L.items!==!0&&k.items!==void 0&&(L.items=f.mergeEvaluated.items(W,k.items,L.items,A)))}mergeValidEvaluated(k,A){const{it:L,gen:W}=this;if(L.opts.unevaluated&&(L.props!==!0||L.items!==!0))return W.if(A,()=>this.mergeEvaluated(k,a.Name)),!0}}Ze.KeywordCxt=D;function V($,k,A,L){const W=new D($,A,k);"code"in A?A.code(W,L):W.$data&&A.validate?(0,i.funcKeywordCode)(W,A):"macro"in A?(0,i.macroKeywordCode)(W,A):(A.compile||A.validate)&&(0,i.funcKeywordCode)(W,A)}const z=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y($,{dataLevel:k,dataNames:A,dataPathArr:L}){let W,x;if($==="")return u.default.rootData;if($[0]==="/"){if(!z.test($))throw new Error(`Invalid JSON-pointer: ${$}`);W=$,x=u.default.rootData}else{const be=Z.exec($);if(!be)throw new Error(`Invalid JSON-pointer: ${$}`);const _e=+be[1];if(W=be[2],W==="#"){if(_e>=k)throw new Error(we("property/index",_e));return L[k-_e]}if(_e>k)throw new Error(we("data",_e));if(x=A[k-_e],!W)return x}let $e=x;const Re=W.split("/");for(const be of Re)be&&(x=(0,a._)`${x}${(0,a.getProperty)((0,f.unescapeJsonPointer)(be))}`,$e=(0,a._)`${$e} && ${x}`);return $e;function we(be,_e){return`Cannot access ${be} ${_e} levels up, current level is ${k}`}}return Ze.getData=Y,Ze}var zt={};Object.defineProperty(zt,"__esModule",{value:!0});class Fo extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}zt.default=Fo;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});const Er=Pe;class qo extends Error{constructor(t,r,s,n){super(n||`can't resolve reference ${s} from id ${r}`),this.missingRef=(0,Er.resolveUrl)(t,r,s),this.missingSchema=(0,Er.normalizeId)((0,Er.getFullPath)(t,this.missingRef))}}Wt.default=qo;var Oe={};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.resolveSchema=Oe.getCompilingSchema=Oe.resolveRef=Oe.compileSchema=Oe.SchemaEnv=void 0;const Fe=ee,Lo=zt,dt=Ke,Le=Pe,Jn=ne,Uo=yr();class gr{constructor(t){var r;this.refs={},this.dynamicAnchors={};let s;typeof t.schema=="object"&&(s=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Le.normalizeId)(s==null?void 0:s[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=s==null?void 0:s.$async,this.refs={}}}Oe.SchemaEnv=gr;function xr(e){const t=Js.call(this,e);if(t)return t;const r=(0,Le.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:n}=this.opts.code,{ownProperties:i}=this.opts,c=new Fe.CodeGen(this.scope,{es5:s,lines:n,ownProperties:i});let a;e.$async&&(a=c.scopeValue("Error",{ref:Lo.default,code:(0,Fe._)`require("ajv/dist/runtime/validation_error").default`}));const u=c.scopeName("validate");e.validateName=u;const d={gen:c,allErrors:this.opts.allErrors,data:dt.default.data,parentData:dt.default.parentData,parentDataProperty:dt.default.parentDataProperty,dataNames:[dt.default.data],dataPathArr:[Fe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Fe.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Fe.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Fe._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,Uo.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);const y=c.toString();f=`${c.scopeRefs(dt.default.scope)}return ${y}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const b=new Function(`${dt.default.self}`,`${dt.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:b}),b.errors=null,b.schema=e.schema,b.schemaEnv=e,e.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:u,validateCode:y,scopeValues:c._values}),this.opts.unevaluated){const{props:_,items:E}=d;b.evaluated={props:_ instanceof Fe.Name?void 0:_,items:E instanceof Fe.Name?void 0:E,dynamicProps:_ instanceof Fe.Name,dynamicItems:E instanceof Fe.Name},b.source&&(b.source.evaluated=(0,Fe.stringify)(b.evaluated))}return e.validate=b,e}catch(y){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),y}finally{this._compilations.delete(e)}}Oe.compileSchema=xr;function Vo(e,t,r){var s;r=(0,Le.resolveUrl)(this.opts.uriResolver,t,r);const n=e.refs[r];if(n)return n;let i=Bo.call(this,e,r);if(i===void 0){const c=(s=e.localRefs)===null||s===void 0?void 0:s[r],{schemaId:a}=this.opts;c&&(i=new gr({schema:c,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=zo.call(this,i)}Oe.resolveRef=Vo;function zo(e){return(0,Le.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:xr.call(this,e)}function Js(e){for(const t of this._compilations)if(Wo(t,e))return t}Oe.getCompilingSchema=Js;function Wo(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Bo(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||$r.call(this,e,t)}function $r(e,t){const r=this.opts.uriResolver.parse(t),s=(0,Le._getFullPath)(this.opts.uriResolver,r);let n=(0,Le.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===n)return Pr.call(this,r,e);const i=(0,Le.normalizeId)(s),c=this.refs[i]||this.schemas[i];if(typeof c=="string"){const a=$r.call(this,e,c);return typeof(a==null?void 0:a.schema)!="object"?void 0:Pr.call(this,r,a)}if(typeof(c==null?void 0:c.schema)=="object"){if(c.validate||xr.call(this,c),i===(0,Le.normalizeId)(t)){const{schema:a}=c,{schemaId:u}=this.opts,d=a[u];return d&&(n=(0,Le.resolveUrl)(this.opts.uriResolver,n,d)),new gr({schema:a,schemaId:u,root:e,baseId:n})}return Pr.call(this,r,c)}}Oe.resolveSchema=$r;const Ho=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Pr(e,{baseId:t,schema:r,root:s}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const u=r[(0,Jn.unescapeFragment)(a)];if(u===void 0)return;r=u;const d=typeof r=="object"&&r[this.opts.schemaId];!Ho.has(a)&&d&&(t=(0,Le.resolveUrl)(this.opts.uriResolver,t,d))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Jn.schemaHasRulesButRef)(r,this.RULES)){const a=(0,Le.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=$r.call(this,s,a)}const{schemaId:c}=this.opts;if(i=i||new gr({schema:r,schemaId:c,root:s,baseId:t}),i.schema!==i.root.schema)return i}const Go="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",xo="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ko="object",Jo=["$data"],Qo={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Zo=!1,Yo={$id:Go,description:xo,type:Ko,required:Jo,properties:Qo,additionalProperties:Zo};var Kr={},Ir={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(r,s){s(t)})(Hi,function(r){function s(){for(var p=arguments.length,l=Array(p),m=0;m<p;m++)l[m]=arguments[m];if(l.length>1){l[0]=l[0].slice(0,-1);for(var C=l.length-1,N=1;N<C;++N)l[N]=l[N].slice(1,-1);return l[C]=l[C].slice(1),l.join("")}else return l[0]}function n(p){return"(?:"+p+")"}function i(p){return p===void 0?"undefined":p===null?"null":Object.prototype.toString.call(p).split(" ").pop().split("]").shift().toLowerCase()}function c(p){return p.toUpperCase()}function a(p){return p!=null?p instanceof Array?p:typeof p.length!="number"||p.split||p.setInterval||p.call?[p]:Array.prototype.slice.call(p):[]}function u(p,l){var m=p;if(l)for(var C in l)m[C]=l[C];return m}function d(p){var l="[A-Za-z]",m="[0-9]",C=s(m,"[A-Fa-f]"),N=n(n("%[EFef]"+C+"%"+C+C+"%"+C+C)+"|"+n("%[89A-Fa-f]"+C+"%"+C+C)+"|"+n("%"+C+C)),B="[\\:\\/\\?\\#\\[\\]\\@]",H="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",re=s(B,H),ce=p?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",pe=p?"[\\uE000-\\uF8FF]":"[]",te=s(l,m,"[\\-\\.\\_\\~]",ce);n(l+s(l,m,"[\\+\\-\\.]")+"*"),n(n(N+"|"+s(te,H,"[\\:]"))+"*");var ae=n(n("25[0-5]")+"|"+n("2[0-4]"+m)+"|"+n("1"+m+m)+"|"+n("0?[1-9]"+m)+"|0?0?"+m),he=n(ae+"\\."+ae+"\\."+ae+"\\."+ae),K=n(C+"{1,4}"),ue=n(n(K+"\\:"+K)+"|"+he),ge=n(n(K+"\\:")+"{6}"+ue),de=n("\\:\\:"+n(K+"\\:")+"{5}"+ue),tt=n(n(K)+"?\\:\\:"+n(K+"\\:")+"{4}"+ue),ze=n(n(n(K+"\\:")+"{0,1}"+K)+"?\\:\\:"+n(K+"\\:")+"{3}"+ue),We=n(n(n(K+"\\:")+"{0,2}"+K)+"?\\:\\:"+n(K+"\\:")+"{2}"+ue),_t=n(n(n(K+"\\:")+"{0,3}"+K)+"?\\:\\:"+K+"\\:"+ue),ct=n(n(n(K+"\\:")+"{0,4}"+K)+"?\\:\\:"+ue),Ie=n(n(n(K+"\\:")+"{0,5}"+K)+"?\\:\\:"+K),Be=n(n(n(K+"\\:")+"{0,6}"+K)+"?\\:\\:"),lt=n([ge,de,tt,ze,We,_t,ct,Ie,Be].join("|")),Qe=n(n(te+"|"+N)+"+");n("[vV]"+C+"+\\."+s(te,H,"[\\:]")+"+"),n(n(N+"|"+s(te,H))+"*");var Ot=n(N+"|"+s(te,H,"[\\:\\@]"));return n(n(N+"|"+s(te,H,"[\\@]"))+"+"),n(n(Ot+"|"+s("[\\/\\?]",pe))+"*"),{NOT_SCHEME:new RegExp(s("[^]",l,m,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(s("[^\\%\\:]",te,H),"g"),NOT_HOST:new RegExp(s("[^\\%\\[\\]\\:]",te,H),"g"),NOT_PATH:new RegExp(s("[^\\%\\/\\:\\@]",te,H),"g"),NOT_PATH_NOSCHEME:new RegExp(s("[^\\%\\/\\@]",te,H),"g"),NOT_QUERY:new RegExp(s("[^\\%]",te,H,"[\\:\\@\\/\\?]",pe),"g"),NOT_FRAGMENT:new RegExp(s("[^\\%]",te,H,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(s("[^]",te,H),"g"),UNRESERVED:new RegExp(te,"g"),OTHER_CHARS:new RegExp(s("[^\\%]",te,re),"g"),PCT_ENCODED:new RegExp(N,"g"),IPV4ADDRESS:new RegExp("^("+he+")$"),IPV6ADDRESS:new RegExp("^\\[?("+lt+")"+n(n("\\%25|\\%(?!"+C+"{2})")+"("+Qe+")")+"?\\]?$")}}var f=d(!1),y=d(!0),P=function(){function p(l,m){var C=[],N=!0,B=!1,H=void 0;try{for(var re=l[Symbol.iterator](),ce;!(N=(ce=re.next()).done)&&(C.push(ce.value),!(m&&C.length===m));N=!0);}catch(pe){B=!0,H=pe}finally{try{!N&&re.return&&re.return()}finally{if(B)throw H}}return C}return function(l,m){if(Array.isArray(l))return l;if(Symbol.iterator in Object(l))return p(l,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(p){if(Array.isArray(p)){for(var l=0,m=Array(p.length);l<p.length;l++)m[l]=p[l];return m}else return Array.from(p)},_=2147483647,E=36,w=1,g=26,v=38,T=700,j=72,F=128,S="-",I=/^xn--/,q=/[^\0-\x7E]/,G=/[\x2E\u3002\uFF0E\uFF61]/g,J={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ie=E-w,Q=Math.floor,oe=String.fromCharCode;function se(p){throw new RangeError(J[p])}function Ae(p,l){for(var m=[],C=p.length;C--;)m[C]=l(p[C]);return m}function Ue(p,l){var m=p.split("@"),C="";m.length>1&&(C=m[0]+"@",p=m[1]),p=p.replace(G,".");var N=p.split("."),B=Ae(N,l).join(".");return C+B}function Je(p){for(var l=[],m=0,C=p.length;m<C;){var N=p.charCodeAt(m++);if(N>=55296&&N<=56319&&m<C){var B=p.charCodeAt(m++);(B&64512)==56320?l.push(((N&1023)<<10)+(B&1023)+65536):(l.push(N),m--)}else l.push(N)}return l}var it=function(l){return String.fromCodePoint.apply(String,b(l))},et=function(l){return l-48<10?l-22:l-65<26?l-65:l-97<26?l-97:E},U=function(l,m){return l+22+75*(l<26)-((m!=0)<<5)},R=function(l,m,C){var N=0;for(l=C?Q(l/T):l>>1,l+=Q(l/m);l>ie*g>>1;N+=E)l=Q(l/ie);return Q(N+(ie+1)*l/(l+v))},M=function(l){var m=[],C=l.length,N=0,B=F,H=j,re=l.lastIndexOf(S);re<0&&(re=0);for(var ce=0;ce<re;++ce)l.charCodeAt(ce)>=128&&se("not-basic"),m.push(l.charCodeAt(ce));for(var pe=re>0?re+1:0;pe<C;){for(var te=N,ae=1,he=E;;he+=E){pe>=C&&se("invalid-input");var K=et(l.charCodeAt(pe++));(K>=E||K>Q((_-N)/ae))&&se("overflow"),N+=K*ae;var ue=he<=H?w:he>=H+g?g:he-H;if(K<ue)break;var ge=E-ue;ae>Q(_/ge)&&se("overflow"),ae*=ge}var de=m.length+1;H=R(N-te,de,te==0),Q(N/de)>_-B&&se("overflow"),B+=Q(N/de),N%=de,m.splice(N++,0,B)}return String.fromCodePoint.apply(String,m)},O=function(l){var m=[];l=Je(l);var C=l.length,N=F,B=0,H=j,re=!0,ce=!1,pe=void 0;try{for(var te=l[Symbol.iterator](),ae;!(re=(ae=te.next()).done);re=!0){var he=ae.value;he<128&&m.push(oe(he))}}catch(Nt){ce=!0,pe=Nt}finally{try{!re&&te.return&&te.return()}finally{if(ce)throw pe}}var K=m.length,ue=K;for(K&&m.push(S);ue<C;){var ge=_,de=!0,tt=!1,ze=void 0;try{for(var We=l[Symbol.iterator](),_t;!(de=(_t=We.next()).done);de=!0){var ct=_t.value;ct>=N&&ct<ge&&(ge=ct)}}catch(Nt){tt=!0,ze=Nt}finally{try{!de&&We.return&&We.return()}finally{if(tt)throw ze}}var Ie=ue+1;ge-N>Q((_-B)/Ie)&&se("overflow"),B+=(ge-N)*Ie,N=ge;var Be=!0,lt=!1,Qe=void 0;try{for(var Ot=l[Symbol.iterator](),An;!(Be=(An=Ot.next()).done);Be=!0){var Mn=An.value;if(Mn<N&&++B>_&&se("overflow"),Mn==N){for(var Gt=B,xt=E;;xt+=E){var Kt=xt<=H?w:xt>=H+g?g:xt-H;if(Gt<Kt)break;var Fn=Gt-Kt,qn=E-Kt;m.push(oe(U(Kt+Fn%qn,0))),Gt=Q(Fn/qn)}m.push(oe(U(Gt,0))),H=R(B,Ie,ue==K),B=0,++ue}}}catch(Nt){lt=!0,Qe=Nt}finally{try{!Be&&Ot.return&&Ot.return()}finally{if(lt)throw Qe}}++B,++N}return m.join("")},o=function(l){return Ue(l,function(m){return I.test(m)?M(m.slice(4).toLowerCase()):m})},h=function(l){return Ue(l,function(m){return q.test(m)?"xn--"+O(m):m})},D={version:"2.1.0",ucs2:{decode:Je,encode:it},decode:M,encode:O,toASCII:h,toUnicode:o},V={};function z(p){var l=p.charCodeAt(0),m=void 0;return l<16?m="%0"+l.toString(16).toUpperCase():l<128?m="%"+l.toString(16).toUpperCase():l<2048?m="%"+(l>>6|192).toString(16).toUpperCase()+"%"+(l&63|128).toString(16).toUpperCase():m="%"+(l>>12|224).toString(16).toUpperCase()+"%"+(l>>6&63|128).toString(16).toUpperCase()+"%"+(l&63|128).toString(16).toUpperCase(),m}function Z(p){for(var l="",m=0,C=p.length;m<C;){var N=parseInt(p.substr(m+1,2),16);if(N<128)l+=String.fromCharCode(N),m+=3;else if(N>=194&&N<224){if(C-m>=6){var B=parseInt(p.substr(m+4,2),16);l+=String.fromCharCode((N&31)<<6|B&63)}else l+=p.substr(m,6);m+=6}else if(N>=224){if(C-m>=9){var H=parseInt(p.substr(m+4,2),16),re=parseInt(p.substr(m+7,2),16);l+=String.fromCharCode((N&15)<<12|(H&63)<<6|re&63)}else l+=p.substr(m,9);m+=9}else l+=p.substr(m,3),m+=3}return l}function Y(p,l){function m(C){var N=Z(C);return N.match(l.UNRESERVED)?N:C}return p.scheme&&(p.scheme=String(p.scheme).replace(l.PCT_ENCODED,m).toLowerCase().replace(l.NOT_SCHEME,"")),p.userinfo!==void 0&&(p.userinfo=String(p.userinfo).replace(l.PCT_ENCODED,m).replace(l.NOT_USERINFO,z).replace(l.PCT_ENCODED,c)),p.host!==void 0&&(p.host=String(p.host).replace(l.PCT_ENCODED,m).toLowerCase().replace(l.NOT_HOST,z).replace(l.PCT_ENCODED,c)),p.path!==void 0&&(p.path=String(p.path).replace(l.PCT_ENCODED,m).replace(p.scheme?l.NOT_PATH:l.NOT_PATH_NOSCHEME,z).replace(l.PCT_ENCODED,c)),p.query!==void 0&&(p.query=String(p.query).replace(l.PCT_ENCODED,m).replace(l.NOT_QUERY,z).replace(l.PCT_ENCODED,c)),p.fragment!==void 0&&(p.fragment=String(p.fragment).replace(l.PCT_ENCODED,m).replace(l.NOT_FRAGMENT,z).replace(l.PCT_ENCODED,c)),p}function $(p){return p.replace(/^0*(.*)/,"$1")||"0"}function k(p,l){var m=p.match(l.IPV4ADDRESS)||[],C=P(m,2),N=C[1];return N?N.split(".").map($).join("."):p}function A(p,l){var m=p.match(l.IPV6ADDRESS)||[],C=P(m,3),N=C[1],B=C[2];if(N){for(var H=N.toLowerCase().split("::").reverse(),re=P(H,2),ce=re[0],pe=re[1],te=pe?pe.split(":").map($):[],ae=ce.split(":").map($),he=l.IPV4ADDRESS.test(ae[ae.length-1]),K=he?7:8,ue=ae.length-K,ge=Array(K),de=0;de<K;++de)ge[de]=te[de]||ae[ue+de]||"";he&&(ge[K-1]=k(ge[K-1],l));var tt=ge.reduce(function(Ie,Be,lt){if(!Be||Be==="0"){var Qe=Ie[Ie.length-1];Qe&&Qe.index+Qe.length===lt?Qe.length++:Ie.push({index:lt,length:1})}return Ie},[]),ze=tt.sort(function(Ie,Be){return Be.length-Ie.length})[0],We=void 0;if(ze&&ze.length>1){var _t=ge.slice(0,ze.index),ct=ge.slice(ze.index+ze.length);We=_t.join(":")+"::"+ct.join(":")}else We=ge.join(":");return B&&(We+="%"+B),We}else return p}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,W="".match(/(){0}/)[1]===void 0;function x(p){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m={},C=l.iri!==!1?y:f;l.reference==="suffix"&&(p=(l.scheme?l.scheme+":":"")+"//"+p);var N=p.match(L);if(N){W?(m.scheme=N[1],m.userinfo=N[3],m.host=N[4],m.port=parseInt(N[5],10),m.path=N[6]||"",m.query=N[7],m.fragment=N[8],isNaN(m.port)&&(m.port=N[5])):(m.scheme=N[1]||void 0,m.userinfo=p.indexOf("@")!==-1?N[3]:void 0,m.host=p.indexOf("//")!==-1?N[4]:void 0,m.port=parseInt(N[5],10),m.path=N[6]||"",m.query=p.indexOf("?")!==-1?N[7]:void 0,m.fragment=p.indexOf("#")!==-1?N[8]:void 0,isNaN(m.port)&&(m.port=p.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?N[4]:void 0)),m.host&&(m.host=A(k(m.host,C),C)),m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&!m.path&&m.query===void 0?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference="uri",l.reference&&l.reference!=="suffix"&&l.reference!==m.reference&&(m.error=m.error||"URI is not a "+l.reference+" reference.");var B=V[(l.scheme||m.scheme||"").toLowerCase()];if(!l.unicodeSupport&&(!B||!B.unicodeSupport)){if(m.host&&(l.domainHost||B&&B.domainHost))try{m.host=D.toASCII(m.host.replace(C.PCT_ENCODED,Z).toLowerCase())}catch(H){m.error=m.error||"Host's domain name can not be converted to ASCII via punycode: "+H}Y(m,f)}else Y(m,C);B&&B.parse&&B.parse(m,l)}else m.error=m.error||"URI can not be parsed.";return m}function $e(p,l){var m=l.iri!==!1?y:f,C=[];return p.userinfo!==void 0&&(C.push(p.userinfo),C.push("@")),p.host!==void 0&&C.push(A(k(String(p.host),m),m).replace(m.IPV6ADDRESS,function(N,B,H){return"["+B+(H?"%25"+H:"")+"]"})),(typeof p.port=="number"||typeof p.port=="string")&&(C.push(":"),C.push(String(p.port))),C.length?C.join(""):void 0}var Re=/^\.\.?\//,we=/^\/\.(\/|$)/,be=/^\/\.\.(\/|$)/,_e=/^\/?(?:.|\n)*?(?=\/|$)/;function Ne(p){for(var l=[];p.length;)if(p.match(Re))p=p.replace(Re,"");else if(p.match(we))p=p.replace(we,"/");else if(p.match(be))p=p.replace(be,"/"),l.pop();else if(p==="."||p==="..")p="";else{var m=p.match(_e);if(m){var C=m[0];p=p.slice(C.length),l.push(C)}else throw new Error("Unexpected dot segment condition")}return l.join("")}function fe(p){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=l.iri?y:f,C=[],N=V[(l.scheme||p.scheme||"").toLowerCase()];if(N&&N.serialize&&N.serialize(p,l),p.host&&!m.IPV6ADDRESS.test(p.host)){if(l.domainHost||N&&N.domainHost)try{p.host=l.iri?D.toUnicode(p.host):D.toASCII(p.host.replace(m.PCT_ENCODED,Z).toLowerCase())}catch(re){p.error=p.error||"Host's domain name can not be converted to "+(l.iri?"Unicode":"ASCII")+" via punycode: "+re}}Y(p,m),l.reference!=="suffix"&&p.scheme&&(C.push(p.scheme),C.push(":"));var B=$e(p,l);if(B!==void 0&&(l.reference!=="suffix"&&C.push("//"),C.push(B),p.path&&p.path.charAt(0)!=="/"&&C.push("/")),p.path!==void 0){var H=p.path;!l.absolutePath&&(!N||!N.absolutePath)&&(H=Ne(H)),B===void 0&&(H=H.replace(/^\/\//,"/%2F")),C.push(H)}return p.query!==void 0&&(C.push("?"),C.push(p.query)),p.fragment!==void 0&&(C.push("#"),C.push(p.fragment)),C.join("")}function gt(p,l){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=arguments[3],N={};return C||(p=x(fe(p,m),m),l=x(fe(l,m),m)),m=m||{},!m.tolerant&&l.scheme?(N.scheme=l.scheme,N.userinfo=l.userinfo,N.host=l.host,N.port=l.port,N.path=Ne(l.path||""),N.query=l.query):(l.userinfo!==void 0||l.host!==void 0||l.port!==void 0?(N.userinfo=l.userinfo,N.host=l.host,N.port=l.port,N.path=Ne(l.path||""),N.query=l.query):(l.path?(l.path.charAt(0)==="/"?N.path=Ne(l.path):((p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?N.path="/"+l.path:p.path?N.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+l.path:N.path=l.path,N.path=Ne(N.path)),N.query=l.query):(N.path=p.path,l.query!==void 0?N.query=l.query:N.query=p.query),N.userinfo=p.userinfo,N.host=p.host,N.port=p.port),N.scheme=p.scheme),N.fragment=l.fragment,N}function Tt(p,l,m){var C=u({scheme:"null"},m);return fe(gt(x(p,C),x(l,C),C,!0),C)}function ot(p,l){return typeof p=="string"?p=fe(x(p,l),l):i(p)==="object"&&(p=x(fe(p,l),l)),p}function Rt(p,l,m){return typeof p=="string"?p=fe(x(p,m),m):i(p)==="object"&&(p=fe(p,m)),typeof l=="string"?l=fe(x(l,m),m):i(l)==="object"&&(l=fe(l,m)),p===l}function Ht(p,l){return p&&p.toString().replace(!l||!l.iri?f.ESCAPE:y.ESCAPE,z)}function Ce(p,l){return p&&p.toString().replace(!l||!l.iri?f.PCT_ENCODED:y.PCT_ENCODED,Z)}var at={scheme:"http",domainHost:!0,parse:function(l,m){return l.host||(l.error=l.error||"HTTP URIs must have a host."),l},serialize:function(l,m){var C=String(l.scheme).toLowerCase()==="https";return(l.port===(C?443:80)||l.port==="")&&(l.port=void 0),l.path||(l.path="/"),l}},Rn={scheme:"https",domainHost:at.domainHost,parse:at.parse,serialize:at.serialize};function kn(p){return typeof p.secure=="boolean"?p.secure:String(p.scheme).toLowerCase()==="wss"}var kt={scheme:"ws",domainHost:!0,parse:function(l,m){var C=l;return C.secure=kn(C),C.resourceName=(C.path||"/")+(C.query?"?"+C.query:""),C.path=void 0,C.query=void 0,C},serialize:function(l,m){if((l.port===(kn(l)?443:80)||l.port==="")&&(l.port=void 0),typeof l.secure=="boolean"&&(l.scheme=l.secure?"wss":"ws",l.secure=void 0),l.resourceName){var C=l.resourceName.split("?"),N=P(C,2),B=N[0],H=N[1];l.path=B&&B!=="/"?B:void 0,l.query=H,l.resourceName=void 0}return l.fragment=void 0,l}},On={scheme:"wss",domainHost:kt.domainHost,parse:kt.parse,serialize:kt.serialize},oi={},Nn="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ve="[0-9A-Fa-f]",ai=n(n("%[EFef]"+Ve+"%"+Ve+Ve+"%"+Ve+Ve)+"|"+n("%[89A-Fa-f]"+Ve+"%"+Ve+Ve)+"|"+n("%"+Ve+Ve)),ci="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",li="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",ui=s(li,'[\\"\\\\]'),di="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",fi=new RegExp(Nn,"g"),$t=new RegExp(ai,"g"),pi=new RegExp(s("[^]",ci,"[\\.]",'[\\"]',ui),"g"),Cn=new RegExp(s("[^]",Nn,di),"g"),hi=Cn;function vr(p){var l=Z(p);return l.match(fi)?l:p}var In={scheme:"mailto",parse:function(l,m){var C=l,N=C.to=C.path?C.path.split(","):[];if(C.path=void 0,C.query){for(var B=!1,H={},re=C.query.split("&"),ce=0,pe=re.length;ce<pe;++ce){var te=re[ce].split("=");switch(te[0]){case"to":for(var ae=te[1].split(","),he=0,K=ae.length;he<K;++he)N.push(ae[he]);break;case"subject":C.subject=Ce(te[1],m);break;case"body":C.body=Ce(te[1],m);break;default:B=!0,H[Ce(te[0],m)]=Ce(te[1],m);break}}B&&(C.headers=H)}C.query=void 0;for(var ue=0,ge=N.length;ue<ge;++ue){var de=N[ue].split("@");if(de[0]=Ce(de[0]),m.unicodeSupport)de[1]=Ce(de[1],m).toLowerCase();else try{de[1]=D.toASCII(Ce(de[1],m).toLowerCase())}catch(tt){C.error=C.error||"Email address's domain name can not be converted to ASCII via punycode: "+tt}N[ue]=de.join("@")}return C},serialize:function(l,m){var C=l,N=a(l.to);if(N){for(var B=0,H=N.length;B<H;++B){var re=String(N[B]),ce=re.lastIndexOf("@"),pe=re.slice(0,ce).replace($t,vr).replace($t,c).replace(pi,z),te=re.slice(ce+1);try{te=m.iri?D.toUnicode(te):D.toASCII(Ce(te,m).toLowerCase())}catch(ue){C.error=C.error||"Email address's domain name can not be converted to "+(m.iri?"Unicode":"ASCII")+" via punycode: "+ue}N[B]=pe+"@"+te}C.path=N.join(",")}var ae=l.headers=l.headers||{};l.subject&&(ae.subject=l.subject),l.body&&(ae.body=l.body);var he=[];for(var K in ae)ae[K]!==oi[K]&&he.push(K.replace($t,vr).replace($t,c).replace(Cn,z)+"="+ae[K].replace($t,vr).replace($t,c).replace(hi,z));return he.length&&(C.query=he.join("&")),C}},mi=/^([^\:]+)\:(.*)/,jn={scheme:"urn",parse:function(l,m){var C=l.path&&l.path.match(mi),N=l;if(C){var B=m.scheme||N.scheme||"urn",H=C[1].toLowerCase(),re=C[2],ce=B+":"+(m.nid||H),pe=V[ce];N.nid=H,N.nss=re,N.path=void 0,pe&&(N=pe.parse(N,m))}else N.error=N.error||"URN can not be parsed.";return N},serialize:function(l,m){var C=m.scheme||l.scheme||"urn",N=l.nid,B=C+":"+(m.nid||N),H=V[B];H&&(l=H.serialize(l,m));var re=l,ce=l.nss;return re.path=(N||m.nid)+":"+ce,re}},yi=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Dn={scheme:"urn:uuid",parse:function(l,m){var C=l;return C.uuid=C.nss,C.nss=void 0,!m.tolerant&&(!C.uuid||!C.uuid.match(yi))&&(C.error=C.error||"UUID is not valid."),C},serialize:function(l,m){var C=l;return C.nss=(l.uuid||"").toLowerCase(),C}};V[at.scheme]=at,V[Rn.scheme]=Rn,V[kt.scheme]=kt,V[On.scheme]=On,V[In.scheme]=In,V[jn.scheme]=jn,V[Dn.scheme]=Dn,r.SCHEMES=V,r.pctEncChar=z,r.pctDecChars=Z,r.parse=x,r.removeDotSegments=Ne,r.serialize=fe,r.resolveComponents=gt,r.resolve=Tt,r.normalize=ot,r.equal=Rt,r.escapeComponent=Ht,r.unescapeComponent=Ce,Object.defineProperty(r,"__esModule",{value:!0})})})(Ir,Ir.exports);var Xo=Ir.exports;Object.defineProperty(Kr,"__esModule",{value:!0});const Qs=Xo;Qs.code='require("ajv/dist/runtime/uri").default';Kr.default=Qs;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=yr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ee;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const s=zt,n=Wt,i=ht,c=Oe,a=ee,u=Pe,d=Ut,f=ne,y=Yo,P=Kr,b=(U,R)=>new RegExp(U,R);b.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],E=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function T(U){var R,M,O,o,h,D,V,z,Z,Y,$,k,A,L,W,x,$e,Re,we,be,_e,Ne,fe,gt,Tt;const ot=U.strict,Rt=(R=U.code)===null||R===void 0?void 0:R.optimize,Ht=Rt===!0||Rt===void 0?1:Rt||0,Ce=(O=(M=U.code)===null||M===void 0?void 0:M.regExp)!==null&&O!==void 0?O:b,at=(o=U.uriResolver)!==null&&o!==void 0?o:P.default;return{strictSchema:(D=(h=U.strictSchema)!==null&&h!==void 0?h:ot)!==null&&D!==void 0?D:!0,strictNumbers:(z=(V=U.strictNumbers)!==null&&V!==void 0?V:ot)!==null&&z!==void 0?z:!0,strictTypes:(Y=(Z=U.strictTypes)!==null&&Z!==void 0?Z:ot)!==null&&Y!==void 0?Y:"log",strictTuples:(k=($=U.strictTuples)!==null&&$!==void 0?$:ot)!==null&&k!==void 0?k:"log",strictRequired:(L=(A=U.strictRequired)!==null&&A!==void 0?A:ot)!==null&&L!==void 0?L:!1,code:U.code?{...U.code,optimize:Ht,regExp:Ce}:{optimize:Ht,regExp:Ce},loopRequired:(W=U.loopRequired)!==null&&W!==void 0?W:v,loopEnum:(x=U.loopEnum)!==null&&x!==void 0?x:v,meta:($e=U.meta)!==null&&$e!==void 0?$e:!0,messages:(Re=U.messages)!==null&&Re!==void 0?Re:!0,inlineRefs:(we=U.inlineRefs)!==null&&we!==void 0?we:!0,schemaId:(be=U.schemaId)!==null&&be!==void 0?be:"$id",addUsedSchema:(_e=U.addUsedSchema)!==null&&_e!==void 0?_e:!0,validateSchema:(Ne=U.validateSchema)!==null&&Ne!==void 0?Ne:!0,validateFormats:(fe=U.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(gt=U.unicodeRegExp)!==null&>!==void 0?gt:!0,int32range:(Tt=U.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:at}}class j{constructor(R={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,R=this.opts={...R,...T(R)};const{es5:M,lines:O}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:E,es5:M,lines:O}),this.logger=Q(R.logger);const o=R.validateFormats;R.validateFormats=!1,this.RULES=(0,i.getRules)(),F.call(this,w,R,"NOT SUPPORTED"),F.call(this,g,R,"DEPRECATED","warn"),this._metaOpts=J.call(this),R.formats&&q.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),R.keywords&&G.call(this,R.keywords),typeof R.meta=="object"&&this.addMetaSchema(R.meta),I.call(this),R.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:R,meta:M,schemaId:O}=this.opts;let o=y;O==="id"&&(o={...y},o.id=o.$id,delete o.$id),M&&R&&this.addMetaSchema(o,o[O],!1)}defaultMeta(){const{meta:R,schemaId:M}=this.opts;return this.opts.defaultMeta=typeof R=="object"?R[M]||R:void 0}validate(R,M){let O;if(typeof R=="string"){if(O=this.getSchema(R),!O)throw new Error(`no schema with key or ref "${R}"`)}else O=this.compile(R);const o=O(M);return"$async"in O||(this.errors=O.errors),o}compile(R,M){const O=this._addSchema(R,M);return O.validate||this._compileSchemaEnv(O)}compileAsync(R,M){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return o.call(this,R,M);async function o(Y,$){await h.call(this,Y.$schema);const k=this._addSchema(Y,$);return k.validate||D.call(this,k)}async function h(Y){Y&&!this.getSchema(Y)&&await o.call(this,{$ref:Y},!0)}async function D(Y){try{return this._compileSchemaEnv(Y)}catch($){if(!($ instanceof n.default))throw $;return V.call(this,$),await z.call(this,$.missingSchema),D.call(this,Y)}}function V({missingSchema:Y,missingRef:$}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${$} cannot be resolved`)}async function z(Y){const $=await Z.call(this,Y);this.refs[Y]||await h.call(this,$.$schema),this.refs[Y]||this.addSchema($,Y,M)}async function Z(Y){const $=this._loading[Y];if($)return $;try{return await(this._loading[Y]=O(Y))}finally{delete this._loading[Y]}}}addSchema(R,M,O,o=this.opts.validateSchema){if(Array.isArray(R)){for(const D of R)this.addSchema(D,void 0,O,o);return this}let h;if(typeof R=="object"){const{schemaId:D}=this.opts;if(h=R[D],h!==void 0&&typeof h!="string")throw new Error(`schema ${D} must be string`)}return M=(0,u.normalizeId)(M||h),this._checkUnique(M),this.schemas[M]=this._addSchema(R,O,M,o,!0),this}addMetaSchema(R,M,O=this.opts.validateSchema){return this.addSchema(R,M,!0,O),this}validateSchema(R,M){if(typeof R=="boolean")return!0;let O;if(O=R.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const o=this.validate(O,R);if(!o&&M){const h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw new Error(h)}return o}getSchema(R){let M;for(;typeof(M=S.call(this,R))=="string";)R=M;if(M===void 0){const{schemaId:O}=this.opts,o=new c.SchemaEnv({schema:{},schemaId:O});if(M=c.resolveSchema.call(this,o,R),!M)return;this.refs[R]=M}return M.validate||this._compileSchemaEnv(M)}removeSchema(R){if(R instanceof RegExp)return this._removeAllSchemas(this.schemas,R),this._removeAllSchemas(this.refs,R),this;switch(typeof R){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const M=S.call(this,R);return typeof M=="object"&&this._cache.delete(M.schema),delete this.schemas[R],delete this.refs[R],this}case"object":{const M=R;this._cache.delete(M);let O=R[this.opts.schemaId];return O&&(O=(0,u.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(R){for(const M of R)this.addKeyword(M);return this}addKeyword(R,M){let O;if(typeof R=="string")O=R,typeof M=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),M.keyword=O);else if(typeof R=="object"&&M===void 0){if(M=R,O=M.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(se.call(this,O,M),!M)return(0,f.eachItem)(O,h=>Ae.call(this,h)),this;Je.call(this,M);const o={...M,type:(0,d.getJSONTypes)(M.type),schemaType:(0,d.getJSONTypes)(M.schemaType)};return(0,f.eachItem)(O,o.type.length===0?h=>Ae.call(this,h,o):h=>o.type.forEach(D=>Ae.call(this,h,o,D))),this}getKeyword(R){const M=this.RULES.all[R];return typeof M=="object"?M.definition:!!M}removeKeyword(R){const{RULES:M}=this;delete M.keywords[R],delete M.all[R];for(const O of M.rules){const o=O.rules.findIndex(h=>h.keyword===R);o>=0&&O.rules.splice(o,1)}return this}addFormat(R,M){return typeof M=="string"&&(M=new RegExp(M)),this.formats[R]=M,this}errorsText(R=this.errors,{separator:M=", ",dataVar:O="data"}={}){return!R||R.length===0?"No errors":R.map(o=>`${O}${o.instancePath} ${o.message}`).reduce((o,h)=>o+M+h)}$dataMetaSchema(R,M){const O=this.RULES.all;R=JSON.parse(JSON.stringify(R));for(const o of M){const h=o.split("/").slice(1);let D=R;for(const V of h)D=D[V];for(const V in O){const z=O[V];if(typeof z!="object")continue;const{$data:Z}=z.definition,Y=D[V];Z&&Y&&(D[V]=et(Y))}}return R}_removeAllSchemas(R,M){for(const O in R){const o=R[O];(!M||M.test(O))&&(typeof o=="string"?delete R[O]:o&&!o.meta&&(this._cache.delete(o.schema),delete R[O]))}}_addSchema(R,M,O,o=this.opts.validateSchema,h=this.opts.addUsedSchema){let D;const{schemaId:V}=this.opts;if(typeof R=="object")D=R[V];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof R!="boolean")throw new Error("schema must be object or boolean")}let z=this._cache.get(R);if(z!==void 0)return z;O=(0,u.normalizeId)(D||O);const Z=u.getSchemaRefs.call(this,R,O);return z=new c.SchemaEnv({schema:R,schemaId:V,meta:M,baseId:O,localRefs:Z}),this._cache.set(z.schema,z),h&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=z),o&&this.validateSchema(R,!0),z}_checkUnique(R){if(this.schemas[R]||this.refs[R])throw new Error(`schema with key or id "${R}" already exists`)}_compileSchemaEnv(R){if(R.meta?this._compileMetaSchema(R):c.compileSchema.call(this,R),!R.validate)throw new Error("ajv implementation error");return R.validate}_compileMetaSchema(R){const M=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,R)}finally{this.opts=M}}}e.default=j,j.ValidationError=s.default,j.MissingRefError=n.default;function F(U,R,M,O="error"){for(const o in U){const h=o;h in R&&this.logger[O](`${M}: option ${o}. ${U[h]}`)}}function S(U){return U=(0,u.normalizeId)(U),this.schemas[U]||this.refs[U]}function I(){const U=this.opts.schemas;if(U)if(Array.isArray(U))this.addSchema(U);else for(const R in U)this.addSchema(U[R],R)}function q(){for(const U in this.opts.formats){const R=this.opts.formats[U];R&&this.addFormat(U,R)}}function G(U){if(Array.isArray(U)){this.addVocabulary(U);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const R in U){const M=U[R];M.keyword||(M.keyword=R),this.addKeyword(M)}}function J(){const U={...this.opts};for(const R of _)delete U[R];return U}const ie={log(){},warn(){},error(){}};function Q(U){if(U===!1)return ie;if(U===void 0)return console;if(U.log&&U.warn&&U.error)return U;throw new Error("logger must implement log, warn and error methods")}const oe=/^[a-z_$][a-z0-9_$:-]*$/i;function se(U,R){const{RULES:M}=this;if((0,f.eachItem)(U,O=>{if(M.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!oe.test(O))throw new Error(`Keyword ${O} has invalid name`)}),!!R&&R.$data&&!("code"in R||"validate"in R))throw new Error('$data keyword must have "code" or "validate" function')}function Ae(U,R,M){var O;const o=R==null?void 0:R.post;if(M&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:h}=this;let D=o?h.post:h.rules.find(({type:z})=>z===M);if(D||(D={type:M,rules:[]},h.rules.push(D)),h.keywords[U]=!0,!R)return;const V={keyword:U,definition:{...R,type:(0,d.getJSONTypes)(R.type),schemaType:(0,d.getJSONTypes)(R.schemaType)}};R.before?Ue.call(this,D,V,R.before):D.rules.push(V),h.all[U]=V,(O=R.implements)===null||O===void 0||O.forEach(z=>this.addKeyword(z))}function Ue(U,R,M){const O=U.rules.findIndex(o=>o.keyword===M);O>=0?U.rules.splice(O,0,R):(U.rules.push(R),this.logger.warn(`rule ${M} is not defined`))}function Je(U){let{metaSchema:R}=U;R!==void 0&&(U.$data&&this.opts.$data&&(R=et(R)),U.validateSchema=this.compile(R,!0))}const it={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function et(U){return{anyOf:[U,it]}}})(Us);var Jr={},Qr={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});const ea={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Zr.default=ea;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.callRef=mt.getValidate=void 0;const ta=Wt,Qn=X,ke=ee,vt=Ke,Zn=Oe,Jt=ne,ra={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:s}=e,{baseId:n,schemaEnv:i,validateName:c,opts:a,self:u}=s,{root:d}=i;if((r==="#"||r==="#/")&&n===d.baseId)return y();const f=Zn.resolveRef.call(u,d,n,r);if(f===void 0)throw new ta.default(s.opts.uriResolver,n,r);if(f instanceof Zn.SchemaEnv)return P(f);return b(f);function y(){if(i===d)return rr(e,c,i,i.$async);const _=t.scopeValue("root",{ref:d});return rr(e,(0,ke._)`${_}.validate`,d,d.$async)}function P(_){const E=Zs(e,_);rr(e,E,_,_.$async)}function b(_){const E=t.scopeValue("schema",a.code.source===!0?{ref:_,code:(0,ke.stringify)(_)}:{ref:_}),w=t.name("valid"),g=e.subschema({schema:_,dataTypes:[],schemaPath:ke.nil,topSchemaRef:E,errSchemaPath:r},w);e.mergeEvaluated(g),e.ok(w)}}};function Zs(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,ke._)`${r.scopeValue("wrapper",{ref:t})}.validate`}mt.getValidate=Zs;function rr(e,t,r,s){const{gen:n,it:i}=e,{allErrors:c,schemaEnv:a,opts:u}=i,d=u.passContext?vt.default.this:ke.nil;s?f():y();function f(){if(!a.$async)throw new Error("async schema referenced by sync schema");const _=n.let("valid");n.try(()=>{n.code((0,ke._)`await ${(0,Qn.callValidateCode)(e,t,d)}`),b(t),c||n.assign(_,!0)},E=>{n.if((0,ke._)`!(${E} instanceof ${i.ValidationError})`,()=>n.throw(E)),P(E),c||n.assign(_,!1)}),e.ok(_)}function y(){e.result((0,Qn.callValidateCode)(e,t,d),()=>b(t),()=>P(t))}function P(_){const E=(0,ke._)`${_}.errors`;n.assign(vt.default.vErrors,(0,ke._)`${vt.default.vErrors} === null ? ${E} : ${vt.default.vErrors}.concat(${E})`),n.assign(vt.default.errors,(0,ke._)`${vt.default.vErrors}.length`)}function b(_){var E;if(!i.opts.unevaluated)return;const w=(E=r==null?void 0:r.validate)===null||E===void 0?void 0:E.evaluated;if(i.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(i.props=Jt.mergeEvaluated.props(n,w.props,i.props));else{const g=n.var("props",(0,ke._)`${_}.evaluated.props`);i.props=Jt.mergeEvaluated.props(n,g,i.props,ke.Name)}if(i.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(i.items=Jt.mergeEvaluated.items(n,w.items,i.items));else{const g=n.var("items",(0,ke._)`${_}.evaluated.items`);i.items=Jt.mergeEvaluated.items(n,g,i.items,ke.Name)}}}mt.callRef=rr;mt.default=ra;Object.defineProperty(Qr,"__esModule",{value:!0});const na=Zr,sa=mt,ia=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",na.default,sa.default];Qr.default=ia;var Yr={},Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});const cr=ee,nt=cr.operators,lr={maximum:{okStr:"<=",ok:nt.LTE,fail:nt.GT},minimum:{okStr:">=",ok:nt.GTE,fail:nt.LT},exclusiveMaximum:{okStr:"<",ok:nt.LT,fail:nt.GTE},exclusiveMinimum:{okStr:">",ok:nt.GT,fail:nt.LTE}},oa={message:({keyword:e,schemaCode:t})=>(0,cr.str)`must be ${lr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,cr._)`{comparison: ${lr[e].okStr}, limit: ${t}}`},aa={keyword:Object.keys(lr),type:"number",schemaType:"number",$data:!0,error:oa,code(e){const{keyword:t,data:r,schemaCode:s}=e;e.fail$data((0,cr._)`${r} ${lr[t].fail} ${s} || isNaN(${r})`)}};Xr.default=aa;var en={};Object.defineProperty(en,"__esModule",{value:!0});const Dt=ee,ca={message:({schemaCode:e})=>(0,Dt.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Dt._)`{multipleOf: ${e}}`},la={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ca,code(e){const{gen:t,data:r,schemaCode:s,it:n}=e,i=n.opts.multipleOfPrecision,c=t.let("res"),a=i?(0,Dt._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${i}`:(0,Dt._)`${c} !== parseInt(${c})`;e.fail$data((0,Dt._)`(${s} === 0 || (${c} = ${r}/${s}, ${a}))`)}};en.default=la;var tn={},rn={};Object.defineProperty(rn,"__esModule",{value:!0});function Ys(e){const t=e.length;let r=0,s=0,n;for(;s<t;)r++,n=e.charCodeAt(s++),n>=55296&&n<=56319&&s<t&&(n=e.charCodeAt(s),(n&64512)===56320&&s++);return r}rn.default=Ys;Ys.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(tn,"__esModule",{value:!0});const ft=ee,ua=ne,da=rn,fa={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,ft.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,ft._)`{limit: ${e}}`},pa={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:fa,code(e){const{keyword:t,data:r,schemaCode:s,it:n}=e,i=t==="maxLength"?ft.operators.GT:ft.operators.LT,c=n.opts.unicode===!1?(0,ft._)`${r}.length`:(0,ft._)`${(0,ua.useFunc)(e.gen,da.default)}(${r})`;e.fail$data((0,ft._)`${c} ${i} ${s}`)}};tn.default=pa;var nn={};Object.defineProperty(nn,"__esModule",{value:!0});const ha=X,ur=ee,ma={message:({schemaCode:e})=>(0,ur.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ur._)`{pattern: ${e}}`},ya={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:ma,code(e){const{data:t,$data:r,schema:s,schemaCode:n,it:i}=e,c=i.opts.unicodeRegExp?"u":"",a=r?(0,ur._)`(new RegExp(${n}, ${c}))`:(0,ha.usePattern)(e,s);e.fail$data((0,ur._)`!${a}.test(${t})`)}};nn.default=ya;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});const At=ee,ga={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,At.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,At._)`{limit: ${e}}`},$a={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:ga,code(e){const{keyword:t,data:r,schemaCode:s}=e,n=t==="maxProperties"?At.operators.GT:At.operators.LT;e.fail$data((0,At._)`Object.keys(${r}).length ${n} ${s}`)}};sn.default=$a;var on={};Object.defineProperty(on,"__esModule",{value:!0});const It=X,Mt=ee,_a=ne,va={message:({params:{missingProperty:e}})=>(0,Mt.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Mt._)`{missingProperty: ${e}}`},wa={keyword:"required",type:"object",schemaType:"array",$data:!0,error:va,code(e){const{gen:t,schema:r,schemaCode:s,data:n,$data:i,it:c}=e,{opts:a}=c;if(!i&&r.length===0)return;const u=r.length>=a.loopRequired;if(c.allErrors?d():f(),a.strictRequired){const b=e.parentSchema.properties,{definedProperties:_}=e.it;for(const E of r)if((b==null?void 0:b[E])===void 0&&!_.has(E)){const w=c.schemaEnv.baseId+c.errSchemaPath,g=`required property "${E}" is not defined at "${w}" (strictRequired)`;(0,_a.checkStrictMode)(c,g,c.opts.strictRequired)}}function d(){if(u||i)e.block$data(Mt.nil,y);else for(const b of r)(0,It.checkReportMissingProp)(e,b)}function f(){const b=t.let("missing");if(u||i){const _=t.let("valid",!0);e.block$data(_,()=>P(b,_)),e.ok(_)}else t.if((0,It.checkMissingProp)(e,r,b)),(0,It.reportMissingProp)(e,b),t.else()}function y(){t.forOf("prop",s,b=>{e.setParams({missingProperty:b}),t.if((0,It.noPropertyInData)(t,n,b,a.ownProperties),()=>e.error())})}function P(b,_){e.setParams({missingProperty:b}),t.forOf(b,s,()=>{t.assign(_,(0,It.propertyInData)(t,n,b,a.ownProperties)),t.if((0,Mt.not)(_),()=>{e.error(),t.break()})},Mt.nil)}}};on.default=wa;var an={};Object.defineProperty(an,"__esModule",{value:!0});const Ft=ee,ba={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Ft.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Ft._)`{limit: ${e}}`},Ea={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ba,code(e){const{keyword:t,data:r,schemaCode:s}=e,n=t==="maxItems"?Ft.operators.GT:Ft.operators.LT;e.fail$data((0,Ft._)`${r}.length ${n} ${s}`)}};an.default=Ea;var cn={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});const Xs=Bs;Xs.code='require("ajv/dist/runtime/equal").default';Bt.default=Xs;Object.defineProperty(cn,"__esModule",{value:!0});const Sr=Ut,Ee=ee,Pa=ne,Sa=Bt,Ta={message:({params:{i:e,j:t}})=>(0,Ee.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ee._)`{i: ${e}, j: ${t}}`},Ra={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Ta,code(e){const{gen:t,data:r,$data:s,schema:n,parentSchema:i,schemaCode:c,it:a}=e;if(!s&&!n)return;const u=t.let("valid"),d=i.items?(0,Sr.getSchemaTypes)(i.items):[];e.block$data(u,f,(0,Ee._)`${c} === false`),e.ok(u);function f(){const _=t.let("i",(0,Ee._)`${r}.length`),E=t.let("j");e.setParams({i:_,j:E}),t.assign(u,!0),t.if((0,Ee._)`${_} > 1`,()=>(y()?P:b)(_,E))}function y(){return d.length>0&&!d.some(_=>_==="object"||_==="array")}function P(_,E){const w=t.name("item"),g=(0,Sr.checkDataTypes)(d,w,a.opts.strictNumbers,Sr.DataType.Wrong),v=t.const("indices",(0,Ee._)`{}`);t.for((0,Ee._)`;${_}--;`,()=>{t.let(w,(0,Ee._)`${r}[${_}]`),t.if(g,(0,Ee._)`continue`),d.length>1&&t.if((0,Ee._)`typeof ${w} == "string"`,(0,Ee._)`${w} += "_"`),t.if((0,Ee._)`typeof ${v}[${w}] == "number"`,()=>{t.assign(E,(0,Ee._)`${v}[${w}]`),e.error(),t.assign(u,!1).break()}).code((0,Ee._)`${v}[${w}] = ${_}`)})}function b(_,E){const w=(0,Pa.useFunc)(t,Sa.default),g=t.name("outer");t.label(g).for((0,Ee._)`;${_}--;`,()=>t.for((0,Ee._)`${E} = ${_}; ${E}--;`,()=>t.if((0,Ee._)`${w}(${r}[${_}], ${r}[${E}])`,()=>{e.error(),t.assign(u,!1).break(g)})))}}};cn.default=Ra;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});const jr=ee,ka=ne,Oa=Bt,Na={message:"must be equal to constant",params:({schemaCode:e})=>(0,jr._)`{allowedValue: ${e}}`},Ca={keyword:"const",$data:!0,error:Na,code(e){const{gen:t,data:r,$data:s,schemaCode:n,schema:i}=e;s||i&&typeof i=="object"?e.fail$data((0,jr._)`!${(0,ka.useFunc)(t,Oa.default)}(${r}, ${n})`):e.fail((0,jr._)`${i} !== ${r}`)}};ln.default=Ca;var un={};Object.defineProperty(un,"__esModule",{value:!0});const jt=ee,Ia=ne,ja=Bt,Da={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,jt._)`{allowedValues: ${e}}`},Aa={keyword:"enum",schemaType:"array",$data:!0,error:Da,code(e){const{gen:t,data:r,$data:s,schema:n,schemaCode:i,it:c}=e;if(!s&&n.length===0)throw new Error("enum must have non-empty array");const a=n.length>=c.opts.loopEnum;let u;const d=()=>u??(u=(0,Ia.useFunc)(t,ja.default));let f;if(a||s)f=t.let("valid"),e.block$data(f,y);else{if(!Array.isArray(n))throw new Error("ajv implementation error");const b=t.const("vSchema",i);f=(0,jt.or)(...n.map((_,E)=>P(b,E)))}e.pass(f);function y(){t.assign(f,!1),t.forOf("v",i,b=>t.if((0,jt._)`${d()}(${r}, ${b})`,()=>t.assign(f,!0).break()))}function P(b,_){const E=n[_];return typeof E=="object"&&E!==null?(0,jt._)`${d()}(${r}, ${b}[${_}])`:(0,jt._)`${r} === ${E}`}}};un.default=Aa;Object.defineProperty(Yr,"__esModule",{value:!0});const Ma=Xr,Fa=en,qa=tn,La=nn,Ua=sn,Va=on,za=an,Wa=cn,Ba=ln,Ha=un,Ga=[Ma.default,Fa.default,qa.default,La.default,Ua.default,Va.default,za.default,Wa.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ba.default,Ha.default];Yr.default=Ga;var dn={},Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.validateAdditionalItems=void 0;const pt=ee,Dr=ne,xa={message:({params:{len:e}})=>(0,pt.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,pt._)`{limit: ${e}}`},Ka={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:xa,code(e){const{parentSchema:t,it:r}=e,{items:s}=t;if(!Array.isArray(s)){(0,Dr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ei(e,s)}};function ei(e,t){const{gen:r,schema:s,data:n,keyword:i,it:c}=e;c.items=!0;const a=r.const("len",(0,pt._)`${n}.length`);if(s===!1)e.setParams({len:t.length}),e.pass((0,pt._)`${a} <= ${t.length}`);else if(typeof s=="object"&&!(0,Dr.alwaysValidSchema)(c,s)){const d=r.var("valid",(0,pt._)`${a} <= ${t.length}`);r.if((0,pt.not)(d),()=>u(d)),e.ok(d)}function u(d){r.forRange("i",t.length,a,f=>{e.subschema({keyword:i,dataProp:f,dataPropType:Dr.Type.Num},d),c.allErrors||r.if((0,pt.not)(d),()=>r.break())})}}Pt.validateAdditionalItems=ei;Pt.default=Ka;var fn={},St={};Object.defineProperty(St,"__esModule",{value:!0});St.validateTuple=void 0;const Yn=ee,nr=ne,Ja=X,Qa={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return ti(e,"additionalItems",t);r.items=!0,!(0,nr.alwaysValidSchema)(r,t)&&e.ok((0,Ja.validateArray)(e))}};function ti(e,t,r=e.schema){const{gen:s,parentSchema:n,data:i,keyword:c,it:a}=e;f(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=nr.mergeEvaluated.items(s,r.length,a.items));const u=s.name("valid"),d=s.const("len",(0,Yn._)`${i}.length`);r.forEach((y,P)=>{(0,nr.alwaysValidSchema)(a,y)||(s.if((0,Yn._)`${d} > ${P}`,()=>e.subschema({keyword:c,schemaProp:P,dataProp:P},u)),e.ok(u))});function f(y){const{opts:P,errSchemaPath:b}=a,_=r.length,E=_===y.minItems&&(_===y.maxItems||y[t]===!1);if(P.strictTuples&&!E){const w=`"${c}" is ${_}-tuple, but minItems or maxItems/${t} are not specified or different at path "${b}"`;(0,nr.checkStrictMode)(a,w,P.strictTuples)}}}St.validateTuple=ti;St.default=Qa;Object.defineProperty(fn,"__esModule",{value:!0});const Za=St,Ya={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Za.validateTuple)(e,"items")};fn.default=Ya;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});const Xn=ee,Xa=ne,ec=X,tc=Pt,rc={message:({params:{len:e}})=>(0,Xn.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Xn._)`{limit: ${e}}`},nc={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:rc,code(e){const{schema:t,parentSchema:r,it:s}=e,{prefixItems:n}=r;s.items=!0,!(0,Xa.alwaysValidSchema)(s,t)&&(n?(0,tc.validateAdditionalItems)(e,n):e.ok((0,ec.validateArray)(e)))}};pn.default=nc;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});const De=ee,Qt=ne,sc={message:({params:{min:e,max:t}})=>t===void 0?(0,De.str)`must contain at least ${e} valid item(s)`:(0,De.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,De._)`{minContains: ${e}}`:(0,De._)`{minContains: ${e}, maxContains: ${t}}`},ic={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:sc,code(e){const{gen:t,schema:r,parentSchema:s,data:n,it:i}=e;let c,a;const{minContains:u,maxContains:d}=s;i.opts.next?(c=u===void 0?1:u,a=d):c=1;const f=t.const("len",(0,De._)`${n}.length`);if(e.setParams({min:c,max:a}),a===void 0&&c===0){(0,Qt.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&c>a){(0,Qt.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Qt.alwaysValidSchema)(i,r)){let E=(0,De._)`${f} >= ${c}`;a!==void 0&&(E=(0,De._)`${E} && ${f} <= ${a}`),e.pass(E);return}i.items=!0;const y=t.name("valid");a===void 0&&c===1?b(y,()=>t.if(y,()=>t.break())):c===0?(t.let(y,!0),a!==void 0&&t.if((0,De._)`${n}.length > 0`,P)):(t.let(y,!1),P()),e.result(y,()=>e.reset());function P(){const E=t.name("_valid"),w=t.let("count",0);b(E,()=>t.if(E,()=>_(w)))}function b(E,w){t.forRange("i",0,f,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:Qt.Type.Num,compositeRule:!0},E),w()})}function _(E){t.code((0,De._)`${E}++`),a===void 0?t.if((0,De._)`${E} >= ${c}`,()=>t.assign(y,!0).break()):(t.if((0,De._)`${E} > ${a}`,()=>t.assign(y,!1).break()),c===1?t.assign(y,!0):t.if((0,De._)`${E} >= ${c}`,()=>t.assign(y,!0)))}}};hn.default=ic;var ri={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ee,r=ne,s=X;e.error={message:({params:{property:u,depsCount:d,deps:f}})=>{const y=d===1?"property":"properties";return(0,t.str)`must have ${y} ${f} when property ${u} is present`},params:({params:{property:u,depsCount:d,deps:f,missingProperty:y}})=>(0,t._)`{property: ${u},
|
|
633
633
|
missingProperty: ${y},
|
|
634
634
|
depsCount: ${d},
|
|
635
|
-
deps: ${f}}`};const n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[d,f]=i(u);l(u,d),a(u,f)}};function i({schema:u}){const d={},f={};for(const y in u){if(y==="__proto__")continue;const P=Array.isArray(u[y])?d:f;P[y]=u[y]}return[d,f]}function l(u,d=u.schema){const{gen:f,data:y,it:P}=u;if(Object.keys(d).length===0)return;const b=f.let("missing");for(const _ in d){const E=d[_];if(E.length===0)continue;const w=(0,s.propertyInData)(f,y,_,P.opts.ownProperties);u.setParams({property:_,depsCount:E.length,deps:E.join(", ")}),P.allErrors?f.if(w,()=>{for(const g of E)(0,s.checkReportMissingProp)(u,g)}):(f.if((0,t._)`${w} && (${(0,s.checkMissingProp)(u,E,b)})`),(0,s.reportMissingProp)(u,b),f.else())}}e.validatePropertyDeps=l;function a(u,d=u.schema){const{gen:f,data:y,keyword:P,it:b}=u,_=f.name("valid");for(const E in d)(0,r.alwaysValidSchema)(b,d[E])||(f.if((0,s.propertyInData)(f,y,E,b.opts.ownProperties),()=>{const w=u.subschema({keyword:P,schemaProp:E},_);u.mergeValidEvaluated(w,_)},()=>f.var(_,!0)),u.ok(_))}e.validateSchemaDeps=a,e.default=n})(si);var yn={};Object.defineProperty(yn,"__esModule",{value:!0});const ii=ee,cc=ne,lc={message:"property name must be valid",params:({params:e})=>(0,ii._)`{propertyName: ${e.propertyName}}`},uc={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:lc,code(e){const{gen:t,schema:r,data:s,it:n}=e;if((0,cc.alwaysValidSchema)(n,r))return;const i=t.name("valid");t.forIn("key",s,l=>{e.setParams({propertyName:l}),e.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},i),t.if((0,ii.not)(i),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(i)}};yn.default=uc;var _r={};Object.defineProperty(_r,"__esModule",{value:!0});const Zt=X,qe=ee,dc=Ke,Yt=ne,fc={message:"must NOT have additional properties",params:({params:e})=>(0,qe._)`{additionalProperty: ${e.additionalProperty}}`},pc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:fc,code(e){const{gen:t,schema:r,parentSchema:s,data:n,errsCount:i,it:l}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:u}=l;if(l.props=!0,u.removeAdditional!=="all"&&(0,Yt.alwaysValidSchema)(l,r))return;const d=(0,Zt.allSchemaProperties)(s.properties),f=(0,Zt.allSchemaProperties)(s.patternProperties);y(),e.ok((0,qe._)`${i} === ${dc.default.errors}`);function y(){t.forIn("key",n,w=>{!d.length&&!f.length?_(w):t.if(P(w),()=>_(w))})}function P(w){let g;if(d.length>8){const v=(0,Yt.schemaRefOrVal)(l,s.properties,"properties");g=(0,Zt.isOwnProperty)(t,v,w)}else d.length?g=(0,qe.or)(...d.map(v=>(0,qe._)`${w} === ${v}`)):g=qe.nil;return f.length&&(g=(0,qe.or)(g,...f.map(v=>(0,qe._)`${(0,Zt.usePattern)(e,v)}.test(${w})`))),(0,qe.not)(g)}function b(w){t.code((0,qe._)`delete ${n}[${w}]`)}function _(w){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){b(w);return}if(r===!1){e.setParams({additionalProperty:w}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Yt.alwaysValidSchema)(l,r)){const g=t.name("valid");u.removeAdditional==="failing"?(E(w,g,!1),t.if((0,qe.not)(g),()=>{e.reset(),b(w)})):(E(w,g),a||t.if((0,qe.not)(g),()=>t.break()))}}function E(w,g,v){const T={keyword:"additionalProperties",dataProp:w,dataPropType:Yt.Type.Str};v===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(T,g)}}};_r.default=pc;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});const hc=yr(),ts=X,Tr=ne,rs=_r,mc={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:s,data:n,it:i}=e;i.opts.removeAdditional==="all"&&s.additionalProperties===void 0&&rs.default.code(new hc.KeywordCxt(i,rs.default,"additionalProperties"));const l=(0,ts.allSchemaProperties)(r);for(const y of l)i.definedProperties.add(y);i.opts.unevaluated&&l.length&&i.props!==!0&&(i.props=Tr.mergeEvaluated.props(t,(0,Tr.toHash)(l),i.props));const a=l.filter(y=>!(0,Tr.alwaysValidSchema)(i,r[y]));if(a.length===0)return;const u=t.name("valid");for(const y of a)d(y)?f(y):(t.if((0,ts.propertyInData)(t,n,y,i.opts.ownProperties)),f(y),i.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(y),e.ok(u);function d(y){return i.opts.useDefaults&&!i.compositeRule&&r[y].default!==void 0}function f(y){e.subschema({keyword:"properties",schemaProp:y,dataProp:y},u)}}};gn.default=mc;var $n={};Object.defineProperty($n,"__esModule",{value:!0});const ns=X,Xt=ee,ss=ne,is=ne,yc={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:s,parentSchema:n,it:i}=e,{opts:l}=i,a=(0,ns.allSchemaProperties)(r),u=a.filter(E=>(0,ss.alwaysValidSchema)(i,r[E]));if(a.length===0||u.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const d=l.strictSchema&&!l.allowMatchingProperties&&n.properties,f=t.name("valid");i.props!==!0&&!(i.props instanceof Xt.Name)&&(i.props=(0,is.evaluatedPropsToName)(t,i.props));const{props:y}=i;P();function P(){for(const E of a)d&&b(E),i.allErrors?_(E):(t.var(f,!0),_(E),t.if(f))}function b(E){for(const w in d)new RegExp(E).test(w)&&(0,ss.checkStrictMode)(i,`property ${w} matches pattern ${E} (use allowMatchingProperties)`)}function _(E){t.forIn("key",s,w=>{t.if((0,Xt._)`${(0,ns.usePattern)(e,E)}.test(${w})`,()=>{const g=u.includes(E);g||e.subschema({keyword:"patternProperties",schemaProp:E,dataProp:w,dataPropType:is.Type.Str},f),i.opts.unevaluated&&y!==!0?t.assign((0,Xt._)`${y}[${w}]`,!0):!g&&!i.allErrors&&t.if((0,Xt.not)(f),()=>t.break())})})}}};$n.default=yc;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});const gc=ne,$c={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:s}=e;if((0,gc.alwaysValidSchema)(s,r)){e.fail();return}const n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};_n.default=$c;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});const _c=X,vc={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:_c.validateUnion,error:{message:"must match a schema in anyOf"}};vn.default=vc;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});const sr=ee,wc=ne,bc={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,sr._)`{passingSchemas: ${e.passing}}`},Ec={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:bc,code(e){const{gen:t,schema:r,parentSchema:s,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&s.discriminator)return;const i=r,l=t.let("valid",!1),a=t.let("passing",null),u=t.name("_valid");e.setParams({passing:a}),t.block(d),e.result(l,()=>e.reset(),()=>e.error(!0));function d(){i.forEach((f,y)=>{let P;(0,wc.alwaysValidSchema)(n,f)?t.var(u,!0):P=e.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},u),y>0&&t.if((0,sr._)`${u} && ${l}`).assign(l,!1).assign(a,(0,sr._)`[${a}, ${y}]`).else(),t.if(u,()=>{t.assign(l,!0),t.assign(a,y),P&&e.mergeEvaluated(P,sr.Name)})})}}};wn.default=Ec;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});const Pc=ne,Sc={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const n=t.name("valid");r.forEach((i,l)=>{if((0,Pc.alwaysValidSchema)(s,i))return;const a=e.subschema({keyword:"allOf",schemaProp:l},n);e.ok(n),e.mergeEvaluated(a)})}};bn.default=Sc;var En={};Object.defineProperty(En,"__esModule",{value:!0});const dr=ee,oi=ne,Tc={message:({params:e})=>(0,dr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,dr._)`{failingKeyword: ${e.ifClause}}`},Rc={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Tc,code(e){const{gen:t,parentSchema:r,it:s}=e;r.then===void 0&&r.else===void 0&&(0,oi.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const n=os(s,"then"),i=os(s,"else");if(!n&&!i)return;const l=t.let("valid",!0),a=t.name("_valid");if(u(),e.reset(),n&&i){const f=t.let("ifClause");e.setParams({ifClause:f}),t.if(a,d("then",f),d("else",f))}else n?t.if(a,d("then")):t.if((0,dr.not)(a),d("else"));e.pass(l,()=>e.error(!0));function u(){const f=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(f)}function d(f,y){return()=>{const P=e.subschema({keyword:f},a);t.assign(l,a),e.mergeValidEvaluated(P,l),y?t.assign(y,(0,dr._)`${f}`):e.setParams({ifClause:f})}}}};function os(e,t){const r=e.schema[t];return r!==void 0&&!(0,oi.alwaysValidSchema)(e,r)}En.default=Rc;var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});const kc=ne,Oc={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,kc.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Pn.default=Oc;Object.defineProperty(fn,"__esModule",{value:!0});const Nc=Pt,Cc=pn,Ic=St,jc=hn,Dc=mn,Ac=si,Mc=yn,Fc=_r,qc=gn,Lc=$n,Uc=_n,Vc=vn,zc=wn,Wc=bn,Bc=En,Hc=Pn;function Gc(e=!1){const t=[Uc.default,Vc.default,zc.default,Wc.default,Bc.default,Hc.default,Mc.default,Fc.default,Ac.default,qc.default,Lc.default];return e?t.push(Cc.default,jc.default):t.push(Nc.default,Ic.default),t.push(Dc.default),t}fn.default=Gc;var Sn={},Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});const me=ee,xc={message:({schemaCode:e})=>(0,me.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,me._)`{format: ${e}}`},Kc={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:xc,code(e,t){const{gen:r,data:s,$data:n,schema:i,schemaCode:l,it:a}=e,{opts:u,errSchemaPath:d,schemaEnv:f,self:y}=a;if(!u.validateFormats)return;n?P():b();function P(){const _=r.scopeValue("formats",{ref:y.formats,code:u.code.formats}),E=r.const("fDef",(0,me._)`${_}[${l}]`),w=r.let("fType"),g=r.let("format");r.if((0,me._)`typeof ${E} == "object" && !(${E} instanceof RegExp)`,()=>r.assign(w,(0,me._)`${E}.type || "string"`).assign(g,(0,me._)`${E}.validate`),()=>r.assign(w,(0,me._)`"string"`).assign(g,E)),e.fail$data((0,me.or)(v(),T()));function v(){return u.strictSchema===!1?me.nil:(0,me._)`${l} && !${g}`}function T(){const j=f.$async?(0,me._)`(${E}.async ? await ${g}(${s}) : ${g}(${s}))`:(0,me._)`${g}(${s})`,F=(0,me._)`(typeof ${g} == "function" ? ${j} : ${g}.test(${s}))`;return(0,me._)`${g} && ${g} !== true && ${w} === ${t} && !${F}`}}function b(){const _=y.formats[i];if(!_){v();return}if(_===!0)return;const[E,w,g]=T(_);E===t&&e.pass(j());function v(){if(u.strictSchema===!1){y.logger.warn(F());return}throw new Error(F());function F(){return`unknown format "${i}" ignored in schema at path "${d}"`}}function T(F){const S=F instanceof RegExp?(0,me.regexpCode)(F):u.code.formats?(0,me._)`${u.code.formats}${(0,me.getProperty)(i)}`:void 0,I=r.scopeValue("formats",{key:i,ref:F,code:S});return typeof F=="object"&&!(F instanceof RegExp)?[F.type||"string",F.validate,(0,me._)`${I}.validate`]:["string",F,I]}function j(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!f.$async)throw new Error("async format in sync schema");return(0,me._)`await ${g}(${s})`}return typeof w=="function"?(0,me._)`${g}(${s})`:(0,me._)`${g}.test(${s})`}}}};Tn.default=Kc;Object.defineProperty(Sn,"__esModule",{value:!0});const Jc=Tn,Qc=[Jc.default];Sn.default=Qc;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.contentVocabulary=Et.metadataVocabulary=void 0;Et.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Et.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Qr,"__esModule",{value:!0});const Zc=Zr,Yc=Xr,Xc=fn,el=Sn,as=Et,tl=[Zc.default,Yc.default,(0,Xc.default)(),el.default,as.metadataVocabulary,as.contentVocabulary];Qr.default=tl;var Rn={},ai={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(ai);Object.defineProperty(Rn,"__esModule",{value:!0});const wt=ee,Ar=ai,cs=Oe,rl=ne,nl={message:({params:{discrError:e,tagName:t}})=>e===Ar.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,wt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},sl={keyword:"discriminator",type:"object",schemaType:"object",error:nl,code(e){const{gen:t,data:r,schema:s,parentSchema:n,it:i}=e,{oneOf:l}=n;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=s.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(s.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),d=t.const("tag",(0,wt._)`${r}${(0,wt.getProperty)(a)}`);t.if((0,wt._)`typeof ${d} == "string"`,()=>f(),()=>e.error(!1,{discrError:Ar.DiscrError.Tag,tag:d,tagName:a})),e.ok(u);function f(){const b=P();t.if(!1);for(const _ in b)t.elseIf((0,wt._)`${d} === ${_}`),t.assign(u,y(b[_]));t.else(),e.error(!1,{discrError:Ar.DiscrError.Mapping,tag:d,tagName:a}),t.endIf()}function y(b){const _=t.name("valid"),E=e.subschema({keyword:"oneOf",schemaProp:b},_);return e.mergeEvaluated(E,wt.Name),_}function P(){var b;const _={},E=g(n);let w=!0;for(let j=0;j<l.length;j++){let F=l[j];F!=null&&F.$ref&&!(0,rl.schemaHasRulesButRef)(F,i.self.RULES)&&(F=cs.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,F==null?void 0:F.$ref),F instanceof cs.SchemaEnv&&(F=F.schema));const S=(b=F==null?void 0:F.properties)===null||b===void 0?void 0:b[a];if(typeof S!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);w=w&&(E||g(F)),v(S,j)}if(!w)throw new Error(`discriminator: "${a}" must be required`);return _;function g({required:j}){return Array.isArray(j)&&j.includes(a)}function v(j,F){if(j.const)T(j.const,F);else if(j.enum)for(const S of j.enum)T(S,F);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(j,F){if(typeof j!="string"||j in _)throw new Error(`discriminator: "${a}" values must be unique strings`);_[j]=F}}}};Rn.default=sl;const il="http://json-schema.org/draft-07/schema#",ol="http://json-schema.org/draft-07/schema#",al="Core schema meta-schema",cl={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},ll=["object","boolean"],ul={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dl={$schema:il,$id:ol,title:al,definitions:cl,type:ll,properties:ul,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=Vs,s=Qr,n=Rn,i=dl,l=["/properties"],a="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),s.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(i,l):i;this.addMetaSchema(_,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=yr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var f=ee;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var y=xr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return y.default}});var P=zt;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return P.default}})})(Or,Or.exports);var fl=Or.exports;const pl=Ki(fl),hl="http://json-schema.org/schema",ml="#/definitions/Blueprint",yl={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",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},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:
|
|
635
|
+
deps: ${f}}`};const n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[d,f]=i(u);c(u,d),a(u,f)}};function i({schema:u}){const d={},f={};for(const y in u){if(y==="__proto__")continue;const P=Array.isArray(u[y])?d:f;P[y]=u[y]}return[d,f]}function c(u,d=u.schema){const{gen:f,data:y,it:P}=u;if(Object.keys(d).length===0)return;const b=f.let("missing");for(const _ in d){const E=d[_];if(E.length===0)continue;const w=(0,s.propertyInData)(f,y,_,P.opts.ownProperties);u.setParams({property:_,depsCount:E.length,deps:E.join(", ")}),P.allErrors?f.if(w,()=>{for(const g of E)(0,s.checkReportMissingProp)(u,g)}):(f.if((0,t._)`${w} && (${(0,s.checkMissingProp)(u,E,b)})`),(0,s.reportMissingProp)(u,b),f.else())}}e.validatePropertyDeps=c;function a(u,d=u.schema){const{gen:f,data:y,keyword:P,it:b}=u,_=f.name("valid");for(const E in d)(0,r.alwaysValidSchema)(b,d[E])||(f.if((0,s.propertyInData)(f,y,E,b.opts.ownProperties),()=>{const w=u.subschema({keyword:P,schemaProp:E},_);u.mergeValidEvaluated(w,_)},()=>f.var(_,!0)),u.ok(_))}e.validateSchemaDeps=a,e.default=n})(ri);var mn={};Object.defineProperty(mn,"__esModule",{value:!0});const ni=ee,oc=ne,ac={message:"property name must be valid",params:({params:e})=>(0,ni._)`{propertyName: ${e.propertyName}}`},cc={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ac,code(e){const{gen:t,schema:r,data:s,it:n}=e;if((0,oc.alwaysValidSchema)(n,r))return;const i=t.name("valid");t.forIn("key",s,c=>{e.setParams({propertyName:c}),e.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},i),t.if((0,ni.not)(i),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(i)}};mn.default=cc;var _r={};Object.defineProperty(_r,"__esModule",{value:!0});const Zt=X,qe=ee,lc=Ke,Yt=ne,uc={message:"must NOT have additional properties",params:({params:e})=>(0,qe._)`{additionalProperty: ${e.additionalProperty}}`},dc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:uc,code(e){const{gen:t,schema:r,parentSchema:s,data:n,errsCount:i,it:c}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:u}=c;if(c.props=!0,u.removeAdditional!=="all"&&(0,Yt.alwaysValidSchema)(c,r))return;const d=(0,Zt.allSchemaProperties)(s.properties),f=(0,Zt.allSchemaProperties)(s.patternProperties);y(),e.ok((0,qe._)`${i} === ${lc.default.errors}`);function y(){t.forIn("key",n,w=>{!d.length&&!f.length?_(w):t.if(P(w),()=>_(w))})}function P(w){let g;if(d.length>8){const v=(0,Yt.schemaRefOrVal)(c,s.properties,"properties");g=(0,Zt.isOwnProperty)(t,v,w)}else d.length?g=(0,qe.or)(...d.map(v=>(0,qe._)`${w} === ${v}`)):g=qe.nil;return f.length&&(g=(0,qe.or)(g,...f.map(v=>(0,qe._)`${(0,Zt.usePattern)(e,v)}.test(${w})`))),(0,qe.not)(g)}function b(w){t.code((0,qe._)`delete ${n}[${w}]`)}function _(w){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){b(w);return}if(r===!1){e.setParams({additionalProperty:w}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Yt.alwaysValidSchema)(c,r)){const g=t.name("valid");u.removeAdditional==="failing"?(E(w,g,!1),t.if((0,qe.not)(g),()=>{e.reset(),b(w)})):(E(w,g),a||t.if((0,qe.not)(g),()=>t.break()))}}function E(w,g,v){const T={keyword:"additionalProperties",dataProp:w,dataPropType:Yt.Type.Str};v===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(T,g)}}};_r.default=dc;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});const fc=yr(),es=X,Tr=ne,ts=_r,pc={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:s,data:n,it:i}=e;i.opts.removeAdditional==="all"&&s.additionalProperties===void 0&&ts.default.code(new fc.KeywordCxt(i,ts.default,"additionalProperties"));const c=(0,es.allSchemaProperties)(r);for(const y of c)i.definedProperties.add(y);i.opts.unevaluated&&c.length&&i.props!==!0&&(i.props=Tr.mergeEvaluated.props(t,(0,Tr.toHash)(c),i.props));const a=c.filter(y=>!(0,Tr.alwaysValidSchema)(i,r[y]));if(a.length===0)return;const u=t.name("valid");for(const y of a)d(y)?f(y):(t.if((0,es.propertyInData)(t,n,y,i.opts.ownProperties)),f(y),i.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(y),e.ok(u);function d(y){return i.opts.useDefaults&&!i.compositeRule&&r[y].default!==void 0}function f(y){e.subschema({keyword:"properties",schemaProp:y,dataProp:y},u)}}};yn.default=pc;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});const rs=X,Xt=ee,ns=ne,ss=ne,hc={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:s,parentSchema:n,it:i}=e,{opts:c}=i,a=(0,rs.allSchemaProperties)(r),u=a.filter(E=>(0,ns.alwaysValidSchema)(i,r[E]));if(a.length===0||u.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const d=c.strictSchema&&!c.allowMatchingProperties&&n.properties,f=t.name("valid");i.props!==!0&&!(i.props instanceof Xt.Name)&&(i.props=(0,ss.evaluatedPropsToName)(t,i.props));const{props:y}=i;P();function P(){for(const E of a)d&&b(E),i.allErrors?_(E):(t.var(f,!0),_(E),t.if(f))}function b(E){for(const w in d)new RegExp(E).test(w)&&(0,ns.checkStrictMode)(i,`property ${w} matches pattern ${E} (use allowMatchingProperties)`)}function _(E){t.forIn("key",s,w=>{t.if((0,Xt._)`${(0,rs.usePattern)(e,E)}.test(${w})`,()=>{const g=u.includes(E);g||e.subschema({keyword:"patternProperties",schemaProp:E,dataProp:w,dataPropType:ss.Type.Str},f),i.opts.unevaluated&&y!==!0?t.assign((0,Xt._)`${y}[${w}]`,!0):!g&&!i.allErrors&&t.if((0,Xt.not)(f),()=>t.break())})})}}};gn.default=hc;var $n={};Object.defineProperty($n,"__esModule",{value:!0});const mc=ne,yc={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:s}=e;if((0,mc.alwaysValidSchema)(s,r)){e.fail();return}const n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};$n.default=yc;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});const gc=X,$c={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:gc.validateUnion,error:{message:"must match a schema in anyOf"}};_n.default=$c;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});const sr=ee,_c=ne,vc={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,sr._)`{passingSchemas: ${e.passing}}`},wc={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:vc,code(e){const{gen:t,schema:r,parentSchema:s,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&s.discriminator)return;const i=r,c=t.let("valid",!1),a=t.let("passing",null),u=t.name("_valid");e.setParams({passing:a}),t.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){i.forEach((f,y)=>{let P;(0,_c.alwaysValidSchema)(n,f)?t.var(u,!0):P=e.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},u),y>0&&t.if((0,sr._)`${u} && ${c}`).assign(c,!1).assign(a,(0,sr._)`[${a}, ${y}]`).else(),t.if(u,()=>{t.assign(c,!0),t.assign(a,y),P&&e.mergeEvaluated(P,sr.Name)})})}}};vn.default=wc;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});const bc=ne,Ec={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const n=t.name("valid");r.forEach((i,c)=>{if((0,bc.alwaysValidSchema)(s,i))return;const a=e.subschema({keyword:"allOf",schemaProp:c},n);e.ok(n),e.mergeEvaluated(a)})}};wn.default=Ec;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});const dr=ee,si=ne,Pc={message:({params:e})=>(0,dr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,dr._)`{failingKeyword: ${e.ifClause}}`},Sc={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Pc,code(e){const{gen:t,parentSchema:r,it:s}=e;r.then===void 0&&r.else===void 0&&(0,si.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const n=is(s,"then"),i=is(s,"else");if(!n&&!i)return;const c=t.let("valid",!0),a=t.name("_valid");if(u(),e.reset(),n&&i){const f=t.let("ifClause");e.setParams({ifClause:f}),t.if(a,d("then",f),d("else",f))}else n?t.if(a,d("then")):t.if((0,dr.not)(a),d("else"));e.pass(c,()=>e.error(!0));function u(){const f=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(f)}function d(f,y){return()=>{const P=e.subschema({keyword:f},a);t.assign(c,a),e.mergeValidEvaluated(P,c),y?t.assign(y,(0,dr._)`${f}`):e.setParams({ifClause:f})}}}};function is(e,t){const r=e.schema[t];return r!==void 0&&!(0,si.alwaysValidSchema)(e,r)}bn.default=Sc;var En={};Object.defineProperty(En,"__esModule",{value:!0});const Tc=ne,Rc={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Tc.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};En.default=Rc;Object.defineProperty(dn,"__esModule",{value:!0});const kc=Pt,Oc=fn,Nc=St,Cc=pn,Ic=hn,jc=ri,Dc=mn,Ac=_r,Mc=yn,Fc=gn,qc=$n,Lc=_n,Uc=vn,Vc=wn,zc=bn,Wc=En;function Bc(e=!1){const t=[qc.default,Lc.default,Uc.default,Vc.default,zc.default,Wc.default,Dc.default,Ac.default,jc.default,Mc.default,Fc.default];return e?t.push(Oc.default,Cc.default):t.push(kc.default,Nc.default),t.push(Ic.default),t}dn.default=Bc;var Pn={},Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});const me=ee,Hc={message:({schemaCode:e})=>(0,me.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,me._)`{format: ${e}}`},Gc={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Hc,code(e,t){const{gen:r,data:s,$data:n,schema:i,schemaCode:c,it:a}=e,{opts:u,errSchemaPath:d,schemaEnv:f,self:y}=a;if(!u.validateFormats)return;n?P():b();function P(){const _=r.scopeValue("formats",{ref:y.formats,code:u.code.formats}),E=r.const("fDef",(0,me._)`${_}[${c}]`),w=r.let("fType"),g=r.let("format");r.if((0,me._)`typeof ${E} == "object" && !(${E} instanceof RegExp)`,()=>r.assign(w,(0,me._)`${E}.type || "string"`).assign(g,(0,me._)`${E}.validate`),()=>r.assign(w,(0,me._)`"string"`).assign(g,E)),e.fail$data((0,me.or)(v(),T()));function v(){return u.strictSchema===!1?me.nil:(0,me._)`${c} && !${g}`}function T(){const j=f.$async?(0,me._)`(${E}.async ? await ${g}(${s}) : ${g}(${s}))`:(0,me._)`${g}(${s})`,F=(0,me._)`(typeof ${g} == "function" ? ${j} : ${g}.test(${s}))`;return(0,me._)`${g} && ${g} !== true && ${w} === ${t} && !${F}`}}function b(){const _=y.formats[i];if(!_){v();return}if(_===!0)return;const[E,w,g]=T(_);E===t&&e.pass(j());function v(){if(u.strictSchema===!1){y.logger.warn(F());return}throw new Error(F());function F(){return`unknown format "${i}" ignored in schema at path "${d}"`}}function T(F){const S=F instanceof RegExp?(0,me.regexpCode)(F):u.code.formats?(0,me._)`${u.code.formats}${(0,me.getProperty)(i)}`:void 0,I=r.scopeValue("formats",{key:i,ref:F,code:S});return typeof F=="object"&&!(F instanceof RegExp)?[F.type||"string",F.validate,(0,me._)`${I}.validate`]:["string",F,I]}function j(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!f.$async)throw new Error("async format in sync schema");return(0,me._)`await ${g}(${s})`}return typeof w=="function"?(0,me._)`${g}(${s})`:(0,me._)`${g}.test(${s})`}}}};Sn.default=Gc;Object.defineProperty(Pn,"__esModule",{value:!0});const xc=Sn,Kc=[xc.default];Pn.default=Kc;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.contentVocabulary=Et.metadataVocabulary=void 0;Et.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Et.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Jr,"__esModule",{value:!0});const Jc=Qr,Qc=Yr,Zc=dn,Yc=Pn,os=Et,Xc=[Jc.default,Qc.default,(0,Zc.default)(),Yc.default,os.metadataVocabulary,os.contentVocabulary];Jr.default=Xc;var Tn={},ii={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(ii);Object.defineProperty(Tn,"__esModule",{value:!0});const wt=ee,Ar=ii,as=Oe,el=ne,tl={message:({params:{discrError:e,tagName:t}})=>e===Ar.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,wt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},rl={keyword:"discriminator",type:"object",schemaType:"object",error:tl,code(e){const{gen:t,data:r,schema:s,parentSchema:n,it:i}=e,{oneOf:c}=n;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=s.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(s.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),d=t.const("tag",(0,wt._)`${r}${(0,wt.getProperty)(a)}`);t.if((0,wt._)`typeof ${d} == "string"`,()=>f(),()=>e.error(!1,{discrError:Ar.DiscrError.Tag,tag:d,tagName:a})),e.ok(u);function f(){const b=P();t.if(!1);for(const _ in b)t.elseIf((0,wt._)`${d} === ${_}`),t.assign(u,y(b[_]));t.else(),e.error(!1,{discrError:Ar.DiscrError.Mapping,tag:d,tagName:a}),t.endIf()}function y(b){const _=t.name("valid"),E=e.subschema({keyword:"oneOf",schemaProp:b},_);return e.mergeEvaluated(E,wt.Name),_}function P(){var b;const _={},E=g(n);let w=!0;for(let j=0;j<c.length;j++){let F=c[j];F!=null&&F.$ref&&!(0,el.schemaHasRulesButRef)(F,i.self.RULES)&&(F=as.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,F==null?void 0:F.$ref),F instanceof as.SchemaEnv&&(F=F.schema));const S=(b=F==null?void 0:F.properties)===null||b===void 0?void 0:b[a];if(typeof S!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);w=w&&(E||g(F)),v(S,j)}if(!w)throw new Error(`discriminator: "${a}" must be required`);return _;function g({required:j}){return Array.isArray(j)&&j.includes(a)}function v(j,F){if(j.const)T(j.const,F);else if(j.enum)for(const S of j.enum)T(S,F);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(j,F){if(typeof j!="string"||j in _)throw new Error(`discriminator: "${a}" values must be unique strings`);_[j]=F}}}};Tn.default=rl;const nl="http://json-schema.org/draft-07/schema#",sl="http://json-schema.org/draft-07/schema#",il="Core schema meta-schema",ol={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},al=["object","boolean"],cl={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},ll={$schema:nl,$id:sl,title:il,definitions:ol,type:al,properties:cl,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=Us,s=Jr,n=Tn,i=ll,c=["/properties"],a="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),s.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(i,c):i;this.addMetaSchema(_,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=yr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var f=ee;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var y=zt;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return y.default}});var P=Wt;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return P.default}})})(Or,Or.exports);var ul=Or.exports;const dl=Gi(ul),fl="http://json-schema.org/schema",pl="#/definitions/Blueprint",hl={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",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},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:
|
|
636
636
|
|
|
637
637
|
- 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.
|
|
638
638
|
|
|
639
639
|
- 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.
|
|
640
640
|
This option is only kept in here to avoid breaking Blueprint schema validation
|
|
641
|
-
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:"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."}},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"]}]},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}},gl={$schema:hl,$ref:ml,definitions:yl},{wpCLI:$l,...ls}=Vi,_l={...ls,"wp-cli":$l,importFile:ls.importWxr};function vl(e,{progress:t=new zr,semaphore:r=new wi({concurrency:3}),onStepCompleted:s=()=>{}}={}){var y,P,b,_,E,w,g;e={...e,steps:(e.steps||[]).filter(Sl).filter(Tl)};for(const v of e.steps)typeof v=="object"&&v.step==="importFile"&&(v.step="importWxr",Te.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 v=e.plugins.map(T=>typeof T=="string"?T.startsWith("https://")?{resource:"url",url:T}:{resource:"wordpress.org/plugins",slug:T}:T).map(T=>({step:"installPlugin",pluginZipFile:T}));e.steps.unshift(...v)}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 n=(y=e.steps)==null?void 0:y.findIndex(v=>typeof v=="object"&&(v==null?void 0:v.step)==="wp-cli");n!==void 0&&n>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter(v=>v!=="light"),Te.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. ")),(P=e.steps)==null||P.splice(n,0,{step:"writeFile",data:{resource:"url",url:"https://playground.wordpress.net/wp-cli.phar"},path:"/tmp/wp-cli.phar"}));const i=(b=e.steps)==null?void 0:b.findIndex(v=>typeof v=="object"&&(v==null?void 0:v.step)==="importWxr");i!==void 0&&i>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter(v=>v!=="light"),Te.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.steps)==null||_.splice(i,0,{step:"installPlugin",pluginZipFile:{resource:"url",url:"https://playground.wordpress.net/wordpress-importer.zip",caption:"Downloading the WordPress Importer plugin"}}));const{valid:l,errors:a}=bl(e);if(!l){const v=new Error(`Invalid blueprint: ${a[0].message} at ${a[0].instancePath}`);throw v.errors=a,v}const u=e.steps||[],d=u.reduce((v,T)=>{var j;return v+(((j=T.progress)==null?void 0:j.weight)||1)},0),f=u.map(v=>Rl(v,{semaphore:r,rootProgressTracker:t,totalProgressWeight:d}));return{versions:{php:El((E=e.preferredVersions)==null?void 0:E.php,Fs,Ji),wp:((w=e.preferredVersions)==null?void 0:w.wp)||"latest"},phpExtensions:Pl([],e.phpExtensionBundles||[]),features:{networking:((g=e.features)==null?void 0:g.networking)??!1},run:async v=>{try{for(const{resources:T}of f)for(const j of T)j.setPlayground(v),j.isAsync&&j.resolve();for(const[T,{run:j,step:F}]of Object.entries(f))try{const S=await j(v);s(S,F)}catch(S){throw Te.error(S),new Error(`Error when executing the blueprint step #${T} (${JSON.stringify(F)}) ${S instanceof Error?`: ${S.message}`:S}`,{cause:S})}}finally{try{await v.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const wl=new pl({discriminator:!0});let er;function bl(e){var n;er=wl.compile(gl);const t=er(e);if(t)return{valid:t};const r=new Set;for(const i of er.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(i.instancePath);const s=(n=er.errors)==null?void 0:n.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(i.instancePath)));return{valid:t,errors:s}}function El(e,t,r){return e&&t.includes(e)?e:r}function Pl(e,t){const r=qs.filter(n=>e.includes(n)),s=t.flatMap(n=>n in Wn?Wn[n]:[]);return Array.from(new Set([...r,...s]))}function Sl(e){return!!(typeof e=="object"&&e)}function Tl(e){return["setPhpIniEntry","request"].includes(e.step)?(Te.warn(`The "${e.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`),!1):!0}function Rl(e,{semaphore:t,rootProgressTracker:r,totalProgressWeight:s}){var f;const n=r.stage((((f=e.progress)==null?void 0:f.weight)||1)/s),i={};for(const y of Object.keys(e)){let P=e[y];Zi(P)&&(P=yt.create(P,{semaphore:t})),i[y]=P}const l=async y=>{var P;try{return n.fillSlowly(),await _l[e.step](y,await kl(i),{tracker:n,initialCaption:(P=e.progress)==null?void 0:P.caption})}finally{n.finish()}},a=us(i),u=us(i).filter(y=>y.isAsync),d=1/(u.length+1);for(const y of u)y.progress=n.stage(d);return{run:l,step:e,resources:a}}function us(e){const t=[];for(const r in e){const s=e[r];s instanceof yt&&t.push(s)}return t}async function kl(e){const t={};for(const r in e){const s=e[r];s instanceof yt?t[r]=await s.resolve():t[r]=s}return t}async function Ol(e,t){await e.run(t)}function Nl(){}exports.activatePlugin=pr;exports.activateTheme=Fr;exports.compileBlueprint=vl;exports.cp=Es;exports.defineSiteUrl=Vr;exports.defineWpConfigConsts=qt;exports.enableMultisite=bs;exports.exportWXR=Os;exports.importWordPressFiles=ks;exports.importWxr=Rs;exports.installPlugin=Cs;exports.installTheme=Is;exports.login=or;exports.mkdir=Ss;exports.mv=Ps;exports.request=ir;exports.resetData=js;exports.rm=qr;exports.rmdir=Ts;exports.runBlueprintSteps=Ol;exports.runPHP=gs;exports.runPHPWithOptions=$s;exports.runSql=_s;exports.runWpInstallationWizard=Ds;exports.setPluginProxyURL=Nl;exports.setSiteOptions=Lr;exports.unzip=hr;exports.updateUserMeta=vs;exports.wpCLI=Ms;exports.wpContentFilesExcludedFromExport=Mr;exports.writeFile=Ur;exports.zipWpContent=As;
|
|
641
|
+
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:"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."}},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"]}]},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}},ml={$schema:fl,$ref:pl,definitions:hl},{wpCLI:yl,...cs}=Li,gl={...cs,"wp-cli":yl,importFile:cs.importWxr};function $l(e,{progress:t=new zr,semaphore:r=new _i({concurrency:3}),onStepCompleted:s=()=>{}}={}){var y,P,b,_,E,w,g;e={...e,steps:(e.steps||[]).filter(El).filter(Pl)};for(const v of e.steps)typeof v=="object"&&v.step==="importFile"&&(v.step="importWxr",Te.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 v=e.plugins.map(T=>typeof T=="string"?T.startsWith("https://")?{resource:"url",url:T}:{resource:"wordpress.org/plugins",slug:T}:T).map(T=>({step:"installPlugin",pluginZipFile:T}));e.steps.unshift(...v)}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 n=(y=e.steps)==null?void 0:y.findIndex(v=>typeof v=="object"&&(v==null?void 0:v.step)==="wp-cli");n!==void 0&&n>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter(v=>v!=="light"),Te.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. ")),(P=e.steps)==null||P.splice(n,0,{step:"writeFile",data:{resource:"url",url:"https://playground.wordpress.net/wp-cli.phar"},path:"/tmp/wp-cli.phar"}));const i=(b=e.steps)==null?void 0:b.findIndex(v=>typeof v=="object"&&(v==null?void 0:v.step)==="importWxr");i!==void 0&&i>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter(v=>v!=="light"),Te.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.steps)==null||_.splice(i,0,{step:"installPlugin",pluginZipFile:{resource:"url",url:"https://playground.wordpress.net/wordpress-importer.zip",caption:"Downloading the WordPress Importer plugin"}}));const{valid:c,errors:a}=vl(e);if(!c){const v=new Error(`Invalid blueprint: ${a[0].message} at ${a[0].instancePath}`);throw v.errors=a,v}const u=e.steps||[],d=u.reduce((v,T)=>{var j;return v+(((j=T.progress)==null?void 0:j.weight)||1)},0),f=u.map(v=>Sl(v,{semaphore:r,rootProgressTracker:t,totalProgressWeight:d}));return{versions:{php:wl((E=e.preferredVersions)==null?void 0:E.php,Ms,xi),wp:((w=e.preferredVersions)==null?void 0:w.wp)||"latest"},phpExtensions:bl([],e.phpExtensionBundles||[]),features:{networking:((g=e.features)==null?void 0:g.networking)??!1},run:async v=>{try{for(const{resources:T}of f)for(const j of T)j.setPlayground(v),j.isAsync&&j.resolve();for(const[T,{run:j,step:F}]of Object.entries(f))try{const S=await j(v);s(S,F)}catch(S){throw Te.error(S),new Error(`Error when executing the blueprint step #${T} (${JSON.stringify(F)}) ${S instanceof Error?`: ${S.message}`:S}`,{cause:S})}}finally{try{await v.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const _l=new dl({discriminator:!0});let er;function vl(e){var n;er=_l.compile(ml);const t=er(e);if(t)return{valid:t};const r=new Set;for(const i of er.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(i.instancePath);const s=(n=er.errors)==null?void 0:n.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(i.instancePath)));return{valid:t,errors:s}}function wl(e,t,r){return e&&t.includes(e)?e:r}function bl(e,t){const r=Fs.filter(n=>e.includes(n)),s=t.flatMap(n=>n in zn?zn[n]:[]);return Array.from(new Set([...r,...s]))}function El(e){return!!(typeof e=="object"&&e)}function Pl(e){return["setPhpIniEntry","request"].includes(e.step)?(Te.warn(`The "${e.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`),!1):!0}function Sl(e,{semaphore:t,rootProgressTracker:r,totalProgressWeight:s}){var f;const n=r.stage((((f=e.progress)==null?void 0:f.weight)||1)/s),i={};for(const y of Object.keys(e)){let P=e[y];Ji(P)&&(P=yt.create(P,{semaphore:t})),i[y]=P}const c=async y=>{var P;try{return n.fillSlowly(),await gl[e.step](y,await Tl(i),{tracker:n,initialCaption:(P=e.progress)==null?void 0:P.caption})}finally{n.finish()}},a=ls(i),u=ls(i).filter(y=>y.isAsync),d=1/(u.length+1);for(const y of u)y.progress=n.stage(d);return{run:c,step:e,resources:a}}function ls(e){const t=[];for(const r in e){const s=e[r];s instanceof yt&&t.push(s)}return t}async function Tl(e){const t={};for(const r in e){const s=e[r];s instanceof yt?t[r]=await s.resolve():t[r]=s}return t}async function Rl(e,t){await e.run(t)}function kl(){}exports.activatePlugin=pr;exports.activateTheme=Fr;exports.compileBlueprint=$l;exports.cp=bs;exports.defineSiteUrl=Vr;exports.defineWpConfigConsts=qt;exports.enableMultisite=ws;exports.exportWXR=ks;exports.importWordPressFiles=Rs;exports.importWxr=Ts;exports.installPlugin=Ns;exports.installTheme=Cs;exports.login=or;exports.mkdir=Ps;exports.mv=Es;exports.request=ir;exports.resetData=Is;exports.rm=qr;exports.rmdir=Ss;exports.runBlueprintSteps=Rl;exports.runPHP=ys;exports.runPHPWithOptions=gs;exports.runSql=$s;exports.runWpInstallationWizard=js;exports.setPluginProxyURL=kl;exports.setSiteOptions=Lr;exports.unzip=hr;exports.updateUserMeta=_s;exports.wpCLI=As;exports.wpContentFilesExcludedFromExport=Mr;exports.writeFile=Ur;exports.zipWpContent=Ds;
|