@novu/framework 2.8.0 → 2.9.0-nightly.20251202.474f9cfa96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/cjs/{index-DMh2JJ5c.d.cts → index-S0QKfWxm.d.cts} +13 -2
  2. package/dist/cjs/index.cjs +33 -33
  3. package/dist/cjs/index.d.cts +1 -1
  4. package/dist/cjs/servers/express.cjs +32 -32
  5. package/dist/cjs/servers/express.d.cts +2 -2
  6. package/dist/cjs/servers/h3.cjs +28 -28
  7. package/dist/cjs/servers/h3.d.cts +2 -2
  8. package/dist/cjs/servers/lambda.cjs +56 -56
  9. package/dist/cjs/servers/lambda.d.cts +2 -2
  10. package/dist/cjs/servers/nest.cjs +63 -63
  11. package/dist/cjs/servers/nest.d.cts +2 -2
  12. package/dist/cjs/servers/next.cjs +30 -30
  13. package/dist/cjs/servers/next.d.cts +2 -2
  14. package/dist/cjs/servers/nuxt.cjs +28 -28
  15. package/dist/cjs/servers/nuxt.d.cts +2 -2
  16. package/dist/cjs/servers/remix.cjs +32 -32
  17. package/dist/cjs/servers/remix.d.cts +2 -2
  18. package/dist/cjs/servers/sveltekit.cjs +28 -28
  19. package/dist/cjs/servers/sveltekit.d.cts +2 -2
  20. package/dist/esm/{chunk-BEJRLOTZ.js → chunk-3VXCWACY.js} +55 -55
  21. package/dist/esm/{index-DnpUToB5.d.ts → index-CmEcpAEO.d.ts} +13 -2
  22. package/dist/esm/index.d.ts +1 -1
  23. package/dist/esm/index.js +1 -1
  24. package/dist/esm/servers/express.d.ts +2 -2
  25. package/dist/esm/servers/express.js +1 -1
  26. package/dist/esm/servers/h3.d.ts +2 -2
  27. package/dist/esm/servers/h3.js +1 -1
  28. package/dist/esm/servers/lambda.d.ts +2 -2
  29. package/dist/esm/servers/lambda.js +1 -1
  30. package/dist/esm/servers/nest.d.ts +2 -2
  31. package/dist/esm/servers/nest.js +1 -1
  32. package/dist/esm/servers/next.d.ts +2 -2
  33. package/dist/esm/servers/next.js +1 -1
  34. package/dist/esm/servers/nuxt.d.ts +2 -2
  35. package/dist/esm/servers/nuxt.js +1 -1
  36. package/dist/esm/servers/remix.d.ts +2 -2
  37. package/dist/esm/servers/remix.js +1 -1
  38. package/dist/esm/servers/sveltekit.d.ts +2 -2
  39. package/dist/esm/servers/sveltekit.js +1 -1
  40. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- "use strict";var Mo=Object.create;var Jt=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Uo=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var $o=(h,n)=>{for(var s in n)Jt(h,s,{get:n[s],enumerable:!0})},Tr=(h,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let S of Do(n))!Fo.call(h,S)&&S!==s&&Jt(h,S,{get:()=>n[S],enumerable:!(c=Lo(n,S))||c.enumerable});return h};var et=(h,n,s)=>(s=h!=null?Mo(Uo(h)):{},Tr(n||!h||!h.__esModule?Jt(s,"default",{value:h,enumerable:!0}):s,h)),jo=h=>Tr(Jt({},"__esModule",{value:!0}),h);var ja={};$o(ja,{Client:()=>wt,CronExpression:()=>ci,NovuRequestHandler:()=>kn,SeverityLevelEnum:()=>Fn,providerSchemas:()=>Mn,workflow:()=>As});module.exports=jo(ja);var Gr=require("jsonrepair");var Rt=(c=>(c.TRIGGER="trigger",c.EXECUTE="execute",c.PREVIEW="preview",c))(Rt||{}),Gt=(c=>(c.DISCOVER="discover",c.HEALTH_CHECK="health-check",c.CODE="code",c))(Gt||{});var ci=(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))(ci||{});var We=(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))(We||{});var Kt=(c=>(c.POST="POST",c.GET="GET",c.OPTIONS="OPTIONS",c))(Kt||{});var Yo=h=>{var s,c;if(typeof h!="object"||h===null)return!1;let n=Object.getPrototypeOf(h);return(c=(s=n==null?void 0:n.constructor)==null?void 0:s.name.endsWith("Error"))!=null?c:!1},tt=class extends Error{},Ht=class extends tt{constructor(){super(...arguments);this.statusCode=404}},Ue=class extends tt{constructor(){super(...arguments);this.statusCode=400}},st=class extends tt{constructor(){super(...arguments);this.statusCode=401}},ot=class extends tt{constructor(n,{cause:s}={}){var c;Yo(s)?(super(`${n}: ${s.message}`),this.data={stack:(c=s.stack)!=null?c:n}):(super(`${n}${s?`: ${JSON.stringify(s,null,2)}`:""}`),this.data={stack:n})}},zt=class extends tt{constructor(){super(...arguments);this.statusCode=409}};var mt=class extends ot{constructor(s){super("Unknown BridgeError",{cause:s});this.statusCode=500;this.code="BridgeError"}};var Xt=class extends Ue{constructor(s,c){super(`Workflow with id: \`${s}\` has a corrupt state. Step with id: \`${c}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:s,stepId:c}}},xt=class extends Ue{constructor(s,c){super(`Workflow with id: \`${s}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=c}},Qt=class extends Ue{constructor(s,c){super(`Workflow with id: \`${s}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=c}},Zt=class extends Ue{constructor(s,c,S){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${c}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=S}},en=class extends Ue{constructor(s,c,S){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${c}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=S}},tn=class extends Ue{constructor(s,c,S){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${c}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=S}},nn=class extends Ue{constructor(s,c,S){super(`Workflow with id: \`${s}\` has invalid controls syntax in step with id: \`${c}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=S}},rn=class extends Ue{constructor(s,c,S,U){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${c}\` and provider with id: \`${S}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=U}},sn=class extends Ue{constructor(s,c){super(`Workflow with id: \`${s}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=c}};var lt=h=>Object.values(We).includes(h==null?void 0:h.code),Or=h=>!lt(h)&&typeof h.statusCode=="number"&&h.statusCode>=400&&h.statusCode<500;var pi=h=>Object.values(h).map(n=>`\`${n}\``).join(", "),on=h=>h.replaceAll(/(\w)(\w*)/g,(n,s,c)=>s.toUpperCase()+c.toLowerCase()).replaceAll(/[\s-]+/g,"");var an=class extends tt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${pi(Kt)}`}},It=class extends Ue{constructor(s,c){super(`Invalid query string: \`action\`=\`${s}\`. Please use one of ${pi(c)}`);this.code="InvalidActionError"}},ln=class extends Ue{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var cn=class extends Error{constructor(n,s,c){super(),this.data={message:c},this.statusCode=n,this.code=s}};var Nt=class extends zt{constructor(n,s){super(`${on(n)} with id: \`${s}\` already exists. Please use a different id.`)}},at=class extends Ht{constructor(n,s){super(`${on(n)} with id: \`${s}\` does not exist. Please provide a valid id.`)}},yt=class extends ot{constructor(s,c,S,U){super(`Failed to ${S} ${on(s)} with id: \`${c}\``,{cause:U});this.statusCode=502}};var pn=class extends at{constructor(s){super("provider",s);this.code="ProviderNotFoundError"}},un=class extends yt{constructor(s,c,S){super("provider",s,c,S);this.code="ProviderExecutionFailedError"}};var dn=class extends st{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"}},fn=class extends st{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},hn=class extends st{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},mn=class extends st{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},yn=class extends st{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var gn=class extends at{constructor(s){super("step",s);this.code="StepNotFoundError"}},wn=class extends Nt{constructor(s){super("step",s);this.code="StepAlreadyExistsError"}},kt=class extends yt{constructor(s,c,S){super("step",s,c,S);this.code="StepExecutionFailedError"}};var Ct=class extends at{constructor(s){super("workflow",s);this.code="WorkflowNotFoundError"}};var Sn=(()=>{var h=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,S=(e,t)=>function(){return e&&(t=(0,e[s(e)[0]])(e=0)),t},U=(e,t)=>function(){return t||(0,e[s(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var i in t)h(e,i,{get:t[i],enumerable:!0})},z=(e,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of s(t))!c.call(e,p)&&p!==i&&h(e,p,{get:()=>t[p],enumerable:!(l=n(t,p))||l.enumerable});return e},ie=e=>z(h({},"__esModule",{value:!0}),e),Ae={};C(Ae,{JSONSchemaFaker:()=>Sr,default:()=>br,setDependencies:()=>Mi});function Ie(e,t){return typeof e=="string"?typeof t!="undefined"?Ot.register(e,t):Ot.get(e):Ot.registerMany(e)}function Ne(e,t){return e=typeof e=="undefined"?He.MIN_INTEGER:e,t=typeof t=="undefined"?He.MAX_INTEGER:t,Math.floor(te("random")()*(t-e+1))+e}function Se(e){return $t.default.prototype.max=te("defaultRandExpMax"),$t.default.prototype.randInt=(i,l)=>i+Math.floor(te("random")()*(1+(l-i))),new $t.default(e).gen()}function ke(e){return e[Math.floor(te("random")()*e.length)]}function Fe(e){let t,i,l=e.length,p=e.slice();for(;l>0;)i=Math.floor(te("random")()*l),l-=1,t=p[l],p[l]=p[i],p[i]=t;return p}function it(e,t){return te("random")()*(t-e)+e}function Ge(e,t,i,l,p=!1){return i=typeof i=="undefined"?He.MIN_NUMBER:i,l=typeof l=="undefined"?He.MAX_NUMBER:l,e=typeof e=="undefined"?i:e,t=typeof t=="undefined"?l:t,t<e&&(t+=e),p?it(e,t):Ne(e,t)}function Dt(e){switch(e){case"seconds":return Ge(0,60)*60;case"minutes":return Ge(15,50)*612;case"hours":return Ge(12,72)*36123;case"days":return Ge(7,30)*86412345;case"weeks":return Ge(4,52)*604812345;case"months":return Ge(2,13)*2592012345;case"years":return Ge(1,20)*31104012345;default:break}}function jn(e){if(e)return Dt(e);let t=te("minDateTime"),i=te("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof i=="string"&&(i=new Date(i));let l=new Date().getTime();return typeof t=="number"&&(t=new Date(l+t)),typeof i=="number"&&(i=new Date(l+i)),new Date(it(t.getTime(),i.getTime()))}function hi(e,t,i){if(t=decodeURIComponent(t),i&&i[t])return ce(i[t]);let l=t.replace("#/","/").split("/"),p=e.$ref&&i&&i[e.$ref]||e;for(!p&&!l[0]&&(l[0]=e.$ref.split("#/")[0]),i&&t.includes("#/")&&i[l[0]]&&(p=i[l.shift()]),l[0]||l.shift();p&&l.length>0;){let f=l.shift();if(!p[f])throw new Error(`Prop not found: ${f} (${t})`);p=p[f]}return p}function Ut(e){return typeof e=="string"&&qi.test(e)}function Ke(e){return["number","boolean"].includes(typeof e)}function qe(e,...t){return t.filter(i=>typeof e[i]!="undefined").length>0}function mi(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i,l]=e.split("T")[0].split("-");return i=`0${Math.max(1,Math.min(12,i))}`.slice(-2),l=`0${Math.max(1,Math.min(31,l))}`.slice(-2),`${t}-${i}-${l}`}function vs(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i]=e.split("T"),[l,p,f]=t.split("-"),[d,O,D]=i.substr(0,8).split(":");return p=`0${Math.max(1,Math.min(12,p))}`.slice(-2),f=`0${Math.max(1,Math.min(31,f))}`.slice(-2),d=`0${Math.max(1,Math.min(23,d))}`.slice(-2),O=`0${Math.max(1,Math.min(59,O))}`.slice(-2),D=`0${Math.max(1,Math.min(59,D))}`.slice(-2),`${l}-${p}-${f}T${d}:${O}:${D}.000Z`}function Es(e,t,i){let l={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(l.minimum=t.minimum),typeof t.maximum!="undefined"&&(l.maximum=t.maximum),t.enum){let f=Math.max(l.minimum||0,0),d=Math.min(l.maximum||1/0,1/0);t.exclusiveMinimum&&f===t.minimum&&(f+=t.multipleOf||1),t.exclusiveMaximum&&d===t.maximum&&(d-=t.multipleOf||1),(f||d!==1/0)&&(t.enum=t.enum.filter(O=>O>=f&&O<=d))}break;case"string":{l.minLength=te("minLength")||0,l.maxLength=te("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(l.minLength=Math.max(l.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(l.maxLength=Math.min(l.maxLength,t.maxLength));break}default:break}let p=i(l);if(p==null)return null;switch(e||t.type){case"number":p=Ut(p)?parseFloat(p):p;break;case"integer":p=Ut(p)?parseInt(p,10):p;break;case"boolean":p=!!p;break;case"string":{if(Ke(p))return p;p=String(p);let f=Math.max(l.minLength||0,0),d=Math.min(l.maxLength||1/0,1/0),O,D=0;for(;p.length<f;)if(O=p,t.pattern?p+=Z.randexp(t.pattern):p+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${p}`,p===O){if(D+=1,D===3)break}else D=0;switch(p.length>d&&(p=p.substr(0,d)),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(mi(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 dt(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((l,p)=>{e.type==="array"&&t.type==="array"?e[i][p]=dt(e[i][p]||{},l,!0):Array.isArray(e[i])&&e[i].indexOf(l)===-1&&e[i].push(l)})):typeof e[i]!="object"||e[i]===null||Array.isArray(e[i])?e[i]=dt({},t[i]):e[i]=dt(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 l=[];return t.set(e,l),l.push(...e.map(p=>ce(p,t))),l}let i={};return t.set(e,i),Object.keys(e).reduce((l,p)=>(l[p]=ce(e[p],t),l),i)}function _s(e){let t=JSON.stringify(e),i=JSON.stringify(e,null,2);return t.length>400?`${i.substr(0,400)}...`:i}function yi(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Rs(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Ps(e,t){let i=dt({},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(He.SCALAR_TYPES.filter(l=>(Array.isArray(e.type)?e.type:[e.type]).every(f=>l==="number"||l==="integer"?f!=="number"&&f!=="integer":l!==f)));else if(e.enum){let l;do l=yi();while(e.enum.indexOf(l)!==-1);i.enum=[l]}return e.required&&i.properties&&e.required.forEach(l=>{delete i.properties[l]}),i}function Yn(e,t){let i=t.minimum!==void 0,l=t.maximum!==void 0;return(i||l)&&(!i||e>=t.minimum)&&(!l||e<=t.maximum)}function xs(e,t){return!t.every(i=>Yn(e,i))}function Is(e,t){return t.reduce((l,p)=>l+(Yn(e,p)?1:0),0)===1}function Ns(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function ks(e,t){return Object.keys(e).filter(i=>!t.includes(i)).reduce((i,l)=>(Array.isArray(e[l])?i[l]=e[l].slice():i[l]=e[l]instanceof Object?dt({},e[l]):e[l],i),{})}function gi(e,t){return Array.isArray(e)?e.map(i=>gi(i,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(i,l)=>t[l])),e)}function Wn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function wi(e,t){t=t.items||t;let i=te("alwaysFakeOptionals"),l=Array.isArray(t.required)&&t.required.includes(e)||i,p=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!l&&!p}function Vn(e,t,i=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(l=>Vn(l,t,!0)).filter(l=>typeof l!="undefined");if(Object.keys(e).forEach(l=>{if(Wn(e[l]))wi(l,t)&&delete e[l];else{let p=t;t&&t.properties&&t.properties[l]&&(p=t.properties[l]);let f=Vn(e[l],p);Wn(f)||(e[l]=f)}typeof e[l]=="undefined"&&delete e[l]}),!(!Object.keys(e).length&&i))return e}function Cs(e){return(t,i,l,p)=>{let f=t,d=[];typeof t=="object"&&(f=Object.keys(t)[0],Array.isArray(t[f])?d=t[f]:d.push(t[f]));let O=f.split("."),D=e();for(;O.length>1;)D=D[O.shift()];return t=typeof D=="object"?D[O[0]]:D,typeof t=="function"&&(t=t.apply(D,d.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 '${l}: ${f}', given: ${t}`)}),t}}function Ms(e,t){if(typeof e=="undefined")return ht.list();if(typeof e=="string")if(typeof t=="function")ht.register(e,t);else if(t===null||t===!1)ht.unregister(e);else return ht.get(e);else ht.registerMany(e)}function Ls(e,t,i){return Object.keys(e).filter(l=>{let p=Ki.indexOf(t)>-1;return i.indexOf(l)>-1&&!p}).length>0}function Ds(e,t){let i=Object.keys(At);for(let l=0;l<i.length;l+=1){let p=i[l],f=t[t.length-1];if(Ls(e,f,At[p]))return p}}function Us(){return te("random")()>.5}function Fs(){return null}function $s(e,t,i,l,p,f){let d=[],O=[];function D($){let E=JSON.stringify($.value);return O.indexOf(E)===-1?(O.push(E),d.push($),!0):!1}t.forEach(D);let T=100;for(;d.length!==t.length&&(D(f(i.items||l,e,p))||(T-=1),!!T););return d}function js(e,t,i,l){let p=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new jt(`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 l(W,Q,i)});let f=e.minItems,d=e.maxItems,O=te("minItems"),D=te("maxItems");O&&(f=typeof f=="undefined"?O:Math.min(O,f)),D&&(d=typeof d=="undefined"?D:Math.min(D,d),d&&d>D&&(d=D),f&&f>D&&(f=d));let T=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),$=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,E=Z.number(f,d,1,5);T!==null&&(E=Math.max($?Math.round((d||E)*T):Math.abs(Z.number(f,d)*T),f||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=l(e.items||J,ae,i);p.push(Q)}if(e.contains&&E>0){let W=Z.number(0,E-1);p[W]=l(e.contains,t.concat(["items",W]),i)}return e.uniqueItems?$s(t.concat(["items"]),p,e,J,i,l):p}function Ys(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?He.MIN_INTEGER:e.minimum,i=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?He.MAX_INTEGER:e.maximum,l=e.multipleOf,p=l&&String(l).match(/e-(\d)|\.(\d+)$/);if(p){let f=(Math.random()*Z.number(0,10)+1)*l,d=p[1]||p[2].length,O=parseFloat(f.toFixed(d)),D=Z.number(t,i-1);return String(O).includes(".")?D+O:(D+O).toExponential()}if(l&&(i=Math.floor(i/l)*l,t=Math.ceil(t/l)*l),e.exclusiveMinimum&&t===e.minimum&&(t+=l||1),e.exclusiveMaximum&&i===e.maximum&&(i-=l||1),t>i)return NaN;if(l){let f=Z.number(Math.floor(t/l),Math.floor(i/l))*l;for(;f<t;)f+=l;return f}return Z.number(t,i,void 0,void 0,e.type!=="integer")}function Ws(e){return Math.floor(ri({...e}))}function Vs(e){return Z.shuffle(rr).slice(0,e)}function qs(e,t,i,l){let p={},f=e.properties||{},d=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),D=e.additionalProperties!==!1,T=Object.keys(f),$=Object.keys(d),E=T.concat($).reduce((Y,m)=>(O.indexOf(m)===-1&&Y.push(m),Y),[]),J=O.concat(E),W=D&&e.additionalProperties===!0?Wt:e.additionalProperties;if(!D&&T.length===0&&$.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(te("requiredOnly")===!0)return O.forEach(Y=>{f[Y]&&(p[Y]=f[Y])}),l(p,t.concat(["properties"]),i,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+(D?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 R=Z.shuffle(E).slice(0,b),x=E.filter(Y=>R.indexOf(Y)!==-1),M=ae!==null||O.length===j?j:Z.number(0,j),_=O.concat(Z.shuffle(x).slice(0,M)).slice(0,j),I=[],k=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(Y=>{let m=e.dependencies[Y];if(_.indexOf(Y)!==-1)if(Array.isArray(m))m.forEach(N=>{_.indexOf(N)===-1&&_.push(N)});else if(Array.isArray(m.oneOf||m.anyOf)){let N=m.oneOf||m.anyOf;k.push({prop:Y,values:N})}else I.push(m)}),I.length))return delete e.dependencies,l({allOf:I.concat(e)},t.concat(["properties"]),i,e);let V=[],G=[];_.forEach(Y=>{if(f[Y]&&["{}","true"].includes(JSON.stringify(f[Y].not)))return;for(let N=0;N<ne.length;N+=1)if(ne[N]instanceof RegExp&&ne[N].test(Y)||typeof ne[N]=="string"&&ne[N]===Y||typeof ne[N]=="function"&&ne[N](f[Y],Y)){V.push(Y);return}W===!1&&O.indexOf(Y)!==-1&&(p[Y]=f[Y]),f[Y]&&(p[Y]=f[Y]);let m;if($.forEach(N=>{Y.match(new RegExp(N))&&(m=!0,p[Y]?de.merge(p[Y],d[N]):p[Z.randexp(Y)]=d[N])}),!m){let N=d[Y]||W;N&&W!==!1?p[d[Y]?Z.randexp(Y):Y]=f[Y]||N:G.push(Y)}});let ee=Object.keys(p).length+(ye?0:V.length),Oe=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=w;if(D&&!O.length&&(_e=Math.max(ae===null||W?Z.number(ye?1:0,j):0,w)),!x.length&&!b&&D&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)p[Yt(1)+Oe(Y[m])]=W||Wt}for(;ye&&!(!($.length||D)||ee>=_e);){if(D)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]=f[m],ee+=1)}else if($.length&&!W){let Y=Z.pick($),m=Z.randexp(Y);p[m]||(p[m]=d[Y],ee+=1)}else{let Y=ve(O)||Yt(1)+Oe();p[Y]||(p[Y]=W||Wt,ee+=1)}for(let Y=0;ee<w&&Y<$.length;Y+=1){let m=$[Y],N=Z.randexp(m);p[N]||(p[N]=d[m],ee+=1)}}if(O.length===0&&(!D||ae===!1)){let Y=Z.number(w,j);for(;ee<Y;){let m=ve(T);m&&(p[m]=f[m]),ee+=1}}let Pe=p;if(te("sortProperties")!==null){let Y=Object.keys(f);Pe=Object.keys(p).sort((N,K)=>te("sortProperties")?N.localeCompare(K):Y.indexOf(N)-Y.indexOf(K)).reduce((N,K)=>(N[K]=p[K],N),{})}let Ce=l(Pe,t.concat(["properties"]),i,e);return k.forEach(Y=>{for(let m of Y.values)if(de.hasValue(m.properties[Y.prop],Ce.value[Y.prop])){Object.keys(m.properties).forEach(N=>{N!==Y.prop&&de.merge(Ce.value,l(m.properties,t.concat(["properties"]),i,e).value)});break}}),Ce}function Si(){let e=Z.number(1,5);return Yt(e).join(" ")}function Bs(e=0,t=140){let i=Math.max(0,e),l=Z.number(i,t),p=Si();for(;p.length<i;)p+=Si();return p.length>l&&(p=p.substr(0,l)),p}function Js(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function Gs(){return Z.date().toISOString()}function Ks(){return Vt().slice(0,10)}function Hs(){return Vt().slice(11)}function zs(e){return Z.randexp(je[e]).replace(pr,(t,i)=>Z.randexp(je[i]))}function Xs(e,t){let i=ii(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return Vt();case"date":return ar();case"time":return lr();case"ipv4":return or();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 ur(e.format);default:if(typeof i=="undefined"){if(te("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function Qs(e){return de.typecast("string",e,i=>e.format?Xs(e,()=>si(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):si(i.minLength,i.maxLength))}function Zs({$comment:e,title:t,description:i}){return Object.entries({comment:e,title:t,description:i}).filter(([,l])=>l).reduce((l,[p,f])=>(l[p]=f,l),{})}function ft(e,t,i,l){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(l)}'`);let p={...Zs(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,l),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:$}=ft(e,t.concat(["not"]),i,l);return{value:de.clean(T,e,!1),context:{...p,items:$}}}if(typeof e.thunk=="function"){let{value:T,context:$}=ft(e.thunk(l),t,i);return{value:T,context:{...p,items:$}}}if(e.jsonPath)return{value:e,context:p};let f=e.type;if(Array.isArray(f)?f=Z.pick(f):typeof f=="undefined"&&(f=Hi(e,t)||f,f&&(e.type=f)),typeof e.generate=="function"){let T=de.typecast(null,e,()=>e.generate(l,t)),$=T===null?"null":typeof T;if($===f||$==="number"&&f==="integer"||Array.isArray(T)&&f==="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 f=="string")if(vt[f])try{let T=vt[f](e,t,i,ft);return f==="array"?{value:T.map(({value:$})=>$),context:{...p,items:T.map(Array.isArray(e.items)?({context:$})=>$:({context:$})=>({...$,schemaPath:$.schemaPath.slice(0,-1)}))}}:f==="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 jt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new jt(`unknown primitive ${de.short(f)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&vt[T]?{value:vt[T](e,t,i,ft),context:p}:{value:T,context:p}}}let d={},O={...p};Array.isArray(e)&&(d=[]);let D=te("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!D.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:E}=ft(e[T],t.concat([T]),i,d);d[T]=de.clean($,e[T],!1),O[T]=E,d[T]===null&&te("omitNulls")&&(delete d[T],delete O[T])}else d[T]=e[T]}),{value:d,context:O}}function eo(e){return Array.isArray(e)?Z.pick(e):e}function to(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 qn(e,t,i,l){if(!e||typeof e!="object")return e;if(i||(i={}),t||(t=e),Array.isArray(e))return e.map(p=>qn(p,t,i,l));if(e.jsonPath){let{JSONPath:p}=Qn(),f=typeof e.jsonPath!="object"?{path:e.jsonPath}:e.jsonPath;f.group=e.group||f.group||l,f.cycle=e.cycle||f.cycle||!1,f.reverse=e.reverse||f.reverse||!1,f.count=e.count||f.count||1;let d=`${f.group}__${f.path}`;return i[d]||(f.count>1?i[d]=p(f.path,t).slice(0,f.count):i[d]=p(f.path,t)),f.cycle||f.reverse?to(i[d],f.reverse):eo(i[d])}return Object.keys(e).forEach(p=>{e[p]=qn(e[p],t,i,p)}),e}function no(e,t,i,l){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let p=te("refDepthMin")||0,f=te("refDepthMax")||3;try{let{resolveSchema:d}=yr({refs:e,schema:t,container:i,synchronous:l,refDepthMin:p,refDepthMax:f}),O=hr(de.clone(t),[],d);return te("resolveJsonPath")?{value:qn(O.value),context:O.context}:O}catch(d){throw d.path?new Error(`${d.message} in /${d.path.join("/")}`):d}}function io(e){return e.value}function ro(e,t){return t.reduce((i,l)=>l in i?i[l]:{},e)}function Bn(e,t,i,l=i){let{title:p,description:f,comment:d}=ro(e,t),O=[];te("renderTitle")&&p&&O.push(` ${p}`,""),te("renderDescription")&&f&&O.push(` ${f}`),te("renderComment")&&d&&O.push(` ${d}`),i.commentBefore=O.join(`
2
- `),l instanceof gr?l.items.forEach(D=>{Bn(e,[...t,"items",D.key.value],D.key,D.value)}):l instanceof wr&&l.items.forEach((D,T)=>{Bn(e,[...t,"items",T],D)})}function so({value:e,context:t}){let i=Et.createNode(e);Bn(t,[],i);let l=new Et.Document;return l.contents=i,l.toString()}function bi(){Xe.define("autoIncrement",function(t,i){if(!this.offset){let l=i.minimum||1,p=l+He.MAX_NUMBER,f=t.initialOffset||i.initialOffset;this.offset=f||Z.number(l,p)}return t?this.offset++:i}),Xe.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 Ti(e,t){let i={};Array.isArray(e)?e.forEach(p=>{i[p.$id||p.id]=p}):i=e||{};function l(p){if(!p||typeof p!="object")return;if(Array.isArray(p))return p.forEach(l);let f=p.$id||p.id;typeof f=="string"&&!i[f]&&(i[f]=p),Object.keys(p).forEach(d=>{l(p[d])})}return l(e),l(t),i}var Oi,Jn,Ai,Gn,vi,Ei,$e,_i,Kn,F,Hn,Ri,Pi,xi,Ii,Ni,Tt,Ft,zn,ki,Ci,Xn,Qn,Mi,Li,Zn,ue,ei,Di,Ui,Ot,te,ti,ni,Fi,$i,ji,Yi,Wi,Vi,He,$t,Z,qi,de,Bi,Ji,ht,ii,Gi,jt,At,Ki,Hi,zi,Xi,Qi,Zi,er,tr,nr,ri,ir,rr,Yt,Wt,sr,si,or,Vt,ar,lr,oi,qt,cr,je,pr,ur,dr,fr,vt,hr,mr,yr,ai,li,Le,oo,ao,lo,co,po,uo,fo,ho,mo,yo,go,wo,gr,wr,Et,Xe,Te,Sr,br,So=S({"src/shared.js"(){Oi=Object.create,Jn=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,Gn=Object.getOwnPropertyNames,vi=Object.getPrototypeOf,Ei=Object.prototype.hasOwnProperty,$e=(e,t)=>function(){return t||(0,e[Gn(e)[0]])((t={exports:{}}).exports,t),t.exports},_i=(e,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of Gn(t))!Ei.call(e,p)&&p!==i&&Jn(e,p,{get:()=>t[p],enumerable:!(l=Ai(t,p))||l.enumerable});return e},Kn=(e,t,i)=>(i=e!=null?Oi(vi(e)):{},_i(t||!e||!e.__esModule?Jn(i,"default",{value:e,enumerable:!0}):i,e)),F=$e({"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}}}),Hn=$e({"node_modules/ret/lib/sets.js"(e){var t=F(),i=()=>[{type:t.RANGE,from:48,to:57}],l=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(i()),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}],f=()=>[{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:l(),not:!1}),e.notWords=()=>({type:t.SET,set:l(),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:p(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:p(),not:!0}),e.anyChar=()=>({type:t.SET,set:f(),not:!0})}}),Ri=$e({"node_modules/ret/lib/util.js"(e){var t=F(),i=Hn(),l="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",p={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=f=>{var d=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return f=f.replace(d,(O,D,T,$,E,J,W,ae)=>{if(T)return O;var Q=D?8:$?parseInt($,16):E?parseInt(E,16):J?parseInt(J,8):W?l.indexOf(W):p[ae],ne=String.fromCharCode(Q);return/[[\]{}^$.|?*+()]/.test(ne)&&(ne="\\"+ne),ne}),f},e.tokenizeClass=(f,d)=>{for(var O=[],D=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,T,$;(T=D.exec(f))!=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,D.lastIndex];e.error(d,"Unterminated character class")},e.error=(f,d)=>{throw new SyntaxError("Invalid regular expression: /"+f+"/: "+d)}}}),Pi=$e({"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:"$"})}}),xi=$e({"node_modules/ret/lib/index.js"(e,t){var i=Ri(),l=F(),p=Hn(),f=Pi();t.exports=d=>{var O=0,D,T,$={type:l.ROOT,stack:[]},E=$,J=$.stack,W=[],ae=x=>{i.error(d,`Nothing to repeat at column ${x-1}`)},Q=i.strToChars(d);for(D=Q.length;O<D;)switch(T=Q[O++],T){case"\\":switch(T=Q[O++],T){case"b":J.push(f.wordBoundary());break;case"B":J.push(f.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:l.REFERENCE,value:parseInt(T,10)}):J.push({type:l.CHAR,value:T.charCodeAt(0)})}break;case"^":J.push(f.begin());break;case"$":J.push(f.end());break;case"[":{var ne;Q[O]==="^"?(ne=!0,O++):ne=!1;var he=i.tokenizeClass(Q.slice(O),d);O+=he[1],J.push({type:l.SET,set:he[0],not:ne});break}case".":J.push(p.anyChar());break;case"(":{var ye={type:l.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(d,`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&&i.error(d,`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 w=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,R;w!==null?(J.length===0&&ae(O),b=parseInt(w[1],10),R=w[2]?w[3]?parseInt(w[3],10):1/0:b,O+=w[0].length,J.push({type:l.REPETITION,min:b,max:R,value:J.pop()})):J.push({type:l.CHAR,value:123});break}case"?":J.length===0&&ae(O),J.push({type:l.REPETITION,min:0,max:1,value:J.pop()});break;case"+":J.length===0&&ae(O),J.push({type:l.REPETITION,min:1,max:1/0,value:J.pop()});break;case"*":J.length===0&&ae(O),J.push({type:l.REPETITION,min:0,max:1/0,value:J.pop()});break;default:J.push({type:l.CHAR,value:T.charCodeAt(0)})}return W.length!==0&&i.error(d,"Unterminated group"),$},t.exports.types=l}}),Ii=$e({"node_modules/drange/lib/index.js"(e,t){var i=class gt{constructor(f,d){this.low=f,this.high=d,this.length=1+d-f}overlaps(f){return!(this.high<f.low||this.low>f.high)}touches(f){return!(this.high+1<f.low||this.low-1>f.high)}add(f){return new gt(Math.min(this.low,f.low),Math.max(this.high,f.high))}subtract(f){return f.low<=this.low&&f.high>=this.high?[]:f.low>this.low&&f.high<this.high?[new gt(this.low,f.low-1),new gt(f.high+1,this.high)]:f.low<=this.low?[new gt(f.high+1,this.high)]:[new gt(this.low,f.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},l=class Mt{constructor(f,d){this.ranges=[],this.length=0,f!=null&&this.add(f,d)}_update_length(){this.length=this.ranges.reduce((f,d)=>f+d.length,0)}add(f,d){var O=D=>{for(var T=0;T<this.ranges.length&&!D.touches(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.touches(this.ranges[T]);)D=D.add(this.ranges[T]),T++;$.push(D),this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return f instanceof Mt?f.ranges.forEach(O):(d==null&&(d=f),O(new i(f,d))),this}subtract(f,d){var O=D=>{for(var T=0;T<this.ranges.length&&!D.overlaps(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.overlaps(this.ranges[T]);)$=$.concat(this.ranges[T].subtract(D)),T++;this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return f instanceof Mt?f.ranges.forEach(O):(d==null&&(d=f),O(new i(f,d))),this}intersect(f,d){var O=[],D=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 i(E,J)),$++}};return f instanceof Mt?f.ranges.forEach(D):(d==null&&(d=f),D(new i(f,d))),this.ranges=O,this._update_length(),this}index(f){for(var d=0;d<this.ranges.length&&this.ranges[d].length<=f;)f-=this.ranges[d].length,d++;return this.ranges[d].low+f}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Mt(this)}numbers(){return this.ranges.reduce((f,d)=>{for(var O=d.low;O<=d.high;)f.push(O),O++;return f},[])}subranges(){return this.ranges.map(f=>({low:f.low,high:f.high,length:1+f.high-f.low}))}};t.exports=l}}),Ni=$e({"node_modules/randexp/lib/randexp.js"(e,t){var i=xi(),l=Ii(),p=i.types;t.exports=class Lt{constructor(d,O){if(this._setDefaults(d),d instanceof RegExp)this.ignoreCase=d.ignoreCase,this.multiline=d.multiline,d=d.source;else if(typeof d=="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(d)}_setDefaults(d){this.max=d.max!=null?d.max:Lt.prototype.max!=null?Lt.prototype.max:100,this.defaultRange=d.defaultRange?d.defaultRange:this.defaultRange.clone(),d.randInt&&(this.randInt=d.randInt)}gen(){return this._gen(this.tokens,[])}_gen(d,O){var D,T,$,E,J;switch(d.type){case p.ROOT:case p.GROUP:if(d.followedBy||d.notFollowedBy)return"";for(d.remember&&d.groupNumber===void 0&&(d.groupNumber=O.push(null)-1),D=d.options?this._randSelect(d.options):d.stack,T="",E=0,J=D.length;E<J;E++)T+=this._gen(D[E],O);return d.remember&&(O[d.groupNumber]=T),T;case p.POSITION:return"";case p.SET:{var W=this._expand(d);return W.length?String.fromCharCode(this._randSelect(W)):""}case p.REPETITION:for($=this.randInt(d.min,d.max===1/0?d.min+this.max:d.max),T="",E=0;E<$;E++)T+=this._gen(d.value,O);return T;case p.REFERENCE:return O[d.value-1]||"";case p.CHAR:{var ae=this.ignoreCase&&this._randBool()?this._toOtherCase(d.value):d.value;return String.fromCharCode(ae)}}}_toOtherCase(d){return d+(97<=d&&d<=122?-32:65<=d&&d<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(d){return d instanceof l?d.index(this.randInt(0,d.length-1)):d[this.randInt(0,d.length-1)]}_expand(d){if(d.type===i.types.CHAR)return new l(d.value);if(d.type===i.types.RANGE)return new l(d.from,d.to);{let O=new l;for(let D=0;D<d.set.length;D++){let T=this._expand(d.set[D]);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 d.not?this.defaultRange.clone().subtract(O):this.defaultRange.clone().intersect(O)}}randInt(d,O){return d+Math.floor(Math.random()*(1+O-d))}get defaultRange(){return this._range=this._range||new l(32,126)}set defaultRange(d){this._range=d}static randexp(d,O){var D;return typeof d=="string"&&(d=new RegExp(d,O)),d._randexp===void 0?(D=new Lt(d,O),d._randexp=D):(D=d._randexp,D._setDefaults(d)),D.gen()}static sugar(){RegExp.prototype.gen=function(){return Lt.randexp(this)}}}}}),Tt=$e({"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"},l="tag:yaml.org,2002:",p={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function f(j){let w=[0],b=j.indexOf(`
1
+ "use strict";var Mo=Object.create;var Jt=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Uo=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var $o=(f,n)=>{for(var s in n)Jt(f,s,{get:n[s],enumerable:!0})},Tr=(f,n,s,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let S of Do(n))!Fo.call(f,S)&&S!==s&&Jt(f,S,{get:()=>n[S],enumerable:!(l=Lo(n,S))||l.enumerable});return f};var et=(f,n,s)=>(s=f!=null?Mo(Uo(f)):{},Tr(n||!f||!f.__esModule?Jt(s,"default",{value:f,enumerable:!0}):s,f)),jo=f=>Tr(Jt({},"__esModule",{value:!0}),f);var Ya={};$o(Ya,{Client:()=>wt,CronExpression:()=>ci,NovuRequestHandler:()=>kn,SeverityLevelEnum:()=>Fn,providerSchemas:()=>Mn,workflow:()=>As});module.exports=jo(Ya);var Gr=require("jsonrepair");var Rt=(l=>(l.TRIGGER="trigger",l.EXECUTE="execute",l.PREVIEW="preview",l))(Rt||{}),Gt=(l=>(l.DISCOVER="discover",l.HEALTH_CHECK="health-check",l.CODE="code",l))(Gt||{});var ci=(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))(ci||{});var We=(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))(We||{});var Kt=(l=>(l.POST="POST",l.GET="GET",l.OPTIONS="OPTIONS",l))(Kt||{});var Yo=f=>{var s,l;if(typeof f!="object"||f===null)return!1;let n=Object.getPrototypeOf(f);return(l=(s=n==null?void 0:n.constructor)==null?void 0:s.name.endsWith("Error"))!=null?l:!1},tt=class extends Error{},Ht=class extends tt{constructor(){super(...arguments);this.statusCode=404}},Ue=class extends tt{constructor(){super(...arguments);this.statusCode=400}},st=class extends tt{constructor(){super(...arguments);this.statusCode=401}},ot=class extends tt{constructor(n,{cause:s}={}){var l;Yo(s)?(super(`${n}: ${s.message}`),this.data={stack:(l=s.stack)!=null?l:n}):(super(`${n}${s?`: ${JSON.stringify(s,null,2)}`:""}`),this.data={stack:n})}},zt=class extends tt{constructor(){super(...arguments);this.statusCode=409}};var mt=class extends ot{constructor(s){super("Unknown BridgeError",{cause:s});this.statusCode=500;this.code="BridgeError"}};var Xt=class extends Ue{constructor(s,l){super(`Workflow with id: \`${s}\` has a corrupt state. Step with id: \`${l}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:s,stepId:l}}},xt=class extends Ue{constructor(s,l){super(`Workflow with id: \`${s}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=l}},Qt=class extends Ue{constructor(s,l){super(`Workflow with id: \`${s}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=l}},Zt=class extends Ue{constructor(s,l,S){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${l}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=S}},en=class extends Ue{constructor(s,l,S){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${l}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=S}},tn=class extends Ue{constructor(s,l,S){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${l}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=S}},nn=class extends Ue{constructor(s,l,S){super(`Workflow with id: \`${s}\` has invalid controls syntax in step with id: \`${l}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=S}},rn=class extends Ue{constructor(s,l,S,U){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${l}\` and provider with id: \`${S}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=U}},sn=class extends Ue{constructor(s,l){super(`Workflow with id: \`${s}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=l}};var lt=f=>Object.values(We).includes(f==null?void 0:f.code),Or=f=>!lt(f)&&typeof f.statusCode=="number"&&f.statusCode>=400&&f.statusCode<500;var pi=f=>Object.values(f).map(n=>`\`${n}\``).join(", "),on=f=>f.replaceAll(/(\w)(\w*)/g,(n,s,l)=>s.toUpperCase()+l.toLowerCase()).replaceAll(/[\s-]+/g,"");var an=class extends tt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${pi(Kt)}`}},It=class extends Ue{constructor(s,l){super(`Invalid query string: \`action\`=\`${s}\`. Please use one of ${pi(l)}`);this.code="InvalidActionError"}},ln=class extends Ue{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var cn=class extends Error{constructor(n,s,l){super(),this.data={message:l},this.statusCode=n,this.code=s}};var Nt=class extends zt{constructor(n,s){super(`${on(n)} with id: \`${s}\` already exists. Please use a different id.`)}},at=class extends Ht{constructor(n,s){super(`${on(n)} with id: \`${s}\` does not exist. Please provide a valid id.`)}},yt=class extends ot{constructor(s,l,S,U){super(`Failed to ${S} ${on(s)} with id: \`${l}\``,{cause:U});this.statusCode=502}};var pn=class extends at{constructor(s){super("provider",s);this.code="ProviderNotFoundError"}},un=class extends yt{constructor(s,l,S){super("provider",s,l,S);this.code="ProviderExecutionFailedError"}};var dn=class extends st{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"}},fn=class extends st{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},hn=class extends st{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},mn=class extends st{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},yn=class extends st{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var gn=class extends at{constructor(s){super("step",s);this.code="StepNotFoundError"}},wn=class extends Nt{constructor(s){super("step",s);this.code="StepAlreadyExistsError"}},kt=class extends yt{constructor(s,l,S){super("step",s,l,S);this.code="StepExecutionFailedError"}};var Ct=class extends at{constructor(s){super("workflow",s);this.code="WorkflowNotFoundError"}};var Sn=(()=>{var f=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,S=(e,t)=>function(){return e&&(t=(0,e[s(e)[0]])(e=0)),t},U=(e,t)=>function(){return t||(0,e[s(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var i in t)f(e,i,{get:t[i],enumerable:!0})},z=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of s(t))!l.call(e,p)&&p!==i&&f(e,p,{get:()=>t[p],enumerable:!(c=n(t,p))||c.enumerable});return e},ie=e=>z(f({},"__esModule",{value:!0}),e),Se={};C(Se,{JSONSchemaFaker:()=>Sr,default:()=>br,setDependencies:()=>Mi});function Ie(e,t){return typeof e=="string"?typeof t!="undefined"?Ot.register(e,t):Ot.get(e):Ot.registerMany(e)}function Ne(e,t){return e=typeof e=="undefined"?He.MIN_INTEGER:e,t=typeof t=="undefined"?He.MAX_INTEGER:t,Math.floor(te("random")()*(t-e+1))+e}function be(e){return $t.default.prototype.max=te("defaultRandExpMax"),$t.default.prototype.randInt=(i,c)=>i+Math.floor(te("random")()*(1+(c-i))),new $t.default(e).gen()}function ke(e){return e[Math.floor(te("random")()*e.length)]}function Fe(e){let t,i,c=e.length,p=e.slice();for(;c>0;)i=Math.floor(te("random")()*c),c-=1,t=p[c],p[c]=p[i],p[i]=t;return p}function it(e,t){return te("random")()*(t-e)+e}function Ge(e,t,i,c,p=!1){return i=typeof i=="undefined"?He.MIN_NUMBER:i,c=typeof c=="undefined"?He.MAX_NUMBER:c,e=typeof e=="undefined"?i:e,t=typeof t=="undefined"?c:t,t<e&&(t+=e),p?it(e,t):Ne(e,t)}function Dt(e){switch(e){case"seconds":return Ge(0,60)*60;case"minutes":return Ge(15,50)*612;case"hours":return Ge(12,72)*36123;case"days":return Ge(7,30)*86412345;case"weeks":return Ge(4,52)*604812345;case"months":return Ge(2,13)*2592012345;case"years":return Ge(1,20)*31104012345;default:break}}function jn(e){if(e)return Dt(e);let t=te("minDateTime"),i=te("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof i=="string"&&(i=new Date(i));let c=new Date().getTime();return typeof t=="number"&&(t=new Date(c+t)),typeof i=="number"&&(i=new Date(c+i)),new Date(it(t.getTime(),i.getTime()))}function hi(e,t,i){if(t=decodeURIComponent(t),i&&i[t])return ce(i[t]);let c=t.replace("#/","/").split("/"),p=e.$ref&&i&&i[e.$ref]||e;for(!p&&!c[0]&&(c[0]=e.$ref.split("#/")[0]),i&&t.includes("#/")&&i[c[0]]&&(p=i[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 Ut(e){return typeof e=="string"&&qi.test(e)}function Ke(e){return["number","boolean"].includes(typeof e)}function qe(e,...t){return t.filter(i=>typeof e[i]!="undefined").length>0}function mi(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i,c]=e.split("T")[0].split("-");return i=`0${Math.max(1,Math.min(12,i))}`.slice(-2),c=`0${Math.max(1,Math.min(31,c))}`.slice(-2),`${t}-${i}-${c}`}function vs(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i]=e.split("T"),[c,p,h]=t.split("-"),[d,O,D]=i.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),d=`0${Math.max(1,Math.min(23,d))}`.slice(-2),O=`0${Math.max(1,Math.min(59,O))}`.slice(-2),D=`0${Math.max(1,Math.min(59,D))}`.slice(-2),`${c}-${p}-${h}T${d}:${O}:${D}.000Z`}function Es(e,t,i){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),d=Math.min(c.maximum||1/0,1/0);t.exclusiveMinimum&&h===t.minimum&&(h+=t.multipleOf||1),t.exclusiveMaximum&&d===t.maximum&&(d-=t.multipleOf||1),(h||d!==1/0)&&(t.enum=t.enum.filter(O=>O>=h&&O<=d))}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=i(c);if(p==null)return null;switch(e||t.type){case"number":p=Ut(p)?parseFloat(p):p;break;case"integer":p=Ut(p)?parseInt(p,10):p;break;case"boolean":p=!!p;break;case"string":{if(Ke(p))return p;p=String(p);let h=Math.max(c.minLength||0,0),d=Math.min(c.maxLength||1/0,1/0),O,D=0;for(;p.length<h;)if(O=p,t.pattern?p+=Z.randexp(t.pattern):p+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${p}`,p===O){if(D+=1,D===3)break}else D=0;switch(p.length>d&&(p=p.substr(0,d)),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(mi(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 dt(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((c,p)=>{e.type==="array"&&t.type==="array"?e[i][p]=dt(e[i][p]||{},c,!0):Array.isArray(e[i])&&e[i].indexOf(c)===-1&&e[i].push(c)})):typeof e[i]!="object"||e[i]===null||Array.isArray(e[i])?e[i]=dt({},t[i]):e[i]=dt(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 c=[];return t.set(e,c),c.push(...e.map(p=>ce(p,t))),c}let i={};return t.set(e,i),Object.keys(e).reduce((c,p)=>(c[p]=ce(e[p],t),c),i)}function _s(e){let t=JSON.stringify(e),i=JSON.stringify(e,null,2);return t.length>400?`${i.substr(0,400)}...`:i}function yi(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Rs(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Ps(e,t){let i=dt({},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(He.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=yi();while(e.enum.indexOf(c)!==-1);i.enum=[c]}return e.required&&i.properties&&e.required.forEach(c=>{delete i.properties[c]}),i}function Yn(e,t){let i=t.minimum!==void 0,c=t.maximum!==void 0;return(i||c)&&(!i||e>=t.minimum)&&(!c||e<=t.maximum)}function xs(e,t){return!t.every(i=>Yn(e,i))}function Is(e,t){return t.reduce((c,p)=>c+(Yn(e,p)?1:0),0)===1}function Ns(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function ks(e,t){return Object.keys(e).filter(i=>!t.includes(i)).reduce((i,c)=>(Array.isArray(e[c])?i[c]=e[c].slice():i[c]=e[c]instanceof Object?dt({},e[c]):e[c],i),{})}function gi(e,t){return Array.isArray(e)?e.map(i=>gi(i,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(i,c)=>t[c])),e)}function Wn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function wi(e,t){t=t.items||t;let i=te("alwaysFakeOptionals"),c=Array.isArray(t.required)&&t.required.includes(e)||i,p=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!c&&!p}function Vn(e,t,i=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(c=>Vn(c,t,!0)).filter(c=>typeof c!="undefined");if(Object.keys(e).forEach(c=>{if(Wn(e[c]))wi(c,t)&&delete e[c];else{let p=t;t&&t.properties&&t.properties[c]&&(p=t.properties[c]);let h=Vn(e[c],p);Wn(h)||(e[c]=h)}typeof e[c]=="undefined"&&delete e[c]}),!(!Object.keys(e).length&&i))return e}function Cs(e){return(t,i,c,p)=>{let h=t,d=[];typeof t=="object"&&(h=Object.keys(t)[0],Array.isArray(t[h])?d=t[h]:d.push(t[h]));let O=h.split("."),D=e();for(;O.length>1;)D=D[O.shift()];return t=typeof D=="object"?D[O[0]]:D,typeof t=="function"&&(t=t.apply(D,d.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 Ms(e,t){if(typeof e=="undefined")return ht.list();if(typeof e=="string")if(typeof t=="function")ht.register(e,t);else if(t===null||t===!1)ht.unregister(e);else return ht.get(e);else ht.registerMany(e)}function Ls(e,t,i){return Object.keys(e).filter(c=>{let p=Ki.indexOf(t)>-1;return i.indexOf(c)>-1&&!p}).length>0}function Ds(e,t){let i=Object.keys(At);for(let c=0;c<i.length;c+=1){let p=i[c],h=t[t.length-1];if(Ls(e,h,At[p]))return p}}function Us(){return te("random")()>.5}function Fs(){return null}function $s(e,t,i,c,p,h){let d=[],O=[];function D($){let E=JSON.stringify($.value);return O.indexOf(E)===-1?(O.push(E),d.push($),!0):!1}t.forEach(D);let T=100;for(;d.length!==t.length&&(D(h(i.items||c,e,p))||(T-=1),!!T););return d}function js(e,t,i,c){let p=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new jt(`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,i)});let h=e.minItems,d=e.maxItems,O=te("minItems"),D=te("maxItems");O&&(h=typeof h=="undefined"?O:Math.min(O,h)),D&&(d=typeof d=="undefined"?D:Math.min(D,d),d&&d>D&&(d=D),h&&h>D&&(h=d));let T=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),$=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,E=Z.number(h,d,1,5);T!==null&&(E=Math.max($?Math.round((d||E)*T):Math.abs(Z.number(h,d)*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,i);p.push(Q)}if(e.contains&&E>0){let W=Z.number(0,E-1);p[W]=c(e.contains,t.concat(["items",W]),i)}return e.uniqueItems?$s(t.concat(["items"]),p,e,J,i,c):p}function Ys(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?He.MIN_INTEGER:e.minimum,i=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?He.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,d=p[1]||p[2].length,O=parseFloat(h.toFixed(d)),D=Z.number(t,i-1);return String(O).includes(".")?D+O:(D+O).toExponential()}if(c&&(i=Math.floor(i/c)*c,t=Math.ceil(t/c)*c),e.exclusiveMinimum&&t===e.minimum&&(t+=c||1),e.exclusiveMaximum&&i===e.maximum&&(i-=c||1),t>i)return NaN;if(c){let h=Z.number(Math.floor(t/c),Math.floor(i/c))*c;for(;h<t;)h+=c;return h}return Z.number(t,i,void 0,void 0,e.type!=="integer")}function Ws(e){return Math.floor(ri({...e}))}function Vs(e){return Z.shuffle(rr).slice(0,e)}function qs(e,t,i,c){let p={},h=e.properties||{},d=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),D=e.additionalProperties!==!1,T=Object.keys(h),$=Object.keys(d),E=T.concat($).reduce((Y,m)=>(O.indexOf(m)===-1&&Y.push(m),Y),[]),J=O.concat(E),W=D&&e.additionalProperties===!0?Wt:e.additionalProperties;if(!D&&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"]),i,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+(D?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 R=Z.shuffle(E).slice(0,b),x=E.filter(Y=>R.indexOf(Y)!==-1),M=ae!==null||O.length===j?j:Z.number(0,j),_=O.concat(Z.shuffle(x).slice(0,M)).slice(0,j),I=[],k=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(Y=>{let m=e.dependencies[Y];if(_.indexOf(Y)!==-1)if(Array.isArray(m))m.forEach(N=>{_.indexOf(N)===-1&&_.push(N)});else if(Array.isArray(m.oneOf||m.anyOf)){let N=m.oneOf||m.anyOf;k.push({prop:Y,values:N})}else I.push(m)}),I.length))return delete e.dependencies,c({allOf:I.concat(e)},t.concat(["properties"]),i,e);let V=[],G=[];_.forEach(Y=>{if(h[Y]&&["{}","true"].includes(JSON.stringify(h[Y].not)))return;for(let N=0;N<ne.length;N+=1)if(ne[N]instanceof RegExp&&ne[N].test(Y)||typeof ne[N]=="string"&&ne[N]===Y||typeof ne[N]=="function"&&ne[N](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(N=>{Y.match(new RegExp(N))&&(m=!0,p[Y]?de.merge(p[Y],d[N]):p[Z.randexp(Y)]=d[N])}),!m){let N=d[Y]||W;N&&W!==!1?p[d[Y]?Z.randexp(Y):Y]=h[Y]||N: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=w;if(D&&!O.length&&(_e=Math.max(ae===null||W?Z.number(ye?1:0,j):0,w)),!x.length&&!b&&D&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)p[Yt(1)+Ae(Y[m])]=W||Wt}for(;ye&&!(!($.length||D)||ee>=_e);){if(D)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]=d[Y],ee+=1)}else{let Y=ve(O)||Yt(1)+Ae();p[Y]||(p[Y]=W||Wt,ee+=1)}for(let Y=0;ee<w&&Y<$.length;Y+=1){let m=$[Y],N=Z.randexp(m);p[N]||(p[N]=d[m],ee+=1)}}if(O.length===0&&(!D||ae===!1)){let Y=Z.number(w,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((N,K)=>te("sortProperties")?N.localeCompare(K):Y.indexOf(N)-Y.indexOf(K)).reduce((N,K)=>(N[K]=p[K],N),{})}let Ce=c(Pe,t.concat(["properties"]),i,e);return k.forEach(Y=>{for(let m of Y.values)if(de.hasValue(m.properties[Y.prop],Ce.value[Y.prop])){Object.keys(m.properties).forEach(N=>{N!==Y.prop&&de.merge(Ce.value,c(m.properties,t.concat(["properties"]),i,e).value)});break}}),Ce}function Si(){let e=Z.number(1,5);return Yt(e).join(" ")}function Bs(e=0,t=140){let i=Math.max(0,e),c=Z.number(i,t),p=Si();for(;p.length<i;)p+=Si();return p.length>c&&(p=p.substr(0,c)),p}function Js(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function Gs(){return Z.date().toISOString()}function Ks(){return Vt().slice(0,10)}function Hs(){return Vt().slice(11)}function zs(e){return Z.randexp(je[e]).replace(pr,(t,i)=>Z.randexp(je[i]))}function Xs(e,t){let i=ii(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return Vt();case"date":return ar();case"time":return lr();case"ipv4":return or();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 ur(e.format);default:if(typeof i=="undefined"){if(te("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function Qs(e){return de.typecast("string",e,i=>e.format?Xs(e,()=>si(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):si(i.minLength,i.maxLength))}function Zs({$comment:e,title:t,description:i}){return Object.entries({comment:e,title:t,description:i}).filter(([,c])=>c).reduce((c,[p,h])=>(c[p]=h,c),{})}function ft(e,t,i,c){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(c)}'`);let p={...Zs(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:$}=ft(e,t.concat(["not"]),i,c);return{value:de.clean(T,e,!1),context:{...p,items:$}}}if(typeof e.thunk=="function"){let{value:T,context:$}=ft(e.thunk(c),t,i);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=Hi(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(vt[h])try{let T=vt[h](e,t,i,ft);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 jt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new jt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&vt[T]?{value:vt[T](e,t,i,ft),context:p}:{value:T,context:p}}}let d={},O={...p};Array.isArray(e)&&(d=[]);let D=te("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!D.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:E}=ft(e[T],t.concat([T]),i,d);d[T]=de.clean($,e[T],!1),O[T]=E,d[T]===null&&te("omitNulls")&&(delete d[T],delete O[T])}else d[T]=e[T]}),{value:d,context:O}}function eo(e){return Array.isArray(e)?Z.pick(e):e}function to(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 qn(e,t,i,c){if(!e||typeof e!="object")return e;if(i||(i={}),t||(t=e),Array.isArray(e))return e.map(p=>qn(p,t,i,c));if(e.jsonPath){let{JSONPath:p}=Qn(),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 d=`${h.group}__${h.path}`;return i[d]||(h.count>1?i[d]=p(h.path,t).slice(0,h.count):i[d]=p(h.path,t)),h.cycle||h.reverse?to(i[d],h.reverse):eo(i[d])}return Object.keys(e).forEach(p=>{e[p]=qn(e[p],t,i,p)}),e}function no(e,t,i,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:d}=yr({refs:e,schema:t,container:i,synchronous:c,refDepthMin:p,refDepthMax:h}),O=hr(de.clone(t),[],d);return te("resolveJsonPath")?{value:qn(O.value),context:O.context}:O}catch(d){throw d.path?new Error(`${d.message} in /${d.path.join("/")}`):d}}function io(e){return e.value}function ro(e,t){return t.reduce((i,c)=>c in i?i[c]:{},e)}function Bn(e,t,i,c=i){let{title:p,description:h,comment:d}=ro(e,t),O=[];te("renderTitle")&&p&&O.push(` ${p}`,""),te("renderDescription")&&h&&O.push(` ${h}`),te("renderComment")&&d&&O.push(` ${d}`),i.commentBefore=O.join(`
2
+ `),c instanceof gr?c.items.forEach(D=>{Bn(e,[...t,"items",D.key.value],D.key,D.value)}):c instanceof wr&&c.items.forEach((D,T)=>{Bn(e,[...t,"items",T],D)})}function so({value:e,context:t}){let i=Et.createNode(e);Bn(t,[],i);let c=new Et.Document;return c.contents=i,c.toString()}function bi(){Xe.define("autoIncrement",function(t,i){if(!this.offset){let c=i.minimum||1,p=c+He.MAX_NUMBER,h=t.initialOffset||i.initialOffset;this.offset=h||Z.number(c,p)}return t?this.offset++:i}),Xe.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 Ti(e,t){let i={};Array.isArray(e)?e.forEach(p=>{i[p.$id||p.id]=p}):i=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"&&!i[h]&&(i[h]=p),Object.keys(p).forEach(d=>{c(p[d])})}return c(e),c(t),i}var Oi,Jn,Ai,Gn,vi,Ei,$e,_i,Kn,F,Hn,Ri,Pi,xi,Ii,Ni,Tt,Ft,zn,ki,Ci,Xn,Qn,Mi,Li,Zn,ue,ei,Di,Ui,Ot,te,ti,ni,Fi,$i,ji,Yi,Wi,Vi,He,$t,Z,qi,de,Bi,Ji,ht,ii,Gi,jt,At,Ki,Hi,zi,Xi,Qi,Zi,er,tr,nr,ri,ir,rr,Yt,Wt,sr,si,or,Vt,ar,lr,oi,qt,cr,je,pr,ur,dr,fr,vt,hr,mr,yr,ai,li,Le,oo,ao,lo,co,po,uo,fo,ho,mo,yo,go,wo,gr,wr,Et,Xe,Oe,Sr,br,So=S({"src/shared.js"(){Oi=Object.create,Jn=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,Gn=Object.getOwnPropertyNames,vi=Object.getPrototypeOf,Ei=Object.prototype.hasOwnProperty,$e=(e,t)=>function(){return t||(0,e[Gn(e)[0]])((t={exports:{}}).exports,t),t.exports},_i=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of Gn(t))!Ei.call(e,p)&&p!==i&&Jn(e,p,{get:()=>t[p],enumerable:!(c=Ai(t,p))||c.enumerable});return e},Kn=(e,t,i)=>(i=e!=null?Oi(vi(e)):{},_i(t||!e||!e.__esModule?Jn(i,"default",{value:e,enumerable:!0}):i,e)),F=$e({"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}}}),Hn=$e({"node_modules/ret/lib/sets.js"(e){var t=F(),i=()=>[{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(i()),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:i(),not:!1}),e.notInts=()=>({type:t.SET,set:i(),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})}}),Ri=$e({"node_modules/ret/lib/util.js"(e){var t=F(),i=Hn(),c="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",p={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=h=>{var d=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return h=h.replace(d,(O,D,T,$,E,J,W,ae)=>{if(T)return O;var Q=D?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,d)=>{for(var O=[],D=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,T,$;(T=D.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,D.lastIndex];e.error(d,"Unterminated character class")},e.error=(h,d)=>{throw new SyntaxError("Invalid regular expression: /"+h+"/: "+d)}}}),Pi=$e({"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:"$"})}}),xi=$e({"node_modules/ret/lib/index.js"(e,t){var i=Ri(),c=F(),p=Hn(),h=Pi();t.exports=d=>{var O=0,D,T,$={type:c.ROOT,stack:[]},E=$,J=$.stack,W=[],ae=x=>{i.error(d,`Nothing to repeat at column ${x-1}`)},Q=i.strToChars(d);for(D=Q.length;O<D;)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=i.tokenizeClass(Q.slice(O),d);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!==":"&&i.error(d,`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&&i.error(d,`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 w=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,R;w!==null?(J.length===0&&ae(O),b=parseInt(w[1],10),R=w[2]?w[3]?parseInt(w[3],10):1/0:b,O+=w[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&&i.error(d,"Unterminated group"),$},t.exports.types=c}}),Ii=$e({"node_modules/drange/lib/index.js"(e,t){var i=class gt{constructor(h,d){this.low=h,this.high=d,this.length=1+d-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 gt(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 gt(this.low,h.low-1),new gt(h.high+1,this.high)]:h.low<=this.low?[new gt(h.high+1,this.high)]:[new gt(this.low,h.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},c=class Mt{constructor(h,d){this.ranges=[],this.length=0,h!=null&&this.add(h,d)}_update_length(){this.length=this.ranges.reduce((h,d)=>h+d.length,0)}add(h,d){var O=D=>{for(var T=0;T<this.ranges.length&&!D.touches(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.touches(this.ranges[T]);)D=D.add(this.ranges[T]),T++;$.push(D),this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Mt?h.ranges.forEach(O):(d==null&&(d=h),O(new i(h,d))),this}subtract(h,d){var O=D=>{for(var T=0;T<this.ranges.length&&!D.overlaps(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.overlaps(this.ranges[T]);)$=$.concat(this.ranges[T].subtract(D)),T++;this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Mt?h.ranges.forEach(O):(d==null&&(d=h),O(new i(h,d))),this}intersect(h,d){var O=[],D=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 i(E,J)),$++}};return h instanceof Mt?h.ranges.forEach(D):(d==null&&(d=h),D(new i(h,d))),this.ranges=O,this._update_length(),this}index(h){for(var d=0;d<this.ranges.length&&this.ranges[d].length<=h;)h-=this.ranges[d].length,d++;return this.ranges[d].low+h}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Mt(this)}numbers(){return this.ranges.reduce((h,d)=>{for(var O=d.low;O<=d.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}}),Ni=$e({"node_modules/randexp/lib/randexp.js"(e,t){var i=xi(),c=Ii(),p=i.types;t.exports=class Lt{constructor(d,O){if(this._setDefaults(d),d instanceof RegExp)this.ignoreCase=d.ignoreCase,this.multiline=d.multiline,d=d.source;else if(typeof d=="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(d)}_setDefaults(d){this.max=d.max!=null?d.max:Lt.prototype.max!=null?Lt.prototype.max:100,this.defaultRange=d.defaultRange?d.defaultRange:this.defaultRange.clone(),d.randInt&&(this.randInt=d.randInt)}gen(){return this._gen(this.tokens,[])}_gen(d,O){var D,T,$,E,J;switch(d.type){case p.ROOT:case p.GROUP:if(d.followedBy||d.notFollowedBy)return"";for(d.remember&&d.groupNumber===void 0&&(d.groupNumber=O.push(null)-1),D=d.options?this._randSelect(d.options):d.stack,T="",E=0,J=D.length;E<J;E++)T+=this._gen(D[E],O);return d.remember&&(O[d.groupNumber]=T),T;case p.POSITION:return"";case p.SET:{var W=this._expand(d);return W.length?String.fromCharCode(this._randSelect(W)):""}case p.REPETITION:for($=this.randInt(d.min,d.max===1/0?d.min+this.max:d.max),T="",E=0;E<$;E++)T+=this._gen(d.value,O);return T;case p.REFERENCE:return O[d.value-1]||"";case p.CHAR:{var ae=this.ignoreCase&&this._randBool()?this._toOtherCase(d.value):d.value;return String.fromCharCode(ae)}}}_toOtherCase(d){return d+(97<=d&&d<=122?-32:65<=d&&d<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(d){return d instanceof c?d.index(this.randInt(0,d.length-1)):d[this.randInt(0,d.length-1)]}_expand(d){if(d.type===i.types.CHAR)return new c(d.value);if(d.type===i.types.RANGE)return new c(d.from,d.to);{let O=new c;for(let D=0;D<d.set.length;D++){let T=this._expand(d.set[D]);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 d.not?this.defaultRange.clone().subtract(O):this.defaultRange.clone().intersect(O)}}randInt(d,O){return d+Math.floor(Math.random()*(1+O-d))}get defaultRange(){return this._range=this._range||new c(32,126)}set defaultRange(d){this._range=d}static randexp(d,O){var D;return typeof d=="string"&&(d=new RegExp(d,O)),d._randexp===void 0?(D=new Lt(d,O),d._randexp=D):(D=d._randexp,D._setDefaults(d)),D.gen()}static sugar(){RegExp.prototype.gen=function(){return Lt.randexp(this)}}}}}),Tt=$e({"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"},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 w=[0],b=j.indexOf(`
3
3
  `);for(;b!==-1;)b+=1,w.push(b),b=j.indexOf(`
4
- `,b);return w}function d(j){let w,b;return typeof j=="string"?(w=f(j),b=j):(Array.isArray(j)&&(j=j[0]),j&&j.context&&(j.lineStarts||(j.lineStarts=f(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:R}=d(w);if(!b||!R||j>R.length)return null;for(let M=0;M<b.length;++M){let _=b[M];if(j<_)return{line:M,col:j-b[M-1]+1};if(j===_)return{line:M+1,col:1}}let x=b.length;return{line:x,col:j-b[x-1]+1}}function D(j,w){let{lineStarts:b,src:R}=d(w);if(!b||!(j>=1)||j>b.length)return null;let x=b[j-1],M=b[j];for(;M&&M>x&&R[M-1]===`
4
+ `,b);return w}function d(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:R}=d(w);if(!b||!R||j>R.length)return null;for(let M=0;M<b.length;++M){let _=b[M];if(j<_)return{line:M,col:j-b[M-1]+1};if(j===_)return{line:M+1,col:1}}let x=b.length;return{line:x,col:j-b[x-1]+1}}function D(j,w){let{lineStarts:b,src:R}=d(w);if(!b||!(j>=1)||j>b.length)return null;let x=b[j-1],M=b[j];for(;M&&M>x&&R[M-1]===`
5
5
  `;)--M;return R.slice(x,M)}function T({start:j,end:w},b,R=80){let x=D(j.line,b);if(!x)return null;let{col:M}=j;if(x.length>R)if(M<=R-10)x=x.substr(0,R-1)+"\u2026";else{let G=Math.round(R/2);x.length>M+G&&(x=x.substr(0,M+G-1)+"\u2026"),M-=x.length-R,x="\u2026"+x.substr(1-R)}let _=1,I="";w&&(w.line===j.line&&M+(w.col-j.col)<=R+1?_=w.col-j.col:(_=Math.min(x.length+1,R)-M,I="\u2026"));let k=M>1?" ".repeat(M-1):"",V="^".repeat(_);return`${x}
6
6
  ${k}${V}${I}`}var $=class vr{static copy(w){return new vr(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:R,end:x}=this;if(w.length===0||x<=w[0])return this.origStart=R,this.origEnd=x,b;let M=b;for(;M<w.length&&!(w[M]>R);)++M;this.origStart=R+M;let _=M;for(;M<w.length&&!(w[M]>=x);)++M;return this.origEnd=x+M,_}},E=class nt{static addStringTerminator(w,b,R){if(R[R.length-1]===`
7
7
  `)return R;let x=nt.endOfWhiteSpace(w,b);return x>=w.length||w[x]===`
@@ -33,46 +33,46 @@ ${R}
33
33
  `&&(M+=I>V?R.slice(V,I+1):k)}else M+=k}let _=R[w];switch(_){case" ":{let I="Plain value cannot start with a tab character";return{errors:[new ae(this,I)],str:M}}case"@":case"`":{let I=`Plain value cannot start with reserved character ${_}`;return{errors:[new ae(this,I)],str:M}}default:return M}}parseBlockValue(w){let{indent:b,inFlow:R,src:x}=this.context,M=w,_=w;for(let I=x[M];I===`
34
34
  `&&!E.atDocumentBoundary(x,M+1);I=x[M]){let k=E.endOfBlockIndent(x,b,M+1);if(k===null||x[k]==="#")break;x[k]===`
35
35
  `?M=k:(_=ui.endOfLine(x,k,R),M=_)}return this.valueRange.isEmpty()&&(this.valueRange.start=w),this.valueRange.end=_,_}parse(w,b){this.context=w;let{inFlow:R,src:x}=w,M=b,_=x[M];return _&&_!=="#"&&_!==`
36
- `&&(M=ui.endOfLine(x,b,R)),this.valueRange=new $(b,M),M=E.endOfWhiteSpace(x,M),M=this.parseComment(M),(!this.hasComment||this.valueRange.isEmpty())&&(M=this.parseBlockValue(M)),M}};e.Char=t,e.Node=E,e.PlainValue=ye,e.Range=$,e.Type=i,e.YAMLError=J,e.YAMLReferenceError=W,e.YAMLSemanticError=ae,e.YAMLSyntaxError=Q,e.YAMLWarning=ne,e._defineProperty=he,e.defaultTagPrefix=l,e.defaultTags=p}}),Ft=$e({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(e){var t=Tt();function i(o,r,a){return a?`#${a.replace(/[\s\S]^/gm,`$&${r}#`)}
37
- ${r}${o}`:o}function l(o,r,a){return a?a.indexOf(`
36
+ `&&(M=ui.endOfLine(x,b,R)),this.valueRange=new $(b,M),M=E.endOfWhiteSpace(x,M),M=this.parseComment(M),(!this.hasComment||this.valueRange.isEmpty())&&(M=this.parseBlockValue(M)),M}};e.Char=t,e.Node=E,e.PlainValue=ye,e.Range=$,e.Type=i,e.YAMLError=J,e.YAMLReferenceError=W,e.YAMLSemanticError=ae,e.YAMLSyntaxError=Q,e.YAMLWarning=ne,e._defineProperty=he,e.defaultTagPrefix=c,e.defaultTags=p}}),Ft=$e({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(e){var t=Tt();function i(o,r,a){return a?`#${a.replace(/[\s\S]^/gm,`$&${r}#`)}
37
+ ${r}${o}`:o}function c(o,r,a){return a?a.indexOf(`
38
38
  `)===-1?`${o} #${a}`:`${o}
39
- `+a.replace(/^/gm,`${r||""}#`):o}var p=class{};function f(o,r,a){if(Array.isArray(o))return o.map((u,y)=>f(u,String(y),a));if(o&&typeof o.toJSON=="function"){let u=a&&a.anchors&&a.anchors.get(o);u&&(a.onCreate=g=>{u.res=g,delete a.onCreate});let y=o.toJSON(r,a);return u&&a.onCreate&&a.onCreate(y),y}return(!a||!a.keep)&&typeof o=="bigint"?Number(o):o}var d=class extends p{constructor(o){super(),this.value=o}toJSON(o,r){return r&&r.keep?this.value:f(this.value,o,r)}toString(){return String(this.value)}};function O(o,r,a){let u=a;for(let y=r.length-1;y>=0;--y){let g=r[y];if(Number.isInteger(g)&&g>=0){let A=[];A[g]=u,u=A}else{let A={};Object.defineProperty(A,g,{value:u,writable:!0,enumerable:!0,configurable:!0}),u=A}}return o.createNode(u,!1)}var D=o=>o==null||typeof o=="object"&&o[Symbol.iterator]().next().done,T=class ct extends p{constructor(r){super(),t._defineProperty(this,"items",[]),this.schema=r}addIn(r,a){if(D(r))this.add(a);else{let[u,...y]=r,g=this.get(u,!0);if(g instanceof ct)g.addIn(y,a);else if(g===void 0&&this.schema)this.set(u,O(this.schema,y,a));else throw new Error(`Expected YAML collection at ${u}. Remaining path: ${y}`)}}deleteIn([r,...a]){if(a.length===0)return this.delete(r);let u=this.get(r,!0);if(u instanceof ct)return u.deleteIn(a);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}getIn([r,...a],u){let y=this.get(r,!0);return a.length===0?!u&&y instanceof d?y.value:y:y instanceof ct?y.getIn(a,u):void 0}hasAllNullValues(){return this.items.every(r=>{if(!r||r.type!=="PAIR")return!1;let a=r.value;return a==null||a instanceof d&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn([r,...a]){if(a.length===0)return this.has(r);let u=this.get(r,!0);return u instanceof ct?u.hasIn(a):!1}setIn([r,...a],u){if(a.length===0)this.set(r,u);else{let y=this.get(r,!0);if(y instanceof ct)y.setIn(a,u);else if(y===void 0&&this.schema)this.set(r,O(this.schema,a,u));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}toJSON(){return null}toString(r,{blockItem:a,flowChars:u,isMap:y,itemIndent:g},A,v){let{indent:P,indentStep:L,stringify:q}=r,X=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||r.inFlow;X&&(g+=L);let be=y&&this.hasAllNullValues();r=Object.assign({},r,{allNullValues:be,indent:g,inFlow:X,type:null});let se=!1,ge=!1,oe=this.items.reduce((xe,pe,Ee)=>{let fe;pe&&(!se&&pe.spaceBefore&&xe.push({type:"comment",str:""}),pe.commentBefore&&pe.commentBefore.match(/^.*$/gm).forEach(Co=>{xe.push({type:"comment",str:`#${Co}`})}),pe.comment&&(fe=pe.comment),X&&(!se&&pe.spaceBefore||pe.commentBefore||pe.comment||pe.key&&(pe.key.commentBefore||pe.key.comment)||pe.value&&(pe.value.commentBefore||pe.value.comment))&&(ge=!0)),se=!1;let De=q(pe,r,()=>fe=null,()=>se=!0);return X&&!ge&&De.includes(`
40
- `)&&(ge=!0),X&&Ee<this.items.length-1&&(De+=","),De=l(De,g,fe),se&&(fe||X)&&(se=!1),xe.push({type:"item",str:De}),xe},[]),me;if(oe.length===0)me=u.start+u.end;else if(X){let{start:xe,end:pe}=u,Ee=oe.map(fe=>fe.str);if(ge||Ee.reduce((fe,De)=>fe+De.length+2,2)>ct.maxFlowStringSingleLineLength){me=xe;for(let fe of Ee)me+=fe?`
39
+ `+a.replace(/^/gm,`${r||""}#`):o}var p=class{};function h(o,r,a){if(Array.isArray(o))return o.map((u,y)=>h(u,String(y),a));if(o&&typeof o.toJSON=="function"){let u=a&&a.anchors&&a.anchors.get(o);u&&(a.onCreate=g=>{u.res=g,delete a.onCreate});let y=o.toJSON(r,a);return u&&a.onCreate&&a.onCreate(y),y}return(!a||!a.keep)&&typeof o=="bigint"?Number(o):o}var d=class extends p{constructor(o){super(),this.value=o}toJSON(o,r){return r&&r.keep?this.value:h(this.value,o,r)}toString(){return String(this.value)}};function O(o,r,a){let u=a;for(let y=r.length-1;y>=0;--y){let g=r[y];if(Number.isInteger(g)&&g>=0){let A=[];A[g]=u,u=A}else{let A={};Object.defineProperty(A,g,{value:u,writable:!0,enumerable:!0,configurable:!0}),u=A}}return o.createNode(u,!1)}var D=o=>o==null||typeof o=="object"&&o[Symbol.iterator]().next().done,T=class ct extends p{constructor(r){super(),t._defineProperty(this,"items",[]),this.schema=r}addIn(r,a){if(D(r))this.add(a);else{let[u,...y]=r,g=this.get(u,!0);if(g instanceof ct)g.addIn(y,a);else if(g===void 0&&this.schema)this.set(u,O(this.schema,y,a));else throw new Error(`Expected YAML collection at ${u}. Remaining path: ${y}`)}}deleteIn([r,...a]){if(a.length===0)return this.delete(r);let u=this.get(r,!0);if(u instanceof ct)return u.deleteIn(a);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}getIn([r,...a],u){let y=this.get(r,!0);return a.length===0?!u&&y instanceof d?y.value:y:y instanceof ct?y.getIn(a,u):void 0}hasAllNullValues(){return this.items.every(r=>{if(!r||r.type!=="PAIR")return!1;let a=r.value;return a==null||a instanceof d&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn([r,...a]){if(a.length===0)return this.has(r);let u=this.get(r,!0);return u instanceof ct?u.hasIn(a):!1}setIn([r,...a],u){if(a.length===0)this.set(r,u);else{let y=this.get(r,!0);if(y instanceof ct)y.setIn(a,u);else if(y===void 0&&this.schema)this.set(r,O(this.schema,a,u));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}toJSON(){return null}toString(r,{blockItem:a,flowChars:u,isMap:y,itemIndent:g},A,v){let{indent:P,indentStep:L,stringify:q}=r,X=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||r.inFlow;X&&(g+=L);let Te=y&&this.hasAllNullValues();r=Object.assign({},r,{allNullValues:Te,indent:g,inFlow:X,type:null});let se=!1,ge=!1,oe=this.items.reduce((xe,pe,Ee)=>{let fe;pe&&(!se&&pe.spaceBefore&&xe.push({type:"comment",str:""}),pe.commentBefore&&pe.commentBefore.match(/^.*$/gm).forEach(Co=>{xe.push({type:"comment",str:`#${Co}`})}),pe.comment&&(fe=pe.comment),X&&(!se&&pe.spaceBefore||pe.commentBefore||pe.comment||pe.key&&(pe.key.commentBefore||pe.key.comment)||pe.value&&(pe.value.commentBefore||pe.value.comment))&&(ge=!0)),se=!1;let De=q(pe,r,()=>fe=null,()=>se=!0);return X&&!ge&&De.includes(`
40
+ `)&&(ge=!0),X&&Ee<this.items.length-1&&(De+=","),De=c(De,g,fe),se&&(fe||X)&&(se=!1),xe.push({type:"item",str:De}),xe},[]),me;if(oe.length===0)me=u.start+u.end;else if(X){let{start:xe,end:pe}=u,Ee=oe.map(fe=>fe.str);if(ge||Ee.reduce((fe,De)=>fe+De.length+2,2)>ct.maxFlowStringSingleLineLength){me=xe;for(let fe of Ee)me+=fe?`
41
41
  ${L}${P}${fe}`:`
42
42
  `;me+=`
43
43
  ${P}${pe}`}else me=`${xe} ${Ee.join(" ")} ${pe}`}else{let xe=oe.map(a);me=xe.shift();for(let pe of xe)me+=pe?`
44
44
  ${P}${pe}`:`
45
45
  `}return this.comment?(me+=`
46
- `+this.comment.replace(/^/gm,`${P}#`),A&&A()):se&&v&&v(),me}};t._defineProperty(T,"maxFlowStringSingleLineLength",60);function $(o){let r=o instanceof d?o.value:o;return r&&typeof r=="string"&&(r=Number(r)),Number.isInteger(r)&&r>=0?r:null}var E=class extends T{add(o){this.items.push(o)}delete(o){let r=$(o);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(o,r){let a=$(o);if(typeof a!="number")return;let u=this.items[a];return!r&&u instanceof d?u.value:u}has(o){let r=$(o);return typeof r=="number"&&r<this.items.length}set(o,r){let a=$(o);if(typeof a!="number")throw new Error(`Expected a valid index, not ${o}.`);this.items[a]=r}toJSON(o,r){let a=[];r&&r.onCreate&&r.onCreate(a);let u=0;for(let y of this.items)a.push(f(y,String(u++),r));return a}toString(o,r,a){return o?super.toString(o,{blockItem:u=>u.type==="comment"?u.str:`- ${u.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(o.indent||"")+" "},r,a):JSON.stringify(this)}},J=(o,r,a)=>r===null?"":typeof r!="object"?String(r):o instanceof p&&a&&a.doc?o.toString({anchors:Object.create(null),doc:a.doc,indent:"",indentStep:a.indentStep,inFlow:!0,inStringifyKey:!0,stringify:a.stringify}):JSON.stringify(r),W=class Er extends p{constructor(r,a=null){super(),this.key=r,this.value=a,this.type=Er.Type.PAIR}get commentBefore(){return this.key instanceof p?this.key.commentBefore:void 0}set commentBefore(r){if(this.key==null&&(this.key=new d(null)),this.key instanceof p)this.key.commentBefore=r;else{let a="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(a)}}addToJSMap(r,a){let u=f(this.key,"",r);if(a instanceof Map){let y=f(this.value,u,r);a.set(u,y)}else if(a instanceof Set)a.add(u);else{let y=J(this.key,u,r),g=f(this.value,y,r);y in a?Object.defineProperty(a,y,{value:g,writable:!0,enumerable:!0,configurable:!0}):a[y]=g}return a}toJSON(r,a){let u=a&&a.mapAsMap?new Map:{};return this.addToJSMap(a,u)}toString(r,a,u){if(!r||!r.doc)return JSON.stringify(this);let{indent:y,indentSeq:g,simpleKeys:A}=r.doc.options,{key:v,value:P}=this,L=v instanceof p&&v.comment;if(A){if(L)throw new Error("With simple keys, key nodes cannot have comments");if(v instanceof T){let De="With simple keys, collection cannot be used as a key value";throw new Error(De)}}let q=!A&&(!v||L||(v instanceof p?v instanceof T||v.type===t.Type.BLOCK_FOLDED||v.type===t.Type.BLOCK_LITERAL:typeof v=="object")),{doc:X,indent:be,indentStep:se,stringify:ge}=r;r=Object.assign({},r,{implicitKey:!q,indent:be+se});let oe=!1,me=ge(v,r,()=>L=null,()=>oe=!0);if(me=l(me,r.indent,L),!q&&me.length>1024){if(A)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");q=!0}if(r.allNullValues&&!A)return this.comment?(me=l(me,r.indent,this.comment),a&&a()):oe&&!L&&u&&u(),r.inFlow&&!q?me:`? ${me}`;me=q?`? ${me}
47
- ${be}:`:`${me}:`,this.comment&&(me=l(me,r.indent,this.comment),a&&a());let xe="",pe=null;if(P instanceof p){if(P.spaceBefore&&(xe=`
46
+ `+this.comment.replace(/^/gm,`${P}#`),A&&A()):se&&v&&v(),me}};t._defineProperty(T,"maxFlowStringSingleLineLength",60);function $(o){let r=o instanceof d?o.value:o;return r&&typeof r=="string"&&(r=Number(r)),Number.isInteger(r)&&r>=0?r:null}var E=class extends T{add(o){this.items.push(o)}delete(o){let r=$(o);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(o,r){let a=$(o);if(typeof a!="number")return;let u=this.items[a];return!r&&u instanceof d?u.value:u}has(o){let r=$(o);return typeof r=="number"&&r<this.items.length}set(o,r){let a=$(o);if(typeof a!="number")throw new Error(`Expected a valid index, not ${o}.`);this.items[a]=r}toJSON(o,r){let a=[];r&&r.onCreate&&r.onCreate(a);let u=0;for(let y of this.items)a.push(h(y,String(u++),r));return a}toString(o,r,a){return o?super.toString(o,{blockItem:u=>u.type==="comment"?u.str:`- ${u.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(o.indent||"")+" "},r,a):JSON.stringify(this)}},J=(o,r,a)=>r===null?"":typeof r!="object"?String(r):o instanceof p&&a&&a.doc?o.toString({anchors:Object.create(null),doc:a.doc,indent:"",indentStep:a.indentStep,inFlow:!0,inStringifyKey:!0,stringify:a.stringify}):JSON.stringify(r),W=class Er extends p{constructor(r,a=null){super(),this.key=r,this.value=a,this.type=Er.Type.PAIR}get commentBefore(){return this.key instanceof p?this.key.commentBefore:void 0}set commentBefore(r){if(this.key==null&&(this.key=new d(null)),this.key instanceof p)this.key.commentBefore=r;else{let a="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(a)}}addToJSMap(r,a){let u=h(this.key,"",r);if(a instanceof Map){let y=h(this.value,u,r);a.set(u,y)}else if(a instanceof Set)a.add(u);else{let y=J(this.key,u,r),g=h(this.value,y,r);y in a?Object.defineProperty(a,y,{value:g,writable:!0,enumerable:!0,configurable:!0}):a[y]=g}return a}toJSON(r,a){let u=a&&a.mapAsMap?new Map:{};return this.addToJSMap(a,u)}toString(r,a,u){if(!r||!r.doc)return JSON.stringify(this);let{indent:y,indentSeq:g,simpleKeys:A}=r.doc.options,{key:v,value:P}=this,L=v instanceof p&&v.comment;if(A){if(L)throw new Error("With simple keys, key nodes cannot have comments");if(v instanceof T){let De="With simple keys, collection cannot be used as a key value";throw new Error(De)}}let q=!A&&(!v||L||(v instanceof p?v instanceof T||v.type===t.Type.BLOCK_FOLDED||v.type===t.Type.BLOCK_LITERAL:typeof v=="object")),{doc:X,indent:Te,indentStep:se,stringify:ge}=r;r=Object.assign({},r,{implicitKey:!q,indent:Te+se});let oe=!1,me=ge(v,r,()=>L=null,()=>oe=!0);if(me=c(me,r.indent,L),!q&&me.length>1024){if(A)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");q=!0}if(r.allNullValues&&!A)return this.comment?(me=c(me,r.indent,this.comment),a&&a()):oe&&!L&&u&&u(),r.inFlow&&!q?me:`? ${me}`;me=q?`? ${me}
47
+ ${Te}:`:`${me}:`,this.comment&&(me=c(me,r.indent,this.comment),a&&a());let xe="",pe=null;if(P instanceof p){if(P.spaceBefore&&(xe=`
48
48
  `),P.commentBefore){let De=P.commentBefore.replace(/^/gm,`${r.indent}#`);xe+=`
49
49
  ${De}`}pe=P.comment}else P&&typeof P=="object"&&(P=X.schema.createNode(P,!0));r.implicitKey=!1,!q&&!this.comment&&P instanceof d&&(r.indentAtStart=me.length+1),oe=!1,!g&&y>=2&&!r.inFlow&&!q&&P instanceof E&&P.type!==t.Type.FLOW_SEQ&&!P.tag&&!X.anchors.getName(P)&&(r.indent=r.indent.substr(2));let Ee=ge(P,r,()=>pe=null,()=>oe=!0),fe=" ";return xe||this.comment?fe=`${xe}
50
50
  ${r.indent}`:!q&&P instanceof T?(!(Ee[0]==="["||Ee[0]==="{")||Ee.includes(`
51
51
  `))&&(fe=`
52
52
  ${r.indent}`):Ee[0]===`
53
- `&&(fe=""),oe&&!pe&&u&&u(),l(me+fe+Ee,r.indent,pe)}};t._defineProperty(W,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var ae=(o,r)=>{if(o instanceof Q){let a=r.get(o.source);return a.count*a.aliasCount}else if(o instanceof T){let a=0;for(let u of o.items){let y=ae(u,r);y>a&&(a=y)}return a}else if(o instanceof W){let a=ae(o.key,r),u=ae(o.value,r);return Math.max(a,u)}return 1},Q=class _r extends p{static stringify({range:r,source:a},{anchors:u,doc:y,implicitKey:g,inStringifyKey:A}){let v=Object.keys(u).find(L=>u[L]===a);if(!v&&A&&(v=y.anchors.getName(a)||y.anchors.newName()),v)return`*${v}${g?" ":""}`;let P=y.anchors.getName(a)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${P} [${r}]`)}constructor(r){super(),this.source=r,this.type=t.Type.ALIAS}set tag(r){throw new Error("Alias nodes cannot have tags")}toJSON(r,a){if(!a)return f(this.source,r,a);let{anchors:u,maxAliasCount:y}=a,g=u.get(this.source);if(!g||g.res===void 0){let A="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new t.YAMLReferenceError(this.cstNode,A):new ReferenceError(A)}if(y>=0&&(g.count+=1,g.aliasCount===0&&(g.aliasCount=ae(this.source,u)),g.count*g.aliasCount>y)){let A="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new t.YAMLReferenceError(this.cstNode,A):new ReferenceError(A)}return g.res}toString(r){return _r.stringify(this,r)}};t._defineProperty(Q,"default",!0);function ne(o,r){let a=r instanceof d?r.value:r;for(let u of o)if(u instanceof W&&(u.key===r||u.key===a||u.key&&u.key.value===a))return u}var he=class extends T{add(o,r){o?o instanceof W||(o=new W(o.key||o,o.value)):o=new W(o);let a=ne(this.items,o.key),u=this.schema&&this.schema.sortMapEntries;if(a)if(r)a.value=o.value;else throw new Error(`Key ${o.key} already set`);else if(u){let y=this.items.findIndex(g=>u(o,g)<0);y===-1?this.items.push(o):this.items.splice(y,0,o)}else this.items.push(o)}delete(o){let r=ne(this.items,o);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(o,r){let a=ne(this.items,o),u=a&&a.value;return!r&&u instanceof d?u.value:u}has(o){return!!ne(this.items,o)}set(o,r){this.add(new W(o,r),!0)}toJSON(o,r,a){let u=a?new a:r&&r.mapAsMap?new Map:{};r&&r.onCreate&&r.onCreate(u);for(let y of this.items)y.addToJSMap(r,u);return u}toString(o,r,a){if(!o)return JSON.stringify(this);for(let u of this.items)if(!(u instanceof W))throw new Error(`Map items must all be pairs; found ${JSON.stringify(u)} instead`);return super.toString(o,{blockItem:u=>u.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:o.indent||""},r,a)}},ye="<<",j=class extends W{constructor(o){if(o instanceof W){let r=o.value;r instanceof E||(r=new E,r.items.push(o.value),r.range=o.value.range),super(o.key,r),this.range=o.range}else super(new d(ye),new E);this.type=W.Type.MERGE_PAIR}addToJSMap(o,r){for(let{source:a}of this.value.items){if(!(a instanceof he))throw new Error("Merge sources must be maps");let u=a.toJSON(null,o,Map);for(let[y,g]of u)r instanceof Map?r.has(y)||r.set(y,g):r instanceof Set?r.add(y):Object.prototype.hasOwnProperty.call(r,y)||Object.defineProperty(r,y,{value:g,writable:!0,enumerable:!0,configurable:!0})}return r}toString(o,r){let a=this.value;if(a.items.length>1)return super.toString(o,r);this.value=a.items[0];let u=super.toString(o,r);return this.value=a,u}},w={defaultType:t.Type.BLOCK_LITERAL,lineWidth:76},b={trueStr:"true",falseStr:"false"},R={asBigInt:!1},x={nullStr:"null"},M={defaultType:t.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function _(o,r,a){for(let{format:u,test:y,resolve:g}of r)if(y){let A=o.match(y);if(A){let v=g.apply(null,A);return v instanceof d||(v=new d(v)),u&&(v.format=u),v}}return a&&(o=a(o)),new d(o)}var I="flow",k="block",V="quoted",G=(o,r)=>{let a=o[r+1];for(;a===" "||a===" ";){do a=o[r+=1];while(a&&a!==`
54
- `);a=o[r+1]}return r};function ee(o,r,a,{indentAtStart:u,lineWidth:y=80,minContentWidth:g=20,onFold:A,onOverflow:v}){if(!y||y<0)return o;let P=Math.max(1+g,1+y-r.length);if(o.length<=P)return o;let L=[],q={},X=y-r.length;typeof u=="number"&&(u>y-Math.max(2,g)?L.push(0):X=y-u);let be,se,ge=!1,oe=-1,me=-1,xe=-1;a===k&&(oe=G(o,oe),oe!==-1&&(X=oe+P));for(let Ee;Ee=o[oe+=1];){if(a===V&&Ee==="\\"){switch(me=oe,o[oe+1]){case"x":oe+=3;break;case"u":oe+=5;break;case"U":oe+=9;break;default:oe+=1}xe=oe}if(Ee===`
55
- `)a===k&&(oe=G(o,oe)),X=oe+P,be=void 0;else{if(Ee===" "&&se&&se!==" "&&se!==`
53
+ `&&(fe=""),oe&&!pe&&u&&u(),c(me+fe+Ee,r.indent,pe)}};t._defineProperty(W,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var ae=(o,r)=>{if(o instanceof Q){let a=r.get(o.source);return a.count*a.aliasCount}else if(o instanceof T){let a=0;for(let u of o.items){let y=ae(u,r);y>a&&(a=y)}return a}else if(o instanceof W){let a=ae(o.key,r),u=ae(o.value,r);return Math.max(a,u)}return 1},Q=class _r extends p{static stringify({range:r,source:a},{anchors:u,doc:y,implicitKey:g,inStringifyKey:A}){let v=Object.keys(u).find(L=>u[L]===a);if(!v&&A&&(v=y.anchors.getName(a)||y.anchors.newName()),v)return`*${v}${g?" ":""}`;let P=y.anchors.getName(a)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${P} [${r}]`)}constructor(r){super(),this.source=r,this.type=t.Type.ALIAS}set tag(r){throw new Error("Alias nodes cannot have tags")}toJSON(r,a){if(!a)return h(this.source,r,a);let{anchors:u,maxAliasCount:y}=a,g=u.get(this.source);if(!g||g.res===void 0){let A="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new t.YAMLReferenceError(this.cstNode,A):new ReferenceError(A)}if(y>=0&&(g.count+=1,g.aliasCount===0&&(g.aliasCount=ae(this.source,u)),g.count*g.aliasCount>y)){let A="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new t.YAMLReferenceError(this.cstNode,A):new ReferenceError(A)}return g.res}toString(r){return _r.stringify(this,r)}};t._defineProperty(Q,"default",!0);function ne(o,r){let a=r instanceof d?r.value:r;for(let u of o)if(u instanceof W&&(u.key===r||u.key===a||u.key&&u.key.value===a))return u}var he=class extends T{add(o,r){o?o instanceof W||(o=new W(o.key||o,o.value)):o=new W(o);let a=ne(this.items,o.key),u=this.schema&&this.schema.sortMapEntries;if(a)if(r)a.value=o.value;else throw new Error(`Key ${o.key} already set`);else if(u){let y=this.items.findIndex(g=>u(o,g)<0);y===-1?this.items.push(o):this.items.splice(y,0,o)}else this.items.push(o)}delete(o){let r=ne(this.items,o);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(o,r){let a=ne(this.items,o),u=a&&a.value;return!r&&u instanceof d?u.value:u}has(o){return!!ne(this.items,o)}set(o,r){this.add(new W(o,r),!0)}toJSON(o,r,a){let u=a?new a:r&&r.mapAsMap?new Map:{};r&&r.onCreate&&r.onCreate(u);for(let y of this.items)y.addToJSMap(r,u);return u}toString(o,r,a){if(!o)return JSON.stringify(this);for(let u of this.items)if(!(u instanceof W))throw new Error(`Map items must all be pairs; found ${JSON.stringify(u)} instead`);return super.toString(o,{blockItem:u=>u.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:o.indent||""},r,a)}},ye="<<",j=class extends W{constructor(o){if(o instanceof W){let r=o.value;r instanceof E||(r=new E,r.items.push(o.value),r.range=o.value.range),super(o.key,r),this.range=o.range}else super(new d(ye),new E);this.type=W.Type.MERGE_PAIR}addToJSMap(o,r){for(let{source:a}of this.value.items){if(!(a instanceof he))throw new Error("Merge sources must be maps");let u=a.toJSON(null,o,Map);for(let[y,g]of u)r instanceof Map?r.has(y)||r.set(y,g):r instanceof Set?r.add(y):Object.prototype.hasOwnProperty.call(r,y)||Object.defineProperty(r,y,{value:g,writable:!0,enumerable:!0,configurable:!0})}return r}toString(o,r){let a=this.value;if(a.items.length>1)return super.toString(o,r);this.value=a.items[0];let u=super.toString(o,r);return this.value=a,u}},w={defaultType:t.Type.BLOCK_LITERAL,lineWidth:76},b={trueStr:"true",falseStr:"false"},R={asBigInt:!1},x={nullStr:"null"},M={defaultType:t.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function _(o,r,a){for(let{format:u,test:y,resolve:g}of r)if(y){let A=o.match(y);if(A){let v=g.apply(null,A);return v instanceof d||(v=new d(v)),u&&(v.format=u),v}}return a&&(o=a(o)),new d(o)}var I="flow",k="block",V="quoted",G=(o,r)=>{let a=o[r+1];for(;a===" "||a===" ";){do a=o[r+=1];while(a&&a!==`
54
+ `);a=o[r+1]}return r};function ee(o,r,a,{indentAtStart:u,lineWidth:y=80,minContentWidth:g=20,onFold:A,onOverflow:v}){if(!y||y<0)return o;let P=Math.max(1+g,1+y-r.length);if(o.length<=P)return o;let L=[],q={},X=y-r.length;typeof u=="number"&&(u>y-Math.max(2,g)?L.push(0):X=y-u);let Te,se,ge=!1,oe=-1,me=-1,xe=-1;a===k&&(oe=G(o,oe),oe!==-1&&(X=oe+P));for(let Ee;Ee=o[oe+=1];){if(a===V&&Ee==="\\"){switch(me=oe,o[oe+1]){case"x":oe+=3;break;case"u":oe+=5;break;case"U":oe+=9;break;default:oe+=1}xe=oe}if(Ee===`
55
+ `)a===k&&(oe=G(o,oe)),X=oe+P,Te=void 0;else{if(Ee===" "&&se&&se!==" "&&se!==`
56
56
  `&&se!==" "){let fe=o[oe+1];fe&&fe!==" "&&fe!==`
57
- `&&fe!==" "&&(be=oe)}if(oe>=X)if(be)L.push(be),X=be+P,be=void 0;else if(a===V){for(;se===" "||se===" ";)se=Ee,Ee=o[oe+=1],ge=!0;let fe=oe>xe+1?oe-2:me-1;if(q[fe])return o;L.push(fe),q[fe]=!0,X=fe+P,be=void 0}else ge=!0}se=Ee}if(ge&&v&&v(),L.length===0)return o;A&&A();let pe=o.slice(0,L[0]);for(let Ee=0;Ee<L.length;++Ee){let fe=L[Ee],De=L[Ee+1]||o.length;fe===0?pe=`
57
+ `&&fe!==" "&&(Te=oe)}if(oe>=X)if(Te)L.push(Te),X=Te+P,Te=void 0;else if(a===V){for(;se===" "||se===" ";)se=Ee,Ee=o[oe+=1],ge=!0;let fe=oe>xe+1?oe-2:me-1;if(q[fe])return o;L.push(fe),q[fe]=!0,X=fe+P,Te=void 0}else ge=!0}se=Ee}if(ge&&v&&v(),L.length===0)return o;A&&A();let pe=o.slice(0,L[0]);for(let Ee=0;Ee<L.length;++Ee){let fe=L[Ee],De=L[Ee+1]||o.length;fe===0?pe=`
58
58
  ${r}${o.slice(0,De)}`:(a===V&&q[fe]&&(pe+=`${o[fe]}\\`),pe+=`
59
- ${r}${o.slice(fe+1,De)}`)}return pe}var Oe=({indentAtStart:o})=>o?Object.assign({indentAtStart:o},M.fold):M.fold,ve=o=>/^(%|---|\.\.\.)/m.test(o);function _e(o,r,a){if(!r||r<0)return!1;let u=r-a,y=o.length;if(y<=u)return!1;for(let g=0,A=0;g<y;++g)if(o[g]===`
59
+ ${r}${o.slice(fe+1,De)}`)}return pe}var Ae=({indentAtStart:o})=>o?Object.assign({indentAtStart:o},M.fold):M.fold,ve=o=>/^(%|---|\.\.\.)/m.test(o);function _e(o,r,a){if(!r||r<0)return!1;let u=r-a,y=o.length;if(y<=u)return!1;for(let g=0,A=0;g<y;++g)if(o[g]===`
60
60
  `){if(g-A>u)return!0;if(A=g+1,y-A<=u)return!1}return!0}function Pe(o,r){let{implicitKey:a}=r,{jsonEncoding:u,minMultiLineLength:y}=M.doubleQuoted,g=JSON.stringify(o);if(u)return g;let A=r.indent||(ve(o)?" ":""),v="",P=0;for(let L=0,q=g[L];q;q=g[++L])if(q===" "&&g[L+1]==="\\"&&g[L+2]==="n"&&(v+=g.slice(P,L)+"\\ ",L+=1,P=L,q="\\"),q==="\\")switch(g[L+1]){case"u":{v+=g.slice(P,L);let X=g.substr(L+2,4);switch(X){case"0000":v+="\\0";break;case"0007":v+="\\a";break;case"000b":v+="\\v";break;case"001b":v+="\\e";break;case"0085":v+="\\N";break;case"00a0":v+="\\_";break;case"2028":v+="\\L";break;case"2029":v+="\\P";break;default:X.substr(0,2)==="00"?v+="\\x"+X.substr(2):v+=g.substr(L,6)}L+=5,P=L+1}break;case"n":if(a||g[L+2]==='"'||g.length<y)L+=1;else{for(v+=g.slice(P,L)+`
61
61
 
62
62
  `;g[L+2]==="\\"&&g[L+3]==="n"&&g[L+4]!=='"';)v+=`
63
- `,L+=2;v+=A,g[L+2]===" "&&(v+="\\"),L+=1,P=L+1}break;default:L+=1}return v=P?v+g.slice(P):g,a?v:ee(v,A,V,Oe(r))}function Ce(o,r){if(r.implicitKey){if(/\n/.test(o))return Pe(o,r)}else if(/[ \t]\n|\n[ \t]/.test(o))return Pe(o,r);let a=r.indent||(ve(o)?" ":""),u="'"+o.replace(/'/g,"''").replace(/\n+/g,`$&
64
- ${a}`)+"'";return r.implicitKey?u:ee(u,a,I,Oe(r))}function Y({comment:o,type:r,value:a},u,y,g){if(/\n[\t ]+$/.test(a)||/^\s*$/.test(a))return Pe(a,u);let A=u.indent||(u.forceBlockIndent||ve(a)?" ":""),v=A?"2":"1",P=r===t.Type.BLOCK_FOLDED?!1:r===t.Type.BLOCK_LITERAL?!0:!_e(a,M.fold.lineWidth,A.length),L=P?"|":">";if(!a)return L+`
63
+ `,L+=2;v+=A,g[L+2]===" "&&(v+="\\"),L+=1,P=L+1}break;default:L+=1}return v=P?v+g.slice(P):g,a?v:ee(v,A,V,Ae(r))}function Ce(o,r){if(r.implicitKey){if(/\n/.test(o))return Pe(o,r)}else if(/[ \t]\n|\n[ \t]/.test(o))return Pe(o,r);let a=r.indent||(ve(o)?" ":""),u="'"+o.replace(/'/g,"''").replace(/\n+/g,`$&
64
+ ${a}`)+"'";return r.implicitKey?u:ee(u,a,I,Ae(r))}function Y({comment:o,type:r,value:a},u,y,g){if(/\n[\t ]+$/.test(a)||/^\s*$/.test(a))return Pe(a,u);let A=u.indent||(u.forceBlockIndent||ve(a)?" ":""),v=A?"2":"1",P=r===t.Type.BLOCK_FOLDED?!1:r===t.Type.BLOCK_LITERAL?!0:!_e(a,M.fold.lineWidth,A.length),L=P?"|":">";if(!a)return L+`
65
65
  `;let q="",X="";if(a=a.replace(/[\n\t ]*$/,se=>{let ge=se.indexOf(`
66
66
  `);return ge===-1?L+="-":(a===se||ge!==se.length-1)&&(L+="+",g&&g()),X=se.replace(/\n$/,""),""}).replace(/^[\n ]*/,se=>{se.indexOf(" ")!==-1&&(L+=v);let ge=se.match(/ +$/);return ge?(q=se.slice(0,-ge[0].length),ge[0]):(q=se,"")}),X&&(X=X.replace(/\n+(?!\n|$)/g,`$&${A}`)),q&&(q=q.replace(/\n+/g,`$&${A}`)),o&&(L+=" #"+o.replace(/ ?[\r\n]+/g," "),y&&y()),!a)return`${L}${v}
67
67
  ${A}${X}`;if(P)return a=a.replace(/\n+/g,`$&${A}`),`${L}
68
68
  ${A}${q}${a}${X}`;a=a.replace(/\n+/g,`
69
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${A}`);let be=ee(`${q}${a}${X}`,A,k,M.fold);return`${L}
70
- ${A}${be}`}function m(o,r,a,u){let{comment:y,type:g,value:A}=o,{actualString:v,implicitKey:P,indent:L,inFlow:q}=r;if(P&&/[\n[\]{},]/.test(A)||q&&/[[\]{},]/.test(A))return Pe(A,r);if(!A||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(A))return P||q||A.indexOf(`
69
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${A}`);let Te=ee(`${q}${a}${X}`,A,k,M.fold);return`${L}
70
+ ${A}${Te}`}function m(o,r,a,u){let{comment:y,type:g,value:A}=o,{actualString:v,implicitKey:P,indent:L,inFlow:q}=r;if(P&&/[\n[\]{},]/.test(A)||q&&/[[\]{},]/.test(A))return Pe(A,r);if(!A||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(A))return P||q||A.indexOf(`
71
71
  `)===-1?A.indexOf('"')!==-1&&A.indexOf("'")===-1?Ce(A,r):Pe(A,r):Y(o,r,a,u);if(!P&&!q&&g!==t.Type.PLAIN&&A.indexOf(`
72
72
  `)!==-1)return Y(o,r,a,u);if(L===""&&ve(A))return r.forceBlockIndent=!0,Y(o,r,a,u);let X=A.replace(/\n+/g,`$&
73
- ${L}`);if(v){let{tags:se}=r.doc.schema;if(typeof _(X,se,se.scalarFallback).value!="string")return Pe(A,r)}let be=P?X:ee(X,L,I,Oe(r));return y&&!q&&(be.indexOf(`
73
+ ${L}`);if(v){let{tags:se}=r.doc.schema;if(typeof _(X,se,se.scalarFallback).value!="string")return Pe(A,r)}let Te=P?X:ee(X,L,I,Ae(r));return y&&!q&&(Te.indexOf(`
74
74
  `)!==-1||y.indexOf(`
75
- `)!==-1)?(a&&a(),i(be,L,y)):be}function N(o,r,a,u){let{defaultType:y}=M,{implicitKey:g,inFlow:A}=r,{type:v,value:P}=o;typeof P!="string"&&(P=String(P),o=Object.assign({},o,{value:P}));let L=X=>{switch(X){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:return Y(o,r,a,u);case t.Type.QUOTE_DOUBLE:return Pe(P,r);case t.Type.QUOTE_SINGLE:return Ce(P,r);case t.Type.PLAIN:return m(o,r,a,u);default:return null}};(v!==t.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(P)||(g||A)&&(v===t.Type.BLOCK_FOLDED||v===t.Type.BLOCK_LITERAL))&&(v=t.Type.QUOTE_DOUBLE);let q=L(v);if(q===null&&(q=L(y),q===null))throw new Error(`Unsupported default string type ${y}`);return q}function K({format:o,minFractionDigits:r,tag:a,value:u}){if(typeof u=="bigint")return String(u);if(!isFinite(u))return isNaN(u)?".nan":u<0?"-.inf":".inf";let y=JSON.stringify(u);if(!o&&r&&(!a||a==="tag:yaml.org,2002:float")&&/^\d/.test(y)){let g=y.indexOf(".");g<0&&(g=y.length,y+=".");let A=r-(y.length-g-1);for(;A-- >0;)y+="0"}return y}function H(o,r){let a,u;switch(r.type){case t.Type.FLOW_MAP:a="}",u="flow map";break;case t.Type.FLOW_SEQ:a="]",u="flow sequence";break;default:o.push(new t.YAMLSemanticError(r,"Not a flow collection!?"));return}let y;for(let g=r.items.length-1;g>=0;--g){let A=r.items[g];if(!A||A.type!==t.Type.COMMENT){y=A;break}}if(y&&y.char!==a){let g=`Expected ${u} to end with ${a}`,A;typeof y.offset=="number"?(A=new t.YAMLSemanticError(r,g),A.offset=y.offset+1):(A=new t.YAMLSemanticError(y,g),y.range&&y.range.end&&(A.offset=y.range.end-y.range.start)),o.push(A)}}function re(o,r){let a=r.context.src[r.range.start-1];if(a!==`
75
+ `)!==-1)?(a&&a(),i(Te,L,y)):Te}function N(o,r,a,u){let{defaultType:y}=M,{implicitKey:g,inFlow:A}=r,{type:v,value:P}=o;typeof P!="string"&&(P=String(P),o=Object.assign({},o,{value:P}));let L=X=>{switch(X){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:return Y(o,r,a,u);case t.Type.QUOTE_DOUBLE:return Pe(P,r);case t.Type.QUOTE_SINGLE:return Ce(P,r);case t.Type.PLAIN:return m(o,r,a,u);default:return null}};(v!==t.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(P)||(g||A)&&(v===t.Type.BLOCK_FOLDED||v===t.Type.BLOCK_LITERAL))&&(v=t.Type.QUOTE_DOUBLE);let q=L(v);if(q===null&&(q=L(y),q===null))throw new Error(`Unsupported default string type ${y}`);return q}function K({format:o,minFractionDigits:r,tag:a,value:u}){if(typeof u=="bigint")return String(u);if(!isFinite(u))return isNaN(u)?".nan":u<0?"-.inf":".inf";let y=JSON.stringify(u);if(!o&&r&&(!a||a==="tag:yaml.org,2002:float")&&/^\d/.test(y)){let g=y.indexOf(".");g<0&&(g=y.length,y+=".");let A=r-(y.length-g-1);for(;A-- >0;)y+="0"}return y}function H(o,r){let a,u;switch(r.type){case t.Type.FLOW_MAP:a="}",u="flow map";break;case t.Type.FLOW_SEQ:a="]",u="flow sequence";break;default:o.push(new t.YAMLSemanticError(r,"Not a flow collection!?"));return}let y;for(let g=r.items.length-1;g>=0;--g){let A=r.items[g];if(!A||A.type!==t.Type.COMMENT){y=A;break}}if(y&&y.char!==a){let g=`Expected ${u} to end with ${a}`,A;typeof y.offset=="number"?(A=new t.YAMLSemanticError(r,g),A.offset=y.offset+1):(A=new t.YAMLSemanticError(y,g),y.range&&y.range.end&&(A.offset=y.range.end-y.range.start)),o.push(A)}}function re(o,r){let a=r.context.src[r.range.start-1];if(a!==`
76
76
  `&&a!==" "&&a!==" "){let u="Comments must be separated from other tokens by white space characters";o.push(new t.YAMLSemanticError(r,u))}}function le(o,r){let a=String(r),u=a.substr(0,8)+"..."+a.substr(-8);return new t.YAMLSemanticError(o,`The "${u}" key is too long`)}function Ye(o,r){for(let{afterKey:a,before:u,comment:y}of r){let g=o.items[u];g?(a&&g.value&&(g=g.value),y===void 0?(a||!g.commentBefore)&&(g.spaceBefore=!0):g.commentBefore?g.commentBefore+=`
77
77
  `+y:g.commentBefore=y):y!==void 0&&(o.comment?o.comment+=`
78
78
  `+y:o.comment=y)}}function Qe(o,r){let a=r.strValue;return a?typeof a=="string"?a:(a.errors.forEach(u=>{u.source||(u.source=r),o.errors.push(u)}),a.str):""}function Ze(o,r){let{handle:a,suffix:u}=r.tag,y=o.tagPrefixes.find(g=>g.handle===a);if(!y){let g=o.getDefaults().tagPrefixes;if(g&&(y=g.find(A=>A.handle===a)),!y)throw new t.YAMLSemanticError(r,`The ${a} tag handle is non-default and was not declared.`)}if(!u)throw new t.YAMLSemanticError(r,`The ${a} tag has no suffix.`);if(a==="!"&&(o.version||o.options.version)==="1.0"){if(u[0]==="^")return o.warnings.push(new t.YAMLWarning(r,"YAML 1.0 ^ tag expansion is not supported")),u;if(/[:/]/.test(u)){let g=u.match(/^([a-z0-9-]+)\/(.*)/i);return g?`tag:${g[1]}.yaml.org,2002:${g[2]}`:`tag:${u}`}}return y.prefix+decodeURIComponent(u)}function ze(o,r){let{tag:a,type:u}=r,y=!1;if(a){let{handle:g,suffix:A,verbatim:v}=a;if(v){if(v!=="!"&&v!=="!!")return v;let P=`Verbatim tags aren't resolved, so ${v} is invalid.`;o.errors.push(new t.YAMLSemanticError(r,P))}else if(g==="!"&&!A)y=!0;else try{return Ze(o,r)}catch(P){o.errors.push(P)}}switch(u){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:case t.Type.QUOTE_DOUBLE:case t.Type.QUOTE_SINGLE:return t.defaultTags.STR;case t.Type.FLOW_MAP:case t.Type.MAP:return t.defaultTags.MAP;case t.Type.FLOW_SEQ:case t.Type.SEQ:return t.defaultTags.SEQ;case t.Type.PLAIN:return y?t.defaultTags.STR:null;default:return null}}function _t(o,r,a){let{tags:u}=o.schema,y=[];for(let A of u)if(A.tag===a)if(A.test)y.push(A);else{let v=A.resolve(o,r);return v instanceof T?v:new d(v)}let g=Qe(o,r);return typeof g=="string"&&y.length>0?_(g,y,u.scalarFallback):null}function Bt({type:o}){switch(o){case t.Type.FLOW_MAP:case t.Type.MAP:return t.defaultTags.MAP;case t.Type.FLOW_SEQ:case t.Type.SEQ:return t.defaultTags.SEQ;default:return t.defaultTags.STR}}function To(o,r,a){try{let u=_t(o,r,a);if(u)return a&&r.tag&&(u.tag=a),u}catch(u){return u.source||(u.source=r),o.errors.push(u),null}try{let u=Bt(r);if(!u)throw new Error(`The tag ${a} is unavailable`);let y=`The tag ${a} is unavailable, falling back to ${u}`;o.warnings.push(new t.YAMLWarning(r,y));let g=_t(o,r,u);return g.tag=a,g}catch(u){let y=new t.YAMLReferenceError(r,u.message);return y.stack=u.stack,o.errors.push(y),null}}var Oo=o=>{if(!o)return!1;let{type:r}=o;return r===t.Type.MAP_KEY||r===t.Type.MAP_VALUE||r===t.Type.SEQ_ITEM};function Ao(o,r){let a={before:[],after:[]},u=!1,y=!1,g=Oo(r.context.parent)?r.context.parent.props.concat(r.props):r.props;for(let{start:A,end:v}of g)switch(r.context.src[A]){case t.Char.COMMENT:{if(!r.commentHasRequiredWhitespace(A)){let X="Comments must be separated from other tokens by white space characters";o.push(new t.YAMLSemanticError(r,X))}let{header:P,valueRange:L}=r;(L&&(A>L.start||P&&A>P.start)?a.after:a.before).push(r.context.src.slice(A+1,v));break}case t.Char.ANCHOR:if(u){let P="A node can have at most one anchor";o.push(new t.YAMLSemanticError(r,P))}u=!0;break;case t.Char.TAG:if(y){let P="A node can have at most one tag";o.push(new t.YAMLSemanticError(r,P))}y=!0;break}return{comments:a,hasAnchor:u,hasTag:y}}function vo(o,r){let{anchors:a,errors:u,schema:y}=o;if(r.type===t.Type.ALIAS){let A=r.rawValue,v=a.getNode(A);if(!v){let L=`Aliased anchor not found: ${A}`;return u.push(new t.YAMLReferenceError(r,L)),null}let P=new Q(v);return a._cstAliases.push(P),P}let g=ze(o,r);if(g)return To(o,r,g);if(r.type!==t.Type.PLAIN){let A=`Failed to resolve ${r.type} node here`;return u.push(new t.YAMLSyntaxError(r,A)),null}try{let A=Qe(o,r);return _(A,y.tags,y.tags.scalarFallback)}catch(A){return A.source||(A.source=r),u.push(A),null}}function rt(o,r){if(!r)return null;r.error&&o.errors.push(r.error);let{comments:a,hasAnchor:u,hasTag:y}=Ao(o.errors,r);if(u){let{anchors:A}=o,v=r.anchor,P=A.getNode(v);P&&(A.map[A.newName(v)]=P),A.map[v]=r}if(r.type===t.Type.ALIAS&&(u||y)){let A="An alias node must not specify any properties";o.errors.push(new t.YAMLSemanticError(r,A))}let g=vo(o,r);if(g){g.range=[r.range.start,r.range.end],o.options.keepCstNodes&&(g.cstNode=r),o.options.keepNodeTypes&&(g.type=r.type);let A=a.before.join(`
@@ -80,27 +80,27 @@ ${L}`);if(v){let{tags:se}=r.doc.schema;if(typeof _(X,se,se.scalarFallback).value
80
80
  ${A}`:A);let v=a.after.join(`
81
81
  `);v&&(g.comment=g.comment?`${g.comment}
82
82
  ${v}`:v)}return r.resolved=g}function Eo(o,r){if(r.type!==t.Type.MAP&&r.type!==t.Type.FLOW_MAP){let A=`A ${r.type} node cannot be resolved as a mapping`;return o.errors.push(new t.YAMLSyntaxError(r,A)),null}let{comments:a,items:u}=r.type===t.Type.FLOW_MAP?xo(o,r):Po(o,r),y=new he;y.items=u,Ye(y,a);let g=!1;for(let A=0;A<u.length;++A){let{key:v}=u[A];if(v instanceof T&&(g=!0),o.schema.merge&&v&&v.value===ye){u[A]=new j(u[A]);let P=u[A].value.items,L=null;P.some(q=>{if(q instanceof Q){let{type:X}=q.source;return X===t.Type.MAP||X===t.Type.FLOW_MAP?!1:L="Merge nodes aliases can only point to maps"}return L="Merge nodes can only have Alias nodes as values"}),L&&o.errors.push(new t.YAMLSemanticError(r,L))}else for(let P=A+1;P<u.length;++P){let{key:L}=u[P];if(v===L||v&&L&&Object.prototype.hasOwnProperty.call(v,"value")&&v.value===L.value){let q=`Map keys must be unique; "${v}" is repeated`;o.errors.push(new t.YAMLSemanticError(r,q));break}}}if(g&&!o.options.mapAsMap){let A="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";o.warnings.push(new t.YAMLWarning(r,A))}return r.resolved=y,y}var _o=({context:{lineStart:o,node:r,src:a},props:u})=>{if(u.length===0)return!1;let{start:y}=u[0];if(r&&y>r.valueRange.start||a[y]!==t.Char.COMMENT)return!1;for(let g=o;g<y;++g)if(a[g]===`
83
- `)return!1;return!0};function Ro(o,r){if(!_o(o))return;let a=o.getPropValue(0,t.Char.COMMENT,!0),u=!1,y=r.value.commentBefore;if(y&&y.startsWith(a))r.value.commentBefore=y.substr(a.length+1),u=!0;else{let g=r.value.comment;!o.node&&g&&g.startsWith(a)&&(r.value.comment=g.substr(a.length+1),u=!0)}u&&(r.comment=a)}function Po(o,r){let a=[],u=[],y,g=null;for(let A=0;A<r.items.length;++A){let v=r.items[A];switch(v.type){case t.Type.BLANK_LINE:a.push({afterKey:!!y,before:u.length});break;case t.Type.COMMENT:a.push({afterKey:!!y,before:u.length,comment:v.comment});break;case t.Type.MAP_KEY:y!==void 0&&u.push(new W(y)),v.error&&o.errors.push(v.error),y=rt(o,v.node),g=null;break;case t.Type.MAP_VALUE:{if(y===void 0&&(y=null),v.error&&o.errors.push(v.error),!v.context.atLineStart&&v.node&&v.node.type===t.Type.MAP&&!v.node.context.atLineStart){let q="Nested mappings are not allowed in compact mappings";o.errors.push(new t.YAMLSemanticError(v.node,q))}let P=v.node;if(!P&&v.props.length>0){P=new t.PlainValue(t.Type.PLAIN,[]),P.context={parent:v,src:v.context.src};let q=v.range.start+1;if(P.range={start:q,end:q},P.valueRange={start:q,end:q},typeof v.range.origStart=="number"){let X=v.range.origStart+1;P.range.origStart=P.range.origEnd=X,P.valueRange.origStart=P.valueRange.origEnd=X}}let L=new W(y,rt(o,P));Ro(v,L),u.push(L),y&&typeof g=="number"&&v.range.start>g+1024&&o.errors.push(le(r,y)),y=void 0,g=null}break;default:y!==void 0&&u.push(new W(y)),y=rt(o,v),g=v.range.start,v.error&&o.errors.push(v.error);e:for(let P=A+1;;++P){let L=r.items[P];switch(L&&L.type){case t.Type.BLANK_LINE:case t.Type.COMMENT:continue e;case t.Type.MAP_VALUE:break e;default:{let q="Implicit map keys need to be followed by map values";o.errors.push(new t.YAMLSemanticError(v,q));break e}}}if(v.valueRangeContainsNewline){let P="Implicit map keys need to be on a single line";o.errors.push(new t.YAMLSemanticError(v,P))}}}return y!==void 0&&u.push(new W(y)),{comments:a,items:u}}function xo(o,r){let a=[],u=[],y,g=!1,A="{";for(let v=0;v<r.items.length;++v){let P=r.items[v];if(typeof P.char=="string"){let{char:L,offset:q}=P;if(L==="?"&&y===void 0&&!g){g=!0,A=":";continue}if(L===":"){if(y===void 0&&(y=null),A===":"){A=",";continue}}else if(g&&(y===void 0&&L!==","&&(y=null),g=!1),y!==void 0&&(u.push(new W(y)),y=void 0,L===",")){A=":";continue}if(L==="}"){if(v===r.items.length-1)continue}else if(L===A){A=":";continue}let X=`Flow map contains an unexpected ${L}`,be=new t.YAMLSyntaxError(r,X);be.offset=q,o.errors.push(be)}else P.type===t.Type.BLANK_LINE?a.push({afterKey:!!y,before:u.length}):P.type===t.Type.COMMENT?(re(o.errors,P),a.push({afterKey:!!y,before:u.length,comment:P.comment})):y===void 0?(A===","&&o.errors.push(new t.YAMLSemanticError(P,"Separator , missing in flow map")),y=rt(o,P)):(A!==","&&o.errors.push(new t.YAMLSemanticError(P,"Indicator : missing in flow map entry")),u.push(new W(y,rt(o,P))),y=void 0,g=!1)}return H(o.errors,r),y!==void 0&&u.push(new W(y)),{comments:a,items:u}}function Io(o,r){if(r.type!==t.Type.SEQ&&r.type!==t.Type.FLOW_SEQ){let g=`A ${r.type} node cannot be resolved as a sequence`;return o.errors.push(new t.YAMLSyntaxError(r,g)),null}let{comments:a,items:u}=r.type===t.Type.FLOW_SEQ?ko(o,r):No(o,r),y=new E;if(y.items=u,Ye(y,a),!o.options.mapAsMap&&u.some(g=>g instanceof W&&g.key instanceof T)){let g="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";o.warnings.push(new t.YAMLWarning(r,g))}return r.resolved=y,y}function No(o,r){let a=[],u=[];for(let y=0;y<r.items.length;++y){let g=r.items[y];switch(g.type){case t.Type.BLANK_LINE:a.push({before:u.length});break;case t.Type.COMMENT:a.push({comment:g.comment,before:u.length});break;case t.Type.SEQ_ITEM:if(g.error&&o.errors.push(g.error),u.push(rt(o,g.node)),g.hasProps){let A="Sequence items cannot have tags or anchors before the - indicator";o.errors.push(new t.YAMLSemanticError(g,A))}break;default:g.error&&o.errors.push(g.error),o.errors.push(new t.YAMLSyntaxError(g,`Unexpected ${g.type} node in sequence`))}}return{comments:a,items:u}}function ko(o,r){let a=[],u=[],y=!1,g,A=null,v="[",P=null;for(let L=0;L<r.items.length;++L){let q=r.items[L];if(typeof q.char=="string"){let{char:X,offset:be}=q;if(X!==":"&&(y||g!==void 0)&&(y&&g===void 0&&(g=v?u.pop():null),u.push(new W(g)),y=!1,g=void 0,A=null),X===v)v=null;else if(!v&&X==="?")y=!0;else if(v!=="["&&X===":"&&g===void 0){if(v===","){if(g=u.pop(),g instanceof W){let se="Chaining flow sequence pairs is invalid",ge=new t.YAMLSemanticError(r,se);ge.offset=be,o.errors.push(ge)}if(!y&&typeof A=="number"){let se=q.range?q.range.start:q.offset;se>A+1024&&o.errors.push(le(r,g));let{src:ge}=P.context;for(let oe=A;oe<se;++oe)if(ge[oe]===`
84
- `){let me="Implicit keys of flow sequence pairs need to be on a single line";o.errors.push(new t.YAMLSemanticError(P,me));break}}}else g=null;A=null,y=!1,v=null}else if(v==="["||X!=="]"||L<r.items.length-1){let se=`Flow sequence contains an unexpected ${X}`,ge=new t.YAMLSyntaxError(r,se);ge.offset=be,o.errors.push(ge)}}else if(q.type===t.Type.BLANK_LINE)a.push({before:u.length});else if(q.type===t.Type.COMMENT)re(o.errors,q),a.push({comment:q.comment,before:u.length});else{if(v){let be=`Expected a ${v} in flow sequence`;o.errors.push(new t.YAMLSemanticError(q,be))}let X=rt(o,q);g===void 0?(u.push(X),P=q):(u.push(new W(g,X)),g=void 0),A=q.range.start,v=","}}return H(o.errors,r),g!==void 0&&u.push(new W(g)),{comments:a,items:u}}e.Alias=Q,e.Collection=T,e.Merge=j,e.Node=p,e.Pair=W,e.Scalar=d,e.YAMLMap=he,e.YAMLSeq=E,e.addComment=l,e.binaryOptions=w,e.boolOptions=b,e.findPair=ne,e.intOptions=R,e.isEmptyPath=D,e.nullOptions=x,e.resolveMap=Eo,e.resolveNode=rt,e.resolveSeq=Io,e.resolveString=Qe,e.strOptions=M,e.stringifyNumber=K,e.stringifyString=N,e.toJSON=f}}),zn=$e({"node_modules/yaml/dist/warnings-1000a372.js"(e){var t=Tt(),i=Ft(),l={identify:_=>_ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(_,I)=>{let k=i.resolveString(_,I);if(typeof Buffer=="function")return Buffer.from(k,"base64");if(typeof atob=="function"){let V=atob(k.replace(/[\n\r]/g,"")),G=new Uint8Array(V.length);for(let ee=0;ee<V.length;++ee)G[ee]=V.charCodeAt(ee);return G}else{let V="This environment does not support reading binary tags; either Buffer or atob is required";return _.errors.push(new t.YAMLReferenceError(I,V)),null}},options:i.binaryOptions,stringify:({comment:_,type:I,value:k},V,G,ee)=>{let Oe;if(typeof Buffer=="function")Oe=k instanceof Buffer?k.toString("base64"):Buffer.from(k.buffer).toString("base64");else if(typeof btoa=="function"){let ve="";for(let _e=0;_e<k.length;++_e)ve+=String.fromCharCode(k[_e]);Oe=btoa(ve)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(I||(I=i.binaryOptions.defaultType),I===t.Type.QUOTE_DOUBLE)k=Oe;else{let{lineWidth:ve}=i.binaryOptions,_e=Math.ceil(Oe.length/ve),Pe=new Array(_e);for(let Ce=0,Y=0;Ce<_e;++Ce,Y+=ve)Pe[Ce]=Oe.substr(Y,ve);k=Pe.join(I===t.Type.BLOCK_LITERAL?`
85
- `:" ")}return i.stringifyString({comment:_,type:I,value:k},V,G,ee)}};function p(_,I){let k=i.resolveSeq(_,I);for(let V=0;V<k.items.length;++V){let G=k.items[V];if(!(G instanceof i.Pair)){if(G instanceof i.YAMLMap){if(G.items.length>1){let Oe="Each pair must have its own sequence indicator";throw new t.YAMLSemanticError(I,Oe)}let ee=G.items[0]||new i.Pair;G.commentBefore&&(ee.commentBefore=ee.commentBefore?`${G.commentBefore}
83
+ `)return!1;return!0};function Ro(o,r){if(!_o(o))return;let a=o.getPropValue(0,t.Char.COMMENT,!0),u=!1,y=r.value.commentBefore;if(y&&y.startsWith(a))r.value.commentBefore=y.substr(a.length+1),u=!0;else{let g=r.value.comment;!o.node&&g&&g.startsWith(a)&&(r.value.comment=g.substr(a.length+1),u=!0)}u&&(r.comment=a)}function Po(o,r){let a=[],u=[],y,g=null;for(let A=0;A<r.items.length;++A){let v=r.items[A];switch(v.type){case t.Type.BLANK_LINE:a.push({afterKey:!!y,before:u.length});break;case t.Type.COMMENT:a.push({afterKey:!!y,before:u.length,comment:v.comment});break;case t.Type.MAP_KEY:y!==void 0&&u.push(new W(y)),v.error&&o.errors.push(v.error),y=rt(o,v.node),g=null;break;case t.Type.MAP_VALUE:{if(y===void 0&&(y=null),v.error&&o.errors.push(v.error),!v.context.atLineStart&&v.node&&v.node.type===t.Type.MAP&&!v.node.context.atLineStart){let q="Nested mappings are not allowed in compact mappings";o.errors.push(new t.YAMLSemanticError(v.node,q))}let P=v.node;if(!P&&v.props.length>0){P=new t.PlainValue(t.Type.PLAIN,[]),P.context={parent:v,src:v.context.src};let q=v.range.start+1;if(P.range={start:q,end:q},P.valueRange={start:q,end:q},typeof v.range.origStart=="number"){let X=v.range.origStart+1;P.range.origStart=P.range.origEnd=X,P.valueRange.origStart=P.valueRange.origEnd=X}}let L=new W(y,rt(o,P));Ro(v,L),u.push(L),y&&typeof g=="number"&&v.range.start>g+1024&&o.errors.push(le(r,y)),y=void 0,g=null}break;default:y!==void 0&&u.push(new W(y)),y=rt(o,v),g=v.range.start,v.error&&o.errors.push(v.error);e:for(let P=A+1;;++P){let L=r.items[P];switch(L&&L.type){case t.Type.BLANK_LINE:case t.Type.COMMENT:continue e;case t.Type.MAP_VALUE:break e;default:{let q="Implicit map keys need to be followed by map values";o.errors.push(new t.YAMLSemanticError(v,q));break e}}}if(v.valueRangeContainsNewline){let P="Implicit map keys need to be on a single line";o.errors.push(new t.YAMLSemanticError(v,P))}}}return y!==void 0&&u.push(new W(y)),{comments:a,items:u}}function xo(o,r){let a=[],u=[],y,g=!1,A="{";for(let v=0;v<r.items.length;++v){let P=r.items[v];if(typeof P.char=="string"){let{char:L,offset:q}=P;if(L==="?"&&y===void 0&&!g){g=!0,A=":";continue}if(L===":"){if(y===void 0&&(y=null),A===":"){A=",";continue}}else if(g&&(y===void 0&&L!==","&&(y=null),g=!1),y!==void 0&&(u.push(new W(y)),y=void 0,L===",")){A=":";continue}if(L==="}"){if(v===r.items.length-1)continue}else if(L===A){A=":";continue}let X=`Flow map contains an unexpected ${L}`,Te=new t.YAMLSyntaxError(r,X);Te.offset=q,o.errors.push(Te)}else P.type===t.Type.BLANK_LINE?a.push({afterKey:!!y,before:u.length}):P.type===t.Type.COMMENT?(re(o.errors,P),a.push({afterKey:!!y,before:u.length,comment:P.comment})):y===void 0?(A===","&&o.errors.push(new t.YAMLSemanticError(P,"Separator , missing in flow map")),y=rt(o,P)):(A!==","&&o.errors.push(new t.YAMLSemanticError(P,"Indicator : missing in flow map entry")),u.push(new W(y,rt(o,P))),y=void 0,g=!1)}return H(o.errors,r),y!==void 0&&u.push(new W(y)),{comments:a,items:u}}function Io(o,r){if(r.type!==t.Type.SEQ&&r.type!==t.Type.FLOW_SEQ){let g=`A ${r.type} node cannot be resolved as a sequence`;return o.errors.push(new t.YAMLSyntaxError(r,g)),null}let{comments:a,items:u}=r.type===t.Type.FLOW_SEQ?ko(o,r):No(o,r),y=new E;if(y.items=u,Ye(y,a),!o.options.mapAsMap&&u.some(g=>g instanceof W&&g.key instanceof T)){let g="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";o.warnings.push(new t.YAMLWarning(r,g))}return r.resolved=y,y}function No(o,r){let a=[],u=[];for(let y=0;y<r.items.length;++y){let g=r.items[y];switch(g.type){case t.Type.BLANK_LINE:a.push({before:u.length});break;case t.Type.COMMENT:a.push({comment:g.comment,before:u.length});break;case t.Type.SEQ_ITEM:if(g.error&&o.errors.push(g.error),u.push(rt(o,g.node)),g.hasProps){let A="Sequence items cannot have tags or anchors before the - indicator";o.errors.push(new t.YAMLSemanticError(g,A))}break;default:g.error&&o.errors.push(g.error),o.errors.push(new t.YAMLSyntaxError(g,`Unexpected ${g.type} node in sequence`))}}return{comments:a,items:u}}function ko(o,r){let a=[],u=[],y=!1,g,A=null,v="[",P=null;for(let L=0;L<r.items.length;++L){let q=r.items[L];if(typeof q.char=="string"){let{char:X,offset:Te}=q;if(X!==":"&&(y||g!==void 0)&&(y&&g===void 0&&(g=v?u.pop():null),u.push(new W(g)),y=!1,g=void 0,A=null),X===v)v=null;else if(!v&&X==="?")y=!0;else if(v!=="["&&X===":"&&g===void 0){if(v===","){if(g=u.pop(),g instanceof W){let se="Chaining flow sequence pairs is invalid",ge=new t.YAMLSemanticError(r,se);ge.offset=Te,o.errors.push(ge)}if(!y&&typeof A=="number"){let se=q.range?q.range.start:q.offset;se>A+1024&&o.errors.push(le(r,g));let{src:ge}=P.context;for(let oe=A;oe<se;++oe)if(ge[oe]===`
84
+ `){let me="Implicit keys of flow sequence pairs need to be on a single line";o.errors.push(new t.YAMLSemanticError(P,me));break}}}else g=null;A=null,y=!1,v=null}else if(v==="["||X!=="]"||L<r.items.length-1){let se=`Flow sequence contains an unexpected ${X}`,ge=new t.YAMLSyntaxError(r,se);ge.offset=Te,o.errors.push(ge)}}else if(q.type===t.Type.BLANK_LINE)a.push({before:u.length});else if(q.type===t.Type.COMMENT)re(o.errors,q),a.push({comment:q.comment,before:u.length});else{if(v){let Te=`Expected a ${v} in flow sequence`;o.errors.push(new t.YAMLSemanticError(q,Te))}let X=rt(o,q);g===void 0?(u.push(X),P=q):(u.push(new W(g,X)),g=void 0),A=q.range.start,v=","}}return H(o.errors,r),g!==void 0&&u.push(new W(g)),{comments:a,items:u}}e.Alias=Q,e.Collection=T,e.Merge=j,e.Node=p,e.Pair=W,e.Scalar=d,e.YAMLMap=he,e.YAMLSeq=E,e.addComment=c,e.binaryOptions=w,e.boolOptions=b,e.findPair=ne,e.intOptions=R,e.isEmptyPath=D,e.nullOptions=x,e.resolveMap=Eo,e.resolveNode=rt,e.resolveSeq=Io,e.resolveString=Qe,e.strOptions=M,e.stringifyNumber=K,e.stringifyString=N,e.toJSON=h}}),zn=$e({"node_modules/yaml/dist/warnings-1000a372.js"(e){var t=Tt(),i=Ft(),c={identify:_=>_ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(_,I)=>{let k=i.resolveString(_,I);if(typeof Buffer=="function")return Buffer.from(k,"base64");if(typeof atob=="function"){let V=atob(k.replace(/[\n\r]/g,"")),G=new Uint8Array(V.length);for(let ee=0;ee<V.length;++ee)G[ee]=V.charCodeAt(ee);return G}else{let V="This environment does not support reading binary tags; either Buffer or atob is required";return _.errors.push(new t.YAMLReferenceError(I,V)),null}},options:i.binaryOptions,stringify:({comment:_,type:I,value:k},V,G,ee)=>{let Ae;if(typeof Buffer=="function")Ae=k instanceof Buffer?k.toString("base64"):Buffer.from(k.buffer).toString("base64");else if(typeof btoa=="function"){let ve="";for(let _e=0;_e<k.length;++_e)ve+=String.fromCharCode(k[_e]);Ae=btoa(ve)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(I||(I=i.binaryOptions.defaultType),I===t.Type.QUOTE_DOUBLE)k=Ae;else{let{lineWidth:ve}=i.binaryOptions,_e=Math.ceil(Ae.length/ve),Pe=new Array(_e);for(let Ce=0,Y=0;Ce<_e;++Ce,Y+=ve)Pe[Ce]=Ae.substr(Y,ve);k=Pe.join(I===t.Type.BLOCK_LITERAL?`
85
+ `:" ")}return i.stringifyString({comment:_,type:I,value:k},V,G,ee)}};function p(_,I){let k=i.resolveSeq(_,I);for(let V=0;V<k.items.length;++V){let G=k.items[V];if(!(G instanceof i.Pair)){if(G instanceof i.YAMLMap){if(G.items.length>1){let Ae="Each pair must have its own sequence indicator";throw new t.YAMLSemanticError(I,Ae)}let ee=G.items[0]||new i.Pair;G.commentBefore&&(ee.commentBefore=ee.commentBefore?`${G.commentBefore}
86
86
  ${ee.commentBefore}`:G.commentBefore),G.comment&&(ee.comment=ee.comment?`${G.comment}
87
- ${ee.comment}`:G.comment),G=ee}k.items[V]=G instanceof i.Pair?G:new i.Pair(G)}}return k}function f(_,I,k){let V=new i.YAMLSeq(_);V.tag="tag:yaml.org,2002:pairs";for(let G of I){let ee,Oe;if(Array.isArray(G))if(G.length===2)ee=G[0],Oe=G[1];else throw new TypeError(`Expected [key, value] tuple: ${G}`);else if(G&&G instanceof Object){let _e=Object.keys(G);if(_e.length===1)ee=_e[0],Oe=G[ee];else throw new TypeError(`Expected { key: value } tuple: ${G}`)}else ee=G;let ve=_.createPair(ee,Oe,k);V.items.push(ve)}return V}var d={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:p,createNode:f},O=class Rr extends i.YAMLSeq{constructor(){super(),t._defineProperty(this,"add",i.YAMLMap.prototype.add.bind(this)),t._defineProperty(this,"delete",i.YAMLMap.prototype.delete.bind(this)),t._defineProperty(this,"get",i.YAMLMap.prototype.get.bind(this)),t._defineProperty(this,"has",i.YAMLMap.prototype.has.bind(this)),t._defineProperty(this,"set",i.YAMLMap.prototype.set.bind(this)),this.tag=Rr.tag}toJSON(I,k){let V=new Map;k&&k.onCreate&&k.onCreate(V);for(let G of this.items){let ee,Oe;if(G instanceof i.Pair?(ee=i.toJSON(G.key,"",k),Oe=i.toJSON(G.value,ee,k)):ee=i.toJSON(G,"",k),V.has(ee))throw new Error("Ordered maps must not include duplicate keys");V.set(ee,Oe)}return V}};t._defineProperty(O,"tag","tag:yaml.org,2002:omap");function D(_,I){let k=p(_,I),V=[];for(let{key:G}of k.items)if(G instanceof i.Scalar)if(V.includes(G.value)){let ee="Ordered maps must not include duplicate keys";throw new t.YAMLSemanticError(I,ee)}else V.push(G.value);return Object.assign(new O,k)}function T(_,I,k){let V=f(_,I,k),G=new O;return G.items=V.items,G}var $={identify:_=>_ instanceof Map,nodeClass:O,default:!1,tag:"tag:yaml.org,2002:omap",resolve:D,createNode:T},E=class Pr extends i.YAMLMap{constructor(){super(),this.tag=Pr.tag}add(I){let k=I instanceof i.Pair?I:new i.Pair(I);i.findPair(this.items,k.key)||this.items.push(k)}get(I,k){let V=i.findPair(this.items,I);return!k&&V instanceof i.Pair?V.key instanceof i.Scalar?V.key.value:V.key:V}set(I,k){if(typeof k!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof k}`);let V=i.findPair(this.items,I);V&&!k?this.items.splice(this.items.indexOf(V),1):!V&&k&&this.items.push(new i.Pair(I))}toJSON(I,k){return super.toJSON(I,k,Set)}toString(I,k,V){if(!I)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(I,k,V);throw new Error("Set items must all have null values")}};t._defineProperty(E,"tag","tag:yaml.org,2002:set");function J(_,I){let k=i.resolveMap(_,I);if(!k.hasAllNullValues())throw new t.YAMLSemanticError(I,"Set items must all have null values");return Object.assign(new E,k)}function W(_,I,k){let V=new E;for(let G of I)V.items.push(_.createPair(G,null,k));return V}var ae={identify:_=>_ instanceof Set,nodeClass:E,default:!1,tag:"tag:yaml.org,2002:set",resolve:J,createNode:W},Q=(_,I)=>{let k=I.split(":").reduce((V,G)=>V*60+Number(G),0);return _==="-"?-k:k},ne=({value:_})=>{if(isNaN(_)||!isFinite(_))return i.stringifyNumber(_);let I="";_<0&&(I="-",_=Math.abs(_));let k=[_%60];return _<60?k.unshift(0):(_=Math.round((_-k[0])/60),k.unshift(_%60),_>=60&&(_=Math.round((_-k[0])/60),k.unshift(_))),I+k.map(V=>V<10?"0"+String(V):String(V)).join(":").replace(/000000\d*$/,"")},he={identify:_=>typeof _=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(_,I,k)=>Q(I,k.replace(/_/g,"")),stringify:ne},ye={identify:_=>typeof _=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(_,I,k)=>Q(I,k.replace(/_/g,"")),stringify:ne},j={identify:_=>_ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:/^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\.[0-9]+)?)(?:[ \t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$/,resolve:(_,I,k,V,G,ee,Oe,ve,_e)=>{ve&&(ve=(ve+"00").substr(1,3));let Pe=Date.UTC(I,k-1,V,G||0,ee||0,Oe||0,ve||0);if(_e&&_e!=="Z"){let Ce=Q(_e[0],_e.slice(1));Math.abs(Ce)<30&&(Ce*=60),Pe-=6e4*Ce}return new Date(Pe)},stringify:({value:_})=>_.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function w(_){let I=typeof process!="undefined"&&process.env||{};return _?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!I.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!I.YAML_SILENCE_WARNINGS}function b(_,I){if(w(!1)){let k=typeof process!="undefined"&&process.emitWarning;k?k(_,I):console.warn(I?`${I}: ${_}`:_)}}function R(_){if(w(!0)){let I=_.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");b(`The endpoint 'yaml/${I}' will be removed in a future release.`,"DeprecationWarning")}}var x={};function M(_,I){if(!x[_]&&w(!0)){x[_]=!0;let k=`The option '${_}' will be removed in a future release`;k+=I?`, use '${I}' instead.`:".",b(k,"DeprecationWarning")}}e.binary=l,e.floatTime=ye,e.intTime=he,e.omap=$,e.pairs=d,e.set=ae,e.timestamp=j,e.warn=b,e.warnFileDeprecation=R,e.warnOptionDeprecation=M}}),ki=$e({"node_modules/yaml/dist/Schema-88e323a7.js"(e){var t=Tt(),i=Ft(),l=zn();function p(m,N,K){let H=new i.YAMLMap(m);if(N instanceof Map)for(let[re,le]of N)H.items.push(m.createPair(re,le,K));else if(N&&typeof N=="object")for(let re of Object.keys(N))H.items.push(m.createPair(re,N[re],K));return typeof m.sortMapEntries=="function"&&H.items.sort(m.sortMapEntries),H}var f={createNode:p,default:!0,nodeClass:i.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:i.resolveMap};function d(m,N,K){let H=new i.YAMLSeq(m);if(N&&N[Symbol.iterator])for(let re of N){let le=m.createNode(re,K.wrapScalars,null,K);H.items.push(le)}return H}var O={createNode:d,default:!0,nodeClass:i.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:i.resolveSeq},D={identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify(m,N,K,H){return N=Object.assign({actualString:!0},N),i.stringifyString(m,N,K,H)},options:i.strOptions},T=[f,O,D],$=m=>typeof m=="bigint"||Number.isInteger(m),E=(m,N,K)=>i.intOptions.asBigInt?BigInt(m):parseInt(N,K);function J(m,N,K){let{value:H}=m;return $(H)&&H>=0?K+H.toString(N):i.stringifyNumber(m)}var W={identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:i.nullOptions,stringify:()=>i.nullOptions.nullStr},ae={identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:m=>m[0]==="t"||m[0]==="T",options:i.boolOptions,stringify:({value:m})=>m?i.boolOptions.trueStr:i.boolOptions.falseStr},Q={identify:m=>$(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(m,N)=>E(m,N,8),options:i.intOptions,stringify:m=>J(m,8,"0o")},ne={identify:$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:m=>E(m,m,10),options:i.intOptions,stringify:i.stringifyNumber},he={identify:m=>$(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(m,N)=>E(m,N,16),options:i.intOptions,stringify:m=>J(m,16,"0x")},ye={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(m,N)=>N?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},j={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m),stringify:({value:m})=>Number(m).toExponential()},w={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(m,N,K){let H=N||K,re=new i.Scalar(parseFloat(m));return H&&H[H.length-1]==="0"&&(re.minFractionDigits=H.length),re},stringify:i.stringifyNumber},b=T.concat([W,ae,Q,ne,he,ye,j,w]),R=m=>typeof m=="bigint"||Number.isInteger(m),x=({value:m})=>JSON.stringify(m),M=[f,O,{identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify:x},{identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:x},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:m=>m==="true",stringify:x},{identify:R,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:m=>i.intOptions.asBigInt?BigInt(m):parseInt(m,10),stringify:({value:m})=>R(m)?m.toString():JSON.stringify(m)},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:m=>parseFloat(m),stringify:x}];M.scalarFallback=m=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(m)}`)};var _=({value:m})=>m?i.boolOptions.trueStr:i.boolOptions.falseStr,I=m=>typeof m=="bigint"||Number.isInteger(m);function k(m,N,K){let H=N.replace(/_/g,"");if(i.intOptions.asBigInt){switch(K){case 2:H=`0b${H}`;break;case 8:H=`0o${H}`;break;case 16:H=`0x${H}`;break}let le=BigInt(H);return m==="-"?BigInt(-1)*le:le}let re=parseInt(H,K);return m==="-"?-1*re:re}function V(m,N,K){let{value:H}=m;if(I(H)){let re=H.toString(N);return H<0?"-"+K+re.substr(1):K+re}return i.stringifyNumber(m)}var G=T.concat([{identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:i.nullOptions,stringify:()=>i.nullOptions.nullStr},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:i.boolOptions,stringify:_},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:i.boolOptions,stringify:_},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(m,N,K)=>k(N,K,2),stringify:m=>V(m,2,"0b")},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(m,N,K)=>k(N,K,8),stringify:m=>V(m,8,"0")},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(m,N,K)=>k(N,K,10),stringify:i.stringifyNumber},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(m,N,K)=>k(N,K,16),stringify:m=>V(m,16,"0x")},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(m,N)=>N?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m.replace(/_/g,"")),stringify:({value:m})=>Number(m).toExponential()},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(m,N){let K=new i.Scalar(parseFloat(m.replace(/_/g,"")));if(N){let H=N.replace(/_/g,"");H[H.length-1]==="0"&&(K.minFractionDigits=H.length)}return K},stringify:i.stringifyNumber}],l.binary,l.omap,l.pairs,l.set,l.intTime,l.floatTime,l.timestamp),ee={core:b,failsafe:T,json:M,yaml11:G},Oe={binary:l.binary,bool:ae,float:w,floatExp:j,floatNaN:ye,floatTime:l.floatTime,int:ne,intHex:he,intOct:Q,intTime:l.intTime,map:f,null:W,omap:l.omap,pairs:l.pairs,seq:O,set:l.set,timestamp:l.timestamp};function ve(m,N,K){if(N){let H=K.filter(le=>le.tag===N),re=H.find(le=>!le.format)||H[0];if(!re)throw new Error(`Tag ${N} not found`);return re}return K.find(H=>(H.identify&&H.identify(m)||H.class&&m instanceof H.class)&&!H.format)}function _e(m,N,K){if(m instanceof i.Node)return m;let{defaultPrefix:H,onTagObj:re,prevObjects:le,schema:Ye,wrapScalars:Qe}=K;N&&N.startsWith("!!")&&(N=H+N.slice(2));let Ze=ve(m,N,Ye.tags);if(!Ze){if(typeof m.toJSON=="function"&&(m=m.toJSON()),!m||typeof m!="object")return Qe?new i.Scalar(m):m;Ze=m instanceof Map?f:m[Symbol.iterator]?O:f}re&&(re(Ze),delete K.onTagObj);let ze={value:void 0,node:void 0};if(m&&typeof m=="object"&&le){let _t=le.get(m);if(_t){let Bt=new i.Alias(_t);return K.aliasNodes.push(Bt),Bt}ze.value=m,le.set(m,ze)}return ze.node=Ze.createNode?Ze.createNode(K.schema,m,K):Qe?new i.Scalar(m):m,N&&ze.node instanceof i.Node&&(ze.node.tag=N),ze.node}function Pe(m,N,K,H){let re=m[H.replace(/\W/g,"")];if(!re){let le=Object.keys(m).map(Ye=>JSON.stringify(Ye)).join(", ");throw new Error(`Unknown schema "${H}"; use one of ${le}`)}if(Array.isArray(K))for(let le of K)re=re.concat(le);else typeof K=="function"&&(re=K(re.slice()));for(let le=0;le<re.length;++le){let Ye=re[le];if(typeof Ye=="string"){let Qe=N[Ye];if(!Qe){let Ze=Object.keys(N).map(ze=>JSON.stringify(ze)).join(", ");throw new Error(`Unknown custom tag "${Ye}"; use one of ${Ze}`)}re[le]=Qe}}return re}var Ce=(m,N)=>m.key<N.key?-1:m.key>N.key?1:0,Y=class xr{constructor({customTags:N,merge:K,schema:H,sortMapEntries:re,tags:le}){this.merge=!!K,this.name=H,this.sortMapEntries=re===!0?Ce:re||null,!N&&le&&l.warnOptionDeprecation("tags","customTags"),this.tags=Pe(ee,Oe,N||le,H)}createNode(N,K,H,re){let le={defaultPrefix:xr.defaultPrefix,schema:this,wrapScalars:K},Ye=re?Object.assign(re,le):le;return _e(N,H,Ye)}createPair(N,K,H){H||(H={wrapScalars:!0});let re=this.createNode(N,H.wrapScalars,null,H),le=this.createNode(K,H.wrapScalars,null,H);return new i.Pair(re,le)}};t._defineProperty(Y,"defaultPrefix",t.defaultTagPrefix),t._defineProperty(Y,"defaultTags",t.defaultTags),e.Schema=Y}}),Ci=$e({"node_modules/yaml/dist/types.js"(e){var t=Ft(),i=ki();Tt(),zn(),e.Alias=t.Alias,e.Collection=t.Collection,e.Merge=t.Merge,e.Node=t.Node,e.Pair=t.Pair,e.Scalar=t.Scalar,e.YAMLMap=t.YAMLMap,e.YAMLSeq=t.YAMLSeq,e.binaryOptions=t.binaryOptions,e.boolOptions=t.boolOptions,e.intOptions=t.intOptions,e.nullOptions=t.nullOptions,e.strOptions=t.strOptions,e.Schema=i.Schema}}),Xn={},Qn=()=>Xn,Mi=e=>{Object.assign(Xn,e)},Li=class{constructor(){this.data={}}unregister(e){e?delete this.data[e]:this.data={}}register(e,t){this.data[e]=t}registerMany(e){Object.keys(e).forEach(t=>{this.data[t]=e[t]})}get(e){return this.data[e]}list(){return this.data}},Zn=Li,ue={},ei=ue,ue.defaultInvalidTypeProduct=void 0,ue.defaultRandExpMax=10,ue.pruneProperties=[],ue.ignoreProperties=[],ue.ignoreMissingRefs=!1,ue.failOnInvalidTypes=!0,ue.failOnInvalidFormat=!0,ue.alwaysFakeOptionals=!1,ue.optionalsProbability=null,ue.fixedProbabilities=!1,ue.useExamplesValue=!1,ue.useDefaultValue=!1,ue.requiredOnly=!1,ue.omitNulls=!1,ue.minItems=0,ue.maxItems=null,ue.minLength=0,ue.maxLength=null,ue.resolveJsonPath=!1,ue.reuseProperties=!1,ue.fillProperties=!0,ue.sortProperties=!1,ue.replaceEmptyByRandomValue=!1,ue.random=Math.random,ue.minDateTime=new Date("1889-12-31T00:00:00.000Z"),ue.maxDateTime=new Date("1970-01-01T00:00:01.000Z"),ue.renderTitle=!0,ue.renderDescription=!0,ue.renderComment=!1,Di=class extends Zn{constructor(){super(),this.data={...ei},this._defaults=ei}get defaults(){return{...this._defaults}}},Ui=Di,Ot=new Ui,Ie.getDefaults=()=>Ot.defaults,te=Ie,ti=["integer","number","string","boolean"],ni=ti.concat(["null"]),Fi=["array","object"].concat(ni),$i=2524608e6,ji=-1e8,Yi=1e8,Wi=-100,Vi=100,He={ALLOWED_TYPES:ti,SCALAR_TYPES:ni,ALL_TYPES:Fi,MIN_NUMBER:Wi,MAX_NUMBER:Vi,MIN_INTEGER:ji,MAX_INTEGER:Yi,MOST_NEAR_DATETIME:$i},$t=Kn(Ni(),1),Z={pick:ke,date:jn,shuffle:Fe,number:Ge,randexp:Se},qi=/^(0|[1-9][0-9]*)$/,de={hasProperties:qe,getLocalRef:hi,omitProps:ks,typecast:Es,merge:dt,clone:ce,short:_s,hasValue:Rs,notValue:Ps,anyValue:yi,validate:xs,validateValueForSchema:Yn,validateValueForOneOf:Is,isKey:Ns,template:gi,shouldClean:wi,clean:Vn,isEmpty:Wn,clampDate:mi},Bi=class{constructor(){this.registry={},this.support={}}reset(e){e?(delete this.registry[e],delete this.support[e]):(this.registry={},this.support={})}extend(e,t){this.registry[e]=t(this.registry[e]),this.support[e]||(this.support[e]=Cs(()=>this.registry[e]))}define(e,t){this.support[e]=t}get(e){if(typeof this.registry[e]=="undefined")throw new ReferenceError(`'${e}' dependency doesn't exist.`);return this.registry[e]}wrap(e){if(!("generate"in e)){let t=Object.keys(e),i={},l=t.length;for(;l--;){let p=t[l].replace(/^x-/,""),f=this.support[p];if(typeof f=="function"){Object.defineProperty(e,"generate",{configurable:!1,enumerable:!1,writable:!1,value:(d,O)=>f.call(i,e[t[l]],e,t[l],d,O.slice())});break}}}return e}},Ji=Bi,ht=new Zn,ii=Ms,Gi=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},jt=Gi,At={array:["additionalItems","items","maxItems","minItems","uniqueItems"],integer:["exclusiveMaximum","exclusiveMinimum","maximum","minimum","multipleOf"],object:["additionalProperties","dependencies","maxProperties","minProperties","patternProperties","properties","required"],string:["maxLength","minLength","pattern","format"]},At.number=At.integer,Ki=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Hi=Ds,zi=Us,Xi=zi,Qi=Xi,Zi=Fs,er=Zi,tr=er,nr=js,ri=Ys,ir=Ws,rr=`Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore
87
+ ${ee.comment}`:G.comment),G=ee}k.items[V]=G instanceof i.Pair?G:new i.Pair(G)}}return k}function h(_,I,k){let V=new i.YAMLSeq(_);V.tag="tag:yaml.org,2002:pairs";for(let G of I){let ee,Ae;if(Array.isArray(G))if(G.length===2)ee=G[0],Ae=G[1];else throw new TypeError(`Expected [key, value] tuple: ${G}`);else if(G&&G instanceof Object){let _e=Object.keys(G);if(_e.length===1)ee=_e[0],Ae=G[ee];else throw new TypeError(`Expected { key: value } tuple: ${G}`)}else ee=G;let ve=_.createPair(ee,Ae,k);V.items.push(ve)}return V}var d={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:p,createNode:h},O=class Rr extends i.YAMLSeq{constructor(){super(),t._defineProperty(this,"add",i.YAMLMap.prototype.add.bind(this)),t._defineProperty(this,"delete",i.YAMLMap.prototype.delete.bind(this)),t._defineProperty(this,"get",i.YAMLMap.prototype.get.bind(this)),t._defineProperty(this,"has",i.YAMLMap.prototype.has.bind(this)),t._defineProperty(this,"set",i.YAMLMap.prototype.set.bind(this)),this.tag=Rr.tag}toJSON(I,k){let V=new Map;k&&k.onCreate&&k.onCreate(V);for(let G of this.items){let ee,Ae;if(G instanceof i.Pair?(ee=i.toJSON(G.key,"",k),Ae=i.toJSON(G.value,ee,k)):ee=i.toJSON(G,"",k),V.has(ee))throw new Error("Ordered maps must not include duplicate keys");V.set(ee,Ae)}return V}};t._defineProperty(O,"tag","tag:yaml.org,2002:omap");function D(_,I){let k=p(_,I),V=[];for(let{key:G}of k.items)if(G instanceof i.Scalar)if(V.includes(G.value)){let ee="Ordered maps must not include duplicate keys";throw new t.YAMLSemanticError(I,ee)}else V.push(G.value);return Object.assign(new O,k)}function T(_,I,k){let V=h(_,I,k),G=new O;return G.items=V.items,G}var $={identify:_=>_ instanceof Map,nodeClass:O,default:!1,tag:"tag:yaml.org,2002:omap",resolve:D,createNode:T},E=class Pr extends i.YAMLMap{constructor(){super(),this.tag=Pr.tag}add(I){let k=I instanceof i.Pair?I:new i.Pair(I);i.findPair(this.items,k.key)||this.items.push(k)}get(I,k){let V=i.findPair(this.items,I);return!k&&V instanceof i.Pair?V.key instanceof i.Scalar?V.key.value:V.key:V}set(I,k){if(typeof k!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof k}`);let V=i.findPair(this.items,I);V&&!k?this.items.splice(this.items.indexOf(V),1):!V&&k&&this.items.push(new i.Pair(I))}toJSON(I,k){return super.toJSON(I,k,Set)}toString(I,k,V){if(!I)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(I,k,V);throw new Error("Set items must all have null values")}};t._defineProperty(E,"tag","tag:yaml.org,2002:set");function J(_,I){let k=i.resolveMap(_,I);if(!k.hasAllNullValues())throw new t.YAMLSemanticError(I,"Set items must all have null values");return Object.assign(new E,k)}function W(_,I,k){let V=new E;for(let G of I)V.items.push(_.createPair(G,null,k));return V}var ae={identify:_=>_ instanceof Set,nodeClass:E,default:!1,tag:"tag:yaml.org,2002:set",resolve:J,createNode:W},Q=(_,I)=>{let k=I.split(":").reduce((V,G)=>V*60+Number(G),0);return _==="-"?-k:k},ne=({value:_})=>{if(isNaN(_)||!isFinite(_))return i.stringifyNumber(_);let I="";_<0&&(I="-",_=Math.abs(_));let k=[_%60];return _<60?k.unshift(0):(_=Math.round((_-k[0])/60),k.unshift(_%60),_>=60&&(_=Math.round((_-k[0])/60),k.unshift(_))),I+k.map(V=>V<10?"0"+String(V):String(V)).join(":").replace(/000000\d*$/,"")},he={identify:_=>typeof _=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(_,I,k)=>Q(I,k.replace(/_/g,"")),stringify:ne},ye={identify:_=>typeof _=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(_,I,k)=>Q(I,k.replace(/_/g,"")),stringify:ne},j={identify:_=>_ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:/^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\.[0-9]+)?)(?:[ \t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$/,resolve:(_,I,k,V,G,ee,Ae,ve,_e)=>{ve&&(ve=(ve+"00").substr(1,3));let Pe=Date.UTC(I,k-1,V,G||0,ee||0,Ae||0,ve||0);if(_e&&_e!=="Z"){let Ce=Q(_e[0],_e.slice(1));Math.abs(Ce)<30&&(Ce*=60),Pe-=6e4*Ce}return new Date(Pe)},stringify:({value:_})=>_.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function w(_){let I=typeof process!="undefined"&&process.env||{};return _?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!I.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!I.YAML_SILENCE_WARNINGS}function b(_,I){if(w(!1)){let k=typeof process!="undefined"&&process.emitWarning;k?k(_,I):console.warn(I?`${I}: ${_}`:_)}}function R(_){if(w(!0)){let I=_.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");b(`The endpoint 'yaml/${I}' will be removed in a future release.`,"DeprecationWarning")}}var x={};function M(_,I){if(!x[_]&&w(!0)){x[_]=!0;let k=`The option '${_}' will be removed in a future release`;k+=I?`, use '${I}' instead.`:".",b(k,"DeprecationWarning")}}e.binary=c,e.floatTime=ye,e.intTime=he,e.omap=$,e.pairs=d,e.set=ae,e.timestamp=j,e.warn=b,e.warnFileDeprecation=R,e.warnOptionDeprecation=M}}),ki=$e({"node_modules/yaml/dist/Schema-88e323a7.js"(e){var t=Tt(),i=Ft(),c=zn();function p(m,N,K){let H=new i.YAMLMap(m);if(N instanceof Map)for(let[re,le]of N)H.items.push(m.createPair(re,le,K));else if(N&&typeof N=="object")for(let re of Object.keys(N))H.items.push(m.createPair(re,N[re],K));return typeof m.sortMapEntries=="function"&&H.items.sort(m.sortMapEntries),H}var h={createNode:p,default:!0,nodeClass:i.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:i.resolveMap};function d(m,N,K){let H=new i.YAMLSeq(m);if(N&&N[Symbol.iterator])for(let re of N){let le=m.createNode(re,K.wrapScalars,null,K);H.items.push(le)}return H}var O={createNode:d,default:!0,nodeClass:i.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:i.resolveSeq},D={identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify(m,N,K,H){return N=Object.assign({actualString:!0},N),i.stringifyString(m,N,K,H)},options:i.strOptions},T=[h,O,D],$=m=>typeof m=="bigint"||Number.isInteger(m),E=(m,N,K)=>i.intOptions.asBigInt?BigInt(m):parseInt(N,K);function J(m,N,K){let{value:H}=m;return $(H)&&H>=0?K+H.toString(N):i.stringifyNumber(m)}var W={identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:i.nullOptions,stringify:()=>i.nullOptions.nullStr},ae={identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:m=>m[0]==="t"||m[0]==="T",options:i.boolOptions,stringify:({value:m})=>m?i.boolOptions.trueStr:i.boolOptions.falseStr},Q={identify:m=>$(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(m,N)=>E(m,N,8),options:i.intOptions,stringify:m=>J(m,8,"0o")},ne={identify:$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:m=>E(m,m,10),options:i.intOptions,stringify:i.stringifyNumber},he={identify:m=>$(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(m,N)=>E(m,N,16),options:i.intOptions,stringify:m=>J(m,16,"0x")},ye={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(m,N)=>N?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},j={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m),stringify:({value:m})=>Number(m).toExponential()},w={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(m,N,K){let H=N||K,re=new i.Scalar(parseFloat(m));return H&&H[H.length-1]==="0"&&(re.minFractionDigits=H.length),re},stringify:i.stringifyNumber},b=T.concat([W,ae,Q,ne,he,ye,j,w]),R=m=>typeof m=="bigint"||Number.isInteger(m),x=({value:m})=>JSON.stringify(m),M=[h,O,{identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify:x},{identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:x},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:m=>m==="true",stringify:x},{identify:R,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:m=>i.intOptions.asBigInt?BigInt(m):parseInt(m,10),stringify:({value:m})=>R(m)?m.toString():JSON.stringify(m)},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:m=>parseFloat(m),stringify:x}];M.scalarFallback=m=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(m)}`)};var _=({value:m})=>m?i.boolOptions.trueStr:i.boolOptions.falseStr,I=m=>typeof m=="bigint"||Number.isInteger(m);function k(m,N,K){let H=N.replace(/_/g,"");if(i.intOptions.asBigInt){switch(K){case 2:H=`0b${H}`;break;case 8:H=`0o${H}`;break;case 16:H=`0x${H}`;break}let le=BigInt(H);return m==="-"?BigInt(-1)*le:le}let re=parseInt(H,K);return m==="-"?-1*re:re}function V(m,N,K){let{value:H}=m;if(I(H)){let re=H.toString(N);return H<0?"-"+K+re.substr(1):K+re}return i.stringifyNumber(m)}var G=T.concat([{identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:i.nullOptions,stringify:()=>i.nullOptions.nullStr},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:i.boolOptions,stringify:_},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:i.boolOptions,stringify:_},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(m,N,K)=>k(N,K,2),stringify:m=>V(m,2,"0b")},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(m,N,K)=>k(N,K,8),stringify:m=>V(m,8,"0")},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(m,N,K)=>k(N,K,10),stringify:i.stringifyNumber},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(m,N,K)=>k(N,K,16),stringify:m=>V(m,16,"0x")},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(m,N)=>N?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m.replace(/_/g,"")),stringify:({value:m})=>Number(m).toExponential()},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(m,N){let K=new i.Scalar(parseFloat(m.replace(/_/g,"")));if(N){let H=N.replace(/_/g,"");H[H.length-1]==="0"&&(K.minFractionDigits=H.length)}return K},stringify:i.stringifyNumber}],c.binary,c.omap,c.pairs,c.set,c.intTime,c.floatTime,c.timestamp),ee={core:b,failsafe:T,json:M,yaml11:G},Ae={binary:c.binary,bool:ae,float:w,floatExp:j,floatNaN:ye,floatTime:c.floatTime,int:ne,intHex:he,intOct:Q,intTime:c.intTime,map:h,null:W,omap:c.omap,pairs:c.pairs,seq:O,set:c.set,timestamp:c.timestamp};function ve(m,N,K){if(N){let H=K.filter(le=>le.tag===N),re=H.find(le=>!le.format)||H[0];if(!re)throw new Error(`Tag ${N} not found`);return re}return K.find(H=>(H.identify&&H.identify(m)||H.class&&m instanceof H.class)&&!H.format)}function _e(m,N,K){if(m instanceof i.Node)return m;let{defaultPrefix:H,onTagObj:re,prevObjects:le,schema:Ye,wrapScalars:Qe}=K;N&&N.startsWith("!!")&&(N=H+N.slice(2));let Ze=ve(m,N,Ye.tags);if(!Ze){if(typeof m.toJSON=="function"&&(m=m.toJSON()),!m||typeof m!="object")return Qe?new i.Scalar(m):m;Ze=m instanceof Map?h:m[Symbol.iterator]?O:h}re&&(re(Ze),delete K.onTagObj);let ze={value:void 0,node:void 0};if(m&&typeof m=="object"&&le){let _t=le.get(m);if(_t){let Bt=new i.Alias(_t);return K.aliasNodes.push(Bt),Bt}ze.value=m,le.set(m,ze)}return ze.node=Ze.createNode?Ze.createNode(K.schema,m,K):Qe?new i.Scalar(m):m,N&&ze.node instanceof i.Node&&(ze.node.tag=N),ze.node}function Pe(m,N,K,H){let re=m[H.replace(/\W/g,"")];if(!re){let le=Object.keys(m).map(Ye=>JSON.stringify(Ye)).join(", ");throw new Error(`Unknown schema "${H}"; use one of ${le}`)}if(Array.isArray(K))for(let le of K)re=re.concat(le);else typeof K=="function"&&(re=K(re.slice()));for(let le=0;le<re.length;++le){let Ye=re[le];if(typeof Ye=="string"){let Qe=N[Ye];if(!Qe){let Ze=Object.keys(N).map(ze=>JSON.stringify(ze)).join(", ");throw new Error(`Unknown custom tag "${Ye}"; use one of ${Ze}`)}re[le]=Qe}}return re}var Ce=(m,N)=>m.key<N.key?-1:m.key>N.key?1:0,Y=class xr{constructor({customTags:N,merge:K,schema:H,sortMapEntries:re,tags:le}){this.merge=!!K,this.name=H,this.sortMapEntries=re===!0?Ce:re||null,!N&&le&&c.warnOptionDeprecation("tags","customTags"),this.tags=Pe(ee,Ae,N||le,H)}createNode(N,K,H,re){let le={defaultPrefix:xr.defaultPrefix,schema:this,wrapScalars:K},Ye=re?Object.assign(re,le):le;return _e(N,H,Ye)}createPair(N,K,H){H||(H={wrapScalars:!0});let re=this.createNode(N,H.wrapScalars,null,H),le=this.createNode(K,H.wrapScalars,null,H);return new i.Pair(re,le)}};t._defineProperty(Y,"defaultPrefix",t.defaultTagPrefix),t._defineProperty(Y,"defaultTags",t.defaultTags),e.Schema=Y}}),Ci=$e({"node_modules/yaml/dist/types.js"(e){var t=Ft(),i=ki();Tt(),zn(),e.Alias=t.Alias,e.Collection=t.Collection,e.Merge=t.Merge,e.Node=t.Node,e.Pair=t.Pair,e.Scalar=t.Scalar,e.YAMLMap=t.YAMLMap,e.YAMLSeq=t.YAMLSeq,e.binaryOptions=t.binaryOptions,e.boolOptions=t.boolOptions,e.intOptions=t.intOptions,e.nullOptions=t.nullOptions,e.strOptions=t.strOptions,e.Schema=i.Schema}}),Xn={},Qn=()=>Xn,Mi=e=>{Object.assign(Xn,e)},Li=class{constructor(){this.data={}}unregister(e){e?delete this.data[e]:this.data={}}register(e,t){this.data[e]=t}registerMany(e){Object.keys(e).forEach(t=>{this.data[t]=e[t]})}get(e){return this.data[e]}list(){return this.data}},Zn=Li,ue={},ei=ue,ue.defaultInvalidTypeProduct=void 0,ue.defaultRandExpMax=10,ue.pruneProperties=[],ue.ignoreProperties=[],ue.ignoreMissingRefs=!1,ue.failOnInvalidTypes=!0,ue.failOnInvalidFormat=!0,ue.alwaysFakeOptionals=!1,ue.optionalsProbability=null,ue.fixedProbabilities=!1,ue.useExamplesValue=!1,ue.useDefaultValue=!1,ue.requiredOnly=!1,ue.omitNulls=!1,ue.minItems=0,ue.maxItems=null,ue.minLength=0,ue.maxLength=null,ue.resolveJsonPath=!1,ue.reuseProperties=!1,ue.fillProperties=!0,ue.sortProperties=!1,ue.replaceEmptyByRandomValue=!1,ue.random=Math.random,ue.minDateTime=new Date("1889-12-31T00:00:00.000Z"),ue.maxDateTime=new Date("1970-01-01T00:00:01.000Z"),ue.renderTitle=!0,ue.renderDescription=!0,ue.renderComment=!1,Di=class extends Zn{constructor(){super(),this.data={...ei},this._defaults=ei}get defaults(){return{...this._defaults}}},Ui=Di,Ot=new Ui,Ie.getDefaults=()=>Ot.defaults,te=Ie,ti=["integer","number","string","boolean"],ni=ti.concat(["null"]),Fi=["array","object"].concat(ni),$i=2524608e6,ji=-1e8,Yi=1e8,Wi=-100,Vi=100,He={ALLOWED_TYPES:ti,SCALAR_TYPES:ni,ALL_TYPES:Fi,MIN_NUMBER:Wi,MAX_NUMBER:Vi,MIN_INTEGER:ji,MAX_INTEGER:Yi,MOST_NEAR_DATETIME:$i},$t=Kn(Ni(),1),Z={pick:ke,date:jn,shuffle:Fe,number:Ge,randexp:be},qi=/^(0|[1-9][0-9]*)$/,de={hasProperties:qe,getLocalRef:hi,omitProps:ks,typecast:Es,merge:dt,clone:ce,short:_s,hasValue:Rs,notValue:Ps,anyValue:yi,validate:xs,validateValueForSchema:Yn,validateValueForOneOf:Is,isKey:Ns,template:gi,shouldClean:wi,clean:Vn,isEmpty:Wn,clampDate:mi},Bi=class{constructor(){this.registry={},this.support={}}reset(e){e?(delete this.registry[e],delete this.support[e]):(this.registry={},this.support={})}extend(e,t){this.registry[e]=t(this.registry[e]),this.support[e]||(this.support[e]=Cs(()=>this.registry[e]))}define(e,t){this.support[e]=t}get(e){if(typeof this.registry[e]=="undefined")throw new ReferenceError(`'${e}' dependency doesn't exist.`);return this.registry[e]}wrap(e){if(!("generate"in e)){let t=Object.keys(e),i={},c=t.length;for(;c--;){let p=t[c].replace(/^x-/,""),h=this.support[p];if(typeof h=="function"){Object.defineProperty(e,"generate",{configurable:!1,enumerable:!1,writable:!1,value:(d,O)=>h.call(i,e[t[c]],e,t[c],d,O.slice())});break}}}return e}},Ji=Bi,ht=new Zn,ii=Ms,Gi=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},jt=Gi,At={array:["additionalItems","items","maxItems","minItems","uniqueItems"],integer:["exclusiveMaximum","exclusiveMinimum","maximum","minimum","multipleOf"],object:["additionalProperties","dependencies","maxProperties","minProperties","patternProperties","properties","required"],string:["maxLength","minLength","pattern","format"]},At.number=At.integer,Ki=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Hi=Ds,zi=Us,Xi=zi,Qi=Xi,Zi=Fs,er=Zi,tr=er,nr=js,ri=Ys,ir=Ws,rr=`Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore
88
88
  et dolore magna aliqua Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
89
89
  commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
90
90
  pariatur Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est
91
- laborum`.split(/\W/),Yt=Vs,Wt={type:He.ALLOWED_TYPES},sr=qs,si=Bs,or=Js,Vt=Gs,ar=Ks,lr=Hs,oi="[a-zA-Z][a-zA-Z0-9+-.]*",qt=`https?://{hostname}(?:${oi})+`,cr="(?:\\?([a-z]{1,7}(=\\w{1,5})?&){0,3})?",je={email:"[a-zA-Z\\d][a-zA-Z\\d-]{1,13}[a-zA-Z\\d]@{hostname}",hostname:"[a-zA-Z]{1,33}\\.[a-z]{2,4}",ipv6:"[a-f\\d]{4}(:[a-f\\d]{4}){7}",uri:qt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${qt}${cr}`,"uri-template":qt.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${oi.replace("]*","/]*")}|~[01]))+`,uuid:"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$",duration:"^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$"},je.iri=je["uri-reference"],je["iri-reference"]=je["uri-reference"],je["idn-email"]=je.email,je["idn-hostname"]=je.hostname,pr=new RegExp(`\\{(${Object.keys(je).join("|")})\\}`),ur=zs,dr=Qs,fr={boolean:Qi,null:tr,array:nr,integer:ir,number:ri,object:sr,string:dr},vt=fr,hr=ft,mr=({refs:e,schema:t,container:i,synchronous:l,refDepthMax:p,refDepthMin:f})=>{let d={},O={},D=0,T,$;return d.resolveSchema=(E,J,W)=>{if(E==null)return null;if(typeof E.generate=="function")return E;if(typeof(E.$id||E.id)=="string"&&(delete E.id,delete E.$id,delete E.$schema),typeof E.$ref=="string"){let Q=Math.max(f,p)-1;if(E.$ref==="#"||O[E.$ref]<0||T===E.$ref&&++D>Q)return E.$ref!=="#"&&$&&$.length===W.length?de.getLocalRef(t,E.$ref,l&&e):(delete E.$ref,E);typeof O[E.$ref]=="undefined"&&(O[E.$ref]=Z.number(f,p)-1),$=W,T=E.$ref;let ne;E.$ref.indexOf("#/")===-1?ne=e[E.$ref]||null:ne=de.getLocalRef(t,E.$ref,l&&e)||null;let he;if(typeof ne!="undefined"){if(!ne&&te("ignoreMissingRefs")!==!0)throw new Error(`Reference not found: ${E.$ref}`);O[E.$ref]-=1,de.merge(E,ne||{}),he=l&&ne&&ne.$ref}return he||delete E.$ref,E}if(Array.isArray(E.allOf)){let Q=E.allOf;delete E.allOf,Q.forEach(ne=>{let he=d.resolveSchema(ne,null,W);de.merge(E,typeof he.thunk=="function"?he.thunk(E):he),Array.isArray(E.allOf)&&d.resolveSchema(E,J,W)})}if(Array.isArray(E.oneOf||E.anyOf)&&W[W.length-2]!=="dependencies"){let Q=E.oneOf||E.anyOf;return E.enum&&E.oneOf&&(E.enum=E.enum.filter(ne=>de.validate(ne,Q))),{thunk(ne){let he=de.omitProps(E,["anyOf","oneOf"]),ye=Z.pick(Q);return de.merge(he,ye),Q.forEach(j=>{j.required&&j!==ye&&j.required.forEach(w=>{if(ye.required&&ye.required.includes(w))return;let b=he.required&&he.required.includes(w);he.properties&&!b&&delete he.properties[w],ne&&ne.properties&&delete ne.properties[w]})}),he}}}if(Object.keys(E).forEach(Q=>{(Array.isArray(E[Q])||typeof E[Q]=="object")&&!de.isKey(Q)&&(E[Q]=d.resolveSchema(E[Q],Q,W.concat(Q)))}),W){let Q=W[W.length-1];if(Q==="properties"||Q==="items")return E}return i.wrap(E)},d},yr=mr,ai=no,li=io,Le=Kn(Ci(),1),oo=Le.default.binaryOptions,ao=Le.default.boolOptions,lo=Le.default.intOptions,co=Le.default.nullOptions,po=Le.default.strOptions,uo=Le.default.Schema,fo=Le.default.Alias,ho=Le.default.Collection,mo=Le.default.Merge,yo=Le.default.Node,go=Le.default.Pair,wo=Le.default.Scalar,gr=Le.default.YAMLMap,wr=Le.default.YAMLSeq,Et=so,Xe=new Ji,Te=(e,t,i)=>(console.debug("[json-schema-faker] calling JSONSchemaFaker() is deprecated, call either .generate() or .resolve()"),i&&console.debug("[json-schema-faker] local references are only supported by calling .resolve()"),Te.generate(e,t)),Te.generateWithContext=(e,t)=>{let i=Ti(t,e);return ai(i,e,Xe,!0)},Te.generate=(e,t)=>li(Te.generateWithContext(e,t)),Te.generateYAML=(e,t)=>Et(Te.generateWithContext(e,t)),Te.resolveWithContext=(e,t,i)=>{typeof t=="string"&&(i=t,t={}),i=i||(typeof process!="undefined"&&typeof process.cwd=="function"?process.cwd():""),i=`${i.replace(/\/+$/,"")}/`;let l=Ti(t,e),p={order:1,canRead(d){let O=d.url.replace("/:",":");return l[O]||l[O.split("/").pop()]},read(d,O){try{O(null,this.canRead(d))}catch(D){O(D)}}},{$RefParser:f}=Qn();return f.bundle(i,e,{resolve:{file:{order:100},http:{order:200},fixedRefs:p},dereference:{circular:"ignore"}}).then(d=>ai(l,d,Xe)).catch(d=>{throw new Error(`Error while resolving schema (${d.message})`)})},Te.resolve=(e,t,i)=>Te.resolveWithContext(e,t,i).then(li),Te.resolveYAML=(e,t,i)=>Te.resolveWithContext(e,t,i).then(Et),bi(),Te.format=ii,Te.option=te,Te.random=Z,Te.extend=(e,t)=>(Xe.extend(e,t),Te),Te.define=(e,t)=>(Xe.define(e,t),Te),Te.reset=e=>(Xe.reset(e),bi(),Te),Te.locate=e=>Xe.get(e),Te.VERSION="0.5.5",Sr={...Te},br=Te}}),bo=U({"src/src/main.iife.js"(e,t){var i=(So(),ie(Ae));typeof $RefParser!="undefined"&&typeof JSONPath!="undefined"&&i.setDependencies({...JSONPath,$RefParser}),typeof window!="undefined"&&(window.JSONSchemaFaker=i.default),t.exports=i.default,t.exports.JSONSchemaFaker=i.JSONSchemaFaker}});return bo()})();((h,n)=>{h.JSONSchemaFaker=n()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>Sn);Sn.random.shuffle=function(){return["[placeholder]"]};Sn.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function Ir(h){return Sn.generate(h)}var Nr=async(h,n)=>{let s=new TextEncoder,c=s.encode(h),S=s.encode(n),U=await crypto.subtle.importKey("raw",c,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await crypto.subtle.sign("HMAC",U,S);return Array.from(new Uint8Array(C)).map(z=>z.toString(16).padStart(2,"0")).join("")};var qo=require("cross-fetch");var kr=async()=>{if(process.env.NOVU_BRIDGE_ORIGIN)return`${process.env.NOVU_BRIDGE_ORIGIN}/api/novu`;if(process.env.NEXT_PUBLIC_VERCEL_ENV==="preview"&&process.env.NEXT_PUBLIC_VERCEL_URL)return`https://${process.env.NEXT_PUBLIC_VERCEL_URL}/api/novu`;try{if(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev"){let n=await(await fetch("http://localhost:2022/.well-known/novu")).json();return`${n.tunnelOrigin}${n.route}`}}catch(h){console.error(h)}return""};function Cr(h){return!!h&&typeof h=="object"&&"error"in h&&"message"in h&&"statusCode"in h}var bn=(h,n)=>{if(!h)throw new ln;return{post:async(s,c)=>{let S=await fetch(`${n}/v1${s}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${h}`},body:JSON.stringify(c)}),U=await S.json();if(S.ok)return U;throw Cr(U)?new cn(U.statusCode,U.error,U.message):new mt(U)},delete:async s=>(await fetch(`${n}/v1${s}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${h}`}})).json()}};var $r=require("liquidjs");function di(h,n){let s={...h};for(let c of Object.keys(n)){let S=n[c];S&&typeof S=="object"&&!Array.isArray(S)?s[c]=di(s[c]||{},S):(Array.isArray(S),s[c]=S)}return s}function Tn(h,n){let s=n.split(".").reduce((c,S)=>{if(c&&typeof c=="object")return c[S]},h);if(s==null)return"";if(typeof s=="string")return s;if(typeof s=="number"||typeof s=="boolean")return String(s);if(typeof s=="object"){let c=JSON.stringify(s);return c==="{}"?"":c}return""}function Mr(h,n=2,s,c=", "){if(!Array.isArray(h)||h.length===0)return"";let S=s?h.map(z=>typeof z!="object"||!z?"":Tn(z,s)):h;if(S.length===1)return S[0];if(S.length===2)return`${S[0]} and ${S[1]}`;if(S.length===3&&n>=3)return`${S[0]}, ${c}${S[1]} and ${S[2]}`;let U=S.slice(0,n),C=S.length-n;return`${U.join(c)} and ${C} ${C===1?"other":"others"}`}var Lr=et(require("pluralize"),1);function Dr(h,n="",s="",c="true"){if(h==null)return"";let S=0;if(Array.isArray(h)?S=h.length:typeof h=="object"?S=Object.keys(h).length:typeof h=="string"?S=+h:typeof h=="number"?S=h:S=Number(h),Number.isNaN(S)&&(S=0),S<=0)return"";let U;return s?U=S===1?n:s:U=(0,Lr.default)(n,S),c==="true"?`${S} ${U}`:U}var Bo=require("liquidjs"),Ur=et(require("pluralize"),1),Jo=require("zod");var Go="",Ko=2,Ho="other",zo=", ",Xo=" and ",Qo=", and ";function Fr(h,n=Go,s=Ko,c=Ho,S=zo,U=Xo,C=Qo){if(!Array.isArray(h)||h.length===0)return"";let z=n?h.map(Se=>typeof Se!="object"||!Se?"":Tn(Se,n)):h,ie=z.length;if(ie===1)return z[0];if(ie===2)return`${z[0]}${U}${z[1]}`;if(s>=ie){let Se=z.slice(0,ie-1),ke=z[ie-1];return`${Se.join(S)}${C}${ke}`}let Ae=z.slice(0,s),Ie=ie-s,Ne=s===1?U:C;return`${Ae.join(S)}${Ne}${Ie} ${(0,Ur.default)(c,Ie)}`}function Zo(h){return Array.isArray(h)||typeof h=="object"&&h!==null?jr(h):typeof h=="string"&&h.includes(`
92
- `)?h.replace(/\n/g,"\\n"):h==null?"":String(h)}var jr=(h,n=0)=>Array.isArray(h)||typeof h=="object"&&h!==null?JSON.stringify(h,null,n).replace(/"/g,"'").replace(/\n/g,"\\n"):h==null?"":String(h);function Yr(h){let n=new $r.Liquid({outputEscape:Zo,...h});return n.registerFilter("json",(s,c)=>jr(s,c)),n.registerFilter("digest",Mr),n.registerFilter("toSentence",Fr),n.registerFilter("pluralize",Dr),n}var pt=et(require("chalk"),1),we={info:h=>pt.default.blue(h),warning:h=>pt.default.yellow(h),error:h=>pt.default.red(h),success:h=>pt.default.green(h),underline:h=>pt.default.underline(h),bold:h=>pt.default.bold(h)},Re={SUCCESS:we.success("\u2714"),ERROR:we.error("\u2717"),WARNING:we.warning("\u26A0"),INFO:we.info("\u2139"),ARROW:we.bold("\u2192"),MOCK:we.info("\u25CB"),HYDRATED:we.bold(we.info("\u2192")),STEP:we.info("\u03C3"),ACTION:we.info("\u03B1"),DURATION:we.info("\u0394"),PROVIDER:we.info("\u2699"),OUTPUT:we.info("\u21E2"),INPUT:we.info("\u21E0"),WORKFLOW:we.info("\u03C9"),STATE:we.info("\u03C3"),EXECUTE:we.info("\u03B5"),PREVIEW:we.info("\u03C1")};function On(h){return h||process.env.NOVU_API_URL||"https://api.novu.co"}function An(h){return h||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var fi=et(require("sanitize-html"),1),ea={allowedTags:fi.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},Wr=h=>{if(!h)return h;let n=/^<!DOCTYPE .*?>/,s=h.match(n),c=(0,fi.default)(h,ea);return s?s[0]+c:c},vn=h=>Object.keys(h).reduce((n,s)=>{let c=h[s];return typeof c=="string"?n[s]=Wr(c):Array.isArray(c)?n[s]=c.map(S=>typeof S=="string"?Wr(S):typeof S=="object"?vn(S):S):typeof c=="object"&&c!==null?n[s]=vn(c):n[s]=c,n},{});function Vr(h){console.log(`
93
- ${we.bold(we.underline("Discovered workflowId:"))} '${h.workflowId}'`),h.steps.forEach((n,s)=>{let c=s===h.steps.length-1;console.log(`${c?"\u2514":"\u251C"} ${Re.STEP} Discovered stepId: '${n.stepId}' Type: '${n.type}'`),n.providers.forEach((U,C)=>{let z=C===n.providers.length-1;console.log(`${c?" ":"\u2502"} ${z?"\u2514":"\u251C"} ${Re.PROVIDER} Discovered provider: '${U.type}'`)})})}var Br=et(require("ajv"),1),Jr=et(require("ajv-formats"),1);var qr=h=>typeof structuredClone=="function"?structuredClone(h):JSON.parse(JSON.stringify(h));var En=class extends ot{constructor(s,c){let S=c.length===1?"it":"them";super(`Tried to use a ${s} in @novu/framework without ${c.join(", ")} installed. Please install ${S} by running \`npm install ${c.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var _n=async(h,n)=>{let s=new Set;if((await Promise.allSettled(h.map(S=>S.import))).forEach((S,U)=>{let C=h[U];S.status==="fulfilled"&&C.exports.every(ie=>S.value[ie]!==void 0)||s.add(C.name)}),s.size>0)throw new En(n,Array.from(s))};var Rn=class{constructor(){this.requiredImports=[];this.ajv=new Br.default({useDefaults:!0,removeAdditional:"failing"}),(0,Jr.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(n){let s=n.type==="object"||!!n.anyOf||!!n.allOf||!!n.oneOf;return s&&await _n(this.requiredImports,"JSON schema"),s}async validate(n,s){let c=this.compiledSchemas.get(s);c||(c=this.ajv.compile(s),this.compiledSchemas.set(s,c));let S=qr(n);return c(S)?{success:!0,data:S}:{success:!1,errors:c.errors.map(C=>({path:C.instancePath,message:C.message}))}}async transformToJsonSchema(n){return n}};var Pn=class{constructor(){this.requiredImports=[{name:"zod",import:import("zod"),exports:["ZodType"]},{name:"zod-to-json-schema",import:import("zod-to-json-schema"),exports:["zodToJsonSchema"]}]}async canHandle(n){let s=n.safeParseAsync!==void 0;return s&&await _n(this.requiredImports,"Zod schema"),s}async validate(n,s){let c=await s.safeParseAsync(n);return c.success?{success:!0,data:c.data}:{success:!1,errors:c.error.errors.map(S=>({path:`/${S.path.join("/")}`,message:S.message}))}}async transformToJsonSchema(n){let{zodToJsonSchema:s}=await import("zod-to-json-schema");return s(n)}};var xn=new Pn,In=new Rn,Nn=async(h,n)=>{if(await xn.canHandle(h))return xn.validate(n,h);if(await In.canHandle(h))return In.validate(n,h);throw new Error("Invalid schema")},Me=async h=>{if(await xn.canHandle(h))return xn.transformToJsonSchema(h);if(await In.canHandle(h))return In.transformToJsonSchema(h);throw new Error("Invalid schema")};function ta(){return["development",void 0,"dev"].includes(process.env.NODE_ENV)}var wt=class{constructor(n){this.discoveredWorkflows=new Map;this.discoverWorkflowPromises=new Map;this.version="2.8.0";let s=this.buildOptions(n);this.apiUrl=s.apiUrl,this.secretKey=s.secretKey,this.strictAuthentication=s.strictAuthentication,this.templateEngine=Yr()}buildOptions(n){let s={apiUrl:On(n==null?void 0:n.apiUrl),secretKey:An(n==null?void 0:n.secretKey),strictAuthentication:!ta()};return(n==null?void 0:n.strictAuthentication)!==void 0?s.strictAuthentication=n.strictAuthentication:process.env.NOVU_STRICT_AUTHENTICATION_ENABLED!==void 0&&(s.strictAuthentication=process.env.NOVU_STRICT_AUTHENTICATION_ENABLED==="true"),s}async addWorkflows(n){for(let s of n){if(this.discoveredWorkflows.has(s.id))continue;let c=this.discoverWorkflowPromises.get(s.id);if(c){await c;continue}let S=this.addWorkflow(s);this.discoverWorkflowPromises.set(s.id,S),await S}}async addWorkflow(n){try{let s=await n.discover();Vr(s),this.discoveredWorkflows.set(n.id,s)}finally{this.discoverWorkflowPromises.delete(n.id)}}healthCheck(){let n=this.getRegisteredWorkflows(),s=n.length,c=n.reduce((S,U)=>S+U.steps.length,0);return{status:"ok",sdkVersion:"2.8.0",frameworkVersion:"2024-06-26",discovered:{workflows:s,steps:c}}}getWorkflow(n){let s=this.discoveredWorkflows.get(n);if(s)return s;throw new Ct(n)}getStep(n,s){let S=this.getWorkflow(n).steps.find(U=>U.stepId===s);if(S)return S;throw new gn(s)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows()}}mock(n){return Ir(n)}async validate(n,s,c,S,U,C,z){let ie=await Nn(s,n);if(ie.success)return ie.data;switch(c){case"event":this.throwInvalidEvent(S,U,ie.errors);case"step":this.throwInvalidStep(C,S,U,ie.errors);case"provider":this.throwInvalidProvider(C,z,S,U,ie.errors);default:throw new Error(`Invalid component: '${c}'`)}}throwInvalidProvider(n,s,c,S,U){if(!n)throw new Error("stepId is required");if(!s)throw new Error("providerId is required");switch(c){case"output":throw new rn(S,n,s,U);default:throw new Error(`Invalid payload type: '${c}'`)}}throwInvalidStep(n,s,c,S){if(!n)throw new Error("stepId is required");switch(s){case"output":throw new en(c,n,S);case"result":throw new tn(c,n,S);case"controls":throw new Zt(c,n,S);default:throw new Error(`Invalid payload type: '${s}'`)}}throwInvalidEvent(n,s,c){switch(n){case"controls":throw new Qt(s,c);case"payload":throw new xt(s,c);default:throw new Error(`Invalid payload type: '${n}'`)}}executeStepFactory(n,s,c){return async(S,U,C)=>{if(c())return;let z=this.getStep(n.workflowId,S),ie=n.action==="preview";if(!ie&&S===n.stepId){let ke=await this.createStepControls(z,n),Fe=await this.compileControls(ke,n);if(await this.shouldSkip(C==null?void 0:C.skip,Fe))return s({options:{skip:!0},outputs:{},providers:{}}),{}}let Ae=this.previewStep.bind(this),Ie=this.executeStep.bind(this),Se=await(ie?Ae:Ie)(n,{...z,providers:z.providers.map(ke=>{var it;let Fe=(it=C==null?void 0:C.providers)==null?void 0:it[ke.type];if(!Fe)throw new pn(ke.type);return{...ke,resolve:Fe}}),resolve:U});return this.shouldSanitize({stepType:z.type,options:C})&&(Se={...Se,outputs:vn(Se.outputs)}),S===n.stepId&&s({...Se,options:{skip:!1}}),Se.outputs}}shouldSanitize({stepType:n,options:s}){return(s==null?void 0:s.disableOutputSanitization)===!0?!1:["email","in_app"].includes(n)}async shouldSkip(n,s){return n?n(s):!1}async executeWorkflow(n){let S=`${{execute:"Executing",preview:"Previewing"}[n.action]} workflowId:`;console.log(`
94
- ${we.bold(we.underline(S))} '${n.workflowId}'`);let U=this.getWorkflow(n.workflowId),C=process.hrtime(),z={outputs:{},providers:{},options:{skip:!1}},ie,Ae=!1,Ie=new Promise(Ke=>{ie=Ke}),Ne=Ke=>{if(Ae)throw new Error("setResult can only be called once per workflow execution");ie(),Ae=!0,z=Ke},Se=()=>Ae,ke;try{if(n.action==="execute"&&!n.payload)throw new xt(n.workflowId,{message:"Event `payload` is required"});let Ke=await this.createExecutionPayload(n,U),qe={...n,payload:Ke};await Promise.race([Ie,U.execute({payload:Ke,environment:{},controls:{},subscriber:n.subscriber,context:n.context,step:{email:this.executeStepFactory(qe,Ne,Se),sms:this.executeStepFactory(qe,Ne,Se),inApp:this.executeStepFactory(qe,Ne,Se),digest:this.executeStepFactory(qe,Ne,Se),delay:this.executeStepFactory(qe,Ne,Se),push:this.executeStepFactory(qe,Ne,Se),chat:this.executeStepFactory(qe,Ne,Se),custom:this.executeStepFactory(qe,Ne,Se),throttle:this.executeStepFactory(qe,Ne,Se)}})])}catch(Ke){ke=Ke}let Fe=process.hrtime(C),it=Fe[0],Ge=Fe[1],Dt=it*1e3+Ge/1e6,jn=ke?Re.ERROR:Re.SUCCESS,Ut={execute:"Executed",preview:"Previewed"}[n.action];if(console.log(`${jn} ${Ut} workflowId: \`${n.workflowId}\``),this.prettyPrintExecute(n,Dt,ke),ke)throw ke;return{outputs:z.outputs,providers:z.providers,options:z.options,metadata:{status:"success",error:!1,duration:Dt}}}async createExecutionPayload(n,s){let{payload:c}=n;if(n.action==="preview"){let U=this.mock(s.payload.schema);c=Object.assign(U,c)}return await this.validate(c,s.payload.unknownSchema,"event","payload",n.workflowId)}prettyPrintExecute(n,s,c){let S=c?Re.ERROR:Re.SUCCESS,C={execute:"Executed",preview:"Previewed"}[n.action],z=c?"Failed to execute":C,ie=c?we.error:we.success,Ae=`${S} ${z} workflowId: '${n.workflowId}`;console.log(`
95
- ${we.bold(ie(Ae))}'`),console.log(` \u251C ${Re.STEP} stepId: '${n.stepId}'`),console.log(` \u251C ${Re.ACTION} action: '${n.action}'`),console.log(` \u2514 ${Re.DURATION} duration: '${s.toFixed(2)}ms'
96
- `)}async executeProviders(n,s,c){return s.providers.reduce(async(S,U)=>{let C=await S,z=this.previewProvider.bind(this),ie=this.executeProvider.bind(this),Ie=await(n.action==="preview"?z:ie)(n,s,U,c);return{...C,[U.type]:Ie}},Promise.resolve({}))}previewProvider(n,s,c,S){return console.log(` ${Re.MOCK} Mocked provider: \`${c.type}\``),this.mock(c.outputs.schema)}async executeProvider(n,s,c,S){try{if(n.stepId===s.stepId){let U=await this.createStepControls(s,n),C=await c.resolve({controls:U,outputs:S}),z=await this.validate(C,c.outputs.unknownSchema,"step","output",n.workflowId,s.stepId,c.type);return console.log(` ${Re.SUCCESS} Executed provider: \`${c.type}\``),{...z,_passthrough:C._passthrough}}else return console.log(` ${Re.HYDRATED} Hydrated provider: \`${c.type}\``),{}}catch(U){throw console.log(` ${Re.ERROR} Failed to execute provider: \`${c.type}\``),new un(c.type,n.action,U)}}async executeStep(n,s){if(n.stepId===s.stepId)try{let c=await this.createStepControls(s,n),S=await this.compileControls(c,n),U=await s.resolve(S),C=await this.validate(U,s.outputs.unknownSchema,"step","output",n.workflowId,s.stepId),z=await this.executeProviders(n,s,C);return console.log(` ${Re.SUCCESS} Executed stepId: \`${s.stepId}\``),{outputs:C,providers:z}}catch(c){throw console.log(` ${Re.ERROR} Failed to execute stepId: \`${s.stepId}\``),lt(c)?c:new kt(s.stepId,n.action,c)}else try{let c=this.getStepState(n,s.stepId);if(c){let S=await this.validate(c.outputs,s.results.unknownSchema,"step","result",n.workflowId,s.stepId);return console.log(` ${Re.HYDRATED} Hydrated stepId: \`${s.stepId}\``),{outputs:S,providers:await this.executeProviders(n,s,S)}}else throw new Xt(n.workflowId,s.stepId)}catch(c){throw console.log(` ${Re.ERROR} Failed to hydrate stepId: \`${s.stepId}\``),c}}async compileControls(n,s){try{let c=this.preprocessTranslationPatterns(JSON.stringify(n)),S=this.templateEngine.parse(c),U=this.getWorkflow(s.workflowId),C={workflow:{workflowId:U.workflowId,name:U.name,description:U.description,tags:U.tags,severity:U.severity},payload:s.payload,subscriber:s.subscriber,context:s.context,steps:na(s.state),t:{}},z=await this.templateEngine.render(S,C),ie=(0,Gr.jsonrepair)(z);return JSON.parse(ie)}catch(c){throw new nn(s.workflowId,s.stepId,c)}}preprocessTranslationPatterns(n){return n.replace(/\{\{\s*t\.([\p{L}\p{N}_.-]+)\s*\}\}/gu,'{{ t.$1 | default: "{{t.$1}}" }}')}async createStepControls(n,s){return await this.validate(s.controls,n.controls.unknownSchema,"step","controls",s.workflowId,n.stepId)}async previewStep(n,s){try{return await this.constructStepForPreview(n,s)}catch(c){throw console.log(` ${Re.ERROR} Failed to preview stepId: \`${s.stepId}\``),lt(c)?c:new kt(s.stepId,n.action,c)}}async constructStepForPreview(n,s){return n.stepId===s.stepId?await this.previewRequiredStep(s,n):await this.extractMockDataForPreviousSteps(n,s)}async extractMockDataForPreviousSteps(n,s){let c={},S=this.getStepState(n,s.stepId),U=this.mock(s.results.schema);return{outputs:di(U,(S==null?void 0:S.outputs)||{}),providers:await this.executeProviders(n,s,c)}}async previewRequiredStep(n,s){let c=await this.createStepControls(n,s),S=await this.compileControls(c,s),U=await n.resolve(S),C=await this.validate(U,n.outputs.unknownSchema,"step","output",s.workflowId,n.stepId);return console.log(` ${Re.MOCK} Mocked stepId: \`${n.stepId}\``),{outputs:C,providers:await this.executeProviders(s,n,C)}}getStepState(n,s){return n.state.find(c=>c.stepId===s)}getStepCode(n,s){return{code:this.getStep(n,s).resolve.toString()}}getWorkflowCode(n){return{code:this.getWorkflow(n).execute.toString()}}getCode(n,s){let c;if(n)s?c=this.getStepCode(n,s):c=this.getWorkflowCode(n);else throw new Ct(n);return c}};function na(h){let n={};for(let s of h)n[s.stepId]=s.outputs;return n}var kn=class{constructor(n){this.handler=n.handler,this.client=n.client?n.client:new wt,this.workflows=n.workflows,this.http=bn(this.client.secretKey,this.client.apiUrl),this.frameworkName=n.frameworkName,this.hmacEnabled=this.client.strictAuthentication}createHandler(){return async(...n)=>{await this.client.addWorkflows(this.workflows);let s=await this.handler(...n),c=await this.handleAction({actions:s});return s.transformResponse(c)}}getStaticHeaders(){let n=`novu-framework:v${this.client.version}`;return{"content-type":"application/json","access-control-allow-origin":"*","access-control-allow-methods":"GET, POST","access-control-allow-headers":"*","access-control-max-age":"604800","novu-framework-version":"2024-06-26","novu-framework-sdk":"2.8.0","novu-framework-server":this.frameworkName,"user-agent":n}}createResponse(n,s){return{status:n,body:JSON.stringify(s),headers:{...this.getStaticHeaders()}}}createError(n){return{status:n.statusCode,body:JSON.stringify({message:n.message,data:n.data,code:n.code}),headers:this.getStaticHeaders()}}async handleAction({actions:n}){let s=await n.url(),c=await n.method(),S=s.searchParams.get("action")||"health-check",U=s.searchParams.get("workflowId")||"",C=s.searchParams.get("stepId")||"",z=await n.headers("novu-signature")||"",ie={};try{c==="POST"&&(ie=await n.body())}catch{}try{S!=="health-check"&&await this.validateHmac(ie,z);let Ae=this.getPostActionMap(ie,U,C,S),Ie=this.getGetActionMap(U,C);if(c==="POST")return await this.handlePostAction(S,Ae);if(c==="GET")return await this.handleGetAction(S,Ie);if(c==="OPTIONS")return this.createResponse(200,{})}catch(Ae){return this.handleError(Ae)}return this.createError(new an(c))}getPostActionMap(n,s,c,S){return{trigger:this.triggerAction({workflowId:s,...n}),execute:async()=>{let U=await this.client.executeWorkflow({...n,workflowId:s,stepId:c,action:S});return this.createResponse(200,U)},preview:async()=>{let U=await this.client.executeWorkflow({...n,workflowId:s,stepId:c,action:S});return this.createResponse(200,U)}}}triggerAction(n){return async()=>{let s={name:n.workflowId,to:n.to,payload:(n==null?void 0:n.payload)||{},transactionId:n.transactionId,overrides:n.overrides||{},...n.actor&&{actor:n.actor},...n.bridgeUrl&&{bridgeUrl:n.bridgeUrl},...n.controls&&{controls:n.controls},...n.context&&{context:n.context}},c=await this.http.post("/events/trigger",s);return this.createResponse(200,c)}}getGetActionMap(n,s){return{discover:async()=>{let c=await this.client.discover();return this.createResponse(200,c)},"health-check":async()=>{let c=await this.client.healthCheck();return this.createResponse(200,c)},code:async()=>{let c=await this.client.getCode(n,s);return this.createResponse(200,c)}}}async handlePostAction(n,s){if(Object.values(Rt).includes(n)){let c=s[n];return c()}else throw new It(n,Rt)}async handleGetAction(n,s){if(Object.values(Gt).includes(n)){let c=s[n];return c()}else throw new It(n,Gt)}handleError(n){if(lt(n))return n.statusCode>=500&&console.error(n),this.createError(n);if(Or(n))return this.createError(n);{let s=new mt(n);return console.error(s),this.createError(s)}}async validateHmac(n,s){if(!this.hmacEnabled)return;if(!s)throw new fn;if(!this.client.secretKey)throw new yn;let[c,S]=s.split(",");if(!c||!S)throw new hn;let[U,C]=c.split("="),[z,ie]=S.split("=");if(Number(U)<Date.now()-1500)throw new mn;if(!(await Nr(this.client.secretKey,`${C}.${JSON.stringify(n)}`)===ie))throw new dn}};var B={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var ra={type:"object",properties:{webhookUrl:{type:"string",format:"uri"},text:{type:"string"},blocks:{type:"array",items:{type:"object",properties:{type:{enum:["image","context","actions","divider","section","input","file","header","video","rich_text"]}},required:["type"],additionalProperties:!0}}},additionalProperties:!0},Kr={output:ra};var Hr={"chat-webhook":B,discord:B,getstream:B,"grafana-on-call":B,mattermost:B,msteams:B,"rocket-chat":B,ryver:B,slack:Kr,"whatsapp-business":B,zulip:B};var sa={type:"object",properties:{to:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:'Email address of the recipient(s). Example: "Bob bob@host.com". You can use commas to separate multiple recipients (e.g.: "test@example.com,test@example.com" or ["test@example.com", "test@example.com"]).'},from:{type:"string"},subject:{type:"string",description:"Subject of the message."},text:{type:"string",description:"Text version of the message."},html:{type:"string",description:"HTML version of the message."},message:{type:"string",description:"MIME string of the message. Make sure to use multipart/form-data to send this as a file upload."},cc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Same as To but for carbon copy"},bcc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Same as To but for blind carbon copy"},ampHtml:{type:"string"},tVersion:{type:"string"},tText:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},oTag:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Tag string. See Tagging for more information."},oDkim:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Enables/disabled DKIM signatures on per-message basis. Pass yes or no"},oDeliverytime:{type:"string",description:"Desired time of delivery. See Date Format. Note: Messages can be scheduled for a maximum of 3 days in the future."},oDeliverytimeOptimizePeriod:{type:"string"},oTimeZoneLocalize:{type:"string"},oTestmode:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Enables sending in test mode. Pass yes if needed. See Sending in Test Mode"},oTracking:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Toggles tracking on a per-message basis, see Tracking Messages for details. Pass yes or no."},oTrackingClicks:{anyOf:[{type:"string",enum:["yes","no","htmlonly"]},{type:"boolean"}],description:"Toggles clicks tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes, no or htmlonly."},oTrackingOpens:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Toggles opens tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes or no."},oRequireTls:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},oSkipVerification:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},recipientVariables:{type:"string"}},required:[],additionalProperties:!0},zr={output:sa};var ut={type:"object",properties:{name:{type:"string"},email:{type:"string"}},description:'JSON object, containing 2 properties: Name and Email address of a previously validated and active sender. Including the Name property in the JSON is optional. This property is not mandatory in case you use TemplateID and you specified a From address for the template. Format : { "Email":"value", "Name":"value" }.',required:["Email"],additionalProperties:!0},oa={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},aa={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},la={type:"object",properties:{from:ut,sender:ut,to:{type:"array",items:ut},cc:{type:"array",items:ut},bcc:{type:"array",items:ut},replyTo:ut,subject:{type:"string"},textPart:{type:"string",description:"Content of the message, sent in Text and/or HTML format. At least one of these content types needs to be specified. When the HTML part is the only part provided, Mailjet will not generate a Text-part from the HTML version. The property can't be set when you use TemplateID"},htmlPart:{type:"string",description:"Content of the message, sent in Text and/or HTML format. At least one of these content types needs to be specified. When the HTML part is the only part provided, Mailjet will not generate a Text-part from the HTML version. The property can't be set when you use TemplateID"},templateId:{type:"number",description:"an ID for a template that is previously created and stored in Mailjet's system. It is mandatory when From and TextPart and/or HtmlPart are not provided. "},templateLanguage:{type:"boolean"},templateErrorReporting:ut,templateErrorDeliver:{type:"boolean"},attachments:{type:"array",items:oa},inlineAttachments:{type:"array",items:aa},priority:{type:"number"},customCampaign:{type:"string"},deduplicateCampaign:{type:"boolean"},trackOpens:{type:"string",enum:["account_default","disabled","enabled"]},trackClicks:{type:"string",enum:["account_default","disabled","enabled"]},customId:{type:"string"},eventPayload:{type:"string"},urlTags:{type:"string"},headers:{type:"object",additionalProperties:!0},variables:{type:"object",additionalProperties:!0}},required:[],additionalProperties:!0},Xr={output:la};var Be={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},Cn={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},ca={type:"object",properties:{from:{anyOf:[{type:"string"},Be]},sender:{anyOf:[{type:"string"},Be]},to:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},cc:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},bcc:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},replyTo:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},inReplyTo:{anyOf:[{type:"string"},Be]},references:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},subject:{type:"string"},text:{anyOf:[{type:"string"},Cn]},html:{anyOf:[{type:"string"},Cn]},watchHtml:{anyOf:[{type:"string"},Cn]},amp:{anyOf:[{type:"string"},{type:"object",properties:{content:{type:"string"},path:{type:"string"},href:{type:"string"},encoding:{type:"string"},contentType:{type:"string"},raw:{anyOf:[{type:"string"},Cn]}}}]},icalEvent:{anyOf:[{type:"string"},{type:"object",properties:{content:{type:"string"},path:{type:"string"},method:{type:"string"},filename:{anyOf:[{type:"string"},{type:"boolean"}]},href:{type:"string"},encoding:{type:"string"}}}]},headers:{anyOf:[{type:"object",additionalProperties:!0},{type:"array",items:{type:"object",additionalProperties:!0}}]},list:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},attachments:{type:"array",items:{type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0}}},required:[],additionalProperties:!0},Qr={output:ca};var pa={type:"object",properties:{},required:[],additionalProperties:!1},Zr={output:pa};var ua={type:"object",properties:{personalizations:{type:"array",description:"An array of messages and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled. See our [Personalizations documentation](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) for examples.",uniqueItems:!1,maxItems:1e3,items:{type:"object",properties:{from:{title:"From Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account."},name:{type:"string",description:"A name or title associated with the sending email address."}},required:["email"]},to:{title:"To Email Array",type:"array",items:{type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},cc:{type:"array",description:"An array of recipients who will receive a copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.",maxItems:1e3,items:{title:"CC BCC Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},bcc:{type:"array",description:"An array of recipients who will receive a blind carbon copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.",maxItems:1e3,items:{title:"CC BCC Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},subject:{type:"string",description:"The subject of your email. See character length requirements according to [RFC 2822](http://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit#answer-1592310).",minLength:1},headers:{type:"object",description:"A collection of JSON key/value pairs allowing you to specify handling instructions for your email. You may not overwrite the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`"},substitutions:{type:"object",description:'Substitutions allow you to insert data without using Dynamic Transactional Templates. This field should **not** be used in combination with a Dynamic Transactional Template, which can be identified by a `templateId` starting with `d-`. This field is a collection of key/value pairs following the pattern "substitutionTag":"value to substitute". The key/value pairs must be strings. These substitutions will apply to the text and html content of the body of your email, in addition to the `subject` and `reply-to` parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object.',maxProperties:1e4},dynamicTemplateData:{type:"object",description:'Dynamic template data is available using Handlebars syntax in Dynamic Transactional Templates. This field should be used in combination with a Dynamic Transactional Template, which can be identified by a `templateId` starting with `d-`. This field is a collection of key/value pairs following the pattern "variable_name":"value to insert".'},customArgs:{type:"object",description:"Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This field may not exceed 10,000 bytes.",maxProperties:1e4},sendAt:{type:"integer",description:"A unix timestamp allowing you to specify when your email should be delivered. Scheduling delivery more than 72 hours in advance is forbidden."}},required:["to"]}},from:{title:"From Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account."},name:{type:"string",description:"A name or title associated with the sending email address."}},required:["email"]},replyTo:{title:"Reply_to Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The email address where any replies or bounces will be returned."},name:{type:"string",description:"A name or title associated with the `replyTo` email address."}},required:["email"]},replyToList:{type:"array",description:"An array of recipients who will receive replies and/or bounces. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name. You can either choose to use \u201CreplyTo\u201D field or \u201CreplyToList\u201D but not both.",uniqueItems:!0,maxItems:1e3,items:{type:"object",properties:{email:{type:"string",description:"The email address where any replies or bounces will be returned.",format:"email"},name:{type:"string",description:"A name or title associated with the `replyToList` email address."}},required:["email"]}},subject:{type:"string",description:"The global or 'message level' subject of your email. This may be overridden by subject lines set in personalizations.",minLength:1},content:{type:"array",description:"An array where you can specify the content of your email. You can include multiple [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of content, but you must specify at least one MIME type. To include more than one MIME type, add another object to the array containing the `type` and `value` parameters.",items:{type:"object",properties:{type:{type:"string",description:"The MIME type of the content you are including in your email (e.g., `\u201Ctext/plain\u201D` or `\u201Ctext/html\u201D`).",minLength:1},value:{type:"string",description:"The actual content of the specified MIME type that you are including in your email.",minLength:1}},required:["type","value"]}},attachments:{type:"array",description:"An array of objects where you can specify any attachments you want to include.",items:{type:"object",properties:{content:{type:"string",description:"The Base64 encoded content of the attachment.",minLength:1},type:{type:"string",description:"The MIME type of the content you are attaching (e.g., `\u201Ctext/plain\u201D` or `\u201Ctext/html\u201D`).",minLength:1},filename:{type:"string",description:"The attachment's filename."},disposition:{type:"string",default:"attachment",description:"The attachment's content-disposition, specifying how you would like the attachment to be displayed. For example, `\u201Cinline\u201D` results in the attached file are displayed automatically within the message while `\u201Cattachment\u201D` results in the attached file require some action to be taken before it is displayed, such as opening or downloading the file.",enum:["inline","attachment"]},contentId:{type:"string",description:"The attachment's content ID. This is used when the disposition is set to `\u201Cinline\u201D` and the attachment is an image, allowing the file to be displayed within the body of your email."}},required:["content","filename"]}},templateId:{type:"string",description:"An email template ID. A template that contains a subject and content \u2014 either text or html \u2014 will override any subject and content values specified at the personalizations or message level."},headers:{description:"An object containing key/value pairs of header names and the value to substitute for them. The key/value pairs must be strings. You must ensure these are properly encoded if they contain unicode characters. These headers cannot be one of the reserved headers.",type:"object"},categories:{type:"array",description:"An array of category names for this message. Each category name may not exceed 255 characters. ",uniqueItems:!0,maxItems:10,items:{type:"string",maxLength:255}},customArgs:{description:"Values that are specific to the entire send that will be carried along with the email and its activity data. Key/value pairs must be strings. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This parameter is overridden by `customArgs` set at the personalizations level. Total `customArgs` size may not exceed 10,000 bytes.",type:"string"},sendAt:{type:"integer",description:"A unix timestamp allowing you to specify when you want your email to be delivered. This may be overridden by the `sendAt` parameter set at the personalizations level. Delivery cannot be scheduled more than 72 hours in advance. If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid peak times \u2014 for example, scheduling at 10:53 \u2014 can result in lower deferral rates due to the reduced traffic during off-peak times."},batchId:{type:"string",description:"An ID representing a batch of emails to be sent at the same time. Including a `batchId` in your request allows you include this email in that batch. It also enables you to cancel or pause the delivery of that batch. For more information, see the [Cancel Scheduled Sends API](https://sendgrid.com/docs/api-reference/)."},asm:{type:"object",description:"An object allowing you to specify how to handle unsubscribes.",properties:{groupId:{type:"integer",description:"The unsubscribe group to associate with this email."},groupsToDisplay:{type:"array",description:"An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.",maxItems:25,items:{type:"integer"}}},required:["groupId"]},ipPoolName:{type:"string",description:"The IP Pool that you would like to send this email from.",minLength:2,maxLength:64},mailSettings:{type:"object",description:"A collection of different mail settings that you can use to specify how you would like this email to be handled.",properties:{bypassListManagement:{type:"object",description:"Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. This filter cannot be combined with any other bypass filters. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassSpamManagement:{type:"object",description:"Allows you to bypass the spam report list to ensure that the email is delivered to recipients. Bounce and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassBounceManagement:{type:"object",description:"Allows you to bypass the bounce list to ensure that the email is delivered to recipients. Spam report and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassUnsubscribeManagement:{type:"object",description:"Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. Bounce and spam report lists will still be checked; addresses on these other lists will not receive the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},footer:{type:"object",description:"The default footer that you would like included on every email.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},text:{type:"string",description:"The plain text content of your footer."},html:{type:"string",description:"The HTML content of your footer."}}},sandboxMode:{type:"object",description:"Sandbox Mode allows you to send a test email to ensure that your request body is valid and formatted correctly.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}}}},trackingSettings:{type:"object",description:"Settings to determine how you would like to track the metrics of how your recipients interact with your email.",properties:{clickTracking:{type:"object",description:"Allows you to track if a recipient clicked a link in your email.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},enableText:{type:"boolean",description:"Indicates if this setting should be included in the `text/plain` portion of your email."}}},openTracking:{type:"object",description:"Allows you to track if the email was opened by including a single pixel image in the body of the content. When the pixel is loaded, Twilio SendGrid can log that the email was opened.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},substitutionTag:{type:"string",description:"Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel."}}},subscriptionTracking:{type:"object",description:"Allows you to insert a subscription management link at the bottom of the text and HTML bodies of your email. If you would like to specify the location of the link within your email, you may use the `substitutionTag`.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},text:{type:"string",description:"Text to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>"},html:{type:"string",description:"HTML to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>"},substitutionTag:{type:"string",description:"A tag that will be replaced with the unsubscribe URL. for example: `[unsubscribe_url]`. If this parameter is used, it will override both the `text` and `html` parameters. The URL of the link will be placed at the substitution tag\u2019s location with no additional formatting."}}},ganalytics:{type:"object",description:"Allows you to enable tracking provided by Google Analytics.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},utmSource:{type:"string",description:"Name of the referrer source. (e.g. Google, SomeDomain.com, or Marketing Email)"},utmMedium:{type:"string",description:"Name of the marketing medium. (e.g. Email)"},utmTerm:{type:"string",description:"Used to identify any paid keywords."},utmContent:{type:"string",description:"Used to differentiate your campaign from advertisements."},utmCampaign:{type:"string",description:"The name of the campaign."}}}}}},required:[],additionalProperties:!1},es={output:ua};var ts={braze:B,clickatell:B,nodemailer:Qr,emailjs:B,"email-webhook":B,"infobip-email":B,mailersend:B,mailgun:zr,mailjet:Xr,mailtrap:B,mandrill:B,netcore:B,"novu-email":Zr,outlook365:B,plunk:B,postmark:B,resend:B,sendgrid:es,sendinblue:B,ses:B,sparkpost:B};var da={type:"object",properties:{},required:[],additionalProperties:!1},ns={output:da};var is={novu:ns};var rs={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},fa={type:"object",properties:{topic:{type:"string",description:"The destination topic for the notification."},id:{type:"string",description:"A UUID to identify the notification with APNS. If an id is not supplied, APNS will generate one automatically. If an error occurs the response will contain the id. This property populates the apns-id header."},expiry:{type:"number",description:"A UNIX timestamp when the notification should expire. If the notification cannot be delivered to the device, APNS will retry until it expires. An expiry of 0 indicates that the notification expires immediately, therefore no retries will be attempted."},priority:{type:"number",description:`Provide one of the following values:
91
+ laborum`.split(/\W/),Yt=Vs,Wt={type:He.ALLOWED_TYPES},sr=qs,si=Bs,or=Js,Vt=Gs,ar=Ks,lr=Hs,oi="[a-zA-Z][a-zA-Z0-9+-.]*",qt=`https?://{hostname}(?:${oi})+`,cr="(?:\\?([a-z]{1,7}(=\\w{1,5})?&){0,3})?",je={email:"[a-zA-Z\\d][a-zA-Z\\d-]{1,13}[a-zA-Z\\d]@{hostname}",hostname:"[a-zA-Z]{1,33}\\.[a-z]{2,4}",ipv6:"[a-f\\d]{4}(:[a-f\\d]{4}){7}",uri:qt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${qt}${cr}`,"uri-template":qt.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${oi.replace("]*","/]*")}|~[01]))+`,uuid:"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$",duration:"^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$"},je.iri=je["uri-reference"],je["iri-reference"]=je["uri-reference"],je["idn-email"]=je.email,je["idn-hostname"]=je.hostname,pr=new RegExp(`\\{(${Object.keys(je).join("|")})\\}`),ur=zs,dr=Qs,fr={boolean:Qi,null:tr,array:nr,integer:ir,number:ri,object:sr,string:dr},vt=fr,hr=ft,mr=({refs:e,schema:t,container:i,synchronous:c,refDepthMax:p,refDepthMin:h})=>{let d={},O={},D=0,T,$;return d.resolveSchema=(E,J,W)=>{if(E==null)return null;if(typeof E.generate=="function")return E;if(typeof(E.$id||E.id)=="string"&&(delete E.id,delete E.$id,delete E.$schema),typeof E.$ref=="string"){let Q=Math.max(h,p)-1;if(E.$ref==="#"||O[E.$ref]<0||T===E.$ref&&++D>Q)return E.$ref!=="#"&&$&&$.length===W.length?de.getLocalRef(t,E.$ref,c&&e):(delete E.$ref,E);typeof O[E.$ref]=="undefined"&&(O[E.$ref]=Z.number(h,p)-1),$=W,T=E.$ref;let ne;E.$ref.indexOf("#/")===-1?ne=e[E.$ref]||null:ne=de.getLocalRef(t,E.$ref,c&&e)||null;let he;if(typeof ne!="undefined"){if(!ne&&te("ignoreMissingRefs")!==!0)throw new Error(`Reference not found: ${E.$ref}`);O[E.$ref]-=1,de.merge(E,ne||{}),he=c&&ne&&ne.$ref}return he||delete E.$ref,E}if(Array.isArray(E.allOf)){let Q=E.allOf;delete E.allOf,Q.forEach(ne=>{let he=d.resolveSchema(ne,null,W);de.merge(E,typeof he.thunk=="function"?he.thunk(E):he),Array.isArray(E.allOf)&&d.resolveSchema(E,J,W)})}if(Array.isArray(E.oneOf||E.anyOf)&&W[W.length-2]!=="dependencies"){let Q=E.oneOf||E.anyOf;return E.enum&&E.oneOf&&(E.enum=E.enum.filter(ne=>de.validate(ne,Q))),{thunk(ne){let he=de.omitProps(E,["anyOf","oneOf"]),ye=Z.pick(Q);return de.merge(he,ye),Q.forEach(j=>{j.required&&j!==ye&&j.required.forEach(w=>{if(ye.required&&ye.required.includes(w))return;let b=he.required&&he.required.includes(w);he.properties&&!b&&delete he.properties[w],ne&&ne.properties&&delete ne.properties[w]})}),he}}}if(Object.keys(E).forEach(Q=>{(Array.isArray(E[Q])||typeof E[Q]=="object")&&!de.isKey(Q)&&(E[Q]=d.resolveSchema(E[Q],Q,W.concat(Q)))}),W){let Q=W[W.length-1];if(Q==="properties"||Q==="items")return E}return i.wrap(E)},d},yr=mr,ai=no,li=io,Le=Kn(Ci(),1),oo=Le.default.binaryOptions,ao=Le.default.boolOptions,lo=Le.default.intOptions,co=Le.default.nullOptions,po=Le.default.strOptions,uo=Le.default.Schema,fo=Le.default.Alias,ho=Le.default.Collection,mo=Le.default.Merge,yo=Le.default.Node,go=Le.default.Pair,wo=Le.default.Scalar,gr=Le.default.YAMLMap,wr=Le.default.YAMLSeq,Et=so,Xe=new Ji,Oe=(e,t,i)=>(console.debug("[json-schema-faker] calling JSONSchemaFaker() is deprecated, call either .generate() or .resolve()"),i&&console.debug("[json-schema-faker] local references are only supported by calling .resolve()"),Oe.generate(e,t)),Oe.generateWithContext=(e,t)=>{let i=Ti(t,e);return ai(i,e,Xe,!0)},Oe.generate=(e,t)=>li(Oe.generateWithContext(e,t)),Oe.generateYAML=(e,t)=>Et(Oe.generateWithContext(e,t)),Oe.resolveWithContext=(e,t,i)=>{typeof t=="string"&&(i=t,t={}),i=i||(typeof process!="undefined"&&typeof process.cwd=="function"?process.cwd():""),i=`${i.replace(/\/+$/,"")}/`;let c=Ti(t,e),p={order:1,canRead(d){let O=d.url.replace("/:",":");return c[O]||c[O.split("/").pop()]},read(d,O){try{O(null,this.canRead(d))}catch(D){O(D)}}},{$RefParser:h}=Qn();return h.bundle(i,e,{resolve:{file:{order:100},http:{order:200},fixedRefs:p},dereference:{circular:"ignore"}}).then(d=>ai(c,d,Xe)).catch(d=>{throw new Error(`Error while resolving schema (${d.message})`)})},Oe.resolve=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(li),Oe.resolveYAML=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(Et),bi(),Oe.format=ii,Oe.option=te,Oe.random=Z,Oe.extend=(e,t)=>(Xe.extend(e,t),Oe),Oe.define=(e,t)=>(Xe.define(e,t),Oe),Oe.reset=e=>(Xe.reset(e),bi(),Oe),Oe.locate=e=>Xe.get(e),Oe.VERSION="0.5.5",Sr={...Oe},br=Oe}}),bo=U({"src/src/main.iife.js"(e,t){var i=(So(),ie(Se));typeof $RefParser!="undefined"&&typeof JSONPath!="undefined"&&i.setDependencies({...JSONPath,$RefParser}),typeof window!="undefined"&&(window.JSONSchemaFaker=i.default),t.exports=i.default,t.exports.JSONSchemaFaker=i.JSONSchemaFaker}});return bo()})();((f,n)=>{f.JSONSchemaFaker=n()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>Sn);Sn.random.shuffle=function(){return["[placeholder]"]};Sn.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function Ir(f){return Sn.generate(f)}var Nr=async(f,n)=>{let s=new TextEncoder,l=s.encode(f),S=s.encode(n),U=await crypto.subtle.importKey("raw",l,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await crypto.subtle.sign("HMAC",U,S);return Array.from(new Uint8Array(C)).map(z=>z.toString(16).padStart(2,"0")).join("")};var qo=require("cross-fetch");var kr=async()=>{if(process.env.NOVU_BRIDGE_ORIGIN)return`${process.env.NOVU_BRIDGE_ORIGIN}/api/novu`;if(process.env.NEXT_PUBLIC_VERCEL_ENV==="preview"&&process.env.NEXT_PUBLIC_VERCEL_URL)return`https://${process.env.NEXT_PUBLIC_VERCEL_URL}/api/novu`;try{if(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev"){let n=await(await fetch("http://localhost:2022/.well-known/novu")).json();return`${n.tunnelOrigin}${n.route}`}}catch(f){console.error(f)}return""};function Cr(f){return!!f&&typeof f=="object"&&"error"in f&&"message"in f&&"statusCode"in f}var bn=(f,n)=>{if(!f)throw new ln;return{post:async(s,l)=>{let S=await fetch(`${n}/v1${s}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${f}`},body:JSON.stringify(l)}),U=await S.json();if(S.ok)return U;throw Cr(U)?new cn(U.statusCode,U.error,U.message):new mt(U)},delete:async s=>(await fetch(`${n}/v1${s}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${f}`}})).json()}};var $r=require("liquidjs");function di(f,n){let s={...f};for(let l of Object.keys(n)){let S=n[l];S&&typeof S=="object"&&!Array.isArray(S)?s[l]=di(s[l]||{},S):(Array.isArray(S),s[l]=S)}return s}function Tn(f,n){let s=n.split(".").reduce((l,S)=>{if(l&&typeof l=="object")return l[S]},f);if(s==null)return"";if(typeof s=="string")return s;if(typeof s=="number"||typeof s=="boolean")return String(s);if(typeof s=="object"){let l=JSON.stringify(s);return l==="{}"?"":l}return""}function Mr(f,n=2,s,l=", "){if(!Array.isArray(f)||f.length===0)return"";let S=s?f.map(z=>typeof z!="object"||!z?"":Tn(z,s)):f;if(S.length===1)return S[0];if(S.length===2)return`${S[0]} and ${S[1]}`;if(S.length===3&&n>=3)return`${S[0]}, ${l}${S[1]} and ${S[2]}`;let U=S.slice(0,n),C=S.length-n;return`${U.join(l)} and ${C} ${C===1?"other":"others"}`}var Lr=et(require("pluralize"),1);function Dr(f,n="",s="",l="true"){if(f==null)return"";let S=0;if(Array.isArray(f)?S=f.length:typeof f=="object"?S=Object.keys(f).length:typeof f=="string"?S=+f:typeof f=="number"?S=f:S=Number(f),Number.isNaN(S)&&(S=0),S<=0)return"";let U;return s?U=S===1?n:s:U=(0,Lr.default)(n,S),l==="true"?`${S} ${U}`:U}var Bo=require("liquidjs"),Ur=et(require("pluralize"),1),Jo=require("zod");var Go="",Ko=2,Ho="other",zo=", ",Xo=" and ",Qo=", and ";function Fr(f,n=Go,s=Ko,l=Ho,S=zo,U=Xo,C=Qo){if(!Array.isArray(f)||f.length===0)return"";let z=n?f.map(be=>typeof be!="object"||!be?"":Tn(be,n)):f,ie=z.length;if(ie===1)return z[0];if(ie===2)return`${z[0]}${U}${z[1]}`;if(s>=ie){let be=z.slice(0,ie-1),ke=z[ie-1];return`${be.join(S)}${C}${ke}`}let Se=z.slice(0,s),Ie=ie-s,Ne=s===1?U:C;return`${Se.join(S)}${Ne}${Ie} ${(0,Ur.default)(l,Ie)}`}function Zo(f){return Array.isArray(f)||typeof f=="object"&&f!==null?jr(f):typeof f=="string"&&f.includes(`
92
+ `)?f.replace(/\n/g,"\\n"):f==null?"":String(f)}var jr=(f,n=0)=>Array.isArray(f)||typeof f=="object"&&f!==null?JSON.stringify(f,null,n).replace(/"/g,"'").replace(/\n/g,"\\n"):f==null?"":String(f);function Yr(f){let n=new $r.Liquid({outputEscape:Zo,...f});return n.registerFilter("json",(s,l)=>jr(s,l)),n.registerFilter("digest",Mr),n.registerFilter("toSentence",Fr),n.registerFilter("pluralize",Dr),n}var pt=et(require("chalk"),1),we={info:f=>pt.default.blue(f),warning:f=>pt.default.yellow(f),error:f=>pt.default.red(f),success:f=>pt.default.green(f),underline:f=>pt.default.underline(f),bold:f=>pt.default.bold(f)},Re={SUCCESS:we.success("\u2714"),ERROR:we.error("\u2717"),WARNING:we.warning("\u26A0"),INFO:we.info("\u2139"),ARROW:we.bold("\u2192"),MOCK:we.info("\u25CB"),HYDRATED:we.bold(we.info("\u2192")),STEP:we.info("\u03C3"),ACTION:we.info("\u03B1"),DURATION:we.info("\u0394"),PROVIDER:we.info("\u2699"),OUTPUT:we.info("\u21E2"),INPUT:we.info("\u21E0"),WORKFLOW:we.info("\u03C9"),STATE:we.info("\u03C3"),EXECUTE:we.info("\u03B5"),PREVIEW:we.info("\u03C1")};function On(f){return f||process.env.NOVU_API_URL||"https://api.novu.co"}function An(f){return f||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var fi=et(require("sanitize-html"),1),ea=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"],ta={allowedTags:fi.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,transformTags:{img:(f,n)=>{let s={};for(let[l,S]of Object.entries(n))ea.includes(l.toLowerCase())&&(s[l]=S);return{tagName:f,attribs:s}}},allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},Wr=f=>{if(!f)return f;let n=/^<!DOCTYPE .*?>/,s=f.match(n),l=(0,fi.default)(f,ta);return s?s[0]+l:l},vn=f=>Object.keys(f).reduce((n,s)=>{let l=f[s];return typeof l=="string"?n[s]=Wr(l):Array.isArray(l)?n[s]=l.map(S=>typeof S=="string"?Wr(S):typeof S=="object"?vn(S):S):typeof l=="object"&&l!==null?n[s]=vn(l):n[s]=l,n},{});function Vr(f){console.log(`
93
+ ${we.bold(we.underline("Discovered workflowId:"))} '${f.workflowId}'`),f.steps.forEach((n,s)=>{let l=s===f.steps.length-1;console.log(`${l?"\u2514":"\u251C"} ${Re.STEP} Discovered stepId: '${n.stepId}' Type: '${n.type}'`),n.providers.forEach((U,C)=>{let z=C===n.providers.length-1;console.log(`${l?" ":"\u2502"} ${z?"\u2514":"\u251C"} ${Re.PROVIDER} Discovered provider: '${U.type}'`)})})}var Br=et(require("ajv"),1),Jr=et(require("ajv-formats"),1);var qr=f=>typeof structuredClone=="function"?structuredClone(f):JSON.parse(JSON.stringify(f));var En=class extends ot{constructor(s,l){let S=l.length===1?"it":"them";super(`Tried to use a ${s} in @novu/framework without ${l.join(", ")} installed. Please install ${S} by running \`npm install ${l.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var _n=async(f,n)=>{let s=new Set;if((await Promise.allSettled(f.map(S=>S.import))).forEach((S,U)=>{let C=f[U];S.status==="fulfilled"&&C.exports.every(ie=>S.value[ie]!==void 0)||s.add(C.name)}),s.size>0)throw new En(n,Array.from(s))};var Rn=class{constructor(){this.requiredImports=[];this.ajv=new Br.default({useDefaults:!0,removeAdditional:"failing"}),(0,Jr.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(n){let s=n.type==="object"||!!n.anyOf||!!n.allOf||!!n.oneOf;return s&&await _n(this.requiredImports,"JSON schema"),s}async validate(n,s){let l=this.compiledSchemas.get(s);l||(l=this.ajv.compile(s),this.compiledSchemas.set(s,l));let S=qr(n);return l(S)?{success:!0,data:S}:{success:!1,errors:l.errors.map(C=>({path:C.instancePath,message:C.message}))}}async transformToJsonSchema(n){return n}};var Pn=class{constructor(){this.requiredImports=[{name:"zod",import:import("zod"),exports:["ZodType"]},{name:"zod-to-json-schema",import:import("zod-to-json-schema"),exports:["zodToJsonSchema"]}]}async canHandle(n){let s=n.safeParseAsync!==void 0;return s&&await _n(this.requiredImports,"Zod schema"),s}async validate(n,s){let l=await s.safeParseAsync(n);return l.success?{success:!0,data:l.data}:{success:!1,errors:l.error.errors.map(S=>({path:`/${S.path.join("/")}`,message:S.message}))}}async transformToJsonSchema(n){let{zodToJsonSchema:s}=await import("zod-to-json-schema");return s(n)}};var xn=new Pn,In=new Rn,Nn=async(f,n)=>{if(await xn.canHandle(f))return xn.validate(n,f);if(await In.canHandle(f))return In.validate(n,f);throw new Error("Invalid schema")},Me=async f=>{if(await xn.canHandle(f))return xn.transformToJsonSchema(f);if(await In.canHandle(f))return In.transformToJsonSchema(f);throw new Error("Invalid schema")};function na(){return["development",void 0,"dev"].includes(process.env.NODE_ENV)}var wt=class{constructor(n){this.discoveredWorkflows=new Map;this.discoverWorkflowPromises=new Map;this.version="2.9.0-nightly.20251202.474f9cfa96";let s=this.buildOptions(n);this.apiUrl=s.apiUrl,this.secretKey=s.secretKey,this.strictAuthentication=s.strictAuthentication,this.templateEngine=Yr()}buildOptions(n){let s={apiUrl:On(n==null?void 0:n.apiUrl),secretKey:An(n==null?void 0:n.secretKey),strictAuthentication:!na()};return(n==null?void 0:n.strictAuthentication)!==void 0?s.strictAuthentication=n.strictAuthentication:process.env.NOVU_STRICT_AUTHENTICATION_ENABLED!==void 0&&(s.strictAuthentication=process.env.NOVU_STRICT_AUTHENTICATION_ENABLED==="true"),s}async addWorkflows(n){for(let s of n){if(this.discoveredWorkflows.has(s.id))continue;let l=this.discoverWorkflowPromises.get(s.id);if(l){await l;continue}let S=this.addWorkflow(s);this.discoverWorkflowPromises.set(s.id,S),await S}}async addWorkflow(n){try{let s=await n.discover();Vr(s),this.discoveredWorkflows.set(n.id,s)}finally{this.discoverWorkflowPromises.delete(n.id)}}healthCheck(){let n=this.getRegisteredWorkflows(),s=n.length,l=n.reduce((S,U)=>S+U.steps.length,0);return{status:"ok",sdkVersion:"2.9.0-nightly.20251202.474f9cfa96",frameworkVersion:"2024-06-26",discovered:{workflows:s,steps:l}}}getWorkflow(n){let s=this.discoveredWorkflows.get(n);if(s)return s;throw new Ct(n)}getStep(n,s){let S=this.getWorkflow(n).steps.find(U=>U.stepId===s);if(S)return S;throw new gn(s)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows()}}mock(n){return Ir(n)}async validate(n,s,l,S,U,C,z){let ie=await Nn(s,n);if(ie.success)return ie.data;switch(l){case"event":this.throwInvalidEvent(S,U,ie.errors);case"step":this.throwInvalidStep(C,S,U,ie.errors);case"provider":this.throwInvalidProvider(C,z,S,U,ie.errors);default:throw new Error(`Invalid component: '${l}'`)}}throwInvalidProvider(n,s,l,S,U){if(!n)throw new Error("stepId is required");if(!s)throw new Error("providerId is required");switch(l){case"output":throw new rn(S,n,s,U);default:throw new Error(`Invalid payload type: '${l}'`)}}throwInvalidStep(n,s,l,S){if(!n)throw new Error("stepId is required");switch(s){case"output":throw new en(l,n,S);case"result":throw new tn(l,n,S);case"controls":throw new Zt(l,n,S);default:throw new Error(`Invalid payload type: '${s}'`)}}throwInvalidEvent(n,s,l){switch(n){case"controls":throw new Qt(s,l);case"payload":throw new xt(s,l);default:throw new Error(`Invalid payload type: '${n}'`)}}executeStepFactory(n,s,l){return async(S,U,C)=>{if(l())return;let z=this.getStep(n.workflowId,S),ie=n.action==="preview";if(!ie&&S===n.stepId){let ke=await this.createStepControls(z,n),Fe=await this.compileControls(ke,n);if(await this.shouldSkip(C==null?void 0:C.skip,Fe))return s({options:{skip:!0},outputs:{},providers:{}}),{}}let Se=this.previewStep.bind(this),Ie=this.executeStep.bind(this),be=await(ie?Se:Ie)(n,{...z,providers:z.providers.map(ke=>{var it;let Fe=(it=C==null?void 0:C.providers)==null?void 0:it[ke.type];if(!Fe)throw new pn(ke.type);return{...ke,resolve:Fe}}),resolve:U});return this.shouldSanitize({stepType:z.type,options:C})&&(be={...be,outputs:vn(be.outputs)}),S===n.stepId&&s({...be,options:{skip:!1}}),be.outputs}}shouldSanitize({stepType:n,options:s}){return(s==null?void 0:s.disableOutputSanitization)===!0?!1:["email","in_app"].includes(n)}async shouldSkip(n,s){return n?n(s):!1}async executeWorkflow(n){let S=`${{execute:"Executing",preview:"Previewing"}[n.action]} workflowId:`;console.log(`
94
+ ${we.bold(we.underline(S))} '${n.workflowId}'`);let U=this.getWorkflow(n.workflowId),C=process.hrtime(),z={outputs:{},providers:{},options:{skip:!1}},ie,Se=!1,Ie=new Promise(Ke=>{ie=Ke}),Ne=Ke=>{if(Se)throw new Error("setResult can only be called once per workflow execution");ie(),Se=!0,z=Ke},be=()=>Se,ke;try{if(n.action==="execute"&&!n.payload)throw new xt(n.workflowId,{message:"Event `payload` is required"});let Ke=await this.createExecutionPayload(n,U),qe={...n,payload:Ke};await Promise.race([Ie,U.execute({payload:Ke,environment:{},controls:{},subscriber:n.subscriber,context:n.context,step:{email:this.executeStepFactory(qe,Ne,be),sms:this.executeStepFactory(qe,Ne,be),inApp:this.executeStepFactory(qe,Ne,be),digest:this.executeStepFactory(qe,Ne,be),delay:this.executeStepFactory(qe,Ne,be),push:this.executeStepFactory(qe,Ne,be),chat:this.executeStepFactory(qe,Ne,be),custom:this.executeStepFactory(qe,Ne,be),throttle:this.executeStepFactory(qe,Ne,be)}})])}catch(Ke){ke=Ke}let Fe=process.hrtime(C),it=Fe[0],Ge=Fe[1],Dt=it*1e3+Ge/1e6,jn=ke?Re.ERROR:Re.SUCCESS,Ut={execute:"Executed",preview:"Previewed"}[n.action];if(console.log(`${jn} ${Ut} workflowId: \`${n.workflowId}\``),this.prettyPrintExecute(n,Dt,ke),ke)throw ke;return{outputs:z.outputs,providers:z.providers,options:z.options,metadata:{status:"success",error:!1,duration:Dt}}}async createExecutionPayload(n,s){let{payload:l}=n;if(n.action==="preview"){let U=this.mock(s.payload.schema);l=Object.assign(U,l)}return await this.validate(l,s.payload.unknownSchema,"event","payload",n.workflowId)}prettyPrintExecute(n,s,l){let S=l?Re.ERROR:Re.SUCCESS,C={execute:"Executed",preview:"Previewed"}[n.action],z=l?"Failed to execute":C,ie=l?we.error:we.success,Se=`${S} ${z} workflowId: '${n.workflowId}`;console.log(`
95
+ ${we.bold(ie(Se))}'`),console.log(` \u251C ${Re.STEP} stepId: '${n.stepId}'`),console.log(` \u251C ${Re.ACTION} action: '${n.action}'`),console.log(` \u2514 ${Re.DURATION} duration: '${s.toFixed(2)}ms'
96
+ `)}async executeProviders(n,s,l){return s.providers.reduce(async(S,U)=>{let C=await S,z=this.previewProvider.bind(this),ie=this.executeProvider.bind(this),Ie=await(n.action==="preview"?z:ie)(n,s,U,l);return{...C,[U.type]:Ie}},Promise.resolve({}))}previewProvider(n,s,l,S){return console.log(` ${Re.MOCK} Mocked provider: \`${l.type}\``),this.mock(l.outputs.schema)}async executeProvider(n,s,l,S){try{if(n.stepId===s.stepId){let U=await this.createStepControls(s,n),C=await l.resolve({controls:U,outputs:S}),z=await this.validate(C,l.outputs.unknownSchema,"step","output",n.workflowId,s.stepId,l.type);return console.log(` ${Re.SUCCESS} Executed provider: \`${l.type}\``),{...z,_passthrough:C._passthrough}}else return console.log(` ${Re.HYDRATED} Hydrated provider: \`${l.type}\``),{}}catch(U){throw console.log(` ${Re.ERROR} Failed to execute provider: \`${l.type}\``),new un(l.type,n.action,U)}}async executeStep(n,s){if(n.stepId===s.stepId)try{let l=await this.createStepControls(s,n),S=await this.compileControls(l,n),U=await s.resolve(S),C=await this.validate(U,s.outputs.unknownSchema,"step","output",n.workflowId,s.stepId),z=await this.executeProviders(n,s,C);return console.log(` ${Re.SUCCESS} Executed stepId: \`${s.stepId}\``),{outputs:C,providers:z}}catch(l){throw console.log(` ${Re.ERROR} Failed to execute stepId: \`${s.stepId}\``),lt(l)?l:new kt(s.stepId,n.action,l)}else try{let l=this.getStepState(n,s.stepId);if(l){let S=await this.validate(l.outputs,s.results.unknownSchema,"step","result",n.workflowId,s.stepId);return console.log(` ${Re.HYDRATED} Hydrated stepId: \`${s.stepId}\``),{outputs:S,providers:await this.executeProviders(n,s,S)}}else throw new Xt(n.workflowId,s.stepId)}catch(l){throw console.log(` ${Re.ERROR} Failed to hydrate stepId: \`${s.stepId}\``),l}}async compileControls(n,s){try{let l=this.preprocessTranslationPatterns(JSON.stringify(n));l=this.preprocessFilterTranslationArgs(l);let S=this.templateEngine.parse(l),U=this.getWorkflow(s.workflowId),C={workflow:{workflowId:U.workflowId,name:U.name,description:U.description,tags:U.tags,severity:U.severity},payload:s.payload,subscriber:s.subscriber,context:s.context,steps:ia(s.state)},z=await this.templateEngine.render(S,C),ie=this.postprocessTranslationMarkers(z),Se=(0,Gr.jsonrepair)(ie);return JSON.parse(Se)}catch(l){throw new nn(s.workflowId,s.stepId,l)}}preprocessTranslationPatterns(n){return n.replace(/\{\{\s*t\.([\p{L}\p{N}_.-]+)\s*\}\}/gu,"[T:$1]")}preprocessFilterTranslationArgs(n){return n.replace(/'t\.([\p{L}\p{N}_.-]+)'/gu,"'[T:$1]'")}postprocessTranslationMarkers(n){return n.replace(/\[T:([\p{L}\p{N}_.-]+)\]/gu,"{{t.$1}}")}async createStepControls(n,s){return await this.validate(s.controls,n.controls.unknownSchema,"step","controls",s.workflowId,n.stepId)}async previewStep(n,s){try{return await this.constructStepForPreview(n,s)}catch(l){throw console.log(` ${Re.ERROR} Failed to preview stepId: \`${s.stepId}\``),lt(l)?l:new kt(s.stepId,n.action,l)}}async constructStepForPreview(n,s){return n.stepId===s.stepId?await this.previewRequiredStep(s,n):await this.extractMockDataForPreviousSteps(n,s)}async extractMockDataForPreviousSteps(n,s){let l={},S=this.getStepState(n,s.stepId),U=this.mock(s.results.schema);return{outputs:di(U,(S==null?void 0:S.outputs)||{}),providers:await this.executeProviders(n,s,l)}}async previewRequiredStep(n,s){let l=await this.createStepControls(n,s),S=await this.compileControls(l,s),U=await n.resolve(S),C=await this.validate(U,n.outputs.unknownSchema,"step","output",s.workflowId,n.stepId);return console.log(` ${Re.MOCK} Mocked stepId: \`${n.stepId}\``),{outputs:C,providers:await this.executeProviders(s,n,C)}}getStepState(n,s){return n.state.find(l=>l.stepId===s)}getStepCode(n,s){return{code:this.getStep(n,s).resolve.toString()}}getWorkflowCode(n){return{code:this.getWorkflow(n).execute.toString()}}getCode(n,s){let l;if(n)s?l=this.getStepCode(n,s):l=this.getWorkflowCode(n);else throw new Ct(n);return l}};function ia(f){let n={};for(let s of f)n[s.stepId]=s.outputs;return n}var kn=class{constructor(n){this.handler=n.handler,this.client=n.client?n.client:new wt,this.workflows=n.workflows,this.http=bn(this.client.secretKey,this.client.apiUrl),this.frameworkName=n.frameworkName,this.hmacEnabled=this.client.strictAuthentication}createHandler(){return async(...n)=>{await this.client.addWorkflows(this.workflows);let s=await this.handler(...n),l=await this.handleAction({actions:s});return s.transformResponse(l)}}getStaticHeaders(){let n=`novu-framework:v${this.client.version}`;return{"content-type":"application/json","access-control-allow-origin":"*","access-control-allow-methods":"GET, POST","access-control-allow-headers":"*","access-control-max-age":"604800","novu-framework-version":"2024-06-26","novu-framework-sdk":"2.9.0-nightly.20251202.474f9cfa96","novu-framework-server":this.frameworkName,"user-agent":n}}createResponse(n,s){return{status:n,body:JSON.stringify(s),headers:{...this.getStaticHeaders()}}}createError(n){return{status:n.statusCode,body:JSON.stringify({message:n.message,data:n.data,code:n.code}),headers:this.getStaticHeaders()}}async handleAction({actions:n}){let s=await n.url(),l=await n.method(),S=s.searchParams.get("action")||"health-check",U=s.searchParams.get("workflowId")||"",C=s.searchParams.get("stepId")||"",z=await n.headers("novu-signature")||"",ie={};try{l==="POST"&&(ie=await n.body())}catch{}try{S!=="health-check"&&await this.validateHmac(ie,z);let Se=this.getPostActionMap(ie,U,C,S),Ie=this.getGetActionMap(U,C);if(l==="POST")return await this.handlePostAction(S,Se);if(l==="GET")return await this.handleGetAction(S,Ie);if(l==="OPTIONS")return this.createResponse(200,{})}catch(Se){return this.handleError(Se)}return this.createError(new an(l))}getPostActionMap(n,s,l,S){return{trigger:this.triggerAction({workflowId:s,...n}),execute:async()=>{let U=await this.client.executeWorkflow({...n,workflowId:s,stepId:l,action:S});return this.createResponse(200,U)},preview:async()=>{let U=await this.client.executeWorkflow({...n,workflowId:s,stepId:l,action:S});return this.createResponse(200,U)}}}triggerAction(n){return async()=>{let s={name:n.workflowId,to:n.to,payload:(n==null?void 0:n.payload)||{},transactionId:n.transactionId,overrides:n.overrides||{},...n.actor&&{actor:n.actor},...n.bridgeUrl&&{bridgeUrl:n.bridgeUrl},...n.controls&&{controls:n.controls},...n.context&&{context:n.context}},l=await this.http.post("/events/trigger",s);return this.createResponse(200,l)}}getGetActionMap(n,s){return{discover:async()=>{let l=await this.client.discover();return this.createResponse(200,l)},"health-check":async()=>{let l=await this.client.healthCheck();return this.createResponse(200,l)},code:async()=>{let l=await this.client.getCode(n,s);return this.createResponse(200,l)}}}async handlePostAction(n,s){if(Object.values(Rt).includes(n)){let l=s[n];return l()}else throw new It(n,Rt)}async handleGetAction(n,s){if(Object.values(Gt).includes(n)){let l=s[n];return l()}else throw new It(n,Gt)}handleError(n){if(lt(n))return n.statusCode>=500&&console.error(n),this.createError(n);if(Or(n))return this.createError(n);{let s=new mt(n);return console.error(s),this.createError(s)}}async validateHmac(n,s){if(!this.hmacEnabled)return;if(!s)throw new fn;if(!this.client.secretKey)throw new yn;let[l,S]=s.split(",");if(!l||!S)throw new hn;let[U,C]=l.split("="),[z,ie]=S.split("=");if(Number(U)<Date.now()-1500)throw new mn;if(!(await Nr(this.client.secretKey,`${C}.${JSON.stringify(n)}`)===ie))throw new dn}};var B={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var sa={type:"object",properties:{webhookUrl:{type:"string",format:"uri"},text:{type:"string"},blocks:{type:"array",items:{type:"object",properties:{type:{enum:["image","context","actions","divider","section","input","file","header","video","rich_text"]}},required:["type"],additionalProperties:!0}}},additionalProperties:!0},Kr={output:sa};var Hr={"chat-webhook":B,discord:B,getstream:B,"grafana-on-call":B,mattermost:B,msteams:B,"rocket-chat":B,ryver:B,slack:Kr,"whatsapp-business":B,zulip:B};var oa={type:"object",properties:{to:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:'Email address of the recipient(s). Example: "Bob bob@host.com". You can use commas to separate multiple recipients (e.g.: "test@example.com,test@example.com" or ["test@example.com", "test@example.com"]).'},from:{type:"string"},subject:{type:"string",description:"Subject of the message."},text:{type:"string",description:"Text version of the message."},html:{type:"string",description:"HTML version of the message."},message:{type:"string",description:"MIME string of the message. Make sure to use multipart/form-data to send this as a file upload."},cc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Same as To but for carbon copy"},bcc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Same as To but for blind carbon copy"},ampHtml:{type:"string"},tVersion:{type:"string"},tText:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},oTag:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Tag string. See Tagging for more information."},oDkim:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Enables/disabled DKIM signatures on per-message basis. Pass yes or no"},oDeliverytime:{type:"string",description:"Desired time of delivery. See Date Format. Note: Messages can be scheduled for a maximum of 3 days in the future."},oDeliverytimeOptimizePeriod:{type:"string"},oTimeZoneLocalize:{type:"string"},oTestmode:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Enables sending in test mode. Pass yes if needed. See Sending in Test Mode"},oTracking:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Toggles tracking on a per-message basis, see Tracking Messages for details. Pass yes or no."},oTrackingClicks:{anyOf:[{type:"string",enum:["yes","no","htmlonly"]},{type:"boolean"}],description:"Toggles clicks tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes, no or htmlonly."},oTrackingOpens:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Toggles opens tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes or no."},oRequireTls:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},oSkipVerification:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},recipientVariables:{type:"string"}},required:[],additionalProperties:!0},zr={output:oa};var ut={type:"object",properties:{name:{type:"string"},email:{type:"string"}},description:'JSON object, containing 2 properties: Name and Email address of a previously validated and active sender. Including the Name property in the JSON is optional. This property is not mandatory in case you use TemplateID and you specified a From address for the template. Format : { "Email":"value", "Name":"value" }.',required:["Email"],additionalProperties:!0},aa={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},la={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},ca={type:"object",properties:{from:ut,sender:ut,to:{type:"array",items:ut},cc:{type:"array",items:ut},bcc:{type:"array",items:ut},replyTo:ut,subject:{type:"string"},textPart:{type:"string",description:"Content of the message, sent in Text and/or HTML format. At least one of these content types needs to be specified. When the HTML part is the only part provided, Mailjet will not generate a Text-part from the HTML version. The property can't be set when you use TemplateID"},htmlPart:{type:"string",description:"Content of the message, sent in Text and/or HTML format. At least one of these content types needs to be specified. When the HTML part is the only part provided, Mailjet will not generate a Text-part from the HTML version. The property can't be set when you use TemplateID"},templateId:{type:"number",description:"an ID for a template that is previously created and stored in Mailjet's system. It is mandatory when From and TextPart and/or HtmlPart are not provided. "},templateLanguage:{type:"boolean"},templateErrorReporting:ut,templateErrorDeliver:{type:"boolean"},attachments:{type:"array",items:aa},inlineAttachments:{type:"array",items:la},priority:{type:"number"},customCampaign:{type:"string"},deduplicateCampaign:{type:"boolean"},trackOpens:{type:"string",enum:["account_default","disabled","enabled"]},trackClicks:{type:"string",enum:["account_default","disabled","enabled"]},customId:{type:"string"},eventPayload:{type:"string"},urlTags:{type:"string"},headers:{type:"object",additionalProperties:!0},variables:{type:"object",additionalProperties:!0}},required:[],additionalProperties:!0},Xr={output:ca};var Be={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},Cn={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},pa={type:"object",properties:{from:{anyOf:[{type:"string"},Be]},sender:{anyOf:[{type:"string"},Be]},to:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},cc:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},bcc:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},replyTo:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},inReplyTo:{anyOf:[{type:"string"},Be]},references:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},subject:{type:"string"},text:{anyOf:[{type:"string"},Cn]},html:{anyOf:[{type:"string"},Cn]},watchHtml:{anyOf:[{type:"string"},Cn]},amp:{anyOf:[{type:"string"},{type:"object",properties:{content:{type:"string"},path:{type:"string"},href:{type:"string"},encoding:{type:"string"},contentType:{type:"string"},raw:{anyOf:[{type:"string"},Cn]}}}]},icalEvent:{anyOf:[{type:"string"},{type:"object",properties:{content:{type:"string"},path:{type:"string"},method:{type:"string"},filename:{anyOf:[{type:"string"},{type:"boolean"}]},href:{type:"string"},encoding:{type:"string"}}}]},headers:{anyOf:[{type:"object",additionalProperties:!0},{type:"array",items:{type:"object",additionalProperties:!0}}]},list:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},attachments:{type:"array",items:{type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0}}},required:[],additionalProperties:!0},Qr={output:pa};var ua={type:"object",properties:{},required:[],additionalProperties:!1},Zr={output:ua};var da={type:"object",properties:{personalizations:{type:"array",description:"An array of messages and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled. See our [Personalizations documentation](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) for examples.",uniqueItems:!1,maxItems:1e3,items:{type:"object",properties:{from:{title:"From Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account."},name:{type:"string",description:"A name or title associated with the sending email address."}},required:["email"]},to:{title:"To Email Array",type:"array",items:{type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},cc:{type:"array",description:"An array of recipients who will receive a copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.",maxItems:1e3,items:{title:"CC BCC Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},bcc:{type:"array",description:"An array of recipients who will receive a blind carbon copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.",maxItems:1e3,items:{title:"CC BCC Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},subject:{type:"string",description:"The subject of your email. See character length requirements according to [RFC 2822](http://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit#answer-1592310).",minLength:1},headers:{type:"object",description:"A collection of JSON key/value pairs allowing you to specify handling instructions for your email. You may not overwrite the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`"},substitutions:{type:"object",description:'Substitutions allow you to insert data without using Dynamic Transactional Templates. This field should **not** be used in combination with a Dynamic Transactional Template, which can be identified by a `templateId` starting with `d-`. This field is a collection of key/value pairs following the pattern "substitutionTag":"value to substitute". The key/value pairs must be strings. These substitutions will apply to the text and html content of the body of your email, in addition to the `subject` and `reply-to` parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object.',maxProperties:1e4},dynamicTemplateData:{type:"object",description:'Dynamic template data is available using Handlebars syntax in Dynamic Transactional Templates. This field should be used in combination with a Dynamic Transactional Template, which can be identified by a `templateId` starting with `d-`. This field is a collection of key/value pairs following the pattern "variable_name":"value to insert".'},customArgs:{type:"object",description:"Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This field may not exceed 10,000 bytes.",maxProperties:1e4},sendAt:{type:"integer",description:"A unix timestamp allowing you to specify when your email should be delivered. Scheduling delivery more than 72 hours in advance is forbidden."}},required:["to"]}},from:{title:"From Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account."},name:{type:"string",description:"A name or title associated with the sending email address."}},required:["email"]},replyTo:{title:"Reply_to Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The email address where any replies or bounces will be returned."},name:{type:"string",description:"A name or title associated with the `replyTo` email address."}},required:["email"]},replyToList:{type:"array",description:"An array of recipients who will receive replies and/or bounces. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name. You can either choose to use \u201CreplyTo\u201D field or \u201CreplyToList\u201D but not both.",uniqueItems:!0,maxItems:1e3,items:{type:"object",properties:{email:{type:"string",description:"The email address where any replies or bounces will be returned.",format:"email"},name:{type:"string",description:"A name or title associated with the `replyToList` email address."}},required:["email"]}},subject:{type:"string",description:"The global or 'message level' subject of your email. This may be overridden by subject lines set in personalizations.",minLength:1},content:{type:"array",description:"An array where you can specify the content of your email. You can include multiple [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of content, but you must specify at least one MIME type. To include more than one MIME type, add another object to the array containing the `type` and `value` parameters.",items:{type:"object",properties:{type:{type:"string",description:"The MIME type of the content you are including in your email (e.g., `\u201Ctext/plain\u201D` or `\u201Ctext/html\u201D`).",minLength:1},value:{type:"string",description:"The actual content of the specified MIME type that you are including in your email.",minLength:1}},required:["type","value"]}},attachments:{type:"array",description:"An array of objects where you can specify any attachments you want to include.",items:{type:"object",properties:{content:{type:"string",description:"The Base64 encoded content of the attachment.",minLength:1},type:{type:"string",description:"The MIME type of the content you are attaching (e.g., `\u201Ctext/plain\u201D` or `\u201Ctext/html\u201D`).",minLength:1},filename:{type:"string",description:"The attachment's filename."},disposition:{type:"string",default:"attachment",description:"The attachment's content-disposition, specifying how you would like the attachment to be displayed. For example, `\u201Cinline\u201D` results in the attached file are displayed automatically within the message while `\u201Cattachment\u201D` results in the attached file require some action to be taken before it is displayed, such as opening or downloading the file.",enum:["inline","attachment"]},contentId:{type:"string",description:"The attachment's content ID. This is used when the disposition is set to `\u201Cinline\u201D` and the attachment is an image, allowing the file to be displayed within the body of your email."}},required:["content","filename"]}},templateId:{type:"string",description:"An email template ID. A template that contains a subject and content \u2014 either text or html \u2014 will override any subject and content values specified at the personalizations or message level."},headers:{description:"An object containing key/value pairs of header names and the value to substitute for them. The key/value pairs must be strings. You must ensure these are properly encoded if they contain unicode characters. These headers cannot be one of the reserved headers.",type:"object"},categories:{type:"array",description:"An array of category names for this message. Each category name may not exceed 255 characters. ",uniqueItems:!0,maxItems:10,items:{type:"string",maxLength:255}},customArgs:{description:"Values that are specific to the entire send that will be carried along with the email and its activity data. Key/value pairs must be strings. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This parameter is overridden by `customArgs` set at the personalizations level. Total `customArgs` size may not exceed 10,000 bytes.",type:"string"},sendAt:{type:"integer",description:"A unix timestamp allowing you to specify when you want your email to be delivered. This may be overridden by the `sendAt` parameter set at the personalizations level. Delivery cannot be scheduled more than 72 hours in advance. If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid peak times \u2014 for example, scheduling at 10:53 \u2014 can result in lower deferral rates due to the reduced traffic during off-peak times."},batchId:{type:"string",description:"An ID representing a batch of emails to be sent at the same time. Including a `batchId` in your request allows you include this email in that batch. It also enables you to cancel or pause the delivery of that batch. For more information, see the [Cancel Scheduled Sends API](https://sendgrid.com/docs/api-reference/)."},asm:{type:"object",description:"An object allowing you to specify how to handle unsubscribes.",properties:{groupId:{type:"integer",description:"The unsubscribe group to associate with this email."},groupsToDisplay:{type:"array",description:"An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.",maxItems:25,items:{type:"integer"}}},required:["groupId"]},ipPoolName:{type:"string",description:"The IP Pool that you would like to send this email from.",minLength:2,maxLength:64},mailSettings:{type:"object",description:"A collection of different mail settings that you can use to specify how you would like this email to be handled.",properties:{bypassListManagement:{type:"object",description:"Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. This filter cannot be combined with any other bypass filters. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassSpamManagement:{type:"object",description:"Allows you to bypass the spam report list to ensure that the email is delivered to recipients. Bounce and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassBounceManagement:{type:"object",description:"Allows you to bypass the bounce list to ensure that the email is delivered to recipients. Spam report and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassUnsubscribeManagement:{type:"object",description:"Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. Bounce and spam report lists will still be checked; addresses on these other lists will not receive the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},footer:{type:"object",description:"The default footer that you would like included on every email.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},text:{type:"string",description:"The plain text content of your footer."},html:{type:"string",description:"The HTML content of your footer."}}},sandboxMode:{type:"object",description:"Sandbox Mode allows you to send a test email to ensure that your request body is valid and formatted correctly.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}}}},trackingSettings:{type:"object",description:"Settings to determine how you would like to track the metrics of how your recipients interact with your email.",properties:{clickTracking:{type:"object",description:"Allows you to track if a recipient clicked a link in your email.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},enableText:{type:"boolean",description:"Indicates if this setting should be included in the `text/plain` portion of your email."}}},openTracking:{type:"object",description:"Allows you to track if the email was opened by including a single pixel image in the body of the content. When the pixel is loaded, Twilio SendGrid can log that the email was opened.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},substitutionTag:{type:"string",description:"Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel."}}},subscriptionTracking:{type:"object",description:"Allows you to insert a subscription management link at the bottom of the text and HTML bodies of your email. If you would like to specify the location of the link within your email, you may use the `substitutionTag`.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},text:{type:"string",description:"Text to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>"},html:{type:"string",description:"HTML to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>"},substitutionTag:{type:"string",description:"A tag that will be replaced with the unsubscribe URL. for example: `[unsubscribe_url]`. If this parameter is used, it will override both the `text` and `html` parameters. The URL of the link will be placed at the substitution tag\u2019s location with no additional formatting."}}},ganalytics:{type:"object",description:"Allows you to enable tracking provided by Google Analytics.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},utmSource:{type:"string",description:"Name of the referrer source. (e.g. Google, SomeDomain.com, or Marketing Email)"},utmMedium:{type:"string",description:"Name of the marketing medium. (e.g. Email)"},utmTerm:{type:"string",description:"Used to identify any paid keywords."},utmContent:{type:"string",description:"Used to differentiate your campaign from advertisements."},utmCampaign:{type:"string",description:"The name of the campaign."}}}}}},required:[],additionalProperties:!1},es={output:da};var ts={braze:B,clickatell:B,nodemailer:Qr,emailjs:B,"email-webhook":B,"infobip-email":B,mailersend:B,mailgun:zr,mailjet:Xr,mailtrap:B,mandrill:B,netcore:B,"novu-email":Zr,outlook365:B,plunk:B,postmark:B,resend:B,sendgrid:es,sendinblue:B,ses:B,sparkpost:B};var fa={type:"object",properties:{},required:[],additionalProperties:!1},ns={output:fa};var is={novu:ns};var rs={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},ha={type:"object",properties:{topic:{type:"string",description:"The destination topic for the notification."},id:{type:"string",description:"A UUID to identify the notification with APNS. If an id is not supplied, APNS will generate one automatically. If an error occurs the response will contain the id. This property populates the apns-id header."},expiry:{type:"number",description:"A UNIX timestamp when the notification should expire. If the notification cannot be delivered to the device, APNS will retry until it expires. An expiry of 0 indicates that the notification expires immediately, therefore no retries will be attempted."},priority:{type:"number",description:`Provide one of the following values:
97
97
 
98
98
  10 - The push notification is sent to the device immediately. (Default)
99
99
  The push notification must trigger an alert, sound, or badge on the device. It is an error to use this priority for a push notification that contains only the content-available key.
100
100
 
101
101
  5 - The push message is sent at a time that conserves power on the device receiving it.`},collapseId:{type:"string"},pushType:{type:"string",enum:["background","alert","voip"],description:`The type of the notification. The value of this header is alert or background. Specify alert when the delivery of your notification displays an alert, plays a sound, or badges your app's icon. Specify background for silent notifications that do not interact with the user.
102
102
 
103
- The value of this header must accurately reflect the contents of your notification's payload. If there is a mismatch, or if the header is missing on required systems, APNs may delay the delivery of the notification or drop it altogether.`},threadId:{type:"string"},payload:{type:"object",additionalProperties:!0},aps:{type:"object",additionalProperties:!0,properties:{badge:{type:"number"},sound:rs,category:{type:"string"},contentAvailable:{type:"number"},launchImage:{type:"number"},mutableContent:{type:"number"},urlArgs:{type:"array",items:{type:"string"}}}},rawPayload:{type:"object",additionalProperties:!0},badge:{type:"number"},sound:rs,alert:{anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{title:{type:"string"},body:{type:"string"},subtitle:{type:"string"},titleLocKey:{type:"string"},titleLocArgs:{type:"array",items:{type:"string"}},actionLocKey:{type:"string"},locKey:{type:"string"},locArgs:{type:"array",items:{type:"string"}},launchImage:{type:"string"}},required:["body"]}]},contentAvailable:{type:"boolean"},mutableContent:{type:"boolean"},mdm:{anyOf:[{type:"string"},{type:"object",additionalProperties:!0}]},urlArgs:{type:"array",items:{type:"string"}}},required:[],additionalProperties:!0},ss={output:fa};var ha={type:"object",properties:{to:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"An Expo push token or an array of Expo push tokens specifying the recipient(s) of this message."},data:{type:"object",additionalProperties:!0,description:'A JSON object delivered to your app. It may be up to about 4KiB; the total notification payload sent to Apple and Google must be at most 4KiB or else you will get a "Message Too Big" error.'},title:{type:"string",description:"The title to display in the notification. Often displayed above the notification body."},subtitle:{type:"string",description:"The subtitle to display in the notification below the title."},body:{type:"string",description:"The message to display in the notification."},sound:{anyOf:[{type:"string"},{type:"null"},{type:"object",properties:{name:{anyOf:[{type:"string",enum:["default"]},{type:"null"}]},volume:{type:"number"},critical:{type:"boolean"}},additionalProperties:!0}],description:"Play a sound when the recipient receives this notification. Specify default to play the device's default notification sound, or omit this field to play no sound. Custom sounds are not supported."},ttl:{type:"number",description:"Time to Live: the number of seconds for which the message may be kept around for redelivery if it hasn't been delivered yet. Defaults to undefined to use the respective defaults of each provider (2419200 (4 weeks) for Android/FCM and 0 for iOS/APNs)."},expiration:{type:"number",description:"Timestamp since the Unix epoch specifying when the message expires. Same effect as ttl (ttl takes precedence over expiration)."},priority:{type:"string",enum:["default","normal","high"],description:'The delivery priority of the message. Specify default or omit this field to use the default priority on each platform ("normal" on Android and "high" on iOS).'},badge:{type:"number",description:"Number to display in the badge on the app icon. Specify zero to clear the badge."},channelId:{type:"string",description:"ID of the Notification Channel through which to display this notification. If an ID is specified but the corresponding channel does not exist on the device (that has not yet been created by your app), the notification will not be displayed to the user."},categoryId:{type:"string",description:"ID of the notification category that this notification is associated with."},mutableContent:{type:"boolean",description:"Specifies whether this notification can be intercepted by the client app. In Expo Go, this defaults to true, and if you change that to false, you may experience issues. In standalone and bare apps, this defaults to false."}},required:[],additionalProperties:!0},os={output:ha};var ma={type:"object",properties:{to:{description:`This parameter specifies the recipient of a message.
103
+ The value of this header must accurately reflect the contents of your notification's payload. If there is a mismatch, or if the header is missing on required systems, APNs may delay the delivery of the notification or drop it altogether.`},threadId:{type:"string"},payload:{type:"object",additionalProperties:!0},aps:{type:"object",additionalProperties:!0,properties:{badge:{type:"number"},sound:rs,category:{type:"string"},contentAvailable:{type:"number"},launchImage:{type:"number"},mutableContent:{type:"number"},urlArgs:{type:"array",items:{type:"string"}}}},rawPayload:{type:"object",additionalProperties:!0},badge:{type:"number"},sound:rs,alert:{anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{title:{type:"string"},body:{type:"string"},subtitle:{type:"string"},titleLocKey:{type:"string"},titleLocArgs:{type:"array",items:{type:"string"}},actionLocKey:{type:"string"},locKey:{type:"string"},locArgs:{type:"array",items:{type:"string"}},launchImage:{type:"string"}},required:["body"]}]},contentAvailable:{type:"boolean"},mutableContent:{type:"boolean"},mdm:{anyOf:[{type:"string"},{type:"object",additionalProperties:!0}]},urlArgs:{type:"array",items:{type:"string"}}},required:[],additionalProperties:!0},ss={output:ha};var ma={type:"object",properties:{to:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"An Expo push token or an array of Expo push tokens specifying the recipient(s) of this message."},data:{type:"object",additionalProperties:!0,description:'A JSON object delivered to your app. It may be up to about 4KiB; the total notification payload sent to Apple and Google must be at most 4KiB or else you will get a "Message Too Big" error.'},title:{type:"string",description:"The title to display in the notification. Often displayed above the notification body."},subtitle:{type:"string",description:"The subtitle to display in the notification below the title."},body:{type:"string",description:"The message to display in the notification."},sound:{anyOf:[{type:"string"},{type:"null"},{type:"object",properties:{name:{anyOf:[{type:"string",enum:["default"]},{type:"null"}]},volume:{type:"number"},critical:{type:"boolean"}},additionalProperties:!0}],description:"Play a sound when the recipient receives this notification. Specify default to play the device's default notification sound, or omit this field to play no sound. Custom sounds are not supported."},ttl:{type:"number",description:"Time to Live: the number of seconds for which the message may be kept around for redelivery if it hasn't been delivered yet. Defaults to undefined to use the respective defaults of each provider (2419200 (4 weeks) for Android/FCM and 0 for iOS/APNs)."},expiration:{type:"number",description:"Timestamp since the Unix epoch specifying when the message expires. Same effect as ttl (ttl takes precedence over expiration)."},priority:{type:"string",enum:["default","normal","high"],description:'The delivery priority of the message. Specify default or omit this field to use the default priority on each platform ("normal" on Android and "high" on iOS).'},badge:{type:"number",description:"Number to display in the badge on the app icon. Specify zero to clear the badge."},channelId:{type:"string",description:"ID of the Notification Channel through which to display this notification. If an ID is specified but the corresponding channel does not exist on the device (that has not yet been created by your app), the notification will not be displayed to the user."},categoryId:{type:"string",description:"ID of the notification category that this notification is associated with."},mutableContent:{type:"boolean",description:"Specifies whether this notification can be intercepted by the client app. In Expo Go, this defaults to true, and if you change that to false, you may experience issues. In standalone and bare apps, this defaults to false."}},required:[],additionalProperties:!0},os={output:ma};var ya={type:"object",properties:{to:{description:`This parameter specifies the recipient of a message.
104
104
  The value must be a registration token, notification key, or topic. Do not set this field when sending to multiple topics. See **condition**.
105
105
  `,type:"string"},registrationIds:{description:`This parameter specifies a list of devices (registration tokens, or IDs) receiving a multicast message. It must contain at least 1 and at most 1000 registration tokens.
106
106
  Use this parameter only for multicast messaging, not for single recipients. Multicast messages (sending to more than 1 registration tokens) are allowed using HTTP JSON format only.
@@ -136,7 +136,7 @@ If set, and a notification with the same tag is already being shown, the new not
136
136
  `,type:"string"},titleLocArgs:{description:`Indicates the string value to replace format specifiers in the title string for localization.
137
137
  * iOS: Corresponds to "title-loc-args" in the APNs payload.
138
138
  * android: See [Formatting strings](https://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling).
139
- `,type:"string"}}}},required:[],additionalProperties:!0},as={output:ma};var ya={allOf:[{allOf:[{anyOf:[{type:"object",properties:{includedSegments:{type:"array",description:`The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excludedSegments.
139
+ `,type:"string"}}}},required:[],additionalProperties:!0},as={output:ya};var ga={allOf:[{allOf:[{anyOf:[{type:"object",properties:{includedSegments:{type:"array",description:`The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excludedSegments.
140
140
  Example: ["Active Users", "Inactive Users"]
141
141
  `,items:{type:"string"}},excludedSegments:{type:"array",description:`Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in includedSegments. This targeting parameter is only compatible with includedSegments.
142
142
  Example: ["Active Users", "Inactive Users"]
@@ -503,4 +503,4 @@ Examples: All examples are the exact same date & time.
503
503
  "Sept 24 2015 14:00:00 GMT-0700"
504
504
  "Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)"
505
505
  Note: SMS currently only supports sendAfter parameter.
506
- `,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},ls={output:ya};var cs={apns:ss,expo:os,fcm:as,"one-signal":ls,"pusher-beams":B,pushpad:B,"push-webhook":B,appio:B};var ga={type:"object",properties:{},required:[],additionalProperties:!1},ps={output:ga};var wa={type:"object",properties:{to:{type:"string",pattern:"^\\+[1-9]\\d{1,14}$",description:"The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`."},statusCallback:{type:"string",format:"uri",description:"The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messagingServiceSid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). "},applicationSid:{type:"string",minLength:34,maxLength:34,pattern:"^AP[0-9a-fA-F]{32}$",description:"The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `statusCallback` URL. Note that the `statusCallback` parameter of a request takes priority over the `applicationSid` parameter; if both are included `applicationSid` is ignored."},maxPrice:{type:"number",description:"[OBSOLETE] This parameter will no longer have any effect as of 2024-06-03."},provideFeedback:{type:"boolean",description:"Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`."},attempt:{type:"integer",description:"Total number of attempts made (including this request) to send the message regardless of the provider used"},validityPeriod:{type:"integer",description:"The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validityPeriod`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validityPeriod` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html)"},forceDelivery:{type:"boolean",description:"Reserved"},contentRetention:{type:"string",enum:["retain","discard"],description:"Determines if the message content can be stored or redacted based on privacy settings"},addressRetention:{type:"string",enum:["retain","obfuscate"],description:"Determines if the address can be stored or obfuscated based on privacy settings"},smartEncoded:{type:"boolean",description:"Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`."},persistentAction:{type:"array",items:{type:"string"},description:"Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp)."},shortenUrls:{type:"boolean",description:"For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messagingServiceSid` parameter must also be provided."},scheduleType:{type:"string",enum:["fixed"],description:"For Messaging Services only: Include this parameter with a value of `fixed` in conjunction with the `sendAt` parameter in order to [schedule a Message](https://www.twilio.com/docs/messaging/features/message-scheduling)."},sendAt:{type:"string",format:"date-time",description:"The time that Twilio will send the message. Must be in ISO 8601 format."},sendAsMms:{type:"boolean",description:"If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media."},contentVariables:{type:"string",description:"For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `contentSid` parameter must also be provided. If values are not defined in the `contentVariables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used."},riskCheck:{type:"string",enum:["enable","disable"],description:"Include this parameter with a value of `disable` to skip any kind of risk check on the respective message request."},from:{type:"string",pattern:"^\\+[1-9]\\d{1,14}$",description:"The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messagingServiceSid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool."},messagingServiceSid:{type:"string",minLength:34,maxLength:34,pattern:"^MG[0-9a-fA-F]{32}$",description:"The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool."},body:{type:"string",description:"The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [sendAsMms parameter](https://www.twilio.com/blog/mms-for-long-text-messages)."},mediaUrl:{type:"array",items:{type:"string",format:"uri"},description:"The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `mediaUrl` parameters in the POST request. You can include up to ten `mediaUrl` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply."},contentSid:{type:"string",minLength:34,maxLength:34,pattern:"^HX[0-9a-fA-F]{32}$",description:"For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources)."}},required:[],additionalProperties:!0},us={output:wa};var ds={"africas-talking":B,"azure-sms":B,bandwidth:B,"brevo-sms":B,"bulk-sms":B,"burst-sms":B,clickatell:B,clicksend:B,"eazy-sms":B,firetext:B,"forty-six-elks":B,"generic-sms":B,gupshup:B,"infobip-sms":B,"isend-sms":B,kannel:B,maqsam:B,messagebird:B,mobishastra:B,nexmo:B,"novu-sms":ps,plivo:B,"ring-central":B,sendchamp:B,simpletexting:B,sms77:B,"sms-central":B,smsmode:B,sns:B,telnyx:B,termii:B,twilio:us,"afro-message":B,unifonic:B,imedia:B,sinch:B,"isendpro-sms":B};var Mn={chat:Hr,sms:ds,email:ts,push:cs,in_app:is};var Sa={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},ba={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Ta={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},Oa={oneOf:[Sa,ba,Ta]},Aa={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Ln={output:Oa,result:Aa};var va={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},digestKey:{type:"string"},lookBackWindow:{type:"object",properties:{amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},Ea={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},_a={oneOf:[va,Ea]},Ra={type:"object",properties:{eventCount:{type:"number"},events:{type:"array",items:{type:"object",properties:{id:{type:"string"},time:{type:"string"},payload:{type:"object"}},required:["id","time","payload"],additionalProperties:!1}}},required:["events"],additionalProperties:!1},Dn={output:_a,result:Ra};var Un={output:{type:"object",properties:{type:{type:"string",enum:["fixed","dynamic"]},amount:{type:"number"},unit:{type:"string",enum:["minutes","hours","days"]},dynamicKey:{type:"string"},threshold:{type:"number"},throttleKey:{type:"string"}},required:["type"],additionalProperties:!1},result:{type:"object",properties:{throttled:{type:"boolean",description:"Whether the workflow execution was throttled"},executionCount:{type:"number",description:"Number of executions within the throttle window"},threshold:{type:"number",description:"The throttle threshold that was applied"},windowStart:{type:"string",format:"date-time",description:"Start time of the throttle window"}},required:["throttled"],additionalProperties:!1}};var Pa={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},xa={type:"object",properties:{},required:[],additionalProperties:!1},fs={output:Pa,result:xa};var Ia={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Na={type:"object",properties:{},required:[],additionalProperties:!1},hs={output:Ia,result:Na};var ka="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",ys={type:"object",properties:{url:{type:"string",pattern:ka},target:{type:"string",enum:["_self","_blank","_parent","_top","_unfencedTop"],default:"_blank"}},if:{properties:{url:{type:"string",pattern:"^/"}}},then:{properties:{target:{default:"_self"}}},else:{properties:{target:{default:"_blank"}}},required:["url"],additionalProperties:!1},ms={type:"object",properties:{label:{type:"string"},redirect:ys},required:["label"],additionalProperties:!1},Ca={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:ms,secondaryAction:ms,data:{type:"object",additionalProperties:!0},redirect:ys},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},Ma={type:"object",properties:{seen:{type:"boolean"},read:{type:"boolean"},lastSeenDate:{type:"string",format:"date-time",nullable:!0},lastReadDate:{type:"string",format:"date-time",nullable:!0}},required:["seen","read","lastSeenDate","lastReadDate"],additionalProperties:!1},gs={output:Ca,result:Ma};var La={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Da={type:"object",properties:{},required:[],additionalProperties:!1},ws={output:La,result:Da};var Ua={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Fa={type:"object",properties:{},required:[],additionalProperties:!1},Ss={output:Ua,result:Fa};var Je={chat:fs,sms:Ss,push:ws,email:hs,in_app:gs};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};var Fn=(S=>(S.NONE="none",S.LOW="low",S.MEDIUM="medium",S.HIGH="high",S))(Fn||{});async function St(h,n,s){if(h.steps.some(c=>c.stepId===n))throw new wn(n);h.steps.push(s)}async function $n(h,n,s,c){return async(S,U,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve;return await St(h,S,{stepId:S,type:n,controls:{schema:await Me(z),unknownSchema:z},outputs:{schema:await Me(s),unknownSchema:s},results:{schema:await Me(c),unknownSchema:c},resolve:U,code:U.toString(),options:C,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function bs(h,n,s){let c=Mn[n],S=Object.entries(s).map(async([U,C])=>{let z=c[U];return{type:U,code:C.toString(),resolve:C,outputs:{schema:await Me(z.output),unknownSchema:z.output}}});h.providers.push(...await Promise.all(S))}async function bt(h,n,s,c){return async(S,U,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve,ie={stepId:S,type:n,controls:{schema:await Me(z),unknownSchema:z},outputs:{schema:await Me(s),unknownSchema:s},results:{schema:await Me(c),unknownSchema:c},resolve:U,code:U.toString(),options:C,providers:[]};return await St(h,S,ie),Object.keys(C.providers||{}).length>0&&await bs(ie,n,C.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function Ts(h,n){return async(s,c,S={})=>{let U=(S==null?void 0:S.controlSchema)||Ve,C=(S==null?void 0:S.outputSchema)||Ve,[z,ie]=await Promise.all([Me(U),Me(C)]);return await St(h,s,{stepId:s,type:n,controls:{schema:z,unknownSchema:U},outputs:{schema:ie,unknownSchema:C},results:{schema:ie,unknownSchema:C},resolve:c,code:c.toString(),options:S,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var $a={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat"};function Os(h){if(!h)return{};let n={};return h.all&&(n.all=h.all),Object.entries(h.channels||{}).forEach(([s,c])=>{let S=$a[s];S&&(n.channels||(n.channels={}),n.channels[S]=c)}),n}function As(h,n,s){let c=s||{};return{id:h,trigger:async C=>{let z=bn(An(C.secretKey),On(C.apiUrl)),ie=C.payload||{},Ae;if(c.payloadSchema){let Fe=await Nn(c.payloadSchema,ie);if(Fe.success===!1)throw new sn(h,Fe.errors);Ae=Fe.data}else Ae=C.payload;let Ie=await kr(),Ne={name:h,to:C.to,payload:{...Ae},...C.transactionId&&{transactionId:C.transactionId},...C.overrides&&{overrides:C.overrides},...C.actor&&{actor:C.actor},...C.context&&{context:C.context},...Ie&&{bridgeUrl:Ie}},Se=await z.post("/events/trigger",Ne);return{cancel:async()=>z.delete(`/events/trigger/${Se.transactionId}`),data:Se}},discover:async()=>{var z;let C={workflowId:h,severity:(z=c.severity)!=null?z:"none",steps:[],code:n.toString(),payload:{schema:await Me(c.payloadSchema||Ve),unknownSchema:c.payloadSchema||Ve},controls:{schema:await Me(c.controlSchema||Ve),unknownSchema:c.controlSchema||Ve},tags:c.tags||[],preferences:Os(c.preferences),name:c.name,description:c.description,execute:n};return await n({payload:{},subscriber:{},environment:{},controls:{},context:{},step:{push:await bt(C,"push",Je.push.output,Je.push.result),chat:await bt(C,"chat",Je.chat.output,Je.chat.result),email:await bt(C,"email",Je.email.output,Je.email.result),sms:await bt(C,"sms",Je.sms.output,Je.sms.result),inApp:await bt(C,"in_app",Je.in_app.output,Je.in_app.result),digest:await $n(C,"digest",Dn.output,Dn.result),delay:await $n(C,"delay",Ln.output,Ln.result),throttle:await $n(C,"throttle",Un.output,Un.result),custom:await Ts(C,"custom")}}),C}}}0&&(module.exports={Client,CronExpression,NovuRequestHandler,SeverityLevelEnum,providerSchemas,workflow});
506
+ `,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},ls={output:ga};var cs={apns:ss,expo:os,fcm:as,"one-signal":ls,"pusher-beams":B,pushpad:B,"push-webhook":B,appio:B};var wa={type:"object",properties:{},required:[],additionalProperties:!1},ps={output:wa};var Sa={type:"object",properties:{to:{type:"string",pattern:"^\\+[1-9]\\d{1,14}$",description:"The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`."},statusCallback:{type:"string",format:"uri",description:"The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messagingServiceSid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). "},applicationSid:{type:"string",minLength:34,maxLength:34,pattern:"^AP[0-9a-fA-F]{32}$",description:"The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `statusCallback` URL. Note that the `statusCallback` parameter of a request takes priority over the `applicationSid` parameter; if both are included `applicationSid` is ignored."},maxPrice:{type:"number",description:"[OBSOLETE] This parameter will no longer have any effect as of 2024-06-03."},provideFeedback:{type:"boolean",description:"Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`."},attempt:{type:"integer",description:"Total number of attempts made (including this request) to send the message regardless of the provider used"},validityPeriod:{type:"integer",description:"The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validityPeriod`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validityPeriod` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html)"},forceDelivery:{type:"boolean",description:"Reserved"},contentRetention:{type:"string",enum:["retain","discard"],description:"Determines if the message content can be stored or redacted based on privacy settings"},addressRetention:{type:"string",enum:["retain","obfuscate"],description:"Determines if the address can be stored or obfuscated based on privacy settings"},smartEncoded:{type:"boolean",description:"Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`."},persistentAction:{type:"array",items:{type:"string"},description:"Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp)."},shortenUrls:{type:"boolean",description:"For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messagingServiceSid` parameter must also be provided."},scheduleType:{type:"string",enum:["fixed"],description:"For Messaging Services only: Include this parameter with a value of `fixed` in conjunction with the `sendAt` parameter in order to [schedule a Message](https://www.twilio.com/docs/messaging/features/message-scheduling)."},sendAt:{type:"string",format:"date-time",description:"The time that Twilio will send the message. Must be in ISO 8601 format."},sendAsMms:{type:"boolean",description:"If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media."},contentVariables:{type:"string",description:"For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `contentSid` parameter must also be provided. If values are not defined in the `contentVariables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used."},riskCheck:{type:"string",enum:["enable","disable"],description:"Include this parameter with a value of `disable` to skip any kind of risk check on the respective message request."},from:{type:"string",pattern:"^\\+[1-9]\\d{1,14}$",description:"The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messagingServiceSid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool."},messagingServiceSid:{type:"string",minLength:34,maxLength:34,pattern:"^MG[0-9a-fA-F]{32}$",description:"The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool."},body:{type:"string",description:"The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [sendAsMms parameter](https://www.twilio.com/blog/mms-for-long-text-messages)."},mediaUrl:{type:"array",items:{type:"string",format:"uri"},description:"The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `mediaUrl` parameters in the POST request. You can include up to ten `mediaUrl` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply."},contentSid:{type:"string",minLength:34,maxLength:34,pattern:"^HX[0-9a-fA-F]{32}$",description:"For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources)."}},required:[],additionalProperties:!0},us={output:Sa};var ds={"africas-talking":B,"azure-sms":B,bandwidth:B,"brevo-sms":B,"bulk-sms":B,"burst-sms":B,clickatell:B,clicksend:B,"eazy-sms":B,firetext:B,"forty-six-elks":B,"generic-sms":B,gupshup:B,"infobip-sms":B,"isend-sms":B,kannel:B,maqsam:B,messagebird:B,mobishastra:B,nexmo:B,"novu-sms":ps,plivo:B,"ring-central":B,sendchamp:B,simpletexting:B,sms77:B,"sms-central":B,smsmode:B,sns:B,telnyx:B,termii:B,twilio:us,"afro-message":B,unifonic:B,imedia:B,sinch:B,"isendpro-sms":B};var Mn={chat:Hr,sms:ds,email:ts,push:cs,in_app:is};var ba={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},Ta={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Oa={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},Aa={oneOf:[ba,Ta,Oa]},va={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Ln={output:Aa,result:va};var Ea={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},digestKey:{type:"string"},lookBackWindow:{type:"object",properties:{amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},_a={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Ra={oneOf:[Ea,_a]},Pa={type:"object",properties:{eventCount:{type:"number"},events:{type:"array",items:{type:"object",properties:{id:{type:"string"},time:{type:"string"},payload:{type:"object"}},required:["id","time","payload"],additionalProperties:!1}}},required:["events"],additionalProperties:!1},Dn={output:Ra,result:Pa};var Un={output:{type:"object",properties:{type:{type:"string",enum:["fixed","dynamic"]},amount:{type:"number"},unit:{type:"string",enum:["minutes","hours","days"]},dynamicKey:{type:"string"},threshold:{type:"number"},throttleKey:{type:"string"}},required:["type"],additionalProperties:!1},result:{type:"object",properties:{throttled:{type:"boolean",description:"Whether the workflow execution was throttled"},executionCount:{type:"number",description:"Number of executions within the throttle window"},threshold:{type:"number",description:"The throttle threshold that was applied"},windowStart:{type:"string",format:"date-time",description:"Start time of the throttle window"}},required:["throttled"],additionalProperties:!1}};var xa={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Ia={type:"object",properties:{},required:[],additionalProperties:!1},fs={output:xa,result:Ia};var Na={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},ka={type:"object",properties:{},required:[],additionalProperties:!1},hs={output:Na,result:ka};var Ca="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",ys={type:"object",properties:{url:{type:"string",pattern:Ca},target:{type:"string",enum:["_self","_blank","_parent","_top","_unfencedTop"],default:"_blank"}},if:{properties:{url:{type:"string",pattern:"^/"}}},then:{properties:{target:{default:"_self"}}},else:{properties:{target:{default:"_blank"}}},required:["url"],additionalProperties:!1},ms={type:"object",properties:{label:{type:"string"},redirect:ys},required:["label"],additionalProperties:!1},Ma={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:ms,secondaryAction:ms,data:{type:"object",additionalProperties:!0},redirect:ys},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},La={type:"object",properties:{seen:{type:"boolean"},read:{type:"boolean"},lastSeenDate:{type:"string",format:"date-time",nullable:!0},lastReadDate:{type:"string",format:"date-time",nullable:!0}},required:["seen","read","lastSeenDate","lastReadDate"],additionalProperties:!1},gs={output:Ma,result:La};var Da={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Ua={type:"object",properties:{},required:[],additionalProperties:!1},ws={output:Da,result:Ua};var Fa={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},$a={type:"object",properties:{},required:[],additionalProperties:!1},Ss={output:Fa,result:$a};var Je={chat:fs,sms:Ss,push:ws,email:hs,in_app:gs};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};var Fn=(S=>(S.NONE="none",S.LOW="low",S.MEDIUM="medium",S.HIGH="high",S))(Fn||{});async function St(f,n,s){if(f.steps.some(l=>l.stepId===n))throw new wn(n);f.steps.push(s)}async function $n(f,n,s,l){return async(S,U,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve;return await St(f,S,{stepId:S,type:n,controls:{schema:await Me(z),unknownSchema:z},outputs:{schema:await Me(s),unknownSchema:s},results:{schema:await Me(l),unknownSchema:l},resolve:U,code:U.toString(),options:C,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function bs(f,n,s){let l=Mn[n],S=Object.entries(s).map(async([U,C])=>{let z=l[U];return{type:U,code:C.toString(),resolve:C,outputs:{schema:await Me(z.output),unknownSchema:z.output}}});f.providers.push(...await Promise.all(S))}async function bt(f,n,s,l){return async(S,U,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve,ie={stepId:S,type:n,controls:{schema:await Me(z),unknownSchema:z},outputs:{schema:await Me(s),unknownSchema:s},results:{schema:await Me(l),unknownSchema:l},resolve:U,code:U.toString(),options:C,providers:[]};return await St(f,S,ie),Object.keys(C.providers||{}).length>0&&await bs(ie,n,C.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function Ts(f,n){return async(s,l,S={})=>{let U=(S==null?void 0:S.controlSchema)||Ve,C=(S==null?void 0:S.outputSchema)||Ve,[z,ie]=await Promise.all([Me(U),Me(C)]);return await St(f,s,{stepId:s,type:n,controls:{schema:z,unknownSchema:U},outputs:{schema:ie,unknownSchema:C},results:{schema:ie,unknownSchema:C},resolve:l,code:l.toString(),options:S,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var ja={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat"};function Os(f){if(!f)return{};let n={};return f.all&&(n.all=f.all),Object.entries(f.channels||{}).forEach(([s,l])=>{let S=ja[s];S&&(n.channels||(n.channels={}),n.channels[S]=l)}),n}function As(f,n,s){let l=s||{};return{id:f,trigger:async C=>{let z=bn(An(C.secretKey),On(C.apiUrl)),ie=C.payload||{},Se;if(l.payloadSchema){let Fe=await Nn(l.payloadSchema,ie);if(Fe.success===!1)throw new sn(f,Fe.errors);Se=Fe.data}else Se=C.payload;let Ie=await kr(),Ne={name:f,to:C.to,payload:{...Se},...C.transactionId&&{transactionId:C.transactionId},...C.overrides&&{overrides:C.overrides},...C.actor&&{actor:C.actor},...C.context&&{context:C.context},...Ie&&{bridgeUrl:Ie}},be=await z.post("/events/trigger",Ne);return{cancel:async()=>z.delete(`/events/trigger/${be.transactionId}`),data:be}},discover:async()=>{var z;let C={workflowId:f,severity:(z=l.severity)!=null?z:"none",steps:[],code:n.toString(),payload:{schema:await Me(l.payloadSchema||Ve),unknownSchema:l.payloadSchema||Ve},controls:{schema:await Me(l.controlSchema||Ve),unknownSchema:l.controlSchema||Ve},tags:l.tags||[],preferences:Os(l.preferences),name:l.name,description:l.description,execute:n};return await n({payload:{},subscriber:{},environment:{},controls:{},context:{},step:{push:await bt(C,"push",Je.push.output,Je.push.result),chat:await bt(C,"chat",Je.chat.output,Je.chat.result),email:await bt(C,"email",Je.email.output,Je.email.result),sms:await bt(C,"sms",Je.sms.output,Je.sms.result),inApp:await bt(C,"in_app",Je.in_app.output,Je.in_app.result),digest:await $n(C,"digest",Dn.output,Dn.result),delay:await $n(C,"delay",Ln.output,Ln.result),throttle:await $n(C,"throttle",Un.output,Un.result),custom:await Ts(C,"custom")}}),C}}}0&&(module.exports={Client,CronExpression,NovuRequestHandler,SeverityLevelEnum,providerSchemas,workflow});