@useago/sdk 1.0.4 → 1.0.6

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 (41) hide show
  1. package/README.md +3 -3
  2. package/dist/{AgoClient-1jgDndKs.cjs → AgoClient--y10UXUV.cjs} +1 -1
  3. package/dist/{AgoClient-j1sk1hK5.js → AgoClient-DYdIe_R4.js} +9 -6
  4. package/dist/angular.cjs +1 -1
  5. package/dist/angular.d.cts +49 -2
  6. package/dist/angular.d.ts +49 -2
  7. package/dist/angular.js +1 -1
  8. package/dist/{createConversationSession-CZhoTCtD.js → createConversationSession-Boi0PjDU.js} +1 -1
  9. package/dist/{createConversationSession-BYNhYbkY.cjs → createConversationSession-lJWANT6T.cjs} +1 -1
  10. package/dist/{createFormCollector-BPKzKDeX.js → createFormCollector-BUqSA2Qw.js} +1 -1
  11. package/dist/{createFormCollector-B8V9YSGe.cjs → createFormCollector-CSG5ioym.cjs} +1 -1
  12. package/dist/devtools.cjs +41 -27
  13. package/dist/devtools.d.cts +48 -0
  14. package/dist/devtools.d.ts +48 -0
  15. package/dist/devtools.js +98 -70
  16. package/dist/{functions-C1-5vadY.js → functions-CApuQZ2b.js} +50 -43
  17. package/dist/{functions-DsmzgHjC.cjs → functions-Djnq-JAo.cjs} +1 -1
  18. package/dist/helpers.cjs +1 -1
  19. package/dist/helpers.js +1 -1
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.d.cts +12 -0
  22. package/dist/index.d.ts +12 -0
  23. package/dist/index.js +35 -35
  24. package/dist/react.cjs +3 -31
  25. package/dist/react.d.cts +49 -2
  26. package/dist/react.d.ts +49 -2
  27. package/dist/react.js +599 -8156
  28. package/dist/rolldown-runtime-16Nf8qvH.cjs +1 -0
  29. package/dist/testing.d.cts +48 -0
  30. package/dist/testing.d.ts +48 -0
  31. package/dist/vue.cjs +1 -1
  32. package/dist/vue.d.cts +49 -2
  33. package/dist/vue.d.ts +49 -2
  34. package/dist/vue.js +1 -1
  35. package/dist/widget.cjs +1 -1
  36. package/dist/widget.d.cts +48 -0
  37. package/dist/widget.d.ts +48 -0
  38. package/dist/widget.js +3 -3
  39. package/package.json +6 -6
  40. package/dist/rolldown-runtime-CaekUdDJ.cjs +0 -1
  41. package/dist/rolldown-runtime-DxmricAu.js +0 -25
package/dist/react.cjs CHANGED
@@ -1,35 +1,7 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("./rolldown-runtime-CaekUdDJ.cjs"),oi=require("./AgoClient-1jgDndKs.cjs"),ve=require("./createFormCollector-B8V9YSGe.cjs"),ai=require("./createMockClient-zHQ0cjUH.cjs");let D=require("react");D=fe.__toESM(D,1);let z=require("react/jsx-runtime");function Un(e){const[n,t]=(0,D.useState)(!1),r=(0,D.useRef)(null),i=(0,D.useMemo)(()=>{if(r.current&&(r.current.destroy(),r.current=null),!e)return null;const l=new oi.AgoClient(e);return r.current=l,l},[e?.baseUrl,e?.widgetId]);return(0,D.useEffect)(()=>(t(!0),()=>{r.current?.destroy(),r.current=null}),[i]),(0,D.useEffect)(()=>{r.current&&e&&r.current.updateConfig({agent:e.agent,defaultAgentId:e.defaultAgentId,permission:e.permission,userEmail:e.userEmail,userJwt:e.userJwt,debug:e.debug,warnOnEmptyReply:e.warnOnEmptyReply})},[e?.agent,e?.defaultAgentId,e?.permission,e?.userEmail,e?.userJwt,e?.debug,e?.warnOnEmptyReply]),{client:i,isReady:n}}var _t=(0,D.createContext)(null),ui=({children:e,client:n,tools:t,helpers:r,pageContext:i,...l})=>{const{client:o}=Un(n?null:l),a=n||o;return(0,D.useEffect)(()=>{if(!(!t||t.length===0)){for(const u of t)a.register(u);return()=>{for(const u of t)a.unregisterFunction(u.name)}}},[a,t]),(0,D.useEffect)(()=>{if(!r)return;const u=[];return Promise.resolve().then(()=>require("./functions-DsmzgHjC.cjs")).then(s=>s.functions_exports).then(s=>{for(const[f,c]of Object.entries(r)){const h=s[f];if(!h){console.warn(`[AGO] Unknown helper: "${f}"`);continue}const p=c===!0?h:{...h,handler:c};a.register(p),u.push(p.name)}}),()=>{for(const s of u)a.unregisterFunction(s)}},[a,r]),(0,D.useEffect)(()=>{i==="auto"&&a.enableAutoPageContext()},[a,i]),(0,z.jsx)(_t.Provider,{value:a,children:e})};function Ye(){const e=(0,D.useContext)(_t);if(!e)throw new Error('useAgoClient must be used within an <AgoProvider>. Wrap your component tree with <AgoProvider baseUrl="...">.');return e}function Je(){return(0,D.useContext)(_t)}function Ot({client:e,conversationId:n}={}){const t=Je(),r=e||t;if(!r)throw new Error("useMessages requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");const[i,l]=(0,D.useState)([]),[o,a]=(0,D.useState)(n),[u,s]=(0,D.useState)(!1),[f,c]=(0,D.useState)(null);(0,D.useEffect)(()=>{n&&n!==o&&(a(n),h(n))},[n]);const h=async p=>{try{l(await r.getMessages(p))}catch(x){c(x instanceof Error?x:new Error("Failed to load messages"))}};return(0,D.useEffect)(()=>{const p=v=>{o||a(v.conversationId)},x=v=>{l(b=>{const A=b[b.length-1];return A&&A.id===v.messageId?[...b.slice(0,-1),{...A,content:A.content+v.content}]:b})},k=v=>{l(b=>{let A=-1;for(let P=b.length-1;P>=0;P--)if(b[P].role==="assistant"&&b[P].status==="IN_PROGRESS"){A=P;break}return A<0?b:[...b.slice(0,A),{...b[A],...v},...b.slice(A+1)]})},C=v=>{l(b=>{const A=b.findIndex(P=>P.id===v.id);return A>=0?[...b.slice(0,A),v,...b.slice(A+1)]:[...b,v]}),s(!1)},d=v=>{c(new Error(v.error)),s(!1)};return r.on("message:start",p),r.on("message:chunk",x),r.on("message:answer-complete",k),r.on("message:complete",C),r.on("message:error",d),()=>{r.off("message:start",p),r.off("message:chunk",x),r.off("message:answer-complete",k),r.off("message:complete",C),r.off("message:error",d)}},[r,o]),{messages:i,isLoading:u,error:f,sendMessage:(0,D.useCallback)(async(p,x)=>{s(!0),c(null);const k={id:`temp-${Date.now()}`,conversationId:o||"",content:p,role:"user",status:"DONE",createdAt:new Date},C={id:`temp-assistant-${Date.now()}`,conversationId:o||"",content:"",role:"assistant",status:"IN_PROGRESS",createdAt:new Date};l(d=>[...d,k,C]);try{const d=await r.sendMessage(p,{conversationId:o,files:x});return d.conversationId&&!o&&a(d.conversationId),l(v=>{const b=v.filter(P=>!P.id.startsWith("temp-")),A={...k,id:k.id.replace("temp-","user-"),conversationId:d.conversationId};return b.some(P=>P.id===d.id)?[...b,A].sort((P,S)=>new Date(P.createdAt).getTime()-new Date(S.createdAt).getTime()):[...b,A,d]}),d}catch(d){return c(d instanceof Error?d:new Error("Failed to send message")),s(!1),l(v=>v.filter(b=>!b.id.startsWith("temp-"))),null}},[r,o]),clearMessages:(0,D.useCallback)(()=>{l([]),a(void 0),c(null)},[]),conversationId:o}}var $n=({onSend:e,disabled:n=!1,placeholder:t="Type a message...",allowFiles:r=!1,className:i=""})=>{const[l,o]=(0,D.useState)(""),[a,u]=(0,D.useState)([]),s=(0,D.useRef)(null),f=(0,D.useCallback)(k=>{k.preventDefault(),(l.trim()||a.length>0)&&(e(l.trim(),a.length>0?a:void 0),o(""),u([]))},[l,a,e]),c=(0,D.useCallback)(k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),f(k))},[f]),h=(0,D.useCallback)(k=>{const C=Array.from(k.target.files||[]);u(d=>[...d,...C])},[]),p=(0,D.useCallback)(k=>{u(C=>C.filter((d,v)=>v!==k))},[]),x=l.trim()||a.length>0;return(0,z.jsxs)("form",{onSubmit:f,className:`ago-chat-input ${i}`,style:{display:"flex",flexDirection:"column",gap:"8px",padding:"12px 16px",borderTop:"1px solid #dee3e8",backgroundColor:"#fff"},children:[a.length>0&&(0,z.jsx)("div",{className:"ago-chat-input__files",style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:a.map((k,C)=>(0,z.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"4px 10px",backgroundColor:"#f0f2f5",borderRadius:"6px",fontSize:"12px",color:"#30373e"},children:[(0,z.jsx)("span",{style:{maxWidth:"120px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.name}),(0,z.jsx)("button",{type:"button",onClick:()=>p(C),style:{border:"none",background:"none",cursor:"pointer",padding:"0",color:"#6b6d6f",fontSize:"14px",lineHeight:1},children:"×"})]},C))}),(0,z.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"flex-end"},children:[r&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("button",{type:"button",onClick:()=>s.current?.click(),disabled:n,style:{padding:"8px",border:"1px solid #dee3e8",borderRadius:"8px",backgroundColor:"#fff",cursor:n?"not-allowed":"pointer",color:"#6b6d6f",fontSize:"16px",lineHeight:1},children:"+"}),(0,z.jsx)("input",{ref:s,type:"file",multiple:!0,onChange:h,style:{display:"none"}})]}),(0,z.jsx)("textarea",{value:l,onChange:k=>o(k.target.value),onKeyDown:c,placeholder:t,disabled:n,rows:1,style:{flex:1,padding:"10px 14px",border:"1px solid #dee3e8",borderRadius:"20px",resize:"none",outline:"none",fontFamily:"inherit",fontSize:"14px",color:"#30373e",backgroundColor:"#f8f8f8",transition:"border-color 0.15s"},onFocus:k=>{k.currentTarget.style.borderColor="#1b5fc4"},onBlur:k=>{k.currentTarget.style.borderColor="#dee3e8"}}),(0,z.jsx)("button",{type:"submit",disabled:n||!x,style:{padding:"10px 18px",border:"none",borderRadius:"20px",backgroundColor:n||!x?"#b5bfc8":"#03182f",color:"#fff",cursor:n||!x?"not-allowed":"pointer",fontWeight:500,fontSize:"14px",transition:"background-color 0.15s"},children:"Send"})]})]})};function si(e,n){const t=n||{};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}var ci=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pi={};function rn(e,n){return((n||pi).jsx?fi:ci).test(e)}var hi=/[ \t\n\f\r]/g;function mi(e){return typeof e=="object"?e.type==="text"?ln(e.value):!1:ln(e)}function ln(e){return e.replace(hi,"")===""}var Ke=class{constructor(e,n,t){this.normal=n,this.property=e,t&&(this.space=t)}};Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function Vn(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Ke(t,r,n)}function It(e){return e.toLowerCase()}var re=class{constructor(e,n){this.attribute=n,this.property=e}};re.prototype.attribute="";re.prototype.booleanish=!1;re.prototype.boolean=!1;re.prototype.commaOrSpaceSeparated=!1;re.prototype.commaSeparated=!1;re.prototype.defined=!1;re.prototype.mustUseProperty=!1;re.prototype.number=!1;re.prototype.overloadedBoolean=!1;re.prototype.property="";re.prototype.spaceSeparated=!1;re.prototype.space=void 0;var At=fe.__exportAll({boolean:()=>N,booleanish:()=>Q,commaOrSpaceSeparated:()=>le,commaSeparated:()=>Re,number:()=>E,overloadedBoolean:()=>Tt,spaceSeparated:()=>W}),gi=0,N=Ae(),Q=Ae(),Tt=Ae(),E=Ae(),W=Ae(),Re=Ae(),le=Ae();function Ae(){return 2**++gi}var ft=Object.keys(At),Nt=class extends re{constructor(e,n,t,r){let i=-1;if(super(e,n),on(this,"space",r),typeof t=="number")for(;++i<ft.length;){const l=ft[i];on(this,ft[i],(t&At[l])===At[l])}}};Nt.prototype.defined=!0;function on(e,n,t){t&&(e[n]=t)}function Oe(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new Nt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[It(r)]=r,t[It(l.attribute)]=r}return new Ke(n,t,e.space)}var Wn=Oe({properties:{ariaActiveDescendant:null,ariaAtomic:Q,ariaAutoComplete:null,ariaBusy:Q,ariaChecked:Q,ariaColCount:E,ariaColIndex:E,ariaColSpan:E,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:Q,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:Q,ariaFlowTo:W,ariaGrabbed:Q,ariaHasPopup:null,ariaHidden:Q,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:E,ariaLive:null,ariaModal:Q,ariaMultiLine:Q,ariaMultiSelectable:Q,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:E,ariaPressed:Q,ariaReadOnly:Q,ariaRelevant:null,ariaRequired:Q,ariaRoleDescription:W,ariaRowCount:E,ariaRowIndex:E,ariaRowSpan:E,ariaSelected:Q,ariaSetSize:E,ariaSort:null,ariaValueMax:E,ariaValueMin:E,ariaValueNow:E,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Xn(e,n){return n in e?e[n]:n}function Yn(e,n){return Xn(e,n.toLowerCase())}var di=Oe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Re,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:N,allowPaymentRequest:N,allowUserMedia:N,alt:null,as:null,async:N,autoCapitalize:null,autoComplete:W,autoFocus:N,autoPlay:N,blocking:W,capture:null,charSet:null,checked:N,cite:null,className:W,cols:E,colSpan:null,content:null,contentEditable:Q,controls:N,controlsList:W,coords:E|Re,crossOrigin:null,data:null,dateTime:null,decoding:null,default:N,defer:N,dir:null,dirName:null,disabled:N,download:Tt,draggable:Q,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:N,formTarget:null,headers:W,height:E,hidden:Tt,high:E,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:N,inputMode:null,integrity:null,is:null,isMap:N,itemId:null,itemProp:W,itemRef:W,itemScope:N,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:N,low:E,manifest:null,max:null,maxLength:E,media:null,method:null,min:null,minLength:E,multiple:N,muted:N,name:null,nonce:null,noModule:N,noValidate:N,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:N,optimum:E,pattern:null,ping:W,placeholder:null,playsInline:N,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:N,referrerPolicy:null,rel:W,required:N,reversed:N,rows:E,rowSpan:E,sandbox:W,scope:null,scoped:N,seamless:N,selected:N,shadowRootClonable:N,shadowRootDelegatesFocus:N,shadowRootMode:null,shape:null,size:E,sizes:null,slot:null,span:E,spellCheck:Q,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E,step:null,style:null,tabIndex:E,target:null,title:null,translate:null,type:null,typeMustMatch:N,useMap:null,value:Q,width:E,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:E,borderColor:null,bottomMargin:E,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:N,declare:N,event:null,face:null,frame:null,frameBorder:null,hSpace:E,leftMargin:E,link:null,longDesc:null,lowSrc:null,marginHeight:E,marginWidth:E,noResize:N,noHref:N,noShade:N,noWrap:N,object:null,profile:null,prompt:null,rev:null,rightMargin:E,rules:null,scheme:null,scrolling:Q,standby:null,summary:null,text:null,topMargin:E,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:N,disableRemotePlayback:N,prefix:null,property:null,results:E,security:null,unselectable:null},space:"html",transform:Yn}),xi=Oe({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:le,accentHeight:E,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E,amplitude:E,arabicForm:null,ascent:E,attributeName:null,attributeType:null,azimuth:E,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E,by:null,calcMode:null,capHeight:E,className:W,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:E,diffuseConstant:E,direction:null,display:null,dur:null,divisor:E,dominantBaseline:null,download:N,dx:null,dy:null,edgeMode:null,editable:null,elevation:E,enableBackground:null,end:null,event:null,exponent:E,externalResourcesRequired:null,fill:null,fillOpacity:E,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Re,g2:Re,glyphName:Re,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E,horizOriginX:E,horizOriginY:E,id:null,ideographic:E,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E,k:E,k1:E,k2:E,k3:E,k4:E,kernelMatrix:le,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:E,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:E,overlineThickness:E,paintOrder:null,panose1:null,path:null,pathLength:E,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E,pointsAtY:E,pointsAtZ:E,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:le,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:le,rev:le,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:le,requiredFeatures:le,requiredFonts:le,requiredFormats:le,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:E,specularExponent:E,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E,strikethroughThickness:E,string:null,stroke:null,strokeDashArray:le,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E,strokeOpacity:E,strokeWidth:null,style:null,surfaceScale:E,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:le,tabIndex:E,tableValues:null,target:null,targetX:E,targetY:E,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:le,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E,underlineThickness:E,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E,values:null,vAlphabetic:E,vMathematical:E,vectorEffect:null,vHanging:E,vIdeographic:E,version:null,vertAdvY:E,vertOriginX:E,vertOriginY:E,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Xn}),Jn=Oe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Kn=Oe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Yn}),Qn=Oe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),yi={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ki=/[A-Z]/g,an=/-[a-z]/g,bi=/^data[-\w.:]+$/i;function wi(e,n){const t=It(n);let r=n,i=re;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&bi.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(an,Si);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!an.test(l)){let o=l.replace(ki,vi);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=Nt}return new i(r,n)}function vi(e){return"-"+e.toLowerCase()}function Si(e){return e.charAt(1).toUpperCase()}var Ci=Vn([Wn,di,Jn,Kn,Qn],"html"),Bt=Vn([Wn,xi,Jn,Kn,Qn],"svg");function Ei(e){return e.join(" ").trim()}var Ii=fe.__commonJSMin(((e,n)=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,s=/^\s+|\s+$/g,f=`
2
- `,c="/",h="*",p="",x="comment",k="declaration";function C(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var A=1,P=1;function S(_){var M=_.match(r);M&&(A+=M.length);var K=_.lastIndexOf(f);P=~K?_.length-K:P+_.length}function B(){var _={line:A,column:P};return function(M){return M.position=new U(_),T(),M}}function U(_){this.start=_,this.end={line:A,column:P},this.source=b.source}U.prototype.content=v;function F(_){var M=new Error(b.source+":"+A+":"+P+": "+_);if(M.reason=_,M.filename=b.source,M.line=A,M.column=P,M.source=v,!b.silent)throw M}function y(_){var M=_.exec(v);if(M){var K=M[0];return S(K),v=v.slice(K.length),M}}function T(){y(i)}function L(_){var M;for(_=_||[];M=$();)M!==!1&&_.push(M);return _}function $(){var _=B();if(!(c!=v.charAt(0)||h!=v.charAt(1))){for(var M=2;p!=v.charAt(M)&&(h!=v.charAt(M)||c!=v.charAt(M+1));)++M;if(M+=2,p===v.charAt(M-1))return F("End of comment missing");var K=v.slice(2,M-2);return P+=2,S(K),v=v.slice(M),P+=2,_({type:x,comment:K})}}function X(){var _=B(),M=y(l);if(M){if($(),!y(o))return F("property missing ':'");var K=y(a),ue=_({type:k,property:d(M[0].replace(t,p)),value:K?d(K[0].replace(t,p)):p});return y(u),ue}}function H(){var _=[];L(_);for(var M;M=X();)M!==!1&&(_.push(M),L(_));return _}return T(),H()}function d(v){return v?v.replace(s,p):p}n.exports=C})),Ai=fe.__commonJSMin((e=>{var n=e&&e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var t=n(Ii());function r(i,l){let o=null;if(!i||typeof i!="string")return o;const a=(0,t.default)(i),u=typeof l=="function";return a.forEach(s=>{if(s.type!=="declaration")return;const{property:f,value:c}=s;u?l(f,c,s):c&&(o=o||{},o[f]=c)}),o}})),Ti=fe.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(f){return!f||r.test(f)||n.test(f)},a=function(f,c){return c.toUpperCase()},u=function(f,c){return"".concat(c,"-")},s=function(f,c){return c===void 0&&(c={}),o(f)?f:(f=f.toLowerCase(),c.reactCompat?f=f.replace(l,u):f=f.replace(i,u),f.replace(t,a))};e.camelCase=s})),Pi=fe.__commonJSMin(((e,n)=>{var t=(e&&e.__importDefault||function(l){return l&&l.__esModule?l:{default:l}})(Ai()),r=Ti();function i(l,o){var a={};return!l||typeof l!="string"||(0,t.default)(l,function(u,s){u&&s&&(a[(0,r.camelCase)(u,o)]=s)}),a}i.default=i,n.exports=i})),Gn=Zn("end"),jt=Zn("start");function Zn(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Li(e){const n=jt(e),t=Gn(e);if(n&&t)return{start:n,end:t}}function $e(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?un(e.position):"start"in e||"end"in e?un(e):"line"in e||"column"in e?Pt(e):""}function Pt(e){return sn(e&&e.line)+":"+sn(e&&e.column)}function un(e){return Pt(e&&e.start)+"-"+Pt(e&&e.end)}function sn(e){return e&&typeof e=="number"?e:1}var ee=class extends Error{constructor(e,n,t){super(),typeof n=="string"&&(t=n,n=void 0);let r="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?r=e:!i.cause&&e&&(l=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof t=="string"){const a=t.indexOf(":");a===-1?i.ruleId=t:(i.source=t.slice(0,a),i.ruleId=t.slice(a+1))}if(!i.place&&i.ancestors&&i.ancestors){const a=i.ancestors[i.ancestors.length-1];a&&(i.place=a.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=$e(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ee.prototype.file="";ee.prototype.name="";ee.prototype.reason="";ee.prototype.message="";ee.prototype.stack="";ee.prototype.column=void 0;ee.prototype.line=void 0;ee.prototype.ancestors=void 0;ee.prototype.cause=void 0;ee.prototype.fatal=void 0;ee.prototype.place=void 0;ee.prototype.ruleId=void 0;ee.prototype.source=void 0;var zi=fe.__toESM(Pi(),1),Ht={}.hasOwnProperty,Di=new Map,Fi=/[A-Z]/g,Mi=new Set(["table","tbody","thead","tfoot","tr"]),Ri=new Set(["td","th"]),er="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _i(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=$i(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ui(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Bt:Ci,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=tr(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function tr(e,n,t){if(n.type==="element")return Oi(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Ni(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return ji(e,n,t);if(n.type==="mdxjsEsm")return Bi(e,n);if(n.type==="root")return Hi(e,n,t);if(n.type==="text")return qi(e,n)}function Oi(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Bt,e.schema=i),e.ancestors.push(n);const l=rr(e,n.tagName,!1),o=Vi(e,n);let a=Ut(e,n);return Mi.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!mi(u):!0})),nr(e,o,l,n),qt(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Ni(e,n){if(n.data&&n.data.estree&&e.evaluater){const t=n.data.estree.body[0];return t.type,e.evaluater.evaluateExpression(t.expression)}We(e,n.position)}function Bi(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);We(e,n.position)}function ji(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Bt,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:rr(e,n.name,!0),o=Wi(e,n),a=Ut(e,n);return nr(e,o,l,n),qt(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Hi(e,n,t){const r={};return qt(r,Ut(e,n)),e.create(n,e.Fragment,r,t)}function qi(e,n){return n.value}function nr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qt(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Ui(e,n,t){return r;function r(i,l,o,a){const u=Array.isArray(o.children)?t:n;return a?u(l,o,a):u(l,o)}}function $i(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),u=jt(r);return n(i,l,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Vi(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Ht.call(n.properties,i)){const l=Xi(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Ri.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Wi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const o=l.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else We(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else We(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function Ut(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Di;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const s=i.get(u)||0;o=u+"-"+s,i.set(u,s+1)}}const a=tr(e,l,o);a!==void 0&&t.push(a)}return t}function Xi(e,n,t){const r=wi(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?si(t):Ei(t)),r.property==="style"){let i=typeof t=="object"?t:Yi(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Ji(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?yi[r.property]||r.property:r.attribute,t]}}function Yi(e,n){try{return(0,zi.default)(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ee("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=er+"#cannot-parse-style-attribute",i}}function rr(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let l=-1,o;for(;++l<i.length;){const a=rn(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=o}else r=rn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Ht.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);We(e)}function We(e,n){const t=new ee("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=er+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Ji(e){const n={};let t;for(t in e)Ht.call(e,t)&&(n[Ki(t)]=e[t]);return n}function Ki(e){let n=e.replace(Fi,Qi);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Qi(e){return"-"+e.toLowerCase()}var pt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Gi={};function $t(e,n){const t=n||Gi;return ir(e,typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,typeof t.includeHtml=="boolean"?t.includeHtml:!0)}function ir(e,n,t){if(Zi(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return cn(e.children,n,t)}return Array.isArray(e)?cn(e,n,t):""}function cn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=ir(e[i],n,t);return r.join("")}function Zi(e){return!!(e&&typeof e=="object")}var fn=document.createElement("i");function Vt(e){const n="&"+e+";";fn.innerHTML=n;const t=fn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function oe(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function ae(e,n){return e.length>0?(oe(e,e.length,0,n),e):n}var pn={}.hasOwnProperty;function lr(e){const n={};let t=-1;for(;++t<e.length;)el(n,e[t]);return n}function el(e,n){let t;for(t in n){const r=(pn.call(e,t)?e[t]:void 0)||(e[t]={}),i=n[t];let l;if(i)for(l in i){pn.call(r,l)||(r[l]=[]);const o=i[l];tl(r[l],Array.isArray(o)?o:o?[o]:[])}}}function tl(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);oe(e,0,0,r)}function or(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var te=Se(/[A-Za-z]/),Z=Se(/[\dA-Za-z]/),nl=Se(/[#-'*+\--9=?A-Z^-~]/);function it(e){return e!==null&&(e<32||e===127)}var Lt=Se(/\d/),rl=Se(/[\dA-Fa-f]/),il=Se(/[!-/:-@[-`{-~]/);function R(e){return e!==null&&e<-2}function V(e){return e!==null&&(e<0||e===32)}function j(e){return e===-2||e===-1||e===32}var at=Se(new RegExp("\\p{P}|\\p{S}","u")),Ie=Se(/\s/);function Se(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ne(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&Z(e.charCodeAt(t+1))&&Z(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function q(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(u){return j(u)?(e.enter(t),a(u)):n(u)}function a(u){return j(u)&&l++<i?(e.consume(u),a):(e.exit(t),n(u))}}var ll={tokenize:ol};function ol(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),q(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return R(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}var al={tokenize:ul},hn={tokenize:sl};function ul(e){const n=this,t=[];let r=0,i,l,o;return a;function a(b){if(r<t.length){const A=t[r];return n.containerState=A[1],e.attempt(A[0].continuation,u,s)(b)}return s(b)}function u(b){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&v();const A=n.events.length;let P=A,S;for(;P--;)if(n.events[P][0]==="exit"&&n.events[P][1].type==="chunkFlow"){S=n.events[P][1].end;break}d(r);let B=A;for(;B<n.events.length;)n.events[B][1].end={...S},B++;return oe(n.events,P+1,0,n.events.slice(A)),n.events.length=B,s(b)}return a(b)}function s(b){if(r===t.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return x(b);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(hn,f,c)(b)}function f(b){return i&&v(),d(r),h(b)}function c(b){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,x(b)}function h(b){return n.containerState={},e.attempt(hn,p,x)(b)}function p(b){return r++,t.push([n.currentConstruct,n.containerState]),h(b)}function x(b){if(b===null){i&&v(),d(0),e.consume(b);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),k(b)}function k(b){if(b===null){C(e.exit("chunkFlow"),!0),d(0),e.consume(b);return}return R(b)?(e.consume(b),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(b),k)}function C(b,A){const P=n.sliceStream(b);if(A&&P.push(null),b.previous=l,l&&(l.next=b),l=b,i.defineSkip(b.start),i.write(P),n.parser.lazy[b.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<o&&(!i.events[S][1].end||i.events[S][1].end.offset>o))return;const B=n.events.length;let U=B,F,y;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if(F){y=n.events[U][1].end;break}F=!0}for(d(r),S=B;S<n.events.length;)n.events[S][1].end={...y},S++;oe(n.events,U+1,0,n.events.slice(B)),n.events.length=S}}function d(b){let A=t.length;for(;A-- >b;){const P=t[A];n.containerState=P[1],P[0].exit.call(n,e)}t.length=b}function v(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function sl(e,n,t){return q(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||V(e)||Ie(e))return 1;if(at(e))return 2}function ut(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}var zt={name:"attention",resolveAll:cl,tokenize:fl};function cl(e,n){let t=-1,r,i,l,o,a,u,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[t][1].start};mn(c,-u),mn(h,u),o={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:h},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ae(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=ae(s,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),s=ae(s,ut(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=ae(s,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=ae(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,oe(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function fl(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=_e(r);let l;return o;function o(u){return l=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===l)return e.consume(u),a;const s=e.exit("attentionSequence"),f=_e(u),c=!f||f===2&&i||t.includes(u),h=!i||i===2&&f||t.includes(r);return s._open=!!(l===42?c:c&&(i||!h)),s._close=!!(l===42?h:h&&(f||!c)),n(u)}}function mn(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}var pl={name:"autolink",tokenize:hl};function hl(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(p){return te(p)?(e.consume(p),o):p===64?t(p):s(p)}function o(p){return p===43||p===45||p===46||Z(p)?(r=1,a(p)):s(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||Z(p))&&r++<32?(e.consume(p),a):(r=0,s(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||it(p)?t(p):(e.consume(p),u)}function s(p){return p===64?(e.consume(p),f):nl(p)?(e.consume(p),s):t(p)}function f(p){return Z(p)?c(p):t(p)}function c(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):h(p)}function h(p){if((p===45||Z(p))&&r++<63){const x=p===45?h:c;return e.consume(p),x}return t(p)}}var Qe={partial:!0,tokenize:ml};function ml(e,n,t){return r;function r(l){return j(l)?q(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||R(l)?n(l):t(l)}}var ar={continuation:{tokenize:dl},exit:xl,name:"blockQuote",tokenize:gl};function gl(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return j(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function dl(e,n,t){const r=this;return i;function i(o){return j(o)?q(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(ar,n,t)(o)}}function xl(e){e.exit("blockQuote")}var ur={name:"characterEscape",tokenize:yl};function yl(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return il(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}var sr={name:"characterReference",tokenize:kl};function kl(e,n,t){const r=this;let i=0,l,o;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),l=31,o=Z,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=rl,f):(e.enter("characterReferenceValue"),l=7,o=Lt,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return o===Z&&!Vt(r.sliceSerialize(h))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(c)&&i++<l?(e.consume(c),f):t(c)}}var gn={partial:!0,tokenize:wl},dn={concrete:!0,name:"codeFenced",tokenize:bl};function bl(e,n,t){const r=this,i={partial:!0,tokenize:P};let l=0,o=0,a;return u;function u(S){return s(S)}function s(S){const B=r.events[r.events.length-1];return l=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(S)}function f(S){return S===a?(o++,e.consume(S),f):o<3?t(S):(e.exit("codeFencedFenceSequence"),j(S)?q(e,c,"whitespace")(S):c(S))}function c(S){return S===null||R(S)?(e.exit("codeFencedFence"),r.interrupt?n(S):e.check(gn,k,A)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||R(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(S)):j(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),q(e,p,"whitespace")(S)):S===96&&S===a?t(S):(e.consume(S),h)}function p(S){return S===null||R(S)?c(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||R(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(S)):S===96&&S===a?t(S):(e.consume(S),x)}function k(S){return e.attempt(i,A,C)(S)}function C(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),d}function d(S){return l>0&&j(S)?q(e,v,"linePrefix",l+1)(S):v(S)}function v(S){return S===null||R(S)?e.check(gn,k,A)(S):(e.enter("codeFlowValue"),b(S))}function b(S){return S===null||R(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),b)}function A(S){return e.exit("codeFenced"),n(S)}function P(S,B,U){let F=0;return y;function y(H){return S.enter("lineEnding"),S.consume(H),S.exit("lineEnding"),T}function T(H){return S.enter("codeFencedFence"),j(H)?q(S,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):L(H)}function L(H){return H===a?(S.enter("codeFencedFenceSequence"),$(H)):U(H)}function $(H){return H===a?(F++,S.consume(H),$):F>=o?(S.exit("codeFencedFenceSequence"),j(H)?q(S,X,"whitespace")(H):X(H)):U(H)}function X(H){return H===null||R(H)?(S.exit("codeFencedFence"),B(H)):U(H)}}}function wl(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}var ht={name:"codeIndented",tokenize:Sl},vl={partial:!0,tokenize:Cl};function Sl(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),q(e,l,"linePrefix",5)(s)}function l(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(s):t(s)}function o(s){return s===null?u(s):R(s)?e.attempt(vl,o,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||R(s)?(e.exit("codeFlowValue"),o(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function Cl(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):R(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):q(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):R(o)?i(o):t(o)}}var El={name:"codeText",previous:Al,resolve:Il,tokenize:Tl};function Il(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||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),n-=r-i-2,r=i+2),i=void 0);return e}function Al(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Tl(e,n,t){let r=0,i,l;return o;function o(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(l=e.enter("codeTextSequence"),i=0,f(c)):R(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||R(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(l.type="codeTextData",s(c))}}var Pl=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const t=n??Number.POSITIVE_INFINITY;return t<this.left.length?this.left.slice(e,t):e>this.left.length?this.right.slice(this.right.length-t+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-t+this.left.length).reverse())}splice(e,n,t){const r=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return t&&qe(this.left,t),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),qe(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qe(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);qe(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);qe(this.left,n.reverse())}}};function qe(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function cr(e){const n={};let t=-1,r,i,l,o,a,u,s;const f=new Pl(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Ll(f,t)),t=n[t],s=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=f.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return oe(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function Ll(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,u=[],s={};let f,c,h=-1,p=t,x=0,k=0;const C=[k];for(;p;){for(;e.get(++i)[1]!==p;);l.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),c&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(f),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=t;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(k=h+1,C.push(k),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),h=C.length;h--;){const d=a.slice(C[h],C[h+1]),v=l.pop();u.push([v,v+d.length-1]),e.splice(v,2,d)}for(u.reverse(),h=-1;++h<u.length;)s[x+u[h][0]]=x+u[h][1],x+=u[h][1]-u[h][0]-1;return s}var zl={resolve:Fl,tokenize:Ml},Dl={partial:!0,tokenize:Rl};function Fl(e){return cr(e),e}function Ml(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):R(a)?e.check(Dl,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Rl(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),q(e,l,"linePrefix")}function l(o){if(o===null||R(o))return t(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function fr(e,n,t,r,i,l,o,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(d){return d===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(d),e.exit(l),h):d===null||d===32||d===41||it(d)?t(d):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),k(d))}function h(d){return d===62?(e.enter(l),e.consume(d),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(d))}function p(d){return d===62?(e.exit("chunkString"),e.exit(a),h(d)):d===null||d===60||R(d)?t(d):(e.consume(d),d===92?x:p)}function x(d){return d===60||d===62||d===92?(e.consume(d),p):p(d)}function k(d){return!f&&(d===null||d===41||V(d))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(d)):f<s&&d===40?(e.consume(d),f++,k):d===41?(e.consume(d),f--,k):d===null||d===32||d===40||it(d)?t(d):(e.consume(d),d===92?C:k)}function C(d){return d===40||d===41||d===92?(e.consume(d),k):k(d)}}function pr(e,n,t,r,i,l){const o=this;let a=0,u;return s;function s(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(l),f}function f(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):R(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||R(p)||a++>999?(e.exit("chunkString"),f(p)):(e.consume(p),u||(u=!j(p)),p===92?h:c)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function hr(e,n,t,r,i,l){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,u):t(h)}function u(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):(e.enter(l),s(h))}function s(h){return h===o?(e.exit(l),u(o)):h===null?t(h):R(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),q(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===o||h===null||R(h)?(e.exit("chunkString"),s(h)):(e.consume(h),h===92?c:f)}function c(h){return h===o||h===92?(e.consume(h),f):f(h)}}function Ve(e,n){let t;return r;function r(i){return R(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):j(i)?q(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}var _l={name:"definition",tokenize:Nl},Ol={partial:!0,tokenize:Bl};function Nl(e,n,t){const r=this;let i;return l;function l(p){return e.enter("definition"),o(p)}function o(p){return pr.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):t(p)}function u(p){return V(p)?Ve(e,s)(p):s(p)}function s(p){return fr(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Ol,c,c)(p)}function c(p){return j(p)?q(e,h,"whitespace")(p):h(p)}function h(p){return p===null||R(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Bl(e,n,t){return r;function r(a){return V(a)?Ve(e,i)(a):t(a)}function i(a){return hr(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return j(a)?q(e,o,"whitespace")(a):o(a)}function o(a){return a===null||R(a)?n(a):t(a)}}var jl={name:"hardBreakEscape",tokenize:Hl};function Hl(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return R(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}var ql={name:"headingAtx",resolve:Ul,tokenize:$l};function Ul(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},oe(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function $l(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),l(f)}function l(f){return e.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(e.consume(f),o):f===null||V(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||R(f)?(e.exit("atxHeading"),n(f)):j(f)?q(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||V(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}var Vl=["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"],xn=["pre","script","style","textarea"],Wl={concrete:!0,name:"htmlFlow",resolveTo:Jl,tokenize:Kl},Xl={partial:!0,tokenize:Gl},Yl={partial:!0,tokenize:Ql};function Jl(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Kl(e,n,t){const r=this;let i,l,o,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),h):g===47?(e.consume(g),l=!0,k):g===63?(e.consume(g),i=3,r.interrupt?n:m):te(g)?(e.consume(g),o=String.fromCharCode(g),C):t(g)}function h(g){return g===45?(e.consume(g),i=2,p):g===91?(e.consume(g),i=5,a=0,x):te(g)?(e.consume(g),i=4,r.interrupt?n:m):t(g)}function p(g){return g===45?(e.consume(g),r.interrupt?n:m):t(g)}function x(g){return g==="CDATA[".charCodeAt(a++)?(e.consume(g),a===6?r.interrupt?n:L:x):t(g)}function k(g){return te(g)?(e.consume(g),o=String.fromCharCode(g),C):t(g)}function C(g){if(g===null||g===47||g===62||V(g)){const ke=g===47,Ce=o.toLowerCase();return!ke&&!l&&xn.includes(Ce)?(i=1,r.interrupt?n(g):L(g)):Vl.includes(o.toLowerCase())?(i=6,ke?(e.consume(g),d):r.interrupt?n(g):L(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(g):l?v(g):b(g))}return g===45||Z(g)?(e.consume(g),o+=String.fromCharCode(g),C):t(g)}function d(g){return g===62?(e.consume(g),r.interrupt?n:L):t(g)}function v(g){return j(g)?(e.consume(g),v):y(g)}function b(g){return g===47?(e.consume(g),y):g===58||g===95||te(g)?(e.consume(g),A):j(g)?(e.consume(g),b):y(g)}function A(g){return g===45||g===46||g===58||g===95||Z(g)?(e.consume(g),A):P(g)}function P(g){return g===61?(e.consume(g),S):j(g)?(e.consume(g),P):b(g)}function S(g){return g===null||g===60||g===61||g===62||g===96?t(g):g===34||g===39?(e.consume(g),u=g,B):j(g)?(e.consume(g),S):U(g)}function B(g){return g===u?(e.consume(g),u=null,F):g===null||R(g)?t(g):(e.consume(g),B)}function U(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||V(g)?P(g):(e.consume(g),U)}function F(g){return g===47||g===62||j(g)?b(g):t(g)}function y(g){return g===62?(e.consume(g),T):t(g)}function T(g){return g===null||R(g)?L(g):j(g)?(e.consume(g),T):t(g)}function L(g){return g===45&&i===2?(e.consume(g),_):g===60&&i===1?(e.consume(g),M):g===62&&i===4?(e.consume(g),ye):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),ue):R(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Xl,he,$)(g)):g===null||R(g)?(e.exit("htmlFlowData"),$(g)):(e.consume(g),L)}function $(g){return e.check(Yl,X,he)(g)}function X(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),H}function H(g){return g===null||R(g)?$(g):(e.enter("htmlFlowData"),L(g))}function _(g){return g===45?(e.consume(g),m):L(g)}function M(g){return g===47?(e.consume(g),o="",K):L(g)}function K(g){if(g===62){const ke=o.toLowerCase();return xn.includes(ke)?(e.consume(g),ye):L(g)}return te(g)&&o.length<8?(e.consume(g),o+=String.fromCharCode(g),K):L(g)}function ue(g){return g===93?(e.consume(g),m):L(g)}function m(g){return g===62?(e.consume(g),ye):g===45&&i===2?(e.consume(g),m):L(g)}function ye(g){return g===null||R(g)?(e.exit("htmlFlowData"),he(g)):(e.consume(g),ye)}function he(g){return e.exit("htmlFlow"),n(g)}}function Ql(e,n,t){const r=this;return i;function i(o){return R(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Gl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,n,t)}}var Zl={name:"htmlText",tokenize:eo};function eo(e,n,t){const r=this;let i,l,o;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),P):m===63?(e.consume(m),b):te(m)?(e.consume(m),U):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),l=0,x):te(m)?(e.consume(m),v):t(m)}function f(m){return m===45?(e.consume(m),p):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),h):R(m)?(o=c,M(m)):(e.consume(m),c)}function h(m){return m===45?(e.consume(m),p):c(m)}function p(m){return m===62?_(m):m===45?h(m):c(m)}function x(m){return m==="CDATA[".charCodeAt(l++)?(e.consume(m),l===6?k:x):t(m)}function k(m){return m===null?t(m):m===93?(e.consume(m),C):R(m)?(o=k,M(m)):(e.consume(m),k)}function C(m){return m===93?(e.consume(m),d):k(m)}function d(m){return m===62?_(m):m===93?(e.consume(m),d):k(m)}function v(m){return m===null||m===62?_(m):R(m)?(o=v,M(m)):(e.consume(m),v)}function b(m){return m===null?t(m):m===63?(e.consume(m),A):R(m)?(o=b,M(m)):(e.consume(m),b)}function A(m){return m===62?_(m):b(m)}function P(m){return te(m)?(e.consume(m),S):t(m)}function S(m){return m===45||Z(m)?(e.consume(m),S):B(m)}function B(m){return R(m)?(o=B,M(m)):j(m)?(e.consume(m),B):_(m)}function U(m){return m===45||Z(m)?(e.consume(m),U):m===47||m===62||V(m)?F(m):t(m)}function F(m){return m===47?(e.consume(m),_):m===58||m===95||te(m)?(e.consume(m),y):R(m)?(o=F,M(m)):j(m)?(e.consume(m),F):_(m)}function y(m){return m===45||m===46||m===58||m===95||Z(m)?(e.consume(m),y):T(m)}function T(m){return m===61?(e.consume(m),L):R(m)?(o=T,M(m)):j(m)?(e.consume(m),T):F(m)}function L(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,$):R(m)?(o=L,M(m)):j(m)?(e.consume(m),L):(e.consume(m),X)}function $(m){return m===i?(e.consume(m),i=void 0,H):m===null?t(m):R(m)?(o=$,M(m)):(e.consume(m),$)}function X(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||V(m)?F(m):(e.consume(m),X)}function H(m){return m===47||m===62||V(m)?F(m):t(m)}function _(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function M(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),K}function K(m){return j(m)?q(e,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ue(m)}function ue(m){return e.enter("htmlTextData"),o(m)}}var Wt={name:"labelEnd",resolveAll:io,resolveTo:lo,tokenize:oo},to={tokenize:ao},no={tokenize:uo},ro={tokenize:so};function io(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&oe(e,0,e.length,t),e}function lo(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const u={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},f={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=ae(a,e.slice(l+1,l+r+3)),a=ae(a,[["enter",f,n]]),a=ae(a,ut(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=ae(a,[["exit",f,n],e[o-2],e[o-1],["exit",s,n]]),a=ae(a,e.slice(o+1)),a=ae(a,[["exit",u,n]]),oe(e,l,e.length,a),e}function oo(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(h){return l?l._inactive?c(h):(o=r.parser.defined.includes(se(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):t(h)}function u(h){return h===40?e.attempt(to,f,o?f:c)(h):h===91?e.attempt(no,f,o?s:c)(h):o?f(h):c(h)}function s(h){return e.attempt(ro,f,c)(h)}function f(h){return n(h)}function c(h){return l._balanced=!0,t(h)}}function ao(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return V(c)?Ve(e,l)(c):l(c)}function l(c){return c===41?f(c):fr(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function o(c){return V(c)?Ve(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?hr(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return V(c)?Ve(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function uo(e,n,t){const r=this;return i;function i(a){return pr.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function so(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}var co={name:"labelStartImage",resolveAll:Wt.resolveAll,tokenize:fo};function fo(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}var po={name:"labelStartLink",resolveAll:Wt.resolveAll,tokenize:ho};function ho(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}var mt={name:"lineEnding",tokenize:mo};function mo(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),q(e,n,"linePrefix")}}var rt={name:"thematicBreak",tokenize:go};function go(e,n,t){let r=0,i;return l;function l(s){return e.enter("thematicBreak"),o(s)}function o(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||R(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),j(s)?q(e,a,"whitespace")(s):a(s))}}var ne={continuation:{tokenize:bo},exit:vo,name:"list",tokenize:ko},xo={partial:!0,tokenize:So},yo={partial:!0,tokenize:wo};function ko(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Lt(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(rt,t,s)(p):s(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return t(p)}function u(p){return Lt(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),s(p)):t(p)}function s(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Qe,r.interrupt?t:f,e.attempt(xo,h,c))}function f(p){return r.containerState.initialBlankLine=!0,l++,h(p)}function c(p){return j(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):t(p)}function h(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function bo(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,q(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!j(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yo,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,q(e,e.attempt(ne,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function wo(e,n,t){const r=this;return q(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function vo(e){e.exit(this.containerState.type)}function So(e,n,t){const r=this;return q(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!j(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}var yn={name:"setextUnderline",resolveTo:Co,tokenize:Eo};function Co(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function Eo(e,n,t){const r=this;let i;return l;function l(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,o(s)):t(s)}function o(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),j(s)?q(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||R(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}var Io={tokenize:Ao};function Ao(e){const n=this,t=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(zl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}var To={resolveAll:gr()},Po=mr("string"),Lo=mr("text");function mr(e){return{resolveAll:gr(e==="text"?zo:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(f){return s(f)?l(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return s(f)?(t.exit("data"),l(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const p=c[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function gr(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function zo(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,u;for(;l--;){const s=i[l];if(typeof s=="string"){for(o=s.length;s.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(s===-2)u=!0,a++;else if(s!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}var Do=fe.__exportAll({attentionMarkers:()=>jo,contentInitial:()=>Mo,disable:()=>Ho,document:()=>Fo,flow:()=>_o,flowInitial:()=>Ro,insideSpan:()=>Bo,string:()=>Oo,text:()=>No}),Fo={42:ne,43:ne,45:ne,48:ne,49:ne,50:ne,51:ne,52:ne,53:ne,54:ne,55:ne,56:ne,57:ne,62:ar},Mo={91:_l},Ro={[-2]:ht,[-1]:ht,32:ht},_o={35:ql,42:rt,45:[yn,rt],60:Wl,61:yn,95:rt,96:dn,126:dn},Oo={38:sr,92:ur},No={[-5]:mt,[-4]:mt,[-3]:mt,33:co,38:sr,42:zt,60:[pl,Zl],91:po,92:[jl,ur],93:Wt,95:zt,96:El},Bo={null:[zt,To]},jo={null:[42,95]},Ho={null:[]};function qo(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const u={attempt:B(P),check:B(S),consume:v,enter:b,exit:A,interrupt:B(S,{interrupt:!0})},s={code:null,containerState:{},defineSkip:k,events:[],now:x,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&l.push(n),s;function c(T){return o=ae(o,T),C(),o[o.length-1]!==null?[]:(U(n,0),s.events=ut(l,s.events,s),s.events)}function h(T,L){return $o(p(T),L)}function p(T){return Uo(o,T)}function x(){const{_bufferIndex:T,_index:L,line:$,column:X,offset:H}=r;return{_bufferIndex:T,_index:L,line:$,column:X,offset:H}}function k(T){i[T.line]=T.column,y()}function C(){let T;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<L.length;)d(L.charCodeAt(r._bufferIndex));else d(L)}}function d(T){f=f(T)}function v(T){R(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,y()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=T}function b(T,L){const $=L||{};return $.type=T,$.start=x(),s.events.push(["enter",$,s]),a.push($),$}function A(T){const L=a.pop();return L.end=x(),s.events.push(["exit",L,s]),L}function P(T,L){U(T,L.from)}function S(T,L){L.restore()}function B(T,L){return $;function $(X,H,_){let M,K,ue,m;return Array.isArray(X)?he(X):"tokenize"in X?he([X]):ye(X);function ye(G){return Be;function Be(me){const Te=me!==null&&G[me],Pe=me!==null&&G.null;return he([...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]])(me)}}function he(G){return M=G,K=0,G.length===0?_:g(G[K])}function g(G){return Be;function Be(me){return m=F(),ue=G,G.partial||(s.currentConstruct=G),G.name&&s.parser.constructs.disable.null.includes(G.name)?Ce(me):G.tokenize.call(L?Object.assign(Object.create(s),L):s,u,ke,Ce)(me)}}function ke(G){return T(ue,m),H}function Ce(G){return m.restore(),++K<M.length?g(M[K]):_}}}function U(T,L){T.resolveAll&&!l.includes(T)&&l.push(T),T.resolve&&oe(s.events,L,s.events.length-L,T.resolve(s.events.slice(L),s)),T.resolveTo&&(s.events=T.resolveTo(s.events,s))}function F(){const T=x(),L=s.previous,$=s.currentConstruct,X=s.events.length,H=Array.from(a);return{from:X,restore:_};function _(){r=T,s.previous=L,s.currentConstruct=$,s.events.length=X,a=H,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Uo(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function $o(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:o="\r";break;case-4:o=`
3
- `;break;case-3:o=`\r
4
- `;break;case-2:o=n?" ":" ";break;case-1:if(!n&&i)continue;o=" ";break;default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Vo(e){const n={constructs:lr([Do,...(e||{}).extensions||[]]),content:t(ll),defined:[],document:t(al),flow:t(Io),lazy:{},string:t(Po),text:t(Lo)};return n;function t(r){return i;function i(l){return qo(n,r,l)}}}function Wo(e){for(;!cr(e););return e}var kn=/[\0\t\n\r]/g;function Xo(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const u=[];let s,f,c,h,p;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),c=0,n="",t&&(l.charCodeAt(0)===65279&&c++,t=void 0);c<l.length;){if(kn.lastIndex=c,s=kn.exec(l),h=s&&s.index!==void 0?s.index:l.length,p=l.charCodeAt(h),!s){n=l.slice(c);break}if(p===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(l.slice(c,h)),e+=h-c),p){case 0:u.push(65533),e++;break;case 9:for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break;case 10:u.push(-4),e=1;break;default:r=!0,e=1}c=h+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}var Yo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Jo(e){return e.replace(Yo,Ko)}function Ko(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const r=t.charCodeAt(1),i=r===120||r===88;return or(t.slice(i?2:1),i?16:10)}return Vt(t)||e}var dr={}.hasOwnProperty;function Qo(e,n,t){return typeof n!="string"&&(t=n,n=void 0),Go(t)(Wo(Vo(t).document().write(Xo()(e,n,!0))))}function Go(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(tn),autolinkProtocol:F,autolinkEmail:F,atxHeading:l(Gt),blockQuote:l(Pe),characterEscape:F,characterReference:F,codeFenced:l(Qt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Qt,o),codeText:l(Qr,o),codeTextData:F,data:F,codeFlowValue:F,definition:l(Gr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Zr),hardBreakEscape:l(Zt),hardBreakTrailing:l(Zt),htmlFlow:l(en,o),htmlFlowData:F,htmlText:l(en,o),htmlTextData:F,image:l(ei),label:o,link:l(tn),listItem:l(ti),listItemValue:h,listOrdered:l(nn,c),listUnordered:l(nn),paragraph:l(ni),reference:g,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Gt),strong:l(ri),thematicBreak:l(li)},exit:{atxHeading:u(),atxHeadingSequence:P,autolink:u(),autolinkEmail:Te,autolinkProtocol:me,blockQuote:u(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:G,characterReference:Be,codeFenced:u(C),codeFencedFence:k,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:y,codeIndented:u(d),codeText:u(H),codeTextData:y,data:y,definition:u(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(L),hardBreakTrailing:u(L),htmlFlow:u($),htmlFlowData:y,htmlText:u(X),htmlTextData:y,image:u(M),label:ue,labelText:K,lineEnding:T,link:u(_),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ke,resourceDestinationString:m,resourceTitleString:ye,resource:he,setextHeading:u(U),setextHeadingLineSequence:B,setextHeadingText:S,strong:u(),thematicBreak:u()}};xr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(w){let I={type:"root",children:[]};const O={stack:[I],tokenStack:[],config:n,enter:a,exit:s,buffer:o,resume:f,data:t},Y=[];let J=-1;for(;++J<w.length;)(w[J][1].type==="listOrdered"||w[J][1].type==="listUnordered")&&(w[J][0]==="enter"?Y.push(J):J=i(w,Y.pop(),J));for(J=-1;++J<w.length;){const be=n[w[J][0]];dr.call(be,w[J][1].type)&&be[w[J][1].type].call(Object.assign({sliceSerialize:w[J][2].sliceSerialize},O),w[J][1])}if(O.tokenStack.length>0){const be=O.tokenStack[O.tokenStack.length-1];(be[1]||bn).call(O,void 0,be[0])}for(I.position={start:we(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:we(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<n.transforms.length;)I=n.transforms[J](I)||I;return I}function i(w,I,O){let Y=I-1,J=-1,be=!1,Le,ge,je,He;for(;++Y<=O;){const ie=w[Y];switch(ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":ie[0]==="enter"?J++:J--,He=void 0;break;case"lineEndingBlank":ie[0]==="enter"&&(Le&&!He&&!J&&!je&&(je=Y),He=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!J&&ie[0]==="enter"&&ie[1].type==="listItemPrefix"||J===-1&&ie[0]==="exit"&&(ie[1].type==="listUnordered"||ie[1].type==="listOrdered")){if(Le){let ze=Y;for(ge=void 0;ze--;){const de=w[ze];if(de[1].type==="lineEnding"||de[1].type==="lineEndingBlank"){if(de[0]==="exit")continue;ge&&(w[ge][1].type="lineEndingBlank",be=!0),de[1].type="lineEnding",ge=ze}else if(!(de[1].type==="linePrefix"||de[1].type==="blockQuotePrefix"||de[1].type==="blockQuotePrefixWhitespace"||de[1].type==="blockQuoteMarker"||de[1].type==="listItemIndent"))break}je&&(!ge||je<ge)&&(Le._spread=!0),Le.end=Object.assign({},ge?w[ge][1].start:ie[1].end),w.splice(ge||Y,0,["exit",Le,ie[2]]),Y++,O++}if(ie[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},ie[1].start),end:void 0};Le=ze,w.splice(Y,0,["enter",ze,ie[2]]),Y++,O++,je=void 0,He=!0}}}return w[I][1]._spread=be,O}function l(w,I){return O;function O(Y){a.call(this,w(Y),Y),I&&I.call(this,Y)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(w,I,O){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([I,O||void 0]),w.position={start:we(I.start),end:void 0}}function u(w){return I;function I(O){w&&w.call(this,O),s.call(this,O)}}function s(w,I){const O=this.stack.pop(),Y=this.tokenStack.pop();if(Y)Y[0].type!==w.type&&(I?I.call(this,w,Y[0]):(Y[1]||bn).call(this,w,Y[0]));else throw new Error("Cannot close `"+w.type+"` ("+$e({start:w.start,end:w.end})+"): it’s not open");O.position.end=we(w.end)}function f(){return $t(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(w){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function p(){const w=this.resume(),I=this.stack[this.stack.length-1];I.lang=w}function x(){const w=this.resume(),I=this.stack[this.stack.length-1];I.meta=w}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function d(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w.replace(/(\r?\n|\r)$/g,"")}function v(w){const I=this.resume(),O=this.stack[this.stack.length-1];O.label=I,O.identifier=se(this.sliceSerialize(w)).toLowerCase()}function b(){const w=this.resume(),I=this.stack[this.stack.length-1];I.title=w}function A(){const w=this.resume(),I=this.stack[this.stack.length-1];I.url=w}function P(w){const I=this.stack[this.stack.length-1];I.depth||(I.depth=this.sliceSerialize(w).length)}function S(){this.data.setextHeadingSlurpLineEnding=!0}function B(w){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function F(w){const I=this.stack[this.stack.length-1].children;let O=I[I.length-1];(!O||O.type!=="text")&&(O=ii(),O.position={start:we(w.start),end:void 0},I.push(O)),this.stack.push(O)}function y(w){const I=this.stack.pop();I.value+=this.sliceSerialize(w),I.position.end=we(w.end)}function T(w){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const O=I.children[I.children.length-1];O.position.end=we(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(I.type)&&(F.call(this,w),y.call(this,w))}function L(){this.data.atHardBreak=!0}function $(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function X(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function H(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function _(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=I,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function M(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=I,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function K(w){const I=this.sliceSerialize(w),O=this.stack[this.stack.length-2];O.label=Jo(I),O.identifier=se(I).toLowerCase()}function ue(){const w=this.stack[this.stack.length-1],I=this.resume(),O=this.stack[this.stack.length-1];this.data.inReference=!0,O.type==="link"?O.children=w.children:O.alt=I}function m(){const w=this.resume(),I=this.stack[this.stack.length-1];I.url=w}function ye(){const w=this.resume(),I=this.stack[this.stack.length-1];I.title=w}function he(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function ke(w){const I=this.resume(),O=this.stack[this.stack.length-1];O.label=I,O.identifier=se(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Ce(w){this.data.characterReferenceType=w.type}function G(w){const I=this.sliceSerialize(w),O=this.data.characterReferenceType;let Y;O?(Y=or(I,O==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Y=Vt(I);const J=this.stack[this.stack.length-1];J.value+=Y}function Be(w){const I=this.stack.pop();I.position.end=we(w.end)}function me(w){y.call(this,w);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(w)}function Te(w){y.call(this,w);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(w)}function Pe(){return{type:"blockquote",children:[]}}function Qt(){return{type:"code",lang:null,meta:null,value:""}}function Qr(){return{type:"inlineCode",value:""}}function Gr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Zr(){return{type:"emphasis",children:[]}}function Gt(){return{type:"heading",depth:0,children:[]}}function Zt(){return{type:"break"}}function en(){return{type:"html",value:""}}function ei(){return{type:"image",title:null,url:"",alt:null}}function tn(){return{type:"link",title:null,url:"",children:[]}}function nn(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[]}}function ti(w){return{type:"listItem",spread:w._spread,checked:null,children:[]}}function ni(){return{type:"paragraph",children:[]}}function ri(){return{type:"strong",children:[]}}function ii(){return{type:"text",value:""}}function li(){return{type:"thematicBreak"}}}function we(e){return{line:e.line,column:e.column,offset:e.offset}}function xr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?xr(e,r):Zo(e,r)}}function Zo(e,n){let t;for(t in n)if(dr.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function bn(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+$e({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+$e({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+$e({start:n.start,end:n.end})+") is still open")}function ea(e){const n=this;n.parser=t;function t(r){return Qo(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function ta(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function na(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
5
- `}]}function ra(e,n){const t=n.value?n.value+`
6
- `:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function ia(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function la(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function oa(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Ne(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,u);const s={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,s),e.applyData(n,s)}function aa(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ua(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function yr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function sa(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return yr(e,n);const i={src:Ne(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function ca(e,n){const t={src:Ne(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function fa(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function pa(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return yr(e,n);const i={href:Ne(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function ha(e,n){const t={href:Ne(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function ma(e,n,t){const r=e.all(n),i=t?ga(t):kr(n),l={},o=[];if(typeof n.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
7
- `}),f.type==="element"&&f.tagName==="p"&&!i?o.push(...f.children):o.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
8
- `});const s={type:"element",tagName:"li",properties:l,children:o};return e.patch(n,s),e.applyData(n,s)}function ga(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r<t.length;)n=kr(t[r])}return n}function kr(e){const n=e.spread;return n??e.children.length>1}function da(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const l={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,l),e.applyData(n,l)}function xa(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ya(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function ka(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ba(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],o),i.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=jt(n.children[1]),u=Gn(n.children[n.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function wa(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,o=l?l.length:n.children.length;let a=-1;const u=[];for(;++a<o;){const f=n.children[a],c={},h=l?l[a]:void 0;h&&(c.align=h);let p={type:"element",tagName:i,properties:c,children:[]};f&&(p.children=e.all(f),e.patch(f,p),p=e.applyData(f,p)),u.push(p)}const s={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,s),e.applyData(n,s)}function va(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}var wn=9,vn=32;function Sa(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const l=[];for(;r;)l.push(Sn(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(Sn(n.slice(i),i>0,!1)),l.join("")}function Sn(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===wn||l===vn;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===wn||l===vn;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ca(e,n){const t={type:"text",value:Sa(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Ea(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}var Ia={blockquote:ta,break:na,code:ra,delete:ia,emphasis:la,footnoteReference:oa,heading:aa,html:ua,imageReference:sa,image:ca,inlineCode:fa,linkReference:pa,link:ha,listItem:ma,list:da,paragraph:xa,root:ya,strong:ka,table:ba,tableCell:va,tableRow:wa,text:Ca,thematicBreak:Ea,toml:Ze,yaml:Ze,definition:Ze,footnoteDefinition:Ze};function Ze(){}var Cn=typeof self=="object"?self:globalThis,Aa=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=n[i];switch(l){case 0:case-1:return t(o,i);case 1:{const a=t([],i);for(const u of o)a.push(r(u));return a}case 2:{const a=t({},i);for(const[u,s]of o)a[r(u)]=r(s);return a}case 3:return t(new Date(o),i);case 4:{const{source:a,flags:u}=o;return t(new RegExp(a,u),i)}case 5:{const a=t(new Map,i);for(const[u,s]of o)a.set(r(u),r(s));return a}case 6:{const a=t(new Set,i);for(const u of o)a.add(r(u));return a}case 7:{const{name:a,message:u}=o;return t(new Cn[a](u),i)}case 8:return t(BigInt(o),i);case"BigInt":return t(Object(BigInt(o)),i);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}}return t(new Cn[l](o),i)};return r},En=e=>Aa(new Map,e)(0),De="",{toString:Ta}={},{keys:Pa}=Object,Ue=e=>{const n=typeof e;if(n!=="object"||!e)return[0,n];const t=Ta.call(e).slice(8,-1);switch(t){case"Array":return[1,De];case"Object":return[2,De];case"Date":return[3,De];case"RegExp":return[4,De];case"Map":return[5,De];case"Set":return[6,De];case"DataView":return[1,t]}return t.includes("Array")?[1,t]:t.includes("Error")?[7,t]:[2,t]},et=([e,n])=>e===0&&(n==="function"||n==="symbol"),La=(e,n,t,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return t.set(a,u),u},l=o=>{if(t.has(o))return t.get(o);let[a,u]=Ue(o);switch(a){case 0:{let f=o;switch(u){case"bigint":a=8,f=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([-1],o)}return i([a,f],o)}case 1:{if(u){let h=o;return u==="DataView"?h=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(o)),i([u,[...h]],o)}const f=[],c=i([a,f],o);for(const h of o)f.push(l(h));return c}case 2:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const f=[],c=i([a,f],o);for(const h of Pa(o))(e||!et(Ue(o[h])))&&f.push([l(h),l(o[h])]);return c}case 3:return i([a,o.toISOString()],o);case 4:{const{source:f,flags:c}=o;return i([a,{source:f,flags:c}],o)}case 5:{const f=[],c=i([a,f],o);for(const[h,p]of o)(e||!(et(Ue(h))||et(Ue(p))))&&f.push([l(h),l(p)]);return c}case 6:{const f=[],c=i([a,f],o);for(const h of o)(e||!et(Ue(h)))&&f.push(l(h));return c}}const{message:s}=o;return i([a,{name:u,message:s}],o)};return l},In=(e,{json:n,lossy:t}={})=>{const r=[];return La(!(n||t),!!n,new Map,r)(e),r},lt=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?En(In(e,n)):structuredClone(e):(e,n)=>En(In(e,n));function za(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Da(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Fa(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||za,r=e.options.footnoteBackLabel||Da,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const s=e.footnoteById.get(e.footnoteOrder[u]);if(!s)continue;const f=e.all(s),c=String(s.identifier).toUpperCase(),h=Ne(c.toLowerCase());let p=0;const x=[],k=e.footnoteCounts.get(c);for(;k!==void 0&&++p<=k;){x.length>0&&x.push({type:"text",value:" "});let v=typeof t=="string"?t:t(u,p);typeof v=="string"&&(v={type:"text",value:v}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const C=f[f.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const v=C.children[C.children.length-1];v&&v.type==="text"?v.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...x)}else f.push(...x);const d={type:"element",tagName:"li",properties:{id:n+"fn-"+h},children:e.wrap(f,!0)};e.patch(s,d),a.push(d)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...lt(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
9
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
10
- `}]}}var st=(function(e){if(e==null)return Oa;if(typeof e=="function")return ct(e);if(typeof e=="object")return Array.isArray(e)?Ma(e):Ra(e);if(typeof e=="string")return _a(e);throw new Error("Expected function, string, or object as test")});function Ma(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=st(e[t]);return ct(r);function r(...i){let l=-1;for(;++l<n.length;)if(n[l].apply(this,i))return!0;return!1}}function Ra(e){const n=e;return ct(t);function t(r){const i=r;let l;for(l in e)if(i[l]!==n[l])return!1;return!0}}function _a(e){return ct(n);function n(t){return t&&t.type===e}}function ct(e){return n;function n(t,r,i){return!!(Na(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Oa(){return!0}function Na(e){return e!==null&&typeof e=="object"&&"type"in e}var br=[];function wr(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const l=st(i),o=r?-1:1;a(e,void 0,[])();function a(u,s,f){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=br,x,k,C;if((!n||l(u,s,f[f.length-1]||void 0))&&(p=Ba(t(u,f)),p[0]===!1))return p;if("children"in u&&u.children){const d=u;if(d.children&&p[0]!=="skip")for(k=(r?d.children.length:-1)+o,C=f.concat(d);k>-1&&k<d.children.length;){const v=d.children[k];if(x=a(v,k,C)(),x[0]===!1)return x;k=typeof x[1]=="number"?x[1]:k+o}}return p}}}function Ba(e){return Array.isArray(e)?e:typeof e=="number"?[!0,e]:e==null?br:[e]}function Xt(e,n,t,r){let i,l,o;typeof n=="function"&&typeof t!="function"?(l=void 0,o=n,i=t):(l=n,o=t,i=r),wr(e,l,a,i);function a(u,s){const f=s[s.length-1],c=f?f.children.indexOf(u):void 0;return o(u,c,f)}}var Dt={}.hasOwnProperty,ja={};function Ha(e,n){const t=n||ja,r=new Map,i=new Map,l={all:a,applyData:Ua,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Ia,...t.handlers},one:o,options:t,patch:qa,wrap:Va};return Xt(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const s=u.type==="definition"?r:i,f=String(u.identifier).toUpperCase();s.has(f)||s.set(f,u)}}),l;function o(u,s){const f=u.type,c=l.handlers[f];if(Dt.call(l.handlers,f)&&c)return c(l,u,s);if(l.options.passThrough&&l.options.passThrough.includes(f)){if("children"in u){const{children:h,...p}=u,x=lt(p);return x.children=l.all(u),x}return lt(u)}return(l.options.unknownHandler||$a)(l,u,s)}function a(u){const s=[];if("children"in u){const f=u.children;let c=-1;for(;++c<f.length;){const h=l.one(f[c],u);if(h){if(c&&f[c-1].type==="break"&&(!Array.isArray(h)&&h.type==="text"&&(h.value=An(h.value)),!Array.isArray(h)&&h.type==="element")){const p=h.children[0];p&&p.type==="text"&&(p.value=An(p.value))}Array.isArray(h)?s.push(...h):s.push(h)}}}return s}}function qa(e,n){e.position&&(n.position=Li(e))}function Ua(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;typeof r=="string"&&(t.type==="element"?t.tagName=r:t={type:"element",tagName:r,properties:{},children:"children"in t?t.children:[t]}),t.type==="element"&&l&&Object.assign(t.properties,lt(l)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function $a(e,n){const t=n.data||{},r="value"in n&&!(Dt.call(t,"hProperties")||Dt.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Va(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
11
- `});++r<e.length;)r&&t.push({type:"text",value:`
12
- `}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
13
- `}),t}function An(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Tn(e,n){const t=Ha(e,n),r=t.one(e,void 0),i=Fa(t),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&("children"in l,l.children.push({type:"text",value:`
14
- `},i)),l}function Wa(e,n){return e&&"run"in e?async function(t,r){const i=Tn(t,{file:r,...n});await e.run(i,r)}:function(t,r){return Tn(t,{file:r,...e||n})}}function Pn(e){if(e)throw e}var Xa=fe.__commonJSMin(((e,n)=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):r.call(c)==="[object Array]"},a=function(c){if(!c||r.call(c)!=="[object Object]")return!1;var h=t.call(c,"constructor"),p=c.constructor&&c.constructor.prototype&&t.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!p)return!1;var x;for(x in c);return typeof x>"u"||t.call(c,x)},u=function(c,h){i&&h.name==="__proto__"?i(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},s=function(c,h){if(h==="__proto__")if(t.call(c,h)){if(l)return l(c,h).value}else return;return c[h]};n.exports=function f(){var c,h,p,x,k,C,d=arguments[0],v=1,b=arguments.length,A=!1;for(typeof d=="boolean"&&(A=d,d=arguments[1]||{},v=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});v<b;++v)if(c=arguments[v],c!=null)for(h in c)p=s(d,h),x=s(c,h),d!==x&&(A&&x&&(a(x)||(k=o(x)))?(k?(k=!1,C=p&&o(p)?p:[]):C=p&&a(p)?p:{},u(d,{name:h,newValue:f(A,C,x)})):typeof x<"u"&&u(d,{name:h,newValue:x}));return d}}));function Ft(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ya(){const e=[],n={run:t,use:r};return n;function t(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(u,...s){const f=e[++l];let c=-1;if(u){o(u);return}for(;++c<i.length;)(s[c]===null||s[c]===void 0)&&(s[c]=i[c]);i=s,f?Ja(f,a)(...s):o(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function Ja(e,n){let t;return r;function r(...o){const a=e.length>o.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(s){const f=s;if(a&&t)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}var ce={basename:Ka,dirname:Qa,extname:Ga,join:Za,sep:"/"};function Ka(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ge(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function Qa(e){if(Ge(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Ga(e){Ge(e);let n=e.length,t=-1,r=0,i=-1,l=0,o;for(;n--;){const a=e.codePointAt(n);if(a===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Za(...e){let n=-1,t;for(;++n<e.length;)Ge(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":eu(t)}function eu(e){Ge(e);const n=e.codePointAt(0)===47;let t=tu(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function tu(e,n){let t="",r=0,i=-1,l=0,o=-1,a,u;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=o,l=0;continue}}else if(t.length>0){t="",r=0,i=o,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,o):t=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return t}function Ge(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var nu={cwd:ru};function ru(){return"/"}function Mt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function iu(e){if(typeof e=="string")e=new URL(e);else if(!Mt(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return lu(e)}function lu(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}var gt=["history","path","basename","stem","extname","dirname"],vr=class{constructor(e){let n;e?Mt(e)?n={path:e}:typeof e=="string"||ou(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":nu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let t=-1;for(;++t<gt.length;){const i=gt[t];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let r;for(r in n)gt.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?ce.basename(this.path):void 0}set basename(e){xt(e,"basename"),dt(e,"basename"),this.path=ce.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ce.dirname(this.path):void 0}set dirname(e){Ln(this.basename,"dirname"),this.path=ce.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ce.extname(this.path):void 0}set extname(e){if(dt(e,"extname"),Ln(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ce.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Mt(e)&&(e=iu(e)),xt(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ce.basename(this.path,this.extname):void 0}set stem(e){xt(e,"stem"),dt(e,"stem"),this.path=ce.join(this.dirname||"",e+(this.extname||""))}fail(e,n,t){const r=this.message(e,n,t);throw r.fatal=!0,r}info(e,n,t){const r=this.message(e,n,t);return r.fatal=void 0,r}message(e,n,t){const r=new ee(e,n,t);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}};function dt(e,n){if(e&&e.includes(ce.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ce.sep+"`")}function xt(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Ln(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function ou(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var au=(function(e){const n=this.constructor.prototype,t=n[e],r=function(){return t.apply(r,arguments)};return Object.setPrototypeOf(r,n),r}),yt=fe.__toESM(Xa(),1),uu={}.hasOwnProperty,su=class Sr extends au{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=Ya()}copy(){const n=new Sr;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data((0,yt.default)(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(wt("data",this.frozen),this.namespace[n]=t,this):uu.call(this.namespace,n)&&this.namespace[n]||void 0:n?(wt("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=tt(n),r=this.parser||this.Parser;return kt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),kt("process",this.parser||this.Parser),bt("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(l,o){const a=tt(n),u=r.parse(a);r.run(u,a,function(f,c,h){if(f||!c||!h)return s(f);const p=c,x=r.stringify(p,h);pu(x)?h.value=x:h.result=x,s(f,h)});function s(f,c){f||!c?o(f):l?l(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),kt("processSync",this.parser||this.Parser),bt("processSync",this.compiler||this.Compiler),this.process(n,i),Dn("processSync","process",t),r;function i(l,o){t=!0,Pn(l),r=o}}run(n,t,r){zn(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?l(void 0,r):new Promise(l);function l(o,a){const u=tt(t);i.run(n,u,s);function s(f,c,h){const p=c||n;f?a(f):o?o(p):r(void 0,p,h)}}}runSync(n,t){let r=!1,i;return this.run(n,t,l),Dn("runSync","run",r),i;function l(o,a){Pn(o),i=a,r=!0}}stringify(n,t){this.freeze();const r=tt(t),i=this.compiler||this.Compiler;return bt("stringify",i),zn(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(wt("use",this.frozen),n!=null)if(typeof n=="function")u(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):o(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function l(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...c]=s;u(f,c)}else o(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function o(s){if(!("plugins"in s)&&!("settings"in s))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");a(s.plugins),s.settings&&(i.settings=(0,yt.default)(!0,i.settings,s.settings))}function a(s){let f=-1;if(s!=null)if(Array.isArray(s))for(;++f<s.length;){const c=s[f];l(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===s){h=c;break}if(h===-1)r.push([s,...f]);else if(f.length>0){let[p,...x]=f;const k=r[h][1];Ft(k)&&Ft(p)&&(p=(0,yt.default)(!0,k,p)),r[h]=[s,p,...x]}}}},cu=new su().freeze();function kt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wt(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zn(e){if(!Ft(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dn(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function tt(e){return fu(e)?e:new vr(e)}function fu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function pu(e){return typeof e=="string"||hu(e)}function hu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Fn=[],Mn={allowDangerousHtml:!0},mu=/^(https?|ircs?|mailto|xmpp)$/i,gu=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function du(e){const n=xu(e),t=yu(e);return ku(n.runSync(n.parse(t),t),e)}function xu(e){const n=e.rehypePlugins||Fn,t=e.remarkPlugins||Fn,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mn}:Mn;return cu().use(ea).use(t).use(Wa,r).use(n)}function yu(e){const n=e.children||"",t=new vr;return typeof n=="string"?t.value=n:""+n,t}function ku(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,u=n.urlTransform||bu;for(const f of gu)Object.hasOwn(n,f.from)&&""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+f.id;return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),Xt(e,s),_i(e,{Fragment:z.Fragment,components:i,ignoreInvalidStyle:!0,jsx:z.jsx,jsxs:z.jsxs,passKeys:!0,passNode:!0});function s(f,c,h){if(f.type==="raw"&&h&&typeof c=="number")return o?h.children.splice(c,1):h.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let p;for(p in pt)if(Object.hasOwn(pt,p)&&Object.hasOwn(f.properties,p)){const x=f.properties[p],k=pt[p];(k===null||k.includes(f.tagName))&&(f.properties[p]=u(String(x||""),p,f))}}if(f.type==="element"){let p=t?!t.includes(f.tagName):l?l.includes(f.tagName):!1;if(!p&&r&&typeof c=="number"&&(p=!r(f,c,h)),p&&h&&typeof c=="number")return a&&f.children?h.children.splice(c,1,...f.children):h.children.splice(c,1),c}}}function bu(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||mu.test(e.slice(0,n))?e:""}function Rn(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function wu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function vu(e,n,t){const r=st((t||{}).ignore||[]),i=Su(n);let l=-1;for(;++l<i.length;)wr(e,"text",o);function o(u,s){let f=-1,c;for(;++f<s.length;){const h=s[f],p=c?c.children:void 0;if(r(h,p?p.indexOf(h):void 0,c))return;c=h}if(c)return a(u,s)}function a(u,s){const f=s[s.length-1],c=i[l][0],h=i[l][1];let p=0;const x=f.children.indexOf(u);let k=!1,C=[];c.lastIndex=0;let d=c.exec(u.value);for(;d;){const v=d.index,b={index:d.index,input:d.input,stack:[...s,u]};let A=h(...d,b);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?c.lastIndex=v+1:(p!==v&&C.push({type:"text",value:u.value.slice(p,v)}),Array.isArray(A)?C.push(...A):A&&C.push(A),p=v+d[0].length,k=!0),!c.global)break;d=c.exec(u.value)}return k?(p<u.value.length&&C.push({type:"text",value:u.value.slice(p)}),f.children.splice(x,1,...C)):C=[u],x+C.length}}function Su(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<t.length;){const i=t[r];n.push([Cu(i[0]),Eu(i[1])])}return n}function Cu(e){return typeof e=="string"?new RegExp(wu(e),"g"):e}function Eu(e){return typeof e=="function"?e:function(){return e}}var vt="phrasing",St=["autolink","link","image","label"];function Iu(){return{transforms:[Fu],enter:{literalAutolink:Tu,literalAutolinkEmail:Ct,literalAutolinkHttp:Ct,literalAutolinkWww:Ct},exit:{literalAutolink:Du,literalAutolinkEmail:zu,literalAutolinkHttp:Pu,literalAutolinkWww:Lu}}}function Au(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vt,notInConstruct:St},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vt,notInConstruct:St},{character:":",before:"[ps]",after:"\\/",inConstruct:vt,notInConstruct:St}]}}function Tu(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ct(e){this.config.enter.autolinkProtocol.call(this,e)}function Pu(e){this.config.exit.autolinkProtocol.call(this,e)}function Lu(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function zu(e){this.config.exit.autolinkEmail.call(this,e)}function Du(e){this.exit(e)}function Fu(e){vu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Mu],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Ru]],{ignore:["link","linkReference"]})}function Mu(e,n,t,r,i){let l="";if(!Cr(i)||(/^w/i.test(n)&&(t=n+t,n="",l="http://"),!_u(t)))return!1;const o=Ou(t+r);if(!o[0])return!1;const a={type:"link",title:null,url:l+n+o[0],children:[{type:"text",value:n+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function Ru(e,n,t,r){return!Cr(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function _u(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function Ou(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const i=Rn(e,"(");let l=Rn(e,")");for(;r!==-1&&i>l;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),l++;return[e,t]}function Cr(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Ie(t)||at(t))&&(!n||t!==47)}Er.peek=Wu;function Nu(){this.buffer()}function Bu(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ju(){this.buffer()}function Hu(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function qu(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=se(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Uu(e){this.exit(e)}function $u(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=se(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Vu(e){this.exit(e)}function Wu(){return"["}function Er(e,n,t,r){const i=t.createTracker(r);let l=i.move("[^");const o=t.enter("footnoteReference"),a=t.enter("reference");return l+=i.move(t.safe(t.associationId(e),{after:"]",before:l})),a(),o(),l+=i.move("]"),l}function Xu(){return{enter:{gfmFootnoteCallString:Nu,gfmFootnoteCall:Bu,gfmFootnoteDefinitionLabelString:ju,gfmFootnoteDefinition:Hu},exit:{gfmFootnoteCallString:qu,gfmFootnoteCall:Uu,gfmFootnoteDefinitionLabelString:$u,gfmFootnoteDefinition:Vu}}}function Yu(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Er},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,l,o){const a=l.createTracker(o);let u=a.move("[^");const s=l.enter("footnoteDefinition"),f=l.enter("label");return u+=a.move(l.safe(l.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((n?`
15
- `:" ")+l.indentLines(l.containerFlow(r,a.current()),n?Ir:Ju))),s(),u}}function Ju(e,n,t){return n===0?e:Ir(e,n,t)}function Ir(e,n,t){return(t?"":" ")+e}var Ku=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ar.peek=ts;function Qu(){return{canContainEols:["delete"],enter:{strikethrough:Zu},exit:{strikethrough:es}}}function Gu(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ku}],handlers:{delete:Ar}}}function Zu(e){this.enter({type:"delete",children:[]},e)}function es(e){this.exit(e)}function Ar(e,n,t,r){const i=t.createTracker(r),l=t.enter("strikethrough");let o=i.move("~~");return o+=t.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function ts(){return"~"}function ns(e){return e.length}function rs(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||ns,l=[],o=[],a=[],u=[];let s=0,f=-1;for(;++f<e.length;){const k=[],C=[];let d=-1;for(e[f].length>s&&(s=e[f].length);++d<e[f].length;){const v=is(e[f][d]);if(t.alignDelimiters!==!1){const b=i(v);C[d]=b,(u[d]===void 0||b>u[d])&&(u[d]=b)}k.push(v)}o[f]=k,a[f]=C}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<s;)l[c]=_n(r[c]);else{const k=_n(r);for(;++c<s;)l[c]=k}c=-1;const h=[],p=[];for(;++c<s;){const k=l[c];let C="",d="";k===99?(C=":",d=":"):k===108?C=":":k===114&&(d=":");let v=t.alignDelimiters===!1?1:Math.max(1,u[c]-C.length-d.length);const b=C+"-".repeat(v)+d;t.alignDelimiters!==!1&&(v=C.length+v+d.length,v>u[c]&&(u[c]=v),p[c]=v),h[c]=b}o.splice(1,0,h),a.splice(1,0,p),f=-1;const x=[];for(;++f<o.length;){const k=o[f],C=a[f];c=-1;const d=[];for(;++c<s;){const v=k[c]||"";let b="",A="";if(t.alignDelimiters!==!1){const P=u[c]-(C[c]||0),S=l[c];S===114?b=" ".repeat(P):S===99?P%2?(b=" ".repeat(P/2+.5),A=" ".repeat(P/2-.5)):(b=" ".repeat(P/2),A=b):A=" ".repeat(P)}t.delimiterStart!==!1&&!c&&d.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||c)&&d.push(" "),t.alignDelimiters!==!1&&d.push(b),d.push(v),t.alignDelimiters!==!1&&d.push(A),t.padding!==!1&&d.push(" "),(t.delimiterEnd!==!1||c!==s-1)&&d.push("|")}x.push(t.delimiterEnd===!1?d.join("").replace(/ +$/,""):d.join(""))}return x.join(`
16
- `)}function is(e){return e==null?"":String(e)}function _n(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function ls(e,n,t,r){const i=t.enter("blockquote"),l=t.createTracker(r);l.move("> "),l.shift(2);const o=t.indentLines(t.containerFlow(e,l.current()),os);return i(),o}function os(e,n,t){return">"+(t?"":" ")+e}function as(e,n){return On(e,n.inConstruct,!0)&&!On(e,n.notInConstruct,!1)}function On(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function Nn(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
17
- `&&as(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
18
- `}function us(e,n){const t=String(e);let r=t.indexOf(n),i=r,l=0,o=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>o&&(o=l):l=1,i=r+n.length,r=t.indexOf(n,i);return o}function ss(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function cs(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function fs(e,n,t,r){const i=cs(t),l=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(ss(e,t)){const c=t.enter("codeIndented"),h=t.indentLines(l,ps);return c(),h}const a=t.createTracker(r),u=i.repeat(Math.max(us(l,i)+1,3)),s=t.enter("codeFenced");let f=a.move(u);if(e.lang){const c=t.enter(`codeFencedLang${o}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${o}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
19
- `,encode:["`"],...a.current()})),c()}return f+=a.move(`
20
- `),l&&(f+=a.move(l+`
21
- `)),f+=a.move(u),s(),f}function ps(e,n,t){return(t?"":" ")+e}function Yt(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function hs(e,n,t,r){const i=Yt(t),l=i==='"'?"Quote":"Apostrophe",o=t.enter("definition");let a=t.enter("label");const u=t.createTracker(r);let s=u.move("[");return s+=u.move(t.safe(t.associationId(e),{before:s,after:"]",...u.current()})),s+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(t.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=t.enter("destinationRaw"),s+=u.move(t.safe(e.url,{before:s,after:e.title?" ":`
22
- `,...u.current()}))),a(),e.title&&(a=t.enter(`title${l}`),s+=u.move(" "+i),s+=u.move(t.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),o(),s}function ms(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function Xe(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ot(e,n,t){const r=_e(e),i=_e(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Tr.peek=gs;function Tr(e,n,t,r){const i=ms(t),l=t.enter("emphasis"),o=t.createTracker(r),a=o.move(i);let u=o.move(t.containerPhrasing(e,{after:i,before:a,...o.current()}));const s=u.charCodeAt(0),f=ot(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=Xe(s)+u.slice(1));const c=u.charCodeAt(u.length-1),h=ot(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Xe(c));const p=o.move(i);return l(),t.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+u+p}function gs(e,n,t){return t.options.emphasis||"*"}function ds(e,n){let t=!1;return Xt(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,!1}),!!((!e.depth||e.depth<3)&&$t(e)&&(n.options.setext||t))}function xs(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),l=t.createTracker(r);if(ds(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),h=t.containerPhrasing(e,{...l.current(),before:`
23
- `,after:`
24
- `});return c(),f(),h+`
25
- `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
26
- `))+1))}const o="#".repeat(i),a=t.enter("headingAtx"),u=t.enter("phrasing");l.move(o+" ");let s=t.containerPhrasing(e,{before:"# ",after:`
27
- `,...l.current()});return/^[\t ]/.test(s)&&(s=Xe(s.charCodeAt(0))+s.slice(1)),s=s?o+" "+s:o,t.options.closeAtx&&(s+=" "+o),u(),a(),s}Pr.peek=ys;function Pr(e){return e.value||""}function ys(){return"<"}Lr.peek=ks;function Lr(e,n,t,r){const i=Yt(t),l=i==='"'?"Quote":"Apostrophe",o=t.enter("image");let a=t.enter("label");const u=t.createTracker(r);let s=u.move("![");return s+=u.move(t.safe(e.alt,{before:s,after:"]",...u.current()})),s+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(t.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=t.enter("destinationRaw"),s+=u.move(t.safe(e.url,{before:s,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=t.enter(`title${l}`),s+=u.move(" "+i),s+=u.move(t.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),s+=u.move(")"),o(),s}function ks(){return"!"}zr.peek=bs;function zr(e,n,t,r){const i=e.referenceType,l=t.enter("imageReference");let o=t.enter("label");const a=t.createTracker(r);let u=a.move("![");const s=t.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),o();const f=t.stack;t.stack=[],o=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return o(),t.stack=f,l(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function bs(){return"!"}Dr.peek=ws;function Dr(e,n,t){let r=e.value||"",i="`",l=-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+" ");++l<t.unsafe.length;){const o=t.unsafe[l],a=t.compilePattern(o);let u;if(o.atBreak)for(;u=a.exec(r);){let s=u.index;r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13&&s--,r=r.slice(0,s)+" "+r.slice(u.index+1)}}return i+r+i}function ws(){return"`"}function Fr(e,n){const t=$t(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Mr.peek=vs;function Mr(e,n,t,r){const i=Yt(t),l=i==='"'?"Quote":"Apostrophe",o=t.createTracker(r);let a,u;if(Fr(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=o.move("<");return c+=o.move(t.containerPhrasing(e,{before:c,after:">",...o.current()})),c+=o.move(">"),a(),t.stack=f,c}a=t.enter("link"),u=t.enter("label");let s=o.move("[");return s+=o.move(t.containerPhrasing(e,{before:s,after:"](",...o.current()})),s+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=t.enter("destinationLiteral"),s+=o.move("<"),s+=o.move(t.safe(e.url,{before:s,after:">",...o.current()})),s+=o.move(">")):(u=t.enter("destinationRaw"),s+=o.move(t.safe(e.url,{before:s,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=t.enter(`title${l}`),s+=o.move(" "+i),s+=o.move(t.safe(e.title,{before:s,after:i,...o.current()})),s+=o.move(i),u()),s+=o.move(")"),a(),s}function vs(e,n,t){return Fr(e,t)?"<":"["}Rr.peek=Ss;function Rr(e,n,t,r){const i=e.referenceType,l=t.enter("linkReference");let o=t.enter("label");const a=t.createTracker(r);let u=a.move("[");const s=t.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),o();const f=t.stack;t.stack=[],o=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return o(),t.stack=f,l(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Ss(){return"["}function Jt(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Cs(e){const n=Jt(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Es(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function _r(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Is(e,n,t,r){const i=t.enter("list"),l=t.bulletCurrent;let o=e.ordered?Es(t):Jt(t);const a=e.ordered?o==="."?")":".":Cs(t);let u=n&&t.bulletLastUsed?o===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(u=!0),_r(t)===o&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(o=a),t.bulletCurrent=o;const s=t.containerFlow(e,r);return t.bulletLastUsed=o,t.bulletCurrent=l,i(),s}function As(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function Ts(e,n,t,r){const i=As(t);let l=t.bulletCurrent||Jt(t);n&&n.type==="list"&&n.ordered&&(l=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+l);let o=l.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=t.createTracker(r);a.move(l+" ".repeat(o-l.length)),a.shift(o);const u=t.enter("listItem"),s=t.indentLines(t.containerFlow(e,a.current()),f);return u(),s;function f(c,h,p){return h?(p?"":" ".repeat(o))+c:(p?l:l+" ".repeat(o-l.length))+c}}function Ps(e,n,t,r){const i=t.enter("paragraph"),l=t.enter("phrasing"),o=t.containerPhrasing(e,r);return l(),i(),o}var Ls=st(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zs(e,n,t,r){return(e.children.some(function(i){return Ls(i)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Ds(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Or.peek=Fs;function Or(e,n,t,r){const i=Ds(t),l=t.enter("strong"),o=t.createTracker(r),a=o.move(i+i);let u=o.move(t.containerPhrasing(e,{after:i,before:a,...o.current()}));const s=u.charCodeAt(0),f=ot(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=Xe(s)+u.slice(1));const c=u.charCodeAt(u.length-1),h=ot(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Xe(c));const p=o.move(i+i);return l(),t.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+u+p}function Fs(e,n,t){return t.options.strong||"*"}function Ms(e,n,t,r){return t.safe(e.value,r)}function Rs(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function _s(e,n,t){const r=(_r(t)+(t.options.ruleSpaces?" ":"")).repeat(Rs(t));return t.options.ruleSpaces?r.slice(0,-1):r}var Nr={blockquote:ls,break:Nn,code:fs,definition:hs,emphasis:Tr,hardBreak:Nn,heading:xs,html:Pr,image:Lr,imageReference:zr,inlineCode:Dr,link:Mr,linkReference:Rr,list:Is,listItem:Ts,paragraph:Ps,root:zs,strong:Or,text:Ms,thematicBreak:_s};function Os(){return{enter:{table:Ns,tableData:Bn,tableHeader:Bn,tableRow:js},exit:{codeText:Hs,table:Bs,tableData:Et,tableHeader:Et,tableRow:Et}}}function Ns(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Bs(e){this.exit(e),this.data.inTable=void 0}function js(e){this.enter({type:"tableRow",children:[]},e)}function Et(e){this.exit(e)}function Bn(e){this.enter({type:"tableCell",children:[]},e)}function Hs(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,qs));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function qs(e,n){return n==="|"?n:e}function Us(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,l=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
28
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:u,tableRow:a}};function o(p,x,k,C){return s(f(p,k,C),p.align)}function a(p,x,k,C){const d=s([c(p,k,C)]);return d.slice(0,d.indexOf(`
29
- `))}function u(p,x,k,C){const d=k.enter("tableCell"),v=k.enter("phrasing"),b=k.containerPhrasing(p,{...C,before:l,after:l});return v(),d(),b}function s(p,x){return rs(p,{align:x,alignDelimiters:r,padding:t,stringLength:i})}function f(p,x,k){const C=p.children;let d=-1;const v=[],b=x.enter("table");for(;++d<C.length;)v[d]=c(C[d],x,k);return b(),v}function c(p,x,k){const C=p.children;let d=-1;const v=[],b=x.enter("tableRow");for(;++d<C.length;)v[d]=u(C[d],p,x,k);return b(),v}function h(p,x,k){let C=Nr.inlineCode(p,x,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function $s(){return{exit:{taskListCheckValueChecked:jn,taskListCheckValueUnchecked:jn,paragraph:Ws}}}function Vs(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Xs}}}function jn(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Ws(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let l=-1,o;for(;++l<i.length;){const a=i[l];if(a.type==="paragraph"){o=a;break}}o===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Xs(e,n,t,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);l&&a.move(o);let u=Nr.listItem(e,n,t,{...r,...a.current()});return l&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),u;function s(f){return f+o}}function Ys(){return[Iu(),Xu(),Qu(),Os(),$s()]}function Js(e){return{extensions:[Au(),Yu(e),Gu(),Us(e),Vs()]}}var Ks={tokenize:nc,partial:!0},Br={tokenize:rc,partial:!0},jr={tokenize:ic,partial:!0},Hr={tokenize:lc,partial:!0},Qs={tokenize:oc,partial:!0},qr={name:"wwwAutolink",tokenize:ec,previous:$r},Ur={name:"protocolAutolink",tokenize:tc,previous:Vr},xe={name:"emailAutolink",tokenize:Zs,previous:Wr},pe={};function Gs(){return{text:pe}}var Ee=48;for(;Ee<123;)pe[Ee]=xe,Ee++,Ee===58?Ee=65:Ee===91&&(Ee=97);pe[43]=xe;pe[45]=xe;pe[46]=xe;pe[95]=xe;pe[72]=[xe,Ur];pe[104]=[xe,Ur];pe[87]=[xe,qr];pe[119]=[xe,qr];function Zs(e,n,t){const r=this;let i,l;return o;function o(c){return!Rt(c)||!Wr.call(r,r.previous)||Kt(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Rt(c)?(e.consume(c),a):c===64?(e.consume(c),u):t(c)}function u(c){return c===46?e.check(Qs,f,s)(c):c===45||c===95||Z(c)?(l=!0,e.consume(c),u):f(c)}function s(c){return e.consume(c),i=!0,u}function f(c){return l&&i&&te(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function ec(e,n,t){const r=this;return i;function i(o){return o!==87&&o!==119||!$r.call(r,r.previous)||Kt(r.events)?t(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Ks,e.attempt(Br,e.attempt(jr,l),t),t)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(o)}}function tc(e,n,t){const r=this;let i="",l=!1;return o;function o(c){return(c===72||c===104)&&Vr.call(r,r.previous)&&!Kt(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(te(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),u}return t(c)}function u(c){return c===47?(e.consume(c),l?s:(l=!0,u)):t(c)}function s(c){return c===null||it(c)||V(c)||Ie(c)||at(c)?t(c):e.attempt(Br,e.attempt(jr,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function nc(e,n,t){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),l):t(o)}function l(o){return o===null?t(o):n(o)}}function rc(e,n,t){let r,i,l;return o;function o(s){return s===46||s===95?e.check(Hr,u,a)(s):s===null||V(s)||Ie(s)||s!==45&&at(s)?u(s):(l=!0,e.consume(s),o)}function a(s){return s===95?r=!0:(i=r,r=void 0),e.consume(s),o}function u(s){return i||r||!l?t(s):n(s)}}function ic(e,n){let t=0,r=0;return i;function i(o){return o===40?(t++,e.consume(o),i):o===41&&r<t?l(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(Hr,n,l)(o):o===null||V(o)||Ie(o)?n(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function lc(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),l):a===93?(e.consume(a),i):a===60||a===null||V(a)||Ie(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||V(a)||Ie(a)?n(a):r(a)}function l(a){return te(a)?o(a):t(a)}function o(a){return a===59?(e.consume(a),r):te(a)?(e.consume(a),o):t(a)}}function oc(e,n,t){return r;function r(l){return e.consume(l),i}function i(l){return Z(l)?t(l):n(l)}}function $r(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||V(e)}function Vr(e){return!te(e)}function Wr(e){return!(e===47||Rt(e))}function Rt(e){return e===43||e===45||e===46||e===95||Z(e)}function Kt(e){let n=e.length,t=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}var ac={tokenize:gc,partial:!0};function uc(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pc,continuation:{tokenize:hc},exit:mc}},text:{91:{name:"gfmFootnoteCall",tokenize:fc},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:sc,resolveTo:cc}}}}function sc(e,n,t){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!o||!o._balanced)return t(u);const s=se(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!l.includes(s.slice(1))?t(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function cc(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",l,n],["enter",o,n],["exit",o,n],["exit",l,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function fc(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(c){if(l>999||c===93&&!o||c===null||c===91||V(c))return t(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(se(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return V(c)||(o=!0),l++,e.consume(c),c===92?f:s}function f(c){return c===91||c===92||c===93?(e.consume(c),l++,s):s(c)}}function pc(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,a;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(x)}function f(x){if(o>999||x===93&&!a||x===null||x===91||V(x))return t(x);if(x===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return l=se(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return V(x)||(a=!0),o++,e.consume(x),x===92?c:f}function c(x){return x===91||x===92||x===93?(e.consume(x),o++,f):f(x)}function h(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(l)||i.push(l),q(e,p,"gfmFootnoteDefinitionWhitespace")):t(x)}function p(x){return n(x)}}function hc(e,n,t){return e.check(Qe,n,e.attempt(ac,n,t))}function mc(e){e.exit("gfmFootnoteDefinition")}function gc(e,n,t){const r=this;return q(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?n(l):t(l)}}function dc(e){let n=(e||{}).singleTilde;const t={name:"strikethrough",tokenize:i,resolveAll:r};return n==null&&(n=!0),{text:{126:t},insideSpan:{null:[t]},attentionMarkers:{null:[126]}};function r(l,o){let a=-1;for(;++a<l.length;)if(l[a][0]==="enter"&&l[a][1].type==="strikethroughSequenceTemporary"&&l[a][1]._close){let u=a;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[a][1].end.offset-l[a][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[a][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const s={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[a][1].end)},f={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[a][1].start)},c=[["enter",s,o],["enter",l[u][1],o],["exit",l[u][1],o],["enter",f,o]],h=o.parser.constructs.insideSpan.null;h&&oe(c,c.length,0,ut(h,l.slice(u+1,a),o)),oe(c,c.length,0,[["exit",f,o],["enter",l[a][1],o],["exit",l[a][1],o],["exit",s,o]]),oe(l,u-1,a-u+3,c),a=u+c.length-2;break}}for(a=-1;++a<l.length;)l[a][1].type==="strikethroughSequenceTemporary"&&(l[a][1].type="data");return l}function i(l,o,a){const u=this.previous,s=this.events;let f=0;return c;function c(p){return u===126&&s[s.length-1][1].type!=="characterEscape"?a(p):(l.enter("strikethroughSequenceTemporary"),h(p))}function h(p){const x=_e(u);if(p===126)return f>1?a(p):(l.consume(p),f++,h);if(f<2&&!n)return a(p);const k=l.exit("strikethroughSequenceTemporary"),C=_e(p);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,o(p)}}}var xc=class{constructor(){this.map=[]}add(e,n,t){yc(this,e,n,t)}consume(e){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const t=[];for(;n>0;)n-=1,t.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];t.push(e.slice()),e.length=0;let r=t.pop();for(;r;){for(const i of r)e.push(i);r=t.pop()}this.map.length=0}};function yc(e,n,t,r){let i=0;if(!(t===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===n){e.map[i][1]+=t,e.map[i][2].push(...r);return}i+=1}e.map.push([n,t,r])}}function kc(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function bc(){return{flow:{null:{name:"table",tokenize:wc,resolveAll:vc}}}}function wc(e,n,t){const r=this;let i=0,l=0,o;return a;function a(y){let T=r.events.length-1;for(;T>-1;){const X=r.events[T][1].type;if(X==="lineEnding"||X==="linePrefix")T--;else break}const L=T>-1?r.events[T][1].type:null,$=L==="tableHead"||L==="tableRow"?S:u;return $===S&&r.parser.lazy[r.now().line]?t(y):$(y)}function u(y){return e.enter("tableHead"),e.enter("tableRow"),s(y)}function s(y){return y===124||(o=!0,l+=1),f(y)}function f(y){return y===null?t(y):R(y)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):t(y):j(y)?q(e,f,"whitespace")(y):(l+=1,o&&(o=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),o=!0,f):(e.enter("data"),c(y)))}function c(y){return y===null||y===124||V(y)?(e.exit("data"),f(y)):(e.consume(y),y===92?h:c)}function h(y){return y===92||y===124?(e.consume(y),c):c(y)}function p(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(y):(e.enter("tableDelimiterRow"),o=!1,j(y)?q(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):x(y))}function x(y){return y===45||y===58?C(y):y===124?(o=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),k):P(y)}function k(y){return j(y)?q(e,C,"whitespace")(y):C(y)}function C(y){return y===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),d):y===45?(l+=1,d(y)):y===null||R(y)?A(y):P(y)}function d(y){return y===45?(e.enter("tableDelimiterFiller"),v(y)):P(y)}function v(y){return y===45?(e.consume(y),v):y===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(y))}function b(y){return j(y)?q(e,A,"whitespace")(y):A(y)}function A(y){return y===124?x(y):y===null||R(y)?!o||i!==l?P(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(y)):P(y)}function P(y){return t(y)}function S(y){return e.enter("tableRow"),B(y)}function B(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),B):y===null||R(y)?(e.exit("tableRow"),n(y)):j(y)?q(e,B,"whitespace")(y):(e.enter("data"),U(y))}function U(y){return y===null||y===124||V(y)?(e.exit("data"),B(y)):(e.consume(y),y===92?F:U)}function F(y){return y===92||y===124?(e.consume(y),U):U(y)}}function vc(e,n){let t=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],a=!1,u=0,s,f,c;const h=new xc;for(;++t<e.length;){const p=e[t],x=p[1];p[0]==="enter"?x.type==="tableHead"?(a=!1,u!==0&&(Hn(h,n,u,s,f),f=void 0,u=0),s={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},h.add(t,0,[["enter",s,n]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,c=void 0,l=[0,0,0,0],o=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},h.add(t,0,[["enter",f,n]])),i=x.type==="tableDelimiterRow"?2:f?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],c=nt(h,n,l,i,void 0,c),l=[0,0,0,0]),o[2]=t)):x.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],c=nt(h,n,l,i,void 0,c)),l=o,o=[l[1],t,0,0])):x.type==="tableHead"?(a=!0,u=t):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=t,l[1]!==0?(o[0]=o[1],c=nt(h,n,l,i,t,c)):o[1]!==0&&(c=nt(h,n,o,i,t,c)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(o[3]=t)}for(u!==0&&Hn(h,n,u,s,f),h.consume(n.events),t=-1;++t<n.events.length;){const p=n.events[t];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=kc(n.events,t))}return e}function nt(e,n,t,r,i,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(l.end=Object.assign({},Me(n.events,t[0])),e.add(t[0],0,[["exit",l,n]]));const u=Me(n.events,t[1]);if(l={type:o,start:Object.assign({},u),end:Object.assign({},u)},e.add(t[1],0,[["enter",l,n]]),t[2]!==0){const s=Me(n.events,t[2]),f=Me(n.events,t[3]),c={type:a,start:Object.assign({},s),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const h=n.events[t[2]],p=n.events[t[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",t[3]>t[2]+1){const x=t[2]+1,k=t[3]-t[2]-1;e.add(x,k,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(l.end=Object.assign({},Me(n.events,i)),e.add(i,0,[["exit",l,n]]),l=void 0),l}function Hn(e,n,t,r,i){const l=[],o=Me(n.events,t);i&&(i.end=Object.assign({},o),l.push(["exit",i,n])),r.end=Object.assign({},o),l.push(["exit",r,n]),e.add(t+1,0,l)}function Me(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}var Sc={name:"tasklistCheck",tokenize:Ec};function Cc(){return{text:{91:Sc}}}function Ec(e,n,t){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return V(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):t(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(u)}function a(u){return R(u)?n(u):j(u)?e.check({tokenize:Ic},n,t)(u):t(u)}}function Ic(e,n,t){return q(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function Ac(e){return lr([Gs(),uc(),dc(e),bc(),Cc()])}var Tc={};function Pc(e){const n=this,t=e||Tc,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ac(t)),l.push(Ys()),o.push(Js(t))}var Lc=({href:e,children:n,...t})=>(0,z.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"#1b5fc4",textDecoration:"underline"},...t,children:n}),zc=({children:e,...n})=>(0,z.jsx)("p",{style:{margin:"0 0 8px 0",lineHeight:"1.6"},...n,children:e}),Fe=(e,n)=>{const t=({children:r,...i})=>D.default.createElement(`h${e}`,{style:{margin:"16px 0 8px 0",fontSize:n,fontWeight:600,lineHeight:"1.3"},...i},r);return t.displayName=`MarkdownHeading${e}`,t},Dc=({children:e,...n})=>(0,z.jsx)("ul",{style:{margin:"0 0 8px 0",paddingLeft:"20px",listStyleType:"disc",listStylePosition:"outside"},...n,children:e}),Fc=({children:e,...n})=>(0,z.jsx)("ol",{style:{margin:"0 0 8px 0",paddingLeft:"20px",listStyleType:"decimal",listStylePosition:"outside"},...n,children:e}),Mc=({children:e,...n})=>(0,z.jsx)("li",{style:{display:"list-item",margin:"2px 0",lineHeight:"1.6"},...n,children:e}),Rc=({className:e,children:n,...t})=>e!==void 0||String(n).includes(`
30
- `)?(0,z.jsx)("code",{style:{display:"block",background:"#f5f5f5",padding:"8px 12px",borderRadius:"6px",fontSize:"13px",overflowX:"auto",fontFamily:'"IBM Plex Mono", monospace'},...t,children:n}):(0,z.jsx)("code",{style:{background:"#f0f2f5",padding:"2px 5px",borderRadius:"4px",fontSize:"13px",fontFamily:'"IBM Plex Mono", monospace'},...t,children:n}),_c=({children:e,...n})=>(0,z.jsx)("pre",{style:{margin:"0 0 8px 0"},...n,children:e}),Oc=({children:e,...n})=>(0,z.jsx)("blockquote",{style:{borderLeft:"4px solid #dee3e8",paddingLeft:"12px",margin:"0 0 8px 0",fontStyle:"italic",color:"#6b6d6f"},...n,children:e}),Nc=({children:e,...n})=>(0,z.jsx)("div",{style:{overflowX:"auto",margin:"0 0 8px 0"},children:(0,z.jsx)("table",{style:{borderCollapse:"collapse",width:"100%",fontSize:"13px"},...n,children:e})}),Bc=({children:e,...n})=>(0,z.jsx)("th",{style:{border:"1px solid #dee3e8",padding:"6px 10px",textAlign:"left",backgroundColor:"#f5f7fa",fontWeight:600},...n,children:e}),jc=({children:e,...n})=>(0,z.jsx)("td",{style:{border:"1px solid #dee3e8",padding:"6px 10px"},...n,children:e}),Hc=({alt:e,...n})=>(0,z.jsx)("img",{alt:e??"",style:{maxWidth:"100%",borderRadius:"8px",margin:"4px 0"},...n}),qc=e=>(0,z.jsx)("hr",{style:{border:"none",borderTop:"1px solid #dee3e8",margin:"12px 0"},...e}),Uc={a:Lc,p:zc,h1:Fe(1,"20px"),h2:Fe(2,"18px"),h3:Fe(3,"16px"),h4:Fe(4,"15px"),h5:Fe(5,"14px"),h6:Fe(6,"13px"),ul:Dc,ol:Fc,li:Mc,code:Rc,pre:_c,blockquote:Oc,table:Nc,th:Bc,td:jc,img:Hc,hr:qc},$c=[Pc],Xr=({content:e})=>(0,z.jsx)(du,{remarkPlugins:$c,components:Uc,children:e}),Vc=({source:e,index:n})=>{const t=(0,z.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",minWidth:0},children:[(0,z.jsx)("div",{style:{flexShrink:0,width:"18px",height:"18px",borderRadius:"3px",border:"1px solid #1b5fc4",color:"#1b5fc4",fontSize:"11px",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f0f4ff"},children:n+1}),(0,z.jsx)("div",{style:{fontSize:"12px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#30373e"},title:e.title,children:e.title})]}),r={display:"flex",alignItems:"center",padding:"8px 10px",border:"1px solid #dee3e8",borderRadius:"8px",backgroundColor:"#fff",cursor:e.url?"pointer":"default",textDecoration:"none",color:"inherit",minWidth:0,transition:"border-color 0.15s"};return e.url?(0,z.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:r,onMouseEnter:i=>{i.currentTarget.style.borderColor="#1b5fc4"},onMouseLeave:i=>{i.currentTarget.style.borderColor="#dee3e8"},children:t}):(0,z.jsx)("div",{style:r,children:t})},Wc=()=>(0,z.jsxs)("div",{style:{display:"flex",gap:"4px",padding:"4px 0"},children:[[0,1,2].map(e=>(0,z.jsx)("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#b5bfc8",animation:"ago-pulse 1.2s ease-in-out infinite",animationDelay:`${e*.2}s`}},e)),(0,z.jsx)("style",{children:`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./rolldown-runtime-16Nf8qvH.cjs"),J=require("./AgoClient--y10UXUV.cjs"),M=require("./createFormCollector-CSG5ioym.cjs"),V=require("./createMockClient-zHQ0cjUH.cjs");let n=require("react");n=P.__toESM(n,1);let o=require("react/jsx-runtime"),F=require("react-markdown");F=P.__toESM(F,1);let N=require("remark-gfm");N=P.__toESM(N,1);function q(e){const[t,s]=(0,n.useState)(!1),r=(0,n.useRef)(null),a=(0,n.useMemo)(()=>{if(r.current&&(r.current.destroy(),r.current=null),!e)return null;const l=new J.AgoClient(e);return r.current=l,l},[e?.baseUrl,e?.widgetId]);return(0,n.useEffect)(()=>(s(!0),()=>{r.current?.destroy(),r.current=null}),[a]),(0,n.useEffect)(()=>{r.current&&e&&r.current.updateConfig({agent:e.agent,defaultAgentId:e.defaultAgentId,permission:e.permission,userEmail:e.userEmail,userJwt:e.userJwt,debug:e.debug,warnOnEmptyReply:e.warnOnEmptyReply})},[e?.agent,e?.defaultAgentId,e?.permission,e?.userEmail,e?.userJwt,e?.debug,e?.warnOnEmptyReply]),{client:a,isReady:t}}var T=(0,n.createContext)(null),G=({children:e,client:t,tools:s,helpers:r,pageContext:a,...l})=>{const{client:u}=q(t?null:l),i=t||u;return(0,n.useEffect)(()=>{if(!(!s||s.length===0)){for(const p of s)i.register(p);return()=>{for(const p of s)i.unregisterFunction(p.name)}}},[i,s]),(0,n.useEffect)(()=>{if(!r)return;const p=[];return Promise.resolve().then(()=>require("./functions-Djnq-JAo.cjs")).then(d=>d.functions_exports).then(d=>{for(const[h,C]of Object.entries(r)){const k=d[h];if(!k){console.warn(`[AGO] Unknown helper: "${h}"`);continue}const m=C===!0?k:{...k,handler:C};i.register(m),p.push(m.name)}}),()=>{for(const d of p)i.unregisterFunction(d)}},[i,r]),(0,n.useEffect)(()=>{a==="auto"&&i.enableAutoPageContext()},[i,a]),(0,o.jsx)(T.Provider,{value:i,children:e})};function A(){const e=(0,n.useContext)(T);if(!e)throw new Error('useAgoClient must be used within an <AgoProvider>. Wrap your component tree with <AgoProvider baseUrl="...">.');return e}function R(){return(0,n.useContext)(T)}function L({client:e,conversationId:t}={}){const s=R(),r=e||s;if(!r)throw new Error("useMessages requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");const[a,l]=(0,n.useState)([]),[u,i]=(0,n.useState)(t),[p,d]=(0,n.useState)(!1),[h,C]=(0,n.useState)(null);(0,n.useEffect)(()=>{t&&t!==u&&(i(t),k(t))},[t]);const k=async m=>{try{l(await r.getMessages(m))}catch(v){C(v instanceof Error?v:new Error("Failed to load messages"))}};return(0,n.useEffect)(()=>{const m=x=>{u||i(x.conversationId)},v=x=>{l(f=>{const w=f[f.length-1];return w&&w.id===x.messageId?[...f.slice(0,-1),{...w,content:w.content+x.content}]:f})},c=x=>{l(f=>{let w=-1;for(let S=f.length-1;S>=0;S--)if(f[S].role==="assistant"&&f[S].status==="IN_PROGRESS"){w=S;break}return w<0?f:[...f.slice(0,w),{...f[w],...x},...f.slice(w+1)]})},y=x=>{l(f=>{const w=f.findIndex(S=>S.id===x.id);return w>=0?[...f.slice(0,w),x,...f.slice(w+1)]:[...f,x]}),d(!1)},g=x=>{C(new Error(x.error)),d(!1)};return r.on("message:start",m),r.on("message:chunk",v),r.on("message:answer-complete",c),r.on("message:complete",y),r.on("message:error",g),()=>{r.off("message:start",m),r.off("message:chunk",v),r.off("message:answer-complete",c),r.off("message:complete",y),r.off("message:error",g)}},[r,u]),{messages:a,isLoading:p,error:h,sendMessage:(0,n.useCallback)(async(m,v)=>{d(!0),C(null);const c={id:`temp-${Date.now()}`,conversationId:u||"",content:m,role:"user",status:"DONE",createdAt:new Date},y={id:`temp-assistant-${Date.now()}`,conversationId:u||"",content:"",role:"assistant",status:"IN_PROGRESS",createdAt:new Date};l(g=>[...g,c,y]);try{const g=await r.sendMessage(m,{conversationId:u,files:v});return g.conversationId&&!u&&i(g.conversationId),l(x=>{const f=x.filter(S=>!S.id.startsWith("temp-")),w={...c,id:c.id.replace("temp-","user-"),conversationId:g.conversationId};return f.some(S=>S.id===g.id)?[...f,w].sort((S,_)=>new Date(S.createdAt).getTime()-new Date(_.createdAt).getTime()):[...f,w,g]}),g}catch(g){return C(g instanceof Error?g:new Error("Failed to send message")),d(!1),l(x=>x.filter(f=>!f.id.startsWith("temp-"))),null}},[r,u]),clearMessages:(0,n.useCallback)(()=>{l([]),i(void 0),C(null)},[]),conversationId:u}}var W=({onSend:e,disabled:t=!1,placeholder:s="Type a message...",allowFiles:r=!1,className:a=""})=>{const[l,u]=(0,n.useState)(""),[i,p]=(0,n.useState)([]),d=(0,n.useRef)(null),h=(0,n.useCallback)(c=>{c.preventDefault(),(l.trim()||i.length>0)&&(e(l.trim(),i.length>0?i:void 0),u(""),p([]))},[l,i,e]),C=(0,n.useCallback)(c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),h(c))},[h]),k=(0,n.useCallback)(c=>{const y=Array.from(c.target.files||[]);p(g=>[...g,...y])},[]),m=(0,n.useCallback)(c=>{p(y=>y.filter((g,x)=>x!==c))},[]),v=l.trim()||i.length>0;return(0,o.jsxs)("form",{onSubmit:h,className:`ago-chat-input ${a}`,style:{display:"flex",flexDirection:"column",gap:"8px",padding:"12px 16px",borderTop:"1px solid #dee3e8",backgroundColor:"#fff"},children:[i.length>0&&(0,o.jsx)("div",{className:"ago-chat-input__files",style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:i.map((c,y)=>(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"4px 10px",backgroundColor:"#f0f2f5",borderRadius:"6px",fontSize:"12px",color:"#30373e"},children:[(0,o.jsx)("span",{style:{maxWidth:"120px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.name}),(0,o.jsx)("button",{type:"button",onClick:()=>m(y),style:{border:"none",background:"none",cursor:"pointer",padding:"0",color:"#6b6d6f",fontSize:"14px",lineHeight:1},children:"×"})]},y))}),(0,o.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"flex-end"},children:[r&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{type:"button",onClick:()=>d.current?.click(),disabled:t,style:{padding:"8px",border:"1px solid #dee3e8",borderRadius:"8px",backgroundColor:"#fff",cursor:t?"not-allowed":"pointer",color:"#6b6d6f",fontSize:"16px",lineHeight:1},children:"+"}),(0,o.jsx)("input",{ref:d,type:"file",multiple:!0,onChange:k,style:{display:"none"}})]}),(0,o.jsx)("textarea",{value:l,onChange:c=>u(c.target.value),onKeyDown:C,placeholder:s,disabled:t,rows:1,style:{flex:1,padding:"10px 14px",border:"1px solid #dee3e8",borderRadius:"20px",resize:"none",outline:"none",fontFamily:"inherit",fontSize:"14px",color:"#30373e",backgroundColor:"#f8f8f8",transition:"border-color 0.15s"},onFocus:c=>{c.currentTarget.style.borderColor="#1b5fc4"},onBlur:c=>{c.currentTarget.style.borderColor="#dee3e8"}}),(0,o.jsx)("button",{type:"submit",disabled:t||!v,style:{padding:"10px 18px",border:"none",borderRadius:"20px",backgroundColor:t||!v?"#b5bfc8":"#03182f",color:"#fff",cursor:t||!v?"not-allowed":"pointer",fontWeight:500,fontSize:"14px",transition:"background-color 0.15s"},children:"Send"})]})]})},X=({href:e,children:t,...s})=>(0,o.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"#1b5fc4",textDecoration:"underline"},...s,children:t}),Y=({children:e,...t})=>(0,o.jsx)("p",{style:{margin:"0 0 8px 0",lineHeight:"1.6"},...t,children:e}),I=(e,t)=>{const s=({children:r,...a})=>n.default.createElement(`h${e}`,{style:{margin:"16px 0 8px 0",fontSize:t,fontWeight:600,lineHeight:"1.3"},...a},r);return s.displayName=`MarkdownHeading${e}`,s},Q=({children:e,...t})=>(0,o.jsx)("ul",{style:{margin:"0 0 8px 0",paddingLeft:"20px",listStyleType:"disc",listStylePosition:"outside"},...t,children:e}),Z=({children:e,...t})=>(0,o.jsx)("ol",{style:{margin:"0 0 8px 0",paddingLeft:"20px",listStyleType:"decimal",listStylePosition:"outside"},...t,children:e}),ee=({children:e,...t})=>(0,o.jsx)("li",{style:{display:"list-item",margin:"2px 0",lineHeight:"1.6"},...t,children:e}),te=({className:e,children:t,...s})=>e!==void 0||String(t).includes(`
2
+ `)?(0,o.jsx)("code",{style:{display:"block",background:"#f5f5f5",padding:"8px 12px",borderRadius:"6px",fontSize:"13px",overflowX:"auto",fontFamily:'"IBM Plex Mono", monospace'},...s,children:t}):(0,o.jsx)("code",{style:{background:"#f0f2f5",padding:"2px 5px",borderRadius:"4px",fontSize:"13px",fontFamily:'"IBM Plex Mono", monospace'},...s,children:t}),re=({children:e,...t})=>(0,o.jsx)("pre",{style:{margin:"0 0 8px 0"},...t,children:e}),ne=({children:e,...t})=>(0,o.jsx)("blockquote",{style:{borderLeft:"4px solid #dee3e8",paddingLeft:"12px",margin:"0 0 8px 0",fontStyle:"italic",color:"#6b6d6f"},...t,children:e}),oe=({children:e,...t})=>(0,o.jsx)("div",{style:{overflowX:"auto",margin:"0 0 8px 0"},children:(0,o.jsx)("table",{style:{borderCollapse:"collapse",width:"100%",fontSize:"13px"},...t,children:e})}),se=({children:e,...t})=>(0,o.jsx)("th",{style:{border:"1px solid #dee3e8",padding:"6px 10px",textAlign:"left",backgroundColor:"#f5f7fa",fontWeight:600},...t,children:e}),ae=({children:e,...t})=>(0,o.jsx)("td",{style:{border:"1px solid #dee3e8",padding:"6px 10px"},...t,children:e}),le=({alt:e,...t})=>(0,o.jsx)("img",{alt:e??"",style:{maxWidth:"100%",borderRadius:"8px",margin:"4px 0"},...t}),ie=e=>(0,o.jsx)("hr",{style:{border:"none",borderTop:"1px solid #dee3e8",margin:"12px 0"},...e}),ce={a:X,p:Y,h1:I(1,"20px"),h2:I(2,"18px"),h3:I(3,"16px"),h4:I(4,"15px"),h5:I(5,"14px"),h6:I(6,"13px"),ul:Q,ol:Z,li:ee,code:te,pre:re,blockquote:ne,table:oe,th:se,td:ae,img:le,hr:ie},de=[N.default],z=({content:e})=>(0,o.jsx)(F.default,{remarkPlugins:de,components:ce,children:e}),ue=({source:e,index:t})=>{const s=(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",minWidth:0},children:[(0,o.jsx)("div",{style:{flexShrink:0,width:"18px",height:"18px",borderRadius:"3px",border:"1px solid #1b5fc4",color:"#1b5fc4",fontSize:"11px",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f0f4ff"},children:t+1}),(0,o.jsx)("div",{style:{fontSize:"12px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#30373e"},title:e.title,children:e.title})]}),r={display:"flex",alignItems:"center",padding:"8px 10px",border:"1px solid #dee3e8",borderRadius:"8px",backgroundColor:"#fff",cursor:e.url?"pointer":"default",textDecoration:"none",color:"inherit",minWidth:0,transition:"border-color 0.15s"};return e.url?(0,o.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:r,onMouseEnter:a=>{a.currentTarget.style.borderColor="#1b5fc4"},onMouseLeave:a=>{a.currentTarget.style.borderColor="#dee3e8"},children:s}):(0,o.jsx)("div",{style:r,children:s})},fe=()=>(0,o.jsxs)("div",{style:{display:"flex",gap:"4px",padding:"4px 0"},children:[[0,1,2].map(e=>(0,o.jsx)("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#b5bfc8",animation:"ago-pulse 1.2s ease-in-out infinite",animationDelay:`${e*.2}s`}},e)),(0,o.jsx)("style",{children:`
31
3
  @keyframes ago-pulse {
32
4
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
33
5
  40% { opacity: 1; transform: scale(1); }
34
6
  }
35
- `})]}),Yr=({message:e,className:n="",showAgentName:t=!1,isLast:r=!1,onFollowUpClick:i})=>{const l=e.role==="user",o=e.status==="IN_PROGRESS";return(0,z.jsxs)("div",{className:`ago-message ago-message--${e.role} ${n}`,style:{display:"flex",flexDirection:"column",alignItems:l?"flex-end":"flex-start",marginBottom:"16px"},children:[!l&&t&&e.agent&&(0,z.jsx)("div",{className:"ago-message__agent",style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"13px",fontWeight:500,color:"#30373e",marginBottom:"6px",padding:"0 4px"},children:e.agent.displayName||e.agent.name}),!l&&e.sources&&e.sources.length>0&&(0,z.jsx)("div",{className:"ago-message__sources",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"6px",marginBottom:"10px",width:"100%",maxWidth:"85%"},children:e.sources.map((a,u)=>(0,z.jsx)(Vc,{source:a,index:u},a.id))}),(0,z.jsx)("div",{className:"ago-message__content",style:{maxWidth:l?"75%":"100%",padding:l?"10px 14px":"2px 8px",borderRadius:l?"16px":"0",backgroundColor:l?"#03182f":"transparent",color:l?"#fff":"#30373e",wordBreak:"break-word",fontSize:"14px",lineHeight:"1.6"},children:e.content?(0,z.jsx)(Xr,{content:e.content}):o&&(0,z.jsx)(Wc,{})}),r&&e.followUpReplies&&e.followUpReplies.length>0&&(0,z.jsx)("div",{className:"ago-message__followups",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"10px"},children:e.followUpReplies.map((a,u)=>(0,z.jsx)("button",{type:"button",className:"ago-message__followup-btn",disabled:!i,onClick:i?()=>i(a):void 0,style:{padding:"6px 14px",fontSize:"13px",borderRadius:"16px",border:"1px solid #dee3e8",backgroundColor:"#fff",color:"#30373e",cursor:i?"pointer":"default",transition:"border-color 0.15s"},onMouseEnter:s=>{s.currentTarget.style.borderColor="#1b5fc4"},onMouseLeave:s=>{s.currentTarget.style.borderColor="#dee3e8"},children:a},u))})]})},Xc=({client:e,conversationId:n,title:t="Chat",welcomeMessage:r="Hello! How can I help you today?",placeholder:i="Type a message...",allowFiles:l=!1,height:o=500,logoUrl:a,showAgentName:u=!1,forms:s,onFollowUpClick:f,className:c="",onMessageSent:h,onMessageReceived:p})=>{const x=(0,D.useRef)(null),k=Je(),C=e??k,{messages:d,isLoading:v,error:b,sendMessage:A}=Ot({client:e,conversationId:n});(0,D.useEffect)(()=>{if(!C||!s||s.length===0)return;let F=!1;const y=[];return Promise.all(s.map(T=>T.schema!=null?Promise.resolve(ve.createFormCollector(T)):ve.loadFormCollector(C,T))).then(T=>{if(!F)for(const L of T)y.push(L.install(C))}).catch(()=>{}),()=>{F=!0,y.forEach(T=>T())}},[C,s?JSON.stringify(s.map(F=>[F.name,F.schema??null,F.submit??!1,F.description??null])):""]),(0,D.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[d]),(0,D.useEffect)(()=>{const F=d[d.length-1];F&&F.role==="assistant"&&F.status==="DONE"&&p&&p({id:F.id,content:F.content})},[d,p]);const P=async(F,y)=>{h?.(F),await A(F,y)},S=d[d.length-1],B=v&&S?.role==="assistant"&&S.status==="IN_PROGRESS",U=f===!1?void 0:f??(F=>P(F));return(0,z.jsxs)("div",{className:`ago-chat-widget ${c}`,style:{display:"flex",flexDirection:"column",height:typeof o=="number"?`${o}px`:o,border:"1px solid #dee3e8",borderRadius:"16px",overflow:"hidden",backgroundColor:"#fff",fontFamily:'"IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',textAlign:"left",boxShadow:"rgba(15, 15, 15, 0.08) 0px 2px 16px 0px"},children:[(0,z.jsxs)("div",{className:"ago-chat-widget__header",style:{padding:"14px 16px",borderBottom:"1px solid #dee3e8",backgroundColor:"#03182f",color:"#e8f0fe",display:"flex",alignItems:"center",gap:"10px"},children:[a&&(0,z.jsx)("img",{src:a,alt:"Logo",style:{height:"24px",width:"auto"}}),(0,z.jsx)("h3",{style:{margin:0,fontSize:"15px",fontWeight:600},children:t})]}),(0,z.jsxs)("div",{className:"ago-chat-widget__messages",style:{flex:1,overflow:"auto",padding:"16px",backgroundColor:"#fbfbfb"},children:[d.length===0?(0,z.jsx)("div",{style:{textAlign:"center",color:"#6b6d6f",padding:"24px 16px",fontSize:"14px",lineHeight:"1.5"},children:r}):d.map((F,y)=>(0,z.jsx)(Yr,{message:F,showAgentName:u,isLast:y===d.length-1,onFollowUpClick:U},F.id)),b&&(0,z.jsx)("div",{style:{padding:"10px 14px",backgroundColor:"#fef2f2",color:"#dc2626",borderRadius:"12px",marginTop:"8px",fontSize:"13px",border:"1px solid #fecaca"},children:b.message}),(0,z.jsx)("div",{ref:x})]}),(0,z.jsx)($n,{onSend:P,disabled:B,placeholder:i,allowFiles:l})]})};function Jr({client:e,autoLoad:n=!0}={}){const t=Je(),r=e||t;if(!r)throw new Error("useConversation requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");const[i,l]=(0,D.useState)([]),[o,a]=(0,D.useState)(null),[u,s]=(0,D.useState)(!1),[f,c]=(0,D.useState)(null),h=(0,D.useCallback)(async()=>{s(!0),c(null);try{l(await r.getConversations())}catch(k){c(k instanceof Error?k:new Error("Failed to load conversations"))}finally{s(!1)}},[r]),p=(0,D.useCallback)(async k=>{s(!0),c(null);try{a(await r.getConversation(k))}catch(C){c(C instanceof Error?C:new Error("Failed to load conversation"))}finally{s(!1)}},[r]),x=(0,D.useCallback)(()=>{a(null)},[]);return(0,D.useEffect)(()=>{n&&h()},[n,h]),{conversations:i,currentConversation:o,isLoading:u,error:f,selectConversation:p,startNewConversation:x,refreshConversations:h}}function Yc(e={}){const n=Je(),t=e.client||n;if(!t)throw new Error("useChat requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");const r=Ot({client:t,conversationId:e.conversationId}),i=Jr({client:t,autoLoad:e.autoLoad});return{messages:r.messages,isLoading:r.isLoading,error:r.error||i.error,sendMessage:r.sendMessage,clearMessages:r.clearMessages,conversationId:r.conversationId,conversations:i.conversations,currentConversation:i.currentConversation,isConversationsLoading:i.isLoading,selectConversation:i.selectConversation,startNewConversation:i.startNewConversation,refreshConversations:i.refreshConversations}}function Jc(e,n){const t=Ye(),{name:r,description:i,parameters:l,handler:o}=typeof e=="string"?{name:e,...n}:e,a=(0,D.useRef)(o);a.current=o,(0,D.useEffect)(()=>{const u=s=>a.current(s);return t.registerFunction(r,u,{description:i,parameters:l}),()=>{t.unregisterFunction(r)}},[t,r,i,l])}function Kc(e,n){const t=Ye(),r=(0,D.useRef)(e);r.current=e,(0,D.useEffect)(()=>(t.registerNavigationFunction(i=>r.current(i),n),()=>{t.unregisterFunction("navigateToPage")}),[t,n])}function Qc(e,n){const t=Ye(),r=(0,D.useId)(),i=n??r,l=(0,D.useRef)(e);l.current=e;const o=typeof e=="function";(0,D.useEffect)(()=>{if(typeof l.current=="function"){const a=()=>l.current();return t.addDynamicContext(i,a),()=>{t.removeDynamicContext(i)}}return t.setContext(i,l.current),()=>{t.removeContext(i)}},[t,i,o,o?"":JSON.stringify(e)])}function Kr(e){return(0,D.useSyncExternalStore)(e.subscribe,e.get,e.get)}var qn={missing:[],complete:!1};function Gc(e){const n=Ye(),t=e.schema!=null,r=JSON.stringify(e.schema??null),i=e.submit,l=i?typeof i=="string"?`client:${i}`:i.via==="backend"?"backend":"handler"in i?"client:handler":`client:${i.url}`:"none",o=JSON.stringify(e.initialValues??null),a=(0,D.useMemo)(()=>t?ve.createFormCollector(e):null,[t,e.name,r,l,o]),[u,s]=(0,D.useState)({collector:null,loading:!t,error:null});(0,D.useEffect)(()=>{if(t)return;let v=!1;return s({collector:null,loading:!0,error:null}),ve.loadFormCollector(n,e).then(b=>{v||s({collector:b,loading:!1,error:null})}).catch(b=>{v||s({collector:null,loading:!1,error:b instanceof Error?b:new Error(String(b))})}),()=>{v=!0}},[n,t,e.name,l,o]);const f=t?a:u.collector,c=t?!1:u.loading,h=t?null:u.error;(0,D.useEffect)(()=>{if(f)return f.install(n)},[n,f]);const p=(0,D.useMemo)(()=>ve.createStore({values:e.initialValues??{},submitted:!1}),[o]),x=Kr(f?.store??p),k=(0,D.useMemo)(()=>f?.getStatus()??qn,[x,f]),C=(0,D.useMemo)(()=>({...x,...k}),[x,k]),d=(0,D.useMemo)(()=>({name:e.name,store:p,functions:[],contextKey:`form:${e.name}`,contextProvider:()=>({name:`Form: ${e.name}`,description:""}),install:()=>()=>{},hydrate:()=>{},submit:async()=>({ok:!1,error:"Form definition not loaded yet."}),getValues:()=>p.get().values,setValues:()=>{},reset:()=>{},getStatus:()=>qn}),[e.name,p]);return{...f??d,state:C,loading:c,error:h}}exports.AgoProvider=ui;exports.ChatInput=$n;exports.ChatWidget=Xc;exports.Markdown=Xr;exports.Message=Yr;exports.createFormCollector=ve.createFormCollector;exports.createMockClient=ai.createMockClient;exports.deriveFormStatus=ve.deriveFormStatus;exports.loadFormCollector=ve.loadFormCollector;exports.useAgo=Un;exports.useAgoClient=Ye;exports.useAgoContext=Qc;exports.useAgoFunction=Jc;exports.useAgoNavigation=Kc;exports.useAgoStore=Kr;exports.useChat=Yc;exports.useConversation=Jr;exports.useFormCollector=Gc;exports.useMessages=Ot;exports.useOptionalAgoClient=Je;
7
+ `})]}),O=({message:e,className:t="",showAgentName:s=!1,isLast:r=!1,onFollowUpClick:a})=>{const l=e.role==="user",u=e.status==="IN_PROGRESS";return(0,o.jsxs)("div",{className:`ago-message ago-message--${e.role} ${t}`,style:{display:"flex",flexDirection:"column",alignItems:l?"flex-end":"flex-start",marginBottom:"16px"},children:[!l&&s&&e.agent&&(0,o.jsx)("div",{className:"ago-message__agent",style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"13px",fontWeight:500,color:"#30373e",marginBottom:"6px",padding:"0 4px"},children:e.agent.displayName||e.agent.name}),!l&&e.sources&&e.sources.length>0&&(0,o.jsx)("div",{className:"ago-message__sources",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"6px",marginBottom:"10px",width:"100%",maxWidth:"85%"},children:e.sources.map((i,p)=>(0,o.jsx)(ue,{source:i,index:p},i.id))}),(0,o.jsx)("div",{className:"ago-message__content",style:{maxWidth:l?"75%":"100%",padding:l?"10px 14px":"2px 8px",borderRadius:l?"16px":"0",backgroundColor:l?"#03182f":"transparent",color:l?"#fff":"#30373e",wordBreak:"break-word",fontSize:"14px",lineHeight:"1.6"},children:e.content?(0,o.jsx)(z,{content:e.content}):u&&(0,o.jsx)(fe,{})}),r&&e.followUpReplies&&e.followUpReplies.length>0&&(0,o.jsx)("div",{className:"ago-message__followups",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"10px"},children:e.followUpReplies.map((i,p)=>(0,o.jsx)("button",{type:"button",className:"ago-message__followup-btn",disabled:!a,onClick:a?()=>a(i):void 0,style:{padding:"6px 14px",fontSize:"13px",borderRadius:"16px",border:"1px solid #dee3e8",backgroundColor:"#fff",color:"#30373e",cursor:a?"pointer":"default",transition:"border-color 0.15s"},onMouseEnter:d=>{d.currentTarget.style.borderColor="#1b5fc4"},onMouseLeave:d=>{d.currentTarget.style.borderColor="#dee3e8"},children:i},p))})]})},ge=({client:e,conversationId:t,title:s="Chat",welcomeMessage:r="Hello! How can I help you today?",placeholder:a="Type a message...",allowFiles:l=!1,height:u=500,logoUrl:i,showAgentName:p=!1,forms:d,onFollowUpClick:h,className:C="",onMessageSent:k,onMessageReceived:m})=>{const v=(0,n.useRef)(null),c=R(),y=e??c,{messages:g,isLoading:x,error:f,sendMessage:w}=L({client:e,conversationId:t});(0,n.useEffect)(()=>{if(!y||!d||d.length===0)return;let b=!1;const j=[];return Promise.all(d.map(E=>E.schema!=null?Promise.resolve(M.createFormCollector(E)):M.loadFormCollector(y,E))).then(E=>{if(!b)for(const U of E)j.push(U.install(y))}).catch(()=>{}),()=>{b=!0,j.forEach(E=>E())}},[y,d?JSON.stringify(d.map(b=>[b.name,b.schema??null,b.submit??!1,b.description??null])):""]),(0,n.useEffect)(()=>{v.current?.scrollIntoView({behavior:"smooth"})},[g]),(0,n.useEffect)(()=>{const b=g[g.length-1];b&&b.role==="assistant"&&b.status==="DONE"&&m&&m({id:b.id,content:b.content})},[g,m]);const S=async(b,j)=>{k?.(b),await w(b,j)},_=g[g.length-1],B=x&&_?.role==="assistant"&&_.status==="IN_PROGRESS",K=h===!1?void 0:h??(b=>S(b));return(0,o.jsxs)("div",{className:`ago-chat-widget ${C}`,style:{display:"flex",flexDirection:"column",height:typeof u=="number"?`${u}px`:u,border:"1px solid #dee3e8",borderRadius:"16px",overflow:"hidden",backgroundColor:"#fff",fontFamily:'"IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',textAlign:"left",boxShadow:"rgba(15, 15, 15, 0.08) 0px 2px 16px 0px"},children:[(0,o.jsxs)("div",{className:"ago-chat-widget__header",style:{padding:"14px 16px",borderBottom:"1px solid #dee3e8",backgroundColor:"#03182f",color:"#e8f0fe",display:"flex",alignItems:"center",gap:"10px"},children:[i&&(0,o.jsx)("img",{src:i,alt:"Logo",style:{height:"24px",width:"auto"}}),(0,o.jsx)("h3",{style:{margin:0,fontSize:"15px",fontWeight:600},children:s})]}),(0,o.jsxs)("div",{className:"ago-chat-widget__messages",style:{flex:1,overflow:"auto",padding:"16px",backgroundColor:"#fbfbfb"},children:[g.length===0?(0,o.jsx)("div",{style:{textAlign:"center",color:"#6b6d6f",padding:"24px 16px",fontSize:"14px",lineHeight:"1.5"},children:r}):g.map((b,j)=>(0,o.jsx)(O,{message:b,showAgentName:p,isLast:j===g.length-1,onFollowUpClick:K},b.id)),f&&(0,o.jsx)("div",{style:{padding:"10px 14px",backgroundColor:"#fef2f2",color:"#dc2626",borderRadius:"12px",marginTop:"8px",fontSize:"13px",border:"1px solid #fecaca"},children:f.message}),(0,o.jsx)("div",{ref:v})]}),(0,o.jsx)(W,{onSend:S,disabled:B,placeholder:a,allowFiles:l})]})};function H({client:e,autoLoad:t=!0}={}){const s=R(),r=e||s;if(!r)throw new Error("useConversation requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");const[a,l]=(0,n.useState)([]),[u,i]=(0,n.useState)(null),[p,d]=(0,n.useState)(!1),[h,C]=(0,n.useState)(null),k=(0,n.useCallback)(async()=>{d(!0),C(null);try{l(await r.getConversations())}catch(c){C(c instanceof Error?c:new Error("Failed to load conversations"))}finally{d(!1)}},[r]),m=(0,n.useCallback)(async c=>{d(!0),C(null);try{i(await r.getConversation(c))}catch(y){C(y instanceof Error?y:new Error("Failed to load conversation"))}finally{d(!1)}},[r]),v=(0,n.useCallback)(()=>{i(null)},[]);return(0,n.useEffect)(()=>{t&&k()},[t,k]),{conversations:a,currentConversation:u,isLoading:p,error:h,selectConversation:m,startNewConversation:v,refreshConversations:k}}function pe(e={}){const t=R(),s=e.client||t;if(!s)throw new Error("useChat requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");const r=L({client:s,conversationId:e.conversationId}),a=H({client:s,autoLoad:e.autoLoad});return{messages:r.messages,isLoading:r.isLoading,error:r.error||a.error,sendMessage:r.sendMessage,clearMessages:r.clearMessages,conversationId:r.conversationId,conversations:a.conversations,currentConversation:a.currentConversation,isConversationsLoading:a.isLoading,selectConversation:a.selectConversation,startNewConversation:a.startNewConversation,refreshConversations:a.refreshConversations}}function xe(e,t){const s=A(),{name:r,description:a,parameters:l,handler:u}=typeof e=="string"?{name:e,...t}:e,i=(0,n.useRef)(u);i.current=u,(0,n.useEffect)(()=>{const p=d=>i.current(d);return s.registerFunction(r,p,{description:a,parameters:l}),()=>{s.unregisterFunction(r)}},[s,r,a,l])}function me(e,t){const s=A(),r=(0,n.useRef)(e);r.current=e,(0,n.useEffect)(()=>(s.registerNavigationFunction(a=>r.current(a),t),()=>{s.unregisterFunction("navigateToPage")}),[s,t])}function he(e,t){const s=A(),r=(0,n.useId)(),a=t??r,l=(0,n.useRef)(e);l.current=e;const u=typeof e=="function";(0,n.useEffect)(()=>{if(typeof l.current=="function"){const i=()=>l.current();return s.addDynamicContext(a,i),()=>{s.removeDynamicContext(a)}}return s.setContext(a,l.current),()=>{s.removeContext(a)}},[s,a,u,u?"":JSON.stringify(e)])}function $(e){return(0,n.useSyncExternalStore)(e.subscribe,e.get,e.get)}var D={missing:[],complete:!1};function ye(e){const t=A(),s=e.schema!=null,r=JSON.stringify(e.schema??null),a=e.submit,l=a?typeof a=="string"?`client:${a}`:a.via==="backend"?"backend":"handler"in a?"client:handler":`client:${a.url}`:"none",u=JSON.stringify(e.initialValues??null),i=(0,n.useMemo)(()=>s?M.createFormCollector(e):null,[s,e.name,r,l,u]),[p,d]=(0,n.useState)({collector:null,loading:!s,error:null});(0,n.useEffect)(()=>{if(s)return;let x=!1;return d({collector:null,loading:!0,error:null}),M.loadFormCollector(t,e).then(f=>{x||d({collector:f,loading:!1,error:null})}).catch(f=>{x||d({collector:null,loading:!1,error:f instanceof Error?f:new Error(String(f))})}),()=>{x=!0}},[t,s,e.name,l,u]);const h=s?i:p.collector,C=s?!1:p.loading,k=s?null:p.error;(0,n.useEffect)(()=>{if(h)return h.install(t)},[t,h]);const m=(0,n.useMemo)(()=>M.createStore({values:e.initialValues??{},submitted:!1}),[u]),v=$(h?.store??m),c=(0,n.useMemo)(()=>h?.getStatus()??D,[v,h]),y=(0,n.useMemo)(()=>({...v,...c}),[v,c]),g=(0,n.useMemo)(()=>({name:e.name,store:m,functions:[],contextKey:`form:${e.name}`,contextProvider:()=>({name:`Form: ${e.name}`,description:""}),install:()=>()=>{},hydrate:()=>{},submit:async()=>({ok:!1,error:"Form definition not loaded yet."}),getValues:()=>m.get().values,setValues:()=>{},reset:()=>{},getStatus:()=>D}),[e.name,m]);return{...h??g,state:y,loading:C,error:k}}exports.AgoProvider=G;exports.ChatInput=W;exports.ChatWidget=ge;exports.Markdown=z;exports.Message=O;exports.createFormCollector=M.createFormCollector;exports.createMockClient=V.createMockClient;exports.deriveFormStatus=M.deriveFormStatus;exports.loadFormCollector=M.loadFormCollector;exports.useAgo=q;exports.useAgoClient=A;exports.useAgoContext=he;exports.useAgoFunction=xe;exports.useAgoNavigation=me;exports.useAgoStore=$;exports.useChat=pe;exports.useConversation=H;exports.useFormCollector=ye;exports.useMessages=L;exports.useOptionalAgoClient=R;