@novu/framework 2.9.0 → 2.10.0-alpha.1

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 (66) hide show
  1. package/dist/cjs/base.schema.types-BApIn9jr.d.cts +135 -0
  2. package/dist/cjs/{health-check.types-D_KcRiM_.d.cts → health-check.types-CBl2aQ8k.d.cts} +21 -131
  3. package/dist/cjs/{index-S0QKfWxm.d.cts → index-D3UJoqjc.d.cts} +5 -1
  4. package/dist/cjs/index.cjs +37 -38
  5. package/dist/cjs/index.d.cts +4 -2
  6. package/dist/cjs/internal/index.cjs +1 -2
  7. package/dist/cjs/internal/index.d.cts +13 -67
  8. package/dist/cjs/servers/express.cjs +65 -66
  9. package/dist/cjs/servers/express.d.cts +5 -3
  10. package/dist/cjs/servers/h3.cjs +37 -38
  11. package/dist/cjs/servers/h3.d.cts +5 -3
  12. package/dist/cjs/servers/lambda.cjs +51 -52
  13. package/dist/cjs/servers/lambda.d.cts +6 -4
  14. package/dist/cjs/servers/nest.cjs +57 -58
  15. package/dist/cjs/servers/nest.d.cts +6 -4
  16. package/dist/cjs/servers/next.cjs +72 -73
  17. package/dist/cjs/servers/next.d.cts +5 -3
  18. package/dist/cjs/servers/nuxt.cjs +37 -38
  19. package/dist/cjs/servers/nuxt.d.cts +5 -3
  20. package/dist/cjs/servers/remix.cjs +37 -38
  21. package/dist/cjs/servers/remix.d.cts +5 -3
  22. package/dist/cjs/servers/sveltekit.cjs +35 -36
  23. package/dist/cjs/servers/sveltekit.d.cts +5 -3
  24. package/dist/cjs/step-resolver.cjs +1 -0
  25. package/dist/cjs/step-resolver.d.cts +32 -0
  26. package/dist/cjs/validator.types-BeoiKdnR.d.cts +66 -0
  27. package/dist/cjs/validators.cjs +1 -0
  28. package/dist/cjs/validators.d.cts +23 -0
  29. package/dist/esm/base.schema.types-BApIn9jr.d.ts +135 -0
  30. package/dist/esm/chunk-7YRWUU4W.js +95 -0
  31. package/dist/esm/chunk-AZJKOVFF.js +1 -0
  32. package/dist/esm/chunk-C734BFYR.js +1 -0
  33. package/dist/esm/{chunk-YLCZR2QR.js → chunk-HQVOLRIB.js} +4 -5
  34. package/dist/esm/chunk-JFMDTNSL.js +1 -0
  35. package/dist/esm/chunk-PLPQUHX6.js +1 -0
  36. package/dist/esm/{health-check.types-D_KcRiM_.d.ts → health-check.types-23Z3Ne4i.d.ts} +21 -131
  37. package/dist/esm/{index-CmEcpAEO.d.ts → index-B6Kq7kjS.d.ts} +5 -1
  38. package/dist/esm/index.d.ts +4 -2
  39. package/dist/esm/index.js +1 -1
  40. package/dist/esm/internal/index.d.ts +13 -67
  41. package/dist/esm/internal/index.js +1 -1
  42. package/dist/esm/servers/express.d.ts +5 -3
  43. package/dist/esm/servers/express.js +1 -1
  44. package/dist/esm/servers/h3.d.ts +5 -3
  45. package/dist/esm/servers/h3.js +1 -1
  46. package/dist/esm/servers/lambda.d.ts +6 -4
  47. package/dist/esm/servers/lambda.js +1 -1
  48. package/dist/esm/servers/nest.d.ts +6 -4
  49. package/dist/esm/servers/nest.js +1 -1
  50. package/dist/esm/servers/next.d.ts +5 -3
  51. package/dist/esm/servers/next.js +1 -1
  52. package/dist/esm/servers/nuxt.d.ts +5 -3
  53. package/dist/esm/servers/nuxt.js +1 -1
  54. package/dist/esm/servers/remix.d.ts +5 -3
  55. package/dist/esm/servers/remix.js +1 -1
  56. package/dist/esm/servers/sveltekit.d.ts +5 -3
  57. package/dist/esm/servers/sveltekit.js +1 -1
  58. package/dist/esm/step-resolver.d.ts +32 -0
  59. package/dist/esm/step-resolver.js +1 -0
  60. package/dist/esm/validator.types-BIQli_m1.d.ts +66 -0
  61. package/dist/esm/validators.d.ts +23 -0
  62. package/dist/esm/validators.js +1 -0
  63. package/package.json +24 -2
  64. package/step-resolver/package.json +4 -0
  65. package/validators/package.json +4 -0
  66. package/dist/esm/chunk-ZF4VXELU.js +0 -95
@@ -1,9 +1,9 @@
1
- "use strict";var Lo=Object.create;var Gt=Object.defineProperty;var Do=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Fo=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty;var jo=(f,n)=>{for(var s in n)Gt(f,s,{get:n[s],enumerable:!0})},Tr=(f,n,s,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let w of Uo(n))!$o.call(f,w)&&w!==s&&Gt(f,w,{get:()=>n[w],enumerable:!(l=Do(n,w))||l.enumerable});return f};var et=(f,n,s)=>(s=f!=null?Lo(Fo(f)):{},Tr(n||!f||!f.__esModule?Gt(s,"default",{value:f,enumerable:!0}):s,f)),Yo=f=>Tr(Gt({},"__esModule",{value:!0}),f);var Va={};jo(Va,{Client:()=>wt,CronExpression:()=>ci,NovuRequestHandler:()=>St,SeverityLevelEnum:()=>Fn,frameworkName:()=>vs,providerSchemas:()=>Mn,serve:()=>Wa,workflow:()=>As});module.exports=Yo(Va);var Gr=require("jsonrepair");var Pt=(l=>(l.TRIGGER="trigger",l.EXECUTE="execute",l.PREVIEW="preview",l))(Pt||{}),Kt=(l=>(l.DISCOVER="discover",l.HEALTH_CHECK="health-check",l.CODE="code",l))(Kt||{});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 Ht=(l=>(l.POST="POST",l.GET="GET",l.OPTIONS="OPTIONS",l))(Ht||{});var Wo=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{},zt=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;Wo(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})}},Xt=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 Qt=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}}},It=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}},Zt=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}},en=class extends Ue{constructor(s,l,w){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=w}},tn=class extends Ue{constructor(s,l,w){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=w}},nn=class extends Ue{constructor(s,l,w){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=w}},rn=class extends Ue{constructor(s,l,w){super(`Workflow with id: \`${s}\` has invalid controls syntax in step with id: \`${l}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=w}},sn=class extends Ue{constructor(s,l,w,M){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${l}\` and provider with id: \`${w}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=M}},on=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(", "),an=f=>f.replaceAll(/(\w)(\w*)/g,(n,s,l)=>s.toUpperCase()+l.toLowerCase()).replaceAll(/[\s-]+/g,"");var ln=class extends tt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${pi(Ht)}`}},Nt=class extends Ue{constructor(s,l){super(`Invalid query string: \`action\`=\`${s}\`. Please use one of ${pi(l)}`);this.code="InvalidActionError"}},cn=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 pn=class extends Error{constructor(n,s,l){super(),this.data={message:l},this.statusCode=n,this.code=s}};var kt=class extends Xt{constructor(n,s){super(`${an(n)} with id: \`${s}\` already exists. Please use a different id.`)}},at=class extends zt{constructor(n,s){super(`${an(n)} with id: \`${s}\` does not exist. Please provide a valid id.`)}},yt=class extends ot{constructor(s,l,w,M){super(`Failed to ${w} ${an(s)} with id: \`${l}\``,{cause:M});this.statusCode=502}};var un=class extends at{constructor(s){super("provider",s);this.code="ProviderNotFoundError"}},dn=class extends yt{constructor(s,l,w){super("provider",s,l,w);this.code="ProviderExecutionFailedError"}};var fn=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"}},hn=class extends st{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},mn=class extends st{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},yn=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"}},gn=class extends st{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var wn=class extends at{constructor(s){super("step",s);this.code="StepNotFoundError"}},Sn=class extends kt{constructor(s){super("step",s);this.code="StepAlreadyExistsError"}},Ct=class extends yt{constructor(s,l,w){super("step",s,l,w);this.code="StepExecutionFailedError"}};var Mt=class extends at{constructor(s){super("workflow",s);this.code="WorkflowNotFoundError"}};var bn=(()=>{var f=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,w=(e,t)=>function(){return e&&(t=(0,e[s(e)[0]])(e=0)),t},M=(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})},K=(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=>K(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"?At.register(e,t):At.get(e):At.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 jt.default.prototype.max=te("defaultRandExpMax"),jt.default.prototype.randInt=(i,c)=>i+Math.floor(te("random")()*(1+(c-i))),new jt.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 Ut(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 Ut(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 Ft(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 Es(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,U]=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),U=`0${Math.max(1,Math.min(59,U))}`.slice(-2),`${c}-${p}-${h}T${d}:${O}:${U}.000Z`}function _s(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=Ft(p)?parseFloat(p):p;break;case"integer":p=Ft(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,U=0;for(;p.length<h;)if(O=p,t.pattern?p+=Z.randexp(t.pattern):p+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${p}`,p===O){if(U+=1,U===3)break}else U=0;switch(p.length>d&&(p=p.substr(0,d)),t.format){case"date-time":case"datetime":p=new Date(Es(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 Rs(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 Ps(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function xs(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 Is(e,t){return!t.every(i=>Yn(e,i))}function Ns(e,t){return t.reduce((c,p)=>c+(Yn(e,p)?1:0),0)===1}function ks(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function Cs(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 Ms(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("."),U=e();for(;O.length>1;)U=U[O.shift()];return t=typeof U=="object"?U[O[0]]:U,typeof t=="function"&&(t=t.apply(U,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 Ls(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 Ds(e,t,i){return Object.keys(e).filter(c=>{let p=Ki.indexOf(t)>-1;return i.indexOf(c)>-1&&!p}).length>0}function Us(e,t){let i=Object.keys(vt);for(let c=0;c<i.length;c+=1){let p=i[c],h=t[t.length-1];if(Ds(e,h,vt[p]))return p}}function Fs(){return te("random")()>.5}function $s(){return null}function js(e,t,i,c,p,h){let d=[],O=[];function U($){let E=JSON.stringify($.value);return O.indexOf(E)===-1?(O.push(E),d.push($),!0):!1}t.forEach(U);let T=100;for(;d.length!==t.length&&(U(h(i.items||c,e,p))||(T-=1),!!T););return d}function Ys(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 Yt(`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"),U=te("maxItems");O&&(h=typeof h=="undefined"?O:Math.min(O,h)),U&&(d=typeof d=="undefined"?U:Math.min(U,d),d&&d>U&&(d=U),h&&h>U&&(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?js(t.concat(["items"]),p,e,J,i,c):p}function Ws(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)),U=Z.number(t,i-1);return String(O).includes(".")?U+O:(U+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 Vs(e){return Math.floor(ri({...e}))}function qs(e){return Z.shuffle(rr).slice(0,e)}function Bs(e,t,i,c){let p={},h=e.properties||{},d=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),U=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=U&&e.additionalProperties===!0?Vt:e.additionalProperties;if(!U&&T.length===0&&$.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(te("requiredOnly")===!0)return O.forEach(Y=>{h[Y]&&(p[Y]=h[Y])}),c(p,t.concat(["properties"]),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+(U?Z.number(1,5):0),S=Math.max(e.minProperties||0,O.length),b=Math.max(0,J.length-S);J.length===1&&!O.length&&(S=Math.max(Z.number(ye?1:0,j),S)),ae!==null&&(Q===!0?b=Math.round(S-O.length+ae*(J.length-S)):b=Z.number(S-O.length,ae*(J.length-S)));let R=Z.shuffle(E).slice(0,b),x=E.filter(Y=>R.indexOf(Y)!==-1),L=ae!==null||O.length===j?j:Z.number(0,j),_=O.concat(Z.shuffle(x).slice(0,L)).slice(0,j),I=[],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=S;if(U&&!O.length&&(_e=Math.max(ae===null||W?Z.number(ye?1:0,j):0,S)),!x.length&&!b&&U&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)p[Wt(1)+Ae(Y[m])]=W||Vt}for(;ye&&!(!($.length||U)||ee>=_e);){if(U)if(he&&T.length-ee>_e){let Y=0,m;do{if(Y+=1,Y>1e3)break;m=ve(O)||Z.pick(T)}while(typeof p[m]!="undefined");typeof p[m]=="undefined"&&(p[m]=h[m],ee+=1)}else if($.length&&!W){let Y=Z.pick($),m=Z.randexp(Y);p[m]||(p[m]=d[Y],ee+=1)}else{let Y=ve(O)||Wt(1)+Ae();p[Y]||(p[Y]=W||Vt,ee+=1)}for(let Y=0;ee<S&&Y<$.length;Y+=1){let m=$[Y],N=Z.randexp(m);p[N]||(p[N]=d[m],ee+=1)}}if(O.length===0&&(!U||ae===!1)){let Y=Z.number(S,j);for(;ee<Y;){let m=ve(T);m&&(p[m]=h[m]),ee+=1}}let Pe=p;if(te("sortProperties")!==null){let Y=Object.keys(h);Pe=Object.keys(p).sort((N,H)=>te("sortProperties")?N.localeCompare(H):Y.indexOf(N)-Y.indexOf(H)).reduce((N,H)=>(N[H]=p[H],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 Wt(e).join(" ")}function Js(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 Gs(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function Ks(){return Z.date().toISOString()}function Hs(){return qt().slice(0,10)}function zs(){return qt().slice(11)}function Xs(e){return Z.randexp(je[e]).replace(pr,(t,i)=>Z.randexp(je[i]))}function Qs(e,t){let i=ii(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return qt();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 Zs(e){return de.typecast("string",e,i=>e.format?Qs(e,()=>si(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):si(i.minLength,i.maxLength))}function eo({$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={...eo(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(Et[h])try{let T=Et[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 Yt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new Yt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&Et[T]?{value:Et[T](e,t,i,ft),context:p}:{value:T,context:p}}}let d={},O={...p};Array.isArray(e)&&(d=[]);let U=te("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!U.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:E}=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 to(e){return Array.isArray(e)?Z.pick(e):e}function no(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?no(i[d],h.reverse):to(i[d])}return Object.keys(e).forEach(p=>{e[p]=qn(e[p],t,i,p)}),e}function io(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 ro(e){return e.value}function so(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}=so(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(U=>{Bn(e,[...t,"items",U.key.value],U.key,U.value)}):c instanceof wr&&c.items.forEach((U,T)=>{Bn(e,[...t,"items",T],U)})}function oo({value:e,context:t}){let i=_t.createNode(e);Bn(t,[],i);let c=new _t.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,Ot,$t,zn,ki,Ci,Xn,Qn,Mi,Li,Zn,ue,ei,Di,Ui,At,te,ti,ni,Fi,$i,ji,Yi,Wi,Vi,He,jt,Z,qi,de,Bi,Ji,ht,ii,Gi,Yt,vt,Ki,Hi,zi,Xi,Qi,Zi,er,tr,nr,ri,ir,rr,Wt,Vt,sr,si,or,qt,ar,lr,oi,Bt,cr,je,pr,ur,dr,fr,Et,hr,mr,yr,ai,li,Le,ao,lo,co,po,uo,fo,ho,mo,yo,go,wo,So,gr,wr,_t,Xe,Oe,Sr,br,bo=w({"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,U,T,$,E,J,W,ae)=>{if(T)return O;var Q=U?8:$?parseInt($,16):E?parseInt(E,16):J?parseInt(J,8):W?c.indexOf(W):p[ae],ne=String.fromCharCode(Q);return/[[\]{}^$.|?*+()]/.test(ne)&&(ne="\\"+ne),ne}),h},e.tokenizeClass=(h,d)=>{for(var O=[],U=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,T,$;(T=U.exec(h))!=null;)if(T[1])O.push(i.words());else if(T[2])O.push(i.ints());else if(T[3])O.push(i.whitespace());else if(T[4])O.push(i.notWords());else if(T[5])O.push(i.notInts());else if(T[6])O.push(i.notWhitespace());else if(T[7])O.push({type:t.RANGE,from:(T[8]||T[9]).charCodeAt(0),to:T[10].charCodeAt(0)});else if($=T[12])O.push({type:t.CHAR,value:$.charCodeAt(0)});else return[O,U.lastIndex];e.error(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,U,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(U=Q.length;O<U;)switch(T=Q[O++],T){case"\\":switch(T=Q[O++],T){case"b":J.push(h.wordBoundary());break;case"B":J.push(h.nonWordBoundary());break;case"w":J.push(p.words());break;case"W":J.push(p.notWords());break;case"d":J.push(p.ints());break;case"D":J.push(p.notInts());break;case"s":J.push(p.whitespace());break;case"S":J.push(p.notWhitespace());break;default:/\d/.test(T)?J.push({type:c.REFERENCE,value:parseInt(T,10)}):J.push({type:c.CHAR,value:T.charCodeAt(0)})}break;case"^":J.push(h.begin());break;case"$":J.push(h.end());break;case"[":{var ne;Q[O]==="^"?(ne=!0,O++):ne=!1;var he=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 S=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,R;S!==null?(J.length===0&&ae(O),b=parseInt(S[1],10),R=S[2]?S[3]?parseInt(S[3],10):1/0:b,O+=S[0].length,J.push({type:c.REPETITION,min:b,max:R,value:J.pop()})):J.push({type:c.CHAR,value:123});break}case"?":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1,value:J.pop()});break;case"+":J.length===0&&ae(O),J.push({type:c.REPETITION,min:1,max:1/0,value:J.pop()});break;case"*":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1/0,value:J.pop()});break;default:J.push({type:c.CHAR,value:T.charCodeAt(0)})}return W.length!==0&&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 Lt{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=U=>{for(var T=0;T<this.ranges.length&&!U.touches(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&U.touches(this.ranges[T]);)U=U.add(this.ranges[T]),T++;$.push(U),this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Lt?h.ranges.forEach(O):(d==null&&(d=h),O(new i(h,d))),this}subtract(h,d){var O=U=>{for(var T=0;T<this.ranges.length&&!U.overlaps(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&U.overlaps(this.ranges[T]);)$=$.concat(this.ranges[T].subtract(U)),T++;this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Lt?h.ranges.forEach(O):(d==null&&(d=h),O(new i(h,d))),this}intersect(h,d){var O=[],U=T=>{for(var $=0;$<this.ranges.length&&!T.overlaps(this.ranges[$]);)$++;for(;$<this.ranges.length&&T.overlaps(this.ranges[$]);){var E=Math.max(this.ranges[$].low,T.low),J=Math.min(this.ranges[$].high,T.high);O.push(new i(E,J)),$++}};return h instanceof Lt?h.ranges.forEach(U):(d==null&&(d=h),U(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 Lt(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 Dt{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:Dt.prototype.max!=null?Dt.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 U,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),U=d.options?this._randSelect(d.options):d.stack,T="",E=0,J=U.length;E<J;E++)T+=this._gen(U[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 U=0;U<d.set.length;U++){let T=this._expand(d.set[U]);if(O.add(T),this.ignoreCase)for(let $=0;$<T.length;$++){let E=T.index($),J=this._toOtherCase(E);E!==J&&O.add(J)}}return 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 U;return typeof d=="string"&&(d=new RegExp(d,O)),d._randexp===void 0?(U=new Dt(d,O),d._randexp=U):(U=d._randexp,U._setDefaults(d)),U.gen()}static sugar(){RegExp.prototype.gen=function(){return Dt.randexp(this)}}}}}),Ot=$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 S=[0],b=j.indexOf(`
1
+ "use strict";var jo=Object.create;var Ht=Object.defineProperty;var Yo=Object.getOwnPropertyDescriptor;var Wo=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty;var Bo=(p,n)=>{for(var s in n)Ht(p,s,{get:n[s],enumerable:!0})},Ti=(p,n,s,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let g of Wo(n))!qo.call(p,g)&&g!==s&&Ht(p,g,{get:()=>n[g],enumerable:!(l=Yo(n,g))||l.enumerable});return p};var et=(p,n,s)=>(s=p!=null?jo(Vo(p)):{},Ti(n||!p||!p.__esModule?Ht(s,"default",{value:p,enumerable:!0}):s,p)),Jo=p=>Ti(Ht({},"__esModule",{value:!0}),p);var Xa={};Bo(Xa,{Client:()=>wt,CronExpression:()=>cr,NovuRequestHandler:()=>St,SeverityLevelEnum:()=>$n,frameworkName:()=>xs,providerSchemas:()=>Ln,serve:()=>za,step:()=>Ps,workflow:()=>Rs});module.exports=Jo(Xa);var Xi=require("jsonrepair");var xt=(l=>(l.TRIGGER="trigger",l.EXECUTE="execute",l.PREVIEW="preview",l))(xt||{}),zt=(l=>(l.DISCOVER="discover",l.HEALTH_CHECK="health-check",l.CODE="code",l))(zt||{});var cr=(F=>(F.EVERY_SECOND="* * * * * *",F.EVERY_5_SECONDS="*/5 * * * * *",F.EVERY_10_SECONDS="*/10 * * * * *",F.EVERY_30_SECONDS="*/30 * * * * *",F.EVERY_MINUTE="*/1 * * * *",F.EVERY_5_MINUTES="0 */5 * * * *",F.EVERY_10_MINUTES="0 */10 * * * *",F.EVERY_30_MINUTES="0 */30 * * * *",F.EVERY_HOUR="0 0-23/1 * * *",F.EVERY_2_HOURS="0 0-23/2 * * *",F.EVERY_3_HOURS="0 0-23/3 * * *",F.EVERY_4_HOURS="0 0-23/4 * * *",F.EVERY_5_HOURS="0 0-23/5 * * *",F.EVERY_6_HOURS="0 0-23/6 * * *",F.EVERY_7_HOURS="0 0-23/7 * * *",F.EVERY_8_HOURS="0 0-23/8 * * *",F.EVERY_9_HOURS="0 0-23/9 * * *",F.EVERY_10_HOURS="0 0-23/10 * * *",F.EVERY_11_HOURS="0 0-23/11 * * *",F.EVERY_12_HOURS="0 0-23/12 * * *",F.EVERY_DAY_AT_1AM="0 01 * * *",F.EVERY_DAY_AT_2AM="0 02 * * *",F.EVERY_DAY_AT_3AM="0 03 * * *",F.EVERY_DAY_AT_4AM="0 04 * * *",F.EVERY_DAY_AT_5AM="0 05 * * *",F.EVERY_DAY_AT_6AM="0 06 * * *",F.EVERY_DAY_AT_7AM="0 07 * * *",F.EVERY_DAY_AT_8AM="0 08 * * *",F.EVERY_DAY_AT_9AM="0 09 * * *",F.EVERY_DAY_AT_10AM="0 10 * * *",F.EVERY_DAY_AT_11AM="0 11 * * *",F.EVERY_DAY_AT_NOON="0 12 * * *",F.EVERY_DAY_AT_1PM="0 13 * * *",F.EVERY_DAY_AT_2PM="0 14 * * *",F.EVERY_DAY_AT_3PM="0 15 * * *",F.EVERY_DAY_AT_4PM="0 16 * * *",F.EVERY_DAY_AT_5PM="0 17 * * *",F.EVERY_DAY_AT_6PM="0 18 * * *",F.EVERY_DAY_AT_7PM="0 19 * * *",F.EVERY_DAY_AT_8PM="0 20 * * *",F.EVERY_DAY_AT_9PM="0 21 * * *",F.EVERY_DAY_AT_10PM="0 22 * * *",F.EVERY_DAY_AT_11PM="0 23 * * *",F.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",F.EVERY_WEEK="0 0 * * 0",F.EVERY_WEEKDAY="0 0 * * 1-5",F.EVERY_WEEKEND="0 0 * * 6,0",F.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",F.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",F.EVERY_2ND_DAY_OF_MONTH_AT_10AM="0 10 2 * *",F.EVERY_2ND_HOUR="0 */2 * * *",F.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",F.EVERY_2ND_MONTH="0 0 1 */2 *",F.EVERY_QUARTER="0 0 1 */3 *",F.EVERY_6_MONTHS="0 0 1 */6 *",F.EVERY_YEAR="0 0 1 0 *",F.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",F.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",F.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",F.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",F.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",F.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",F.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",F.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",F.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",F.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",F.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",F.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",F.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",F.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",F.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",F.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",F.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",F.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",F.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",F.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",F.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",F.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",F.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",F.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",F.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",F))(cr||{});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 Xt=(l=>(l.POST="POST",l.GET="GET",l.OPTIONS="OPTIONS",l))(Xt||{});var Go=p=>{var s,l;if(typeof p!="object"||p===null)return!1;let n=Object.getPrototypeOf(p);return(l=(s=n==null?void 0:n.constructor)==null?void 0:s.name.endsWith("Error"))!=null?l:!1},tt=class extends Error{},Qt=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;Go(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 en=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}}},Nt=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}},tn=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}},nn=class extends Ue{constructor(s,l,g){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=g}},rn=class extends Ue{constructor(s,l,g){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=g}},sn=class extends Ue{constructor(s,l,g){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=g}},on=class extends Ue{constructor(s,l,g){super(`Workflow with id: \`${s}\` has invalid controls syntax in step with id: \`${l}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=g}},an=class extends Ue{constructor(s,l,g,M){super(`Workflow with id: \`${s}\` has an invalid state. Step with id: \`${l}\` and provider with id: \`${g}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=M}},ln=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=p=>Object.values(We).includes(p==null?void 0:p.code),Oi=p=>!lt(p)&&typeof p.statusCode=="number"&&p.statusCode>=400&&p.statusCode<500;var pr=p=>Object.values(p).map(n=>`\`${n}\``).join(", "),cn=p=>p.replaceAll(/(\w)(\w*)/g,(n,s,l)=>s.toUpperCase()+l.toLowerCase()).replaceAll(/[\s-]+/g,"");var pn=class extends tt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${pr(Xt)}`}},kt=class extends Ue{constructor(s,l){super(`Invalid query string: \`action\`=\`${s}\`. Please use one of ${pr(l)}`);this.code="InvalidActionError"}},un=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 dn=class extends Error{constructor(n,s,l){super(),this.data={message:l},this.statusCode=n,this.code=s}};var Ct=class extends Zt{constructor(n,s){super(`${cn(n)} with id: \`${s}\` already exists. Please use a different id.`)}},at=class extends Qt{constructor(n,s){super(`${cn(n)} with id: \`${s}\` does not exist. Please provide a valid id.`)}},yt=class extends ot{constructor(s,l,g,M){super(`Failed to ${g} ${cn(s)} with id: \`${l}\``,{cause:M});this.statusCode=502}};var fn=class extends at{constructor(s){super("provider",s);this.code="ProviderNotFoundError"}},hn=class extends yt{constructor(s,l,g){super("provider",s,l,g);this.code="ProviderExecutionFailedError"}};var mn=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"}},yn=class extends st{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},gn=class extends st{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},wn=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"}},Sn=class extends st{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var bn=class extends at{constructor(s){super("step",s);this.code="StepNotFoundError"}},Tn=class extends Ct{constructor(s){super("step",s);this.code="StepAlreadyExistsError"}},Mt=class extends yt{constructor(s,l,g){super("step",s,l,g);this.code="StepExecutionFailedError"}};var Lt=class extends at{constructor(s){super("workflow",s);this.code="WorkflowNotFoundError"}};var On=(()=>{var p=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,g=(e,t)=>function(){return e&&(t=(0,e[s(e)[0]])(e=0)),t},M=(e,t)=>function(){return t||(0,e[s(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},K=(e,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of s(t))!l.call(e,u)&&u!==r&&p(e,u,{get:()=>t[u],enumerable:!(c=n(t,u))||c.enumerable});return e},re=e=>K(p({},"__esModule",{value:!0}),e),Se={};C(Se,{JSONSchemaFaker:()=>Si,default:()=>bi,setDependencies:()=>Mr});function Pe(e,t){return typeof e=="string"?typeof t!="undefined"?vt.register(e,t):vt.get(e):vt.registerMany(e)}function ke(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 Wt.default.prototype.max=te("defaultRandExpMax"),Wt.default.prototype.randInt=(r,c)=>r+Math.floor(te("random")()*(1+(c-r))),new Wt.default(e).gen()}function Ce(e){return e[Math.floor(te("random")()*e.length)]}function Fe(e){let t,r,c=e.length,u=e.slice();for(;c>0;)r=Math.floor(te("random")()*c),c-=1,t=u[c],u[c]=u[r],u[r]=t;return u}function rt(e,t){return te("random")()*(t-e)+e}function Ge(e,t,r,c,u=!1){return r=typeof r=="undefined"?He.MIN_NUMBER:r,c=typeof c=="undefined"?He.MAX_NUMBER:c,e=typeof e=="undefined"?r:e,t=typeof t=="undefined"?c:t,t<e&&(t+=e),u?rt(e,t):ke(e,t)}function $t(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 Yn(e){if(e)return $t(e);let t=te("minDateTime"),r=te("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof r=="string"&&(r=new Date(r));let c=new Date().getTime();return typeof t=="number"&&(t=new Date(c+t)),typeof r=="number"&&(r=new Date(c+r)),new Date(rt(t.getTime(),r.getTime()))}function hr(e,t,r){if(t=decodeURIComponent(t),r&&r[t])return ce(r[t]);let c=t.replace("#/","/").split("/"),u=e.$ref&&r&&r[e.$ref]||e;for(!u&&!c[0]&&(c[0]=e.$ref.split("#/")[0]),r&&t.includes("#/")&&r[c[0]]&&(u=r[c.shift()]),c[0]||c.shift();u&&c.length>0;){let h=c.shift();if(!u[h])throw new Error(`Prop not found: ${h} (${t})`);u=u[h]}return u}function jt(e){return typeof e=="string"&&qr.test(e)}function Ke(e){return["number","boolean"].includes(typeof e)}function qe(e,...t){return t.filter(r=>typeof e[r]!="undefined").length>0}function mr(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,r,c]=e.split("T")[0].split("-");return r=`0${Math.max(1,Math.min(12,r))}`.slice(-2),c=`0${Math.max(1,Math.min(31,c))}`.slice(-2),`${t}-${r}-${c}`}function Is(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,r]=e.split("T"),[c,u,h]=t.split("-"),[f,O,U]=r.substr(0,8).split(":");return u=`0${Math.max(1,Math.min(12,u))}`.slice(-2),h=`0${Math.max(1,Math.min(31,h))}`.slice(-2),f=`0${Math.max(1,Math.min(23,f))}`.slice(-2),O=`0${Math.max(1,Math.min(59,O))}`.slice(-2),U=`0${Math.max(1,Math.min(59,U))}`.slice(-2),`${c}-${u}-${h}T${f}:${O}:${U}.000Z`}function Ns(e,t,r){let c={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(c.minimum=t.minimum),typeof t.maximum!="undefined"&&(c.maximum=t.maximum),t.enum){let h=Math.max(c.minimum||0,0),f=Math.min(c.maximum||1/0,1/0);t.exclusiveMinimum&&h===t.minimum&&(h+=t.multipleOf||1),t.exclusiveMaximum&&f===t.maximum&&(f-=t.multipleOf||1),(h||f!==1/0)&&(t.enum=t.enum.filter(O=>O>=h&&O<=f))}break;case"string":{c.minLength=te("minLength")||0,c.maxLength=te("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(c.minLength=Math.max(c.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(c.maxLength=Math.min(c.maxLength,t.maxLength));break}default:break}let u=r(c);if(u==null)return null;switch(e||t.type){case"number":u=jt(u)?parseFloat(u):u;break;case"integer":u=jt(u)?parseInt(u,10):u;break;case"boolean":u=!!u;break;case"string":{if(Ke(u))return u;u=String(u);let h=Math.max(c.minLength||0,0),f=Math.min(c.maxLength||1/0,1/0),O,U=0;for(;u.length<h;)if(O=u,t.pattern?u+=Z.randexp(t.pattern):u+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${u}`,u===O){if(U+=1,U===3)break}else U=0;switch(u.length>f&&(u=u.substr(0,f)),t.format){case"date-time":case"datetime":u=new Date(Is(u)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":u=new Date(mr(u)).toISOString().substr(0,10);break;case"time":u=new Date(`1969-01-01 ${u}`).toISOString().substr(11);break;default:break}break}default:break}return u}function dt(e,t){return Object.keys(t).forEach(r=>{typeof t[r]!="object"||t[r]===null?e[r]=t[r]:Array.isArray(t[r])?(e[r]=e[r]||[],t[r].forEach((c,u)=>{e.type==="array"&&t.type==="array"?e[r][u]=dt(e[r][u]||{},c,!0):Array.isArray(e[r])&&e[r].indexOf(c)===-1&&e[r].push(c)})):typeof e[r]!="object"||e[r]===null||Array.isArray(e[r])?e[r]=dt({},t[r]):e[r]=dt(e[r],t[r])}),e}function ce(e,t=new Map){if(!e||typeof e!="object")return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let c=[];return t.set(e,c),c.push(...e.map(u=>ce(u,t))),c}let r={};return t.set(e,r),Object.keys(e).reduce((c,u)=>(c[u]=ce(e[u],t),c),r)}function ks(e){let t=JSON.stringify(e),r=JSON.stringify(e,null,2);return t.length>400?`${r.substr(0,400)}...`:r}function yr(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Cs(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Ms(e,t){let r=dt({},t);if(typeof e.minimum!="undefined"&&(r.maximum=e.minimum,r.exclusiveMaximum=!0),typeof e.maximum!="undefined"&&(r.minimum=e.maximum>r.maximum?0:e.maximum,r.exclusiveMinimum=!0),typeof e.minLength!="undefined"&&(r.maxLength=e.minLength),typeof e.maxLength!="undefined"&&(r.minLength=e.maxLength>r.maxLength?0:e.maxLength),e.type)r.type=Z.pick(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=yr();while(e.enum.indexOf(c)!==-1);r.enum=[c]}return e.required&&r.properties&&e.required.forEach(c=>{delete r.properties[c]}),r}function Wn(e,t){let r=t.minimum!==void 0,c=t.maximum!==void 0;return(r||c)&&(!r||e>=t.minimum)&&(!c||e<=t.maximum)}function Ls(e,t){return!t.every(r=>Wn(e,r))}function Ds(e,t){return t.reduce((c,u)=>c+(Wn(e,u)?1:0),0)===1}function Us(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function Fs(e,t){return Object.keys(e).filter(r=>!t.includes(r)).reduce((r,c)=>(Array.isArray(e[c])?r[c]=e[c].slice():r[c]=e[c]instanceof Object?dt({},e[c]):e[c],r),{})}function gr(e,t){return Array.isArray(e)?e.map(r=>gr(r,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(r,c)=>t[c])),e)}function Vn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function wr(e,t){t=t.items||t;let r=te("alwaysFakeOptionals"),c=Array.isArray(t.required)&&t.required.includes(e)||r,u=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!c&&!u}function qn(e,t,r=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(c=>qn(c,t,!0)).filter(c=>typeof c!="undefined");if(Object.keys(e).forEach(c=>{if(Vn(e[c]))wr(c,t)&&delete e[c];else{let u=t;t&&t.properties&&t.properties[c]&&(u=t.properties[c]);let h=qn(e[c],u);Vn(h)||(e[c]=h)}typeof e[c]=="undefined"&&delete e[c]}),!(!Object.keys(e).length&&r))return e}function $s(e){return(t,r,c,u)=>{let h=t,f=[];typeof t=="object"&&(h=Object.keys(t)[0],Array.isArray(t[h])?f=t[h]:f.push(t[h]));let O=h.split("."),U=e();for(;O.length>1;)U=U[O.shift()];return t=typeof U=="object"?U[O[0]]:U,typeof t=="function"&&(t=t.apply(U,f.map(T=>de.template(T,u)))),Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(T=>{if(typeof t[T]=="function")throw new Error(`Cannot resolve value for '${c}: ${h}', given: ${t}`)}),t}}function js(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 Ys(e,t,r){return Object.keys(e).filter(c=>{let u=Kr.indexOf(t)>-1;return r.indexOf(c)>-1&&!u}).length>0}function Ws(e,t){let r=Object.keys(Et);for(let c=0;c<r.length;c+=1){let u=r[c],h=t[t.length-1];if(Ys(e,h,Et[u]))return u}}function Vs(){return te("random")()>.5}function qs(){return null}function Bs(e,t,r,c,u,h){let f=[],O=[];function U($){let E=JSON.stringify($.value);return O.indexOf(E)===-1?(O.push(E),f.push($),!0):!1}t.forEach(U);let T=100;for(;f.length!==t.length&&(U(h(r.items||c,e,u))||(T-=1),!!T););return f}function Js(e,t,r,c){let u=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new Vt(`missing items for ${de.short(e)}`,t);return u}if(Array.isArray(e.items))return e.items.map((W,ae)=>{let Q=t.concat(["items",ae]);return c(W,Q,r)});let h=e.minItems,f=e.maxItems,O=te("minItems"),U=te("maxItems");O&&(h=typeof h=="undefined"?O:Math.min(O,h)),U&&(f=typeof f=="undefined"?U:Math.min(U,f),f&&f>U&&(f=U),h&&h>U&&(h=f));let T=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),$=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,E=Z.number(h,f,1,5);T!==null&&(E=Math.max($?Math.round((f||E)*T):Math.abs(Z.number(h,f)*T),h||0));let J=typeof e.additionalItems=="object"?e.additionalItems:{};for(let W=u.length;W<E;W+=1){let ae=t.concat(["items",W]),Q=c(e.items||J,ae,r);u.push(Q)}if(e.contains&&E>0){let W=Z.number(0,E-1);u[W]=c(e.contains,t.concat(["items",W]),r)}return e.uniqueItems?Bs(t.concat(["items"]),u,e,J,r,c):u}function Gs(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?He.MIN_INTEGER:e.minimum,r=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?He.MAX_INTEGER:e.maximum,c=e.multipleOf,u=c&&String(c).match(/e-(\d)|\.(\d+)$/);if(u){let h=(Math.random()*Z.number(0,10)+1)*c,f=u[1]||u[2].length,O=parseFloat(h.toFixed(f)),U=Z.number(t,r-1);return String(O).includes(".")?U+O:(U+O).toExponential()}if(c&&(r=Math.floor(r/c)*c,t=Math.ceil(t/c)*c),e.exclusiveMinimum&&t===e.minimum&&(t+=c||1),e.exclusiveMaximum&&r===e.maximum&&(r-=c||1),t>r)return NaN;if(c){let h=Z.number(Math.floor(t/c),Math.floor(r/c))*c;for(;h<t;)h+=c;return h}return Z.number(t,r,void 0,void 0,e.type!=="integer")}function Ks(e){return Math.floor(ir({...e}))}function Hs(e){return Z.shuffle(ii).slice(0,e)}function zs(e,t,r,c){let u={},h=e.properties||{},f=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),U=e.additionalProperties!==!1,T=Object.keys(h),$=Object.keys(f),E=T.concat($).reduce((Y,m)=>(O.indexOf(m)===-1&&Y.push(m),Y),[]),J=O.concat(E),W=U&&e.additionalProperties===!0?Bt:e.additionalProperties;if(!U&&T.length===0&&$.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(te("requiredOnly")===!0)return O.forEach(Y=>{h[Y]&&(u[Y]=h[Y])}),c(u,t.concat(["properties"]),r,e);let ae=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),Q=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,ne=te("ignoreProperties")||[],he=te("reuseProperties"),ye=te("fillProperties"),j=e.maxProperties||J.length+(U?Z.number(1,5):0),S=Math.max(e.minProperties||0,O.length),b=Math.max(0,J.length-S);J.length===1&&!O.length&&(S=Math.max(Z.number(ye?1:0,j),S)),ae!==null&&(Q===!0?b=Math.round(S-O.length+ae*(J.length-S)):b=Z.number(S-O.length,ae*(J.length-S)));let R=Z.shuffle(E).slice(0,b),x=E.filter(Y=>R.indexOf(Y)!==-1),L=ae!==null||O.length===j?j:Z.number(0,j),_=O.concat(Z.shuffle(x).slice(0,L)).slice(0,j),I=[],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"]),r,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&&(u[Y]=h[Y]),h[Y]&&(u[Y]=h[Y]);let m;if($.forEach(N=>{Y.match(new RegExp(N))&&(m=!0,u[Y]?de.merge(u[Y],f[N]):u[Z.randexp(Y)]=f[N])}),!m){let N=f[Y]||W;N&&W!==!1?u[f[Y]?Z.randexp(Y):Y]=h[Y]||N:G.push(Y)}});let ee=Object.keys(u).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(u[m]);return m}let _e=S;if(U&&!O.length&&(_e=Math.max(ae===null||W?Z.number(ye?1:0,j):0,S)),!x.length&&!b&&U&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)u[qt(1)+Ae(Y[m])]=W||Bt}for(;ye&&!(!($.length||U)||ee>=_e);){if(U)if(he&&T.length-ee>_e){let Y=0,m;do{if(Y+=1,Y>1e3)break;m=ve(O)||Z.pick(T)}while(typeof u[m]!="undefined");typeof u[m]=="undefined"&&(u[m]=h[m],ee+=1)}else if($.length&&!W){let Y=Z.pick($),m=Z.randexp(Y);u[m]||(u[m]=f[Y],ee+=1)}else{let Y=ve(O)||qt(1)+Ae();u[Y]||(u[Y]=W||Bt,ee+=1)}for(let Y=0;ee<S&&Y<$.length;Y+=1){let m=$[Y],N=Z.randexp(m);u[N]||(u[N]=f[m],ee+=1)}}if(O.length===0&&(!U||ae===!1)){let Y=Z.number(S,j);for(;ee<Y;){let m=ve(T);m&&(u[m]=h[m]),ee+=1}}let xe=u;if(te("sortProperties")!==null){let Y=Object.keys(h);xe=Object.keys(u).sort((N,H)=>te("sortProperties")?N.localeCompare(H):Y.indexOf(N)-Y.indexOf(H)).reduce((N,H)=>(N[H]=u[H],N),{})}let Me=c(xe,t.concat(["properties"]),r,e);return k.forEach(Y=>{for(let m of Y.values)if(de.hasValue(m.properties[Y.prop],Me.value[Y.prop])){Object.keys(m.properties).forEach(N=>{N!==Y.prop&&de.merge(Me.value,c(m.properties,t.concat(["properties"]),r,e).value)});break}}),Me}function Sr(){let e=Z.number(1,5);return qt(e).join(" ")}function Xs(e=0,t=140){let r=Math.max(0,e),c=Z.number(r,t),u=Sr();for(;u.length<r;)u+=Sr();return u.length>c&&(u=u.substr(0,c)),u}function Qs(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function Zs(){return Z.date().toISOString()}function eo(){return Jt().slice(0,10)}function to(){return Jt().slice(11)}function no(e){return Z.randexp(je[e]).replace(pi,(t,r)=>Z.randexp(je[r]))}function ro(e,t){let r=rr(e.format);if(typeof r=="function")return r(e);switch(e.format){case"date-time":case"datetime":return Jt();case"date":return ai();case"time":return li();case"ipv4":return oi();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 ui(e.format);default:if(typeof r=="undefined"){if(te("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function io(e){return de.typecast("string",e,r=>e.format?ro(e,()=>sr(r.minLength,r.maxLength)):e.pattern?Z.randexp(e.pattern):sr(r.minLength,r.maxLength))}function so({$comment:e,title:t,description:r}){return Object.entries({comment:e,title:t,description:r}).filter(([,c])=>c).reduce((c,[u,h])=>(c[u]=h,c),{})}function ft(e,t,r,c){if(e=r(e,null,t),e&&(e.oneOf||e.anyOf||e.allOf)&&(e=r(e,null,t)),!e)throw new Error(`Cannot traverse at '${t.join(".")}', given '${JSON.stringify(c)}'`);let u={...so(e),schemaPath:t};if(t[t.length-1]!=="properties"){if(te("useExamplesValue")&&Array.isArray(e.examples)){let T=e.examples.concat("default"in e?[e.default]:[]);return{value:de.typecast(null,e,()=>Z.pick(T)),context:u}}if(te("useExamplesValue")&&typeof e.example!="undefined")return{value:de.typecast(null,e,()=>e.example),context:u};if(te("useDefaultValue")&&"default"in e&&(e.default!==""||!te("replaceEmptyByRandomValue")))return{value:e.default,context:u};if("template"in e)return{value:de.template(e.template,c),context:u};if("const"in e)return{value:e.const,context:u}}if(e.not&&typeof e.not=="object"&&(e=de.notValue(e.not,de.omitProps(e,["not"])),e.type&&e.type==="object")){let{value:T,context:$}=ft(e,t.concat(["not"]),r,c);return{value:de.clean(T,e,!1),context:{...u,items:$}}}if(typeof e.thunk=="function"){let{value:T,context:$}=ft(e.thunk(c),t,r);return{value:T,context:{...u,items:$}}}if(e.jsonPath)return{value:e,context:u};let h=e.type;if(Array.isArray(h)?h=Z.pick(h):typeof h=="undefined"&&(h=Hr(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:u}}if(typeof e.pattern=="string")return{value:de.typecast("string",e,()=>Z.randexp(e.pattern)),context:u};if(Array.isArray(e.enum))return{value:de.typecast(null,e,()=>Z.pick(e.enum)),context:u};if(typeof h=="string")if(_t[h])try{let T=_t[h](e,t,r,ft);return h==="array"?{value:T.map(({value:$})=>$),context:{...u,items:T.map(Array.isArray(e.items)?({context:$})=>$:({context:$})=>({...$,schemaPath:$.schemaPath.slice(0,-1)}))}}:h==="object"?T!==null?{value:T.value,context:{...u,items:T.context}}:{value:{},context:u}:{value:T,context:u}}catch(T){throw typeof T.path=="undefined"?new Vt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new Vt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&_t[T]?{value:_t[T](e,t,r,ft),context:u}:{value:T,context:u}}}let f={},O={...u};Array.isArray(e)&&(f=[]);let U=te("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!U.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:E}=ft(e[T],t.concat([T]),r,f);f[T]=de.clean($,e[T],!1),O[T]=E,f[T]===null&&te("omitNulls")&&(delete f[T],delete O[T])}else f[T]=e[T]}),{value:f,context:O}}function oo(e){return Array.isArray(e)?Z.pick(e):e}function ao(e,t){if(!Array.isArray(e))return e;let r=t?e.pop():e.shift();return t?e.unshift(r):e.push(r),r}function Bn(e,t,r,c){if(!e||typeof e!="object")return e;if(r||(r={}),t||(t=e),Array.isArray(e))return e.map(u=>Bn(u,t,r,c));if(e.jsonPath){let{JSONPath:u}=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 f=`${h.group}__${h.path}`;return r[f]||(h.count>1?r[f]=u(h.path,t).slice(0,h.count):r[f]=u(h.path,t)),h.cycle||h.reverse?ao(r[f],h.reverse):oo(r[f])}return Object.keys(e).forEach(u=>{e[u]=Bn(e[u],t,r,u)}),e}function lo(e,t,r,c){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let u=te("refDepthMin")||0,h=te("refDepthMax")||3;try{let{resolveSchema:f}=yi({refs:e,schema:t,container:r,synchronous:c,refDepthMin:u,refDepthMax:h}),O=hi(de.clone(t),[],f);return te("resolveJsonPath")?{value:Bn(O.value),context:O.context}:O}catch(f){throw f.path?new Error(`${f.message} in /${f.path.join("/")}`):f}}function co(e){return e.value}function po(e,t){return t.reduce((r,c)=>c in r?r[c]:{},e)}function Jn(e,t,r,c=r){let{title:u,description:h,comment:f}=po(e,t),O=[];te("renderTitle")&&u&&O.push(` ${u}`,""),te("renderDescription")&&h&&O.push(` ${h}`),te("renderComment")&&f&&O.push(` ${f}`),r.commentBefore=O.join(`
2
+ `),c instanceof gi?c.items.forEach(U=>{Jn(e,[...t,"items",U.key.value],U.key,U.value)}):c instanceof wi&&c.items.forEach((U,T)=>{Jn(e,[...t,"items",T],U)})}function uo({value:e,context:t}){let r=Rt.createNode(e);Jn(t,[],r);let c=new Rt.Document;return c.contents=r,c.toString()}function br(){Xe.define("autoIncrement",function(t,r){if(!this.offset){let c=r.minimum||1,u=c+He.MAX_NUMBER,h=t.initialOffset||r.initialOffset;this.offset=h||Z.number(c,u)}return t?this.offset++:r}),Xe.define("sequentialDate",function(t,r){if(this.now||(this.now=Z.date()),t){if(r=this.now.toISOString(),t=t===!0?"days":t,["seconds","minutes","hours","days","weeks","months","years"].indexOf(t)===-1)throw new Error(`Unsupported increment by ${de.short(t)}`);this.now.setTime(this.now.getTime()+Z.date(t))}return r})}function Tr(e,t){let r={};Array.isArray(e)?e.forEach(u=>{r[u.$id||u.id]=u}):r=e||{};function c(u){if(!u||typeof u!="object")return;if(Array.isArray(u))return u.forEach(c);let h=u.$id||u.id;typeof h=="string"&&!r[h]&&(r[h]=u),Object.keys(u).forEach(f=>{c(u[f])})}return c(e),c(t),r}var Or,Gn,Ar,Kn,vr,Er,$e,_r,Hn,Ot,F,Rr,Pr,xr,Ir,Nr,At,Yt,zn,kr,Cr,Xn,Qn,Mr,Lr,Zn,ue,er,Dr,Ur,vt,te,tr,nr,Fr,$r,jr,Yr,Wr,Vr,He,Wt,Z,qr,de,Br,Jr,ht,rr,Gr,Vt,Et,Kr,Hr,zr,Xr,Qr,Zr,ei,ti,ni,ir,ri,ii,qt,Bt,si,sr,oi,Jt,ai,li,or,Gt,ci,je,pi,ui,di,fi,_t,hi,mi,yi,ar,lr,Le,fo,ho,mo,yo,go,wo,So,bo,To,Oo,Ao,vo,gi,wi,Rt,Xe,Oe,Si,bi,Eo=g({"src/shared.js"(){Or=Object.create,Gn=Object.defineProperty,Ar=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyNames,vr=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty,$e=(e,t)=>function(){return t||(0,e[Kn(e)[0]])((t={exports:{}}).exports,t),t.exports},_r=(e,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Kn(t))!Er.call(e,u)&&u!==r&&Gn(e,u,{get:()=>t[u],enumerable:!(c=Ar(t,u))||c.enumerable});return e},Hn=(e,t,r)=>(r=e!=null?Or(vr(e)):{},_r(t||!e||!e.__esModule?Gn(r,"default",{value:e,enumerable:!0}):r,e)),Ot=$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}}}),F=$e({"node_modules/ret/lib/sets.js"(e){var t=Ot(),r=()=>[{type:t.RANGE,from:48,to:57}],c=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(r()),u=()=>[{type:t.CHAR,value:9},{type:t.CHAR,value:10},{type:t.CHAR,value:11},{type:t.CHAR,value:12},{type:t.CHAR,value:13},{type:t.CHAR,value:32},{type:t.CHAR,value:160},{type:t.CHAR,value:5760},{type:t.RANGE,from:8192,to:8202},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233},{type:t.CHAR,value:8239},{type:t.CHAR,value:8287},{type:t.CHAR,value:12288},{type:t.CHAR,value:65279}],h=()=>[{type:t.CHAR,value:10},{type:t.CHAR,value:13},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233}];e.words=()=>({type:t.SET,set:c(),not:!1}),e.notWords=()=>({type:t.SET,set:c(),not:!0}),e.ints=()=>({type:t.SET,set:r(),not:!1}),e.notInts=()=>({type:t.SET,set:r(),not:!0}),e.whitespace=()=>({type:t.SET,set:u(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:u(),not:!0}),e.anyChar=()=>({type:t.SET,set:h(),not:!0})}}),Rr=$e({"node_modules/ret/lib/util.js"(e){var t=Ot(),r=F(),c="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",u={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=h=>{var f=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return h=h.replace(f,(O,U,T,$,E,J,W,ae)=>{if(T)return O;var Q=U?8:$?parseInt($,16):E?parseInt(E,16):J?parseInt(J,8):W?c.indexOf(W):u[ae],ne=String.fromCharCode(Q);return/[[\]{}^$.|?*+()]/.test(ne)&&(ne="\\"+ne),ne}),h},e.tokenizeClass=(h,f)=>{for(var O=[],U=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,T,$;(T=U.exec(h))!=null;)if(T[1])O.push(r.words());else if(T[2])O.push(r.ints());else if(T[3])O.push(r.whitespace());else if(T[4])O.push(r.notWords());else if(T[5])O.push(r.notInts());else if(T[6])O.push(r.notWhitespace());else if(T[7])O.push({type:t.RANGE,from:(T[8]||T[9]).charCodeAt(0),to:T[10].charCodeAt(0)});else if($=T[12])O.push({type:t.CHAR,value:$.charCodeAt(0)});else return[O,U.lastIndex];e.error(f,"Unterminated character class")},e.error=(h,f)=>{throw new SyntaxError("Invalid regular expression: /"+h+"/: "+f)}}}),Pr=$e({"node_modules/ret/lib/positions.js"(e){var t=Ot();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:"$"})}}),xr=$e({"node_modules/ret/lib/index.js"(e,t){var r=Rr(),c=Ot(),u=F(),h=Pr();t.exports=f=>{var O=0,U,T,$={type:c.ROOT,stack:[]},E=$,J=$.stack,W=[],ae=x=>{r.error(f,`Nothing to repeat at column ${x-1}`)},Q=r.strToChars(f);for(U=Q.length;O<U;)switch(T=Q[O++],T){case"\\":switch(T=Q[O++],T){case"b":J.push(h.wordBoundary());break;case"B":J.push(h.nonWordBoundary());break;case"w":J.push(u.words());break;case"W":J.push(u.notWords());break;case"d":J.push(u.ints());break;case"D":J.push(u.notInts());break;case"s":J.push(u.whitespace());break;case"S":J.push(u.notWhitespace());break;default:/\d/.test(T)?J.push({type:c.REFERENCE,value:parseInt(T,10)}):J.push({type:c.CHAR,value:T.charCodeAt(0)})}break;case"^":J.push(h.begin());break;case"$":J.push(h.end());break;case"[":{var ne;Q[O]==="^"?(ne=!0,O++):ne=!1;var he=r.tokenizeClass(Q.slice(O),f);O+=he[1],J.push({type:c.SET,set:he[0],not:ne});break}case".":J.push(u.anyChar());break;case"(":{var ye={type:c.GROUP,stack:[],remember:!0};T=Q[O],T==="?"&&(T=Q[O+1],O+=2,T==="="?ye.followedBy=!0:T==="!"?ye.notFollowedBy=!0:T!==":"&&r.error(f,`Invalid group, character '${T}' after '?' at column ${O-1}`),ye.remember=!1),J.push(ye),W.push(E),E=ye,J=ye.stack;break}case")":W.length===0&&r.error(f,`Unmatched ) at column ${O-1}`),E=W.pop(),J=E.options?E.options[E.options.length-1]:E.stack;break;case"|":{E.options||(E.options=[E.stack],delete E.stack);var j=[];E.options.push(j),J=j;break}case"{":{var S=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,R;S!==null?(J.length===0&&ae(O),b=parseInt(S[1],10),R=S[2]?S[3]?parseInt(S[3],10):1/0:b,O+=S[0].length,J.push({type:c.REPETITION,min:b,max:R,value:J.pop()})):J.push({type:c.CHAR,value:123});break}case"?":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1,value:J.pop()});break;case"+":J.length===0&&ae(O),J.push({type:c.REPETITION,min:1,max:1/0,value:J.pop()});break;case"*":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1/0,value:J.pop()});break;default:J.push({type:c.CHAR,value:T.charCodeAt(0)})}return W.length!==0&&r.error(f,"Unterminated group"),$},t.exports.types=c}}),Ir=$e({"node_modules/drange/lib/index.js"(e,t){var r=class gt{constructor(h,f){this.low=h,this.high=f,this.length=1+f-h}overlaps(h){return!(this.high<h.low||this.low>h.high)}touches(h){return!(this.high+1<h.low||this.low-1>h.high)}add(h){return new 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 Dt{constructor(h,f){this.ranges=[],this.length=0,h!=null&&this.add(h,f)}_update_length(){this.length=this.ranges.reduce((h,f)=>h+f.length,0)}add(h,f){var O=U=>{for(var T=0;T<this.ranges.length&&!U.touches(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&U.touches(this.ranges[T]);)U=U.add(this.ranges[T]),T++;$.push(U),this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Dt?h.ranges.forEach(O):(f==null&&(f=h),O(new r(h,f))),this}subtract(h,f){var O=U=>{for(var T=0;T<this.ranges.length&&!U.overlaps(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&U.overlaps(this.ranges[T]);)$=$.concat(this.ranges[T].subtract(U)),T++;this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Dt?h.ranges.forEach(O):(f==null&&(f=h),O(new r(h,f))),this}intersect(h,f){var O=[],U=T=>{for(var $=0;$<this.ranges.length&&!T.overlaps(this.ranges[$]);)$++;for(;$<this.ranges.length&&T.overlaps(this.ranges[$]);){var E=Math.max(this.ranges[$].low,T.low),J=Math.min(this.ranges[$].high,T.high);O.push(new r(E,J)),$++}};return h instanceof Dt?h.ranges.forEach(U):(f==null&&(f=h),U(new r(h,f))),this.ranges=O,this._update_length(),this}index(h){for(var f=0;f<this.ranges.length&&this.ranges[f].length<=h;)h-=this.ranges[f].length,f++;return this.ranges[f].low+h}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Dt(this)}numbers(){return this.ranges.reduce((h,f)=>{for(var O=f.low;O<=f.high;)h.push(O),O++;return h},[])}subranges(){return this.ranges.map(h=>({low:h.low,high:h.high,length:1+h.high-h.low}))}};t.exports=c}}),Nr=$e({"node_modules/randexp/lib/randexp.js"(e,t){var r=xr(),c=Ir(),u=r.types;t.exports=class Ut{constructor(f,O){if(this._setDefaults(f),f instanceof RegExp)this.ignoreCase=f.ignoreCase,this.multiline=f.multiline,f=f.source;else if(typeof f=="string")this.ignoreCase=O&&O.indexOf("i")!==-1,this.multiline=O&&O.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=r(f)}_setDefaults(f){this.max=f.max!=null?f.max:Ut.prototype.max!=null?Ut.prototype.max:100,this.defaultRange=f.defaultRange?f.defaultRange:this.defaultRange.clone(),f.randInt&&(this.randInt=f.randInt)}gen(){return this._gen(this.tokens,[])}_gen(f,O){var U,T,$,E,J;switch(f.type){case u.ROOT:case u.GROUP:if(f.followedBy||f.notFollowedBy)return"";for(f.remember&&f.groupNumber===void 0&&(f.groupNumber=O.push(null)-1),U=f.options?this._randSelect(f.options):f.stack,T="",E=0,J=U.length;E<J;E++)T+=this._gen(U[E],O);return f.remember&&(O[f.groupNumber]=T),T;case u.POSITION:return"";case u.SET:{var W=this._expand(f);return W.length?String.fromCharCode(this._randSelect(W)):""}case u.REPETITION:for($=this.randInt(f.min,f.max===1/0?f.min+this.max:f.max),T="",E=0;E<$;E++)T+=this._gen(f.value,O);return T;case u.REFERENCE:return O[f.value-1]||"";case u.CHAR:{var ae=this.ignoreCase&&this._randBool()?this._toOtherCase(f.value):f.value;return String.fromCharCode(ae)}}}_toOtherCase(f){return f+(97<=f&&f<=122?-32:65<=f&&f<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(f){return f instanceof c?f.index(this.randInt(0,f.length-1)):f[this.randInt(0,f.length-1)]}_expand(f){if(f.type===r.types.CHAR)return new c(f.value);if(f.type===r.types.RANGE)return new c(f.from,f.to);{let O=new c;for(let U=0;U<f.set.length;U++){let T=this._expand(f.set[U]);if(O.add(T),this.ignoreCase)for(let $=0;$<T.length;$++){let E=T.index($),J=this._toOtherCase(E);E!==J&&O.add(J)}}return f.not?this.defaultRange.clone().subtract(O):this.defaultRange.clone().intersect(O)}}randInt(f,O){return f+Math.floor(Math.random()*(1+O-f))}get defaultRange(){return this._range=this._range||new c(32,126)}set defaultRange(f){this._range=f}static randexp(f,O){var U;return typeof f=="string"&&(f=new RegExp(f,O)),f._randexp===void 0?(U=new Ut(f,O),f._randexp=U):(U=f._randexp,U._setDefaults(f)),U.gen()}static sugar(){RegExp.prototype.gen=function(){return Ut.randexp(this)}}}}}),At=$e({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(e){var t={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},r={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},c="tag:yaml.org,2002:",u={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function h(j){let S=[0],b=j.indexOf(`
3
3
  `);for(;b!==-1;)b+=1,S.push(b),b=j.indexOf(`
4
- `,b);return S}function d(j){let S,b;return typeof j=="string"?(S=h(j),b=j):(Array.isArray(j)&&(j=j[0]),j&&j.context&&(j.lineStarts||(j.lineStarts=h(j.context.src)),S=j.lineStarts,b=j.context.src)),{lineStarts:S,src:b}}function O(j,S){if(typeof j!="number"||j<0)return null;let{lineStarts:b,src:R}=d(S);if(!b||!R||j>R.length)return null;for(let L=0;L<b.length;++L){let _=b[L];if(j<_)return{line:L,col:j-b[L-1]+1};if(j===_)return{line:L+1,col:1}}let x=b.length;return{line:x,col:j-b[x-1]+1}}function U(j,S){let{lineStarts:b,src:R}=d(S);if(!b||!(j>=1)||j>b.length)return null;let x=b[j-1],L=b[j];for(;L&&L>x&&R[L-1]===`
4
+ `,b);return S}function f(j){let S,b;return typeof j=="string"?(S=h(j),b=j):(Array.isArray(j)&&(j=j[0]),j&&j.context&&(j.lineStarts||(j.lineStarts=h(j.context.src)),S=j.lineStarts,b=j.context.src)),{lineStarts:S,src:b}}function O(j,S){if(typeof j!="number"||j<0)return null;let{lineStarts:b,src:R}=f(S);if(!b||!R||j>R.length)return null;for(let L=0;L<b.length;++L){let _=b[L];if(j<_)return{line:L,col:j-b[L-1]+1};if(j===_)return{line:L+1,col:1}}let x=b.length;return{line:x,col:j-b[x-1]+1}}function U(j,S){let{lineStarts:b,src:R}=f(S);if(!b||!(j>=1)||j>b.length)return null;let x=b[j-1],L=b[j];for(;L&&L>x&&R[L-1]===`
5
5
  `;)--L;return R.slice(x,L)}function T({start:j,end:S},b,R=80){let x=U(j.line,b);if(!x)return null;let{col:L}=j;if(x.length>R)if(L<=R-10)x=x.substr(0,R-1)+"\u2026";else{let G=Math.round(R/2);x.length>L+G&&(x=x.substr(0,L+G-1)+"\u2026"),L-=x.length-R,x="\u2026"+x.substr(1-R)}let _=1,I="";S&&(S.line===j.line&&L+(S.col-j.col)<=R+1?_=S.col-j.col:(_=Math.min(x.length+1,R)-L,I="\u2026"));let k=L>1?" ".repeat(L-1):"",V="^".repeat(_);return`${x}
6
- ${k}${V}${I}`}var $=class vr{static copy(S){return new vr(S.start,S.end)}constructor(S,b){this.start=S,this.end=b||S}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(S,b){let{start:R,end:x}=this;if(S.length===0||x<=S[0])return this.origStart=R,this.origEnd=x,b;let L=b;for(;L<S.length&&!(S[L]>R);)++L;this.origStart=R+L;let _=L;for(;L<S.length&&!(S[L]>=x);)++L;return this.origEnd=x+L,_}},E=class nt{static addStringTerminator(S,b,R){if(R[R.length-1]===`
6
+ ${k}${V}${I}`}var $=class vi{static copy(S){return new vi(S.start,S.end)}constructor(S,b){this.start=S,this.end=b||S}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(S,b){let{start:R,end:x}=this;if(S.length===0||x<=S[0])return this.origStart=R,this.origEnd=x,b;let L=b;for(;L<S.length&&!(S[L]>R);)++L;this.origStart=R+L;let _=L;for(;L<S.length&&!(S[L]>=x);)++L;return this.origEnd=x+L,_}},E=class nt{static addStringTerminator(S,b,R){if(R[R.length-1]===`
7
7
  `)return R;let x=nt.endOfWhiteSpace(S,b);return x>=S.length||S[x]===`
8
8
  `?R+`
9
9
  `:R}static atDocumentBoundary(S,b,R){let x=S[b];if(!x)return!0;let L=S[b-1];if(L&&L!==`
@@ -21,86 +21,85 @@ ${k}${V}${I}`}var $=class vr{static copy(S){return new vr(S.start,S.end)}constru
21
21
  `;){switch(I){case`
22
22
  `:x=0,b+=1,_+=`
23
23
  `;break;case" ":x<=R&&(L=!0),b=nt.endOfWhiteSpace(S,b+2)-1;break;case" ":x+=1,b+=1;break}I=S[b+1]}return _||(_=" "),I&&x<=R&&(L=!0),{fold:_,offset:b,error:L}}constructor(S,b,R){Object.defineProperty(this,"context",{value:R||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=b||[],this.type=S,this.value=null}getPropValue(S,b,R){if(!this.context)return null;let{src:x}=this.context,L=this.props[S];return L&&x[L.start]===b?x.slice(L.start+(R?1:0),L.end):null}get anchor(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.ANCHOR,!0);if(b!=null)return b}return null}get comment(){let S=[];for(let b=0;b<this.props.length;++b){let R=this.getPropValue(b,t.COMMENT,!0);R!=null&&S.push(R)}return S.length>0?S.join(`
24
- `):null}commentHasRequiredWhitespace(S){let{src:b}=this.context;if(this.header&&S===this.header.end||!this.valueRange)return!1;let{end:R}=this.valueRange;return S!==R||nt.atBlank(b,R-1)}get hasComment(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]!==t.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[i.FLOW_MAP,i.FLOW_SEQ,i.QUOTE_DOUBLE,i.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let S=O(this.range.start,this.context.root);if(!S)return;let b=O(this.range.end,this.context.root);return{start:S,end:b}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:S,end:b}=this.valueRange;return this.context.src.slice(S,b)}get tag(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.TAG,!1);if(b!=null){if(b[1]==="<")return{verbatim:b.slice(2,-1)};{let[R,x,L]=b.match(/^(.*!)([^!]*)$/);return{handle:x,suffix:L}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:S,end:b}=this.valueRange,{src:R}=this.context;for(let x=S;x<b;++x)if(R[x]===`
24
+ `):null}commentHasRequiredWhitespace(S){let{src:b}=this.context;if(this.header&&S===this.header.end||!this.valueRange)return!1;let{end:R}=this.valueRange;return S!==R||nt.atBlank(b,R-1)}get hasComment(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]!==t.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[r.FLOW_MAP,r.FLOW_SEQ,r.QUOTE_DOUBLE,r.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let S=O(this.range.start,this.context.root);if(!S)return;let b=O(this.range.end,this.context.root);return{start:S,end:b}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:S,end:b}=this.valueRange;return this.context.src.slice(S,b)}get tag(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.TAG,!1);if(b!=null){if(b[1]==="<")return{verbatim:b.slice(2,-1)};{let[R,x,L]=b.match(/^(.*!)([^!]*)$/);return{handle:x,suffix:L}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:S,end:b}=this.valueRange,{src:R}=this.context;for(let x=S;x<b;++x)if(R[x]===`
25
25
  `)return!0;return!1}parseComment(S){let{src:b}=this.context;if(b[S]===t.COMMENT){let R=nt.endOfLine(b,S+1),x=new $(S,R);return this.props.push(x),R}return S}setOrigRanges(S,b){return this.range&&(b=this.range.setOrigRange(S,b)),this.valueRange&&this.valueRange.setOrigRange(S,b),this.props.forEach(R=>R.setOrigRange(S,b)),b}toString(){let{context:{src:S},range:b,value:R}=this;if(R!=null)return R;let x=S.slice(b.start,b.end);return nt.addStringTerminator(S,b.end,x)}},J=class extends Error{constructor(j,S,b){if(!b||!(S instanceof E))throw new Error(`Invalid arguments for new ${j}`);super(),this.name=j,this.message=b,this.source=S}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let j=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new $(this.offset,this.offset+1);let S=j&&O(this.offset,j);if(S){let b={line:S.line,col:S.col+1};this.linePos={start:S,end:b}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:S,col:b}=this.linePos.start;this.message+=` at line ${S}, column ${b}`;let R=j&&T(this.linePos,j);R&&(this.message+=`:
26
26
 
27
27
  ${R}
28
- `)}delete this.source}},W=class extends J{constructor(j,S){super("YAMLReferenceError",j,S)}},ae=class extends J{constructor(j,S){super("YAMLSemanticError",j,S)}},Q=class extends J{constructor(j,S){super("YAMLSyntaxError",j,S)}},ne=class extends J{constructor(j,S){super("YAMLWarning",j,S)}};function he(j,S,b){return S in j?Object.defineProperty(j,S,{value:b,enumerable:!0,configurable:!0,writable:!0}):j[S]=b,j}var ye=class ui extends E{static endOfLine(S,b,R){let x=S[b],L=b;for(;x&&x!==`
28
+ `)}delete this.source}},W=class extends J{constructor(j,S){super("YAMLReferenceError",j,S)}},ae=class extends J{constructor(j,S){super("YAMLSemanticError",j,S)}},Q=class extends J{constructor(j,S){super("YAMLSyntaxError",j,S)}},ne=class extends J{constructor(j,S){super("YAMLWarning",j,S)}};function he(j,S,b){return S in j?Object.defineProperty(j,S,{value:b,enumerable:!0,configurable:!0,writable:!0}):j[S]=b,j}var ye=class ur extends E{static endOfLine(S,b,R){let x=S[b],L=b;for(;x&&x!==`
29
29
  `&&!(R&&(x==="["||x==="]"||x==="{"||x==="}"||x===","));){let _=S[L+1];if(x===":"&&(!_||_===`
30
30
  `||_===" "||_===" "||R&&_===",")||(x===" "||x===" ")&&_==="#")break;L+=1,x=_}return L}get strValue(){if(!this.valueRange||!this.context)return null;let{start:S,end:b}=this.valueRange,{src:R}=this.context,x=R[b-1];for(;S<b&&(x===`
31
31
  `||x===" "||x===" ");)x=R[--b-1];let L="";for(let I=S;I<b;++I){let k=R[I];if(k===`
32
32
  `){let{fold:V,offset:G}=E.foldNewline(R,I,-1);L+=V,I=G}else if(k===" "||k===" "){let V=I,G=R[I+1];for(;I<b&&(G===" "||G===" ");)I+=1,G=R[I+1];G!==`
33
33
  `&&(L+=I>V?R.slice(V,I+1):k)}else L+=k}let _=R[S];switch(_){case" ":{let I="Plain value cannot start with a tab character";return{errors:[new ae(this,I)],str:L}}case"@":case"`":{let I=`Plain value cannot start with reserved character ${_}`;return{errors:[new ae(this,I)],str:L}}default:return L}}parseBlockValue(S){let{indent:b,inFlow:R,src:x}=this.context,L=S,_=S;for(let I=x[L];I===`
34
34
  `&&!E.atDocumentBoundary(x,L+1);I=x[L]){let k=E.endOfBlockIndent(x,b,L+1);if(k===null||x[k]==="#")break;x[k]===`
35
- `?L=k:(_=ui.endOfLine(x,k,R),L=_)}return this.valueRange.isEmpty()&&(this.valueRange.start=S),this.valueRange.end=_,_}parse(S,b){this.context=S;let{inFlow:R,src:x}=S,L=b,_=x[L];return _&&_!=="#"&&_!==`
36
- `&&(L=ui.endOfLine(x,b,R)),this.valueRange=new $(b,L),L=E.endOfWhiteSpace(x,L),L=this.parseComment(L),(!this.hasComment||this.valueRange.isEmpty())&&(L=this.parseBlockValue(L)),L}};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}}),$t=$e({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(e){var t=Ot();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(`
35
+ `?L=k:(_=ur.endOfLine(x,k,R),L=_)}return this.valueRange.isEmpty()&&(this.valueRange.start=S),this.valueRange.end=_,_}parse(S,b){this.context=S;let{inFlow:R,src:x}=S,L=b,_=x[L];return _&&_!=="#"&&_!==`
36
+ `&&(L=ur.endOfLine(x,b,R)),this.valueRange=new $(b,L),L=E.endOfWhiteSpace(x,L),L=this.parseComment(L),(!this.hasComment||this.valueRange.isEmpty())&&(L=this.parseBlockValue(L)),L}};e.Char=t,e.Node=E,e.PlainValue=ye,e.Range=$,e.Type=r,e.YAMLError=J,e.YAMLReferenceError=W,e.YAMLSemanticError=ae,e.YAMLSyntaxError=Q,e.YAMLWarning=ne,e._defineProperty=he,e.defaultTagPrefix=c,e.defaultTags=u}}),Yt=$e({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(e){var t=At();function r(o,i,a){return a?`#${a.replace(/[\s\S]^/gm,`$&${i}#`)}
37
+ ${i}${o}`:o}function c(o,i,a){return a?a.indexOf(`
38
38
  `)===-1?`${o} #${a}`:`${o}
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 U=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(U(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:D,stringify:q}=r,X=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||r.inFlow;X&&(g+=D);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(Mo=>{xe.push({type:"comment",str:`#${Mo}`})}),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?`
39
+ `+a.replace(/^/gm,`${i||""}#`):o}var u=class{};function h(o,i,a){if(Array.isArray(o))return o.map((d,y)=>h(d,String(y),a));if(o&&typeof o.toJSON=="function"){let d=a&&a.anchors&&a.anchors.get(o);d&&(a.onCreate=w=>{d.res=w,delete a.onCreate});let y=o.toJSON(i,a);return d&&a.onCreate&&a.onCreate(y),y}return(!a||!a.keep)&&typeof o=="bigint"?Number(o):o}var f=class extends u{constructor(o){super(),this.value=o}toJSON(o,i){return i&&i.keep?this.value:h(this.value,o,i)}toString(){return String(this.value)}};function O(o,i,a){let d=a;for(let y=i.length-1;y>=0;--y){let w=i[y];if(Number.isInteger(w)&&w>=0){let A=[];A[w]=d,d=A}else{let A={};Object.defineProperty(A,w,{value:d,writable:!0,enumerable:!0,configurable:!0}),d=A}}return o.createNode(d,!1)}var U=o=>o==null||typeof o=="object"&&o[Symbol.iterator]().next().done,T=class ct extends u{constructor(i){super(),t._defineProperty(this,"items",[]),this.schema=i}addIn(i,a){if(U(i))this.add(a);else{let[d,...y]=i,w=this.get(d,!0);if(w instanceof ct)w.addIn(y,a);else if(w===void 0&&this.schema)this.set(d,O(this.schema,y,a));else throw new Error(`Expected YAML collection at ${d}. Remaining path: ${y}`)}}deleteIn([i,...a]){if(a.length===0)return this.delete(i);let d=this.get(i,!0);if(d instanceof ct)return d.deleteIn(a);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}getIn([i,...a],d){let y=this.get(i,!0);return a.length===0?!d&&y instanceof f?y.value:y:y instanceof ct?y.getIn(a,d):void 0}hasAllNullValues(){return this.items.every(i=>{if(!i||i.type!=="PAIR")return!1;let a=i.value;return a==null||a instanceof f&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn([i,...a]){if(a.length===0)return this.has(i);let d=this.get(i,!0);return d instanceof ct?d.hasIn(a):!1}setIn([i,...a],d){if(a.length===0)this.set(i,d);else{let y=this.get(i,!0);if(y instanceof ct)y.setIn(a,d);else if(y===void 0&&this.schema)this.set(i,O(this.schema,a,d));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}}toJSON(){return null}toString(i,{blockItem:a,flowChars:d,isMap:y,itemIndent:w},A,v){let{indent:P,indentStep:D,stringify:q}=i,X=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||i.inFlow;X&&(w+=D);let Te=y&&this.hasAllNullValues();i=Object.assign({},i,{allNullValues:Te,indent:w,inFlow:X,type:null});let se=!1,ge=!1,oe=this.items.reduce((Ie,pe,Ee)=>{let fe;pe&&(!se&&pe.spaceBefore&&Ie.push({type:"comment",str:""}),pe.commentBefore&&pe.commentBefore.match(/^.*$/gm).forEach($o=>{Ie.push({type:"comment",str:`#${$o}`})}),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,i,()=>fe=null,()=>se=!0);return X&&!ge&&De.includes(`
40
+ `)&&(ge=!0),X&&Ee<this.items.length-1&&(De+=","),De=c(De,w,fe),se&&(fe||X)&&(se=!1),Ie.push({type:"item",str:De}),Ie},[]),me;if(oe.length===0)me=d.start+d.end;else if(X){let{start:Ie,end:pe}=d,Ee=oe.map(fe=>fe.str);if(ge||Ee.reduce((fe,De)=>fe+De.length+2,2)>ct.maxFlowStringSingleLineLength){me=Ie;for(let fe of Ee)me+=fe?`
41
41
  ${D}${P}${fe}`:`
42
42
  `;me+=`
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?`
43
+ ${P}${pe}`}else me=`${Ie} ${Ee.join(" ")} ${pe}`}else{let Ie=oe.map(a);me=Ie.shift();for(let pe of Ie)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(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,D=v instanceof p&&v.comment;if(A){if(D)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||D||(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,()=>D=null,()=>oe=!0);if(me=c(me,r.indent,D),!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&&!D&&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
- `),P.commentBefore){let De=P.commentBefore.replace(/^/gm,`${r.indent}#`);xe+=`
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
- ${r.indent}`:!q&&P instanceof T?(!(Ee[0]==="["||Ee[0]==="{")||Ee.includes(`
46
+ `+this.comment.replace(/^/gm,`${P}#`),A&&A()):se&&v&&v(),me}};t._defineProperty(T,"maxFlowStringSingleLineLength",60);function $(o){let i=o instanceof f?o.value:o;return i&&typeof i=="string"&&(i=Number(i)),Number.isInteger(i)&&i>=0?i:null}var E=class extends T{add(o){this.items.push(o)}delete(o){let i=$(o);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(o,i){let a=$(o);if(typeof a!="number")return;let d=this.items[a];return!i&&d instanceof f?d.value:d}has(o){let i=$(o);return typeof i=="number"&&i<this.items.length}set(o,i){let a=$(o);if(typeof a!="number")throw new Error(`Expected a valid index, not ${o}.`);this.items[a]=i}toJSON(o,i){let a=[];i&&i.onCreate&&i.onCreate(a);let d=0;for(let y of this.items)a.push(h(y,String(d++),i));return a}toString(o,i,a){return o?super.toString(o,{blockItem:d=>d.type==="comment"?d.str:`- ${d.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(o.indent||"")+" "},i,a):JSON.stringify(this)}},J=(o,i,a)=>i===null?"":typeof i!="object"?String(i):o instanceof u&&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(i),W=class Ei extends u{constructor(i,a=null){super(),this.key=i,this.value=a,this.type=Ei.Type.PAIR}get commentBefore(){return this.key instanceof u?this.key.commentBefore:void 0}set commentBefore(i){if(this.key==null&&(this.key=new f(null)),this.key instanceof u)this.key.commentBefore=i;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(i,a){let d=h(this.key,"",i);if(a instanceof Map){let y=h(this.value,d,i);a.set(d,y)}else if(a instanceof Set)a.add(d);else{let y=J(this.key,d,i),w=h(this.value,y,i);y in a?Object.defineProperty(a,y,{value:w,writable:!0,enumerable:!0,configurable:!0}):a[y]=w}return a}toJSON(i,a){let d=a&&a.mapAsMap?new Map:{};return this.addToJSMap(a,d)}toString(i,a,d){if(!i||!i.doc)return JSON.stringify(this);let{indent:y,indentSeq:w,simpleKeys:A}=i.doc.options,{key:v,value:P}=this,D=v instanceof u&&v.comment;if(A){if(D)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||D||(v instanceof u?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}=i;i=Object.assign({},i,{implicitKey:!q,indent:Te+se});let oe=!1,me=ge(v,i,()=>D=null,()=>oe=!0);if(me=c(me,i.indent,D),!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(i.allNullValues&&!A)return this.comment?(me=c(me,i.indent,this.comment),a&&a()):oe&&!D&&d&&d(),i.inFlow&&!q?me:`? ${me}`;me=q?`? ${me}
47
+ ${Te}:`:`${me}:`,this.comment&&(me=c(me,i.indent,this.comment),a&&a());let Ie="",pe=null;if(P instanceof u){if(P.spaceBefore&&(Ie=`
48
+ `),P.commentBefore){let De=P.commentBefore.replace(/^/gm,`${i.indent}#`);Ie+=`
49
+ ${De}`}pe=P.comment}else P&&typeof P=="object"&&(P=X.schema.createNode(P,!0));i.implicitKey=!1,!q&&!this.comment&&P instanceof f&&(i.indentAtStart=me.length+1),oe=!1,!w&&y>=2&&!i.inFlow&&!q&&P instanceof E&&P.type!==t.Type.FLOW_SEQ&&!P.tag&&!X.anchors.getName(P)&&(i.indent=i.indent.substr(2));let Ee=ge(P,i,()=>pe=null,()=>oe=!0),fe=" ";return Ie||this.comment?fe=`${Ie}
50
+ ${i.indent}`:!q&&P instanceof T?(!(Ee[0]==="["||Ee[0]==="{")||Ee.includes(`
51
51
  `))&&(fe=`
52
- ${r.indent}`):Ee[0]===`
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(D=>u[D]===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}},S={defaultType:t.Type.BLOCK_LITERAL,lineWidth:76},b={trueStr:"true",falseStr:"false"},R={asBigInt:!1},x={nullStr:"null"},L={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 D=[],q={},X=y-r.length;typeof u=="number"&&(u>y-Math.max(2,g)?D.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===`
52
+ ${i.indent}`):Ee[0]===`
53
+ `&&(fe=""),oe&&!pe&&d&&d(),c(me+fe+Ee,i.indent,pe)}};t._defineProperty(W,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var ae=(o,i)=>{if(o instanceof Q){let a=i.get(o.source);return a.count*a.aliasCount}else if(o instanceof T){let a=0;for(let d of o.items){let y=ae(d,i);y>a&&(a=y)}return a}else if(o instanceof W){let a=ae(o.key,i),d=ae(o.value,i);return Math.max(a,d)}return 1},Q=class _i extends u{static stringify({range:i,source:a},{anchors:d,doc:y,implicitKey:w,inStringifyKey:A}){let v=Object.keys(d).find(D=>d[D]===a);if(!v&&A&&(v=y.anchors.getName(a)||y.anchors.newName()),v)return`*${v}${w?" ":""}`;let P=y.anchors.getName(a)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${P} [${i}]`)}constructor(i){super(),this.source=i,this.type=t.Type.ALIAS}set tag(i){throw new Error("Alias nodes cannot have tags")}toJSON(i,a){if(!a)return h(this.source,i,a);let{anchors:d,maxAliasCount:y}=a,w=d.get(this.source);if(!w||w.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&&(w.count+=1,w.aliasCount===0&&(w.aliasCount=ae(this.source,d)),w.count*w.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 w.res}toString(i){return _i.stringify(this,i)}};t._defineProperty(Q,"default",!0);function ne(o,i){let a=i instanceof f?i.value:i;for(let d of o)if(d instanceof W&&(d.key===i||d.key===a||d.key&&d.key.value===a))return d}var he=class extends T{add(o,i){o?o instanceof W||(o=new W(o.key||o,o.value)):o=new W(o);let a=ne(this.items,o.key),d=this.schema&&this.schema.sortMapEntries;if(a)if(i)a.value=o.value;else throw new Error(`Key ${o.key} already set`);else if(d){let y=this.items.findIndex(w=>d(o,w)<0);y===-1?this.items.push(o):this.items.splice(y,0,o)}else this.items.push(o)}delete(o){let i=ne(this.items,o);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(o,i){let a=ne(this.items,o),d=a&&a.value;return!i&&d instanceof f?d.value:d}has(o){return!!ne(this.items,o)}set(o,i){this.add(new W(o,i),!0)}toJSON(o,i,a){let d=a?new a:i&&i.mapAsMap?new Map:{};i&&i.onCreate&&i.onCreate(d);for(let y of this.items)y.addToJSMap(i,d);return d}toString(o,i,a){if(!o)return JSON.stringify(this);for(let d of this.items)if(!(d instanceof W))throw new Error(`Map items must all be pairs; found ${JSON.stringify(d)} instead`);return super.toString(o,{blockItem:d=>d.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:o.indent||""},i,a)}},ye="<<",j=class extends W{constructor(o){if(o instanceof W){let i=o.value;i instanceof E||(i=new E,i.items.push(o.value),i.range=o.value.range),super(o.key,i),this.range=o.range}else super(new f(ye),new E);this.type=W.Type.MERGE_PAIR}addToJSMap(o,i){for(let{source:a}of this.value.items){if(!(a instanceof he))throw new Error("Merge sources must be maps");let d=a.toJSON(null,o,Map);for(let[y,w]of d)i instanceof Map?i.has(y)||i.set(y,w):i instanceof Set?i.add(y):Object.prototype.hasOwnProperty.call(i,y)||Object.defineProperty(i,y,{value:w,writable:!0,enumerable:!0,configurable:!0})}return i}toString(o,i){let a=this.value;if(a.items.length>1)return super.toString(o,i);this.value=a.items[0];let d=super.toString(o,i);return this.value=a,d}},S={defaultType:t.Type.BLOCK_LITERAL,lineWidth:76},b={trueStr:"true",falseStr:"false"},R={asBigInt:!1},x={nullStr:"null"},L={defaultType:t.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function _(o,i,a){for(let{format:d,test:y,resolve:w}of i)if(y){let A=o.match(y);if(A){let v=w.apply(null,A);return v instanceof f||(v=new f(v)),d&&(v.format=d),v}}return a&&(o=a(o)),new f(o)}var I="flow",k="block",V="quoted",G=(o,i)=>{let a=o[i+1];for(;a===" "||a===" ";){do a=o[i+=1];while(a&&a!==`
54
+ `);a=o[i+1]}return i};function ee(o,i,a,{indentAtStart:d,lineWidth:y=80,minContentWidth:w=20,onFold:A,onOverflow:v}){if(!y||y<0)return o;let P=Math.max(1+w,1+y-i.length);if(o.length<=P)return o;let D=[],q={},X=y-i.length;typeof d=="number"&&(d>y-Math.max(2,w)?D.push(0):X=y-d);let Te,se,ge=!1,oe=-1,me=-1,Ie=-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}Ie=oe}if(Ee===`
55
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!==" "&&(Te=oe)}if(oe>=X)if(Te)D.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;D.push(fe),q[fe]=!0,X=fe+P,Te=void 0}else ge=!0}se=Ee}if(ge&&v&&v(),D.length===0)return o;A&&A();let pe=o.slice(0,D[0]);for(let Ee=0;Ee<D.length;++Ee){let fe=D[Ee],De=D[Ee+1]||o.length;fe===0?pe=`
58
- ${r}${o.slice(0,De)}`:(a===V&&q[fe]&&(pe+=`${o[fe]}\\`),pe+=`
59
- ${r}${o.slice(fe+1,De)}`)}return pe}var Ae=({indentAtStart:o})=>o?Object.assign({indentAtStart:o},L.fold):L.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
- `){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}=L.doubleQuoted,g=JSON.stringify(o);if(u)return g;let A=r.indent||(ve(o)?" ":""),v="",P=0;for(let D=0,q=g[D];q;q=g[++D])if(q===" "&&g[D+1]==="\\"&&g[D+2]==="n"&&(v+=g.slice(P,D)+"\\ ",D+=1,P=D,q="\\"),q==="\\")switch(g[D+1]){case"u":{v+=g.slice(P,D);let X=g.substr(D+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(D,6)}D+=5,P=D+1}break;case"n":if(a||g[D+2]==='"'||g.length<y)D+=1;else{for(v+=g.slice(P,D)+`
57
+ `&&fe!==" "&&(Te=oe)}if(oe>=X)if(Te)D.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>Ie+1?oe-2:me-1;if(q[fe])return o;D.push(fe),q[fe]=!0,X=fe+P,Te=void 0}else ge=!0}se=Ee}if(ge&&v&&v(),D.length===0)return o;A&&A();let pe=o.slice(0,D[0]);for(let Ee=0;Ee<D.length;++Ee){let fe=D[Ee],De=D[Ee+1]||o.length;fe===0?pe=`
58
+ ${i}${o.slice(0,De)}`:(a===V&&q[fe]&&(pe+=`${o[fe]}\\`),pe+=`
59
+ ${i}${o.slice(fe+1,De)}`)}return pe}var Ae=({indentAtStart:o})=>o?Object.assign({indentAtStart:o},L.fold):L.fold,ve=o=>/^(%|---|\.\.\.)/m.test(o);function _e(o,i,a){if(!i||i<0)return!1;let d=i-a,y=o.length;if(y<=d)return!1;for(let w=0,A=0;w<y;++w)if(o[w]===`
60
+ `){if(w-A>d)return!0;if(A=w+1,y-A<=d)return!1}return!0}function xe(o,i){let{implicitKey:a}=i,{jsonEncoding:d,minMultiLineLength:y}=L.doubleQuoted,w=JSON.stringify(o);if(d)return w;let A=i.indent||(ve(o)?" ":""),v="",P=0;for(let D=0,q=w[D];q;q=w[++D])if(q===" "&&w[D+1]==="\\"&&w[D+2]==="n"&&(v+=w.slice(P,D)+"\\ ",D+=1,P=D,q="\\"),q==="\\")switch(w[D+1]){case"u":{v+=w.slice(P,D);let X=w.substr(D+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+=w.substr(D,6)}D+=5,P=D+1}break;case"n":if(a||w[D+2]==='"'||w.length<y)D+=1;else{for(v+=w.slice(P,D)+`
61
61
 
62
- `;g[D+2]==="\\"&&g[D+3]==="n"&&g[D+4]!=='"';)v+=`
63
- `,D+=2;v+=A,g[D+2]===" "&&(v+="\\"),D+=1,P=D+1}break;default:D+=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,L.fold.lineWidth,A.length),D=P?"|":">";if(!a)return D+`
62
+ `;w[D+2]==="\\"&&w[D+3]==="n"&&w[D+4]!=='"';)v+=`
63
+ `,D+=2;v+=A,w[D+2]===" "&&(v+="\\"),D+=1,P=D+1}break;default:D+=1}return v=P?v+w.slice(P):w,a?v:ee(v,A,V,Ae(i))}function Me(o,i){if(i.implicitKey){if(/\n/.test(o))return xe(o,i)}else if(/[ \t]\n|\n[ \t]/.test(o))return xe(o,i);let a=i.indent||(ve(o)?" ":""),d="'"+o.replace(/'/g,"''").replace(/\n+/g,`$&
64
+ ${a}`)+"'";return i.implicitKey?d:ee(d,a,I,Ae(i))}function Y({comment:o,type:i,value:a},d,y,w){if(/\n[\t ]+$/.test(a)||/^\s*$/.test(a))return xe(a,d);let A=d.indent||(d.forceBlockIndent||ve(a)?" ":""),v=A?"2":"1",P=i===t.Type.BLOCK_FOLDED?!1:i===t.Type.BLOCK_LITERAL?!0:!_e(a,L.fold.lineWidth,A.length),D=P?"|":">";if(!a)return D+`
65
65
  `;let q="",X="";if(a=a.replace(/[\n\t ]*$/,se=>{let ge=se.indexOf(`
66
- `);return ge===-1?D+="-":(a===se||ge!==se.length-1)&&(D+="+",g&&g()),X=se.replace(/\n$/,""),""}).replace(/^[\n ]*/,se=>{se.indexOf(" ")!==-1&&(D+=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&&(D+=" #"+o.replace(/ ?[\r\n]+/g," "),y&&y()),!a)return`${D}${v}
66
+ `);return ge===-1?D+="-":(a===se||ge!==se.length-1)&&(D+="+",w&&w()),X=se.replace(/\n$/,""),""}).replace(/^[\n ]*/,se=>{se.indexOf(" ")!==-1&&(D+=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&&(D+=" #"+o.replace(/ ?[\r\n]+/g," "),y&&y()),!a)return`${D}${v}
67
67
  ${A}${X}`;if(P)return a=a.replace(/\n+/g,`$&${A}`),`${D}
68
68
  ${A}${q}${a}${X}`;a=a.replace(/\n+/g,`
69
69
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${A}`);let Te=ee(`${q}${a}${X}`,A,k,L.fold);return`${D}
70
- ${A}${Te}`}function m(o,r,a,u){let{comment:y,type:g,value:A}=o,{actualString:v,implicitKey:P,indent:D,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
- `)===-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
- `)!==-1)return Y(o,r,a,u);if(D===""&&ve(A))return r.forceBlockIndent=!0,Y(o,r,a,u);let X=A.replace(/\n+/g,`$&
73
- ${D}`);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,D,I,Ae(r));return y&&!q&&(Te.indexOf(`
70
+ ${A}${Te}`}function m(o,i,a,d){let{comment:y,type:w,value:A}=o,{actualString:v,implicitKey:P,indent:D,inFlow:q}=i;if(P&&/[\n[\]{},]/.test(A)||q&&/[[\]{},]/.test(A))return xe(A,i);if(!A||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(A))return P||q||A.indexOf(`
71
+ `)===-1?A.indexOf('"')!==-1&&A.indexOf("'")===-1?Me(A,i):xe(A,i):Y(o,i,a,d);if(!P&&!q&&w!==t.Type.PLAIN&&A.indexOf(`
72
+ `)!==-1)return Y(o,i,a,d);if(D===""&&ve(A))return i.forceBlockIndent=!0,Y(o,i,a,d);let X=A.replace(/\n+/g,`$&
73
+ ${D}`);if(v){let{tags:se}=i.doc.schema;if(typeof _(X,se,se.scalarFallback).value!="string")return xe(A,i)}let Te=P?X:ee(X,D,I,Ae(i));return y&&!q&&(Te.indexOf(`
74
74
  `)!==-1||y.indexOf(`
75
- `)!==-1)?(a&&a(),i(Te,D,y)):Te}function N(o,r,a,u){let{defaultType:y}=L,{implicitKey:g,inFlow:A}=r,{type:v,value:P}=o;typeof P!="string"&&(P=String(P),o=Object.assign({},o,{value:P}));let D=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=D(v);if(q===null&&(q=D(y),q===null))throw new Error(`Unsupported default string type ${y}`);return q}function H({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 z(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
- `&&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
- `+y:g.commentBefore=y):y!==void 0&&(o.comment?o.comment+=`
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 Rt(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 Jt({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 Oo(o,r,a){try{let u=Rt(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=Jt(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=Rt(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 Ao=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 vo(o,r){let a={before:[],after:[]},u=!1,y=!1,g=Ao(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:D}=r;(D&&(A>D.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 Eo(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 D=`Aliased anchor not found: ${A}`;return u.push(new t.YAMLReferenceError(r,D)),null}let P=new Q(v);return a._cstAliases.push(P),P}let g=ze(o,r);if(g)return Oo(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}=vo(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=Eo(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(`
79
- `);A&&(g.commentBefore=g.commentBefore?`${g.commentBefore}
75
+ `)!==-1)?(a&&a(),r(Te,D,y)):Te}function N(o,i,a,d){let{defaultType:y}=L,{implicitKey:w,inFlow:A}=i,{type:v,value:P}=o;typeof P!="string"&&(P=String(P),o=Object.assign({},o,{value:P}));let D=X=>{switch(X){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:return Y(o,i,a,d);case t.Type.QUOTE_DOUBLE:return xe(P,i);case t.Type.QUOTE_SINGLE:return Me(P,i);case t.Type.PLAIN:return m(o,i,a,d);default:return null}};(v!==t.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(P)||(w||A)&&(v===t.Type.BLOCK_FOLDED||v===t.Type.BLOCK_LITERAL))&&(v=t.Type.QUOTE_DOUBLE);let q=D(v);if(q===null&&(q=D(y),q===null))throw new Error(`Unsupported default string type ${y}`);return q}function H({format:o,minFractionDigits:i,tag:a,value:d}){if(typeof d=="bigint")return String(d);if(!isFinite(d))return isNaN(d)?".nan":d<0?"-.inf":".inf";let y=JSON.stringify(d);if(!o&&i&&(!a||a==="tag:yaml.org,2002:float")&&/^\d/.test(y)){let w=y.indexOf(".");w<0&&(w=y.length,y+=".");let A=i-(y.length-w-1);for(;A-- >0;)y+="0"}return y}function z(o,i){let a,d;switch(i.type){case t.Type.FLOW_MAP:a="}",d="flow map";break;case t.Type.FLOW_SEQ:a="]",d="flow sequence";break;default:o.push(new t.YAMLSemanticError(i,"Not a flow collection!?"));return}let y;for(let w=i.items.length-1;w>=0;--w){let A=i.items[w];if(!A||A.type!==t.Type.COMMENT){y=A;break}}if(y&&y.char!==a){let w=`Expected ${d} to end with ${a}`,A;typeof y.offset=="number"?(A=new t.YAMLSemanticError(i,w),A.offset=y.offset+1):(A=new t.YAMLSemanticError(y,w),y.range&&y.range.end&&(A.offset=y.range.end-y.range.start)),o.push(A)}}function ie(o,i){let a=i.context.src[i.range.start-1];if(a!==`
76
+ `&&a!==" "&&a!==" "){let d="Comments must be separated from other tokens by white space characters";o.push(new t.YAMLSemanticError(i,d))}}function le(o,i){let a=String(i),d=a.substr(0,8)+"..."+a.substr(-8);return new t.YAMLSemanticError(o,`The "${d}" key is too long`)}function Ye(o,i){for(let{afterKey:a,before:d,comment:y}of i){let w=o.items[d];w?(a&&w.value&&(w=w.value),y===void 0?(a||!w.commentBefore)&&(w.spaceBefore=!0):w.commentBefore?w.commentBefore+=`
77
+ `+y:w.commentBefore=y):y!==void 0&&(o.comment?o.comment+=`
78
+ `+y:o.comment=y)}}function Qe(o,i){let a=i.strValue;return a?typeof a=="string"?a:(a.errors.forEach(d=>{d.source||(d.source=i),o.errors.push(d)}),a.str):""}function Ze(o,i){let{handle:a,suffix:d}=i.tag,y=o.tagPrefixes.find(w=>w.handle===a);if(!y){let w=o.getDefaults().tagPrefixes;if(w&&(y=w.find(A=>A.handle===a)),!y)throw new t.YAMLSemanticError(i,`The ${a} tag handle is non-default and was not declared.`)}if(!d)throw new t.YAMLSemanticError(i,`The ${a} tag has no suffix.`);if(a==="!"&&(o.version||o.options.version)==="1.0"){if(d[0]==="^")return o.warnings.push(new t.YAMLWarning(i,"YAML 1.0 ^ tag expansion is not supported")),d;if(/[:/]/.test(d)){let w=d.match(/^([a-z0-9-]+)\/(.*)/i);return w?`tag:${w[1]}.yaml.org,2002:${w[2]}`:`tag:${d}`}}return y.prefix+decodeURIComponent(d)}function ze(o,i){let{tag:a,type:d}=i,y=!1;if(a){let{handle:w,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(i,P))}else if(w==="!"&&!A)y=!0;else try{return Ze(o,i)}catch(P){o.errors.push(P)}}switch(d){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 Pt(o,i,a){let{tags:d}=o.schema,y=[];for(let A of d)if(A.tag===a)if(A.test)y.push(A);else{let v=A.resolve(o,i);return v instanceof T?v:new f(v)}let w=Qe(o,i);return typeof w=="string"&&y.length>0?_(w,y,d.scalarFallback):null}function Kt({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 Ro(o,i,a){try{let d=Pt(o,i,a);if(d)return a&&i.tag&&(d.tag=a),d}catch(d){return d.source||(d.source=i),o.errors.push(d),null}try{let d=Kt(i);if(!d)throw new Error(`The tag ${a} is unavailable`);let y=`The tag ${a} is unavailable, falling back to ${d}`;o.warnings.push(new t.YAMLWarning(i,y));let w=Pt(o,i,d);return w.tag=a,w}catch(d){let y=new t.YAMLReferenceError(i,d.message);return y.stack=d.stack,o.errors.push(y),null}}var Po=o=>{if(!o)return!1;let{type:i}=o;return i===t.Type.MAP_KEY||i===t.Type.MAP_VALUE||i===t.Type.SEQ_ITEM};function xo(o,i){let a={before:[],after:[]},d=!1,y=!1,w=Po(i.context.parent)?i.context.parent.props.concat(i.props):i.props;for(let{start:A,end:v}of w)switch(i.context.src[A]){case t.Char.COMMENT:{if(!i.commentHasRequiredWhitespace(A)){let X="Comments must be separated from other tokens by white space characters";o.push(new t.YAMLSemanticError(i,X))}let{header:P,valueRange:D}=i;(D&&(A>D.start||P&&A>P.start)?a.after:a.before).push(i.context.src.slice(A+1,v));break}case t.Char.ANCHOR:if(d){let P="A node can have at most one anchor";o.push(new t.YAMLSemanticError(i,P))}d=!0;break;case t.Char.TAG:if(y){let P="A node can have at most one tag";o.push(new t.YAMLSemanticError(i,P))}y=!0;break}return{comments:a,hasAnchor:d,hasTag:y}}function Io(o,i){let{anchors:a,errors:d,schema:y}=o;if(i.type===t.Type.ALIAS){let A=i.rawValue,v=a.getNode(A);if(!v){let D=`Aliased anchor not found: ${A}`;return d.push(new t.YAMLReferenceError(i,D)),null}let P=new Q(v);return a._cstAliases.push(P),P}let w=ze(o,i);if(w)return Ro(o,i,w);if(i.type!==t.Type.PLAIN){let A=`Failed to resolve ${i.type} node here`;return d.push(new t.YAMLSyntaxError(i,A)),null}try{let A=Qe(o,i);return _(A,y.tags,y.tags.scalarFallback)}catch(A){return A.source||(A.source=i),d.push(A),null}}function it(o,i){if(!i)return null;i.error&&o.errors.push(i.error);let{comments:a,hasAnchor:d,hasTag:y}=xo(o.errors,i);if(d){let{anchors:A}=o,v=i.anchor,P=A.getNode(v);P&&(A.map[A.newName(v)]=P),A.map[v]=i}if(i.type===t.Type.ALIAS&&(d||y)){let A="An alias node must not specify any properties";o.errors.push(new t.YAMLSemanticError(i,A))}let w=Io(o,i);if(w){w.range=[i.range.start,i.range.end],o.options.keepCstNodes&&(w.cstNode=i),o.options.keepNodeTypes&&(w.type=i.type);let A=a.before.join(`
79
+ `);A&&(w.commentBefore=w.commentBefore?`${w.commentBefore}
80
80
  ${A}`:A);let v=a.after.join(`
81
- `);v&&(g.comment=g.comment?`${g.comment}
82
- ${v}`:v)}return r.resolved=g}function _o(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?Io(o,r):xo(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,D=null;P.some(q=>{if(q instanceof Q){let{type:X}=q.source;return X===t.Type.MAP||X===t.Type.FLOW_MAP?!1:D="Merge nodes aliases can only point to maps"}return D="Merge nodes can only have Alias nodes as values"}),D&&o.errors.push(new t.YAMLSemanticError(r,D))}else for(let P=A+1;P<u.length;++P){let{key:D}=u[P];if(v===D||v&&D&&Object.prototype.hasOwnProperty.call(v,"value")&&v.value===D.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 Ro=({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 Po(o,r){if(!Ro(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 xo(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 D=new W(y,rt(o,P));Po(v,D),u.push(D),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 D=r.items[P];switch(D&&D.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 Io(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:D,offset:q}=P;if(D==="?"&&y===void 0&&!g){g=!0,A=":";continue}if(D===":"){if(y===void 0&&(y=null),A===":"){A=",";continue}}else if(g&&(y===void 0&&D!==","&&(y=null),g=!1),y!==void 0&&(u.push(new W(y)),y=void 0,D===",")){A=":";continue}if(D==="}"){if(v===r.items.length-1)continue}else if(D===A){A=":";continue}let X=`Flow map contains an unexpected ${D}`,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 z(o.errors,r),y!==void 0&&u.push(new W(y)),{comments:a,items:u}}function No(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?Co(o,r):ko(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 ko(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 Co(o,r){let a=[],u=[],y=!1,g,A=null,v="[",P=null;for(let D=0;D<r.items.length;++D){let q=r.items[D];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!=="]"||D<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 z(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=S,e.boolOptions=b,e.findPair=ne,e.intOptions=R,e.isEmptyPath=U,e.nullOptions=x,e.resolveMap=_o,e.resolveNode=rt,e.resolveSeq=No,e.resolveString=Qe,e.strOptions=L,e.stringifyNumber=H,e.stringifyString=N,e.toJSON=h}}),zn=$e({"node_modules/yaml/dist/warnings-1000a372.js"(e){var t=Ot(),i=$t(),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}
81
+ `);v&&(w.comment=w.comment?`${w.comment}
82
+ ${v}`:v)}return i.resolved=w}function No(o,i){if(i.type!==t.Type.MAP&&i.type!==t.Type.FLOW_MAP){let A=`A ${i.type} node cannot be resolved as a mapping`;return o.errors.push(new t.YAMLSyntaxError(i,A)),null}let{comments:a,items:d}=i.type===t.Type.FLOW_MAP?Lo(o,i):Mo(o,i),y=new he;y.items=d,Ye(y,a);let w=!1;for(let A=0;A<d.length;++A){let{key:v}=d[A];if(v instanceof T&&(w=!0),o.schema.merge&&v&&v.value===ye){d[A]=new j(d[A]);let P=d[A].value.items,D=null;P.some(q=>{if(q instanceof Q){let{type:X}=q.source;return X===t.Type.MAP||X===t.Type.FLOW_MAP?!1:D="Merge nodes aliases can only point to maps"}return D="Merge nodes can only have Alias nodes as values"}),D&&o.errors.push(new t.YAMLSemanticError(i,D))}else for(let P=A+1;P<d.length;++P){let{key:D}=d[P];if(v===D||v&&D&&Object.prototype.hasOwnProperty.call(v,"value")&&v.value===D.value){let q=`Map keys must be unique; "${v}" is repeated`;o.errors.push(new t.YAMLSemanticError(i,q));break}}}if(w&&!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(i,A))}return i.resolved=y,y}var ko=({context:{lineStart:o,node:i,src:a},props:d})=>{if(d.length===0)return!1;let{start:y}=d[0];if(i&&y>i.valueRange.start||a[y]!==t.Char.COMMENT)return!1;for(let w=o;w<y;++w)if(a[w]===`
83
+ `)return!1;return!0};function Co(o,i){if(!ko(o))return;let a=o.getPropValue(0,t.Char.COMMENT,!0),d=!1,y=i.value.commentBefore;if(y&&y.startsWith(a))i.value.commentBefore=y.substr(a.length+1),d=!0;else{let w=i.value.comment;!o.node&&w&&w.startsWith(a)&&(i.value.comment=w.substr(a.length+1),d=!0)}d&&(i.comment=a)}function Mo(o,i){let a=[],d=[],y,w=null;for(let A=0;A<i.items.length;++A){let v=i.items[A];switch(v.type){case t.Type.BLANK_LINE:a.push({afterKey:!!y,before:d.length});break;case t.Type.COMMENT:a.push({afterKey:!!y,before:d.length,comment:v.comment});break;case t.Type.MAP_KEY:y!==void 0&&d.push(new W(y)),v.error&&o.errors.push(v.error),y=it(o,v.node),w=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 D=new W(y,it(o,P));Co(v,D),d.push(D),y&&typeof w=="number"&&v.range.start>w+1024&&o.errors.push(le(i,y)),y=void 0,w=null}break;default:y!==void 0&&d.push(new W(y)),y=it(o,v),w=v.range.start,v.error&&o.errors.push(v.error);e:for(let P=A+1;;++P){let D=i.items[P];switch(D&&D.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&&d.push(new W(y)),{comments:a,items:d}}function Lo(o,i){let a=[],d=[],y,w=!1,A="{";for(let v=0;v<i.items.length;++v){let P=i.items[v];if(typeof P.char=="string"){let{char:D,offset:q}=P;if(D==="?"&&y===void 0&&!w){w=!0,A=":";continue}if(D===":"){if(y===void 0&&(y=null),A===":"){A=",";continue}}else if(w&&(y===void 0&&D!==","&&(y=null),w=!1),y!==void 0&&(d.push(new W(y)),y=void 0,D===",")){A=":";continue}if(D==="}"){if(v===i.items.length-1)continue}else if(D===A){A=":";continue}let X=`Flow map contains an unexpected ${D}`,Te=new t.YAMLSyntaxError(i,X);Te.offset=q,o.errors.push(Te)}else P.type===t.Type.BLANK_LINE?a.push({afterKey:!!y,before:d.length}):P.type===t.Type.COMMENT?(ie(o.errors,P),a.push({afterKey:!!y,before:d.length,comment:P.comment})):y===void 0?(A===","&&o.errors.push(new t.YAMLSemanticError(P,"Separator , missing in flow map")),y=it(o,P)):(A!==","&&o.errors.push(new t.YAMLSemanticError(P,"Indicator : missing in flow map entry")),d.push(new W(y,it(o,P))),y=void 0,w=!1)}return z(o.errors,i),y!==void 0&&d.push(new W(y)),{comments:a,items:d}}function Do(o,i){if(i.type!==t.Type.SEQ&&i.type!==t.Type.FLOW_SEQ){let w=`A ${i.type} node cannot be resolved as a sequence`;return o.errors.push(new t.YAMLSyntaxError(i,w)),null}let{comments:a,items:d}=i.type===t.Type.FLOW_SEQ?Fo(o,i):Uo(o,i),y=new E;if(y.items=d,Ye(y,a),!o.options.mapAsMap&&d.some(w=>w instanceof W&&w.key instanceof T)){let w="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(i,w))}return i.resolved=y,y}function Uo(o,i){let a=[],d=[];for(let y=0;y<i.items.length;++y){let w=i.items[y];switch(w.type){case t.Type.BLANK_LINE:a.push({before:d.length});break;case t.Type.COMMENT:a.push({comment:w.comment,before:d.length});break;case t.Type.SEQ_ITEM:if(w.error&&o.errors.push(w.error),d.push(it(o,w.node)),w.hasProps){let A="Sequence items cannot have tags or anchors before the - indicator";o.errors.push(new t.YAMLSemanticError(w,A))}break;default:w.error&&o.errors.push(w.error),o.errors.push(new t.YAMLSyntaxError(w,`Unexpected ${w.type} node in sequence`))}}return{comments:a,items:d}}function Fo(o,i){let a=[],d=[],y=!1,w,A=null,v="[",P=null;for(let D=0;D<i.items.length;++D){let q=i.items[D];if(typeof q.char=="string"){let{char:X,offset:Te}=q;if(X!==":"&&(y||w!==void 0)&&(y&&w===void 0&&(w=v?d.pop():null),d.push(new W(w)),y=!1,w=void 0,A=null),X===v)v=null;else if(!v&&X==="?")y=!0;else if(v!=="["&&X===":"&&w===void 0){if(v===","){if(w=d.pop(),w instanceof W){let se="Chaining flow sequence pairs is invalid",ge=new t.YAMLSemanticError(i,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(i,w));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 w=null;A=null,y=!1,v=null}else if(v==="["||X!=="]"||D<i.items.length-1){let se=`Flow sequence contains an unexpected ${X}`,ge=new t.YAMLSyntaxError(i,se);ge.offset=Te,o.errors.push(ge)}}else if(q.type===t.Type.BLANK_LINE)a.push({before:d.length});else if(q.type===t.Type.COMMENT)ie(o.errors,q),a.push({comment:q.comment,before:d.length});else{if(v){let Te=`Expected a ${v} in flow sequence`;o.errors.push(new t.YAMLSemanticError(q,Te))}let X=it(o,q);w===void 0?(d.push(X),P=q):(d.push(new W(w,X)),w=void 0),A=q.range.start,v=","}}return z(o.errors,i),w!==void 0&&d.push(new W(w)),{comments:a,items:d}}e.Alias=Q,e.Collection=T,e.Merge=j,e.Node=u,e.Pair=W,e.Scalar=f,e.YAMLMap=he,e.YAMLSeq=E,e.addComment=c,e.binaryOptions=S,e.boolOptions=b,e.findPair=ne,e.intOptions=R,e.isEmptyPath=U,e.nullOptions=x,e.resolveMap=No,e.resolveNode=it,e.resolveSeq=Do,e.resolveString=Qe,e.strOptions=L,e.stringifyNumber=H,e.stringifyString=N,e.toJSON=h}}),zn=$e({"node_modules/yaml/dist/warnings-1000a372.js"(e){var t=At(),r=Yt(),c={identify:_=>_ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(_,I)=>{let k=r.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:r.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=r.binaryOptions.defaultType),I===t.Type.QUOTE_DOUBLE)k=Ae;else{let{lineWidth:ve}=r.binaryOptions,_e=Math.ceil(Ae.length/ve),xe=new Array(_e);for(let Me=0,Y=0;Me<_e;++Me,Y+=ve)xe[Me]=Ae.substr(Y,ve);k=xe.join(I===t.Type.BLOCK_LITERAL?`
85
+ `:" ")}return r.stringifyString({comment:_,type:I,value:k},V,G,ee)}};function u(_,I){let k=r.resolveSeq(_,I);for(let V=0;V<k.items.length;++V){let G=k.items[V];if(!(G instanceof r.Pair)){if(G instanceof r.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 r.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 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 U(_,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:U,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 S(_){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(S(!1)){let k=typeof process!="undefined"&&process.emitWarning;k?k(_,I):console.warn(I?`${I}: ${_}`:_)}}function R(_){if(S(!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 L(_,I){if(!x[_]&&S(!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=L}}),ki=$e({"node_modules/yaml/dist/Schema-88e323a7.js"(e){var t=Ot(),i=$t(),c=zn();function p(m,N,H){let z=new i.YAMLMap(m);if(N instanceof Map)for(let[re,le]of N)z.items.push(m.createPair(re,le,H));else if(N&&typeof N=="object")for(let re of Object.keys(N))z.items.push(m.createPair(re,N[re],H));return typeof m.sortMapEntries=="function"&&z.items.sort(m.sortMapEntries),z}var h={createNode:p,default:!0,nodeClass:i.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:i.resolveMap};function d(m,N,H){let z=new i.YAMLSeq(m);if(N&&N[Symbol.iterator])for(let re of N){let le=m.createNode(re,H.wrapScalars,null,H);z.items.push(le)}return z}var O={createNode:d,default:!0,nodeClass:i.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:i.resolveSeq},U={identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify(m,N,H,z){return N=Object.assign({actualString:!0},N),i.stringifyString(m,N,H,z)},options:i.strOptions},T=[h,O,U],$=m=>typeof m=="bigint"||Number.isInteger(m),E=(m,N,H)=>i.intOptions.asBigInt?BigInt(m):parseInt(N,H);function J(m,N,H){let{value:z}=m;return $(z)&&z>=0?H+z.toString(N):i.stringifyNumber(m)}var W={identify:m=>m==null,createNode:(m,N,H)=>H.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()},S={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(m,N,H){let z=N||H,re=new i.Scalar(parseFloat(m));return z&&z[z.length-1]==="0"&&(re.minFractionDigits=z.length),re},stringify:i.stringifyNumber},b=T.concat([W,ae,Q,ne,he,ye,j,S]),R=m=>typeof m=="bigint"||Number.isInteger(m),x=({value:m})=>JSON.stringify(m),L=[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,H)=>H.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}];L.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,H){let z=N.replace(/_/g,"");if(i.intOptions.asBigInt){switch(H){case 2:z=`0b${z}`;break;case 8:z=`0o${z}`;break;case 16:z=`0x${z}`;break}let le=BigInt(z);return m==="-"?BigInt(-1)*le:le}let re=parseInt(z,H);return m==="-"?-1*re:re}function V(m,N,H){let{value:z}=m;if(I(z)){let re=z.toString(N);return z<0?"-"+H+re.substr(1):H+re}return i.stringifyNumber(m)}var G=T.concat([{identify:m=>m==null,createNode:(m,N,H)=>H.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,H)=>k(N,H,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,H)=>k(N,H,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,H)=>k(N,H,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,H)=>k(N,H,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 H=new i.Scalar(parseFloat(m.replace(/_/g,"")));if(N){let z=N.replace(/_/g,"");z[z.length-1]==="0"&&(H.minFractionDigits=z.length)}return H},stringify:i.stringifyNumber}],c.binary,c.omap,c.pairs,c.set,c.intTime,c.floatTime,c.timestamp),ee={core:b,failsafe:T,json:L,yaml11:G},Ae={binary:c.binary,bool:ae,float:S,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,H){if(N){let z=H.filter(le=>le.tag===N),re=z.find(le=>!le.format)||z[0];if(!re)throw new Error(`Tag ${N} not found`);return re}return H.find(z=>(z.identify&&z.identify(m)||z.class&&m instanceof z.class)&&!z.format)}function _e(m,N,H){if(m instanceof i.Node)return m;let{defaultPrefix:z,onTagObj:re,prevObjects:le,schema:Ye,wrapScalars:Qe}=H;N&&N.startsWith("!!")&&(N=z+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 H.onTagObj);let ze={value:void 0,node:void 0};if(m&&typeof m=="object"&&le){let Rt=le.get(m);if(Rt){let Jt=new i.Alias(Rt);return H.aliasNodes.push(Jt),Jt}ze.value=m,le.set(m,ze)}return ze.node=Ze.createNode?Ze.createNode(H.schema,m,H):Qe?new i.Scalar(m):m,N&&ze.node instanceof i.Node&&(ze.node.tag=N),ze.node}function Pe(m,N,H,z){let re=m[z.replace(/\W/g,"")];if(!re){let le=Object.keys(m).map(Ye=>JSON.stringify(Ye)).join(", ");throw new Error(`Unknown schema "${z}"; use one of ${le}`)}if(Array.isArray(H))for(let le of H)re=re.concat(le);else typeof H=="function"&&(re=H(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:H,schema:z,sortMapEntries:re,tags:le}){this.merge=!!H,this.name=z,this.sortMapEntries=re===!0?Ce:re||null,!N&&le&&c.warnOptionDeprecation("tags","customTags"),this.tags=Pe(ee,Ae,N||le,z)}createNode(N,H,z,re){let le={defaultPrefix:xr.defaultPrefix,schema:this,wrapScalars:H},Ye=re?Object.assign(re,le):le;return _e(N,z,Ye)}createPair(N,H,z){z||(z={wrapScalars:!0});let re=this.createNode(N,z.wrapScalars,null,z),le=this.createNode(H,z.wrapScalars,null,z);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=$t(),i=ki();Ot(),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,At=new Ui,Ie.getDefaults=()=>At.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},jt=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:Cs,typecast:_s,merge:dt,clone:ce,short:Rs,hasValue:Ps,notValue:xs,anyValue:yi,validate:Is,validateValueForSchema:Yn,validateValueForOneOf:Ns,isKey:ks,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]=Ms(()=>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=Ls,Gi=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},Yt=Gi,vt={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"]},vt.number=vt.integer,Ki=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Hi=Us,zi=Fs,Xi=zi,Qi=Xi,Zi=$s,er=Zi,tr=er,nr=Ys,ri=Ws,ir=Vs,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 r.Pair?G:new r.Pair(G)}}return k}function h(_,I,k){let V=new r.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 f={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:u,createNode:h},O=class Ri extends r.YAMLSeq{constructor(){super(),t._defineProperty(this,"add",r.YAMLMap.prototype.add.bind(this)),t._defineProperty(this,"delete",r.YAMLMap.prototype.delete.bind(this)),t._defineProperty(this,"get",r.YAMLMap.prototype.get.bind(this)),t._defineProperty(this,"has",r.YAMLMap.prototype.has.bind(this)),t._defineProperty(this,"set",r.YAMLMap.prototype.set.bind(this)),this.tag=Ri.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 r.Pair?(ee=r.toJSON(G.key,"",k),Ae=r.toJSON(G.value,ee,k)):ee=r.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 U(_,I){let k=u(_,I),V=[];for(let{key:G}of k.items)if(G instanceof r.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:U,createNode:T},E=class Pi extends r.YAMLMap{constructor(){super(),this.tag=Pi.tag}add(I){let k=I instanceof r.Pair?I:new r.Pair(I);r.findPair(this.items,k.key)||this.items.push(k)}get(I,k){let V=r.findPair(this.items,I);return!k&&V instanceof r.Pair?V.key instanceof r.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=r.findPair(this.items,I);V&&!k?this.items.splice(this.items.indexOf(V),1):!V&&k&&this.items.push(new r.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=r.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 r.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 xe=Date.UTC(I,k-1,V,G||0,ee||0,Ae||0,ve||0);if(_e&&_e!=="Z"){let Me=Q(_e[0],_e.slice(1));Math.abs(Me)<30&&(Me*=60),xe-=6e4*Me}return new Date(xe)},stringify:({value:_})=>_.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function S(_){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(S(!1)){let k=typeof process!="undefined"&&process.emitWarning;k?k(_,I):console.warn(I?`${I}: ${_}`:_)}}function R(_){if(S(!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 L(_,I){if(!x[_]&&S(!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=f,e.set=ae,e.timestamp=j,e.warn=b,e.warnFileDeprecation=R,e.warnOptionDeprecation=L}}),kr=$e({"node_modules/yaml/dist/Schema-88e323a7.js"(e){var t=At(),r=Yt(),c=zn();function u(m,N,H){let z=new r.YAMLMap(m);if(N instanceof Map)for(let[ie,le]of N)z.items.push(m.createPair(ie,le,H));else if(N&&typeof N=="object")for(let ie of Object.keys(N))z.items.push(m.createPair(ie,N[ie],H));return typeof m.sortMapEntries=="function"&&z.items.sort(m.sortMapEntries),z}var h={createNode:u,default:!0,nodeClass:r.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:r.resolveMap};function f(m,N,H){let z=new r.YAMLSeq(m);if(N&&N[Symbol.iterator])for(let ie of N){let le=m.createNode(ie,H.wrapScalars,null,H);z.items.push(le)}return z}var O={createNode:f,default:!0,nodeClass:r.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:r.resolveSeq},U={identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r.resolveString,stringify(m,N,H,z){return N=Object.assign({actualString:!0},N),r.stringifyString(m,N,H,z)},options:r.strOptions},T=[h,O,U],$=m=>typeof m=="bigint"||Number.isInteger(m),E=(m,N,H)=>r.intOptions.asBigInt?BigInt(m):parseInt(N,H);function J(m,N,H){let{value:z}=m;return $(z)&&z>=0?H+z.toString(N):r.stringifyNumber(m)}var W={identify:m=>m==null,createNode:(m,N,H)=>H.wrapScalars?new r.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:r.nullOptions,stringify:()=>r.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:r.boolOptions,stringify:({value:m})=>m?r.boolOptions.trueStr:r.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:r.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:r.intOptions,stringify:r.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:r.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:r.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()},S={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(m,N,H){let z=N||H,ie=new r.Scalar(parseFloat(m));return z&&z[z.length-1]==="0"&&(ie.minFractionDigits=z.length),ie},stringify:r.stringifyNumber},b=T.concat([W,ae,Q,ne,he,ye,j,S]),R=m=>typeof m=="bigint"||Number.isInteger(m),x=({value:m})=>JSON.stringify(m),L=[h,O,{identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r.resolveString,stringify:x},{identify:m=>m==null,createNode:(m,N,H)=>H.wrapScalars?new r.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=>r.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}];L.scalarFallback=m=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(m)}`)};var _=({value:m})=>m?r.boolOptions.trueStr:r.boolOptions.falseStr,I=m=>typeof m=="bigint"||Number.isInteger(m);function k(m,N,H){let z=N.replace(/_/g,"");if(r.intOptions.asBigInt){switch(H){case 2:z=`0b${z}`;break;case 8:z=`0o${z}`;break;case 16:z=`0x${z}`;break}let le=BigInt(z);return m==="-"?BigInt(-1)*le:le}let ie=parseInt(z,H);return m==="-"?-1*ie:ie}function V(m,N,H){let{value:z}=m;if(I(z)){let ie=z.toString(N);return z<0?"-"+H+ie.substr(1):H+ie}return r.stringifyNumber(m)}var G=T.concat([{identify:m=>m==null,createNode:(m,N,H)=>H.wrapScalars?new r.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:r.nullOptions,stringify:()=>r.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:r.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:r.boolOptions,stringify:_},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(m,N,H)=>k(N,H,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,H)=>k(N,H,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,H)=>k(N,H,10),stringify:r.stringifyNumber},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(m,N,H)=>k(N,H,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:r.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 H=new r.Scalar(parseFloat(m.replace(/_/g,"")));if(N){let z=N.replace(/_/g,"");z[z.length-1]==="0"&&(H.minFractionDigits=z.length)}return H},stringify:r.stringifyNumber}],c.binary,c.omap,c.pairs,c.set,c.intTime,c.floatTime,c.timestamp),ee={core:b,failsafe:T,json:L,yaml11:G},Ae={binary:c.binary,bool:ae,float:S,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,H){if(N){let z=H.filter(le=>le.tag===N),ie=z.find(le=>!le.format)||z[0];if(!ie)throw new Error(`Tag ${N} not found`);return ie}return H.find(z=>(z.identify&&z.identify(m)||z.class&&m instanceof z.class)&&!z.format)}function _e(m,N,H){if(m instanceof r.Node)return m;let{defaultPrefix:z,onTagObj:ie,prevObjects:le,schema:Ye,wrapScalars:Qe}=H;N&&N.startsWith("!!")&&(N=z+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 r.Scalar(m):m;Ze=m instanceof Map?h:m[Symbol.iterator]?O:h}ie&&(ie(Ze),delete H.onTagObj);let ze={value:void 0,node:void 0};if(m&&typeof m=="object"&&le){let Pt=le.get(m);if(Pt){let Kt=new r.Alias(Pt);return H.aliasNodes.push(Kt),Kt}ze.value=m,le.set(m,ze)}return ze.node=Ze.createNode?Ze.createNode(H.schema,m,H):Qe?new r.Scalar(m):m,N&&ze.node instanceof r.Node&&(ze.node.tag=N),ze.node}function xe(m,N,H,z){let ie=m[z.replace(/\W/g,"")];if(!ie){let le=Object.keys(m).map(Ye=>JSON.stringify(Ye)).join(", ");throw new Error(`Unknown schema "${z}"; use one of ${le}`)}if(Array.isArray(H))for(let le of H)ie=ie.concat(le);else typeof H=="function"&&(ie=H(ie.slice()));for(let le=0;le<ie.length;++le){let Ye=ie[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}`)}ie[le]=Qe}}return ie}var Me=(m,N)=>m.key<N.key?-1:m.key>N.key?1:0,Y=class xi{constructor({customTags:N,merge:H,schema:z,sortMapEntries:ie,tags:le}){this.merge=!!H,this.name=z,this.sortMapEntries=ie===!0?Me:ie||null,!N&&le&&c.warnOptionDeprecation("tags","customTags"),this.tags=xe(ee,Ae,N||le,z)}createNode(N,H,z,ie){let le={defaultPrefix:xi.defaultPrefix,schema:this,wrapScalars:H},Ye=ie?Object.assign(ie,le):le;return _e(N,z,Ye)}createPair(N,H,z){z||(z={wrapScalars:!0});let ie=this.createNode(N,z.wrapScalars,null,z),le=this.createNode(H,z.wrapScalars,null,z);return new r.Pair(ie,le)}};t._defineProperty(Y,"defaultPrefix",t.defaultTagPrefix),t._defineProperty(Y,"defaultTags",t.defaultTags),e.Schema=Y}}),Cr=$e({"node_modules/yaml/dist/types.js"(e){var t=Yt(),r=kr();At(),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=r.Schema}}),Xn={},Qn=()=>Xn,Mr=e=>{Object.assign(Xn,e)},Lr=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=Lr,ue={},er=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,Dr=class extends Zn{constructor(){super(),this.data={...er},this._defaults=er}get defaults(){return{...this._defaults}}},Ur=Dr,vt=new Ur,Pe.getDefaults=()=>vt.defaults,te=Pe,tr=["integer","number","string","boolean"],nr=tr.concat(["null"]),Fr=["array","object"].concat(nr),$r=2524608e6,jr=-1e8,Yr=1e8,Wr=-100,Vr=100,He={ALLOWED_TYPES:tr,SCALAR_TYPES:nr,ALL_TYPES:Fr,MIN_NUMBER:Wr,MAX_NUMBER:Vr,MIN_INTEGER:jr,MAX_INTEGER:Yr,MOST_NEAR_DATETIME:$r},Wt=Hn(Nr(),1),Z={pick:Ce,date:Yn,shuffle:Fe,number:Ge,randexp:be},qr=/^(0|[1-9][0-9]*)$/,de={hasProperties:qe,getLocalRef:hr,omitProps:Fs,typecast:Ns,merge:dt,clone:ce,short:ks,hasValue:Cs,notValue:Ms,anyValue:yr,validate:Ls,validateValueForSchema:Wn,validateValueForOneOf:Ds,isKey:Us,template:gr,shouldClean:wr,clean:qn,isEmpty:Vn,clampDate:mr},Br=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]=$s(()=>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),r={},c=t.length;for(;c--;){let u=t[c].replace(/^x-/,""),h=this.support[u];if(typeof h=="function"){Object.defineProperty(e,"generate",{configurable:!1,enumerable:!1,writable:!1,value:(f,O)=>h.call(r,e[t[c]],e,t[c],f,O.slice())});break}}}return e}},Jr=Br,ht=new Zn,rr=js,Gr=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},Vt=Gr,Et={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"]},Et.number=Et.integer,Kr=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Hr=Ws,zr=Vs,Xr=zr,Qr=Xr,Zr=qs,ei=Zr,ti=ei,ni=Js,ir=Gs,ri=Ks,ii=`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/),Wt=qs,Vt={type:He.ALLOWED_TYPES},sr=Bs,si=Js,or=Gs,qt=Ks,ar=Hs,lr=zs,oi="[a-zA-Z][a-zA-Z0-9+-.]*",Bt=`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:Bt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${Bt}${cr}`,"uri-template":Bt.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=Xs,dr=Zs,fr={boolean:Qi,null:tr,array:nr,integer:ir,number:ri,object:sr,string:dr},Et=fr,hr=ft,mr=({refs:e,schema:t,container:i,synchronous:c,refDepthMax:p,refDepthMin:h})=>{let d={},O={},U=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&&++U>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(S=>{if(ye.required&&ye.required.includes(S))return;let b=he.required&&he.required.includes(S);he.properties&&!b&&delete he.properties[S],ne&&ne.properties&&delete ne.properties[S]})}),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=io,li=ro,Le=Kn(Ci(),1),ao=Le.default.binaryOptions,lo=Le.default.boolOptions,co=Le.default.intOptions,po=Le.default.nullOptions,uo=Le.default.strOptions,fo=Le.default.Schema,ho=Le.default.Alias,mo=Le.default.Collection,yo=Le.default.Merge,go=Le.default.Node,wo=Le.default.Pair,So=Le.default.Scalar,gr=Le.default.YAMLMap,wr=Le.default.YAMLSeq,_t=oo,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)=>_t(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(U){O(U)}}},{$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(_t),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}}),To=M({"src/src/main.iife.js"(e,t){var i=(bo(),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 To()})();((f,n)=>{f.JSONSchemaFaker=n()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>bn);bn.random.shuffle=function(){return["[placeholder]"]};bn.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function Ir(f){return bn.generate(f)}var Nr=async(f,n)=>{let s=new TextEncoder,l=s.encode(f),w=s.encode(n),M=await crypto.subtle.importKey("raw",l,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await crypto.subtle.sign("HMAC",M,w);return Array.from(new Uint8Array(C)).map(K=>K.toString(16).padStart(2,"0")).join("")};var Bo=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 Tn=(f,n)=>{if(!f)throw new cn;return{post:async(s,l)=>{let w=await fetch(`${n}/v1${s}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${f}`},body:JSON.stringify(l)}),M=await w.json();if(w.ok)return M;throw Cr(M)?new pn(M.statusCode,M.error,M.message):new mt(M)},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 w=n[l];w&&typeof w=="object"&&!Array.isArray(w)?s[l]=di(s[l]||{},w):(Array.isArray(w),s[l]=w)}return s}function On(f,n){let s=n.split(".").reduce((l,w)=>{if(l&&typeof l=="object")return l[w]},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 w=s?f.map(K=>typeof K!="object"||!K?"":On(K,s)):f;if(w.length===1)return w[0];if(w.length===2)return`${w[0]} and ${w[1]}`;if(w.length===3&&n>=3)return`${w[0]}, ${l}${w[1]} and ${w[2]}`;let M=w.slice(0,n),C=w.length-n;return`${M.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 w=0;if(Array.isArray(f)?w=f.length:typeof f=="object"?w=Object.keys(f).length:typeof f=="string"?w=+f:typeof f=="number"?w=f:w=Number(f),Number.isNaN(w)&&(w=0),w<=0)return"";let M;return s?M=w===1?n:s:M=(0,Lr.default)(n,w),l==="true"?`${w} ${M}`:M}var Jo=require("liquidjs"),Ur=et(require("pluralize"),1),Go=require("zod");var Ko="",Ho=2,zo="other",Xo=", ",Qo=" and ",Zo=", and ";function Fr(f,n=Ko,s=Ho,l=zo,w=Xo,M=Qo,C=Zo){if(!Array.isArray(f)||f.length===0)return"";let K=n?f.map(be=>typeof be!="object"||!be?"":On(be,n)):f,ie=K.length;if(ie===1)return K[0];if(ie===2)return`${K[0]}${M}${K[1]}`;if(s>=ie){let be=K.slice(0,ie-1),ke=K[ie-1];return`${be.join(w)}${C}${ke}`}let Se=K.slice(0,s),Ie=ie-s,Ne=s===1?M:C;return`${Se.join(w)}${Ne}${Ie} ${(0,Ur.default)(l,Ie)}`}function ea(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:ea,...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 An(f){return f||process.env.NOVU_API_URL||"https://api.novu.co"}function vn(f){return f||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var fi=et(require("sanitize-html"),1),ta=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"],na={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,w]of Object.entries(n))ta.includes(l.toLowerCase())&&(s[l]=w);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,na);return s?s[0]+l:l},En=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(w=>typeof w=="string"?Wr(w):typeof w=="object"?En(w):w):typeof l=="object"&&l!==null?n[s]=En(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((M,C)=>{let K=C===n.providers.length-1;console.log(`${l?" ":"\u2502"} ${K?"\u2514":"\u251C"} ${Re.PROVIDER} Discovered provider: '${M.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 _n=class extends ot{constructor(s,l){let w=l.length===1?"it":"them";super(`Tried to use a ${s} in @novu/framework without ${l.join(", ")} installed. Please install ${w} by running \`npm install ${l.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var Rn=async(f,n)=>{let s=new Set;if((await Promise.allSettled(f.map(w=>w.import))).forEach((w,M)=>{let C=f[M];w.status==="fulfilled"&&C.exports.every(ie=>w.value[ie]!==void 0)||s.add(C.name)}),s.size>0)throw new _n(n,Array.from(s))};var Pn=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 Rn(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 w=qr(n);return l(w)?{success:!0,data:w}:{success:!1,errors:l.errors.map(C=>({path:C.instancePath,message:C.message}))}}async transformToJsonSchema(n){return n}};var xn=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 Rn(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(w=>({path:`/${w.path.join("/")}`,message:w.message}))}}async transformToJsonSchema(n){let{zodToJsonSchema:s}=await import("zod-to-json-schema");return s(n)}};var In=new xn,Nn=new Pn,kn=async(f,n)=>{if(await In.canHandle(f))return In.validate(n,f);if(await Nn.canHandle(f))return Nn.validate(n,f);throw new Error("Invalid schema")},Me=async f=>{if(await In.canHandle(f))return In.transformToJsonSchema(f);if(await Nn.canHandle(f))return Nn.transformToJsonSchema(f);throw new Error("Invalid schema")};function ia(){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";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:An(n==null?void 0:n.apiUrl),secretKey:vn(n==null?void 0:n.secretKey),strictAuthentication:!ia()};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 w=this.addWorkflow(s);this.discoverWorkflowPromises.set(s.id,w),await w}}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((w,M)=>w+M.steps.length,0);return{status:"ok",sdkVersion:"2.9.0",frameworkVersion:"2024-06-26",discovered:{workflows:s,steps:l}}}getWorkflow(n){let s=this.discoveredWorkflows.get(n);if(s)return s;throw new Mt(n)}getStep(n,s){let w=this.getWorkflow(n).steps.find(M=>M.stepId===s);if(w)return w;throw new wn(s)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows()}}mock(n){return Ir(n)}async validate(n,s,l,w,M,C,K){let ie=await kn(s,n);if(ie.success)return ie.data;switch(l){case"event":this.throwInvalidEvent(w,M,ie.errors);case"step":this.throwInvalidStep(C,w,M,ie.errors);case"provider":this.throwInvalidProvider(C,K,w,M,ie.errors);default:throw new Error(`Invalid component: '${l}'`)}}throwInvalidProvider(n,s,l,w,M){if(!n)throw new Error("stepId is required");if(!s)throw new Error("providerId is required");switch(l){case"output":throw new sn(w,n,s,M);default:throw new Error(`Invalid payload type: '${l}'`)}}throwInvalidStep(n,s,l,w){if(!n)throw new Error("stepId is required");switch(s){case"output":throw new tn(l,n,w);case"result":throw new nn(l,n,w);case"controls":throw new en(l,n,w);default:throw new Error(`Invalid payload type: '${s}'`)}}throwInvalidEvent(n,s,l){switch(n){case"controls":throw new Zt(s,l);case"payload":throw new It(s,l);default:throw new Error(`Invalid payload type: '${n}'`)}}executeStepFactory(n,s,l){return async(w,M,C)=>{if(l())return;let K=this.getStep(n.workflowId,w),ie=n.action==="preview";if(!ie&&w===n.stepId){let ke=await this.createStepControls(K,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,{...K,providers:K.providers.map(ke=>{var it;let Fe=(it=C==null?void 0:C.providers)==null?void 0:it[ke.type];if(!Fe)throw new un(ke.type);return{...ke,resolve:Fe}}),resolve:M});return this.shouldSanitize({stepType:K.type,options:C})&&(be={...be,outputs:En(be.outputs)}),w===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 w=`${{execute:"Executing",preview:"Previewing"}[n.action]} workflowId:`;console.log(`
94
- ${we.bold(we.underline(w))} '${n.workflowId}'`);let M=this.getWorkflow(n.workflowId),C=process.hrtime(),K={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,K=Ke},be=()=>Se,ke;try{if(n.action==="execute"&&!n.payload)throw new It(n.workflowId,{message:"Event `payload` is required"});let Ke=await this.createExecutionPayload(n,M),qe={...n,payload:Ke};await Promise.race([Ie,M.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],Ut=it*1e3+Ge/1e6,jn=ke?Re.ERROR:Re.SUCCESS,Ft={execute:"Executed",preview:"Previewed"}[n.action];if(console.log(`${jn} ${Ft} workflowId: \`${n.workflowId}\``),this.prettyPrintExecute(n,Ut,ke),ke)throw ke;return{outputs:K.outputs,providers:K.providers,options:K.options,metadata:{status:"success",error:!1,duration:Ut}}}async createExecutionPayload(n,s){let{payload:l}=n;if(n.action==="preview"){let M=this.mock(s.payload.schema);l=Object.assign(M,l)}return await this.validate(l,s.payload.unknownSchema,"event","payload",n.workflowId)}prettyPrintExecute(n,s,l){let w=l?Re.ERROR:Re.SUCCESS,C={execute:"Executed",preview:"Previewed"}[n.action],K=l?"Failed to execute":C,ie=l?we.error:we.success,Se=`${w} ${K} 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(w,M)=>{let C=await w,K=this.previewProvider.bind(this),ie=this.executeProvider.bind(this),Ie=await(n.action==="preview"?K:ie)(n,s,M,l);return{...C,[M.type]:Ie}},Promise.resolve({}))}previewProvider(n,s,l,w){return console.log(` ${Re.MOCK} Mocked provider: \`${l.type}\``),this.mock(l.outputs.schema)}async executeProvider(n,s,l,w){try{if(n.stepId===s.stepId){let M=await this.createStepControls(s,n),C=await l.resolve({controls:M,outputs:w}),K=await this.validate(C,l.outputs.unknownSchema,"step","output",n.workflowId,s.stepId,l.type);return console.log(` ${Re.SUCCESS} Executed provider: \`${l.type}\``),{...K,_passthrough:C._passthrough}}else return console.log(` ${Re.HYDRATED} Hydrated provider: \`${l.type}\``),{}}catch(M){throw console.log(` ${Re.ERROR} Failed to execute provider: \`${l.type}\``),new dn(l.type,n.action,M)}}async executeStep(n,s){if(n.stepId===s.stepId)try{let l=await this.createStepControls(s,n),w=await this.compileControls(l,n),M=await s.resolve(w),C=await this.validate(M,s.outputs.unknownSchema,"step","output",n.workflowId,s.stepId),K=await this.executeProviders(n,s,C);return console.log(` ${Re.SUCCESS} Executed stepId: \`${s.stepId}\``),{outputs:C,providers:K}}catch(l){throw console.log(` ${Re.ERROR} Failed to execute stepId: \`${s.stepId}\``),lt(l)?l:new Ct(s.stepId,n.action,l)}else try{let l=this.getStepState(n,s.stepId);if(l){let w=await this.validate(l.outputs,s.results.unknownSchema,"step","result",n.workflowId,s.stepId);return console.log(` ${Re.HYDRATED} Hydrated stepId: \`${s.stepId}\``),{outputs:w,providers:await this.executeProviders(n,s,w)}}else throw new Qt(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 w=this.templateEngine.parse(l),M=this.getWorkflow(s.workflowId),C={workflow:{workflowId:M.workflowId,name:M.name,description:M.description,tags:M.tags,severity:M.severity},payload:s.payload,subscriber:s.subscriber,context:s.context,steps:ra(s.state)},K=await this.templateEngine.render(w,C),ie=this.postprocessTranslationMarkers(K),Se=(0,Gr.jsonrepair)(ie);return JSON.parse(Se)}catch(l){throw new rn(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 Ct(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={},w=this.getStepState(n,s.stepId),M=this.mock(s.results.schema);return{outputs:di(M,(w==null?void 0:w.outputs)||{}),providers:await this.executeProviders(n,s,l)}}async previewRequiredStep(n,s){let l=await this.createStepControls(n,s),w=await this.compileControls(l,s),M=await n.resolve(w),C=await this.validate(M,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 Mt(n);return l}};function ra(f){let n={};for(let s of f)n[s.stepId]=s.outputs;return n}var St=class{constructor(n){this.handler=n.handler,this.client=n.client?n.client:new wt,this.workflows=n.workflows,this.http=Tn(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","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(),w=s.searchParams.get("action")||"health-check",M=s.searchParams.get("workflowId")||"",C=s.searchParams.get("stepId")||"",K=await n.headers("novu-signature")||"",ie={};try{l==="POST"&&(ie=await n.body())}catch{}try{w!=="health-check"&&await this.validateHmac(ie,K);let Se=this.getPostActionMap(ie,M,C,w),Ie=this.getGetActionMap(M,C);if(l==="POST")return await this.handlePostAction(w,Se);if(l==="GET")return await this.handleGetAction(w,Ie);if(l==="OPTIONS")return this.createResponse(200,{})}catch(Se){return this.handleError(Se)}return this.createError(new ln(l))}getPostActionMap(n,s,l,w){return{trigger:this.triggerAction({workflowId:s,...n}),execute:async()=>{let M=await this.client.executeWorkflow({...n,workflowId:s,stepId:l,action:w});return this.createResponse(200,M)},preview:async()=>{let M=await this.client.executeWorkflow({...n,workflowId:s,stepId:l,action:w});return this.createResponse(200,M)}}}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(Pt).includes(n)){let l=s[n];return l()}else throw new Nt(n,Pt)}async handleGetAction(n,s){if(Object.values(Kt).includes(n)){let l=s[n];return l()}else throw new Nt(n,Kt)}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 hn;if(!this.client.secretKey)throw new gn;let[l,w]=s.split(",");if(!l||!w)throw new mn;let[M,C]=l.split("="),[K,ie]=w.split("=");if(Number(M)<Date.now()-1500)throw new yn;if(!(await Nr(this.client.secretKey,`${C}.${JSON.stringify(n)}`)===ie))throw new fn}};var B={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var oa={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:oa};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 aa={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:aa};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},la={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},ca={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},pa={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:la},inlineAttachments:{type:"array",items:ca},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:pa};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},ua={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:ua};var da={type:"object",properties:{},required:[],additionalProperties:!1},Zr={output:da};var fa={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:fa};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 ha={type:"object",properties:{},required:[],additionalProperties:!1},ns={output:ha};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"]}]},ma={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/),qt=Hs,Bt={type:He.ALLOWED_TYPES},si=zs,sr=Xs,oi=Qs,Jt=Zs,ai=eo,li=to,or="[a-zA-Z][a-zA-Z0-9+-.]*",Gt=`https?://{hostname}(?:${or})+`,ci="(?:\\?([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:Gt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${Gt}${ci}`,"uri-template":Gt.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${or.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,pi=new RegExp(`\\{(${Object.keys(je).join("|")})\\}`),ui=no,di=io,fi={boolean:Qr,null:ti,array:ni,integer:ri,number:ir,object:si,string:di},_t=fi,hi=ft,mi=({refs:e,schema:t,container:r,synchronous:c,refDepthMax:u,refDepthMin:h})=>{let f={},O={},U=0,T,$;return f.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,u)-1;if(E.$ref==="#"||O[E.$ref]<0||T===E.$ref&&++U>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,u)-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=f.resolveSchema(ne,null,W);de.merge(E,typeof he.thunk=="function"?he.thunk(E):he),Array.isArray(E.allOf)&&f.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(S=>{if(ye.required&&ye.required.includes(S))return;let b=he.required&&he.required.includes(S);he.properties&&!b&&delete he.properties[S],ne&&ne.properties&&delete ne.properties[S]})}),he}}}if(Object.keys(E).forEach(Q=>{(Array.isArray(E[Q])||typeof E[Q]=="object")&&!de.isKey(Q)&&(E[Q]=f.resolveSchema(E[Q],Q,W.concat(Q)))}),W){let Q=W[W.length-1];if(Q==="properties"||Q==="items")return E}return r.wrap(E)},f},yi=mi,ar=lo,lr=co,Le=Hn(Cr(),1),fo=Le.default.binaryOptions,ho=Le.default.boolOptions,mo=Le.default.intOptions,yo=Le.default.nullOptions,go=Le.default.strOptions,wo=Le.default.Schema,So=Le.default.Alias,bo=Le.default.Collection,To=Le.default.Merge,Oo=Le.default.Node,Ao=Le.default.Pair,vo=Le.default.Scalar,gi=Le.default.YAMLMap,wi=Le.default.YAMLSeq,Rt=uo,Xe=new Jr,Oe=(e,t,r)=>(console.debug("[json-schema-faker] calling JSONSchemaFaker() is deprecated, call either .generate() or .resolve()"),r&&console.debug("[json-schema-faker] local references are only supported by calling .resolve()"),Oe.generate(e,t)),Oe.generateWithContext=(e,t)=>{let r=Tr(t,e);return ar(r,e,Xe,!0)},Oe.generate=(e,t)=>lr(Oe.generateWithContext(e,t)),Oe.generateYAML=(e,t)=>Rt(Oe.generateWithContext(e,t)),Oe.resolveWithContext=(e,t,r)=>{typeof t=="string"&&(r=t,t={}),r=r||(typeof process!="undefined"&&typeof process.cwd=="function"?process.cwd():""),r=`${r.replace(/\/+$/,"")}/`;let c=Tr(t,e),u={order:1,canRead(f){let O=f.url.replace("/:",":");return c[O]||c[O.split("/").pop()]},read(f,O){try{O(null,this.canRead(f))}catch(U){O(U)}}},{$RefParser:h}=Qn();return h.bundle(r,e,{resolve:{file:{order:100},http:{order:200},fixedRefs:u},dereference:{circular:"ignore"}}).then(f=>ar(c,f,Xe)).catch(f=>{throw new Error(`Error while resolving schema (${f.message})`)})},Oe.resolve=(e,t,r)=>Oe.resolveWithContext(e,t,r).then(lr),Oe.resolveYAML=(e,t,r)=>Oe.resolveWithContext(e,t,r).then(Rt),br(),Oe.format=rr,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),br(),Oe),Oe.locate=e=>Xe.get(e),Oe.VERSION="0.5.5",Si={...Oe},bi=Oe}}),_o=M({"src/src/main.iife.js"(e,t){var r=(Eo(),re(Se));typeof $RefParser!="undefined"&&typeof JSONPath!="undefined"&&r.setDependencies({...JSONPath,$RefParser}),typeof window!="undefined"&&(window.JSONSchemaFaker=r.default),t.exports=r.default,t.exports.JSONSchemaFaker=r.JSONSchemaFaker}});return _o()})();((p,n)=>{p.JSONSchemaFaker=n()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>On);On.random.shuffle=function(){return["[placeholder]"]};On.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function Ii(p){return On.generate(p)}var Ni=async(p,n)=>{let s=new TextEncoder,l=s.encode(p),g=s.encode(n),M=await crypto.subtle.importKey("raw",l,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await crypto.subtle.sign("HMAC",M,g);return Array.from(new Uint8Array(C)).map(K=>K.toString(16).padStart(2,"0")).join("")};var zo=require("cross-fetch");var ki=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(p){console.error(p)}return""};function Ci(p){return!!p&&typeof p=="object"&&"error"in p&&"message"in p&&"statusCode"in p}var An=(p,n)=>{if(!p)throw new un;return{post:async(s,l)=>{let g=await fetch(`${n}/v1${s}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${p}`},body:JSON.stringify(l)}),M=await g.json();if(g.ok)return M;throw Ci(M)?new dn(M.statusCode,M.error,M.message):new mt(M)},delete:async s=>(await fetch(`${n}/v1${s}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${p}`}})).json()}};var $i=require("liquidjs");function dr(p,n){let s={...p};for(let l of Object.keys(n)){let g=n[l];g&&typeof g=="object"&&!Array.isArray(g)?s[l]=dr(s[l]||{},g):(Array.isArray(g),s[l]=g)}return s}function vn(p,n){let s=n.split(".").reduce((l,g)=>{if(l&&typeof l=="object")return l[g]},p);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 Mi(p,n=2,s,l=", "){if(!Array.isArray(p)||p.length===0)return"";let g=s?p.map(K=>typeof K!="object"||!K?"":vn(K,s)):p;if(g.length===1)return g[0];if(g.length===2)return`${g[0]} and ${g[1]}`;if(g.length===3&&n>=3)return`${g[0]}, ${l}${g[1]} and ${g[2]}`;let M=g.slice(0,n),C=g.length-n;return`${M.join(l)} and ${C} ${C===1?"other":"others"}`}var Li=et(require("pluralize"),1);function Di(p,n="",s="",l="true"){if(p==null)return"";let g=0;if(Array.isArray(p)?g=p.length:typeof p=="object"?g=Object.keys(p).length:typeof p=="string"?g=+p:typeof p=="number"?g=p:g=Number(p),Number.isNaN(g)&&(g=0),g<=0)return"";let M;return s?M=g===1?n:s:M=(0,Li.default)(n,g),l==="true"?`${g} ${M}`:M}var Xo=require("liquidjs"),Ui=et(require("pluralize"),1),Qo=require("zod");var Zo="",ea=2,ta="other",na=", ",ra=" and ",ia=", and ";function Fi(p,n=Zo,s=ea,l=ta,g=na,M=ra,C=ia){if(!Array.isArray(p)||p.length===0)return"";let K=n?p.map(be=>typeof be!="object"||!be?"":vn(be,n)):p,re=K.length;if(re===1)return K[0];if(re===2)return`${K[0]}${M}${K[1]}`;if(s>=re){let be=K.slice(0,re-1),Ce=K[re-1];return`${be.join(g)}${C}${Ce}`}let Se=K.slice(0,s),Pe=re-s,ke=s===1?M:C;return`${Se.join(g)}${ke}${Pe} ${(0,Ui.default)(l,Pe)}`}function sa(p){return Array.isArray(p)||typeof p=="object"&&p!==null?ji(p):typeof p=="string"?p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):p==null?"":String(p)}var ji=(p,n=0)=>Array.isArray(p)||typeof p=="object"&&p!==null?JSON.stringify(p,null,n).replace(/"/g,"'").replace(/\n/g,"\\n"):p==null?"":String(p);function Yi(p){let n=new $i.Liquid({outputEscape:sa,...p});return n.registerFilter("json",(s,l)=>ji(s,l)),n.registerFilter("digest",Mi),n.registerFilter("toSentence",Fi),n.registerFilter("pluralize",Di),n}var pt=et(require("chalk"),1),we={info:p=>pt.default.blue(p),warning:p=>pt.default.yellow(p),error:p=>pt.default.red(p),success:p=>pt.default.green(p),underline:p=>pt.default.underline(p),bold:p=>pt.default.bold(p)},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 En(p){return p||process.env.NOVU_API_URL||"https://api.novu.co"}function _n(p){return p||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var fr=et(require("sanitize-html"),1),oa=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"];function aa(p){return p.toLowerCase().startsWith("on")}var la={allowedTags:fr.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,transformTags:{"*":(p,n)=>{let s={};for(let[l,g]of Object.entries(n))aa(l)||(s[l]=g);return{tagName:p,attribs:s}},img:(p,n)=>{let s={};for(let[l,g]of Object.entries(n))oa.includes(l.toLowerCase())&&(s[l]=g);return{tagName:p,attribs:s}}},allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},Wi=p=>{if(!p)return p;let n=/^<!DOCTYPE .*?>/,s=p.match(n),l=(0,fr.default)(p,la);return s?s[0]+l:l},Rn=p=>Object.keys(p).reduce((n,s)=>{let l=p[s];return typeof l=="string"?n[s]=Wi(l):Array.isArray(l)?n[s]=l.map(g=>typeof g=="string"?Wi(g):typeof g=="object"?Rn(g):g):typeof l=="object"&&l!==null?n[s]=Rn(l):n[s]=l,n},{});function Vi(p,n=!0){n&&(console.log(`
92
+ ${we.bold(we.underline("Discovered workflowId:"))} '${p.workflowId}'`),p.steps.forEach((s,l)=>{let g=l===p.steps.length-1;console.log(`${g?"\u2514":"\u251C"} ${Re.STEP} Discovered stepId: '${s.stepId}' Type: '${s.type}'`),s.providers.forEach((C,K)=>{let re=K===s.providers.length-1;console.log(`${g?" ":"\u2502"} ${re?"\u2514":"\u251C"} ${Re.PROVIDER} Discovered provider: '${C.type}'`)})}))}var qi=require("jsonrepair");function ca(p){let n=p.trim();return(n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]"))&&n.length>2}function pa(p){try{return JSON.parse(p),p}catch{try{return(0,qi.jsonrepair)(p)}catch{return p}}}function Bi(p){return Object.fromEntries(Object.entries(p).map(([n,s])=>typeof s=="string"?[n,ca(s)?pa(s):s]:typeof s=="object"&&s!==null&&!Array.isArray(s)?[n,Bi(s)]:[n,s]))}function Ji(p){return!(p!=null&&p.data)||typeof p.data!="object"||Array.isArray(p.data)?p:{...p,data:Bi(p.data)}}var Ki=et(require("ajv"),1),Hi=et(require("ajv-formats"),1);var Gi=p=>typeof structuredClone=="function"?structuredClone(p):JSON.parse(JSON.stringify(p));var Pn=class extends ot{constructor(s,l){let g=l.length===1?"it":"them";super(`Tried to use a ${s} in @novu/framework without ${l.join(", ")} installed. Please install ${g} by running \`npm install ${l.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var xn=async(p,n)=>{let s=new Set;if((await Promise.allSettled(p.map(g=>g.import))).forEach((g,M)=>{let C=p[M];g.status==="fulfilled"&&C.exports.every(re=>g.value[re]!==void 0)||s.add(C.name)}),s.size>0)throw new Pn(n,Array.from(s))};var In=class{constructor(){this.requiredImports=[];this.ajv=new Ki.default({useDefaults:!0,removeAdditional:"failing"}),(0,Hi.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(n){let s=n.type==="object"||!!n.anyOf||!!n.allOf||!!n.oneOf;return s&&await xn(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 g=Gi(n);return l(g)?{success:!0,data:g}:{success:!1,errors:l.errors.map(C=>({path:C.instancePath,message:C.message}))}}async transformToJsonSchema(n){return n}};var Nn=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 xn(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(g=>({path:`/${g.path.join("/")}`,message:g.message}))}}async transformToJsonSchema(n){let{zodToJsonSchema:s}=await import("zod-to-json-schema");return s(n)}};var kn=new Nn,Cn=new In,Ft=async(p,n)=>{if(await kn.canHandle(p))return kn.validate(n,p);if(await Cn.canHandle(p))return Cn.validate(n,p);throw new Error("Invalid schema")},Ne=async p=>{if(await kn.canHandle(p))return kn.transformToJsonSchema(p);if(await Cn.canHandle(p))return Cn.transformToJsonSchema(p);throw new Error("Invalid schema")};function zi(){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.10.0-alpha.0";let s=this.buildOptions(n);this.apiUrl=s.apiUrl,this.secretKey=s.secretKey,this.strictAuthentication=s.strictAuthentication,this.verbose=s.verbose,this.templateEngine=Yi()}buildOptions(n){let s={apiUrl:En(n==null?void 0:n.apiUrl),secretKey:_n(n==null?void 0:n.secretKey),strictAuthentication:!zi(),verbose:zi()};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"),(n==null?void 0:n.verbose)!==void 0&&(s.verbose=n.verbose),s}log(...n){this.verbose&&console.log(...n)}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 g=this.addWorkflow(s);this.discoverWorkflowPromises.set(s.id,g),await g}}async addWorkflow(n){try{let s=await n.discover();Vi(s,this.verbose),this.discoveredWorkflows.set(n.id,s)}finally{this.discoverWorkflowPromises.delete(n.id)}}healthCheck(){let n=this.getRegisteredWorkflows(),s=n.length,l=n.reduce((g,M)=>g+M.steps.length,0);return{status:"ok",sdkVersion:"2.10.0-alpha.0",frameworkVersion:"2024-06-26",discovered:{workflows:s,steps:l}}}getWorkflow(n){let s=this.discoveredWorkflows.get(n);if(s)return s;throw new Lt(n)}getStep(n,s){let g=this.getWorkflow(n).steps.find(M=>M.stepId===s);if(g)return g;throw new bn(s)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows()}}mock(n){return Ii(n)}async validate(n,s,l,g,M,C,K){let re=await Ft(s,n);if(re.success)return re.data;switch(l){case"event":this.throwInvalidEvent(g,M,re.errors);case"step":this.throwInvalidStep(C,g,M,re.errors);case"provider":this.throwInvalidProvider(C,K,g,M,re.errors);default:throw new Error(`Invalid component: '${l}'`)}}throwInvalidProvider(n,s,l,g,M){if(!n)throw new Error("stepId is required");if(!s)throw new Error("providerId is required");switch(l){case"output":throw new an(g,n,s,M);default:throw new Error(`Invalid payload type: '${l}'`)}}throwInvalidStep(n,s,l,g){if(!n)throw new Error("stepId is required");switch(s){case"output":throw new rn(l,n,g);case"result":throw new sn(l,n,g);case"controls":throw new nn(l,n,g);default:throw new Error(`Invalid payload type: '${s}'`)}}throwInvalidEvent(n,s,l){switch(n){case"controls":throw new tn(s,l);case"payload":throw new Nt(s,l);default:throw new Error(`Invalid payload type: '${n}'`)}}executeStepFactory(n,s,l){return async(g,M,C)=>{if(l())return;let K=this.getStep(n.workflowId,g),re=n.action==="preview";if(!re&&g===n.stepId){let Ce=await this.createStepControls(K,n),Fe=await this.compileControls(Ce,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),Pe=this.executeStep.bind(this),be=await(re?Se:Pe)(n,{...K,providers:K.providers.map(Ce=>{var rt;let Fe=(rt=C==null?void 0:C.providers)==null?void 0:rt[Ce.type];if(!Fe)throw new fn(Ce.type);return{...Ce,resolve:Fe}}),resolve:M});return this.shouldSanitize({stepType:K.type,options:C})&&(be={...be,outputs:Rn(be.outputs)}),g===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 g=`${{execute:"Executing",preview:"Previewing"}[n.action]} workflowId:`;this.log(`
93
+ ${we.bold(we.underline(g))} '${n.workflowId}'`);let M=this.getWorkflow(n.workflowId),C=process.hrtime(),K={outputs:{},providers:{},options:{skip:!1}},re,Se=!1,Pe=new Promise(Ke=>{re=Ke}),ke=Ke=>{if(Se)throw new Error("setResult can only be called once per workflow execution");re(),Se=!0,K=Ke},be=()=>Se,Ce;try{if(n.action==="execute"&&!n.payload)throw new Nt(n.workflowId,{message:"Event `payload` is required"});let Ke=await this.createExecutionPayload(n,M),qe={...n,payload:Ke};await Promise.race([Pe,M.execute({payload:Ke,environment:{},controls:{},subscriber:n.subscriber,context:n.context,step:{email:this.executeStepFactory(qe,ke,be),sms:this.executeStepFactory(qe,ke,be),inApp:this.executeStepFactory(qe,ke,be),digest:this.executeStepFactory(qe,ke,be),delay:this.executeStepFactory(qe,ke,be),push:this.executeStepFactory(qe,ke,be),chat:this.executeStepFactory(qe,ke,be),custom:this.executeStepFactory(qe,ke,be),throttle:this.executeStepFactory(qe,ke,be)}})])}catch(Ke){Ce=Ke}let Fe=process.hrtime(C),rt=Fe[0],Ge=Fe[1],$t=rt*1e3+Ge/1e6,Yn=Ce?Re.ERROR:Re.SUCCESS,jt={execute:"Executed",preview:"Previewed"}[n.action];if(this.log(`${Yn} ${jt} workflowId: \`${n.workflowId}\``),this.prettyPrintExecute(n,$t,Ce),Ce)throw Ce;return{outputs:K.outputs,providers:K.providers,options:K.options,metadata:{status:"success",error:!1,duration:$t}}}async createExecutionPayload(n,s){let{payload:l}=n;if(n.action==="preview"){let M=this.mock(s.payload.schema);l=Object.assign(M,l)}return await this.validate(l,s.payload.unknownSchema,"event","payload",n.workflowId)}prettyPrintExecute(n,s,l){if(!this.verbose)return;let g=l?Re.ERROR:Re.SUCCESS,C={execute:"Executed",preview:"Previewed"}[n.action],K=l?"Failed to execute":C,re=l?we.error:we.success,Se=`${g} ${K} workflowId: '${n.workflowId}`;console.log(`
94
+ ${we.bold(re(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'
95
+ `)}async executeProviders(n,s,l){return s.providers.reduce(async(g,M)=>{let C=await g,K=this.previewProvider.bind(this),re=this.executeProvider.bind(this),Pe=await(n.action==="preview"?K:re)(n,s,M,l);return{...C,[M.type]:Pe}},Promise.resolve({}))}previewProvider(n,s,l,g){return this.log(` ${Re.MOCK} Mocked provider: \`${l.type}\``),this.mock(l.outputs.schema)}async executeProvider(n,s,l,g){try{if(n.stepId===s.stepId){let M=await this.createStepControls(s,n),C=await l.resolve({controls:M,outputs:g}),K=await this.validate(C,l.outputs.unknownSchema,"step","output",n.workflowId,s.stepId,l.type);return this.log(` ${Re.SUCCESS} Executed provider: \`${l.type}\``),{...K,_passthrough:C._passthrough}}else return this.log(` ${Re.HYDRATED} Hydrated provider: \`${l.type}\``),{}}catch(M){throw this.log(` ${Re.ERROR} Failed to execute provider: \`${l.type}\``),new hn(l.type,n.action,M)}}async executeStep(n,s){if(n.stepId===s.stepId)try{let l=await this.createStepControls(s,n),g=await this.compileControls(l,n),M=await s.resolve(g),C=await this.validate(M,s.outputs.unknownSchema,"step","output",n.workflowId,s.stepId),K=await this.executeProviders(n,s,C);return this.log(` ${Re.SUCCESS} Executed stepId: \`${s.stepId}\``),{outputs:C,providers:K}}catch(l){throw this.log(` ${Re.ERROR} Failed to execute stepId: \`${s.stepId}\``),lt(l)?l:new Mt(s.stepId,n.action,l)}else try{let l=this.getStepState(n,s.stepId);if(l){let g=await this.validate(l.outputs,s.results.unknownSchema,"step","result",n.workflowId,s.stepId);return this.log(` ${Re.HYDRATED} Hydrated stepId: \`${s.stepId}\``),{outputs:g,providers:await this.executeProviders(n,s,g)}}else throw new en(n.workflowId,s.stepId)}catch(l){throw this.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 g=this.templateEngine.parse(l),M=this.getWorkflow(s.workflowId),C={workflow:{workflowId:M.workflowId,name:M.name,description:M.description,tags:M.tags,severity:M.severity},payload:s.payload,subscriber:s.subscriber,context:s.context,steps:ua(s.state)},K=await this.templateEngine.render(g,C),re=this.postprocessTranslationMarkers(K),Se=(0,Xi.jsonrepair)(re),Pe=JSON.parse(Se);return Ji(Pe)}catch(l){throw new on(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 this.log(` ${Re.ERROR} Failed to preview stepId: \`${s.stepId}\``),lt(l)?l:new Mt(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={},g=this.getStepState(n,s.stepId),M=this.mock(s.results.schema);return{outputs:dr(M,(g==null?void 0:g.outputs)||{}),providers:await this.executeProviders(n,s,l)}}async previewRequiredStep(n,s){let l=await this.createStepControls(n,s),g=await this.compileControls(l,s),M=await n.resolve(g),C=await this.validate(M,n.outputs.unknownSchema,"step","output",s.workflowId,n.stepId);return this.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 Lt(n);return l}};function ua(p){let n={};for(let s of p)n[s.stepId]=s.outputs;return n}var St=class{constructor(n){this.handler=n.handler,this.client=n.client?n.client:new wt,this.workflows=n.workflows,this.http=An(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-private-network":"true","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.10.0-alpha.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(),l=await n.method(),g=s.searchParams.get("action")||"health-check",M=s.searchParams.get("workflowId")||"",C=s.searchParams.get("stepId")||"",K=await n.headers("novu-signature")||"",re={};try{l==="POST"&&(re=await n.body())}catch{}try{g!=="health-check"&&await this.validateHmac(re,K);let Se=this.getPostActionMap(re,M,C,g),Pe=this.getGetActionMap(M,C);if(l==="POST")return await this.handlePostAction(g,Se);if(l==="GET")return await this.handleGetAction(g,Pe);if(l==="OPTIONS")return this.createResponse(200,{})}catch(Se){return this.handleError(Se)}return this.createError(new pn(l))}getPostActionMap(n,s,l,g){return{trigger:this.triggerAction({workflowId:s,...n}),execute:async()=>{let M=await this.client.executeWorkflow({...n,workflowId:s,stepId:l,action:g});return this.createResponse(200,M)},preview:async()=>{let M=await this.client.executeWorkflow({...n,workflowId:s,stepId:l,action:g});return this.createResponse(200,M)}}}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(xt).includes(n)){let l=s[n];return l()}else throw new kt(n,xt)}async handleGetAction(n,s){if(Object.values(zt).includes(n)){let l=s[n];return l()}else throw new kt(n,zt)}handleError(n){if(lt(n))return n.statusCode>=500&&console.error(n),this.createError(n);if(Oi(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 yn;if(!this.client.secretKey)throw new Sn;let[l,g]=s.split(",");if(!l||!g)throw new gn;let[M,C]=l.split("="),[K,re]=g.split("=");if(Number(M)<Date.now()-1500)throw new wn;if(!(await Ni(this.client.secretKey,`${C}.${JSON.stringify(n)}`)===re))throw new mn}};var B={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var fa={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},Qi={output:fa};var Zi={"chat-webhook":B,discord:B,getstream:B,"grafana-on-call":B,mattermost:B,msteams:B,"rocket-chat":B,ryver:B,slack:Qi,"whatsapp-business":B,zulip:B};var ha={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},es={output:ha};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},ma={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},ya={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},ga={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:ma},inlineAttachments:{type:"array",items:ya},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},ts={output:ga};var Be={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},Mn={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},wa={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"},Mn]},html:{anyOf:[{type:"string"},Mn]},watchHtml:{anyOf:[{type:"string"},Mn]},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"},Mn]}}}]},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},ns={output:wa};var Sa={type:"object",properties:{},required:[],additionalProperties:!1},rs={output:Sa};var ba={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},is={output:ba};var ss={braze:B,clickatell:B,nodemailer:ns,emailjs:B,"email-webhook":B,"infobip-email":B,mailersend:B,mailgun:es,mailjet:ts,mailtrap:B,mandrill:B,netcore:B,"novu-email":rs,outlook365:B,plunk:B,postmark:B,resend:B,sendgrid:is,sendinblue:B,ses:B,sparkpost:B};var Ta={type:"object",properties:{},required:[],additionalProperties:!1},os={output:Ta};var as={novu:os};var ls={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},Oa={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
96
 
98
97
  10 - The push notification is sent to the device immediately. (Default)
99
98
  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
99
 
101
100
  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
101
 
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:ma};var ya={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:ya};var ga={type:"object",properties:{to:{description:`This parameter specifies the recipient of a message.
102
+ 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:ls,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:ls,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},cs={output:Oa};var Aa={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},ps={output:Aa};var va={type:"object",properties:{to:{description:`This parameter specifies the recipient of a message.
104
103
  The value must be a registration token, notification key, or topic. Do not set this field when sending to multiple topics. See **condition**.
105
104
  `,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
105
  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 +135,7 @@ If set, and a notification with the same tag is already being shown, the new not
136
135
  `,type:"string"},titleLocArgs:{description:`Indicates the string value to replace format specifiers in the title string for localization.
137
136
  * iOS: Corresponds to "title-loc-args" in the APNs payload.
138
137
  * android: See [Formatting strings](https://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling).
139
- `,type:"string"}}}},required:[],additionalProperties:!0},as={output:ga};var wa={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.
138
+ `,type:"string"}}}},required:[],additionalProperties:!0},us={output:va};var Ea={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
139
  Example: ["Active Users", "Inactive Users"]
141
140
  `,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
141
  Example: ["Active Users", "Inactive Users"]
@@ -503,4 +502,4 @@ Examples: All examples are the exact same date & time.
503
502
  "Sept 24 2015 14:00:00 GMT-0700"
504
503
  "Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)"
505
504
  Note: SMS currently only supports sendAfter parameter.
506
- `,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},ls={output:wa};var cs={apns:ss,expo:os,fcm:as,"one-signal":ls,"pusher-beams":B,pushpad:B,"push-webhook":B,appio:B};var Sa={type:"object",properties:{},required:[],additionalProperties:!1},ps={output:Sa};var ba={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:ba};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 Ta={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},Oa={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Aa={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},va={oneOf:[Ta,Oa,Aa]},Ea={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Ln={output:va,result:Ea};var _a={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},Ra={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Pa={oneOf:[_a,Ra]},xa={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:Pa,result:xa};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 Ia={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Na={type:"object",properties:{},required:[],additionalProperties:!1},fs={output:Ia,result:Na};var ka={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Ca={type:"object",properties:{},required:[],additionalProperties:!1},hs={output:ka,result:Ca};var Ma="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",ys={type:"object",properties:{url:{type:"string",pattern:Ma},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},La={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},Da={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:La,result:Da};var Ua={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Fa={type:"object",properties:{},required:[],additionalProperties:!1},ws={output:Ua,result:Fa};var $a={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},ja={type:"object",properties:{},required:[],additionalProperties:!1},Ss={output:$a,result:ja};var Je={chat:fs,sms:Ss,push:ws,email:hs,in_app:gs};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};var Fn=(w=>(w.NONE="none",w.LOW="low",w.MEDIUM="medium",w.HIGH="high",w))(Fn||{});async function bt(f,n,s){if(f.steps.some(l=>l.stepId===n))throw new Sn(n);f.steps.push(s)}async function $n(f,n,s,l){return async(w,M,C={})=>{let K=(C==null?void 0:C.controlSchema)||Ve;return await bt(f,w,{stepId:w,type:n,controls:{schema:await Me(K),unknownSchema:K},outputs:{schema:await Me(s),unknownSchema:s},results:{schema:await Me(l),unknownSchema:l},resolve:M,code:M.toString(),options:C,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function bs(f,n,s){let l=Mn[n],w=Object.entries(s).map(async([M,C])=>{let K=l[M];return{type:M,code:C.toString(),resolve:C,outputs:{schema:await Me(K.output),unknownSchema:K.output}}});f.providers.push(...await Promise.all(w))}async function Tt(f,n,s,l){return async(w,M,C={})=>{let K=(C==null?void 0:C.controlSchema)||Ve,ie={stepId:w,type:n,controls:{schema:await Me(K),unknownSchema:K},outputs:{schema:await Me(s),unknownSchema:s},results:{schema:await Me(l),unknownSchema:l},resolve:M,code:M.toString(),options:C,providers:[]};return await bt(f,w,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,w={})=>{let M=(w==null?void 0:w.controlSchema)||Ve,C=(w==null?void 0:w.outputSchema)||Ve,[K,ie]=await Promise.all([Me(M),Me(C)]);return await bt(f,s,{stepId:s,type:n,controls:{schema:K,unknownSchema:M},outputs:{schema:ie,unknownSchema:C},results:{schema:ie,unknownSchema:C},resolve:l,code:l.toString(),options:w,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var Ya={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 w=Ya[s];w&&(n.channels||(n.channels={}),n.channels[w]=l)}),n}function As(f,n,s){let l=s||{};return{id:f,trigger:async C=>{let K=Tn(vn(C.secretKey),An(C.apiUrl)),ie=C.payload||{},Se;if(l.payloadSchema){let Fe=await kn(l.payloadSchema,ie);if(Fe.success===!1)throw new on(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 K.post("/events/trigger",Ne);return{cancel:async()=>K.delete(`/events/trigger/${be.transactionId}`),data:be}},discover:async()=>{var K;let C={workflowId:f,severity:(K=l.severity)!=null?K:"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 Tt(C,"push",Je.push.output,Je.push.result),chat:await Tt(C,"chat",Je.chat.output,Je.chat.result),email:await Tt(C,"email",Je.email.output,Je.email.result),sms:await Tt(C,"sms",Je.sms.output,Je.sms.result),inApp:await Tt(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}}}var vs="lambda",Wa=f=>new St({frameworkName:vs,...f,handler:s=>{let l=(w=>w.version==="2.0")(s);return{url:()=>{let w=l?s.requestContext.http.path:s.path,M=s.headers["x-forwarded-proto"]||"https",C=new URL(w,`${M}://${s.headers.host||s.headers.Host||""}`);for(let K in s.queryStringParameters)K&&C.searchParams.set(K,s.queryStringParameters[K]);return C},body:()=>{let w="{}";return s.body&&(w=s.isBase64Encoded?Buffer.from(s.body,"base64").toString():s.body),JSON.parse(w)},headers:w=>s.headers[w],queryString:w=>{var M;return(M=s.queryStringParameters)==null?void 0:M[w]},transformResponse:({body:w,status:M,headers:C})=>Promise.resolve({body:w,statusCode:M,headers:C}),method:()=>l?s.requestContext.http.method:s.httpMethod}}}).createHandler();0&&(module.exports={Client,CronExpression,NovuRequestHandler,SeverityLevelEnum,frameworkName,providerSchemas,serve,workflow});
505
+ `,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},ds={output:Ea};var fs={apns:cs,expo:ps,fcm:us,"one-signal":ds,"pusher-beams":B,pushpad:B,"push-webhook":B,appio:B};var _a={type:"object",properties:{},required:[],additionalProperties:!1},hs={output:_a};var Ra={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},ms={output:Ra};var ys={"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":hs,plivo:B,"ring-central":B,sendchamp:B,simpletexting:B,sms77:B,"sms-central":B,smsmode:B,sns:B,telnyx:B,termii:B,twilio:ms,"afro-message":B,unifonic:B,imedia:B,sinch:B,"isendpro-sms":B};var Ln={chat:Zi,sms:ys,email:ss,push:fs,in_app:as};var Pa={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},xa={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Ia={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},Na={oneOf:[Pa,xa,Ia]},ka={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Dn={output:Na,result:ka};var Ca={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},Ma={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},La={oneOf:[Ca,Ma]},Da={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},Un={output:La,result:Da};var Fn={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 Ua={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Fa={type:"object",properties:{},required:[],additionalProperties:!1},gs={output:Ua,result:Fa};var $a={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string"},from:{type:"object",properties:{email:{type:"string"},name:{type:"string"}},additionalProperties:!1}},required:["subject","body"],additionalProperties:!1},ja={type:"object",properties:{},required:[],additionalProperties:!1},ws={output:$a,result:ja};var Ya="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",bs={type:"object",properties:{url:{type:"string",pattern:Ya},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},Ss={type:"object",properties:{label:{type:"string"},redirect:bs},required:["label"],additionalProperties:!1},Wa={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:Ss,secondaryAction:Ss,data:{type:"object",additionalProperties:!0},redirect:bs},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},Va={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},Ts={output:Wa,result:Va};var qa={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Ba={type:"object",properties:{},required:[],additionalProperties:!1},Os={output:qa,result:Ba};var Ja={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Ga={type:"object",properties:{},required:[],additionalProperties:!1},As={output:Ja,result:Ga};var Je={chat:gs,sms:As,push:Os,email:ws,in_app:Ts};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};var $n=(g=>(g.NONE="none",g.LOW="low",g.MEDIUM="medium",g.HIGH="high",g))($n||{});async function bt(p,n,s){if(p.steps.some(l=>l.stepId===n))throw new Tn(n);p.steps.push(s)}async function jn(p,n,s,l){return async(g,M,C={})=>{let K=(C==null?void 0:C.controlSchema)||Ve;return await bt(p,g,{stepId:g,type:n,controls:{schema:await Ne(K),unknownSchema:K},outputs:{schema:await Ne(s),unknownSchema:s},results:{schema:await Ne(l),unknownSchema:l},resolve:M,code:M.toString(),options:C,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function vs(p,n,s){let l=Ln[n],g=Object.entries(s).map(async([M,C])=>{let K=l[M];return{type:M,code:C.toString(),resolve:C,outputs:{schema:await Ne(K.output),unknownSchema:K.output}}});p.providers.push(...await Promise.all(g))}async function Tt(p,n,s,l){return async(g,M,C={})=>{let K=(C==null?void 0:C.controlSchema)||Ve,re={stepId:g,type:n,controls:{schema:await Ne(K),unknownSchema:K},outputs:{schema:await Ne(s),unknownSchema:s},results:{schema:await Ne(l),unknownSchema:l},resolve:M,code:M.toString(),options:C,providers:[]};return await bt(p,g,re),Object.keys(C.providers||{}).length>0&&await vs(re,n,C.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function Es(p,n){return async(s,l,g={})=>{let M=(g==null?void 0:g.controlSchema)||Ve,C=(g==null?void 0:g.outputSchema)||Ve,[K,re]=await Promise.all([Ne(M),Ne(C)]);return await bt(p,s,{stepId:s,type:n,controls:{schema:K,unknownSchema:M},outputs:{schema:re,unknownSchema:C},results:{schema:re,unknownSchema:C},resolve:l,code:l.toString(),options:g,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var Ka={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat"};function _s(p){if(!p)return{};let n={};return p.all&&(n.all=p.all),Object.entries(p.channels||{}).forEach(([s,l])=>{let g=Ka[s];g&&(n.channels||(n.channels={}),n.channels[g]=l)}),n}function Rs(p,n,s){let l=s||{};return{id:p,trigger:async C=>{let K=An(_n(C.secretKey),En(C.apiUrl)),re=C.payload||{},Se;if(l.payloadSchema){let Fe=await Ft(l.payloadSchema,re);if(Fe.success===!1)throw new ln(p,Fe.errors);Se=Fe.data}else Se=C.payload;let Pe=await ki(),ke={name:p,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},...Pe&&{bridgeUrl:Pe}},be=await K.post("/events/trigger",ke);return{cancel:async()=>K.delete(`/events/trigger/${be.transactionId}`),data:be}},discover:async()=>{var K;let C={workflowId:p,severity:(K=l.severity)!=null?K:"none",steps:[],code:n.toString(),payload:{schema:await Ne(l.payloadSchema||Ve),unknownSchema:l.payloadSchema||Ve},controls:{schema:await Ne(l.controlSchema||Ve),unknownSchema:l.controlSchema||Ve},tags:l.tags||[],preferences:_s(l.preferences),name:l.name,description:l.description,execute:n};return await n({payload:{},subscriber:{},environment:{},controls:{},context:{},step:{push:await Tt(C,"push",Je.push.output,Je.push.result),chat:await Tt(C,"chat",Je.chat.output,Je.chat.result),email:await Tt(C,"email",Je.email.output,Je.email.result),sms:await Tt(C,"sms",Je.sms.output,Je.sms.result),inApp:await Tt(C,"in_app",Je.in_app.output,Je.in_app.result),digest:await jn(C,"digest",Un.output,Un.result),delay:await jn(C,"delay",Dn.output,Dn.result),throttle:await jn(C,"throttle",Fn.output,Fn.result),custom:await Es(C,"custom")}}),C}}}function Ha(p,n,s){return{type:"email",stepId:p,resolve:n,controlSchema:s==null?void 0:s.controlSchema}}var Ps={email:Ha};var xs="lambda",za=p=>new St({frameworkName:xs,...p,handler:s=>{let l=(g=>g.version==="2.0")(s);return{url:()=>{let g=l?s.requestContext.http.path:s.path,M=s.headers["x-forwarded-proto"]||"https",C=new URL(g,`${M}://${s.headers.host||s.headers.Host||""}`);for(let K in s.queryStringParameters)K&&C.searchParams.set(K,s.queryStringParameters[K]);return C},body:()=>{let g="{}";return s.body&&(g=s.isBase64Encoded?Buffer.from(s.body,"base64").toString():s.body),JSON.parse(g)},headers:g=>s.headers[g],queryString:g=>{var M;return(M=s.queryStringParameters)==null?void 0:M[g]},transformResponse:({body:g,status:M,headers:C})=>Promise.resolve({body:g,statusCode:M,headers:C}),method:()=>l?s.requestContext.http.method:s.httpMethod}}}).createHandler();0&&(module.exports={Client,CronExpression,NovuRequestHandler,SeverityLevelEnum,frameworkName,providerSchemas,serve,step,workflow});