UNPKG

@novu/framework

Version:

The Code-First Notifications Workflow SDK.

46 lines (45 loc) 115 kB
import{$ as mr,A as Cn,B as pr,C as xn,D as Ln,E as $n,F as Dn,G as Fn,H as Wn,I as jn,J as dr,K as Un,L as hr,M as Bn,N as Vn,R as Yn,S as Hn,T as qn,U as Kn,V as Jn,W as Gn,X as Qn,Z as zn,_ as Zn,aa as gr,c as _t,ca as pt,d as ur,da as Xn,ea as ei,fa as yr,g as Nn,ga as wr,ia as We,ja as Fe,o as fr,w as In,z as kt}from"./chunk-J2MPR7MB.js";import{Liquid as xs}from"liquidjs";function ks(N,s){let f=s.split(".").reduce((y,A)=>{if(y&&typeof y=="object")return y[A]},N);if(f==null)return"";if(typeof f=="string")return f;if(typeof f=="number"||typeof f=="boolean")return String(f);if(typeof f=="object"){let y=JSON.stringify(f);return y==="{}"?"":y}return""}function ti(N,s=2,f,y=", "){if(!Array.isArray(N)||N.length===0)return"";let A=f?N.map(ee=>typeof ee!="object"||!ee?"":ks(ee,f)):N;if(A.length===1)return A[0];if(A.length===2)return`${A[0]} and ${A[1]}`;if(A.length===3&&s>=3)return`${A[0]}, ${y}${A[1]} and ${A[2]}`;let j=A.slice(0,s),$=A.length-s;return`${j.join(y)} and ${$} ${$===1?"other":"others"}`}var ri=async(N,s)=>{let f=new TextEncoder,y=f.encode(N),A=f.encode(s),j=await crypto.subtle.importKey("raw",y,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),$=await crypto.subtle.sign("HMAC",j,A);return Array.from(new Uint8Array($)).map(ee=>ee.toString(16).padStart(2,"0")).join("")};import{Response as Ps}from"cross-fetch";var Bs=()=>typeof Response!="undefined"?Response:Ps,ni=async()=>{if(process.env.NOVU_BRIDGE_ORIGIN)return`${process.env.NOVU_BRIDGE_ORIGIN}/api/novu`;if(process.env.NEXT_PUBLIC_VERCEL_ENV==="preview"&&process.env.NEXT_PUBLIC_VERCEL_URL)return`https://${process.env.NEXT_PUBLIC_VERCEL_URL}/api/novu`;try{if(process.env.NODE_ENV==="development"){let s=await(await fetch("http://localhost:2022/.well-known/novu")).json();return`${s.tunnelOrigin}${s.route}`}}catch(N){console.error(N)}return""};function ii(N){return!!N&&typeof N=="object"&&"error"in N&&"message"in N&&"statusCode"in N}var Pt=(N,s)=>{if(!N)throw new Bn;return{post:async(f,y)=>{let A=await fetch(`${s}/v1${f}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${N}`},body:JSON.stringify(y)}),j=await A.json();if(A.ok)return j;throw ii(j)?new Vn(j.statusCode,j.error,j.message):new kt(j)},delete:async f=>(await fetch(`${s}/v1${f}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${N}`}})).json()}};import tt from"chalk";var me={info:N=>tt.blue(N),warning:N=>tt.yellow(N),error:N=>tt.red(N),success:N=>tt.green(N),underline:N=>tt.underline(N),bold:N=>tt.bold(N)},Ae={SUCCESS:me.success("\u2714"),ERROR:me.error("\u2717"),WARNING:me.warning("\u26A0"),INFO:me.info("\u2139"),ARROW:me.bold("\u2192"),MOCK:me.info("\u25CB"),HYDRATED:me.bold(me.info("\u2192")),STEP:me.info("\u03C3"),ACTION:me.info("\u03B1"),DURATION:me.info("\u0394"),PROVIDER:me.info("\u2699"),OUTPUT:me.info("\u21E2"),INPUT:me.info("\u21E0"),WORKFLOW:me.info("\u03C9"),STATE:me.info("\u03C3"),EXECUTE:me.info("\u03B5"),PREVIEW:me.info("\u03C1")};function Mt(N){return N||process.env.NOVU_API_URL||"https://api.novu.co"}function Nt(N){return N||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}import oi from"sanitize-html";var Ms={allowedTags:oi.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},si=N=>{if(!N)return N;let s=/^<!DOCTYPE .*?>/,f=N.match(s),y=oi(N,Ms);return f?f[0]+y:y},It=N=>Object.keys(N).reduce((s,f)=>{let y=N[f];return typeof y=="string"?s[f]=si(y):Array.isArray(y)?s[f]=y.map(A=>typeof A=="string"?si(A):typeof A=="object"?It(A):A):typeof y=="object"&&y!==null?s[f]=It(y):s[f]=y,s},{});import Is from"ajv";import Cs from"ajv-formats";var ai=N=>typeof structuredClone=="function"?structuredClone(N):JSON.parse(JSON.stringify(N));var Ct=class extends In{constructor(f,y){let A=y.length===1?"it":"them";super(`Tried to use a ${f} in @novu/framework without ${y.join(", ")} installed. Please install ${A} by running \`npm install ${y.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var xt=async(N,s)=>{let f=new Set;if((await Promise.allSettled(N.map(A=>A.import))).forEach((A,j)=>{let $=N[j];A.status==="fulfilled"&&$.exports.every(ae=>A.value[ae]!==void 0)||f.add($.name)}),f.size>0)throw new Ct(s,Array.from(f))};var Lt=class{constructor(){this.requiredImports=[];this.ajv=new Is({useDefaults:!0,removeAdditional:"failing"}),Cs(this.ajv),this.compiledSchemas=new Map}async canHandle(s){let f=s.type==="object"||!!s.anyOf||!!s.allOf||!!s.oneOf;return f&&await xt(this.requiredImports,"JSON schema"),f}async validate(s,f){let y=this.compiledSchemas.get(f);y||(y=this.ajv.compile(f),this.compiledSchemas.set(f,y));let A=ai(s);return y(A)?{success:!0,data:A}:{success:!1,errors:y.errors.map($=>({path:$.instancePath,message:$.message}))}}async transformToJsonSchema(s){return s}};var $t=class{constructor(){this.requiredImports=[{name:"zod",import:import("zod"),exports:["ZodType"]},{name:"zod-to-json-schema",import:import("zod-to-json-schema"),exports:["zodToJsonSchema"]}]}async canHandle(s){let f=s.safeParseAsync!==void 0;return f&&await xt(this.requiredImports,"Zod schema"),f}async validate(s,f){let y=await f.safeParseAsync(s);return y.success?{success:!0,data:y.data}:{success:!1,errors:y.error.errors.map(A=>({path:`/${A.path.join("/")}`,message:A.message}))}}async transformToJsonSchema(s){let{zodToJsonSchema:f}=await import("zod-to-json-schema");return f(s)}};var Dt=new $t,Ft=new Lt,Wt=async(N,s)=>{if(await Dt.canHandle(N))return Dt.validate(s,N);if(await Ft.canHandle(N))return Ft.validate(s,N);throw new Error("Invalid schema")},_e=async N=>{if(await Dt.canHandle(N))return Dt.transformToJsonSchema(N);if(await Ft.canHandle(N))return Ft.transformToJsonSchema(N);throw new Error("Invalid schema")};var jt=(()=>{var N=Object.defineProperty,s=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,y=Object.prototype.hasOwnProperty,A=(e,t)=>function(){return e&&(t=(0,e[f(e)[0]])(e=0)),t},j=(e,t)=>function(){return t||(0,e[f(e)[0]])((t={exports:{}}).exports,t),t.exports},$=(e,t)=>{for(var r in t)N(e,r,{get:t[r],enumerable:!0})},ee=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of f(t))!y.call(e,l)&&l!==r&&N(e,l,{get:()=>t[l],enumerable:!(a=s(t,l))||a.enumerable});return e},ae=e=>ee(N({},"__esModule",{value:!0}),e),Ee={};$(Ee,{JSONSchemaFaker:()=>Pn,default:()=>Mn,setDependencies:()=>Vr});function Ne(e,t){return typeof e=="string"?typeof t!="undefined"?at.register(e,t):at.get(e):at.registerMany(e)}function Ce(e,t){return e=typeof e=="undefined"?Ve.MIN_INTEGER:e,t=typeof t=="undefined"?Ve.MAX_INTEGER:t,Math.floor(Z("random")()*(t-e+1))+e}function be(e){return Ot.default.prototype.max=Z("defaultRandExpMax"),Ot.default.prototype.randInt=(r,a)=>r+Math.floor(Z("random")()*(1+(a-r))),new Ot.default(e).gen()}function Ie(e){return e[Math.floor(Z("random")()*e.length)]}function xe(e){let t,r,a=e.length,l=e.slice();for(;a>0;)r=Math.floor(Z("random")()*a),a-=1,t=l[a],l[a]=l[r],l[r]=t;return l}function Ge(e,t){return Z("random")()*(t-e)+e}function je(e,t,r,a,l=!1){return r=typeof r=="undefined"?Ve.MIN_NUMBER:r,a=typeof a=="undefined"?Ve.MAX_NUMBER:a,e=typeof e=="undefined"?r:e,t=typeof t=="undefined"?a:t,t<e&&(t+=e),l?Ge(e,t):Ce(e,t)}function gt(e){switch(e){case"seconds":return je(0,60)*60;case"minutes":return je(15,50)*612;case"hours":return je(12,72)*36123;case"days":return je(7,30)*86412345;case"weeks":return je(4,52)*604812345;case"months":return je(2,13)*2592012345;case"years":return je(1,20)*31104012345;default:break}}function Ut(e){if(e)return gt(e);let t=Z("minDateTime"),r=Z("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof r=="string"&&(r=new Date(r));let a=new Date().getTime();return typeof t=="number"&&(t=new Date(a+t)),typeof r=="number"&&(r=new Date(a+r)),new Date(Ge(t.getTime(),r.getTime()))}function Ar(e,t,r){if(t=decodeURIComponent(t),r&&r[t])return wt(r[t]);let a=t.replace("#/","/").split("/"),l=e.$ref&&r&&r[e.$ref]||e;for(!l&&!a[0]&&(a[0]=e.$ref.split("#/")[0]),r&&t.includes("#/")&&r[a[0]]&&(l=r[a.shift()]),a[0]||a.shift();l&&a.length>0;){let p=a.shift();if(!l[p])throw new Error(`Prop not found: ${p} (${t})`);l=l[p]}return l}function yt(e){return typeof e=="string"&&Xr.test(e)}function Ue(e){return["number","boolean"].includes(typeof e)}function Be(e,...t){return t.filter(r=>typeof e[r]!="undefined").length>0}function br(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,r,a]=e.split("T")[0].split("-");return r=`0${Math.max(1,Math.min(12,r))}`.slice(-2),a=`0${Math.max(1,Math.min(31,a))}`.slice(-2),`${t}-${r}-${a}`}function Si(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,r]=e.split("T"),[a,l,p]=t.split("-"),[u,O,L]=r.substr(0,8).split(":");return l=`0${Math.max(1,Math.min(12,l))}`.slice(-2),p=`0${Math.max(1,Math.min(31,p))}`.slice(-2),u=`0${Math.max(1,Math.min(23,u))}`.slice(-2),O=`0${Math.max(1,Math.min(59,O))}`.slice(-2),L=`0${Math.max(1,Math.min(59,L))}`.slice(-2),`${a}-${l}-${p}T${u}:${O}:${L}.000Z`}function Oi(e,t,r){let a={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(a.minimum=t.minimum),typeof t.maximum!="undefined"&&(a.maximum=t.maximum),t.enum){let p=Math.max(a.minimum||0,0),u=Math.min(a.maximum||1/0,1/0);t.exclusiveMinimum&&p===t.minimum&&(p+=t.multipleOf||1),t.exclusiveMaximum&&u===t.maximum&&(u-=t.multipleOf||1),(p||u!==1/0)&&(t.enum=t.enum.filter(O=>O>=p&&O<=u))}break;case"string":{a.minLength=Z("minLength")||0,a.maxLength=Z("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(a.minLength=Math.max(a.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(a.maxLength=Math.min(a.maxLength,t.maxLength));break}default:break}let l=r(a);if(l==null)return null;switch(e||t.type){case"number":l=yt(l)?parseFloat(l):l;break;case"integer":l=yt(l)?parseInt(l,10):l;break;case"boolean":l=!!l;break;case"string":{if(Ue(l))return l;l=String(l);let p=Math.max(a.minLength||0,0),u=Math.min(a.maxLength||1/0,1/0),O,L=0;for(;l.length<p;)if(O=l,t.pattern?l+=Q.randexp(t.pattern):l+=`${Q.pick([" ","/","_","-","+","=","@","^"])}${l}`,l===O){if(L+=1,L===3)break}else L=0;switch(l.length>u&&(l=l.substr(0,u)),t.format){case"date-time":case"datetime":l=new Date(Si(l)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":l=new Date(br(l)).toISOString().substr(0,10);break;case"time":l=new Date(`1969-01-01 ${l}`).toISOString().substr(11);break;default:break}break}default:break}return l}function Ze(e,t){return Object.keys(t).forEach(r=>{typeof t[r]!="object"||t[r]===null?e[r]=t[r]:Array.isArray(t[r])?(e[r]=e[r]||[],t[r].forEach((a,l)=>{e.type==="array"&&t.type==="array"?e[r][l]=Ze(e[r][l]||{},a,!0):Array.isArray(e[r])&&e[r].indexOf(a)===-1&&e[r].push(a)})):typeof e[r]!="object"||e[r]===null||Array.isArray(e[r])?e[r]=Ze({},t[r]):e[r]=Ze(e[r],t[r])}),e}function wt(e,t=new Map){if(!e||typeof e!="object")return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let a=[];return t.set(e,a),a.push(...e.map(l=>wt(l,t))),a}let r={};return t.set(e,r),Object.keys(e).reduce((a,l)=>(a[l]=wt(e[l],t),a),r)}function Ei(e){let t=JSON.stringify(e),r=JSON.stringify(e,null,2);return t.length>400?`${r.substr(0,400)}...`:r}function Tr(){return Q.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function vi(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Ai(e,t){let r=Ze({},t);if(typeof e.minimum!="undefined"&&(r.maximum=e.minimum,r.exclusiveMaximum=!0),typeof e.maximum!="undefined"&&(r.minimum=e.maximum>r.maximum?0:e.maximum,r.exclusiveMinimum=!0),typeof e.minLength!="undefined"&&(r.maxLength=e.minLength),typeof e.maxLength!="undefined"&&(r.minLength=e.maxLength>r.maxLength?0:e.maxLength),e.type)r.type=Q.pick(Ve.SCALAR_TYPES.filter(a=>(Array.isArray(e.type)?e.type:[e.type]).every(p=>a==="number"||a==="integer"?p!=="number"&&p!=="integer":a!==p)));else if(e.enum){let a;do a=Tr();while(e.enum.indexOf(a)!==-1);r.enum=[a]}return e.required&&r.properties&&e.required.forEach(a=>{delete r.properties[a]}),r}function Bt(e,t){let r=t.minimum!==void 0,a=t.maximum!==void 0;return(r||a)&&(!r||e>=t.minimum)&&(!a||e<=t.maximum)}function bi(e,t){return!t.every(r=>Bt(e,r))}function Ti(e,t){return t.reduce((a,l)=>a+(Bt(e,l)?1:0),0)===1}function Ri(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function _i(e,t){return Object.keys(e).filter(r=>!t.includes(r)).reduce((r,a)=>(Array.isArray(e[a])?r[a]=e[a].slice():r[a]=e[a]instanceof Object?Ze({},e[a]):e[a],r),{})}function Rr(e,t){return Array.isArray(e)?e.map(r=>Rr(r,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(r,a)=>t[a])),e)}function Vt(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function _r(e,t){t=t.items||t;let r=Z("alwaysFakeOptionals"),a=Array.isArray(t.required)&&t.required.includes(e)||r,l=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!a&&!l}function Yt(e,t,r=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(a=>Yt(a,t,!0)).filter(a=>typeof a!="undefined");if(Object.keys(e).forEach(a=>{if(Vt(e[a]))_r(a,t)&&delete e[a];else{let l=t;t&&t.properties&&t.properties[a]&&(l=t.properties[a]);let p=Yt(e[a],l);Vt(p)||(e[a]=p)}typeof e[a]=="undefined"&&delete e[a]}),!(!Object.keys(e).length&&r))return e}function ki(e){return(t,r,a,l)=>{let p=t,u=[];typeof t=="object"&&(p=Object.keys(t)[0],Array.isArray(t[p])?u=t[p]:u.push(t[p]));let O=p.split("."),L=e();for(;O.length>1;)L=L[O.shift()];return t=typeof L=="object"?L[O[0]]:L,typeof t=="function"&&(t=t.apply(L,u.map(S=>ce.template(S,l)))),Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(S=>{if(typeof t[S]=="function")throw new Error(`Cannot resolve value for '${a}: ${p}', given: ${t}`)}),t}}function Pi(e,t){if(typeof e=="undefined")return et.list();if(typeof e=="string")if(typeof t=="function")et.register(e,t);else if(t===null||t===!1)et.unregister(e);else return et.get(e);else et.registerMany(e)}function Mi(e,t,r){return Object.keys(e).filter(a=>{let l=nn.indexOf(t)>-1;return r.indexOf(a)>-1&&!l}).length>0}function Ni(e,t){let r=Object.keys(lt);for(let a=0;a<r.length;a+=1){let l=r[a],p=t[t.length-1];if(Mi(e,p,lt[l]))return l}}function Ii(){return Z("random")()>.5}function Ci(){return null}function xi(e,t,r,a,l,p){let u=[],O=[];function L(D){let b=JSON.stringify(D.value);return O.indexOf(b)===-1?(O.push(b),u.push(D),!0):!1}t.forEach(L);let S=100;for(;u.length!==t.length&&(L(p(r.items||a,e,l))||(S-=1),!!S););return u}function Li(e,t,r,a){let l=[];if(!(e.items||e.additionalItems)){if(ce.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new Et(`missing items for ${ce.short(e)}`,t);return l}if(Array.isArray(e.items))return e.items.map((U,ie)=>{let G=t.concat(["items",ie]);return a(U,G,r)});let p=e.minItems,u=e.maxItems,O=Z("minItems"),L=Z("maxItems");O&&(p=typeof p=="undefined"?O:Math.min(O,p)),L&&(u=typeof u=="undefined"?L:Math.min(L,u),u&&u>L&&(u=L),p&&p>L&&(p=u));let S=Z("alwaysFakeOptionals")===!0?1:Z("optionalsProbability"),D=Z("alwaysFakeOptionals")||Z("fixedProbabilities")||!1,b=Q.number(p,u,1,5);S!==null&&(b=Math.max(D?Math.round((u||b)*S):Math.abs(Q.number(p,u)*S),p||0));let Y=typeof e.additionalItems=="object"?e.additionalItems:{};for(let U=l.length;U<b;U+=1){let ie=t.concat(["items",U]),G=a(e.items||Y,ie,r);l.push(G)}if(e.contains&&b>0){let U=Q.number(0,b-1);l[U]=a(e.contains,t.concat(["items",U]),r)}return e.uniqueItems?xi(t.concat(["items"]),l,e,Y,r,a):l}function $i(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?Ve.MIN_INTEGER:e.minimum,r=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?Ve.MAX_INTEGER:e.maximum,a=e.multipleOf,l=a&&String(a).match(/e-(\d)|\.(\d+)$/);if(l){let p=(Math.random()*Q.number(0,10)+1)*a,u=l[1]||l[2].length,O=parseFloat(p.toFixed(u)),L=Q.number(t,r-1);return String(O).includes(".")?L+O:(L+O).toExponential()}if(a&&(r=Math.floor(r/a)*a,t=Math.ceil(t/a)*a),e.exclusiveMinimum&&t===e.minimum&&(t+=a||1),e.exclusiveMaximum&&r===e.maximum&&(r-=a||1),t>r)return NaN;if(a){let p=Q.number(Math.floor(t/a),Math.floor(r/a))*a;for(;p<t;)p+=a;return p}return Q.number(t,r,void 0,void 0,e.type!=="integer")}function Di(e){return Math.floor(sr({...e}))}function Fi(e){return Q.shuffle(hn).slice(0,e)}function Wi(e,t,r,a){let l={},p=e.properties||{},u=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),L=e.additionalProperties!==!1,S=Object.keys(p),D=Object.keys(u),b=S.concat(D).reduce((W,d)=>(O.indexOf(d)===-1&&W.push(d),W),[]),Y=O.concat(b),U=L&&e.additionalProperties===!0?At:e.additionalProperties;if(!L&&S.length===0&&D.length===0&&ce.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(Z("requiredOnly")===!0)return O.forEach(W=>{p[W]&&(l[W]=p[W])}),a(l,t.concat(["properties"]),r,e);let ie=Z("alwaysFakeOptionals")===!0?1:Z("optionalsProbability"),G=Z("alwaysFakeOptionals")||Z("fixedProbabilities")||!1,X=Z("ignoreProperties")||[],fe=Z("reuseProperties"),de=Z("fillProperties"),F=e.maxProperties||Y.length+(L?Q.number(1,5):0),g=Math.max(e.minProperties||0,O.length),w=Math.max(0,Y.length-g);Y.length===1&&!O.length&&(g=Math.max(Q.number(de?1:0,F),g)),ie!==null&&(G===!0?w=Math.round(g-O.length+ie*(Y.length-g)):w=Q.number(g-O.length,ie*(Y.length-g)));let R=Q.shuffle(b).slice(0,w),k=b.filter(W=>R.indexOf(W)!==-1),C=ie!==null||O.length===F?F:Q.number(0,F),T=O.concat(Q.shuffle(k).slice(0,C)).slice(0,F),P=[],I=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(W=>{let d=e.dependencies[W];if(T.indexOf(W)!==-1)if(Array.isArray(d))d.forEach(M=>{T.indexOf(M)===-1&&T.push(M)});else if(Array.isArray(d.oneOf||d.anyOf)){let M=d.oneOf||d.anyOf;I.push({prop:W,values:M})}else P.push(d)}),P.length))return delete e.dependencies,a({allOf:P.concat(e)},t.concat(["properties"]),r,e);let B=[],H=[];T.forEach(W=>{if(p[W]&&["{}","true"].includes(JSON.stringify(p[W].not)))return;for(let M=0;M<X.length;M+=1)if(X[M]instanceof RegExp&&X[M].test(W)||typeof X[M]=="string"&&X[M]===W||typeof X[M]=="function"&&X[M](p[W],W)){B.push(W);return}U===!1&&O.indexOf(W)!==-1&&(l[W]=p[W]),p[W]&&(l[W]=p[W]);let d;if(D.forEach(M=>{W.match(new RegExp(M))&&(d=!0,l[W]?ce.merge(l[W],u[M]):l[Q.randexp(W)]=u[M])}),!d){let M=u[W]||U;M&&U!==!1?l[u[W]?Q.randexp(W):W]=p[W]||M:H.push(W)}});let z=Object.keys(l).length+(de?0:B.length),we=W=>Q.randexp(`_?[_a-f\\d]{1,3}${W?"\\$?":""}`);function Se(W){let d;do{if(!W.length)break;d=W.shift()}while(l[d]);return d}let ve=g;if(L&&!O.length&&(ve=Math.max(ie===null||U?Q.number(de?1:0,F):0,g)),!k.length&&!w&&L&&G===!0&&de){let W=Q.number(0,F);for(let d=0;d<W;d+=1)l[vt(1)+we(W[d])]=U||At}for(;de&&!(!(D.length||L)||z>=ve);){if(L)if(fe&&S.length-z>ve){let W=0,d;do{if(W+=1,W>1e3)break;d=Se(O)||Q.pick(S)}while(typeof l[d]!="undefined");typeof l[d]=="undefined"&&(l[d]=p[d],z+=1)}else if(D.length&&!U){let W=Q.pick(D),d=Q.randexp(W);l[d]||(l[d]=u[W],z+=1)}else{let W=Se(O)||vt(1)+we();l[W]||(l[W]=U||At,z+=1)}for(let W=0;z<g&&W<D.length;W+=1){let d=D[W],M=Q.randexp(d);l[M]||(l[M]=u[d],z+=1)}}if(O.length===0&&(!L||ie===!1)){let W=Q.number(g,F);for(;z<W;){let d=Se(S);d&&(l[d]=p[d]),z+=1}}let Te=l;if(Z("sortProperties")!==null){let W=Object.keys(p);Te=Object.keys(l).sort((M,q)=>Z("sortProperties")?M.localeCompare(q):W.indexOf(M)-W.indexOf(q)).reduce((M,q)=>(M[q]=l[q],M),{})}let ke=a(Te,t.concat(["properties"]),r,e);return I.forEach(W=>{for(let d of W.values)if(ce.hasValue(d.properties[W.prop],ke.value[W.prop])){Object.keys(d.properties).forEach(M=>{M!==W.prop&&ce.merge(ke.value,a(d.properties,t.concat(["properties"]),r,e).value)});break}}),ke}function kr(){let e=Q.number(1,5);return vt(e).join(" ")}function ji(e=0,t=140){let r=Math.max(0,e),a=Q.number(r,t),l=kr();for(;l.length<r;)l+=kr();return l.length>a&&(l=l.substr(0,a)),l}function Ui(){return[0,0,0,0].map(()=>Q.number(0,255)).join(".")}function Bi(){return Q.date().toISOString()}function Vi(){return bt().slice(0,10)}function Yi(){return bt().slice(11)}function Hi(e){return Q.randexp($e[e]).replace(On,(t,r)=>Q.randexp($e[r]))}function qi(e,t){let r=ir(e.format);if(typeof r=="function")return r(e);switch(e.format){case"date-time":case"datetime":return bt();case"date":return yn();case"time":return wn();case"ipv4":return gn();case"regex":return".+?";case"email":case"hostname":case"ipv6":case"uri":case"uri-reference":case"iri":case"iri-reference":case"idn-email":case"idn-hostname":case"json-pointer":case"slug":case"uri-template":case"uuid":case"duration":return En(e.format);default:if(typeof r=="undefined"){if(Z("failOnInvalidFormat"))throw new Error(`unknown registry key ${ce.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function Ki(e){return ce.typecast("string",e,r=>e.format?qi(e,()=>or(r.minLength,r.maxLength)):e.pattern?Q.randexp(e.pattern):or(r.minLength,r.maxLength))}function Ji({$comment:e,title:t,description:r}){return Object.entries({comment:e,title:t,description:r}).filter(([,a])=>a).reduce((a,[l,p])=>(a[l]=p,a),{})}function Xe(e,t,r,a){if(e=r(e,null,t),e&&(e.oneOf||e.anyOf||e.allOf)&&(e=r(e,null,t)),!e)throw new Error(`Cannot traverse at '${t.join(".")}', given '${JSON.stringify(a)}'`);let l={...Ji(e),schemaPath:t};if(t[t.length-1]!=="properties"){if(Z("useExamplesValue")&&Array.isArray(e.examples)){let S=e.examples.concat("default"in e?[e.default]:[]);return{value:ce.typecast(null,e,()=>Q.pick(S)),context:l}}if(Z("useExamplesValue")&&typeof e.example!="undefined")return{value:ce.typecast(null,e,()=>e.example),context:l};if(Z("useDefaultValue")&&"default"in e&&(e.default!==""||!Z("replaceEmptyByRandomValue")))return{value:e.default,context:l};if("template"in e)return{value:ce.template(e.template,a),context:l};if("const"in e)return{value:e.const,context:l}}if(e.not&&typeof e.not=="object"&&(e=ce.notValue(e.not,ce.omitProps(e,["not"])),e.type&&e.type==="object")){let{value:S,context:D}=Xe(e,t.concat(["not"]),r,a);return{value:ce.clean(S,e,!1),context:{...l,items:D}}}if(typeof e.thunk=="function"){let{value:S,context:D}=Xe(e.thunk(a),t,r);return{value:S,context:{...l,items:D}}}if(e.jsonPath)return{value:e,context:l};let p=e.type;if(Array.isArray(p)?p=Q.pick(p):typeof p=="undefined"&&(p=sn(e,t)||p,p&&(e.type=p)),typeof e.generate=="function"){let S=ce.typecast(null,e,()=>e.generate(a,t)),D=S===null?"null":typeof S;if(D===p||D==="number"&&p==="integer"||Array.isArray(S)&&p==="array")return{value:S,context:l}}if(typeof e.pattern=="string")return{value:ce.typecast("string",e,()=>Q.randexp(e.pattern)),context:l};if(Array.isArray(e.enum))return{value:ce.typecast(null,e,()=>Q.pick(e.enum)),context:l};if(typeof p=="string")if(ct[p])try{let S=ct[p](e,t,r,Xe);return p==="array"?{value:S.map(({value:D})=>D),context:{...l,items:S.map(Array.isArray(e.items)?({context:D})=>D:({context:D})=>({...D,schemaPath:D.schemaPath.slice(0,-1)}))}}:p==="object"?S!==null?{value:S.value,context:{...l,items:S.context}}:{value:{},context:l}:{value:S,context:l}}catch(S){throw typeof S.path=="undefined"?new Et(S.stack,t):S}else{if(Z("failOnInvalidTypes"))throw new Et(`unknown primitive ${ce.short(p)}`,t.concat(["type"]));{let S=Z("defaultInvalidTypeProduct");return typeof S=="string"&&ct[S]?{value:ct[S](e,t,r,Xe),context:l}:{value:S,context:l}}}let u={},O={...l};Array.isArray(e)&&(u=[]);let L=Z("pruneProperties")||[];return Object.keys(e).forEach(S=>{if(!L.includes(S)&&e[S]!==null)if(typeof e[S]=="object"&&S!=="definitions"){let{value:D,context:b}=Xe(e[S],t.concat([S]),r,u);u[S]=ce.clean(D,e[S],!1),O[S]=b,u[S]===null&&Z("omitNulls")&&(delete u[S],delete O[S])}else u[S]=e[S]}),{value:u,context:O}}function Gi(e){return Array.isArray(e)?Q.pick(e):e}function Qi(e,t){if(!Array.isArray(e))return e;let r=t?e.pop():e.shift();return t?e.unshift(r):e.push(r),r}function Ht(e,t,r,a){if(!e||typeof e!="object")return e;if(r||(r={}),t||(t=e),Array.isArray(e))return e.map(l=>Ht(l,t,r,a));if(e.jsonPath){let{JSONPath:l}=Xt(),p=typeof e.jsonPath!="object"?{path:e.jsonPath}:e.jsonPath;p.group=e.group||p.group||a,p.cycle=e.cycle||p.cycle||!1,p.reverse=e.reverse||p.reverse||!1,p.count=e.count||p.count||1;let u=`${p.group}__${p.path}`;return r[u]||(p.count>1?r[u]=l(p.path,t).slice(0,p.count):r[u]=l(p.path,t)),p.cycle||p.reverse?Qi(r[u],p.reverse):Gi(r[u])}return Object.keys(e).forEach(l=>{e[l]=Ht(e[l],t,r,l)}),e}function zi(e,t,r,a){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let l=Z("refDepthMin")||0,p=Z("refDepthMax")||3;try{let{resolveSchema:u}=Rn({refs:e,schema:t,container:r,synchronous:a,refDepthMin:l,refDepthMax:p}),O=bn(ce.clone(t),[],u);return Z("resolveJsonPath")?{value:Ht(O.value),context:O.context}:O}catch(u){throw u.path?new Error(`${u.message} in /${u.path.join("/")}`):u}}function Zi(e){return e.value}function Xi(e,t){return t.reduce((r,a)=>a in r?r[a]:{},e)}function qt(e,t,r,a=r){let{title:l,description:p,comment:u}=Xi(e,t),O=[];Z("renderTitle")&&l&&O.push(` ${l}`,""),Z("renderDescription")&&p&&O.push(` ${p}`),Z("renderComment")&&u&&O.push(` ${u}`),r.commentBefore=O.join(` `),a instanceof _n?a.items.forEach(L=>{qt(e,[...t,"items",L.key.value],L.key,L.value)}):a instanceof kn&&a.items.forEach((L,S)=>{qt(e,[...t,"items",S],L)})}function es({value:e,context:t}){let r=ut.createNode(e);qt(t,[],r);let a=new ut.Document;return a.contents=r,a.toString()}function Pr(){He.define("autoIncrement",function(t,r){if(!this.offset){let a=r.minimum||1,l=a+Ve.MAX_NUMBER,p=t.initialOffset||r.initialOffset;this.offset=p||Q.number(a,l)}return t?this.offset++:r}),He.define("sequentialDate",function(t,r){if(this.now||(this.now=Q.date()),t){if(r=this.now.toISOString(),t=t===!0?"days":t,["seconds","minutes","hours","days","weeks","months","years"].indexOf(t)===-1)throw new Error(`Unsupported increment by ${ce.short(t)}`);this.now.setTime(this.now.getTime()+Q.date(t))}return r})}function Mr(e,t){let r={};Array.isArray(e)?e.forEach(l=>{r[l.$id||l.id]=l}):r=e||{};function a(l){if(!l||typeof l!="object")return;if(Array.isArray(l))return l.forEach(a);let p=l.$id||l.id;typeof p=="string"&&!r[p]&&(r[p]=l),Object.keys(l).forEach(u=>{a(l[u])})}return a(e),a(t),r}var Nr,Kt,Ir,Jt,Cr,xr,Le,Lr,Gt,st,Qt,$r,Dr,Fr,Wr,jr,ot,St,zt,Ur,Br,Zt,Xt,Vr,Yr,er,le,tr,Hr,qr,at,Z,rr,nr,Kr,Jr,Gr,Qr,zr,Zr,Ve,Ot,Q,Xr,ce,en,tn,et,ir,rn,Et,lt,nn,sn,on,an,ln,cn,un,fn,pn,sr,dn,hn,vt,At,mn,or,gn,bt,yn,wn,ar,Tt,Sn,$e,On,En,vn,An,ct,bn,Tn,Rn,lr,cr,Pe,ts,rs,ns,is,ss,os,as,ls,cs,us,fs,ps,_n,kn,ut,He,ye,Pn,Mn,ds=A({"src/shared.js"(){Nr=Object.create,Kt=Object.defineProperty,Ir=Object.getOwnPropertyDescriptor,Jt=Object.getOwnPropertyNames,Cr=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty,Le=(e,t)=>function(){return t||(0,e[Jt(e)[0]])((t={exports:{}}).exports,t),t.exports},Lr=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Jt(t))!xr.call(e,l)&&l!==r&&Kt(e,l,{get:()=>t[l],enumerable:!(a=Ir(t,l))||a.enumerable});return e},Gt=(e,t,r)=>(r=e!=null?Nr(Cr(e)):{},Lr(t||!e||!e.__esModule?Kt(r,"default",{value:e,enumerable:!0}):r,e)),st=Le({"node_modules/ret/lib/types.js"(e,t){t.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}}}),Qt=Le({"node_modules/ret/lib/sets.js"(e){var t=st(),r=()=>[{type:t.RANGE,from:48,to:57}],a=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(r()),l=()=>[{type:t.CHAR,value:9},{type:t.CHAR,value:10},{type:t.CHAR,value:11},{type:t.CHAR,value:12},{type:t.CHAR,value:13},{type:t.CHAR,value:32},{type:t.CHAR,value:160},{type:t.CHAR,value:5760},{type:t.RANGE,from:8192,to:8202},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233},{type:t.CHAR,value:8239},{type:t.CHAR,value:8287},{type:t.CHAR,value:12288},{type:t.CHAR,value:65279}],p=()=>[{type:t.CHAR,value:10},{type:t.CHAR,value:13},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233}];e.words=()=>({type:t.SET,set:a(),not:!1}),e.notWords=()=>({type:t.SET,set:a(),not:!0}),e.ints=()=>({type:t.SET,set:r(),not:!1}),e.notInts=()=>({type:t.SET,set:r(),not:!0}),e.whitespace=()=>({type:t.SET,set:l(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:l(),not:!0}),e.anyChar=()=>({type:t.SET,set:p(),not:!0})}}),$r=Le({"node_modules/ret/lib/util.js"(e){var t=st(),r=Qt(),a="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",l={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=function(p){var u=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return p=p.replace(u,function(O,L,S,D,b,Y,U,ie){if(S)return O;var G=L?8:D?parseInt(D,16):b?parseInt(b,16):Y?parseInt(Y,8):U?a.indexOf(U):l[ie],X=String.fromCharCode(G);return/[[\]{}^$.|?*+()]/.test(X)&&(X="\\"+X),X}),p},e.tokenizeClass=(p,u)=>{for(var O=[],L=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,S,D;(S=L.exec(p))!=null;)if(S[1])O.push(r.words());else if(S[2])O.push(r.ints());else if(S[3])O.push(r.whitespace());else if(S[4])O.push(r.notWords());else if(S[5])O.push(r.notInts());else if(S[6])O.push(r.notWhitespace());else if(S[7])O.push({type:t.RANGE,from:(S[8]||S[9]).charCodeAt(0),to:S[10].charCodeAt(0)});else if(D=S[12])O.push({type:t.CHAR,value:D.charCodeAt(0)});else return[O,L.lastIndex];e.error(u,"Unterminated character class")},e.error=(p,u)=>{throw new SyntaxError("Invalid regular expression: /"+p+"/: "+u)}}}),Dr=Le({"node_modules/ret/lib/positions.js"(e){var t=st();e.wordBoundary=()=>({type:t.POSITION,value:"b"}),e.nonWordBoundary=()=>({type:t.POSITION,value:"B"}),e.begin=()=>({type:t.POSITION,value:"^"}),e.end=()=>({type:t.POSITION,value:"$"})}}),Fr=Le({"node_modules/ret/lib/index.js"(e,t){var r=$r(),a=st(),l=Qt(),p=Dr();t.exports=u=>{var O=0,L,S,D={type:a.ROOT,stack:[]},b=D,Y=D.stack,U=[],ie=k=>{r.error(u,`Nothing to repeat at column ${k-1}`)},G=r.strToChars(u);for(L=G.length;O<L;)switch(S=G[O++],S){case"\\":switch(S=G[O++],S){case"b":Y.push(p.wordBoundary());break;case"B":Y.push(p.nonWordBoundary());break;case"w":Y.push(l.words());break;case"W":Y.push(l.notWords());break;case"d":Y.push(l.ints());break;case"D":Y.push(l.notInts());break;case"s":Y.push(l.whitespace());break;case"S":Y.push(l.notWhitespace());break;default:/\d/.test(S)?Y.push({type:a.REFERENCE,value:parseInt(S,10)}):Y.push({type:a.CHAR,value:S.charCodeAt(0)})}break;case"^":Y.push(p.begin());break;case"$":Y.push(p.end());break;case"[":var X;G[O]==="^"?(X=!0,O++):X=!1;var fe=r.tokenizeClass(G.slice(O),u);O+=fe[1],Y.push({type:a.SET,set:fe[0],not:X});break;case".":Y.push(l.anyChar());break;case"(":var de={type:a.GROUP,stack:[],remember:!0};S=G[O],S==="?"&&(S=G[O+1],O+=2,S==="="?de.followedBy=!0:S==="!"?de.notFollowedBy=!0:S!==":"&&r.error(u,`Invalid group, character '${S}' after '?' at column ${O-1}`),de.remember=!1),Y.push(de),U.push(b),b=de,Y=de.stack;break;case")":U.length===0&&r.error(u,`Unmatched ) at column ${O-1}`),b=U.pop(),Y=b.options?b.options[b.options.length-1]:b.stack;break;case"|":b.options||(b.options=[b.stack],delete b.stack);var F=[];b.options.push(F),Y=F;break;case"{":var g=/^(\d+)(,(\d+)?)?\}/.exec(G.slice(O)),w,R;g!==null?(Y.length===0&&ie(O),w=parseInt(g[1],10),R=g[2]?g[3]?parseInt(g[3],10):1/0:w,O+=g[0].length,Y.push({type:a.REPETITION,min:w,max:R,value:Y.pop()})):Y.push({type:a.CHAR,value:123});break;case"?":Y.length===0&&ie(O),Y.push({type:a.REPETITION,min:0,max:1,value:Y.pop()});break;case"+":Y.length===0&&ie(O),Y.push({type:a.REPETITION,min:1,max:1/0,value:Y.pop()});break;case"*":Y.length===0&&ie(O),Y.push({type:a.REPETITION,min:0,max:1/0,value:Y.pop()});break;default:Y.push({type:a.CHAR,value:S.charCodeAt(0)})}return U.length!==0&&r.error(u,"Unterminated group"),D},t.exports.types=a}}),Wr=Le({"node_modules/drange/lib/index.js"(e,t){"use strict";var r=class rt{constructor(p,u){this.low=p,this.high=u,this.length=1+u-p}overlaps(p){return!(this.high<p.low||this.low>p.high)}touches(p){return!(this.high+1<p.low||this.low-1>p.high)}add(p){return new rt(Math.min(this.low,p.low),Math.max(this.high,p.high))}subtract(p){return p.low<=this.low&&p.high>=this.high?[]:p.low>this.low&&p.high<this.high?[new rt(this.low,p.low-1),new rt(p.high+1,this.high)]:p.low<=this.low?[new rt(p.high+1,this.high)]:[new rt(this.low,p.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},a=class dt{constructor(p,u){this.ranges=[],this.length=0,p!=null&&this.add(p,u)}_update_length(){this.length=this.ranges.reduce((p,u)=>p+u.length,0)}add(p,u){var O=L=>{for(var S=0;S<this.ranges.length&&!L.touches(this.ranges[S]);)S++;for(var D=this.ranges.slice(0,S);S<this.ranges.length&&L.touches(this.ranges[S]);)L=L.add(this.ranges[S]),S++;D.push(L),this.ranges=D.concat(this.ranges.slice(S)),this._update_length()};return p instanceof dt?p.ranges.forEach(O):(u==null&&(u=p),O(new r(p,u))),this}subtract(p,u){var O=L=>{for(var S=0;S<this.ranges.length&&!L.overlaps(this.ranges[S]);)S++;for(var D=this.ranges.slice(0,S);S<this.ranges.length&&L.overlaps(this.ranges[S]);)D=D.concat(this.ranges[S].subtract(L)),S++;this.ranges=D.concat(this.ranges.slice(S)),this._update_length()};return p instanceof dt?p.ranges.forEach(O):(u==null&&(u=p),O(new r(p,u))),this}intersect(p,u){var O=[],L=S=>{for(var D=0;D<this.ranges.length&&!S.overlaps(this.ranges[D]);)D++;for(;D<this.ranges.length&&S.overlaps(this.ranges[D]);){var b=Math.max(this.ranges[D].low,S.low),Y=Math.min(this.ranges[D].high,S.high);O.push(new r(b,Y)),D++}};return p instanceof dt?p.ranges.forEach(L):(u==null&&(u=p),L(new r(p,u))),this.ranges=O,this._update_length(),this}index(p){for(var u=0;u<this.ranges.length&&this.ranges[u].length<=p;)p-=this.ranges[u].length,u++;return this.ranges[u].low+p}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new dt(this)}numbers(){return this.ranges.reduce((p,u)=>{for(var O=u.low;O<=u.high;)p.push(O),O++;return p},[])}subranges(){return this.ranges.map(p=>({low:p.low,high:p.high,length:1+p.high-p.low}))}};t.exports=a}}),jr=Le({"node_modules/randexp/lib/randexp.js"(e,t){var r=Fr(),a=Wr(),l=r.types;t.exports=class ht{constructor(u,O){if(this._setDefaults(u),u instanceof RegExp)this.ignoreCase=u.ignoreCase,this.multiline=u.multiline,u=u.source;else if(typeof u=="string")this.ignoreCase=O&&O.indexOf("i")!==-1,this.multiline=O&&O.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=r(u)}_setDefaults(u){this.max=u.max!=null?u.max:ht.prototype.max!=null?ht.prototype.max:100,this.defaultRange=u.defaultRange?u.defaultRange:this.defaultRange.clone(),u.randInt&&(this.randInt=u.randInt)}gen(){return this._gen(this.tokens,[])}_gen(u,O){var L,S,D,b,Y;switch(u.type){case l.ROOT:case l.GROUP:if(u.followedBy||u.notFollowedBy)return"";for(u.remember&&u.groupNumber===void 0&&(u.groupNumber=O.push(null)-1),L=u.options?this._randSelect(u.options):u.stack,S="",b=0,Y=L.length;b<Y;b++)S+=this._gen(L[b],O);return u.remember&&(O[u.groupNumber]=S),S;case l.POSITION:return"";case l.SET:var U=this._expand(u);return U.length?String.fromCharCode(this._randSelect(U)):"";case l.REPETITION:for(D=this.randInt(u.min,u.max===1/0?u.min+this.max:u.max),S="",b=0;b<D;b++)S+=this._gen(u.value,O);return S;case l.REFERENCE:return O[u.value-1]||"";case l.CHAR:var ie=this.ignoreCase&&this._randBool()?this._toOtherCase(u.value):u.value;return String.fromCharCode(ie)}}_toOtherCase(u){return u+(97<=u&&u<=122?-32:65<=u&&u<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(u){return u instanceof a?u.index(this.randInt(0,u.length-1)):u[this.randInt(0,u.length-1)]}_expand(u){if(u.type===r.types.CHAR)return new a(u.value);if(u.type===r.types.RANGE)return new a(u.from,u.to);{let O=new a;for(let L=0;L<u.set.length;L++){let S=this._expand(u.set[L]);if(O.add(S),this.ignoreCase)for(let D=0;D<S.length;D++){let b=S.index(D),Y=this._toOtherCase(b);b!==Y&&O.add(Y)}}return u.not?this.defaultRange.clone().subtract(O):this.defaultRange.clone().intersect(O)}}randInt(u,O){return u+Math.floor(Math.random()*(1+O-u))}get defaultRange(){return this._range=this._range||new a(32,126)}set defaultRange(u){this._range=u}static randexp(u,O){var L;return typeof u=="string"&&(u=new RegExp(u,O)),u._randexp===void 0?(L=new ht(u,O),u._randexp=L):(L=u._randexp,L._setDefaults(u)),L.gen()}static sugar(){RegExp.prototype.gen=function(){return ht.randexp(this)}}}}}),ot=Le({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(e){"use strict";var t={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},r={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},a="tag:yaml.org,2002:",l={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function p(F){let g=[0],w=F.indexOf(` `);for(;w!==-1;)w+=1,g.push(w),w=F.indexOf(` `,w);return g}function u(F){let g,w;return typeof F=="string"?(g=p(F),w=F):(Array.isArray(F)&&(F=F[0]),F&&F.context&&(F.lineStarts||(F.lineStarts=p(F.context.src)),g=F.lineStarts,w=F.context.src)),{lineStarts:g,src:w}}function O(F,g){if(typeof F!="number"||F<0)return null;let{lineStarts:w,src:R}=u(g);if(!w||!R||F>R.length)return null;for(let C=0;C<w.length;++C){let T=w[C];if(F<T)return{line:C,col:F-w[C-1]+1};if(F===T)return{line:C+1,col:1}}let k=w.length;return{line:k,col:F-w[k-1]+1}}function L(F,g){let{lineStarts:w,src:R}=u(g);if(!w||!(F>=1)||F>w.length)return null;let k=w[F-1],C=w[F];for(;C&&C>k&&R[C-1]===` `;)--C;return R.slice(k,C)}function S({start:F,end:g},w,R=80){let k=L(F.line,w);if(!k)return null;let{col:C}=F;if(k.length>R)if(C<=R-10)k=k.substr(0,R-1)+"\u2026";else{let H=Math.round(R/2);k.length>C+H&&(k=k.substr(0,C+H-1)+"\u2026"),C-=k.length-R,k="\u2026"+k.substr(1-R)}let T=1,P="";g&&(g.line===F.line&&C+(g.col-F.col)<=R+1?T=g.col-F.col:(T=Math.min(k.length+1,R)-C,P="\u2026"));let I=C>1?" ".repeat(C-1):"",B="^".repeat(T);return`${k} ${I}${B}${P}`}var D=class li{static copy(g){return new li(g.start,g.end)}constructor(g,w){this.start=g,this.end=w||g}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(g,w){let{start:R,end:k}=this;if(g.length===0||k<=g[0])return this.origStart=R,this.origEnd=k,w;let C=w;for(;C<g.length&&!(g[C]>R);)++C;this.origStart=R+C;let T=C;for(;C<g.length&&!(g[C]>=k);)++C;return this.origEnd=k+C,T}},b=class Je{static addStringTerminator(g,w,R){if(R[R.length-1]===` `)return R;let k=Je.endOfWhiteSpace(g,w);return k>=g.length||g[k]===` `?R+` `:R}static atDocumentBoundary(g,w,R){let k=g[w];if(!k)return!0;let C=g[w-1];if(C&&C!==` `)return!1;if(R){if(k!==R)return!1}else if(k!==t.DIRECTIVES_END&&k!==t.DOCUMENT_END)return!1;let T=g[w+1],P=g[w+2];if(T!==k||P!==k)return!1;let I=g[w+3];return!I||I===` `||I===" "||I===" "}static endOfIdentifier(g,w){let R=g[w],k=R==="<",C=k?[` `," "," ",">"]:[` `," "," ","[","]","{","}",","];for(;R&&C.indexOf(R)===-1;)R=g[w+=1];return k&&R===">"&&(w+=1),w}static endOfIndent(g,w){let R=g[w];for(;R===" ";)R=g[w+=1];return w}static endOfLine(g,w){let R=g[w];for(;R&&R!==` `;)R=g[w+=1];return w}static endOfWhiteSpace(g,w){let R=g[w];for(;R===" "||R===" ";)R=g[w+=1];return w}static startOfLine(g,w){let R=g[w-1];if(R===` `)return w;for(;R&&R!==` `;)R=g[w-=1];return w+1}static endOfBlockIndent(g,w,R){let k=Je.endOfIndent(g,R);if(k>R+w)return k;{let C=Je.endOfWhiteSpace(g,k),T=g[C];if(!T||T===` `)return C}return null}static atBlank(g,w,R){let k=g[w];return k===` `||k===" "||k===" "||R&&!k}static nextNodeIsIndented(g,w,R){return!g||w<0?!1:w>0?!0:R&&g==="-"}static normalizeOffset(g,w){let R=g[w];return R?R!==` `&&g[w-1]===` `?w-1:Je.endOfWhiteSpace(g,w):w}static foldNewline(g,w,R){let k=0,C=!1,T="",P=g[w+1];for(;P===" "||P===" "||P===` `;){switch(P){case` `:k=0,w+=1,T+=` `;break;case" ":k<=R&&(C=!0),w=Je.endOfWhiteSpace(g,w+2)-1;break;case" ":k+=1,w+=1;break}P=g[w+1]}return T||(T=" "),P&&k<=R&&(C=!0),{fold:T,offset:w,error:C}}constructor(g,w,R){Object.defineProperty(this,"context",{value:R||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=w||[],this.type=g,this.value=null}getPropValue(g,w,R){if(!this.context)return null;let{src:k}=this.context,C=this.props[g];return C&&k[C.start]===w?k.slice(C.start+(R?1:0),C.end):null}get anchor(){for(let g=0;g<this.props.length;++g){let w=this.getPropValue(g,t.ANCHOR,!0);if(w!=null)return w}return null}get comment(){let g=[];for(let w=0;w<this.props.length;++w){let R=this.getPropValue(w,t.COMMENT,!0);R!=null&&g.push(R)}return g.length>0?g.join(` `):null}commentHasRequiredWhitespace(g){let{src:w}=this.context;if(this.header&&g===this.header.end||!this.valueRange)return!1;let{end:R}=this.valueRange;return g!==R||Je.atBlank(w,R-1)}get hasComment(){if(this.context){let{src:g}=this.context;for(let w=0;w<this.props.length;++w)if(g[this.props[w].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:g}=this.context;for(let w=0;w<this.props.length;++w)if(g[this.props[w].start]!==t.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[r.FLOW_MAP,r.FLOW_SEQ,r.QUOTE_DOUBLE,r.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let g=O(this.range.start,this.context.root);if(!g)return;let w=O(this.range.end,this.context.root);return{start:g,end:w}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:g,end:w}=this.valueRange;return this.context.src.slice(g,w)}get tag(){for(let g=0;g<this.props.length;++g){let w=this.getPropValue(g,t.TAG,!1);if(w!=null){if(w[1]==="<")return{verbatim:w.slice(2,-1)};{let[R,k,C]=w.match(/^(.*!)([^!]*)$/);return{handle:k,suffix:C}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:g,end:w}=this.valueRange,{src:R}=this.context;for(let k=g;k<w;++k)if(R[k]===` `)return!0;return!1}parseComment(g){let{src:w}=this.context;if(w[g]===t.COMMENT){let R=Je.endOfLine(w,g+1),k=new D(g,R);return this.props.push(k),R}return g}setOrigRanges(g,w){return this.range&&(w=this.range.setOrigRange(g,w)),this.valueRange&&this.valueRange.setOrigRange(g,w),this.props.forEach(R=>R.setOrigRange(g,w)),w}toString(){let{context:{src:g},range:w,value:R}=this;if(R!=null)return R;let k=g.slice(w.start,w.end);return Je.addStringTerminator(g,w.end,k)}},Y=class extends Error{constructor(F,g,w){if(!w||!(g instanceof b))throw new Error(`Invalid arguments for new ${F}`);super(),this.name=F,this.message=w,this.source=g}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let F=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new D(this.offset,this.offset+1);let g=F&&O(this.offset,F);if(g){let w={line:g.line,col:g.col+1};this.linePos={start:g,end:w}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:g,col:w}=this.linePos.start;this.message+=` at line ${g}, column ${w}`;let R=F&&S(this.linePos,F);R&&(this.message+=`: ${R} `)}delete this.source}},U=class extends Y{constructor(F,g){super("YAMLReferenceError",F,g)}},ie=class extends Y{constructor(F,g){super("YAMLSemanticError",F,g)}},G=class extends Y{constructor(F,g){super("YAMLSyntaxError",F,g)}},X=class extends Y{constructor(F,g){super("YAMLWarning",F,g)}};function fe(F,g,w){return g in F?Object.defineProperty(F,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):F[g]=w,F}var de=class Sr extends b{static endOfLine(g,w,R){let k=g[w],C=w;for(;k&&k!==` `&&!(R&&(k==="["||k==="]"||k==="{"||k==="}"||k===","));){let T=g[C+1];if(k===":"&&(!T||T===` `||T===" "||T===" "||R&&T===",")||(k===" "||k===" ")&&T==="#")break;C+=1,k=T}return C}get strValue(){if(!this.valueRange||!this.context)return null;let{start:g,end:w}=this.valueRange,{src:R}=this.context,k=R[w-1];for(;g<w&&(k===` `||k===" "||k===" ");)k=R[--w-1];let C="";for(let P=g;P<w;++P){let I=R[P];if(I===` `){let{fold:B,offset:H}=b.foldNewline(R,P,-1);C+=B,P=H}else if(I===" "||I===" "){let B=P,H=R[P+1];for(;P<w&&(H===" "||H===" ");)P+=1,H=R[P+1];H!==` `&&(C+=P>B?R.slice(B,P+1):I)}else C+=I}let T=R[g];switch(T){case" ":{let P="Plain value cannot start with a tab character";return{errors:[new ie(this,P)],str:C}}case"@":case"`":{let P=`Plain value cannot start with reserved character ${T}`;return{errors:[new ie(this,P)],str:C}}default:return C}}parseBlockValue(g){let{indent:w,inFlow:R,src:k}=this.context,C=g,T=g;for(let P=k[C];P===` `&&!b.atDocumentBoundary(k,C+1);P=k[C]){let I=b.endOfBlockIndent(k,w,C+1);if(I===null||k[I]==="#")break;k[I]===` `?C=I:(T=Sr.endOfLine(k,I,R),C=T)}return this.valueRange.isEmpty()&&(this.valueRange.start=g),this.valueRange.end=T,T}parse(g,w){this.context=g;let{inFlow:R,src:k}=g,C=w,T=k[C];return T&&T!=="#"&&T!==` `&&(C=Sr.endOfLine(k,w,R)),this.valueRange=new D(w,C),C=b.endOfWhiteSpace(k,C),C=this.parseComment(C),(!this.hasComment||this.valueRange.isEmpty())&&(C=this.parseBlockValue(C)),C}};e.Char=t,e.Node=b,e.PlainValue=de,e.Range=D,e.Type=r,e.YAMLError=Y,e.YAMLReferenceError=U,e.YAMLSemanticError=ie,e.YAMLSyntaxError=G,e.YAMLWarning=X,e._defineProperty=fe,e.defaultTagPrefix=a,e.defaultTags=l}}),St=Le({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(e){"use strict";var t=ot();function r(i,n,o){return o?`#${o.replace(/[\s\S]^/gm,`$&${n}#`)} ${n}${i}`:i}function a(i,n,o){return o?o.indexOf(` `)===-1?`${i} #${o}`:`${i} `+o.replace(/^/gm,`${n||""}#`):i}var l=class{};function p(i,n,o){if(Array.isArray(i))return i.map((c,h)=>p(c,String(h),o));if(i&&typeof i.toJSON=="function"){let c=o&&o.anchors&&o.anchors.get(i);c&&(o.onCreate=m=>{c.res=m,delete o.onCreate});let h=i.toJSON(n,o);return c&&o.onCreate&&o.onCreate(h),h}return(!o||!o.keep)&&typeof i=="bigint"?Number(i):i}var u=class extends l{constructor(i){super(),this.value=i}toJSON(i,n){return n&&n.keep?this.value:p(this.value,i,n)}toString(){return String(this.value)}};function O(i,n,o){let c=o;for(let h=n.length-1;h>=0;--h){let m=n[h];if(Number.isInteger(m)&&m>=0){let E=[];E[m]=c,c=E}else{let E={};Object.defineProperty(E,m,{value:c,writable:!0,enumerable:!0,configurable:!0}),c=E}}return i.createNode(c,!1)}var L=i=>i==null||typeof i=="object"&&i[Symbol.iterator]().next().done,S=class ze extends l{constructor(n){super(),t._defineProperty(this,"items",[]),this.schema=n}addIn(n,o){if(L(n))this.add(o);else{let[c,...h]=n,m=this.get(c,!0);if(m instanceof ze)m.addIn(h,o);else if(m===void 0&&this.schema)this.set(c,O(this.schema,h,o));else throw new Error(`Expected YAML collection at ${c}. Remaining path: ${h}`)}}deleteIn([n,...o]){if(o.length===0)return this.delete(n);let c=this.get(n,!0);if(c instanceof ze)return c.deleteIn(o);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}getIn([n,...o],c){let h=this.get(n,!0);return o.length===0?!c&&h instanceof u?h.value:h:h instanceof ze?h.getIn(o,c):void 0}hasAllNullValues(){return this.items.every(n=>{if(!n||n.type!=="PAIR")return!1;let o=n.value;return o==null||o instanceof u&&o.value==null&&!o.commentBefore&&!o.comment&&!o.tag})}hasIn([n,...o]){if(o.length===0)return this.has(n);let c=this.get(n,!0);return c instanceof ze?c.hasIn(o):!1}setIn([n,...o],c){if(o.length===0)this.set(n,c);else{let h=this.get(n,!0);if(h instanceof ze)h.setIn(o,c);else if(h===void 0&&this.schema)this.set(n,O(this.schema,o,c));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}toJSON(){return null}toString(n,{blockItem:o,flowChars:c,isMap:h,itemIndent:m},E,v){let{indent:_,indentStep:x,stringify:V}=n,J=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||n.inFlow;J&&(m+=x);let ge=h&&this.hasAllNullValues();n=Object.assign({},n,{allNullValues:ge,indent:m,inFlow:J,type:null});let re=!1,he=!1,ne=this.items.reduce((Re,oe,Oe)=>{let ue;oe&&(!re&&oe.spaceBefore&&Re.push({type:"comment",str:""}),oe.commentBefore&&oe.commentBefore.match(/^.*$/gm).forEach(_s=>{Re.push({type:"comment",str:`#${_s}`})}),oe.comment&&(ue=oe.comment),J&&(!re&&oe.spaceBefore||oe.commentBefore||oe.comment||oe.key&&(oe.key.commentBefore||oe.key.comment)||oe.value&&(oe.value.commentBefore||oe.value.comment))&&(he=!0)),re=!1;let Me=V(oe,n,()=>ue=null,()=>re=!0);return J&&!he&&Me.includes(` `)&&(he=!0),J&&Oe<this.items.length-1&&(Me+=","),Me=a(Me,m,ue),re&&(ue||J)&&(re=!1),Re.push({type:"item",str:Me}),Re},[]),pe;if(ne.length===0)pe=c.start+c.end;else if(J){let{start:Re,end:oe}=c,Oe=ne.map(ue=>ue.str);if(he||Oe.reduce((ue,Me)=>ue+Me.length+2,2)>ze.maxFlowStringSingleLineLength){pe=Re;for(let ue of Oe)pe+=ue?` ${x}${_}${ue}`:` `;pe+=` ${_}${oe}`}else pe=`${Re} ${Oe.join(" ")} ${oe}`}else{let Re=ne.map(o);pe=Re.shift();for(let oe of Re)pe+=oe?` ${_}${oe}`:` `}return this.comment?(pe+=` `+this.comment.replace(/^/gm,`${_}#`),E&&E()):re&&v&&v(),pe}};t._defineProperty(S,"maxFlowStringSingleLineLength",60);function D(i){let n=i instanceof u?i.value:i;return n&&typeof n=="string"&&(n=Number(n)),Number.isInteger(n)&&n>=0?n:null}var b=class extends S{add(i){this.items.push(i)}delete(i){let n=D(i);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(i,n){let o=D(i);if(typeof o!="number")return;let c=this.items[o];return!n&&c instanceof u?c.value:c}has(i){let n=D(i);return typeof n=="number"&&n<this.items.length}set(i,n){let o=D(i);if(typeof o!="number")throw new Error(`Expected a valid index, not ${i}.`);this.items[o]=n}toJSON(i,n){let o=[];n&&n.onCreate&&n.onCreate(o);let c=0;for(let h of this.items)o.push(p(h,String(c++),n));return o}toString(i,n,o){return i?super.toString(i,{blockItem:c=>c.type==="comment"?c.str:`- ${c.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(i.indent||"")+" "},n,o):JSON.stringify(this)}},Y=(i,n,o)=>n===null?"":typeof n!="object"?String(n):i instanceof l&&o&&o.do