@novu/framework 2.13.2 → 2.14.0-rc.5ea799b171

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 (86) hide show
  1. package/dist/cjs/{agent.types-crcJBtCy.d.cts → agent.types-ButmIWLf.d.cts} +260 -22
  2. package/dist/cjs/ai-sdk/index.cjs +2 -2
  3. package/dist/cjs/ai-sdk/index.d.cts +4 -2
  4. package/dist/cjs/cards.cjs +60 -52
  5. package/dist/cjs/cards.d.cts +1 -1
  6. package/dist/cjs/{health-check.types-C2XZ-Tpt.d.cts → health-check.types-w3F_4NHh.d.cts} +2 -2
  7. package/dist/cjs/{index-DVSB455a.d.cts → index-tLP27-lJ.d.cts} +3 -3
  8. package/dist/cjs/index.cjs +134 -126
  9. package/dist/cjs/index.d.cts +5 -5
  10. package/dist/cjs/internal/index.cjs +52 -44
  11. package/dist/cjs/internal/index.d.cts +163 -36
  12. package/dist/cjs/jsx-dev-runtime.cjs +1 -1
  13. package/dist/cjs/jsx-runtime.cjs +1 -1
  14. package/dist/cjs/langchain/index.cjs +2 -2
  15. package/dist/cjs/langchain/index.d.cts +4 -2
  16. package/dist/cjs/servers/express.cjs +138 -130
  17. package/dist/cjs/servers/express.d.cts +6 -6
  18. package/dist/cjs/servers/h3.cjs +137 -129
  19. package/dist/cjs/servers/h3.d.cts +6 -6
  20. package/dist/cjs/servers/hono.cjs +138 -130
  21. package/dist/cjs/servers/hono.d.cts +6 -6
  22. package/dist/cjs/servers/lambda.cjs +138 -130
  23. package/dist/cjs/servers/lambda.d.cts +6 -6
  24. package/dist/cjs/servers/nest.cjs +131 -123
  25. package/dist/cjs/servers/nest.d.cts +8 -8
  26. package/dist/cjs/servers/next.cjs +137 -129
  27. package/dist/cjs/servers/next.d.cts +6 -6
  28. package/dist/cjs/servers/nuxt.cjs +137 -129
  29. package/dist/cjs/servers/nuxt.d.cts +6 -6
  30. package/dist/cjs/servers/remix.cjs +138 -130
  31. package/dist/cjs/servers/remix.d.cts +6 -6
  32. package/dist/cjs/servers/sveltekit.cjs +138 -130
  33. package/dist/cjs/servers/sveltekit.d.cts +6 -6
  34. package/dist/cjs/step-resolver.cjs +4 -4
  35. package/dist/cjs/step-resolver.d.cts +2 -2
  36. package/dist/cjs/{subscriber.types-BanvmGul.d.cts → subscriber.types-PYzkmyuf.d.cts} +248 -0
  37. package/dist/esm/{agent.types-DFLG1_vb.d.ts → agent.types-C9T8i5SY.d.ts} +260 -22
  38. package/dist/esm/ai-sdk/index.d.ts +4 -2
  39. package/dist/esm/ai-sdk/index.js +1 -1
  40. package/dist/esm/cards.d.ts +1 -1
  41. package/dist/esm/cards.js +1 -1
  42. package/dist/esm/chunk-2ANSU3EI.js +1 -0
  43. package/dist/esm/chunk-5DVHK5DS.js +1 -0
  44. package/dist/esm/{chunk-IREH6K2M.js → chunk-E54LXWY3.js} +4 -4
  45. package/dist/esm/chunk-H3BQFYPR.js +0 -0
  46. package/dist/esm/{chunk-RBTQQ5IZ.js → chunk-ICOHH7TO.js} +23 -15
  47. package/dist/esm/chunk-IHERFGZC.js +36 -0
  48. package/dist/esm/chunk-JWRKOFAS.js +98 -0
  49. package/dist/esm/{health-check.types-DORn4djx.d.ts → health-check.types-Dp-fsCai.d.ts} +2 -2
  50. package/dist/esm/{index-BvRGmHFw.d.ts → index-DBKGOU-x.d.ts} +3 -3
  51. package/dist/esm/index.d.ts +5 -5
  52. package/dist/esm/index.js +1 -1
  53. package/dist/esm/internal/index.d.ts +154 -27
  54. package/dist/esm/internal/index.js +1 -1
  55. package/dist/esm/jsx-dev-runtime.js +1 -1
  56. package/dist/esm/{jsx-runtime-5ZWEWA4A.js → jsx-runtime-MFTS7BPV.js} +1 -1
  57. package/dist/esm/jsx-runtime.js +1 -1
  58. package/dist/esm/langchain/index.d.ts +4 -2
  59. package/dist/esm/langchain/index.js +1 -1
  60. package/dist/esm/servers/express.d.ts +6 -6
  61. package/dist/esm/servers/express.js +1 -1
  62. package/dist/esm/servers/h3.d.ts +6 -6
  63. package/dist/esm/servers/h3.js +1 -1
  64. package/dist/esm/servers/hono.d.ts +6 -6
  65. package/dist/esm/servers/hono.js +1 -1
  66. package/dist/esm/servers/lambda.d.ts +6 -6
  67. package/dist/esm/servers/lambda.js +1 -1
  68. package/dist/esm/servers/nest.d.ts +8 -8
  69. package/dist/esm/servers/nest.js +1 -1
  70. package/dist/esm/servers/next.d.ts +6 -6
  71. package/dist/esm/servers/next.js +1 -1
  72. package/dist/esm/servers/nuxt.d.ts +6 -6
  73. package/dist/esm/servers/nuxt.js +1 -1
  74. package/dist/esm/servers/remix.d.ts +6 -6
  75. package/dist/esm/servers/remix.js +1 -1
  76. package/dist/esm/servers/sveltekit.d.ts +6 -6
  77. package/dist/esm/servers/sveltekit.js +1 -1
  78. package/dist/esm/step-resolver.d.ts +2 -2
  79. package/dist/esm/step-resolver.js +1 -1
  80. package/dist/esm/{subscriber.types-Drf26WPA.d.ts → subscriber.types-UA_2pkYJ.d.ts} +248 -0
  81. package/package.json +2 -2
  82. package/dist/esm/chunk-4ETX7FIT.js +0 -1
  83. package/dist/esm/chunk-JLKEQIWC.js +0 -98
  84. package/dist/esm/chunk-PU74XQ2P.js +0 -1
  85. package/dist/esm/chunk-X5AZIKIR.js +0 -36
  86. /package/dist/esm/{chunk-7C3QBYLB.js → chunk-FOODV6YZ.js} +0 -0
@@ -1,164 +1,172 @@
1
- "use strict";var Mg=Object.create;var Tr=Object.defineProperty;var Ng=Object.getOwnPropertyDescriptor;var Lg=Object.getOwnPropertyNames;var Dg=Object.getPrototypeOf,Fg=Object.prototype.hasOwnProperty;var Ug=(e,t,n)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var $g=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},$a=(e,t)=>{for(var n in t)Tr(e,n,{get:t[n],enumerable:!0})},Yc=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Lg(t))!Fg.call(e,i)&&i!==n&&Tr(e,i,{get:()=>t[i],enumerable:!(r=Ng(t,i))||r.enumerable});return e};var jt=(e,t,n)=>(n=e!=null?Mg(Dg(e)):{},Yc(t||!e||!e.__esModule?Tr(n,"default",{value:e,enumerable:!0}):n,e)),qg=e=>Yc(Tr({},"__esModule",{value:!0}),e);var ke=(e,t,n)=>Ug(e,typeof t!="symbol"?t+"":t,n);function dn(e,t){let n=t||Vg,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return iu(e,r,i)}function iu(e,t,n){if(Hg(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ru(e.children,t,n)}return Array.isArray(e)?ru(e,t,n):""}function ru(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=iu(e[i],t,n);return r.join("")}function Hg(e){return!!(e&&typeof e=="object")}var Vg,ou=M(()=>{"use strict";Vg={}});var Cr=M(()=>{"use strict";ou()});function za(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var au=M(()=>{"use strict"});function Dn(e){return e!==null&&(e<32||e===127)}function le(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function Se(e){return e===-2||e===-1||e===32}function vn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}var ht,ft,su,Ir,lu,cu,Fn,Qt,Be=M(()=>{"use strict";ht=vn(/[A-Za-z]/),ft=vn(/[\dA-Za-z]/),su=vn(/[#-'*+\--9=?A-Z^-~]/);Ir=vn(/\d/),lu=vn(/[\dA-Fa-f]/),cu=vn(/[!-/:-@[-`{-~]/);Fn=vn(/\p{P}|\p{S}/u),Qt=vn(/\s/)});function Va(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var uu=M(()=>{"use strict"});function Wg(e){let t=[],n=-1;for(;++n<e.length;)t[n]=An(e[n]);return Hi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Yg(e){let t=e;return Hi(n);function n(r){let i=r,o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Jg(e){return Hi(t);function t(n){return n&&n.type===e}}function Hi(e){return t;function t(n,r,i){return!!(Kg(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Gg(){return!0}function Kg(e){return e!==null&&typeof e=="object"&&"type"in e}var An,pu=M(()=>{"use strict";An=(function(e){if(e==null)return Gg;if(typeof e=="function")return Hi(e);if(typeof e=="object")return Array.isArray(e)?Wg(e):Yg(e);if(typeof e=="string")return Jg(e);throw new Error("Expected function, string, or object as test")})});var Wi=M(()=>{"use strict";pu()});function du(e){return"\x1B[33m"+e+"\x1B[39m"}var hu=M(()=>{"use strict"});function Pr(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;let o=An(i),a=r?-1:1;s(e,void 0,[])();function s(u,p,d){let h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){let y=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+du(u.type+(y?"<"+y+">":""))+")"})}return g;function g(){let y=fu,P,ee,Z;if((!t||o(u,p,d[d.length-1]||void 0))&&(y=Xg(n(u,d)),y[0]===Un))return y;if("children"in u&&u.children){let B=u;if(B.children&&y[0]!==Ji)for(ee=(r?B.children.length:-1)+a,Z=d.concat(B);ee>-1&&ee<B.children.length;){let ue=B.children[ee];if(P=s(ue,ee,Z)(),P[0]===Un)return P;ee=typeof P[1]=="number"?P[1]:ee+a}}return y}}}function Xg(e){return Array.isArray(e)?e:typeof e=="number"?[Yi,e]:e==null?fu:[e]}var fu,Yi,Un,Ji,mu=M(()=>{"use strict";Wi();hu();fu=[],Yi=!0,Un=!1,Ji="skip"});var Gi=M(()=>{"use strict";mu()});function Ha(e,t,n){let i=An((n||{}).ignore||[]),o=Qg(t),a=-1;for(;++a<o.length;)Pr(e,"text",s);function s(p,d){let h=-1,g;for(;++h<d.length;){let y=d[h],P=g?g.children:void 0;if(i(y,P?P.indexOf(y):void 0,g))return;g=y}if(g)return u(p,d)}function u(p,d){let h=d[d.length-1],g=o[a][0],y=o[a][1],P=0,Z=h.children.indexOf(p),B=!1,ue=[];g.lastIndex=0;let ne=g.exec(p.value);for(;ne;){let ve=ne.index,Oe={index:ne.index,input:ne.input,stack:[...d,p]},$=y(...ne,Oe);if(typeof $=="string"&&($=$.length>0?{type:"text",value:$}:void 0),$===!1?g.lastIndex=ve+1:(P!==ve&&ue.push({type:"text",value:p.value.slice(P,ve)}),Array.isArray($)?ue.push(...$):$&&ue.push($),P=ve+ne[0].length,B=!0),!g.global)break;ne=g.exec(p.value)}return B?(P<p.value.length&&ue.push({type:"text",value:p.value.slice(P)}),h.children.splice(Z,1,...ue)):ue=[p],Z+ue.length}}function Qg(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let i=n[r];t.push([Zg(i[0]),ey(i[1])])}return t}function Zg(e){return typeof e=="string"?new RegExp(Va(e),"g"):e}function ey(e){return typeof e=="function"?e:function(){return e}}var gu=M(()=>{"use strict";uu();Gi();Wi()});var yu=M(()=>{"use strict";gu()});function Ga(){return{transforms:[ay],enter:{literalAutolink:ty,literalAutolinkEmail:Ja,literalAutolinkHttp:Ja,literalAutolinkWww:Ja},exit:{literalAutolink:oy,literalAutolinkEmail:iy,literalAutolinkHttp:ny,literalAutolinkWww:ry}}}function Ka(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Wa,notInConstruct:Ya},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Wa,notInConstruct:Ya},{character:":",before:"[ps]",after:"\\/",inConstruct:Wa,notInConstruct:Ya}]}}function ty(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ja(e){this.config.enter.autolinkProtocol.call(this,e)}function ny(e){this.config.exit.autolinkProtocol.call(this,e)}function ry(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function iy(e){this.config.exit.autolinkEmail.call(this,e)}function oy(e){this.exit(e)}function ay(e){Ha(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,sy],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,ly]],{ignore:["link","linkReference"]})}function sy(e,t,n,r,i){let o="";if(!bu(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!cy(n)))return!1;let a=uy(n+r);if(!a[0])return!1;let s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function ly(e,t,n,r){return!bu(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function cy(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function uy(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=za(e,"("),o=za(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function bu(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Qt(n)||Fn(n))&&(!t||n!==47)}var Wa,Ya,wu=M(()=>{"use strict";au();Be();yu();Wa="phrasing",Ya=["autolink","link","image","label"]});var Su=M(()=>{"use strict";wu()});function xt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Zn=M(()=>{"use strict"});function Xa(){return{enter:{gfmFootnoteDefinition:py,gfmFootnoteDefinitionLabelString:dy,gfmFootnoteCall:my,gfmFootnoteCallString:gy},exit:{gfmFootnoteDefinition:fy,gfmFootnoteDefinitionLabelString:hy,gfmFootnoteCall:by,gfmFootnoteCallString:yy}}}function Qa(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Sy,footnoteReference:Tu}}}function py(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dy(){this.buffer()}function hy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=xt(this.sliceSerialize(e)).toLowerCase()}function fy(e){this.exit(e)}function my(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function gy(){this.buffer()}function yy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=xt(this.sliceSerialize(e)).toLowerCase()}function by(e){this.exit(e)}function Tu(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),s(),a(),o+=i.move("]"),o}function wy(){return"["}function Sy(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),a=n.enter("footnoteDefinition"),s=n.enter("label");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),s(),o+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),o+=i.move(n.indentLines(n.containerFlow(e,i.current()),Ty)),a(),o}function Ty(e,t,n){return t===0?e:(n?"":" ")+e}var xu=M(()=>{"use strict";Zn();Tu.peek=wy});var ku=M(()=>{"use strict";xu()});function Za(){return{canContainEols:["delete"],enter:{strikethrough:ky},exit:{strikethrough:vy}}}function es(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xy}],handlers:{delete:vu}}}function ky(e){this.enter({type:"delete",children:[]},e)}function vy(e){this.exit(e)}function vu(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Ay(){return"~"}var xy,Au=M(()=>{"use strict";xy=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];vu.peek=Ay});var Eu=M(()=>{"use strict";Au()});function Ru(e,t={}){let n=(t.align||[]).concat(),r=t.stringLength||_y,i=[],o=[],a=[],s=[],u=0,p=-1;for(;++p<e.length;){let P=[],ee=[],Z=-1;for(e[p].length>u&&(u=e[p].length);++Z<e[p].length;){let B=Ey(e[p][Z]);if(t.alignDelimiters!==!1){let ue=r(B);ee[Z]=ue,(s[Z]===void 0||ue>s[Z])&&(s[Z]=ue)}P.push(B)}o[p]=P,a[p]=ee}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<u;)i[d]=_u(n[d]);else{let P=_u(n);for(;++d<u;)i[d]=P}d=-1;let h=[],g=[];for(;++d<u;){let P=i[d],ee="",Z="";P===99?(ee=":",Z=":"):P===108?ee=":":P===114&&(Z=":");let B=t.alignDelimiters===!1?1:Math.max(1,s[d]-ee.length-Z.length),ue=ee+"-".repeat(B)+Z;t.alignDelimiters!==!1&&(B=ee.length+B+Z.length,B>s[d]&&(s[d]=B),g[d]=B),h[d]=ue}o.splice(1,0,h),a.splice(1,0,g),p=-1;let y=[];for(;++p<o.length;){let P=o[p],ee=a[p];d=-1;let Z=[];for(;++d<u;){let B=P[d]||"",ue="",ne="";if(t.alignDelimiters!==!1){let ve=s[d]-(ee[d]||0),Oe=i[d];Oe===114?ue=" ".repeat(ve):Oe===99?ve%2?(ue=" ".repeat(ve/2+.5),ne=" ".repeat(ve/2-.5)):(ue=" ".repeat(ve/2),ne=ue):ne=" ".repeat(ve)}t.delimiterStart!==!1&&!d&&Z.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&B==="")&&(t.delimiterStart!==!1||d)&&Z.push(" "),t.alignDelimiters!==!1&&Z.push(ue),Z.push(B),t.alignDelimiters!==!1&&Z.push(ne),t.padding!==!1&&Z.push(" "),(t.delimiterEnd!==!1||d!==u-1)&&Z.push("|")}y.push(t.delimiterEnd===!1?Z.join("").replace(/ +$/,""):Z.join(""))}return y.join(`
2
- `)}function Ey(e){return e==null?"":String(e)}function _y(e){return e.length}function _u(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var Ou=M(()=>{"use strict"});function Cu(e,t,n,r){let i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);let a=n.indentLines(n.containerFlow(e,o.current()),Ry);return i(),a}function Ry(e,t,n){return">"+(n?"":" ")+e}var Iu=M(()=>{"use strict"});function Mu(e,t){return Pu(e,t.inConstruct,!0)&&!Pu(e,t.notInConstruct,!1)}function Pu(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}var Nu=M(()=>{"use strict"});function ts(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
3
- `&&Mu(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
4
- `}var Lu=M(()=>{"use strict";Nu()});function Du(e,t){let n=String(e),r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}var Fu=M(()=>{"use strict"});function Uu(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}var $u=M(()=>{"use strict"});function qu(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var ju=M(()=>{"use strict"});function Bu(e,t,n,r){let i=qu(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Uu(e,n)){let h=n.enter("codeIndented"),g=n.indentLines(o,Oy);return h(),g}let s=n.createTracker(r),u=i.repeat(Math.max(Du(o,i)+1,3)),p=n.enter("codeFenced"),d=s.move(u);if(e.lang){let h=n.enter(`codeFencedLang${a}`);d+=s.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...s.current()})),h()}if(e.lang&&e.meta){let h=n.enter(`codeFencedMeta${a}`);d+=s.move(" "),d+=s.move(n.safe(e.meta,{before:d,after:`
1
+ "use strict";var my=Object.create;var Er=Object.defineProperty;var gy=Object.getOwnPropertyDescriptor;var yy=Object.getOwnPropertyNames;var by=Object.getPrototypeOf,wy=Object.prototype.hasOwnProperty;var Sy=(e,t,n)=>t in e?Er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Ty=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},hs=(e,t)=>{for(var n in t)Er(e,n,{get:t[n],enumerable:!0})},Au=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yy(t))!wy.call(e,i)&&i!==n&&Er(e,i,{get:()=>t[i],enumerable:!(r=gy(t,i))||r.enumerable});return e};var Bt=(e,t,n)=>(n=e!=null?my(by(e)):{},Au(t||!e||!e.__esModule?Er(n,"default",{value:e,enumerable:!0}):n,e)),xy=e=>Au(Er({},"__esModule",{value:!0}),e);var Se=(e,t,n)=>Sy(e,typeof t!="symbol"?t+"":t,n);function Dn(e,t){let n=t||Ey,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Nu(e,r,i)}function Nu(e,t,n){if(Ry(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Mu(e.children,t,n)}return Array.isArray(e)?Mu(e,t,n):""}function Mu(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Nu(e[i],t,n);return r.join("")}function Ry(e){return!!(e&&typeof e=="object")}var Ey,Lu=M(()=>{"use strict";Ey={}});var pa=M(()=>{"use strict";Lu()});function ys(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var Du=M(()=>{"use strict"});function Fn(e){return e!==null&&(e<32||e===127)}function le(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function Te(e){return e===-2||e===-1||e===32}function vn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}var ht,ft,Fu,Lr,Uu,Hu,Un,Xt,je=M(()=>{"use strict";ht=vn(/[A-Za-z]/),ft=vn(/[\dA-Za-z]/),Fu=vn(/[#-'*+\--9=?A-Z^-~]/);Lr=vn(/\d/),Uu=vn(/[\dA-Fa-f]/),Hu=vn(/[!-/:-@[-`{-~]/);Un=vn(/\p{P}|\p{S}/u),Xt=vn(/\s/)});function bs(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var $u=M(()=>{"use strict"});function Cy(e){let t=[],n=-1;for(;++n<e.length;)t[n]=kn(e[n]);return da(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function _y(e){let t=e;return da(n);function n(r){let i=r,a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Oy(e){return da(t);function t(n){return n&&n.type===e}}function da(e){return t;function t(n,r,i){return!!(Py(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Iy(){return!0}function Py(e){return e!==null&&typeof e=="object"&&"type"in e}var kn,qu=M(()=>{"use strict";kn=(function(e){if(e==null)return Iy;if(typeof e=="function")return da(e);if(typeof e=="object")return Array.isArray(e)?Cy(e):_y(e);if(typeof e=="string")return Oy(e);throw new Error("Expected function, string, or object as test")})});var ha=M(()=>{"use strict";qu()});function ju(e){return"\x1B[33m"+e+"\x1B[39m"}var Bu=M(()=>{"use strict"});function Dr(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;let a=kn(i),o=r?-1:1;s(e,void 0,[])();function s(c,p,d){let h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){let g=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(y,"name",{value:"node ("+ju(c.type+(g?"<"+g+">":""))+")"})}return y;function y(){let g=zu,I,K,Z;if((!t||a(c,p,d[d.length-1]||void 0))&&(g=My(n(c,d)),g[0]===Hn))return g;if("children"in c&&c.children){let H=c;if(H.children&&g[0]!==ma)for(K=(r?H.children.length:-1)+o,Z=d.concat(H);K>-1&&K<H.children.length;){let ue=H.children[K];if(I=s(ue,K,Z)(),I[0]===Hn)return I;K=typeof I[1]=="number"?I[1]:K+o}}return g}}}function My(e){return Array.isArray(e)?e:typeof e=="number"?[fa,e]:e==null?zu:[e]}var zu,fa,Hn,ma,Vu=M(()=>{"use strict";ha();Bu();zu=[],fa=!0,Hn=!1,ma="skip"});var ga=M(()=>{"use strict";Vu()});function ws(e,t,n){let i=kn((n||{}).ignore||[]),a=Ny(t),o=-1;for(;++o<a.length;)Dr(e,"text",s);function s(p,d){let h=-1,y;for(;++h<d.length;){let g=d[h],I=y?y.children:void 0;if(i(g,I?I.indexOf(g):void 0,y))return;y=g}if(y)return c(p,d)}function c(p,d){let h=d[d.length-1],y=a[o][0],g=a[o][1],I=0,Z=h.children.indexOf(p),H=!1,ue=[];y.lastIndex=0;let ne=y.exec(p.value);for(;ne;){let ve=ne.index,_e={index:ne.index,input:ne.input,stack:[...d,p]},$=g(...ne,_e);if(typeof $=="string"&&($=$.length>0?{type:"text",value:$}:void 0),$===!1?y.lastIndex=ve+1:(I!==ve&&ue.push({type:"text",value:p.value.slice(I,ve)}),Array.isArray($)?ue.push(...$):$&&ue.push($),I=ve+ne[0].length,H=!0),!y.global)break;ne=y.exec(p.value)}return H?(I<p.value.length&&ue.push({type:"text",value:p.value.slice(I)}),h.children.splice(Z,1,...ue)):ue=[p],Z+ue.length}}function Ny(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let i=n[r];t.push([Ly(i[0]),Dy(i[1])])}return t}function Ly(e){return typeof e=="string"?new RegExp(bs(e),"g"):e}function Dy(e){return typeof e=="function"?e:function(){return e}}var Wu=M(()=>{"use strict";$u();ga();ha()});var Yu=M(()=>{"use strict";Wu()});function As(){return{transforms:[jy],enter:{literalAutolink:Fy,literalAutolinkEmail:xs,literalAutolinkHttp:xs,literalAutolinkWww:xs},exit:{literalAutolink:qy,literalAutolinkEmail:$y,literalAutolinkHttp:Uy,literalAutolinkWww:Hy}}}function vs(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ss,notInConstruct:Ts},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ss,notInConstruct:Ts},{character:":",before:"[ps]",after:"\\/",inConstruct:Ss,notInConstruct:Ts}]}}function Fy(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xs(e){this.config.enter.autolinkProtocol.call(this,e)}function Uy(e){this.config.exit.autolinkProtocol.call(this,e)}function Hy(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function $y(e){this.config.exit.autolinkEmail.call(this,e)}function qy(e){this.exit(e)}function jy(e){ws(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,By],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,zy]],{ignore:["link","linkReference"]})}function By(e,t,n,r,i){let a="";if(!Ju(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Vy(n)))return!1;let o=Wy(n+r);if(!o[0])return!1;let s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function zy(e,t,n,r){return!Ju(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Vy(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Wy(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=ys(e,"("),a=ys(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Ju(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Xt(n)||Un(n))&&(!t||n!==47)}var Ss,Ts,Gu=M(()=>{"use strict";Du();je();Yu();Ss="phrasing",Ts=["autolink","link","image","label"]});var Ku=M(()=>{"use strict";Gu()});function xt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var er=M(()=>{"use strict"});function ks(){return{enter:{gfmFootnoteDefinition:Yy,gfmFootnoteDefinitionLabelString:Jy,gfmFootnoteCall:Xy,gfmFootnoteCallString:Qy},exit:{gfmFootnoteDefinition:Ky,gfmFootnoteDefinitionLabelString:Gy,gfmFootnoteCall:eb,gfmFootnoteCallString:Zy}}}function Es(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:nb,footnoteReference:Xu}}}function Yy(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Jy(){this.buffer()}function Gy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=xt(this.sliceSerialize(e)).toLowerCase()}function Ky(e){this.exit(e)}function Xy(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Qy(){this.buffer()}function Zy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=xt(this.sliceSerialize(e)).toLowerCase()}function eb(e){this.exit(e)}function Xu(e,t,n,r){let i=n.createTracker(r),a=i.move("[^"),o=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),s(),o(),a+=i.move("]"),a}function tb(){return"["}function nb(e,t,n,r){let i=n.createTracker(r),a=i.move("[^"),o=n.enter("footnoteDefinition"),s=n.enter("label");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),s(),a+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),a+=i.move(n.indentLines(n.containerFlow(e,i.current()),rb)),o(),a}function rb(e,t,n){return t===0?e:(n?"":" ")+e}var Qu=M(()=>{"use strict";er();Xu.peek=tb});var Zu=M(()=>{"use strict";Qu()});function Rs(){return{canContainEols:["delete"],enter:{strikethrough:ab},exit:{strikethrough:ob}}}function Cs(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ib}],handlers:{delete:ep}}}function ab(e){this.enter({type:"delete",children:[]},e)}function ob(e){this.exit(e)}function ep(e,t,n,r){let i=n.createTracker(r),a=n.enter("strikethrough"),o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function sb(){return"~"}var ib,tp=M(()=>{"use strict";ib=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ep.peek=sb});var np=M(()=>{"use strict";tp()});function ip(e,t={}){let n=(t.align||[]).concat(),r=t.stringLength||cb,i=[],a=[],o=[],s=[],c=0,p=-1;for(;++p<e.length;){let I=[],K=[],Z=-1;for(e[p].length>c&&(c=e[p].length);++Z<e[p].length;){let H=lb(e[p][Z]);if(t.alignDelimiters!==!1){let ue=r(H);K[Z]=ue,(s[Z]===void 0||ue>s[Z])&&(s[Z]=ue)}I.push(H)}a[p]=I,o[p]=K}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<c;)i[d]=rp(n[d]);else{let I=rp(n);for(;++d<c;)i[d]=I}d=-1;let h=[],y=[];for(;++d<c;){let I=i[d],K="",Z="";I===99?(K=":",Z=":"):I===108?K=":":I===114&&(Z=":");let H=t.alignDelimiters===!1?1:Math.max(1,s[d]-K.length-Z.length),ue=K+"-".repeat(H)+Z;t.alignDelimiters!==!1&&(H=K.length+H+Z.length,H>s[d]&&(s[d]=H),y[d]=H),h[d]=ue}a.splice(1,0,h),o.splice(1,0,y),p=-1;let g=[];for(;++p<a.length;){let I=a[p],K=o[p];d=-1;let Z=[];for(;++d<c;){let H=I[d]||"",ue="",ne="";if(t.alignDelimiters!==!1){let ve=s[d]-(K[d]||0),_e=i[d];_e===114?ue=" ".repeat(ve):_e===99?ve%2?(ue=" ".repeat(ve/2+.5),ne=" ".repeat(ve/2-.5)):(ue=" ".repeat(ve/2),ne=ue):ne=" ".repeat(ve)}t.delimiterStart!==!1&&!d&&Z.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&H==="")&&(t.delimiterStart!==!1||d)&&Z.push(" "),t.alignDelimiters!==!1&&Z.push(ue),Z.push(H),t.alignDelimiters!==!1&&Z.push(ne),t.padding!==!1&&Z.push(" "),(t.delimiterEnd!==!1||d!==c-1)&&Z.push("|")}g.push(t.delimiterEnd===!1?Z.join("").replace(/ +$/,""):Z.join(""))}return g.join(`
2
+ `)}function lb(e){return e==null?"":String(e)}function cb(e){return e.length}function rp(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var ap=M(()=>{"use strict"});function op(e,t,n,r){let i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),ub);return i(),o}function ub(e,t,n){return">"+(n?"":" ")+e}var sp=M(()=>{"use strict"});function cp(e,t){return lp(e,t.inConstruct,!0)&&!lp(e,t.notInConstruct,!1)}function lp(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}var up=M(()=>{"use strict"});function _s(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
3
+ `&&cp(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
4
+ `}var pp=M(()=>{"use strict";up()});function dp(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}var hp=M(()=>{"use strict"});function fp(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}var mp=M(()=>{"use strict"});function gp(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var yp=M(()=>{"use strict"});function bp(e,t,n,r){let i=gp(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(fp(e,n)){let h=n.enter("codeIndented"),y=n.indentLines(a,pb);return h(),y}let s=n.createTracker(r),c=i.repeat(Math.max(dp(a,i)+1,3)),p=n.enter("codeFenced"),d=s.move(c);if(e.lang){let h=n.enter(`codeFencedLang${o}`);d+=s.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...s.current()})),h()}if(e.lang&&e.meta){let h=n.enter(`codeFencedMeta${o}`);d+=s.move(" "),d+=s.move(n.safe(e.meta,{before:d,after:`
5
5
  `,encode:["`"],...s.current()})),h()}return d+=s.move(`
6
- `),o&&(d+=s.move(o+`
7
- `)),d+=s.move(u),p(),d}function Oy(e,t,n){return(n?"":" ")+e}var zu=M(()=>{"use strict";Fu();$u();ju()});function er(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var Ki=M(()=>{"use strict"});function Vu(e,t,n,r){let i=er(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition"),s=n.enter("label"),u=n.createTracker(r),p=u.move("[");return p+=u.move(n.safe(n.associationId(e),{before:p,after:"]",...u.current()})),p+=u.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),p+=u.move("<"),p+=u.move(n.safe(e.url,{before:p,after:">",...u.current()})),p+=u.move(">")):(s=n.enter("destinationRaw"),p+=u.move(n.safe(e.url,{before:p,after:e.title?" ":`
8
- `,...u.current()}))),s(),e.title&&(s=n.enter(`title${o}`),p+=u.move(" "+i),p+=u.move(n.safe(e.title,{before:p,after:i,...u.current()})),p+=u.move(i),s()),a(),p}var Hu=M(()=>{"use strict";Ki()});function Wu(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var Yu=M(()=>{"use strict"});function ns(e,t,n,r){let i=Wu(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);return s+=a.move(n.containerPhrasing(e,{before:s,after:i,...a.current()})),s+=a.move(i),o(),s}function Cy(e,t,n){return n.options.emphasis||"*"}var Ju=M(()=>{"use strict";Yu();ns.peek=Cy});function rs(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),Pr(e,o,s,i);function s(u,p){let d=p[p.length-1],h=d?d.children.indexOf(u):void 0;return a(u,h,d)}}var Gu=M(()=>{"use strict";Gi();Gi()});var Ku=M(()=>{"use strict";Gu()});function Xu(e,t){let n=!1;return rs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Un}),!!((!e.depth||e.depth<3)&&dn(e)&&(t.options.setext||n))}var Qu=M(()=>{"use strict";Ku();Cr()});function Zu(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Xu(e,n)){let d=n.enter("headingSetext"),h=n.enter("phrasing"),g=n.containerPhrasing(e,{...o.current(),before:`
6
+ `),a&&(d+=s.move(a+`
7
+ `)),d+=s.move(c),p(),d}function pb(e,t,n){return(n?"":" ")+e}var wp=M(()=>{"use strict";hp();mp();yp()});function tr(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var ya=M(()=>{"use strict"});function Sp(e,t,n,r){let i=tr(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition"),s=n.enter("label"),c=n.createTracker(r),p=c.move("[");return p+=c.move(n.safe(n.associationId(e),{before:p,after:"]",...c.current()})),p+=c.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),p+=c.move("<"),p+=c.move(n.safe(e.url,{before:p,after:">",...c.current()})),p+=c.move(">")):(s=n.enter("destinationRaw"),p+=c.move(n.safe(e.url,{before:p,after:e.title?" ":`
8
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),p+=c.move(" "+i),p+=c.move(n.safe(e.title,{before:p,after:i,...c.current()})),p+=c.move(i),s()),o(),p}var Tp=M(()=>{"use strict";ya()});function xp(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var Ap=M(()=>{"use strict"});function Os(e,t,n,r){let i=xp(n),a=n.enter("emphasis"),o=n.createTracker(r),s=o.move(i);return s+=o.move(n.containerPhrasing(e,{before:s,after:i,...o.current()})),s+=o.move(i),a(),s}function db(e,t,n){return n.options.emphasis||"*"}var vp=M(()=>{"use strict";Ap();Os.peek=db});function Is(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Dr(e,a,s,i);function s(c,p){let d=p[p.length-1],h=d?d.children.indexOf(c):void 0;return o(c,h,d)}}var kp=M(()=>{"use strict";ga();ga()});var Ep=M(()=>{"use strict";kp()});function Rp(e,t){let n=!1;return Is(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Hn}),!!((!e.depth||e.depth<3)&&Dn(e)&&(t.options.setext||n))}var Cp=M(()=>{"use strict";Ep();pa()});function _p(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Rp(e,n)){let d=n.enter("headingSetext"),h=n.enter("phrasing"),y=n.containerPhrasing(e,{...a.current(),before:`
9
9
  `,after:`
10
- `});return h(),d(),g+`
11
- `+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
12
- `))+1))}let a="#".repeat(i),s=n.enter("headingAtx"),u=n.enter("phrasing");o.move(a+" ");let p=n.containerPhrasing(e,{before:"# ",after:`
13
- `,...o.current()});return/^[\t ]/.test(p)&&(p="&#x"+p.charCodeAt(0).toString(16).toUpperCase()+";"+p.slice(1)),p=p?a+" "+p:a,n.options.closeAtx&&(p+=" "+a),u(),s(),p}var ep=M(()=>{"use strict";Qu()});function is(e){return e.value||""}function Iy(){return"<"}var tp=M(()=>{"use strict";is.peek=Iy});function os(e,t,n,r){let i=er(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image"),s=n.enter("label"),u=n.createTracker(r),p=u.move("![");return p+=u.move(n.safe(e.alt,{before:p,after:"]",...u.current()})),p+=u.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),p+=u.move("<"),p+=u.move(n.safe(e.url,{before:p,after:">",...u.current()})),p+=u.move(">")):(s=n.enter("destinationRaw"),p+=u.move(n.safe(e.url,{before:p,after:e.title?" ":")",...u.current()}))),s(),e.title&&(s=n.enter(`title${o}`),p+=u.move(" "+i),p+=u.move(n.safe(e.title,{before:p,after:i,...u.current()})),p+=u.move(i),s()),p+=u.move(")"),a(),p}function Py(){return"!"}var np=M(()=>{"use strict";Ki();os.peek=Py});function as(e,t,n,r){let i=e.referenceType,o=n.enter("imageReference"),a=n.enter("label"),s=n.createTracker(r),u=s.move("!["),p=n.safe(e.alt,{before:u,after:"]",...s.current()});u+=s.move(p+"]["),a();let d=n.stack;n.stack=[],a=n.enter("reference");let h=n.safe(n.associationId(e),{before:u,after:"]",...s.current()});return a(),n.stack=d,o(),i==="full"||!p||p!==h?u+=s.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=s.move("]"),u}function My(){return"!"}var rp=M(()=>{"use strict";as.peek=My});function ss(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let a=n.unsafe[o],s=n.compilePattern(a),u;if(a.atBreak)for(;u=s.exec(r);){let p=u.index;r.charCodeAt(p)===10&&r.charCodeAt(p-1)===13&&p--,r=r.slice(0,p)+" "+r.slice(u.index+1)}}return i+r+i}function Ny(){return"`"}var ip=M(()=>{"use strict";ss.peek=Ny});function ls(e,t){let n=dn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var op=M(()=>{"use strict";Cr()});function cs(e,t,n,r){let i=er(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r),s,u;if(ls(e,n)){let d=n.stack;n.stack=[],s=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),s(),n.stack=d,h}s=n.enter("link"),u=n.enter("label");let p=a.move("[");return p+=a.move(n.containerPhrasing(e,{before:p,after:"](",...a.current()})),p+=a.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),p+=a.move("<"),p+=a.move(n.safe(e.url,{before:p,after:">",...a.current()})),p+=a.move(">")):(u=n.enter("destinationRaw"),p+=a.move(n.safe(e.url,{before:p,after:e.title?" ":")",...a.current()}))),u(),e.title&&(u=n.enter(`title${o}`),p+=a.move(" "+i),p+=a.move(n.safe(e.title,{before:p,after:i,...a.current()})),p+=a.move(i),u()),p+=a.move(")"),s(),p}function Ly(e,t,n){return ls(e,n)?"<":"["}var ap=M(()=>{"use strict";Ki();op();cs.peek=Ly});function us(e,t,n,r){let i=e.referenceType,o=n.enter("linkReference"),a=n.enter("label"),s=n.createTracker(r),u=s.move("["),p=n.containerPhrasing(e,{before:u,after:"]",...s.current()});u+=s.move(p+"]["),a();let d=n.stack;n.stack=[],a=n.enter("reference");let h=n.safe(n.associationId(e),{before:u,after:"]",...s.current()});return a(),n.stack=d,o(),i==="full"||!p||p!==h?u+=s.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=s.move("]"),u}function Dy(){return"["}var sp=M(()=>{"use strict";us.peek=Dy});function tr(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var Xi=M(()=>{"use strict"});function lp(e){let t=tr(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}var cp=M(()=>{"use strict";Xi()});function up(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var pp=M(()=>{"use strict"});function Qi(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var ps=M(()=>{"use strict"});function dp(e,t,n,r){let i=n.enter("list"),o=n.bulletCurrent,a=e.ordered?up(n):tr(n),s=e.ordered?a==="."?")":".":lp(n),u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){let d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Qi(n)===a&&d){let h=-1;for(;++h<e.children.length;){let g=e.children[h];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=s),n.bulletCurrent=a;let p=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),p}var hp=M(()=>{"use strict";Xi();cp();pp();ps()});function fp(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var mp=M(()=>{"use strict"});function gp(e,t,n,r){let i=fp(n),o=n.bulletCurrent||tr(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);let s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);let u=n.enter("listItem"),p=n.indentLines(n.containerFlow(e,s.current()),d);return u(),p;function d(h,g,y){return g?(y?"":" ".repeat(a))+h:(y?o:o+" ".repeat(a-o.length))+h}}var yp=M(()=>{"use strict";Xi();mp()});function bp(e,t,n,r){let i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}var wp=M(()=>{"use strict"});var ds,Sp=M(()=>{"use strict";Wi();ds=An(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var Tp=M(()=>{"use strict";Sp()});function xp(e,t,n,r){return(e.children.some(function(a){return ds(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}var kp=M(()=>{"use strict";Tp()});function vp(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var Ap=M(()=>{"use strict"});function hs(e,t,n,r){let i=vp(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);return s+=a.move(n.containerPhrasing(e,{before:s,after:i,...a.current()})),s+=a.move(i+i),o(),s}function Fy(e,t,n){return n.options.strong||"*"}var Ep=M(()=>{"use strict";Ap();hs.peek=Fy});function _p(e,t,n,r){return n.safe(e.value,r)}var Rp=M(()=>{"use strict"});function Op(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var Cp=M(()=>{"use strict"});function Ip(e,t,n){let r=(Qi(n)+(n.options.ruleSpaces?" ":"")).repeat(Op(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Pp=M(()=>{"use strict";Cp();ps()});var Mr,Mp=M(()=>{"use strict";Iu();Lu();zu();Hu();Ju();ep();tp();np();rp();ip();ap();sp();hp();yp();wp();kp();Ep();Rp();Pp();Mr={blockquote:Cu,break:ts,code:Bu,definition:Vu,emphasis:ns,hardBreak:ts,heading:Zu,html:is,image:os,imageReference:as,inlineCode:ss,link:cs,linkReference:us,list:dp,listItem:gp,paragraph:bp,root:xp,strong:hs,text:_p,thematicBreak:Ip}});var fs,Np=M(()=>{"use strict";fs={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
14
- `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});function nr(e){return Uy.call(fs,e)?fs[e]:!1}var Uy,Zi=M(()=>{"use strict";Np();Uy={}.hasOwnProperty});function eo(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}var ms=M(()=>{"use strict"});function Lp(e){return e.replace($y,qy)}function qy(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),o=i===120||i===88;return eo(n.slice(o?2:1),o?16:10)}return nr(n)||e}var $y,Dp=M(()=>{"use strict";Zi();ms();$y=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var gs=M(()=>{"use strict";Mp()});function bs(){return{enter:{table:jy,tableData:Fp,tableHeader:Fp,tableRow:zy},exit:{codeText:Vy,table:By,tableData:ys,tableHeader:ys,tableRow:ys}}}function jy(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function By(e){this.exit(e),this.data.inTable=void 0}function zy(e){this.enter({type:"tableRow",children:[]},e)}function ys(e){this.exit(e)}function Fp(e){this.enter({type:"tableCell",children:[]},e)}function Vy(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Hy));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Hy(e,t){return t==="|"?t:e}function ws(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
15
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:a,tableCell:u,tableRow:s}};function a(y,P,ee,Z){return p(d(y,ee,Z),y.align)}function s(y,P,ee,Z){let B=h(y,ee,Z),ue=p([B]);return ue.slice(0,ue.indexOf(`
16
- `))}function u(y,P,ee,Z){let B=ee.enter("tableCell"),ue=ee.enter("phrasing"),ne=ee.containerPhrasing(y,{...Z,before:o,after:o});return ue(),B(),ne}function p(y,P){return Ru(y,{align:P,alignDelimiters:r,padding:n,stringLength:i})}function d(y,P,ee){let Z=y.children,B=-1,ue=[],ne=P.enter("table");for(;++B<Z.length;)ue[B]=h(Z[B],P,ee);return ne(),ue}function h(y,P,ee){let Z=y.children,B=-1,ue=[],ne=P.enter("tableRow");for(;++B<Z.length;)ue[B]=u(Z[B],y,P,ee);return ne(),ue}function g(y,P,ee){let Z=Mr.inlineCode(y,P,ee);return ee.stack.includes("tableCell")&&(Z=Z.replace(/\|/g,"\\$&")),Z}}var Up=M(()=>{"use strict";Ou();gs()});var $p=M(()=>{"use strict";Up()});function Ss(){return{exit:{taskListCheckValueChecked:qp,taskListCheckValueUnchecked:qp,paragraph:Wy}}}function Ts(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Yy}}}function qp(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Wy(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let r=n.children[0];if(r&&r.type==="text"){let i=t.children,o=-1,a;for(;++o<i.length;){let s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Yy(e,t,n,r){let i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let u=Mr.listItem(e,t,n,{...r,...s.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),u;function p(d){return d+a}}var jp=M(()=>{"use strict";gs()});var Bp=M(()=>{"use strict";jp()});function xs(){return[Ga(),Xa(),Za(),bs(),Ss()]}function ks(e){return{extensions:[Ka(),Qa(),es(),ws(e),Ts()]}}var zp=M(()=>{"use strict";Su();ku();Eu();$p();Bp()});var Vp=M(()=>{"use strict";zp()});function pt(e,t,n,r){let i=e.length,o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Rt(e,t){return e.length>0?(pt(e,e.length,0,t),e):t}var hn=M(()=>{"use strict"});function to(e){let t={},n=-1;for(;++n<e.length;)Jy(t,e[n]);return t}function Jy(e,t){let n;for(n in t){let i=(Hp.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],a;if(o)for(a in o){Hp.call(i,a)||(i[a]=[]);let s=o[a];Gy(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Gy(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);pt(e,0,0,r)}var Hp,vs=M(()=>{"use strict";hn();Hp={}.hasOwnProperty});function Es(){return{text:Zt}}function Qy(e,t,n){let r=this,i,o;return a;function a(h){return!As(h)||!Zp.call(r,r.previous)||_s(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(h))}function s(h){return As(h)?(e.consume(h),s):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(Xy,d,p)(h):h===45||h===95||ft(h)?(o=!0,e.consume(h),u):d(h)}function p(h){return e.consume(h),i=!0,u}function d(h){return o&&i&&ht(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function Zy(e,t,n){let r=this;return i;function i(a){return a!==87&&a!==119||!Xp.call(r,r.previous)||_s(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Ky,e.attempt(Wp,e.attempt(Yp,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function eb(e,t,n){let r=this,i="",o=!1;return a;function a(h){return(h===72||h===104)&&Qp.call(r,r.previous)&&!_s(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),s):n(h)}function s(h){if(ht(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),s;if(h===58){let g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?p:(o=!0,u)):n(h)}function p(h){return h===null||Dn(h)||Le(h)||Qt(h)||Fn(h)?n(h):e.attempt(Wp,e.attempt(Yp,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function tb(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function nb(e,t,n){let r,i,o;return a;function a(p){return p===46||p===95?e.check(Jp,u,s)(p):p===null||Le(p)||Qt(p)||p!==45&&Fn(p)?u(p):(o=!0,e.consume(p),a)}function s(p){return p===95?r=!0:(i=r,r=void 0),e.consume(p),a}function u(p){return i||r||!o?n(p):t(p)}}function rb(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Jp,t,o)(a):a===null||Le(a)||Qt(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function ib(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||Le(s)||Qt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Le(s)||Qt(s)?t(s):r(s)}function o(s){return ht(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):ht(s)?(e.consume(s),a):n(s)}}function ob(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return ft(o)?n(o):t(o)}}function Xp(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Le(e)}function Qp(e){return!ht(e)}function Zp(e){return!(e===47||As(e))}function As(e){return e===43||e===45||e===46||e===95||ft(e)}function _s(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Ky,Wp,Yp,Jp,Xy,Gp,Kp,fn,Zt,$n,ed=M(()=>{"use strict";Be();Ky={tokenize:tb,partial:!0},Wp={tokenize:nb,partial:!0},Yp={tokenize:rb,partial:!0},Jp={tokenize:ib,partial:!0},Xy={tokenize:ob,partial:!0},Gp={name:"wwwAutolink",tokenize:Zy,previous:Xp},Kp={name:"protocolAutolink",tokenize:eb,previous:Qp},fn={name:"emailAutolink",tokenize:Qy,previous:Zp},Zt={};$n=48;for(;$n<123;)Zt[$n]=fn,$n++,$n===58?$n=65:$n===91&&($n=97);Zt[43]=fn;Zt[45]=fn;Zt[46]=fn;Zt[95]=fn;Zt[72]=[fn,Kp];Zt[104]=[fn,Kp];Zt[87]=[fn,Gp];Zt[119]=[fn,Gp]});var td=M(()=>{"use strict";ed()});function rr(e){if(e===null||Le(e)||Qt(e))return 1;if(Fn(e))return 2}var Rs=M(()=>{"use strict";Be()});function En(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}var Nr=M(()=>{"use strict"});function ab(e,t){let n=-1,r,i,o,a,s,u,p,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let h=Object.assign({},e[r][1].end),g=Object.assign({},e[n][1].start);nd(h,-u),nd(g,u),a={type:u>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[r][1].end)},s={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:g},o={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},s.end),p=[],e[r][1].end.offset-e[r][1].start.offset&&(p=Rt(p,[["enter",e[r][1],t],["exit",e[r][1],t]])),p=Rt(p,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),p=Rt(p,En(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),p=Rt(p,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,p=Rt(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,pt(e,r-1,n-r+3,p),n=r+p.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function sb(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=rr(r),o;return a;function a(u){return o=u,e.enter("attentionSequence"),s(u)}function s(u){if(u===o)return e.consume(u),s;let p=e.exit("attentionSequence"),d=rr(u),h=!d||d===2&&i||n.includes(u),g=!i||i===2&&d||n.includes(r);return p._open=!!(o===42?h:h&&(i||!g)),p._close=!!(o===42?g:g&&(d||!h)),t(u)}}function nd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Lr,rd=M(()=>{"use strict";hn();Rs();Nr();Lr={name:"attention",tokenize:sb,resolveAll:ab}});function lb(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return ht(y)?(e.consume(y),a):y===64?n(y):p(y)}function a(y){return y===43||y===45||y===46||ft(y)?(r=1,s(y)):p(y)}function s(y){return y===58?(e.consume(y),r=0,u):(y===43||y===45||y===46||ft(y))&&r++<32?(e.consume(y),s):(r=0,p(y))}function u(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Dn(y)?n(y):(e.consume(y),u)}function p(y){return y===64?(e.consume(y),d):su(y)?(e.consume(y),p):n(y)}function d(y){return ft(y)?h(y):n(y)}function h(y){return y===46?(e.consume(y),r=0,d):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):g(y)}function g(y){if((y===45||ft(y))&&r++<63){let P=y===45?g:h;return e.consume(y),P}return n(y)}}var Os,id=M(()=>{"use strict";Be();Os={name:"autolink",tokenize:lb}});function we(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return a;function a(u){return Se(u)?(e.enter(n),s(u)):t(u)}function s(u){return Se(u)&&o++<i?(e.consume(u),s):(e.exit(n),t(u))}}var ut=M(()=>{"use strict";Be()});function cb(e,t,n){return r;function r(o){return Se(o)?we(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||le(o)?t(o):n(o)}}var en,no=M(()=>{"use strict";ut();Be();en={tokenize:cb,partial:!0}});function ub(e,t,n){let r=this;return i;function i(a){if(a===62){let s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Se(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function pb(e,t,n){let r=this;return i;function i(a){return Se(a)?we(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(ro,t,n)(a)}}function db(e){e.exit("blockQuote")}var ro,od=M(()=>{"use strict";ut();Be();ro={name:"blockQuote",tokenize:ub,continuation:{tokenize:pb},exit:db}});function hb(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return cu(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var io,ad=M(()=>{"use strict";Be();io={name:"characterEscape",tokenize:hb}});function fb(e,t,n){let r=this,i=0,o,a;return s;function s(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,a=ft,d(h))}function p(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=lu,d):(e.enter("characterReferenceValue"),o=7,a=Ir,d(h))}function d(h){if(h===59&&i){let g=e.exit("characterReferenceValue");return a===ft&&!nr(r.sliceSerialize(g))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<o?(e.consume(h),d):n(h)}}var oo,sd=M(()=>{"use strict";Zi();Be();oo={name:"characterReference",tokenize:fb}});function mb(e,t,n){let r=this,i={tokenize:Oe,partial:!0},o=0,a=0,s;return u;function u($){return p($)}function p($){let Ue=r.events[r.events.length-1];return o=Ue&&Ue[1].type==="linePrefix"?Ue[2].sliceSerialize(Ue[1],!0).length:0,s=$,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d($)}function d($){return $===s?(a++,e.consume($),d):a<3?n($):(e.exit("codeFencedFenceSequence"),Se($)?we(e,h,"whitespace")($):h($))}function h($){return $===null||le($)?(e.exit("codeFencedFence"),r.interrupt?t($):e.check(ld,ee,ve)($)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g($))}function g($){return $===null||le($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h($)):Se($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),we(e,y,"whitespace")($)):$===96&&$===s?n($):(e.consume($),g)}function y($){return $===null||le($)?h($):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),P($))}function P($){return $===null||le($)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h($)):$===96&&$===s?n($):(e.consume($),P)}function ee($){return e.attempt(i,ve,Z)($)}function Z($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),B}function B($){return o>0&&Se($)?we(e,ue,"linePrefix",o+1)($):ue($)}function ue($){return $===null||le($)?e.check(ld,ee,ve)($):(e.enter("codeFlowValue"),ne($))}function ne($){return $===null||le($)?(e.exit("codeFlowValue"),ue($)):(e.consume($),ne)}function ve($){return e.exit("codeFenced"),t($)}function Oe($,Ue,Xe){let je=0;return U;function U(Me){return $.enter("lineEnding"),$.consume(Me),$.exit("lineEnding"),Te}function Te(Me){return $.enter("codeFencedFence"),Se(Me)?we($,ze,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Me):ze(Me)}function ze(Me){return Me===s?($.enter("codeFencedFenceSequence"),ye(Me)):Xe(Me)}function ye(Me){return Me===s?(je++,$.consume(Me),ye):je>=a?($.exit("codeFencedFenceSequence"),Se(Me)?we($,Ie,"whitespace")(Me):Ie(Me)):Xe(Me)}function Ie(Me){return Me===null||le(Me)?($.exit("codeFencedFence"),Ue(Me)):Xe(Me)}}}function gb(e,t,n){let r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}var ld,ao,cd=M(()=>{"use strict";ut();Be();ld={tokenize:gb,partial:!0},ao={name:"codeFenced",tokenize:mb,concrete:!0}});function bb(e,t,n){let r=this;return i;function i(p){return e.enter("codeIndented"),we(e,o,"linePrefix",5)(p)}function o(p){let d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(p):n(p)}function a(p){return p===null?u(p):le(p)?e.attempt(yb,a,u)(p):(e.enter("codeFlowValue"),s(p))}function s(p){return p===null||le(p)?(e.exit("codeFlowValue"),a(p)):(e.consume(p),s)}function u(p){return e.exit("codeIndented"),t(p)}}function wb(e,t,n){let r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):le(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):we(e,o,"linePrefix",5)(a)}function o(a){let s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):le(a)?i(a):n(a)}}var Dr,yb,ud=M(()=>{"use strict";ut();Be();Dr={name:"codeIndented",tokenize:bb},yb={tokenize:wb,partial:!0}});function Sb(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Tb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xb(e,t,n){let r=this,i=0,o,a;return s;function s(g){return e.enter("codeText"),e.enter("codeTextSequence"),u(g)}function u(g){return g===96?(e.consume(g),i++,u):(e.exit("codeTextSequence"),p(g))}function p(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),p):g===96?(a=e.enter("codeTextSequence"),o=0,h(g)):le(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||le(g)?(e.exit("codeTextData"),p(g)):(e.consume(g),d)}function h(g){return g===96?(e.consume(g),o++,h):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(a.type="codeTextData",d(g))}}var Cs,pd=M(()=>{"use strict";Be();Cs={name:"codeText",tokenize:xb,resolve:Sb,previous:Tb}});function Fr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}var so,dd=M(()=>{"use strict";so=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n==null?Number.POSITIVE_INFINITY:n;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Fr(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Fr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);Fr(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fr(this.left,n.reverse())}}}});function lo(e){let t={},n=-1,r,i,o,a,s,u,p,d=new so(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,kb(d,n)),n=t[n],p=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(a=d.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},d.get(i)[1].start),s=d.slice(i,n),s.unshift(r),d.splice(i,n-i+1,s))}}return pt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!p}function kb(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,o=[],a=n._tokenizer||r.parser[n.contentType](n.start),s=a.events,u=[],p={},d,h,g=-1,y=n,P=0,ee=0,Z=[ee];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(d=r.sliceStream(y),y.next||d.push(null),h&&a.defineSkip(y.start),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=y,y=y.next}for(y=n;++g<s.length;)s[g][0]==="exit"&&s[g-1][0]==="enter"&&s[g][1].type===s[g-1][1].type&&s[g][1].start.line!==s[g][1].end.line&&(ee=g+1,Z.push(ee),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(a.events=[],y?(y._tokenizer=void 0,y.previous=void 0):Z.pop(),g=Z.length;g--;){let B=s.slice(Z[g],Z[g+1]),ue=o.pop();u.push([ue,ue+B.length-1]),e.splice(ue,2,B)}for(u.reverse(),g=-1;++g<u.length;)p[P+u[g][0]]=P+u[g][1],P+=u[g][1]-u[g][0]-1;return p}var Is=M(()=>{"use strict";hn();dd()});function Ab(e){return lo(e),e}function Eb(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):le(s)?e.check(vb,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function _b(e,t,n){let r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),we(e,o,"linePrefix")}function o(a){if(a===null||le(a))return n(a);let s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}var Ps,vb,hd=M(()=>{"use strict";ut();Be();Is();Ps={tokenize:Eb,resolve:Ab},vb={tokenize:_b,partial:!0}});function co(e,t,n,r,i,o,a,s,u){let p=u||Number.POSITIVE_INFINITY,d=0;return h;function h(B){return B===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(B),e.exit(o),g):B===null||B===32||B===41||Dn(B)?n(B):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),ee(B))}function g(B){return B===62?(e.enter(o),e.consume(B),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),y(B))}function y(B){return B===62?(e.exit("chunkString"),e.exit(s),g(B)):B===null||B===60||le(B)?n(B):(e.consume(B),B===92?P:y)}function P(B){return B===60||B===62||B===92?(e.consume(B),y):y(B)}function ee(B){return!d&&(B===null||B===41||Le(B))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(B)):d<p&&B===40?(e.consume(B),d++,ee):B===41?(e.consume(B),d--,ee):B===null||B===32||B===40||Dn(B)?n(B):(e.consume(B),B===92?Z:ee)}function Z(B){return B===40||B===41||B===92?(e.consume(B),ee):ee(B)}}var Ms=M(()=>{"use strict";Be()});function uo(e,t,n,r,i,o){let a=this,s=0,u;return p;function p(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),d}function d(y){return s>999||y===null||y===91||y===93&&!u||y===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):le(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||le(y)||s++>999?(e.exit("chunkString"),d(y)):(e.consume(y),u||(u=!Se(y)),y===92?g:h)}function g(y){return y===91||y===92||y===93?(e.consume(y),s++,h):h(y)}}var Ns=M(()=>{"use strict";Be()});function po(e,t,n,r,i,o){let a;return s;function s(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),a=g===40?41:g,u):n(g)}function u(g){return g===a?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),p(g))}function p(g){return g===a?(e.exit(o),u(a)):g===null?n(g):le(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),we(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===a||g===null||le(g)?(e.exit("chunkString"),p(g)):(e.consume(g),g===92?h:d)}function h(g){return g===a||g===92?(e.consume(g),d):d(g)}}var Ls=M(()=>{"use strict";ut();Be()});function qn(e,t){let n;return r;function r(i){return le(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Se(i)?we(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var Ds=M(()=>{"use strict";ut();Be()});function Ob(e,t,n){let r=this,i;return o;function o(y){return e.enter("definition"),a(y)}function a(y){return uo.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function s(y){return i=xt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),u):n(y)}function u(y){return Le(y)?qn(e,p)(y):p(y)}function p(y){return co(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function d(y){return e.attempt(Rb,h,h)(y)}function h(y){return Se(y)?we(e,g,"whitespace")(y):g(y)}function g(y){return y===null||le(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function Cb(e,t,n){return r;function r(s){return Le(s)?qn(e,i)(s):n(s)}function i(s){return po(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Se(s)?we(e,a,"whitespace")(s):a(s)}function a(s){return s===null||le(s)?t(s):n(s)}}var Fs,Rb,fd=M(()=>{"use strict";Ms();Ns();ut();Ls();Ds();Be();Zn();Fs={name:"definition",tokenize:Ob},Rb={tokenize:Cb,partial:!0}});function Ib(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return le(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var Us,md=M(()=>{"use strict";Be();Us={name:"hardBreakEscape",tokenize:Ib}});function Pb(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},pt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Mb(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||Le(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||le(d)?(e.exit("atxHeading"),t(d)):Se(d)?we(e,s,"whitespace")(d):(e.enter("atxHeadingText"),p(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),s(d))}function p(d){return d===null||d===35||Le(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),p)}}var $s,gd=M(()=>{"use strict";ut();Be();hn();$s={name:"headingAtx",tokenize:Mb,resolve:Pb}});var yd,qs,bd=M(()=>{"use strict";yd=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],qs=["pre","script","style","textarea"]});function Db(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Fb(e,t,n){let r=this,i,o,a,s,u;return p;function p(_){return d(_)}function d(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),h}function h(_){return _===33?(e.consume(_),g):_===47?(e.consume(_),o=!0,ee):_===63?(e.consume(_),i=3,r.interrupt?t:A):ht(_)?(e.consume(_),a=String.fromCharCode(_),Z):n(_)}function g(_){return _===45?(e.consume(_),i=2,y):_===91?(e.consume(_),i=5,s=0,P):ht(_)?(e.consume(_),i=4,r.interrupt?t:A):n(_)}function y(_){return _===45?(e.consume(_),r.interrupt?t:A):n(_)}function P(_){let wt="CDATA[";return _===wt.charCodeAt(s++)?(e.consume(_),s===wt.length?r.interrupt?t:ze:P):n(_)}function ee(_){return ht(_)?(e.consume(_),a=String.fromCharCode(_),Z):n(_)}function Z(_){if(_===null||_===47||_===62||Le(_)){let wt=_===47,tn=a.toLowerCase();return!wt&&!o&&qs.includes(tn)?(i=1,r.interrupt?t(_):ze(_)):yd.includes(a.toLowerCase())?(i=6,wt?(e.consume(_),B):r.interrupt?t(_):ze(_)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):o?ue(_):ne(_))}return _===45||ft(_)?(e.consume(_),a+=String.fromCharCode(_),Z):n(_)}function B(_){return _===62?(e.consume(_),r.interrupt?t:ze):n(_)}function ue(_){return Se(_)?(e.consume(_),ue):U(_)}function ne(_){return _===47?(e.consume(_),U):_===58||_===95||ht(_)?(e.consume(_),ve):Se(_)?(e.consume(_),ne):U(_)}function ve(_){return _===45||_===46||_===58||_===95||ft(_)?(e.consume(_),ve):Oe(_)}function Oe(_){return _===61?(e.consume(_),$):Se(_)?(e.consume(_),Oe):ne(_)}function $(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),u=_,Ue):Se(_)?(e.consume(_),$):Xe(_)}function Ue(_){return _===u?(e.consume(_),u=null,je):_===null||le(_)?n(_):(e.consume(_),Ue)}function Xe(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||Le(_)?Oe(_):(e.consume(_),Xe)}function je(_){return _===47||_===62||Se(_)?ne(_):n(_)}function U(_){return _===62?(e.consume(_),Te):n(_)}function Te(_){return _===null||le(_)?ze(_):Se(_)?(e.consume(_),Te):n(_)}function ze(_){return _===45&&i===2?(e.consume(_),tt):_===60&&i===1?(e.consume(_),ct):_===62&&i===4?(e.consume(_),vt):_===63&&i===3?(e.consume(_),A):_===93&&i===5?(e.consume(_),Ft):le(_)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Nb,Mt,ye)(_)):_===null||le(_)?(e.exit("htmlFlowData"),ye(_)):(e.consume(_),ze)}function ye(_){return e.check(Lb,Ie,Mt)(_)}function Ie(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),Me}function Me(_){return _===null||le(_)?ye(_):(e.enter("htmlFlowData"),ze(_))}function tt(_){return _===45?(e.consume(_),A):ze(_)}function ct(_){return _===47?(e.consume(_),a="",Pt):ze(_)}function Pt(_){if(_===62){let wt=a.toLowerCase();return qs.includes(wt)?(e.consume(_),vt):ze(_)}return ht(_)&&a.length<8?(e.consume(_),a+=String.fromCharCode(_),Pt):ze(_)}function Ft(_){return _===93?(e.consume(_),A):ze(_)}function A(_){return _===62?(e.consume(_),vt):_===45&&i===2?(e.consume(_),A):ze(_)}function vt(_){return _===null||le(_)?(e.exit("htmlFlowData"),Mt(_)):(e.consume(_),vt)}function Mt(_){return e.exit("htmlFlow"),t(_)}}function Ub(e,t,n){let r=this;return i;function i(a){return le(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function $b(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(en,t,n)}}var js,Nb,Lb,wd=M(()=>{"use strict";Be();bd();no();js={name:"htmlFlow",tokenize:Fb,resolveTo:Db,concrete:!0},Nb={tokenize:$b,partial:!0},Lb={tokenize:Ub,partial:!0}});function qb(e,t,n){let r=this,i,o,a;return s;function s(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),u}function u(A){return A===33?(e.consume(A),p):A===47?(e.consume(A),Oe):A===63?(e.consume(A),ne):ht(A)?(e.consume(A),Xe):n(A)}function p(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),o=0,P):ht(A)?(e.consume(A),ue):n(A)}function d(A){return A===45?(e.consume(A),y):n(A)}function h(A){return A===null?n(A):A===45?(e.consume(A),g):le(A)?(a=h,ct(A)):(e.consume(A),h)}function g(A){return A===45?(e.consume(A),y):h(A)}function y(A){return A===62?tt(A):A===45?g(A):h(A)}function P(A){let vt="CDATA[";return A===vt.charCodeAt(o++)?(e.consume(A),o===vt.length?ee:P):n(A)}function ee(A){return A===null?n(A):A===93?(e.consume(A),Z):le(A)?(a=ee,ct(A)):(e.consume(A),ee)}function Z(A){return A===93?(e.consume(A),B):ee(A)}function B(A){return A===62?tt(A):A===93?(e.consume(A),B):ee(A)}function ue(A){return A===null||A===62?tt(A):le(A)?(a=ue,ct(A)):(e.consume(A),ue)}function ne(A){return A===null?n(A):A===63?(e.consume(A),ve):le(A)?(a=ne,ct(A)):(e.consume(A),ne)}function ve(A){return A===62?tt(A):ne(A)}function Oe(A){return ht(A)?(e.consume(A),$):n(A)}function $(A){return A===45||ft(A)?(e.consume(A),$):Ue(A)}function Ue(A){return le(A)?(a=Ue,ct(A)):Se(A)?(e.consume(A),Ue):tt(A)}function Xe(A){return A===45||ft(A)?(e.consume(A),Xe):A===47||A===62||Le(A)?je(A):n(A)}function je(A){return A===47?(e.consume(A),tt):A===58||A===95||ht(A)?(e.consume(A),U):le(A)?(a=je,ct(A)):Se(A)?(e.consume(A),je):tt(A)}function U(A){return A===45||A===46||A===58||A===95||ft(A)?(e.consume(A),U):Te(A)}function Te(A){return A===61?(e.consume(A),ze):le(A)?(a=Te,ct(A)):Se(A)?(e.consume(A),Te):je(A)}function ze(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,ye):le(A)?(a=ze,ct(A)):Se(A)?(e.consume(A),ze):(e.consume(A),Ie)}function ye(A){return A===i?(e.consume(A),i=void 0,Me):A===null?n(A):le(A)?(a=ye,ct(A)):(e.consume(A),ye)}function Ie(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Le(A)?je(A):(e.consume(A),Ie)}function Me(A){return A===47||A===62||Le(A)?je(A):n(A)}function tt(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function ct(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),Pt}function Pt(A){return Se(A)?we(e,Ft,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Ft(A)}function Ft(A){return e.enter("htmlTextData"),a(A)}}var Bs,Sd=M(()=>{"use strict";ut();Be();Bs={name:"htmlText",tokenize:qb}});function Vb(e){let t=-1;for(;++t<e.length;){let n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Hb(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);let u={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},p={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[a][1].end)},d={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[a-2][1].start)};return s=[["enter",u,t],["enter",p,t]],s=Rt(s,e.slice(o+1,o+r+3)),s=Rt(s,[["enter",d,t]]),s=Rt(s,En(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=Rt(s,[["exit",d,t],e[a-2],e[a-1],["exit",p,t]]),s=Rt(s,e.slice(a+1)),s=Rt(s,[["exit",u,t]]),pt(e,o,e.length,s),e}function Wb(e,t,n){let r=this,i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(g){return o?o._inactive?h(g):(a=r.parser.defined.includes(xt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),u):n(g)}function u(g){return g===40?e.attempt(jb,d,a?d:h)(g):g===91?e.attempt(Bb,d,a?p:h)(g):a?d(g):h(g)}function p(g){return e.attempt(zb,d,h)(g)}function d(g){return t(g)}function h(g){return o._balanced=!0,n(g)}}function Yb(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Le(h)?qn(e,o)(h):o(h)}function o(h){return h===41?d(h):co(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Le(h)?qn(e,u)(h):d(h)}function s(h){return n(h)}function u(h){return h===34||h===39||h===40?po(e,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function p(h){return Le(h)?qn(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Jb(e,t,n){let r=this;return i;function i(s){return uo.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(xt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function Gb(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var jn,jb,Bb,zb,ho=M(()=>{"use strict";Ms();Ns();Ls();Ds();Be();hn();Zn();Nr();jn={name:"labelEnd",tokenize:Wb,resolveTo:Hb,resolveAll:Vb},jb={tokenize:Yb},Bb={tokenize:Jb},zb={tokenize:Gb}});function Kb(e,t,n){let r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var zs,Td=M(()=>{"use strict";ho();zs={name:"labelStartImage",tokenize:Kb,resolveAll:jn.resolveAll}});function Xb(e,t,n){let r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var Vs,xd=M(()=>{"use strict";ho();Vs={name:"labelStartLink",tokenize:Xb,resolveAll:jn.resolveAll}});function Qb(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),we(e,t,"linePrefix")}}var Ur,kd=M(()=>{"use strict";ut();Ur={name:"lineEnding",tokenize:Qb}});function Zb(e,t,n){let r=0,i;return o;function o(p){return e.enter("thematicBreak"),a(p)}function a(p){return i=p,s(p)}function s(p){return p===i?(e.enter("thematicBreakSequence"),u(p)):r>=3&&(p===null||le(p))?(e.exit("thematicBreak"),t(p)):n(p)}function u(p){return p===i?(e.consume(p),r++,u):(e.exit("thematicBreakSequence"),Se(p)?we(e,s,"whitespace")(p):s(p))}}var Bn,Hs=M(()=>{"use strict";ut();Be();Bn={name:"thematicBreak",tokenize:Zb}});function nw(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(y){let P=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(P==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Ir(y)){if(r.containerState.type||(r.containerState.type=P,e.enter(P,{_container:!0})),P==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Bn,n,p)(y):p(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(y)}return n(y)}function u(y){return Ir(y)&&++a<10?(e.consume(y),u):(!r.interrupt||a<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),p(y)):n(y)}function p(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(en,r.interrupt?n:d,e.attempt(ew,g,h))}function d(y){return r.containerState.initialBlankLine=!0,o++,g(y)}function h(y){return Se(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),g):n(y)}function g(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function rw(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(en,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,we(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Se(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tw,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,we(e,e.attempt(kt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function iw(e,t,n){let r=this;return we(e,i,"listItemIndent",r.containerState.size+1);function i(o){let a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function ow(e){e.exit(this.containerState.type)}function aw(e,t,n){let r=this;return we(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let a=r.events[r.events.length-1];return!Se(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var kt,ew,tw,vd=M(()=>{"use strict";ut();Be();no();Hs();kt={name:"list",tokenize:nw,continuation:{tokenize:rw},exit:ow},ew={tokenize:aw,partial:!0},tw={tokenize:iw,partial:!0}});function sw(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let a={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function lw(e,t,n){let r=this,i;return o;function o(p){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=p,a(p)):n(p)}function a(p){return e.enter("setextHeadingLineSequence"),s(p)}function s(p){return p===i?(e.consume(p),s):(e.exit("setextHeadingLineSequence"),Se(p)?we(e,u,"lineSuffix")(p):u(p))}function u(p){return p===null||le(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}var fo,Ad=M(()=>{"use strict";ut();Be();fo={name:"setextUnderline",tokenize:lw,resolveTo:sw}});var mo=M(()=>{"use strict";rd();id();no();od();ad();sd();cd();ud();pd();hd();fd();md();gd();wd();Sd();ho();Td();xd();kd();vd();Ad();Hs()});function Ws(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hw,continuation:{tokenize:fw},exit:mw}},text:{91:{name:"gfmFootnoteCall",tokenize:dw},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uw,resolveTo:pw}}}}function uw(e,t,n){let r=this,i=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a;for(;i--;){let u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return s;function s(u){if(!a||!a._balanced)return n(u);let p=xt(r.sliceSerialize({start:a.end,end:r.now()}));return p.codePointAt(0)!==94||!o.includes(p.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function pw(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...u),e}function dw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,a;return s;function s(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(h){if(o>999||h===93&&!a||h===null||h===91||Le(h))return n(h);if(h===93){e.exit("chunkString");let g=e.exit("gfmFootnoteCallString");return i.includes(xt(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Le(h)||(a=!0),o++,e.consume(h),h===92?d:p}function d(h){return h===91||h===92||h===93?(e.consume(h),o++,p):p(h)}}function hw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,a=0,s;return u;function u(P){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(P),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(P){return P===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(P),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(P)}function d(P){if(a>999||P===93&&!s||P===null||P===91||Le(P))return n(P);if(P===93){e.exit("chunkString");let ee=e.exit("gfmFootnoteDefinitionLabelString");return o=xt(r.sliceSerialize(ee)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(P),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return Le(P)||(s=!0),a++,e.consume(P),P===92?h:d}function h(P){return P===91||P===92||P===93?(e.consume(P),a++,d):d(P)}function g(P){return P===58?(e.enter("definitionMarker"),e.consume(P),e.exit("definitionMarker"),i.includes(o)||i.push(o),we(e,y,"gfmFootnoteDefinitionWhitespace")):n(P)}function y(P){return t(P)}}function fw(e,t,n){return e.check(en,t,e.attempt(cw,t,n))}function mw(e){e.exit("gfmFootnoteDefinition")}function gw(e,t,n){let r=this;return we(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){let a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}var cw,Ed=M(()=>{"use strict";mo();ut();Be();Zn();cw={tokenize:gw,partial:!0}});var _d=M(()=>{"use strict";Ed()});function Ys(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let p=u;for(;p--;)if(a[p][0]==="exit"&&a[p][1].type==="strikethroughSequenceTemporary"&&a[p][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[p][1].end.offset-a[p][1].start.offset){a[u][1].type="strikethroughSequence",a[p][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},a[p][1].start),end:Object.assign({},a[u][1].end)},h={type:"strikethroughText",start:Object.assign({},a[p][1].end),end:Object.assign({},a[u][1].start)},g=[["enter",d,s],["enter",a[p][1],s],["exit",a[p][1],s],["enter",h,s]],y=s.parser.constructs.insideSpan.null;y&&pt(g,g.length,0,En(y,a.slice(p+1,u),s)),pt(g,g.length,0,[["exit",h,s],["enter",a[u][1],s],["exit",a[u][1],s],["exit",d,s]]),pt(a,p-1,u-p+3,g),u=p+g.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function o(a,s,u){let p=this.previous,d=this.events,h=0;return g;function g(P){return p===126&&d[d.length-1][1].type!=="characterEscape"?u(P):(a.enter("strikethroughSequenceTemporary"),y(P))}function y(P){let ee=rr(p);if(P===126)return h>1?u(P):(a.consume(P),h++,y);if(h<2&&!n)return u(P);let Z=a.exit("strikethroughSequenceTemporary"),B=rr(P);return Z._open=!B||B===2&&!!ee,Z._close=!ee||ee===2&&!!B,s(P)}}}var Rd=M(()=>{"use strict";hn();Rs();Nr()});var Od=M(()=>{"use strict";Rd()});function yw(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}var go,Cd=M(()=>{"use strict";go=class{constructor(){this.map=[]}add(t,n,r){yw(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}});function Id(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}var Pd=M(()=>{"use strict"});function Js(){return{flow:{null:{name:"table",tokenize:bw,resolveAll:ww}}}}function bw(e,t,n){let r=this,i=0,o=0,a;return s;function s(U){let Te=r.events.length-1;for(;Te>-1;){let Ie=r.events[Te][1].type;if(Ie==="lineEnding"||Ie==="linePrefix")Te--;else break}let ze=Te>-1?r.events[Te][1].type:null,ye=ze==="tableHead"||ze==="tableRow"?$:u;return ye===$&&r.parser.lazy[r.now().line]?n(U):ye(U)}function u(U){return e.enter("tableHead"),e.enter("tableRow"),p(U)}function p(U){return U===124||(a=!0,o+=1),d(U)}function d(U){return U===null?n(U):le(U)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),y):n(U):Se(U)?we(e,d,"whitespace")(U):(o+=1,a&&(a=!1,i+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),h(U)))}function h(U){return U===null||U===124||Le(U)?(e.exit("data"),d(U)):(e.consume(U),U===92?g:h)}function g(U){return U===92||U===124?(e.consume(U),h):h(U)}function y(U){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(U):(e.enter("tableDelimiterRow"),a=!1,Se(U)?we(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):P(U))}function P(U){return U===45||U===58?Z(U):U===124?(a=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),ee):Oe(U)}function ee(U){return Se(U)?we(e,Z,"whitespace")(U):Z(U)}function Z(U){return U===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),B):U===45?(o+=1,B(U)):U===null||le(U)?ve(U):Oe(U)}function B(U){return U===45?(e.enter("tableDelimiterFiller"),ue(U)):Oe(U)}function ue(U){return U===45?(e.consume(U),ue):U===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),ne):(e.exit("tableDelimiterFiller"),ne(U))}function ne(U){return Se(U)?we(e,ve,"whitespace")(U):ve(U)}function ve(U){return U===124?P(U):U===null||le(U)?!a||i!==o?Oe(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(U)):Oe(U)}function Oe(U){return n(U)}function $(U){return e.enter("tableRow"),Ue(U)}function Ue(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),Ue):U===null||le(U)?(e.exit("tableRow"),t(U)):Se(U)?we(e,Ue,"whitespace")(U):(e.enter("data"),Xe(U))}function Xe(U){return U===null||U===124||Le(U)?(e.exit("data"),Ue(U)):(e.consume(U),U===92?je:Xe)}function je(U){return U===92||U===124?(e.consume(U),Xe):Xe(U)}}function ww(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,u=0,p,d,h,g=new go;for(;++n<e.length;){let y=e[n],P=y[1];y[0]==="enter"?P.type==="tableHead"?(s=!1,u!==0&&(Md(g,t,u,p,d),d=void 0,u=0),p={type:"table",start:Object.assign({},P.start),end:Object.assign({},P.end)},g.add(n,0,[["enter",p,t]])):P.type==="tableRow"||P.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,d={type:"tableBody",start:Object.assign({},P.start),end:Object.assign({},P.end)},g.add(n,0,[["enter",d,t]])),i=P.type==="tableDelimiterRow"?2:d?3:1):i&&(P.type==="data"||P.type==="tableDelimiterMarker"||P.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],h=yo(g,t,o,i,void 0,h),o=[0,0,0,0]),a[2]=n)):P.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],h=yo(g,t,o,i,void 0,h)),o=a,a=[o[1],n,0,0])):P.type==="tableHead"?(s=!0,u=n):P.type==="tableRow"||P.type==="tableDelimiterRow"?(u=n,o[1]!==0?(a[0]=a[1],h=yo(g,t,o,i,n,h)):a[1]!==0&&(h=yo(g,t,a,i,n,h)),i=0):i&&(P.type==="data"||P.type==="tableDelimiterMarker"||P.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Md(g,t,u,p,d),g.consume(t.events),n=-1;++n<t.events.length;){let y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=Id(t.events,n))}return e}function yo(e,t,n,r,i,o){let a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},ir(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let u=ir(t.events,n[1]);if(o={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){let p=ir(t.events,n[2]),d=ir(t.events,n[3]),h={type:s,start:Object.assign({},p),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){let g=t.events[n[2]],y=t.events[n[3]];if(g[1].end=Object.assign({},y[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){let P=n[2]+1,ee=n[3]-n[2]-1;e.add(P,ee,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},ir(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Md(e,t,n,r,i){let o=[],a=ir(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function ir(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var Nd=M(()=>{"use strict";ut();Be();Cd();Pd()});var Ld=M(()=>{"use strict";Nd()});function Gs(){return{text:{91:Sw}}}function Tw(e,t,n){let r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return Le(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(u)}function s(u){return le(u)?t(u):Se(u)?e.check({tokenize:xw},t,n)(u):n(u)}}function xw(e,t,n){return we(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}var Sw,Dd=M(()=>{"use strict";ut();Be();Sw={name:"tasklistCheck",tokenize:Tw}});var Fd=M(()=>{"use strict";Dd()});function Ud(e){return to([Es(),Ws(),Ys(e),Js(),Gs()])}var $d=M(()=>{"use strict";vs();td();_d();Od();Ld();Fd()});function bo(e){let t=this,n=e||kw,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ud(n)),o.push(xs()),a.push(ks(n))}var kw,qd=M(()=>{"use strict";Vp();$d();kw={}});var jd=M(()=>{"use strict";qd()});function vw(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),we(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){let u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return le(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}var Bd,zd=M(()=>{"use strict";ut();Be();Bd={tokenize:vw}});function Aw(e){let t=this,n=[],r=0,i,o,a;return s;function s(ne){if(r<n.length){let ve=n[r];return t.containerState=ve[1],e.attempt(ve[0].continuation,u,p)(ne)}return p(ne)}function u(ne){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&ue();let ve=t.events.length,Oe=ve,$;for(;Oe--;)if(t.events[Oe][0]==="exit"&&t.events[Oe][1].type==="chunkFlow"){$=t.events[Oe][1].end;break}B(r);let Ue=ve;for(;Ue<t.events.length;)t.events[Ue][1].end=Object.assign({},$),Ue++;return pt(t.events,Oe+1,0,t.events.slice(ve)),t.events.length=Ue,p(ne)}return s(ne)}function p(ne){if(r===n.length){if(!i)return g(ne);if(i.currentConstruct&&i.currentConstruct.concrete)return P(ne);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Vd,d,h)(ne)}function d(ne){return i&&ue(),B(r),g(ne)}function h(ne){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,P(ne)}function g(ne){return t.containerState={},e.attempt(Vd,y,P)(ne)}function y(ne){return r++,n.push([t.currentConstruct,t.containerState]),g(ne)}function P(ne){if(ne===null){i&&ue(),B(0),e.consume(ne);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),ee(ne)}function ee(ne){if(ne===null){Z(e.exit("chunkFlow"),!0),B(0),e.consume(ne);return}return le(ne)?(e.consume(ne),Z(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(ne),ee)}function Z(ne,ve){let Oe=t.sliceStream(ne);if(ve&&Oe.push(null),ne.previous=o,o&&(o.next=ne),o=ne,i.defineSkip(ne.start),i.write(Oe),t.parser.lazy[ne.start.line]){let $=i.events.length;for(;$--;)if(i.events[$][1].start.offset<a&&(!i.events[$][1].end||i.events[$][1].end.offset>a))return;let Ue=t.events.length,Xe=Ue,je,U;for(;Xe--;)if(t.events[Xe][0]==="exit"&&t.events[Xe][1].type==="chunkFlow"){if(je){U=t.events[Xe][1].end;break}je=!0}for(B(r),$=Ue;$<t.events.length;)t.events[$][1].end=Object.assign({},U),$++;pt(t.events,Xe+1,0,t.events.slice(Ue)),t.events.length=$}}function B(ne){let ve=n.length;for(;ve-- >ne;){let Oe=n[ve];t.containerState=Oe[1],Oe[0].exit.call(t,e)}n.length=ne}function ue(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ew(e,t,n){return we(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var Hd,Vd,Wd=M(()=>{"use strict";ut();Be();hn();Hd={tokenize:Aw},Vd={tokenize:Ew}});function _w(e){let t=this,n=e.attempt(en,r,e.attempt(this.parser.constructs.flowInitial,i,we(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ps,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var Yd,Jd=M(()=>{"use strict";mo();ut();Yd={tokenize:_w}});function Qd(e){return{tokenize:t,resolveAll:Zd(e==="text"?Rw:void 0)};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(d){return p(d)?o(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return p(d)?(n.exit("data"),o(d)):(n.consume(d),u)}function p(d){if(d===null)return!0;let h=i[d],g=-1;if(h)for(;++g<h.length;){let y=h[g];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Zd(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Rw(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let r=e[n-1][1],i=t.sliceStream(r),o=i.length,a=-1,s=0,u;for(;o--;){let p=i[o];if(typeof p=="string"){for(a=p.length;p.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(p===-2)u=!0,s++;else if(p!==-1){o++;break}}if(s){let p={type:n===e.length||u||s<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+o,_bufferIndex:o?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},p.start),r.start.offset===r.end.offset?Object.assign(r,p):(e.splice(n,0,["enter",p,t],["exit",p,t]),n+=2)}n++}return e}var Gd,Kd,Xd,Ks=M(()=>{"use strict";Gd={resolveAll:Zd()},Kd=Qd("string"),Xd=Qd("text")});function eh(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),i={},o=[],a=[],s=[],u=!0,p={consume:ve,enter:Oe,exit:$,attempt:je(Ue),check:je(Xe),interrupt:je(Xe,{interrupt:!0})},d={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:ee,sliceSerialize:P,now:Z,defineSkip:B,write:y},h=t.tokenize.call(d,p),g;return t.resolveAll&&o.push(t),d;function y(ye){return a=Rt(a,ye),ue(),a[a.length-1]!==null?[]:(U(t,0),d.events=En(o,d.events,d),d.events)}function P(ye,Ie){return Cw(ee(ye),Ie)}function ee(ye){return Ow(a,ye)}function Z(){let{line:ye,column:Ie,offset:Me,_index:tt,_bufferIndex:ct}=r;return{line:ye,column:Ie,offset:Me,_index:tt,_bufferIndex:ct}}function B(ye){i[ye.line]=ye.column,ze()}function ue(){let ye;for(;r._index<a.length;){let Ie=a[r._index];if(typeof Ie=="string")for(ye=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ye&&r._bufferIndex<Ie.length;)ne(Ie.charCodeAt(r._bufferIndex));else ne(Ie)}}function ne(ye){u=void 0,g=ye,h=h(ye)}function ve(ye){le(ye)?(r.line++,r.column=1,r.offset+=ye===-3?2:1,ze()):ye!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=ye,u=!0}function Oe(ye,Ie){let Me=Ie||{};return Me.type=ye,Me.start=Z(),d.events.push(["enter",Me,d]),s.push(Me),Me}function $(ye){let Ie=s.pop();return Ie.end=Z(),d.events.push(["exit",Ie,d]),Ie}function Ue(ye,Ie){U(ye,Ie.from)}function Xe(ye,Ie){Ie.restore()}function je(ye,Ie){return Me;function Me(tt,ct,Pt){let Ft,A,vt,Mt;return Array.isArray(tt)?wt(tt):"tokenize"in tt?wt([tt]):_(tt);function _(dt){return In;function In(Yt){let nn=Yt!==null&&dt[Yt],wn=Yt!==null&&dt.null,dr=[...Array.isArray(nn)?nn:nn?[nn]:[],...Array.isArray(wn)?wn:wn?[wn]:[]];return wt(dr)(Yt)}}function wt(dt){return Ft=dt,A=0,dt.length===0?Pt:tn(dt[A])}function tn(dt){return In;function In(Yt){return Mt=Te(),vt=dt,dt.partial||(d.currentConstruct=dt),dt.name&&d.parser.constructs.disable.null.includes(dt.name)?Jn(Yt):dt.tokenize.call(Ie?Object.assign(Object.create(d),Ie):d,p,pr,Jn)(Yt)}}function pr(dt){return u=!0,ye(vt,Mt),ct}function Jn(dt){return u=!0,Mt.restore(),++A<Ft.length?tn(Ft[A]):Pt}}}function U(ye,Ie){ye.resolveAll&&!o.includes(ye)&&o.push(ye),ye.resolve&&pt(d.events,Ie,d.events.length-Ie,ye.resolve(d.events.slice(Ie),d)),ye.resolveTo&&(d.events=ye.resolveTo(d.events,d))}function Te(){let ye=Z(),Ie=d.previous,Me=d.currentConstruct,tt=d.events.length,ct=Array.from(s);return{restore:Pt,from:tt};function Pt(){r=ye,d.previous=Ie,d.currentConstruct=Me,d.events.length=tt,s=ct,ze()}}function ze(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ow(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex,a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){let s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function Cw(e,t){let n=-1,r=[],i;for(;++n<e.length;){let o=e[n],a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
17
- `;break}case-3:{a=`\r
18
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}var th=M(()=>{"use strict";Be();hn();Nr()});var Xs={};$a(Xs,{attentionMarkers:()=>Uw,contentInitial:()=>Pw,disable:()=>$w,document:()=>Iw,flow:()=>Nw,flowInitial:()=>Mw,insideSpan:()=>Fw,string:()=>Lw,text:()=>Dw});var Iw,Pw,Mw,Nw,Lw,Dw,Fw,Uw,$w,nh=M(()=>{"use strict";mo();Ks();Iw={42:kt,43:kt,45:kt,48:kt,49:kt,50:kt,51:kt,52:kt,53:kt,54:kt,55:kt,56:kt,57:kt,62:ro},Pw={91:Fs},Mw={[-2]:Dr,[-1]:Dr,32:Dr},Nw={35:$s,42:Bn,45:[fo,Bn],60:js,61:fo,95:Bn,96:ao,126:ao},Lw={38:oo,92:io},Dw={[-5]:Ur,[-4]:Ur,[-3]:Ur,33:zs,38:oo,42:Lr,60:[Os,Bs],91:Vs,92:[Us,io],93:jn,95:Lr,96:Cs},Fw={null:[Lr,Gd]},Uw={null:[42,95]},$w={null:[]}});function Qs(e){let n=to([Xs,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(Bd),document:i(Hd),flow:i(Yd),string:i(Kd),text:i(Xd)};return r;function i(o){return a;function a(s){return eh(r,o,s)}}}var rh=M(()=>{"use strict";vs();zd();Wd();Jd();Ks();th();nh()});function Zs(e){for(;!lo(e););return e}var ih=M(()=>{"use strict";Is()});function el(){let e=1,t="",n=!0,r;return i;function i(o,a,s){let u=[],p,d,h,g,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(oh.lastIndex=h,p=oh.exec(o),g=p&&p.index!==void 0?p.index:o.length,y=o.charCodeAt(g),!p){t=o.slice(h);break}if(y===10&&h===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<g&&(u.push(o.slice(h,g)),e+=g-h),y){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=g+1}return s&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}var oh,ah=M(()=>{"use strict";oh=/[\0\t\n\r]/g});var sh=M(()=>{"use strict";rh();ih();ah()});function _n(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?lh(e.position):"start"in e||"end"in e?lh(e):"line"in e||"column"in e?tl(e):""}function tl(e){return ch(e&&e.line)+":"+ch(e&&e.column)}function lh(e){return tl(e&&e.start)+"-"+tl(e&&e.end)}function ch(e){return e&&typeof e=="number"?e:1}var uh=M(()=>{"use strict"});var nl=M(()=>{"use strict";uh()});function rl(e,t,n){return typeof t!="string"&&(n=t,t=void 0),qw(n)(Zs(Qs(n).document().write(el()(e,t,!0))))}function qw(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ci),autolinkProtocol:je,autolinkEmail:je,atxHeading:o(si),blockQuote:o(Yt),characterEscape:je,characterReference:je,codeFenced:o(nn),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(nn,a),codeText:o(wn,a),codeTextData:je,data:je,codeFlowValue:je,definition:o(dr),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(ga),hardBreakEscape:o(li),hardBreakTrailing:o(li),htmlFlow:o(hr,a),htmlFlowData:je,htmlText:o(hr,a),htmlTextData:je,image:o(ya),label:a,link:o(ci),listItem:o(ba),listItemValue:g,listOrdered:o(ui,h),listUnordered:o(ui),paragraph:o(wa),reference:_,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(si),strong:o(Sa),thematicBreak:o(xa)},exit:{atxHeading:u(),atxHeadingSequence:Oe,autolink:u(),autolinkEmail:In,autolinkProtocol:dt,blockQuote:u(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:tn,characterReferenceMarkerNumeric:tn,characterReferenceValue:pr,characterReference:Jn,codeFenced:u(Z),codeFencedFence:ee,codeFencedFenceInfo:y,codeFencedFenceMeta:P,codeFlowValue:U,codeIndented:u(B),codeText:u(Me),codeTextData:U,data:U,definition:u(),definitionDestinationString:ve,definitionLabelString:ue,definitionTitleString:ne,emphasis:u(),hardBreakEscape:u(ze),hardBreakTrailing:u(ze),htmlFlow:u(ye),htmlFlowData:U,htmlText:u(Ie),htmlTextData:U,image:u(ct),label:Ft,labelText:Pt,lineEnding:Te,link:u(tt),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:wt,resourceDestinationString:A,resourceTitleString:vt,resource:Mt,setextHeading:u(Xe),setextHeadingLineSequence:Ue,setextHeadingText:$,strong:u(),thematicBreak:u()}};hh(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(q){let re={type:"root",children:[]},Ce={stack:[re],tokenStack:[],config:t,enter:s,exit:p,buffer:a,resume:d,data:n},De=[],He=-1;for(;++He<q.length;)if(q[He][1].type==="listOrdered"||q[He][1].type==="listUnordered")if(q[He][0]==="enter")De.push(He);else{let Nt=De.pop();He=i(q,Nt,He)}for(He=-1;++He<q.length;){let Nt=t[q[He][0]];dh.call(Nt,q[He][1].type)&&Nt[q[He][1].type].call(Object.assign({sliceSerialize:q[He][2].sliceSerialize},Ce),q[He][1])}if(Ce.tokenStack.length>0){let Nt=Ce.tokenStack[Ce.tokenStack.length-1];(Nt[1]||ph).call(Ce,void 0,Nt[0])}for(re.position={start:Rn(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:Rn(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)re=t.transforms[He](re)||re;return re}function i(q,re,Ce){let De=re-1,He=-1,Nt=!1,rn,Jt,on,Pn;for(;++De<=Ce;){let St=q[De];switch(St[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{St[0]==="enter"?He++:He--,Pn=void 0;break}case"lineEndingBlank":{St[0]==="enter"&&(rn&&!Pn&&!He&&!on&&(on=De),Pn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pn=void 0}if(!He&&St[0]==="enter"&&St[1].type==="listItemPrefix"||He===-1&&St[0]==="exit"&&(St[1].type==="listUnordered"||St[1].type==="listOrdered")){if(rn){let an=De;for(Jt=void 0;an--;){let Ut=q[an];if(Ut[1].type==="lineEnding"||Ut[1].type==="lineEndingBlank"){if(Ut[0]==="exit")continue;Jt&&(q[Jt][1].type="lineEndingBlank",Nt=!0),Ut[1].type="lineEnding",Jt=an}else if(!(Ut[1].type==="linePrefix"||Ut[1].type==="blockQuotePrefix"||Ut[1].type==="blockQuotePrefixWhitespace"||Ut[1].type==="blockQuoteMarker"||Ut[1].type==="listItemIndent"))break}on&&(!Jt||on<Jt)&&(rn._spread=!0),rn.end=Object.assign({},Jt?q[Jt][1].start:St[1].end),q.splice(Jt||De,0,["exit",rn,St[2]]),De++,Ce++}if(St[1].type==="listItemPrefix"){let an={type:"listItem",_spread:!1,start:Object.assign({},St[1].start),end:void 0};rn=an,q.splice(De,0,["enter",an,St[2]]),De++,Ce++,on=void 0,Pn=!0}}}return q[re][1]._spread=Nt,Ce}function o(q,re){return Ce;function Ce(De){s.call(this,q(De),De),re&&re.call(this,De)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(q,re,Ce){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([re,Ce]),q.position={start:Rn(re.start),end:void 0}}function u(q){return re;function re(Ce){q&&q.call(this,Ce),p.call(this,Ce)}}function p(q,re){let Ce=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==q.type&&(re?re.call(this,q,De[0]):(De[1]||ph).call(this,q,De[0]));else throw new Error("Cannot close `"+q.type+"` ("+_n({start:q.start,end:q.end})+"): it\u2019s not open");Ce.position.end=Rn(q.end)}function d(){return dn(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(q){if(this.data.expectingFirstListItemValue){let re=this.stack[this.stack.length-2];re.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function y(){let q=this.resume(),re=this.stack[this.stack.length-1];re.lang=q}function P(){let q=this.resume(),re=this.stack[this.stack.length-1];re.meta=q}function ee(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function Z(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function B(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q.replace(/(\r?\n|\r)$/g,"")}function ue(q){let re=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=re,Ce.identifier=xt(this.sliceSerialize(q)).toLowerCase()}function ne(){let q=this.resume(),re=this.stack[this.stack.length-1];re.title=q}function ve(){let q=this.resume(),re=this.stack[this.stack.length-1];re.url=q}function Oe(q){let re=this.stack[this.stack.length-1];if(!re.depth){let Ce=this.sliceSerialize(q).length;re.depth=Ce}}function $(){this.data.setextHeadingSlurpLineEnding=!0}function Ue(q){let re=this.stack[this.stack.length-1];re.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function Xe(){this.data.setextHeadingSlurpLineEnding=void 0}function je(q){let Ce=this.stack[this.stack.length-1].children,De=Ce[Ce.length-1];(!De||De.type!=="text")&&(De=Ta(),De.position={start:Rn(q.start),end:void 0},Ce.push(De)),this.stack.push(De)}function U(q){let re=this.stack.pop();re.value+=this.sliceSerialize(q),re.position.end=Rn(q.end)}function Te(q){let re=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ce=re.children[re.children.length-1];Ce.position.end=Rn(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(re.type)&&(je.call(this,q),U.call(this,q))}function ze(){this.data.atHardBreak=!0}function ye(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q}function Ie(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q}function Me(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q}function tt(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let re=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=re,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function ct(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let re=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=re,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function Pt(q){let re=this.sliceSerialize(q),Ce=this.stack[this.stack.length-2];Ce.label=Lp(re),Ce.identifier=xt(re).toLowerCase()}function Ft(){let q=this.stack[this.stack.length-1],re=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){let De=q.children;Ce.children=De}else Ce.alt=re}function A(){let q=this.resume(),re=this.stack[this.stack.length-1];re.url=q}function vt(){let q=this.resume(),re=this.stack[this.stack.length-1];re.title=q}function Mt(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function wt(q){let re=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=re,Ce.identifier=xt(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function tn(q){this.data.characterReferenceType=q.type}function pr(q){let re=this.sliceSerialize(q),Ce=this.data.characterReferenceType,De;Ce?(De=eo(re,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=nr(re);let He=this.stack[this.stack.length-1];He.value+=De}function Jn(q){let re=this.stack.pop();re.position.end=Rn(q.end)}function dt(q){U.call(this,q);let re=this.stack[this.stack.length-1];re.url=this.sliceSerialize(q)}function In(q){U.call(this,q);let re=this.stack[this.stack.length-1];re.url="mailto:"+this.sliceSerialize(q)}function Yt(){return{type:"blockquote",children:[]}}function nn(){return{type:"code",lang:null,meta:null,value:""}}function wn(){return{type:"inlineCode",value:""}}function dr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ga(){return{type:"emphasis",children:[]}}function si(){return{type:"heading",depth:0,children:[]}}function li(){return{type:"break"}}function hr(){return{type:"html",value:""}}function ya(){return{type:"image",title:null,url:"",alt:null}}function ci(){return{type:"link",title:null,url:"",children:[]}}function ui(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function ba(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function wa(){return{type:"paragraph",children:[]}}function Sa(){return{type:"strong",children:[]}}function Ta(){return{type:"text",value:""}}function xa(){return{type:"thematicBreak"}}}function Rn(e){return{line:e.line,column:e.column,offset:e.offset}}function hh(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?hh(e,r):jw(e,r)}}function jw(e,t){let n;for(n in t)if(dh.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function ph(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_n({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_n({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_n({start:t.start,end:t.end})+") is still open")}var dh,fh=M(()=>{"use strict";Cr();sh();ms();Dp();Zn();Zi();nl();dh={}.hasOwnProperty});var mh=M(()=>{"use strict";fh()});function wo(e){let t=this;t.parser=n;function n(r){return rl(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var gh=M(()=>{"use strict";mh()});var yh=M(()=>{"use strict";gh()});function il(e){if(e)throw e}var bh=M(()=>{"use strict"});var _h=$g((u0,Eh)=>{"use strict";var So=Object.prototype.hasOwnProperty,Ah=Object.prototype.toString,wh=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,Th=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ah.call(t)==="[object Array]"},xh=function(t){if(!t||Ah.call(t)!=="[object Object]")return!1;var n=So.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&So.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i=="undefined"||So.call(t,i)},kh=function(t,n){wh&&n.name==="__proto__"?wh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},vh=function(t,n){if(n==="__proto__")if(So.call(t,n)){if(Sh)return Sh(t,n).value}else return;return t[n]};Eh.exports=function e(){var t,n,r,i,o,a,s=arguments[0],u=1,p=arguments.length,d=!1;for(typeof s=="boolean"&&(d=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});u<p;++u)if(t=arguments[u],t!=null)for(n in t)r=vh(s,n),i=vh(t,n),s!==i&&(d&&i&&(xh(i)||(o=Th(i)))?(o?(o=!1,a=r&&Th(r)?r:[]):a=r&&xh(r)?r:{},kh(s,{name:n,newValue:e(d,a,i)})):typeof i!="undefined"&&kh(s,{name:n,newValue:i}));return s}});function $r(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var Rh=M(()=>{"use strict"});function ol(){let e=[],t={run:n,use:r};return t;function n(...i){let o=-1,a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(u,...p){let d=e[++o],h=-1;if(u){a(u);return}for(;++h<i.length;)(p[h]===null||p[h]===void 0)&&(p[h]=i[h]);i=p,d?Oh(d,s)(...p):a(null,...p)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Oh(e,t){let n;return r;function r(...a){let s=e.length>a.length,u;s&&a.push(i);try{u=e.apply(this,a)}catch(p){let d=p;if(s&&n)throw d;return i(d)}s||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}var Ch=M(()=>{"use strict"});var Ih=M(()=>{"use strict";Ch()});var yt,Ph=M(()=>{"use strict";nl();yt=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){let u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){let u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}let s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=_n(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}};yt.prototype.file="";yt.prototype.name="";yt.prototype.reason="";yt.prototype.message="";yt.prototype.stack="";yt.prototype.column=void 0;yt.prototype.line=void 0;yt.prototype.ancestors=void 0;yt.prototype.cause=void 0;yt.prototype.fatal=void 0;yt.prototype.place=void 0;yt.prototype.ruleId=void 0;yt.prototype.source=void 0});var Mh=M(()=>{"use strict";Ph()});var zt,Nh=M(()=>{"use strict";zt=jt(require("path"),1)});var al,Lh=M(()=>{"use strict";al=jt(require("process"),1)});function To(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Dh=M(()=>{"use strict"});var sl,Fh=M(()=>{"use strict";sl=require("url");Dh()});function cl(e,t){if(e&&e.includes(zt.default.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zt.default.sep+"`")}function ul(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Uh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Bw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var ll,qr,$h=M(()=>{"use strict";Mh();Nh();Lh();Fh();ll=["history","path","basename","stem","extname","dirname"],qr=class{constructor(t){let n;t?To(t)?n={path:t}:typeof t=="string"||Bw(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":al.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ll.length;){let o=ll[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ll.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?zt.default.basename(this.path):void 0}set basename(t){ul(t,"basename"),cl(t,"basename"),this.path=zt.default.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zt.default.dirname(this.path):void 0}set dirname(t){Uh(this.basename,"dirname"),this.path=zt.default.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zt.default.extname(this.path):void 0}set extname(t){if(cl(t,"extname"),Uh(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zt.default.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){To(t)&&(t=(0,sl.fileURLToPath)(t)),ul(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zt.default.basename(this.path,this.extname):void 0}set stem(t){ul(t,"stem"),cl(t,"stem"),this.path=zt.default.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){let i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){let i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){let i=new yt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var qh=M(()=>{"use strict";$h()});var jh,Bh=M(()=>{"use strict";jh=(function(e){let r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o})});function pl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hl(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zh(e){if(!$r(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Vh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xo(e){return Vw(e)?e:new qr(e)}function Vw(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Hw(e){return typeof e=="string"||Ww(e)}function Ww(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var ko,zw,fl,ml,Hh=M(()=>{"use strict";bh();ko=jt(_h(),1);Rh();Ih();qh();Bh();zw={}.hasOwnProperty,fl=class e extends jh{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ol()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let r=this.attachers[n];t.use(...r)}return t.data((0,ko.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(hl("data",this.frozen),this.namespace[t]=n,this):zw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hl("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let n=xo(t),r=this.parser||this.Parser;return pl("parse",r),r(String(n),n)}process(t,n){let r=this;return this.freeze(),pl("process",this.parser||this.Parser),dl("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){let s=xo(t),u=r.parse(s);r.run(u,s,function(d,h,g){if(d||!h||!g)return p(d);let y=h,P=r.stringify(y,g);Hw(P)?g.value=P:g.result=P,p(d,g)});function p(d,h){d||!h?a(d):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),pl("processSync",this.parser||this.Parser),dl("processSync",this.compiler||this.Compiler),this.process(t,i),Vh("processSync","process",n),r;function i(o,a){n=!0,il(o),r=a}}run(t,n,r){zh(t),this.freeze();let i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){let u=xo(n);i.run(t,u,p);function p(d,h,g){let y=h||t;d?s(d):a?a(y):r(void 0,y,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Vh("runSync","run",r),i;function o(a,s){il(a),i=s,r=!0}}stringify(t,n){this.freeze();let r=xo(n),i=this.compiler||this.Compiler;return dl("stringify",i),zh(t),i(t,r)}use(t,...n){let r=this.attachers,i=this.namespace;if(hl("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(p){if(typeof p=="function")u(p,[]);else if(typeof p=="object")if(Array.isArray(p)){let[d,...h]=p;u(d,h)}else a(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function a(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(p.plugins),p.settings&&(i.settings=(0,ko.default)(!0,i.settings,p.settings))}function s(p){let d=-1;if(p!=null)if(Array.isArray(p))for(;++d<p.length;){let h=p[d];o(h)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function u(p,d){let h=-1,g=-1;for(;++h<r.length;)if(r[h][0]===p){g=h;break}if(g===-1)r.push([p,...d]);else if(d.length>0){let[y,...P]=d,ee=r[g][1];$r(ee)&&$r(y)&&(y=(0,ko.default)(!0,ee,y)),r[g]=[p,y,...P]}}}},ml=new fl().freeze()});var Wh=M(()=>{"use strict";Hh()});function Jh(e,t){let n=[e,...t],r=Math.max(...n.map(s=>s.length));if(r===0)return"";let i=Array.from({length:r},()=>0);for(let s of n)for(let u=0;u<r;u++){let p=(s[u]||"").length;p>i[u]&&(i[u]=p)}let o=s=>Array.from({length:r},(u,p)=>(s[p]||"").padEnd(i[p])).join(" | ").trimEnd(),a=[];a.push(o(e)),a.push(i.map(s=>"-".repeat(s)).join("-|-"));for(let s of t)a.push(o(s));return a.join(`
19
- `)}function yl(e){return ml().use(wo).use(bo).parse(e)}function jr(e){return dn(e)}function mn(e){return{type:"text",value:e}}function gn(e){return{type:"paragraph",children:e}}function yn(e){return{type:"root",children:e}}function bl(e={}){var t;return{type:"card",title:e.title,subtitle:e.subtitle,imageUrl:e.imageUrl,children:(t=e.children)!=null?t:[]}}function gl(e,t={}){return{type:"text",content:e,style:t.style}}function vo(e){return{type:"image",url:e.url,alt:e.alt}}function Ao(){return{type:"divider"}}function Eo(e){return{type:"section",children:e}}function _o(e){return{type:"actions",children:e}}function Ro(e){return{type:"button",id:e.id,label:e.label,style:e.style,value:e.value,disabled:e.disabled,actionType:e.actionType,callbackUrl:e.callbackUrl}}function Oo(e){return{type:"link-button",id:e.id,url:e.url,label:e.label,style:e.style}}function Co(e){return{type:"field",label:e.label,value:e.value}}function Io(e){return{type:"fields",children:e}}function Po(e){return{type:"table",headers:e.headers,rows:e.rows,align:e.align}}function Mo(e){return{type:"link",url:e.url,label:e.label}}function Br(e){let t=[];e.title&&t.push(`**${e.title}**`),e.subtitle&&t.push(e.subtitle);for(let n of e.children){let r=wl(n);r&&t.push(r)}return t.join(`
20
- `)}function wl(e){switch(e.type){case"text":return e.content;case"link":return`${e.label} (${e.url})`;case"fields":return e.children.map(t=>`${t.label}: ${t.value}`).join(`
21
- `);case"actions":return null;case"table":return Jh(e.headers,e.rows);case"section":return e.children.map(t=>wl(t)).filter(Boolean).join(`
22
- `);default:return null}}function Kh(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="modal"}function Jw(e){let t=e.filter(n=>typeof n=="object"&&n!==null&&"type"in n&&Yw.includes(n.type));return t.length<e.length&&console.warn("[chat] Modal contains unsupported child elements that were ignored"),t}function No(e){var t;return{type:"modal",callbackId:e.callbackId,callbackUrl:e.callbackUrl,title:e.title,submitLabel:e.submitLabel,closeLabel:e.closeLabel,notifyOnClose:e.notifyOnClose,privateMetadata:e.privateMetadata,children:(t=e.children)!=null?t:[]}}function Lo(e){return{type:"text_input",id:e.id,label:e.label,placeholder:e.placeholder,initialValue:e.initialValue,multiline:e.multiline,optional:e.optional,maxLength:e.maxLength}}function Do(e){if(!e.options||e.options.length===0)throw new Error("Select requires at least one option");return{type:"select",id:e.id,label:e.label,placeholder:e.placeholder,options:e.options,initialOption:e.initialOption,optional:e.optional}}function Fo(e){return{type:"external_select",id:e.id,initialOption:e.initialOption,label:e.label,placeholder:e.placeholder,minQueryLength:e.minQueryLength,optional:e.optional}}function Uo(e){return{label:e.label,value:e.value,description:e.description}}function $o(e){if(!e.options||e.options.length===0)throw new Error("RadioSelect requires at least one option");return{type:"radio_select",id:e.id,label:e.label,options:e.options,initialOption:e.initialOption,optional:e.optional}}function qo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sl}function Tl(e){if(e==null)return[];if(Array.isArray(e))return e.flatMap(Tl);if(qo(e)){let t=kl(e);return t?[t]:[]}return typeof e=="object"&&"type"in e?[e]:typeof e=="string"||typeof e=="number"?[String(e)]:[]}function Gw(e){return!("id"in e||"url"in e||"label"in e)}function Kw(e){return"id"in e&&typeof e.id=="string"&&!("url"in e)}function Xw(e){return"url"in e&&typeof e.url=="string"&&!("id"in e)}function xl(e){return"url"in e&&typeof e.url=="string"&&!("id"in e)&&!("alt"in e)&&!("style"in e)}function Qw(e){return"url"in e&&typeof e.url=="string"}function Zw(e){return"label"in e&&"value"in e&&typeof e.label=="string"&&typeof e.value=="string"}function eS(e){return!("id"in e||"url"in e||"callbackId"in e)&&("title"in e||"subtitle"in e||"imageUrl"in e)}function tS(e){return"callbackId"in e&&"title"in e}function nS(e){return"id"in e&&"label"in e&&!("options"in e)&&!("value"in e)}function Yh(e){return"id"in e&&"label"in e&&!("value"in e)}function rS(e){return"id"in e&&"label"in e&&!("value"in e)&&!("children"in e)}function iS(e){return"label"in e&&"value"in e&&!("id"in e)}function kl(e){var a,s,u,p;let{type:t,props:n,children:r}=e,i=Tl(r);if(t===gl){let d=Gw(n)?n:{style:void 0},h=i.length>0?i.map(String).join(""):String((a=d.children)!=null?a:"");return gl(h,{style:d.style})}if(t===Eo)return Eo(i);if(t===_o)return _o(i);if(t===Io)return Io(i);if(t===Ro){if(!Kw(n))throw new Error("Button requires an 'id' prop");let d=i.length>0?i.map(String).join(""):(s=n.label)!=null?s:"";return Ro({id:n.id,label:d,style:n.style,value:n.value,actionType:n.actionType,callbackUrl:n.callbackUrl,disabled:n.disabled})}if(t===Oo){if(!Xw(n))throw new Error("LinkButton requires a 'url' prop");let d=i.length>0?i.map(String).join(""):(u=n.label)!=null?u:"";return Oo({id:n.id,url:n.url,label:d,style:n.style})}if(t===Mo){if(!xl(n))throw new Error("CardLink requires a 'url' prop");let d=i.length>0?i.map(String).join(""):(p=n.label)!=null?p:"";return Mo({url:n.url,label:d})}if(t===vo){if(!Qw(n))throw new Error("Image requires a 'url' prop");return vo({url:n.url,alt:n.alt})}if(t===Co){if(!Zw(n))throw new Error("Field requires 'label' and 'value' props");return Co({label:n.label,value:n.value})}if(t===Ao)return Ao();if(t===No){if(!tS(n))throw new Error("Modal requires 'callbackId' and 'title' props");return No({callbackId:n.callbackId,callbackUrl:n.callbackUrl,title:n.title,submitLabel:n.submitLabel,closeLabel:n.closeLabel,notifyOnClose:n.notifyOnClose,privateMetadata:n.privateMetadata,children:Jw(i)})}if(t===Lo){if(!nS(n))throw new Error("TextInput requires 'id' and 'label' props");return Lo({id:n.id,label:n.label,placeholder:n.placeholder,initialValue:n.initialValue,multiline:n.multiline,optional:n.optional,maxLength:n.maxLength})}if(t===Do){if(!Yh(n))throw new Error("Select requires 'id' and 'label' props");return Do({id:n.id,label:n.label,placeholder:n.placeholder,initialOption:n.initialOption,optional:n.optional,options:i})}if(t===Fo){if(!rS(n))throw new Error("ExternalSelect requires 'id' and 'label' props");return Fo({id:n.id,initialOption:n.initialOption,label:n.label,placeholder:n.placeholder,minQueryLength:n.minQueryLength,optional:n.optional})}if(t===$o){if(!Yh(n))throw new Error("RadioSelect requires 'id' and 'label' props");return $o({id:n.id,label:n.label,initialOption:n.initialOption,optional:n.optional,options:i})}if(t===Uo){if(!iS(n))throw new Error("SelectOption requires 'label' and 'value' props");return Uo({label:n.label,value:n.value,description:n.description})}if(t===Po){let d=n;return Po({headers:d.headers,rows:d.rows})}let o=eS(n)?n:{};return bl({title:o.title,subtitle:o.subtitle,imageUrl:o.imageUrl,children:i})}function vl(e,t,n){let{children:r,...i}=t;return{$$typeof:Sl,type:e,props:i,children:r!=null?[r]:[]}}function Xh(e,t,n){let{children:r,...i}=t,o;return Array.isArray(r)?o=r:r!=null?o=[r]:o=[],{$$typeof:Sl,type:e,props:i,children:o}}function Zh(e){return Tl(e.children)}function Vt(e){if(qo(e)){let t=kl(e);if(t&&typeof t=="object"&&"type"in t&&t.type==="card")return t}return typeof e=="object"&&e!==null&&"type"in e&&e.type==="card"?e:null}function Al(e){if(qo(e)){let t=kl(e);if(t&&typeof t=="object"&&"type"in t&&t.type==="modal")return t}return Kh(e)?e:null}function Ht(e){if(qo(e))return!0;if(typeof e=="object"&&e!==null&&"$$typeof"in e&&typeof e.$$typeof=="symbol"){let t=e.$$typeof.toString();return t.includes("react.element")||t.includes("react.transitional.element")}return!1}var Gh,Yw,Sl,Qh,El=M(()=>{"use strict";Cr();jd();yh();Wh();Gh=gl;Yw=["text_input","select","external_select","radio_select","text","fields"];Sl=Symbol.for("chat.jsx.element");Qh=vl});var Df={};$a(Df,{Fragment:()=>Zh,isCardLinkProps:()=>xl,isJSX:()=>Ht,jsx:()=>vl,jsxDEV:()=>Qh,jsxs:()=>Xh,toCardElement:()=>Vt,toModalElement:()=>Al});var Ff=M(()=>{"use strict";El()});var Nk={};$a(Nk,{Actions:()=>Vr,AgentDeliveryError:()=>Wt,AgentError:()=>bn,Button:()=>Hr,Card:()=>Wr,CardLink:()=>Yr,CardText:()=>Jr,Client:()=>lr,CronExpression:()=>qa,Divider:()=>Gr,Image:()=>Kr,NovuRequestHandler:()=>la,Select:()=>Xr,SelectOption:()=>Qr,SeverityLevelEnum:()=>fa,TextInput:()=>Zr,agent:()=>Yl,isFromWorkflow:()=>Dl,providerSchemas:()=>ua,step:()=>og,toAgentError:()=>ri,workflow:()=>ig});module.exports=qg(Nk);var sm=require("jsonrepair");var xr=(i=>(i.TRIGGER="trigger",i.EXECUTE="execute",i.PREVIEW="preview",i.AGENT_EVENT="agent-event",i))(xr||{}),wi=(r=>(r.DISCOVER="discover",r.HEALTH_CHECK="health-check",r.CODE="code",r))(wi||{});var qa=(te=>(te.EVERY_SECOND="* * * * * *",te.EVERY_5_SECONDS="*/5 * * * * *",te.EVERY_10_SECONDS="*/10 * * * * *",te.EVERY_30_SECONDS="*/30 * * * * *",te.EVERY_MINUTE="*/1 * * * *",te.EVERY_5_MINUTES="0 */5 * * * *",te.EVERY_10_MINUTES="0 */10 * * * *",te.EVERY_30_MINUTES="0 */30 * * * *",te.EVERY_HOUR="0 0-23/1 * * *",te.EVERY_2_HOURS="0 0-23/2 * * *",te.EVERY_3_HOURS="0 0-23/3 * * *",te.EVERY_4_HOURS="0 0-23/4 * * *",te.EVERY_5_HOURS="0 0-23/5 * * *",te.EVERY_6_HOURS="0 0-23/6 * * *",te.EVERY_7_HOURS="0 0-23/7 * * *",te.EVERY_8_HOURS="0 0-23/8 * * *",te.EVERY_9_HOURS="0 0-23/9 * * *",te.EVERY_10_HOURS="0 0-23/10 * * *",te.EVERY_11_HOURS="0 0-23/11 * * *",te.EVERY_12_HOURS="0 0-23/12 * * *",te.EVERY_DAY_AT_1AM="0 01 * * *",te.EVERY_DAY_AT_2AM="0 02 * * *",te.EVERY_DAY_AT_3AM="0 03 * * *",te.EVERY_DAY_AT_4AM="0 04 * * *",te.EVERY_DAY_AT_5AM="0 05 * * *",te.EVERY_DAY_AT_6AM="0 06 * * *",te.EVERY_DAY_AT_7AM="0 07 * * *",te.EVERY_DAY_AT_8AM="0 08 * * *",te.EVERY_DAY_AT_9AM="0 09 * * *",te.EVERY_DAY_AT_10AM="0 10 * * *",te.EVERY_DAY_AT_11AM="0 11 * * *",te.EVERY_DAY_AT_NOON="0 12 * * *",te.EVERY_DAY_AT_1PM="0 13 * * *",te.EVERY_DAY_AT_2PM="0 14 * * *",te.EVERY_DAY_AT_3PM="0 15 * * *",te.EVERY_DAY_AT_4PM="0 16 * * *",te.EVERY_DAY_AT_5PM="0 17 * * *",te.EVERY_DAY_AT_6PM="0 18 * * *",te.EVERY_DAY_AT_7PM="0 19 * * *",te.EVERY_DAY_AT_8PM="0 20 * * *",te.EVERY_DAY_AT_9PM="0 21 * * *",te.EVERY_DAY_AT_10PM="0 22 * * *",te.EVERY_DAY_AT_11PM="0 23 * * *",te.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",te.EVERY_WEEK="0 0 * * 0",te.EVERY_WEEKDAY="0 0 * * 1-5",te.EVERY_WEEKEND="0 0 * * 6,0",te.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",te.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",te.EVERY_2ND_DAY_OF_MONTH_AT_10AM="0 10 2 * *",te.EVERY_2ND_HOUR="0 */2 * * *",te.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",te.EVERY_2ND_MONTH="0 0 1 */2 *",te.EVERY_QUARTER="0 0 1 */3 *",te.EVERY_6_MONTHS="0 0 1 */6 *",te.EVERY_YEAR="0 0 1 0 *",te.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",te.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",te.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",te.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",te.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",te.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",te.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",te.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",te.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",te.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",te.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",te.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",te.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",te.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",te.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",te.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",te.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",te.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",te.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",te.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",te.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",te.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",te.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",te.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",te.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",te.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",te.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",te.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",te))(qa||{});var Bt=(Te=>(Te.BRIDGE_ERROR="BridgeError",Te.EXECUTION_EVENT_CONTROL_INVALID_ERROR="ExecutionEventControlInvalidError",Te.EXECUTION_EVENT_PAYLOAD_INVALID_ERROR="ExecutionEventPayloadInvalidError",Te.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",Te.EXECUTION_STATE_CONTROL_INVALID_ERROR="ExecutionStateControlInvalidError",Te.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",Te.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",Te.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",Te.INVALID_ACTION_ERROR="InvalidActionError",Te.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",Te.MISSING_DEPENDENCY_ERROR="MissingDependencyError",Te.MISSING_SECRET_KEY_ERROR="MissingSecretKeyError",Te.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",Te.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",Te.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",Te.SIGNATURE_INVALID_ERROR="SignatureInvalidError",Te.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",Te.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",Te.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",Te.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",Te.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",Te.STEP_CONTROL_COMPILATION_FAILED_ERROR="StepControlCompilationFailedError",Te.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",Te.STEP_NOT_FOUND_ERROR="StepNotFoundError",Te.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",Te.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",Te.WORKFLOW_PAYLOAD_INVALID_ERROR="WorkflowPayloadInvalidError",Te))(Bt||{});var Si=(r=>(r.POST="POST",r.GET="GET",r.OPTIONS="OPTIONS",r))(Si||{});var jg=e=>{var n,r;if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(r=(n=t==null?void 0:t.constructor)==null?void 0:n.name.endsWith("Error"))!=null?r:!1},un=class extends Error{},Ti=class extends un{constructor(){super(...arguments);this.statusCode=404}},_t=class extends un{constructor(){super(...arguments);this.statusCode=400}},Tn=class extends un{constructor(){super(...arguments);this.statusCode=401}},xn=class extends un{constructor(t,{cause:n}={}){var r;jg(n)?(super(`${t}: ${n.message}`),this.data={stack:(r=n.stack)!=null?r:t}):(super(`${t}${n?`: ${JSON.stringify(n,null,2)}`:""}`),this.data={stack:t})}},xi=class extends un{constructor(){super(...arguments);this.statusCode=409}};var Kn=class extends xn{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var ki=class extends _t{constructor(n,r){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${r}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:r}}},vr=class extends _t{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=r}},vi=class extends _t{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=r}},Ai=class extends _t{constructor(n,r,i){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=i}},Ei=class extends _t{constructor(n,r,i){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=i}},_i=class extends _t{constructor(n,r,i){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=i}},Ri=class extends _t{constructor(n,r,i){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${r}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=i}},Oi=class extends _t{constructor(n,r,i,o){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` and provider with id: \`${i}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=o}},Ci=class extends _t{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=r}};var Mn=e=>Object.values(Bt).includes(e==null?void 0:e.code),Jc=e=>!Mn(e)&&typeof e.statusCode=="number"&&e.statusCode>=400&&e.statusCode<500;var ja=e=>Object.values(e).map(t=>`\`${t}\``).join(", "),Ii=e=>e.replaceAll(/(\w)(\w*)/g,(t,n,r)=>n.toUpperCase()+r.toLowerCase()).replaceAll(/[\s-]+/g,"");var Pi=class extends un{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${ja(Si)}`}},Nn=class extends _t{constructor(n,r){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${ja(r)}`);this.code="InvalidActionError"}},Mi=class extends _t{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var Ni=class extends Error{constructor(t,n,r){super(),this.data={message:r},this.statusCode=t,this.code=n}};var Ar=class extends xi{constructor(t,n){super(`${Ii(t)} with id: \`${n}\` already exists. Please use a different id.`)}},kn=class extends Ti{constructor(t,n){super(`${Ii(t)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},Xn=class extends xn{constructor(n,r,i,o){super(`Failed to ${i} ${Ii(n)} with id: \`${r}\``,{cause:o});this.statusCode=502}};var Li=class extends kn{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},Di=class extends Xn{constructor(n,r,i){super("provider",n,r,i);this.code="ProviderExecutionFailedError"}};var Fi=class extends Tn{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"}},Ui=class extends Tn{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},$i=class extends Tn{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},qi=class extends Tn{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},ji=class extends Tn{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var Bi=class extends kn{constructor(n){super("step",n);this.code="StepNotFoundError"}},zi=class extends Ar{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},Er=class extends Xn{constructor(n,r,i){super("step",n,r,i);this.code="StepExecutionFailedError"}};var _r=class extends kn{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}};var Vi=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(l,c)=>function(){return l&&(c=(0,l[n(l)[0]])(l=0)),c},o=(l,c)=>function(){return c||(0,l[n(l)[0]])((c={exports:{}}).exports,c),c.exports},a=(l,c)=>{for(var f in c)e(l,f,{get:c[f],enumerable:!0})},s=(l,c,f,S)=>{if(c&&typeof c=="object"||typeof c=="function")for(let T of n(c))!r.call(l,T)&&T!==f&&e(l,T,{get:()=>c[T],enumerable:!(S=t(c,T))||S.enumerable});return l},u=l=>s(e({},"__esModule",{value:!0}),l),p={};a(p,{JSONSchemaFaker:()=>Hc,default:()=>Wc,setDependencies:()=>ac});function d(l,c){return typeof l=="string"?typeof c!="undefined"?gr.register(l,c):gr.get(l):gr.registerMany(l)}function h(l,c){return l=typeof l=="undefined"?Kt.MIN_INTEGER:l,c=typeof c=="undefined"?Kt.MAX_INTEGER:c,Math.floor(_e("random")()*(c-l+1))+l}function g(l){return di.default.prototype.max=_e("defaultRandExpMax"),di.default.prototype.randInt=(f,S)=>f+Math.floor(_e("random")()*(1+(S-f))),new di.default(l).gen()}function y(l){return l[Math.floor(_e("random")()*l.length)]}function P(l){let c,f,S=l.length,T=l.slice();for(;S>0;)f=Math.floor(_e("random")()*S),S-=1,c=T[S],T[S]=T[f],T[f]=c;return T}function ee(l,c){return _e("random")()*(c-l)+l}function Z(l,c,f,S,T=!1){return f=typeof f=="undefined"?Kt.MIN_NUMBER:f,S=typeof S=="undefined"?Kt.MAX_NUMBER:S,l=typeof l=="undefined"?f:l,c=typeof c=="undefined"?S:c,c<l&&(c+=l),T?ee(l,c):h(l,c)}function B(l){switch(l){case"seconds":return Z(0,60)*60;case"minutes":return Z(15,50)*612;case"hours":return Z(12,72)*36123;case"days":return Z(7,30)*86412345;case"weeks":return Z(4,52)*604812345;case"months":return Z(2,13)*2592012345;case"years":return Z(1,20)*31104012345;default:break}}function ue(l){if(l)return B(l);let c=_e("minDateTime"),f=_e("maxDateTime");typeof c=="string"&&(c=new Date(c)),typeof f=="string"&&(f=new Date(f));let S=new Date().getTime();return typeof c=="number"&&(c=new Date(S+c)),typeof f=="number"&&(f=new Date(S+f)),new Date(ee(c.getTime(),f.getTime()))}function ne(l,c,f){if(c=decodeURIComponent(c),f&&f[c])return Te(f[c]);let S=c.replace("#/","/").split("/"),T=l.$ref&&f&&f[l.$ref]||l;for(!T&&!S[0]&&(S[0]=l.$ref.split("#/")[0]),f&&c.includes("#/")&&f[S[0]]&&(T=f[S.shift()]),S[0]||S.shift();T&&S.length>0;){let v=S.shift();if(!T[v])throw new Error(`Prop not found: ${v} (${c})`);T=T[v]}return T}function ve(l){return typeof l=="string"&&gc.test(l)}function Oe(l){return["number","boolean"].includes(typeof l)}function $(l,...c){return c.filter(f=>typeof l[f]!="undefined").length>0}function Ue(l){if(l.includes(" "))return new Date(l).toISOString().substr(0,10);let[c,f,S]=l.split("T")[0].split("-");return f=`0${Math.max(1,Math.min(12,f))}`.slice(-2),S=`0${Math.max(1,Math.min(31,S))}`.slice(-2),`${c}-${f}-${S}`}function Xe(l){if(l.includes(" "))return new Date(l).toISOString().substr(0,10);let[c,f]=l.split("T"),[S,T,v]=c.split("-"),[k,L,Q]=f.substr(0,8).split(":");return T=`0${Math.max(1,Math.min(12,T))}`.slice(-2),v=`0${Math.max(1,Math.min(31,v))}`.slice(-2),k=`0${Math.max(1,Math.min(23,k))}`.slice(-2),L=`0${Math.max(1,Math.min(59,L))}`.slice(-2),Q=`0${Math.max(1,Math.min(59,Q))}`.slice(-2),`${S}-${T}-${v}T${k}:${L}:${Q}.000Z`}function je(l,c,f){let S={};switch(l||c.type){case"integer":case"number":if(typeof c.minimum!="undefined"&&(S.minimum=c.minimum),typeof c.maximum!="undefined"&&(S.maximum=c.maximum),c.enum){let v=Math.max(S.minimum||0,0),k=Math.min(S.maximum||1/0,1/0);c.exclusiveMinimum&&v===c.minimum&&(v+=c.multipleOf||1),c.exclusiveMaximum&&k===c.maximum&&(k-=c.multipleOf||1),(v||k!==1/0)&&(c.enum=c.enum.filter(L=>L>=v&&L<=k))}break;case"string":{S.minLength=_e("minLength")||0,S.maxLength=_e("maxLength")||Number.MAX_SAFE_INTEGER,typeof c.minLength!="undefined"&&(S.minLength=Math.max(S.minLength,c.minLength)),typeof c.maxLength!="undefined"&&(S.maxLength=Math.min(S.maxLength,c.maxLength));break}default:break}let T=f(S);if(T==null)return null;switch(l||c.type){case"number":T=ve(T)?parseFloat(T):T;break;case"integer":T=ve(T)?parseInt(T,10):T;break;case"boolean":T=!!T;break;case"string":{if(Oe(T))return T;T=String(T);let v=Math.max(S.minLength||0,0),k=Math.min(S.maxLength||1/0,1/0),L,Q=0;for(;T.length<v;)if(L=T,c.pattern?T+=Ae.randexp(c.pattern):T+=`${Ae.pick([" ","/","_","-","+","=","@","^"])}${T}`,T===L){if(Q+=1,Q===3)break}else Q=0;switch(T.length>k&&(T=T.substr(0,k)),c.format){case"date-time":case"datetime":T=new Date(Xe(T)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":T=new Date(Ue(T)).toISOString().substr(0,10);break;case"time":T=new Date(`1969-01-01 ${T}`).toISOString().substr(11);break;default:break}break}default:break}return T}function U(l,c){return Object.keys(c).forEach(f=>{typeof c[f]!="object"||c[f]===null?l[f]=c[f]:Array.isArray(c[f])?(l[f]=l[f]||[],c[f].forEach((S,T)=>{l.type==="array"&&c.type==="array"?l[f][T]=U(l[f][T]||{},S,!0):Array.isArray(l[f])&&l[f].indexOf(S)===-1&&l[f].push(S)})):typeof l[f]!="object"||l[f]===null||Array.isArray(l[f])?l[f]=U({},c[f]):l[f]=U(l[f],c[f])}),l}function Te(l,c=new Map){if(!l||typeof l!="object")return l;if(c.has(l))return c.get(l);if(Array.isArray(l)){let S=[];return c.set(l,S),S.push(...l.map(T=>Te(T,c))),S}let f={};return c.set(l,f),Object.keys(l).reduce((S,T)=>(S[T]=Te(l[T],c),S),f)}function ze(l){let c=JSON.stringify(l),f=JSON.stringify(l,null,2);return c.length>400?`${f.substr(0,400)}...`:f}function ye(){return Ae.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Ie(l,c){if(l.enum)return l.enum.includes(c);if(l.const)return l.const===c}function Me(l,c){let f=U({},c);if(typeof l.minimum!="undefined"&&(f.maximum=l.minimum,f.exclusiveMaximum=!0),typeof l.maximum!="undefined"&&(f.minimum=l.maximum>f.maximum?0:l.maximum,f.exclusiveMinimum=!0),typeof l.minLength!="undefined"&&(f.maxLength=l.minLength),typeof l.maxLength!="undefined"&&(f.minLength=l.maxLength>f.maxLength?0:l.maxLength),l.type)f.type=Ae.pick(Kt.SCALAR_TYPES.filter(S=>(Array.isArray(l.type)?l.type:[l.type]).every(v=>S==="number"||S==="integer"?v!=="number"&&v!=="integer":S!==v)));else if(l.enum){let S;do S=ye();while(l.enum.indexOf(S)!==-1);f.enum=[S]}return l.required&&f.properties&&l.required.forEach(S=>{delete f.properties[S]}),f}function tt(l,c){let f=c.minimum!==void 0,S=c.maximum!==void 0;return(f||S)&&(!f||l>=c.minimum)&&(!S||l<=c.maximum)}function ct(l,c){return!c.every(f=>tt(l,f))}function Pt(l,c){return c.reduce((S,T)=>S+(tt(l,T)?1:0),0)===1}function Ft(l){return["enum","const","default","examples","required","definitions","items","properties"].includes(l)}function A(l,c){return Object.keys(l).filter(f=>!c.includes(f)).reduce((f,S)=>(Array.isArray(l[S])?f[S]=l[S].slice():f[S]=l[S]instanceof Object?U({},l[S]):l[S],f),{})}function vt(l,c){return Array.isArray(l)?l.map(f=>vt(f,c)):(typeof l=="string"&&(l=l.replace(/#\{([\w.-]+)\}/g,(f,S)=>c[S])),l)}function Mt(l){return Object.prototype.toString.call(l)==="[object Object]"&&!Object.keys(l).length}function _(l,c){c=c.items||c;let f=_e("alwaysFakeOptionals"),S=Array.isArray(c.required)&&c.required.includes(l)||f,T=typeof c.thunk=="function"||c.additionalProperties&&typeof c.additionalProperties.thunk=="function";return!S&&!T}function wt(l,c,f=!1){if(!l||typeof l!="object")return l;if(Array.isArray(l))return l.map(S=>wt(S,c,!0)).filter(S=>typeof S!="undefined");if(Object.keys(l).forEach(S=>{if(Mt(l[S]))_(S,c)&&delete l[S];else{let T=c;c&&c.properties&&c.properties[S]&&(T=c.properties[S]);let v=wt(l[S],T);Mt(v)||(l[S]=v)}typeof l[S]=="undefined"&&delete l[S]}),!(!Object.keys(l).length&&f))return l}function tn(l){return(c,f,S,T)=>{let v=c,k=[];typeof c=="object"&&(v=Object.keys(c)[0],Array.isArray(c[v])?k=c[v]:k.push(c[v]));let L=v.split("."),Q=l();for(;L.length>1;)Q=Q[L.shift()];return c=typeof Q=="object"?Q[L[0]]:Q,typeof c=="function"&&(c=c.apply(Q,k.map(N=>Ye.template(N,T)))),Object.prototype.toString.call(c)==="[object Object]"&&Object.keys(c).forEach(N=>{if(typeof c[N]=="function")throw new Error(`Cannot resolve value for '${S}: ${v}', given: ${c}`)}),c}}function pr(l,c){if(typeof l=="undefined")return Gn.list();if(typeof l=="string")if(typeof c=="function")Gn.register(l,c);else if(c===null||c===!1)Gn.unregister(l);else return Gn.get(l);else Gn.registerMany(l)}function Jn(l,c,f){return Object.keys(l).filter(S=>{let T=Sc.indexOf(c)>-1;return f.indexOf(S)>-1&&!T}).length>0}function dt(l,c){let f=Object.keys(yr);for(let S=0;S<f.length;S+=1){let T=f[S],v=c[c.length-1];if(Jn(l,v,yr[T]))return T}}function In(){return _e("random")()>.5}function Yt(){return null}function nn(l,c,f,S,T,v){let k=[],L=[];function Q(ie){let j=JSON.stringify(ie.value);return L.indexOf(j)===-1?(L.push(j),k.push(ie),!0):!1}c.forEach(Q);let N=100;for(;k.length!==c.length&&(Q(v(f.items||S,l,T))||(N-=1),!!N););return k}function wn(l,c,f,S){let T=[];if(!(l.items||l.additionalItems)){if(Ye.hasProperties(l,"minItems","maxItems","uniqueItems")&&(l.minItems!==0||l.maxItems!==0))throw new hi(`missing items for ${Ye.short(l)}`,c);return T}if(Array.isArray(l.items))return l.items.map((ce,$e)=>{let xe=c.concat(["items",$e]);return S(ce,xe,f)});let v=l.minItems,k=l.maxItems,L=_e("minItems"),Q=_e("maxItems");L&&(v=typeof v=="undefined"?L:Math.min(L,v)),Q&&(k=typeof k=="undefined"?Q:Math.min(Q,k),k&&k>Q&&(k=Q),v&&v>Q&&(v=k));let N=_e("alwaysFakeOptionals")===!0?1:_e("optionalsProbability"),ie=_e("alwaysFakeOptionals")||_e("fixedProbabilities")||!1,j=Ae.number(v,k,1,5);N!==null&&(j=Math.max(ie?Math.round((k||j)*N):Math.abs(Ae.number(v,k)*N),v||0));let he=typeof l.additionalItems=="object"?l.additionalItems:{};for(let ce=T.length;ce<j;ce+=1){let $e=c.concat(["items",ce]),xe=S(l.items||he,$e,f);T.push(xe)}if(l.contains&&j>0){let ce=Ae.number(0,j-1);T[ce]=S(l.contains,c.concat(["items",ce]),f)}return l.uniqueItems?nn(c.concat(["items"]),T,l,he,f,S):T}function dr(l){let c=typeof l.minimum=="undefined"||l.minimum===-Number.MAX_VALUE?Kt.MIN_INTEGER:l.minimum,f=typeof l.maximum=="undefined"||l.maximum===Number.MAX_VALUE?Kt.MAX_INTEGER:l.maximum,S=l.multipleOf,T=S&&String(S).match(/e-(\d)|\.(\d+)$/);if(T){let v=(Math.random()*Ae.number(0,10)+1)*S,k=T[1]||T[2].length,L=parseFloat(v.toFixed(k)),Q=Ae.number(c,f-1);return String(L).includes(".")?Q+L:(Q+L).toExponential()}if(S&&(f=Math.floor(f/S)*S,c=Math.ceil(c/S)*S),l.exclusiveMinimum&&c===l.minimum&&(c+=S||1),l.exclusiveMaximum&&f===l.maximum&&(f-=S||1),c>f)return NaN;if(S){let v=Ae.number(Math.floor(c/S),Math.floor(f/S))*S;for(;v<c;)v+=S;return v}return Ae.number(c,f,void 0,void 0,l.type!=="integer")}function ga(l){return Math.floor(Na({...l}))}function si(l){return Ae.shuffle(Cc).slice(0,l)}function li(l,c,f,S){let T={},v=l.properties||{},k=l.patternProperties||{},L=typeof l.required=="boolean"?[]:(l.required||[]).slice(),Q=l.additionalProperties!==!1,N=Object.keys(v),ie=Object.keys(k),j=N.concat(ie).reduce((se,E)=>(L.indexOf(E)===-1&&se.push(E),se),[]),he=L.concat(j),ce=Q&&l.additionalProperties===!0?mi:l.additionalProperties;if(!Q&&N.length===0&&ie.length===0&&Ye.hasProperties(l,"minProperties","maxProperties","dependencies","required"))return null;if(_e("requiredOnly")===!0)return L.forEach(se=>{v[se]&&(T[se]=v[se])}),S(T,c.concat(["properties"]),f,l);let $e=_e("alwaysFakeOptionals")===!0?1:_e("optionalsProbability"),xe=_e("alwaysFakeOptionals")||_e("fixedProbabilities")||!1,Re=_e("ignoreProperties")||[],Ge=_e("reuseProperties"),Qe=_e("fillProperties"),ae=l.maxProperties||he.length+(Q?Ae.number(1,5):0),C=Math.max(l.minProperties||0,L.length),I=Math.max(0,he.length-C);he.length===1&&!L.length&&(C=Math.max(Ae.number(Qe?1:0,ae),C)),$e!==null&&(xe===!0?I=Math.round(C-L.length+$e*(he.length-C)):I=Ae.number(C-L.length,$e*(he.length-C)));let V=Ae.shuffle(j).slice(0,I),W=j.filter(se=>V.indexOf(se)!==-1),K=$e!==null||L.length===ae?ae:Ae.number(0,ae),z=L.concat(Ae.shuffle(W).slice(0,K)).slice(0,ae),Y=[],G=[];if(l.dependencies&&(Object.keys(l.dependencies).forEach(se=>{let E=l.dependencies[se];if(z.indexOf(se)!==-1)if(Array.isArray(E))E.forEach(J=>{z.indexOf(J)===-1&&z.push(J)});else if(Array.isArray(E.oneOf||E.anyOf)){let J=E.oneOf||E.anyOf;G.push({prop:se,values:J})}else Y.push(E)}),Y.length))return delete l.dependencies,S({allOf:Y.concat(l)},c.concat(["properties"]),f,l);let pe=[],fe=[];z.forEach(se=>{if(v[se]&&["{}","true"].includes(JSON.stringify(v[se].not)))return;for(let J=0;J<Re.length;J+=1)if(Re[J]instanceof RegExp&&Re[J].test(se)||typeof Re[J]=="string"&&Re[J]===se||typeof Re[J]=="function"&&Re[J](v[se],se)){pe.push(se);return}ce===!1&&L.indexOf(se)!==-1&&(T[se]=v[se]),v[se]&&(T[se]=v[se]);let E;if(ie.forEach(J=>{se.match(new RegExp(J))&&(E=!0,T[se]?Ye.merge(T[se],k[J]):T[Ae.randexp(se)]=k[J])}),!E){let J=k[se]||ce;J&&ce!==!1?T[k[se]?Ae.randexp(se):se]=v[se]||J:fe.push(se)}});let Ee=Object.keys(T).length+(Qe?0:pe.length),it=se=>Ae.randexp(`_?[_a-f\\d]{1,3}${se?"\\$?":""}`);function ot(se){let E;do{if(!se.length)break;E=se.shift()}while(T[E]);return E}let st=C;if(Q&&!L.length&&(st=Math.max($e===null||ce?Ae.number(Qe?1:0,ae):0,C)),!W.length&&!I&&Q&&xe===!0&&Qe){let se=Ae.number(0,ae);for(let E=0;E<se;E+=1)T[fi(1)+it(se[E])]=ce||mi}for(;Qe&&!(!(ie.length||Q)||Ee>=st);){if(Q)if(Ge&&N.length-Ee>st){let se=0,E;do{if(se+=1,se>1e3)break;E=ot(L)||Ae.pick(N)}while(typeof T[E]!="undefined");typeof T[E]=="undefined"&&(T[E]=v[E],Ee+=1)}else if(ie.length&&!ce){let se=Ae.pick(ie),E=Ae.randexp(se);T[E]||(T[E]=k[se],Ee+=1)}else{let se=ot(L)||fi(1)+it();T[se]||(T[se]=ce||mi,Ee+=1)}for(let se=0;Ee<C&&se<ie.length;se+=1){let E=ie[se],J=Ae.randexp(E);T[J]||(T[J]=k[E],Ee+=1)}}if(L.length===0&&(!Q||$e===!1)){let se=Ae.number(C,ae);for(;Ee<se;){let E=ot(N);E&&(T[E]=v[E]),Ee+=1}}let mt=T;if(_e("sortProperties")!==null){let se=Object.keys(v);mt=Object.keys(T).sort((J,me)=>_e("sortProperties")?J.localeCompare(me):se.indexOf(J)-se.indexOf(me)).reduce((J,me)=>(J[me]=T[me],J),{})}let Tt=S(mt,c.concat(["properties"]),f,l);return G.forEach(se=>{for(let E of se.values)if(Ye.hasValue(E.properties[se.prop],Tt.value[se.prop])){Object.keys(E.properties).forEach(J=>{J!==se.prop&&Ye.merge(Tt.value,S(E.properties,c.concat(["properties"]),f,l).value)});break}}),Tt}function hr(){let l=Ae.number(1,5);return fi(l).join(" ")}function ya(l=0,c=140){let f=Math.max(0,l),S=Ae.number(f,c),T=hr();for(;T.length<f;)T+=hr();return T.length>S&&(T=T.substr(0,S)),T}function ci(){return[0,0,0,0].map(()=>Ae.number(0,255)).join(".")}function ui(){return Ae.date().toISOString()}function ba(){return gi().slice(0,10)}function wa(){return gi().slice(11)}function Sa(l){return Ae.randexp($t[l]).replace(Dc,(c,f)=>Ae.randexp($t[f]))}function Ta(l,c){let f=Ma(l.format);if(typeof f=="function")return f(l);switch(l.format){case"date-time":case"datetime":return gi();case"date":return Mc();case"time":return Nc();case"ipv4":return Pc();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 Fc(l.format);default:if(typeof f=="undefined"){if(_e("failOnInvalidFormat"))throw new Error(`unknown registry key ${Ye.short(l.format)}`);return c()}throw new Error(`unsupported format '${l.format}'`)}}function xa(l){return Ye.typecast("string",l,f=>l.format?Ta(l,()=>La(f.minLength,f.maxLength)):l.pattern?Ae.randexp(l.pattern):La(f.minLength,f.maxLength))}function q({$comment:l,title:c,description:f}){return Object.entries({comment:l,title:c,description:f}).filter(([,S])=>S).reduce((S,[T,v])=>(S[T]=v,S),{})}function re(l,c,f,S){if(l=f(l,null,c),l&&(l.oneOf||l.anyOf||l.allOf)&&(l=f(l,null,c)),!l)throw new Error(`Cannot traverse at '${c.join(".")}', given '${JSON.stringify(S)}'`);let T={...q(l),schemaPath:c};if(c[c.length-1]!=="properties"){if(_e("useExamplesValue")&&Array.isArray(l.examples)){let N=l.examples.concat("default"in l?[l.default]:[]);return{value:Ye.typecast(null,l,()=>Ae.pick(N)),context:T}}if(_e("useExamplesValue")&&typeof l.example!="undefined")return{value:Ye.typecast(null,l,()=>l.example),context:T};if(_e("useDefaultValue")&&"default"in l&&(l.default!==""||!_e("replaceEmptyByRandomValue")))return{value:l.default,context:T};if("template"in l)return{value:Ye.template(l.template,S),context:T};if("const"in l)return{value:l.const,context:T}}if(l.not&&typeof l.not=="object"&&(l=Ye.notValue(l.not,Ye.omitProps(l,["not"])),l.type&&l.type==="object")){let{value:N,context:ie}=re(l,c.concat(["not"]),f,S);return{value:Ye.clean(N,l,!1),context:{...T,items:ie}}}if(typeof l.thunk=="function"){let{value:N,context:ie}=re(l.thunk(S),c,f);return{value:N,context:{...T,items:ie}}}if(l.jsonPath)return{value:l,context:T};let v=l.type;if(Array.isArray(v)?v=Ae.pick(v):typeof v=="undefined"&&(v=Tc(l,c)||v,v&&(l.type=v)),typeof l.generate=="function"){let N=Ye.typecast(null,l,()=>l.generate(S,c)),ie=N===null?"null":typeof N;if(ie===v||ie==="number"&&v==="integer"||Array.isArray(N)&&v==="array")return{value:N,context:T}}if(typeof l.pattern=="string")return{value:Ye.typecast("string",l,()=>Ae.randexp(l.pattern)),context:T};if(Array.isArray(l.enum))return{value:Ye.typecast(null,l,()=>Ae.pick(l.enum)),context:T};if(typeof v=="string")if(br[v])try{let N=br[v](l,c,f,re);return v==="array"?{value:N.map(({value:ie})=>ie),context:{...T,items:N.map(Array.isArray(l.items)?({context:ie})=>ie:({context:ie})=>({...ie,schemaPath:ie.schemaPath.slice(0,-1)}))}}:v==="object"?N!==null?{value:N.value,context:{...T,items:N.context}}:{value:{},context:T}:{value:N,context:T}}catch(N){throw typeof N.path=="undefined"?new hi(N.stack,c):N}else{if(_e("failOnInvalidTypes"))throw new hi(`unknown primitive ${Ye.short(v)}`,c.concat(["type"]));{let N=_e("defaultInvalidTypeProduct");return typeof N=="string"&&br[N]?{value:br[N](l,c,f,re),context:T}:{value:N,context:T}}}let k={},L={...T};Array.isArray(l)&&(k=[]);let Q=_e("pruneProperties")||[];return Object.keys(l).forEach(N=>{if(!Q.includes(N)&&l[N]!==null)if(typeof l[N]=="object"&&N!=="definitions"){let{value:ie,context:j}=re(l[N],c.concat([N]),f,k);k[N]=Ye.clean(ie,l[N],!1),L[N]=j,k[N]===null&&_e("omitNulls")&&(delete k[N],delete L[N])}else k[N]=l[N]}),{value:k,context:L}}function Ce(l){return Array.isArray(l)?Ae.pick(l):l}function De(l,c){if(!Array.isArray(l))return l;let f=c?l.pop():l.shift();return c?l.unshift(f):l.push(f),f}function He(l,c,f,S){if(!l||typeof l!="object")return l;if(f||(f={}),c||(c=l),Array.isArray(l))return l.map(T=>He(T,c,f,S));if(l.jsonPath){let{JSONPath:T}=Ra(),v=typeof l.jsonPath!="object"?{path:l.jsonPath}:l.jsonPath;v.group=l.group||v.group||S,v.cycle=l.cycle||v.cycle||!1,v.reverse=l.reverse||v.reverse||!1,v.count=l.count||v.count||1;let k=`${v.group}__${v.path}`;return f[k]||(v.count>1?f[k]=T(v.path,c).slice(0,v.count):f[k]=T(v.path,c)),v.cycle||v.reverse?De(f[k],v.reverse):Ce(f[k])}return Object.keys(l).forEach(T=>{l[T]=He(l[T],c,f,T)}),l}function Nt(l,c,f,S){if(Object.prototype.toString.call(c)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof c}`);let T=_e("refDepthMin")||0,v=_e("refDepthMax")||3;try{let{resolveSchema:k}=Bc({refs:l,schema:c,container:f,synchronous:S,refDepthMin:T,refDepthMax:v}),L=qc(Ye.clone(c),[],k);return _e("resolveJsonPath")?{value:He(L.value),context:L.context}:L}catch(k){throw k.path?new Error(`${k.message} in /${k.path.join("/")}`):k}}function rn(l){return l.value}function Jt(l,c){return c.reduce((f,S)=>S in f?f[S]:{},l)}function on(l,c,f,S=f){let{title:T,description:v,comment:k}=Jt(l,c),L=[];_e("renderTitle")&&T&&L.push(` ${T}`,""),_e("renderDescription")&&v&&L.push(` ${v}`),_e("renderComment")&&k&&L.push(` ${k}`),f.commentBefore=L.join(`
23
- `),S instanceof zc?S.items.forEach(Q=>{on(l,[...c,"items",Q.key.value],Q.key,Q.value)}):S instanceof Vc&&S.items.forEach((Q,N)=>{on(l,[...c,"items",N],Q)})}function Pn({value:l,context:c}){let f=wr.createNode(l);on(c,[],f);let S=new wr.Document;return S.contents=f,S.toString()}function St(){sn.define("autoIncrement",function(c,f){if(!this.offset){let S=f.minimum||1,T=S+Kt.MAX_NUMBER,v=c.initialOffset||f.initialOffset;this.offset=v||Ae.number(S,T)}return c?this.offset++:f}),sn.define("sequentialDate",function(c,f){if(this.now||(this.now=Ae.date()),c){if(f=this.now.toISOString(),c=c===!0?"days":c,["seconds","minutes","hours","days","weeks","months","years"].indexOf(c)===-1)throw new Error(`Unsupported increment by ${Ye.short(c)}`);this.now.setTime(this.now.getTime()+Ae.date(c))}return f})}function an(l,c){let f={};Array.isArray(l)?l.forEach(T=>{f[T.$id||T.id]=T}):f=l||{};function S(T){if(!T||typeof T!="object")return;if(Array.isArray(T))return T.forEach(S);let v=T.$id||T.id;typeof v=="string"&&!f[v]&&(f[v]=T),Object.keys(T).forEach(k=>{S(T[k])})}return S(l),S(c),f}var Ut,ka,Gl,va,Kl,Xl,Lt,Ql,Aa,fr,te,Zl,ec,tc,nc,rc,mr,pi,Ea,ic,oc,_a,Ra,ac,sc,Oa,We,Ca,lc,cc,gr,_e,Ia,Pa,uc,pc,dc,hc,fc,mc,Kt,di,Ae,gc,Ye,yc,bc,Gn,Ma,wc,hi,yr,Sc,Tc,xc,kc,vc,Ac,Ec,_c,Rc,Na,Oc,Cc,fi,mi,Ic,La,Pc,gi,Mc,Nc,Da,yi,Lc,$t,Dc,Fc,Uc,$c,br,qc,jc,Bc,Fa,Ua,At,ag,sg,lg,cg,ug,pg,dg,hg,fg,mg,gg,yg,zc,Vc,wr,sn,rt,Hc,Wc,bg=i({"src/shared.js"(){Ut=Object.create,ka=Object.defineProperty,Gl=Object.getOwnPropertyDescriptor,va=Object.getOwnPropertyNames,Kl=Object.getPrototypeOf,Xl=Object.prototype.hasOwnProperty,Lt=(l,c)=>function(){return c||(0,l[va(l)[0]])((c={exports:{}}).exports,c),c.exports},Ql=(l,c,f,S)=>{if(c&&typeof c=="object"||typeof c=="function")for(let T of va(c))!Xl.call(l,T)&&T!==f&&ka(l,T,{get:()=>c[T],enumerable:!(S=Gl(c,T))||S.enumerable});return l},Aa=(l,c,f)=>(f=l!=null?Ut(Kl(l)):{},Ql(c||!l||!l.__esModule?ka(f,"default",{value:l,enumerable:!0}):f,l)),fr=Lt({"node_modules/ret/lib/types.js"(l,c){c.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}}}),te=Lt({"node_modules/ret/lib/sets.js"(l){var c=fr(),f=()=>[{type:c.RANGE,from:48,to:57}],S=()=>[{type:c.CHAR,value:95},{type:c.RANGE,from:97,to:122},{type:c.RANGE,from:65,to:90}].concat(f()),T=()=>[{type:c.CHAR,value:9},{type:c.CHAR,value:10},{type:c.CHAR,value:11},{type:c.CHAR,value:12},{type:c.CHAR,value:13},{type:c.CHAR,value:32},{type:c.CHAR,value:160},{type:c.CHAR,value:5760},{type:c.RANGE,from:8192,to:8202},{type:c.CHAR,value:8232},{type:c.CHAR,value:8233},{type:c.CHAR,value:8239},{type:c.CHAR,value:8287},{type:c.CHAR,value:12288},{type:c.CHAR,value:65279}],v=()=>[{type:c.CHAR,value:10},{type:c.CHAR,value:13},{type:c.CHAR,value:8232},{type:c.CHAR,value:8233}];l.words=()=>({type:c.SET,set:S(),not:!1}),l.notWords=()=>({type:c.SET,set:S(),not:!0}),l.ints=()=>({type:c.SET,set:f(),not:!1}),l.notInts=()=>({type:c.SET,set:f(),not:!0}),l.whitespace=()=>({type:c.SET,set:T(),not:!1}),l.notWhitespace=()=>({type:c.SET,set:T(),not:!0}),l.anyChar=()=>({type:c.SET,set:v(),not:!0})}}),Zl=Lt({"node_modules/ret/lib/util.js"(l){var c=fr(),f=te(),S="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",T={0:0,t:9,n:10,v:11,f:12,r:13};l.strToChars=v=>{var k=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return v=v.replace(k,(L,Q,N,ie,j,he,ce,$e)=>{if(N)return L;var xe=Q?8:ie?parseInt(ie,16):j?parseInt(j,16):he?parseInt(he,8):ce?S.indexOf(ce):T[$e],Re=String.fromCharCode(xe);return/[[\]{}^$.|?*+()]/.test(Re)&&(Re="\\"+Re),Re}),v},l.tokenizeClass=(v,k)=>{for(var L=[],Q=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,N,ie;(N=Q.exec(v))!=null;)if(N[1])L.push(f.words());else if(N[2])L.push(f.ints());else if(N[3])L.push(f.whitespace());else if(N[4])L.push(f.notWords());else if(N[5])L.push(f.notInts());else if(N[6])L.push(f.notWhitespace());else if(N[7])L.push({type:c.RANGE,from:(N[8]||N[9]).charCodeAt(0),to:N[10].charCodeAt(0)});else if(ie=N[12])L.push({type:c.CHAR,value:ie.charCodeAt(0)});else return[L,Q.lastIndex];l.error(k,"Unterminated character class")},l.error=(v,k)=>{throw new SyntaxError("Invalid regular expression: /"+v+"/: "+k)}}}),ec=Lt({"node_modules/ret/lib/positions.js"(l){var c=fr();l.wordBoundary=()=>({type:c.POSITION,value:"b"}),l.nonWordBoundary=()=>({type:c.POSITION,value:"B"}),l.begin=()=>({type:c.POSITION,value:"^"}),l.end=()=>({type:c.POSITION,value:"$"})}}),tc=Lt({"node_modules/ret/lib/index.js"(l,c){var f=Zl(),S=fr(),T=te(),v=ec();c.exports=k=>{var L=0,Q,N,ie={type:S.ROOT,stack:[]},j=ie,he=ie.stack,ce=[],$e=W=>{f.error(k,`Nothing to repeat at column ${W-1}`)},xe=f.strToChars(k);for(Q=xe.length;L<Q;)switch(N=xe[L++],N){case"\\":switch(N=xe[L++],N){case"b":he.push(v.wordBoundary());break;case"B":he.push(v.nonWordBoundary());break;case"w":he.push(T.words());break;case"W":he.push(T.notWords());break;case"d":he.push(T.ints());break;case"D":he.push(T.notInts());break;case"s":he.push(T.whitespace());break;case"S":he.push(T.notWhitespace());break;default:/\d/.test(N)?he.push({type:S.REFERENCE,value:parseInt(N,10)}):he.push({type:S.CHAR,value:N.charCodeAt(0)})}break;case"^":he.push(v.begin());break;case"$":he.push(v.end());break;case"[":{var Re;xe[L]==="^"?(Re=!0,L++):Re=!1;var Ge=f.tokenizeClass(xe.slice(L),k);L+=Ge[1],he.push({type:S.SET,set:Ge[0],not:Re});break}case".":he.push(T.anyChar());break;case"(":{var Qe={type:S.GROUP,stack:[],remember:!0};N=xe[L],N==="?"&&(N=xe[L+1],L+=2,N==="="?Qe.followedBy=!0:N==="!"?Qe.notFollowedBy=!0:N!==":"&&f.error(k,`Invalid group, character '${N}' after '?' at column ${L-1}`),Qe.remember=!1),he.push(Qe),ce.push(j),j=Qe,he=Qe.stack;break}case")":ce.length===0&&f.error(k,`Unmatched ) at column ${L-1}`),j=ce.pop(),he=j.options?j.options[j.options.length-1]:j.stack;break;case"|":{j.options||(j.options=[j.stack],delete j.stack);var ae=[];j.options.push(ae),he=ae;break}case"{":{var C=/^(\d+)(,(\d+)?)?\}/.exec(xe.slice(L)),I,V;C!==null?(he.length===0&&$e(L),I=parseInt(C[1],10),V=C[2]?C[3]?parseInt(C[3],10):1/0:I,L+=C[0].length,he.push({type:S.REPETITION,min:I,max:V,value:he.pop()})):he.push({type:S.CHAR,value:123});break}case"?":he.length===0&&$e(L),he.push({type:S.REPETITION,min:0,max:1,value:he.pop()});break;case"+":he.length===0&&$e(L),he.push({type:S.REPETITION,min:1,max:1/0,value:he.pop()});break;case"*":he.length===0&&$e(L),he.push({type:S.REPETITION,min:0,max:1/0,value:he.pop()});break;default:he.push({type:S.CHAR,value:N.charCodeAt(0)})}return ce.length!==0&&f.error(k,"Unterminated group"),ie},c.exports.types=S}}),nc=Lt({"node_modules/drange/lib/index.js"(l,c){var f=class Qn{constructor(v,k){this.low=v,this.high=k,this.length=1+k-v}overlaps(v){return!(this.high<v.low||this.low>v.high)}touches(v){return!(this.high+1<v.low||this.low-1>v.high)}add(v){return new Qn(Math.min(this.low,v.low),Math.max(this.high,v.high))}subtract(v){return v.low<=this.low&&v.high>=this.high?[]:v.low>this.low&&v.high<this.high?[new Qn(this.low,v.low-1),new Qn(v.high+1,this.high)]:v.low<=this.low?[new Qn(v.high+1,this.high)]:[new Qn(this.low,v.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},S=class Rr{constructor(v,k){this.ranges=[],this.length=0,v!=null&&this.add(v,k)}_update_length(){this.length=this.ranges.reduce((v,k)=>v+k.length,0)}add(v,k){var L=Q=>{for(var N=0;N<this.ranges.length&&!Q.touches(this.ranges[N]);)N++;for(var ie=this.ranges.slice(0,N);N<this.ranges.length&&Q.touches(this.ranges[N]);)Q=Q.add(this.ranges[N]),N++;ie.push(Q),this.ranges=ie.concat(this.ranges.slice(N)),this._update_length()};return v instanceof Rr?v.ranges.forEach(L):(k==null&&(k=v),L(new f(v,k))),this}subtract(v,k){var L=Q=>{for(var N=0;N<this.ranges.length&&!Q.overlaps(this.ranges[N]);)N++;for(var ie=this.ranges.slice(0,N);N<this.ranges.length&&Q.overlaps(this.ranges[N]);)ie=ie.concat(this.ranges[N].subtract(Q)),N++;this.ranges=ie.concat(this.ranges.slice(N)),this._update_length()};return v instanceof Rr?v.ranges.forEach(L):(k==null&&(k=v),L(new f(v,k))),this}intersect(v,k){var L=[],Q=N=>{for(var ie=0;ie<this.ranges.length&&!N.overlaps(this.ranges[ie]);)ie++;for(;ie<this.ranges.length&&N.overlaps(this.ranges[ie]);){var j=Math.max(this.ranges[ie].low,N.low),he=Math.min(this.ranges[ie].high,N.high);L.push(new f(j,he)),ie++}};return v instanceof Rr?v.ranges.forEach(Q):(k==null&&(k=v),Q(new f(v,k))),this.ranges=L,this._update_length(),this}index(v){for(var k=0;k<this.ranges.length&&this.ranges[k].length<=v;)v-=this.ranges[k].length,k++;return this.ranges[k].low+v}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Rr(this)}numbers(){return this.ranges.reduce((v,k)=>{for(var L=k.low;L<=k.high;)v.push(L),L++;return v},[])}subranges(){return this.ranges.map(v=>({low:v.low,high:v.high,length:1+v.high-v.low}))}};c.exports=S}}),rc=Lt({"node_modules/randexp/lib/randexp.js"(l,c){var f=tc(),S=nc(),T=f.types;c.exports=class Or{constructor(k,L){if(this._setDefaults(k),k instanceof RegExp)this.ignoreCase=k.ignoreCase,this.multiline=k.multiline,k=k.source;else if(typeof k=="string")this.ignoreCase=L&&L.indexOf("i")!==-1,this.multiline=L&&L.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=f(k)}_setDefaults(k){this.max=k.max!=null?k.max:Or.prototype.max!=null?Or.prototype.max:100,this.defaultRange=k.defaultRange?k.defaultRange:this.defaultRange.clone(),k.randInt&&(this.randInt=k.randInt)}gen(){return this._gen(this.tokens,[])}_gen(k,L){var Q,N,ie,j,he;switch(k.type){case T.ROOT:case T.GROUP:if(k.followedBy||k.notFollowedBy)return"";for(k.remember&&k.groupNumber===void 0&&(k.groupNumber=L.push(null)-1),Q=k.options?this._randSelect(k.options):k.stack,N="",j=0,he=Q.length;j<he;j++)N+=this._gen(Q[j],L);return k.remember&&(L[k.groupNumber]=N),N;case T.POSITION:return"";case T.SET:{var ce=this._expand(k);return ce.length?String.fromCharCode(this._randSelect(ce)):""}case T.REPETITION:for(ie=this.randInt(k.min,k.max===1/0?k.min+this.max:k.max),N="",j=0;j<ie;j++)N+=this._gen(k.value,L);return N;case T.REFERENCE:return L[k.value-1]||"";case T.CHAR:{var $e=this.ignoreCase&&this._randBool()?this._toOtherCase(k.value):k.value;return String.fromCharCode($e)}}}_toOtherCase(k){return k+(97<=k&&k<=122?-32:65<=k&&k<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(k){return k instanceof S?k.index(this.randInt(0,k.length-1)):k[this.randInt(0,k.length-1)]}_expand(k){if(k.type===f.types.CHAR)return new S(k.value);if(k.type===f.types.RANGE)return new S(k.from,k.to);{let L=new S;for(let Q=0;Q<k.set.length;Q++){let N=this._expand(k.set[Q]);if(L.add(N),this.ignoreCase)for(let ie=0;ie<N.length;ie++){let j=N.index(ie),he=this._toOtherCase(j);j!==he&&L.add(he)}}return k.not?this.defaultRange.clone().subtract(L):this.defaultRange.clone().intersect(L)}}randInt(k,L){return k+Math.floor(Math.random()*(1+L-k))}get defaultRange(){return this._range=this._range||new S(32,126)}set defaultRange(k){this._range=k}static randexp(k,L){var Q;return typeof k=="string"&&(k=new RegExp(k,L)),k._randexp===void 0?(Q=new Or(k,L),k._randexp=Q):(Q=k._randexp,Q._setDefaults(k)),Q.gen()}static sugar(){RegExp.prototype.gen=function(){return Or.randexp(this)}}}}}),mr=Lt({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(l){var c={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},f={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"},S="tag:yaml.org,2002:",T={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function v(ae){let C=[0],I=ae.indexOf(`
24
- `);for(;I!==-1;)I+=1,C.push(I),I=ae.indexOf(`
25
- `,I);return C}function k(ae){let C,I;return typeof ae=="string"?(C=v(ae),I=ae):(Array.isArray(ae)&&(ae=ae[0]),ae&&ae.context&&(ae.lineStarts||(ae.lineStarts=v(ae.context.src)),C=ae.lineStarts,I=ae.context.src)),{lineStarts:C,src:I}}function L(ae,C){if(typeof ae!="number"||ae<0)return null;let{lineStarts:I,src:V}=k(C);if(!I||!V||ae>V.length)return null;for(let K=0;K<I.length;++K){let z=I[K];if(ae<z)return{line:K,col:ae-I[K-1]+1};if(ae===z)return{line:K+1,col:1}}let W=I.length;return{line:W,col:ae-I[W-1]+1}}function Q(ae,C){let{lineStarts:I,src:V}=k(C);if(!I||!(ae>=1)||ae>I.length)return null;let W=I[ae-1],K=I[ae];for(;K&&K>W&&V[K-1]===`
26
- `;)--K;return V.slice(W,K)}function N({start:ae,end:C},I,V=80){let W=Q(ae.line,I);if(!W)return null;let{col:K}=ae;if(W.length>V)if(K<=V-10)W=W.substr(0,V-1)+"\u2026";else{let fe=Math.round(V/2);W.length>K+fe&&(W=W.substr(0,K+fe-1)+"\u2026"),K-=W.length-V,W="\u2026"+W.substr(1-V)}let z=1,Y="";C&&(C.line===ae.line&&K+(C.col-ae.col)<=V+1?z=C.col-ae.col:(z=Math.min(W.length+1,V)-K,Y="\u2026"));let G=K>1?" ".repeat(K-1):"",pe="^".repeat(z);return`${W}
27
- ${G}${pe}${Y}`}var ie=class Kc{static copy(C){return new Kc(C.start,C.end)}constructor(C,I){this.start=C,this.end=I||C}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(C,I){let{start:V,end:W}=this;if(C.length===0||W<=C[0])return this.origStart=V,this.origEnd=W,I;let K=I;for(;K<C.length&&!(C[K]>V);)++K;this.origStart=V+K;let z=K;for(;K<C.length&&!(C[K]>=W);)++K;return this.origEnd=W+K,z}},j=class pn{static addStringTerminator(C,I,V){if(V[V.length-1]===`
28
- `)return V;let W=pn.endOfWhiteSpace(C,I);return W>=C.length||C[W]===`
29
- `?V+`
30
- `:V}static atDocumentBoundary(C,I,V){let W=C[I];if(!W)return!0;let K=C[I-1];if(K&&K!==`
31
- `)return!1;if(V){if(W!==V)return!1}else if(W!==c.DIRECTIVES_END&&W!==c.DOCUMENT_END)return!1;let z=C[I+1],Y=C[I+2];if(z!==W||Y!==W)return!1;let G=C[I+3];return!G||G===`
32
- `||G===" "||G===" "}static endOfIdentifier(C,I){let V=C[I],W=V==="<",K=W?[`
10
+ `});return h(),d(),y+`
11
+ `+(i===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
12
+ `))+1))}let o="#".repeat(i),s=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let p=n.containerPhrasing(e,{before:"# ",after:`
13
+ `,...a.current()});return/^[\t ]/.test(p)&&(p="&#x"+p.charCodeAt(0).toString(16).toUpperCase()+";"+p.slice(1)),p=p?o+" "+p:o,n.options.closeAtx&&(p+=" "+o),c(),s(),p}var Op=M(()=>{"use strict";Cp()});function Ps(e){return e.value||""}function hb(){return"<"}var Ip=M(()=>{"use strict";Ps.peek=hb});function Ms(e,t,n,r){let i=tr(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image"),s=n.enter("label"),c=n.createTracker(r),p=c.move("![");return p+=c.move(n.safe(e.alt,{before:p,after:"]",...c.current()})),p+=c.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),p+=c.move("<"),p+=c.move(n.safe(e.url,{before:p,after:">",...c.current()})),p+=c.move(">")):(s=n.enter("destinationRaw"),p+=c.move(n.safe(e.url,{before:p,after:e.title?" ":")",...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),p+=c.move(" "+i),p+=c.move(n.safe(e.title,{before:p,after:i,...c.current()})),p+=c.move(i),s()),p+=c.move(")"),o(),p}function fb(){return"!"}var Pp=M(()=>{"use strict";ya();Ms.peek=fb});function Ns(e,t,n,r){let i=e.referenceType,a=n.enter("imageReference"),o=n.enter("label"),s=n.createTracker(r),c=s.move("!["),p=n.safe(e.alt,{before:c,after:"]",...s.current()});c+=s.move(p+"]["),o();let d=n.stack;n.stack=[],o=n.enter("reference");let h=n.safe(n.associationId(e),{before:c,after:"]",...s.current()});return o(),n.stack=d,a(),i==="full"||!p||p!==h?c+=s.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function mb(){return"!"}var Mp=M(()=>{"use strict";Ns.peek=mb});function Ls(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){let o=n.unsafe[a],s=n.compilePattern(o),c;if(o.atBreak)for(;c=s.exec(r);){let p=c.index;r.charCodeAt(p)===10&&r.charCodeAt(p-1)===13&&p--,r=r.slice(0,p)+" "+r.slice(c.index+1)}}return i+r+i}function gb(){return"`"}var Np=M(()=>{"use strict";Ls.peek=gb});function Ds(e,t){let n=Dn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var Lp=M(()=>{"use strict";pa()});function Fs(e,t,n,r){let i=tr(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r),s,c;if(Ds(e,n)){let d=n.stack;n.stack=[],s=n.enter("autolink");let h=o.move("<");return h+=o.move(n.containerPhrasing(e,{before:h,after:">",...o.current()})),h+=o.move(">"),s(),n.stack=d,h}s=n.enter("link"),c=n.enter("label");let p=o.move("[");return p+=o.move(n.containerPhrasing(e,{before:p,after:"](",...o.current()})),p+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),p+=o.move("<"),p+=o.move(n.safe(e.url,{before:p,after:">",...o.current()})),p+=o.move(">")):(c=n.enter("destinationRaw"),p+=o.move(n.safe(e.url,{before:p,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),p+=o.move(" "+i),p+=o.move(n.safe(e.title,{before:p,after:i,...o.current()})),p+=o.move(i),c()),p+=o.move(")"),s(),p}function yb(e,t,n){return Ds(e,n)?"<":"["}var Dp=M(()=>{"use strict";ya();Lp();Fs.peek=yb});function Us(e,t,n,r){let i=e.referenceType,a=n.enter("linkReference"),o=n.enter("label"),s=n.createTracker(r),c=s.move("["),p=n.containerPhrasing(e,{before:c,after:"]",...s.current()});c+=s.move(p+"]["),o();let d=n.stack;n.stack=[],o=n.enter("reference");let h=n.safe(n.associationId(e),{before:c,after:"]",...s.current()});return o(),n.stack=d,a(),i==="full"||!p||p!==h?c+=s.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function bb(){return"["}var Fp=M(()=>{"use strict";Us.peek=bb});function nr(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var ba=M(()=>{"use strict"});function Up(e){let t=nr(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}var Hp=M(()=>{"use strict";ba()});function $p(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var qp=M(()=>{"use strict"});function wa(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var Hs=M(()=>{"use strict"});function jp(e,t,n,r){let i=n.enter("list"),a=n.bulletCurrent,o=e.ordered?$p(n):nr(n),s=e.ordered?o==="."?")":".":Up(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),wa(n)===o&&d){let h=-1;for(;++h<e.children.length;){let y=e.children[h];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let p=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),p}var Bp=M(()=>{"use strict";ba();Hp();qp();Hs()});function zp(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var Vp=M(()=>{"use strict"});function Wp(e,t,n,r){let i=zp(n),a=n.bulletCurrent||nr(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+" ".repeat(o-a.length)),s.shift(o);let c=n.enter("listItem"),p=n.indentLines(n.containerFlow(e,s.current()),d);return c(),p;function d(h,y,g){return y?(g?"":" ".repeat(o))+h:(g?a:a+" ".repeat(o-a.length))+h}}var Yp=M(()=>{"use strict";ba();Vp()});function Jp(e,t,n,r){let i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}var Gp=M(()=>{"use strict"});var $s,Kp=M(()=>{"use strict";ha();$s=kn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var Xp=M(()=>{"use strict";Kp()});function Qp(e,t,n,r){return(e.children.some(function(o){return $s(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}var Zp=M(()=>{"use strict";Xp()});function ed(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var td=M(()=>{"use strict"});function qs(e,t,n,r){let i=ed(n),a=n.enter("strong"),o=n.createTracker(r),s=o.move(i+i);return s+=o.move(n.containerPhrasing(e,{before:s,after:i,...o.current()})),s+=o.move(i+i),a(),s}function wb(e,t,n){return n.options.strong||"*"}var nd=M(()=>{"use strict";td();qs.peek=wb});function rd(e,t,n,r){return n.safe(e.value,r)}var id=M(()=>{"use strict"});function ad(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var od=M(()=>{"use strict"});function sd(e,t,n){let r=(wa(n)+(n.options.ruleSpaces?" ":"")).repeat(ad(n));return n.options.ruleSpaces?r.slice(0,-1):r}var ld=M(()=>{"use strict";od();Hs()});var Fr,cd=M(()=>{"use strict";sp();pp();wp();Tp();vp();Op();Ip();Pp();Mp();Np();Dp();Fp();Bp();Yp();Gp();Zp();nd();id();ld();Fr={blockquote:op,break:_s,code:bp,definition:Sp,emphasis:Os,hardBreak:_s,heading:_p,html:Ps,image:Ms,imageReference:Ns,inlineCode:Ls,link:Fs,linkReference:Us,list:jp,listItem:Wp,paragraph:Jp,root:Qp,strong:qs,text:rd,thematicBreak:sd}});var js,ud=M(()=>{"use strict";js={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
14
+ `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});function rr(e){return Sb.call(js,e)?js[e]:!1}var Sb,Sa=M(()=>{"use strict";ud();Sb={}.hasOwnProperty});function Ta(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}var Bs=M(()=>{"use strict"});function pd(e){return e.replace(Tb,xb)}function xb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),a=i===120||i===88;return Ta(n.slice(a?2:1),a?16:10)}return rr(n)||e}var Tb,dd=M(()=>{"use strict";Sa();Bs();Tb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var zs=M(()=>{"use strict";cd()});function Ws(){return{enter:{table:Ab,tableData:hd,tableHeader:hd,tableRow:kb},exit:{codeText:Eb,table:vb,tableData:Vs,tableHeader:Vs,tableRow:Vs}}}function Ab(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function vb(e){this.exit(e),this.data.inTable=void 0}function kb(e){this.enter({type:"tableRow",children:[]},e)}function Vs(e){this.exit(e)}function hd(e){this.enter({type:"tableCell",children:[]},e)}function Eb(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Rb));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Rb(e,t){return t==="|"?t:e}function Ys(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
15
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:c,tableRow:s}};function o(g,I,K,Z){return p(d(g,K,Z),g.align)}function s(g,I,K,Z){let H=h(g,K,Z),ue=p([H]);return ue.slice(0,ue.indexOf(`
16
+ `))}function c(g,I,K,Z){let H=K.enter("tableCell"),ue=K.enter("phrasing"),ne=K.containerPhrasing(g,{...Z,before:a,after:a});return ue(),H(),ne}function p(g,I){return ip(g,{align:I,alignDelimiters:r,padding:n,stringLength:i})}function d(g,I,K){let Z=g.children,H=-1,ue=[],ne=I.enter("table");for(;++H<Z.length;)ue[H]=h(Z[H],I,K);return ne(),ue}function h(g,I,K){let Z=g.children,H=-1,ue=[],ne=I.enter("tableRow");for(;++H<Z.length;)ue[H]=c(Z[H],g,I,K);return ne(),ue}function y(g,I,K){let Z=Fr.inlineCode(g,I,K);return K.stack.includes("tableCell")&&(Z=Z.replace(/\|/g,"\\$&")),Z}}var fd=M(()=>{"use strict";ap();zs()});var md=M(()=>{"use strict";fd()});function Js(){return{exit:{taskListCheckValueChecked:gd,taskListCheckValueUnchecked:gd,paragraph:Cb}}}function Gs(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:_b}}}function gd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Cb(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let r=n.children[0];if(r&&r.type==="text"){let i=t.children,a=-1,o;for(;++a<i.length;){let s=i[a];if(s.type==="paragraph"){o=s;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function _b(e,t,n,r){let i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);a&&s.move(o);let c=Fr.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),c;function p(d){return d+o}}var yd=M(()=>{"use strict";zs()});var bd=M(()=>{"use strict";yd()});function Ks(){return[As(),ks(),Rs(),Ws(),Js()]}function Xs(e){return{extensions:[vs(),Es(),Cs(),Ys(e),Gs()]}}var wd=M(()=>{"use strict";Ku();Zu();np();md();bd()});var Sd=M(()=>{"use strict";wd()});function pt(e,t,n,r){let i=e.length,a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Ct(e,t){return e.length>0?(pt(e,e.length,0,t),e):t}var gn=M(()=>{"use strict"});function xa(e){let t={},n=-1;for(;++n<e.length;)Ob(t,e[n]);return t}function Ob(e,t){let n;for(n in t){let i=(Td.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n],o;if(a)for(o in a){Td.call(i,o)||(i[o]=[]);let s=a[o];Ib(i[o],Array.isArray(s)?s:s?[s]:[])}}}function Ib(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);pt(e,0,0,r)}var Td,Qs=M(()=>{"use strict";gn();Td={}.hasOwnProperty});function el(){return{text:Qt}}function Nb(e,t,n){let r=this,i,a;return o;function o(h){return!Zs(h)||!_d.call(r,r.previous)||tl(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(h))}function s(h){return Zs(h)?(e.consume(h),s):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check(Mb,d,p)(h):h===45||h===95||ft(h)?(a=!0,e.consume(h),c):d(h)}function p(h){return e.consume(h),i=!0,c}function d(h){return a&&i&&ht(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function Lb(e,t,n){let r=this;return i;function i(o){return o!==87&&o!==119||!Rd.call(r,r.previous)||tl(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Pb,e.attempt(xd,e.attempt(Ad,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Db(e,t,n){let r=this,i="",a=!1;return o;function o(h){return(h===72||h===104)&&Cd.call(r,r.previous)&&!tl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),s):n(h)}function s(h){if(ht(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),s;if(h===58){let y=i.toLowerCase();if(y==="http"||y==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),a?p:(a=!0,c)):n(h)}function p(h){return h===null||Fn(h)||Le(h)||Xt(h)||Un(h)?n(h):e.attempt(xd,e.attempt(Ad,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function Fb(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function Ub(e,t,n){let r,i,a;return o;function o(p){return p===46||p===95?e.check(vd,c,s)(p):p===null||Le(p)||Xt(p)||p!==45&&Un(p)?c(p):(a=!0,e.consume(p),o)}function s(p){return p===95?r=!0:(i=r,r=void 0),e.consume(p),o}function c(p){return i||r||!a?n(p):t(p)}}function Hb(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(vd,t,a)(o):o===null||Le(o)||Xt(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function $b(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),a):s===93?(e.consume(s),i):s===60||s===null||Le(s)||Xt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Le(s)||Xt(s)?t(s):r(s)}function a(s){return ht(s)?o(s):n(s)}function o(s){return s===59?(e.consume(s),r):ht(s)?(e.consume(s),o):n(s)}}function qb(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return ft(a)?n(a):t(a)}}function Rd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Le(e)}function Cd(e){return!ht(e)}function _d(e){return!(e===47||Zs(e))}function Zs(e){return e===43||e===45||e===46||e===95||ft(e)}function tl(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Pb,xd,Ad,vd,Mb,kd,Ed,yn,Qt,$n,Od=M(()=>{"use strict";je();Pb={tokenize:Fb,partial:!0},xd={tokenize:Ub,partial:!0},Ad={tokenize:Hb,partial:!0},vd={tokenize:$b,partial:!0},Mb={tokenize:qb,partial:!0},kd={name:"wwwAutolink",tokenize:Lb,previous:Rd},Ed={name:"protocolAutolink",tokenize:Db,previous:Cd},yn={name:"emailAutolink",tokenize:Nb,previous:_d},Qt={};$n=48;for(;$n<123;)Qt[$n]=yn,$n++,$n===58?$n=65:$n===91&&($n=97);Qt[43]=yn;Qt[45]=yn;Qt[46]=yn;Qt[95]=yn;Qt[72]=[yn,Ed];Qt[104]=[yn,Ed];Qt[87]=[yn,kd];Qt[119]=[yn,kd]});var Id=M(()=>{"use strict";Od()});function ir(e){if(e===null||Le(e)||Xt(e))return 1;if(Un(e))return 2}var nl=M(()=>{"use strict";je()});function En(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Ur=M(()=>{"use strict"});function jb(e,t){let n=-1,r,i,a,o,s,c,p,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let h=Object.assign({},e[r][1].end),y=Object.assign({},e[n][1].start);Pd(h,-c),Pd(y,c),o={type:c>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[r][1].end)},s={type:c>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:y},a={type:c>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:c>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),p=[],e[r][1].end.offset-e[r][1].start.offset&&(p=Ct(p,[["enter",e[r][1],t],["exit",e[r][1],t]])),p=Ct(p,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),p=Ct(p,En(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),p=Ct(p,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,p=Ct(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,pt(e,r-1,n-r+3,p),n=r+p.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Bb(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ir(r),a;return o;function o(c){return a=c,e.enter("attentionSequence"),s(c)}function s(c){if(c===a)return e.consume(c),s;let p=e.exit("attentionSequence"),d=ir(c),h=!d||d===2&&i||n.includes(c),y=!i||i===2&&d||n.includes(r);return p._open=!!(a===42?h:h&&(i||!y)),p._close=!!(a===42?y:y&&(d||!h)),t(c)}}function Pd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Hr,Md=M(()=>{"use strict";gn();nl();Ur();Hr={name:"attention",tokenize:Bb,resolveAll:jb}});function zb(e,t,n){let r=0;return i;function i(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(g){return ht(g)?(e.consume(g),o):g===64?n(g):p(g)}function o(g){return g===43||g===45||g===46||ft(g)?(r=1,s(g)):p(g)}function s(g){return g===58?(e.consume(g),r=0,c):(g===43||g===45||g===46||ft(g))&&r++<32?(e.consume(g),s):(r=0,p(g))}function c(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Fn(g)?n(g):(e.consume(g),c)}function p(g){return g===64?(e.consume(g),d):Fu(g)?(e.consume(g),p):n(g)}function d(g){return ft(g)?h(g):n(g)}function h(g){return g===46?(e.consume(g),r=0,d):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):y(g)}function y(g){if((g===45||ft(g))&&r++<63){let I=g===45?y:h;return e.consume(g),I}return n(g)}}var rl,Nd=M(()=>{"use strict";je();rl={name:"autolink",tokenize:zb}});function we(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,a=0;return o;function o(c){return Te(c)?(e.enter(n),s(c)):t(c)}function s(c){return Te(c)&&a++<i?(e.consume(c),s):(e.exit(n),t(c))}}var ut=M(()=>{"use strict";je()});function Vb(e,t,n){return r;function r(a){return Te(a)?we(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||le(a)?t(a):n(a)}}var Zt,Aa=M(()=>{"use strict";ut();je();Zt={tokenize:Vb,partial:!0}});function Wb(e,t,n){let r=this;return i;function i(o){if(o===62){let s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return Te(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Yb(e,t,n){let r=this;return i;function i(o){return Te(o)?we(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(va,t,n)(o)}}function Jb(e){e.exit("blockQuote")}var va,Ld=M(()=>{"use strict";ut();je();va={name:"blockQuote",tokenize:Wb,continuation:{tokenize:Yb},exit:Jb}});function Gb(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Hu(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}var ka,Dd=M(()=>{"use strict";je();ka={name:"characterEscape",tokenize:Gb}});function Kb(e,t,n){let r=this,i=0,a,o;return s;function s(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),a=31,o=ft,d(h))}function p(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Uu,d):(e.enter("characterReferenceValue"),a=7,o=Lr,d(h))}function d(h){if(h===59&&i){let y=e.exit("characterReferenceValue");return o===ft&&!rr(r.sliceSerialize(y))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(h)&&i++<a?(e.consume(h),d):n(h)}}var Ea,Fd=M(()=>{"use strict";Sa();je();Ea={name:"characterReference",tokenize:Kb}});function Xb(e,t,n){let r=this,i={tokenize:_e,partial:!0},a=0,o=0,s;return c;function c($){return p($)}function p($){let Ue=r.events[r.events.length-1];return a=Ue&&Ue[1].type==="linePrefix"?Ue[2].sliceSerialize(Ue[1],!0).length:0,s=$,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d($)}function d($){return $===s?(o++,e.consume($),d):o<3?n($):(e.exit("codeFencedFenceSequence"),Te($)?we(e,h,"whitespace")($):h($))}function h($){return $===null||le($)?(e.exit("codeFencedFence"),r.interrupt?t($):e.check(Ud,K,ve)($)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y($))}function y($){return $===null||le($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h($)):Te($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),we(e,g,"whitespace")($)):$===96&&$===s?n($):(e.consume($),y)}function g($){return $===null||le($)?h($):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),I($))}function I($){return $===null||le($)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h($)):$===96&&$===s?n($):(e.consume($),I)}function K($){return e.attempt(i,ve,Z)($)}function Z($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),H}function H($){return a>0&&Te($)?we(e,ue,"linePrefix",a+1)($):ue($)}function ue($){return $===null||le($)?e.check(Ud,K,ve)($):(e.enter("codeFlowValue"),ne($))}function ne($){return $===null||le($)?(e.exit("codeFlowValue"),ue($)):(e.consume($),ne)}function ve($){return e.exit("codeFenced"),t($)}function _e($,Ue,Xe){let qe=0;return U;function U(Me){return $.enter("lineEnding"),$.consume(Me),$.exit("lineEnding"),xe}function xe(Me){return $.enter("codeFencedFence"),Te(Me)?we($,Be,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Me):Be(Me)}function Be(Me){return Me===s?($.enter("codeFencedFenceSequence"),ye(Me)):Xe(Me)}function ye(Me){return Me===s?(qe++,$.consume(Me),ye):qe>=o?($.exit("codeFencedFenceSequence"),Te(Me)?we($,Ie,"whitespace")(Me):Ie(Me)):Xe(Me)}function Ie(Me){return Me===null||le(Me)?($.exit("codeFencedFence"),Ue(Me)):Xe(Me)}}}function Qb(e,t,n){let r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}var Ud,Ra,Hd=M(()=>{"use strict";ut();je();Ud={tokenize:Qb,partial:!0},Ra={name:"codeFenced",tokenize:Xb,concrete:!0}});function ew(e,t,n){let r=this;return i;function i(p){return e.enter("codeIndented"),we(e,a,"linePrefix",5)(p)}function a(p){let d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(p):n(p)}function o(p){return p===null?c(p):le(p)?e.attempt(Zb,o,c)(p):(e.enter("codeFlowValue"),s(p))}function s(p){return p===null||le(p)?(e.exit("codeFlowValue"),o(p)):(e.consume(p),s)}function c(p){return e.exit("codeIndented"),t(p)}}function tw(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):le(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):we(e,a,"linePrefix",5)(o)}function a(o){let s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):le(o)?i(o):n(o)}}var $r,Zb,$d=M(()=>{"use strict";ut();je();$r={name:"codeIndented",tokenize:ew},Zb={tokenize:tw,partial:!0}});function nw(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function rw(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function iw(e,t,n){let r=this,i=0,a,o;return s;function s(y){return e.enter("codeText"),e.enter("codeTextSequence"),c(y)}function c(y){return y===96?(e.consume(y),i++,c):(e.exit("codeTextSequence"),p(y))}function p(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),p):y===96?(o=e.enter("codeTextSequence"),a=0,h(y)):le(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("codeTextData"),d(y))}function d(y){return y===null||y===32||y===96||le(y)?(e.exit("codeTextData"),p(y)):(e.consume(y),d)}function h(y){return y===96?(e.consume(y),a++,h):a===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(o.type="codeTextData",d(y))}}var il,qd=M(()=>{"use strict";je();il={name:"codeText",tokenize:iw,resolve:nw,previous:rw}});function qr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}var Ca,jd=M(()=>{"use strict";Ca=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n==null?Number.POSITIVE_INFINITY:n;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qr(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);qr(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qr(this.left,n.reverse())}}}});function _a(e){let t={},n=-1,r,i,a,o,s,c,p,d=new Ca(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,aw(d,n)),n=t[n],p=!0);else if(r[1]._container){for(a=n,i=void 0;a--&&(o=d.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);i&&(r[1].end=Object.assign({},d.get(i)[1].start),s=d.slice(i,n),s.unshift(r),d.splice(i,n-i+1,s))}}return pt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!p}function aw(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer||r.parser[n.contentType](n.start),s=o.events,c=[],p={},d,h,y=-1,g=n,I=0,K=0,Z=[K];for(;g;){for(;e.get(++i)[1]!==g;);a.push(i),g._tokenizer||(d=r.sliceStream(g),g.next||d.push(null),h&&o.defineSkip(g.start),g._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),g._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=g,g=g.next}for(g=n;++y<s.length;)s[y][0]==="exit"&&s[y-1][0]==="enter"&&s[y][1].type===s[y-1][1].type&&s[y][1].start.line!==s[y][1].end.line&&(K=y+1,Z.push(K),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(o.events=[],g?(g._tokenizer=void 0,g.previous=void 0):Z.pop(),y=Z.length;y--;){let H=s.slice(Z[y],Z[y+1]),ue=a.pop();c.push([ue,ue+H.length-1]),e.splice(ue,2,H)}for(c.reverse(),y=-1;++y<c.length;)p[I+c[y][0]]=I+c[y][1],I+=c[y][1]-c[y][0]-1;return p}var al=M(()=>{"use strict";gn();jd()});function sw(e){return _a(e),e}function lw(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?a(s):le(s)?e.check(ow,o,a)(s):(e.consume(s),i)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function o(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function cw(e,t,n){let r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),we(e,a,"linePrefix")}function a(o){if(o===null||le(o))return n(o);let s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}var ol,ow,Bd=M(()=>{"use strict";ut();je();al();ol={tokenize:lw,resolve:sw},ow={tokenize:cw,partial:!0}});function Oa(e,t,n,r,i,a,o,s,c){let p=c||Number.POSITIVE_INFINITY,d=0;return h;function h(H){return H===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(H),e.exit(a),y):H===null||H===32||H===41||Fn(H)?n(H):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),K(H))}function y(H){return H===62?(e.enter(a),e.consume(H),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(H))}function g(H){return H===62?(e.exit("chunkString"),e.exit(s),y(H)):H===null||H===60||le(H)?n(H):(e.consume(H),H===92?I:g)}function I(H){return H===60||H===62||H===92?(e.consume(H),g):g(H)}function K(H){return!d&&(H===null||H===41||Le(H))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(H)):d<p&&H===40?(e.consume(H),d++,K):H===41?(e.consume(H),d--,K):H===null||H===32||H===40||Fn(H)?n(H):(e.consume(H),H===92?Z:K)}function Z(H){return H===40||H===41||H===92?(e.consume(H),K):K(H)}}var sl=M(()=>{"use strict";je()});function Ia(e,t,n,r,i,a){let o=this,s=0,c;return p;function p(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(a),d}function d(g){return s>999||g===null||g===91||g===93&&!c||g===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(g):g===93?(e.exit(a),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):le(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||le(g)||s++>999?(e.exit("chunkString"),d(g)):(e.consume(g),c||(c=!Te(g)),g===92?y:h)}function y(g){return g===91||g===92||g===93?(e.consume(g),s++,h):h(g)}}var ll=M(()=>{"use strict";je()});function Pa(e,t,n,r,i,a){let o;return s;function s(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,c):n(y)}function c(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),p(y))}function p(y){return y===o?(e.exit(a),c(o)):y===null?n(y):le(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),we(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===o||y===null||le(y)?(e.exit("chunkString"),p(y)):(e.consume(y),y===92?h:d)}function h(y){return y===o||y===92?(e.consume(y),d):d(y)}}var cl=M(()=>{"use strict";ut();je()});function qn(e,t){let n;return r;function r(i){return le(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Te(i)?we(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var ul=M(()=>{"use strict";ut();je()});function pw(e,t,n){let r=this,i;return a;function a(g){return e.enter("definition"),o(g)}function o(g){return Ia.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return i=xt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),c):n(g)}function c(g){return Le(g)?qn(e,p)(g):p(g)}function p(g){return Oa(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function d(g){return e.attempt(uw,h,h)(g)}function h(g){return Te(g)?we(e,y,"whitespace")(g):y(g)}function y(g){return g===null||le(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function dw(e,t,n){return r;function r(s){return Le(s)?qn(e,i)(s):n(s)}function i(s){return Pa(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Te(s)?we(e,o,"whitespace")(s):o(s)}function o(s){return s===null||le(s)?t(s):n(s)}}var pl,uw,zd=M(()=>{"use strict";sl();ll();ut();cl();ul();je();er();pl={name:"definition",tokenize:pw},uw={tokenize:dw,partial:!0}});function hw(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return le(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}var dl,Vd=M(()=>{"use strict";je();dl={name:"hardBreakEscape",tokenize:hw}});function fw(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},pt(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function mw(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Le(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||le(d)?(e.exit("atxHeading"),t(d)):Te(d)?we(e,s,"whitespace")(d):(e.enter("atxHeadingText"),p(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),s(d))}function p(d){return d===null||d===35||Le(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),p)}}var hl,Wd=M(()=>{"use strict";ut();je();gn();hl={name:"headingAtx",tokenize:mw,resolve:fw}});var Yd,fl,Jd=M(()=>{"use strict";Yd=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fl=["pre","script","style","textarea"]});function bw(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ww(e,t,n){let r=this,i,a,o,s,c;return p;function p(R){return d(R)}function d(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),h}function h(R){return R===33?(e.consume(R),y):R===47?(e.consume(R),a=!0,K):R===63?(e.consume(R),i=3,r.interrupt?t:k):ht(R)?(e.consume(R),o=String.fromCharCode(R),Z):n(R)}function y(R){return R===45?(e.consume(R),i=2,g):R===91?(e.consume(R),i=5,s=0,I):ht(R)?(e.consume(R),i=4,r.interrupt?t:k):n(R)}function g(R){return R===45?(e.consume(R),r.interrupt?t:k):n(R)}function I(R){let wt="CDATA[";return R===wt.charCodeAt(s++)?(e.consume(R),s===wt.length?r.interrupt?t:Be:I):n(R)}function K(R){return ht(R)?(e.consume(R),o=String.fromCharCode(R),Z):n(R)}function Z(R){if(R===null||R===47||R===62||Le(R)){let wt=R===47,on=o.toLowerCase();return!wt&&!a&&fl.includes(on)?(i=1,r.interrupt?t(R):Be(R)):Yd.includes(o.toLowerCase())?(i=6,wt?(e.consume(R),H):r.interrupt?t(R):Be(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):a?ue(R):ne(R))}return R===45||ft(R)?(e.consume(R),o+=String.fromCharCode(R),Z):n(R)}function H(R){return R===62?(e.consume(R),r.interrupt?t:Be):n(R)}function ue(R){return Te(R)?(e.consume(R),ue):U(R)}function ne(R){return R===47?(e.consume(R),U):R===58||R===95||ht(R)?(e.consume(R),ve):Te(R)?(e.consume(R),ne):U(R)}function ve(R){return R===45||R===46||R===58||R===95||ft(R)?(e.consume(R),ve):_e(R)}function _e(R){return R===61?(e.consume(R),$):Te(R)?(e.consume(R),_e):ne(R)}function $(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),c=R,Ue):Te(R)?(e.consume(R),$):Xe(R)}function Ue(R){return R===c?(e.consume(R),c=null,qe):R===null||le(R)?n(R):(e.consume(R),Ue)}function Xe(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||Le(R)?_e(R):(e.consume(R),Xe)}function qe(R){return R===47||R===62||Te(R)?ne(R):n(R)}function U(R){return R===62?(e.consume(R),xe):n(R)}function xe(R){return R===null||le(R)?Be(R):Te(R)?(e.consume(R),xe):n(R)}function Be(R){return R===45&&i===2?(e.consume(R),tt):R===60&&i===1?(e.consume(R),ct):R===62&&i===4?(e.consume(R),vt):R===63&&i===3?(e.consume(R),k):R===93&&i===5?(e.consume(R),Ht):le(R)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(gw,Lt,ye)(R)):R===null||le(R)?(e.exit("htmlFlowData"),ye(R)):(e.consume(R),Be)}function ye(R){return e.check(yw,Ie,Lt)(R)}function Ie(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),Me}function Me(R){return R===null||le(R)?ye(R):(e.enter("htmlFlowData"),Be(R))}function tt(R){return R===45?(e.consume(R),k):Be(R)}function ct(R){return R===47?(e.consume(R),o="",Nt):Be(R)}function Nt(R){if(R===62){let wt=o.toLowerCase();return fl.includes(wt)?(e.consume(R),vt):Be(R)}return ht(R)&&o.length<8?(e.consume(R),o+=String.fromCharCode(R),Nt):Be(R)}function Ht(R){return R===93?(e.consume(R),k):Be(R)}function k(R){return R===62?(e.consume(R),vt):R===45&&i===2?(e.consume(R),k):Be(R)}function vt(R){return R===null||le(R)?(e.exit("htmlFlowData"),Lt(R)):(e.consume(R),vt)}function Lt(R){return e.exit("htmlFlow"),t(R)}}function Sw(e,t,n){let r=this;return i;function i(o){return le(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Tw(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Zt,t,n)}}var ml,gw,yw,Gd=M(()=>{"use strict";je();Jd();Aa();ml={name:"htmlFlow",tokenize:ww,resolveTo:bw,concrete:!0},gw={tokenize:Tw,partial:!0},yw={tokenize:Sw,partial:!0}});function xw(e,t,n){let r=this,i,a,o;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),c}function c(k){return k===33?(e.consume(k),p):k===47?(e.consume(k),_e):k===63?(e.consume(k),ne):ht(k)?(e.consume(k),Xe):n(k)}function p(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),a=0,I):ht(k)?(e.consume(k),ue):n(k)}function d(k){return k===45?(e.consume(k),g):n(k)}function h(k){return k===null?n(k):k===45?(e.consume(k),y):le(k)?(o=h,ct(k)):(e.consume(k),h)}function y(k){return k===45?(e.consume(k),g):h(k)}function g(k){return k===62?tt(k):k===45?y(k):h(k)}function I(k){let vt="CDATA[";return k===vt.charCodeAt(a++)?(e.consume(k),a===vt.length?K:I):n(k)}function K(k){return k===null?n(k):k===93?(e.consume(k),Z):le(k)?(o=K,ct(k)):(e.consume(k),K)}function Z(k){return k===93?(e.consume(k),H):K(k)}function H(k){return k===62?tt(k):k===93?(e.consume(k),H):K(k)}function ue(k){return k===null||k===62?tt(k):le(k)?(o=ue,ct(k)):(e.consume(k),ue)}function ne(k){return k===null?n(k):k===63?(e.consume(k),ve):le(k)?(o=ne,ct(k)):(e.consume(k),ne)}function ve(k){return k===62?tt(k):ne(k)}function _e(k){return ht(k)?(e.consume(k),$):n(k)}function $(k){return k===45||ft(k)?(e.consume(k),$):Ue(k)}function Ue(k){return le(k)?(o=Ue,ct(k)):Te(k)?(e.consume(k),Ue):tt(k)}function Xe(k){return k===45||ft(k)?(e.consume(k),Xe):k===47||k===62||Le(k)?qe(k):n(k)}function qe(k){return k===47?(e.consume(k),tt):k===58||k===95||ht(k)?(e.consume(k),U):le(k)?(o=qe,ct(k)):Te(k)?(e.consume(k),qe):tt(k)}function U(k){return k===45||k===46||k===58||k===95||ft(k)?(e.consume(k),U):xe(k)}function xe(k){return k===61?(e.consume(k),Be):le(k)?(o=xe,ct(k)):Te(k)?(e.consume(k),xe):qe(k)}function Be(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,ye):le(k)?(o=Be,ct(k)):Te(k)?(e.consume(k),Be):(e.consume(k),Ie)}function ye(k){return k===i?(e.consume(k),i=void 0,Me):k===null?n(k):le(k)?(o=ye,ct(k)):(e.consume(k),ye)}function Ie(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Le(k)?qe(k):(e.consume(k),Ie)}function Me(k){return k===47||k===62||Le(k)?qe(k):n(k)}function tt(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function ct(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),Nt}function Nt(k){return Te(k)?we(e,Ht,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):Ht(k)}function Ht(k){return e.enter("htmlTextData"),o(k)}}var gl,Kd=M(()=>{"use strict";ut();je();gl={name:"htmlText",tokenize:xw}});function Ew(e){let t=-1;for(;++t<e.length;){let n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Rw(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);let c={type:e[a][1].type==="labelLink"?"link":"image",start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)},p={type:"label",start:Object.assign({},e[a][1].start),end:Object.assign({},e[o][1].end)},d={type:"labelText",start:Object.assign({},e[a+r+2][1].end),end:Object.assign({},e[o-2][1].start)};return s=[["enter",c,t],["enter",p,t]],s=Ct(s,e.slice(a+1,a+r+3)),s=Ct(s,[["enter",d,t]]),s=Ct(s,En(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Ct(s,[["exit",d,t],e[o-2],e[o-1],["exit",p,t]]),s=Ct(s,e.slice(o+1)),s=Ct(s,[["exit",c,t]]),pt(e,a,e.length,s),e}function Cw(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(y){return a?a._inactive?h(y):(o=r.parser.defined.includes(xt(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),c):n(y)}function c(y){return y===40?e.attempt(Aw,d,o?d:h)(y):y===91?e.attempt(vw,d,o?p:h)(y):o?d(y):h(y)}function p(y){return e.attempt(kw,d,h)(y)}function d(y){return t(y)}function h(y){return a._balanced=!0,n(y)}}function _w(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Le(h)?qn(e,a)(h):a(h)}function a(h){return h===41?d(h):Oa(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return Le(h)?qn(e,c)(h):d(h)}function s(h){return n(h)}function c(h){return h===34||h===39||h===40?Pa(e,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function p(h){return Le(h)?qn(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Ow(e,t,n){let r=this;return i;function i(s){return Ia.call(r,e,a,o,"reference","referenceMarker","referenceString")(s)}function a(s){return r.parser.defined.includes(xt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function o(s){return n(s)}}function Iw(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}var jn,Aw,vw,kw,Ma=M(()=>{"use strict";sl();ll();cl();ul();je();gn();er();Ur();jn={name:"labelEnd",tokenize:Cw,resolveTo:Rw,resolveAll:Ew},Aw={tokenize:_w},vw={tokenize:Ow},kw={tokenize:Iw}});function Pw(e,t,n){let r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),o):n(s)}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var yl,Xd=M(()=>{"use strict";Ma();yl={name:"labelStartImage",tokenize:Pw,resolveAll:jn.resolveAll}});function Mw(e,t,n){let r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}var bl,Qd=M(()=>{"use strict";Ma();bl={name:"labelStartLink",tokenize:Mw,resolveAll:jn.resolveAll}});function Nw(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),we(e,t,"linePrefix")}}var jr,Zd=M(()=>{"use strict";ut();jr={name:"lineEnding",tokenize:Nw}});function Lw(e,t,n){let r=0,i;return a;function a(p){return e.enter("thematicBreak"),o(p)}function o(p){return i=p,s(p)}function s(p){return p===i?(e.enter("thematicBreakSequence"),c(p)):r>=3&&(p===null||le(p))?(e.exit("thematicBreak"),t(p)):n(p)}function c(p){return p===i?(e.consume(p),r++,c):(e.exit("thematicBreakSequence"),Te(p)?we(e,s,"whitespace")(p):s(p))}}var Bn,wl=M(()=>{"use strict";ut();je();Bn={name:"thematicBreak",tokenize:Lw}});function Uw(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(g){let I=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(I==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:Lr(g)){if(r.containerState.type||(r.containerState.type=I,e.enter(I,{_container:!0})),I==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Bn,n,p)(g):p(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(g)}return n(g)}function c(g){return Lr(g)&&++o<10?(e.consume(g),c):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),p(g)):n(g)}function p(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(Zt,r.interrupt?n:d,e.attempt(Dw,y,h))}function d(g){return r.containerState.initialBlankLine=!0,a++,y(g)}function h(g){return Te(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),y):n(g)}function y(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function Hw(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Zt,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,we(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!Te(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Fw,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,we(e,e.attempt(At,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function $w(e,t,n){let r=this;return we(e,i,"listItemIndent",r.containerState.size+1);function i(a){let o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function qw(e){e.exit(this.containerState.type)}function jw(e,t,n){let r=this;return we(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){let o=r.events[r.events.length-1];return!Te(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}var At,Dw,Fw,eh=M(()=>{"use strict";ut();je();Aa();wl();At={name:"list",tokenize:Uw,continuation:{tokenize:Hw},exit:qw},Dw={tokenize:jw,partial:!0},Fw={tokenize:$w,partial:!0}});function Bw(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);let o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function zw(e,t,n){let r=this,i;return a;function a(p){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=p,o(p)):n(p)}function o(p){return e.enter("setextHeadingLineSequence"),s(p)}function s(p){return p===i?(e.consume(p),s):(e.exit("setextHeadingLineSequence"),Te(p)?we(e,c,"lineSuffix")(p):c(p))}function c(p){return p===null||le(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}var Na,th=M(()=>{"use strict";ut();je();Na={name:"setextUnderline",tokenize:zw,resolveTo:Bw}});var La=M(()=>{"use strict";Md();Nd();Aa();Ld();Dd();Fd();Hd();$d();qd();Bd();zd();Vd();Wd();Gd();Kd();Ma();Xd();Qd();Zd();eh();th();wl()});function Sl(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Gw,continuation:{tokenize:Kw},exit:Xw}},text:{91:{name:"gfmFootnoteCall",tokenize:Jw},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ww,resolveTo:Yw}}}}function Ww(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return s;function s(c){if(!o||!o._balanced)return n(c);let p=xt(r.sliceSerialize({start:o.end,end:r.now()}));return p.codePointAt(0)!==94||!a.includes(p.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Yw(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function Jw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(h){if(a>999||h===93&&!o||h===null||h===91||Le(h))return n(h);if(h===93){e.exit("chunkString");let y=e.exit("gfmFootnoteCallString");return i.includes(xt(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Le(h)||(o=!0),a++,e.consume(h),h===92?d:p}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,p):p(h)}}function Gw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(I){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(I),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(I){return I===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(I),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(I)}function d(I){if(o>999||I===93&&!s||I===null||I===91||Le(I))return n(I);if(I===93){e.exit("chunkString");let K=e.exit("gfmFootnoteDefinitionLabelString");return a=xt(r.sliceSerialize(K)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(I),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Le(I)||(s=!0),o++,e.consume(I),I===92?h:d}function h(I){return I===91||I===92||I===93?(e.consume(I),o++,d):d(I)}function y(I){return I===58?(e.enter("definitionMarker"),e.consume(I),e.exit("definitionMarker"),i.includes(a)||i.push(a),we(e,g,"gfmFootnoteDefinitionWhitespace")):n(I)}function g(I){return t(I)}}function Kw(e,t,n){return e.check(Zt,t,e.attempt(Vw,t,n))}function Xw(e){e.exit("gfmFootnoteDefinition")}function Qw(e,t,n){let r=this;return we(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){let o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}var Vw,nh=M(()=>{"use strict";La();ut();je();er();Vw={tokenize:Qw,partial:!0}});var rh=M(()=>{"use strict";nh()});function Tl(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,s){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let p=c;for(;p--;)if(o[p][0]==="exit"&&o[p][1].type==="strikethroughSequenceTemporary"&&o[p][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[p][1].end.offset-o[p][1].start.offset){o[c][1].type="strikethroughSequence",o[p][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},o[p][1].start),end:Object.assign({},o[c][1].end)},h={type:"strikethroughText",start:Object.assign({},o[p][1].end),end:Object.assign({},o[c][1].start)},y=[["enter",d,s],["enter",o[p][1],s],["exit",o[p][1],s],["enter",h,s]],g=s.parser.constructs.insideSpan.null;g&&pt(y,y.length,0,En(g,o.slice(p+1,c),s)),pt(y,y.length,0,[["exit",h,s],["enter",o[c][1],s],["exit",o[c][1],s],["exit",d,s]]),pt(o,p-1,c-p+3,y),c=p+y.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function a(o,s,c){let p=this.previous,d=this.events,h=0;return y;function y(I){return p===126&&d[d.length-1][1].type!=="characterEscape"?c(I):(o.enter("strikethroughSequenceTemporary"),g(I))}function g(I){let K=ir(p);if(I===126)return h>1?c(I):(o.consume(I),h++,g);if(h<2&&!n)return c(I);let Z=o.exit("strikethroughSequenceTemporary"),H=ir(I);return Z._open=!H||H===2&&!!K,Z._close=!K||K===2&&!!H,s(I)}}}var ih=M(()=>{"use strict";gn();nl();Ur()});var ah=M(()=>{"use strict";ih()});function Zw(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}var Da,oh=M(()=>{"use strict";Da=class{constructor(){this.map=[]}add(t,n,r){Zw(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}});function sh(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}var lh=M(()=>{"use strict"});function xl(){return{flow:{null:{name:"table",tokenize:eS,resolveAll:tS}}}}function eS(e,t,n){let r=this,i=0,a=0,o;return s;function s(U){let xe=r.events.length-1;for(;xe>-1;){let Ie=r.events[xe][1].type;if(Ie==="lineEnding"||Ie==="linePrefix")xe--;else break}let Be=xe>-1?r.events[xe][1].type:null,ye=Be==="tableHead"||Be==="tableRow"?$:c;return ye===$&&r.parser.lazy[r.now().line]?n(U):ye(U)}function c(U){return e.enter("tableHead"),e.enter("tableRow"),p(U)}function p(U){return U===124||(o=!0,a+=1),d(U)}function d(U){return U===null?n(U):le(U)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),g):n(U):Te(U)?we(e,d,"whitespace")(U):(a+=1,o&&(o=!1,i+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),h(U)))}function h(U){return U===null||U===124||Le(U)?(e.exit("data"),d(U)):(e.consume(U),U===92?y:h)}function y(U){return U===92||U===124?(e.consume(U),h):h(U)}function g(U){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(U):(e.enter("tableDelimiterRow"),o=!1,Te(U)?we(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):I(U))}function I(U){return U===45||U===58?Z(U):U===124?(o=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),K):_e(U)}function K(U){return Te(U)?we(e,Z,"whitespace")(U):Z(U)}function Z(U){return U===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),H):U===45?(a+=1,H(U)):U===null||le(U)?ve(U):_e(U)}function H(U){return U===45?(e.enter("tableDelimiterFiller"),ue(U)):_e(U)}function ue(U){return U===45?(e.consume(U),ue):U===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),ne):(e.exit("tableDelimiterFiller"),ne(U))}function ne(U){return Te(U)?we(e,ve,"whitespace")(U):ve(U)}function ve(U){return U===124?I(U):U===null||le(U)?!o||i!==a?_e(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(U)):_e(U)}function _e(U){return n(U)}function $(U){return e.enter("tableRow"),Ue(U)}function Ue(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),Ue):U===null||le(U)?(e.exit("tableRow"),t(U)):Te(U)?we(e,Ue,"whitespace")(U):(e.enter("data"),Xe(U))}function Xe(U){return U===null||U===124||Le(U)?(e.exit("data"),Ue(U)):(e.consume(U),U===92?qe:Xe)}function qe(U){return U===92||U===124?(e.consume(U),Xe):Xe(U)}}function tS(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,p,d,h,y=new Da;for(;++n<e.length;){let g=e[n],I=g[1];g[0]==="enter"?I.type==="tableHead"?(s=!1,c!==0&&(ch(y,t,c,p,d),d=void 0,c=0),p={type:"table",start:Object.assign({},I.start),end:Object.assign({},I.end)},y.add(n,0,[["enter",p,t]])):I.type==="tableRow"||I.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,d={type:"tableBody",start:Object.assign({},I.start),end:Object.assign({},I.end)},y.add(n,0,[["enter",d,t]])),i=I.type==="tableDelimiterRow"?2:d?3:1):i&&(I.type==="data"||I.type==="tableDelimiterMarker"||I.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],h=Fa(y,t,a,i,void 0,h),a=[0,0,0,0]),o[2]=n)):I.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],h=Fa(y,t,a,i,void 0,h)),a=o,o=[a[1],n,0,0])):I.type==="tableHead"?(s=!0,c=n):I.type==="tableRow"||I.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],h=Fa(y,t,a,i,n,h)):o[1]!==0&&(h=Fa(y,t,o,i,n,h)),i=0):i&&(I.type==="data"||I.type==="tableDelimiterMarker"||I.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&ch(y,t,c,p,d),y.consume(t.events),n=-1;++n<t.events.length;){let g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=sh(t.events,n))}return e}function Fa(e,t,n,r,i,a){let o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(a.end=Object.assign({},ar(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));let c=ar(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){let p=ar(t.events,n[2]),d=ar(t.events,n[3]),h={type:s,start:Object.assign({},p),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){let y=t.events[n[2]],g=t.events[n[3]];if(y[1].end=Object.assign({},g[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){let I=n[2]+1,K=n[3]-n[2]-1;e.add(I,K,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(a.end=Object.assign({},ar(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function ch(e,t,n,r,i){let a=[],o=ar(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function ar(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var uh=M(()=>{"use strict";ut();je();oh();lh()});var ph=M(()=>{"use strict";uh()});function Al(){return{text:{91:nS}}}function rS(e,t,n){let r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return Le(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(c)}function s(c){return le(c)?t(c):Te(c)?e.check({tokenize:iS},t,n)(c):n(c)}}function iS(e,t,n){return we(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}var nS,dh=M(()=>{"use strict";ut();je();nS={name:"tasklistCheck",tokenize:rS}});var hh=M(()=>{"use strict";dh()});function fh(e){return xa([el(),Sl(),Tl(e),xl(),Al()])}var mh=M(()=>{"use strict";Qs();Id();rh();ah();ph();hh()});function Ua(e){let t=this,n=e||aS,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(fh(n)),a.push(Ks()),o.push(Xs(n))}var aS,gh=M(()=>{"use strict";Sd();mh();aS={}});var yh=M(()=>{"use strict";gh()});function oS(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),we(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),a(s)}function a(s){let c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(s)}function o(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return le(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),o)}}var bh,wh=M(()=>{"use strict";ut();je();bh={tokenize:oS}});function sS(e){let t=this,n=[],r=0,i,a,o;return s;function s(ne){if(r<n.length){let ve=n[r];return t.containerState=ve[1],e.attempt(ve[0].continuation,c,p)(ne)}return p(ne)}function c(ne){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&ue();let ve=t.events.length,_e=ve,$;for(;_e--;)if(t.events[_e][0]==="exit"&&t.events[_e][1].type==="chunkFlow"){$=t.events[_e][1].end;break}H(r);let Ue=ve;for(;Ue<t.events.length;)t.events[Ue][1].end=Object.assign({},$),Ue++;return pt(t.events,_e+1,0,t.events.slice(ve)),t.events.length=Ue,p(ne)}return s(ne)}function p(ne){if(r===n.length){if(!i)return y(ne);if(i.currentConstruct&&i.currentConstruct.concrete)return I(ne);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Sh,d,h)(ne)}function d(ne){return i&&ue(),H(r),y(ne)}function h(ne){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,I(ne)}function y(ne){return t.containerState={},e.attempt(Sh,g,I)(ne)}function g(ne){return r++,n.push([t.currentConstruct,t.containerState]),y(ne)}function I(ne){if(ne===null){i&&ue(),H(0),e.consume(ne);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:a,_tokenizer:i}),K(ne)}function K(ne){if(ne===null){Z(e.exit("chunkFlow"),!0),H(0),e.consume(ne);return}return le(ne)?(e.consume(ne),Z(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(ne),K)}function Z(ne,ve){let _e=t.sliceStream(ne);if(ve&&_e.push(null),ne.previous=a,a&&(a.next=ne),a=ne,i.defineSkip(ne.start),i.write(_e),t.parser.lazy[ne.start.line]){let $=i.events.length;for(;$--;)if(i.events[$][1].start.offset<o&&(!i.events[$][1].end||i.events[$][1].end.offset>o))return;let Ue=t.events.length,Xe=Ue,qe,U;for(;Xe--;)if(t.events[Xe][0]==="exit"&&t.events[Xe][1].type==="chunkFlow"){if(qe){U=t.events[Xe][1].end;break}qe=!0}for(H(r),$=Ue;$<t.events.length;)t.events[$][1].end=Object.assign({},U),$++;pt(t.events,Xe+1,0,t.events.slice(Ue)),t.events.length=$}}function H(ne){let ve=n.length;for(;ve-- >ne;){let _e=n[ve];t.containerState=_e[1],_e[0].exit.call(t,e)}n.length=ne}function ue(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lS(e,t,n){return we(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var Th,Sh,xh=M(()=>{"use strict";ut();je();gn();Th={tokenize:sS},Sh={tokenize:lS}});function cS(e){let t=this,n=e.attempt(Zt,r,e.attempt(this.parser.constructs.flowInitial,i,we(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ol,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var Ah,vh=M(()=>{"use strict";La();ut();Ah={tokenize:cS}});function Ch(e){return{tokenize:t,resolveAll:_h(e==="text"?uS:void 0)};function t(n){let r=this,i=this.parser.constructs[e],a=n.attempt(i,o,s);return o;function o(d){return p(d)?a(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return p(d)?(n.exit("data"),a(d)):(n.consume(d),c)}function p(d){if(d===null)return!0;let h=i[d],y=-1;if(h)for(;++y<h.length;){let g=h[y];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function _h(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function uS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let p=i[a];if(typeof p=="string"){for(o=p.length;p.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(p===-2)c=!0,s++;else if(p!==-1){a++;break}}if(s){let p={type:n===e.length||c||s<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+a,_bufferIndex:a?o:r.start._bufferIndex+o},end:Object.assign({},r.end)};r.end=Object.assign({},p.start),r.start.offset===r.end.offset?Object.assign(r,p):(e.splice(n,0,["enter",p,t],["exit",p,t]),n+=2)}n++}return e}var kh,Eh,Rh,vl=M(()=>{"use strict";kh={resolveAll:_h()},Eh=Ch("string"),Rh=Ch("text")});function Oh(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),i={},a=[],o=[],s=[],c=!0,p={consume:ve,enter:_e,exit:$,attempt:qe(Ue),check:qe(Xe),interrupt:qe(Xe,{interrupt:!0})},d={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:K,sliceSerialize:I,now:Z,defineSkip:H,write:g},h=t.tokenize.call(d,p),y;return t.resolveAll&&a.push(t),d;function g(ye){return o=Ct(o,ye),ue(),o[o.length-1]!==null?[]:(U(t,0),d.events=En(a,d.events,d),d.events)}function I(ye,Ie){return dS(K(ye),Ie)}function K(ye){return pS(o,ye)}function Z(){let{line:ye,column:Ie,offset:Me,_index:tt,_bufferIndex:ct}=r;return{line:ye,column:Ie,offset:Me,_index:tt,_bufferIndex:ct}}function H(ye){i[ye.line]=ye.column,Be()}function ue(){let ye;for(;r._index<o.length;){let Ie=o[r._index];if(typeof Ie=="string")for(ye=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ye&&r._bufferIndex<Ie.length;)ne(Ie.charCodeAt(r._bufferIndex));else ne(Ie)}}function ne(ye){c=void 0,y=ye,h=h(ye)}function ve(ye){le(ye)?(r.line++,r.column=1,r.offset+=ye===-3?2:1,Be()):ye!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=ye,c=!0}function _e(ye,Ie){let Me=Ie||{};return Me.type=ye,Me.start=Z(),d.events.push(["enter",Me,d]),s.push(Me),Me}function $(ye){let Ie=s.pop();return Ie.end=Z(),d.events.push(["exit",Ie,d]),Ie}function Ue(ye,Ie){U(ye,Ie.from)}function Xe(ye,Ie){Ie.restore()}function qe(ye,Ie){return Me;function Me(tt,ct,Nt){let Ht,k,vt,Lt;return Array.isArray(tt)?wt(tt):"tokenize"in tt?wt([tt]):R(tt);function R(dt){return In;function In(Wt){let sn=Wt!==null&&dt[Wt],wn=Wt!==null&&dt.null,yr=[...Array.isArray(sn)?sn:sn?[sn]:[],...Array.isArray(wn)?wn:wn?[wn]:[]];return wt(yr)(Wt)}}function wt(dt){return Ht=dt,k=0,dt.length===0?Nt:on(dt[k])}function on(dt){return In;function In(Wt){return Lt=xe(),vt=dt,dt.partial||(d.currentConstruct=dt),dt.name&&d.parser.constructs.disable.null.includes(dt.name)?Gn(Wt):dt.tokenize.call(Ie?Object.assign(Object.create(d),Ie):d,p,gr,Gn)(Wt)}}function gr(dt){return c=!0,ye(vt,Lt),ct}function Gn(dt){return c=!0,Lt.restore(),++k<Ht.length?on(Ht[k]):Nt}}}function U(ye,Ie){ye.resolveAll&&!a.includes(ye)&&a.push(ye),ye.resolve&&pt(d.events,Ie,d.events.length-Ie,ye.resolve(d.events.slice(Ie),d)),ye.resolveTo&&(d.events=ye.resolveTo(d.events,d))}function xe(){let ye=Z(),Ie=d.previous,Me=d.currentConstruct,tt=d.events.length,ct=Array.from(s);return{restore:Nt,from:tt};function Nt(){r=ye,d.previous=Ie,d.currentConstruct=Me,d.events.length=tt,s=ct,Be()}}function Be(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function pS(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function dS(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
17
+ `;break}case-3:{o=`\r
18
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}var Ih=M(()=>{"use strict";je();gn();Ur()});var kl={};hs(kl,{attentionMarkers:()=>SS,contentInitial:()=>fS,disable:()=>TS,document:()=>hS,flow:()=>gS,flowInitial:()=>mS,insideSpan:()=>wS,string:()=>yS,text:()=>bS});var hS,fS,mS,gS,yS,bS,wS,SS,TS,Ph=M(()=>{"use strict";La();vl();hS={42:At,43:At,45:At,48:At,49:At,50:At,51:At,52:At,53:At,54:At,55:At,56:At,57:At,62:va},fS={91:pl},mS={[-2]:$r,[-1]:$r,32:$r},gS={35:hl,42:Bn,45:[Na,Bn],60:ml,61:Na,95:Bn,96:Ra,126:Ra},yS={38:Ea,92:ka},bS={[-5]:jr,[-4]:jr,[-3]:jr,33:yl,38:Ea,42:Hr,60:[rl,gl],91:bl,92:[dl,ka],93:jn,95:Hr,96:il},wS={null:[Hr,kh]},SS={null:[42,95]},TS={null:[]}});function El(e){let n=xa([kl,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(bh),document:i(Th),flow:i(Ah),string:i(Eh),text:i(Rh)};return r;function i(a){return o;function o(s){return Oh(r,a,s)}}}var Mh=M(()=>{"use strict";Qs();wh();xh();vh();vl();Ih();Ph()});function Rl(e){for(;!_a(e););return e}var Nh=M(()=>{"use strict";al()});function Cl(){let e=1,t="",n=!0,r;return i;function i(a,o,s){let c=[],p,d,h,y,g;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(Lh.lastIndex=h,p=Lh.exec(a),y=p&&p.index!==void 0?p.index:a.length,g=a.charCodeAt(y),!p){t=a.slice(h);break}if(g===10&&h===y&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<y&&(c.push(a.slice(h,y)),e+=y-h),g){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=y+1}return s&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}var Lh,Dh=M(()=>{"use strict";Lh=/[\0\t\n\r]/g});var Fh=M(()=>{"use strict";Mh();Nh();Dh()});function Rn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Uh(e.position):"start"in e||"end"in e?Uh(e):"line"in e||"column"in e?_l(e):""}function _l(e){return Hh(e&&e.line)+":"+Hh(e&&e.column)}function Uh(e){return _l(e&&e.start)+"-"+_l(e&&e.end)}function Hh(e){return e&&typeof e=="number"?e:1}var $h=M(()=>{"use strict"});var Ol=M(()=>{"use strict";$h()});function Il(e,t,n){return typeof t!="string"&&(n=t,t=void 0),xS(n)(Rl(El(n).document().write(Cl()(e,t,!0))))}function xS(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(_i),autolinkProtocol:qe,autolinkEmail:qe,atxHeading:a(Ri),blockQuote:a(Wt),characterEscape:qe,characterReference:qe,codeFenced:a(sn),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(sn,o),codeText:a(wn,o),codeTextData:qe,data:qe,codeFlowValue:qe,definition:a(yr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(zo),hardBreakEscape:a(Ci),hardBreakTrailing:a(Ci),htmlFlow:a(br,o),htmlFlowData:qe,htmlText:a(br,o),htmlTextData:qe,image:a(Vo),label:o,link:a(_i),listItem:a(Wo),listItemValue:y,listOrdered:a(Oi,h),listUnordered:a(Oi),paragraph:a(Yo),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Ri),strong:a(Jo),thematicBreak:a(Ko)},exit:{atxHeading:c(),atxHeadingSequence:_e,autolink:c(),autolinkEmail:In,autolinkProtocol:dt,blockQuote:c(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:on,characterReferenceMarkerNumeric:on,characterReferenceValue:gr,characterReference:Gn,codeFenced:c(Z),codeFencedFence:K,codeFencedFenceInfo:g,codeFencedFenceMeta:I,codeFlowValue:U,codeIndented:c(H),codeText:c(Me),codeTextData:U,data:U,definition:c(),definitionDestinationString:ve,definitionLabelString:ue,definitionTitleString:ne,emphasis:c(),hardBreakEscape:c(Be),hardBreakTrailing:c(Be),htmlFlow:c(ye),htmlFlowData:U,htmlText:c(Ie),htmlTextData:U,image:c(ct),label:Ht,labelText:Nt,lineEnding:xe,link:c(tt),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:wt,resourceDestinationString:k,resourceTitleString:vt,resource:Lt,setextHeading:c(Xe),setextHeadingLineSequence:Ue,setextHeadingText:$,strong:c(),thematicBreak:c()}};Bh(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(q){let re={type:"root",children:[]},Oe={stack:[re],tokenStack:[],config:t,enter:s,exit:p,buffer:o,resume:d,data:n},De=[],Ve=-1;for(;++Ve<q.length;)if(q[Ve][1].type==="listOrdered"||q[Ve][1].type==="listUnordered")if(q[Ve][0]==="enter")De.push(Ve);else{let Dt=De.pop();Ve=i(q,Dt,Ve)}for(Ve=-1;++Ve<q.length;){let Dt=t[q[Ve][0]];jh.call(Dt,q[Ve][1].type)&&Dt[q[Ve][1].type].call(Object.assign({sliceSerialize:q[Ve][2].sliceSerialize},Oe),q[Ve][1])}if(Oe.tokenStack.length>0){let Dt=Oe.tokenStack[Oe.tokenStack.length-1];(Dt[1]||qh).call(Oe,void 0,Dt[0])}for(re.position={start:Cn(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:Cn(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)re=t.transforms[Ve](re)||re;return re}function i(q,re,Oe){let De=re-1,Ve=-1,Dt=!1,ln,Yt,cn,Pn;for(;++De<=Oe;){let St=q[De];switch(St[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{St[0]==="enter"?Ve++:Ve--,Pn=void 0;break}case"lineEndingBlank":{St[0]==="enter"&&(ln&&!Pn&&!Ve&&!cn&&(cn=De),Pn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pn=void 0}if(!Ve&&St[0]==="enter"&&St[1].type==="listItemPrefix"||Ve===-1&&St[0]==="exit"&&(St[1].type==="listUnordered"||St[1].type==="listOrdered")){if(ln){let un=De;for(Yt=void 0;un--;){let $t=q[un];if($t[1].type==="lineEnding"||$t[1].type==="lineEndingBlank"){if($t[0]==="exit")continue;Yt&&(q[Yt][1].type="lineEndingBlank",Dt=!0),$t[1].type="lineEnding",Yt=un}else if(!($t[1].type==="linePrefix"||$t[1].type==="blockQuotePrefix"||$t[1].type==="blockQuotePrefixWhitespace"||$t[1].type==="blockQuoteMarker"||$t[1].type==="listItemIndent"))break}cn&&(!Yt||cn<Yt)&&(ln._spread=!0),ln.end=Object.assign({},Yt?q[Yt][1].start:St[1].end),q.splice(Yt||De,0,["exit",ln,St[2]]),De++,Oe++}if(St[1].type==="listItemPrefix"){let un={type:"listItem",_spread:!1,start:Object.assign({},St[1].start),end:void 0};ln=un,q.splice(De,0,["enter",un,St[2]]),De++,Oe++,cn=void 0,Pn=!0}}}return q[re][1]._spread=Dt,Oe}function a(q,re){return Oe;function Oe(De){s.call(this,q(De),De),re&&re.call(this,De)}}function o(){this.stack.push({type:"fragment",children:[]})}function s(q,re,Oe){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([re,Oe]),q.position={start:Cn(re.start),end:void 0}}function c(q){return re;function re(Oe){q&&q.call(this,Oe),p.call(this,Oe)}}function p(q,re){let Oe=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==q.type&&(re?re.call(this,q,De[0]):(De[1]||qh).call(this,q,De[0]));else throw new Error("Cannot close `"+q.type+"` ("+Rn({start:q.start,end:q.end})+"): it\u2019s not open");Oe.position.end=Cn(q.end)}function d(){return Dn(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function y(q){if(this.data.expectingFirstListItemValue){let re=this.stack[this.stack.length-2];re.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function g(){let q=this.resume(),re=this.stack[this.stack.length-1];re.lang=q}function I(){let q=this.resume(),re=this.stack[this.stack.length-1];re.meta=q}function K(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function Z(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function H(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q.replace(/(\r?\n|\r)$/g,"")}function ue(q){let re=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=re,Oe.identifier=xt(this.sliceSerialize(q)).toLowerCase()}function ne(){let q=this.resume(),re=this.stack[this.stack.length-1];re.title=q}function ve(){let q=this.resume(),re=this.stack[this.stack.length-1];re.url=q}function _e(q){let re=this.stack[this.stack.length-1];if(!re.depth){let Oe=this.sliceSerialize(q).length;re.depth=Oe}}function $(){this.data.setextHeadingSlurpLineEnding=!0}function Ue(q){let re=this.stack[this.stack.length-1];re.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function Xe(){this.data.setextHeadingSlurpLineEnding=void 0}function qe(q){let Oe=this.stack[this.stack.length-1].children,De=Oe[Oe.length-1];(!De||De.type!=="text")&&(De=Go(),De.position={start:Cn(q.start),end:void 0},Oe.push(De)),this.stack.push(De)}function U(q){let re=this.stack.pop();re.value+=this.sliceSerialize(q),re.position.end=Cn(q.end)}function xe(q){let re=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Oe=re.children[re.children.length-1];Oe.position.end=Cn(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(re.type)&&(qe.call(this,q),U.call(this,q))}function Be(){this.data.atHardBreak=!0}function ye(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q}function Ie(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q}function Me(){let q=this.resume(),re=this.stack[this.stack.length-1];re.value=q}function tt(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let re=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=re,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function ct(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let re=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=re,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function Nt(q){let re=this.sliceSerialize(q),Oe=this.stack[this.stack.length-2];Oe.label=pd(re),Oe.identifier=xt(re).toLowerCase()}function Ht(){let q=this.stack[this.stack.length-1],re=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){let De=q.children;Oe.children=De}else Oe.alt=re}function k(){let q=this.resume(),re=this.stack[this.stack.length-1];re.url=q}function vt(){let q=this.resume(),re=this.stack[this.stack.length-1];re.title=q}function Lt(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function wt(q){let re=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=re,Oe.identifier=xt(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function on(q){this.data.characterReferenceType=q.type}function gr(q){let re=this.sliceSerialize(q),Oe=this.data.characterReferenceType,De;Oe?(De=Ta(re,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=rr(re);let Ve=this.stack[this.stack.length-1];Ve.value+=De}function Gn(q){let re=this.stack.pop();re.position.end=Cn(q.end)}function dt(q){U.call(this,q);let re=this.stack[this.stack.length-1];re.url=this.sliceSerialize(q)}function In(q){U.call(this,q);let re=this.stack[this.stack.length-1];re.url="mailto:"+this.sliceSerialize(q)}function Wt(){return{type:"blockquote",children:[]}}function sn(){return{type:"code",lang:null,meta:null,value:""}}function wn(){return{type:"inlineCode",value:""}}function yr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function zo(){return{type:"emphasis",children:[]}}function Ri(){return{type:"heading",depth:0,children:[]}}function Ci(){return{type:"break"}}function br(){return{type:"html",value:""}}function Vo(){return{type:"image",title:null,url:"",alt:null}}function _i(){return{type:"link",title:null,url:"",children:[]}}function Oi(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function Wo(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function Yo(){return{type:"paragraph",children:[]}}function Jo(){return{type:"strong",children:[]}}function Go(){return{type:"text",value:""}}function Ko(){return{type:"thematicBreak"}}}function Cn(e){return{line:e.line,column:e.column,offset:e.offset}}function Bh(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Bh(e,r):AS(e,r)}}function AS(e,t){let n;for(n in t)if(jh.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function qh(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Rn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Rn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Rn({start:t.start,end:t.end})+") is still open")}var jh,zh=M(()=>{"use strict";pa();Fh();Bs();dd();er();Sa();Ol();jh={}.hasOwnProperty});var Vh=M(()=>{"use strict";zh()});function Ha(e){let t=this;t.parser=n;function n(r){return Il(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var Wh=M(()=>{"use strict";Vh()});var Yh=M(()=>{"use strict";Wh()});function Pl(e){if(e)throw e}var Jh=M(()=>{"use strict"});var rf=Ty((gP,nf)=>{"use strict";var $a=Object.prototype.hasOwnProperty,tf=Object.prototype.toString,Gh=Object.defineProperty,Kh=Object.getOwnPropertyDescriptor,Xh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):tf.call(t)==="[object Array]"},Qh=function(t){if(!t||tf.call(t)!=="[object Object]")return!1;var n=$a.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&$a.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i=="undefined"||$a.call(t,i)},Zh=function(t,n){Gh&&n.name==="__proto__"?Gh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ef=function(t,n){if(n==="__proto__")if($a.call(t,n)){if(Kh)return Kh(t,n).value}else return;return t[n]};nf.exports=function e(){var t,n,r,i,a,o,s=arguments[0],c=1,p=arguments.length,d=!1;for(typeof s=="boolean"&&(d=s,s=arguments[1]||{},c=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});c<p;++c)if(t=arguments[c],t!=null)for(n in t)r=ef(s,n),i=ef(t,n),s!==i&&(d&&i&&(Qh(i)||(a=Xh(i)))?(a?(a=!1,o=r&&Xh(r)?r:[]):o=r&&Qh(r)?r:{},Zh(s,{name:n,newValue:e(d,o,i)})):typeof i!="undefined"&&Zh(s,{name:n,newValue:i}));return s}});function Br(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var af=M(()=>{"use strict"});function Ml(){let e=[],t={run:n,use:r};return t;function n(...i){let a=-1,o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...i);function s(c,...p){let d=e[++a],h=-1;if(c){o(c);return}for(;++h<i.length;)(p[h]===null||p[h]===void 0)&&(p[h]=i[h]);i=p,d?of(d,s)(...p):o(null,...p)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function of(e,t){let n;return r;function r(...o){let s=e.length>o.length,c;s&&o.push(i);try{c=e.apply(this,o)}catch(p){let d=p;if(s&&n)throw d;return i(d)}s||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...s){n||(n=!0,t(o,...s))}function a(o){i(null,o)}}var sf=M(()=>{"use strict"});var lf=M(()=>{"use strict";sf()});var yt,cf=M(()=>{"use strict";Ol();yt=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){let c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){let c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}let s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=Rn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}};yt.prototype.file="";yt.prototype.name="";yt.prototype.reason="";yt.prototype.message="";yt.prototype.stack="";yt.prototype.column=void 0;yt.prototype.line=void 0;yt.prototype.ancestors=void 0;yt.prototype.cause=void 0;yt.prototype.fatal=void 0;yt.prototype.place=void 0;yt.prototype.ruleId=void 0;yt.prototype.source=void 0});var uf=M(()=>{"use strict";cf()});var Vt,pf=M(()=>{"use strict";Vt=Bt(require("path"),1)});var Nl,df=M(()=>{"use strict";Nl=Bt(require("process"),1)});function qa(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var hf=M(()=>{"use strict"});var Ll,ff=M(()=>{"use strict";Ll=require("url");hf()});function Fl(e,t){if(e&&e.includes(Vt.default.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Vt.default.sep+"`")}function Ul(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mf(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vS(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Dl,zr,gf=M(()=>{"use strict";uf();pf();df();ff();Dl=["history","path","basename","stem","extname","dirname"],zr=class{constructor(t){let n;t?qa(t)?n={path:t}:typeof t=="string"||vS(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Nl.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Dl.length;){let a=Dl[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Dl.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Vt.default.basename(this.path):void 0}set basename(t){Ul(t,"basename"),Fl(t,"basename"),this.path=Vt.default.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Vt.default.dirname(this.path):void 0}set dirname(t){mf(this.basename,"dirname"),this.path=Vt.default.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Vt.default.extname(this.path):void 0}set extname(t){if(Fl(t,"extname"),mf(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Vt.default.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){qa(t)&&(t=(0,Ll.fileURLToPath)(t)),Ul(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Vt.default.basename(this.path,this.extname):void 0}set stem(t){Ul(t,"stem"),Fl(t,"stem"),this.path=Vt.default.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){let i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){let i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){let i=new yt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var yf=M(()=>{"use strict";gf()});var bf,wf=M(()=>{"use strict";bf=(function(e){let r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a})});function Hl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function $l(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ql(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sf(e){if(!Br(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tf(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ja(e){return ES(e)?e:new zr(e)}function ES(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function RS(e){return typeof e=="string"||CS(e)}function CS(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Ba,kS,jl,Bl,xf=M(()=>{"use strict";Jh();Ba=Bt(rf(),1);af();lf();yf();wf();kS={}.hasOwnProperty,jl=class e extends bf{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ml()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let r=this.attachers[n];t.use(...r)}return t.data((0,Ba.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ql("data",this.frozen),this.namespace[t]=n,this):kS.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ql("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let n=ja(t),r=this.parser||this.Parser;return Hl("parse",r),r(String(n),n)}process(t,n){let r=this;return this.freeze(),Hl("process",this.parser||this.Parser),$l("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){let s=ja(t),c=r.parse(s);r.run(c,s,function(d,h,y){if(d||!h||!y)return p(d);let g=h,I=r.stringify(g,y);RS(I)?y.value=I:y.result=I,p(d,y)});function p(d,h){d||!h?o(d):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Hl("processSync",this.parser||this.Parser),$l("processSync",this.compiler||this.Compiler),this.process(t,i),Tf("processSync","process",n),r;function i(a,o){n=!0,Pl(a),r=o}}run(t,n,r){Sf(t),this.freeze();let i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,s){let c=ja(n);i.run(t,c,p);function p(d,h,y){let g=h||t;d?s(d):o?o(g):r(void 0,g,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Tf("runSync","run",r),i;function a(o,s){Pl(o),i=s,r=!0}}stringify(t,n){this.freeze();let r=ja(n),i=this.compiler||this.Compiler;return $l("stringify",i),Sf(t),i(t,r)}use(t,...n){let r=this.attachers,i=this.namespace;if(ql("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(p){if(typeof p=="function")c(p,[]);else if(typeof p=="object")if(Array.isArray(p)){let[d,...h]=p;c(d,h)}else o(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function o(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(p.plugins),p.settings&&(i.settings=(0,Ba.default)(!0,i.settings,p.settings))}function s(p){let d=-1;if(p!=null)if(Array.isArray(p))for(;++d<p.length;){let h=p[d];a(h)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function c(p,d){let h=-1,y=-1;for(;++h<r.length;)if(r[h][0]===p){y=h;break}if(y===-1)r.push([p,...d]);else if(d.length>0){let[g,...I]=d,K=r[y][1];Br(K)&&Br(g)&&(g=(0,Ba.default)(!0,K,g)),r[y]=[p,g,...I]}}}},Bl=new jl().freeze()});var Af=M(()=>{"use strict";xf()});function za(e,t){let n=[e,...t],r=Math.max(...n.map(s=>s.length));if(r===0)return"";let i=Array.from({length:r},()=>0);for(let s of n)for(let c=0;c<r;c++){let p=(s[c]||"").length;p>i[c]&&(i[c]=p)}let a=s=>Array.from({length:r},(c,p)=>(s[p]||"").padEnd(i[p])).join(" | ").trimEnd(),o=[];o.push(a(e)),o.push(i.map(s=>"-".repeat(s)).join("-|-"));for(let s of t)o.push(a(s));return o.join(`
19
+ `)}function vf(e){var a;let{chart:t,title:n}=e;if(t.type==="pie"){let o=za(["Label","Value"],t.segments.map(s=>[s.label,String(s.value)]));return`${n}
20
+ ${o}`}let r=[(a=t.xLabel)!=null?a:"",...t.series.map(o=>o.name)],i=t.categories.map(o=>[o,...t.series.map(s=>{let c=s.data.find(p=>p.label===o);return c?String(c.value):""})]);return`${n}
21
+ ${za(r,i)}`}function Va(e){return Bl().use(Ha).use(Ua).parse(e)}function _S(e){return"value"in e&&typeof e.value=="string"?e.value:"alt"in e&&typeof e.alt=="string"?e.alt:null}function or(e,t,n=!1){if(!("children"in e&&Array.isArray(e.children)))return"";let r=e.children.map(i=>zl(i));return(n?r:r.filter(i=>i.length>0)).join(t)}function zl(e){let t=_S(e);if(t!==null)return t;switch(e.type){case"root":return or(e,`
22
+
23
+ `);case"list":return or(e,`
24
+ `);case"table":return e.children.map(r=>zl(r)).filter(r=>r.trim().length>0).join(`
25
+ `);case"listItem":case"blockquote":return or(e,`
26
+ `);case"tableRow":return or(e," ",!0);case"break":return`
27
+ `;case"thematicBreak":return"";case"tableCell":return or(e,"");default:return or(e,"")}}function sr(e){return zl(e)}function en(e){return{type:"text",value:e}}function tn(e){return{type:"paragraph",children:e}}function nn(e){return{type:"root",children:e}}function Wa(e={}){var t;return{type:"card",title:e.title,subtitle:e.subtitle,imageUrl:e.imageUrl,width:e.width,children:(t=e.children)!=null?t:[]}}function Ya(e,t={}){return{type:"text",content:e,style:t.style}}function Vr(e){return{type:"image",url:e.url,alt:e.alt}}function Wr(){return{type:"divider"}}function Yr(e){return{type:"section",children:e}}function Jr(e){return{type:"actions",children:e}}function Gr(e){return{type:"button",id:e.id,label:e.label,style:e.style,value:e.value,disabled:e.disabled,actionType:e.actionType,callbackUrl:e.callbackUrl,tooltip:e.tooltip}}function Kr(e){return{type:"link-button",id:e.id,url:e.url,label:e.label,style:e.style,tooltip:e.tooltip}}function Xr(e){return{type:"field",label:e.label,value:e.value}}function Qr(e){return{type:"fields",children:e}}function Zr(e){return{type:"table",headers:e.headers,rows:e.rows,align:e.align,caption:e.caption,pageSize:e.pageSize}}function ei(e){return{type:"chart",title:e.title,chart:e.chart}}function ti(e){return{type:"link",url:e.url,label:e.label}}function ni(e){let t=[];e.title&&t.push(`**${e.title}**`),e.subtitle&&t.push(e.subtitle);for(let n of e.children){let r=Vl(n);r&&t.push(r)}return t.join(`
28
+ `)}function Vl(e){switch(e.type){case"text":return e.content;case"link":return`${e.label} (${e.url})`;case"fields":return e.children.map(t=>`${t.label}: ${t.value}`).join(`
29
+ `);case"actions":return null;case"table":return za(e.headers,e.rows);case"chart":return vf(e);case"section":return e.children.map(t=>Vl(t)).filter(Boolean).join(`
30
+ `);default:return null}}var kf,ri=M(()=>{"use strict";yh();Yh();Af();kf=Ya});function Rf(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="modal"}function IS(e){let t=e.filter(n=>typeof n=="object"&&n!==null&&"type"in n&&OS.includes(n.type));return t.length<e.length&&console.warn("[chat] Modal contains unsupported child elements that were ignored"),t}function Ja(e){var t;return{type:"modal",callbackId:e.callbackId,callbackUrl:e.callbackUrl,title:e.title,submitLabel:e.submitLabel,closeLabel:e.closeLabel,notifyOnClose:e.notifyOnClose,privateMetadata:e.privateMetadata,children:(t=e.children)!=null?t:[]}}function Ga(e){return{type:"text_input",id:e.id,label:e.label,placeholder:e.placeholder,initialValue:e.initialValue,multiline:e.multiline,optional:e.optional,maxLength:e.maxLength}}function Wl(e){return{type:"date_input",id:e.id,label:e.label,placeholder:e.placeholder,initialValue:e.initialValue,optional:e.optional}}function Yl(e){return{type:"number_input",id:e.id,label:e.label,placeholder:e.placeholder,initialValue:e.initialValue,optional:e.optional,min:e.min,max:e.max,decimal:e.decimal}}function Ka(e){if(!e.options||e.options.length===0)throw new Error("Select requires at least one option");return{type:"select",id:e.id,label:e.label,placeholder:e.placeholder,options:e.options,initialOption:e.initialOption,optional:e.optional}}function Xa(e){return{type:"external_select",id:e.id,initialOption:e.initialOption,label:e.label,placeholder:e.placeholder,minQueryLength:e.minQueryLength,optional:e.optional}}function Qa(e){return{label:e.label,value:e.value,description:e.description}}function Za(e){if(!e.options||e.options.length===0)throw new Error("RadioSelect requires at least one option");return{type:"radio_select",id:e.id,label:e.label,options:e.options,initialOption:e.initialOption,optional:e.optional}}function eo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Jl}function Gl(e){if(e==null)return[];if(Array.isArray(e))return e.flatMap(Gl);if(eo(e)){let t=Xl(e);return t?[t]:[]}return typeof e=="object"&&"type"in e?[e]:typeof e=="string"||typeof e=="number"?[String(e)]:[]}function PS(e){return!("id"in e||"url"in e||"label"in e)}function MS(e){return"id"in e&&typeof e.id=="string"&&!("url"in e)}function NS(e){return"url"in e&&typeof e.url=="string"}function Kl(e){return"url"in e&&typeof e.url=="string"&&!("id"in e)&&!("alt"in e)&&!("style"in e)}function LS(e){return"url"in e&&typeof e.url=="string"}function DS(e){return"label"in e&&"value"in e&&typeof e.label=="string"&&typeof e.value=="string"}function FS(e){return"callbackId"in e&&"title"in e}function US(e){return"id"in e&&"label"in e&&!("options"in e)&&!("value"in e)}function Cf(e){return"id"in e&&"label"in e}function HS(e){return Cf(e)}function $S(e){return Cf(e)}function Ef(e){return"id"in e&&"label"in e&&!("value"in e)}function qS(e){return"id"in e&&"label"in e&&!("value"in e)&&!("children"in e)}function jS(e){return"label"in e&&"value"in e&&!("id"in e)}function Xl(e){var o,s,c,p;let{type:t,props:n,children:r}=e,i=Gl(r);if(t===Ya){let d=PS(n)?n:{style:void 0},h=i.length>0?i.map(String).join(""):String((o=d.children)!=null?o:"");return Ya(h,{style:d.style})}if(t===Yr)return Yr(i);if(t===Jr)return Jr(i);if(t===Qr)return Qr(i);if(t===Gr){if(!MS(n))throw new Error("Button requires an 'id' prop");let d=i.length>0?i.map(String).join(""):(s=n.label)!=null?s:"";return Gr({id:n.id,label:d,style:n.style,value:n.value,actionType:n.actionType,callbackUrl:n.callbackUrl,disabled:n.disabled,tooltip:n.tooltip})}if(t===Kr){if(!NS(n))throw new Error("LinkButton requires a 'url' prop");let d=i.length>0?i.map(String).join(""):(c=n.label)!=null?c:"";return Kr({id:n.id,url:n.url,label:d,style:n.style,tooltip:n.tooltip})}if(t===ti){if(!Kl(n))throw new Error("CardLink requires a 'url' prop");let d=i.length>0?i.map(String).join(""):(p=n.label)!=null?p:"";return ti({url:n.url,label:d})}if(t===Vr){if(!LS(n))throw new Error("Image requires a 'url' prop");return Vr({url:n.url,alt:n.alt})}if(t===Xr){if(!DS(n))throw new Error("Field requires 'label' and 'value' props");return Xr({label:n.label,value:n.value})}if(t===Wr)return Wr();if(t===Ja){if(!FS(n))throw new Error("Modal requires 'callbackId' and 'title' props");return Ja({callbackId:n.callbackId,callbackUrl:n.callbackUrl,title:n.title,submitLabel:n.submitLabel,closeLabel:n.closeLabel,notifyOnClose:n.notifyOnClose,privateMetadata:n.privateMetadata,children:IS(i)})}if(t===Ga){if(!US(n))throw new Error("TextInput requires 'id' and 'label' props");return Ga({id:n.id,label:n.label,placeholder:n.placeholder,initialValue:n.initialValue,multiline:n.multiline,optional:n.optional,maxLength:n.maxLength})}if(t===Wl){if(!HS(n))throw new Error("DateInput requires 'id' and 'label' props");return Wl({id:n.id,label:n.label,placeholder:n.placeholder,initialValue:n.initialValue,optional:n.optional})}if(t===Yl){if(!$S(n))throw new Error("NumberInput requires 'id' and 'label' props");return Yl({id:n.id,label:n.label,placeholder:n.placeholder,initialValue:n.initialValue,optional:n.optional,min:n.min,max:n.max,decimal:n.decimal})}if(t===Ka){if(!Ef(n))throw new Error("Select requires 'id' and 'label' props");return Ka({id:n.id,label:n.label,placeholder:n.placeholder,initialOption:n.initialOption,optional:n.optional,options:i})}if(t===Xa){if(!qS(n))throw new Error("ExternalSelect requires 'id' and 'label' props");return Xa({id:n.id,initialOption:n.initialOption,label:n.label,placeholder:n.placeholder,minQueryLength:n.minQueryLength,optional:n.optional})}if(t===Za){if(!Ef(n))throw new Error("RadioSelect requires 'id' and 'label' props");return Za({id:n.id,label:n.label,initialOption:n.initialOption,optional:n.optional,options:i})}if(t===Qa){if(!jS(n))throw new Error("SelectOption requires 'label' and 'value' props");return Qa({label:n.label,value:n.value,description:n.description})}if(t===Zr){let d=n;return Zr({headers:d.headers,rows:d.rows,caption:d.caption,pageSize:d.pageSize})}if(t===ei){let d=n;return ei({title:d.title,chart:d.chart})}let a=n;return Wa({title:a.title,subtitle:a.subtitle,imageUrl:a.imageUrl,width:a.width,children:i})}function Ql(e,t,n){let{children:r,...i}=t;return{$$typeof:Jl,type:e,props:i,children:r!=null?[r]:[]}}function _f(e,t,n){let{children:r,...i}=t,a;return Array.isArray(r)?a=r:r!=null?a=[r]:a=[],{$$typeof:Jl,type:e,props:i,children:a}}function If(e){return Gl(e.children)}function It(e){if(eo(e)){let t=Xl(e);if(t&&typeof t=="object"&&"type"in t&&t.type==="card")return t}return typeof e=="object"&&e!==null&&"type"in e&&e.type==="card"?e:null}function Zl(e){if(eo(e)){let t=Xl(e);if(t&&typeof t=="object"&&"type"in t&&t.type==="modal")return t}return Rf(e)?e:null}function Pt(e){if(eo(e))return!0;if(typeof e=="object"&&e!==null&&"$$typeof"in e&&typeof e.$$typeof=="symbol"){let t=e.$$typeof.toString();return t.includes("react.element")||t.includes("react.transitional.element")}return!1}var OS,Jl,Of,to=M(()=>{"use strict";ri();OS=["text_input","date_input","number_input","select","external_select","radio_select","text","fields"];Jl=Symbol.for("chat.jsx.element");Of=Ql});var cc=M(()=>{"use strict"});var mm={};hs(mm,{Fragment:()=>If,isCardLinkProps:()=>Kl,isJSX:()=>Pt,jsx:()=>Ql,jsxDEV:()=>Of,jsxs:()=>_f,toCardElement:()=>It,toModalElement:()=>Zl});var gm=M(()=>{"use strict";to();ri();cc()});var $v={};hs($v,{Actions:()=>li,AgentDeliveryError:()=>an,AgentError:()=>bn,Button:()=>ci,Card:()=>ui,CardLink:()=>pi,CardText:()=>di,Chart:()=>hi,Client:()=>dr,CronExpression:()=>fs,Divider:()=>fi,Image:()=>mi,LinkButton:()=>gi,NovuRequestHandler:()=>Do,Select:()=>bi,SelectOption:()=>wi,SeverityLevelEnum:()=>jo,Table:()=>yi,TextInput:()=>Si,agent:()=>Ac,isFromWorkflow:()=>uc,providerSchemas:()=>Uo,step:()=>qg,toAgentError:()=>Ei,workflow:()=>$g});module.exports=xy($v);var $m=require("jsonrepair");var Rr=(i=>(i.TRIGGER="trigger",i.EXECUTE="execute",i.PREVIEW="preview",i.AGENT_EVENT="agent-event",i))(Rr||{}),Hi=(r=>(r.DISCOVER="discover",r.HEALTH_CHECK="health-check",r.CODE="code",r))(Hi||{});var fs=(te=>(te.EVERY_SECOND="* * * * * *",te.EVERY_5_SECONDS="*/5 * * * * *",te.EVERY_10_SECONDS="*/10 * * * * *",te.EVERY_30_SECONDS="*/30 * * * * *",te.EVERY_MINUTE="*/1 * * * *",te.EVERY_5_MINUTES="0 */5 * * * *",te.EVERY_10_MINUTES="0 */10 * * * *",te.EVERY_30_MINUTES="0 */30 * * * *",te.EVERY_HOUR="0 0-23/1 * * *",te.EVERY_2_HOURS="0 0-23/2 * * *",te.EVERY_3_HOURS="0 0-23/3 * * *",te.EVERY_4_HOURS="0 0-23/4 * * *",te.EVERY_5_HOURS="0 0-23/5 * * *",te.EVERY_6_HOURS="0 0-23/6 * * *",te.EVERY_7_HOURS="0 0-23/7 * * *",te.EVERY_8_HOURS="0 0-23/8 * * *",te.EVERY_9_HOURS="0 0-23/9 * * *",te.EVERY_10_HOURS="0 0-23/10 * * *",te.EVERY_11_HOURS="0 0-23/11 * * *",te.EVERY_12_HOURS="0 0-23/12 * * *",te.EVERY_DAY_AT_1AM="0 01 * * *",te.EVERY_DAY_AT_2AM="0 02 * * *",te.EVERY_DAY_AT_3AM="0 03 * * *",te.EVERY_DAY_AT_4AM="0 04 * * *",te.EVERY_DAY_AT_5AM="0 05 * * *",te.EVERY_DAY_AT_6AM="0 06 * * *",te.EVERY_DAY_AT_7AM="0 07 * * *",te.EVERY_DAY_AT_8AM="0 08 * * *",te.EVERY_DAY_AT_9AM="0 09 * * *",te.EVERY_DAY_AT_10AM="0 10 * * *",te.EVERY_DAY_AT_11AM="0 11 * * *",te.EVERY_DAY_AT_NOON="0 12 * * *",te.EVERY_DAY_AT_1PM="0 13 * * *",te.EVERY_DAY_AT_2PM="0 14 * * *",te.EVERY_DAY_AT_3PM="0 15 * * *",te.EVERY_DAY_AT_4PM="0 16 * * *",te.EVERY_DAY_AT_5PM="0 17 * * *",te.EVERY_DAY_AT_6PM="0 18 * * *",te.EVERY_DAY_AT_7PM="0 19 * * *",te.EVERY_DAY_AT_8PM="0 20 * * *",te.EVERY_DAY_AT_9PM="0 21 * * *",te.EVERY_DAY_AT_10PM="0 22 * * *",te.EVERY_DAY_AT_11PM="0 23 * * *",te.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",te.EVERY_WEEK="0 0 * * 0",te.EVERY_WEEKDAY="0 0 * * 1-5",te.EVERY_WEEKEND="0 0 * * 6,0",te.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",te.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",te.EVERY_2ND_DAY_OF_MONTH_AT_10AM="0 10 2 * *",te.EVERY_2ND_HOUR="0 */2 * * *",te.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",te.EVERY_2ND_MONTH="0 0 1 */2 *",te.EVERY_QUARTER="0 0 1 */3 *",te.EVERY_6_MONTHS="0 0 1 */6 *",te.EVERY_YEAR="0 0 1 0 *",te.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",te.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",te.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",te.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",te.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",te.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",te.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",te.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",te.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",te.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",te.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",te.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",te.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",te.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",te.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",te.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",te.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",te.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",te.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",te.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",te.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",te.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",te.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",te.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",te.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",te.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",te.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",te.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",te))(fs||{});var zt=(xe=>(xe.BRIDGE_ERROR="BridgeError",xe.EXECUTION_EVENT_CONTROL_INVALID_ERROR="ExecutionEventControlInvalidError",xe.EXECUTION_EVENT_PAYLOAD_INVALID_ERROR="ExecutionEventPayloadInvalidError",xe.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",xe.EXECUTION_STATE_CONTROL_INVALID_ERROR="ExecutionStateControlInvalidError",xe.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",xe.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",xe.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",xe.INVALID_ACTION_ERROR="InvalidActionError",xe.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",xe.MISSING_DEPENDENCY_ERROR="MissingDependencyError",xe.MISSING_SECRET_KEY_ERROR="MissingSecretKeyError",xe.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",xe.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",xe.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",xe.SIGNATURE_INVALID_ERROR="SignatureInvalidError",xe.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",xe.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",xe.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",xe.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",xe.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",xe.STEP_CONTROL_COMPILATION_FAILED_ERROR="StepControlCompilationFailedError",xe.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",xe.STEP_NOT_FOUND_ERROR="StepNotFoundError",xe.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",xe.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",xe.WORKFLOW_PAYLOAD_INVALID_ERROR="WorkflowPayloadInvalidError",xe))(zt||{});var $i=(r=>(r.POST="POST",r.GET="GET",r.OPTIONS="OPTIONS",r))($i||{});var Ay=e=>{var n,r;if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(r=(n=t==null?void 0:t.constructor)==null?void 0:n.name.endsWith("Error"))!=null?r:!1},fn=class extends Error{},qi=class extends fn{constructor(){super(...arguments);this.statusCode=404}},Rt=class extends fn{constructor(){super(...arguments);this.statusCode=400}},Tn=class extends fn{constructor(){super(...arguments);this.statusCode=401}},xn=class extends fn{constructor(t,{cause:n}={}){var r;Ay(n)?(super(`${t}: ${n.message}`),this.data={stack:(r=n.stack)!=null?r:t}):(super(`${t}${n?`: ${JSON.stringify(n,null,2)}`:""}`),this.data={stack:t})}},ji=class extends fn{constructor(){super(...arguments);this.statusCode=409}};var Xn=class extends xn{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var Bi=class extends Rt{constructor(n,r){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${r}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:r}}},_r=class extends Rt{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=r}},zi=class extends Rt{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=r}},Vi=class extends Rt{constructor(n,r,i){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=i}},Wi=class extends Rt{constructor(n,r,i){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=i}},Yi=class extends Rt{constructor(n,r,i){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=i}},Ji=class extends Rt{constructor(n,r,i){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${r}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=i}},Gi=class extends Rt{constructor(n,r,i,a){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` and provider with id: \`${i}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=a}},Ki=class extends Rt{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=r}};var Mn=e=>Object.values(zt).includes(e==null?void 0:e.code),vu=e=>!Mn(e)&&typeof e.statusCode=="number"&&e.statusCode>=400&&e.statusCode<500;var ms=e=>Object.values(e).map(t=>`\`${t}\``).join(", "),Xi=e=>e.replaceAll(/(\w)(\w*)/g,(t,n,r)=>n.toUpperCase()+r.toLowerCase()).replaceAll(/[\s-]+/g,"");var Qi=class extends fn{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${ms($i)}`}},Nn=class extends Rt{constructor(n,r){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${ms(r)}`);this.code="InvalidActionError"}},Zi=class extends Rt{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var ea=class extends Error{constructor(t,n,r){super(),this.data={message:r},this.statusCode=t,this.code=n}};var Or=class extends ji{constructor(t,n){super(`${Xi(t)} with id: \`${n}\` already exists. Please use a different id.`)}},An=class extends qi{constructor(t,n){super(`${Xi(t)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},Qn=class extends xn{constructor(n,r,i,a){super(`Failed to ${i} ${Xi(n)} with id: \`${r}\``,{cause:a});this.statusCode=502}};var ta=class extends An{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},na=class extends Qn{constructor(n,r,i){super("provider",n,r,i);this.code="ProviderExecutionFailedError"}};var ra=class extends Tn{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"}},ia=class extends Tn{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},aa=class extends Tn{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},oa=class extends Tn{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},sa=class extends Tn{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var la=class extends An{constructor(n){super("step",n);this.code="StepNotFoundError"}},ca=class extends Or{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},Ir=class extends Qn{constructor(n,r,i){super("step",n,r,i);this.code="StepExecutionFailedError"}};var Pr=class extends An{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}};var ua=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(l,u)=>function(){return l&&(u=(0,l[n(l)[0]])(l=0)),u},a=(l,u)=>function(){return u||(0,l[n(l)[0]])((u={exports:{}}).exports,u),u.exports},o=(l,u)=>{for(var f in u)e(l,f,{get:u[f],enumerable:!0})},s=(l,u,f,S)=>{if(u&&typeof u=="object"||typeof u=="function")for(let T of n(u))!r.call(l,T)&&T!==f&&e(l,T,{get:()=>u[T],enumerable:!(S=t(u,T))||S.enumerable});return l},c=l=>s(e({},"__esModule",{value:!0}),l),p={};o(p,{JSONSchemaFaker:()=>Tu,default:()=>xu,setDependencies:()=>Dc});function d(l,u){return typeof l=="string"?typeof u!="undefined"?Tr.register(l,u):Tr.get(l):Tr.registerMany(l)}function h(l,u){return l=typeof l=="undefined"?Gt.MIN_INTEGER:l,u=typeof u=="undefined"?Gt.MAX_INTEGER:u,Math.floor(Re("random")()*(u-l+1))+l}function y(l){return Pi.default.prototype.max=Re("defaultRandExpMax"),Pi.default.prototype.randInt=(f,S)=>f+Math.floor(Re("random")()*(1+(S-f))),new Pi.default(l).gen()}function g(l){return l[Math.floor(Re("random")()*l.length)]}function I(l){let u,f,S=l.length,T=l.slice();for(;S>0;)f=Math.floor(Re("random")()*S),S-=1,u=T[S],T[S]=T[f],T[f]=u;return T}function K(l,u){return Re("random")()*(u-l)+l}function Z(l,u,f,S,T=!1){return f=typeof f=="undefined"?Gt.MIN_NUMBER:f,S=typeof S=="undefined"?Gt.MAX_NUMBER:S,l=typeof l=="undefined"?f:l,u=typeof u=="undefined"?S:u,u<l&&(u+=l),T?K(l,u):h(l,u)}function H(l){switch(l){case"seconds":return Z(0,60)*60;case"minutes":return Z(15,50)*612;case"hours":return Z(12,72)*36123;case"days":return Z(7,30)*86412345;case"weeks":return Z(4,52)*604812345;case"months":return Z(2,13)*2592012345;case"years":return Z(1,20)*31104012345;default:break}}function ue(l){if(l)return H(l);let u=Re("minDateTime"),f=Re("maxDateTime");typeof u=="string"&&(u=new Date(u)),typeof f=="string"&&(f=new Date(f));let S=new Date().getTime();return typeof u=="number"&&(u=new Date(S+u)),typeof f=="number"&&(f=new Date(S+f)),new Date(K(u.getTime(),f.getTime()))}function ne(l,u,f){if(u=decodeURIComponent(u),f&&f[u])return xe(f[u]);let S=u.replace("#/","/").split("/"),T=l.$ref&&f&&f[l.$ref]||l;for(!T&&!S[0]&&(S[0]=l.$ref.split("#/")[0]),f&&u.includes("#/")&&f[S[0]]&&(T=f[S.shift()]),S[0]||S.shift();T&&S.length>0;){let v=S.shift();if(!T[v])throw new Error(`Prop not found: ${v} (${u})`);T=T[v]}return T}function ve(l){return typeof l=="string"&&Wc.test(l)}function _e(l){return["number","boolean"].includes(typeof l)}function $(l,...u){return u.filter(f=>typeof l[f]!="undefined").length>0}function Ue(l){if(l.includes(" "))return new Date(l).toISOString().substr(0,10);let[u,f,S]=l.split("T")[0].split("-");return f=`0${Math.max(1,Math.min(12,f))}`.slice(-2),S=`0${Math.max(1,Math.min(31,S))}`.slice(-2),`${u}-${f}-${S}`}function Xe(l){if(l.includes(" "))return new Date(l).toISOString().substr(0,10);let[u,f]=l.split("T"),[S,T,v]=u.split("-"),[A,L,ee]=f.substr(0,8).split(":");return T=`0${Math.max(1,Math.min(12,T))}`.slice(-2),v=`0${Math.max(1,Math.min(31,v))}`.slice(-2),A=`0${Math.max(1,Math.min(23,A))}`.slice(-2),L=`0${Math.max(1,Math.min(59,L))}`.slice(-2),ee=`0${Math.max(1,Math.min(59,ee))}`.slice(-2),`${S}-${T}-${v}T${A}:${L}:${ee}.000Z`}function qe(l,u,f){let S={};switch(l||u.type){case"integer":case"number":if(typeof u.minimum!="undefined"&&(S.minimum=u.minimum),typeof u.maximum!="undefined"&&(S.maximum=u.maximum),u.enum){let v=Math.max(S.minimum||0,0),A=Math.min(S.maximum||1/0,1/0);u.exclusiveMinimum&&v===u.minimum&&(v+=u.multipleOf||1),u.exclusiveMaximum&&A===u.maximum&&(A-=u.multipleOf||1),(v||A!==1/0)&&(u.enum=u.enum.filter(L=>L>=v&&L<=A))}break;case"string":{S.minLength=Re("minLength")||0,S.maxLength=Re("maxLength")||Number.MAX_SAFE_INTEGER,typeof u.minLength!="undefined"&&(S.minLength=Math.max(S.minLength,u.minLength)),typeof u.maxLength!="undefined"&&(S.maxLength=Math.min(S.maxLength,u.maxLength));break}default:break}let T=f(S);if(T==null)return null;switch(l||u.type){case"number":T=ve(T)?parseFloat(T):T;break;case"integer":T=ve(T)?parseInt(T,10):T;break;case"boolean":T=!!T;break;case"string":{if(_e(T))return T;T=String(T);let v=Math.max(S.minLength||0,0),A=Math.min(S.maxLength||1/0,1/0),L,ee=0;for(;T.length<v;)if(L=T,u.pattern?T+=ke.randexp(u.pattern):T+=`${ke.pick([" ","/","_","-","+","=","@","^"])}${T}`,T===L){if(ee+=1,ee===3)break}else ee=0;switch(T.length>A&&(T=T.substr(0,A)),u.format){case"date-time":case"datetime":T=new Date(Xe(T)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":T=new Date(Ue(T)).toISOString().substr(0,10);break;case"time":T=new Date(`1969-01-01 ${T}`).toISOString().substr(11);break;default:break}break}default:break}return T}function U(l,u){return Object.keys(u).forEach(f=>{typeof u[f]!="object"||u[f]===null?l[f]=u[f]:Array.isArray(u[f])?(l[f]=l[f]||[],u[f].forEach((S,T)=>{l.type==="array"&&u.type==="array"?l[f][T]=U(l[f][T]||{},S,!0):Array.isArray(l[f])&&l[f].indexOf(S)===-1&&l[f].push(S)})):typeof l[f]!="object"||l[f]===null||Array.isArray(l[f])?l[f]=U({},u[f]):l[f]=U(l[f],u[f])}),l}function xe(l,u=new Map){if(!l||typeof l!="object")return l;if(u.has(l))return u.get(l);if(Array.isArray(l)){let S=[];return u.set(l,S),S.push(...l.map(T=>xe(T,u))),S}let f={};return u.set(l,f),Object.keys(l).reduce((S,T)=>(S[T]=xe(l[T],u),S),f)}function Be(l){let u=JSON.stringify(l),f=JSON.stringify(l,null,2);return u.length>400?`${f.substr(0,400)}...`:f}function ye(){return ke.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Ie(l,u){if(l.enum)return l.enum.includes(u);if(l.const)return l.const===u}function Me(l,u){let f=U({},u);if(typeof l.minimum!="undefined"&&(f.maximum=l.minimum,f.exclusiveMaximum=!0),typeof l.maximum!="undefined"&&(f.minimum=l.maximum>f.maximum?0:l.maximum,f.exclusiveMinimum=!0),typeof l.minLength!="undefined"&&(f.maxLength=l.minLength),typeof l.maxLength!="undefined"&&(f.minLength=l.maxLength>f.maxLength?0:l.maxLength),l.type)f.type=ke.pick(Gt.SCALAR_TYPES.filter(S=>(Array.isArray(l.type)?l.type:[l.type]).every(v=>S==="number"||S==="integer"?v!=="number"&&v!=="integer":S!==v)));else if(l.enum){let S;do S=ye();while(l.enum.indexOf(S)!==-1);f.enum=[S]}return l.required&&f.properties&&l.required.forEach(S=>{delete f.properties[S]}),f}function tt(l,u){let f=u.minimum!==void 0,S=u.maximum!==void 0;return(f||S)&&(!f||l>=u.minimum)&&(!S||l<=u.maximum)}function ct(l,u){return!u.every(f=>tt(l,f))}function Nt(l,u){return u.reduce((S,T)=>S+(tt(l,T)?1:0),0)===1}function Ht(l){return["enum","const","default","examples","required","definitions","items","properties"].includes(l)}function k(l,u){return Object.keys(l).filter(f=>!u.includes(f)).reduce((f,S)=>(Array.isArray(l[S])?f[S]=l[S].slice():f[S]=l[S]instanceof Object?U({},l[S]):l[S],f),{})}function vt(l,u){return Array.isArray(l)?l.map(f=>vt(f,u)):(typeof l=="string"&&(l=l.replace(/#\{([\w.-]+)\}/g,(f,S)=>u[S])),l)}function Lt(l){return Object.prototype.toString.call(l)==="[object Object]"&&!Object.keys(l).length}function R(l,u){u=u.items||u;let f=Re("alwaysFakeOptionals"),S=Array.isArray(u.required)&&u.required.includes(l)||f,T=typeof u.thunk=="function"||u.additionalProperties&&typeof u.additionalProperties.thunk=="function";return!S&&!T}function wt(l,u,f=!1){if(!l||typeof l!="object")return l;if(Array.isArray(l))return l.map(S=>wt(S,u,!0)).filter(S=>typeof S!="undefined");if(Object.keys(l).forEach(S=>{if(Lt(l[S]))R(S,u)&&delete l[S];else{let T=u;u&&u.properties&&u.properties[S]&&(T=u.properties[S]);let v=wt(l[S],T);Lt(v)||(l[S]=v)}typeof l[S]=="undefined"&&delete l[S]}),!(!Object.keys(l).length&&f))return l}function on(l){return(u,f,S,T)=>{let v=u,A=[];typeof u=="object"&&(v=Object.keys(u)[0],Array.isArray(u[v])?A=u[v]:A.push(u[v]));let L=v.split("."),ee=l();for(;L.length>1;)ee=ee[L.shift()];return u=typeof ee=="object"?ee[L[0]]:ee,typeof u=="function"&&(u=u.apply(ee,A.map(N=>Ye.template(N,T)))),Object.prototype.toString.call(u)==="[object Object]"&&Object.keys(u).forEach(N=>{if(typeof u[N]=="function")throw new Error(`Cannot resolve value for '${S}: ${v}', given: ${u}`)}),u}}function gr(l,u){if(typeof l=="undefined")return Kn.list();if(typeof l=="string")if(typeof u=="function")Kn.register(l,u);else if(u===null||u===!1)Kn.unregister(l);else return Kn.get(l);else Kn.registerMany(l)}function Gn(l,u,f){return Object.keys(l).filter(S=>{let T=Kc.indexOf(u)>-1;return f.indexOf(S)>-1&&!T}).length>0}function dt(l,u){let f=Object.keys(xr);for(let S=0;S<f.length;S+=1){let T=f[S],v=u[u.length-1];if(Gn(l,v,xr[T]))return T}}function In(){return Re("random")()>.5}function Wt(){return null}function sn(l,u,f,S,T,v){let A=[],L=[];function ee(ie){let j=JSON.stringify(ie.value);return L.indexOf(j)===-1?(L.push(j),A.push(ie),!0):!1}u.forEach(ee);let N=100;for(;A.length!==u.length&&(ee(v(f.items||S,l,T))||(N-=1),!!N););return A}function wn(l,u,f,S){let T=[];if(!(l.items||l.additionalItems)){if(Ye.hasProperties(l,"minItems","maxItems","uniqueItems")&&(l.minItems!==0||l.maxItems!==0))throw new Mi(`missing items for ${Ye.short(l)}`,u);return T}if(Array.isArray(l.items))return l.items.map((ce,He)=>{let Ae=u.concat(["items",He]);return S(ce,Ae,f)});let v=l.minItems,A=l.maxItems,L=Re("minItems"),ee=Re("maxItems");L&&(v=typeof v=="undefined"?L:Math.min(L,v)),ee&&(A=typeof A=="undefined"?ee:Math.min(ee,A),A&&A>ee&&(A=ee),v&&v>ee&&(v=A));let N=Re("alwaysFakeOptionals")===!0?1:Re("optionalsProbability"),ie=Re("alwaysFakeOptionals")||Re("fixedProbabilities")||!1,j=ke.number(v,A,1,5);N!==null&&(j=Math.max(ie?Math.round((A||j)*N):Math.abs(ke.number(v,A)*N),v||0));let he=typeof l.additionalItems=="object"?l.additionalItems:{};for(let ce=T.length;ce<j;ce+=1){let He=u.concat(["items",ce]),Ae=S(l.items||he,He,f);T.push(Ae)}if(l.contains&&j>0){let ce=ke.number(0,j-1);T[ce]=S(l.contains,u.concat(["items",ce]),f)}return l.uniqueItems?sn(u.concat(["items"]),T,l,he,f,S):T}function yr(l){let u=typeof l.minimum=="undefined"||l.minimum===-Number.MAX_VALUE?Gt.MIN_INTEGER:l.minimum,f=typeof l.maximum=="undefined"||l.maximum===Number.MAX_VALUE?Gt.MAX_INTEGER:l.maximum,S=l.multipleOf,T=S&&String(S).match(/e-(\d)|\.(\d+)$/);if(T){let v=(Math.random()*ke.number(0,10)+1)*S,A=T[1]||T[2].length,L=parseFloat(v.toFixed(A)),ee=ke.number(u,f-1);return String(L).includes(".")?ee+L:(ee+L).toExponential()}if(S&&(f=Math.floor(f/S)*S,u=Math.ceil(u/S)*S),l.exclusiveMinimum&&u===l.minimum&&(u+=S||1),l.exclusiveMaximum&&f===l.maximum&&(f-=S||1),u>f)return NaN;if(S){let v=ke.number(Math.floor(u/S),Math.floor(f/S))*S;for(;v<u;)v+=S;return v}return ke.number(u,f,void 0,void 0,l.type!=="integer")}function zo(l){return Math.floor(ls({...l}))}function Ri(l){return ke.shuffle(ou).slice(0,l)}function Ci(l,u,f,S){let T={},v=l.properties||{},A=l.patternProperties||{},L=typeof l.required=="boolean"?[]:(l.required||[]).slice(),ee=l.additionalProperties!==!1,N=Object.keys(v),ie=Object.keys(A),j=N.concat(ie).reduce((se,E)=>(L.indexOf(E)===-1&&se.push(E),se),[]),he=L.concat(j),ce=ee&&l.additionalProperties===!0?Li:l.additionalProperties;if(!ee&&N.length===0&&ie.length===0&&Ye.hasProperties(l,"minProperties","maxProperties","dependencies","required"))return null;if(Re("requiredOnly")===!0)return L.forEach(se=>{v[se]&&(T[se]=v[se])}),S(T,u.concat(["properties"]),f,l);let He=Re("alwaysFakeOptionals")===!0?1:Re("optionalsProbability"),Ae=Re("alwaysFakeOptionals")||Re("fixedProbabilities")||!1,Ce=Re("ignoreProperties")||[],Ge=Re("reuseProperties"),Qe=Re("fillProperties"),oe=l.maxProperties||he.length+(ee?ke.number(1,5):0),O=Math.max(l.minProperties||0,L.length),P=Math.max(0,he.length-O);he.length===1&&!L.length&&(O=Math.max(ke.number(Qe?1:0,oe),O)),He!==null&&(Ae===!0?P=Math.round(O-L.length+He*(he.length-O)):P=ke.number(O-L.length,He*(he.length-O)));let z=ke.shuffle(j).slice(0,P),W=j.filter(se=>z.indexOf(se)!==-1),X=He!==null||L.length===oe?oe:ke.number(0,oe),B=L.concat(ke.shuffle(W).slice(0,X)).slice(0,oe),Y=[],G=[];if(l.dependencies&&(Object.keys(l.dependencies).forEach(se=>{let E=l.dependencies[se];if(B.indexOf(se)!==-1)if(Array.isArray(E))E.forEach(J=>{B.indexOf(J)===-1&&B.push(J)});else if(Array.isArray(E.oneOf||E.anyOf)){let J=E.oneOf||E.anyOf;G.push({prop:se,values:J})}else Y.push(E)}),Y.length))return delete l.dependencies,S({allOf:Y.concat(l)},u.concat(["properties"]),f,l);let pe=[],fe=[];B.forEach(se=>{if(v[se]&&["{}","true"].includes(JSON.stringify(v[se].not)))return;for(let J=0;J<Ce.length;J+=1)if(Ce[J]instanceof RegExp&&Ce[J].test(se)||typeof Ce[J]=="string"&&Ce[J]===se||typeof Ce[J]=="function"&&Ce[J](v[se],se)){pe.push(se);return}ce===!1&&L.indexOf(se)!==-1&&(T[se]=v[se]),v[se]&&(T[se]=v[se]);let E;if(ie.forEach(J=>{se.match(new RegExp(J))&&(E=!0,T[se]?Ye.merge(T[se],A[J]):T[ke.randexp(se)]=A[J])}),!E){let J=A[se]||ce;J&&ce!==!1?T[A[se]?ke.randexp(se):se]=v[se]||J:fe.push(se)}});let Ee=Object.keys(T).length+(Qe?0:pe.length),it=se=>ke.randexp(`_?[_a-f\\d]{1,3}${se?"\\$?":""}`);function at(se){let E;do{if(!se.length)break;E=se.shift()}while(T[E]);return E}let st=O;if(ee&&!L.length&&(st=Math.max(He===null||ce?ke.number(Qe?1:0,oe):0,O)),!W.length&&!P&&ee&&Ae===!0&&Qe){let se=ke.number(0,oe);for(let E=0;E<se;E+=1)T[Ni(1)+it(se[E])]=ce||Li}for(;Qe&&!(!(ie.length||ee)||Ee>=st);){if(ee)if(Ge&&N.length-Ee>st){let se=0,E;do{if(se+=1,se>1e3)break;E=at(L)||ke.pick(N)}while(typeof T[E]!="undefined");typeof T[E]=="undefined"&&(T[E]=v[E],Ee+=1)}else if(ie.length&&!ce){let se=ke.pick(ie),E=ke.randexp(se);T[E]||(T[E]=A[se],Ee+=1)}else{let se=at(L)||Ni(1)+it();T[se]||(T[se]=ce||Li,Ee+=1)}for(let se=0;Ee<O&&se<ie.length;se+=1){let E=ie[se],J=ke.randexp(E);T[J]||(T[J]=A[E],Ee+=1)}}if(L.length===0&&(!ee||He===!1)){let se=ke.number(O,oe);for(;Ee<se;){let E=at(N);E&&(T[E]=v[E]),Ee+=1}}let mt=T;if(Re("sortProperties")!==null){let se=Object.keys(v);mt=Object.keys(T).sort((J,me)=>Re("sortProperties")?J.localeCompare(me):se.indexOf(J)-se.indexOf(me)).reduce((J,me)=>(J[me]=T[me],J),{})}let Tt=S(mt,u.concat(["properties"]),f,l);return G.forEach(se=>{for(let E of se.values)if(Ye.hasValue(E.properties[se.prop],Tt.value[se.prop])){Object.keys(E.properties).forEach(J=>{J!==se.prop&&Ye.merge(Tt.value,S(E.properties,u.concat(["properties"]),f,l).value)});break}}),Tt}function br(){let l=ke.number(1,5);return Ni(l).join(" ")}function Vo(l=0,u=140){let f=Math.max(0,l),S=ke.number(f,u),T=br();for(;T.length<f;)T+=br();return T.length>S&&(T=T.substr(0,S)),T}function _i(){return[0,0,0,0].map(()=>ke.number(0,255)).join(".")}function Oi(){return ke.date().toISOString()}function Wo(){return Di().slice(0,10)}function Yo(){return Di().slice(11)}function Jo(l){return ke.randexp(qt[l]).replace(du,(u,f)=>ke.randexp(qt[f]))}function Go(l,u){let f=ss(l.format);if(typeof f=="function")return f(l);switch(l.format){case"date-time":case"datetime":return Di();case"date":return cu();case"time":return uu();case"ipv4":return lu();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 hu(l.format);default:if(typeof f=="undefined"){if(Re("failOnInvalidFormat"))throw new Error(`unknown registry key ${Ye.short(l.format)}`);return u()}throw new Error(`unsupported format '${l.format}'`)}}function Ko(l){return Ye.typecast("string",l,f=>l.format?Go(l,()=>cs(f.minLength,f.maxLength)):l.pattern?ke.randexp(l.pattern):cs(f.minLength,f.maxLength))}function q({$comment:l,title:u,description:f}){return Object.entries({comment:l,title:u,description:f}).filter(([,S])=>S).reduce((S,[T,v])=>(S[T]=v,S),{})}function re(l,u,f,S){if(l=f(l,null,u),l&&(l.oneOf||l.anyOf||l.allOf)&&(l=f(l,null,u)),!l)throw new Error(`Cannot traverse at '${u.join(".")}', given '${JSON.stringify(S)}'`);let T={...q(l),schemaPath:u};if(u[u.length-1]!=="properties"){if(Re("useExamplesValue")&&Array.isArray(l.examples)){let N=l.examples.concat("default"in l?[l.default]:[]);return{value:Ye.typecast(null,l,()=>ke.pick(N)),context:T}}if(Re("useExamplesValue")&&typeof l.example!="undefined")return{value:Ye.typecast(null,l,()=>l.example),context:T};if(Re("useDefaultValue")&&"default"in l&&(l.default!==""||!Re("replaceEmptyByRandomValue")))return{value:l.default,context:T};if("template"in l)return{value:Ye.template(l.template,S),context:T};if("const"in l)return{value:l.const,context:T}}if(l.not&&typeof l.not=="object"&&(l=Ye.notValue(l.not,Ye.omitProps(l,["not"])),l.type&&l.type==="object")){let{value:N,context:ie}=re(l,u.concat(["not"]),f,S);return{value:Ye.clean(N,l,!1),context:{...T,items:ie}}}if(typeof l.thunk=="function"){let{value:N,context:ie}=re(l.thunk(S),u,f);return{value:N,context:{...T,items:ie}}}if(l.jsonPath)return{value:l,context:T};let v=l.type;if(Array.isArray(v)?v=ke.pick(v):typeof v=="undefined"&&(v=Xc(l,u)||v,v&&(l.type=v)),typeof l.generate=="function"){let N=Ye.typecast(null,l,()=>l.generate(S,u)),ie=N===null?"null":typeof N;if(ie===v||ie==="number"&&v==="integer"||Array.isArray(N)&&v==="array")return{value:N,context:T}}if(typeof l.pattern=="string")return{value:Ye.typecast("string",l,()=>ke.randexp(l.pattern)),context:T};if(Array.isArray(l.enum))return{value:Ye.typecast(null,l,()=>ke.pick(l.enum)),context:T};if(typeof v=="string")if(Ar[v])try{let N=Ar[v](l,u,f,re);return v==="array"?{value:N.map(({value:ie})=>ie),context:{...T,items:N.map(Array.isArray(l.items)?({context:ie})=>ie:({context:ie})=>({...ie,schemaPath:ie.schemaPath.slice(0,-1)}))}}:v==="object"?N!==null?{value:N.value,context:{...T,items:N.context}}:{value:{},context:T}:{value:N,context:T}}catch(N){throw typeof N.path=="undefined"?new Mi(N.stack,u):N}else{if(Re("failOnInvalidTypes"))throw new Mi(`unknown primitive ${Ye.short(v)}`,u.concat(["type"]));{let N=Re("defaultInvalidTypeProduct");return typeof N=="string"&&Ar[N]?{value:Ar[N](l,u,f,re),context:T}:{value:N,context:T}}}let A={},L={...T};Array.isArray(l)&&(A=[]);let ee=Re("pruneProperties")||[];return Object.keys(l).forEach(N=>{if(!ee.includes(N)&&l[N]!==null)if(typeof l[N]=="object"&&N!=="definitions"){let{value:ie,context:j}=re(l[N],u.concat([N]),f,A);A[N]=Ye.clean(ie,l[N],!1),L[N]=j,A[N]===null&&Re("omitNulls")&&(delete A[N],delete L[N])}else A[N]=l[N]}),{value:A,context:L}}function Oe(l){return Array.isArray(l)?ke.pick(l):l}function De(l,u){if(!Array.isArray(l))return l;let f=u?l.pop():l.shift();return u?l.unshift(f):l.push(f),f}function Ve(l,u,f,S){if(!l||typeof l!="object")return l;if(f||(f={}),u||(u=l),Array.isArray(l))return l.map(T=>Ve(T,u,f,S));if(l.jsonPath){let{JSONPath:T}=ns(),v=typeof l.jsonPath!="object"?{path:l.jsonPath}:l.jsonPath;v.group=l.group||v.group||S,v.cycle=l.cycle||v.cycle||!1,v.reverse=l.reverse||v.reverse||!1,v.count=l.count||v.count||1;let A=`${v.group}__${v.path}`;return f[A]||(v.count>1?f[A]=T(v.path,u).slice(0,v.count):f[A]=T(v.path,u)),v.cycle||v.reverse?De(f[A],v.reverse):Oe(f[A])}return Object.keys(l).forEach(T=>{l[T]=Ve(l[T],u,f,T)}),l}function Dt(l,u,f,S){if(Object.prototype.toString.call(u)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof u}`);let T=Re("refDepthMin")||0,v=Re("refDepthMax")||3;try{let{resolveSchema:A}=bu({refs:l,schema:u,container:f,synchronous:S,refDepthMin:T,refDepthMax:v}),L=gu(Ye.clone(u),[],A);return Re("resolveJsonPath")?{value:Ve(L.value),context:L.context}:L}catch(A){throw A.path?new Error(`${A.message} in /${A.path.join("/")}`):A}}function ln(l){return l.value}function Yt(l,u){return u.reduce((f,S)=>S in f?f[S]:{},l)}function cn(l,u,f,S=f){let{title:T,description:v,comment:A}=Yt(l,u),L=[];Re("renderTitle")&&T&&L.push(` ${T}`,""),Re("renderDescription")&&v&&L.push(` ${v}`),Re("renderComment")&&A&&L.push(` ${A}`),f.commentBefore=L.join(`
31
+ `),S instanceof wu?S.items.forEach(ee=>{cn(l,[...u,"items",ee.key.value],ee.key,ee.value)}):S instanceof Su&&S.items.forEach((ee,N)=>{cn(l,[...u,"items",N],ee)})}function Pn({value:l,context:u}){let f=vr.createNode(l);cn(u,[],f);let S=new vr.Document;return S.contents=f,S.toString()}function St(){pn.define("autoIncrement",function(u,f){if(!this.offset){let S=f.minimum||1,T=S+Gt.MAX_NUMBER,v=u.initialOffset||f.initialOffset;this.offset=v||ke.number(S,T)}return u?this.offset++:f}),pn.define("sequentialDate",function(u,f){if(this.now||(this.now=ke.date()),u){if(f=this.now.toISOString(),u=u===!0?"days":u,["seconds","minutes","hours","days","weeks","months","years"].indexOf(u)===-1)throw new Error(`Unsupported increment by ${Ye.short(u)}`);this.now.setTime(this.now.getTime()+ke.date(u))}return f})}function un(l,u){let f={};Array.isArray(l)?l.forEach(T=>{f[T.$id||T.id]=T}):f=l||{};function S(T){if(!T||typeof T!="object")return;if(Array.isArray(T))return T.forEach(S);let v=T.$id||T.id;typeof v=="string"&&!f[v]&&(f[v]=T),Object.keys(T).forEach(A=>{S(T[A])})}return S(l),S(u),f}var $t,Xo,kc,Qo,Ec,Rc,Ft,Cc,Zo,wr,te,_c,Oc,Ic,Pc,Mc,Sr,Ii,es,Nc,Lc,ts,ns,Dc,Fc,rs,We,is,Uc,Hc,Tr,Re,as,os,$c,qc,jc,Bc,zc,Vc,Gt,Pi,ke,Wc,Ye,Yc,Jc,Kn,ss,Gc,Mi,xr,Kc,Xc,Qc,Zc,eu,tu,nu,ru,iu,ls,au,ou,Ni,Li,su,cs,lu,Di,cu,uu,us,Fi,pu,qt,du,hu,fu,mu,Ar,gu,yu,bu,ps,ds,kt,jg,Bg,zg,Vg,Wg,Yg,Jg,Gg,Kg,Xg,Qg,Zg,wu,Su,vr,pn,rt,Tu,xu,ey=i({"src/shared.js"(){$t=Object.create,Xo=Object.defineProperty,kc=Object.getOwnPropertyDescriptor,Qo=Object.getOwnPropertyNames,Ec=Object.getPrototypeOf,Rc=Object.prototype.hasOwnProperty,Ft=(l,u)=>function(){return u||(0,l[Qo(l)[0]])((u={exports:{}}).exports,u),u.exports},Cc=(l,u,f,S)=>{if(u&&typeof u=="object"||typeof u=="function")for(let T of Qo(u))!Rc.call(l,T)&&T!==f&&Xo(l,T,{get:()=>u[T],enumerable:!(S=kc(u,T))||S.enumerable});return l},Zo=(l,u,f)=>(f=l!=null?$t(Ec(l)):{},Cc(u||!l||!l.__esModule?Xo(f,"default",{value:l,enumerable:!0}):f,l)),wr=Ft({"node_modules/ret/lib/types.js"(l,u){u.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}}}),te=Ft({"node_modules/ret/lib/sets.js"(l){var u=wr(),f=()=>[{type:u.RANGE,from:48,to:57}],S=()=>[{type:u.CHAR,value:95},{type:u.RANGE,from:97,to:122},{type:u.RANGE,from:65,to:90}].concat(f()),T=()=>[{type:u.CHAR,value:9},{type:u.CHAR,value:10},{type:u.CHAR,value:11},{type:u.CHAR,value:12},{type:u.CHAR,value:13},{type:u.CHAR,value:32},{type:u.CHAR,value:160},{type:u.CHAR,value:5760},{type:u.RANGE,from:8192,to:8202},{type:u.CHAR,value:8232},{type:u.CHAR,value:8233},{type:u.CHAR,value:8239},{type:u.CHAR,value:8287},{type:u.CHAR,value:12288},{type:u.CHAR,value:65279}],v=()=>[{type:u.CHAR,value:10},{type:u.CHAR,value:13},{type:u.CHAR,value:8232},{type:u.CHAR,value:8233}];l.words=()=>({type:u.SET,set:S(),not:!1}),l.notWords=()=>({type:u.SET,set:S(),not:!0}),l.ints=()=>({type:u.SET,set:f(),not:!1}),l.notInts=()=>({type:u.SET,set:f(),not:!0}),l.whitespace=()=>({type:u.SET,set:T(),not:!1}),l.notWhitespace=()=>({type:u.SET,set:T(),not:!0}),l.anyChar=()=>({type:u.SET,set:v(),not:!0})}}),_c=Ft({"node_modules/ret/lib/util.js"(l){var u=wr(),f=te(),S="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",T={0:0,t:9,n:10,v:11,f:12,r:13};l.strToChars=v=>{var A=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return v=v.replace(A,(L,ee,N,ie,j,he,ce,He)=>{if(N)return L;var Ae=ee?8:ie?parseInt(ie,16):j?parseInt(j,16):he?parseInt(he,8):ce?S.indexOf(ce):T[He],Ce=String.fromCharCode(Ae);return/[[\]{}^$.|?*+()]/.test(Ce)&&(Ce="\\"+Ce),Ce}),v},l.tokenizeClass=(v,A)=>{for(var L=[],ee=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,N,ie;(N=ee.exec(v))!=null;)if(N[1])L.push(f.words());else if(N[2])L.push(f.ints());else if(N[3])L.push(f.whitespace());else if(N[4])L.push(f.notWords());else if(N[5])L.push(f.notInts());else if(N[6])L.push(f.notWhitespace());else if(N[7])L.push({type:u.RANGE,from:(N[8]||N[9]).charCodeAt(0),to:N[10].charCodeAt(0)});else if(ie=N[12])L.push({type:u.CHAR,value:ie.charCodeAt(0)});else return[L,ee.lastIndex];l.error(A,"Unterminated character class")},l.error=(v,A)=>{throw new SyntaxError("Invalid regular expression: /"+v+"/: "+A)}}}),Oc=Ft({"node_modules/ret/lib/positions.js"(l){var u=wr();l.wordBoundary=()=>({type:u.POSITION,value:"b"}),l.nonWordBoundary=()=>({type:u.POSITION,value:"B"}),l.begin=()=>({type:u.POSITION,value:"^"}),l.end=()=>({type:u.POSITION,value:"$"})}}),Ic=Ft({"node_modules/ret/lib/index.js"(l,u){var f=_c(),S=wr(),T=te(),v=Oc();u.exports=A=>{var L=0,ee,N,ie={type:S.ROOT,stack:[]},j=ie,he=ie.stack,ce=[],He=W=>{f.error(A,`Nothing to repeat at column ${W-1}`)},Ae=f.strToChars(A);for(ee=Ae.length;L<ee;)switch(N=Ae[L++],N){case"\\":switch(N=Ae[L++],N){case"b":he.push(v.wordBoundary());break;case"B":he.push(v.nonWordBoundary());break;case"w":he.push(T.words());break;case"W":he.push(T.notWords());break;case"d":he.push(T.ints());break;case"D":he.push(T.notInts());break;case"s":he.push(T.whitespace());break;case"S":he.push(T.notWhitespace());break;default:/\d/.test(N)?he.push({type:S.REFERENCE,value:parseInt(N,10)}):he.push({type:S.CHAR,value:N.charCodeAt(0)})}break;case"^":he.push(v.begin());break;case"$":he.push(v.end());break;case"[":{var Ce;Ae[L]==="^"?(Ce=!0,L++):Ce=!1;var Ge=f.tokenizeClass(Ae.slice(L),A);L+=Ge[1],he.push({type:S.SET,set:Ge[0],not:Ce});break}case".":he.push(T.anyChar());break;case"(":{var Qe={type:S.GROUP,stack:[],remember:!0};N=Ae[L],N==="?"&&(N=Ae[L+1],L+=2,N==="="?Qe.followedBy=!0:N==="!"?Qe.notFollowedBy=!0:N!==":"&&f.error(A,`Invalid group, character '${N}' after '?' at column ${L-1}`),Qe.remember=!1),he.push(Qe),ce.push(j),j=Qe,he=Qe.stack;break}case")":ce.length===0&&f.error(A,`Unmatched ) at column ${L-1}`),j=ce.pop(),he=j.options?j.options[j.options.length-1]:j.stack;break;case"|":{j.options||(j.options=[j.stack],delete j.stack);var oe=[];j.options.push(oe),he=oe;break}case"{":{var O=/^(\d+)(,(\d+)?)?\}/.exec(Ae.slice(L)),P,z;O!==null?(he.length===0&&He(L),P=parseInt(O[1],10),z=O[2]?O[3]?parseInt(O[3],10):1/0:P,L+=O[0].length,he.push({type:S.REPETITION,min:P,max:z,value:he.pop()})):he.push({type:S.CHAR,value:123});break}case"?":he.length===0&&He(L),he.push({type:S.REPETITION,min:0,max:1,value:he.pop()});break;case"+":he.length===0&&He(L),he.push({type:S.REPETITION,min:1,max:1/0,value:he.pop()});break;case"*":he.length===0&&He(L),he.push({type:S.REPETITION,min:0,max:1/0,value:he.pop()});break;default:he.push({type:S.CHAR,value:N.charCodeAt(0)})}return ce.length!==0&&f.error(A,"Unterminated group"),ie},u.exports.types=S}}),Pc=Ft({"node_modules/drange/lib/index.js"(l,u){var f=class Zn{constructor(v,A){this.low=v,this.high=A,this.length=1+A-v}overlaps(v){return!(this.high<v.low||this.low>v.high)}touches(v){return!(this.high+1<v.low||this.low-1>v.high)}add(v){return new Zn(Math.min(this.low,v.low),Math.max(this.high,v.high))}subtract(v){return v.low<=this.low&&v.high>=this.high?[]:v.low>this.low&&v.high<this.high?[new Zn(this.low,v.low-1),new Zn(v.high+1,this.high)]:v.low<=this.low?[new Zn(v.high+1,this.high)]:[new Zn(this.low,v.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},S=class Mr{constructor(v,A){this.ranges=[],this.length=0,v!=null&&this.add(v,A)}_update_length(){this.length=this.ranges.reduce((v,A)=>v+A.length,0)}add(v,A){var L=ee=>{for(var N=0;N<this.ranges.length&&!ee.touches(this.ranges[N]);)N++;for(var ie=this.ranges.slice(0,N);N<this.ranges.length&&ee.touches(this.ranges[N]);)ee=ee.add(this.ranges[N]),N++;ie.push(ee),this.ranges=ie.concat(this.ranges.slice(N)),this._update_length()};return v instanceof Mr?v.ranges.forEach(L):(A==null&&(A=v),L(new f(v,A))),this}subtract(v,A){var L=ee=>{for(var N=0;N<this.ranges.length&&!ee.overlaps(this.ranges[N]);)N++;for(var ie=this.ranges.slice(0,N);N<this.ranges.length&&ee.overlaps(this.ranges[N]);)ie=ie.concat(this.ranges[N].subtract(ee)),N++;this.ranges=ie.concat(this.ranges.slice(N)),this._update_length()};return v instanceof Mr?v.ranges.forEach(L):(A==null&&(A=v),L(new f(v,A))),this}intersect(v,A){var L=[],ee=N=>{for(var ie=0;ie<this.ranges.length&&!N.overlaps(this.ranges[ie]);)ie++;for(;ie<this.ranges.length&&N.overlaps(this.ranges[ie]);){var j=Math.max(this.ranges[ie].low,N.low),he=Math.min(this.ranges[ie].high,N.high);L.push(new f(j,he)),ie++}};return v instanceof Mr?v.ranges.forEach(ee):(A==null&&(A=v),ee(new f(v,A))),this.ranges=L,this._update_length(),this}index(v){for(var A=0;A<this.ranges.length&&this.ranges[A].length<=v;)v-=this.ranges[A].length,A++;return this.ranges[A].low+v}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Mr(this)}numbers(){return this.ranges.reduce((v,A)=>{for(var L=A.low;L<=A.high;)v.push(L),L++;return v},[])}subranges(){return this.ranges.map(v=>({low:v.low,high:v.high,length:1+v.high-v.low}))}};u.exports=S}}),Mc=Ft({"node_modules/randexp/lib/randexp.js"(l,u){var f=Ic(),S=Pc(),T=f.types;u.exports=class Nr{constructor(A,L){if(this._setDefaults(A),A instanceof RegExp)this.ignoreCase=A.ignoreCase,this.multiline=A.multiline,A=A.source;else if(typeof A=="string")this.ignoreCase=L&&L.indexOf("i")!==-1,this.multiline=L&&L.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=f(A)}_setDefaults(A){this.max=A.max!=null?A.max:Nr.prototype.max!=null?Nr.prototype.max:100,this.defaultRange=A.defaultRange?A.defaultRange:this.defaultRange.clone(),A.randInt&&(this.randInt=A.randInt)}gen(){return this._gen(this.tokens,[])}_gen(A,L){var ee,N,ie,j,he;switch(A.type){case T.ROOT:case T.GROUP:if(A.followedBy||A.notFollowedBy)return"";for(A.remember&&A.groupNumber===void 0&&(A.groupNumber=L.push(null)-1),ee=A.options?this._randSelect(A.options):A.stack,N="",j=0,he=ee.length;j<he;j++)N+=this._gen(ee[j],L);return A.remember&&(L[A.groupNumber]=N),N;case T.POSITION:return"";case T.SET:{var ce=this._expand(A);return ce.length?String.fromCharCode(this._randSelect(ce)):""}case T.REPETITION:for(ie=this.randInt(A.min,A.max===1/0?A.min+this.max:A.max),N="",j=0;j<ie;j++)N+=this._gen(A.value,L);return N;case T.REFERENCE:return L[A.value-1]||"";case T.CHAR:{var He=this.ignoreCase&&this._randBool()?this._toOtherCase(A.value):A.value;return String.fromCharCode(He)}}}_toOtherCase(A){return A+(97<=A&&A<=122?-32:65<=A&&A<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(A){return A instanceof S?A.index(this.randInt(0,A.length-1)):A[this.randInt(0,A.length-1)]}_expand(A){if(A.type===f.types.CHAR)return new S(A.value);if(A.type===f.types.RANGE)return new S(A.from,A.to);{let L=new S;for(let ee=0;ee<A.set.length;ee++){let N=this._expand(A.set[ee]);if(L.add(N),this.ignoreCase)for(let ie=0;ie<N.length;ie++){let j=N.index(ie),he=this._toOtherCase(j);j!==he&&L.add(he)}}return A.not?this.defaultRange.clone().subtract(L):this.defaultRange.clone().intersect(L)}}randInt(A,L){return A+Math.floor(Math.random()*(1+L-A))}get defaultRange(){return this._range=this._range||new S(32,126)}set defaultRange(A){this._range=A}static randexp(A,L){var ee;return typeof A=="string"&&(A=new RegExp(A,L)),A._randexp===void 0?(ee=new Nr(A,L),A._randexp=ee):(ee=A._randexp,ee._setDefaults(A)),ee.gen()}static sugar(){RegExp.prototype.gen=function(){return Nr.randexp(this)}}}}}),Sr=Ft({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(l){var u={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},f={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"},S="tag:yaml.org,2002:",T={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function v(oe){let O=[0],P=oe.indexOf(`
32
+ `);for(;P!==-1;)P+=1,O.push(P),P=oe.indexOf(`
33
+ `,P);return O}function A(oe){let O,P;return typeof oe=="string"?(O=v(oe),P=oe):(Array.isArray(oe)&&(oe=oe[0]),oe&&oe.context&&(oe.lineStarts||(oe.lineStarts=v(oe.context.src)),O=oe.lineStarts,P=oe.context.src)),{lineStarts:O,src:P}}function L(oe,O){if(typeof oe!="number"||oe<0)return null;let{lineStarts:P,src:z}=A(O);if(!P||!z||oe>z.length)return null;for(let X=0;X<P.length;++X){let B=P[X];if(oe<B)return{line:X,col:oe-P[X-1]+1};if(oe===B)return{line:X+1,col:1}}let W=P.length;return{line:W,col:oe-P[W-1]+1}}function ee(oe,O){let{lineStarts:P,src:z}=A(O);if(!P||!(oe>=1)||oe>P.length)return null;let W=P[oe-1],X=P[oe];for(;X&&X>W&&z[X-1]===`
34
+ `;)--X;return z.slice(W,X)}function N({start:oe,end:O},P,z=80){let W=ee(oe.line,P);if(!W)return null;let{col:X}=oe;if(W.length>z)if(X<=z-10)W=W.substr(0,z-1)+"\u2026";else{let fe=Math.round(z/2);W.length>X+fe&&(W=W.substr(0,X+fe-1)+"\u2026"),X-=W.length-z,W="\u2026"+W.substr(1-z)}let B=1,Y="";O&&(O.line===oe.line&&X+(O.col-oe.col)<=z+1?B=O.col-oe.col:(B=Math.min(W.length+1,z)-X,Y="\u2026"));let G=X>1?" ".repeat(X-1):"",pe="^".repeat(B);return`${W}
35
+ ${G}${pe}${Y}`}var ie=class Eu{static copy(O){return new Eu(O.start,O.end)}constructor(O,P){this.start=O,this.end=P||O}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(O,P){let{start:z,end:W}=this;if(O.length===0||W<=O[0])return this.origStart=z,this.origEnd=W,P;let X=P;for(;X<O.length&&!(O[X]>z);)++X;this.origStart=z+X;let B=X;for(;X<O.length&&!(O[X]>=W);)++X;return this.origEnd=W+X,B}},j=class mn{static addStringTerminator(O,P,z){if(z[z.length-1]===`
36
+ `)return z;let W=mn.endOfWhiteSpace(O,P);return W>=O.length||O[W]===`
37
+ `?z+`
38
+ `:z}static atDocumentBoundary(O,P,z){let W=O[P];if(!W)return!0;let X=O[P-1];if(X&&X!==`
39
+ `)return!1;if(z){if(W!==z)return!1}else if(W!==u.DIRECTIVES_END&&W!==u.DOCUMENT_END)return!1;let B=O[P+1],Y=O[P+2];if(B!==W||Y!==W)return!1;let G=O[P+3];return!G||G===`
40
+ `||G===" "||G===" "}static endOfIdentifier(O,P){let z=O[P],W=z==="<",X=W?[`
33
41
  `," "," ",">"]:[`
34
- `," "," ","[","]","{","}",","];for(;V&&K.indexOf(V)===-1;)V=C[I+=1];return W&&V===">"&&(I+=1),I}static endOfIndent(C,I){let V=C[I];for(;V===" ";)V=C[I+=1];return I}static endOfLine(C,I){let V=C[I];for(;V&&V!==`
35
- `;)V=C[I+=1];return I}static endOfWhiteSpace(C,I){let V=C[I];for(;V===" "||V===" ";)V=C[I+=1];return I}static startOfLine(C,I){let V=C[I-1];if(V===`
36
- `)return I;for(;V&&V!==`
37
- `;)V=C[I-=1];return I+1}static endOfBlockIndent(C,I,V){let W=pn.endOfIndent(C,V);if(W>V+I)return W;{let K=pn.endOfWhiteSpace(C,W),z=C[K];if(!z||z===`
38
- `)return K}return null}static atBlank(C,I,V){let W=C[I];return W===`
39
- `||W===" "||W===" "||V&&!W}static nextNodeIsIndented(C,I,V){return!C||I<0?!1:I>0?!0:V&&C==="-"}static normalizeOffset(C,I){let V=C[I];return V?V!==`
40
- `&&C[I-1]===`
41
- `?I-1:pn.endOfWhiteSpace(C,I):I}static foldNewline(C,I,V){let W=0,K=!1,z="",Y=C[I+1];for(;Y===" "||Y===" "||Y===`
42
+ `," "," ","[","]","{","}",","];for(;z&&X.indexOf(z)===-1;)z=O[P+=1];return W&&z===">"&&(P+=1),P}static endOfIndent(O,P){let z=O[P];for(;z===" ";)z=O[P+=1];return P}static endOfLine(O,P){let z=O[P];for(;z&&z!==`
43
+ `;)z=O[P+=1];return P}static endOfWhiteSpace(O,P){let z=O[P];for(;z===" "||z===" ";)z=O[P+=1];return P}static startOfLine(O,P){let z=O[P-1];if(z===`
44
+ `)return P;for(;z&&z!==`
45
+ `;)z=O[P-=1];return P+1}static endOfBlockIndent(O,P,z){let W=mn.endOfIndent(O,z);if(W>z+P)return W;{let X=mn.endOfWhiteSpace(O,W),B=O[X];if(!B||B===`
46
+ `)return X}return null}static atBlank(O,P,z){let W=O[P];return W===`
47
+ `||W===" "||W===" "||z&&!W}static nextNodeIsIndented(O,P,z){return!O||P<0?!1:P>0?!0:z&&O==="-"}static normalizeOffset(O,P){let z=O[P];return z?z!==`
48
+ `&&O[P-1]===`
49
+ `?P-1:mn.endOfWhiteSpace(O,P):P}static foldNewline(O,P,z){let W=0,X=!1,B="",Y=O[P+1];for(;Y===" "||Y===" "||Y===`
42
50
  `;){switch(Y){case`
43
- `:W=0,I+=1,z+=`
44
- `;break;case" ":W<=V&&(K=!0),I=pn.endOfWhiteSpace(C,I+2)-1;break;case" ":W+=1,I+=1;break}Y=C[I+1]}return z||(z=" "),Y&&W<=V&&(K=!0),{fold:z,offset:I,error:K}}constructor(C,I,V){Object.defineProperty(this,"context",{value:V||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=I||[],this.type=C,this.value=null}getPropValue(C,I,V){if(!this.context)return null;let{src:W}=this.context,K=this.props[C];return K&&W[K.start]===I?W.slice(K.start+(V?1:0),K.end):null}get anchor(){for(let C=0;C<this.props.length;++C){let I=this.getPropValue(C,c.ANCHOR,!0);if(I!=null)return I}return null}get comment(){let C=[];for(let I=0;I<this.props.length;++I){let V=this.getPropValue(I,c.COMMENT,!0);V!=null&&C.push(V)}return C.length>0?C.join(`
45
- `):null}commentHasRequiredWhitespace(C){let{src:I}=this.context;if(this.header&&C===this.header.end||!this.valueRange)return!1;let{end:V}=this.valueRange;return C!==V||pn.atBlank(I,V-1)}get hasComment(){if(this.context){let{src:C}=this.context;for(let I=0;I<this.props.length;++I)if(C[this.props[I].start]===c.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:C}=this.context;for(let I=0;I<this.props.length;++I)if(C[this.props[I].start]!==c.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[f.FLOW_MAP,f.FLOW_SEQ,f.QUOTE_DOUBLE,f.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let C=L(this.range.start,this.context.root);if(!C)return;let I=L(this.range.end,this.context.root);return{start:C,end:I}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:C,end:I}=this.valueRange;return this.context.src.slice(C,I)}get tag(){for(let C=0;C<this.props.length;++C){let I=this.getPropValue(C,c.TAG,!1);if(I!=null){if(I[1]==="<")return{verbatim:I.slice(2,-1)};{let[V,W,K]=I.match(/^(.*!)([^!]*)$/);return{handle:W,suffix:K}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:C,end:I}=this.valueRange,{src:V}=this.context;for(let W=C;W<I;++W)if(V[W]===`
46
- `)return!0;return!1}parseComment(C){let{src:I}=this.context;if(I[C]===c.COMMENT){let V=pn.endOfLine(I,C+1),W=new ie(C,V);return this.props.push(W),V}return C}setOrigRanges(C,I){return this.range&&(I=this.range.setOrigRange(C,I)),this.valueRange&&this.valueRange.setOrigRange(C,I),this.props.forEach(V=>V.setOrigRange(C,I)),I}toString(){let{context:{src:C},range:I,value:V}=this;if(V!=null)return V;let W=C.slice(I.start,I.end);return pn.addStringTerminator(C,I.end,W)}},he=class extends Error{constructor(ae,C,I){if(!I||!(C instanceof j))throw new Error(`Invalid arguments for new ${ae}`);super(),this.name=ae,this.message=I,this.source=C}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let ae=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new ie(this.offset,this.offset+1);let C=ae&&L(this.offset,ae);if(C){let I={line:C.line,col:C.col+1};this.linePos={start:C,end:I}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:C,col:I}=this.linePos.start;this.message+=` at line ${C}, column ${I}`;let V=ae&&N(this.linePos,ae);V&&(this.message+=`:
51
+ `:W=0,P+=1,B+=`
52
+ `;break;case" ":W<=z&&(X=!0),P=mn.endOfWhiteSpace(O,P+2)-1;break;case" ":W+=1,P+=1;break}Y=O[P+1]}return B||(B=" "),Y&&W<=z&&(X=!0),{fold:B,offset:P,error:X}}constructor(O,P,z){Object.defineProperty(this,"context",{value:z||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=P||[],this.type=O,this.value=null}getPropValue(O,P,z){if(!this.context)return null;let{src:W}=this.context,X=this.props[O];return X&&W[X.start]===P?W.slice(X.start+(z?1:0),X.end):null}get anchor(){for(let O=0;O<this.props.length;++O){let P=this.getPropValue(O,u.ANCHOR,!0);if(P!=null)return P}return null}get comment(){let O=[];for(let P=0;P<this.props.length;++P){let z=this.getPropValue(P,u.COMMENT,!0);z!=null&&O.push(z)}return O.length>0?O.join(`
53
+ `):null}commentHasRequiredWhitespace(O){let{src:P}=this.context;if(this.header&&O===this.header.end||!this.valueRange)return!1;let{end:z}=this.valueRange;return O!==z||mn.atBlank(P,z-1)}get hasComment(){if(this.context){let{src:O}=this.context;for(let P=0;P<this.props.length;++P)if(O[this.props[P].start]===u.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:O}=this.context;for(let P=0;P<this.props.length;++P)if(O[this.props[P].start]!==u.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[f.FLOW_MAP,f.FLOW_SEQ,f.QUOTE_DOUBLE,f.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let O=L(this.range.start,this.context.root);if(!O)return;let P=L(this.range.end,this.context.root);return{start:O,end:P}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:O,end:P}=this.valueRange;return this.context.src.slice(O,P)}get tag(){for(let O=0;O<this.props.length;++O){let P=this.getPropValue(O,u.TAG,!1);if(P!=null){if(P[1]==="<")return{verbatim:P.slice(2,-1)};{let[z,W,X]=P.match(/^(.*!)([^!]*)$/);return{handle:W,suffix:X}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:O,end:P}=this.valueRange,{src:z}=this.context;for(let W=O;W<P;++W)if(z[W]===`
54
+ `)return!0;return!1}parseComment(O){let{src:P}=this.context;if(P[O]===u.COMMENT){let z=mn.endOfLine(P,O+1),W=new ie(O,z);return this.props.push(W),z}return O}setOrigRanges(O,P){return this.range&&(P=this.range.setOrigRange(O,P)),this.valueRange&&this.valueRange.setOrigRange(O,P),this.props.forEach(z=>z.setOrigRange(O,P)),P}toString(){let{context:{src:O},range:P,value:z}=this;if(z!=null)return z;let W=O.slice(P.start,P.end);return mn.addStringTerminator(O,P.end,W)}},he=class extends Error{constructor(oe,O,P){if(!P||!(O instanceof j))throw new Error(`Invalid arguments for new ${oe}`);super(),this.name=oe,this.message=P,this.source=O}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let oe=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new ie(this.offset,this.offset+1);let O=oe&&L(this.offset,oe);if(O){let P={line:O.line,col:O.col+1};this.linePos={start:O,end:P}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:O,col:P}=this.linePos.start;this.message+=` at line ${O}, column ${P}`;let z=oe&&N(this.linePos,oe);z&&(this.message+=`:
47
55
 
48
- ${V}
49
- `)}delete this.source}},ce=class extends he{constructor(ae,C){super("YAMLReferenceError",ae,C)}},$e=class extends he{constructor(ae,C){super("YAMLSemanticError",ae,C)}},xe=class extends he{constructor(ae,C){super("YAMLSyntaxError",ae,C)}},Re=class extends he{constructor(ae,C){super("YAMLWarning",ae,C)}};function Ge(ae,C,I){return C in ae?Object.defineProperty(ae,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):ae[C]=I,ae}var Qe=class Ba extends j{static endOfLine(C,I,V){let W=C[I],K=I;for(;W&&W!==`
50
- `&&!(V&&(W==="["||W==="]"||W==="{"||W==="}"||W===","));){let z=C[K+1];if(W===":"&&(!z||z===`
51
- `||z===" "||z===" "||V&&z===",")||(W===" "||W===" ")&&z==="#")break;K+=1,W=z}return K}get strValue(){if(!this.valueRange||!this.context)return null;let{start:C,end:I}=this.valueRange,{src:V}=this.context,W=V[I-1];for(;C<I&&(W===`
52
- `||W===" "||W===" ");)W=V[--I-1];let K="";for(let Y=C;Y<I;++Y){let G=V[Y];if(G===`
53
- `){let{fold:pe,offset:fe}=j.foldNewline(V,Y,-1);K+=pe,Y=fe}else if(G===" "||G===" "){let pe=Y,fe=V[Y+1];for(;Y<I&&(fe===" "||fe===" ");)Y+=1,fe=V[Y+1];fe!==`
54
- `&&(K+=Y>pe?V.slice(pe,Y+1):G)}else K+=G}let z=V[C];switch(z){case" ":{let Y="Plain value cannot start with a tab character";return{errors:[new $e(this,Y)],str:K}}case"@":case"`":{let Y=`Plain value cannot start with reserved character ${z}`;return{errors:[new $e(this,Y)],str:K}}default:return K}}parseBlockValue(C){let{indent:I,inFlow:V,src:W}=this.context,K=C,z=C;for(let Y=W[K];Y===`
55
- `&&!j.atDocumentBoundary(W,K+1);Y=W[K]){let G=j.endOfBlockIndent(W,I,K+1);if(G===null||W[G]==="#")break;W[G]===`
56
- `?K=G:(z=Ba.endOfLine(W,G,V),K=z)}return this.valueRange.isEmpty()&&(this.valueRange.start=C),this.valueRange.end=z,z}parse(C,I){this.context=C;let{inFlow:V,src:W}=C,K=I,z=W[K];return z&&z!=="#"&&z!==`
57
- `&&(K=Ba.endOfLine(W,I,V)),this.valueRange=new ie(I,K),K=j.endOfWhiteSpace(W,K),K=this.parseComment(K),(!this.hasComment||this.valueRange.isEmpty())&&(K=this.parseBlockValue(K)),K}};l.Char=c,l.Node=j,l.PlainValue=Qe,l.Range=ie,l.Type=f,l.YAMLError=he,l.YAMLReferenceError=ce,l.YAMLSemanticError=$e,l.YAMLSyntaxError=xe,l.YAMLWarning=Re,l._defineProperty=Ge,l.defaultTagPrefix=S,l.defaultTags=T}}),pi=Lt({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(l){var c=mr();function f(b,m,w){return w?`#${w.replace(/[\s\S]^/gm,`$&${m}#`)}
56
+ ${z}
57
+ `)}delete this.source}},ce=class extends he{constructor(oe,O){super("YAMLReferenceError",oe,O)}},He=class extends he{constructor(oe,O){super("YAMLSemanticError",oe,O)}},Ae=class extends he{constructor(oe,O){super("YAMLSyntaxError",oe,O)}},Ce=class extends he{constructor(oe,O){super("YAMLWarning",oe,O)}};function Ge(oe,O,P){return O in oe?Object.defineProperty(oe,O,{value:P,enumerable:!0,configurable:!0,writable:!0}):oe[O]=P,oe}var Qe=class gs extends j{static endOfLine(O,P,z){let W=O[P],X=P;for(;W&&W!==`
58
+ `&&!(z&&(W==="["||W==="]"||W==="{"||W==="}"||W===","));){let B=O[X+1];if(W===":"&&(!B||B===`
59
+ `||B===" "||B===" "||z&&B===",")||(W===" "||W===" ")&&B==="#")break;X+=1,W=B}return X}get strValue(){if(!this.valueRange||!this.context)return null;let{start:O,end:P}=this.valueRange,{src:z}=this.context,W=z[P-1];for(;O<P&&(W===`
60
+ `||W===" "||W===" ");)W=z[--P-1];let X="";for(let Y=O;Y<P;++Y){let G=z[Y];if(G===`
61
+ `){let{fold:pe,offset:fe}=j.foldNewline(z,Y,-1);X+=pe,Y=fe}else if(G===" "||G===" "){let pe=Y,fe=z[Y+1];for(;Y<P&&(fe===" "||fe===" ");)Y+=1,fe=z[Y+1];fe!==`
62
+ `&&(X+=Y>pe?z.slice(pe,Y+1):G)}else X+=G}let B=z[O];switch(B){case" ":{let Y="Plain value cannot start with a tab character";return{errors:[new He(this,Y)],str:X}}case"@":case"`":{let Y=`Plain value cannot start with reserved character ${B}`;return{errors:[new He(this,Y)],str:X}}default:return X}}parseBlockValue(O){let{indent:P,inFlow:z,src:W}=this.context,X=O,B=O;for(let Y=W[X];Y===`
63
+ `&&!j.atDocumentBoundary(W,X+1);Y=W[X]){let G=j.endOfBlockIndent(W,P,X+1);if(G===null||W[G]==="#")break;W[G]===`
64
+ `?X=G:(B=gs.endOfLine(W,G,z),X=B)}return this.valueRange.isEmpty()&&(this.valueRange.start=O),this.valueRange.end=B,B}parse(O,P){this.context=O;let{inFlow:z,src:W}=O,X=P,B=W[X];return B&&B!=="#"&&B!==`
65
+ `&&(X=gs.endOfLine(W,P,z)),this.valueRange=new ie(P,X),X=j.endOfWhiteSpace(W,X),X=this.parseComment(X),(!this.hasComment||this.valueRange.isEmpty())&&(X=this.parseBlockValue(X)),X}};l.Char=u,l.Node=j,l.PlainValue=Qe,l.Range=ie,l.Type=f,l.YAMLError=he,l.YAMLReferenceError=ce,l.YAMLSemanticError=He,l.YAMLSyntaxError=Ae,l.YAMLWarning=Ce,l._defineProperty=Ge,l.defaultTagPrefix=S,l.defaultTags=T}}),Ii=Ft({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(l){var u=Sr();function f(b,m,w){return w?`#${w.replace(/[\s\S]^/gm,`$&${m}#`)}
58
66
  ${m}${b}`:b}function S(b,m,w){return w?w.indexOf(`
59
67
  `)===-1?`${b} #${w}`:`${b}
60
- `+w.replace(/^/gm,`${m||""}#`):b}var T=class{};function v(b,m,w){if(Array.isArray(b))return b.map((x,R)=>v(x,String(R),w));if(b&&typeof b.toJSON=="function"){let x=w&&w.anchors&&w.anchors.get(b);x&&(w.onCreate=O=>{x.res=O,delete w.onCreate});let R=b.toJSON(m,w);return x&&w.onCreate&&w.onCreate(R),R}return(!w||!w.keep)&&typeof b=="bigint"?Number(b):b}var k=class extends T{constructor(b){super(),this.value=b}toJSON(b,m){return m&&m.keep?this.value:v(this.value,b,m)}toString(){return String(this.value)}};function L(b,m,w){let x=w;for(let R=m.length-1;R>=0;--R){let O=m[R];if(Number.isInteger(O)&&O>=0){let D=[];D[O]=x,x=D}else{let D={};Object.defineProperty(D,O,{value:x,writable:!0,enumerable:!0,configurable:!0}),x=D}}return b.createNode(x,!1)}var Q=b=>b==null||typeof b=="object"&&b[Symbol.iterator]().next().done,N=class Ln extends T{constructor(m){super(),c._defineProperty(this,"items",[]),this.schema=m}addIn(m,w){if(Q(m))this.add(w);else{let[x,...R]=m,O=this.get(x,!0);if(O instanceof Ln)O.addIn(R,w);else if(O===void 0&&this.schema)this.set(x,L(this.schema,R,w));else throw new Error(`Expected YAML collection at ${x}. Remaining path: ${R}`)}}deleteIn([m,...w]){if(w.length===0)return this.delete(m);let x=this.get(m,!0);if(x instanceof Ln)return x.deleteIn(w);throw new Error(`Expected YAML collection at ${m}. Remaining path: ${w}`)}getIn([m,...w],x){let R=this.get(m,!0);return w.length===0?!x&&R instanceof k?R.value:R:R instanceof Ln?R.getIn(w,x):void 0}hasAllNullValues(){return this.items.every(m=>{if(!m||m.type!=="PAIR")return!1;let w=m.value;return w==null||w instanceof k&&w.value==null&&!w.commentBefore&&!w.comment&&!w.tag})}hasIn([m,...w]){if(w.length===0)return this.has(m);let x=this.get(m,!0);return x instanceof Ln?x.hasIn(w):!1}setIn([m,...w],x){if(w.length===0)this.set(m,x);else{let R=this.get(m,!0);if(R instanceof Ln)R.setIn(w,x);else if(R===void 0&&this.schema)this.set(m,L(this.schema,w,x));else throw new Error(`Expected YAML collection at ${m}. Remaining path: ${w}`)}}toJSON(){return null}toString(m,{blockItem:w,flowChars:x,isMap:R,itemIndent:O},D,F){let{indent:H,indentStep:X,stringify:de}=m,be=this.type===c.Type.FLOW_MAP||this.type===c.Type.FLOW_SEQ||m.inFlow;be&&(O+=X);let nt=R&&this.hasAllNullValues();m=Object.assign({},m,{allNullValues:nt,indent:O,inFlow:be,type:null});let Ne=!1,Ze=!1,Fe=this.items.reduce((gt,Ve,at)=>{let Je;Ve&&(!Ne&&Ve.spaceBefore&&gt.push({type:"comment",str:""}),Ve.commentBefore&&Ve.commentBefore.match(/^.*$/gm).forEach(Pg=>{gt.push({type:"comment",str:`#${Pg}`})}),Ve.comment&&(Je=Ve.comment),be&&(!Ne&&Ve.spaceBefore||Ve.commentBefore||Ve.comment||Ve.key&&(Ve.key.commentBefore||Ve.key.comment)||Ve.value&&(Ve.value.commentBefore||Ve.value.comment))&&(Ze=!0)),Ne=!1;let Et=de(Ve,m,()=>Je=null,()=>Ne=!0);return be&&!Ze&&Et.includes(`
61
- `)&&(Ze=!0),be&&at<this.items.length-1&&(Et+=","),Et=S(Et,O,Je),Ne&&(Je||be)&&(Ne=!1),gt.push({type:"item",str:Et}),gt},[]),Ke;if(Fe.length===0)Ke=x.start+x.end;else if(be){let{start:gt,end:Ve}=x,at=Fe.map(Je=>Je.str);if(Ze||at.reduce((Je,Et)=>Je+Et.length+2,2)>Ln.maxFlowStringSingleLineLength){Ke=gt;for(let Je of at)Ke+=Je?`
62
- ${X}${H}${Je}`:`
68
+ `+w.replace(/^/gm,`${m||""}#`):b}var T=class{};function v(b,m,w){if(Array.isArray(b))return b.map((x,C)=>v(x,String(C),w));if(b&&typeof b.toJSON=="function"){let x=w&&w.anchors&&w.anchors.get(b);x&&(w.onCreate=_=>{x.res=_,delete w.onCreate});let C=b.toJSON(m,w);return x&&w.onCreate&&w.onCreate(C),C}return(!w||!w.keep)&&typeof b=="bigint"?Number(b):b}var A=class extends T{constructor(b){super(),this.value=b}toJSON(b,m){return m&&m.keep?this.value:v(this.value,b,m)}toString(){return String(this.value)}};function L(b,m,w){let x=w;for(let C=m.length-1;C>=0;--C){let _=m[C];if(Number.isInteger(_)&&_>=0){let D=[];D[_]=x,x=D}else{let D={};Object.defineProperty(D,_,{value:x,writable:!0,enumerable:!0,configurable:!0}),x=D}}return b.createNode(x,!1)}var ee=b=>b==null||typeof b=="object"&&b[Symbol.iterator]().next().done,N=class Ln extends T{constructor(m){super(),u._defineProperty(this,"items",[]),this.schema=m}addIn(m,w){if(ee(m))this.add(w);else{let[x,...C]=m,_=this.get(x,!0);if(_ instanceof Ln)_.addIn(C,w);else if(_===void 0&&this.schema)this.set(x,L(this.schema,C,w));else throw new Error(`Expected YAML collection at ${x}. Remaining path: ${C}`)}}deleteIn([m,...w]){if(w.length===0)return this.delete(m);let x=this.get(m,!0);if(x instanceof Ln)return x.deleteIn(w);throw new Error(`Expected YAML collection at ${m}. Remaining path: ${w}`)}getIn([m,...w],x){let C=this.get(m,!0);return w.length===0?!x&&C instanceof A?C.value:C:C instanceof Ln?C.getIn(w,x):void 0}hasAllNullValues(){return this.items.every(m=>{if(!m||m.type!=="PAIR")return!1;let w=m.value;return w==null||w instanceof A&&w.value==null&&!w.commentBefore&&!w.comment&&!w.tag})}hasIn([m,...w]){if(w.length===0)return this.has(m);let x=this.get(m,!0);return x instanceof Ln?x.hasIn(w):!1}setIn([m,...w],x){if(w.length===0)this.set(m,x);else{let C=this.get(m,!0);if(C instanceof Ln)C.setIn(w,x);else if(C===void 0&&this.schema)this.set(m,L(this.schema,w,x));else throw new Error(`Expected YAML collection at ${m}. Remaining path: ${w}`)}}toJSON(){return null}toString(m,{blockItem:w,flowChars:x,isMap:C,itemIndent:_},D,F){let{indent:V,indentStep:Q,stringify:de}=m,be=this.type===u.Type.FLOW_MAP||this.type===u.Type.FLOW_SEQ||m.inFlow;be&&(_+=Q);let nt=C&&this.hasAllNullValues();m=Object.assign({},m,{allNullValues:nt,indent:_,inFlow:be,type:null});let Ne=!1,Ze=!1,Fe=this.items.reduce((gt,ze,ot)=>{let Je;ze&&(!Ne&&ze.spaceBefore&&gt.push({type:"comment",str:""}),ze.commentBefore&&ze.commentBefore.match(/^.*$/gm).forEach(fy=>{gt.push({type:"comment",str:`#${fy}`})}),ze.comment&&(Je=ze.comment),be&&(!Ne&&ze.spaceBefore||ze.commentBefore||ze.comment||ze.key&&(ze.key.commentBefore||ze.key.comment)||ze.value&&(ze.value.commentBefore||ze.value.comment))&&(Ze=!0)),Ne=!1;let Et=de(ze,m,()=>Je=null,()=>Ne=!0);return be&&!Ze&&Et.includes(`
69
+ `)&&(Ze=!0),be&&ot<this.items.length-1&&(Et+=","),Et=S(Et,_,Je),Ne&&(Je||be)&&(Ne=!1),gt.push({type:"item",str:Et}),gt},[]),Ke;if(Fe.length===0)Ke=x.start+x.end;else if(be){let{start:gt,end:ze}=x,ot=Fe.map(Je=>Je.str);if(Ze||ot.reduce((Je,Et)=>Je+Et.length+2,2)>Ln.maxFlowStringSingleLineLength){Ke=gt;for(let Je of ot)Ke+=Je?`
70
+ ${Q}${V}${Je}`:`
63
71
  `;Ke+=`
64
- ${H}${Ve}`}else Ke=`${gt} ${at.join(" ")} ${Ve}`}else{let gt=Fe.map(w);Ke=gt.shift();for(let Ve of gt)Ke+=Ve?`
65
- ${H}${Ve}`:`
72
+ ${V}${ze}`}else Ke=`${gt} ${ot.join(" ")} ${ze}`}else{let gt=Fe.map(w);Ke=gt.shift();for(let ze of gt)Ke+=ze?`
73
+ ${V}${ze}`:`
66
74
  `}return this.comment?(Ke+=`
67
- `+this.comment.replace(/^/gm,`${H}#`),D&&D()):Ne&&F&&F(),Ke}};c._defineProperty(N,"maxFlowStringSingleLineLength",60);function ie(b){let m=b instanceof k?b.value:b;return m&&typeof m=="string"&&(m=Number(m)),Number.isInteger(m)&&m>=0?m:null}var j=class extends N{add(b){this.items.push(b)}delete(b){let m=ie(b);return typeof m!="number"?!1:this.items.splice(m,1).length>0}get(b,m){let w=ie(b);if(typeof w!="number")return;let x=this.items[w];return!m&&x instanceof k?x.value:x}has(b){let m=ie(b);return typeof m=="number"&&m<this.items.length}set(b,m){let w=ie(b);if(typeof w!="number")throw new Error(`Expected a valid index, not ${b}.`);this.items[w]=m}toJSON(b,m){let w=[];m&&m.onCreate&&m.onCreate(w);let x=0;for(let R of this.items)w.push(v(R,String(x++),m));return w}toString(b,m,w){return b?super.toString(b,{blockItem:x=>x.type==="comment"?x.str:`- ${x.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(b.indent||"")+" "},m,w):JSON.stringify(this)}},he=(b,m,w)=>m===null?"":typeof m!="object"?String(m):b instanceof T&&w&&w.doc?b.toString({anchors:Object.create(null),doc:w.doc,indent:"",indentStep:w.indentStep,inFlow:!0,inStringifyKey:!0,stringify:w.stringify}):JSON.stringify(m),ce=class Xc extends T{constructor(m,w=null){super(),this.key=m,this.value=w,this.type=Xc.Type.PAIR}get commentBefore(){return this.key instanceof T?this.key.commentBefore:void 0}set commentBefore(m){if(this.key==null&&(this.key=new k(null)),this.key instanceof T)this.key.commentBefore=m;else{let w="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(w)}}addToJSMap(m,w){let x=v(this.key,"",m);if(w instanceof Map){let R=v(this.value,x,m);w.set(x,R)}else if(w instanceof Set)w.add(x);else{let R=he(this.key,x,m),O=v(this.value,R,m);R in w?Object.defineProperty(w,R,{value:O,writable:!0,enumerable:!0,configurable:!0}):w[R]=O}return w}toJSON(m,w){let x=w&&w.mapAsMap?new Map:{};return this.addToJSMap(w,x)}toString(m,w,x){if(!m||!m.doc)return JSON.stringify(this);let{indent:R,indentSeq:O,simpleKeys:D}=m.doc.options,{key:F,value:H}=this,X=F instanceof T&&F.comment;if(D){if(X)throw new Error("With simple keys, key nodes cannot have comments");if(F instanceof N){let Et="With simple keys, collection cannot be used as a key value";throw new Error(Et)}}let de=!D&&(!F||X||(F instanceof T?F instanceof N||F.type===c.Type.BLOCK_FOLDED||F.type===c.Type.BLOCK_LITERAL:typeof F=="object")),{doc:be,indent:nt,indentStep:Ne,stringify:Ze}=m;m=Object.assign({},m,{implicitKey:!de,indent:nt+Ne});let Fe=!1,Ke=Ze(F,m,()=>X=null,()=>Fe=!0);if(Ke=S(Ke,m.indent,X),!de&&Ke.length>1024){if(D)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");de=!0}if(m.allNullValues&&!D)return this.comment?(Ke=S(Ke,m.indent,this.comment),w&&w()):Fe&&!X&&x&&x(),m.inFlow&&!de?Ke:`? ${Ke}`;Ke=de?`? ${Ke}
68
- ${nt}:`:`${Ke}:`,this.comment&&(Ke=S(Ke,m.indent,this.comment),w&&w());let gt="",Ve=null;if(H instanceof T){if(H.spaceBefore&&(gt=`
69
- `),H.commentBefore){let Et=H.commentBefore.replace(/^/gm,`${m.indent}#`);gt+=`
70
- ${Et}`}Ve=H.comment}else H&&typeof H=="object"&&(H=be.schema.createNode(H,!0));m.implicitKey=!1,!de&&!this.comment&&H instanceof k&&(m.indentAtStart=Ke.length+1),Fe=!1,!O&&R>=2&&!m.inFlow&&!de&&H instanceof j&&H.type!==c.Type.FLOW_SEQ&&!H.tag&&!be.anchors.getName(H)&&(m.indent=m.indent.substr(2));let at=Ze(H,m,()=>Ve=null,()=>Fe=!0),Je=" ";return gt||this.comment?Je=`${gt}
71
- ${m.indent}`:!de&&H instanceof N?(!(at[0]==="["||at[0]==="{")||at.includes(`
75
+ `+this.comment.replace(/^/gm,`${V}#`),D&&D()):Ne&&F&&F(),Ke}};u._defineProperty(N,"maxFlowStringSingleLineLength",60);function ie(b){let m=b instanceof A?b.value:b;return m&&typeof m=="string"&&(m=Number(m)),Number.isInteger(m)&&m>=0?m:null}var j=class extends N{add(b){this.items.push(b)}delete(b){let m=ie(b);return typeof m!="number"?!1:this.items.splice(m,1).length>0}get(b,m){let w=ie(b);if(typeof w!="number")return;let x=this.items[w];return!m&&x instanceof A?x.value:x}has(b){let m=ie(b);return typeof m=="number"&&m<this.items.length}set(b,m){let w=ie(b);if(typeof w!="number")throw new Error(`Expected a valid index, not ${b}.`);this.items[w]=m}toJSON(b,m){let w=[];m&&m.onCreate&&m.onCreate(w);let x=0;for(let C of this.items)w.push(v(C,String(x++),m));return w}toString(b,m,w){return b?super.toString(b,{blockItem:x=>x.type==="comment"?x.str:`- ${x.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(b.indent||"")+" "},m,w):JSON.stringify(this)}},he=(b,m,w)=>m===null?"":typeof m!="object"?String(m):b instanceof T&&w&&w.doc?b.toString({anchors:Object.create(null),doc:w.doc,indent:"",indentStep:w.indentStep,inFlow:!0,inStringifyKey:!0,stringify:w.stringify}):JSON.stringify(m),ce=class Ru extends T{constructor(m,w=null){super(),this.key=m,this.value=w,this.type=Ru.Type.PAIR}get commentBefore(){return this.key instanceof T?this.key.commentBefore:void 0}set commentBefore(m){if(this.key==null&&(this.key=new A(null)),this.key instanceof T)this.key.commentBefore=m;else{let w="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(w)}}addToJSMap(m,w){let x=v(this.key,"",m);if(w instanceof Map){let C=v(this.value,x,m);w.set(x,C)}else if(w instanceof Set)w.add(x);else{let C=he(this.key,x,m),_=v(this.value,C,m);C in w?Object.defineProperty(w,C,{value:_,writable:!0,enumerable:!0,configurable:!0}):w[C]=_}return w}toJSON(m,w){let x=w&&w.mapAsMap?new Map:{};return this.addToJSMap(w,x)}toString(m,w,x){if(!m||!m.doc)return JSON.stringify(this);let{indent:C,indentSeq:_,simpleKeys:D}=m.doc.options,{key:F,value:V}=this,Q=F instanceof T&&F.comment;if(D){if(Q)throw new Error("With simple keys, key nodes cannot have comments");if(F instanceof N){let Et="With simple keys, collection cannot be used as a key value";throw new Error(Et)}}let de=!D&&(!F||Q||(F instanceof T?F instanceof N||F.type===u.Type.BLOCK_FOLDED||F.type===u.Type.BLOCK_LITERAL:typeof F=="object")),{doc:be,indent:nt,indentStep:Ne,stringify:Ze}=m;m=Object.assign({},m,{implicitKey:!de,indent:nt+Ne});let Fe=!1,Ke=Ze(F,m,()=>Q=null,()=>Fe=!0);if(Ke=S(Ke,m.indent,Q),!de&&Ke.length>1024){if(D)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");de=!0}if(m.allNullValues&&!D)return this.comment?(Ke=S(Ke,m.indent,this.comment),w&&w()):Fe&&!Q&&x&&x(),m.inFlow&&!de?Ke:`? ${Ke}`;Ke=de?`? ${Ke}
76
+ ${nt}:`:`${Ke}:`,this.comment&&(Ke=S(Ke,m.indent,this.comment),w&&w());let gt="",ze=null;if(V instanceof T){if(V.spaceBefore&&(gt=`
77
+ `),V.commentBefore){let Et=V.commentBefore.replace(/^/gm,`${m.indent}#`);gt+=`
78
+ ${Et}`}ze=V.comment}else V&&typeof V=="object"&&(V=be.schema.createNode(V,!0));m.implicitKey=!1,!de&&!this.comment&&V instanceof A&&(m.indentAtStart=Ke.length+1),Fe=!1,!_&&C>=2&&!m.inFlow&&!de&&V instanceof j&&V.type!==u.Type.FLOW_SEQ&&!V.tag&&!be.anchors.getName(V)&&(m.indent=m.indent.substr(2));let ot=Ze(V,m,()=>ze=null,()=>Fe=!0),Je=" ";return gt||this.comment?Je=`${gt}
79
+ ${m.indent}`:!de&&V instanceof N?(!(ot[0]==="["||ot[0]==="{")||ot.includes(`
72
80
  `))&&(Je=`
73
- ${m.indent}`):at[0]===`
74
- `&&(Je=""),Fe&&!Ve&&x&&x(),S(Ke+Je+at,m.indent,Ve)}};c._defineProperty(ce,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var $e=(b,m)=>{if(b instanceof xe){let w=m.get(b.source);return w.count*w.aliasCount}else if(b instanceof N){let w=0;for(let x of b.items){let R=$e(x,m);R>w&&(w=R)}return w}else if(b instanceof ce){let w=$e(b.key,m),x=$e(b.value,m);return Math.max(w,x)}return 1},xe=class Qc extends T{static stringify({range:m,source:w},{anchors:x,doc:R,implicitKey:O,inStringifyKey:D}){let F=Object.keys(x).find(X=>x[X]===w);if(!F&&D&&(F=R.anchors.getName(w)||R.anchors.newName()),F)return`*${F}${O?" ":""}`;let H=R.anchors.getName(w)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${H} [${m}]`)}constructor(m){super(),this.source=m,this.type=c.Type.ALIAS}set tag(m){throw new Error("Alias nodes cannot have tags")}toJSON(m,w){if(!w)return v(this.source,m,w);let{anchors:x,maxAliasCount:R}=w,O=x.get(this.source);if(!O||O.res===void 0){let D="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new c.YAMLReferenceError(this.cstNode,D):new ReferenceError(D)}if(R>=0&&(O.count+=1,O.aliasCount===0&&(O.aliasCount=$e(this.source,x)),O.count*O.aliasCount>R)){let D="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new c.YAMLReferenceError(this.cstNode,D):new ReferenceError(D)}return O.res}toString(m){return Qc.stringify(this,m)}};c._defineProperty(xe,"default",!0);function Re(b,m){let w=m instanceof k?m.value:m;for(let x of b)if(x instanceof ce&&(x.key===m||x.key===w||x.key&&x.key.value===w))return x}var Ge=class extends N{add(b,m){b?b instanceof ce||(b=new ce(b.key||b,b.value)):b=new ce(b);let w=Re(this.items,b.key),x=this.schema&&this.schema.sortMapEntries;if(w)if(m)w.value=b.value;else throw new Error(`Key ${b.key} already set`);else if(x){let R=this.items.findIndex(O=>x(b,O)<0);R===-1?this.items.push(b):this.items.splice(R,0,b)}else this.items.push(b)}delete(b){let m=Re(this.items,b);return m?this.items.splice(this.items.indexOf(m),1).length>0:!1}get(b,m){let w=Re(this.items,b),x=w&&w.value;return!m&&x instanceof k?x.value:x}has(b){return!!Re(this.items,b)}set(b,m){this.add(new ce(b,m),!0)}toJSON(b,m,w){let x=w?new w:m&&m.mapAsMap?new Map:{};m&&m.onCreate&&m.onCreate(x);for(let R of this.items)R.addToJSMap(m,x);return x}toString(b,m,w){if(!b)return JSON.stringify(this);for(let x of this.items)if(!(x instanceof ce))throw new Error(`Map items must all be pairs; found ${JSON.stringify(x)} instead`);return super.toString(b,{blockItem:x=>x.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:b.indent||""},m,w)}},Qe="<<",ae=class extends ce{constructor(b){if(b instanceof ce){let m=b.value;m instanceof j||(m=new j,m.items.push(b.value),m.range=b.value.range),super(b.key,m),this.range=b.range}else super(new k(Qe),new j);this.type=ce.Type.MERGE_PAIR}addToJSMap(b,m){for(let{source:w}of this.value.items){if(!(w instanceof Ge))throw new Error("Merge sources must be maps");let x=w.toJSON(null,b,Map);for(let[R,O]of x)m instanceof Map?m.has(R)||m.set(R,O):m instanceof Set?m.add(R):Object.prototype.hasOwnProperty.call(m,R)||Object.defineProperty(m,R,{value:O,writable:!0,enumerable:!0,configurable:!0})}return m}toString(b,m){let w=this.value;if(w.items.length>1)return super.toString(b,m);this.value=w.items[0];let x=super.toString(b,m);return this.value=w,x}},C={defaultType:c.Type.BLOCK_LITERAL,lineWidth:76},I={trueStr:"true",falseStr:"false"},V={asBigInt:!1},W={nullStr:"null"},K={defaultType:c.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function z(b,m,w){for(let{format:x,test:R,resolve:O}of m)if(R){let D=b.match(R);if(D){let F=O.apply(null,D);return F instanceof k||(F=new k(F)),x&&(F.format=x),F}}return w&&(b=w(b)),new k(b)}var Y="flow",G="block",pe="quoted",fe=(b,m)=>{let w=b[m+1];for(;w===" "||w===" ";){do w=b[m+=1];while(w&&w!==`
75
- `);w=b[m+1]}return m};function Ee(b,m,w,{indentAtStart:x,lineWidth:R=80,minContentWidth:O=20,onFold:D,onOverflow:F}){if(!R||R<0)return b;let H=Math.max(1+O,1+R-m.length);if(b.length<=H)return b;let X=[],de={},be=R-m.length;typeof x=="number"&&(x>R-Math.max(2,O)?X.push(0):be=R-x);let nt,Ne,Ze=!1,Fe=-1,Ke=-1,gt=-1;w===G&&(Fe=fe(b,Fe),Fe!==-1&&(be=Fe+H));for(let at;at=b[Fe+=1];){if(w===pe&&at==="\\"){switch(Ke=Fe,b[Fe+1]){case"x":Fe+=3;break;case"u":Fe+=5;break;case"U":Fe+=9;break;default:Fe+=1}gt=Fe}if(at===`
76
- `)w===G&&(Fe=fe(b,Fe)),be=Fe+H,nt=void 0;else{if(at===" "&&Ne&&Ne!==" "&&Ne!==`
81
+ ${m.indent}`):ot[0]===`
82
+ `&&(Je=""),Fe&&!ze&&x&&x(),S(Ke+Je+ot,m.indent,ze)}};u._defineProperty(ce,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var He=(b,m)=>{if(b instanceof Ae){let w=m.get(b.source);return w.count*w.aliasCount}else if(b instanceof N){let w=0;for(let x of b.items){let C=He(x,m);C>w&&(w=C)}return w}else if(b instanceof ce){let w=He(b.key,m),x=He(b.value,m);return Math.max(w,x)}return 1},Ae=class Cu extends T{static stringify({range:m,source:w},{anchors:x,doc:C,implicitKey:_,inStringifyKey:D}){let F=Object.keys(x).find(Q=>x[Q]===w);if(!F&&D&&(F=C.anchors.getName(w)||C.anchors.newName()),F)return`*${F}${_?" ":""}`;let V=C.anchors.getName(w)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${V} [${m}]`)}constructor(m){super(),this.source=m,this.type=u.Type.ALIAS}set tag(m){throw new Error("Alias nodes cannot have tags")}toJSON(m,w){if(!w)return v(this.source,m,w);let{anchors:x,maxAliasCount:C}=w,_=x.get(this.source);if(!_||_.res===void 0){let D="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new u.YAMLReferenceError(this.cstNode,D):new ReferenceError(D)}if(C>=0&&(_.count+=1,_.aliasCount===0&&(_.aliasCount=He(this.source,x)),_.count*_.aliasCount>C)){let D="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new u.YAMLReferenceError(this.cstNode,D):new ReferenceError(D)}return _.res}toString(m){return Cu.stringify(this,m)}};u._defineProperty(Ae,"default",!0);function Ce(b,m){let w=m instanceof A?m.value:m;for(let x of b)if(x instanceof ce&&(x.key===m||x.key===w||x.key&&x.key.value===w))return x}var Ge=class extends N{add(b,m){b?b instanceof ce||(b=new ce(b.key||b,b.value)):b=new ce(b);let w=Ce(this.items,b.key),x=this.schema&&this.schema.sortMapEntries;if(w)if(m)w.value=b.value;else throw new Error(`Key ${b.key} already set`);else if(x){let C=this.items.findIndex(_=>x(b,_)<0);C===-1?this.items.push(b):this.items.splice(C,0,b)}else this.items.push(b)}delete(b){let m=Ce(this.items,b);return m?this.items.splice(this.items.indexOf(m),1).length>0:!1}get(b,m){let w=Ce(this.items,b),x=w&&w.value;return!m&&x instanceof A?x.value:x}has(b){return!!Ce(this.items,b)}set(b,m){this.add(new ce(b,m),!0)}toJSON(b,m,w){let x=w?new w:m&&m.mapAsMap?new Map:{};m&&m.onCreate&&m.onCreate(x);for(let C of this.items)C.addToJSMap(m,x);return x}toString(b,m,w){if(!b)return JSON.stringify(this);for(let x of this.items)if(!(x instanceof ce))throw new Error(`Map items must all be pairs; found ${JSON.stringify(x)} instead`);return super.toString(b,{blockItem:x=>x.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:b.indent||""},m,w)}},Qe="<<",oe=class extends ce{constructor(b){if(b instanceof ce){let m=b.value;m instanceof j||(m=new j,m.items.push(b.value),m.range=b.value.range),super(b.key,m),this.range=b.range}else super(new A(Qe),new j);this.type=ce.Type.MERGE_PAIR}addToJSMap(b,m){for(let{source:w}of this.value.items){if(!(w instanceof Ge))throw new Error("Merge sources must be maps");let x=w.toJSON(null,b,Map);for(let[C,_]of x)m instanceof Map?m.has(C)||m.set(C,_):m instanceof Set?m.add(C):Object.prototype.hasOwnProperty.call(m,C)||Object.defineProperty(m,C,{value:_,writable:!0,enumerable:!0,configurable:!0})}return m}toString(b,m){let w=this.value;if(w.items.length>1)return super.toString(b,m);this.value=w.items[0];let x=super.toString(b,m);return this.value=w,x}},O={defaultType:u.Type.BLOCK_LITERAL,lineWidth:76},P={trueStr:"true",falseStr:"false"},z={asBigInt:!1},W={nullStr:"null"},X={defaultType:u.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function B(b,m,w){for(let{format:x,test:C,resolve:_}of m)if(C){let D=b.match(C);if(D){let F=_.apply(null,D);return F instanceof A||(F=new A(F)),x&&(F.format=x),F}}return w&&(b=w(b)),new A(b)}var Y="flow",G="block",pe="quoted",fe=(b,m)=>{let w=b[m+1];for(;w===" "||w===" ";){do w=b[m+=1];while(w&&w!==`
83
+ `);w=b[m+1]}return m};function Ee(b,m,w,{indentAtStart:x,lineWidth:C=80,minContentWidth:_=20,onFold:D,onOverflow:F}){if(!C||C<0)return b;let V=Math.max(1+_,1+C-m.length);if(b.length<=V)return b;let Q=[],de={},be=C-m.length;typeof x=="number"&&(x>C-Math.max(2,_)?Q.push(0):be=C-x);let nt,Ne,Ze=!1,Fe=-1,Ke=-1,gt=-1;w===G&&(Fe=fe(b,Fe),Fe!==-1&&(be=Fe+V));for(let ot;ot=b[Fe+=1];){if(w===pe&&ot==="\\"){switch(Ke=Fe,b[Fe+1]){case"x":Fe+=3;break;case"u":Fe+=5;break;case"U":Fe+=9;break;default:Fe+=1}gt=Fe}if(ot===`
84
+ `)w===G&&(Fe=fe(b,Fe)),be=Fe+V,nt=void 0;else{if(ot===" "&&Ne&&Ne!==" "&&Ne!==`
77
85
  `&&Ne!==" "){let Je=b[Fe+1];Je&&Je!==" "&&Je!==`
78
- `&&Je!==" "&&(nt=Fe)}if(Fe>=be)if(nt)X.push(nt),be=nt+H,nt=void 0;else if(w===pe){for(;Ne===" "||Ne===" ";)Ne=at,at=b[Fe+=1],Ze=!0;let Je=Fe>gt+1?Fe-2:Ke-1;if(de[Je])return b;X.push(Je),de[Je]=!0,be=Je+H,nt=void 0}else Ze=!0}Ne=at}if(Ze&&F&&F(),X.length===0)return b;D&&D();let Ve=b.slice(0,X[0]);for(let at=0;at<X.length;++at){let Je=X[at],Et=X[at+1]||b.length;Je===0?Ve=`
79
- ${m}${b.slice(0,Et)}`:(w===pe&&de[Je]&&(Ve+=`${b[Je]}\\`),Ve+=`
80
- ${m}${b.slice(Je+1,Et)}`)}return Ve}var it=({indentAtStart:b})=>b?Object.assign({indentAtStart:b},K.fold):K.fold,ot=b=>/^(%|---|\.\.\.)/m.test(b);function st(b,m,w){if(!m||m<0)return!1;let x=m-w,R=b.length;if(R<=x)return!1;for(let O=0,D=0;O<R;++O)if(b[O]===`
81
- `){if(O-D>x)return!0;if(D=O+1,R-D<=x)return!1}return!0}function mt(b,m){let{implicitKey:w}=m,{jsonEncoding:x,minMultiLineLength:R}=K.doubleQuoted,O=JSON.stringify(b);if(x)return O;let D=m.indent||(ot(b)?" ":""),F="",H=0;for(let X=0,de=O[X];de;de=O[++X])if(de===" "&&O[X+1]==="\\"&&O[X+2]==="n"&&(F+=O.slice(H,X)+"\\ ",X+=1,H=X,de="\\"),de==="\\")switch(O[X+1]){case"u":{F+=O.slice(H,X);let be=O.substr(X+2,4);switch(be){case"0000":F+="\\0";break;case"0007":F+="\\a";break;case"000b":F+="\\v";break;case"001b":F+="\\e";break;case"0085":F+="\\N";break;case"00a0":F+="\\_";break;case"2028":F+="\\L";break;case"2029":F+="\\P";break;default:be.substr(0,2)==="00"?F+="\\x"+be.substr(2):F+=O.substr(X,6)}X+=5,H=X+1}break;case"n":if(w||O[X+2]==='"'||O.length<R)X+=1;else{for(F+=O.slice(H,X)+`
86
+ `&&Je!==" "&&(nt=Fe)}if(Fe>=be)if(nt)Q.push(nt),be=nt+V,nt=void 0;else if(w===pe){for(;Ne===" "||Ne===" ";)Ne=ot,ot=b[Fe+=1],Ze=!0;let Je=Fe>gt+1?Fe-2:Ke-1;if(de[Je])return b;Q.push(Je),de[Je]=!0,be=Je+V,nt=void 0}else Ze=!0}Ne=ot}if(Ze&&F&&F(),Q.length===0)return b;D&&D();let ze=b.slice(0,Q[0]);for(let ot=0;ot<Q.length;++ot){let Je=Q[ot],Et=Q[ot+1]||b.length;Je===0?ze=`
87
+ ${m}${b.slice(0,Et)}`:(w===pe&&de[Je]&&(ze+=`${b[Je]}\\`),ze+=`
88
+ ${m}${b.slice(Je+1,Et)}`)}return ze}var it=({indentAtStart:b})=>b?Object.assign({indentAtStart:b},X.fold):X.fold,at=b=>/^(%|---|\.\.\.)/m.test(b);function st(b,m,w){if(!m||m<0)return!1;let x=m-w,C=b.length;if(C<=x)return!1;for(let _=0,D=0;_<C;++_)if(b[_]===`
89
+ `){if(_-D>x)return!0;if(D=_+1,C-D<=x)return!1}return!0}function mt(b,m){let{implicitKey:w}=m,{jsonEncoding:x,minMultiLineLength:C}=X.doubleQuoted,_=JSON.stringify(b);if(x)return _;let D=m.indent||(at(b)?" ":""),F="",V=0;for(let Q=0,de=_[Q];de;de=_[++Q])if(de===" "&&_[Q+1]==="\\"&&_[Q+2]==="n"&&(F+=_.slice(V,Q)+"\\ ",Q+=1,V=Q,de="\\"),de==="\\")switch(_[Q+1]){case"u":{F+=_.slice(V,Q);let be=_.substr(Q+2,4);switch(be){case"0000":F+="\\0";break;case"0007":F+="\\a";break;case"000b":F+="\\v";break;case"001b":F+="\\e";break;case"0085":F+="\\N";break;case"00a0":F+="\\_";break;case"2028":F+="\\L";break;case"2029":F+="\\P";break;default:be.substr(0,2)==="00"?F+="\\x"+be.substr(2):F+=_.substr(Q,6)}Q+=5,V=Q+1}break;case"n":if(w||_[Q+2]==='"'||_.length<C)Q+=1;else{for(F+=_.slice(V,Q)+`
82
90
 
83
- `;O[X+2]==="\\"&&O[X+3]==="n"&&O[X+4]!=='"';)F+=`
84
- `,X+=2;F+=D,O[X+2]===" "&&(F+="\\"),X+=1,H=X+1}break;default:X+=1}return F=H?F+O.slice(H):O,w?F:Ee(F,D,pe,it(m))}function Tt(b,m){if(m.implicitKey){if(/\n/.test(b))return mt(b,m)}else if(/[ \t]\n|\n[ \t]/.test(b))return mt(b,m);let w=m.indent||(ot(b)?" ":""),x="'"+b.replace(/'/g,"''").replace(/\n+/g,`$&
85
- ${w}`)+"'";return m.implicitKey?x:Ee(x,w,Y,it(m))}function se({comment:b,type:m,value:w},x,R,O){if(/\n[\t ]+$/.test(w)||/^\s*$/.test(w))return mt(w,x);let D=x.indent||(x.forceBlockIndent||ot(w)?" ":""),F=D?"2":"1",H=m===c.Type.BLOCK_FOLDED?!1:m===c.Type.BLOCK_LITERAL?!0:!st(w,K.fold.lineWidth,D.length),X=H?"|":">";if(!w)return X+`
91
+ `;_[Q+2]==="\\"&&_[Q+3]==="n"&&_[Q+4]!=='"';)F+=`
92
+ `,Q+=2;F+=D,_[Q+2]===" "&&(F+="\\"),Q+=1,V=Q+1}break;default:Q+=1}return F=V?F+_.slice(V):_,w?F:Ee(F,D,pe,it(m))}function Tt(b,m){if(m.implicitKey){if(/\n/.test(b))return mt(b,m)}else if(/[ \t]\n|\n[ \t]/.test(b))return mt(b,m);let w=m.indent||(at(b)?" ":""),x="'"+b.replace(/'/g,"''").replace(/\n+/g,`$&
93
+ ${w}`)+"'";return m.implicitKey?x:Ee(x,w,Y,it(m))}function se({comment:b,type:m,value:w},x,C,_){if(/\n[\t ]+$/.test(w)||/^\s*$/.test(w))return mt(w,x);let D=x.indent||(x.forceBlockIndent||at(w)?" ":""),F=D?"2":"1",V=m===u.Type.BLOCK_FOLDED?!1:m===u.Type.BLOCK_LITERAL?!0:!st(w,X.fold.lineWidth,D.length),Q=V?"|":">";if(!w)return Q+`
86
94
  `;let de="",be="";if(w=w.replace(/[\n\t ]*$/,Ne=>{let Ze=Ne.indexOf(`
87
- `);return Ze===-1?X+="-":(w===Ne||Ze!==Ne.length-1)&&(X+="+",O&&O()),be=Ne.replace(/\n$/,""),""}).replace(/^[\n ]*/,Ne=>{Ne.indexOf(" ")!==-1&&(X+=F);let Ze=Ne.match(/ +$/);return Ze?(de=Ne.slice(0,-Ze[0].length),Ze[0]):(de=Ne,"")}),be&&(be=be.replace(/\n+(?!\n|$)/g,`$&${D}`)),de&&(de=de.replace(/\n+/g,`$&${D}`)),b&&(X+=" #"+b.replace(/ ?[\r\n]+/g," "),R&&R()),!w)return`${X}${F}
88
- ${D}${be}`;if(H)return w=w.replace(/\n+/g,`$&${D}`),`${X}
95
+ `);return Ze===-1?Q+="-":(w===Ne||Ze!==Ne.length-1)&&(Q+="+",_&&_()),be=Ne.replace(/\n$/,""),""}).replace(/^[\n ]*/,Ne=>{Ne.indexOf(" ")!==-1&&(Q+=F);let Ze=Ne.match(/ +$/);return Ze?(de=Ne.slice(0,-Ze[0].length),Ze[0]):(de=Ne,"")}),be&&(be=be.replace(/\n+(?!\n|$)/g,`$&${D}`)),de&&(de=de.replace(/\n+/g,`$&${D}`)),b&&(Q+=" #"+b.replace(/ ?[\r\n]+/g," "),C&&C()),!w)return`${Q}${F}
96
+ ${D}${be}`;if(V)return w=w.replace(/\n+/g,`$&${D}`),`${Q}
89
97
  ${D}${de}${w}${be}`;w=w.replace(/\n+/g,`
90
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${D}`);let nt=Ee(`${de}${w}${be}`,D,G,K.fold);return`${X}
91
- ${D}${nt}`}function E(b,m,w,x){let{comment:R,type:O,value:D}=b,{actualString:F,implicitKey:H,indent:X,inFlow:de}=m;if(H&&/[\n[\]{},]/.test(D)||de&&/[[\]{},]/.test(D))return mt(D,m);if(!D||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(D))return H||de||D.indexOf(`
92
- `)===-1?D.indexOf('"')!==-1&&D.indexOf("'")===-1?Tt(D,m):mt(D,m):se(b,m,w,x);if(!H&&!de&&O!==c.Type.PLAIN&&D.indexOf(`
93
- `)!==-1)return se(b,m,w,x);if(X===""&&ot(D))return m.forceBlockIndent=!0,se(b,m,w,x);let be=D.replace(/\n+/g,`$&
94
- ${X}`);if(F){let{tags:Ne}=m.doc.schema;if(typeof z(be,Ne,Ne.scalarFallback).value!="string")return mt(D,m)}let nt=H?be:Ee(be,X,Y,it(m));return R&&!de&&(nt.indexOf(`
95
- `)!==-1||R.indexOf(`
96
- `)!==-1)?(w&&w(),f(nt,X,R)):nt}function J(b,m,w,x){let{defaultType:R}=K,{implicitKey:O,inFlow:D}=m,{type:F,value:H}=b;typeof H!="string"&&(H=String(H),b=Object.assign({},b,{value:H}));let X=be=>{switch(be){case c.Type.BLOCK_FOLDED:case c.Type.BLOCK_LITERAL:return se(b,m,w,x);case c.Type.QUOTE_DOUBLE:return mt(H,m);case c.Type.QUOTE_SINGLE:return Tt(H,m);case c.Type.PLAIN:return E(b,m,w,x);default:return null}};(F!==c.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(H)||(O||D)&&(F===c.Type.BLOCK_FOLDED||F===c.Type.BLOCK_LITERAL))&&(F=c.Type.QUOTE_DOUBLE);let de=X(F);if(de===null&&(de=X(R),de===null))throw new Error(`Unsupported default string type ${R}`);return de}function me({format:b,minFractionDigits:m,tag:w,value:x}){if(typeof x=="bigint")return String(x);if(!isFinite(x))return isNaN(x)?".nan":x<0?"-.inf":".inf";let R=JSON.stringify(x);if(!b&&m&&(!w||w==="tag:yaml.org,2002:float")&&/^\d/.test(R)){let O=R.indexOf(".");O<0&&(O=R.length,R+=".");let D=m-(R.length-O-1);for(;D-- >0;)R+="0"}return R}function ge(b,m){let w,x;switch(m.type){case c.Type.FLOW_MAP:w="}",x="flow map";break;case c.Type.FLOW_SEQ:w="]",x="flow sequence";break;default:b.push(new c.YAMLSemanticError(m,"Not a flow collection!?"));return}let R;for(let O=m.items.length-1;O>=0;--O){let D=m.items[O];if(!D||D.type!==c.Type.COMMENT){R=D;break}}if(R&&R.char!==w){let O=`Expected ${x} to end with ${w}`,D;typeof R.offset=="number"?(D=new c.YAMLSemanticError(m,O),D.offset=R.offset+1):(D=new c.YAMLSemanticError(R,O),R.range&&R.range.end&&(D.offset=R.range.end-R.range.start)),b.push(D)}}function Pe(b,m){let w=m.context.src[m.range.start-1];if(w!==`
97
- `&&w!==" "&&w!==" "){let x="Comments must be separated from other tokens by white space characters";b.push(new c.YAMLSemanticError(m,x))}}function qe(b,m){let w=String(m),x=w.substr(0,8)+"..."+w.substr(-8);return new c.YAMLSemanticError(b,`The "${x}" key is too long`)}function qt(b,m){for(let{afterKey:w,before:x,comment:R}of m){let O=b.items[x];O?(w&&O.value&&(O=O.value),R===void 0?(w||!O.commentBefore)&&(O.spaceBefore=!0):O.commentBefore?O.commentBefore+=`
98
- `+R:O.commentBefore=R):R!==void 0&&(b.comment?b.comment+=`
99
- `+R:b.comment=R)}}function ln(b,m){let w=m.strValue;return w?typeof w=="string"?w:(w.errors.forEach(x=>{x.source||(x.source=m),b.errors.push(x)}),w.str):""}function cn(b,m){let{handle:w,suffix:x}=m.tag,R=b.tagPrefixes.find(O=>O.handle===w);if(!R){let O=b.getDefaults().tagPrefixes;if(O&&(R=O.find(D=>D.handle===w)),!R)throw new c.YAMLSemanticError(m,`The ${w} tag handle is non-default and was not declared.`)}if(!x)throw new c.YAMLSemanticError(m,`The ${w} tag has no suffix.`);if(w==="!"&&(b.version||b.options.version)==="1.0"){if(x[0]==="^")return b.warnings.push(new c.YAMLWarning(m,"YAML 1.0 ^ tag expansion is not supported")),x;if(/[:/]/.test(x)){let O=x.match(/^([a-z0-9-]+)\/(.*)/i);return O?`tag:${O[1]}.yaml.org,2002:${O[2]}`:`tag:${x}`}}return R.prefix+decodeURIComponent(x)}function Xt(b,m){let{tag:w,type:x}=m,R=!1;if(w){let{handle:O,suffix:D,verbatim:F}=w;if(F){if(F!=="!"&&F!=="!!")return F;let H=`Verbatim tags aren't resolved, so ${F} is invalid.`;b.errors.push(new c.YAMLSemanticError(m,H))}else if(O==="!"&&!D)R=!0;else try{return cn(b,m)}catch(H){b.errors.push(H)}}switch(x){case c.Type.BLOCK_FOLDED:case c.Type.BLOCK_LITERAL:case c.Type.QUOTE_DOUBLE:case c.Type.QUOTE_SINGLE:return c.defaultTags.STR;case c.Type.FLOW_MAP:case c.Type.MAP:return c.defaultTags.MAP;case c.Type.FLOW_SEQ:case c.Type.SEQ:return c.defaultTags.SEQ;case c.Type.PLAIN:return R?c.defaultTags.STR:null;default:return null}}function Sr(b,m,w){let{tags:x}=b.schema,R=[];for(let D of x)if(D.tag===w)if(D.test)R.push(D);else{let F=D.resolve(b,m);return F instanceof N?F:new k(F)}let O=ln(b,m);return typeof O=="string"&&R.length>0?z(O,R,x.scalarFallback):null}function bi({type:b}){switch(b){case c.Type.FLOW_MAP:case c.Type.MAP:return c.defaultTags.MAP;case c.Type.FLOW_SEQ:case c.Type.SEQ:return c.defaultTags.SEQ;default:return c.defaultTags.STR}}function Sg(b,m,w){try{let x=Sr(b,m,w);if(x)return w&&m.tag&&(x.tag=w),x}catch(x){return x.source||(x.source=m),b.errors.push(x),null}try{let x=bi(m);if(!x)throw new Error(`The tag ${w} is unavailable`);let R=`The tag ${w} is unavailable, falling back to ${x}`;b.warnings.push(new c.YAMLWarning(m,R));let O=Sr(b,m,x);return O.tag=w,O}catch(x){let R=new c.YAMLReferenceError(m,x.message);return R.stack=x.stack,b.errors.push(R),null}}var Tg=b=>{if(!b)return!1;let{type:m}=b;return m===c.Type.MAP_KEY||m===c.Type.MAP_VALUE||m===c.Type.SEQ_ITEM};function xg(b,m){let w={before:[],after:[]},x=!1,R=!1,O=Tg(m.context.parent)?m.context.parent.props.concat(m.props):m.props;for(let{start:D,end:F}of O)switch(m.context.src[D]){case c.Char.COMMENT:{if(!m.commentHasRequiredWhitespace(D)){let be="Comments must be separated from other tokens by white space characters";b.push(new c.YAMLSemanticError(m,be))}let{header:H,valueRange:X}=m;(X&&(D>X.start||H&&D>H.start)?w.after:w.before).push(m.context.src.slice(D+1,F));break}case c.Char.ANCHOR:if(x){let H="A node can have at most one anchor";b.push(new c.YAMLSemanticError(m,H))}x=!0;break;case c.Char.TAG:if(R){let H="A node can have at most one tag";b.push(new c.YAMLSemanticError(m,H))}R=!0;break}return{comments:w,hasAnchor:x,hasTag:R}}function kg(b,m){let{anchors:w,errors:x,schema:R}=b;if(m.type===c.Type.ALIAS){let D=m.rawValue,F=w.getNode(D);if(!F){let X=`Aliased anchor not found: ${D}`;return x.push(new c.YAMLReferenceError(m,X)),null}let H=new xe(F);return w._cstAliases.push(H),H}let O=Xt(b,m);if(O)return Sg(b,m,O);if(m.type!==c.Type.PLAIN){let D=`Failed to resolve ${m.type} node here`;return x.push(new c.YAMLSyntaxError(m,D)),null}try{let D=ln(b,m);return z(D,R.tags,R.tags.scalarFallback)}catch(D){return D.source||(D.source=m),x.push(D),null}}function Sn(b,m){if(!m)return null;m.error&&b.errors.push(m.error);let{comments:w,hasAnchor:x,hasTag:R}=xg(b.errors,m);if(x){let{anchors:D}=b,F=m.anchor,H=D.getNode(F);H&&(D.map[D.newName(F)]=H),D.map[F]=m}if(m.type===c.Type.ALIAS&&(x||R)){let D="An alias node must not specify any properties";b.errors.push(new c.YAMLSemanticError(m,D))}let O=kg(b,m);if(O){O.range=[m.range.start,m.range.end],b.options.keepCstNodes&&(O.cstNode=m),b.options.keepNodeTypes&&(O.type=m.type);let D=w.before.join(`
100
- `);D&&(O.commentBefore=O.commentBefore?`${O.commentBefore}
98
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${D}`);let nt=Ee(`${de}${w}${be}`,D,G,X.fold);return`${Q}
99
+ ${D}${nt}`}function E(b,m,w,x){let{comment:C,type:_,value:D}=b,{actualString:F,implicitKey:V,indent:Q,inFlow:de}=m;if(V&&/[\n[\]{},]/.test(D)||de&&/[[\]{},]/.test(D))return mt(D,m);if(!D||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(D))return V||de||D.indexOf(`
100
+ `)===-1?D.indexOf('"')!==-1&&D.indexOf("'")===-1?Tt(D,m):mt(D,m):se(b,m,w,x);if(!V&&!de&&_!==u.Type.PLAIN&&D.indexOf(`
101
+ `)!==-1)return se(b,m,w,x);if(Q===""&&at(D))return m.forceBlockIndent=!0,se(b,m,w,x);let be=D.replace(/\n+/g,`$&
102
+ ${Q}`);if(F){let{tags:Ne}=m.doc.schema;if(typeof B(be,Ne,Ne.scalarFallback).value!="string")return mt(D,m)}let nt=V?be:Ee(be,Q,Y,it(m));return C&&!de&&(nt.indexOf(`
103
+ `)!==-1||C.indexOf(`
104
+ `)!==-1)?(w&&w(),f(nt,Q,C)):nt}function J(b,m,w,x){let{defaultType:C}=X,{implicitKey:_,inFlow:D}=m,{type:F,value:V}=b;typeof V!="string"&&(V=String(V),b=Object.assign({},b,{value:V}));let Q=be=>{switch(be){case u.Type.BLOCK_FOLDED:case u.Type.BLOCK_LITERAL:return se(b,m,w,x);case u.Type.QUOTE_DOUBLE:return mt(V,m);case u.Type.QUOTE_SINGLE:return Tt(V,m);case u.Type.PLAIN:return E(b,m,w,x);default:return null}};(F!==u.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(V)||(_||D)&&(F===u.Type.BLOCK_FOLDED||F===u.Type.BLOCK_LITERAL))&&(F=u.Type.QUOTE_DOUBLE);let de=Q(F);if(de===null&&(de=Q(C),de===null))throw new Error(`Unsupported default string type ${C}`);return de}function me({format:b,minFractionDigits:m,tag:w,value:x}){if(typeof x=="bigint")return String(x);if(!isFinite(x))return isNaN(x)?".nan":x<0?"-.inf":".inf";let C=JSON.stringify(x);if(!b&&m&&(!w||w==="tag:yaml.org,2002:float")&&/^\d/.test(C)){let _=C.indexOf(".");_<0&&(_=C.length,C+=".");let D=m-(C.length-_-1);for(;D-- >0;)C+="0"}return C}function ge(b,m){let w,x;switch(m.type){case u.Type.FLOW_MAP:w="}",x="flow map";break;case u.Type.FLOW_SEQ:w="]",x="flow sequence";break;default:b.push(new u.YAMLSemanticError(m,"Not a flow collection!?"));return}let C;for(let _=m.items.length-1;_>=0;--_){let D=m.items[_];if(!D||D.type!==u.Type.COMMENT){C=D;break}}if(C&&C.char!==w){let _=`Expected ${x} to end with ${w}`,D;typeof C.offset=="number"?(D=new u.YAMLSemanticError(m,_),D.offset=C.offset+1):(D=new u.YAMLSemanticError(C,_),C.range&&C.range.end&&(D.offset=C.range.end-C.range.start)),b.push(D)}}function Pe(b,m){let w=m.context.src[m.range.start-1];if(w!==`
105
+ `&&w!==" "&&w!==" "){let x="Comments must be separated from other tokens by white space characters";b.push(new u.YAMLSemanticError(m,x))}}function $e(b,m){let w=String(m),x=w.substr(0,8)+"..."+w.substr(-8);return new u.YAMLSemanticError(b,`The "${x}" key is too long`)}function jt(b,m){for(let{afterKey:w,before:x,comment:C}of m){let _=b.items[x];_?(w&&_.value&&(_=_.value),C===void 0?(w||!_.commentBefore)&&(_.spaceBefore=!0):_.commentBefore?_.commentBefore+=`
106
+ `+C:_.commentBefore=C):C!==void 0&&(b.comment?b.comment+=`
107
+ `+C:b.comment=C)}}function dn(b,m){let w=m.strValue;return w?typeof w=="string"?w:(w.errors.forEach(x=>{x.source||(x.source=m),b.errors.push(x)}),w.str):""}function hn(b,m){let{handle:w,suffix:x}=m.tag,C=b.tagPrefixes.find(_=>_.handle===w);if(!C){let _=b.getDefaults().tagPrefixes;if(_&&(C=_.find(D=>D.handle===w)),!C)throw new u.YAMLSemanticError(m,`The ${w} tag handle is non-default and was not declared.`)}if(!x)throw new u.YAMLSemanticError(m,`The ${w} tag has no suffix.`);if(w==="!"&&(b.version||b.options.version)==="1.0"){if(x[0]==="^")return b.warnings.push(new u.YAMLWarning(m,"YAML 1.0 ^ tag expansion is not supported")),x;if(/[:/]/.test(x)){let _=x.match(/^([a-z0-9-]+)\/(.*)/i);return _?`tag:${_[1]}.yaml.org,2002:${_[2]}`:`tag:${x}`}}return C.prefix+decodeURIComponent(x)}function Kt(b,m){let{tag:w,type:x}=m,C=!1;if(w){let{handle:_,suffix:D,verbatim:F}=w;if(F){if(F!=="!"&&F!=="!!")return F;let V=`Verbatim tags aren't resolved, so ${F} is invalid.`;b.errors.push(new u.YAMLSemanticError(m,V))}else if(_==="!"&&!D)C=!0;else try{return hn(b,m)}catch(V){b.errors.push(V)}}switch(x){case u.Type.BLOCK_FOLDED:case u.Type.BLOCK_LITERAL:case u.Type.QUOTE_DOUBLE:case u.Type.QUOTE_SINGLE:return u.defaultTags.STR;case u.Type.FLOW_MAP:case u.Type.MAP:return u.defaultTags.MAP;case u.Type.FLOW_SEQ:case u.Type.SEQ:return u.defaultTags.SEQ;case u.Type.PLAIN:return C?u.defaultTags.STR:null;default:return null}}function kr(b,m,w){let{tags:x}=b.schema,C=[];for(let D of x)if(D.tag===w)if(D.test)C.push(D);else{let F=D.resolve(b,m);return F instanceof N?F:new A(F)}let _=dn(b,m);return typeof _=="string"&&C.length>0?B(_,C,x.scalarFallback):null}function Ui({type:b}){switch(b){case u.Type.FLOW_MAP:case u.Type.MAP:return u.defaultTags.MAP;case u.Type.FLOW_SEQ:case u.Type.SEQ:return u.defaultTags.SEQ;default:return u.defaultTags.STR}}function ny(b,m,w){try{let x=kr(b,m,w);if(x)return w&&m.tag&&(x.tag=w),x}catch(x){return x.source||(x.source=m),b.errors.push(x),null}try{let x=Ui(m);if(!x)throw new Error(`The tag ${w} is unavailable`);let C=`The tag ${w} is unavailable, falling back to ${x}`;b.warnings.push(new u.YAMLWarning(m,C));let _=kr(b,m,x);return _.tag=w,_}catch(x){let C=new u.YAMLReferenceError(m,x.message);return C.stack=x.stack,b.errors.push(C),null}}var ry=b=>{if(!b)return!1;let{type:m}=b;return m===u.Type.MAP_KEY||m===u.Type.MAP_VALUE||m===u.Type.SEQ_ITEM};function iy(b,m){let w={before:[],after:[]},x=!1,C=!1,_=ry(m.context.parent)?m.context.parent.props.concat(m.props):m.props;for(let{start:D,end:F}of _)switch(m.context.src[D]){case u.Char.COMMENT:{if(!m.commentHasRequiredWhitespace(D)){let be="Comments must be separated from other tokens by white space characters";b.push(new u.YAMLSemanticError(m,be))}let{header:V,valueRange:Q}=m;(Q&&(D>Q.start||V&&D>V.start)?w.after:w.before).push(m.context.src.slice(D+1,F));break}case u.Char.ANCHOR:if(x){let V="A node can have at most one anchor";b.push(new u.YAMLSemanticError(m,V))}x=!0;break;case u.Char.TAG:if(C){let V="A node can have at most one tag";b.push(new u.YAMLSemanticError(m,V))}C=!0;break}return{comments:w,hasAnchor:x,hasTag:C}}function ay(b,m){let{anchors:w,errors:x,schema:C}=b;if(m.type===u.Type.ALIAS){let D=m.rawValue,F=w.getNode(D);if(!F){let Q=`Aliased anchor not found: ${D}`;return x.push(new u.YAMLReferenceError(m,Q)),null}let V=new Ae(F);return w._cstAliases.push(V),V}let _=Kt(b,m);if(_)return ny(b,m,_);if(m.type!==u.Type.PLAIN){let D=`Failed to resolve ${m.type} node here`;return x.push(new u.YAMLSyntaxError(m,D)),null}try{let D=dn(b,m);return B(D,C.tags,C.tags.scalarFallback)}catch(D){return D.source||(D.source=m),x.push(D),null}}function Sn(b,m){if(!m)return null;m.error&&b.errors.push(m.error);let{comments:w,hasAnchor:x,hasTag:C}=iy(b.errors,m);if(x){let{anchors:D}=b,F=m.anchor,V=D.getNode(F);V&&(D.map[D.newName(F)]=V),D.map[F]=m}if(m.type===u.Type.ALIAS&&(x||C)){let D="An alias node must not specify any properties";b.errors.push(new u.YAMLSemanticError(m,D))}let _=ay(b,m);if(_){_.range=[m.range.start,m.range.end],b.options.keepCstNodes&&(_.cstNode=m),b.options.keepNodeTypes&&(_.type=m.type);let D=w.before.join(`
108
+ `);D&&(_.commentBefore=_.commentBefore?`${_.commentBefore}
101
109
  ${D}`:D);let F=w.after.join(`
102
- `);F&&(O.comment=O.comment?`${O.comment}
103
- ${F}`:F)}return m.resolved=O}function vg(b,m){if(m.type!==c.Type.MAP&&m.type!==c.Type.FLOW_MAP){let D=`A ${m.type} node cannot be resolved as a mapping`;return b.errors.push(new c.YAMLSyntaxError(m,D)),null}let{comments:w,items:x}=m.type===c.Type.FLOW_MAP?Rg(b,m):_g(b,m),R=new Ge;R.items=x,qt(R,w);let O=!1;for(let D=0;D<x.length;++D){let{key:F}=x[D];if(F instanceof N&&(O=!0),b.schema.merge&&F&&F.value===Qe){x[D]=new ae(x[D]);let H=x[D].value.items,X=null;H.some(de=>{if(de instanceof xe){let{type:be}=de.source;return be===c.Type.MAP||be===c.Type.FLOW_MAP?!1:X="Merge nodes aliases can only point to maps"}return X="Merge nodes can only have Alias nodes as values"}),X&&b.errors.push(new c.YAMLSemanticError(m,X))}else for(let H=D+1;H<x.length;++H){let{key:X}=x[H];if(F===X||F&&X&&Object.prototype.hasOwnProperty.call(F,"value")&&F.value===X.value){let de=`Map keys must be unique; "${F}" is repeated`;b.errors.push(new c.YAMLSemanticError(m,de));break}}}if(O&&!b.options.mapAsMap){let D="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";b.warnings.push(new c.YAMLWarning(m,D))}return m.resolved=R,R}var Ag=({context:{lineStart:b,node:m,src:w},props:x})=>{if(x.length===0)return!1;let{start:R}=x[0];if(m&&R>m.valueRange.start||w[R]!==c.Char.COMMENT)return!1;for(let O=b;O<R;++O)if(w[O]===`
104
- `)return!1;return!0};function Eg(b,m){if(!Ag(b))return;let w=b.getPropValue(0,c.Char.COMMENT,!0),x=!1,R=m.value.commentBefore;if(R&&R.startsWith(w))m.value.commentBefore=R.substr(w.length+1),x=!0;else{let O=m.value.comment;!b.node&&O&&O.startsWith(w)&&(m.value.comment=O.substr(w.length+1),x=!0)}x&&(m.comment=w)}function _g(b,m){let w=[],x=[],R,O=null;for(let D=0;D<m.items.length;++D){let F=m.items[D];switch(F.type){case c.Type.BLANK_LINE:w.push({afterKey:!!R,before:x.length});break;case c.Type.COMMENT:w.push({afterKey:!!R,before:x.length,comment:F.comment});break;case c.Type.MAP_KEY:R!==void 0&&x.push(new ce(R)),F.error&&b.errors.push(F.error),R=Sn(b,F.node),O=null;break;case c.Type.MAP_VALUE:{if(R===void 0&&(R=null),F.error&&b.errors.push(F.error),!F.context.atLineStart&&F.node&&F.node.type===c.Type.MAP&&!F.node.context.atLineStart){let de="Nested mappings are not allowed in compact mappings";b.errors.push(new c.YAMLSemanticError(F.node,de))}let H=F.node;if(!H&&F.props.length>0){H=new c.PlainValue(c.Type.PLAIN,[]),H.context={parent:F,src:F.context.src};let de=F.range.start+1;if(H.range={start:de,end:de},H.valueRange={start:de,end:de},typeof F.range.origStart=="number"){let be=F.range.origStart+1;H.range.origStart=H.range.origEnd=be,H.valueRange.origStart=H.valueRange.origEnd=be}}let X=new ce(R,Sn(b,H));Eg(F,X),x.push(X),R&&typeof O=="number"&&F.range.start>O+1024&&b.errors.push(qe(m,R)),R=void 0,O=null}break;default:R!==void 0&&x.push(new ce(R)),R=Sn(b,F),O=F.range.start,F.error&&b.errors.push(F.error);e:for(let H=D+1;;++H){let X=m.items[H];switch(X&&X.type){case c.Type.BLANK_LINE:case c.Type.COMMENT:continue e;case c.Type.MAP_VALUE:break e;default:{let de="Implicit map keys need to be followed by map values";b.errors.push(new c.YAMLSemanticError(F,de));break e}}}if(F.valueRangeContainsNewline){let H="Implicit map keys need to be on a single line";b.errors.push(new c.YAMLSemanticError(F,H))}}}return R!==void 0&&x.push(new ce(R)),{comments:w,items:x}}function Rg(b,m){let w=[],x=[],R,O=!1,D="{";for(let F=0;F<m.items.length;++F){let H=m.items[F];if(typeof H.char=="string"){let{char:X,offset:de}=H;if(X==="?"&&R===void 0&&!O){O=!0,D=":";continue}if(X===":"){if(R===void 0&&(R=null),D===":"){D=",";continue}}else if(O&&(R===void 0&&X!==","&&(R=null),O=!1),R!==void 0&&(x.push(new ce(R)),R=void 0,X===",")){D=":";continue}if(X==="}"){if(F===m.items.length-1)continue}else if(X===D){D=":";continue}let be=`Flow map contains an unexpected ${X}`,nt=new c.YAMLSyntaxError(m,be);nt.offset=de,b.errors.push(nt)}else H.type===c.Type.BLANK_LINE?w.push({afterKey:!!R,before:x.length}):H.type===c.Type.COMMENT?(Pe(b.errors,H),w.push({afterKey:!!R,before:x.length,comment:H.comment})):R===void 0?(D===","&&b.errors.push(new c.YAMLSemanticError(H,"Separator , missing in flow map")),R=Sn(b,H)):(D!==","&&b.errors.push(new c.YAMLSemanticError(H,"Indicator : missing in flow map entry")),x.push(new ce(R,Sn(b,H))),R=void 0,O=!1)}return ge(b.errors,m),R!==void 0&&x.push(new ce(R)),{comments:w,items:x}}function Og(b,m){if(m.type!==c.Type.SEQ&&m.type!==c.Type.FLOW_SEQ){let O=`A ${m.type} node cannot be resolved as a sequence`;return b.errors.push(new c.YAMLSyntaxError(m,O)),null}let{comments:w,items:x}=m.type===c.Type.FLOW_SEQ?Ig(b,m):Cg(b,m),R=new j;if(R.items=x,qt(R,w),!b.options.mapAsMap&&x.some(O=>O instanceof ce&&O.key instanceof N)){let O="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";b.warnings.push(new c.YAMLWarning(m,O))}return m.resolved=R,R}function Cg(b,m){let w=[],x=[];for(let R=0;R<m.items.length;++R){let O=m.items[R];switch(O.type){case c.Type.BLANK_LINE:w.push({before:x.length});break;case c.Type.COMMENT:w.push({comment:O.comment,before:x.length});break;case c.Type.SEQ_ITEM:if(O.error&&b.errors.push(O.error),x.push(Sn(b,O.node)),O.hasProps){let D="Sequence items cannot have tags or anchors before the - indicator";b.errors.push(new c.YAMLSemanticError(O,D))}break;default:O.error&&b.errors.push(O.error),b.errors.push(new c.YAMLSyntaxError(O,`Unexpected ${O.type} node in sequence`))}}return{comments:w,items:x}}function Ig(b,m){let w=[],x=[],R=!1,O,D=null,F="[",H=null;for(let X=0;X<m.items.length;++X){let de=m.items[X];if(typeof de.char=="string"){let{char:be,offset:nt}=de;if(be!==":"&&(R||O!==void 0)&&(R&&O===void 0&&(O=F?x.pop():null),x.push(new ce(O)),R=!1,O=void 0,D=null),be===F)F=null;else if(!F&&be==="?")R=!0;else if(F!=="["&&be===":"&&O===void 0){if(F===","){if(O=x.pop(),O instanceof ce){let Ne="Chaining flow sequence pairs is invalid",Ze=new c.YAMLSemanticError(m,Ne);Ze.offset=nt,b.errors.push(Ze)}if(!R&&typeof D=="number"){let Ne=de.range?de.range.start:de.offset;Ne>D+1024&&b.errors.push(qe(m,O));let{src:Ze}=H.context;for(let Fe=D;Fe<Ne;++Fe)if(Ze[Fe]===`
105
- `){let Ke="Implicit keys of flow sequence pairs need to be on a single line";b.errors.push(new c.YAMLSemanticError(H,Ke));break}}}else O=null;D=null,R=!1,F=null}else if(F==="["||be!=="]"||X<m.items.length-1){let Ne=`Flow sequence contains an unexpected ${be}`,Ze=new c.YAMLSyntaxError(m,Ne);Ze.offset=nt,b.errors.push(Ze)}}else if(de.type===c.Type.BLANK_LINE)w.push({before:x.length});else if(de.type===c.Type.COMMENT)Pe(b.errors,de),w.push({comment:de.comment,before:x.length});else{if(F){let nt=`Expected a ${F} in flow sequence`;b.errors.push(new c.YAMLSemanticError(de,nt))}let be=Sn(b,de);O===void 0?(x.push(be),H=de):(x.push(new ce(O,be)),O=void 0),D=de.range.start,F=","}}return ge(b.errors,m),O!==void 0&&x.push(new ce(O)),{comments:w,items:x}}l.Alias=xe,l.Collection=N,l.Merge=ae,l.Node=T,l.Pair=ce,l.Scalar=k,l.YAMLMap=Ge,l.YAMLSeq=j,l.addComment=S,l.binaryOptions=C,l.boolOptions=I,l.findPair=Re,l.intOptions=V,l.isEmptyPath=Q,l.nullOptions=W,l.resolveMap=vg,l.resolveNode=Sn,l.resolveSeq=Og,l.resolveString=ln,l.strOptions=K,l.stringifyNumber=me,l.stringifyString=J,l.toJSON=v}}),Ea=Lt({"node_modules/yaml/dist/warnings-1000a372.js"(l){var c=mr(),f=pi(),S={identify:z=>z instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(z,Y)=>{let G=f.resolveString(z,Y);if(typeof Buffer=="function")return Buffer.from(G,"base64");if(typeof atob=="function"){let pe=atob(G.replace(/[\n\r]/g,"")),fe=new Uint8Array(pe.length);for(let Ee=0;Ee<pe.length;++Ee)fe[Ee]=pe.charCodeAt(Ee);return fe}else{let pe="This environment does not support reading binary tags; either Buffer or atob is required";return z.errors.push(new c.YAMLReferenceError(Y,pe)),null}},options:f.binaryOptions,stringify:({comment:z,type:Y,value:G},pe,fe,Ee)=>{let it;if(typeof Buffer=="function")it=G instanceof Buffer?G.toString("base64"):Buffer.from(G.buffer).toString("base64");else if(typeof btoa=="function"){let ot="";for(let st=0;st<G.length;++st)ot+=String.fromCharCode(G[st]);it=btoa(ot)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Y||(Y=f.binaryOptions.defaultType),Y===c.Type.QUOTE_DOUBLE)G=it;else{let{lineWidth:ot}=f.binaryOptions,st=Math.ceil(it.length/ot),mt=new Array(st);for(let Tt=0,se=0;Tt<st;++Tt,se+=ot)mt[Tt]=it.substr(se,ot);G=mt.join(Y===c.Type.BLOCK_LITERAL?`
106
- `:" ")}return f.stringifyString({comment:z,type:Y,value:G},pe,fe,Ee)}};function T(z,Y){let G=f.resolveSeq(z,Y);for(let pe=0;pe<G.items.length;++pe){let fe=G.items[pe];if(!(fe instanceof f.Pair)){if(fe instanceof f.YAMLMap){if(fe.items.length>1){let it="Each pair must have its own sequence indicator";throw new c.YAMLSemanticError(Y,it)}let Ee=fe.items[0]||new f.Pair;fe.commentBefore&&(Ee.commentBefore=Ee.commentBefore?`${fe.commentBefore}
110
+ `);F&&(_.comment=_.comment?`${_.comment}
111
+ ${F}`:F)}return m.resolved=_}function oy(b,m){if(m.type!==u.Type.MAP&&m.type!==u.Type.FLOW_MAP){let D=`A ${m.type} node cannot be resolved as a mapping`;return b.errors.push(new u.YAMLSyntaxError(m,D)),null}let{comments:w,items:x}=m.type===u.Type.FLOW_MAP?uy(b,m):cy(b,m),C=new Ge;C.items=x,jt(C,w);let _=!1;for(let D=0;D<x.length;++D){let{key:F}=x[D];if(F instanceof N&&(_=!0),b.schema.merge&&F&&F.value===Qe){x[D]=new oe(x[D]);let V=x[D].value.items,Q=null;V.some(de=>{if(de instanceof Ae){let{type:be}=de.source;return be===u.Type.MAP||be===u.Type.FLOW_MAP?!1:Q="Merge nodes aliases can only point to maps"}return Q="Merge nodes can only have Alias nodes as values"}),Q&&b.errors.push(new u.YAMLSemanticError(m,Q))}else for(let V=D+1;V<x.length;++V){let{key:Q}=x[V];if(F===Q||F&&Q&&Object.prototype.hasOwnProperty.call(F,"value")&&F.value===Q.value){let de=`Map keys must be unique; "${F}" is repeated`;b.errors.push(new u.YAMLSemanticError(m,de));break}}}if(_&&!b.options.mapAsMap){let D="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";b.warnings.push(new u.YAMLWarning(m,D))}return m.resolved=C,C}var sy=({context:{lineStart:b,node:m,src:w},props:x})=>{if(x.length===0)return!1;let{start:C}=x[0];if(m&&C>m.valueRange.start||w[C]!==u.Char.COMMENT)return!1;for(let _=b;_<C;++_)if(w[_]===`
112
+ `)return!1;return!0};function ly(b,m){if(!sy(b))return;let w=b.getPropValue(0,u.Char.COMMENT,!0),x=!1,C=m.value.commentBefore;if(C&&C.startsWith(w))m.value.commentBefore=C.substr(w.length+1),x=!0;else{let _=m.value.comment;!b.node&&_&&_.startsWith(w)&&(m.value.comment=_.substr(w.length+1),x=!0)}x&&(m.comment=w)}function cy(b,m){let w=[],x=[],C,_=null;for(let D=0;D<m.items.length;++D){let F=m.items[D];switch(F.type){case u.Type.BLANK_LINE:w.push({afterKey:!!C,before:x.length});break;case u.Type.COMMENT:w.push({afterKey:!!C,before:x.length,comment:F.comment});break;case u.Type.MAP_KEY:C!==void 0&&x.push(new ce(C)),F.error&&b.errors.push(F.error),C=Sn(b,F.node),_=null;break;case u.Type.MAP_VALUE:{if(C===void 0&&(C=null),F.error&&b.errors.push(F.error),!F.context.atLineStart&&F.node&&F.node.type===u.Type.MAP&&!F.node.context.atLineStart){let de="Nested mappings are not allowed in compact mappings";b.errors.push(new u.YAMLSemanticError(F.node,de))}let V=F.node;if(!V&&F.props.length>0){V=new u.PlainValue(u.Type.PLAIN,[]),V.context={parent:F,src:F.context.src};let de=F.range.start+1;if(V.range={start:de,end:de},V.valueRange={start:de,end:de},typeof F.range.origStart=="number"){let be=F.range.origStart+1;V.range.origStart=V.range.origEnd=be,V.valueRange.origStart=V.valueRange.origEnd=be}}let Q=new ce(C,Sn(b,V));ly(F,Q),x.push(Q),C&&typeof _=="number"&&F.range.start>_+1024&&b.errors.push($e(m,C)),C=void 0,_=null}break;default:C!==void 0&&x.push(new ce(C)),C=Sn(b,F),_=F.range.start,F.error&&b.errors.push(F.error);e:for(let V=D+1;;++V){let Q=m.items[V];switch(Q&&Q.type){case u.Type.BLANK_LINE:case u.Type.COMMENT:continue e;case u.Type.MAP_VALUE:break e;default:{let de="Implicit map keys need to be followed by map values";b.errors.push(new u.YAMLSemanticError(F,de));break e}}}if(F.valueRangeContainsNewline){let V="Implicit map keys need to be on a single line";b.errors.push(new u.YAMLSemanticError(F,V))}}}return C!==void 0&&x.push(new ce(C)),{comments:w,items:x}}function uy(b,m){let w=[],x=[],C,_=!1,D="{";for(let F=0;F<m.items.length;++F){let V=m.items[F];if(typeof V.char=="string"){let{char:Q,offset:de}=V;if(Q==="?"&&C===void 0&&!_){_=!0,D=":";continue}if(Q===":"){if(C===void 0&&(C=null),D===":"){D=",";continue}}else if(_&&(C===void 0&&Q!==","&&(C=null),_=!1),C!==void 0&&(x.push(new ce(C)),C=void 0,Q===",")){D=":";continue}if(Q==="}"){if(F===m.items.length-1)continue}else if(Q===D){D=":";continue}let be=`Flow map contains an unexpected ${Q}`,nt=new u.YAMLSyntaxError(m,be);nt.offset=de,b.errors.push(nt)}else V.type===u.Type.BLANK_LINE?w.push({afterKey:!!C,before:x.length}):V.type===u.Type.COMMENT?(Pe(b.errors,V),w.push({afterKey:!!C,before:x.length,comment:V.comment})):C===void 0?(D===","&&b.errors.push(new u.YAMLSemanticError(V,"Separator , missing in flow map")),C=Sn(b,V)):(D!==","&&b.errors.push(new u.YAMLSemanticError(V,"Indicator : missing in flow map entry")),x.push(new ce(C,Sn(b,V))),C=void 0,_=!1)}return ge(b.errors,m),C!==void 0&&x.push(new ce(C)),{comments:w,items:x}}function py(b,m){if(m.type!==u.Type.SEQ&&m.type!==u.Type.FLOW_SEQ){let _=`A ${m.type} node cannot be resolved as a sequence`;return b.errors.push(new u.YAMLSyntaxError(m,_)),null}let{comments:w,items:x}=m.type===u.Type.FLOW_SEQ?hy(b,m):dy(b,m),C=new j;if(C.items=x,jt(C,w),!b.options.mapAsMap&&x.some(_=>_ instanceof ce&&_.key instanceof N)){let _="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";b.warnings.push(new u.YAMLWarning(m,_))}return m.resolved=C,C}function dy(b,m){let w=[],x=[];for(let C=0;C<m.items.length;++C){let _=m.items[C];switch(_.type){case u.Type.BLANK_LINE:w.push({before:x.length});break;case u.Type.COMMENT:w.push({comment:_.comment,before:x.length});break;case u.Type.SEQ_ITEM:if(_.error&&b.errors.push(_.error),x.push(Sn(b,_.node)),_.hasProps){let D="Sequence items cannot have tags or anchors before the - indicator";b.errors.push(new u.YAMLSemanticError(_,D))}break;default:_.error&&b.errors.push(_.error),b.errors.push(new u.YAMLSyntaxError(_,`Unexpected ${_.type} node in sequence`))}}return{comments:w,items:x}}function hy(b,m){let w=[],x=[],C=!1,_,D=null,F="[",V=null;for(let Q=0;Q<m.items.length;++Q){let de=m.items[Q];if(typeof de.char=="string"){let{char:be,offset:nt}=de;if(be!==":"&&(C||_!==void 0)&&(C&&_===void 0&&(_=F?x.pop():null),x.push(new ce(_)),C=!1,_=void 0,D=null),be===F)F=null;else if(!F&&be==="?")C=!0;else if(F!=="["&&be===":"&&_===void 0){if(F===","){if(_=x.pop(),_ instanceof ce){let Ne="Chaining flow sequence pairs is invalid",Ze=new u.YAMLSemanticError(m,Ne);Ze.offset=nt,b.errors.push(Ze)}if(!C&&typeof D=="number"){let Ne=de.range?de.range.start:de.offset;Ne>D+1024&&b.errors.push($e(m,_));let{src:Ze}=V.context;for(let Fe=D;Fe<Ne;++Fe)if(Ze[Fe]===`
113
+ `){let Ke="Implicit keys of flow sequence pairs need to be on a single line";b.errors.push(new u.YAMLSemanticError(V,Ke));break}}}else _=null;D=null,C=!1,F=null}else if(F==="["||be!=="]"||Q<m.items.length-1){let Ne=`Flow sequence contains an unexpected ${be}`,Ze=new u.YAMLSyntaxError(m,Ne);Ze.offset=nt,b.errors.push(Ze)}}else if(de.type===u.Type.BLANK_LINE)w.push({before:x.length});else if(de.type===u.Type.COMMENT)Pe(b.errors,de),w.push({comment:de.comment,before:x.length});else{if(F){let nt=`Expected a ${F} in flow sequence`;b.errors.push(new u.YAMLSemanticError(de,nt))}let be=Sn(b,de);_===void 0?(x.push(be),V=de):(x.push(new ce(_,be)),_=void 0),D=de.range.start,F=","}}return ge(b.errors,m),_!==void 0&&x.push(new ce(_)),{comments:w,items:x}}l.Alias=Ae,l.Collection=N,l.Merge=oe,l.Node=T,l.Pair=ce,l.Scalar=A,l.YAMLMap=Ge,l.YAMLSeq=j,l.addComment=S,l.binaryOptions=O,l.boolOptions=P,l.findPair=Ce,l.intOptions=z,l.isEmptyPath=ee,l.nullOptions=W,l.resolveMap=oy,l.resolveNode=Sn,l.resolveSeq=py,l.resolveString=dn,l.strOptions=X,l.stringifyNumber=me,l.stringifyString=J,l.toJSON=v}}),es=Ft({"node_modules/yaml/dist/warnings-1000a372.js"(l){var u=Sr(),f=Ii(),S={identify:B=>B instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(B,Y)=>{let G=f.resolveString(B,Y);if(typeof Buffer=="function")return Buffer.from(G,"base64");if(typeof atob=="function"){let pe=atob(G.replace(/[\n\r]/g,"")),fe=new Uint8Array(pe.length);for(let Ee=0;Ee<pe.length;++Ee)fe[Ee]=pe.charCodeAt(Ee);return fe}else{let pe="This environment does not support reading binary tags; either Buffer or atob is required";return B.errors.push(new u.YAMLReferenceError(Y,pe)),null}},options:f.binaryOptions,stringify:({comment:B,type:Y,value:G},pe,fe,Ee)=>{let it;if(typeof Buffer=="function")it=G instanceof Buffer?G.toString("base64"):Buffer.from(G.buffer).toString("base64");else if(typeof btoa=="function"){let at="";for(let st=0;st<G.length;++st)at+=String.fromCharCode(G[st]);it=btoa(at)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Y||(Y=f.binaryOptions.defaultType),Y===u.Type.QUOTE_DOUBLE)G=it;else{let{lineWidth:at}=f.binaryOptions,st=Math.ceil(it.length/at),mt=new Array(st);for(let Tt=0,se=0;Tt<st;++Tt,se+=at)mt[Tt]=it.substr(se,at);G=mt.join(Y===u.Type.BLOCK_LITERAL?`
114
+ `:" ")}return f.stringifyString({comment:B,type:Y,value:G},pe,fe,Ee)}};function T(B,Y){let G=f.resolveSeq(B,Y);for(let pe=0;pe<G.items.length;++pe){let fe=G.items[pe];if(!(fe instanceof f.Pair)){if(fe instanceof f.YAMLMap){if(fe.items.length>1){let it="Each pair must have its own sequence indicator";throw new u.YAMLSemanticError(Y,it)}let Ee=fe.items[0]||new f.Pair;fe.commentBefore&&(Ee.commentBefore=Ee.commentBefore?`${fe.commentBefore}
107
115
  ${Ee.commentBefore}`:fe.commentBefore),fe.comment&&(Ee.comment=Ee.comment?`${fe.comment}
108
- ${Ee.comment}`:fe.comment),fe=Ee}G.items[pe]=fe instanceof f.Pair?fe:new f.Pair(fe)}}return G}function v(z,Y,G){let pe=new f.YAMLSeq(z);pe.tag="tag:yaml.org,2002:pairs";for(let fe of Y){let Ee,it;if(Array.isArray(fe))if(fe.length===2)Ee=fe[0],it=fe[1];else throw new TypeError(`Expected [key, value] tuple: ${fe}`);else if(fe&&fe instanceof Object){let st=Object.keys(fe);if(st.length===1)Ee=st[0],it=fe[Ee];else throw new TypeError(`Expected { key: value } tuple: ${fe}`)}else Ee=fe;let ot=z.createPair(Ee,it,G);pe.items.push(ot)}return pe}var k={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:T,createNode:v},L=class Zc extends f.YAMLSeq{constructor(){super(),c._defineProperty(this,"add",f.YAMLMap.prototype.add.bind(this)),c._defineProperty(this,"delete",f.YAMLMap.prototype.delete.bind(this)),c._defineProperty(this,"get",f.YAMLMap.prototype.get.bind(this)),c._defineProperty(this,"has",f.YAMLMap.prototype.has.bind(this)),c._defineProperty(this,"set",f.YAMLMap.prototype.set.bind(this)),this.tag=Zc.tag}toJSON(Y,G){let pe=new Map;G&&G.onCreate&&G.onCreate(pe);for(let fe of this.items){let Ee,it;if(fe instanceof f.Pair?(Ee=f.toJSON(fe.key,"",G),it=f.toJSON(fe.value,Ee,G)):Ee=f.toJSON(fe,"",G),pe.has(Ee))throw new Error("Ordered maps must not include duplicate keys");pe.set(Ee,it)}return pe}};c._defineProperty(L,"tag","tag:yaml.org,2002:omap");function Q(z,Y){let G=T(z,Y),pe=[];for(let{key:fe}of G.items)if(fe instanceof f.Scalar)if(pe.includes(fe.value)){let Ee="Ordered maps must not include duplicate keys";throw new c.YAMLSemanticError(Y,Ee)}else pe.push(fe.value);return Object.assign(new L,G)}function N(z,Y,G){let pe=v(z,Y,G),fe=new L;return fe.items=pe.items,fe}var ie={identify:z=>z instanceof Map,nodeClass:L,default:!1,tag:"tag:yaml.org,2002:omap",resolve:Q,createNode:N},j=class eu extends f.YAMLMap{constructor(){super(),this.tag=eu.tag}add(Y){let G=Y instanceof f.Pair?Y:new f.Pair(Y);f.findPair(this.items,G.key)||this.items.push(G)}get(Y,G){let pe=f.findPair(this.items,Y);return!G&&pe instanceof f.Pair?pe.key instanceof f.Scalar?pe.key.value:pe.key:pe}set(Y,G){if(typeof G!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof G}`);let pe=f.findPair(this.items,Y);pe&&!G?this.items.splice(this.items.indexOf(pe),1):!pe&&G&&this.items.push(new f.Pair(Y))}toJSON(Y,G){return super.toJSON(Y,G,Set)}toString(Y,G,pe){if(!Y)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(Y,G,pe);throw new Error("Set items must all have null values")}};c._defineProperty(j,"tag","tag:yaml.org,2002:set");function he(z,Y){let G=f.resolveMap(z,Y);if(!G.hasAllNullValues())throw new c.YAMLSemanticError(Y,"Set items must all have null values");return Object.assign(new j,G)}function ce(z,Y,G){let pe=new j;for(let fe of Y)pe.items.push(z.createPair(fe,null,G));return pe}var $e={identify:z=>z instanceof Set,nodeClass:j,default:!1,tag:"tag:yaml.org,2002:set",resolve:he,createNode:ce},xe=(z,Y)=>{let G=Y.split(":").reduce((pe,fe)=>pe*60+Number(fe),0);return z==="-"?-G:G},Re=({value:z})=>{if(isNaN(z)||!isFinite(z))return f.stringifyNumber(z);let Y="";z<0&&(Y="-",z=Math.abs(z));let G=[z%60];return z<60?G.unshift(0):(z=Math.round((z-G[0])/60),G.unshift(z%60),z>=60&&(z=Math.round((z-G[0])/60),G.unshift(z))),Y+G.map(pe=>pe<10?"0"+String(pe):String(pe)).join(":").replace(/000000\d*$/,"")},Ge={identify:z=>typeof z=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(z,Y,G)=>xe(Y,G.replace(/_/g,"")),stringify:Re},Qe={identify:z=>typeof z=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(z,Y,G)=>xe(Y,G.replace(/_/g,"")),stringify:Re},ae={identify:z=>z 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:(z,Y,G,pe,fe,Ee,it,ot,st)=>{ot&&(ot=(ot+"00").substr(1,3));let mt=Date.UTC(Y,G-1,pe,fe||0,Ee||0,it||0,ot||0);if(st&&st!=="Z"){let Tt=xe(st[0],st.slice(1));Math.abs(Tt)<30&&(Tt*=60),mt-=6e4*Tt}return new Date(mt)},stringify:({value:z})=>z.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function C(z){let Y=typeof process!="undefined"&&process.env||{};return z?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!Y.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!Y.YAML_SILENCE_WARNINGS}function I(z,Y){if(C(!1)){let G=typeof process!="undefined"&&process.emitWarning;G?G(z,Y):console.warn(Y?`${Y}: ${z}`:z)}}function V(z){if(C(!0)){let Y=z.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");I(`The endpoint 'yaml/${Y}' will be removed in a future release.`,"DeprecationWarning")}}var W={};function K(z,Y){if(!W[z]&&C(!0)){W[z]=!0;let G=`The option '${z}' will be removed in a future release`;G+=Y?`, use '${Y}' instead.`:".",I(G,"DeprecationWarning")}}l.binary=S,l.floatTime=Qe,l.intTime=Ge,l.omap=ie,l.pairs=k,l.set=$e,l.timestamp=ae,l.warn=I,l.warnFileDeprecation=V,l.warnOptionDeprecation=K}}),ic=Lt({"node_modules/yaml/dist/Schema-88e323a7.js"(l){var c=mr(),f=pi(),S=Ea();function T(E,J,me){let ge=new f.YAMLMap(E);if(J instanceof Map)for(let[Pe,qe]of J)ge.items.push(E.createPair(Pe,qe,me));else if(J&&typeof J=="object")for(let Pe of Object.keys(J))ge.items.push(E.createPair(Pe,J[Pe],me));return typeof E.sortMapEntries=="function"&&ge.items.sort(E.sortMapEntries),ge}var v={createNode:T,default:!0,nodeClass:f.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:f.resolveMap};function k(E,J,me){let ge=new f.YAMLSeq(E);if(J&&J[Symbol.iterator])for(let Pe of J){let qe=E.createNode(Pe,me.wrapScalars,null,me);ge.items.push(qe)}return ge}var L={createNode:k,default:!0,nodeClass:f.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:f.resolveSeq},Q={identify:E=>typeof E=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:f.resolveString,stringify(E,J,me,ge){return J=Object.assign({actualString:!0},J),f.stringifyString(E,J,me,ge)},options:f.strOptions},N=[v,L,Q],ie=E=>typeof E=="bigint"||Number.isInteger(E),j=(E,J,me)=>f.intOptions.asBigInt?BigInt(E):parseInt(J,me);function he(E,J,me){let{value:ge}=E;return ie(ge)&&ge>=0?me+ge.toString(J):f.stringifyNumber(E)}var ce={identify:E=>E==null,createNode:(E,J,me)=>me.wrapScalars?new f.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:f.nullOptions,stringify:()=>f.nullOptions.nullStr},$e={identify:E=>typeof E=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:E=>E[0]==="t"||E[0]==="T",options:f.boolOptions,stringify:({value:E})=>E?f.boolOptions.trueStr:f.boolOptions.falseStr},xe={identify:E=>ie(E)&&E>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(E,J)=>j(E,J,8),options:f.intOptions,stringify:E=>he(E,8,"0o")},Re={identify:ie,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:E=>j(E,E,10),options:f.intOptions,stringify:f.stringifyNumber},Ge={identify:E=>ie(E)&&E>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(E,J)=>j(E,J,16),options:f.intOptions,stringify:E=>he(E,16,"0x")},Qe={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(E,J)=>J?NaN:E[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:f.stringifyNumber},ae={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:E=>parseFloat(E),stringify:({value:E})=>Number(E).toExponential()},C={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(E,J,me){let ge=J||me,Pe=new f.Scalar(parseFloat(E));return ge&&ge[ge.length-1]==="0"&&(Pe.minFractionDigits=ge.length),Pe},stringify:f.stringifyNumber},I=N.concat([ce,$e,xe,Re,Ge,Qe,ae,C]),V=E=>typeof E=="bigint"||Number.isInteger(E),W=({value:E})=>JSON.stringify(E),K=[v,L,{identify:E=>typeof E=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:f.resolveString,stringify:W},{identify:E=>E==null,createNode:(E,J,me)=>me.wrapScalars?new f.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:W},{identify:E=>typeof E=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:E=>E==="true",stringify:W},{identify:V,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:E=>f.intOptions.asBigInt?BigInt(E):parseInt(E,10),stringify:({value:E})=>V(E)?E.toString():JSON.stringify(E)},{identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:E=>parseFloat(E),stringify:W}];K.scalarFallback=E=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(E)}`)};var z=({value:E})=>E?f.boolOptions.trueStr:f.boolOptions.falseStr,Y=E=>typeof E=="bigint"||Number.isInteger(E);function G(E,J,me){let ge=J.replace(/_/g,"");if(f.intOptions.asBigInt){switch(me){case 2:ge=`0b${ge}`;break;case 8:ge=`0o${ge}`;break;case 16:ge=`0x${ge}`;break}let qe=BigInt(ge);return E==="-"?BigInt(-1)*qe:qe}let Pe=parseInt(ge,me);return E==="-"?-1*Pe:Pe}function pe(E,J,me){let{value:ge}=E;if(Y(ge)){let Pe=ge.toString(J);return ge<0?"-"+me+Pe.substr(1):me+Pe}return f.stringifyNumber(E)}var fe=N.concat([{identify:E=>E==null,createNode:(E,J,me)=>me.wrapScalars?new f.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:f.nullOptions,stringify:()=>f.nullOptions.nullStr},{identify:E=>typeof E=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:f.boolOptions,stringify:z},{identify:E=>typeof E=="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:f.boolOptions,stringify:z},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(E,J,me)=>G(J,me,2),stringify:E=>pe(E,2,"0b")},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(E,J,me)=>G(J,me,8),stringify:E=>pe(E,8,"0")},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(E,J,me)=>G(J,me,10),stringify:f.stringifyNumber},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(E,J,me)=>G(J,me,16),stringify:E=>pe(E,16,"0x")},{identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(E,J)=>J?NaN:E[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:f.stringifyNumber},{identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:E=>parseFloat(E.replace(/_/g,"")),stringify:({value:E})=>Number(E).toExponential()},{identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(E,J){let me=new f.Scalar(parseFloat(E.replace(/_/g,"")));if(J){let ge=J.replace(/_/g,"");ge[ge.length-1]==="0"&&(me.minFractionDigits=ge.length)}return me},stringify:f.stringifyNumber}],S.binary,S.omap,S.pairs,S.set,S.intTime,S.floatTime,S.timestamp),Ee={core:I,failsafe:N,json:K,yaml11:fe},it={binary:S.binary,bool:$e,float:C,floatExp:ae,floatNaN:Qe,floatTime:S.floatTime,int:Re,intHex:Ge,intOct:xe,intTime:S.intTime,map:v,null:ce,omap:S.omap,pairs:S.pairs,seq:L,set:S.set,timestamp:S.timestamp};function ot(E,J,me){if(J){let ge=me.filter(qe=>qe.tag===J),Pe=ge.find(qe=>!qe.format)||ge[0];if(!Pe)throw new Error(`Tag ${J} not found`);return Pe}return me.find(ge=>(ge.identify&&ge.identify(E)||ge.class&&E instanceof ge.class)&&!ge.format)}function st(E,J,me){if(E instanceof f.Node)return E;let{defaultPrefix:ge,onTagObj:Pe,prevObjects:qe,schema:qt,wrapScalars:ln}=me;J&&J.startsWith("!!")&&(J=ge+J.slice(2));let cn=ot(E,J,qt.tags);if(!cn){if(typeof E.toJSON=="function"&&(E=E.toJSON()),!E||typeof E!="object")return ln?new f.Scalar(E):E;cn=E instanceof Map?v:E[Symbol.iterator]?L:v}Pe&&(Pe(cn),delete me.onTagObj);let Xt={value:void 0,node:void 0};if(E&&typeof E=="object"&&qe){let Sr=qe.get(E);if(Sr){let bi=new f.Alias(Sr);return me.aliasNodes.push(bi),bi}Xt.value=E,qe.set(E,Xt)}return Xt.node=cn.createNode?cn.createNode(me.schema,E,me):ln?new f.Scalar(E):E,J&&Xt.node instanceof f.Node&&(Xt.node.tag=J),Xt.node}function mt(E,J,me,ge){let Pe=E[ge.replace(/\W/g,"")];if(!Pe){let qe=Object.keys(E).map(qt=>JSON.stringify(qt)).join(", ");throw new Error(`Unknown schema "${ge}"; use one of ${qe}`)}if(Array.isArray(me))for(let qe of me)Pe=Pe.concat(qe);else typeof me=="function"&&(Pe=me(Pe.slice()));for(let qe=0;qe<Pe.length;++qe){let qt=Pe[qe];if(typeof qt=="string"){let ln=J[qt];if(!ln){let cn=Object.keys(J).map(Xt=>JSON.stringify(Xt)).join(", ");throw new Error(`Unknown custom tag "${qt}"; use one of ${cn}`)}Pe[qe]=ln}}return Pe}var Tt=(E,J)=>E.key<J.key?-1:E.key>J.key?1:0,se=class tu{constructor({customTags:J,merge:me,schema:ge,sortMapEntries:Pe,tags:qe}){this.merge=!!me,this.name=ge,this.sortMapEntries=Pe===!0?Tt:Pe||null,!J&&qe&&S.warnOptionDeprecation("tags","customTags"),this.tags=mt(Ee,it,J||qe,ge)}createNode(J,me,ge,Pe){let qe={defaultPrefix:tu.defaultPrefix,schema:this,wrapScalars:me},qt=Pe?Object.assign(Pe,qe):qe;return st(J,ge,qt)}createPair(J,me,ge){ge||(ge={wrapScalars:!0});let Pe=this.createNode(J,ge.wrapScalars,null,ge),qe=this.createNode(me,ge.wrapScalars,null,ge);return new f.Pair(Pe,qe)}};c._defineProperty(se,"defaultPrefix",c.defaultTagPrefix),c._defineProperty(se,"defaultTags",c.defaultTags),l.Schema=se}}),oc=Lt({"node_modules/yaml/dist/types.js"(l){var c=pi(),f=ic();mr(),Ea(),l.Alias=c.Alias,l.Collection=c.Collection,l.Merge=c.Merge,l.Node=c.Node,l.Pair=c.Pair,l.Scalar=c.Scalar,l.YAMLMap=c.YAMLMap,l.YAMLSeq=c.YAMLSeq,l.binaryOptions=c.binaryOptions,l.boolOptions=c.boolOptions,l.intOptions=c.intOptions,l.nullOptions=c.nullOptions,l.strOptions=c.strOptions,l.Schema=f.Schema}}),_a={},Ra=()=>_a,ac=l=>{Object.assign(_a,l)},sc=class{constructor(){this.data={}}unregister(l){l?delete this.data[l]:this.data={}}register(l,c){this.data[l]=c}registerMany(l){Object.keys(l).forEach(c=>{this.data[c]=l[c]})}get(l){return this.data[l]}list(){return this.data}},Oa=sc,We={},Ca=We,We.defaultInvalidTypeProduct=void 0,We.defaultRandExpMax=10,We.pruneProperties=[],We.ignoreProperties=[],We.ignoreMissingRefs=!1,We.failOnInvalidTypes=!0,We.failOnInvalidFormat=!0,We.alwaysFakeOptionals=!1,We.optionalsProbability=null,We.fixedProbabilities=!1,We.useExamplesValue=!1,We.useDefaultValue=!1,We.requiredOnly=!1,We.omitNulls=!1,We.minItems=0,We.maxItems=null,We.minLength=0,We.maxLength=null,We.resolveJsonPath=!1,We.reuseProperties=!1,We.fillProperties=!0,We.sortProperties=!1,We.replaceEmptyByRandomValue=!1,We.random=Math.random,We.minDateTime=new Date("1889-12-31T00:00:00.000Z"),We.maxDateTime=new Date("1970-01-01T00:00:01.000Z"),We.renderTitle=!0,We.renderDescription=!0,We.renderComment=!1,lc=class extends Oa{constructor(){super(),this.data={...Ca},this._defaults=Ca}get defaults(){return{...this._defaults}}},cc=lc,gr=new cc,d.getDefaults=()=>gr.defaults,_e=d,Ia=["integer","number","string","boolean"],Pa=Ia.concat(["null"]),uc=["array","object"].concat(Pa),pc=2524608e6,dc=-1e8,hc=1e8,fc=-100,mc=100,Kt={ALLOWED_TYPES:Ia,SCALAR_TYPES:Pa,ALL_TYPES:uc,MIN_NUMBER:fc,MAX_NUMBER:mc,MIN_INTEGER:dc,MAX_INTEGER:hc,MOST_NEAR_DATETIME:pc},di=Aa(rc(),1),Ae={pick:y,date:ue,shuffle:P,number:Z,randexp:g},gc=/^(0|[1-9][0-9]*)$/,Ye={hasProperties:$,getLocalRef:ne,omitProps:A,typecast:je,merge:U,clone:Te,short:ze,hasValue:Ie,notValue:Me,anyValue:ye,validate:ct,validateValueForSchema:tt,validateValueForOneOf:Pt,isKey:Ft,template:vt,shouldClean:_,clean:wt,isEmpty:Mt,clampDate:Ue},yc=class{constructor(){this.registry={},this.support={}}reset(l){l?(delete this.registry[l],delete this.support[l]):(this.registry={},this.support={})}extend(l,c){this.registry[l]=c(this.registry[l]),this.support[l]||(this.support[l]=tn(()=>this.registry[l]))}define(l,c){this.support[l]=c}get(l){if(typeof this.registry[l]=="undefined")throw new ReferenceError(`'${l}' dependency doesn't exist.`);return this.registry[l]}wrap(l){if(!("generate"in l)){let c=Object.keys(l),f={},S=c.length;for(;S--;){let T=c[S].replace(/^x-/,""),v=this.support[T];if(typeof v=="function"){Object.defineProperty(l,"generate",{configurable:!1,enumerable:!1,writable:!1,value:(k,L)=>v.call(f,l[c[S]],l,c[S],k,L.slice())});break}}}return l}},bc=yc,Gn=new Oa,Ma=pr,wc=class extends Error{constructor(l,c){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=l,this.path=c}},hi=wc,yr={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"]},yr.number=yr.integer,Sc=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Tc=dt,xc=In,kc=xc,vc=kc,Ac=Yt,Ec=Ac,_c=Ec,Rc=wn,Na=dr,Oc=ga,Cc=`Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore
116
+ ${Ee.comment}`:fe.comment),fe=Ee}G.items[pe]=fe instanceof f.Pair?fe:new f.Pair(fe)}}return G}function v(B,Y,G){let pe=new f.YAMLSeq(B);pe.tag="tag:yaml.org,2002:pairs";for(let fe of Y){let Ee,it;if(Array.isArray(fe))if(fe.length===2)Ee=fe[0],it=fe[1];else throw new TypeError(`Expected [key, value] tuple: ${fe}`);else if(fe&&fe instanceof Object){let st=Object.keys(fe);if(st.length===1)Ee=st[0],it=fe[Ee];else throw new TypeError(`Expected { key: value } tuple: ${fe}`)}else Ee=fe;let at=B.createPair(Ee,it,G);pe.items.push(at)}return pe}var A={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:T,createNode:v},L=class _u extends f.YAMLSeq{constructor(){super(),u._defineProperty(this,"add",f.YAMLMap.prototype.add.bind(this)),u._defineProperty(this,"delete",f.YAMLMap.prototype.delete.bind(this)),u._defineProperty(this,"get",f.YAMLMap.prototype.get.bind(this)),u._defineProperty(this,"has",f.YAMLMap.prototype.has.bind(this)),u._defineProperty(this,"set",f.YAMLMap.prototype.set.bind(this)),this.tag=_u.tag}toJSON(Y,G){let pe=new Map;G&&G.onCreate&&G.onCreate(pe);for(let fe of this.items){let Ee,it;if(fe instanceof f.Pair?(Ee=f.toJSON(fe.key,"",G),it=f.toJSON(fe.value,Ee,G)):Ee=f.toJSON(fe,"",G),pe.has(Ee))throw new Error("Ordered maps must not include duplicate keys");pe.set(Ee,it)}return pe}};u._defineProperty(L,"tag","tag:yaml.org,2002:omap");function ee(B,Y){let G=T(B,Y),pe=[];for(let{key:fe}of G.items)if(fe instanceof f.Scalar)if(pe.includes(fe.value)){let Ee="Ordered maps must not include duplicate keys";throw new u.YAMLSemanticError(Y,Ee)}else pe.push(fe.value);return Object.assign(new L,G)}function N(B,Y,G){let pe=v(B,Y,G),fe=new L;return fe.items=pe.items,fe}var ie={identify:B=>B instanceof Map,nodeClass:L,default:!1,tag:"tag:yaml.org,2002:omap",resolve:ee,createNode:N},j=class Ou extends f.YAMLMap{constructor(){super(),this.tag=Ou.tag}add(Y){let G=Y instanceof f.Pair?Y:new f.Pair(Y);f.findPair(this.items,G.key)||this.items.push(G)}get(Y,G){let pe=f.findPair(this.items,Y);return!G&&pe instanceof f.Pair?pe.key instanceof f.Scalar?pe.key.value:pe.key:pe}set(Y,G){if(typeof G!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof G}`);let pe=f.findPair(this.items,Y);pe&&!G?this.items.splice(this.items.indexOf(pe),1):!pe&&G&&this.items.push(new f.Pair(Y))}toJSON(Y,G){return super.toJSON(Y,G,Set)}toString(Y,G,pe){if(!Y)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(Y,G,pe);throw new Error("Set items must all have null values")}};u._defineProperty(j,"tag","tag:yaml.org,2002:set");function he(B,Y){let G=f.resolveMap(B,Y);if(!G.hasAllNullValues())throw new u.YAMLSemanticError(Y,"Set items must all have null values");return Object.assign(new j,G)}function ce(B,Y,G){let pe=new j;for(let fe of Y)pe.items.push(B.createPair(fe,null,G));return pe}var He={identify:B=>B instanceof Set,nodeClass:j,default:!1,tag:"tag:yaml.org,2002:set",resolve:he,createNode:ce},Ae=(B,Y)=>{let G=Y.split(":").reduce((pe,fe)=>pe*60+Number(fe),0);return B==="-"?-G:G},Ce=({value:B})=>{if(isNaN(B)||!isFinite(B))return f.stringifyNumber(B);let Y="";B<0&&(Y="-",B=Math.abs(B));let G=[B%60];return B<60?G.unshift(0):(B=Math.round((B-G[0])/60),G.unshift(B%60),B>=60&&(B=Math.round((B-G[0])/60),G.unshift(B))),Y+G.map(pe=>pe<10?"0"+String(pe):String(pe)).join(":").replace(/000000\d*$/,"")},Ge={identify:B=>typeof B=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(B,Y,G)=>Ae(Y,G.replace(/_/g,"")),stringify:Ce},Qe={identify:B=>typeof B=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(B,Y,G)=>Ae(Y,G.replace(/_/g,"")),stringify:Ce},oe={identify:B=>B 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:(B,Y,G,pe,fe,Ee,it,at,st)=>{at&&(at=(at+"00").substr(1,3));let mt=Date.UTC(Y,G-1,pe,fe||0,Ee||0,it||0,at||0);if(st&&st!=="Z"){let Tt=Ae(st[0],st.slice(1));Math.abs(Tt)<30&&(Tt*=60),mt-=6e4*Tt}return new Date(mt)},stringify:({value:B})=>B.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function O(B){let Y=typeof process!="undefined"&&process.env||{};return B?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!Y.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!Y.YAML_SILENCE_WARNINGS}function P(B,Y){if(O(!1)){let G=typeof process!="undefined"&&process.emitWarning;G?G(B,Y):console.warn(Y?`${Y}: ${B}`:B)}}function z(B){if(O(!0)){let Y=B.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");P(`The endpoint 'yaml/${Y}' will be removed in a future release.`,"DeprecationWarning")}}var W={};function X(B,Y){if(!W[B]&&O(!0)){W[B]=!0;let G=`The option '${B}' will be removed in a future release`;G+=Y?`, use '${Y}' instead.`:".",P(G,"DeprecationWarning")}}l.binary=S,l.floatTime=Qe,l.intTime=Ge,l.omap=ie,l.pairs=A,l.set=He,l.timestamp=oe,l.warn=P,l.warnFileDeprecation=z,l.warnOptionDeprecation=X}}),Nc=Ft({"node_modules/yaml/dist/Schema-88e323a7.js"(l){var u=Sr(),f=Ii(),S=es();function T(E,J,me){let ge=new f.YAMLMap(E);if(J instanceof Map)for(let[Pe,$e]of J)ge.items.push(E.createPair(Pe,$e,me));else if(J&&typeof J=="object")for(let Pe of Object.keys(J))ge.items.push(E.createPair(Pe,J[Pe],me));return typeof E.sortMapEntries=="function"&&ge.items.sort(E.sortMapEntries),ge}var v={createNode:T,default:!0,nodeClass:f.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:f.resolveMap};function A(E,J,me){let ge=new f.YAMLSeq(E);if(J&&J[Symbol.iterator])for(let Pe of J){let $e=E.createNode(Pe,me.wrapScalars,null,me);ge.items.push($e)}return ge}var L={createNode:A,default:!0,nodeClass:f.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:f.resolveSeq},ee={identify:E=>typeof E=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:f.resolveString,stringify(E,J,me,ge){return J=Object.assign({actualString:!0},J),f.stringifyString(E,J,me,ge)},options:f.strOptions},N=[v,L,ee],ie=E=>typeof E=="bigint"||Number.isInteger(E),j=(E,J,me)=>f.intOptions.asBigInt?BigInt(E):parseInt(J,me);function he(E,J,me){let{value:ge}=E;return ie(ge)&&ge>=0?me+ge.toString(J):f.stringifyNumber(E)}var ce={identify:E=>E==null,createNode:(E,J,me)=>me.wrapScalars?new f.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:f.nullOptions,stringify:()=>f.nullOptions.nullStr},He={identify:E=>typeof E=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:E=>E[0]==="t"||E[0]==="T",options:f.boolOptions,stringify:({value:E})=>E?f.boolOptions.trueStr:f.boolOptions.falseStr},Ae={identify:E=>ie(E)&&E>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(E,J)=>j(E,J,8),options:f.intOptions,stringify:E=>he(E,8,"0o")},Ce={identify:ie,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:E=>j(E,E,10),options:f.intOptions,stringify:f.stringifyNumber},Ge={identify:E=>ie(E)&&E>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(E,J)=>j(E,J,16),options:f.intOptions,stringify:E=>he(E,16,"0x")},Qe={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(E,J)=>J?NaN:E[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:f.stringifyNumber},oe={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:E=>parseFloat(E),stringify:({value:E})=>Number(E).toExponential()},O={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(E,J,me){let ge=J||me,Pe=new f.Scalar(parseFloat(E));return ge&&ge[ge.length-1]==="0"&&(Pe.minFractionDigits=ge.length),Pe},stringify:f.stringifyNumber},P=N.concat([ce,He,Ae,Ce,Ge,Qe,oe,O]),z=E=>typeof E=="bigint"||Number.isInteger(E),W=({value:E})=>JSON.stringify(E),X=[v,L,{identify:E=>typeof E=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:f.resolveString,stringify:W},{identify:E=>E==null,createNode:(E,J,me)=>me.wrapScalars?new f.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:W},{identify:E=>typeof E=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:E=>E==="true",stringify:W},{identify:z,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:E=>f.intOptions.asBigInt?BigInt(E):parseInt(E,10),stringify:({value:E})=>z(E)?E.toString():JSON.stringify(E)},{identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:E=>parseFloat(E),stringify:W}];X.scalarFallback=E=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(E)}`)};var B=({value:E})=>E?f.boolOptions.trueStr:f.boolOptions.falseStr,Y=E=>typeof E=="bigint"||Number.isInteger(E);function G(E,J,me){let ge=J.replace(/_/g,"");if(f.intOptions.asBigInt){switch(me){case 2:ge=`0b${ge}`;break;case 8:ge=`0o${ge}`;break;case 16:ge=`0x${ge}`;break}let $e=BigInt(ge);return E==="-"?BigInt(-1)*$e:$e}let Pe=parseInt(ge,me);return E==="-"?-1*Pe:Pe}function pe(E,J,me){let{value:ge}=E;if(Y(ge)){let Pe=ge.toString(J);return ge<0?"-"+me+Pe.substr(1):me+Pe}return f.stringifyNumber(E)}var fe=N.concat([{identify:E=>E==null,createNode:(E,J,me)=>me.wrapScalars?new f.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:f.nullOptions,stringify:()=>f.nullOptions.nullStr},{identify:E=>typeof E=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:f.boolOptions,stringify:B},{identify:E=>typeof E=="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:f.boolOptions,stringify:B},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(E,J,me)=>G(J,me,2),stringify:E=>pe(E,2,"0b")},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(E,J,me)=>G(J,me,8),stringify:E=>pe(E,8,"0")},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(E,J,me)=>G(J,me,10),stringify:f.stringifyNumber},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(E,J,me)=>G(J,me,16),stringify:E=>pe(E,16,"0x")},{identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(E,J)=>J?NaN:E[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:f.stringifyNumber},{identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:E=>parseFloat(E.replace(/_/g,"")),stringify:({value:E})=>Number(E).toExponential()},{identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(E,J){let me=new f.Scalar(parseFloat(E.replace(/_/g,"")));if(J){let ge=J.replace(/_/g,"");ge[ge.length-1]==="0"&&(me.minFractionDigits=ge.length)}return me},stringify:f.stringifyNumber}],S.binary,S.omap,S.pairs,S.set,S.intTime,S.floatTime,S.timestamp),Ee={core:P,failsafe:N,json:X,yaml11:fe},it={binary:S.binary,bool:He,float:O,floatExp:oe,floatNaN:Qe,floatTime:S.floatTime,int:Ce,intHex:Ge,intOct:Ae,intTime:S.intTime,map:v,null:ce,omap:S.omap,pairs:S.pairs,seq:L,set:S.set,timestamp:S.timestamp};function at(E,J,me){if(J){let ge=me.filter($e=>$e.tag===J),Pe=ge.find($e=>!$e.format)||ge[0];if(!Pe)throw new Error(`Tag ${J} not found`);return Pe}return me.find(ge=>(ge.identify&&ge.identify(E)||ge.class&&E instanceof ge.class)&&!ge.format)}function st(E,J,me){if(E instanceof f.Node)return E;let{defaultPrefix:ge,onTagObj:Pe,prevObjects:$e,schema:jt,wrapScalars:dn}=me;J&&J.startsWith("!!")&&(J=ge+J.slice(2));let hn=at(E,J,jt.tags);if(!hn){if(typeof E.toJSON=="function"&&(E=E.toJSON()),!E||typeof E!="object")return dn?new f.Scalar(E):E;hn=E instanceof Map?v:E[Symbol.iterator]?L:v}Pe&&(Pe(hn),delete me.onTagObj);let Kt={value:void 0,node:void 0};if(E&&typeof E=="object"&&$e){let kr=$e.get(E);if(kr){let Ui=new f.Alias(kr);return me.aliasNodes.push(Ui),Ui}Kt.value=E,$e.set(E,Kt)}return Kt.node=hn.createNode?hn.createNode(me.schema,E,me):dn?new f.Scalar(E):E,J&&Kt.node instanceof f.Node&&(Kt.node.tag=J),Kt.node}function mt(E,J,me,ge){let Pe=E[ge.replace(/\W/g,"")];if(!Pe){let $e=Object.keys(E).map(jt=>JSON.stringify(jt)).join(", ");throw new Error(`Unknown schema "${ge}"; use one of ${$e}`)}if(Array.isArray(me))for(let $e of me)Pe=Pe.concat($e);else typeof me=="function"&&(Pe=me(Pe.slice()));for(let $e=0;$e<Pe.length;++$e){let jt=Pe[$e];if(typeof jt=="string"){let dn=J[jt];if(!dn){let hn=Object.keys(J).map(Kt=>JSON.stringify(Kt)).join(", ");throw new Error(`Unknown custom tag "${jt}"; use one of ${hn}`)}Pe[$e]=dn}}return Pe}var Tt=(E,J)=>E.key<J.key?-1:E.key>J.key?1:0,se=class Iu{constructor({customTags:J,merge:me,schema:ge,sortMapEntries:Pe,tags:$e}){this.merge=!!me,this.name=ge,this.sortMapEntries=Pe===!0?Tt:Pe||null,!J&&$e&&S.warnOptionDeprecation("tags","customTags"),this.tags=mt(Ee,it,J||$e,ge)}createNode(J,me,ge,Pe){let $e={defaultPrefix:Iu.defaultPrefix,schema:this,wrapScalars:me},jt=Pe?Object.assign(Pe,$e):$e;return st(J,ge,jt)}createPair(J,me,ge){ge||(ge={wrapScalars:!0});let Pe=this.createNode(J,ge.wrapScalars,null,ge),$e=this.createNode(me,ge.wrapScalars,null,ge);return new f.Pair(Pe,$e)}};u._defineProperty(se,"defaultPrefix",u.defaultTagPrefix),u._defineProperty(se,"defaultTags",u.defaultTags),l.Schema=se}}),Lc=Ft({"node_modules/yaml/dist/types.js"(l){var u=Ii(),f=Nc();Sr(),es(),l.Alias=u.Alias,l.Collection=u.Collection,l.Merge=u.Merge,l.Node=u.Node,l.Pair=u.Pair,l.Scalar=u.Scalar,l.YAMLMap=u.YAMLMap,l.YAMLSeq=u.YAMLSeq,l.binaryOptions=u.binaryOptions,l.boolOptions=u.boolOptions,l.intOptions=u.intOptions,l.nullOptions=u.nullOptions,l.strOptions=u.strOptions,l.Schema=f.Schema}}),ts={},ns=()=>ts,Dc=l=>{Object.assign(ts,l)},Fc=class{constructor(){this.data={}}unregister(l){l?delete this.data[l]:this.data={}}register(l,u){this.data[l]=u}registerMany(l){Object.keys(l).forEach(u=>{this.data[u]=l[u]})}get(l){return this.data[l]}list(){return this.data}},rs=Fc,We={},is=We,We.defaultInvalidTypeProduct=void 0,We.defaultRandExpMax=10,We.pruneProperties=[],We.ignoreProperties=[],We.ignoreMissingRefs=!1,We.failOnInvalidTypes=!0,We.failOnInvalidFormat=!0,We.alwaysFakeOptionals=!1,We.optionalsProbability=null,We.fixedProbabilities=!1,We.useExamplesValue=!1,We.useDefaultValue=!1,We.requiredOnly=!1,We.omitNulls=!1,We.minItems=0,We.maxItems=null,We.minLength=0,We.maxLength=null,We.resolveJsonPath=!1,We.reuseProperties=!1,We.fillProperties=!0,We.sortProperties=!1,We.replaceEmptyByRandomValue=!1,We.random=Math.random,We.minDateTime=new Date("1889-12-31T00:00:00.000Z"),We.maxDateTime=new Date("1970-01-01T00:00:01.000Z"),We.renderTitle=!0,We.renderDescription=!0,We.renderComment=!1,Uc=class extends rs{constructor(){super(),this.data={...is},this._defaults=is}get defaults(){return{...this._defaults}}},Hc=Uc,Tr=new Hc,d.getDefaults=()=>Tr.defaults,Re=d,as=["integer","number","string","boolean"],os=as.concat(["null"]),$c=["array","object"].concat(os),qc=2524608e6,jc=-1e8,Bc=1e8,zc=-100,Vc=100,Gt={ALLOWED_TYPES:as,SCALAR_TYPES:os,ALL_TYPES:$c,MIN_NUMBER:zc,MAX_NUMBER:Vc,MIN_INTEGER:jc,MAX_INTEGER:Bc,MOST_NEAR_DATETIME:qc},Pi=Zo(Mc(),1),ke={pick:g,date:ue,shuffle:I,number:Z,randexp:y},Wc=/^(0|[1-9][0-9]*)$/,Ye={hasProperties:$,getLocalRef:ne,omitProps:k,typecast:qe,merge:U,clone:xe,short:Be,hasValue:Ie,notValue:Me,anyValue:ye,validate:ct,validateValueForSchema:tt,validateValueForOneOf:Nt,isKey:Ht,template:vt,shouldClean:R,clean:wt,isEmpty:Lt,clampDate:Ue},Yc=class{constructor(){this.registry={},this.support={}}reset(l){l?(delete this.registry[l],delete this.support[l]):(this.registry={},this.support={})}extend(l,u){this.registry[l]=u(this.registry[l]),this.support[l]||(this.support[l]=on(()=>this.registry[l]))}define(l,u){this.support[l]=u}get(l){if(typeof this.registry[l]=="undefined")throw new ReferenceError(`'${l}' dependency doesn't exist.`);return this.registry[l]}wrap(l){if(!("generate"in l)){let u=Object.keys(l),f={},S=u.length;for(;S--;){let T=u[S].replace(/^x-/,""),v=this.support[T];if(typeof v=="function"){Object.defineProperty(l,"generate",{configurable:!1,enumerable:!1,writable:!1,value:(A,L)=>v.call(f,l[u[S]],l,u[S],A,L.slice())});break}}}return l}},Jc=Yc,Kn=new rs,ss=gr,Gc=class extends Error{constructor(l,u){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=l,this.path=u}},Mi=Gc,xr={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"]},xr.number=xr.integer,Kc=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Xc=dt,Qc=In,Zc=Qc,eu=Zc,tu=Wt,nu=tu,ru=nu,iu=wn,ls=yr,au=zo,ou=`Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore
109
117
  et dolore magna aliqua Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
110
118
  commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
111
119
  pariatur Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est
112
- laborum`.split(/\W/),fi=si,mi={type:Kt.ALLOWED_TYPES},Ic=li,La=ya,Pc=ci,gi=ui,Mc=ba,Nc=wa,Da="[a-zA-Z][a-zA-Z0-9+-.]*",yi=`https?://{hostname}(?:${Da})+`,Lc="(?:\\?([a-z]{1,7}(=\\w{1,5})?&){0,3})?",$t={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:yi,slug:"[a-zA-Z\\d_-]+","uri-reference":`${yi}${Lc}`,"uri-template":yi.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${Da.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)?)$"},$t.iri=$t["uri-reference"],$t["iri-reference"]=$t["uri-reference"],$t["idn-email"]=$t.email,$t["idn-hostname"]=$t.hostname,Dc=new RegExp(`\\{(${Object.keys($t).join("|")})\\}`),Fc=Sa,Uc=xa,$c={boolean:vc,null:_c,array:Rc,integer:Oc,number:Na,object:Ic,string:Uc},br=$c,qc=re,jc=({refs:l,schema:c,container:f,synchronous:S,refDepthMax:T,refDepthMin:v})=>{let k={},L={},Q=0,N,ie;return k.resolveSchema=(j,he,ce)=>{if(j==null)return null;if(typeof j.generate=="function")return j;if(typeof(j.$id||j.id)=="string"&&(delete j.id,delete j.$id,delete j.$schema),typeof j.$ref=="string"){let xe=Math.max(v,T)-1;if(j.$ref==="#"||L[j.$ref]<0||N===j.$ref&&++Q>xe)return j.$ref!=="#"&&ie&&ie.length===ce.length?Ye.getLocalRef(c,j.$ref,S&&l):(delete j.$ref,j);typeof L[j.$ref]=="undefined"&&(L[j.$ref]=Ae.number(v,T)-1),ie=ce,N=j.$ref;let Re;j.$ref.indexOf("#/")===-1?Re=l[j.$ref]||null:Re=Ye.getLocalRef(c,j.$ref,S&&l)||null;let Ge;if(typeof Re!="undefined"){if(!Re&&_e("ignoreMissingRefs")!==!0)throw new Error(`Reference not found: ${j.$ref}`);L[j.$ref]-=1,Ye.merge(j,Re||{}),Ge=S&&Re&&Re.$ref}return Ge||delete j.$ref,j}if(Array.isArray(j.allOf)){let xe=j.allOf;delete j.allOf,xe.forEach(Re=>{let Ge=k.resolveSchema(Re,null,ce);Ye.merge(j,typeof Ge.thunk=="function"?Ge.thunk(j):Ge),Array.isArray(j.allOf)&&k.resolveSchema(j,he,ce)})}if(Array.isArray(j.oneOf||j.anyOf)&&ce[ce.length-2]!=="dependencies"){let xe=j.oneOf||j.anyOf;return j.enum&&j.oneOf&&(j.enum=j.enum.filter(Re=>Ye.validate(Re,xe))),{thunk(Re){let Ge=Ye.omitProps(j,["anyOf","oneOf"]),Qe=Ae.pick(xe);return Ye.merge(Ge,Qe),xe.forEach(ae=>{ae.required&&ae!==Qe&&ae.required.forEach(C=>{if(Qe.required&&Qe.required.includes(C))return;let I=Ge.required&&Ge.required.includes(C);Ge.properties&&!I&&delete Ge.properties[C],Re&&Re.properties&&delete Re.properties[C]})}),Ge}}}if(Object.keys(j).forEach(xe=>{(Array.isArray(j[xe])||typeof j[xe]=="object")&&!Ye.isKey(xe)&&(j[xe]=k.resolveSchema(j[xe],xe,ce.concat(xe)))}),ce){let xe=ce[ce.length-1];if(xe==="properties"||xe==="items")return j}return f.wrap(j)},k},Bc=jc,Fa=Nt,Ua=rn,At=Aa(oc(),1),ag=At.default.binaryOptions,sg=At.default.boolOptions,lg=At.default.intOptions,cg=At.default.nullOptions,ug=At.default.strOptions,pg=At.default.Schema,dg=At.default.Alias,hg=At.default.Collection,fg=At.default.Merge,mg=At.default.Node,gg=At.default.Pair,yg=At.default.Scalar,zc=At.default.YAMLMap,Vc=At.default.YAMLSeq,wr=Pn,sn=new bc,rt=(l,c,f)=>(console.debug("[json-schema-faker] calling JSONSchemaFaker() is deprecated, call either .generate() or .resolve()"),f&&console.debug("[json-schema-faker] local references are only supported by calling .resolve()"),rt.generate(l,c)),rt.generateWithContext=(l,c)=>{let f=an(c,l);return Fa(f,l,sn,!0)},rt.generate=(l,c)=>Ua(rt.generateWithContext(l,c)),rt.generateYAML=(l,c)=>wr(rt.generateWithContext(l,c)),rt.resolveWithContext=(l,c,f)=>{typeof c=="string"&&(f=c,c={}),f=f||(typeof process!="undefined"&&typeof process.cwd=="function"?process.cwd():""),f=`${f.replace(/\/+$/,"")}/`;let S=an(c,l),T={order:1,canRead(k){let L=k.url.replace("/:",":");return S[L]||S[L.split("/").pop()]},read(k,L){try{L(null,this.canRead(k))}catch(Q){L(Q)}}},{$RefParser:v}=Ra();return v.bundle(f,l,{resolve:{file:{order:100},http:{order:200},fixedRefs:T},dereference:{circular:"ignore"}}).then(k=>Fa(S,k,sn)).catch(k=>{throw new Error(`Error while resolving schema (${k.message})`)})},rt.resolve=(l,c,f)=>rt.resolveWithContext(l,c,f).then(Ua),rt.resolveYAML=(l,c,f)=>rt.resolveWithContext(l,c,f).then(wr),St(),rt.format=Ma,rt.option=_e,rt.random=Ae,rt.extend=(l,c)=>(sn.extend(l,c),rt),rt.define=(l,c)=>(sn.define(l,c),rt),rt.reset=l=>(sn.reset(l),St(),rt),rt.locate=l=>sn.get(l),rt.VERSION="0.5.5",Hc={...rt},Wc=rt}}),wg=o({"src/src/main.iife.js"(l,c){var f=(bg(),u(p));typeof $RefParser!="undefined"&&typeof JSONPath!="undefined"&&f.setDependencies({...JSONPath,$RefParser}),typeof window!="undefined"&&(window.JSONSchemaFaker=f.default),c.exports=f.default,c.exports.JSONSchemaFaker=f.JSONSchemaFaker}});return wg()})();((e,t)=>{e.JSONSchemaFaker=t()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>Vi);Vi.random.shuffle=function(){return["[placeholder]"]};Vi.option({useDefaultValue:!0,alwaysFakeOptionals:!0,fillProperties:!1});function nu(e){return Vi.generate(e)}El();var or=Symbol.for("workflow-serialize"),ar=Symbol.for("workflow-deserialize");var oS=Object.defineProperty,aS=Object.defineProperties,sS=Object.getOwnPropertyDescriptors,ef=Object.getOwnPropertySymbols,lS=Object.prototype.hasOwnProperty,cS=Object.prototype.propertyIsEnumerable,tf=(e,t,n)=>t in e?oS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,af=(e,t)=>{for(var n in t||(t={}))lS.call(t,n)&&tf(e,n,t[n]);if(ef)for(var n of ef(t))cS.call(t,n)&&tf(e,n,t[n]);return e},sf=(e,t)=>aS(e,sS(t)),Ct=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},uS=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},pS=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!uS(e,n)&&(t+=1)}return t},On=(e,t)=>{let n=!1,r=!1,i=-1;for(let o=0;o<e.length;o+=1){if(e[o]==="\\"&&o+1<e.length&&e[o+1]==="`"){o+=1;continue}if(e.substring(o,o+3)==="```"){r=!r,o+=2;continue}if(!r&&e[o]==="`")if(n){if(i<t&&t<o)return!0;n=!1,i=-1}else n=!0,i=o}return!1},dS=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,hS=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(dS,(t,n,r,i)=>Ct(e,i)?t:`${n}\\>${r}`),fS=/(\*\*)([^*]*\*?)$/,mS=/(__)([^_]*?)$/,gS=/(\*\*\*)([^*]*?)$/,yS=/(\*)([^*]*?)$/,bS=/(_)([^_]*?)$/,wS=/(`)([^`]*?)$/,SS=/(~~)([^~]*?)$/,zn=/^[\s_~*`]*$/,lf=/^[\s]*[-*+][\s]+$/,TS=/[\p{L}\p{N}_]/u,xS=/^```[^`\n]*```?$/,kS=/^\*{4,}$/,vS=/(__)([^_]+)_$/,AS=/(~~)([^~]+)~$/,nf=/~~/g,Cn=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:TS.test(e)};var ES=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},cf=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},jo=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},_S=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
113
- `)return!1}return!1},uf=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?_S(e,t):!1;if(e[n]===`
114
- `)return!1}return!1},RS=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
115
- `)return!1}return!1},Rl=(e,t,n)=>{let r=0;for(let u=t-1;u>=0;u-=1)if(e[u]===`
116
- `){r=u+1;break}let i=e.length;for(let u=t;u<e.length;u+=1)if(e[u]===`
117
- `){i=u;break}let o=e.substring(r,i),a=0,s=!1;for(let u of o)if(u===n)a+=1;else if(u!==" "&&u!==" "){s=!0;break}return a>=3&&!s},OS=(e,t,n,r)=>n==="\\"||e.includes("$")&&jo(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&Cn(n)&&Cn(r)||(!n||n===" "||n===" "||n===`
120
+ laborum`.split(/\W/),Ni=Ri,Li={type:Gt.ALLOWED_TYPES},su=Ci,cs=Vo,lu=_i,Di=Oi,cu=Wo,uu=Yo,us="[a-zA-Z][a-zA-Z0-9+-.]*",Fi=`https?://{hostname}(?:${us})+`,pu="(?:\\?([a-z]{1,7}(=\\w{1,5})?&){0,3})?",qt={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:Fi,slug:"[a-zA-Z\\d_-]+","uri-reference":`${Fi}${pu}`,"uri-template":Fi.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${us.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)?)$"},qt.iri=qt["uri-reference"],qt["iri-reference"]=qt["uri-reference"],qt["idn-email"]=qt.email,qt["idn-hostname"]=qt.hostname,du=new RegExp(`\\{(${Object.keys(qt).join("|")})\\}`),hu=Jo,fu=Ko,mu={boolean:eu,null:ru,array:iu,integer:au,number:ls,object:su,string:fu},Ar=mu,gu=re,yu=({refs:l,schema:u,container:f,synchronous:S,refDepthMax:T,refDepthMin:v})=>{let A={},L={},ee=0,N,ie;return A.resolveSchema=(j,he,ce)=>{if(j==null)return null;if(typeof j.generate=="function")return j;if(typeof(j.$id||j.id)=="string"&&(delete j.id,delete j.$id,delete j.$schema),typeof j.$ref=="string"){let Ae=Math.max(v,T)-1;if(j.$ref==="#"||L[j.$ref]<0||N===j.$ref&&++ee>Ae)return j.$ref!=="#"&&ie&&ie.length===ce.length?Ye.getLocalRef(u,j.$ref,S&&l):(delete j.$ref,j);typeof L[j.$ref]=="undefined"&&(L[j.$ref]=ke.number(v,T)-1),ie=ce,N=j.$ref;let Ce;j.$ref.indexOf("#/")===-1?Ce=l[j.$ref]||null:Ce=Ye.getLocalRef(u,j.$ref,S&&l)||null;let Ge;if(typeof Ce!="undefined"){if(!Ce&&Re("ignoreMissingRefs")!==!0)throw new Error(`Reference not found: ${j.$ref}`);L[j.$ref]-=1,Ye.merge(j,Ce||{}),Ge=S&&Ce&&Ce.$ref}return Ge||delete j.$ref,j}if(Array.isArray(j.allOf)){let Ae=j.allOf;delete j.allOf,Ae.forEach(Ce=>{let Ge=A.resolveSchema(Ce,null,ce);Ye.merge(j,typeof Ge.thunk=="function"?Ge.thunk(j):Ge),Array.isArray(j.allOf)&&A.resolveSchema(j,he,ce)})}if(Array.isArray(j.oneOf||j.anyOf)&&ce[ce.length-2]!=="dependencies"){let Ae=j.oneOf||j.anyOf;return j.enum&&j.oneOf&&(j.enum=j.enum.filter(Ce=>Ye.validate(Ce,Ae))),{thunk(Ce){let Ge=Ye.omitProps(j,["anyOf","oneOf"]),Qe=ke.pick(Ae);return Ye.merge(Ge,Qe),Ae.forEach(oe=>{oe.required&&oe!==Qe&&oe.required.forEach(O=>{if(Qe.required&&Qe.required.includes(O))return;let P=Ge.required&&Ge.required.includes(O);Ge.properties&&!P&&delete Ge.properties[O],Ce&&Ce.properties&&delete Ce.properties[O]})}),Ge}}}if(Object.keys(j).forEach(Ae=>{(Array.isArray(j[Ae])||typeof j[Ae]=="object")&&!Ye.isKey(Ae)&&(j[Ae]=A.resolveSchema(j[Ae],Ae,ce.concat(Ae)))}),ce){let Ae=ce[ce.length-1];if(Ae==="properties"||Ae==="items")return j}return f.wrap(j)},A},bu=yu,ps=Dt,ds=ln,kt=Zo(Lc(),1),jg=kt.default.binaryOptions,Bg=kt.default.boolOptions,zg=kt.default.intOptions,Vg=kt.default.nullOptions,Wg=kt.default.strOptions,Yg=kt.default.Schema,Jg=kt.default.Alias,Gg=kt.default.Collection,Kg=kt.default.Merge,Xg=kt.default.Node,Qg=kt.default.Pair,Zg=kt.default.Scalar,wu=kt.default.YAMLMap,Su=kt.default.YAMLSeq,vr=Pn,pn=new Jc,rt=(l,u,f)=>(console.debug("[json-schema-faker] calling JSONSchemaFaker() is deprecated, call either .generate() or .resolve()"),f&&console.debug("[json-schema-faker] local references are only supported by calling .resolve()"),rt.generate(l,u)),rt.generateWithContext=(l,u)=>{let f=un(u,l);return ps(f,l,pn,!0)},rt.generate=(l,u)=>ds(rt.generateWithContext(l,u)),rt.generateYAML=(l,u)=>vr(rt.generateWithContext(l,u)),rt.resolveWithContext=(l,u,f)=>{typeof u=="string"&&(f=u,u={}),f=f||(typeof process!="undefined"&&typeof process.cwd=="function"?process.cwd():""),f=`${f.replace(/\/+$/,"")}/`;let S=un(u,l),T={order:1,canRead(A){let L=A.url.replace("/:",":");return S[L]||S[L.split("/").pop()]},read(A,L){try{L(null,this.canRead(A))}catch(ee){L(ee)}}},{$RefParser:v}=ns();return v.bundle(f,l,{resolve:{file:{order:100},http:{order:200},fixedRefs:T},dereference:{circular:"ignore"}}).then(A=>ps(S,A,pn)).catch(A=>{throw new Error(`Error while resolving schema (${A.message})`)})},rt.resolve=(l,u,f)=>rt.resolveWithContext(l,u,f).then(ds),rt.resolveYAML=(l,u,f)=>rt.resolveWithContext(l,u,f).then(vr),St(),rt.format=ss,rt.option=Re,rt.random=ke,rt.extend=(l,u)=>(pn.extend(l,u),rt),rt.define=(l,u)=>(pn.define(l,u),rt),rt.reset=l=>(pn.reset(l),St(),rt),rt.locate=l=>pn.get(l),rt.VERSION="0.5.5",Tu={...rt},xu=rt}}),ty=a({"src/src/main.iife.js"(l,u){var f=(ey(),c(p));typeof $RefParser!="undefined"&&typeof JSONPath!="undefined"&&f.setDependencies({...JSONPath,$RefParser}),typeof window!="undefined"&&(window.JSONSchemaFaker=f.default),u.exports=f.default,u.exports.JSONSchemaFaker=f.JSONSchemaFaker}});return ty()})();((e,t)=>{e.JSONSchemaFaker=t()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>ua);ua.random.shuffle=function(){return["[placeholder]"]};ua.option({useDefaultValue:!0,alwaysFakeOptionals:!0,fillProperties:!1});function Pu(e){return ua.generate(e)}to();ri();var lr=Symbol.for("workflow-serialize"),cr=Symbol.for("workflow-deserialize");var BS=Object.defineProperty,zS=Object.defineProperties,VS=Object.getOwnPropertyDescriptors,Pf=Object.getOwnPropertySymbols,WS=Object.prototype.hasOwnProperty,YS=Object.prototype.propertyIsEnumerable,Mf=(e,t,n)=>t in e?BS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ff=(e,t)=>{for(var n in t||(t={}))WS.call(t,n)&&Mf(e,n,t[n]);if(Pf)for(var n of Pf(t))YS.call(t,n)&&Mf(e,n,t[n]);return e},Uf=(e,t)=>zS(e,VS(t)),Ot=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},JS=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},GS=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!JS(e,n)&&(t+=1)}return t},_n=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]==="\\"&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}return!1},KS=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,XS=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(KS,(t,n,r,i)=>Ot(e,i)?t:`${n}\\>${r}`),QS=/(\*\*)([^*]*\*?)$/,ZS=/(__)([^_]*?)$/,eT=/(\*\*\*)([^*]*?)$/,tT=/(\*)([^*]*?)$/,nT=/(_)([^_]*?)$/,rT=/(`)([^`]*?)$/,iT=/(~~)([^~]*?)$/,zn=/^[\s_~*`]*$/,Hf=/^[\s]*[-*+][\s]+$/,aT=/[\p{L}\p{N}_]/u,oT=/^```[^`\n]*```?$/,sT=/^\*{4,}$/,lT=/(__)([^_]+)_$/,cT=/(~~)([^~]+)~$/,Nf=/~~/g,On=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:aT.test(e)};var uT=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},$f=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},no=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},pT=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
121
+ `)return!1}return!1},qf=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?pT(e,t):!1;if(e[n]===`
122
+ `)return!1}return!1},dT=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
123
+ `)return!1}return!1},tc=(e,t,n)=>{let r=0;for(let c=t-1;c>=0;c-=1)if(e[c]===`
124
+ `){r=c+1;break}let i=e.length;for(let c=t;c<e.length;c+=1)if(e[c]===`
125
+ `){i=c;break}let a=e.substring(r,i),o=0,s=!1;for(let c of a)if(c===n)o+=1;else if(c!==" "&&c!==" "){s=!0;break}return o>=3&&!s},hT=(e,t,n,r)=>n==="\\"||e.includes("$")&&no(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&On(n)&&On(r)||(!n||n===" "||n===" "||n===`
118
126
  `)&&(!r||r===" "||r===" "||r===`
119
- `)),pf=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let o=i>0?e[i-1]:"",a=i<r-1?e[i+1]:"";OS(e,i,o,a)||(t+=1)}return t},CS=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&jo(e,t)||uf(e,t)||RS(e,t)||n==="_"||r==="_"||n&&r&&Cn(n)&&Cn(r)),IS=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let o=i>0?e[i-1]:"",a=i<r-1?e[i+1]:"";CS(e,i,o,a)||(t+=1)}return t},PS=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},Ol=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},rf=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},MS=(e,t,n)=>{if(!t||zn.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
120
- `),i=r===-1?0:r+1,o=e.substring(i,n);return lf.test(o)&&t.includes(`
121
- `)?!0:Rl(e,n,"*")},NS=e=>{let t=e.match(fS);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Ct(e,r)||On(e,r)||MS(e,n,r)?e:Ol(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},LS=(e,t,n)=>{if(!t||zn.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
122
- `),i=r===-1?0:r+1,o=e.substring(i,n);return lf.test(o)&&t.includes(`
123
- `)?!0:Rl(e,n,"_")},DS=e=>{let t=e.match(mS);if(!t){let i=e.match(vS);if(i){let o=e.lastIndexOf(i[1]);if(!(Ct(e,o)||On(e,o))&&rf(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Ct(e,r)||On(e,r)||LS(e,n,r)?e:rf(e)%2===1?`${e}__`:e},FS=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!jo(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
127
+ `)),jf=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let a=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";hT(e,i,a,o)||(t+=1)}return t},fT=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&no(e,t)||qf(e,t)||dT(e,t)||n==="_"||r==="_"||n&&r&&On(n)&&On(r)),mT=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let a=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";fT(e,i,a,o)||(t+=1)}return t},gT=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},nc=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},Lf=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},yT=(e,t,n)=>{if(!t||zn.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
128
+ `),i=r===-1?0:r+1,a=e.substring(i,n);return Hf.test(a)&&t.includes(`
129
+ `)?!0:tc(e,n,"*")},bT=e=>{let t=e.match(QS);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Ot(e,r)||_n(e,r)||yT(e,n,r)?e:nc(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},wT=(e,t,n)=>{if(!t||zn.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
130
+ `),i=r===-1?0:r+1,a=e.substring(i,n);return Hf.test(a)&&t.includes(`
131
+ `)?!0:tc(e,n,"_")},ST=e=>{let t=e.match(ZS);if(!t){let i=e.match(lT);if(i){let a=e.lastIndexOf(i[1]);if(!(Ot(e,a)||_n(e,a))&&Lf(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Ot(e,r)||_n(e,r)||wT(e,n,r)?e:Lf(e)%2===1?`${e}__`:e},TT=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!no(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
124
132
  `)&&(!i||i===" "||i===" "||i===`
125
- `)||r&&i&&Cn(r)&&Cn(i))continue;return n}}return-1},US=e=>{if(!e.match(yS))return e;let t=FS(e);if(t===-1||Ct(e,t)||On(e,t))return e;let n=e.substring(t+1);return!n||zn.test(n)?e:pf(e)%2===1?`${e}*`:e},df=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!jo(e,n)&&!uf(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&Cn(r)&&Cn(i))continue;return n}}return-1},$S=e=>{let t=e.length;for(;t>0&&e[t-1]===`
126
- `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},qS=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(Ol(t)%2!==1)return null;let n=t.indexOf("**"),r=df(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},jS=e=>{if(!e.match(bS))return e;let t=df(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||zn.test(n)||Ct(e,t)||On(e,t))return e;if(IS(e)%2===1){let r=qS(e);return r!==null?r:$S(e)}return e},BS=e=>{let t=Ol(e),n=pf(e);return t%2===0&&n%2===0},zS=(e,t,n)=>!t||zn.test(t)||Ct(e,n)||On(e,n)?!0:Rl(e,n,"*"),VS=e=>{if(kS.test(e))return e;let t=e.match(gS);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return zS(e,n,r)?e:PS(e)%2===1?BS(e)?e:`${e}***`:e},HS=/<[a-zA-Z/][^>]*$/,WS=e=>{let t=e.match(HS);return!t||t.index===void 0||Ct(e,t.index)?e:e.substring(0,t.index).trimEnd()},YS=e=>!e.match(xS)||e.includes(`
127
- `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,JS=e=>(e.match(/```/g)||[]).length%2===1,GS=e=>{let t=YS(e);if(t!==null)return t;let n=e.match(wS);if(n&&!JS(e)){let r=n[2];if(!r||zn.test(r))return e;if(pS(e)%2===1)return`${e}\``}return e},hf=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",KS=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!hf(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},XS=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!hf(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},QS=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
133
+ `)||r&&i&&On(r)&&On(i))continue;return n}}return-1},xT=e=>{if(!e.match(tT))return e;let t=TT(e);if(t===-1||Ot(e,t)||_n(e,t))return e;let n=e.substring(t+1);return!n||zn.test(n)?e:jf(e)%2===1?`${e}*`:e},Bf=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!no(e,n)&&!qf(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&On(r)&&On(i))continue;return n}}return-1},AT=e=>{let t=e.length;for(;t>0&&e[t-1]===`
134
+ `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},vT=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(nc(t)%2!==1)return null;let n=t.indexOf("**"),r=Bf(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},kT=e=>{if(!e.match(nT))return e;let t=Bf(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||zn.test(n)||Ot(e,t)||_n(e,t))return e;if(mT(e)%2===1){let r=vT(e);return r!==null?r:AT(e)}return e},ET=e=>{let t=nc(e),n=jf(e);return t%2===0&&n%2===0},RT=(e,t,n)=>!t||zn.test(t)||Ot(e,n)||_n(e,n)?!0:tc(e,n,"*"),CT=e=>{if(sT.test(e))return e;let t=e.match(eT);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return RT(e,n,r)?e:gT(e)%2===1?ET(e)?e:`${e}***`:e},_T=/<[a-zA-Z/][^>]*$/,OT=e=>{let t=e.match(_T);return!t||t.index===void 0||Ot(e,t.index)?e:e.substring(0,t.index).trimEnd()},IT=e=>!e.match(oT)||e.includes(`
135
+ `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,PT=e=>(e.match(/```/g)||[]).length%2===1,MT=e=>{let t=IT(e);if(t!==null)return t;let n=e.match(rT);if(n&&!PT(e)){let r=n[2];if(!r||zn.test(r))return e;if(GS(e)%2===1)return`${e}\``}return e},zf=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",NT=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!zf(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},LT=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!zf(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},DT=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
128
136
  `,t)!==-1&&!e.endsWith(`
129
137
  `)?`${e}
130
- $$`:`${e}$$`},ZS=e=>KS(e)%2===0?e:QS(e),eT=e=>XS(e)%2===1?`${e}$`:e,tT=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=ES(e,t);if(r===-1||Ct(e,r))return null;let i=r>0&&e[r-1]==="!",o=i?r-1:r,a=e.substring(0,o);if(i)return a;let s=e.substring(r+1,t);return n==="text-only"?`${a}${s}`:`${a}[${s}](streamdown:incomplete-link)`},of=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Ct(e,n)){if(n>0&&e[n-1]==="!")continue;let r=cf(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},nT=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let o=e.substring(0,i);if(r)return o;if(n==="text-only"){let a=of(e,t);return e.substring(0,a)+e.substring(a+1)}return`${e}](streamdown:incomplete-link)`}if(cf(e,t)===-1){let o=e.substring(0,i);if(r)return o;if(n==="text-only"){let a=of(e,t);return e.substring(0,a)+e.substring(a+1)}return`${e}](streamdown:incomplete-link)`}return null},ff=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Ct(e,n)){let r=tT(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Ct(e,r)){let i=nT(e,r,t);if(i!==null)return i}return e},rT=/^-{1,2}$/,iT=/^[\s]*-{1,2}[\s]+$/,oT=/^={1,2}$/,aT=/^[\s]*={1,2}[\s]+$/,sT=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
131
- `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(rT.test(i)&&!n.match(iT)){let o=r.split(`
132
- `).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(oT.test(i)&&!n.match(aT)){let o=r.split(`
133
- `).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}return e},lT=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),cT=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(lT,(t,n)=>Ct(e,n)?t:"\\~"),uT=e=>{var t,n;let r=e.match(SS);if(r){let i=r[2];if(!i||zn.test(i))return e;let o=e.lastIndexOf(r[1]);if(Ct(e,o)||On(e,o))return e;if(((t=e.match(nf))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(AS);if(i){let o=e.lastIndexOf(i[0].slice(0,2));if(Ct(e,o)||On(e,o))return e;if(((n=e.match(nf))==null?void 0:n.length)%2===1)return`${e}~`}}return e},_l=e=>e!==!1,pT=e=>e===!0,Ot={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},dT=[{handler:{name:"singleTilde",handle:cT,priority:Ot.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:hS,priority:Ot.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:WS,priority:Ot.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:sT,priority:Ot.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:ff,priority:Ot.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:VS,priority:Ot.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:NS,priority:Ot.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:DS,priority:Ot.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:US,priority:Ot.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:jS,priority:Ot.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:GS,priority:Ot.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:uT,priority:Ot.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:ZS,priority:Ot.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:eT,priority:Ot.INLINE_KATEX},optionKey:"inlineKatex"}],hT=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return dT.filter(({handler:r,optionKey:i})=>r.name==="links"?_l(e==null?void 0:e.links)||_l(e==null?void 0:e.images):r.name==="inlineKatex"?pT(e==null?void 0:e.inlineKatex):_l(e==null?void 0:e[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:sf(af({},r),{handle:o=>ff(o,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},fT=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=hT(t),o=((n=t==null?void 0:t.handlers)!=null?n:[]).map(s=>{var u;return{handler:sf(af({},s),{priority:(u=s.priority)!=null?u:Ot.DEFAULT}),earlyReturn:void 0}}),a=[...i,...o].sort((s,u)=>{var p,d;return((p=s.handler.priority)!=null?p:0)-((d=u.handler.priority)!=null?d:0)});for(let{handler:s,earlyReturn:u}of a)if(r=s.handle(r),u!=null&&u(r))return r;return r},zr=fT;var mT="__cb:",gT="chat:callback:",yT=720*60*60*1e3;function bT(e){return`${mT}${e}`}function wT(){return crypto.randomUUID().replace(/-/g,"").slice(0,16)}async function ST(e,t){return{type:"actions",children:await Promise.all(e.children.map(async n=>{if(n.type!=="button"||!n.callbackUrl)return n;let r=wT(),i={url:n.callbackUrl,originalValue:n.value};return await t.set(`${gT}${r}`,i,yT),{type:"button",id:n.id,label:n.label,style:n.style,disabled:n.disabled,value:bT(r),actionType:n.actionType}}))}}function Tf(e){for(let t of e){if(t.type==="actions"){for(let n of t.children)if(n.type==="button"&&n.callbackUrl)return!0}if(t.type==="section"&&"children"in t&&Tf(t.children))return!0}return!1}async function xf(e,t){let n=[];for(let r of e)r.type==="actions"?n.push(await ST(r,t)):r.type==="section"&&"children"in r?n.push({...r,children:await xf(r.children,t)}):n.push(r);return n}async function Bo(e,t){return Tf(e.children)?{...e,children:await xf(e.children,t)}:e}var mf=null;function zo(){if(!mf)throw new Error("No Chat singleton registered. Call chat.registerSingleton() first.");return mf}var TT=new Set(["markdown_text","task_update","plan_update"]);async function*kf(e){var r,i;let t=!1,n=!1;for await(let o of e){if(typeof o=="string"){yield o;continue}if(o===null||typeof o!="object"||!("type"in o))continue;let a=o;if(TT.has(a.type)){yield o;continue}let s=(i=(r=a.text)!=null?r:a.delta)!=null?i:a.textDelta;a.type==="text-delta"&&typeof s=="string"?(t&&n&&(yield`
138
+ $$`:`${e}$$`},FT=e=>NT(e)%2===0?e:DT(e),UT=e=>LT(e)%2===1?`${e}$`:e,HT=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=uT(e,t);if(r===-1||Ot(e,r))return null;let i=r>0&&e[r-1]==="!",a=i?r-1:r,o=e.substring(0,a);if(i)return o;let s=e.substring(r+1,t);return n==="text-only"?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`},Df=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Ot(e,n)){if(n>0&&e[n-1]==="!")continue;let r=$f(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},$T=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let a=e.substring(0,i);if(r)return a;if(n==="text-only"){let o=Df(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if($f(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n==="text-only"){let o=Df(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},Vf=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Ot(e,n)){let r=HT(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Ot(e,r)){let i=$T(e,r,t);if(i!==null)return i}return e},qT=/^-{1,2}$/,jT=/^[\s]*-{1,2}[\s]+$/,BT=/^={1,2}$/,zT=/^[\s]*={1,2}[\s]+$/,VT=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
139
+ `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(qT.test(i)&&!n.match(jT)){let a=r.split(`
140
+ `).at(-1);if(a&&a.trim().length>0)return`${e}\u200B`}if(BT.test(i)&&!n.match(zT)){let a=r.split(`
141
+ `).at(-1);if(a&&a.trim().length>0)return`${e}\u200B`}return e},WT=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),YT=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(WT,(t,n)=>Ot(e,n)?t:"\\~"),JT=e=>{var t,n;let r=e.match(iT);if(r){let i=r[2];if(!i||zn.test(i))return e;let a=e.lastIndexOf(r[1]);if(Ot(e,a)||_n(e,a))return e;if(((t=e.match(Nf))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(cT);if(i){let a=e.lastIndexOf(i[0].slice(0,2));if(Ot(e,a)||_n(e,a))return e;if(((n=e.match(Nf))==null?void 0:n.length)%2===1)return`${e}~`}}return e},ec=e=>e!==!1,GT=e=>e===!0,_t={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},KT=[{handler:{name:"singleTilde",handle:YT,priority:_t.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:XS,priority:_t.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:OT,priority:_t.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:VT,priority:_t.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:Vf,priority:_t.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:CT,priority:_t.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:bT,priority:_t.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:ST,priority:_t.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:xT,priority:_t.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:kT,priority:_t.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:MT,priority:_t.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:JT,priority:_t.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:FT,priority:_t.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:UT,priority:_t.INLINE_KATEX},optionKey:"inlineKatex"}],XT=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return KT.filter(({handler:r,optionKey:i})=>r.name==="links"?ec(e==null?void 0:e.links)||ec(e==null?void 0:e.images):r.name==="inlineKatex"?GT(e==null?void 0:e.inlineKatex):ec(e==null?void 0:e[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:Uf(Ff({},r),{handle:a=>Vf(a,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},QT=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=XT(t),a=((n=t==null?void 0:t.handlers)!=null?n:[]).map(s=>{var c;return{handler:Uf(Ff({},s),{priority:(c=s.priority)!=null?c:_t.DEFAULT}),earlyReturn:void 0}}),o=[...i,...a].sort((s,c)=>{var p,d;return((p=s.handler.priority)!=null?p:0)-((d=c.handler.priority)!=null?d:0)});for(let{handler:s,earlyReturn:c}of o)if(r=s.handle(r),c!=null&&c(r))return r;return r},ii=QT;var ZT=new Set(["markdown_text","task_update","plan_update"]);async function*io(e){var r,i;let t=!1,n=!1;for await(let a of e){if(typeof a=="string"){yield a;continue}if(a===null||typeof a!="object"||!("type"in a))continue;let o=a;if(ZT.has(o.type)){yield a;continue}let s=(i=(r=o.text)!=null?r:o.delta)!=null?i:o.textDelta;o.type==="text-delta"&&typeof s=="string"?(t&&n&&(yield`
134
142
 
135
- `),t=!1,n=!0,yield s):a.type==="finish-step"&&(t=!0)}}var xT=new WeakMap;var Vn=class Il{constructor(t){ke(this,"id");ke(this,"threadId");ke(this,"text");ke(this,"formatted");ke(this,"raw");ke(this,"author");ke(this,"metadata");ke(this,"attachments");ke(this,"isMention");ke(this,"userKey");ke(this,"links");ke(this,"_subjectPromise");var n;this.id=t.id,this.threadId=t.threadId,this.text=t.text,this.formatted=t.formatted,this.raw=t.raw,this.author=t.author,this.metadata=t.metadata,this.attachments=t.attachments,this.isMention=t.isMention,this.links=(n=t.links)!=null?n:[]}get subject(){if(this._subjectPromise)return this._subjectPromise;let t=xT.get(this);return t!=null&&t.fetchSubject?(this._subjectPromise=t.fetchSubject(this.raw).catch(()=>null),this._subjectPromise):(this._subjectPromise=Promise.resolve(null),this._subjectPromise)}toJSON(){var t;return{_type:"chat:Message",id:this.id,threadId:this.threadId,text:this.text,formatted:this.formatted,raw:this.raw,author:{userId:this.author.userId,userName:this.author.userName,fullName:this.author.fullName,isBot:this.author.isBot,isMe:this.author.isMe},metadata:{dateSent:this.metadata.dateSent.toISOString(),edited:this.metadata.edited,editedAt:(t=this.metadata.editedAt)==null?void 0:t.toISOString()},attachments:this.attachments.map(n=>({type:n.type,url:n.url,name:n.name,mimeType:n.mimeType,size:n.size,width:n.width,height:n.height,fetchMetadata:n.fetchMetadata})),isMention:this.isMention,links:this.links.length>0?this.links.map(n=>({url:n.url,title:n.title,description:n.description,imageUrl:n.imageUrl,siteName:n.siteName})):void 0}}static fromJSON(t){return new Il({id:t.id,threadId:t.threadId,text:t.text,formatted:t.formatted,raw:t.raw,author:t.author,metadata:{dateSent:new Date(t.metadata.dateSent),edited:t.metadata.edited,editedAt:t.metadata.editedAt?new Date(t.metadata.editedAt):void 0},attachments:t.attachments,isMention:t.isMention,links:t.links})}static[or](t){return t.toJSON()}static[ar](t){return Il.fromJSON(t)}},kT=Symbol.for("chat.postable");function vf(e){return typeof e=="object"&&e!==null&&e.$$typeof===kT}async function Af(e,t,n,r,i){let o=a=>{var s;return{adapter:t,logger:i,messageId:a.id,threadId:(s=a.threadId)!=null?s:n}};if(e.isSupported(t)&&t.postObject){let a=await t.postObject(n,e.kind,e.getPostData());e.onPosted(o(a))}else{let a=await r(n,e.getFallbackText());e.onPosted(o(a))}}var vT=class extends Error{constructor(t,n,r){super(t);ke(this,"code");ke(this,"cause");this.name="ChatError",this.code=n,this.cause=r}};var Ef=class extends vT{constructor(t,n,r){super(t,"NOT_IMPLEMENTED",r);ke(this,"feature");this.name="NotImplementedError",this.feature=n}};var Vo=720*60*60*1e3,gf="channel-state:";function AT(e){return"adapterName"in e&&!("adapter"in e)}function ET(e){return e!==null&&typeof e=="object"&&Symbol.asyncIterator in e}var _T=class Pl{constructor(t){ke(this,"id");ke(this,"isDM");ke(this,"channelVisibility");ke(this,"_adapter");ke(this,"_adapterName");ke(this,"_stateAdapterInstance");ke(this,"_name",null);ke(this,"_threadHistory");var n,r;this.id=t.id,this.isDM=(n=t.isDM)!=null?n:!1,this.channelVisibility=(r=t.channelVisibility)!=null?r:"unknown",AT(t)?this._adapterName=t.adapterName:(this._adapter=t.adapter,this._stateAdapterInstance=t.stateAdapter,this._threadHistory=t.threadHistory)}get adapter(){if(this._adapter)return this._adapter;if(!this._adapterName)throw new Error("Channel has no adapter configured");let n=zo().getAdapter(this._adapterName);if(!n)throw new Error(`Adapter "${this._adapterName}" not found in Chat singleton`);return this._adapter=n,n}get _stateAdapter(){if(this._stateAdapterInstance)return this._stateAdapterInstance;let t=zo();return this._stateAdapterInstance=t.getState(),this._stateAdapterInstance}get name(){return this._name}get state(){return this._stateAdapter.get(`${gf}${this.id}`)}async setState(t,n){let r=`${gf}${this.id}`;if(n!=null&&n.replace)await this._stateAdapter.set(r,t,Vo);else{let o={...await this._stateAdapter.get(r),...t};await this._stateAdapter.set(r,o,Vo)}}get messages(){let t=this.adapter,n=this.id,r=this._threadHistory;return{async*[Symbol.asyncIterator](){let i,o=!1;for(;;){let a={cursor:i,direction:"backward"},s=t.fetchChannelMessages?await t.fetchChannelMessages(n,a):await t.fetchMessages(n,a),u=[...s.messages].reverse();for(let p of u)o=!0,yield p;if(!s.nextCursor||s.messages.length===0)break;i=s.nextCursor}if(!o&&r){let a=await r.getMessages(n);for(let s=a.length-1;s>=0;s--)yield a[s]}}}}threads(){let t=this.adapter,n=this.id;return{async*[Symbol.asyncIterator](){if(!t.listThreads)return;let r;for(;;){let i=await t.listThreads(n,{cursor:r});for(let o of i.threads)yield o;if(!i.nextCursor||i.threads.length===0)break;r=i.nextCursor}}}}async fetchMetadata(){var t;if(this.adapter.fetchChannelInfo){let n=await this.adapter.fetchChannelInfo(this.id);return this._name=(t=n.name)!=null?t:null,n}return{id:this.id,isDM:this.isDM,metadata:{}}}async post(t){if(vf(t))return await this.handlePostableObject(t),t;if(ET(t)){let r="";for await(let i of kf(t))typeof i=="string"?r+=i:i.type==="markdown_text"&&(r+=i.text);return this.postSingleMessage({markdown:r})}let n=t;if(Ht(t)){let r=Vt(t);if(!r)throw new Error("Invalid JSX element: must be a Card element");n=r}return n=await this.processCallbackUrls(n),this.postSingleMessage(n)}async handlePostableObject(t){await Af(t,this.adapter,this.id,(n,r)=>this.adapter.postChannelMessage?this.adapter.postChannelMessage(n,r):this.adapter.postMessage(n,r))}async postSingleMessage(t){let n=this.adapter.postChannelMessage?await this.adapter.postChannelMessage(this.id,t):await this.adapter.postMessage(this.id,t),r=this.createSentMessage(n.id,t,n.threadId);return this._threadHistory&&await this._threadHistory.append(this.id,new Vn(r)),r}async postEphemeral(t,n,r){let{fallbackToDM:i}=r,o=typeof t=="string"?t:t.userId,a;if(Ht(n)){let s=Vt(n);if(!s)throw new Error("Invalid JSX element: must be a Card element");a=s}else a=n;if(a=await this.processCallbackUrls(a),this.adapter.postEphemeral)return this.adapter.postEphemeral(this.id,o,a);if(!i)return null;if(this.adapter.openDM){let s=await this.adapter.openDM(o),u=await this.adapter.postMessage(s,a);return{id:u.id,threadId:s,usedFallback:!0,raw:u.raw}}return null}async schedule(t,n){let r;if(Ht(t)){let i=Vt(t);if(!i)throw new Error("Invalid JSX element: must be a Card element");r=i}else r=t;if(r=await this.processCallbackUrls(r),!this.adapter.scheduleMessage)throw new Ef("Scheduled messages are not supported by this adapter","scheduling");return this.adapter.scheduleMessage(this.id,r,n)}async processCallbackUrls(t){var n;if(typeof t=="string")return t;if("type"in t&&t.type==="card")return Bo(t,this._stateAdapter);if("card"in t&&((n=t.card)==null?void 0:n.type)==="card"){let r=await Bo(t.card,this._stateAdapter);if(r!==t.card)return{...t,card:r}}return t}async startTyping(t){await this.adapter.startTyping(this.id,t)}mentionUser(t){return`<@${t}>`}toJSON(){var t;return{_type:"chat:Channel",id:this.id,adapterName:(t=this._adapterName)!=null?t:this.adapter.name,channelVisibility:this.channelVisibility,isDM:this.isDM}}static fromJSON(t,n){let r=new Pl({id:t.id,adapterName:t.adapterName,channelVisibility:t.channelVisibility,isDM:t.isDM});return n&&(r._adapter=n),r}static[or](t){return t.toJSON()}static[ar](t){return Pl.fromJSON(t)}createSentMessage(t,n,r){let i=this.adapter,o=r||this.id,a=this,{plainText:s,formatted:u,attachments:p}=OT(n);return{id:t,threadId:o,text:s,formatted:u,raw:null,author:{userId:"self",userName:i.userName,fullName:i.userName,isBot:!0,isMe:!0},metadata:{dateSent:new Date,edited:!1},attachments:p,links:[],toJSON(){return new Vn(this).toJSON()},async edit(h){let g=h;if(Ht(h)){let y=Vt(h);if(!y)throw new Error("Invalid JSX element: must be a Card element");g=y}return g=await a.processCallbackUrls(g),await i.editMessage(o,t,g),a.createSentMessage(t,g)},async delete(){await i.deleteMessage(o,t)},async addReaction(h){await i.addReaction(o,t,h)},async removeReaction(h){await i.removeReaction(o,t,h)}}}};function RT(e,t){return e.channelIdFromThreadId(t)}function OT(e){if(typeof e=="string")return{plainText:e,formatted:yn([gn([mn(e)])]),attachments:[]};if("raw"in e)return{plainText:e.raw,formatted:yn([gn([mn(e.raw)])]),attachments:e.attachments||[]};if("markdown"in e){let t=yl(e.markdown);return{plainText:jr(t),formatted:t,attachments:e.attachments||[]}}if("ast"in e)return{plainText:jr(e.ast),formatted:e.ast,attachments:e.attachments||[]};if("card"in e){let t=e.fallbackText||Br(e.card);return{plainText:t,formatted:yn([gn([mn(t)])]),attachments:[]}}if("type"in e&&e.type==="card"){let t=Br(e);return{plainText:t,formatted:yn([gn([mn(t)])]),attachments:[]}}throw new Error("Invalid PostableMessage format")}var CT=class{constructor(e={}){ke(this,"accumulated","");ke(this,"dirty",!0);ke(this,"cachedRender","");ke(this,"finished",!1);ke(this,"fenceToggles",0);ke(this,"incompleteLine","");ke(this,"options");var t;this.options={wrapTablesForAppend:(t=e.wrapTablesForAppend)!=null?t:!0}}push(e){var n;this.accumulated+=e,this.dirty=!0,this.incompleteLine+=e;let t=this.incompleteLine.split(`
136
- `);this.incompleteLine=(n=t.pop())!=null?n:"";for(let r of t){let i=r.trimStart();(i.startsWith("```")||i.startsWith("~~~"))&&this.fenceToggles++}}isAccumulatedInsideFence(){let e=this.fenceToggles%2===1,t=this.incompleteLine.trimStart();return(t.startsWith("```")||t.startsWith("~~~"))&&(e=!e),e}render(){if(!this.dirty)return this.cachedRender;if(this.dirty=!1,this.finished)return this.cachedRender=zr(this.accumulated),this.cachedRender;if(this.isAccumulatedInsideFence())return this.cachedRender=zr(this.accumulated),this.cachedRender;let e=bf(this.accumulated);return this.cachedRender=zr(e),this.cachedRender}getCommittableText(){if(this.finished)return this.formatAppendOnlyText(this.accumulated,!0);let e=this.accumulated;if(e.length>0&&!e.endsWith(`
143
+ `),t=!1,n=!0,yield s):o.type==="finish-step"&&(t=!0)}}var ex=new WeakMap;var rn=class ro{constructor(t){Se(this,"id");Se(this,"threadId");Se(this,"text");Se(this,"formatted");Se(this,"raw");Se(this,"author");Se(this,"metadata");Se(this,"attachments");Se(this,"replyTo");Se(this,"isMention");Se(this,"userKey");Se(this,"links");Se(this,"_subjectPromise");var n;this.id=t.id,this.threadId=t.threadId,this.text=t.text,this.formatted=t.formatted,this.raw=t.raw,this.author=t.author,this.metadata=t.metadata,this.attachments=t.attachments,this.replyTo=t.replyTo,this.isMention=t.isMention,this.links=(n=t.links)!=null?n:[]}get subject(){if(this._subjectPromise)return this._subjectPromise;let t=ex.get(this);return t!=null&&t.fetchSubject?(this._subjectPromise=t.fetchSubject(this.raw).catch(()=>null),this._subjectPromise):(this._subjectPromise=Promise.resolve(null),this._subjectPromise)}toJSON(){var t,n;return{_type:"chat:Message",id:this.id,threadId:this.threadId,text:this.text,formatted:this.formatted,raw:this.raw,author:{userId:this.author.userId,userName:this.author.userName,fullName:this.author.fullName,...this.author.email===void 0?{}:{email:this.author.email},isBot:this.author.isBot,isMe:this.author.isMe,isSystem:this.author.isSystem},metadata:{dateSent:this.metadata.dateSent.toISOString(),edited:this.metadata.edited,editedAt:(t=this.metadata.editedAt)==null?void 0:t.toISOString()},attachments:this.attachments.map(r=>({type:r.type,url:r.url,name:r.name,mimeType:r.mimeType,size:r.size,width:r.width,height:r.height,fetchMetadata:r.fetchMetadata})),replyTo:(n=this.replyTo)==null?void 0:n.toJSON(),isMention:this.isMention,links:this.links.length>0?this.links.map(r=>({url:r.url,title:r.title,description:r.description,imageUrl:r.imageUrl,siteName:r.siteName})):void 0}}static fromJSON(t){return new ro({id:t.id,threadId:t.threadId,text:t.text,formatted:t.formatted,raw:t.raw,author:t.author,metadata:{dateSent:new Date(t.metadata.dateSent),edited:t.metadata.edited,editedAt:t.metadata.editedAt?new Date(t.metadata.editedAt):void 0},attachments:t.attachments,replyTo:t.replyTo?ro.fromJSON(t.replyTo):void 0,isMention:t.isMention,links:t.links})}static[lr](t){return t.toJSON()}static[cr](t){return ro.fromJSON(t)}},Qf=Symbol.for("chat.postable");function lc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qf}async function Zf(e,t,n,r,i){let a=o=>{var s;return{adapter:t,logger:i,messageId:o.id,threadId:(s=o.threadId)!=null?s:n}};if(e.isSupported(t)&&t.postObject){let o=await t.postObject(n,e.kind,e.getPostData());e.onPosted(a(o))}else{let o=await r(n,e.getFallbackText());e.onPosted(a(o))}}var ao=class extends Error{constructor(t,n,r){super(t);Se(this,"code");Se(this,"cause");this.name="ChatError",this.code=n,this.cause=r}};var ai=class extends ao{constructor(t,n,r){super(t,"NOT_IMPLEMENTED",r);Se(this,"feature");this.name="NotImplementedError",this.feature=n}};var oi=720*60*60*1e3,tx="__cb:",nx="chat:callback:",rx=10080*60*1e3;function ix(e){return`${tx}${e}`}function ax(){return crypto.randomUUID().replace(/-/g,"").slice(0,16)}async function ox(e,t,n){return{type:"actions",children:await Promise.all(e.children.map(async r=>{if(r.type!=="button"||!r.callbackUrl)return r;let i=ax(),a={actionId:r.id,url:r.callbackUrl,originalValue:r.value,scope:n};await t.set(`${nx}${i}`,a,rx);let{callbackUrl:o,...s}=r;return{...s,value:ix(i)}}))}}function em(e){for(let t of e){if(t.type==="actions"){for(let n of t.children)if(n.type==="button"&&n.callbackUrl)return!0}if(t.type==="section"&&"children"in t&&em(t.children))return!0}return!1}async function tm(e,t,n){let r=[];for(let i of e)i.type==="actions"?r.push(await ox(i,t,n)):i.type==="section"&&"children"in i?r.push({...i,children:await tm(i.children,t,n)}):r.push(i);return r}async function oo(e,t,n){return em(e.children)?{...e,children:await tm(e.children,t,n)}:e}var Wf=null;function si(){if(!Wf)throw new Error("No Chat singleton registered. Call chat.registerSingleton() first.");return Wf}var Yf="channel-state:";function sx(e){return"adapterName"in e&&!("adapter"in e)}function lx(e){return e!==null&&typeof e=="object"&&Symbol.asyncIterator in e}var nm=class ic{constructor(t){Se(this,"id");Se(this,"isDM");Se(this,"channelVisibility");Se(this,"_adapter");Se(this,"_adapterName");Se(this,"_stateAdapterInstance");Se(this,"_name",null);Se(this,"_threadHistory");var n,r;this.id=t.id,this.isDM=(n=t.isDM)!=null?n:!1,this.channelVisibility=(r=t.channelVisibility)!=null?r:"unknown",sx(t)?this._adapterName=t.adapterName:(this._adapter=t.adapter,this._stateAdapterInstance=t.stateAdapter,this._threadHistory=t.threadHistory)}get adapter(){if(this._adapter)return this._adapter;if(!this._adapterName)throw new Error("Channel has no adapter configured");let n=si().getAdapter(this._adapterName);if(!n)throw new Error(`Adapter "${this._adapterName}" not found in Chat singleton`);return this._adapter=n,n}get _stateAdapter(){if(this._stateAdapterInstance)return this._stateAdapterInstance;let t=si();return this._stateAdapterInstance=t.getState(),this._stateAdapterInstance}get name(){return this._name}get state(){return this._stateAdapter.get(`${Yf}${this.id}`)}async setState(t,n){let r=`${Yf}${this.id}`;if(n!=null&&n.replace)await this._stateAdapter.set(r,t,oi);else{let a={...await this._stateAdapter.get(r),...t};await this._stateAdapter.set(r,a,oi)}}get messages(){let t=this.adapter,n=this.id,r=this._threadHistory;return{async*[Symbol.asyncIterator](){let i,a=!1;for(;;){let o={cursor:i,direction:"backward"},s=t.fetchChannelMessages?await t.fetchChannelMessages(n,o):await t.fetchMessages(n,o),c=[...s.messages].reverse();for(let p of c)a=!0,yield p;if(!s.nextCursor||s.messages.length===0)break;i=s.nextCursor}if(!a&&r){let o=await r.getMessages(n);for(let s=o.length-1;s>=0;s--)yield o[s]}}}}threads(){let t=this.adapter,n=this.id;return{async*[Symbol.asyncIterator](){if(!t.listThreads)return;let r;for(;;){let i=await t.listThreads(n,{cursor:r});for(let a of i.threads)yield a;if(!i.nextCursor||i.threads.length===0)break;r=i.nextCursor}}}}async fetchMetadata(){var t;if(this.adapter.fetchChannelInfo){let n=await this.adapter.fetchChannelInfo(this.id);return this._name=(t=n.name)!=null?t:null,n}return{id:this.id,isDM:this.isDM,metadata:{}}}async post(t){if(lc(t))return await this.handlePostableObject(t),t;if(lx(t)){let r="";for await(let i of io(t))typeof i=="string"?r+=i:i.type==="markdown_text"&&(r+=i.text);return this.postSingleMessage({markdown:r})}let n=t;if(Pt(t)){let r=It(t);if(!r)throw new Error("Invalid JSX element: must be a Card element");n=r}return n=await this.processCallbackUrls(n),this.postSingleMessage(n)}async handlePostableObject(t){await Zf(t,this.adapter,this.id,(n,r)=>this.adapter.postChannelMessage?this.adapter.postChannelMessage(n,r):this.adapter.postMessage(n,r))}async postSingleMessage(t){let n=this.adapter.postChannelMessage?await this.adapter.postChannelMessage(this.id,t):await this.adapter.postMessage(this.id,t),r=this.createSentMessage(n.id,t,n.threadId);return this._threadHistory&&await this._threadHistory.append(this.id,new rn(r)),r}async postEphemeral(t,n,r){let{fallbackToDM:i}=r,a=typeof t=="string"?t:t.userId,o;if(Pt(n)){let s=It(n);if(!s)throw new Error("Invalid JSX element: must be a Card element");o=s}else o=n;if(this.adapter.postEphemeral)return o=await this.processCallbackUrls(o),this.adapter.postEphemeral(this.id,a,o);if(!i)return null;if(this.adapter.openDM){let s=await this.adapter.openDM(a);o=await this.processCallbackUrls(o,{id:this.adapter.channelIdFromThreadId(s),type:"channel"});let c=await this.adapter.postMessage(s,o);return{id:c.id,threadId:s,usedFallback:!0,raw:c.raw}}return null}async schedule(t,n){let r;if(Pt(t)){let i=It(t);if(!i)throw new Error("Invalid JSX element: must be a Card element");r=i}else r=t;if(r=await this.processCallbackUrls(r),!this.adapter.scheduleMessage)throw new ai("Scheduled messages are not supported by this adapter","scheduling");return this.adapter.scheduleMessage(this.id,r,n)}async processCallbackUrls(t,n={id:this.id,type:"channel"}){var r;if(typeof t=="string")return t;if("type"in t&&t.type==="card")return oo(t,this._stateAdapter,n);if("card"in t&&((r=t.card)==null?void 0:r.type)==="card"){let i=await oo(t.card,this._stateAdapter,n);if(i!==t.card)return{...t,card:i}}return t}async startTyping(t){await this.adapter.startTyping(this.id,t)}mentionUser(t){return`<@${t}>`}toJSON(){var t;return{_type:"chat:Channel",id:this.id,adapterName:(t=this._adapterName)!=null?t:this.adapter.name,channelVisibility:this.channelVisibility,isDM:this.isDM}}static fromJSON(t,n){let r=new ic({id:t.id,adapterName:t.adapterName,channelVisibility:t.channelVisibility,isDM:t.isDM});return n&&(r._adapter=n),r}static[lr](t){return t.toJSON()}static[cr](t){return ic.fromJSON(t)}createSentMessage(t,n,r){let i=this.adapter,a=r||this.id,o=this,{plainText:s,formatted:c,attachments:p}=cx(n);return{id:t,threadId:a,text:s,formatted:c,raw:null,author:{userId:"self",userName:i.userName,fullName:i.userName,isBot:!0,isMe:!0},metadata:{dateSent:new Date,edited:!1},attachments:p,links:[],toJSON(){return new rn(this).toJSON()},async edit(h){let y=h;if(Pt(h)){let g=It(h);if(!g)throw new Error("Invalid JSX element: must be a Card element");y=g}return y=await o.processCallbackUrls(y,{id:a,type:"thread"}),await i.editMessage(a,t,y),o.createSentMessage(t,y,a)},async delete(){await i.deleteMessage(a,t)},async addReaction(h){await i.addReaction(a,t,h)},async removeReaction(h){await i.removeReaction(a,t,h)}}}};function rm(e,t){return e.channelIdFromThreadId(t)}function cx(e){if(typeof e=="string")return{plainText:e,formatted:nn([tn([en(e)])]),attachments:[]};if("raw"in e)return{plainText:e.raw,formatted:nn([tn([en(e.raw)])]),attachments:e.attachments||[]};if("markdown"in e){let t=Va(e.markdown);return{plainText:sr(t),formatted:t,attachments:e.attachments||[]}}if("ast"in e)return{plainText:sr(e.ast),formatted:e.ast,attachments:e.attachments||[]};if("card"in e){let t=e.fallbackText||ni(e.card);return{plainText:t,formatted:nn([tn([en(t)])]),attachments:[]}}if("type"in e&&e.type==="card"){let t=ni(e);return{plainText:t,formatted:nn([tn([en(t)])]),attachments:[]}}throw new Error("Invalid PostableMessage format")}var im=class{constructor(e={}){Se(this,"accumulated","");Se(this,"dirty",!0);Se(this,"cachedRender","");Se(this,"finished",!1);Se(this,"fenceToggles",0);Se(this,"incompleteLine","");Se(this,"options");var t;this.options={wrapTablesForAppend:(t=e.wrapTablesForAppend)!=null?t:!0}}push(e){var n;this.accumulated+=e,this.dirty=!0,this.incompleteLine+=e;let t=this.incompleteLine.split(`
144
+ `);this.incompleteLine=(n=t.pop())!=null?n:"";for(let r of t){let i=r.trimStart();(i.startsWith("```")||i.startsWith("~~~"))&&this.fenceToggles++}}isAccumulatedInsideFence(){let e=this.fenceToggles%2===1,t=this.incompleteLine.trimStart();return(t.startsWith("```")||t.startsWith("~~~"))&&(e=!e),e}render(){if(!this.dirty)return this.cachedRender;if(this.dirty=!1,this.finished)return this.cachedRender=ii(this.accumulated),this.cachedRender;if(this.isAccumulatedInsideFence())return this.cachedRender=ii(this.accumulated),this.cachedRender;let e=Gf(this.accumulated);return this.cachedRender=ii(e),this.cachedRender}getCommittableText(){if(this.finished)return this.formatAppendOnlyText(this.accumulated,!0);let e=this.accumulated;if(e.length>0&&!e.endsWith(`
137
145
  `)){let r=e.lastIndexOf(`
138
- `),i=r>=0?e.slice(0,r+1):"";if(Cl(i))return this.formatAppendOnlyText(e);e=i}if(Cl(e))return this.formatAppendOnlyText(e);let t=bf(e),n=this.formatAppendOnlyText(t);return Cl(n)?n:PT(n)}getText(){return this.accumulated}finish(){return this.finished=!0,this.dirty=!0,this.render()}formatAppendOnlyText(e,t=!1){return this.options.wrapTablesForAppend?MT(e,t):e}},IT=new Set(["*","~","`","["]);function yf(e){return zr(e).length<=e.length}function PT(e){if(e.length===0||yf(e))return e;for(let t=e.length-1;t>=0;t--)if(IT.has(e[t])){for(;t>0&&e[t-1]===e[t];)t--;let n=e.slice(0,t);if(yf(n))return n}return""}var Ml=/^\|.*\|$/,Nl=/^\|[\s:]*-{1,}[\s:]*(\|[\s:]*-{1,}[\s:]*)*\|$/;function Cl(e){let t=!1;for(let n of e.split(`
139
- `)){let r=n.trimStart();(r.startsWith("```")||r.startsWith("~~~"))&&(t=!t)}return t}function bf(e){let t=e.endsWith(`
146
+ `),i=r>=0?e.slice(0,r+1):"";if(rc(i))return this.formatAppendOnlyText(e);e=i}if(rc(e))return this.formatAppendOnlyText(e);let t=Gf(e),n=this.formatAppendOnlyText(t);return rc(n)?n:px(n)}getText(){return this.accumulated}finish(){return this.finished=!0,this.dirty=!0,this.render()}formatAppendOnlyText(e,t=!1){return this.options.wrapTablesForAppend?dx(e,t):e}},ux=new Set(["*","~","`","["]);function Jf(e){return ii(e).length<=e.length}function px(e){if(e.length===0||Jf(e))return e;for(let t=e.length-1;t>=0;t--)if(ux.has(e[t])){for(;t>0&&e[t-1]===e[t];)t--;let n=e.slice(0,t);if(Jf(n))return n}return""}var ac=/^\|.*\|$/,oc=/^\|[\s:]*-{1,}[\s:]*(\|[\s:]*-{1,}[\s:]*)*\|$/;function rc(e){let t=!1;for(let n of e.split(`
147
+ `)){let r=n.trimStart();(r.startsWith("```")||r.startsWith("~~~"))&&(t=!t)}return t}function Gf(e){let t=e.endsWith(`
140
148
  `),n=e.split(`
141
- `);!t&&n.length>0&&n.pop(),t&&n.length>0&&n.at(-1)===""&&n.pop();let r=0,i=!1;for(let u=n.length-1;u>=0;u--){let p=n[u].trim();if(p==="")break;if(Nl.test(p)){i=!0;break}if(Ml.test(p))r++;else break}if(i||r===0)return e;let o=n.length-r,a=n.slice(0,o),s=a.join(`
142
- `);return a.length>0&&(s+=`
143
- `),s}function MT(e,t=!1){let n=e.endsWith(`
149
+ `);!t&&n.length>0&&n.pop(),t&&n.length>0&&n.at(-1)===""&&n.pop();let r=0,i=!1;for(let c=n.length-1;c>=0;c--){let p=n[c].trim();if(p==="")break;if(oc.test(p)){i=!0;break}if(ac.test(p))r++;else break}if(i||r===0)return e;let a=n.length-r,o=n.slice(0,a),s=o.join(`
150
+ `);return o.length>0&&(s+=`
151
+ `),s}function dx(e,t=!1){let n=e.endsWith(`
144
152
  `),r=e.split(`
145
- `);n&&r.length>0&&r.at(-1)===""&&r.pop();let i=[],o=!1,a=!1;for(let u=0;u<r.length;u++){let p=r[u].trim();if(!o&&(p.startsWith("```")||p.startsWith("~~~"))){a=!a,i.push(r[u]);continue}if(a){i.push(r[u]);continue}let d=p!==""&&(Ml.test(p)||Nl.test(p));if(d&&!o){let h=!1;for(let g=u;g<r.length;g++){let y=r[g].trim();if(Nl.test(y)){h=!0;break}if(y===""||!Ml.test(y))break}h&&(i.push("```"),o=!0)}else!d&&o&&(i.push("```"),o=!1);i.push(r[u])}o&&t&&i.push("```");let s=i.join(`
153
+ `);n&&r.length>0&&r.at(-1)===""&&r.pop();let i=[],a=!1,o=!1;for(let c=0;c<r.length;c++){let p=r[c].trim();if(!a&&(p.startsWith("```")||p.startsWith("~~~"))){o=!o,i.push(r[c]);continue}if(o){i.push(r[c]);continue}let d=p!==""&&(ac.test(p)||oc.test(p));if(d&&!a){let h=!1;for(let y=c;y<r.length;y++){let g=r[y].trim();if(oc.test(g)){h=!0;break}if(g===""||!ac.test(g))break}h&&(i.push("```"),a=!0)}else!d&&a&&(i.push("```"),a=!1);i.push(r[c])}a&&t&&i.push("```");let s=i.join(`
146
154
  `);return n&&(s+=`
147
- `),s}function NT(e){return"adapterName"in e&&!("adapter"in e)}var wf="thread-state:";function LT(e){return e!==null&&typeof e=="object"&&Symbol.asyncIterator in e}var PP=class Ll{constructor(t){ke(this,"id");ke(this,"channelId");ke(this,"isDM");ke(this,"channelVisibility");ke(this,"_adapter");ke(this,"_adapterName");ke(this,"_stateAdapterInstance");ke(this,"_recentMessages",[]);ke(this,"_isSubscribedContext");ke(this,"_currentMessage");ke(this,"_streamingUpdateIntervalMs");ke(this,"_fallbackStreamingPlaceholderText");ke(this,"_channel");ke(this,"_threadHistory");ke(this,"_logger");var n,r,i,o;this.id=t.id,this.channelId=t.channelId,this.isDM=(n=t.isDM)!=null?n:!1,this.channelVisibility=(r=t.channelVisibility)!=null?r:"unknown",this._isSubscribedContext=(i=t.isSubscribedContext)!=null?i:!1,this._currentMessage=t.currentMessage,this._logger=t.logger,this._streamingUpdateIntervalMs=(o=t.streamingUpdateIntervalMs)!=null?o:500,this._fallbackStreamingPlaceholderText=t.fallbackStreamingPlaceholderText!==void 0?t.fallbackStreamingPlaceholderText:"...",NT(t)?this._adapterName=t.adapterName:(this._adapter=t.adapter,this._stateAdapterInstance=t.stateAdapter,this._threadHistory=t.threadHistory),t.initialMessage&&(this._recentMessages=[t.initialMessage])}get adapter(){if(this._adapter)return this._adapter;if(!this._adapterName)throw new Error("Thread has no adapter configured");let n=zo().getAdapter(this._adapterName);if(!n)throw new Error(`Adapter "${this._adapterName}" not found in Chat singleton`);return this._adapter=n,n}get _stateAdapter(){if(this._stateAdapterInstance)return this._stateAdapterInstance;let t=zo();return this._stateAdapterInstance=t.getState(),this._stateAdapterInstance}get recentMessages(){return this._recentMessages}set recentMessages(t){this._recentMessages=t}get state(){return this._stateAdapter.get(`${wf}${this.id}`)}async setState(t,n){let r=`${wf}${this.id}`;if(n!=null&&n.replace)await this._stateAdapter.set(r,t,Vo);else{let o={...await this._stateAdapter.get(r),...t};await this._stateAdapter.set(r,o,Vo)}}get channel(){if(!this._channel){let t=RT(this.adapter,this.id);this._channel=new _T({id:t,adapter:this.adapter,stateAdapter:this._stateAdapter,isDM:this.isDM,channelVisibility:this.channelVisibility,threadHistory:this._threadHistory})}return this._channel}get messages(){let t=this.adapter,n=this.id,r=this._threadHistory;return{async*[Symbol.asyncIterator](){let i,o=!1;for(;;){let a=await t.fetchMessages(n,{cursor:i,direction:"backward"}),s=[...a.messages].reverse();for(let u of s)o=!0,yield u;if(!a.nextCursor||a.messages.length===0)break;i=a.nextCursor}if(!o&&r){let a=await r.getMessages(n);for(let s=a.length-1;s>=0;s--)yield a[s]}}}}get allMessages(){let t=this.adapter,n=this.id,r=this._threadHistory;return{async*[Symbol.asyncIterator](){let i,o=!1;for(;;){let a=await t.fetchMessages(n,{limit:100,cursor:i,direction:"forward"});for(let s of a.messages)o=!0,yield s;if(!a.nextCursor||a.messages.length===0)break;i=a.nextCursor}if(!o&&r){let a=await r.getMessages(n);for(let s of a)yield s}}}}async getParticipants(){let t=new Map;this._currentMessage&&!this._currentMessage.author.isMe&&!this._currentMessage.author.isBot&&t.set(this._currentMessage.author.userId,this._currentMessage.author);for await(let n of this.allMessages)n.author.isMe||n.author.isBot||t.has(n.author.userId)||t.set(n.author.userId,n.author);return[...t.values()]}async isSubscribed(){return this._isSubscribedContext?!0:this._stateAdapter.isSubscribed(this.id)}async subscribe(){await this._stateAdapter.subscribe(this.id),this.adapter.onThreadSubscribe&&await this.adapter.onThreadSubscribe(this.id)}async unsubscribe(){await this._stateAdapter.unsubscribe(this.id)}async post(t){if(vf(t)){if(t.kind==="stream"){let o=t.getPostData(),a={...o.options.updateIntervalMs?{updateIntervalMs:o.options.updateIntervalMs}:{},...o.options.groupTasks?{taskDisplayMode:o.options.groupTasks}:{},...o.options.endWith?{stopBlocks:o.options.endWith}:{}};return await this.handleStream(o.stream,a),t}return await this.handlePostableObject(t),t}if(LT(t))return this.handleStream(t);let n=t;if(Ht(t)){let o=Vt(t);if(!o)throw new Error("Invalid JSX element: must be a Card element");n=o}n=await this.processCallbackUrls(n);let r=await this.adapter.postMessage(this.id,n),i=this.createSentMessage(r.id,n,r.threadId);return this._threadHistory&&await this._threadHistory.append(this.id,new Vn(i)),i}async handlePostableObject(t){await Af(t,this.adapter,this.id,(n,r)=>this.adapter.postMessage(n,r),this._logger)}async postEphemeral(t,n,r){let{fallbackToDM:i}=r,o=typeof t=="string"?t:t.userId,a;if(Ht(n)){let s=Vt(n);if(!s)throw new Error("Invalid JSX element: must be a Card element");a=s}else a=n;if(a=await this.processCallbackUrls(a),this.adapter.postEphemeral)return this.adapter.postEphemeral(this.id,o,a);if(!i)return null;if(this.adapter.openDM){let s=await this.adapter.openDM(o),u=await this.adapter.postMessage(s,a);return{id:u.id,threadId:s,usedFallback:!0,raw:u.raw}}return null}async processCallbackUrls(t){var n;if(typeof t=="string")return t;if("type"in t&&t.type==="card")return Bo(t,this._stateAdapter);if("card"in t&&((n=t.card)==null?void 0:n.type)==="card"){let r=await Bo(t.card,this._stateAdapter);if(r!==t.card)return{...t,card:r}}return t}async schedule(t,n){let r;if(Ht(t)){let i=Vt(t);if(!i)throw new Error("Invalid JSX element: must be a Card element");r=i}else r=t;if(r=await this.processCallbackUrls(r),!this.adapter.scheduleMessage)throw new Ef("Scheduled messages are not supported by this adapter","scheduling");return this.adapter.scheduleMessage(this.id,r,n)}async handleStream(t,n){let r=kf(t),i={updateIntervalMs:this._streamingUpdateIntervalMs,...n};if(this._currentMessage&&(i.recipientUserId=this._currentMessage.author.userId,i.recipientTeamId=this.extractSlackRecipientTeamId(this._currentMessage.raw)),this.adapter.stream){let a="",s={[Symbol.asyncIterator]:()=>{let p=r[Symbol.asyncIterator]();return{async next(){let d=await p.next();if(!d.done){let h=d.value;typeof h=="string"?a+=h:h.type==="markdown_text"&&(a+=h.text)}return d}}}},u=await this.adapter.stream(this.id,s,i);if(u){let p=this.createSentMessage(u.id,{markdown:a},u.threadId);return this._threadHistory&&await this._threadHistory.append(this.id,new Vn(p)),p}}let o={[Symbol.asyncIterator]:()=>{let a=r[Symbol.asyncIterator]();return{async next(){for(;;){let s=await a.next();if(s.done)return{value:void 0,done:!0};let u=s.value;if(typeof u=="string")return{value:u,done:!1};if(u.type==="markdown_text")return{value:u.text,done:!1}}}}}};return this.fallbackStream(o,i)}extractSlackRecipientTeamId(t){var r;if(!t||typeof t!="object")return;let n=t;if(typeof n.team_id=="string"&&n.team_id)return n.team_id;if(typeof n.team=="string"&&n.team)return n.team;if(n.team&&typeof n.team=="object"&&typeof n.team.id=="string"&&n.team.id)return n.team.id;if(typeof((r=n.user)==null?void 0:r.team_id)=="string"&&n.user.team_id)return n.user.team_id}async startTyping(t){await this.adapter.startTyping(this.id,t)}async fallbackStream(t,n){var B;let r=(B=n==null?void 0:n.updateIntervalMs)!=null?B:this._streamingUpdateIntervalMs,i=this._fallbackStreamingPlaceholderText,o=i===null?null:await this.adapter.postMessage(this.id,i),a=this.id,s=new CT,u="",p=!1,d=null,h=null;o&&(a=o.threadId||this.id,u=i!=null?i:"");let g=()=>{h=setTimeout(()=>{d=y()},r)},y=async()=>{var ne;if(p||!o)return;let ue=s.render();if(ue.trim()&&ue!==u)try{await this.adapter.editMessage(a,o.id,{markdown:ue}),u=ue}catch(ve){(ne=this._logger)==null||ne.warn("fallbackStream edit failed",ve)}p||g()};o&&g();try{for await(let ue of t)if(s.push(ue),!o){let ne=s.render();ne.trim()&&(o=await this.adapter.postMessage(this.id,{markdown:ne}),a=o.threadId||this.id,u=ne,g())}}finally{p=!0,h&&(clearTimeout(h),h=null)}d&&await d;let P=s.getText(),ee=s.finish();o||(o=await this.adapter.postMessage(this.id,{markdown:P.trim()?P:" "}),a=o.threadId||this.id,u=P),ee.trim()&&ee!==u&&await this.adapter.editMessage(a,o.id,{markdown:P});let Z=this.createSentMessage(o.id,{markdown:P},a);return this._threadHistory&&await this._threadHistory.append(this.id,new Vn(Z)),Z}async refresh(){let t=await this.adapter.fetchMessages(this.id,{limit:50});t.messages.length>0?this._recentMessages=t.messages:this._threadHistory?this._recentMessages=await this._threadHistory.getMessages(this.id,50):this._recentMessages=[]}mentionUser(t){return`<@${t}>`}toJSON(){var t,n;return{_type:"chat:Thread",id:this.id,channelId:this.channelId,channelVisibility:this.channelVisibility,currentMessage:(t=this._currentMessage)==null?void 0:t.toJSON(),isDM:this.isDM,adapterName:(n=this._adapterName)!=null?n:this.adapter.name}}static fromJSON(t,n){let r=new Ll({id:t.id,adapterName:t.adapterName,channelId:t.channelId,channelVisibility:t.channelVisibility,currentMessage:t.currentMessage?Vn.fromJSON(t.currentMessage):void 0,isDM:t.isDM});return n&&(r._adapter=n),r}static[or](t){return t.toJSON()}static[ar](t){return Ll.fromJSON(t)}createSentMessage(t,n,r){let i=this.adapter,o=r||this.id,a=this,{plainText:s,formatted:u,attachments:p}=DT(n);return{id:t,threadId:o,text:s,formatted:u,raw:null,links:[],author:{userId:"self",userName:i.userName,fullName:i.userName,isBot:!0,isMe:!0},metadata:{dateSent:new Date,edited:!1},attachments:p,toJSON(){return new Vn(this).toJSON()},async edit(h){let g=h;if(Ht(h)){let y=Vt(h);if(!y)throw new Error("Invalid JSX element: must be a Card element");g=y}return g=await a.processCallbackUrls(g),await i.editMessage(o,t,g),a.createSentMessage(t,g)},async delete(){await i.deleteMessage(o,t)},async addReaction(h){await i.addReaction(o,t,h)},async removeReaction(h){await i.removeReaction(o,t,h)}}}createSentMessageFromMessage(t){let n=this.adapter,r=this.id,i=t.id,o=this;return{id:t.id,threadId:t.threadId,text:t.text,formatted:t.formatted,raw:t.raw,author:t.author,metadata:t.metadata,attachments:t.attachments,links:t.links,isMention:t.isMention,toJSON(){return t.toJSON()},async edit(a){let s=a;if(Ht(a)){let u=Vt(a);if(!u)throw new Error("Invalid JSX element: must be a Card element");s=u}return s=await o.processCallbackUrls(s),await n.editMessage(r,i,s),o.createSentMessage(i,s,r)},async delete(){await n.deleteMessage(r,i)},async addReaction(a){await n.addReaction(r,i,a)},async removeReaction(a){await n.removeReaction(r,i,a)}}}};function DT(e){if(typeof e=="string")return{plainText:e,formatted:yn([gn([mn(e)])]),attachments:[]};if("raw"in e)return{plainText:e.raw,formatted:yn([gn([mn(e.raw)])]),attachments:e.attachments||[]};if("markdown"in e){let t=yl(e.markdown);return{plainText:jr(t),formatted:t,attachments:e.attachments||[]}}if("ast"in e)return{plainText:jr(e.ast),formatted:e.ast,attachments:e.attachments||[]};if("card"in e){let t=e.fallbackText||Br(e.card);return{plainText:t,formatted:yn([gn([mn(t)])]),attachments:[]}}if("type"in e&&e.type==="card"){let t=Br(e);return{plainText:t,formatted:yn([gn([mn(t)])]),attachments:[]}}throw new Error("Invalid PostableMessage format")}var MP=10080*60*1e3;var NP=600*1e3,LP=1440*60*1e3;var Sf=new Map;function sr(e){let t=Sf.get(e);return t||(t=Object.freeze({name:e,toString:()=>`{{emoji:${e}}}`,toJSON:()=>`{{emoji:${e}}}`}),Sf.set(e,t)),t}var FT={thumbs_up:{slack:["+1","thumbsup"],gchat:"\u{1F44D}"},thumbs_down:{slack:["-1","thumbsdown"],gchat:"\u{1F44E}"},clap:{slack:"clap",gchat:"\u{1F44F}"},wave:{slack:"wave",gchat:"\u{1F44B}"},pray:{slack:"pray",gchat:"\u{1F64F}"},muscle:{slack:"muscle",gchat:"\u{1F4AA}"},ok_hand:{slack:"ok_hand",gchat:"\u{1F44C}"},point_up:{slack:"point_up",gchat:"\u{1F446}"},point_down:{slack:"point_down",gchat:"\u{1F447}"},point_left:{slack:"point_left",gchat:"\u{1F448}"},point_right:{slack:"point_right",gchat:"\u{1F449}"},raised_hands:{slack:"raised_hands",gchat:"\u{1F64C}"},shrug:{slack:"shrug",gchat:"\u{1F937}"},facepalm:{slack:"facepalm",gchat:"\u{1F926}"},heart:{slack:"heart",gchat:["\u2764\uFE0F","\u2764"]},smile:{slack:["smile","slightly_smiling_face"],gchat:"\u{1F60A}"},laugh:{slack:["laughing","satisfied","joy"],gchat:["\u{1F602}","\u{1F606}"]},thinking:{slack:"thinking_face",gchat:"\u{1F914}"},sad:{slack:["cry","sad","white_frowning_face"],gchat:"\u{1F622}"},cry:{slack:"sob",gchat:"\u{1F62D}"},angry:{slack:"angry",gchat:"\u{1F620}"},love_eyes:{slack:"heart_eyes",gchat:"\u{1F60D}"},cool:{slack:"sunglasses",gchat:"\u{1F60E}"},wink:{slack:"wink",gchat:"\u{1F609}"},surprised:{slack:"open_mouth",gchat:"\u{1F62E}"},worried:{slack:"worried",gchat:"\u{1F61F}"},confused:{slack:"confused",gchat:"\u{1F615}"},neutral:{slack:"neutral_face",gchat:"\u{1F610}"},sleeping:{slack:"sleeping",gchat:"\u{1F634}"},sick:{slack:"nauseated_face",gchat:"\u{1F922}"},mind_blown:{slack:"exploding_head",gchat:"\u{1F92F}"},relieved:{slack:"relieved",gchat:"\u{1F60C}"},grimace:{slack:"grimacing",gchat:"\u{1F62C}"},rolling_eyes:{slack:"rolling_eyes",gchat:"\u{1F644}"},hug:{slack:"hugging_face",gchat:"\u{1F917}"},zany:{slack:"zany_face",gchat:"\u{1F92A}"},check:{slack:["white_check_mark","heavy_check_mark"],gchat:["\u2705","\u2714\uFE0F"]},x:{slack:["x","heavy_multiplication_x"],gchat:["\u274C","\u2716\uFE0F"]},question:{slack:"question",gchat:["\u2753","?"]},exclamation:{slack:"exclamation",gchat:"\u2757"},warning:{slack:"warning",gchat:"\u26A0\uFE0F"},stop:{slack:"octagonal_sign",gchat:"\u{1F6D1}"},info:{slack:"information_source",gchat:"\u2139\uFE0F"},100:{slack:"100",gchat:"\u{1F4AF}"},fire:{slack:"fire",gchat:"\u{1F525}"},star:{slack:"star",gchat:"\u2B50"},sparkles:{slack:"sparkles",gchat:"\u2728"},lightning:{slack:"zap",gchat:"\u26A1"},boom:{slack:"boom",gchat:"\u{1F4A5}"},eyes:{slack:"eyes",gchat:"\u{1F440}"},green_circle:{slack:"large_green_circle",gchat:"\u{1F7E2}"},yellow_circle:{slack:"large_yellow_circle",gchat:"\u{1F7E1}"},red_circle:{slack:"red_circle",gchat:"\u{1F534}"},blue_circle:{slack:"large_blue_circle",gchat:"\u{1F535}"},white_circle:{slack:"white_circle",gchat:"\u26AA"},black_circle:{slack:"black_circle",gchat:"\u26AB"},rocket:{slack:"rocket",gchat:"\u{1F680}"},party:{slack:["tada","partying_face"],gchat:["\u{1F389}","\u{1F973}"]},confetti:{slack:"confetti_ball",gchat:"\u{1F38A}"},balloon:{slack:"balloon",gchat:"\u{1F388}"},gift:{slack:"gift",gchat:"\u{1F381}"},trophy:{slack:"trophy",gchat:"\u{1F3C6}"},medal:{slack:"first_place_medal",gchat:"\u{1F947}"},lightbulb:{slack:"bulb",gchat:"\u{1F4A1}"},gear:{slack:"gear",gchat:"\u2699\uFE0F"},wrench:{slack:"wrench",gchat:"\u{1F527}"},hammer:{slack:"hammer",gchat:"\u{1F528}"},bug:{slack:"bug",gchat:"\u{1F41B}"},link:{slack:"link",gchat:"\u{1F517}"},lock:{slack:"lock",gchat:"\u{1F512}"},unlock:{slack:"unlock",gchat:"\u{1F513}"},key:{slack:"key",gchat:"\u{1F511}"},pin:{slack:"pushpin",gchat:"\u{1F4CC}"},memo:{slack:"memo",gchat:"\u{1F4DD}"},clipboard:{slack:"clipboard",gchat:"\u{1F4CB}"},calendar:{slack:"calendar",gchat:"\u{1F4C5}"},clock:{slack:"clock1",gchat:"\u{1F550}"},hourglass:{slack:"hourglass",gchat:"\u23F3"},bell:{slack:"bell",gchat:"\u{1F514}"},megaphone:{slack:"mega",gchat:"\u{1F4E2}"},speech_bubble:{slack:"speech_balloon",gchat:"\u{1F4AC}"},email:{slack:"email",gchat:"\u{1F4E7}"},inbox:{slack:"inbox_tray",gchat:"\u{1F4E5}"},outbox:{slack:"outbox_tray",gchat:"\u{1F4E4}"},package:{slack:"package",gchat:"\u{1F4E6}"},folder:{slack:"file_folder",gchat:"\u{1F4C1}"},file:{slack:"page_facing_up",gchat:"\u{1F4C4}"},chart_up:{slack:"chart_with_upwards_trend",gchat:"\u{1F4C8}"},chart_down:{slack:"chart_with_downwards_trend",gchat:"\u{1F4C9}"},coffee:{slack:"coffee",gchat:"\u2615"},pizza:{slack:"pizza",gchat:"\u{1F355}"},beer:{slack:"beer",gchat:"\u{1F37A}"},arrow_up:{slack:"arrow_up",gchat:"\u2B06\uFE0F"},arrow_down:{slack:"arrow_down",gchat:"\u2B07\uFE0F"},arrow_left:{slack:"arrow_left",gchat:"\u2B05\uFE0F"},arrow_right:{slack:"arrow_right",gchat:"\u27A1\uFE0F"},refresh:{slack:"arrows_counterclockwise",gchat:"\u{1F504}"},sun:{slack:"sunny",gchat:"\u2600\uFE0F"},cloud:{slack:"cloud",gchat:"\u2601\uFE0F"},rain:{slack:"rain_cloud",gchat:"\u{1F327}\uFE0F"},snow:{slack:"snowflake",gchat:"\u2744\uFE0F"},rainbow:{slack:"rainbow",gchat:"\u{1F308}"}},UT=class{constructor(e){ke(this,"emojiMap");ke(this,"slackToNormalized");ke(this,"gchatToNormalized");this.emojiMap={...FT,...e},this.slackToNormalized=new Map,this.gchatToNormalized=new Map,this.buildReverseMaps()}buildReverseMaps(){for(let[e,t]of Object.entries(this.emojiMap)){let n=Array.isArray(t.slack)?t.slack:[t.slack];for(let i of n)this.slackToNormalized.set(i.toLowerCase(),e);let r=Array.isArray(t.gchat)?t.gchat:[t.gchat];for(let i of r)this.gchatToNormalized.set(i,e)}}fromSlack(e){var r;let t=e.replace(/^:|:$/g,"").toLowerCase(),n=(r=this.slackToNormalized.get(t))!=null?r:e;return sr(n)}fromGChat(e){var n;let t=(n=this.gchatToNormalized.get(e))!=null?n:e;return sr(t)}fromTeams(e){var r;let n=(r={like:"thumbs_up",heart:"heart",laugh:"laugh",surprised:"surprised",sad:"sad",angry:"angry"}[e])!=null?r:e;return sr(n)}toSlack(e){let t=typeof e=="string"?e:e.name,n=this.emojiMap[t];return n?Array.isArray(n.slack)?n.slack[0]:n.slack:t}toGChat(e){let t=typeof e=="string"?e:e.name,n=this.emojiMap[t];return n?Array.isArray(n.gchat)?n.gchat[0]:n.gchat:t}toDiscord(e){return this.toGChat(e)}matches(e,t){let n=typeof t=="string"?t:t.name,r=this.emojiMap[n];if(!r)return e===n;let i=Array.isArray(r.slack)?r.slack:[r.slack],o=Array.isArray(r.gchat)?r.gchat:[r.gchat],a=e.replace(/^:|:$/g,"").toLowerCase();return i.some(s=>s.toLowerCase()===a)||o.includes(e)}extend(e){Object.assign(this.emojiMap,e),this.buildReverseMaps()}},$T=new UT;function qT(e){let t=["thumbs_up","thumbs_down","clap","wave","pray","muscle","ok_hand","point_up","point_down","point_left","point_right","raised_hands","shrug","facepalm","heart","smile","laugh","thinking","sad","cry","angry","love_eyes","cool","wink","surprised","worried","confused","neutral","sleeping","sick","mind_blown","relieved","grimace","rolling_eyes","hug","zany","check","x","question","exclamation","warning","stop","info","100","fire","star","sparkles","lightning","boom","eyes","green_circle","yellow_circle","red_circle","blue_circle","white_circle","black_circle","rocket","party","confetti","balloon","gift","trophy","medal","lightbulb","gear","wrench","hammer","bug","link","lock","unlock","key","pin","memo","clipboard","calendar","clock","hourglass","bell","megaphone","speech_bubble","email","inbox","outbox","package","folder","file","chart_up","chart_down","coffee","pizza","beer","arrow_up","arrow_down","arrow_left","arrow_right","refresh","sun","cloud","rain","snow","rainbow"],n={custom:r=>sr(r)};for(let r of t)n[r]=sr(r);if(e){for(let r of Object.keys(e))n[r]=sr(r);$T.extend(e)}return n}var DP=qT(),Vr=_o,Hr=Ro,Wr=bl;var Yr=Mo,Jr=Gh,Gr=Ao,_f=Co,Rf=Io;var Kr=vo;var Of=Oo,Cf=Eo,If=Po;var Pf=Fo,Mf=No,Nf=$o,Xr=Do,Qr=Uo,Zr=Lo;function Ho(e){return"type"in e&&e.type==="card"}function Lf(e){return typeof e=="object"&&e!==null&&e.type==="tool-approval-card"}function Dl(e,t){return(e==null?void 0:e.workflowId)===t.id}var jT=Symbol.for("chat.jsx.element"),BT=new Set([Vr,Hr,Wr,Yr,Jr,Gr,Pf,_f,Rf,Kr,Of,Mf,Nf,Cf,Xr,Qr,If,Zr]);function zT(e){return typeof e=="object"&&e!==null&&e.$$typeof===jT}async function Yo(e){let t=Wo(e);if(t&&typeof t=="object"&&Ho(t))return t;let{isJSX:n,toCardElement:r}=await Promise.resolve().then(()=>(Ff(),Df));return n(t)?r(t):null}function Wo(e){var t;if(Array.isArray(e))return e.map(n=>Wo(n));if(!zT(e))return e;if(typeof e.type=="function"&&!BT.has(e.type)){let n={...(t=e.props)!=null?t:{}};return e.children!==void 0&&(n.children=e.children),Wo(e.type(n))}return{...e,children:Wo(e.children)}}var Uf=async(e,t)=>{let n=new TextEncoder,r=n.encode(e),i=n.encode(t),o=await crypto.subtle.importKey("raw",r,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),a=await crypto.subtle.sign("HMAC",o,i);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")},$f=(e,t)=>{if(typeof e!="string"||typeof t!="string"||e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r+=1)n|=e.charCodeAt(r)^t.charCodeAt(r);return n===0};var VT=require("cross-fetch");var qf=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 t=await(await fetch("http://localhost:2022/.well-known/novu")).json();return`${t.tunnelOrigin}${t.route}`}}catch(e){console.error(e)}return""};function jf(e){return!!e&&typeof e=="object"&&"error"in e&&"message"in e&&"statusCode"in e}var Jo=(e,t)=>{if(!e)throw new Mi;return{post:async(n,r)=>{let i=await fetch(`${t}/v1${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${e}`},body:JSON.stringify(r)}),o=await i.json();if(i.ok)return o;throw jf(o)?new Ni(o.statusCode,o.error,o.message):new Kn(o)},delete:async n=>(await fetch(`${t}/v1${n}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${e}`}})).json()}};var Yf=require("liquidjs");function Fl(e,t){let n={...e};for(let r of Object.keys(t)){let i=t[r];i&&typeof i=="object"&&!Array.isArray(i)?n[r]=Fl(n[r]||{},i):(Array.isArray(i),n[r]=i)}return n}function Go(e,t){let n=t.split(".").reduce((r,i)=>{if(r&&typeof r=="object")return r[i]},e);if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"){let r=JSON.stringify(n);return r==="{}"?"":r}return""}function Bf(e,t=2,n,r=", "){if(!Array.isArray(e)||e.length===0)return"";let i=n?e.map(s=>typeof s!="object"||!s?"":Go(s,n)):e;if(i.length===1)return i[0];if(i.length===2)return`${i[0]} and ${i[1]}`;if(t>=i.length){let s=i.slice(0,-1),u=i[i.length-1];return`${s.join(r)} and ${u}`}let o=i.slice(0,t),a=i.length-t;return`${o.join(r)} and ${a} ${a===1?"other":"others"}`}var zf=jt(require("pluralize"),1);function Vf(e,t="",n="",r="true"){if(e==null)return"";let i=0;if(Array.isArray(e)?i=e.length:typeof e=="object"?i=Object.keys(e).length:typeof e=="string"?i=+e:typeof e=="number"?i=e:i=Number(e),Number.isNaN(i)&&(i=0),i<=0)return"";let o;return n?o=i===1?t:n:o=(0,zf.default)(t,i),r==="true"?`${i} ${o}`:o}var HT=require("liquidjs"),Hf=jt(require("pluralize"),1),WT=require("zod");var YT="",JT=2,GT="other",KT=", ",XT=" and ",QT=", and ";function Wf(e,t=YT,n=JT,r=GT,i=KT,o=XT,a=QT){if(!Array.isArray(e)||e.length===0)return"";let s=t?e.map(g=>typeof g!="object"||!g?"":Go(g,t)):e,u=s.length;if(u===1)return s[0];if(u===2)return`${s[0]}${o}${s[1]}`;if(n>=u){let g=s.slice(0,u-1),y=s[u-1];return`${g.join(i)}${a}${y}`}let p=s.slice(0,n),d=u-n,h=n===1?o:a;return`${p.join(i)}${h}${d} ${(0,Hf.default)(r,d)}`}function ZT(e){return Array.isArray(e)||typeof e=="object"&&e!==null?Jf(e):typeof e=="string"?e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):e==null?"":String(e)}var Jf=(e,t=0)=>Array.isArray(e)||typeof e=="object"&&e!==null?JSON.stringify(e,null,t).replace(/"/g,"'").replace(/\n/g,"\\n"):e==null?"":String(e);function Gf(e){let t=new Yf.Liquid({outputEscape:ZT,...e});return t.registerFilter("json",(n,r)=>Jf(n,r)),t.registerFilter("digest",Bf),t.registerFilter("toSentence",Wf),t.registerFilter("pluralize",Vf),t}var Hn=jt(require("chalk"),1),et={info:e=>Hn.default.blue(e),warning:e=>Hn.default.yellow(e),error:e=>Hn.default.red(e),success:e=>Hn.default.green(e),underline:e=>Hn.default.underline(e),bold:e=>Hn.default.bold(e)},lt={SUCCESS:et.success("\u2714"),ERROR:et.error("\u2717"),WARNING:et.warning("\u26A0"),INFO:et.info("\u2139"),ARROW:et.bold("\u2192"),MOCK:et.info("\u25CB"),HYDRATED:et.bold(et.info("\u2192")),STEP:et.info("\u03C3"),ACTION:et.info("\u03B1"),DURATION:et.info("\u0394"),PROVIDER:et.info("\u2699"),OUTPUT:et.info("\u21E2"),INPUT:et.info("\u21E0"),WORKFLOW:et.info("\u03C9"),STATE:et.info("\u03C3"),EXECUTE:et.info("\u03B5"),PREVIEW:et.info("\u03C1")};function Ko(e){return e||process.env.NOVU_API_URL||"https://api.novu.co"}function Xo(e){return e||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var Ul=jt(require("sanitize-html"),1),ex=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"];function tx(e){return e.toLowerCase().startsWith("on")}function nx(e){return e.replace(/<\/([a-zA-Z][a-zA-Z0-9]*)\s*\/[^>]*>/g,"</$1>")}var rx={allowedTags:Ul.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,transformTags:{"*":(e,t)=>{let n={};for(let[r,i]of Object.entries(t))tx(r)||(n[r]=i);return{tagName:e,attribs:n}},img:(e,t)=>{let n={};for(let[r,i]of Object.entries(t))ex.includes(r.toLowerCase())&&(n[r]=i);return{tagName:e,attribs:n}}},allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},Kf=e=>{if(!e)return e;let t=nx(e),n=/^<!DOCTYPE .*?>/,r=t.match(n),i=(0,Ul.default)(t,rx);return r?r[0]+i:i},Qo=e=>Object.keys(e).reduce((t,n)=>{let r=e[n];return typeof r=="string"?t[n]=Kf(r):Array.isArray(r)?t[n]=r.map(i=>typeof i=="string"?Kf(i):typeof i=="object"?Qo(i):i):typeof r=="object"&&r!==null?t[n]=Qo(r):t[n]=r,t},{});function Xf(e,t=!0,n=console){t&&(n.info(`
148
- ${et.bold(et.underline("Discovered workflowId:"))} '${e.workflowId}'`),e.steps.forEach((r,i)=>{let o=i===e.steps.length-1,a=o?"\u2514":"\u251C";n.info(`${a} ${lt.STEP} Discovered stepId: '${r.stepId}' Type: '${r.type}'`),r.providers.forEach((s,u)=>{let p=u===r.providers.length-1,d=o?" ":"\u2502",h=p?"\u2514":"\u251C";n.info(`${d} ${h} ${lt.PROVIDER} Discovered provider: '${s.type}'`)})}))}var Qf=require("jsonrepair");function Zf(e){let t=e.trim();return(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))&&t.length>2}var em="__novuJsonString";function ix(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e[em]===!0}function ei(e){if(typeof e=="string"){if(!Zf(e))return e;try{let t=JSON.parse(e);return{[em]:!0,value:ei(t)}}catch{return e}}if(Array.isArray(e))return e.map(t=>ei(t));if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=ei(r);return t}return e}function ti(e){if(ix(e))return JSON.stringify(ti(e.value));if(Array.isArray(e))return e.map(t=>ti(t));if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=ti(r);return t}return e}function ox(e){try{return JSON.parse(e),e}catch{try{return(0,Qf.jsonrepair)(e)}catch{return e}}}function tm(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>typeof n=="string"?[t,Zf(n)?ox(n):n]:typeof n=="object"&&n!==null&&!Array.isArray(n)?[t,tm(n)]:[t,n]))}function nm(e){return!(e!=null&&e.data)||typeof e.data!="object"||Array.isArray(e.data)?e:{...e,data:tm(e.data)}}var im=jt(require("ajv"),1),om=jt(require("ajv-formats"),1);var rm=e=>typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e));var Zo=class extends xn{constructor(n,r){let i=r.length===1?"it":"them";super(`Tried to use a ${n} in @novu/framework without ${r.join(", ")} installed. Please install ${i} by running \`npm install ${r.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var ea=async(e,t)=>{let n=new Set;if((await Promise.allSettled(e.map(i=>i.import))).forEach((i,o)=>{let a=e[o];i.status==="fulfilled"&&a.exports.every(u=>i.value[u]!==void 0)||n.add(a.name)}),n.size>0)throw new Zo(t,Array.from(n))};var ta=class{constructor(){this.requiredImports=[];this.ajv=new im.default({useDefaults:!0,removeAdditional:"failing",strict:!1}),(0,om.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(t){let n=t.type==="object"||!!t.anyOf||!!t.allOf||!!t.oneOf;return n&&await ea(this.requiredImports,"JSON schema"),n}async validate(t,n){let r=this.compiledSchemas.get(n);r||(r=this.ajv.compile(n),this.compiledSchemas.set(n,r));let i=rm(t);return r(i)?{success:!0,data:i}:{success:!1,errors:r.errors.map(a=>({path:a.instancePath,message:a.message}))}}async transformToJsonSchema(t){return t}};var na=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(t){let n=t.safeParseAsync!==void 0;return n&&await ea(this.requiredImports,"Zod schema"),n}async validate(t,n){let r=await n.safeParseAsync(t);return r.success?{success:!0,data:r.data}:{success:!1,errors:r.error.issues.map(i=>({path:`/${i.path.join("/")}`,message:i.message}))}}async transformToJsonSchema(t){let{zodToJsonSchema:n}=await import("zod-to-json-schema");return n(t)}};var ra=new na,ia=new ta,ni=async(e,t)=>{if(await ra.canHandle(e))return ra.validate(t,e);if(await ia.canHandle(e))return ia.validate(t,e);throw new Error("Invalid schema")},bt=async e=>{if(await ra.canHandle(e))return ra.transformToJsonSchema(e);if(await ia.canHandle(e))return ia.transformToJsonSchema(e);throw new Error("Invalid schema")};function am(){return["development",void 0,"dev"].includes(process.env.NODE_ENV)}var lr=class{constructor(t){this.discoveredWorkflows=new Map;this.discoverWorkflowPromises=new Map;this.registeredAgents=new Map;this.version="2.13.2";let n=this.buildOptions(t);this.apiUrl=n.apiUrl,this.secretKey=n.secretKey,this.strictAuthentication=n.strictAuthentication,this.verbose=n.verbose,this.logger=n.logger,this.templateEngine=Gf()}buildOptions(t){let n={apiUrl:Ko(t==null?void 0:t.apiUrl),secretKey:Xo(t==null?void 0:t.secretKey),strictAuthentication:!am(),verbose:am(),logger:console};return(t==null?void 0:t.strictAuthentication)!==void 0?n.strictAuthentication=t.strictAuthentication:process.env.NOVU_STRICT_AUTHENTICATION_ENABLED!==void 0&&(n.strictAuthentication=process.env.NOVU_STRICT_AUTHENTICATION_ENABLED==="true"),(t==null?void 0:t.verbose)!==void 0&&(n.verbose=t.verbose),(t==null?void 0:t.logger)!==void 0&&(n.logger=t.logger),n}log(...t){this.verbose&&this.logger.info(...t)}async addWorkflows(t){for(let n of t){if(this.discoveredWorkflows.has(n.id))continue;let r=this.discoverWorkflowPromises.get(n.id);if(r){await r;continue}let i=this.addWorkflow(n);this.discoverWorkflowPromises.set(n.id,i),await i}}addAgents(t){for(let n of t)this.registeredAgents.set(n.id,n)}getAgent(t){return this.registeredAgents.get(t)}async addWorkflow(t){try{let n=await t.discover();Xf(n,this.verbose,this.logger),this.discoveredWorkflows.set(t.id,n)}finally{this.discoverWorkflowPromises.delete(t.id)}}healthCheck(){let t=this.getRegisteredWorkflows(),n=t.length,r=t.reduce((i,o)=>i+o.steps.length,0);return{status:"ok",sdkVersion:"2.13.2",frameworkVersion:"2024-06-26",discovered:{workflows:n,steps:r}}}getWorkflow(t){let n=this.discoveredWorkflows.get(t);if(n)return n;throw new _r(t)}getStep(t,n){let i=this.getWorkflow(t).steps.find(o=>o.stepId===n);if(i)return i;throw new Bi(n)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows(),agents:Array.from(this.registeredAgents.keys()).map(t=>({agentId:t}))}}mock(t){try{return nu(t)}catch(n){return this.logger.warn("Failed to mock schema, returning empty object:",n),{}}}async validate(t,n,r,i,o,a,s){let u=await ni(n,t);if(u.success)return u.data;switch(r){case"event":this.throwInvalidEvent(i,o,u.errors);case"step":this.throwInvalidStep(a,i,o,u.errors);case"provider":this.throwInvalidProvider(a,s,i,o,u.errors);default:throw new Error(`Invalid component: '${r}'`)}}throwInvalidProvider(t,n,r,i,o){throw t?n?r==="output"?new Oi(i,t,n,o):new Error(`Invalid payload type: '${r}'`):new Error("providerId is required"):new Error("stepId is required")}throwInvalidStep(t,n,r,i){if(!t)throw new Error("stepId is required");switch(n){case"output":throw new Ei(r,t,i);case"result":throw new _i(r,t,i);case"controls":throw new Ai(r,t,i);default:throw new Error(`Invalid payload type: '${n}'`)}}throwInvalidEvent(t,n,r){switch(t){case"controls":throw new vi(n,r);case"payload":throw new vr(n,r);default:throw new Error(`Invalid payload type: '${t}'`)}}executeStepFactory(t,n,r){return async(i,o,a)=>{if(r())return;let s=this.getStep(t.workflowId,i),u=t.action==="preview";if(!u&&i===t.stepId){let y=await this.createStepControls(s,t),P=await this.compileControls(y,t);if(await this.shouldSkip(a==null?void 0:a.skip,P))return n({options:{skip:!0},outputs:{},providers:{}}),{}}let p=this.previewStep.bind(this),d=this.executeStep.bind(this),g=await(u?p:d)(t,{...s,providers:s.providers.map(y=>{var ee;let P=(ee=a==null?void 0:a.providers)==null?void 0:ee[y.type];if(!P)throw new Li(y.type);return{...y,resolve:P}}),resolve:o});return this.shouldSanitize({stepType:s.type,options:a})&&(g={...g,outputs:Qo(g.outputs)}),i===t.stepId&&n({...g,options:{skip:!1}}),g.outputs}}shouldSanitize({stepType:t,options:n}){return(n==null?void 0:n.disableOutputSanitization)===!0?!1:["email","in_app"].includes(t)}async shouldSkip(t,n){return t?t(n):!1}async executeWorkflow(t){let i=`${{execute:"Executing",preview:"Previewing"}[t.action]||t.action} workflowId:`;this.log(`
149
- ${et.bold(et.underline(i))} '${t.workflowId}'`);let o=this.getWorkflow(t.workflowId),a=process.hrtime(),s={outputs:{},providers:{},options:{skip:!1}},u,p=!1,d=new Promise(Oe=>{u=Oe}),h=Oe=>{if(p)throw new Error("setResult can only be called once per workflow execution");u(),p=!0,s=Oe},g=()=>p,y;try{if(t.action==="execute"&&!t.payload)throw new vr(t.workflowId,{message:"Event `payload` is required"});let Oe=await this.createExecutionPayload(t,o),$={...t,payload:Oe};await Promise.race([d,o.execute({payload:Oe,env:t.env,controls:{},subscriber:t.subscriber,context:t.context,step:{email:this.executeStepFactory($,h,g),sms:this.executeStepFactory($,h,g),inApp:this.executeStepFactory($,h,g),digest:this.executeStepFactory($,h,g),delay:this.executeStepFactory($,h,g),push:this.executeStepFactory($,h,g),chat:this.executeStepFactory($,h,g),custom:this.executeStepFactory($,h,g),throttle:this.executeStepFactory($,h,g),tool:this.executeStepFactory($,h,g)}})])}catch(Oe){y=Oe}let P=process.hrtime(a),ee=P[0],Z=P[1],B=ee*1e3+Z/1e6,ue=y?lt.ERROR:lt.SUCCESS,ve={execute:"Executed",preview:"Previewed"}[t.action]||t.action;if(this.log(`${ue} ${ve} workflowId: \`${t.workflowId}\``),this.prettyPrintExecute(t,B,y),y)throw y;return{outputs:s.outputs,providers:s.providers,options:s.options,metadata:{status:"success",error:!1,duration:B}}}async createExecutionPayload(t,n){let{payload:r}=t;if(t.action==="preview"){let o=this.mock(n.payload.schema);r=Object.assign(o,r)}return await this.validate(r,n.payload.unknownSchema,"event","payload",t.workflowId)}prettyPrintExecute(t,n,r){if(!this.verbose)return;let i=r?lt.ERROR:lt.SUCCESS,a={execute:"Executed",preview:"Previewed"}[t.action]||t.action,s=r?"Failed to execute":a,u=r?et.error:et.success,p=`${i} ${s} workflowId: '${t.workflowId}`;this.logger.info(`
150
- ${et.bold(u(p))}'
155
+ `),s}function hx(e){return"adapterName"in e&&!("adapter"in e)}var Kf="thread-state:";function Xf(e){return e!==null&&typeof e=="object"&&Symbol.asyncIterator in e}var fx=new AbortController().signal;async function*mx(e,t){let n=e[Symbol.asyncIterator](),r;try{for(;!t.aborted;){let i=new Promise(s=>{r=()=>s({done:!0,value:void 0}),t.addEventListener("abort",r,{once:!0})}),a=n.next(),o=await Promise.race([a,i]);if(r&&t.removeEventListener("abort",r),o.done||t.aborted)return;yield o.value}}finally{r&&t.removeEventListener("abort",r),n.return&&n.return().catch(()=>{})}}var gx=class sc{constructor(t){Se(this,"id");Se(this,"channelId");Se(this,"isDM");Se(this,"channelVisibility");Se(this,"signal");Se(this,"_adapter");Se(this,"_adapterName");Se(this,"_stateAdapterInstance");Se(this,"_recentMessages",[]);Se(this,"_isSubscribedContext");Se(this,"_currentMessage");Se(this,"_streamingUpdateIntervalMs");Se(this,"_fallbackStreamingPlaceholderText");Se(this,"_channel");Se(this,"_threadHistory");Se(this,"_logger");Se(this,"_typingStarted",!1);var n,r,i,a,o;this.id=t.id,this.channelId=t.channelId,this.isDM=(n=t.isDM)!=null?n:!1,this.channelVisibility=(r=t.channelVisibility)!=null?r:"unknown",this.signal=(i=t.signal)!=null?i:fx,this._isSubscribedContext=(a=t.isSubscribedContext)!=null?a:!1,this._currentMessage=t.currentMessage,this._logger=t.logger,this._streamingUpdateIntervalMs=(o=t.streamingUpdateIntervalMs)!=null?o:500,this._fallbackStreamingPlaceholderText=t.fallbackStreamingPlaceholderText,hx(t)?this._adapterName=t.adapterName:(this._adapter=t.adapter,this._stateAdapterInstance=t.stateAdapter,this._threadHistory=t.threadHistory),t.initialMessage&&(this._recentMessages=[t.initialMessage])}get adapter(){if(this._adapter)return this._adapter;if(!this._adapterName)throw new Error("Thread has no adapter configured");let n=si().getAdapter(this._adapterName);if(!n)throw new Error(`Adapter "${this._adapterName}" not found in Chat singleton`);return this._adapter=n,n}get _stateAdapter(){if(this._stateAdapterInstance)return this._stateAdapterInstance;let t=si();return this._stateAdapterInstance=t.getState(),this._stateAdapterInstance}get recentMessages(){return this._recentMessages}set recentMessages(t){this._recentMessages=t}get state(){return this._stateAdapter.get(`${Kf}${this.id}`)}async setState(t,n){let r=`${Kf}${this.id}`;if(n!=null&&n.replace)await this._stateAdapter.set(r,t,oi);else{let a={...await this._stateAdapter.get(r),...t};await this._stateAdapter.set(r,a,oi)}}get channel(){if(!this._channel){let t=rm(this.adapter,this.id);this._channel=new nm({id:t,adapter:this.adapter,stateAdapter:this._stateAdapter,isDM:this.isDM,channelVisibility:this.channelVisibility,threadHistory:this._threadHistory})}return this._channel}get messages(){let t=this.adapter,n=this.id,r=this._threadHistory;return{async*[Symbol.asyncIterator](){let i,a=!1;for(;;){let o=await t.fetchMessages(n,{cursor:i,direction:"backward"}),s=[...o.messages].reverse();for(let c of s)a=!0,yield c;if(!o.nextCursor||o.messages.length===0)break;i=o.nextCursor}if(!a&&r){let o=await r.getMessages(n);for(let s=o.length-1;s>=0;s--)yield o[s]}}}}get allMessages(){let t=this.adapter,n=this.id,r=this._threadHistory;return{async*[Symbol.asyncIterator](){let i,a=!1;for(;;){let o=await t.fetchMessages(n,{limit:100,cursor:i,direction:"forward"});for(let s of o.messages)a=!0,yield s;if(!o.nextCursor||o.messages.length===0)break;i=o.nextCursor}if(!a&&r){let o=await r.getMessages(n);for(let s of o)yield s}}}}async getParticipants(){let t=new Map;this._currentMessage&&!this._currentMessage.author.isMe&&!this._currentMessage.author.isBot&&t.set(this._currentMessage.author.userId,this._currentMessage.author);for await(let n of this.allMessages)n.author.isMe||n.author.isBot||t.has(n.author.userId)||t.set(n.author.userId,n.author);return[...t.values()]}async isSubscribed(){return this._isSubscribedContext?!0:this._stateAdapter.isSubscribed(this.id)}async subscribe(){await this._stateAdapter.subscribe(this.id),this.adapter.onThreadSubscribe&&await this.adapter.onThreadSubscribe(this.id)}async unsubscribe(){await this._stateAdapter.unsubscribe(this.id)}async post(t){if(lc(t)){if(t.kind==="stream"){let a=t.getPostData(),o={...a.options.updateIntervalMs?{updateIntervalMs:a.options.updateIntervalMs}:{},...a.options.groupTasks?{taskDisplayMode:a.options.groupTasks}:{},...a.options.endWith?{stopBlocks:a.options.endWith}:{},...a.options.sessionStatus?{sessionStatus:a.options.sessionStatus}:{}};return await this.handleStream(a.stream,o),t}return await this.handlePostableObject(t),t}if(Xf(t))return this.handleStream(t);let n=t;if(Pt(t)){let a=It(t);if(!a)throw new Error("Invalid JSX element: must be a Card element");n=a}n=await this.processCallbackUrls(n);let r;try{r=await this.adapter.postMessage(this.id,n)}finally{await this.finishTyping()}let i=this.createSentMessage(r.id,n,r.threadId);return this._threadHistory&&await this._threadHistory.append(this.id,new rn(i)),i}async handlePostableObject(t){try{await Zf(t,this.adapter,this.id,(n,r)=>this.adapter.postMessage(n,r),this._logger)}finally{await this.finishTyping()}}async postEphemeral(t,n,r){let{fallbackToDM:i}=r,a=typeof t=="string"?t:t.userId,o;if(Pt(n)){let s=It(n);if(!s)throw new Error("Invalid JSX element: must be a Card element");o=s}else o=n;if(this.adapter.postEphemeral)return o=await this.processCallbackUrls(o),this.adapter.postEphemeral(this.id,a,o);if(!i)return null;if(this.adapter.openDM){let s=await this.adapter.openDM(a);o=await this.processCallbackUrls(o,{id:this.adapter.channelIdFromThreadId(s),type:"channel"});let c=await this.adapter.postMessage(s,o);return{id:c.id,threadId:s,usedFallback:!0,raw:c.raw}}return null}async reply(t,n){if(!this.adapter.reply)throw new ai("Message replies are not supported by this adapter","replies");let r=t instanceof rn?t:this.findKnownMessage(t);if(r&&r.threadId!==this.id)throw new Error("Cannot reply to a message from another thread");let i;if(Xf(n)){let c="";for await(let p of io(n))typeof p=="string"?c+=p:p.type==="markdown_text"&&(c+=p.text);i={markdown:c.trim()?c:" "}}else if(Pt(n)){let c=It(n);if(!c)throw new Error("Invalid JSX element: must be a Card element");i=c}else i=n;i=await this.processCallbackUrls(i);let a=typeof t=="string"?t:t.id,o=await this.adapter.reply(this.id,a,i),s=this.createSentMessage(o.id,i,o.threadId,r);return this._threadHistory&&await this._threadHistory.append(this.id,new rn(s)),s}findKnownMessage(t){var n;return((n=this._currentMessage)==null?void 0:n.id)===t?this._currentMessage:this._recentMessages.find(r=>r.id===t)}async processCallbackUrls(t,n={id:this.id,type:"thread"}){var r;if(typeof t=="string")return t;if("type"in t&&t.type==="card")return oo(t,this._stateAdapter,n);if("card"in t&&((r=t.card)==null?void 0:r.type)==="card"){let i=await oo(t.card,this._stateAdapter,n);if(i!==t.card)return{...t,card:i}}return t}async schedule(t,n){let r;if(Pt(t)){let i=It(t);if(!i)throw new Error("Invalid JSX element: must be a Card element");r=i}else r=t;if(r=await this.processCallbackUrls(r),!this.adapter.scheduleMessage)throw new ai("Scheduled messages are not supported by this adapter","scheduling");return this.adapter.scheduleMessage(this.id,r,n)}async handleStream(t,n){let r=mx(io(t),this.signal),i={signal:this.signal,updateIntervalMs:this._streamingUpdateIntervalMs,...n,...this._fallbackStreamingPlaceholderText!==void 0?{fallbackStreamingPlaceholderText:this._fallbackStreamingPlaceholderText}:{}};if(this._currentMessage&&(i.recipientUserId=this._currentMessage.author.userId,i.recipientTeamId=this.extractSlackRecipientTeamId(this._currentMessage.raw)),this.adapter.stream){let o="",s={[Symbol.asyncIterator]:()=>{let p=r[Symbol.asyncIterator]();return{async next(){let d=await p.next();if(!d.done){let h=d.value;typeof h=="string"?o+=h:h.type==="markdown_text"&&(o+=h.text)}return d}}}},c;try{c=await this.adapter.stream(this.id,s,i)}catch(p){throw await this.finishTyping(),p}if(c){this._typingStarted=!1;let p=this.createSentMessage(c.id,{markdown:o},c.threadId);return this._threadHistory&&await this._threadHistory.append(this.id,new rn(p)),p}}let a={[Symbol.asyncIterator]:()=>{let o=r[Symbol.asyncIterator]();return{async next(){for(;;){let s=await o.next();if(s.done)return{value:void 0,done:!0};let c=s.value;if(typeof c=="string")return{value:c,done:!1};if(c.type==="markdown_text")return{value:c.text,done:!1}}}}}};return this.fallbackStream(a,i)}extractSlackRecipientTeamId(t){var r;if(!t||typeof t!="object")return;let n=t;if(typeof n.team_id=="string"&&n.team_id)return n.team_id;if(typeof n.team=="string"&&n.team)return n.team;if(n.team&&typeof n.team=="object"&&typeof n.team.id=="string"&&n.team.id)return n.team.id;if(typeof((r=n.user)==null?void 0:r.team_id)=="string"&&n.user.team_id)return n.user.team_id}async startTyping(t){var r;let n=(r=this._currentMessage)==null?void 0:r.author.userId;if(n){await this.adapter.startTyping(this.id,t,{initiatorUserId:n}),this._typingStarted=!0;return}await this.adapter.startTyping(this.id,t),this._typingStarted=!0}async finishTyping(t="active"){var n,r;this._typingStarted&&(this._typingStarted=!1,await((r=(n=this.adapter).endTyping)==null?void 0:r.call(n,this.id,t)))}async markAsRead(t){if(!this.adapter.markAsRead)throw new ai("Read receipts are not supported by this adapter","read-receipts");let n=t!=null?t:this._currentMessage;if(!n)throw new ao("A message is required outside a message handler","MESSAGE_REQUIRED");if(typeof n!="string"&&n.threadId!==this.id)throw new ao("Cannot mark a message from another thread as read","THREAD_MISMATCH");await this.adapter.markAsRead(this.id,typeof n=="string"?n:n.id,typeof n=="string"?void 0:n)}async fallbackStream(t,n){try{return await this.runFallbackStream(t,n)}finally{await this.finishTyping(n==null?void 0:n.sessionStatus)}}async runFallbackStream(t,n){var H;let r=(H=n==null?void 0:n.updateIntervalMs)!=null?H:this._streamingUpdateIntervalMs,i=this._fallbackStreamingPlaceholderText===void 0?"...":this._fallbackStreamingPlaceholderText,a=i===null?null:await this.adapter.postMessage(this.id,i),o=this.id,s=new im,c="",p=!1,d=null,h=null;a&&(o=a.threadId||this.id,c=i!=null?i:"");let y=()=>{h=setTimeout(()=>{d=g()},r)},g=async()=>{var ne;if(p||!a)return;let ue=s.render();if(ue.trim()&&ue!==c)try{await this.adapter.editMessage(o,a.id,{markdown:ue}),c=ue}catch(ve){(ne=this._logger)==null||ne.warn("fallbackStream edit failed",ve)}p||y()};a&&y();try{for await(let ue of t)if(s.push(ue),!a){let ne=s.render();ne.trim()&&(a=await this.adapter.postMessage(this.id,{markdown:ne}),o=a.threadId||this.id,c=ne,y())}}finally{p=!0,h&&(clearTimeout(h),h=null)}d&&await d;let I=s.getText(),K=s.finish();a||(a=await this.adapter.postMessage(this.id,{markdown:I.trim()?I:" "}),o=a.threadId||this.id,c=I),K.trim()&&K!==c&&await this.adapter.editMessage(o,a.id,{markdown:I});let Z=this.createSentMessage(a.id,{markdown:I},o);return this._threadHistory&&await this._threadHistory.append(this.id,new rn(Z)),Z}async refresh(){let t=await this.adapter.fetchMessages(this.id,{limit:50});t.messages.length>0?this._recentMessages=t.messages:this._threadHistory?this._recentMessages=await this._threadHistory.getMessages(this.id,50):this._recentMessages=[]}mentionUser(t){return`<@${t}>`}toJSON(){var t,n;return{_type:"chat:Thread",id:this.id,channelId:this.channelId,channelVisibility:this.channelVisibility,currentMessage:(t=this._currentMessage)==null?void 0:t.toJSON(),isDM:this.isDM,adapterName:(n=this._adapterName)!=null?n:this.adapter.name}}static fromJSON(t,n){let r=new sc({id:t.id,adapterName:t.adapterName,channelId:t.channelId,channelVisibility:t.channelVisibility,currentMessage:t.currentMessage?rn.fromJSON(t.currentMessage):void 0,isDM:t.isDM});return n&&(r._adapter=n),r}static[lr](t){return t.toJSON()}static[cr](t){return sc.fromJSON(t)}createSentMessage(t,n,r,i){let a=this.adapter,o=r||this.id,s=this,{plainText:c,formatted:p,attachments:d}=yx(n);return{id:t,threadId:o,text:c,formatted:p,raw:null,links:[],author:{userId:"self",userName:a.userName,fullName:a.userName,isBot:!0,isMe:!0},metadata:{dateSent:new Date,edited:!1},attachments:d,replyTo:i,toJSON(){return new rn(this).toJSON()},async edit(y){let g=y;if(Pt(y)){let I=It(y);if(!I)throw new Error("Invalid JSX element: must be a Card element");g=I}return g=await s.processCallbackUrls(g),await a.editMessage(o,t,g),s.createSentMessage(t,g,o,i)},async delete(){await a.deleteMessage(o,t)},async addReaction(y){await a.addReaction(o,t,y)},async removeReaction(y){await a.removeReaction(o,t,y)}}}createSentMessageFromMessage(t){let n=this.adapter,r=this.id,i=t.id,a=this;return{id:t.id,threadId:t.threadId,text:t.text,formatted:t.formatted,raw:t.raw,author:t.author,metadata:t.metadata,attachments:t.attachments,replyTo:t.replyTo,links:t.links,isMention:t.isMention,toJSON(){return t.toJSON()},async edit(o){let s=o;if(Pt(o)){let c=It(o);if(!c)throw new Error("Invalid JSX element: must be a Card element");s=c}return s=await a.processCallbackUrls(s),await n.editMessage(r,i,s),a.createSentMessage(i,s,r,t.replyTo)},async delete(){await n.deleteMessage(r,i)},async addReaction(o){await n.addReaction(r,i,o)},async removeReaction(o){await n.removeReaction(r,i,o)}}}};function yx(e){if(typeof e=="string")return{plainText:e,formatted:nn([tn([en(e)])]),attachments:[]};if("raw"in e)return{plainText:e.raw,formatted:nn([tn([en(e.raw)])]),attachments:e.attachments||[]};if("markdown"in e){let t=Va(e.markdown);return{plainText:sr(t),formatted:t,attachments:e.attachments||[]}}if("ast"in e)return{plainText:sr(e.ast),formatted:e.ast,attachments:e.attachments||[]};if("card"in e){let t=e.fallbackText||ni(e.card);return{plainText:t,formatted:nn([tn([en(t)])]),attachments:[]}}if("type"in e&&e.type==="card"){let t=ni(e);return{plainText:t,formatted:nn([tn([en(t)])]),attachments:[]}}throw new Error("Invalid PostableMessage format")}to();var am=require("async_hooks");var p1=new am.AsyncLocalStorage;ri();cc();var lM=10080*60*1e3;var cM=3600*1e3;var uM=600*1e3,pM=1440*60*1e3;var om=new Map;function ur(e){let t=om.get(e);return t||(t=Object.freeze({name:e,toString:()=>`{{emoji:${e}}}`,toJSON:()=>`{{emoji:${e}}}`}),om.set(e,t)),t}var bx={thumbs_up:{slack:["+1","thumbsup"],gchat:"\u{1F44D}"},thumbs_down:{slack:["-1","thumbsdown"],gchat:"\u{1F44E}"},clap:{slack:"clap",gchat:"\u{1F44F}"},wave:{slack:"wave",gchat:"\u{1F44B}"},pray:{slack:"pray",gchat:"\u{1F64F}"},muscle:{slack:"muscle",gchat:"\u{1F4AA}"},ok_hand:{slack:"ok_hand",gchat:"\u{1F44C}"},point_up:{slack:"point_up",gchat:"\u{1F446}"},point_down:{slack:"point_down",gchat:"\u{1F447}"},point_left:{slack:"point_left",gchat:"\u{1F448}"},point_right:{slack:"point_right",gchat:"\u{1F449}"},raised_hands:{slack:"raised_hands",gchat:"\u{1F64C}"},shrug:{slack:"shrug",gchat:"\u{1F937}"},facepalm:{slack:"facepalm",gchat:"\u{1F926}"},heart:{slack:"heart",gchat:["\u2764\uFE0F","\u2764"]},smile:{slack:["smile","slightly_smiling_face"],gchat:"\u{1F60A}"},laugh:{slack:["laughing","satisfied","joy"],gchat:["\u{1F602}","\u{1F606}"]},thinking:{slack:"thinking_face",gchat:"\u{1F914}"},sad:{slack:["cry","sad","white_frowning_face"],gchat:"\u{1F622}"},cry:{slack:"sob",gchat:"\u{1F62D}"},angry:{slack:"angry",gchat:"\u{1F620}"},love_eyes:{slack:"heart_eyes",gchat:"\u{1F60D}"},cool:{slack:"sunglasses",gchat:"\u{1F60E}"},wink:{slack:"wink",gchat:"\u{1F609}"},surprised:{slack:"open_mouth",gchat:"\u{1F62E}"},worried:{slack:"worried",gchat:"\u{1F61F}"},confused:{slack:"confused",gchat:"\u{1F615}"},neutral:{slack:"neutral_face",gchat:"\u{1F610}"},sleeping:{slack:"sleeping",gchat:"\u{1F634}"},sick:{slack:"nauseated_face",gchat:"\u{1F922}"},mind_blown:{slack:"exploding_head",gchat:"\u{1F92F}"},relieved:{slack:"relieved",gchat:"\u{1F60C}"},grimace:{slack:"grimacing",gchat:"\u{1F62C}"},rolling_eyes:{slack:"rolling_eyes",gchat:"\u{1F644}"},hug:{slack:"hugging_face",gchat:"\u{1F917}"},zany:{slack:"zany_face",gchat:"\u{1F92A}"},check:{slack:["white_check_mark","heavy_check_mark"],gchat:["\u2705","\u2714\uFE0F"]},x:{slack:["x","heavy_multiplication_x"],gchat:["\u274C","\u2716\uFE0F"]},question:{slack:"question",gchat:["\u2753","?"]},exclamation:{slack:"exclamation",gchat:"\u2757"},warning:{slack:"warning",gchat:"\u26A0\uFE0F"},stop:{slack:"octagonal_sign",gchat:"\u{1F6D1}"},info:{slack:"information_source",gchat:"\u2139\uFE0F"},100:{slack:"100",gchat:"\u{1F4AF}"},fire:{slack:"fire",gchat:"\u{1F525}"},star:{slack:"star",gchat:"\u2B50"},sparkles:{slack:"sparkles",gchat:"\u2728"},lightning:{slack:"zap",gchat:"\u26A1"},boom:{slack:"boom",gchat:"\u{1F4A5}"},eyes:{slack:"eyes",gchat:"\u{1F440}"},green_circle:{slack:"large_green_circle",gchat:"\u{1F7E2}"},yellow_circle:{slack:"large_yellow_circle",gchat:"\u{1F7E1}"},red_circle:{slack:"red_circle",gchat:"\u{1F534}"},blue_circle:{slack:"large_blue_circle",gchat:"\u{1F535}"},white_circle:{slack:"white_circle",gchat:"\u26AA"},black_circle:{slack:"black_circle",gchat:"\u26AB"},rocket:{slack:"rocket",gchat:"\u{1F680}"},party:{slack:["tada","partying_face"],gchat:["\u{1F389}","\u{1F973}"]},confetti:{slack:"confetti_ball",gchat:"\u{1F38A}"},balloon:{slack:"balloon",gchat:"\u{1F388}"},gift:{slack:"gift",gchat:"\u{1F381}"},trophy:{slack:"trophy",gchat:"\u{1F3C6}"},medal:{slack:"first_place_medal",gchat:"\u{1F947}"},lightbulb:{slack:"bulb",gchat:"\u{1F4A1}"},gear:{slack:"gear",gchat:"\u2699\uFE0F"},wrench:{slack:"wrench",gchat:"\u{1F527}"},hammer:{slack:"hammer",gchat:"\u{1F528}"},bug:{slack:"bug",gchat:"\u{1F41B}"},link:{slack:"link",gchat:"\u{1F517}"},lock:{slack:"lock",gchat:"\u{1F512}"},unlock:{slack:"unlock",gchat:"\u{1F513}"},key:{slack:"key",gchat:"\u{1F511}"},pin:{slack:"pushpin",gchat:"\u{1F4CC}"},memo:{slack:"memo",gchat:"\u{1F4DD}"},clipboard:{slack:"clipboard",gchat:"\u{1F4CB}"},calendar:{slack:"calendar",gchat:"\u{1F4C5}"},clock:{slack:"clock1",gchat:"\u{1F550}"},hourglass:{slack:"hourglass",gchat:"\u23F3"},bell:{slack:"bell",gchat:"\u{1F514}"},megaphone:{slack:"mega",gchat:"\u{1F4E2}"},speech_bubble:{slack:"speech_balloon",gchat:"\u{1F4AC}"},email:{slack:"email",gchat:"\u{1F4E7}"},inbox:{slack:"inbox_tray",gchat:"\u{1F4E5}"},outbox:{slack:"outbox_tray",gchat:"\u{1F4E4}"},package:{slack:"package",gchat:"\u{1F4E6}"},folder:{slack:"file_folder",gchat:"\u{1F4C1}"},file:{slack:"page_facing_up",gchat:"\u{1F4C4}"},chart_up:{slack:"chart_with_upwards_trend",gchat:"\u{1F4C8}"},chart_down:{slack:"chart_with_downwards_trend",gchat:"\u{1F4C9}"},coffee:{slack:"coffee",gchat:"\u2615"},pizza:{slack:"pizza",gchat:"\u{1F355}"},beer:{slack:"beer",gchat:"\u{1F37A}"},arrow_up:{slack:"arrow_up",gchat:"\u2B06\uFE0F"},arrow_down:{slack:"arrow_down",gchat:"\u2B07\uFE0F"},arrow_left:{slack:"arrow_left",gchat:"\u2B05\uFE0F"},arrow_right:{slack:"arrow_right",gchat:"\u27A1\uFE0F"},refresh:{slack:"arrows_counterclockwise",gchat:"\u{1F504}"},sun:{slack:"sunny",gchat:"\u2600\uFE0F"},cloud:{slack:"cloud",gchat:"\u2601\uFE0F"},rain:{slack:"rain_cloud",gchat:"\u{1F327}\uFE0F"},snow:{slack:"snowflake",gchat:"\u2744\uFE0F"},rainbow:{slack:"rainbow",gchat:"\u{1F308}"}},wx=class{constructor(e){Se(this,"emojiMap");Se(this,"slackToNormalized");Se(this,"gchatToNormalized");this.emojiMap={...bx,...e},this.slackToNormalized=new Map,this.gchatToNormalized=new Map,this.buildReverseMaps()}buildReverseMaps(){for(let[e,t]of Object.entries(this.emojiMap)){let n=Array.isArray(t.slack)?t.slack:[t.slack];for(let i of n)this.slackToNormalized.set(i.toLowerCase(),e);let r=Array.isArray(t.gchat)?t.gchat:[t.gchat];for(let i of r)this.gchatToNormalized.set(i,e)}}fromSlack(e){var r;let t=e.replace(/^:|:$/g,"").toLowerCase(),n=(r=this.slackToNormalized.get(t))!=null?r:e;return ur(n)}fromGChat(e){var n;let t=(n=this.gchatToNormalized.get(e))!=null?n:e;return ur(t)}fromTeams(e){var r;let n=(r={like:"thumbs_up",heart:"heart",laugh:"laugh",surprised:"surprised",sad:"sad",angry:"angry"}[e])!=null?r:e;return ur(n)}toSlack(e){let t=typeof e=="string"?e:e.name,n=this.emojiMap[t];return n?Array.isArray(n.slack)?n.slack[0]:n.slack:t}toGChat(e){let t=typeof e=="string"?e:e.name,n=this.emojiMap[t];return n?Array.isArray(n.gchat)?n.gchat[0]:n.gchat:t}toDiscord(e){return this.toGChat(e)}matches(e,t){let n=typeof t=="string"?t:t.name,r=this.emojiMap[n];if(!r)return e===n;let i=Array.isArray(r.slack)?r.slack:[r.slack],a=Array.isArray(r.gchat)?r.gchat:[r.gchat],o=e.replace(/^:|:$/g,"").toLowerCase();return i.some(s=>s.toLowerCase()===o)||a.includes(e)}extend(e){Object.assign(this.emojiMap,e),this.buildReverseMaps()}},Sx=new wx;function Tx(e){let t=["thumbs_up","thumbs_down","clap","wave","pray","muscle","ok_hand","point_up","point_down","point_left","point_right","raised_hands","shrug","facepalm","heart","smile","laugh","thinking","sad","cry","angry","love_eyes","cool","wink","surprised","worried","confused","neutral","sleeping","sick","mind_blown","relieved","grimace","rolling_eyes","hug","zany","check","x","question","exclamation","warning","stop","info","100","fire","star","sparkles","lightning","boom","eyes","green_circle","yellow_circle","red_circle","blue_circle","white_circle","black_circle","rocket","party","confetti","balloon","gift","trophy","medal","lightbulb","gear","wrench","hammer","bug","link","lock","unlock","key","pin","memo","clipboard","calendar","clock","hourglass","bell","megaphone","speech_bubble","email","inbox","outbox","package","folder","file","chart_up","chart_down","coffee","pizza","beer","arrow_up","arrow_down","arrow_left","arrow_right","refresh","sun","cloud","rain","snow","rainbow"],n={custom:r=>ur(r)};for(let r of t)n[r]=ur(r);if(e){for(let r of Object.keys(e))n[r]=ur(r);Sx.extend(e)}return n}var dM=Tx(),li=Jr,ci=Gr,ui=Wa;var pi=ti,di=kf,hi=ei,fi=Wr,sm=Xr,lm=Qr;var mi=Vr;var gi=Kr,cm=Yr,yi=Zr;var um=Xa,pm=Ja;var dm=Za,bi=Ka,wi=Qa,Si=Ga;function pr(e){return"type"in e&&e.type==="card"}function hm(e){return typeof e=="object"&&e!==null&&e.type==="tool-approval-card"}function fm(e){if(typeof e!="object"||e===null)return!1;let t=e.type;return t==="human-ask-card"||t==="human-approve-card"||t==="human-choose-card"||t==="human-tell-card"}function uc(e,t){return(e==null?void 0:e.workflowId)===t.id}var xx=Symbol.for("chat.jsx.element"),Ax=new Set([li,ci,ui,pi,di,hi,fi,um,sm,lm,mi,gi,pm,dm,cm,bi,wi,yi,Si]);function vx(e){return typeof e=="object"&&e!==null&&"type"in e}function kx(e){return typeof e=="object"&&e!==null&&e.$$typeof===xx}async function lo(e){let t=so(e);if(t&&typeof t=="object"&&pr(t))return t;let{isJSX:n,toCardElement:r}=await Promise.resolve().then(()=>(gm(),mm));return n(t)?r(t):null}function so(e){var t;if(Array.isArray(e))return e.map(n=>so(n));if(!kx(e))return Ex(e);if(typeof e.type=="function"&&!Ax.has(e.type)){let n={...(t=e.props)!=null?t:{}};return e.children!==void 0&&(n.children=e.children),so(e.type(n))}return{...e,children:so(e.children)}}function Ex(e){return typeof e=="string"||typeof e=="number"||vx(e)?e:null}var ym=async(e,t)=>{let n=new TextEncoder,r=n.encode(e),i=n.encode(t),a=await crypto.subtle.importKey("raw",r,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),o=await crypto.subtle.sign("HMAC",a,i);return Array.from(new Uint8Array(o)).map(s=>s.toString(16).padStart(2,"0")).join("")},bm=(e,t)=>{if(typeof e!="string"||typeof t!="string"||e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r+=1)n|=e.charCodeAt(r)^t.charCodeAt(r);return n===0};var Rx=require("cross-fetch");var wm=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 t=await(await fetch("http://localhost:2022/.well-known/novu")).json();return`${t.tunnelOrigin}${t.route}`}}catch(e){console.error(e)}return""};function Sm(e){return!!e&&typeof e=="object"&&"error"in e&&"message"in e&&"statusCode"in e}var co=(e,t)=>{if(!e)throw new Zi;return{post:async(n,r)=>{let i=await fetch(`${t}/v1${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${e}`},body:JSON.stringify(r)}),a=await i.json();if(i.ok)return a;throw Sm(a)?new ea(a.statusCode,a.error,a.message):new Xn(a)},delete:async n=>(await fetch(`${t}/v1${n}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${e}`}})).json()}};var Em=require("liquidjs");function pc(e,t){let n={...e};for(let r of Object.keys(t)){let i=t[r];i&&typeof i=="object"&&!Array.isArray(i)?n[r]=pc(n[r]||{},i):(Array.isArray(i),n[r]=i)}return n}function uo(e,t){let n=t.split(".").reduce((r,i)=>{if(r&&typeof r=="object")return r[i]},e);if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"){let r=JSON.stringify(n);return r==="{}"?"":r}return""}function Tm(e,t=2,n,r=", "){if(!Array.isArray(e)||e.length===0)return"";let i=n?e.map(s=>typeof s!="object"||!s?"":uo(s,n)):e;if(i.length===1)return i[0];if(i.length===2)return`${i[0]} and ${i[1]}`;if(t>=i.length){let s=i.slice(0,-1),c=i[i.length-1];return`${s.join(r)} and ${c}`}let a=i.slice(0,t),o=i.length-t;return`${a.join(r)} and ${o} ${o===1?"other":"others"}`}var xm=Bt(require("pluralize"),1);function Am(e,t="",n="",r="true"){if(e==null)return"";let i=0;if(Array.isArray(e)?i=e.length:typeof e=="object"?i=Object.keys(e).length:typeof e=="string"?i=+e:typeof e=="number"?i=e:i=Number(e),Number.isNaN(i)&&(i=0),i<=0)return"";let a;return n?a=i===1?t:n:a=(0,xm.default)(t,i),r==="true"?`${i} ${a}`:a}var Cx=require("liquidjs"),vm=Bt(require("pluralize"),1),_x=require("zod");var Ox="",Ix=2,Px="other",Mx=", ",Nx=" and ",Lx=", and ";function km(e,t=Ox,n=Ix,r=Px,i=Mx,a=Nx,o=Lx){if(!Array.isArray(e)||e.length===0)return"";let s=t?e.map(y=>typeof y!="object"||!y?"":uo(y,t)):e,c=s.length;if(c===1)return s[0];if(c===2)return`${s[0]}${a}${s[1]}`;if(n>=c){let y=s.slice(0,c-1),g=s[c-1];return`${y.join(i)}${o}${g}`}let p=s.slice(0,n),d=c-n,h=n===1?a:o;return`${p.join(i)}${h}${d} ${(0,vm.default)(r,d)}`}function Dx(e){return Array.isArray(e)||typeof e=="object"&&e!==null?Rm(e):typeof e=="string"?e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):e==null?"":String(e)}var Rm=(e,t=0)=>Array.isArray(e)||typeof e=="object"&&e!==null?JSON.stringify(e,null,t).replace(/"/g,"'").replace(/\n/g,"\\n"):e==null?"":String(e);function Cm(e){let t=new Em.Liquid({outputEscape:Dx,...e});return t.registerFilter("json",(n,r)=>Rm(n,r)),t.registerFilter("digest",Tm),t.registerFilter("toSentence",km),t.registerFilter("pluralize",Am),t}var Vn=Bt(require("chalk"),1),et={info:e=>Vn.default.blue(e),warning:e=>Vn.default.yellow(e),error:e=>Vn.default.red(e),success:e=>Vn.default.green(e),underline:e=>Vn.default.underline(e),bold:e=>Vn.default.bold(e)},lt={SUCCESS:et.success("\u2714"),ERROR:et.error("\u2717"),WARNING:et.warning("\u26A0"),INFO:et.info("\u2139"),ARROW:et.bold("\u2192"),MOCK:et.info("\u25CB"),HYDRATED:et.bold(et.info("\u2192")),STEP:et.info("\u03C3"),ACTION:et.info("\u03B1"),DURATION:et.info("\u0394"),PROVIDER:et.info("\u2699"),OUTPUT:et.info("\u21E2"),INPUT:et.info("\u21E0"),WORKFLOW:et.info("\u03C9"),STATE:et.info("\u03C3"),EXECUTE:et.info("\u03B5"),PREVIEW:et.info("\u03C1")};function po(e){return e||process.env.NOVU_API_URL||"https://api.novu.co"}function ho(e){return e||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var dc=Bt(require("sanitize-html"),1),Fx=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"];function Ux(e){return e.toLowerCase().startsWith("on")}function Hx(e){return e.replace(/<\/([a-zA-Z][a-zA-Z0-9]*)\s*\/[^>]*>/g,"</$1>")}var $x={allowedTags:dc.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,transformTags:{"*":(e,t)=>{let n={};for(let[r,i]of Object.entries(t))Ux(r)||(n[r]=i);return{tagName:e,attribs:n}},img:(e,t)=>{let n={};for(let[r,i]of Object.entries(t))Fx.includes(r.toLowerCase())&&(n[r]=i);return{tagName:e,attribs:n}}},allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},_m=e=>{if(!e)return e;let t=Hx(e),n=/^<!DOCTYPE .*?>/,r=t.match(n),i=(0,dc.default)(t,$x);return r?r[0]+i:i},fo=e=>Object.keys(e).reduce((t,n)=>{let r=e[n];return typeof r=="string"?t[n]=_m(r):Array.isArray(r)?t[n]=r.map(i=>typeof i=="string"?_m(i):typeof i=="object"?fo(i):i):typeof r=="object"&&r!==null?t[n]=fo(r):t[n]=r,t},{});function Om(e,t=!0,n=console){t&&(n.info(`
156
+ ${et.bold(et.underline("Discovered workflowId:"))} '${e.workflowId}'`),e.steps.forEach((r,i)=>{let a=i===e.steps.length-1,o=a?"\u2514":"\u251C";n.info(`${o} ${lt.STEP} Discovered stepId: '${r.stepId}' Type: '${r.type}'`),r.providers.forEach((s,c)=>{let p=c===r.providers.length-1,d=a?" ":"\u2502",h=p?"\u2514":"\u251C";n.info(`${d} ${h} ${lt.PROVIDER} Discovered provider: '${s.type}'`)})}))}var Im=require("jsonrepair");function Pm(e){let t=e.trim();return(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))&&t.length>2}var Mm="__novuJsonString";function qx(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e[Mm]===!0}function Ti(e){if(typeof e=="string"){if(!Pm(e))return e;try{let t=JSON.parse(e);return{[Mm]:!0,value:Ti(t)}}catch{return e}}if(Array.isArray(e))return e.map(t=>Ti(t));if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=Ti(r);return t}return e}function xi(e){if(qx(e))return JSON.stringify(xi(e.value));if(Array.isArray(e))return e.map(t=>xi(t));if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=xi(r);return t}return e}function jx(e){try{return JSON.parse(e),e}catch{try{return(0,Im.jsonrepair)(e)}catch{return e}}}function Nm(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>typeof n=="string"?[t,Pm(n)?jx(n):n]:typeof n=="object"&&n!==null&&!Array.isArray(n)?[t,Nm(n)]:[t,n]))}function Lm(e){return!(e!=null&&e.data)||typeof e.data!="object"||Array.isArray(e.data)?e:{...e,data:Nm(e.data)}}var Fm=Bt(require("ajv"),1),Um=Bt(require("ajv-formats"),1);var Dm=e=>typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e));var mo=class extends xn{constructor(n,r){let i=r.length===1?"it":"them";super(`Tried to use a ${n} in @novu/framework without ${r.join(", ")} installed. Please install ${i} by running \`npm install ${r.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var go=async(e,t)=>{let n=new Set;if((await Promise.allSettled(e.map(i=>i.import))).forEach((i,a)=>{let o=e[a];i.status==="fulfilled"&&o.exports.every(c=>i.value[c]!==void 0)||n.add(o.name)}),n.size>0)throw new mo(t,Array.from(n))};var yo=class{constructor(){this.requiredImports=[];this.ajv=new Fm.default({useDefaults:!0,removeAdditional:"failing",strict:!1}),(0,Um.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(t){let n=t.type==="object"||!!t.anyOf||!!t.allOf||!!t.oneOf;return n&&await go(this.requiredImports,"JSON schema"),n}async validate(t,n){let r=this.compiledSchemas.get(n);r||(r=this.ajv.compile(n),this.compiledSchemas.set(n,r));let i=Dm(t);return r(i)?{success:!0,data:i}:{success:!1,errors:r.errors.map(o=>({path:o.instancePath,message:o.message}))}}async transformToJsonSchema(t){return t}};var bo=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(t){let n=t.safeParseAsync!==void 0;return n&&await go(this.requiredImports,"Zod schema"),n}async validate(t,n){let r=await n.safeParseAsync(t);return r.success?{success:!0,data:r.data}:{success:!1,errors:r.error.issues.map(i=>({path:`/${i.path.join("/")}`,message:i.message}))}}async transformToJsonSchema(t){let{zodToJsonSchema:n}=await import("zod-to-json-schema");return n(t)}};var wo=new bo,So=new yo,Ai=async(e,t)=>{if(await wo.canHandle(e))return wo.validate(t,e);if(await So.canHandle(e))return So.validate(t,e);throw new Error("Invalid schema")},bt=async e=>{if(await wo.canHandle(e))return wo.transformToJsonSchema(e);if(await So.canHandle(e))return So.transformToJsonSchema(e);throw new Error("Invalid schema")};function Hm(){return["development",void 0,"dev"].includes(process.env.NODE_ENV)}var dr=class{constructor(t){this.discoveredWorkflows=new Map;this.discoverWorkflowPromises=new Map;this.registeredAgents=new Map;this.version="2.14.0-rc.5ea799b171";let n=this.buildOptions(t);this.apiUrl=n.apiUrl,this.secretKey=n.secretKey,this.strictAuthentication=n.strictAuthentication,this.verbose=n.verbose,this.logger=n.logger,this.templateEngine=Cm()}buildOptions(t){let n={apiUrl:po(t==null?void 0:t.apiUrl),secretKey:ho(t==null?void 0:t.secretKey),strictAuthentication:!Hm(),verbose:Hm(),logger:console};return(t==null?void 0:t.strictAuthentication)!==void 0?n.strictAuthentication=t.strictAuthentication:process.env.NOVU_STRICT_AUTHENTICATION_ENABLED!==void 0&&(n.strictAuthentication=process.env.NOVU_STRICT_AUTHENTICATION_ENABLED==="true"),(t==null?void 0:t.verbose)!==void 0&&(n.verbose=t.verbose),(t==null?void 0:t.logger)!==void 0&&(n.logger=t.logger),n}log(...t){this.verbose&&this.logger.info(...t)}async addWorkflows(t){for(let n of t){if(this.discoveredWorkflows.has(n.id))continue;let r=this.discoverWorkflowPromises.get(n.id);if(r){await r;continue}let i=this.addWorkflow(n);this.discoverWorkflowPromises.set(n.id,i),await i}}addAgents(t){for(let n of t)this.registeredAgents.set(n.id,n)}getAgent(t){return this.registeredAgents.get(t)}async addWorkflow(t){try{let n=await t.discover();Om(n,this.verbose,this.logger),this.discoveredWorkflows.set(t.id,n)}finally{this.discoverWorkflowPromises.delete(t.id)}}healthCheck(){let t=this.getRegisteredWorkflows(),n=t.length,r=t.reduce((i,a)=>i+a.steps.length,0);return{status:"ok",sdkVersion:"2.14.0-rc.5ea799b171",frameworkVersion:"2024-06-26",discovered:{workflows:n,steps:r}}}getWorkflow(t){let n=this.discoveredWorkflows.get(t);if(n)return n;throw new Pr(t)}getStep(t,n){let i=this.getWorkflow(t).steps.find(a=>a.stepId===n);if(i)return i;throw new la(n)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows(),agents:Array.from(this.registeredAgents.keys()).map(t=>({agentId:t}))}}mock(t){try{return Pu(t)}catch(n){return this.logger.warn("Failed to mock schema, returning empty object:",n),{}}}async validate(t,n,r,i,a,o,s){let c=await Ai(n,t);if(c.success)return c.data;switch(r){case"event":this.throwInvalidEvent(i,a,c.errors);case"step":this.throwInvalidStep(o,i,a,c.errors);case"provider":this.throwInvalidProvider(o,s,i,a,c.errors);default:throw new Error(`Invalid component: '${r}'`)}}throwInvalidProvider(t,n,r,i,a){throw t?n?r==="output"?new Gi(i,t,n,a):new Error(`Invalid payload type: '${r}'`):new Error("providerId is required"):new Error("stepId is required")}throwInvalidStep(t,n,r,i){if(!t)throw new Error("stepId is required");switch(n){case"output":throw new Wi(r,t,i);case"result":throw new Yi(r,t,i);case"controls":throw new Vi(r,t,i);default:throw new Error(`Invalid payload type: '${n}'`)}}throwInvalidEvent(t,n,r){switch(t){case"controls":throw new zi(n,r);case"payload":throw new _r(n,r);default:throw new Error(`Invalid payload type: '${t}'`)}}executeStepFactory(t,n,r){return async(i,a,o)=>{if(r())return;let s=this.getStep(t.workflowId,i),c=t.action==="preview";if(!c&&i===t.stepId){let g=await this.createStepControls(s,t),I=await this.compileControls(g,t);if(await this.shouldSkip(o==null?void 0:o.skip,I))return n({options:{skip:!0},outputs:{},providers:{}}),{}}let p=this.previewStep.bind(this),d=this.executeStep.bind(this),y=await(c?p:d)(t,{...s,providers:s.providers.map(g=>{var K;let I=(K=o==null?void 0:o.providers)==null?void 0:K[g.type];if(!I)throw new ta(g.type);return{...g,resolve:I}}),resolve:a});return this.shouldSanitize({stepType:s.type,options:o})&&(y={...y,outputs:fo(y.outputs)}),i===t.stepId&&n({...y,options:{skip:!1}}),y.outputs}}shouldSanitize({stepType:t,options:n}){return(n==null?void 0:n.disableOutputSanitization)===!0?!1:["email","in_app"].includes(t)}async shouldSkip(t,n){return t?t(n):!1}async executeWorkflow(t){let i=`${{execute:"Executing",preview:"Previewing"}[t.action]||t.action} workflowId:`;this.log(`
157
+ ${et.bold(et.underline(i))} '${t.workflowId}'`);let a=this.getWorkflow(t.workflowId),o=process.hrtime(),s={outputs:{},providers:{},options:{skip:!1}},c,p=!1,d=new Promise(_e=>{c=_e}),h=_e=>{if(p)throw new Error("setResult can only be called once per workflow execution");c(),p=!0,s=_e},y=()=>p,g;try{if(t.action==="execute"&&!t.payload)throw new _r(t.workflowId,{message:"Event `payload` is required"});let _e=await this.createExecutionPayload(t,a),$={...t,payload:_e};await Promise.race([d,a.execute({payload:_e,env:t.env,controls:{},subscriber:t.subscriber,context:t.context,step:{email:this.executeStepFactory($,h,y),sms:this.executeStepFactory($,h,y),inApp:this.executeStepFactory($,h,y),digest:this.executeStepFactory($,h,y),delay:this.executeStepFactory($,h,y),push:this.executeStepFactory($,h,y),chat:this.executeStepFactory($,h,y),custom:this.executeStepFactory($,h,y),throttle:this.executeStepFactory($,h,y),tool:this.executeStepFactory($,h,y)}})])}catch(_e){g=_e}let I=process.hrtime(o),K=I[0],Z=I[1],H=K*1e3+Z/1e6,ue=g?lt.ERROR:lt.SUCCESS,ve={execute:"Executed",preview:"Previewed"}[t.action]||t.action;if(this.log(`${ue} ${ve} workflowId: \`${t.workflowId}\``),this.prettyPrintExecute(t,H,g),g)throw g;return{outputs:s.outputs,providers:s.providers,options:s.options,metadata:{status:"success",error:!1,duration:H}}}async createExecutionPayload(t,n){let{payload:r}=t;if(t.action==="preview"){let a=this.mock(n.payload.schema);r=Object.assign(a,r)}return await this.validate(r,n.payload.unknownSchema,"event","payload",t.workflowId)}prettyPrintExecute(t,n,r){if(!this.verbose)return;let i=r?lt.ERROR:lt.SUCCESS,o={execute:"Executed",preview:"Previewed"}[t.action]||t.action,s=r?"Failed to execute":o,c=r?et.error:et.success,p=`${i} ${s} workflowId: '${t.workflowId}`;this.logger.info(`
158
+ ${et.bold(c(p))}'
151
159
  \u251C ${lt.STEP} stepId: '${t.stepId}'
152
160
  \u251C ${lt.ACTION} action: '${t.action}'
153
161
  \u2514 ${lt.DURATION} duration: '${n.toFixed(2)}ms'
154
- `)}async executeProviders(t,n,r,i){return n.providers.reduce(async(o,a)=>{let s=await o,u=await this.runProvider(t,n,a,r,i);return{...s,[a.type]:u}},Promise.resolve({}))}async runProvider(t,n,r,i,o){let a=t.action==="preview";if(t.stepId!==n.stepId)return a?(this.log(` ${lt.MOCK} Mocked provider: \`${r.type}\``),this.mock(r.outputs.schema)):(this.log(` ${lt.HYDRATED} Hydrated provider: \`${r.type}\``),{});try{return await this.resolveProviderOutput(t,n,r,o,i)}catch(s){if(this.log(` ${lt.ERROR} Failed to execute provider: \`${r.type}\``),a)return this.log(` ${lt.MOCK} Mocked provider: \`${r.type}\``),this.mock(r.outputs.schema);throw new Di(r.type,t.action,s)}}async resolveProviderOutput(t,n,r,i,o){let a=await r.resolve({controls:i,outputs:o}),s=await this.validate(a,r.outputs.unknownSchema,"step","output",t.workflowId,n.stepId,r.type);return this.log(` ${lt.SUCCESS} Executed provider: \`${r.type}\``),{...s,_passthrough:a._passthrough}}async executeStep(t,n){if(t.stepId===n.stepId)try{let r=await this.createStepControls(n,t),i=await this.compileControls(r,t),o=await n.resolve(i),a=await this.normalizeChatCardOutput(n,o),s=await this.validate(a,n.outputs.unknownSchema,"step","output",t.workflowId,n.stepId),u=await this.executeProviders(t,n,s,i);return this.log(` ${lt.SUCCESS} Executed stepId: \`${n.stepId}\``),{outputs:s,providers:u}}catch(r){throw this.log(` ${lt.ERROR} Failed to execute stepId: \`${n.stepId}\``),Mn(r)?r:new Er(n.stepId,t.action,r)}else try{let r=this.getStepState(t,n.stepId);if(r){let i=await this.validate(r.outputs,n.results.unknownSchema,"step","result",t.workflowId,n.stepId);return this.log(` ${lt.HYDRATED} Hydrated stepId: \`${n.stepId}\``),{outputs:i,providers:await this.executeProviders(t,n,i,{})}}else throw new ki(t.workflowId,n.stepId)}catch(r){throw this.log(` ${lt.ERROR} Failed to hydrate stepId: \`${n.stepId}\``),r}}async normalizeChatCardOutput(t,n){if(t.type!=="chat"||(n==null?void 0:n.card)==null)return n;let r=await Yo(n.card);return r?{...n,card:r}:n}async compileControls(t,n){var r;try{let i=ei(t),o=this.preprocessTranslationPatterns(JSON.stringify(i));o=this.preprocessFilterTranslationArgs(o);let a=this.templateEngine.parse(o),s=this.getWorkflow(n.workflowId),u={workflow:{workflowId:s.workflowId,name:s.name,description:s.description,tags:s.tags,severity:s.severity},payload:n.payload,subscriber:n.subscriber,...n.actor&&{actor:n.actor},context:n.context,steps:sx(n.state),env:(r=n.env)!=null?r:{}},p=await this.templateEngine.render(a,u),d=this.postprocessTranslationMarkers(p),h=(0,sm.jsonrepair)(d),g=JSON.parse(h),y=ti(g);return nm(y)}catch(i){throw new Ri(n.workflowId,n.stepId,i)}}preprocessTranslationPatterns(t){return t.replace(/\{\{\s*t\.([\p{L}\p{N}_.-]+)\s*\}\}/gu,"[T:$1]")}preprocessFilterTranslationArgs(t){return t.replace(/'t\.([\p{L}\p{N}_.-]+)'/gu,"'[T:$1]'")}postprocessTranslationMarkers(t){return t.replace(/\[T:([\p{L}\p{N}_.-]+)\]/gu,"{{t.$1}}")}async createStepControls(t,n){return await this.validate(n.controls,t.controls.unknownSchema,"step","controls",n.workflowId,t.stepId)}async previewStep(t,n){try{return await this.constructStepForPreview(t,n)}catch(r){throw this.log(` ${lt.ERROR} Failed to preview stepId: \`${n.stepId}\``),Mn(r)?r:new Er(n.stepId,t.action,r)}}async constructStepForPreview(t,n){return t.stepId===n.stepId?await this.previewRequiredStep(n,t):await this.extractMockDataForPreviousSteps(t,n)}async extractMockDataForPreviousSteps(t,n){let r={},i=this.getStepState(t,n.stepId),o=this.mock(n.results.schema);return{outputs:Fl(o,(i==null?void 0:i.outputs)||{}),providers:await this.executeProviders(t,n,r,{})}}async previewRequiredStep(t,n){let r=await this.createStepControls(t,n),i=await this.compileControls(r,n),o=await t.resolve(i),a=await this.normalizeChatCardOutput(t,o),s=await this.validate(a,t.outputs.unknownSchema,"step","output",n.workflowId,t.stepId);return this.log(` ${lt.MOCK} Mocked stepId: \`${t.stepId}\``),{outputs:s,providers:await this.executeProviders(n,t,s,i)}}getStepState(t,n){return t.state.find(r=>r.stepId===n)}getStepCode(t,n){return{code:this.getStep(t,n).resolve.toString()}}getWorkflowCode(t){return{code:this.getWorkflow(t).execute.toString()}}getCode(t,n){let r;if(t)n?r=this.getStepCode(t,n):r=this.getWorkflowCode(t);else throw new _r(t);return r}};function sx(e){let t={};for(let n of e)t[n.stepId]=n.outputs;return t}var lx={400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",408:"Request Timeout",409:"Conflict",422:"Unprocessable Entity",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"};function oa(e){return typeof e=="string"&&e.trim()?e:!e||typeof e!="object"?null:oa(e.message)}function cx(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t,r=oa(n.message);if(r)return r;let i=oa(n.error);if(i)return i;let o=n.errors;return Array.isArray(o)?oa(o[0]):null}function ux(e,t){var i;let n=(i=lx[e])!=null?i:e,r=cx(t);return r?`Delivery failed: ${n}: ${r}`:`Delivery failed: ${n}`}var bn=class extends Error{constructor(t,n){super(t),this.name="AgentError",this.cause=n==null?void 0:n.cause,this.delivery=n==null?void 0:n.delivery}},Wt=class extends bn{constructor(t,n){let r={statusCode:t,responseBody:n};super(ux(t,n),{delivery:r}),this.name="AgentDeliveryError",this.statusCode=t,this.responseBody=n}};function ri(e){return e instanceof bn?e:e instanceof Error?new bn(e.message,{cause:e}):new bn("Turn failed",{cause:e})}var lm=Symbol.for("novu.agent.runtimeContext");var $l=(i=>(i.ON_MESSAGE="onMessage",i.ON_ACTION="onAction",i.ON_RESOLVE="onResolve",i.ON_REACTION="onReaction",i))($l||{}),cr=class{constructor(){this.__novuPendingApproval=!0}};function cm(e){return typeof e=="object"&&e!==null&&"suppress"in e&&e.suppress===!0}var um=1;function px(e){return new Promise(t=>{setTimeout(t,e)})}function dx(e){return e>=500||e===408||e===429}var aa=class{constructor(t){this.sequence=0;this.buffer=[];this.chain=Promise.resolve();var n,r;this.runId=`run_${crypto.randomUUID()}`,this.eventsUrl=t.eventsUrl,this.secretKey=t.secretKey,this.conversationId=t.conversationId,this.agentId=t.agentId,this.turnId=t.turnId,this.fetchFn=(n=t.fetchFn)!=null?n:fetch,this.maxRetries=(r=t.maxRetries)!=null?r:3}enqueue(t){this.sequence+=1,this.buffer.push({version:um,conversationId:this.conversationId,agentId:this.agentId,runId:this.runId,turnId:this.turnId,sequence:this.sequence,timestamp:new Date().toISOString(),event:t})}flush(){if(this.buffer.length===0)return this.chain;let t=this.buffer;return this.buffer=[],this.chain=this.chain.then(()=>this.postBatchWithRetry(t)),this.chain}async emit(t){this.enqueue(t),await this.flush()}async postBatchWithRetry(t){let n;for(let r=1;r<=this.maxRetries;r+=1)try{await this.postBatch(t);return}catch(i){if(n=i,!hx(i))throw i;r<this.maxRetries&&await px(250*r)}throw n}async postBatch(t){let n;try{n=await this.fetchFn(this.eventsUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${this.secretKey}`},body:JSON.stringify({events:t})})}catch(i){throw fx(i)}let r=await n.text().catch(()=>"");if(!n.ok)throw new Wt(n.status,r)}};function hx(e){return!(e instanceof Wt)||e.statusCode===0?!0:dx(e.statusCode)}function fx(e){if(e instanceof Wt)return e;let t=e instanceof Error?e.message:"Network request failed";return new Wt(0,t)}function pm(e){let t=typeof e=="string"?[e]:e,n=[],r=new Set;for(let i of t){if(typeof i!="string")throw new Error("`to` must be a subscriberId string or an array of subscriberIds");let o=i.trim();!o||r.has(o)||(r.add(o),n.push(o))}if(n.length===0)throw new Error("`to` must include at least one subscriberId");if(n.length>50)throw new Error("`to` supports at most 50 subscriberIds");return n}var dm="tool-approval";function mx(e){return e==="approve"||e==="deny"}function ql(e,t){return`${dm}:${e}:${t}`}function hm(e){let[t,n,...r]=(e!=null?e:"").split(":"),i=r.join(":");return t!==dm||!mx(n)||!i?null:{approved:n==="approve",approvalId:i}}async function fm(e,t,n,r){var p,d;let i=r!=null?r:t.id,o={approve:ql("approve",i),deny:ql("deny",i)},a=h=>({type:"tool-approval-card",...h}),s=(d=(p=n==null?void 0:n.renderApproval)==null?void 0:p.call(n,{toolCall:t,actionIds:o,approvalCard:a}))!=null?d:a(),u={approvalId:i,toolCallId:t.id,name:t.name,input:t.input};if(e.emitToolApprovalRequest(u),Lf(s)){await e.replyApprovalCard(s);return}await e.reply(s)}var gx=5*1024*1024,yx=5*1024*1024,mm=32768,bx=/^[A-Za-z0-9+/]*={0,2}$/;function ai(e,t){return e.filename?`"${e.filename}"`:`at index ${t}`}function wm(){return globalThis.Buffer}function wx(e){var t,n,r;return(r=(n=(t=wm())==null?void 0:t.isBuffer)==null?void 0:n.call(t,e))!=null?r:!1}function Sx(e){return typeof Blob!="undefined"&&e instanceof Blob}function jl(e){let t=wm();if(t)return t.from(e).toString("base64");if(typeof btoa!="function")throw new Error("Unable to encode file data: base64 encoding is not available in this runtime.");let n="";for(let r=0;r<e.length;r+=mm){let i=e.subarray(r,r+mm);n+=String.fromCharCode(...i)}return btoa(n)}function Sm(e){let t=e.replace(/\s/g,""),n=t.length%4;if(!t||n===1||!bx.test(t))return null;let r=t.endsWith("==")?2:t.endsWith("=")?1:0;return Math.floor(t.length*3/4)-r}function ii(e,t,n){if(e>gx)throw new Error(`Invalid file ${ai(t,n)}: inline data must be 5 MB or smaller. Use a publicly-accessible URL for larger files.`)}async function Tx(e,t,n){if(typeof e=="string"){let r=Sm(e);if(r===null)throw new Error(`Invalid file ${ai(t,n)}: data must be a base64-encoded string.`);return ii(r,t,n),e}if(wx(e))return ii(e.byteLength,t,n),e.toString("base64");if(e instanceof Uint8Array)return ii(e.byteLength,t,n),jl(e);if(e instanceof ArrayBuffer)return ii(e.byteLength,t,n),jl(new Uint8Array(e));if(Sx(e))return ii(e.size,t,n),jl(new Uint8Array(await e.arrayBuffer()));throw new Error(`Invalid file ${ai(t,n)}: data must be a base64 string, Buffer, Uint8Array, ArrayBuffer, or Blob.`)}async function xx(e){if(!(e!=null&&e.length))return;let t=[],n=0;for(let[r,i]of e.entries()){let o=i.data,a=i.url,s=o!=null,u=a!=null;if(s===u)throw new Error(`Invalid file ${ai(i,r)}: provide exactly one of data or url.`);if(s){let p=await Tx(o,i,r),d=Sm(p);if(n+=d!=null?d:0,n>yx)throw new Error("Invalid files: total inline data must be 5 MB or smaller. Use publicly-accessible URLs for larger files.");t.push({...i,data:p});continue}if(u&&typeof a!="string")throw new Error(`Invalid file ${ai(i,r)}: url must be a string.`);t.push(i)}return t}async function Tm(e,t){let n=await xx(t);if(typeof e=="string")return n?{markdown:e,files:n}:{markdown:e};let r=await Yo(e);if(r)return n?{card:r,files:n}:{card:r};throw new Error("Invalid message content \u2014 expected string or CardElement")}function xm(e){return`${e}_${crypto.randomUUID()}`}function gm(e){if(e.markdown!==void 0)return{markdown:e.markdown};if(e.card!==void 0)return{card:e.card};throw new Error("Invalid reply content \u2014 expected markdown or card")}function ym(e){if(e!=null&&e.length)return e.map((t,n)=>({fileId:t.filename||`file_${n}`,name:t.filename,mediaType:t.mimeType,...t.data!==void 0?{data:typeof t.data=="string"?t.data:void 0}:{},...t.url!==void 0?{url:t.url}:{}}))}function Bl(e,t){t.toolApprovalRequest&&(e.toolApprovalRequest=t.toolApprovalRequest),t.signals.length&&(e.signals=t.signals),t.toolResults.length&&(e.toolResults=t.toolResults),t.addReactions.length&&(e.addReactions=t.addReactions),t.deleteMessages.length&&(e.deleteMessages=t.deleteMessages),t.resolve&&(e.resolve=t.resolve)}function zl(e,t){var r;let n=[];if(e.toolApprovalRequest){let i=e.toolApprovalRequest;n.push({type:"tool-approval-request",approvalId:i.approvalId,toolUseId:i.toolCallId,toolName:i.name,input:i.input,...t!=null&&t.deliverApprovalCard?{deliverCard:!0}:{}})}for(let i of e.toolResults)n.push({type:"tool-use-result",toolUseId:i.toolCallId,content:[{type:"text",text:String((r=i.preview)!=null?r:"")},{type:"json",value:i.output}]});for(let i of e.signals)n.push({type:"signal",signal:i});for(let i of e.addReactions)n.push({type:"channel.reaction",messageId:i.messageId,emoji:i.emojiName,op:"add"});for(let i of e.deleteMessages)n.push({type:"channel.delete",messageId:i.messageId});return e.resolve&&n.push({type:"resolve",summary:e.resolve.summary}),n}var Vl=class{constructor(t,n,r,i){this.replyUrl=t;this.secretKey=n;this.conversationId=r;this.integrationIdentifier=i}async sendReply(t,n){let r=this._baseBody();return r.reply=t,Bl(r,n),this._post(r)}async sendApprovalCard(t,n){let r=this._baseBody();return r.reply={toolApprovalCard:t},Bl(r,n),this._post(r)}async editMessage(t,n){return this._post({...this._baseBody(),edit:{messageId:t,content:n}})}async deleteMessage(t){await this._post({...this._baseBody(),deleteMessages:[{messageId:t}]})}async setTyping(t){await this._post({...this._baseBody(),typing:t})}async flushSideEffects(t){let n=this._baseBody();Bl(n,t),await this._post(n)}async emitCustom(){}queueRunStart(){}async emitRunFinish(){}async reportTurnError(){await this._post({...this._baseBody(),error:!0})}_baseBody(){return{conversationId:this.conversationId,integrationIdentifier:this.integrationIdentifier}}async _post(t){let n=await fetch(this.replyUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${this.secretKey}`},body:JSON.stringify(t)});if(!n.ok){let i=await n.text().catch(()=>"");throw new Wt(n.status,i)}let r=await n.text().catch(()=>"");if(!r)return null;try{let i=JSON.parse(r),o=i&&typeof i=="object"&&"data"in i?i.data:i;if(o&&typeof o.messageId=="string"&&typeof o.platformThreadId=="string")return{messageId:o.messageId,platformThreadId:o.platformThreadId}}catch{}return null}},Hl=class{constructor(t){this.outbox=t}async sendReply(t,n){let r=xm("msg"),i=zl(n);return i.push({type:"message",role:"assistant",messageId:r,content:gm(t),files:ym(t.files)}),await this._emitAndFlush(i),{messageId:r,platformThreadId:""}}async sendApprovalCard(t,n){return await this._emitAndFlush(zl(n,{deliverApprovalCard:!0})),"unaddressable"}async editMessage(t,n){return await this.outbox.emit({type:"channel.edit",messageId:t,content:gm(n),files:ym(n.files)}),{messageId:t,platformThreadId:""}}async deleteMessage(t){await this.outbox.emit({type:"channel.delete",messageId:t})}async setTyping(t){if(t==="stop"){await this.outbox.emit({type:"channel.typing",state:"off"});return}let n=typeof t=="object"&&"status"in t?t.status:void 0;await this.outbox.emit({type:"channel.typing",state:"on",status:n})}async flushSideEffects(t){await this._emitAndFlush(zl(t))}async emitCustom(t,n){await this.outbox.emit({type:"custom",name:t,data:n})}queueRunStart(){this.outbox.enqueue({type:"run-start"})}async emitRunFinish(t){await this.outbox.emit({type:"run-finish",outcome:t})}async reportTurnError(t){await this.outbox.emit({type:"run-error",message:t!=null?t:"agent handler failed"})}async _emitAndFlush(t){if(t.length!==0){for(let n of t)this.outbox.enqueue(n);await this.outbox.flush()}}},oi=class{constructor(t,n,r){this.transport=r;this.editedByHandler=!1;this.messageId=t,this.platformThreadId=n}async edit(t,n){this.editedByHandler=!0;let r=await Tm(t,n==null?void 0:n.files),i=await this.transport.editMessage(this.messageId,r);if(!i)throw new Error("Agent edit did not return a message handle");return this.messageId=i.messageId,this.platformThreadId=i.platformThreadId,this}async delete(){await this.transport.deleteMessage(this.messageId)}},Wl=class{constructor(){this.messageId="";this.platformThreadId=""}async edit(){return this}async delete(){}},bm;bm=lm;var sa=class{constructor(t,n,r){this[bm]=!0;this._signals=[];this._toolResults=[];this._pendingToolApprovalRequest=null;this._pendingReactions=[];this._pendingDeletes=[];this._resolveSignal=null;var s,u,p,d,h;this.event=t.event,this.action=(s=t.action)!=null?s:null,this.message=t.message,this.reaction=t.reaction,this.conversation=t.conversation,this.subscriber=t.subscriber,this.context=(u=t.context)!=null?u:null,this.notification=(p=t.notification)!=null?p:null,this.history=t.history,this.platform=t.platform,this.platformContext=t.platformContext,this.humanResponse=(d=t.humanResponse)!=null?d:null,this._toolApprovalConfig=r,this._transport=t.eventsUrl?new Hl(new aa({eventsUrl:t.eventsUrl,secretKey:n,conversationId:t.conversationId,agentId:t.agentId,turnId:t.deliveryId})):new Vl(t.replyUrl,n,t.conversationId,t.integrationIdentifier),this._metadataState={...(h=t.conversation.metadata)!=null?h:{}};let i=this;this.metadata={get(g){return i._metadataState[g]},set(g,y){i._metadataState[g]=y,i._signals.push({type:"metadata",action:"set",key:g,value:y})},delete(g){delete i._metadataState[g],i._signals.push({type:"metadata",action:"delete",key:g})},clear(){i._metadataState={},i._signals.push({type:"metadata",action:"clear"})},get current(){return{...i._metadataState}}};let o=g=>this._transport.setTyping(g),a=(g=>o(g===void 0?{}:{status:g}));a.stop=()=>o("stop"),this.typing=a,this.toolApproval={request:async g=>(await fm(this,g,this._toolApprovalConfig),new cr)}}asMessageContext(){return this}async reply(t,n){let r=await Tm(t,n==null?void 0:n.files),i=this._drainSideEffectsSnapshot(),o=await this._transport.sendReply(r,i);if(!o)throw new Error("Agent reply did not return a message handle");return new oi(o.messageId,o.platformThreadId,this._transport)}async replyApprovalCard(t){let n=this._drainSideEffectsSnapshot(),r=await this._transport.sendApprovalCard(t,n);if(r==="unaddressable")return new Wl;if(!r)throw new Error("Agent approval card reply did not return a message handle");return new oi(r.messageId,r.platformThreadId,this._transport)}createReplyHandle(t){return new oi(t,"",this._transport)}async emit(t){await this._transport.emitCustom(t.name,t.data)}resolve(t){this._resolveSignal={summary:t}}trigger(t,n){this._signals.push({...n,type:"trigger",workflowId:t})}ask(t,n){return this.queueHumanSignal("ask",t,n)}approve(t,n){return this.queueHumanSignal("approve",t,n)}choose(t,n,r){if(n.length<2||n.length>10)throw new Error("ctx.choose requires between 2 and 10 options");if(n.some(i=>typeof i!="string"||i.trim().length===0))throw new Error("ctx.choose options must be non-empty strings");return this.queueHumanSignal("choose",t,r,n)}tell(t,n){return this.queueHumanSignal("tell",t,n)}queueHumanSignal(t,n,r,i){let o=xm("hr"),a=(r==null?void 0:r.to)!==void 0?pm(r.to):void 0;return this._signals.push({type:"human",kind:t,prompt:n,requestId:o,...i?{options:i}:{},...r!=null&&r.from?{from:r.from}:{},...r&&"ttlSeconds"in r&&r.ttlSeconds!==void 0?{ttlSeconds:r.ttlSeconds}:{},...a!==void 0?{to:a}:{}}),o}emitToolApprovalRequest(t){if(this._pendingToolApprovalRequest)throw new Error("Only one tool approval request can be queued before the next reply");this._pendingToolApprovalRequest=t}emitToolResult(t){this._toolResults.push(t)}addReaction(t,n){this._pendingReactions.push({messageId:t,emojiName:n})}deleteMessage(t){this._pendingDeletes.push({messageId:t})}queueRunStart(){this._transport.queueRunStart()}async emitRunFinish(t){try{await this._transport.emitRunFinish(t.outcome)}catch(n){console.error("[agent] Failed to emit run finish:",n)}}async reportTurnError(t){try{await this._transport.reportTurnError(t)}catch(n){console.error("[agent] Failed to report turn error:",n)}}async flush(){if(!this._hasPendingSideEffects())return;let t=this._drainSideEffectsSnapshot();await this._transport.flushSideEffects(t)}_hasPendingSideEffects(){return!!(this._pendingToolApprovalRequest||this._signals.length||this._toolResults.length||this._resolveSignal||this._pendingReactions.length||this._pendingDeletes.length)}_drainSideEffectsSnapshot(){let t={toolApprovalRequest:this._pendingToolApprovalRequest,signals:this._signals,toolResults:this._toolResults,addReactions:this._pendingReactions,deleteMessages:this._pendingDeletes,resolve:this._resolveSignal};return this._pendingToolApprovalRequest=null,this._signals=[],this._toolResults=[],this._pendingReactions=[],this._pendingDeletes=[],this._resolveSignal=null,t}};function kx(e){return!!(typeof e=="string"||typeof e=="object"&&e!==null&&Ho(e)||typeof e=="object"&&e!==null&&("markdown"in e||"card"in e||"files"in e))}function vx(e,t){return e}function Ax(e,t){var n;for(let r of e){let i=r.toolData;if(r.type==="tool_approval_request"&&(i==null?void 0:i.approvalId)===t&&i.toolCallId)return{approvalId:i.approvalId,toolCallId:i.toolCallId,name:(n=i.toolName)!=null?n:"tool",input:i.input}}}async function km(e){var o;let t=new sa(e.bridge,e.secretKey,e.agent.handlers.toolApproval),{agent:n,event:r,logger:i}=e;try{t.queueRunStart(),await Ex(n,r,t),await t.flush(),await t.emitRunFinish({outcome:"completed"})}catch(a){let s=ri(a);i==null||i.error(`[agent:${n.id}] Turn failed (${r}): ${s.message}`,(o=s.cause)!=null?o:s);let u=!1;if(n.handlers.onError)try{let p=await n.handlers.onError(s,vx(t,r));cm(p)?u=!0:kx(p)&&(await t.reply(p),u=!0)}catch(p){i==null||i.error(`[agent:${n.id}] onError failed:`,p)}u?await t.emitRunFinish({outcome:"completed"}):await t.reportTurnError(s.message)}finally{try{await t.typing.stop(),await t.flush()}catch{}}}async function Ex(e,t,n){var i,o;let r=async a=>{a instanceof cr||a===void 0||await n.reply(a)};switch(t){case"onMessage":{await r(await e.handlers.onMessage(n.message,n));break}case"onAction":{let a=hm((i=n.action)==null?void 0:i.id);if(a&&e.handlers.onToolApproval){let{approved:s,approvalId:u}=a,p=Ax(n.history,u),d=p?{id:p.toolCallId,name:p.name,input:p.input}:{id:u,name:""},h=n.createReplyHandle((o=n.action.sourceMessageId)!=null?o:""),g={toolCall:d,approved:s,approvalMessage:h};e.userOnToolApproval===!1&&(await n.typing(),n.action.sourceMessageId&&await h.delete());let y=await e.handlers.onToolApproval(g,n);await r(y);break}e.handlers.onAction&&await r(await e.handlers.onAction(n.action,n));break}case"onReaction":e.handlers.onReaction&&await r(await e.handlers.onReaction(n.reaction,n));break;case"onResolve":e.handlers.onResolve&&await r(await e.handlers.onResolve(n));break;default:throw new Nn(t,$l)}}function vm(e){let t={};for(let i of e.split(",")){let o=i.trim();if(!o)continue;let a=o.indexOf("=");if(a<=0)continue;let s=o.slice(0,a),u=o.slice(a+1);s&&u&&!(s in t)&&(t[s]=u)}let n=t.t,r=n!==void 0?Number(n):Number.NaN;return{t:Number.isFinite(r)?r:void 0,v1:t.v1}}var la=class{constructor(t){this.handler=t.handler,this.client=t.client?t.client:new lr,this.workflows=t.workflows||[],this.agents=t.agents||[],this.http=Jo(this.client.secretKey,this.client.apiUrl),this.frameworkName=t.frameworkName,this.hmacEnabled=this.client.strictAuthentication,this.waitUntil=t.waitUntil,this.client.addAgents(this.agents)}createHandler(){return async(...t)=>{await this.client.addWorkflows(this.workflows);let n=await this.handler(...t),r=await this.handleAction({actions:n});return n.transformResponse(r)}}getStaticHeaders(){let t=`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.13.2","novu-framework-server":this.frameworkName,"user-agent":t}}createResponse(t,n){return{status:t,body:JSON.stringify(n),headers:{...this.getStaticHeaders()}}}createError(t){return{status:t.statusCode,body:JSON.stringify({message:t.message,data:t.data,code:t.code}),headers:this.getStaticHeaders()}}async handleAction({actions:t}){var h;let n=await t.url(),r=await t.method(),i=n.searchParams.get("action")||"health-check",o=n.searchParams.get("workflowId")||"",a=n.searchParams.get("stepId")||"",s=n.searchParams.get("agentId")||"",u=n.searchParams.get("event")||"",p=await t.headers("novu-signature")||"",d={};try{r==="POST"&&(d=await t.body())}catch{}try{i!=="health-check"&&await this.validateHmac(d,p);let g=this.getPostActionMap(d,o,a,i,s,u,(h=this.waitUntil)!=null?h:t.waitUntil),y=this.getGetActionMap(o,a);if(r==="POST")return await this.handlePostAction(i,g);if(r==="GET")return await this.handleGetAction(i,y);if(r==="OPTIONS")return this.createResponse(200,{})}catch(g){return this.handleError(g)}return this.createError(new Pi(r))}getPostActionMap(t,n,r,i,o,a,s){return{trigger:this.triggerAction({workflowId:n,...t}),execute:async()=>{let u=await this.client.executeWorkflow({...t,workflowId:n,stepId:r,action:i});return this.createResponse(200,u)},preview:async()=>{let u=await this.client.executeWorkflow({...t,workflowId:n,stepId:r,action:i});return this.createResponse(200,u)},"agent-event":async()=>{let u=this.client.getAgent(o);if(!u)return this.createResponse(404,{error:`Agent '${o}' not registered`});let p=km({agent:u,event:a,bridge:t,secretKey:this.client.secretKey,logger:this.client.logger});return s?s(p):this.warnOnUnprotectedServerlessRuntime(o),this.createResponse(200,{status:"ack"})}}}warnOnUnprotectedServerlessRuntime(t){let n;try{process.env.AWS_LAMBDA_FUNCTION_NAME?n="AWS Lambda":process.env.VERCEL&&(n="Vercel")}catch{}n&&this.client.logger.warn(`[agent:${t}] Agent event acknowledged without a \`waitUntil\` primitive while running on ${n}. The runtime may freeze once the response is sent, silently dropping the rest of the agent turn. Pass \`waitUntil\` to \`serve()\` (e.g. \`serve({ agents, waitUntil })\`) to extend the invocation lifetime.`)}triggerAction(t){return async()=>{let n={name:t.workflowId,to:t.to,payload:(t==null?void 0:t.payload)||{},transactionId:t.transactionId,overrides:t.overrides||{},...t.actor&&{actor:t.actor},...t.bridgeUrl&&{bridgeUrl:t.bridgeUrl},...t.controls&&{controls:t.controls},...t.context&&{context:t.context},...t.agentId!==void 0&&{agentId:t.agentId}},r=await this.http.post("/events/trigger",n);return this.createResponse(200,r)}}getGetActionMap(t,n){return{discover:async()=>{let r=await this.client.discover();return this.createResponse(200,r)},"health-check":async()=>{let r=await this.client.healthCheck();return this.createResponse(200,r)},code:async()=>{let r=await this.client.getCode(t,n);return this.createResponse(200,r)}}}async handlePostAction(t,n){if(Object.values(xr).includes(t)){let r=n[t];return r()}else throw new Nn(t,xr)}async handleGetAction(t,n){if(Object.values(wi).includes(t)){let r=n[t];return r()}else throw new Nn(t,wi)}handleError(t){if(Mn(t))return t.statusCode>=500&&this.client.logger.error(t),this.createError(t);if(Jc(t))return this.createError(t);{let n=new Kn(t);return this.client.logger.error(n),this.createError(n)}}async validateHmac(t,n){if(!this.hmacEnabled)return;if(!n)throw new Ui;if(!this.client.secretKey)throw new ji;let r=vm(n);if(!r.v1||r.t===void 0)throw new $i;let i=Date.now();if(r.t<i-3e5||r.t>i+3e5)throw new qi;let o=await Uf(this.client.secretKey,`${r.t}.${JSON.stringify(t)}`);if(!$f(o,r.v1))throw new Fi}};function Yl(e,t){if(!e)throw new Error("agent() requires a non-empty agentId");if(!(t!=null&&t.onMessage))throw new Error(`agent('${e}') requires an onMessage handler`);return{id:e,handlers:t,userOnToolApproval:typeof t.onToolApproval=="function"}}var oe={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var _x={type:"object",properties:{webhookUrl:{type:"string",format:"uri"},text:{type:"string"},blocks:{type:"array",items:{type:"object",properties:{type:{type:"string"}},required:["type"],additionalProperties:!0}}},additionalProperties:!0},Em={output:_x};var _m={"chat-webhook":oe,discord:oe,getstream:oe,"grafana-on-call":oe,line:oe,mattermost:oe,msteams:oe,"novu-slack":oe,"novu-web-chat":oe,"rocket-chat":oe,ryver:oe,sendblue:oe,slack:Em,"webex-messaging":oe,"whatsapp-business":oe,zulip:oe,telegram:oe};var Rx={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},Rm={output:Rx};var Wn={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},Ox={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},Cx={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},Ix={type:"object",properties:{from:Wn,sender:Wn,to:{type:"array",items:Wn},cc:{type:"array",items:Wn},bcc:{type:"array",items:Wn},replyTo:Wn,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:Wn,templateErrorDeliver:{type:"boolean"},attachments:{type:"array",items:Ox},inlineAttachments:{type:"array",items:Cx},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},Om={output:Ix};var Gt={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},ca={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},Px={type:"object",properties:{from:{anyOf:[{type:"string"},Gt]},sender:{anyOf:[{type:"string"},Gt]},to:{anyOf:[{type:"string"},Gt,{type:"array",items:Gt}]},cc:{anyOf:[{type:"string"},Gt,{type:"array",items:Gt}]},bcc:{anyOf:[{type:"string"},Gt,{type:"array",items:Gt}]},replyTo:{anyOf:[{type:"string"},Gt,{type:"array",items:Gt}]},inReplyTo:{anyOf:[{type:"string"},Gt]},references:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},subject:{type:"string"},text:{anyOf:[{type:"string"},ca]},html:{anyOf:[{type:"string"},ca]},watchHtml:{anyOf:[{type:"string"},ca]},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"},ca]}}}]},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},Cm={output:Px};var Mx={type:"object",properties:{},required:[],additionalProperties:!1},Im={output:Mx};var Nx={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},Pm={output:Nx};var Mm={anypost:oe,braze:oe,clickatell:oe,nodemailer:Cm,emailjs:oe,"email-webhook":oe,"infobip-email":oe,mailersend:oe,mailgun:Rm,mailjet:Om,mailtrap:oe,mandrill:oe,netcore:oe,"novu-email":Im,outlook365:oe,plunk:oe,postmark:oe,resend:oe,sendgrid:Pm,sendinblue:oe,ses:oe,sparkpost:oe};var Lx={type:"object",properties:{},required:[],additionalProperties:!1},Nm={output:Lx};var Lm={novu:Nm};var Dm={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},Dx={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:
162
+ `)}async executeProviders(t,n,r,i){return n.providers.reduce(async(a,o)=>{let s=await a,c=await this.runProvider(t,n,o,r,i);return{...s,[o.type]:c}},Promise.resolve({}))}async runProvider(t,n,r,i,a){let o=t.action==="preview";if(t.stepId!==n.stepId)return o?(this.log(` ${lt.MOCK} Mocked provider: \`${r.type}\``),this.mock(r.outputs.schema)):(this.log(` ${lt.HYDRATED} Hydrated provider: \`${r.type}\``),{});try{return await this.resolveProviderOutput(t,n,r,a,i)}catch(s){if(this.log(` ${lt.ERROR} Failed to execute provider: \`${r.type}\``),o)return this.log(` ${lt.MOCK} Mocked provider: \`${r.type}\``),this.mock(r.outputs.schema);throw new na(r.type,t.action,s)}}async resolveProviderOutput(t,n,r,i,a){let o=await r.resolve({controls:i,outputs:a}),s=await this.validate(o,r.outputs.unknownSchema,"step","output",t.workflowId,n.stepId,r.type);return this.log(` ${lt.SUCCESS} Executed provider: \`${r.type}\``),{...s,_passthrough:o._passthrough}}async executeStep(t,n){if(t.stepId===n.stepId)try{let r=await this.createStepControls(n,t),i=await this.compileControls(r,t),a=await n.resolve(i),o=await this.normalizeChatCardOutput(n,a),s=await this.validate(o,n.outputs.unknownSchema,"step","output",t.workflowId,n.stepId),c=await this.executeProviders(t,n,s,i);return this.log(` ${lt.SUCCESS} Executed stepId: \`${n.stepId}\``),{outputs:s,providers:c}}catch(r){throw this.log(` ${lt.ERROR} Failed to execute stepId: \`${n.stepId}\``),Mn(r)?r:new Ir(n.stepId,t.action,r)}else try{let r=this.getStepState(t,n.stepId);if(r){let i=await this.validate(r.outputs,n.results.unknownSchema,"step","result",t.workflowId,n.stepId);return this.log(` ${lt.HYDRATED} Hydrated stepId: \`${n.stepId}\``),{outputs:i,providers:await this.executeProviders(t,n,i,{})}}else throw new Bi(t.workflowId,n.stepId)}catch(r){throw this.log(` ${lt.ERROR} Failed to hydrate stepId: \`${n.stepId}\``),r}}async normalizeChatCardOutput(t,n){if(t.type!=="chat"||(n==null?void 0:n.card)==null)return n;let r=await lo(n.card);return r?{...n,card:r}:n}async compileControls(t,n){var r;try{let i=Ti(t),a=this.preprocessTranslationPatterns(JSON.stringify(i));a=this.preprocessFilterTranslationArgs(a);let o=this.templateEngine.parse(a),s=this.getWorkflow(n.workflowId),c={workflow:{workflowId:s.workflowId,name:s.name,description:s.description,tags:s.tags,severity:s.severity},payload:n.payload,subscriber:n.subscriber,...n.actor&&{actor:n.actor},context:n.context,steps:zx(n.state),env:(r=n.env)!=null?r:{}},p=await this.templateEngine.render(o,c),d=this.postprocessTranslationMarkers(p),h=(0,$m.jsonrepair)(d),y=JSON.parse(h),g=xi(y);return Lm(g)}catch(i){throw new Ji(n.workflowId,n.stepId,i)}}preprocessTranslationPatterns(t){return t.replace(/\{\{\s*t\.([\p{L}\p{N}_.-]+)\s*\}\}/gu,"[T:$1]")}preprocessFilterTranslationArgs(t){return t.replace(/'t\.([\p{L}\p{N}_.-]+)'/gu,"'[T:$1]'")}postprocessTranslationMarkers(t){return t.replace(/\[T:([\p{L}\p{N}_.-]+)\]/gu,"{{t.$1}}")}async createStepControls(t,n){return await this.validate(n.controls,t.controls.unknownSchema,"step","controls",n.workflowId,t.stepId)}async previewStep(t,n){try{return await this.constructStepForPreview(t,n)}catch(r){throw this.log(` ${lt.ERROR} Failed to preview stepId: \`${n.stepId}\``),Mn(r)?r:new Ir(n.stepId,t.action,r)}}async constructStepForPreview(t,n){return t.stepId===n.stepId?await this.previewRequiredStep(n,t):await this.extractMockDataForPreviousSteps(t,n)}async extractMockDataForPreviousSteps(t,n){let r={},i=this.getStepState(t,n.stepId),a=this.mock(n.results.schema);return{outputs:pc(a,(i==null?void 0:i.outputs)||{}),providers:await this.executeProviders(t,n,r,{})}}async previewRequiredStep(t,n){let r=await this.createStepControls(t,n),i=await this.compileControls(r,n),a=await t.resolve(i),o=await this.normalizeChatCardOutput(t,a),s=await this.validate(o,t.outputs.unknownSchema,"step","output",n.workflowId,t.stepId);return this.log(` ${lt.MOCK} Mocked stepId: \`${t.stepId}\``),{outputs:s,providers:await this.executeProviders(n,t,s,i)}}getStepState(t,n){return t.state.find(r=>r.stepId===n)}getStepCode(t,n){return{code:this.getStep(t,n).resolve.toString()}}getWorkflowCode(t){return{code:this.getWorkflow(t).execute.toString()}}getCode(t,n){let r;if(t)n?r=this.getStepCode(t,n):r=this.getWorkflowCode(t);else throw new Pr(t);return r}};function zx(e){let t={};for(let n of e)t[n.stepId]=n.outputs;return t}var qm=Symbol.for("novu.agent.runtimeContext");var hc=(o=>(o.ON_MESSAGE="onMessage",o.ON_MESSAGE_UPDATED="onMessageUpdated",o.ON_MESSAGE_DELETED="onMessageDeleted",o.ON_ACTION="onAction",o.ON_RESOLVE="onResolve",o.ON_REACTION="onReaction",o))(hc||{});function fc(e){return typeof e=="object"&&e!==null&&"content"in e&&!("type"in e)}var hr=class{constructor(){this.__novuPendingApproval=!0}};function jm(e){return typeof e=="object"&&e!==null&&"suppress"in e&&e.suppress===!0}var Vx=5*1024*1024,Wx=5*1024*1024,Bm=32768,Yx=/^[A-Za-z0-9+/]*={0,2}$/;function ki(e,t){return e.filename?`"${e.filename}"`:`at index ${t}`}function zm(){return globalThis.Buffer}function Jx(e){var t,n,r;return(r=(n=(t=zm())==null?void 0:t.isBuffer)==null?void 0:n.call(t,e))!=null?r:!1}function Gx(e){return typeof Blob!="undefined"&&e instanceof Blob}function mc(e){let t=zm();if(t)return t.from(e).toString("base64");if(typeof btoa!="function")throw new Error("Unable to encode file data: base64 encoding is not available in this runtime.");let n="";for(let r=0;r<e.length;r+=Bm){let i=e.subarray(r,r+Bm);n+=String.fromCharCode(...i)}return btoa(n)}function Vm(e){let t=e.replace(/\s/g,""),n=t.length%4;if(!t||n===1||!Yx.test(t))return null;let r=t.endsWith("==")?2:t.endsWith("=")?1:0;return Math.floor(t.length*3/4)-r}function vi(e,t,n){if(e>Vx)throw new Error(`Invalid file ${ki(t,n)}: inline data must be 5 MB or smaller. Use a publicly-accessible URL for larger files.`)}async function Kx(e,t,n){if(typeof e=="string"){let r=Vm(e);if(r===null)throw new Error(`Invalid file ${ki(t,n)}: data must be a base64-encoded string.`);return vi(r,t,n),e}if(Jx(e))return vi(e.byteLength,t,n),e.toString("base64");if(e instanceof Uint8Array)return vi(e.byteLength,t,n),mc(e);if(e instanceof ArrayBuffer)return vi(e.byteLength,t,n),mc(new Uint8Array(e));if(Gx(e))return vi(e.size,t,n),mc(new Uint8Array(await e.arrayBuffer()));throw new Error(`Invalid file ${ki(t,n)}: data must be a base64 string, Buffer, Uint8Array, ArrayBuffer, or Blob.`)}async function Xx(e){if(!(e!=null&&e.length))return;let t=[],n=0;for(let[r,i]of e.entries()){let a=i.data,o=i.url,s=a!=null,c=o!=null;if(s===c)throw new Error(`Invalid file ${ki(i,r)}: provide exactly one of data or url.`);if(s){let p=await Kx(a,i,r),d=Vm(p);if(n+=d!=null?d:0,n>Wx)throw new Error("Invalid files: total inline data must be 5 MB or smaller. Use publicly-accessible URLs for larger files.");t.push({...i,data:p});continue}if(c&&typeof o!="string")throw new Error(`Invalid file ${ki(i,r)}: url must be a string.`);t.push(i)}return t}async function To(e,t){let n=await Xx(t);if(typeof e=="string")return n?{markdown:e,files:n}:{markdown:e};let r=await lo(e);if(r)return n?{card:r,files:n}:{card:r};throw new Error("Invalid message content \u2014 expected string or CardElement")}var Wm=1;var Qx={400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",408:"Request Timeout",409:"Conflict",422:"Unprocessable Entity",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"};function xo(e){return typeof e=="string"&&e.trim()?e:!e||typeof e!="object"?null:xo(e.message)}function Zx(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t,r=xo(n.message);if(r)return r;let i=xo(n.error);if(i)return i;let a=n.errors;return Array.isArray(a)?xo(a[0]):null}function eA(e,t){var i;let n=(i=Qx[e])!=null?i:e,r=Zx(t);return r?`Delivery failed: ${n}: ${r}`:`Delivery failed: ${n}`}var bn=class extends Error{constructor(t,n){super(t),this.name="AgentError",this.cause=n==null?void 0:n.cause,this.delivery=n==null?void 0:n.delivery}},an=class extends bn{constructor(t,n){let r={statusCode:t,responseBody:n};super(eA(t,n),{delivery:r}),this.name="AgentDeliveryError",this.statusCode=t,this.responseBody=n}};function Ei(e){return e instanceof bn?e:e instanceof Error?new bn(e.message,{cause:e}):new bn("Turn failed",{cause:e})}function tA(e){return new Promise(t=>{setTimeout(t,e)})}function nA(e){return e>=500||e===408||e===429}var Ao=class{constructor(t){this.sequence=0;this.buffer=[];this.chain=Promise.resolve();var n,r;this.runId=`run_${crypto.randomUUID()}`,this.eventsUrl=t.eventsUrl,this.secretKey=t.secretKey,this.conversationId=t.conversationId,this.agentId=t.agentId,this.turnId=t.turnId,this.fetchFn=(n=t.fetchFn)!=null?n:fetch,this.maxRetries=(r=t.maxRetries)!=null?r:3}enqueue(t){this.sequence+=1,this.buffer.push({version:Wm,conversationId:this.conversationId,agentId:this.agentId,runId:this.runId,turnId:this.turnId,sequence:this.sequence,timestamp:new Date().toISOString(),event:t})}flush(){if(this.buffer.length===0)return this.chain;let t=this.buffer;return this.buffer=[],this.chain=this.chain.then(()=>this.postBatchWithRetry(t)),this.chain}async emit(t){this.enqueue(t),await this.flush()}async postBatchWithRetry(t){let n;for(let r=1;r<=this.maxRetries;r+=1)try{await this.postBatch(t);return}catch(i){if(n=i,!rA(i))throw i;r<this.maxRetries&&await tA(250*r)}throw n}async postBatch(t){let n;try{n=await this.fetchFn(this.eventsUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${this.secretKey}`},body:JSON.stringify({events:t})})}catch(i){throw iA(i)}let r=await n.text().catch(()=>"");if(!n.ok)throw new an(n.status,r)}};function rA(e){return!(e instanceof an)||e.statusCode===0?!0:nA(e.statusCode)}function iA(e){if(e instanceof an)return e;let t=e instanceof Error?e.message:"Network request failed";return new an(0,t)}var gc="human:";function vo(e){return`${gc}${e}:approve`}function ko(e){return`${gc}${e}:deny`}function fr(e,t){return`${gc}${e}:opt:${t}`}function Ym(e){return typeof e=="string"?e:e.label}function aA(e){return typeof e=="string"?void 0:e.id}function oA(e){return typeof e=="string"?e:e.id}function Ro(e,t){let n=t==null?void 0:t.trim();if(!n)throw new Error(`ctx.${e} requires a title (string argument or card.title)`);return n}function sA(e){if(!("title"in e))return;let t=e.title;return typeof t=="string"&&t.trim()?t.trim():void 0}function Co(e){if(!e||e.length<2||e.length>10)throw new Error("ctx.choose requires between 2 and 10 options");if(e.some(t=>Ym(t).trim().length===0))throw new Error("ctx.choose options must be non-empty strings")}function _o(e){if(e.length>4)throw new Error("ctx.approve card.extraActions supports at most 4 buttons");for(let t of e){let n=aA(t);if(!Ym(t).trim())throw new Error("ctx.approve extraActions labels must be non-empty");if(n==="approve"||n==="deny")throw new Error("ctx.approve extraActions ids cannot be approve or deny")}}function lA(e){if(typeof e=="string")throw new Error("human render must return chrome (*Card()), a Card, or a chat element \u2014 not a markdown string")}function Eo(e,t=[]){if(Array.isArray(e)){for(let r of e)Eo(r,t);return t}if(!e||typeof e!="object")return t;let n=e;n.type==="button"&&typeof n.id=="string"&&n.id.trim()&&t.push({id:n.id,label:typeof n.label=="string"?n.label:""});for(let r of Object.values(n))r&&typeof r=="object"&&Eo(r,t);return t}function cA(e){return new Set(Eo(e).map(t=>t.id))}function uA(e,t){let n=fr(t,"");return e.startsWith(n)&&e.length>n.length?e.slice(n.length):e}function pA(e,t){let n=Eo(e),r=new Set(n.map(s=>s.id)),i=vo(t),a=ko(t);if(!r.has(i))throw new Error("ctx.approve render must include a button with actionIds.approve");if(!r.has(a))throw new Error("ctx.approve render must include a button with actionIds.deny");let o=n.filter(s=>s.id!==i&&s.id!==a).map(s=>({id:uA(s.id,t),label:s.label}));o.length&&_o(o)}function dA(e,t,n){if(n){Co(n);for(let i of n){let a=oA(i);if(!e.has(fr(t,a)))throw new Error(`ctx.choose render must include a button with actionIds.option('${a}')`)}return}let r=hA(e,t);if(r.length<2||r.length>10)throw new Error("ctx.choose render must include between 2 and 10 option action buttons")}function hA(e,t){let n=fr(t,"");return[...e].filter(r=>r.startsWith(n)&&r.length>n.length).map(r=>r.slice(n.length))}function Jm(e,t,n){var r;switch(Ro(e,t.title),e){case"ask":case"tell":return;case"approve":t.type==="human-approve-card"&&t.extraActions&&_o(t.extraActions);return;case"choose":Co(t.type==="human-choose-card"&&(r=t.options)!=null?r:n);return;default:return}}function Gm(e,t,n,r){switch(lA(t),Ro(e,sA(t)),e){case"ask":case"tell":return;case"approve":pA(t,n);return;case"choose":dA(cA(t),n,r);return;default:return}}function Oo(e){let t=typeof e=="string"?[e]:e,n=[],r=new Set;for(let i of t){if(typeof i!="string")throw new Error("`to` must be a subscriberId string or an array of subscriberIds");let a=i.trim();!a||r.has(a)||(r.add(a),n.push(a))}if(n.length===0)throw new Error("`to` must include at least one subscriberId");if(n.length>50)throw new Error("`to` supports at most 50 subscriberIds");return n}var Km="tool-approval";function fA(e){return e==="approve"||e==="deny"}function yc(e,t){return`${Km}:${e}:${t}`}function Xm(e){let[t,n,...r]=(e!=null?e:"").split(":"),i=r.join(":");return t!==Km||!fA(n)||!i?null:{approved:n==="approve",approvalId:i}}async function Qm(e,t,n,r,i){var d,h;let a=r!=null?r:t.id,o={approve:yc("approve",a),deny:yc("deny",a)},s=y=>({type:"tool-approval-card",...y}),c=(h=(d=n==null?void 0:n.renderApproval)==null?void 0:d.call(n,{toolCall:t,actionIds:o,approvalCard:s}))!=null?h:s(),p={approvalId:a,toolCallId:t.id,name:t.name,input:t.input,...(i==null?void 0:i.to)!==void 0?{to:i.to}:{},...i!=null&&i.from?{from:i.from}:{},...(i==null?void 0:i.ttlSeconds)!==void 0?{ttlSeconds:i.ttlSeconds}:{}};if(e.emitToolApprovalRequest(p),hm(c)){await e.replyApprovalCard(c);return}await e.reply(c)}function Io(e){return t=>({type:e,...t})}function Po(e,t){switch(e){case"ask":return{requestId:t,askCard:Io("human-ask-card")};case"approve":return{requestId:t,actionIds:{approve:vo(t),deny:ko(t)},approveCard:Io("human-approve-card")};case"choose":return{requestId:t,actionIds:{option:n=>fr(t,n)},chooseCard:Io("human-choose-card")};case"tell":return{requestId:t,tellCard:Io("human-tell-card")};default:return e}}function Sc(e){return`${e}_${crypto.randomUUID()}`}function mA(e){let{type:t,...n}=e;return n}function gA(e){if(!(!e||!("card"in e)))return e.card}function Mo(e){if(!(!e||!("render"in e)))return e.render}function yA(e){return typeof e=="object"&&e!==null&&pr(e)?e:{type:"card",children:[e]}}function bc(e){if(!(!e||!("ttlSeconds"in e)||typeof e.ttlSeconds!="number"))return e.ttlSeconds}function Zm(e){if(e.markdown!==void 0)return{markdown:e.markdown};if(e.card!==void 0)return{card:e.card};throw new Error("Invalid reply content \u2014 expected markdown or card")}function bA(e){let t="platformMessageId"in e?e.platformMessageId.trim():e.messageId.trim();if(!t)throw new Error("quoteReply requires a non-empty platform message id");return{messageId:t}}function eg(e){if(e!=null&&e.length)return e.map((t,n)=>({fileId:t.filename||`file_${n}`,name:t.filename,mediaType:t.mimeType,...t.data!==void 0?{data:typeof t.data=="string"?t.data:void 0}:{},...t.url!==void 0?{url:t.url}:{}}))}function wc(e,t){var r;let n=[];if(e.toolApprovalRequest){let i=e.toolApprovalRequest;n.push({type:"tool-approval-request",approvalId:i.approvalId,toolUseId:i.toolCallId,toolName:i.name,input:i.input,...i.ttlSeconds!==void 0?{ttlSeconds:i.ttlSeconds}:{},...i.to!==void 0?{to:i.to}:{},...i.from!==void 0?{from:i.from}:{},...t!=null&&t.deliverApprovalCard?{deliverCard:!0}:{}})}for(let i of e.toolResults)n.push({type:"tool-use-result",toolUseId:i.toolCallId,content:[{type:"text",text:String((r=i.preview)!=null?r:"")},{type:"json",value:i.output}]});for(let i of e.signals)n.push({type:"signal",signal:i});for(let i of e.addReactions)n.push({type:"channel.reaction",messageId:i.messageId,emoji:i.emojiName,op:"add"});for(let i of e.deleteMessages)n.push({type:"channel.delete",messageId:i.messageId});return e.resolve&&n.push({type:"resolve",summary:e.resolve.summary}),n}var Tc=class{constructor(t){this.outbox=t}async sendReply(t,n,r){let i=Sc("msg"),a=wc(n);return a.push({type:"message",role:"assistant",messageId:i,content:Zm(t),files:eg(t.files),...r?{quoteReply:r}:{}}),await this._emitAndFlush(a),{messageId:i,platformThreadId:""}}async sendApprovalCard(t,n){return await this._emitAndFlush(wc(n,{deliverApprovalCard:!0})),"unaddressable"}async editMessage(t,n){return await this.outbox.emit({type:"channel.edit",messageId:t,content:Zm(n),files:eg(n.files)}),{messageId:t,platformThreadId:""}}async deleteMessage(t){await this.outbox.emit({type:"channel.delete",messageId:t})}async setTyping(t){if(t==="stop"){await this.outbox.emit({type:"channel.typing",state:"off"});return}let n=typeof t=="object"&&"status"in t?t.status:void 0;await this.outbox.emit({type:"channel.typing",state:"on",status:n})}async flushSideEffects(t){await this._emitAndFlush(wc(t))}async emitCustom(t,n){await this.outbox.emit({type:"custom",name:t,data:n})}queueRunStart(){this.outbox.enqueue({type:"run-start"})}async emitRunFinish(t){await this.outbox.emit({type:"run-finish",outcome:t})}async reportTurnError(t){await this.outbox.emit({type:"run-error",message:t!=null?t:"agent handler failed"})}async _emitAndFlush(t){if(t.length!==0){for(let n of t)this.outbox.enqueue(n);await this.outbox.flush()}}},No=class{constructor(t,n,r){this.transport=r;this.editedByHandler=!1;this.messageId=t,this.platformThreadId=n}async edit(t,n){this.editedByHandler=!0;let r=await To(t,n==null?void 0:n.files),i=await this.transport.editMessage(this.messageId,r);if(!i)throw new Error("Agent edit did not return a message handle");return this.messageId=i.messageId,this.platformThreadId=i.platformThreadId,this}async delete(){await this.transport.deleteMessage(this.messageId)}},xc=class{constructor(){this.messageId="";this.platformThreadId=""}async edit(){return this}async delete(){}},tg;tg=qm;var Lo=class{constructor(t,n,r){this[tg]=!0;this._signals=[];this._toolResults=[];this._pendingToolApprovalRequest=null;this._pendingReactions=[];this._pendingDeletes=[];this._resolveSignal=null;this._pendingHumanRenders=[];var c,p,d,h,y,g;this.event=t.event,this.action=(c=t.action)!=null?c:null,this.message=t.message,this.previousMessage=(p=t.previousMessage)!=null?p:null,this.reaction=t.reaction,this.conversation=t.conversation,this.subscriber=t.subscriber,this.context=(d=t.context)!=null?d:null,this.notification=(h=t.notification)!=null?h:null,this.history=t.history,this.platform=t.platform,this.platformContext=t.platformContext,this.humanResponse=(y=t.humanResponse)!=null?y:null,this._toolApprovalConfig=r;let i=t.eventsUrl;if(!i)throw new Error("AgentBridgeRequest.eventsUrl is required");this._transport=new Tc(new Ao({eventsUrl:i,secretKey:n,conversationId:t.conversationId,agentId:t.agentId,turnId:t.deliveryId})),this._metadataState={...(g=t.conversation.metadata)!=null?g:{}};let a=this;this.metadata={get(I){return a._metadataState[I]},set(I,K){a._metadataState[I]=K,a._signals.push({type:"metadata",action:"set",key:I,value:K})},delete(I){delete a._metadataState[I],a._signals.push({type:"metadata",action:"delete",key:I})},clear(){a._metadataState={},a._signals.push({type:"metadata",action:"clear"})},get current(){return{...a._metadataState}}};let o=I=>this._transport.setTyping(I),s=(I=>o(I===void 0?{}:{status:I}));s.stop=()=>o("stop"),this.typing=s,this.toolApproval={request:async(I,K)=>(await Qm(this,I,this._toolApprovalConfig,void 0,K),new hr)}}asMessageContext(){return this}async reply(t,n){await this.materializePendingHumanRenders();let r=await To(t,n==null?void 0:n.files),i=this._drainSideEffectsSnapshot(),a=n!=null&&n.quoteReply?bA(n.quoteReply):void 0,o=await this._transport.sendReply(r,i,a);if(!o)throw new Error("Agent reply did not return a message handle");return new No(o.messageId,o.platformThreadId,this._transport)}async replyApprovalCard(t){await this.materializePendingHumanRenders();let n=this._drainSideEffectsSnapshot();return await this._transport.sendApprovalCard(t,n),new xc}createReplyHandle(t){return new No(t,"",this._transport)}async emit(t){await this._transport.emitCustom(t.name,t.data)}resolve(t){this._resolveSignal={summary:t}}trigger(t,n){this._signals.push({...n,type:"trigger",workflowId:t})}ask(t,n){let i=typeof t!="string"?t:n,a=Mo(i);return a?this.queueRendered("ask",i,a):this.queueHumanSignal("ask",t,n)}approve(t,n){let i=typeof t!="string"?t:n,a=Mo(i);return a?this.queueRendered("approve",i,a):this.queueHumanSignal("approve",t,n)}choose(t,n,r){var c;let i=typeof t!="string",a,o;i?a=t:Array.isArray(n)?(a=r,o=n):a=n;let s=Mo(a);return s?this.queueRendered("choose",a,s):i?this.queueHumanSignal("choose",t,void 0,"card"in t?(c=t.card)==null?void 0:c.options:void 0):this.queueHumanSignal("choose",t,a,o)}tell(t,n){let r=typeof t!="string",i=r?t:n,a=Mo(i);if(a)return this.queueRendered("tell",i,a);if(r)throw new Error("ctx.tell requires a title (string argument) when render is omitted");return this.queueHumanSignal("tell",t,n)}queueHumanSignal(t,n,r,i){let a=typeof n!="string",o=a?void 0:n,s=a?n:r,c=gA(s),p=Ro(t,(o==null?void 0:o.trim())||(c==null?void 0:c.title));if(t==="choose"){let I=i!=null?i:c==null?void 0:c.options;Co(I)}t==="approve"&&(c!=null&&c.extraActions)&&_o(c.extraActions);let d=Sc("hr"),h=(s==null?void 0:s.to)!==void 0?Oo(s.to):void 0,y={...c,title:p,...t==="choose"&&i?{options:i}:{}},g=bc(s);return this._signals.push({type:"human",kind:t,requestId:d,card:y,...s!=null&&s.from?{from:s.from}:{},...g!==void 0?{ttlSeconds:g}:{},...h!==void 0?{to:h}:{}}),d}queueRendered(t,n,r){let i=Sc("hr");return this._pendingHumanRenders.push(async()=>{let a=await this.invokeHumanRender(t,i,r);if(fm(a)){this.pushRenderedChrome(t,i,a,n);return}await this.pushRenderedContent(t,i,a,n)}),i}invokeHumanRender(t,n,r){switch(t){case"ask":return Promise.resolve(r(Po("ask",n)));case"approve":return Promise.resolve(r(Po("approve",n)));case"choose":return Promise.resolve(r(Po("choose",n)));case"tell":return Promise.resolve(r(Po("tell",n)));default:{let i=t;return Promise.resolve(i)}}}pushRenderedChrome(t,n,r,i){Jm(t,r);let a=mA(r),o=bc(i),s=(i==null?void 0:i.to)!==void 0?Oo(i.to):void 0,c=t==="approve"||t==="choose";this._signals.push({type:"human",kind:t,requestId:n,...c?{actionIdentifier:n}:{},card:a,...i!=null&&i.from?{from:i.from}:{},...o!==void 0?{ttlSeconds:o}:{},...s!==void 0?{to:s}:{}})}async pushRenderedContent(t,n,r,i){Gm(t,r,n);let a=await To(yA(r));if(!a.card)throw new Error("human render must return chrome (*Card()), a Card, or a chat element \u2014 not a markdown string");let o=bc(i),s=(i==null?void 0:i.to)!==void 0?Oo(i.to):void 0,c=t==="approve"||t==="choose";this._signals.push({type:"human",kind:t,requestId:n,...c?{actionIdentifier:n}:{},card:a.card,...i!=null&&i.from?{from:i.from}:{},...o!==void 0?{ttlSeconds:o}:{},...s!==void 0?{to:s}:{}})}emitToolApprovalRequest(t){if(this._pendingToolApprovalRequest)throw new Error("Only one tool approval request can be queued before the next reply");this._pendingToolApprovalRequest=t}emitToolResult(t){this._toolResults.push(t)}addReaction(t,n){this._pendingReactions.push({messageId:t,emojiName:n})}deleteMessage(t){this._pendingDeletes.push({messageId:t})}queueRunStart(){this._transport.queueRunStart()}async emitRunFinish(t){try{await this._transport.emitRunFinish(t.outcome)}catch(n){console.error("[agent] Failed to emit run finish:",n)}}async reportTurnError(t){try{await this._transport.reportTurnError(t)}catch(n){console.error("[agent] Failed to report turn error:",n)}}async flush(){if(await this.materializePendingHumanRenders(),!this._hasPendingSideEffects())return;let t=this._drainSideEffectsSnapshot();await this._transport.flushSideEffects(t)}async materializePendingHumanRenders(){let t=this._pendingHumanRenders.splice(0);for(let n of t)await n()}_hasPendingSideEffects(){return!!(this._pendingToolApprovalRequest||this._signals.length||this._toolResults.length||this._resolveSignal||this._pendingReactions.length||this._pendingDeletes.length)}_drainSideEffectsSnapshot(){let t={toolApprovalRequest:this._pendingToolApprovalRequest,signals:this._signals,toolResults:this._toolResults,addReactions:this._pendingReactions,deleteMessages:this._pendingDeletes,resolve:this._resolveSignal};return this._pendingToolApprovalRequest=null,this._signals=[],this._toolResults=[],this._pendingReactions=[],this._pendingDeletes=[],this._resolveSignal=null,t}};function wA(e){return!!(typeof e=="string"||typeof e=="object"&&e!==null&&pr(e)||typeof e=="object"&&e!==null&&("markdown"in e||"card"in e||"files"in e))}function SA(e,t){return e}var ng="tool_approval:";function TA(e){if(!(e!=null&&e.startsWith(ng)))return null;let t=e.slice(ng.length);return t.length>0?t:null}async function rg(e,t){await e.reply(t.content,{files:t.files,quoteReply:t.quoteReply})}async function Wn(e,t){if(!(t instanceof hr||t===void 0)){if(fc(t)){await rg(e,t);return}await e.reply(t)}}async function xA(e,t){return jm(t)?!0:fc(t)?(await rg(e,t),!0):wA(t)?(await e.reply(t),!0):!1}function AA(e,t){var n;for(let r of e){let i=r.toolData;if(r.type==="tool_approval_request"&&(i==null?void 0:i.approvalId)===t&&i.toolCallId)return{approvalId:i.approvalId,toolCallId:i.toolCallId,name:(n=i.toolName)!=null?n:"tool",input:i.input}}}async function ig(e){var a;let t=new Lo(e.bridge,e.secretKey,e.agent.handlers.toolApproval),{agent:n,event:r,logger:i}=e;try{t.queueRunStart(),await kA(n,r,t),await t.flush(),await t.emitRunFinish({outcome:"completed"})}catch(o){let s=Ei(o);i==null||i.error(`[agent:${n.id}] Turn failed (${r}): ${s.message}`,(a=s.cause)!=null?a:s);let c=!1;if(n.handlers.onError)try{let p=await n.handlers.onError(s,SA(t,r));c=await xA(t,p)}catch(p){i==null||i.error(`[agent:${n.id}] onError failed:`,p)}c?await t.emitRunFinish({outcome:"completed"}):await t.reportTurnError(s.message)}finally{try{await t.typing.stop(),await t.flush()}catch{}}}async function vA(e,t){var s,c,p,d,h,y;let n=TA((s=t.humanResponse)==null?void 0:s.requestId),r=Xm((c=t.action)==null?void 0:c.id),i=n!=null?n:r==null?void 0:r.approvalId,a=n?((p=t.humanResponse)==null?void 0:p.status)==="approved"&&!t.humanResponse.expired:r==null?void 0:r.approved;if(i&&a!==void 0&&e.handlers.onToolApproval){let g=AA(t.history,i),I=g?{id:g.toolCallId,name:g.name,input:g.input}:{id:i,name:""},K=t.createReplyHandle((h=(d=t.action)==null?void 0:d.sourceMessageId)!=null?h:""),Z={toolCall:I,approved:a,approvalMessage:K};e.userOnToolApproval===!1&&(await t.typing(),(y=t.action)!=null&&y.sourceMessageId&&await K.delete());let H=await e.handlers.onToolApproval(Z,t);await Wn(t,H);return}let o=t.action;o&&e.handlers.onAction&&await Wn(t,await e.handlers.onAction(o,t))}async function kA(e,t,n){switch(t){case"onMessage":{let r=n.message;r&&await Wn(n,await e.handlers.onMessage(r,n));break}case"onMessageUpdated":{let r=n.message;r&&e.handlers.onMessageUpdated&&await Wn(n,await e.handlers.onMessageUpdated(r,n));break}case"onMessageDeleted":{let r=n.message;r&&e.handlers.onMessageDeleted&&await Wn(n,await e.handlers.onMessageDeleted(r,n));break}case"onAction":{await vA(e,n);break}case"onReaction":{let r=n.reaction;r&&e.handlers.onReaction&&await Wn(n,await e.handlers.onReaction(r,n));break}case"onResolve":e.handlers.onResolve&&await Wn(n,await e.handlers.onResolve(n));break;default:throw new Nn(t,hc)}}function ag(e){let t={};for(let i of e.split(",")){let a=i.trim();if(!a)continue;let o=a.indexOf("=");if(o<=0)continue;let s=a.slice(0,o),c=a.slice(o+1);s&&c&&!(s in t)&&(t[s]=c)}let n=t.t,r=n!==void 0?Number(n):Number.NaN;return{t:Number.isFinite(r)?r:void 0,v1:t.v1}}var Do=class{constructor(t){this.handler=t.handler,this.client=t.client?t.client:new dr,this.workflows=t.workflows||[],this.agents=t.agents||[],this.http=co(this.client.secretKey,this.client.apiUrl),this.frameworkName=t.frameworkName,this.hmacEnabled=this.client.strictAuthentication,this.waitUntil=t.waitUntil,this.client.addAgents(this.agents)}createHandler(){return async(...t)=>{await this.client.addWorkflows(this.workflows);let n=await this.handler(...t),r=await this.handleAction({actions:n});return n.transformResponse(r)}}getStaticHeaders(){let t=`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.14.0-rc.5ea799b171","novu-framework-server":this.frameworkName,"user-agent":t}}createResponse(t,n){return{status:t,body:JSON.stringify(n),headers:{...this.getStaticHeaders()}}}createError(t){return{status:t.statusCode,body:JSON.stringify({message:t.message,data:t.data,code:t.code}),headers:this.getStaticHeaders()}}async handleAction({actions:t}){var h;let n=await t.url(),r=await t.method(),i=n.searchParams.get("action")||"health-check",a=n.searchParams.get("workflowId")||"",o=n.searchParams.get("stepId")||"",s=n.searchParams.get("agentId")||"",c=n.searchParams.get("event")||"",p=await t.headers("novu-signature")||"",d={};try{r==="POST"&&(d=await t.body())}catch{}try{i!=="health-check"&&await this.validateHmac(d,p);let y=this.getPostActionMap(d,a,o,i,s,c,(h=this.waitUntil)!=null?h:t.waitUntil),g=this.getGetActionMap(a,o);if(r==="POST")return await this.handlePostAction(i,y);if(r==="GET")return await this.handleGetAction(i,g);if(r==="OPTIONS")return this.createResponse(200,{})}catch(y){return this.handleError(y)}return this.createError(new Qi(r))}getPostActionMap(t,n,r,i,a,o,s){return{trigger:this.triggerAction({workflowId:n,...t}),execute:async()=>{let c=await this.client.executeWorkflow({...t,workflowId:n,stepId:r,action:i});return this.createResponse(200,c)},preview:async()=>{let c=await this.client.executeWorkflow({...t,workflowId:n,stepId:r,action:i});return this.createResponse(200,c)},"agent-event":async()=>{let c=this.client.getAgent(a);if(!c)return this.createResponse(404,{error:`Agent '${a}' not registered`});let p=ig({agent:c,event:o,bridge:t,secretKey:this.client.secretKey,logger:this.client.logger});return s?s(p):this.warnOnUnprotectedServerlessRuntime(a),this.createResponse(200,{status:"ack"})}}}warnOnUnprotectedServerlessRuntime(t){let n;try{process.env.AWS_LAMBDA_FUNCTION_NAME?n="AWS Lambda":process.env.VERCEL&&(n="Vercel")}catch{}n&&this.client.logger.warn(`[agent:${t}] Agent event acknowledged without a \`waitUntil\` primitive while running on ${n}. The runtime may freeze once the response is sent, silently dropping the rest of the agent turn. Pass \`waitUntil\` to \`serve()\` (e.g. \`serve({ agents, waitUntil })\`) to extend the invocation lifetime.`)}triggerAction(t){return async()=>{let n={name:t.workflowId,to:t.to,payload:(t==null?void 0:t.payload)||{},transactionId:t.transactionId,overrides:t.overrides||{},...t.actor&&{actor:t.actor},...t.bridgeUrl&&{bridgeUrl:t.bridgeUrl},...t.controls&&{controls:t.controls},...t.context&&{context:t.context},...t.agentId!==void 0&&{agentId:t.agentId}},r=await this.http.post("/events/trigger",n);return this.createResponse(200,r)}}getGetActionMap(t,n){return{discover:async()=>{let r=await this.client.discover();return this.createResponse(200,r)},"health-check":async()=>{let r=await this.client.healthCheck();return this.createResponse(200,r)},code:async()=>{let r=await this.client.getCode(t,n);return this.createResponse(200,r)}}}async handlePostAction(t,n){if(Object.values(Rr).includes(t)){let r=n[t];return r()}else throw new Nn(t,Rr)}async handleGetAction(t,n){if(Object.values(Hi).includes(t)){let r=n[t];return r()}else throw new Nn(t,Hi)}handleError(t){if(Mn(t))return t.statusCode>=500&&this.client.logger.error(t),this.createError(t);if(vu(t))return this.createError(t);{let n=new Xn(t);return this.client.logger.error(n),this.createError(n)}}async validateHmac(t,n){if(!this.hmacEnabled)return;if(!n)throw new ia;if(!this.client.secretKey)throw new sa;let r=ag(n);if(!r.v1||r.t===void 0)throw new aa;let i=Date.now();if(r.t<i-3e5||r.t>i+3e5)throw new oa;let a=await ym(this.client.secretKey,`${r.t}.${JSON.stringify(t)}`);if(!bm(a,r.v1))throw new ra}};function Ac(e,t){if(!e)throw new Error("agent() requires a non-empty agentId");if(!(t!=null&&t.onMessage))throw new Error(`agent('${e}') requires an onMessage handler`);return{id:e,handlers:t,userOnToolApproval:typeof t.onToolApproval=="function"}}var ae={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var EA={type:"object",properties:{text:{type:"string",description:"Overrides the step body text."},effect:{type:"string",description:"iMessage expressive effect: a friendly name (confetti, fireworks, balloons, heart, lasers, celebration, sparkles, spotlight, echo, slam, loud, gentle, invisible) or a raw com.apple.\u2026 effect id."},attachments:{type:"array",items:{type:"string",format:"uri"},description:"Attachment URLs sent alongside the message."},voice:{type:"string",format:"uri",description:"Audio URL sent as a native iMessage voice note (waveform bubble)."},replyToLast:{type:"boolean",description:"Reply-thread this send to the previous message sent to this recipient."},format:{type:"string",enum:["markdown","text"],description:"Force native styled text (markdown) or plain text for the body."}},additionalProperties:!0},sg={output:EA};var RA={type:"object",properties:{webhookUrl:{type:"string",format:"uri"},text:{type:"string"},blocks:{type:"array",items:{type:"object",properties:{type:{type:"string"}},required:["type"],additionalProperties:!0}}},additionalProperties:!0},lg={output:RA};var cg={"chat-webhook":ae,discord:ae,"google-chat":ae,getstream:ae,"grafana-on-call":ae,line:ae,mattermost:ae,msteams:ae,"novu-slack":ae,"novu-web-chat":ae,"photon-imessage":sg,"rocket-chat":ae,ryver:ae,sendblue:ae,slack:lg,"webex-messaging":ae,"whatsapp-business":ae,zulip:ae,telegram:ae};var CA={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},ug={output:CA};var Yn={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},_A={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},OA={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},IA={type:"object",properties:{from:Yn,sender:Yn,to:{type:"array",items:Yn},cc:{type:"array",items:Yn},bcc:{type:"array",items:Yn},replyTo:Yn,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:Yn,templateErrorDeliver:{type:"boolean"},attachments:{type:"array",items:_A},inlineAttachments:{type:"array",items:OA},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},pg={output:IA};var Jt={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},Fo={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},PA={type:"object",properties:{from:{anyOf:[{type:"string"},Jt]},sender:{anyOf:[{type:"string"},Jt]},to:{anyOf:[{type:"string"},Jt,{type:"array",items:Jt}]},cc:{anyOf:[{type:"string"},Jt,{type:"array",items:Jt}]},bcc:{anyOf:[{type:"string"},Jt,{type:"array",items:Jt}]},replyTo:{anyOf:[{type:"string"},Jt,{type:"array",items:Jt}]},inReplyTo:{anyOf:[{type:"string"},Jt]},references:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},subject:{type:"string"},text:{anyOf:[{type:"string"},Fo]},html:{anyOf:[{type:"string"},Fo]},watchHtml:{anyOf:[{type:"string"},Fo]},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"},Fo]}}}]},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},dg={output:PA};var MA={type:"object",properties:{},required:[],additionalProperties:!1},hg={output:MA};var NA={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},fg={output:NA};var mg={anypost:ae,braze:ae,clickatell:ae,nodemailer:dg,emailjs:ae,"email-webhook":ae,"infobip-email":ae,mailersend:ae,mailgun:ug,mailjet:pg,mailtrap:ae,mandrill:ae,netcore:ae,"novu-email":hg,outlook365:ae,plunk:ae,postmark:ae,resend:ae,sendgrid:fg,sendinblue:ae,ses:ae,sparkpost:ae};var LA={type:"object",properties:{},required:[],additionalProperties:!1},gg={output:LA};var yg={novu:gg};var bg={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},DA={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:
155
163
 
156
164
  10 - The push notification is sent to the device immediately. (Default)
157
165
  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.
158
166
 
159
167
  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.
160
168
 
161
- 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:Dm,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:Dm,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},Fm={output:Dx};var Fx={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},Um={output:Fx};var Ux={type:"object",properties:{to:{description:`This parameter specifies the recipient of a message.
169
+ 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:bg,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:bg,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},wg={output:DA};var FA={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},Sg={output:FA};var UA={type:"object",properties:{to:{description:`This parameter specifies the recipient of a message.
162
170
  The value must be a registration token, notification key, or topic. Do not set this field when sending to multiple topics. See **condition**.
163
171
  `,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.
164
172
  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.
@@ -194,7 +202,7 @@ If set, and a notification with the same tag is already being shown, the new not
194
202
  `,type:"string"},titleLocArgs:{description:`Indicates the string value to replace format specifiers in the title string for localization.
195
203
  * iOS: Corresponds to "title-loc-args" in the APNs payload.
196
204
  * android: See [Formatting strings](https://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling).
197
- `,type:"string"}}}},required:[],additionalProperties:!0},$m={output:Ux};var $x={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.
205
+ `,type:"string"}}}},required:[],additionalProperties:!0},Tg={output:UA};var HA={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.
198
206
  Example: ["Active Users", "Inactive Users"]
199
207
  `,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.
200
208
  Example: ["Active Users", "Inactive Users"]
@@ -561,4 +569,4 @@ Examples: All examples are the exact same date & time.
561
569
  "Sept 24 2015 14:00:00 GMT-0700"
562
570
  "Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)"
563
571
  Note: SMS currently only supports sendAfter parameter.
564
- `,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},qm={output:$x};var jm={apns:Fm,expo:Um,fcm:$m,"one-signal":qm,"pusher-beams":oe,pushpad:oe,"push-webhook":oe,appio:oe};var qx={type:"object",properties:{},required:[],additionalProperties:!1},Bm={output:qx};var jx={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},zm={output:jx};var Vm={"africas-talking":oe,"azure-sms":oe,bandwidth:oe,"brevo-sms":oe,"bulk-sms":oe,"burst-sms":oe,clickatell:oe,clicksend:oe,"eazy-sms":oe,firetext:oe,"forty-six-elks":oe,"generic-sms":oe,gupshup:oe,"infobip-sms":oe,"isend-sms":oe,kannel:oe,maqsam:oe,messagebird:oe,mobishastra:oe,nexmo:oe,"novu-sms":Bm,plivo:oe,"ring-central":oe,sendchamp:oe,simpletexting:oe,sms77:oe,"sms-central":oe,smsmode:oe,sns:oe,telnyx:oe,termii:oe,twilio:zm,"afro-message":oe,unifonic:oe,imedia:oe,sinch:oe,"isendpro-sms":oe,"ruach-sms":oe};var Hm={pagerduty:oe,opsgenie:oe,grafana:oe,"tool-webhook":oe};var ua={chat:_m,sms:Vm,email:Mm,push:jm,in_app:Lm,tool:Hm};var Bx={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},zx={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Vx={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},Hx={oneOf:[Bx,zx,Vx]},Wx={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},pa={output:Hx,result:Wx};var Yx={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},Jx={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Gx={oneOf:[Yx,Jx]},Kx={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},da={output:Gx,result:Kx};var ha={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 Xx={type:"object",properties:{type:{type:"string",const:"text"},content:{type:"string"},style:{type:"string",enum:["plain","bold","muted"]}},required:["type","content"]},Qx={type:"object",properties:{type:{type:"string",const:"image"},url:{type:"string"},alt:{type:"string"}},required:["type","url"]},Zx={type:"object",properties:{type:{type:"string",const:"divider"}},required:["type"]},ek={type:"object",properties:{type:{type:"string",const:"link"},label:{type:"string"},url:{type:"string"}},required:["type","label","url"]},tk={type:"object",properties:{type:{type:"string",const:"link-button"},label:{type:"string"},url:{type:"string"},style:{type:"string",enum:["primary","danger","default"]},id:{type:"string"}},required:["type","label","url"]},nk={type:"object",properties:{type:{type:"string",const:"button"},id:{type:"string"},label:{type:"string"},style:{type:"string",enum:["primary","danger","default"]},actionType:{type:"string",enum:["action","modal"]},callbackUrl:{type:"string"},value:{type:"string"},disabled:{type:"boolean"}},required:["type","id","label"]},Wm={type:"object",properties:{label:{type:"string"},value:{type:"string"},description:{type:"string"}},required:["label","value"]},rk={type:"object",properties:{type:{type:"string",const:"select"},id:{type:"string"},label:{type:"string"},options:{type:"array",items:Wm},initialOption:{type:"string"},optional:{type:"boolean"},placeholder:{type:"string"}},required:["type","id","label","options"]},ik={type:"object",properties:{type:{type:"string",const:"radio_select"},id:{type:"string"},label:{type:"string"},options:{type:"array",items:Wm},initialOption:{type:"string"},optional:{type:"boolean"}},required:["type","id","label","options"]},ok={type:"object",properties:{type:{type:"string",const:"actions"},children:{type:"array",items:{anyOf:[tk,nk,rk,ik]}}},required:["type","children"]},ak={type:"object",properties:{type:{type:"string",const:"field"},label:{type:"string"},value:{type:"string"}},required:["type","label","value"]},sk={type:"object",properties:{type:{type:"string",const:"fields"},children:{type:"array",items:ak}},required:["type","children"]},lk={type:"object",properties:{type:{type:"string",const:"table"},headers:{type:"array",items:{type:"string"}},rows:{type:"array",items:{type:"array",items:{type:"string"}}},align:{type:"array",items:{type:"string",enum:["left","center","right"]}}},required:["type","headers","rows"]},Ym=[Xx,Qx,Zx,ek,ok,sk,lk],ck={type:"object",properties:{type:{type:"string",const:"section"},children:{type:"array",items:{anyOf:[...Ym,{type:"object",properties:{type:{type:"string",const:"section"},children:{type:"array",items:{type:"object"}}},required:["type","children"]}]}}},required:["type","children"]},uk={type:"object",properties:{type:{type:"string",const:"card"},title:{type:"string"},subtitle:{type:"string"},imageUrl:{type:"string"},children:{type:"array",items:{anyOf:[...Ym,ck]}}},required:["type","children"],additionalProperties:!1},pk={type:"object",properties:{body:{type:"string"},card:uk},anyOf:[{required:["body"]},{required:["card"]}],additionalProperties:!1},dk={type:"object",properties:{},required:[],additionalProperties:!1},Jm={output:pk,result:dk};var hk={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string"},from:{type:"object",properties:{email:{type:"string"},name:{type:"string"}},additionalProperties:!1},replyTo:{type:"string"},preheader:{type:"string"},useProviderDefaults:{type:"boolean"}},required:["subject","body"],additionalProperties:!1},fk={type:"object",properties:{},required:[],additionalProperties:!1},Gm={output:hk,result:fk};var mk="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",Xm={type:"object",properties:{url:{type:"string",pattern:mk},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},Km={type:"object",properties:{label:{type:"string"},redirect:Xm},required:["label"],additionalProperties:!1},gk={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:Km,secondaryAction:Km,data:{type:"object",additionalProperties:!0},redirect:Xm},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},yk={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},Qm={output:gk,result:yk};var bk={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},wk={type:"object",properties:{},required:[],additionalProperties:!1},Zm={output:bk,result:wk};var Sk={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Tk={type:"object",properties:{},required:[],additionalProperties:!1},eg={output:Sk,result:Tk};var xk={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},kk={type:"object",properties:{},required:[],additionalProperties:!1},tg={output:xk,result:kk};var Dt={chat:Jm,sms:eg,push:Zm,email:Gm,in_app:Qm,tool:tg};var It={type:"object",properties:{},required:[],additionalProperties:!1};var fa=(i=>(i.NONE="none",i.LOW="low",i.MEDIUM="medium",i.HIGH="high",i))(fa||{});async function ur(e,t,n){if(e.steps.some(r=>r.stepId===t))throw new zi(t);e.steps.push(n)}async function ma(e,t,n,r){return async(i,o,a={})=>{let s=(a==null?void 0:a.controlSchema)||It;return await ur(e,i,{stepId:i,type:t,controls:{schema:await bt(s),unknownSchema:s},outputs:{schema:await bt(n),unknownSchema:n},results:{schema:await bt(r),unknownSchema:r},resolve:o,code:o.toString(),options:a,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function ng(e,t,n){let r=ua[t],i=Object.entries(n).map(async([o,a])=>{let s=r[o];return{type:o,code:a.toString(),resolve:a,outputs:{schema:await bt(s.output),unknownSchema:s.output}}});e.providers.push(...await Promise.all(i))}async function Yn(e,t,n,r){return async(i,o,a={})=>{let s=(a==null?void 0:a.controlSchema)||It,u={stepId:i,type:t,controls:{schema:await bt(s),unknownSchema:s},outputs:{schema:await bt(n),unknownSchema:n},results:{schema:await bt(r),unknownSchema:r},resolve:o,code:o.toString(),options:a,providers:[]};return await ur(e,i,u),Object.keys(a.providers||{}).length>0&&await ng(u,t,a.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function Jl(e,t){return async(n,r,i={})=>{let o=(i==null?void 0:i.controlSchema)||It,a=(i==null?void 0:i.outputSchema)||It,[s,u]=await Promise.all([bt(o),bt(a)]);return await ur(e,n,{stepId:n,type:t,controls:{schema:s,unknownSchema:o},outputs:{schema:u,unknownSchema:a},results:{schema:u,unknownSchema:a},resolve:r,code:r.toString(),options:i,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var vk={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat",tool:"tool"};function rg(e){if(!e)return{};let t={};return e.all&&(t.all=e.all),Object.entries(e.channels||{}).forEach(([n,r])=>{let i=vk[n];i&&(t.channels||(t.channels={}),t.channels[i]=r)}),t}function ig(e,t,n){let r=n||{};return{id:e,trigger:async a=>{let s=Jo(Xo(a.secretKey),Ko(a.apiUrl)),u=a.payload||{},p;if(r.payloadSchema){let P=await ni(r.payloadSchema,u);if(P.success===!1)throw new Ci(e,P.errors);p=P.data}else p=a.payload;let d=await qf(),h={name:e,to:a.to,payload:{...p},...a.transactionId&&{transactionId:a.transactionId},...a.overrides&&{overrides:a.overrides},...a.actor&&{actor:a.actor},...a.context&&{context:a.context},...a.agentId!==void 0&&{agentId:a.agentId},...d&&{bridgeUrl:d}},g=await s.post("/events/trigger",h);return{cancel:async()=>s.delete(`/events/trigger/${g.transactionId}`),data:g}},discover:async()=>{var s;let a={workflowId:e,severity:(s=r.severity)!=null?s:"none",steps:[],code:t.toString(),payload:{schema:await bt(r.payloadSchema||It),unknownSchema:r.payloadSchema||It},controls:{schema:await bt(r.controlSchema||It),unknownSchema:r.controlSchema||It},env:{schema:await bt(r.envSchema||It),unknownSchema:r.envSchema||It},tags:r.tags||[],preferences:rg(r.preferences),name:r.name,description:r.description,execute:t};return await t({payload:{},subscriber:{},env:{},controls:{},context:{},step:{push:await Yn(a,"push",Dt.push.output,Dt.push.result),chat:await Yn(a,"chat",Dt.chat.output,Dt.chat.result),email:await Yn(a,"email",Dt.email.output,Dt.email.result),sms:await Yn(a,"sms",Dt.sms.output,Dt.sms.result),inApp:await Yn(a,"in_app",Dt.in_app.output,Dt.in_app.result),tool:await Yn(a,"tool",Dt.tool.output,Dt.tool.result),digest:await ma(a,"digest",da.output,da.result),delay:await ma(a,"delay",pa.output,pa.result),throttle:await ma(a,"throttle",ha.output,ha.result),custom:await Jl(a,"custom"),httpRequest:await Jl(a,"http_request")}}),a}}}function Ak(e,t,n){return{type:"email",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Ek(e,t,n){return{type:"sms",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function _k(e,t,n){return{type:"chat",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Rk(e,t,n){return{type:"push",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Ok(e,t,n){return{type:"in_app",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Ck(e,t,n){return{type:"tool",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Ik(e,t,n){return{type:"delay",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip}}function Pk(e,t,n){return{type:"digest",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip}}function Mk(e,t,n){return{type:"throttle",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip}}var og={email:Ak,sms:Ek,chat:_k,push:Rk,inApp:Ok,tool:Ck,delay:Ik,digest:Pk,throttle:Mk};0&&(module.exports={Actions,AgentDeliveryError,AgentError,Button,Card,CardLink,CardText,Client,CronExpression,Divider,Image,NovuRequestHandler,Select,SelectOption,SeverityLevelEnum,TextInput,agent,isFromWorkflow,providerSchemas,step,toAgentError,workflow});
572
+ `,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},xg={output:HA};var Ag={apns:wg,expo:Sg,fcm:Tg,"one-signal":xg,"pusher-beams":ae,pushpad:ae,"push-webhook":ae,appio:ae};var $A={type:"object",properties:{},required:[],additionalProperties:!1},vg={output:$A};var qA={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},kg={output:qA};var Eg={"africas-talking":ae,"azure-sms":ae,bandwidth:ae,"brevo-sms":ae,"bulk-sms":ae,"burst-sms":ae,clickatell:ae,clicksend:ae,"eazy-sms":ae,firetext:ae,"forty-six-elks":ae,"generic-sms":ae,gupshup:ae,"infobip-sms":ae,"isend-sms":ae,kannel:ae,maqsam:ae,messagebird:ae,mobishastra:ae,nexmo:ae,"novu-sms":vg,plivo:ae,"ring-central":ae,sendchamp:ae,simpletexting:ae,sms77:ae,"sms-central":ae,smsmode:ae,sns:ae,telnyx:ae,termii:ae,twilio:kg,"afro-message":ae,unifonic:ae,imedia:ae,sinch:ae,"isendpro-sms":ae,"ruach-sms":ae};var Rg={pagerduty:ae,opsgenie:ae,grafana:ae,"tool-webhook":ae};var Uo={chat:cg,sms:Eg,email:mg,push:Ag,in_app:yg,tool:Rg};var jA={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},BA={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},zA={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},VA={oneOf:[jA,BA,zA]},WA={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Ho={output:VA,result:WA};var YA={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},JA={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},GA={oneOf:[YA,JA]},KA={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},$o={output:GA,result:KA};var qo={output:{type:"object",properties:{type:{type:"string",enum:["fixed","dynamic"]},amount:{type:"number"},unit:{type:"string",enum:["minutes","hours","days"]},dynamicKey:{type:"string"},threshold:{type:"number"},throttleKey:{type:"string"}},required:["type"],additionalProperties:!1},result:{type:"object",properties:{throttled:{type:"boolean",description:"Whether the workflow execution was throttled"},executionCount:{type:"number",description:"Number of executions within the throttle window"},threshold:{type:"number",description:"The throttle threshold that was applied"},windowStart:{type:"string",format:"date-time",description:"Start time of the throttle window"}},required:["throttled"],additionalProperties:!1}};var XA={type:"object",properties:{type:{type:"string",const:"text"},content:{type:"string"},style:{type:"string",enum:["plain","bold","muted"]}},required:["type","content"]},QA={type:"object",properties:{type:{type:"string",const:"image"},url:{type:"string"},alt:{type:"string"}},required:["type","url"]},ZA={type:"object",properties:{type:{type:"string",const:"divider"}},required:["type"]},ev={type:"object",properties:{type:{type:"string",const:"link"},label:{type:"string"},url:{type:"string"}},required:["type","label","url"]},tv={type:"object",properties:{type:{type:"string",const:"link-button"},label:{type:"string"},url:{type:"string"},style:{type:"string",enum:["primary","danger","default"]},id:{type:"string"},tooltip:{type:"string"}},required:["type","label","url"]},nv={type:"object",properties:{type:{type:"string",const:"button"},id:{type:"string"},label:{type:"string"},style:{type:"string",enum:["primary","danger","default"]},actionType:{type:"string",enum:["action","modal"]},callbackUrl:{type:"string"},value:{type:"string"},disabled:{type:"boolean"},tooltip:{type:"string"}},required:["type","id","label"]},Cg={type:"object",properties:{label:{type:"string"},value:{type:"string"},description:{type:"string"}},required:["label","value"]},rv={type:"object",properties:{type:{type:"string",const:"select"},id:{type:"string"},label:{type:"string"},options:{type:"array",items:Cg},initialOption:{type:"string"},optional:{type:"boolean"},placeholder:{type:"string"}},required:["type","id","label","options"]},iv={type:"object",properties:{type:{type:"string",const:"radio_select"},id:{type:"string"},label:{type:"string"},options:{type:"array",items:Cg},initialOption:{type:"string"},optional:{type:"boolean"}},required:["type","id","label","options"]},av={type:"object",properties:{type:{type:"string",const:"actions"},children:{type:"array",items:{anyOf:[tv,nv,rv,iv]}}},required:["type","children"]},ov={type:"object",properties:{type:{type:"string",const:"field"},label:{type:"string"},value:{type:"string"}},required:["type","label","value"]},sv={type:"object",properties:{type:{type:"string",const:"fields"},children:{type:"array",items:ov}},required:["type","children"]},lv={type:"object",properties:{type:{type:"string",const:"table"},headers:{type:"array",items:{type:"string"}},rows:{type:"array",items:{type:"array",items:{type:"string"}}},align:{type:"array",items:{type:"string",enum:["left","center","right"]}},caption:{type:"string"},pageSize:{type:"number"}},required:["type","headers","rows"]},cv={type:"object",properties:{label:{type:"string"},value:{type:"number"}},required:["label","value"]},uv={type:"object",properties:{label:{type:"string"},value:{type:"number"}},required:["label","value"]},pv={type:"object",properties:{name:{type:"string"},data:{type:"array",items:uv}},required:["name","data"]},dv={type:"object",properties:{type:{type:"string",const:"pie"},segments:{type:"array",items:cv}},required:["type","segments"]},hv={type:"object",properties:{type:{type:"string",enum:["area","bar","line"]},categories:{type:"array",items:{type:"string"}},series:{type:"array",items:pv},xLabel:{type:"string"},yLabel:{type:"string"}},required:["type","categories","series"]},fv={type:"object",properties:{type:{type:"string",const:"chart"},title:{type:"string"},chart:{anyOf:[dv,hv]}},required:["type","title","chart"]},_g=[XA,QA,ZA,ev,av,sv,lv,fv],mv={type:"object",properties:{type:{type:"string",const:"section"},children:{type:"array",items:{anyOf:[..._g,{type:"object",properties:{type:{type:"string",const:"section"},children:{type:"array",items:{type:"object"}}},required:["type","children"]}]}}},required:["type","children"]},gv={type:"object",properties:{type:{type:"string",const:"card"},title:{type:"string"},subtitle:{type:"string"},imageUrl:{type:"string"},width:{type:"string",enum:["default","full"]},children:{type:"array",items:{anyOf:[..._g,mv]}}},required:["type","children"],additionalProperties:!1},yv={type:"object",properties:{body:{type:"string"},card:gv},anyOf:[{required:["body"]},{required:["card"]}],additionalProperties:!1},bv={type:"object",properties:{},required:[],additionalProperties:!1},Og={output:yv,result:bv};var wv={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string"},from:{type:"object",properties:{email:{type:"string"},name:{type:"string"}},additionalProperties:!1},replyTo:{type:"string"},preheader:{type:"string"},useProviderDefaults:{type:"boolean"}},required:["subject","body"],additionalProperties:!1},Sv={type:"object",properties:{},required:[],additionalProperties:!1},Ig={output:wv,result:Sv};var Tv="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",Mg={type:"object",properties:{url:{type:"string",pattern:Tv},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},Pg={type:"object",properties:{label:{type:"string"},redirect:Mg},required:["label"],additionalProperties:!1},xv={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:Pg,secondaryAction:Pg,data:{type:"object",additionalProperties:!0},redirect:Mg},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},Av={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},Ng={output:xv,result:Av};var vv={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},kv={type:"object",properties:{},required:[],additionalProperties:!1},Lg={output:vv,result:kv};var Ev={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Rv={type:"object",properties:{},required:[],additionalProperties:!1},Dg={output:Ev,result:Rv};var Cv={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},_v={type:"object",properties:{},required:[],additionalProperties:!1},Fg={output:Cv,result:_v};var Ut={chat:Og,sms:Dg,push:Lg,email:Ig,in_app:Ng,tool:Fg};var Mt={type:"object",properties:{},required:[],additionalProperties:!1};var jo=(i=>(i.NONE="none",i.LOW="low",i.MEDIUM="medium",i.HIGH="high",i))(jo||{});async function mr(e,t,n){if(e.steps.some(r=>r.stepId===t))throw new ca(t);e.steps.push(n)}async function Bo(e,t,n,r){return async(i,a,o={})=>{let s=(o==null?void 0:o.controlSchema)||Mt;return await mr(e,i,{stepId:i,type:t,controls:{schema:await bt(s),unknownSchema:s},outputs:{schema:await bt(n),unknownSchema:n},results:{schema:await bt(r),unknownSchema:r},resolve:a,code:a.toString(),options:o,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function Ug(e,t,n){let r=Uo[t],i=Object.entries(n).map(async([a,o])=>{let s=r[a];return{type:a,code:o.toString(),resolve:o,outputs:{schema:await bt(s.output),unknownSchema:s.output}}});e.providers.push(...await Promise.all(i))}async function Jn(e,t,n,r){return async(i,a,o={})=>{let s=(o==null?void 0:o.controlSchema)||Mt,c={stepId:i,type:t,controls:{schema:await bt(s),unknownSchema:s},outputs:{schema:await bt(n),unknownSchema:n},results:{schema:await bt(r),unknownSchema:r},resolve:a,code:a.toString(),options:o,providers:[]};return await mr(e,i,c),Object.keys(o.providers||{}).length>0&&await Ug(c,t,o.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function vc(e,t){return async(n,r,i={})=>{let a=(i==null?void 0:i.controlSchema)||Mt,o=(i==null?void 0:i.outputSchema)||Mt,[s,c]=await Promise.all([bt(a),bt(o)]);return await mr(e,n,{stepId:n,type:t,controls:{schema:s,unknownSchema:a},outputs:{schema:c,unknownSchema:o},results:{schema:c,unknownSchema:o},resolve:r,code:r.toString(),options:i,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var Ov={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat",tool:"tool"};function Hg(e){if(!e)return{};let t={};return e.all&&(t.all=e.all),Object.entries(e.channels||{}).forEach(([n,r])=>{let i=Ov[n];i&&(t.channels||(t.channels={}),t.channels[i]=r)}),t}function $g(e,t,n){let r=n||{};return{id:e,trigger:async o=>{let s=co(ho(o.secretKey),po(o.apiUrl)),c=o.payload||{},p;if(r.payloadSchema){let I=await Ai(r.payloadSchema,c);if(I.success===!1)throw new Ki(e,I.errors);p=I.data}else p=o.payload;let d=await wm(),h={name:e,to:o.to,payload:{...p},...o.transactionId&&{transactionId:o.transactionId},...o.overrides&&{overrides:o.overrides},...o.actor&&{actor:o.actor},...o.context&&{context:o.context},...o.agentId!==void 0&&{agentId:o.agentId},...d&&{bridgeUrl:d}},y=await s.post("/events/trigger",h);return{cancel:async()=>s.delete(`/events/trigger/${y.transactionId}`),data:y}},discover:async()=>{var s;let o={workflowId:e,severity:(s=r.severity)!=null?s:"none",steps:[],code:t.toString(),payload:{schema:await bt(r.payloadSchema||Mt),unknownSchema:r.payloadSchema||Mt},controls:{schema:await bt(r.controlSchema||Mt),unknownSchema:r.controlSchema||Mt},env:{schema:await bt(r.envSchema||Mt),unknownSchema:r.envSchema||Mt},tags:r.tags||[],preferences:Hg(r.preferences),name:r.name,description:r.description,execute:t};return await t({payload:{},subscriber:{},env:{},controls:{},context:{},step:{push:await Jn(o,"push",Ut.push.output,Ut.push.result),chat:await Jn(o,"chat",Ut.chat.output,Ut.chat.result),email:await Jn(o,"email",Ut.email.output,Ut.email.result),sms:await Jn(o,"sms",Ut.sms.output,Ut.sms.result),inApp:await Jn(o,"in_app",Ut.in_app.output,Ut.in_app.result),tool:await Jn(o,"tool",Ut.tool.output,Ut.tool.result),digest:await Bo(o,"digest",$o.output,$o.result),delay:await Bo(o,"delay",Ho.output,Ho.result),throttle:await Bo(o,"throttle",qo.output,qo.result),custom:await vc(o,"custom"),httpRequest:await vc(o,"http_request")}}),o}}}function Iv(e,t,n){return{type:"email",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Pv(e,t,n){return{type:"sms",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Mv(e,t,n){return{type:"chat",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Nv(e,t,n){return{type:"push",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Lv(e,t,n){return{type:"in_app",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Dv(e,t,n){return{type:"tool",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Fv(e,t,n){return{type:"delay",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip}}function Uv(e,t,n){return{type:"digest",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip}}function Hv(e,t,n){return{type:"throttle",stepId:e,resolve:t,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,envSchema:n==null?void 0:n.envSchema,skip:n==null?void 0:n.skip}}var qg={email:Iv,sms:Pv,chat:Mv,push:Nv,inApp:Lv,tool:Dv,delay:Fv,digest:Uv,throttle:Hv};0&&(module.exports={Actions,AgentDeliveryError,AgentError,Button,Card,CardLink,CardText,Chart,Client,CronExpression,Divider,Image,LinkButton,NovuRequestHandler,Select,SelectOption,SeverityLevelEnum,Table,TextInput,agent,isFromWorkflow,providerSchemas,step,toAgentError,workflow});