@novu/framework
Version:
The Code-First Notifications Workflow SDK.
30 lines (29 loc) • 228 kB
JavaScript
"use strict";var ia=Object.create;var Dt=Object.defineProperty;var Mi=Object.getOwnPropertyDescriptor;var oa=Object.getOwnPropertyNames;var sa=Object.getPrototypeOf,aa=Object.prototype.hasOwnProperty;var la=(c,r)=>{for(var n in r)Dt(c,n,{get:r[n],enumerable:!0})},Li=(c,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of oa(r))!aa.call(c,m)&&m!==n&&Dt(c,m,{get:()=>r[m],enumerable:!(a=Mi(r,m))||a.enumerable});return c};var st=(c,r,n)=>(n=c!=null?ia(sa(c)):{},Li(r||!c||!c.__esModule?Dt(n,"default",{value:c,enumerable:!0}):n,c)),ca=c=>Li(Dt({},"__esModule",{value:!0}),c),Ke=(c,r,n,a)=>{for(var m=a>1?void 0:a?Mi(r,n):r,M=c.length-1,P;M>=0;M--)(P=c[M])&&(m=(a?P(r,n,m):P(m))||m);return a&&m&&Dt(r,n,m),m},ze=(c,r)=>(n,a)=>r(n,a,c);var Sl={};la(Sl,{Client:()=>At,CronExpression:()=>br,NOVU_OPTIONS:()=>Pt,NovuClient:()=>Ge,NovuController:()=>Ye,NovuHandler:()=>Je,NovuModule:()=>Ht,NovuRequestHandler:()=>Rt,REGISTER_API_PATH:()=>Er,SeverityLevelEnum:()=>Hn,frameworkName:()=>Bo,providerSchemas:()=>qn,registerApiPath:()=>Xn,step:()=>Wo,workflow:()=>Yo});module.exports=ca(Sl);var uo=require("jsonrepair");var Ut=(a=>(a.TRIGGER="trigger",a.EXECUTE="execute",a.PREVIEW="preview",a))(Ut||{}),sn=(a=>(a.DISCOVER="discover",a.HEALTH_CHECK="health-check",a.CODE="code",a))(sn||{});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_DAY_OF_MONTH_AT_10AM="0 10 2 * *",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 an=(a=>(a.POST="POST",a.GET="GET",a.OPTIONS="OPTIONS",a))(an||{});var pa=c=>{var n,a;if(typeof c!="object"||c===null)return!1;let r=Object.getPrototypeOf(c);return(a=(n=r==null?void 0:r.constructor)==null?void 0:n.name.endsWith("Error"))!=null?a:!1},at=class extends Error{},ln=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(r,{cause:n}={}){var a;pa(n)?(super(`${r}: ${n.message}`),this.data={stack:(a=n.stack)!=null?a:r}):(super(`${r}${n?`: ${JSON.stringify(n,null,2)}`:""}`),this.data={stack:r})}},cn=class extends at{constructor(){super(...arguments);this.statusCode=409}};var Tt=class extends dt{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var pn=class extends Fe{constructor(n,a){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${a}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:a}}},$t=class extends Fe{constructor(n,a){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=a}},un=class extends Fe{constructor(n,a){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=a}},dn=class extends Fe{constructor(n,a,m){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${a}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=m}},fn=class extends Fe{constructor(n,a,m){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${a}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=m}},hn=class extends Fe{constructor(n,a,m){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${a}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=m}},mn=class extends Fe{constructor(n,a,m){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${a}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=m}},yn=class extends Fe{constructor(n,a,m,M){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${a}\` and provider with id: \`${m}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=M}},gn=class extends Fe{constructor(n,a){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=a}};var ht=c=>Object.values(qe).includes(c==null?void 0:c.code),Di=c=>!ht(c)&&typeof c.statusCode=="number"&&c.statusCode>=400&&c.statusCode<500;var Tr=c=>Object.values(c).map(r=>`\`${r}\``).join(", "),Sn=c=>c.replaceAll(/(\w)(\w*)/g,(r,n,a)=>n.toUpperCase()+a.toLowerCase()).replaceAll(/[\s-]+/g,"");var wn=class extends at{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${Tr(an)}`}},jt=class extends Fe{constructor(n,a){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${Tr(a)}`);this.code="InvalidActionError"}},bn=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 Tn=class extends Error{constructor(r,n,a){super(),this.data={message:a},this.statusCode=r,this.code=n}};var Yt=class extends cn{constructor(r,n){super(`${Sn(r)} with id: \`${n}\` already exists. Please use a different id.`)}},ft=class extends ln{constructor(r,n){super(`${Sn(r)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},Ot=class extends dt{constructor(n,a,m,M){super(`Failed to ${m} ${Sn(n)} with id: \`${a}\``,{cause:M});this.statusCode=502}};var On=class extends ft{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},vn=class extends Ot{constructor(n,a,m){super("provider",n,a,m);this.code="ProviderExecutionFailedError"}};var An=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"}},Rn=class extends ut{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},En=class extends ut{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},_n=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"}},Pn=class extends ut{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var xn=class extends ft{constructor(n){super("step",n);this.code="StepNotFoundError"}},In=class extends Yt{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},Wt=class extends Ot{constructor(n,a,m){super("step",n,a,m);this.code="StepExecutionFailedError"}};var Vt=class extends ft{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}};var Nn=(()=>{var c=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,m=(e,t)=>function(){return e&&(t=(0,e[n(e)[0]])(e=0)),t},M=(e,t)=>function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports},P=(e,t)=>{for(var i in t)c(e,i,{get:t[i],enumerable:!0})},z=(e,t,i,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of n(t))!a.call(e,u)&&u!==i&&c(e,u,{get:()=>t[u],enumerable:!(p=r(t,u))||p.enumerable});return e},te=e=>z(c({},"__esModule",{value:!0}),e),we={};P(we,{JSONSchemaFaker:()=>Ci,default:()=>ki,setDependencies:()=>Gr});function Pe(e,t){return typeof e=="string"?typeof t!="undefined"?Nt.register(e,t):Nt.get(e):Nt.registerMany(e)}function xe(e,t){return e=typeof e=="undefined"?tt.MIN_INTEGER:e,t=typeof t=="undefined"?tt.MAX_INTEGER:t,Math.floor(ne("random")()*(t-e+1))+e}function be(e){return Qt.default.prototype.max=ne("defaultRandExpMax"),Qt.default.prototype.randInt=(i,p)=>i+Math.floor(ne("random")()*(1+(p-i))),new Qt.default(e).gen()}function Me(e){return e[Math.floor(ne("random")()*e.length)]}function $e(e){let t,i,p=e.length,u=e.slice();for(;p>0;)i=Math.floor(ne("random")()*p),p-=1,t=u[p],u[p]=u[i],u[i]=t;return u}function ct(e,t){return ne("random")()*(t-e)+e}function Ze(e,t,i,p,u=!1){return i=typeof i=="undefined"?tt.MIN_NUMBER:i,p=typeof p=="undefined"?tt.MAX_NUMBER:p,e=typeof e=="undefined"?i:e,t=typeof t=="undefined"?p:t,t<e&&(t+=e),u?ct(e,t):xe(e,t)}function Kt(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 Qn(e){if(e)return Kt(e);let t=ne("minDateTime"),i=ne("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof i=="string"&&(i=new Date(i));let p=new Date().getTime();return typeof t=="number"&&(t=new Date(p+t)),typeof i=="number"&&(i=new Date(p+i)),new Date(ct(t.getTime(),i.getTime()))}function _r(e,t,i){if(t=decodeURIComponent(t),i&&i[t])return ce(i[t]);let p=t.replace("#/","/").split("/"),u=e.$ref&&i&&i[e.$ref]||e;for(!u&&!p[0]&&(p[0]=e.$ref.split("#/")[0]),i&&t.includes("#/")&&i[p[0]]&&(u=i[p.shift()]),p[0]||p.shift();u&&p.length>0;){let h=p.shift();if(!u[h])throw new Error(`Prop not found: ${h} (${t})`);u=u[h]}return u}function zt(e){return typeof e=="string"&&ri.test(e)}function et(e){return["number","boolean"].includes(typeof e)}function He(e,...t){return t.filter(i=>typeof e[i]!="undefined").length>0}function Pr(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i,p]=e.split("T")[0].split("-");return i=`0${Math.max(1,Math.min(12,i))}`.slice(-2),p=`0${Math.max(1,Math.min(31,p))}`.slice(-2),`${t}-${i}-${p}`}function Ko(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i]=e.split("T"),[p,u,h]=t.split("-"),[f,O,U]=i.substr(0,8).split(":");return u=`0${Math.max(1,Math.min(12,u))}`.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),`${p}-${u}-${h}T${f}:${O}:${U}.000Z`}function zo(e,t,i){let p={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(p.minimum=t.minimum),typeof t.maximum!="undefined"&&(p.maximum=t.maximum),t.enum){let h=Math.max(p.minimum||0,0),f=Math.min(p.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":{p.minLength=ne("minLength")||0,p.maxLength=ne("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(p.minLength=Math.max(p.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(p.maxLength=Math.min(p.maxLength,t.maxLength));break}default:break}let u=i(p);if(u==null)return null;switch(e||t.type){case"number":u=zt(u)?parseFloat(u):u;break;case"integer":u=zt(u)?parseInt(u,10):u;break;case"boolean":u=!!u;break;case"string":{if(et(u))return u;u=String(u);let h=Math.max(p.minLength||0,0),f=Math.min(p.maxLength||1/0,1/0),O,U=0;for(;u.length<h;)if(O=u,t.pattern?u+=Z.randexp(t.pattern):u+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${u}`,u===O){if(U+=1,U===3)break}else U=0;switch(u.length>f&&(u=u.substr(0,f)),t.format){case"date-time":case"datetime":u=new Date(Ko(u)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":u=new Date(Pr(u)).toISOString().substr(0,10);break;case"time":u=new Date(`1969-01-01 ${u}`).toISOString().substr(11);break;default:break}break}default:break}return u}function St(e,t){return Object.keys(t).forEach(i=>{typeof t[i]!="object"||t[i]===null?e[i]=t[i]:Array.isArray(t[i])?(e[i]=e[i]||[],t[i].forEach((p,u)=>{e.type==="array"&&t.type==="array"?e[i][u]=St(e[i][u]||{},p,!0):Array.isArray(e[i])&&e[i].indexOf(p)===-1&&e[i].push(p)})):typeof e[i]!="object"||e[i]===null||Array.isArray(e[i])?e[i]=St({},t[i]):e[i]=St(e[i],t[i])}),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 p=[];return t.set(e,p),p.push(...e.map(u=>ce(u,t))),p}let i={};return t.set(e,i),Object.keys(e).reduce((p,u)=>(p[u]=ce(e[u],t),p),i)}function Xo(e){let t=JSON.stringify(e),i=JSON.stringify(e,null,2);return t.length>400?`${i.substr(0,400)}...`:i}function xr(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Qo(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Zo(e,t){let i=St({},t);if(typeof e.minimum!="undefined"&&(i.maximum=e.minimum,i.exclusiveMaximum=!0),typeof e.maximum!="undefined"&&(i.minimum=e.maximum>i.maximum?0:e.maximum,i.exclusiveMinimum=!0),typeof e.minLength!="undefined"&&(i.maxLength=e.minLength),typeof e.maxLength!="undefined"&&(i.minLength=e.maxLength>i.maxLength?0:e.maxLength),e.type)i.type=Z.pick(tt.SCALAR_TYPES.filter(p=>(Array.isArray(e.type)?e.type:[e.type]).every(h=>p==="number"||p==="integer"?h!=="number"&&h!=="integer":p!==h)));else if(e.enum){let p;do p=xr();while(e.enum.indexOf(p)!==-1);i.enum=[p]}return e.required&&i.properties&&e.required.forEach(p=>{delete i.properties[p]}),i}function Zn(e,t){let i=t.minimum!==void 0,p=t.maximum!==void 0;return(i||p)&&(!i||e>=t.minimum)&&(!p||e<=t.maximum)}function es(e,t){return!t.every(i=>Zn(e,i))}function ts(e,t){return t.reduce((p,u)=>p+(Zn(e,u)?1:0),0)===1}function ns(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function rs(e,t){return Object.keys(e).filter(i=>!t.includes(i)).reduce((i,p)=>(Array.isArray(e[p])?i[p]=e[p].slice():i[p]=e[p]instanceof Object?St({},e[p]):e[p],i),{})}function Ir(e,t){return Array.isArray(e)?e.map(i=>Ir(i,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(i,p)=>t[p])),e)}function er(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function Nr(e,t){t=t.items||t;let i=ne("alwaysFakeOptionals"),p=Array.isArray(t.required)&&t.required.includes(e)||i,u=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!p&&!u}function tr(e,t,i=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(p=>tr(p,t,!0)).filter(p=>typeof p!="undefined");if(Object.keys(e).forEach(p=>{if(er(e[p]))Nr(p,t)&&delete e[p];else{let u=t;t&&t.properties&&t.properties[p]&&(u=t.properties[p]);let h=tr(e[p],u);er(h)||(e[p]=h)}typeof e[p]=="undefined"&&delete e[p]}),!(!Object.keys(e).length&&i))return e}function is(e){return(t,i,p,u)=>{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,u)))),Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(T=>{if(typeof t[T]=="function")throw new Error(`Cannot resolve value for '${p}: ${h}', given: ${t}`)}),t}}function os(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 ss(e,t,i){return Object.keys(e).filter(p=>{let u=ai.indexOf(t)>-1;return i.indexOf(p)>-1&&!u}).length>0}function as(e,t){let i=Object.keys(Ct);for(let p=0;p<i.length;p+=1){let u=i[p],h=t[t.length-1];if(ss(e,h,Ct[u]))return u}}function ls(){return ne("random")()>.5}function cs(){return null}function ps(e,t,i,p,u,h){let f=[],O=[];function U($){let R=JSON.stringify($.value);return O.indexOf(R)===-1?(O.push(R),f.push($),!0):!1}t.forEach(U);let T=100;for(;f.length!==t.length&&(U(h(i.items||p,e,u))||(T-=1),!!T););return f}function us(e,t,i,p){let u=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new Zt(`missing items for ${de.short(e)}`,t);return u}if(Array.isArray(e.items))return e.items.map((W,ae)=>{let Q=t.concat(["items",ae]);return p(W,Q,i)});let h=e.minItems,f=e.maxItems,O=ne("minItems"),U=ne("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=ne("alwaysFakeOptionals")===!0?1:ne("optionalsProbability"),$=ne("alwaysFakeOptionals")||ne("fixedProbabilities")||!1,R=Z.number(h,f,1,5);T!==null&&(R=Math.max($?Math.round((f||R)*T):Math.abs(Z.number(h,f)*T),h||0));let J=typeof e.additionalItems=="object"?e.additionalItems:{};for(let W=u.length;W<R;W+=1){let ae=t.concat(["items",W]),Q=p(e.items||J,ae,i);u.push(Q)}if(e.contains&&R>0){let W=Z.number(0,R-1);u[W]=p(e.contains,t.concat(["items",W]),i)}return e.uniqueItems?ps(t.concat(["items"]),u,e,J,i,p):u}function ds(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?tt.MIN_INTEGER:e.minimum,i=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?tt.MAX_INTEGER:e.maximum,p=e.multipleOf,u=p&&String(p).match(/e-(\d)|\.(\d+)$/);if(u){let h=(Math.random()*Z.number(0,10)+1)*p,f=u[1]||u[2].length,O=parseFloat(h.toFixed(f)),U=Z.number(t,i-1);return String(O).includes(".")?U+O:(U+O).toExponential()}if(p&&(i=Math.floor(i/p)*p,t=Math.ceil(t/p)*p),e.exclusiveMinimum&&t===e.minimum&&(t+=p||1),e.exclusiveMaximum&&i===e.maximum&&(i-=p||1),t>i)return NaN;if(p){let h=Z.number(Math.floor(t/p),Math.floor(i/p))*p;for(;h<t;)h+=p;return h}return Z.number(t,i,void 0,void 0,e.type!=="integer")}function fs(e){return Math.floor(mr({...e}))}function hs(e){return Z.shuffle(gi).slice(0,e)}function ms(e,t,i,p){let u={},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),R=T.concat($).reduce((Y,y)=>(O.indexOf(y)===-1&&Y.push(y),Y),[]),J=O.concat(R),W=U&&e.additionalProperties===!0?tn:e.additionalProperties;if(!U&&T.length===0&&$.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(ne("requiredOnly")===!0)return O.forEach(Y=>{h[Y]&&(u[Y]=h[Y])}),p(u,t.concat(["properties"]),i,e);let ae=ne("alwaysFakeOptionals")===!0?1:ne("optionalsProbability"),Q=ne("alwaysFakeOptionals")||ne("fixedProbabilities")||!1,re=ne("ignoreProperties")||[],he=ne("reuseProperties"),ye=ne("fillProperties"),j=e.maxProperties||J.length+(U?Z.number(1,5):0),w=Math.max(e.minProperties||0,O.length),b=Math.max(0,J.length-w);J.length===1&&!O.length&&(w=Math.max(Z.number(ye?1:0,j),w)),ae!==null&&(Q===!0?b=Math.round(w-O.length+ae*(J.length-w)):b=Z.number(w-O.length,ae*(J.length-w)));let _=Z.shuffle(R).slice(0,b),I=R.filter(Y=>_.indexOf(Y)!==-1),L=ae!==null||O.length===j?j:Z.number(0,j),E=O.concat(Z.shuffle(I).slice(0,L)).slice(0,j),N=[],k=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(Y=>{let y=e.dependencies[Y];if(E.indexOf(Y)!==-1)if(Array.isArray(y))y.forEach(C=>{E.indexOf(C)===-1&&E.push(C)});else if(Array.isArray(y.oneOf||y.anyOf)){let C=y.oneOf||y.anyOf;k.push({prop:Y,values:C})}else N.push(y)}),N.length))return delete e.dependencies,p({allOf:N.concat(e)},t.concat(["properties"]),i,e);let V=[],G=[];E.forEach(Y=>{if(h[Y]&&["{}","true"].includes(JSON.stringify(h[Y].not)))return;for(let C=0;C<re.length;C+=1)if(re[C]instanceof RegExp&&re[C].test(Y)||typeof re[C]=="string"&&re[C]===Y||typeof re[C]=="function"&&re[C](h[Y],Y)){V.push(Y);return}W===!1&&O.indexOf(Y)!==-1&&(u[Y]=h[Y]),h[Y]&&(u[Y]=h[Y]);let y;if($.forEach(C=>{Y.match(new RegExp(C))&&(y=!0,u[Y]?de.merge(u[Y],f[C]):u[Z.randexp(Y)]=f[C])}),!y){let C=f[Y]||W;C&&W!==!1?u[f[Y]?Z.randexp(Y):Y]=h[Y]||C:G.push(Y)}});let ee=Object.keys(u).length+(ye?0:V.length),ve=Y=>Z.randexp(`_?[_a-f\\d]{1,3}${Y?"\\$?":""}`);function Ae(Y){let y;do{if(!Y.length)break;y=Y.shift()}while(u[y]);return y}let Ee=w;if(U&&!O.length&&(Ee=Math.max(ae===null||W?Z.number(ye?1:0,j):0,w)),!I.length&&!b&&U&&Q===!0&&ye){let Y=Z.number(0,j);for(let y=0;y<Y;y+=1)u[en(1)+ve(Y[y])]=W||tn}for(;ye&&!(!($.length||U)||ee>=Ee);){if(U)if(he&&T.length-ee>Ee){let Y=0,y;do{if(Y+=1,Y>1e3)break;y=Ae(O)||Z.pick(T)}while(typeof u[y]!="undefined");typeof u[y]=="undefined"&&(u[y]=h[y],ee+=1)}else if($.length&&!W){let Y=Z.pick($),y=Z.randexp(Y);u[y]||(u[y]=f[Y],ee+=1)}else{let Y=Ae(O)||en(1)+ve();u[Y]||(u[Y]=W||tn,ee+=1)}for(let Y=0;ee<w&&Y<$.length;Y+=1){let y=$[Y],C=Z.randexp(y);u[C]||(u[C]=f[y],ee+=1)}}if(O.length===0&&(!U||ae===!1)){let Y=Z.number(w,j);for(;ee<Y;){let y=Ae(T);y&&(u[y]=h[y]),ee+=1}}let Ie=u;if(ne("sortProperties")!==null){let Y=Object.keys(h);Ie=Object.keys(u).sort((C,H)=>ne("sortProperties")?C.localeCompare(H):Y.indexOf(C)-Y.indexOf(H)).reduce((C,H)=>(C[H]=u[H],C),{})}let Le=p(Ie,t.concat(["properties"]),i,e);return k.forEach(Y=>{for(let y of Y.values)if(de.hasValue(y.properties[Y.prop],Le.value[Y.prop])){Object.keys(y.properties).forEach(C=>{C!==Y.prop&&de.merge(Le.value,p(y.properties,t.concat(["properties"]),i,e).value)});break}}),Le}function Cr(){let e=Z.number(1,5);return en(e).join(" ")}function ys(e=0,t=140){let i=Math.max(0,e),p=Z.number(i,t),u=Cr();for(;u.length<i;)u+=Cr();return u.length>p&&(u=u.substr(0,p)),u}function gs(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function Ss(){return Z.date().toISOString()}function ws(){return nn().slice(0,10)}function bs(){return nn().slice(11)}function Ts(e){return Z.randexp(We[e]).replace(vi,(t,i)=>Z.randexp(We[i]))}function Os(e,t){let i=hr(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return nn();case"date":return bi();case"time":return Ti();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 i=="undefined"){if(ne("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function vs(e){return de.typecast("string",e,i=>e.format?Os(e,()=>yr(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):yr(i.minLength,i.maxLength))}function As({$comment:e,title:t,description:i}){return Object.entries({comment:e,title:t,description:i}).filter(([,p])=>p).reduce((p,[u,h])=>(p[u]=h,p),{})}function wt(e,t,i,p){if(e=i(e,null,t),e&&(e.oneOf||e.anyOf||e.allOf)&&(e=i(e,null,t)),!e)throw new Error(`Cannot traverse at '${t.join(".")}', given '${JSON.stringify(p)}'`);let u={...As(e),schemaPath:t};if(t[t.length-1]!=="properties"){if(ne("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:u}}if(ne("useExamplesValue")&&typeof e.example!="undefined")return{value:de.typecast(null,e,()=>e.example),context:u};if(ne("useDefaultValue")&&"default"in e&&(e.default!==""||!ne("replaceEmptyByRandomValue")))return{value:e.default,context:u};if("template"in e)return{value:de.template(e.template,p),context:u};if("const"in e)return{value:e.const,context:u}}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:$}=wt(e,t.concat(["not"]),i,p);return{value:de.clean(T,e,!1),context:{...u,items:$}}}if(typeof e.thunk=="function"){let{value:T,context:$}=wt(e.thunk(p),t,i);return{value:T,context:{...u,items:$}}}if(e.jsonPath)return{value:e,context:u};let h=e.type;if(Array.isArray(h)?h=Z.pick(h):typeof h=="undefined"&&(h=li(e,t)||h,h&&(e.type=h)),typeof e.generate=="function"){let T=de.typecast(null,e,()=>e.generate(p,t)),$=T===null?"null":typeof T;if($===h||$==="number"&&h==="integer"||Array.isArray(T)&&h==="array")return{value:T,context:u}}if(typeof e.pattern=="string")return{value:de.typecast("string",e,()=>Z.randexp(e.pattern)),context:u};if(Array.isArray(e.enum))return{value:de.typecast(null,e,()=>Z.pick(e.enum)),context:u};if(typeof h=="string")if(kt[h])try{let T=kt[h](e,t,i,wt);return h==="array"?{value:T.map(({value:$})=>$),context:{...u,items:T.map(Array.isArray(e.items)?({context:$})=>$:({context:$})=>({...$,schemaPath:$.schemaPath.slice(0,-1)}))}}:h==="object"?T!==null?{value:T.value,context:{...u,items:T.context}}:{value:{},context:u}:{value:T,context:u}}catch(T){throw typeof T.path=="undefined"?new Zt(T.stack,t):T}else{if(ne("failOnInvalidTypes"))throw new Zt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=ne("defaultInvalidTypeProduct");return typeof T=="string"&&kt[T]?{value:kt[T](e,t,i,wt),context:u}:{value:T,context:u}}}let f={},O={...u};Array.isArray(e)&&(f=[]);let U=ne("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!U.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:R}=wt(e[T],t.concat([T]),i,f);f[T]=de.clean($,e[T],!1),O[T]=R,f[T]===null&&ne("omitNulls")&&(delete f[T],delete O[T])}else f[T]=e[T]}),{value:f,context:O}}function Rs(e){return Array.isArray(e)?Z.pick(e):e}function Es(e,t){if(!Array.isArray(e))return e;let i=t?e.pop():e.shift();return t?e.unshift(i):e.push(i),i}function nr(e,t,i,p){if(!e||typeof e!="object")return e;if(i||(i={}),t||(t=e),Array.isArray(e))return e.map(u=>nr(u,t,i,p));if(e.jsonPath){let{JSONPath:u}=cr(),h=typeof e.jsonPath!="object"?{path:e.jsonPath}:e.jsonPath;h.group=e.group||h.group||p,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 i[f]||(h.count>1?i[f]=u(h.path,t).slice(0,h.count):i[f]=u(h.path,t)),h.cycle||h.reverse?Es(i[f],h.reverse):Rs(i[f])}return Object.keys(e).forEach(u=>{e[u]=nr(e[u],t,i,u)}),e}function _s(e,t,i,p){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let u=ne("refDepthMin")||0,h=ne("refDepthMax")||3;try{let{resolveSchema:f}=xi({refs:e,schema:t,container:i,synchronous:p,refDepthMin:u,refDepthMax:h}),O=_i(de.clone(t),[],f);return ne("resolveJsonPath")?{value:nr(O.value),context:O.context}:O}catch(f){throw f.path?new Error(`${f.message} in /${f.path.join("/")}`):f}}function Ps(e){return e.value}function xs(e,t){return t.reduce((i,p)=>p in i?i[p]:{},e)}function rr(e,t,i,p=i){let{title:u,description:h,comment:f}=xs(e,t),O=[];ne("renderTitle")&&u&&O.push(` ${u}`,""),ne("renderDescription")&&h&&O.push(` ${h}`),ne("renderComment")&&f&&O.push(` ${f}`),i.commentBefore=O.join(`
`),p instanceof Ii?p.items.forEach(U=>{rr(e,[...t,"items",U.key.value],U.key,U.value)}):p instanceof Ni&&p.items.forEach((U,T)=>{rr(e,[...t,"items",T],U)})}function Is({value:e,context:t}){let i=Mt.createNode(e);rr(t,[],i);let p=new Mt.Document;return p.contents=i,p.toString()}function kr(){rt.define("autoIncrement",function(t,i){if(!this.offset){let p=i.minimum||1,u=p+tt.MAX_NUMBER,h=t.initialOffset||i.initialOffset;this.offset=h||Z.number(p,u)}return t?this.offset++:i}),rt.define("sequentialDate",function(t,i){if(this.now||(this.now=Z.date()),t){if(i=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 i})}function Mr(e,t){let i={};Array.isArray(e)?e.forEach(u=>{i[u.$id||u.id]=u}):i=e||{};function p(u){if(!u||typeof u!="object")return;if(Array.isArray(u))return u.forEach(p);let h=u.$id||u.id;typeof h=="string"&&!i[h]&&(i[h]=u),Object.keys(u).forEach(f=>{p(u[f])})}return p(e),p(t),i}var Lr,ir,Dr,or,Ur,Fr,je,$r,sr,xt,F,jr,Yr,Wr,Vr,qr,It,Xt,ar,Br,Jr,lr,cr,Gr,Hr,pr,ue,ur,Kr,zr,Nt,ne,dr,fr,Xr,Qr,Zr,ei,ti,ni,tt,Qt,Z,ri,de,ii,oi,bt,hr,si,Zt,Ct,ai,li,ci,pi,ui,di,fi,hi,mi,mr,yi,gi,en,tn,Si,yr,wi,nn,bi,Ti,gr,rn,Oi,We,vi,Ai,Ri,Ei,kt,_i,Pi,xi,Sr,wr,De,Ns,Cs,ks,Ms,Ls,Ds,Us,Fs,$s,js,Ys,Ws,Ii,Ni,Mt,rt,Oe,Ci,ki,Vs=m({"src/shared.js"(){Lr=Object.create,ir=Object.defineProperty,Dr=Object.getOwnPropertyDescriptor,or=Object.getOwnPropertyNames,Ur=Object.getPrototypeOf,Fr=Object.prototype.hasOwnProperty,je=(e,t)=>function(){return t||(0,e[or(e)[0]])((t={exports:{}}).exports,t),t.exports},$r=(e,t,i,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of or(t))!Fr.call(e,u)&&u!==i&&ir(e,u,{get:()=>t[u],enumerable:!(p=Dr(t,u))||p.enumerable});return e},sr=(e,t,i)=>(i=e!=null?Lr(Ur(e)):{},$r(t||!e||!e.__esModule?ir(i,"default",{value:e,enumerable:!0}):i,e)),xt=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}}}),F=je({"node_modules/ret/lib/sets.js"(e){var t=xt(),i=()=>[{type:t.RANGE,from:48,to:57}],p=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(i()),u=()=>[{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:p(),not:!1}),e.notWords=()=>({type:t.SET,set:p(),not:!0}),e.ints=()=>({type:t.SET,set:i(),not:!1}),e.notInts=()=>({type:t.SET,set:i(),not:!0}),e.whitespace=()=>({type:t.SET,set:u(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:u(),not:!0}),e.anyChar=()=>({type:t.SET,set:h(),not:!0})}}),jr=je({"node_modules/ret/lib/util.js"(e){var t=xt(),i=F(),p="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",u={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,$,R,J,W,ae)=>{if(T)return O;var Q=U?8:$?parseInt($,16):R?parseInt(R,16):J?parseInt(J,8):W?p.indexOf(W):u[ae],re=String.fromCharCode(Q);return/[[\]{}^$.|?*+()]/.test(re)&&(re="\\"+re),re}),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(i.words());else if(T[2])O.push(i.ints());else if(T[3])O.push(i.whitespace());else if(T[4])O.push(i.notWords());else if(T[5])O.push(i.notInts());else if(T[6])O.push(i.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)}}}),Yr=je({"node_modules/ret/lib/positions.js"(e){var t=xt();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:"$"})}}),Wr=je({"node_modules/ret/lib/index.js"(e,t){var i=jr(),p=xt(),u=F(),h=Yr();t.exports=f=>{var O=0,U,T,$={type:p.ROOT,stack:[]},R=$,J=$.stack,W=[],ae=I=>{i.error(f,`Nothing to repeat at column ${I-1}`)},Q=i.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(u.words());break;case"W":J.push(u.notWords());break;case"d":J.push(u.ints());break;case"D":J.push(u.notInts());break;case"s":J.push(u.whitespace());break;case"S":J.push(u.notWhitespace());break;default:/\d/.test(T)?J.push({type:p.REFERENCE,value:parseInt(T,10)}):J.push({type:p.CHAR,value:T.charCodeAt(0)})}break;case"^":J.push(h.begin());break;case"$":J.push(h.end());break;case"[":{var re;Q[O]==="^"?(re=!0,O++):re=!1;var he=i.tokenizeClass(Q.slice(O),f);O+=he[1],J.push({type:p.SET,set:he[0],not:re});break}case".":J.push(u.anyChar());break;case"(":{var ye={type:p.GROUP,stack:[],remember:!0};T=Q[O],T==="?"&&(T=Q[O+1],O+=2,T==="="?ye.followedBy=!0:T==="!"?ye.notFollowedBy=!0:T!==":"&&i.error(f,`Invalid group, character '${T}' after '?' at column ${O-1}`),ye.remember=!1),J.push(ye),W.push(R),R=ye,J=ye.stack;break}case")":W.length===0&&i.error(f,`Unmatched ) at column ${O-1}`),R=W.pop(),J=R.options?R.options[R.options.length-1]:R.stack;break;case"|":{R.options||(R.options=[R.stack],delete R.stack);var j=[];R.options.push(j),J=j;break}case"{":{var w=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,_;w!==null?(J.length===0&&ae(O),b=parseInt(w[1],10),_=w[2]?w[3]?parseInt(w[3],10):1/0:b,O+=w[0].length,J.push({type:p.REPETITION,min:b,max:_,value:J.pop()})):J.push({type:p.CHAR,value:123});break}case"?":J.length===0&&ae(O),J.push({type:p.REPETITION,min:0,max:1,value:J.pop()});break;case"+":J.length===0&&ae(O),J.push({type:p.REPETITION,min:1,max:1/0,value:J.pop()});break;case"*":J.length===0&&ae(O),J.push({type:p.REPETITION,min:0,max:1/0,value:J.pop()});break;default:J.push({type:p.CHAR,value:T.charCodeAt(0)})}return W.length!==0&&i.error(f,"Unterminated group"),$},t.exports.types=p}}),Vr=je({"node_modules/drange/lib/index.js"(e,t){var i=class vt{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 vt(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 vt(this.low,h.low-1),new vt(h.high+1,this.high)]:h.low<=this.low?[new vt(h.high+1,this.high)]:[new vt(this.low,h.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},p=class qt{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 qt?h.ranges.forEach(O):(f==null&&(f=h),O(new i(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 qt?h.ranges.forEach(O):(f==null&&(f=h),O(new i(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 R=Math.max(this.ranges[$].low,T.low),J=Math.min(this.ranges[$].high,T.high);O.push(new i(R,J)),$++}};return h instanceof qt?h.ranges.forEach(U):(f==null&&(f=h),U(new i(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 qt(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=p}}),qr=je({"node_modules/randexp/lib/randexp.js"(e,t){var i=Wr(),p=Vr(),u=i.types;t.exports=class Bt{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=i(f)}_setDefaults(f){this.max=f.max!=null?f.max:Bt.prototype.max!=null?Bt.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,$,R,J;switch(f.type){case u.ROOT:case u.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="",R=0,J=U.length;R<J;R++)T+=this._gen(U[R],O);return f.remember&&(O[f.groupNumber]=T),T;case u.POSITION:return"";case u.SET:{var W=this._expand(f);return W.length?String.fromCharCode(this._randSelect(W)):""}case u.REPETITION:for($=this.randInt(f.min,f.max===1/0?f.min+this.max:f.max),T="",R=0;R<$;R++)T+=this._gen(f.value,O);return T;case u.REFERENCE:return O[f.value-1]||"";case u.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 p?f.index(this.randInt(0,f.length-1)):f[this.randInt(0,f.length-1)]}_expand(f){if(f.type===i.types.CHAR)return new p(f.value);if(f.type===i.types.RANGE)return new p(f.from,f.to);{let O=new p;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 R=T.index($),J=this._toOtherCase(R);R!==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 p(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 Bt(f,O),f._randexp=U):(U=f._randexp,U._setDefaults(f)),U.gen()}static sugar(){RegExp.prototype.gen=function(){return Bt.randexp(this)}}}}}),It=je({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(e){var t={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},i={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"},p="tag:yaml.org,2002:",u={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function h(j){let w=[0],b=j.indexOf(`
`);for(;b!==-1;)b+=1,w.push(b),b=j.indexOf(`
`,b);return w}function f(j){let w,b;return typeof j=="string"?(w=h(j),b=j):(Array.isArray(j)&&(j=j[0]),j&&j.context&&(j.lineStarts||(j.lineStarts=h(j.context.src)),w=j.lineStarts,b=j.context.src)),{lineStarts:w,src:b}}function O(j,w){if(typeof j!="number"||j<0)return null;let{lineStarts:b,src:_}=f(w);if(!b||!_||j>_.length)return null;for(let L=0;L<b.length;++L){let E=b[L];if(j<E)return{line:L,col:j-b[L-1]+1};if(j===E)return{line:L+1,col:1}}let I=b.length;return{line:I,col:j-b[I-1]+1}}function U(j,w){let{lineStarts:b,src:_}=f(w);if(!b||!(j>=1)||j>b.length)return null;let I=b[j-1],L=b[j];for(;L&&L>I&&_[L-1]===`
`;)--L;return _.slice(I,L)}function T({start:j,end:w},b,_=80){let I=U(j.line,b);if(!I)return null;let{col:L}=j;if(I.length>_)if(L<=_-10)I=I.substr(0,_-1)+"\u2026";else{let G=Math.round(_/2);I.length>L+G&&(I=I.substr(0,L+G-1)+"\u2026"),L-=I.length-_,I="\u2026"+I.substr(1-_)}let E=1,N="";w&&(w.line===j.line&&L+(w.col-j.col)<=_+1?E=w.col-j.col:(E=Math.min(I.length+1,_)-L,N="\u2026"));let k=L>1?" ".repeat(L-1):"",V="^".repeat(E);return`${I}
${k}${V}${N}`}var $=class Fi{static copy(w){return new Fi(w.start,w.end)}constructor(w,b){this.start=w,this.end=b||w}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(w,b){let{start:_,end:I}=this;if(w.length===0||I<=w[0])return this.origStart=_,this.origEnd=I,b;let L=b;for(;L<w.length&&!(w[L]>_);)++L;this.origStart=_+L;let E=L;for(;L<w.length&&!(w[L]>=I);)++L;return this.origEnd=I+L,E}},R=class lt{static addStringTerminator(w,b,_){if(_[_.length-1]===`
`)return _;let I=lt.endOfWhiteSpace(w,b);return I>=w.length||w[I]===`
`?_+`
`:_}static atDocumentBoundary(w,b,_){let I=w[b];if(!I)return!0;let L=w[b-1];if(L&&L!==`
`)return!1;if(_){if(I!==_)return!1}else if(I!==t.DIRECTIVES_END&&I!==t.DOCUMENT_END)return!1;let E=w[b+1],N=w[b+2];if(E!==I||N!==I)return!1;let k=w[b+3];return!k||k===`
`||k===" "||k===" "}static endOfIdentifier(w,b){let _=w[b],I=_==="<",L=I?[`
`," "," ",">"]:[`
`," "," ","[","]","{","}",","];for(;_&&L.indexOf(_)===-1;)_=w[b+=1];return I&&_===">"&&(b+=1),b}static endOfIndent(w,b){let _=w[b];for(;_===" ";)_=w[b+=1];return b}static endOfLine(w,b){let _=w[b];for(;_&&_!==`
`;)_=w[b+=1];return b}static endOfWhiteSpace(w,b){let _=w[b];for(;_===" "||_===" ";)_=w[b+=1];return b}static startOfLine(w,b){let _=w[b-1];if(_===`
`)return b;for(;_&&_!==`
`;)_=w[b-=1];return b+1}static endOfBlockIndent(w,b,_){let I=lt.endOfIndent(w,_);if(I>_+b)return I;{let L=lt.endOfWhiteSpace(w,I),E=w[L];if(!E||E===`
`)return L}return null}static atBlank(w,b,_){let I=w[b];return I===`
`||I===" "||I===" "||_&&!I}static nextNodeIsIndented(w,b,_){return!w||b<0?!1:b>0?!0:_&&w==="-"}static normalizeOffset(w,b){let _=w[b];return _?_!==`
`&&w[b-1]===`
`?b-1:lt.endOfWhiteSpace(w,b):b}static foldNewline(w,b,_){let I=0,L=!1,E="",N=w[b+1];for(;N===" "||N===" "||N===`
`;){switch(N){case`
`:I=0,b+=1,E+=`
`;break;case" ":I<=_&&(L=!0),b=lt.endOfWhiteSpace(w,b+2)-1;break;case" ":I+=1,b+=1;break}N=w[b+1]}return E||(E=" "),N&&I<=_&&(L=!0),{fold:E,offset:b,error:L}}constructor(w,b,_){Object.defineProperty(this,"context",{value:_||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=b||[],this.type=w,this.value=null}getPropValue(w,b,_){if(!this.context)return null;let{src:I}=this.context,L=this.props[w];return L&&I[L.start]===b?I.slice(L.start+(_?1:0),L.end):null}get anchor(){for(let w=0;w<this.props.length;++w){let b=this.getPropValue(w,t.ANCHOR,!0);if(b!=null)return b}return null}get comment(){let w=[];for(let b=0;b<this.props.length;++b){let _=this.getPropValue(b,t.COMMENT,!0);_!=null&&w.push(_)}return w.length>0?w.join(`
`):null}commentHasRequiredWhitespace(w){let{src:b}=this.context;if(this.header&&w===this.header.end||!this.valueRange)return!1;let{end:_}=this.valueRange;return w!==_||lt.atBlank(b,_-1)}get hasComment(){if(this.context){let{src:w}=this.context;for(let b=0;b<this.props.length;++b)if(w[this.props[b].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:w}=this.context;for(let b=0;b<this.props.length;++b)if(w[this.props[b].start]!==t.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[i.FLOW_MAP,i.FLOW_SEQ,i.QUOTE_DOUBLE,i.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let w=O(this.range.start,this.context.root);if(!w)return;let b=O(this.range.end,this.context.root);return{start:w,end:b}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:w,end:b}=this.valueRange;return this.context.src.slice(w,b)}get tag(){for(let w=0;w<this.props.length;++w){let b=this.getPropValue(w,t.TAG,!1);if(b!=null){if(b[1]==="<")return{verbatim:b.slice(2,-1)};{let[_,I,L]=b.match(/^(.*!)([^!]*)$/);return{handle:I,suffix:L}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:w,end:b}=this.valueRange,{src:_}=this.context;for(let I=w;I<b;++I)if(_[I]===`
`)return!0;return!1}parseComment(w){let{src:b}=this.context;if(b[w]===t.COMMENT){let _=lt.endOfLine(b,w+1),I=new $(w,_);return this.props.push(I),_}return w}setOrigRanges(w,b){return this.range&&(b=this.range.setOrigRange(w,b)),this.valueRange&&this.valueRange.setOrigRange(w,b),this.props.forEach(_=>_.setOrigRange(w,b)),b}toString(){let{context:{src:w},range:b,value:_}=this;if(_!=null)return _;let I=w.slice(b.start,b.end);return lt.addStringTerminator(w,b.end,I)}},J=class extends Error{constructor(j,w,b){if(!b||!(w instanceof R))throw new Error(`Invalid arguments for new ${j}`);super(),this.name=j,this.message=b,this.source=w}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 w=j&&O(this.offset,j);if(w){let b={line:w.line,col:w.col+1};this.linePos={start:w,end:b}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:w,col:b}=this.linePos.start;this.message+=` at line ${w}, column ${b}`;let _=j&&T(this.linePos,j);_&&(this.message+=`:
${_}
`)}delete this.source}},W=class extends J{constructor(j,w){super("YAMLReferenceError",j,w)}},ae=class extends J{constructor(j,w){super("YAMLSemanticError",j,w)}},Q=class extends J{constructor(j,w){super("YAMLSyntaxError",j,w)}},re=class extends J{constructor(j,w){super("YAMLWarning",j,w)}};function he(j,w,b){return w in j?Object.defineProperty(j,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):j[w]=b,j}var ye=class Or extends R{static endOfLine(w,b,_){let I=w[b],L=b;for(;I&&I!==`
`&&!(_&&(I==="["||I==="]"||I==="{"||I==="}"||I===","));){let E=w[L+1];if(I===":"&&(!E||E===`
`||E===" "||E===" "||_&&E===",")||(I===" "||I===" ")