UNPKG

@novu/framework

Version:

The Code-First Notifications Workflow SDK.

30 lines (29 loc) 225 kB
"use strict";var Zo=Object.create;var Lt=Object.defineProperty;var Mi=Object.getOwnPropertyDescriptor;var ea=Object.getOwnPropertyNames;var ta=Object.getPrototypeOf,na=Object.prototype.hasOwnProperty;var ra=(d,n)=>{for(var s in n)Lt(d,s,{get:n[s],enumerable:!0})},Ci=(d,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let g of ea(n))!na.call(d,g)&&g!==s&&Lt(d,g,{get:()=>n[g],enumerable:!(a=Mi(n,g))||a.enumerable});return d};var ot=(d,n,s)=>(s=d!=null?Zo(ta(d)):{},Ci(n||!d||!d.__esModule?Lt(s,"default",{value:d,enumerable:!0}):s,d)),ia=d=>Ci(Lt({},"__esModule",{value:!0}),d),Ke=(d,n,s,a)=>{for(var g=a>1?void 0:a?Mi(n,s):n,N=d.length-1,C;N>=0;N--)(C=d[N])&&(g=(a?C(n,s,g):C(g))||g);return a&&g&&Lt(n,s,g),g},ze=(d,n)=>(s,a)=>n(s,a,d);var sl={};ra(sl,{Client:()=>vt,CronExpression:()=>br,NOVU_OPTIONS:()=>Pt,NovuClient:()=>Ge,NovuController:()=>Ye,NovuHandler:()=>Je,NovuModule:()=>Jt,NovuRequestHandler:()=>Et,REGISTER_API_PATH:()=>Er,SeverityLevelEnum:()=>Gn,frameworkName:()=>$s,providerSchemas:()=>Vn,registerApiPath:()=>zn,workflow:()=>Ds});module.exports=ia(sl);var os=require("jsonrepair");var Dt=(a=>(a.TRIGGER="trigger",a.EXECUTE="execute",a.PREVIEW="preview",a))(Dt||{}),rn=(a=>(a.DISCOVER="discover",a.HEALTH_CHECK="health-check",a.CODE="code",a))(rn||{});var br=(F=>(F.EVERY_SECOND="* * * * * *",F.EVERY_5_SECONDS="*/5 * * * * *",F.EVERY_10_SECONDS="*/10 * * * * *",F.EVERY_30_SECONDS="*/30 * * * * *",F.EVERY_MINUTE="*/1 * * * *",F.EVERY_5_MINUTES="0 */5 * * * *",F.EVERY_10_MINUTES="0 */10 * * * *",F.EVERY_30_MINUTES="0 */30 * * * *",F.EVERY_HOUR="0 0-23/1 * * *",F.EVERY_2_HOURS="0 0-23/2 * * *",F.EVERY_3_HOURS="0 0-23/3 * * *",F.EVERY_4_HOURS="0 0-23/4 * * *",F.EVERY_5_HOURS="0 0-23/5 * * *",F.EVERY_6_HOURS="0 0-23/6 * * *",F.EVERY_7_HOURS="0 0-23/7 * * *",F.EVERY_8_HOURS="0 0-23/8 * * *",F.EVERY_9_HOURS="0 0-23/9 * * *",F.EVERY_10_HOURS="0 0-23/10 * * *",F.EVERY_11_HOURS="0 0-23/11 * * *",F.EVERY_12_HOURS="0 0-23/12 * * *",F.EVERY_DAY_AT_1AM="0 01 * * *",F.EVERY_DAY_AT_2AM="0 02 * * *",F.EVERY_DAY_AT_3AM="0 03 * * *",F.EVERY_DAY_AT_4AM="0 04 * * *",F.EVERY_DAY_AT_5AM="0 05 * * *",F.EVERY_DAY_AT_6AM="0 06 * * *",F.EVERY_DAY_AT_7AM="0 07 * * *",F.EVERY_DAY_AT_8AM="0 08 * * *",F.EVERY_DAY_AT_9AM="0 09 * * *",F.EVERY_DAY_AT_10AM="0 10 * * *",F.EVERY_DAY_AT_11AM="0 11 * * *",F.EVERY_DAY_AT_NOON="0 12 * * *",F.EVERY_DAY_AT_1PM="0 13 * * *",F.EVERY_DAY_AT_2PM="0 14 * * *",F.EVERY_DAY_AT_3PM="0 15 * * *",F.EVERY_DAY_AT_4PM="0 16 * * *",F.EVERY_DAY_AT_5PM="0 17 * * *",F.EVERY_DAY_AT_6PM="0 18 * * *",F.EVERY_DAY_AT_7PM="0 19 * * *",F.EVERY_DAY_AT_8PM="0 20 * * *",F.EVERY_DAY_AT_9PM="0 21 * * *",F.EVERY_DAY_AT_10PM="0 22 * * *",F.EVERY_DAY_AT_11PM="0 23 * * *",F.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",F.EVERY_WEEK="0 0 * * 0",F.EVERY_WEEKDAY="0 0 * * 1-5",F.EVERY_WEEKEND="0 0 * * 6,0",F.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",F.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",F.EVERY_2ND_HOUR="0 */2 * * *",F.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",F.EVERY_2ND_MONTH="0 0 1 */2 *",F.EVERY_QUARTER="0 0 1 */3 *",F.EVERY_6_MONTHS="0 0 1 */6 *",F.EVERY_YEAR="0 0 1 0 *",F.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",F.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",F.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",F.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",F.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",F.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",F.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",F.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",F.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",F.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",F.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",F.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",F.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",F.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",F.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",F.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",F.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",F.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",F.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",F.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",F.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",F.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",F.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",F.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",F.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",F))(br||{});var qe=(ce=>(ce.BRIDGE_ERROR="BridgeError",ce.EXECUTION_EVENT_CONTROL_INVALID_ERROR="ExecutionEventControlInvalidError",ce.EXECUTION_EVENT_PAYLOAD_INVALID_ERROR="ExecutionEventPayloadInvalidError",ce.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",ce.EXECUTION_STATE_CONTROL_INVALID_ERROR="ExecutionStateControlInvalidError",ce.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",ce.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",ce.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",ce.INVALID_ACTION_ERROR="InvalidActionError",ce.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",ce.MISSING_DEPENDENCY_ERROR="MissingDependencyError",ce.MISSING_SECRET_KEY_ERROR="MissingSecretKeyError",ce.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",ce.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",ce.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",ce.SIGNATURE_INVALID_ERROR="SignatureInvalidError",ce.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",ce.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",ce.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",ce.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",ce.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",ce.STEP_CONTROL_COMPILATION_FAILED_ERROR="StepControlCompilationFailedError",ce.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",ce.STEP_NOT_FOUND_ERROR="StepNotFoundError",ce.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",ce.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",ce.WORKFLOW_PAYLOAD_INVALID_ERROR="WorkflowPayloadInvalidError",ce))(qe||{});var sn=(a=>(a.POST="POST",a.GET="GET",a.OPTIONS="OPTIONS",a))(sn||{});var sa=d=>{var s,a;if(typeof d!="object"||d===null)return!1;let n=Object.getPrototypeOf(d);return(a=(s=n==null?void 0:n.constructor)==null?void 0:s.name.endsWith("Error"))!=null?a:!1},at=class extends Error{},on=class extends at{constructor(){super(...arguments);this.statusCode=404}},Fe=class extends at{constructor(){super(...arguments);this.statusCode=400}},ut=class extends at{constructor(){super(...arguments);this.statusCode=401}},dt=class extends at{constructor(n,{cause:s}={}){var a;sa(s)?(super(`${n}: ${s.message}`),this.data={stack:(a=s.stack)!=null?a:n}):(super(`${n}${s?`: ${JSON.stringify(s,null,2)}`:""}`),this.data={stack:n})}},an=class extends at{constructor(){super(...arguments);this.statusCode=409}};var Tt=class extends dt{constructor(s){super("Unknown BridgeError",{cause:s});this.statusCode=500;this.code="BridgeError"}};var ln=class extends Fe{constructor(s,a){super(`Workflow with id: \`${s}\` has a corrupt state. Step with id: \`${a}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:s,stepId:a}}},Ft=class extends Fe{constructor(s,a){super(`Workflow with id: \`${s}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=a}},cn=class extends Fe{constructor(s,a){super(`Workflow with id: \`${s}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=a}},pn=class extends Fe{constructor(s,a,g){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${a}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=g}},un=class extends Fe{constructor(s,a,g){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${a}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=g}},dn=class extends Fe{constructor(s,a,g){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${a}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=g}},fn=class extends Fe{constructor(s,a,g){super(`Workflow with id: \`${s}\` has invalid controls syntax in step with id: \`${a}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=g}},hn=class extends Fe{constructor(s,a,g,N){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${a}\` and provider with id: \`${g}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=N}},mn=class extends Fe{constructor(s,a){super(`Workflow with id: \`${s}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=a}};var ht=d=>Object.values(qe).includes(d==null?void 0:d.code),Li=d=>!ht(d)&&typeof d.statusCode=="number"&&d.statusCode>=400&&d.statusCode<500;var Tr=d=>Object.values(d).map(n=>`\`${n}\``).join(", "),yn=d=>d.replaceAll(/(\w)(\w*)/g,(n,s,a)=>s.toUpperCase()+a.toLowerCase()).replaceAll(/[\s-]+/g,"");var gn=class extends at{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${Tr(sn)}`}},$t=class extends Fe{constructor(s,a){super(`Invalid query string: \`action\`=\`${s}\`. Please use one of ${Tr(a)}`);this.code="InvalidActionError"}},wn=class extends Fe{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var Sn=class extends Error{constructor(n,s,a){super(),this.data={message:a},this.statusCode=n,this.code=s}};var jt=class extends an{constructor(n,s){super(`${yn(n)} with id: \`${s}\` already exists. Please use a different id.`)}},ft=class extends on{constructor(n,s){super(`${yn(n)} with id: \`${s}\` does not exist. Please provide a valid id.`)}},Ot=class extends dt{constructor(s,a,g,N){super(`Failed to ${g} ${yn(s)} with id: \`${a}\``,{cause:N});this.statusCode=502}};var bn=class extends ft{constructor(s){super("provider",s);this.code="ProviderNotFoundError"}},Tn=class extends Ot{constructor(s,a,g){super("provider",s,a,g);this.code="ProviderExecutionFailedError"}};var On=class extends ut{constructor(){super("Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.");this.code="SignatureMismatchError"}},An=class extends ut{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},vn=class extends ut{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},En=class extends ut{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},_n=class extends ut{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var Rn=class extends ft{constructor(s){super("step",s);this.code="StepNotFoundError"}},Pn=class extends jt{constructor(s){super("step",s);this.code="StepAlreadyExistsError"}},Yt=class extends Ot{constructor(s,a,g){super("step",s,a,g);this.code="StepExecutionFailedError"}};var Wt=class extends ft{constructor(s){super("workflow",s);this.code="WorkflowNotFoundError"}};var xn=(()=>{var d=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,g=(e,t)=>function(){return e&&(t=(0,e[s(e)[0]])(e=0)),t},N=(e,t)=>function(){return t||(0,e[s(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var r in t)d(e,r,{get:t[r],enumerable:!0})},z=(e,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of s(t))!a.call(e,p)&&p!==r&&d(e,p,{get:()=>t[p],enumerable:!(c=n(t,p))||c.enumerable});return e},re=e=>z(d({},"__esModule",{value:!0}),e),Se={};C(Se,{JSONSchemaFaker:()=>Ni,default:()=>ki,setDependencies:()=>Jr});function Ne(e,t){return typeof e=="string"?typeof t!="undefined"?It.register(e,t):It.get(e):It.registerMany(e)}function ke(e,t){return e=typeof e=="undefined"?tt.MIN_INTEGER:e,t=typeof t=="undefined"?tt.MAX_INTEGER:t,Math.floor(te("random")()*(t-e+1))+e}function be(e){return zt.default.prototype.max=te("defaultRandExpMax"),zt.default.prototype.randInt=(r,c)=>r+Math.floor(te("random")()*(1+(c-r))),new zt.default(e).gen()}function Me(e){return e[Math.floor(te("random")()*e.length)]}function $e(e){let t,r,c=e.length,p=e.slice();for(;c>0;)r=Math.floor(te("random")()*c),c-=1,t=p[c],p[c]=p[r],p[r]=t;return p}function ct(e,t){return te("random")()*(t-e)+e}function Ze(e,t,r,c,p=!1){return r=typeof r=="undefined"?tt.MIN_NUMBER:r,c=typeof c=="undefined"?tt.MAX_NUMBER:c,e=typeof e=="undefined"?r:e,t=typeof t=="undefined"?c:t,t<e&&(t+=e),p?ct(e,t):ke(e,t)}function Gt(e){switch(e){case"seconds":return Ze(0,60)*60;case"minutes":return Ze(15,50)*612;case"hours":return Ze(12,72)*36123;case"days":return Ze(7,30)*86412345;case"weeks":return Ze(4,52)*604812345;case"months":return Ze(2,13)*2592012345;case"years":return Ze(1,20)*31104012345;default:break}}function Xn(e){if(e)return Gt(e);let t=te("minDateTime"),r=te("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof r=="string"&&(r=new Date(r));let c=new Date().getTime();return typeof t=="number"&&(t=new Date(c+t)),typeof r=="number"&&(r=new Date(c+r)),new Date(ct(t.getTime(),r.getTime()))}function _r(e,t,r){if(t=decodeURIComponent(t),r&&r[t])return ce(r[t]);let c=t.replace("#/","/").split("/"),p=e.$ref&&r&&r[e.$ref]||e;for(!p&&!c[0]&&(c[0]=e.$ref.split("#/")[0]),r&&t.includes("#/")&&r[c[0]]&&(p=r[c.shift()]),c[0]||c.shift();p&&c.length>0;){let h=c.shift();if(!p[h])throw new Error(`Prop not found: ${h} (${t})`);p=p[h]}return p}function Ht(e){return typeof e=="string"&&ni.test(e)}function et(e){return["number","boolean"].includes(typeof e)}function He(e,...t){return t.filter(r=>typeof e[r]!="undefined").length>0}function Rr(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,r,c]=e.split("T")[0].split("-");return r=`0${Math.max(1,Math.min(12,r))}`.slice(-2),c=`0${Math.max(1,Math.min(31,c))}`.slice(-2),`${t}-${r}-${c}`}function Vs(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,r]=e.split("T"),[c,p,h]=t.split("-"),[f,O,U]=r.substr(0,8).split(":");return p=`0${Math.max(1,Math.min(12,p))}`.slice(-2),h=`0${Math.max(1,Math.min(31,h))}`.slice(-2),f=`0${Math.max(1,Math.min(23,f))}`.slice(-2),O=`0${Math.max(1,Math.min(59,O))}`.slice(-2),U=`0${Math.max(1,Math.min(59,U))}`.slice(-2),`${c}-${p}-${h}T${f}:${O}:${U}.000Z`}function qs(e,t,r){let c={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(c.minimum=t.minimum),typeof t.maximum!="undefined"&&(c.maximum=t.maximum),t.enum){let h=Math.max(c.minimum||0,0),f=Math.min(c.maximum||1/0,1/0);t.exclusiveMinimum&&h===t.minimum&&(h+=t.multipleOf||1),t.exclusiveMaximum&&f===t.maximum&&(f-=t.multipleOf||1),(h||f!==1/0)&&(t.enum=t.enum.filter(O=>O>=h&&O<=f))}break;case"string":{c.minLength=te("minLength")||0,c.maxLength=te("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(c.minLength=Math.max(c.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(c.maxLength=Math.min(c.maxLength,t.maxLength));break}default:break}let p=r(c);if(p==null)return null;switch(e||t.type){case"number":p=Ht(p)?parseFloat(p):p;break;case"integer":p=Ht(p)?parseInt(p,10):p;break;case"boolean":p=!!p;break;case"string":{if(et(p))return p;p=String(p);let h=Math.max(c.minLength||0,0),f=Math.min(c.maxLength||1/0,1/0),O,U=0;for(;p.length<h;)if(O=p,t.pattern?p+=Z.randexp(t.pattern):p+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${p}`,p===O){if(U+=1,U===3)break}else U=0;switch(p.length>f&&(p=p.substr(0,f)),t.format){case"date-time":case"datetime":p=new Date(Vs(p)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":p=new Date(Rr(p)).toISOString().substr(0,10);break;case"time":p=new Date(`1969-01-01 ${p}`).toISOString().substr(11);break;default:break}break}default:break}return p}function wt(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((c,p)=>{e.type==="array"&&t.type==="array"?e[r][p]=wt(e[r][p]||{},c,!0):Array.isArray(e[r])&&e[r].indexOf(c)===-1&&e[r].push(c)})):typeof e[r]!="object"||e[r]===null||Array.isArray(e[r])?e[r]=wt({},t[r]):e[r]=wt(e[r],t[r])}),e}function ce(e,t=new Map){if(!e||typeof e!="object")return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let c=[];return t.set(e,c),c.push(...e.map(p=>ce(p,t))),c}let r={};return t.set(e,r),Object.keys(e).reduce((c,p)=>(c[p]=ce(e[p],t),c),r)}function Bs(e){let t=JSON.stringify(e),r=JSON.stringify(e,null,2);return t.length>400?`${r.substr(0,400)}...`:r}function Pr(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Js(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Gs(e,t){let r=wt({},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=Z.pick(tt.SCALAR_TYPES.filter(c=>(Array.isArray(e.type)?e.type:[e.type]).every(h=>c==="number"||c==="integer"?h!=="number"&&h!=="integer":c!==h)));else if(e.enum){let c;do c=Pr();while(e.enum.indexOf(c)!==-1);r.enum=[c]}return e.required&&r.properties&&e.required.forEach(c=>{delete r.properties[c]}),r}function Qn(e,t){let r=t.minimum!==void 0,c=t.maximum!==void 0;return(r||c)&&(!r||e>=t.minimum)&&(!c||e<=t.maximum)}function Hs(e,t){return!t.every(r=>Qn(e,r))}function Ks(e,t){return t.reduce((c,p)=>c+(Qn(e,p)?1:0),0)===1}function zs(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function Xs(e,t){return Object.keys(e).filter(r=>!t.includes(r)).reduce((r,c)=>(Array.isArray(e[c])?r[c]=e[c].slice():r[c]=e[c]instanceof Object?wt({},e[c]):e[c],r),{})}function xr(e,t){return Array.isArray(e)?e.map(r=>xr(r,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(r,c)=>t[c])),e)}function Zn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function Ir(e,t){t=t.items||t;let r=te("alwaysFakeOptionals"),c=Array.isArray(t.required)&&t.required.includes(e)||r,p=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!c&&!p}function er(e,t,r=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(c=>er(c,t,!0)).filter(c=>typeof c!="undefined");if(Object.keys(e).forEach(c=>{if(Zn(e[c]))Ir(c,t)&&delete e[c];else{let p=t;t&&t.properties&&t.properties[c]&&(p=t.properties[c]);let h=er(e[c],p);Zn(h)||(e[c]=h)}typeof e[c]=="undefined"&&delete e[c]}),!(!Object.keys(e).length&&r))return e}function Qs(e){return(t,r,c,p)=>{let h=t,f=[];typeof t=="object"&&(h=Object.keys(t)[0],Array.isArray(t[h])?f=t[h]:f.push(t[h]));let O=h.split("."),U=e();for(;O.length>1;)U=U[O.shift()];return t=typeof U=="object"?U[O[0]]:U,typeof t=="function"&&(t=t.apply(U,f.map(T=>de.template(T,p)))),Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(T=>{if(typeof t[T]=="function")throw new Error(`Cannot resolve value for '${c}: ${h}', given: ${t}`)}),t}}function Zs(e,t){if(typeof e=="undefined")return bt.list();if(typeof e=="string")if(typeof t=="function")bt.register(e,t);else if(t===null||t===!1)bt.unregister(e);else return bt.get(e);else bt.registerMany(e)}function eo(e,t,r){return Object.keys(e).filter(c=>{let p=oi.indexOf(t)>-1;return r.indexOf(c)>-1&&!p}).length>0}function to(e,t){let r=Object.keys(Nt);for(let c=0;c<r.length;c+=1){let p=r[c],h=t[t.length-1];if(eo(e,h,Nt[p]))return p}}function no(){return te("random")()>.5}function ro(){return null}function io(e,t,r,c,p,h){let f=[],O=[];function U($){let E=JSON.stringify($.value);return O.indexOf(E)===-1?(O.push(E),f.push($),!0):!1}t.forEach(U);let T=100;for(;f.length!==t.length&&(U(h(r.items||c,e,p))||(T-=1),!!T););return f}function so(e,t,r,c){let p=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new Xt(`missing items for ${de.short(e)}`,t);return p}if(Array.isArray(e.items))return e.items.map((W,ae)=>{let Q=t.concat(["items",ae]);return c(W,Q,r)});let h=e.minItems,f=e.maxItems,O=te("minItems"),U=te("maxItems");O&&(h=typeof h=="undefined"?O:Math.min(O,h)),U&&(f=typeof f=="undefined"?U:Math.min(U,f),f&&f>U&&(f=U),h&&h>U&&(h=f));let T=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),$=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,E=Z.number(h,f,1,5);T!==null&&(E=Math.max($?Math.round((f||E)*T):Math.abs(Z.number(h,f)*T),h||0));let J=typeof e.additionalItems=="object"?e.additionalItems:{};for(let W=p.length;W<E;W+=1){let ae=t.concat(["items",W]),Q=c(e.items||J,ae,r);p.push(Q)}if(e.contains&&E>0){let W=Z.number(0,E-1);p[W]=c(e.contains,t.concat(["items",W]),r)}return e.uniqueItems?io(t.concat(["items"]),p,e,J,r,c):p}function oo(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?tt.MIN_INTEGER:e.minimum,r=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?tt.MAX_INTEGER:e.maximum,c=e.multipleOf,p=c&&String(c).match(/e-(\d)|\.(\d+)$/);if(p){let h=(Math.random()*Z.number(0,10)+1)*c,f=p[1]||p[2].length,O=parseFloat(h.toFixed(f)),U=Z.number(t,r-1);return String(O).includes(".")?U+O:(U+O).toExponential()}if(c&&(r=Math.floor(r/c)*c,t=Math.ceil(t/c)*c),e.exclusiveMinimum&&t===e.minimum&&(t+=c||1),e.exclusiveMaximum&&r===e.maximum&&(r-=c||1),t>r)return NaN;if(c){let h=Z.number(Math.floor(t/c),Math.floor(r/c))*c;for(;h<t;)h+=c;return h}return Z.number(t,r,void 0,void 0,e.type!=="integer")}function ao(e){return Math.floor(mr({...e}))}function lo(e){return Z.shuffle(yi).slice(0,e)}function co(e,t,r,c){let p={},h=e.properties||{},f=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),U=e.additionalProperties!==!1,T=Object.keys(h),$=Object.keys(f),E=T.concat($).reduce((Y,m)=>(O.indexOf(m)===-1&&Y.push(m),Y),[]),J=O.concat(E),W=U&&e.additionalProperties===!0?Zt:e.additionalProperties;if(!U&&T.length===0&&$.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(te("requiredOnly")===!0)return O.forEach(Y=>{h[Y]&&(p[Y]=h[Y])}),c(p,t.concat(["properties"]),r,e);let ae=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),Q=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,ne=te("ignoreProperties")||[],he=te("reuseProperties"),ye=te("fillProperties"),j=e.maxProperties||J.length+(U?Z.number(1,5):0),S=Math.max(e.minProperties||0,O.length),b=Math.max(0,J.length-S);J.length===1&&!O.length&&(S=Math.max(Z.number(ye?1:0,j),S)),ae!==null&&(Q===!0?b=Math.round(S-O.length+ae*(J.length-S)):b=Z.number(S-O.length,ae*(J.length-S)));let R=Z.shuffle(E).slice(0,b),x=E.filter(Y=>R.indexOf(Y)!==-1),L=ae!==null||O.length===j?j:Z.number(0,j),_=O.concat(Z.shuffle(x).slice(0,L)).slice(0,j),I=[],M=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(Y=>{let m=e.dependencies[Y];if(_.indexOf(Y)!==-1)if(Array.isArray(m))m.forEach(k=>{_.indexOf(k)===-1&&_.push(k)});else if(Array.isArray(m.oneOf||m.anyOf)){let k=m.oneOf||m.anyOf;M.push({prop:Y,values:k})}else I.push(m)}),I.length))return delete e.dependencies,c({allOf:I.concat(e)},t.concat(["properties"]),r,e);let V=[],G=[];_.forEach(Y=>{if(h[Y]&&["{}","true"].includes(JSON.stringify(h[Y].not)))return;for(let k=0;k<ne.length;k+=1)if(ne[k]instanceof RegExp&&ne[k].test(Y)||typeof ne[k]=="string"&&ne[k]===Y||typeof ne[k]=="function"&&ne[k](h[Y],Y)){V.push(Y);return}W===!1&&O.indexOf(Y)!==-1&&(p[Y]=h[Y]),h[Y]&&(p[Y]=h[Y]);let m;if($.forEach(k=>{Y.match(new RegExp(k))&&(m=!0,p[Y]?de.merge(p[Y],f[k]):p[Z.randexp(Y)]=f[k])}),!m){let k=f[Y]||W;k&&W!==!1?p[f[Y]?Z.randexp(Y):Y]=h[Y]||k:G.push(Y)}});let ee=Object.keys(p).length+(ye?0:V.length),Ae=Y=>Z.randexp(`_?[_a-f\\d]{1,3}${Y?"\\$?":""}`);function ve(Y){let m;do{if(!Y.length)break;m=Y.shift()}while(p[m]);return m}let _e=S;if(U&&!O.length&&(_e=Math.max(ae===null||W?Z.number(ye?1:0,j):0,S)),!x.length&&!b&&U&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)p[Qt(1)+Ae(Y[m])]=W||Zt}for(;ye&&!(!($.length||U)||ee>=_e);){if(U)if(he&&T.length-ee>_e){let Y=0,m;do{if(Y+=1,Y>1e3)break;m=ve(O)||Z.pick(T)}while(typeof p[m]!="undefined");typeof p[m]=="undefined"&&(p[m]=h[m],ee+=1)}else if($.length&&!W){let Y=Z.pick($),m=Z.randexp(Y);p[m]||(p[m]=f[Y],ee+=1)}else{let Y=ve(O)||Qt(1)+Ae();p[Y]||(p[Y]=W||Zt,ee+=1)}for(let Y=0;ee<S&&Y<$.length;Y+=1){let m=$[Y],k=Z.randexp(m);p[k]||(p[k]=f[m],ee+=1)}}if(O.length===0&&(!U||ae===!1)){let Y=Z.number(S,j);for(;ee<Y;){let m=ve(T);m&&(p[m]=h[m]),ee+=1}}let Pe=p;if(te("sortProperties")!==null){let Y=Object.keys(h);Pe=Object.keys(p).sort((k,H)=>te("sortProperties")?k.localeCompare(H):Y.indexOf(k)-Y.indexOf(H)).reduce((k,H)=>(k[H]=p[H],k),{})}let Ce=c(Pe,t.concat(["properties"]),r,e);return M.forEach(Y=>{for(let m of Y.values)if(de.hasValue(m.properties[Y.prop],Ce.value[Y.prop])){Object.keys(m.properties).forEach(k=>{k!==Y.prop&&de.merge(Ce.value,c(m.properties,t.concat(["properties"]),r,e).value)});break}}),Ce}function Nr(){let e=Z.number(1,5);return Qt(e).join(" ")}function po(e=0,t=140){let r=Math.max(0,e),c=Z.number(r,t),p=Nr();for(;p.length<r;)p+=Nr();return p.length>c&&(p=p.substr(0,c)),p}function uo(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function fo(){return Z.date().toISOString()}function ho(){return en().slice(0,10)}function mo(){return en().slice(11)}function yo(e){return Z.randexp(We[e]).replace(Oi,(t,r)=>Z.randexp(We[r]))}function go(e,t){let r=hr(e.format);if(typeof r=="function")return r(e);switch(e.format){case"date-time":case"datetime":return en();case"date":return Si();case"time":return bi();case"ipv4":return wi();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 Ai(e.format);default:if(typeof r=="undefined"){if(te("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function wo(e){return de.typecast("string",e,r=>e.format?go(e,()=>yr(r.minLength,r.maxLength)):e.pattern?Z.randexp(e.pattern):yr(r.minLength,r.maxLength))}function So({$comment:e,title:t,description:r}){return Object.entries({comment:e,title:t,description:r}).filter(([,c])=>c).reduce((c,[p,h])=>(c[p]=h,c),{})}function St(e,t,r,c){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(c)}'`);let p={...So(e),schemaPath:t};if(t[t.length-1]!=="properties"){if(te("useExamplesValue")&&Array.isArray(e.examples)){let T=e.examples.concat("default"in e?[e.default]:[]);return{value:de.typecast(null,e,()=>Z.pick(T)),context:p}}if(te("useExamplesValue")&&typeof e.example!="undefined")return{value:de.typecast(null,e,()=>e.example),context:p};if(te("useDefaultValue")&&"default"in e&&(e.default!==""||!te("replaceEmptyByRandomValue")))return{value:e.default,context:p};if("template"in e)return{value:de.template(e.template,c),context:p};if("const"in e)return{value:e.const,context:p}}if(e.not&&typeof e.not=="object"&&(e=de.notValue(e.not,de.omitProps(e,["not"])),e.type&&e.type==="object")){let{value:T,context:$}=St(e,t.concat(["not"]),r,c);return{value:de.clean(T,e,!1),context:{...p,items:$}}}if(typeof e.thunk=="function"){let{value:T,context:$}=St(e.thunk(c),t,r);return{value:T,context:{...p,items:$}}}if(e.jsonPath)return{value:e,context:p};let h=e.type;if(Array.isArray(h)?h=Z.pick(h):typeof h=="undefined"&&(h=ai(e,t)||h,h&&(e.type=h)),typeof e.generate=="function"){let T=de.typecast(null,e,()=>e.generate(c,t)),$=T===null?"null":typeof T;if($===h||$==="number"&&h==="integer"||Array.isArray(T)&&h==="array")return{value:T,context:p}}if(typeof e.pattern=="string")return{value:de.typecast("string",e,()=>Z.randexp(e.pattern)),context:p};if(Array.isArray(e.enum))return{value:de.typecast(null,e,()=>Z.pick(e.enum)),context:p};if(typeof h=="string")if(kt[h])try{let T=kt[h](e,t,r,St);return h==="array"?{value:T.map(({value:$})=>$),context:{...p,items:T.map(Array.isArray(e.items)?({context:$})=>$:({context:$})=>({...$,schemaPath:$.schemaPath.slice(0,-1)}))}}:h==="object"?T!==null?{value:T.value,context:{...p,items:T.context}}:{value:{},context:p}:{value:T,context:p}}catch(T){throw typeof T.path=="undefined"?new Xt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new Xt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&kt[T]?{value:kt[T](e,t,r,St),context:p}:{value:T,context:p}}}let f={},O={...p};Array.isArray(e)&&(f=[]);let U=te("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!U.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:E}=St(e[T],t.concat([T]),r,f);f[T]=de.clean($,e[T],!1),O[T]=E,f[T]===null&&te("omitNulls")&&(delete f[T],delete O[T])}else f[T]=e[T]}),{value:f,context:O}}function bo(e){return Array.isArray(e)?Z.pick(e):e}function To(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 tr(e,t,r,c){if(!e||typeof e!="object")return e;if(r||(r={}),t||(t=e),Array.isArray(e))return e.map(p=>tr(p,t,r,c));if(e.jsonPath){let{JSONPath:p}=cr(),h=typeof e.jsonPath!="object"?{path:e.jsonPath}:e.jsonPath;h.group=e.group||h.group||c,h.cycle=e.cycle||h.cycle||!1,h.reverse=e.reverse||h.reverse||!1,h.count=e.count||h.count||1;let f=`${h.group}__${h.path}`;return r[f]||(h.count>1?r[f]=p(h.path,t).slice(0,h.count):r[f]=p(h.path,t)),h.cycle||h.reverse?To(r[f],h.reverse):bo(r[f])}return Object.keys(e).forEach(p=>{e[p]=tr(e[p],t,r,p)}),e}function Oo(e,t,r,c){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let p=te("refDepthMin")||0,h=te("refDepthMax")||3;try{let{resolveSchema:f}=Pi({refs:e,schema:t,container:r,synchronous:c,refDepthMin:p,refDepthMax:h}),O=_i(de.clone(t),[],f);return te("resolveJsonPath")?{value:tr(O.value),context:O.context}:O}catch(f){throw f.path?new Error(`${f.message} in /${f.path.join("/")}`):f}}function Ao(e){return e.value}function vo(e,t){return t.reduce((r,c)=>c in r?r[c]:{},e)}function nr(e,t,r,c=r){let{title:p,description:h,comment:f}=vo(e,t),O=[];te("renderTitle")&&p&&O.push(` ${p}`,""),te("renderDescription")&&h&&O.push(` ${h}`),te("renderComment")&&f&&O.push(` ${f}`),r.commentBefore=O.join(` `),c instanceof xi?c.items.forEach(U=>{nr(e,[...t,"items",U.key.value],U.key,U.value)}):c instanceof Ii&&c.items.forEach((U,T)=>{nr(e,[...t,"items",T],U)})}function Eo({value:e,context:t}){let r=Mt.createNode(e);nr(t,[],r);let c=new Mt.Document;return c.contents=r,c.toString()}function kr(){rt.define("autoIncrement",function(t,r){if(!this.offset){let c=r.minimum||1,p=c+tt.MAX_NUMBER,h=t.initialOffset||r.initialOffset;this.offset=h||Z.number(c,p)}return t?this.offset++:r}),rt.define("sequentialDate",function(t,r){if(this.now||(this.now=Z.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 ${de.short(t)}`);this.now.setTime(this.now.getTime()+Z.date(t))}return r})}function Mr(e,t){let r={};Array.isArray(e)?e.forEach(p=>{r[p.$id||p.id]=p}):r=e||{};function c(p){if(!p||typeof p!="object")return;if(Array.isArray(p))return p.forEach(c);let h=p.$id||p.id;typeof h=="string"&&!r[h]&&(r[h]=p),Object.keys(p).forEach(f=>{c(p[f])})}return c(e),c(t),r}var Cr,rr,Lr,ir,Dr,Ur,je,Fr,sr,F,or,$r,jr,Yr,Wr,Vr,xt,Kt,ar,qr,Br,lr,cr,Jr,Gr,pr,ue,ur,Hr,Kr,It,te,dr,fr,zr,Xr,Qr,Zr,ei,ti,tt,zt,Z,ni,de,ri,ii,bt,hr,si,Xt,Nt,oi,ai,li,ci,pi,ui,di,fi,hi,mr,mi,yi,Qt,Zt,gi,yr,wi,en,Si,bi,gr,tn,Ti,We,Oi,Ai,vi,Ei,kt,_i,Ri,Pi,wr,Sr,De,_o,Ro,Po,xo,Io,No,ko,Mo,Co,Lo,Do,Uo,xi,Ii,Mt,rt,Oe,Ni,ki,Fo=g({"src/shared.js"(){Cr=Object.create,rr=Object.defineProperty,Lr=Object.getOwnPropertyDescriptor,ir=Object.getOwnPropertyNames,Dr=Object.getPrototypeOf,Ur=Object.prototype.hasOwnProperty,je=(e,t)=>function(){return t||(0,e[ir(e)[0]])((t={exports:{}}).exports,t),t.exports},Fr=(e,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of ir(t))!Ur.call(e,p)&&p!==r&&rr(e,p,{get:()=>t[p],enumerable:!(c=Lr(t,p))||c.enumerable});return e},sr=(e,t,r)=>(r=e!=null?Cr(Dr(e)):{},Fr(t||!e||!e.__esModule?rr(r,"default",{value:e,enumerable:!0}):r,e)),F=je({"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}}}),or=je({"node_modules/ret/lib/sets.js"(e){var t=F(),r=()=>[{type:t.RANGE,from:48,to:57}],c=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(r()),p=()=>[{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}],h=()=>[{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:c(),not:!1}),e.notWords=()=>({type:t.SET,set:c(),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:p(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:p(),not:!0}),e.anyChar=()=>({type:t.SET,set:h(),not:!0})}}),$r=je({"node_modules/ret/lib/util.js"(e){var t=F(),r=or(),c="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",p={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=h=>{var f=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return h=h.replace(f,(O,U,T,$,E,J,W,ae)=>{if(T)return O;var Q=U?8:$?parseInt($,16):E?parseInt(E,16):J?parseInt(J,8):W?c.indexOf(W):p[ae],ne=String.fromCharCode(Q);return/[[\]{}^$.|?*+()]/.test(ne)&&(ne="\\"+ne),ne}),h},e.tokenizeClass=(h,f)=>{for(var O=[],U=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,T,$;(T=U.exec(h))!=null;)if(T[1])O.push(r.words());else if(T[2])O.push(r.ints());else if(T[3])O.push(r.whitespace());else if(T[4])O.push(r.notWords());else if(T[5])O.push(r.notInts());else if(T[6])O.push(r.notWhitespace());else if(T[7])O.push({type:t.RANGE,from:(T[8]||T[9]).charCodeAt(0),to:T[10].charCodeAt(0)});else if($=T[12])O.push({type:t.CHAR,value:$.charCodeAt(0)});else return[O,U.lastIndex];e.error(f,"Unterminated character class")},e.error=(h,f)=>{throw new SyntaxError("Invalid regular expression: /"+h+"/: "+f)}}}),jr=je({"node_modules/ret/lib/positions.js"(e){var t=F();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:"$"})}}),Yr=je({"node_modules/ret/lib/index.js"(e,t){var r=$r(),c=F(),p=or(),h=jr();t.exports=f=>{var O=0,U,T,$={type:c.ROOT,stack:[]},E=$,J=$.stack,W=[],ae=x=>{r.error(f,`Nothing to repeat at column ${x-1}`)},Q=r.strToChars(f);for(U=Q.length;O<U;)switch(T=Q[O++],T){case"\\":switch(T=Q[O++],T){case"b":J.push(h.wordBoundary());break;case"B":J.push(h.nonWordBoundary());break;case"w":J.push(p.words());break;case"W":J.push(p.notWords());break;case"d":J.push(p.ints());break;case"D":J.push(p.notInts());break;case"s":J.push(p.whitespace());break;case"S":J.push(p.notWhitespace());break;default:/\d/.test(T)?J.push({type:c.REFERENCE,value:parseInt(T,10)}):J.push({type:c.CHAR,value:T.charCodeAt(0)})}break;case"^":J.push(h.begin());break;case"$":J.push(h.end());break;case"[":{var ne;Q[O]==="^"?(ne=!0,O++):ne=!1;var he=r.tokenizeClass(Q.slice(O),f);O+=he[1],J.push({type:c.SET,set:he[0],not:ne});break}case".":J.push(p.anyChar());break;case"(":{var ye={type:c.GROUP,stack:[],remember:!0};T=Q[O],T==="?"&&(T=Q[O+1],O+=2,T==="="?ye.followedBy=!0:T==="!"?ye.notFollowedBy=!0:T!==":"&&r.error(f,`Invalid group, character '${T}' after '?' at column ${O-1}`),ye.remember=!1),J.push(ye),W.push(E),E=ye,J=ye.stack;break}case")":W.length===0&&r.error(f,`Unmatched ) at column ${O-1}`),E=W.pop(),J=E.options?E.options[E.options.length-1]:E.stack;break;case"|":{E.options||(E.options=[E.stack],delete E.stack);var j=[];E.options.push(j),J=j;break}case"{":{var S=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,R;S!==null?(J.length===0&&ae(O),b=parseInt(S[1],10),R=S[2]?S[3]?parseInt(S[3],10):1/0:b,O+=S[0].length,J.push({type:c.REPETITION,min:b,max:R,value:J.pop()})):J.push({type:c.CHAR,value:123});break}case"?":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1,value:J.pop()});break;case"+":J.length===0&&ae(O),J.push({type:c.REPETITION,min:1,max:1/0,value:J.pop()});break;case"*":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1/0,value:J.pop()});break;default:J.push({type:c.CHAR,value:T.charCodeAt(0)})}return W.length!==0&&r.error(f,"Unterminated group"),$},t.exports.types=c}}),Wr=je({"node_modules/drange/lib/index.js"(e,t){var r=class At{constructor(h,f){this.low=h,this.high=f,this.length=1+f-h}overlaps(h){return!(this.high<h.low||this.low>h.high)}touches(h){return!(this.high+1<h.low||this.low-1>h.high)}add(h){return new At(Math.min(this.low,h.low),Math.max(this.high,h.high))}subtract(h){return h.low<=this.low&&h.high>=this.high?[]:h.low>this.low&&h.high<this.high?[new At(this.low,h.low-1),new At(h.high+1,this.high)]:h.low<=this.low?[new At(h.high+1,this.high)]:[new At(this.low,h.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},c=class Vt{constructor(h,f){this.ranges=[],this.length=0,h!=null&&this.add(h,f)}_update_length(){this.length=this.ranges.reduce((h,f)=>h+f.length,0)}add(h,f){var O=U=>{for(var T=0;T<this.ranges.length&&!U.touches(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&U.touches(this.ranges[T]);)U=U.add(this.ranges[T]),T++;$.push(U),this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Vt?h.ranges.forEach(O):(f==null&&(f=h),O(new r(h,f))),this}subtract(h,f){var O=U=>{for(var T=0;T<this.ranges.length&&!U.overlaps(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&U.overlaps(this.ranges[T]);)$=$.concat(this.ranges[T].subtract(U)),T++;this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Vt?h.ranges.forEach(O):(f==null&&(f=h),O(new r(h,f))),this}intersect(h,f){var O=[],U=T=>{for(var $=0;$<this.ranges.length&&!T.overlaps(this.ranges[$]);)$++;for(;$<this.ranges.length&&T.overlaps(this.ranges[$]);){var E=Math.max(this.ranges[$].low,T.low),J=Math.min(this.ranges[$].high,T.high);O.push(new r(E,J)),$++}};return h instanceof Vt?h.ranges.forEach(U):(f==null&&(f=h),U(new r(h,f))),this.ranges=O,this._update_length(),this}index(h){for(var f=0;f<this.ranges.length&&this.ranges[f].length<=h;)h-=this.ranges[f].length,f++;return this.ranges[f].low+h}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Vt(this)}numbers(){return this.ranges.reduce((h,f)=>{for(var O=f.low;O<=f.high;)h.push(O),O++;return h},[])}subranges(){return this.ranges.map(h=>({low:h.low,high:h.high,length:1+h.high-h.low}))}};t.exports=c}}),Vr=je({"node_modules/randexp/lib/randexp.js"(e,t){var r=Yr(),c=Wr(),p=r.types;t.exports=class qt{constructor(f,O){if(this._setDefaults(f),f instanceof RegExp)this.ignoreCase=f.ignoreCase,this.multiline=f.multiline,f=f.source;else if(typeof f=="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(f)}_setDefaults(f){this.max=f.max!=null?f.max:qt.prototype.max!=null?qt.prototype.max:100,this.defaultRange=f.defaultRange?f.defaultRange:this.defaultRange.clone(),f.randInt&&(this.randInt=f.randInt)}gen(){return this._gen(this.tokens,[])}_gen(f,O){var U,T,$,E,J;switch(f.type){case p.ROOT:case p.GROUP:if(f.followedBy||f.notFollowedBy)return"";for(f.remember&&f.groupNumber===void 0&&(f.groupNumber=O.push(null)-1),U=f.options?this._randSelect(f.options):f.stack,T="",E=0,J=U.length;E<J;E++)T+=this._gen(U[E],O);return f.remember&&(O[f.groupNumber]=T),T;case p.POSITION:return"";case p.SET:{var W=this._expand(f);return W.length?String.fromCharCode(this._randSelect(W)):""}case p.REPETITION:for($=this.randInt(f.min,f.max===1/0?f.min+this.max:f.max),T="",E=0;E<$;E++)T+=this._gen(f.value,O);return T;case p.REFERENCE:return O[f.value-1]||"";case p.CHAR:{var ae=this.ignoreCase&&this._randBool()?this._toOtherCase(f.value):f.value;return String.fromCharCode(ae)}}}_toOtherCase(f){return f+(97<=f&&f<=122?-32:65<=f&&f<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(f){return f instanceof c?f.index(this.randInt(0,f.length-1)):f[this.randInt(0,f.length-1)]}_expand(f){if(f.type===r.types.CHAR)return new c(f.value);if(f.type===r.types.RANGE)return new c(f.from,f.to);{let O=new c;for(let U=0;U<f.set.length;U++){let T=this._expand(f.set[U]);if(O.add(T),this.ignoreCase)for(let $=0;$<T.length;$++){let E=T.index($),J=this._toOtherCase(E);E!==J&&O.add(J)}}return f.not?this.defaultRange.clone().subtract(O):this.defaultRange.clone().intersect(O)}}randInt(f,O){return f+Math.floor(Math.random()*(1+O-f))}get defaultRange(){return this._range=this._range||new c(32,126)}set defaultRange(f){this._range=f}static randexp(f,O){var U;return typeof f=="string"&&(f=new RegExp(f,O)),f._randexp===void 0?(U=new qt(f,O),f._randexp=U):(U=f._randexp,U._setDefaults(f)),U.gen()}static sugar(){RegExp.prototype.gen=function(){return qt.randexp(this)}}}}}),xt=je({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(e){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"},c="tag:yaml.org,2002:",p={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function h(j){let S=[0],b=j.indexOf(` `);for(;b!==-1;)b+=1,S.push(b),b=j.indexOf(` `,b);return S}function f(j){let S,b;return typeof j=="string"?(S=h(j),b=j):(Array.isArray(j)&&(j=j[0]),j&&j.context&&(j.lineStarts||(j.lineStarts=h(j.context.src)),S=j.lineStarts,b=j.context.src)),{lineStarts:S,src:b}}function O(j,S){if(typeof j!="number"||j<0)return null;let{lineStarts:b,src:R}=f(S);if(!b||!R||j>R.length)return null;for(let L=0;L<b.length;++L){let _=b[L];if(j<_)return{line:L,col:j-b[L-1]+1};if(j===_)return{line:L+1,col:1}}let x=b.length;return{line:x,col:j-b[x-1]+1}}function U(j,S){let{lineStarts:b,src:R}=f(S);if(!b||!(j>=1)||j>b.length)return null;let x=b[j-1],L=b[j];for(;L&&L>x&&R[L-1]===` `;)--L;return R.slice(x,L)}function T({start:j,end:S},b,R=80){let x=U(j.line,b);if(!x)return null;let{col:L}=j;if(x.length>R)if(L<=R-10)x=x.substr(0,R-1)+"\u2026";else{let G=Math.round(R/2);x.length>L+G&&(x=x.substr(0,L+G-1)+"\u2026"),L-=x.length-R,x="\u2026"+x.substr(1-R)}let _=1,I="";S&&(S.line===j.line&&L+(S.col-j.col)<=R+1?_=S.col-j.col:(_=Math.min(x.length+1,R)-L,I="\u2026"));let M=L>1?" ".repeat(L-1):"",V="^".repeat(_);return`${x} ${M}${V}${I}`}var $=class Ui{static copy(S){return new Ui(S.start,S.end)}constructor(S,b){this.start=S,this.end=b||S}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(S,b){let{start:R,end:x}=this;if(S.length===0||x<=S[0])return this.origStart=R,this.origEnd=x,b;let L=b;for(;L<S.length&&!(S[L]>R);)++L;this.origStart=R+L;let _=L;for(;L<S.length&&!(S[L]>=x);)++L;return this.origEnd=x+L,_}},E=class lt{static addStringTerminator(S,b,R){if(R[R.length-1]===` `)return R;let x=lt.endOfWhiteSpace(S,b);return x>=S.length||S[x]===` `?R+` `:R}static atDocumentBoundary(S,b,R){let x=S[b];if(!x)return!0;let L=S[b-1];if(L&&L!==` `)return!1;if(R){if(x!==R)return!1}else if(x!==t.DIRECTIVES_END&&x!==t.DOCUMENT_END)return!1;let _=S[b+1],I=S[b+2];if(_!==x||I!==x)return!1;let M=S[b+3];return!M||M===` `||M===" "||M===" "}static endOfIdentifier(S,b){let R=S[b],x=R==="<",L=x?[` `," "," ",">"]:[` `," "," ","[","]","{","}",","];for(;R&&L.indexOf(R)===-1;)R=S[b+=1];return x&&R===">"&&(b+=1),b}static endOfIndent(S,b){let R=S[b];for(;R===" ";)R=S[b+=1];return b}static endOfLine(S,b){let R=S[b];for(;R&&R!==` `;)R=S[b+=1];return b}static endOfWhiteSpace(S,b){let R=S[b];for(;R===" "||R===" ";)R=S[b+=1];return b}static startOfLine(S,b){let R=S[b-1];if(R===` `)return b;for(;R&&R!==` `;)R=S[b-=1];return b+1}static endOfBlockIndent(S,b,R){let x=lt.endOfIndent(S,R);if(x>R+b)return x;{let L=lt.endOfWhiteSpace(S,x),_=S[L];if(!_||_===` `)return L}return null}static atBlank(S,b,R){let x=S[b];return x===` `||x===" "||x===" "||R&&!x}static nextNodeIsIndented(S,b,R){return!S||b<0?!1:b>0?!0:R&&S==="-"}static normalizeOffset(S,b){let R=S[b];return R?R!==` `&&S[b-1]===` `?b-1:lt.endOfWhiteSpace(S,b):b}static foldNewline(S,b,R){let x=0,L=!1,_="",I=S[b+1];for(;I===" "||I===" "||I===` `;){switch(I){case` `:x=0,b+=1,_+=` `;break;case" ":x<=R&&(L=!0),b=lt.endOfWhiteSpace(S,b+2)-1;break;case" ":x+=1,b+=1;break}I=S[b+1]}return _||(_=" "),I&&x<=R&&(L=!0),{fold:_,offset:b,error:L}}constructor(S,b,R){Object.defineProperty(this,"context",{value:R||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=b||[],this.type=S,this.value=null}getPropValue(S,b,R){if(!this.context)return null;let{src:x}=this.context,L=this.props[S];return L&&x[L.start]===b?x.slice(L.start+(R?1:0),L.end):null}get anchor(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.ANCHOR,!0);if(b!=null)return b}return null}get comment(){let S=[];for(let b=0;b<this.props.length;++b){let R=this.getPropValue(b,t.COMMENT,!0);R!=null&&S.push(R)}return S.length>0?S.join(` `):null}commentHasRequiredWhitespace(S){let{src:b}=this.context;if(this.header&&S===this.header.end||!this.valueRange)return!1;let{end:R}=this.valueRange;return S!==R||lt.atBlank(b,R-1)}get hasComment(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].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 S=O(this.range.start,this.context.root);if(!S)return;let b=O(this.range.end,this.context.root);return{start:S,end:b}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:S,end:b}=this.valueRange;return this.context.src.slice(S,b)}get tag(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.TAG,!1);if(b!=null){if(b[1]==="<")return{verbatim:b.slice(2,-1)};{let[R,x,L]=b.match(/^(.*!)([^!]*)$/);return{handle:x,suffix:L}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:S,end:b}=this.valueRange,{src:R}=this.context;for(let x=S;x<b;++x)if(R[x]===` `)return!0;return!1}parseComment(S){let{src:b}=this.context;if(b[S]===t.COMMENT){let R=lt.endOfLine(b,S+1),x=new $(S,R);return this.props.push(x),R}return S}setOrigRanges(S,b){return this.range&&(b=this.range.setOrigRange(S,b)),this.valueRange&&this.valueRange.setOrigRange(S,b),this.props.forEach(R=>R.setOrigRange(S,b)),b}toString(){let{context:{src:S},range:b,value:R}=this;if(R!=null)return R;let x=S.slice(b.start,b.end);return lt.addStringTerminator(S,b.end,x)}},J=class extends Error{constructor(j,S,b){if(!b||!(S instanceof E))throw new Error(`Invalid arguments for new ${j}`);super(),this.name=j,this.message=b,this.source=S}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let j=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new $(this.offset,this.offset+1);let S=j&&O(this.offset,j);if(S){let b={line:S.line,col:S.col+1};this.linePos={start:S,end:b}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:S,col:b}=this.linePos.start;this.message+=` at line ${S}, column ${b}`;let R=j&&T(this.linePos,j);R&&(this.message+=`: ${R} `)}delete this.source}},W=class extends J{constructor(j,S){super("YAMLReferenceError",j,S)}},ae=class extends J{constructor(j,S){super("YAMLSemanticError",j,S)}},Q=class extends J{constructor(j,S){super("YAMLSyntaxError",j,S)}},ne=class extends J{constructor(j,S){super("YAMLWarning",j,S)}};function he(j,S,b){return S in j?Object.defineProperty(j,S,{value:b,enumerable:!0,configurable:!0,writable:!0}):j[S]=b,j}var ye=class Or extends E{static endOfLine(S,b,R){let x=S[b],L=b;for(;x&&x!==` `&&!(R&&(x==="["||x==="]"||x==="{"||x==="}"||x===","));){let _=S[L+1];if(x===":"&&(!_||_===` `||_===" "||_===" "||R&&_===",")||(x===" "||x===" ")&&_==="#")break;L+=1,x=_}return L}get strValue(){if(!this.va