tia-gpc-widget 1.1.7 → 1.1.9

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.
@@ -1,31 +1,31 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),O=require("react"),oe=require("react-i18next"),me=require("lucide-react"),Ft=require("react-hot-toast"),Pi=require("@marsidev/react-turnstile"),Di=require("axios"),at=require("i18next"),Li=require("i18next-browser-languagedetector"),_i=({onClick:e,unreadCount:n=0,widgetConfig:t})=>{const{t:r}=oe.useTranslation(),i=t?.company_name||r("widget.title");return T.jsxs("button",{onClick:e,className:"gpc-floating-button gpc-floating-button-with-text gpc-animate-fade-in","aria-label":r("chat.title"),title:r("chat.title"),children:[T.jsxs("div",{className:"gpc-floating-content",children:[T.jsx(me.MessageCircle,{className:"gpc-floating-icon"}),T.jsxs("span",{className:"gpc-floating-text",children:[r("widget.questionsTo")," ",i]})]}),n>0&&T.jsx("span",{className:"gpc-notification-badge",children:n>9?"9+":n})]})},Ri=({theme:e,onToggle:n})=>{const{t}=oe.useTranslation();return T.jsx("button",{onClick:n,className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":t("theme.toggle"),title:t("theme.toggle"),children:e==="light"?T.jsx(me.Moon,{className:"gpc-icon"}):T.jsx(me.Sun,{className:"gpc-icon"})})},kt=[{code:"en",label:"English",flag:"🇬🇧"},{code:"es",label:"Español",flag:"🇪🇸"},{code:"fr",label:"Français",flag:"🇫🇷"}],zi=()=>{const{i18n:e}=oe.useTranslation(),[n,t]=O.useState(!1),r=O.useRef(null),i=kt.find(l=>l.code===e.language)||kt[0],o=l=>{e.changeLanguage(l),t(!1)};return O.useEffect(()=>{const l=a=>{r.current&&!r.current.contains(a.target)&&t(!1)};return n&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[n]),T.jsxs("div",{className:"gpc-language-selector",ref:r,children:[T.jsx("button",{onClick:()=>t(!n),className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":"Cambiar idioma",title:"Cambiar idioma",children:T.jsx(me.Globe,{className:"gpc-icon"})}),n&&T.jsx("div",{className:"gpc-language-dropdown",children:kt.map(l=>T.jsxs("button",{onClick:()=>o(l.code),className:`gpc-language-option ${l.code===i.code?"gpc-language-option-active":""}`,children:[T.jsx("span",{className:"gpc-language-flag",children:l.flag}),T.jsx("span",{className:"gpc-language-label",children:l.label})]},l.code))})]})},Ni=({onClose:e,theme:n,onToggleTheme:t,showBranding:r=!0,widgetConfig:i=null})=>{const{t:o}=oe.useTranslation(),l=i?.company_name||o("widget.title"),a=i?.company_logo_base64,u=a?.startsWith("data:")?a:a?`data:image/png;base64,${a}`:null;return T.jsxs("div",{className:"gpc-chat-header",children:[T.jsxs("div",{className:"gpc-header-content",children:[u&&T.jsx("div",{className:"gpc-header-logo",children:T.jsx("img",{src:u,alt:l,className:"gpc-company-logo"})}),T.jsx("div",{className:"gpc-header-text",children:T.jsx("h2",{className:"gpc-header-title",children:l})})]}),T.jsxs("div",{className:"gpc-header-actions",children:[T.jsx(zi,{}),T.jsx(Ri,{theme:n,onToggle:t}),T.jsx("button",{onClick:e,className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":o("chat.close"),title:o("chat.close"),children:T.jsx(me.ChevronDown,{className:"gpc-icon"})})]})]})};function Oi(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Fi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ji={};function bn(e,n){return(ji.jsx?Mi:Fi).test(e)}const Bi=/[ \t\n\f\r]/g;function Ui(e){return typeof e=="object"?e.type==="text"?wn(e.value):!1:wn(e)}function wn(e){return e.replace(Bi,"")===""}class Je{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Je.prototype.normal={};Je.prototype.property={};Je.prototype.space=void 0;function cr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Je(t,r,n)}function Mt(e){return e.toLowerCase()}class ne{constructor(n,t){this.attribute=t,this.property=n}}ne.prototype.attribute="";ne.prototype.booleanish=!1;ne.prototype.boolean=!1;ne.prototype.commaOrSpaceSeparated=!1;ne.prototype.commaSeparated=!1;ne.prototype.defined=!1;ne.prototype.mustUseProperty=!1;ne.prototype.number=!1;ne.prototype.overloadedBoolean=!1;ne.prototype.property="";ne.prototype.spaceSeparated=!1;ne.prototype.space=void 0;let Hi=0;const B=Pe(),K=Pe(),jt=Pe(),v=Pe(),W=Pe(),Oe=Pe(),ie=Pe();function Pe(){return 2**++Hi}const Bt=Object.freeze(Object.defineProperty({__proto__:null,boolean:B,booleanish:K,commaOrSpaceSeparated:ie,commaSeparated:Oe,number:v,overloadedBoolean:jt,spaceSeparated:W},Symbol.toStringTag,{value:"Module"})),xt=Object.keys(Bt);class Yt extends ne{constructor(n,t,r,i){let o=-1;if(super(n,t),Sn(this,"space",i),typeof r=="number")for(;++o<xt.length;){const l=xt[o];Sn(this,xt[o],(r&Bt[l])===Bt[l])}}}Yt.prototype.defined=!0;function Sn(e,n,t){t&&(e[n]=t)}function Me(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new Yt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[Mt(r)]=r,t[Mt(o.attribute)]=r}return new Je(n,t,e.space)}const fr=Me({properties:{ariaActiveDescendant:null,ariaAtomic:K,ariaAutoComplete:null,ariaBusy:K,ariaChecked:K,ariaColCount:v,ariaColIndex:v,ariaColSpan:v,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:K,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:K,ariaFlowTo:W,ariaGrabbed:K,ariaHasPopup:null,ariaHidden:K,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:v,ariaLive:null,ariaModal:K,ariaMultiLine:K,ariaMultiSelectable:K,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:v,ariaPressed:K,ariaReadOnly:K,ariaRelevant:null,ariaRequired:K,ariaRoleDescription:W,ariaRowCount:v,ariaRowIndex:v,ariaRowSpan:v,ariaSelected:K,ariaSetSize:v,ariaSort:null,ariaValueMax:v,ariaValueMin:v,ariaValueNow:v,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function hr(e,n){return n in e?e[n]:n}function pr(e,n){return hr(e,n.toLowerCase())}const qi=Me({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oe,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:W,autoFocus:B,autoPlay:B,blocking:W,capture:null,charSet:null,checked:B,cite:null,className:W,cols:v,colSpan:null,content:null,contentEditable:K,controls:B,controlsList:W,coords:v|Oe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:jt,draggable:K,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:W,height:v,hidden:jt,high:v,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:W,itemRef:W,itemScope:B,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:v,manifest:null,max:null,maxLength:v,media:null,method:null,min:null,minLength:v,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,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:B,optimum:v,pattern:null,ping:W,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:W,required:B,reversed:B,rows:v,rowSpan:v,sandbox:W,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shape:null,size:v,sizes:null,slot:null,span:v,spellCheck:K,src:null,srcDoc:null,srcLang:null,srcSet:null,start:v,step:null,style:null,tabIndex:v,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:K,width:v,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:v,borderColor:null,bottomMargin:v,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:v,leftMargin:v,link:null,longDesc:null,lowSrc:null,marginHeight:v,marginWidth:v,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:v,rules:null,scheme:null,scrolling:K,standby:null,summary:null,text:null,topMargin:v,valueType:null,version:null,vAlign:null,vLink:null,vSpace:v,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:B,disableRemotePlayback:B,prefix:null,property:null,results:v,security:null,unselectable:null},space:"html",transform:pr}),Vi=Me({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:ie,accentHeight:v,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:v,amplitude:v,arabicForm:null,ascent:v,attributeName:null,attributeType:null,azimuth:v,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:v,by:null,calcMode:null,capHeight:v,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:v,diffuseConstant:v,direction:null,display:null,dur:null,divisor:v,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:v,enableBackground:null,end:null,event:null,exponent:v,externalResourcesRequired:null,fill:null,fillOpacity:v,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:Oe,g2:Oe,glyphName:Oe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:v,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:v,horizOriginX:v,horizOriginY:v,id:null,ideographic:v,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:v,k:v,k1:v,k2:v,k3:v,k4:v,kernelMatrix:ie,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:v,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:v,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:v,overlineThickness:v,paintOrder:null,panose1:null,path:null,pathLength:v,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:v,pointsAtY:v,pointsAtZ:v,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ie,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ie,rev:ie,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ie,requiredFeatures:ie,requiredFonts:ie,requiredFormats:ie,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:v,specularExponent:v,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:v,strikethroughThickness:v,string:null,stroke:null,strokeDashArray:ie,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:v,strokeOpacity:v,strokeWidth:null,style:null,surfaceScale:v,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ie,tabIndex:v,tableValues:null,target:null,targetX:v,targetY:v,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ie,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:v,underlineThickness:v,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:v,values:null,vAlphabetic:v,vMathematical:v,vectorEffect:null,vHanging:v,vIdeographic:v,version:null,vertAdvY:v,vertOriginX:v,vertOriginY:v,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:v,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hr}),mr=Me({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()}}),dr=Me({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pr}),gr=Me({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),$i={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"},Gi=/[A-Z]/g,Cn=/-[a-z]/g,Wi=/^data[-\w.:]+$/i;function Ki(e,n){const t=Mt(n);let r=n,i=ne;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Wi.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Cn,Qi);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Cn.test(o)){let l=o.replace(Gi,Yi);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=Yt}return new i(r,n)}function Yi(e){return"-"+e.toLowerCase()}function Qi(e){return e.charAt(1).toUpperCase()}const Xi=cr([fr,qi,mr,dr,gr],"html"),Qt=cr([fr,Vi,mr,dr,gr],"svg");function Ji(e){return e.join(" ").trim()}function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Re={},bt,En;function Zi(){if(En)return bt;En=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
2
- `,s="/",f="*",c="",p="comment",h="declaration";bt=function(k,C){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];C=C||{};var y=1,E=1;function w(P){var L=P.match(n);L&&(y+=L.length);var F=P.lastIndexOf(u);E=~F?P.length-F:E+P.length}function _(){var P={line:y,column:E};return function(L){return L.position=new R(P),U(),L}}function R(P){this.start=P,this.end={line:y,column:E},this.source=C.source}R.prototype.content=k;function b(P){var L=new Error(C.source+":"+y+":"+E+": "+P);if(L.reason=P,L.filename=C.source,L.line=y,L.column=E,L.source=k,!C.silent)throw L}function N(P){var L=P.exec(k);if(L){var F=L[0];return w(F),k=k.slice(F.length),L}}function U(){N(t)}function M(P){var L;for(P=P||[];L=x();)L!==!1&&P.push(L);return P}function x(){var P=_();if(!(s!=k.charAt(0)||f!=k.charAt(1))){for(var L=2;c!=k.charAt(L)&&(f!=k.charAt(L)||s!=k.charAt(L+1));)++L;if(L+=2,c===k.charAt(L-1))return b("End of comment missing");var F=k.slice(2,L-2);return E+=2,w(F),k=k.slice(L),E+=2,P({type:p,comment:F})}}function D(){var P=_(),L=N(r);if(L){if(x(),!N(i))return b("property missing ':'");var F=N(o),Y=P({type:h,property:g(L[0].replace(e,c)),value:F?g(F[0].replace(e,c)):c});return N(l),Y}}function A(){var P=[];M(P);for(var L;L=D();)L!==!1&&(P.push(L),M(P));return P}return U(),A()};function g(k){return k?k.replace(a,c):c}return bt}var Tn;function el(){if(Tn)return Re;Tn=1;var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.default=t;const n=e(Zi());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:s,value:f}=u;a?i(s,f,u):f&&(o=o||{},o[s]=f)}),o}return Re}var qe={},vn;function tl(){if(vn)return qe;vn=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(s){return!s||t.test(s)||e.test(s)},l=function(s,f){return f.toUpperCase()},a=function(s,f){return"".concat(f,"-")},u=function(s,f){return f===void 0&&(f={}),o(s)?s:(s=s.toLowerCase(),f.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(n,l))};return qe.camelCase=u,qe}var Ve,In;function nl(){if(In)return Ve;In=1;var e=Ve&&Ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(el()),t=tl();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,u){a&&u&&(l[(0,t.camelCase)(a,o)]=u)}),l}return r.default=r,Ve=r,Ve}var rl=nl();const il=yr(rl),kr=xr("end"),Xt=xr("start");function xr(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 ll(e){const n=Xt(e),t=kr(e);if(n&&t)return{start:n,end:t}}function We(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?An(e.position):"start"in e||"end"in e?An(e):"line"in e||"column"in e?Ut(e):""}function Ut(e){return Pn(e&&e.line)+":"+Pn(e&&e.column)}function An(e){return Ut(e&&e.start)+"-"+Ut(e&&e.end)}function Pn(e){return e&&typeof e=="number"?e:1}class Z extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=We(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Z.prototype.file="";Z.prototype.name="";Z.prototype.reason="";Z.prototype.message="";Z.prototype.stack="";Z.prototype.column=void 0;Z.prototype.line=void 0;Z.prototype.ancestors=void 0;Z.prototype.cause=void 0;Z.prototype.fatal=void 0;Z.prototype.place=void 0;Z.prototype.ruleId=void 0;Z.prototype.source=void 0;const Jt={}.hasOwnProperty,ol=new Map,al=/[A-Z]/g,sl=new Set(["table","tbody","thead","tfoot","tr"]),ul=new Set(["td","th"]),br="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cl(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=kl(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=yl(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"?Qt:Xi,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=wr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function wr(e,n,t){if(n.type==="element")return fl(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return hl(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return ml(e,n,t);if(n.type==="mdxjsEsm")return pl(e,n);if(n.type==="root")return dl(e,n,t);if(n.type==="text")return gl(e,n)}function fl(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Qt,e.schema=i),e.ancestors.push(n);const o=Cr(e,n.tagName,!1),l=xl(e,n);let a=en(e,n);return sl.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Ui(u):!0})),Sr(e,l,o,n),Zt(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function hl(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Qe(e,n.position)}function pl(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Qe(e,n.position)}function ml(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Qt,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:Cr(e,n.name,!0),l=bl(e,n),a=en(e,n);return Sr(e,l,o,n),Zt(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function dl(e,n,t){const r={};return Zt(r,en(e,n)),e.create(n,e.Fragment,r,t)}function gl(e,n){return n.value}function Sr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Zt(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function yl(e,n,t){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?t:n;return a?s(o,l,a):s(o,l)}}function kl(e,n){return t;function t(r,i,o,l){const a=Array.isArray(o.children),u=Xt(r);return n(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function xl(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Jt.call(n.properties,i)){const o=wl(e,i,n.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&ul.has(n.tagName)?r=a:t[l]=a}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function bl(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Qe(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Qe(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function en(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:ol;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=wr(e,o,l);a!==void 0&&t.push(a)}return t}function wl(e,n,t){const r=Ki(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Oi(t):Ji(t)),r.property==="style"){let i=typeof t=="object"?t:Sl(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Cl(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?$i[r.property]||r.property:r.attribute,t]}}function Sl(e,n){try{return il(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new Z("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=br+"#cannot-parse-style-attribute",i}}function Cr(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const a=bn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=bn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Jt.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qe(e)}function Qe(e,n){const t=new Z("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=br+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Cl(e){const n={};let t;for(t in e)Jt.call(e,t)&&(n[El(t)]=e[t]);return n}function El(e){let n=e.replace(al,Tl);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Tl(e){return"-"+e.toLowerCase()}const wt={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"]},vl={};function tn(e,n){const t=vl,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Er(e,r,i)}function Er(e,n,t){if(Il(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 Dn(e.children,n,t)}return Array.isArray(e)?Dn(e,n,t):""}function Dn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Er(e[i],n,t);return r.join("")}function Il(e){return!!(e&&typeof e=="object")}const Ln=document.createElement("i");function nn(e){const n="&"+e+";";Ln.innerHTML=n;const t=Ln.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function le(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function ae(e,n){return e.length>0?(le(e,e.length,0,n),e):n}const _n={}.hasOwnProperty;function Tr(e){const n={};let t=-1;for(;++t<e.length;)Al(n,e[t]);return n}function Al(e,n){let t;for(t in n){const i=(_n.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){_n.call(i,l)||(i[l]=[]);const a=o[l];Pl(i[l],Array.isArray(a)?a:a?[a]:[])}}}function Pl(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);le(e,0,0,r)}function vr(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 he(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ee=Ee(/[A-Za-z]/),J=Ee(/[\dA-Za-z]/),Dl=Ee(/[#-'*+\--9=?A-Z^-~]/);function ut(e){return e!==null&&(e<32||e===127)}const Ht=Ee(/\d/),Ll=Ee(/[\dA-Fa-f]/),_l=Ee(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}const pt=Ee(new RegExp("\\p{P}|\\p{S}","u")),Ae=Ee(/\s/);function Ee(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function je(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&J(e.charCodeAt(t+1))&&J(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function V(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return H(u)?(e.enter(t),a(u)):n(u)}function a(u){return H(u)&&o++<i?(e.consume(u),a):(e.exit(t),n(u))}}const Rl={tokenize:zl};function zl(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"),V(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const Nl={tokenize:Ol},Rn={tokenize:Fl};function Ol(e){const n=this,t=[];let r=0,i,o,l;return a;function a(w){if(r<t.length){const _=t[r];return n.containerState=_[1],e.attempt(_[0].continuation,u,s)(w)}return s(w)}function u(w){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&E();const _=n.events.length;let R=_,b;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){b=n.events[R][1].end;break}y(r);let N=_;for(;N<n.events.length;)n.events[N][1].end={...b},N++;return le(n.events,R+1,0,n.events.slice(_)),n.events.length=N,s(w)}return a(w)}function s(w){if(r===t.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Rn,f,c)(w)}function f(w){return i&&E(),y(r),p(w)}function c(w){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,g(w)}function p(w){return n.containerState={},e.attempt(Rn,h,g)(w)}function h(w){return r++,t.push([n.currentConstruct,n.containerState]),p(w)}function g(w){if(w===null){i&&E(),y(0),e.consume(w);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),k(w)}function k(w){if(w===null){C(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return z(w)?(e.consume(w),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(w),k)}function C(w,_){const R=n.sliceStream(w);if(_&&R.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(R),n.parser.lazy[w.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const N=n.events.length;let U=N,M,x;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if(M){x=n.events[U][1].end;break}M=!0}for(y(r),b=N;b<n.events.length;)n.events[b][1].end={...x},b++;le(n.events,U+1,0,n.events.slice(N)),n.events.length=b}}function y(w){let _=t.length;for(;_-- >w;){const R=t[_];n.containerState=R[1],R[0].exit.call(n,e)}t.length=w}function E(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Fl(e,n,t){return V(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fe(e){if(e===null||G(e)||Ae(e))return 1;if(pt(e))return 2}function mt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const qt={name:"attention",resolveAll:Ml,tokenize:jl};function Ml(e,n){let t=-1,r,i,o,l,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},p={...e[t][1].start};zn(c,-u),zn(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.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",l,n],["exit",l,n],["enter",o,n]]),s=ae(s,mt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=ae(s,[["exit",o,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,le(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 jl(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Fe(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Fe(u),c=!f||f===2&&i||t.includes(u),p=!i||i===2&&f||t.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),n(u)}}function zn(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Bl={name:"autolink",tokenize:Ul};function Ul(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ee(h)?(e.consume(h),l):h===64?t(h):s(h)}function l(h){return h===43||h===45||h===46||J(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||J(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||ut(h)?t(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):Dl(h)?(e.consume(h),s):t(h)}function f(h){return J(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||J(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return t(h)}}const Ze={partial:!0,tokenize:Hl};function Hl(e,n,t){return r;function r(o){return H(o)?V(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?n(o):t(o)}}const Ir={continuation:{tokenize:Vl},exit:$l,name:"blockQuote",tokenize:ql};function ql(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return H(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function Vl(e,n,t){const r=this;return i;function i(l){return H(l)?V(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Ir,n,t)(l)}}function $l(e){e.exit("blockQuote")}const Ar={name:"characterEscape",tokenize:Gl};function Gl(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return _l(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const Pr={name:"characterReference",tokenize:Wl};function Wl(e,n,t){const r=this;let i=0,o,l;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"),o=31,l=J,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Ll,f):(e.enter("characterReferenceValue"),o=7,l=Ht,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===J&&!nn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const Nn={partial:!0,tokenize:Yl},On={concrete:!0,name:"codeFenced",tokenize:Kl};function Kl(e,n,t){const r=this,i={partial:!0,tokenize:R};let o=0,l=0,a;return u;function u(b){return s(b)}function s(b){const N=r.events[r.events.length-1];return o=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?t(b):(e.exit("codeFencedFenceSequence"),H(b)?V(e,c,"whitespace")(b):c(b))}function c(b){return b===null||z(b)?(e.exit("codeFencedFence"),r.interrupt?n(b):e.check(Nn,k,_)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):H(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,h,"whitespace")(b)):b===96&&b===a?t(b):(e.consume(b),p)}function h(b){return b===null||z(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?t(b):(e.consume(b),g)}function k(b){return e.attempt(i,_,C)(b)}function C(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y}function y(b){return o>0&&H(b)?V(e,E,"linePrefix",o+1)(b):E(b)}function E(b){return b===null||z(b)?e.check(Nn,k,_)(b):(e.enter("codeFlowValue"),w(b))}function w(b){return b===null||z(b)?(e.exit("codeFlowValue"),E(b)):(e.consume(b),w)}function _(b){return e.exit("codeFenced"),n(b)}function R(b,N,U){let M=0;return x;function x(F){return b.enter("lineEnding"),b.consume(F),b.exit("lineEnding"),D}function D(F){return b.enter("codeFencedFence"),H(F)?V(b,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):A(F)}function A(F){return F===a?(b.enter("codeFencedFenceSequence"),P(F)):U(F)}function P(F){return F===a?(M++,b.consume(F),P):M>=l?(b.exit("codeFencedFenceSequence"),H(F)?V(b,L,"whitespace")(F):L(F)):U(F)}function L(F){return F===null||z(F)?(b.exit("codeFencedFence"),N(F)):U(F)}}}function Yl(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const St={name:"codeIndented",tokenize:Xl},Ql={partial:!0,tokenize:Jl};function Xl(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),V(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):t(s)}function l(s){return s===null?u(s):z(s)?e.attempt(Ql,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||z(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function Jl(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):V(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):z(l)?i(l):t(l)}}const Zl={name:"codeText",previous:to,resolve:eo,tokenize:no};function eo(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 to(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function no(e,n,t){let r=0,i,o;return l;function l(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?(o=e.enter("codeTextSequence"),i=0,f(c)):z(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||z(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)):(o.type="codeTextData",s(c))}}class ro{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$e(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),$e(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),$e(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);$e(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);$e(this.left,t.reverse())}}}function $e(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 Dr(e){const n={};let t=-1,r,i,o,l,a,u,s;const f=new ro(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,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,io(f,t)),t=n[t],s=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[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 le(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function io(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=t,g=0,k=0;const C=[k];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(k=p+1,C.push(k),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):C.pop(),p=C.length;p--;){const y=a.slice(C[p],C[p+1]),E=o.pop();u.push([E,E+y.length-1]),e.splice(E,2,y)}for(u.reverse(),p=-1;++p<u.length;)s[g+u[p][0]]=g+u[p][1],g+=u[p][1]-u[p][0]-1;return s}const lo={resolve:ao,tokenize:so},oo={partial:!0,tokenize:uo};function ao(e){return Dr(e),e}function so(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?o(a):z(a)?e.check(oo,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function uo(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),V(e,o,"linePrefix")}function o(l){if(l===null||z(l))return t(l);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(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function Lr(e,n,t,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||ut(y)?t(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),k(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?t(y):(e.consume(y),y===92?g:h)}function g(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function k(y){return!f&&(y===null||y===41||G(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(y)):f<s&&y===40?(e.consume(y),f++,k):y===41?(e.consume(y),f--,k):y===null||y===32||y===40||ut(y)?t(y):(e.consume(y),y===92?C:k)}function C(y){return y===40||y===41||y===92?(e.consume(y),k):k(y)}}function _r(e,n,t,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!H(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function Rr(e,n,t,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):t(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?t(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),V(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||z(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Ke(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):H(i)?V(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const co={name:"definition",tokenize:ho},fo={partial:!0,tokenize:po};function ho(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return _r.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=he(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):t(h)}function u(h){return G(h)?Ke(e,s)(h):s(h)}function s(h){return Lr(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(fo,c,c)(h)}function c(h){return H(h)?V(e,p,"whitespace")(h):p(h)}function p(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function po(e,n,t){return r;function r(a){return G(a)?Ke(e,i)(a):t(a)}function i(a){return Rr(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return H(a)?V(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?n(a):t(a)}}const mo={name:"hardBreakEscape",tokenize:go};function go(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const yo={name:"headingAtx",resolve:ko,tokenize:xo};function ko(e,n){let t=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},le(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function xo(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||G(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||z(f)?(e.exit("atxHeading"),n(f)):H(f)?V(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||G(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const bo=["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"],Fn=["pre","script","style","textarea"],wo={concrete:!0,name:"htmlFlow",resolveTo:Eo,tokenize:To},So={partial:!0,tokenize:Io},Co={partial:!0,tokenize:vo};function Eo(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 To(e,n,t){const r=this;let i,o,l,a,u;return s;function s(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,k):d===63?(e.consume(d),i=3,r.interrupt?n:m):ee(d)?(e.consume(d),l=String.fromCharCode(d),C):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):ee(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function g(d){const ce="CDATA[";return d===ce.charCodeAt(a++)?(e.consume(d),a===ce.length?r.interrupt?n:A:g):t(d)}function k(d){return ee(d)?(e.consume(d),l=String.fromCharCode(d),C):t(d)}function C(d){if(d===null||d===47||d===62||G(d)){const ce=d===47,Te=l.toLowerCase();return!ce&&!o&&Fn.includes(Te)?(i=1,r.interrupt?n(d):A(d)):bo.includes(l.toLowerCase())?(i=6,ce?(e.consume(d),y):r.interrupt?n(d):A(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?E(d):w(d))}return d===45||J(d)?(e.consume(d),l+=String.fromCharCode(d),C):t(d)}function y(d){return d===62?(e.consume(d),r.interrupt?n:A):t(d)}function E(d){return H(d)?(e.consume(d),E):x(d)}function w(d){return d===47?(e.consume(d),x):d===58||d===95||ee(d)?(e.consume(d),_):H(d)?(e.consume(d),w):x(d)}function _(d){return d===45||d===46||d===58||d===95||J(d)?(e.consume(d),_):R(d)}function R(d){return d===61?(e.consume(d),b):H(d)?(e.consume(d),R):w(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),u=d,N):H(d)?(e.consume(d),b):U(d)}function N(d){return d===u?(e.consume(d),u=null,M):d===null||z(d)?t(d):(e.consume(d),N)}function U(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||G(d)?R(d):(e.consume(d),U)}function M(d){return d===47||d===62||H(d)?w(d):t(d)}function x(d){return d===62?(e.consume(d),D):t(d)}function D(d){return d===null||z(d)?A(d):H(d)?(e.consume(d),D):t(d)}function A(d){return d===45&&i===2?(e.consume(d),Y):d===60&&i===1?(e.consume(d),Q):d===62&&i===4?(e.consume(d),ue):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),ge):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(So,ye,P)(d)):d===null||z(d)?(e.exit("htmlFlowData"),P(d)):(e.consume(d),A)}function P(d){return e.check(Co,L,ye)(d)}function L(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),F}function F(d){return d===null||z(d)?P(d):(e.enter("htmlFlowData"),A(d))}function Y(d){return d===45?(e.consume(d),m):A(d)}function Q(d){return d===47?(e.consume(d),l="",se):A(d)}function se(d){if(d===62){const ce=l.toLowerCase();return Fn.includes(ce)?(e.consume(d),ue):A(d)}return ee(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),se):A(d)}function ge(d){return d===93?(e.consume(d),m):A(d)}function m(d){return d===62?(e.consume(d),ue):d===45&&i===2?(e.consume(d),m):A(d)}function ue(d){return d===null||z(d)?(e.exit("htmlFlowData"),ye(d)):(e.consume(d),ue)}function ye(d){return e.exit("htmlFlow"),n(d)}}function vo(e,n,t){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function Io(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const Ao={name:"htmlText",tokenize:Po};function Po(e,n,t){const r=this;let i,o,l;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),R):m===63?(e.consume(m),w):ee(m)?(e.consume(m),U):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):ee(m)?(e.consume(m),E):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):z(m)?(l=c,Q(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?Y(m):m===45?p(m):c(m)}function g(m){const ue="CDATA[";return m===ue.charCodeAt(o++)?(e.consume(m),o===ue.length?k:g):t(m)}function k(m){return m===null?t(m):m===93?(e.consume(m),C):z(m)?(l=k,Q(m)):(e.consume(m),k)}function C(m){return m===93?(e.consume(m),y):k(m)}function y(m){return m===62?Y(m):m===93?(e.consume(m),y):k(m)}function E(m){return m===null||m===62?Y(m):z(m)?(l=E,Q(m)):(e.consume(m),E)}function w(m){return m===null?t(m):m===63?(e.consume(m),_):z(m)?(l=w,Q(m)):(e.consume(m),w)}function _(m){return m===62?Y(m):w(m)}function R(m){return ee(m)?(e.consume(m),b):t(m)}function b(m){return m===45||J(m)?(e.consume(m),b):N(m)}function N(m){return z(m)?(l=N,Q(m)):H(m)?(e.consume(m),N):Y(m)}function U(m){return m===45||J(m)?(e.consume(m),U):m===47||m===62||G(m)?M(m):t(m)}function M(m){return m===47?(e.consume(m),Y):m===58||m===95||ee(m)?(e.consume(m),x):z(m)?(l=M,Q(m)):H(m)?(e.consume(m),M):Y(m)}function x(m){return m===45||m===46||m===58||m===95||J(m)?(e.consume(m),x):D(m)}function D(m){return m===61?(e.consume(m),A):z(m)?(l=D,Q(m)):H(m)?(e.consume(m),D):M(m)}function A(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,P):z(m)?(l=A,Q(m)):H(m)?(e.consume(m),A):(e.consume(m),L)}function P(m){return m===i?(e.consume(m),i=void 0,F):m===null?t(m):z(m)?(l=P,Q(m)):(e.consume(m),P)}function L(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||G(m)?M(m):(e.consume(m),L)}function F(m){return m===47||m===62||G(m)?M(m):t(m)}function Y(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function Q(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),se}function se(m){return H(m)?V(e,ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ge(m)}function ge(m){return e.enter("htmlTextData"),l(m)}}const rn={name:"labelEnd",resolveAll:Ro,resolveTo:zo,tokenize:No},Do={tokenize:Oo},Lo={tokenize:Fo},_o={tokenize:Mo};function Ro(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&&le(e,0,e.length,t),e}function zo(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=ae(a,e.slice(o+1,o+r+3)),a=ae(a,[["enter",f,n]]),a=ae(a,mt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=ae(a,[["exit",f,n],e[l-2],e[l-1],["exit",s,n]]),a=ae(a,e.slice(l+1)),a=ae(a,[["exit",u,n]]),le(e,o,e.length,a),e}function No(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(he(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):t(p)}function u(p){return p===40?e.attempt(Do,f,l?f:c)(p):p===91?e.attempt(Lo,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(_o,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function Oo(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 G(c)?Ke(e,o)(c):o(c)}function o(c){return c===41?f(c):Lr(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return G(c)?Ke(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?Rr(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return G(c)?Ke(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 Fo(e,n,t){const r=this;return i;function i(a){return _r.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(he(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function Mo(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const jo={name:"labelStartImage",resolveAll:rn.resolveAll,tokenize:Bo};function Bo(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const Uo={name:"labelStartLink",resolveAll:rn.resolveAll,tokenize:Ho};function Ho(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Ct={name:"lineEnding",tokenize:qo};function qo(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),V(e,n,"linePrefix")}}const st={name:"thematicBreak",tokenize:Vo};function Vo(e,n,t){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||z(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),H(s)?V(e,a,"whitespace")(s):a(s))}}const te={continuation:{tokenize:Ko},exit:Qo,name:"list",tokenize:Wo},$o={partial:!0,tokenize:Xo},Go={partial:!0,tokenize:Yo};function Wo(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ht(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(st,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return t(h)}function u(h){return Ht(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ze,r.interrupt?t:f,e.attempt($o,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return H(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function Ko(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,V(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!H(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Go,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,V(e,e.attempt(te,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Yo(e,n,t){const r=this;return V(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function Qo(e){e.exit(this.containerState.type)}function Xo(e,n,t){const r=this;return V(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!H(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const Mn={name:"setextUnderline",resolveTo:Jo,tokenize:Zo};function Jo(e,n){let t=e.length,r,i,o;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),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function Zo(e,n,t){const r=this;let i;return o;function o(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,l(s)):t(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),H(s)?V(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||z(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const ea={tokenize:ta};function ta(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,V(e,e.attempt(this.parser.constructs.flow,i,e.attempt(lo,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const na={resolveAll:Nr()},ra=zr("string"),ia=zr("text");function zr(e){return{resolveAll:Nr(e==="text"?la:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return s(f)?o(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"),o(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Nr(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function la(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 o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,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}const oa={42:te,43:te,45:te,48:te,49:te,50:te,51:te,52:te,53:te,54:te,55:te,56:te,57:te,62:Ir},aa={91:co},sa={[-2]:St,[-1]:St,32:St},ua={35:yo,42:st,45:[Mn,st],60:wo,61:Mn,95:st,96:On,126:On},ca={38:Pr,92:Ar},fa={[-5]:Ct,[-4]:Ct,[-3]:Ct,33:jo,38:Pr,42:qt,60:[Bl,Ao],91:Uo,92:[mo,Ar],93:rn,95:qt,96:Zl},ha={null:[qt,na]},pa={null:[42,95]},ma={null:[]},da=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pa,contentInitial:aa,disable:ma,document:oa,flow:ua,flowInitial:sa,insideSpan:ha,string:ca,text:fa},Symbol.toStringTag,{value:"Module"}));function ga(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={},o=[];let l=[],a=[];const u={attempt:N(R),check:N(b),consume:E,enter:w,exit:_,interrupt:N(b,{interrupt:!0})},s={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&o.push(n),s;function c(D){return l=ae(l,D),C(),l[l.length-1]!==null?[]:(U(n,0),s.events=mt(o,s.events,s),s.events)}function p(D,A){return ka(h(D),A)}function h(D){return ya(l,D)}function g(){const{_bufferIndex:D,_index:A,line:P,column:L,offset:F}=r;return{_bufferIndex:D,_index:A,line:P,column:L,offset:F}}function k(D){i[D.line]=D.column,x()}function C(){let D;for(;r._index<l.length;){const A=l[r._index];if(typeof A=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<A.length;)y(A.charCodeAt(r._bufferIndex));else y(A)}}function y(D){f=f(D)}function E(D){z(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,x()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=D}function w(D,A){const P=A||{};return P.type=D,P.start=g(),s.events.push(["enter",P,s]),a.push(P),P}function _(D){const A=a.pop();return A.end=g(),s.events.push(["exit",A,s]),A}function R(D,A){U(D,A.from)}function b(D,A){A.restore()}function N(D,A){return P;function P(L,F,Y){let Q,se,ge,m;return Array.isArray(L)?ye(L):"tokenize"in L?ye([L]):ue(L);function ue(X){return Be;function Be(we){const De=we!==null&&X[we],Le=we!==null&&X.null,tt=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return ye(tt)(we)}}function ye(X){return Q=X,se=0,X.length===0?Y:d(X[se])}function d(X){return Be;function Be(we){return m=M(),ge=X,X.partial||(s.currentConstruct=X),X.name&&s.parser.constructs.disable.null.includes(X.name)?Te():X.tokenize.call(A?Object.assign(Object.create(s),A):s,u,ce,Te)(we)}}function ce(X){return D(ge,m),F}function Te(X){return m.restore(),++se<Q.length?d(Q[se]):Y}}}function U(D,A){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&le(s.events,A,s.events.length-A,D.resolve(s.events.slice(A),s)),D.resolveTo&&(s.events=D.resolveTo(s.events,s))}function M(){const D=g(),A=s.previous,P=s.currentConstruct,L=s.events.length,F=Array.from(a);return{from:L,restore:Y};function Y(){r=D,s.previous=A,s.currentConstruct=P,s.events.length=L,a=F,x()}}function x(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ya(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function ka(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),O=require("react"),oe=require("react-i18next"),me=require("lucide-react"),Ft=require("react-hot-toast"),Pi=require("@marsidev/react-turnstile"),Di=require("axios"),at=require("i18next"),Li=require("i18next-browser-languagedetector"),_i=({onClick:e,unreadCount:n=0,widgetConfig:t})=>{const{t:r}=oe.useTranslation(),i=t?.company_name||r("widget.title");return T.jsxs("button",{onClick:e,className:"gpc-floating-button gpc-floating-button-with-text gpc-animate-fade-in","aria-label":r("chat.title"),title:r("chat.title"),children:[T.jsxs("div",{className:"gpc-floating-content",children:[T.jsx(me.MessageCircle,{className:"gpc-floating-icon"}),T.jsxs("span",{className:"gpc-floating-text",children:[r("widget.questionsTo")," ",i]})]}),n>0&&T.jsx("span",{className:"gpc-notification-badge",children:n>9?"9+":n})]})},Ri=({theme:e,onToggle:n})=>{const{t}=oe.useTranslation();return T.jsx("button",{onClick:n,className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":t("theme.toggle"),title:t("theme.toggle"),children:e==="light"?T.jsx(me.Moon,{className:"gpc-icon"}):T.jsx(me.Sun,{className:"gpc-icon"})})},kt=[{code:"en",label:"English",flag:"🇬🇧"},{code:"es",label:"Español",flag:"🇪🇸"},{code:"fr",label:"Français",flag:"🇫🇷"}],zi=()=>{const{i18n:e}=oe.useTranslation(),[n,t]=O.useState(!1),r=O.useRef(null),i=kt.find(l=>l.code===e.language)||kt[0],o=l=>{e.changeLanguage(l),t(!1)};return O.useEffect(()=>{const l=a=>{r.current&&!r.current.contains(a.target)&&t(!1)};return n&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[n]),T.jsxs("div",{className:"gpc-language-selector",ref:r,children:[T.jsx("button",{onClick:()=>t(!n),className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":"Cambiar idioma",title:"Cambiar idioma",children:T.jsx(me.Globe,{className:"gpc-icon"})}),n&&T.jsx("div",{className:"gpc-language-dropdown",children:kt.map(l=>T.jsxs("button",{onClick:()=>o(l.code),className:`gpc-language-option ${l.code===i.code?"gpc-language-option-active":""}`,children:[T.jsx("span",{className:"gpc-language-flag",children:l.flag}),T.jsx("span",{className:"gpc-language-label",children:l.label})]},l.code))})]})},Ni=({onClose:e,theme:n,onToggleTheme:t,showBranding:r=!0,widgetConfig:i=null})=>{const{t:o}=oe.useTranslation(),l=i?.company_name||o("widget.title"),a=i?.company_logo_base64,s=a?.startsWith("data:")?a:a?`data:image/png;base64,${a}`:null;return T.jsxs("div",{className:"gpc-chat-header",children:[T.jsxs("div",{className:"gpc-header-content",children:[s&&T.jsx("div",{className:"gpc-header-logo",children:T.jsx("img",{src:s,alt:l,className:"gpc-company-logo"})}),T.jsx("div",{className:"gpc-header-text",children:T.jsx("h2",{className:"gpc-header-title",children:l})})]}),T.jsxs("div",{className:"gpc-header-actions",children:[T.jsx(zi,{}),T.jsx(Ri,{theme:n,onToggle:t}),T.jsx("button",{onClick:e,className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":o("chat.close"),title:o("chat.close"),children:T.jsx(me.ChevronDown,{className:"gpc-icon"})})]})]})};function Oi(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Fi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ji={};function bn(e,n){return(ji.jsx?Mi:Fi).test(e)}const Bi=/[ \t\n\f\r]/g;function Ui(e){return typeof e=="object"?e.type==="text"?wn(e.value):!1:wn(e)}function wn(e){return e.replace(Bi,"")===""}class Je{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Je.prototype.normal={};Je.prototype.property={};Je.prototype.space=void 0;function cr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Je(t,r,n)}function Mt(e){return e.toLowerCase()}class ne{constructor(n,t){this.attribute=t,this.property=n}}ne.prototype.attribute="";ne.prototype.booleanish=!1;ne.prototype.boolean=!1;ne.prototype.commaOrSpaceSeparated=!1;ne.prototype.commaSeparated=!1;ne.prototype.defined=!1;ne.prototype.mustUseProperty=!1;ne.prototype.number=!1;ne.prototype.overloadedBoolean=!1;ne.prototype.property="";ne.prototype.spaceSeparated=!1;ne.prototype.space=void 0;let Hi=0;const B=Pe(),K=Pe(),jt=Pe(),v=Pe(),W=Pe(),Oe=Pe(),ie=Pe();function Pe(){return 2**++Hi}const Bt=Object.freeze(Object.defineProperty({__proto__:null,boolean:B,booleanish:K,commaOrSpaceSeparated:ie,commaSeparated:Oe,number:v,overloadedBoolean:jt,spaceSeparated:W},Symbol.toStringTag,{value:"Module"})),xt=Object.keys(Bt);class Yt extends ne{constructor(n,t,r,i){let o=-1;if(super(n,t),Sn(this,"space",i),typeof r=="number")for(;++o<xt.length;){const l=xt[o];Sn(this,xt[o],(r&Bt[l])===Bt[l])}}}Yt.prototype.defined=!0;function Sn(e,n,t){t&&(e[n]=t)}function Me(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new Yt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[Mt(r)]=r,t[Mt(o.attribute)]=r}return new Je(n,t,e.space)}const fr=Me({properties:{ariaActiveDescendant:null,ariaAtomic:K,ariaAutoComplete:null,ariaBusy:K,ariaChecked:K,ariaColCount:v,ariaColIndex:v,ariaColSpan:v,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:K,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:K,ariaFlowTo:W,ariaGrabbed:K,ariaHasPopup:null,ariaHidden:K,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:v,ariaLive:null,ariaModal:K,ariaMultiLine:K,ariaMultiSelectable:K,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:v,ariaPressed:K,ariaReadOnly:K,ariaRelevant:null,ariaRequired:K,ariaRoleDescription:W,ariaRowCount:v,ariaRowIndex:v,ariaRowSpan:v,ariaSelected:K,ariaSetSize:v,ariaSort:null,ariaValueMax:v,ariaValueMin:v,ariaValueNow:v,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function hr(e,n){return n in e?e[n]:n}function pr(e,n){return hr(e,n.toLowerCase())}const qi=Me({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oe,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:W,autoFocus:B,autoPlay:B,blocking:W,capture:null,charSet:null,checked:B,cite:null,className:W,cols:v,colSpan:null,content:null,contentEditable:K,controls:B,controlsList:W,coords:v|Oe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:jt,draggable:K,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:W,height:v,hidden:jt,high:v,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:W,itemRef:W,itemScope:B,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:v,manifest:null,max:null,maxLength:v,media:null,method:null,min:null,minLength:v,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,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:B,optimum:v,pattern:null,ping:W,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:W,required:B,reversed:B,rows:v,rowSpan:v,sandbox:W,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shape:null,size:v,sizes:null,slot:null,span:v,spellCheck:K,src:null,srcDoc:null,srcLang:null,srcSet:null,start:v,step:null,style:null,tabIndex:v,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:K,width:v,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:v,borderColor:null,bottomMargin:v,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:v,leftMargin:v,link:null,longDesc:null,lowSrc:null,marginHeight:v,marginWidth:v,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:v,rules:null,scheme:null,scrolling:K,standby:null,summary:null,text:null,topMargin:v,valueType:null,version:null,vAlign:null,vLink:null,vSpace:v,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:B,disableRemotePlayback:B,prefix:null,property:null,results:v,security:null,unselectable:null},space:"html",transform:pr}),Vi=Me({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:ie,accentHeight:v,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:v,amplitude:v,arabicForm:null,ascent:v,attributeName:null,attributeType:null,azimuth:v,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:v,by:null,calcMode:null,capHeight:v,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:v,diffuseConstant:v,direction:null,display:null,dur:null,divisor:v,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:v,enableBackground:null,end:null,event:null,exponent:v,externalResourcesRequired:null,fill:null,fillOpacity:v,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:Oe,g2:Oe,glyphName:Oe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:v,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:v,horizOriginX:v,horizOriginY:v,id:null,ideographic:v,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:v,k:v,k1:v,k2:v,k3:v,k4:v,kernelMatrix:ie,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:v,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:v,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:v,overlineThickness:v,paintOrder:null,panose1:null,path:null,pathLength:v,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:v,pointsAtY:v,pointsAtZ:v,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ie,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ie,rev:ie,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ie,requiredFeatures:ie,requiredFonts:ie,requiredFormats:ie,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:v,specularExponent:v,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:v,strikethroughThickness:v,string:null,stroke:null,strokeDashArray:ie,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:v,strokeOpacity:v,strokeWidth:null,style:null,surfaceScale:v,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ie,tabIndex:v,tableValues:null,target:null,targetX:v,targetY:v,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ie,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:v,underlineThickness:v,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:v,values:null,vAlphabetic:v,vMathematical:v,vectorEffect:null,vHanging:v,vIdeographic:v,version:null,vertAdvY:v,vertOriginX:v,vertOriginY:v,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:v,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hr}),mr=Me({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()}}),dr=Me({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pr}),gr=Me({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),$i={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"},Gi=/[A-Z]/g,Cn=/-[a-z]/g,Wi=/^data[-\w.:]+$/i;function Ki(e,n){const t=Mt(n);let r=n,i=ne;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Wi.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Cn,Xi);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Cn.test(o)){let l=o.replace(Gi,Yi);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=Yt}return new i(r,n)}function Yi(e){return"-"+e.toLowerCase()}function Xi(e){return e.charAt(1).toUpperCase()}const Qi=cr([fr,qi,mr,dr,gr],"html"),Xt=cr([fr,Vi,mr,dr,gr],"svg");function Ji(e){return e.join(" ").trim()}function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Re={},bt,En;function Zi(){if(En)return bt;En=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
2
+ `,u="/",f="*",c="",p="comment",h="declaration";bt=function(x,E){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];E=E||{};var y=1,C=1;function k(L){var R=L.match(n);R&&(y+=R.length);var F=L.lastIndexOf(s);C=~F?L.length-F:C+L.length}function D(){var L={line:y,column:C};return function(R){return R.position=new z(L),U(),R}}function z(L){this.start=L,this.end={line:y,column:C},this.source=E.source}z.prototype.content=x;function w(L){var R=new Error(E.source+":"+y+":"+C+": "+L);if(R.reason=L,R.filename=E.source,R.line=y,R.column=C,R.source=x,!E.silent)throw R}function _(L){var R=L.exec(x);if(R){var F=R[0];return k(F),x=x.slice(F.length),R}}function U(){_(t)}function j(L){var R;for(L=L||[];R=b();)R!==!1&&L.push(R);return L}function b(){var L=D();if(!(u!=x.charAt(0)||f!=x.charAt(1))){for(var R=2;c!=x.charAt(R)&&(f!=x.charAt(R)||u!=x.charAt(R+1));)++R;if(R+=2,c===x.charAt(R-1))return w("End of comment missing");var F=x.slice(2,R-2);return C+=2,k(F),x=x.slice(R),C+=2,L({type:p,comment:F})}}function P(){var L=D(),R=_(r);if(R){if(b(),!_(i))return w("property missing ':'");var F=_(o),Y=L({type:h,property:g(R[0].replace(e,c)),value:F?g(F[0].replace(e,c)):c});return _(l),Y}}function A(){var L=[];j(L);for(var R;R=P();)R!==!1&&(L.push(R),j(L));return L}return U(),A()};function g(x){return x?x.replace(a,c):c}return bt}var Tn;function el(){if(Tn)return Re;Tn=1;var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.default=t;const n=e(Zi());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:f}=s;a?i(u,f,s):f&&(o=o||{},o[u]=f)}),o}return Re}var qe={},vn;function tl(){if(vn)return qe;vn=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||t.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},s=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,l))};return qe.camelCase=s,qe}var Ve,In;function nl(){if(In)return Ve;In=1;var e=Ve&&Ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(el()),t=tl();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,s){a&&s&&(l[(0,t.camelCase)(a,o)]=s)}),l}return r.default=r,Ve=r,Ve}var rl=nl();const il=yr(rl),kr=xr("end"),Qt=xr("start");function xr(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 ll(e){const n=Qt(e),t=kr(e);if(n&&t)return{start:n,end:t}}function We(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?An(e.position):"start"in e||"end"in e?An(e):"line"in e||"column"in e?Ut(e):""}function Ut(e){return Pn(e&&e.line)+":"+Pn(e&&e.column)}function An(e){return Ut(e&&e.start)+"-"+Ut(e&&e.end)}function Pn(e){return e&&typeof e=="number"?e:1}class Z extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=We(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Z.prototype.file="";Z.prototype.name="";Z.prototype.reason="";Z.prototype.message="";Z.prototype.stack="";Z.prototype.column=void 0;Z.prototype.line=void 0;Z.prototype.ancestors=void 0;Z.prototype.cause=void 0;Z.prototype.fatal=void 0;Z.prototype.place=void 0;Z.prototype.ruleId=void 0;Z.prototype.source=void 0;const Jt={}.hasOwnProperty,ol=new Map,al=/[A-Z]/g,sl=new Set(["table","tbody","thead","tfoot","tr"]),ul=new Set(["td","th"]),br="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cl(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=kl(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=yl(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"?Xt:Qi,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=wr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function wr(e,n,t){if(n.type==="element")return fl(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return hl(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return ml(e,n,t);if(n.type==="mdxjsEsm")return pl(e,n);if(n.type==="root")return dl(e,n,t);if(n.type==="text")return gl(e,n)}function fl(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Xt,e.schema=i),e.ancestors.push(n);const o=Cr(e,n.tagName,!1),l=xl(e,n);let a=en(e,n);return sl.has(n.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Ui(s):!0})),Sr(e,l,o,n),Zt(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function hl(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Xe(e,n.position)}function pl(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Xe(e,n.position)}function ml(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Xt,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:Cr(e,n.name,!0),l=bl(e,n),a=en(e,n);return Sr(e,l,o,n),Zt(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function dl(e,n,t){const r={};return Zt(r,en(e,n)),e.create(n,e.Fragment,r,t)}function gl(e,n){return n.value}function Sr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Zt(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function yl(e,n,t){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?t:n;return a?u(o,l,a):u(o,l)}}function kl(e,n){return t;function t(r,i,o,l){const a=Array.isArray(o.children),s=Qt(r);return n(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function xl(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Jt.call(n.properties,i)){const o=wl(e,i,n.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&ul.has(n.tagName)?r=a:t[l]=a}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function bl(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Xe(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Xe(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function en(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:ol;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){const u=i.get(s)||0;l=s+"-"+u,i.set(s,u+1)}}const a=wr(e,o,l);a!==void 0&&t.push(a)}return t}function wl(e,n,t){const r=Ki(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Oi(t):Ji(t)),r.property==="style"){let i=typeof t=="object"?t:Sl(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Cl(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?$i[r.property]||r.property:r.attribute,t]}}function Sl(e,n){try{return il(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new Z("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=br+"#cannot-parse-style-attribute",i}}function Cr(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const a=bn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=bn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Jt.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Xe(e)}function Xe(e,n){const t=new Z("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=br+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Cl(e){const n={};let t;for(t in e)Jt.call(e,t)&&(n[El(t)]=e[t]);return n}function El(e){let n=e.replace(al,Tl);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Tl(e){return"-"+e.toLowerCase()}const wt={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"]},vl={};function tn(e,n){const t=vl,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Er(e,r,i)}function Er(e,n,t){if(Il(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 Dn(e.children,n,t)}return Array.isArray(e)?Dn(e,n,t):""}function Dn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Er(e[i],n,t);return r.join("")}function Il(e){return!!(e&&typeof e=="object")}const Ln=document.createElement("i");function nn(e){const n="&"+e+";";Ln.innerHTML=n;const t=Ln.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function le(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function ae(e,n){return e.length>0?(le(e,e.length,0,n),e):n}const _n={}.hasOwnProperty;function Tr(e){const n={};let t=-1;for(;++t<e.length;)Al(n,e[t]);return n}function Al(e,n){let t;for(t in n){const i=(_n.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){_n.call(i,l)||(i[l]=[]);const a=o[l];Pl(i[l],Array.isArray(a)?a:a?[a]:[])}}}function Pl(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);le(e,0,0,r)}function vr(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 he(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ee=Ee(/[A-Za-z]/),J=Ee(/[\dA-Za-z]/),Dl=Ee(/[#-'*+\--9=?A-Z^-~]/);function ut(e){return e!==null&&(e<32||e===127)}const Ht=Ee(/\d/),Ll=Ee(/[\dA-Fa-f]/),_l=Ee(/[!-/:-@[-`{-~]/);function N(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}const pt=Ee(new RegExp("\\p{P}|\\p{S}","u")),Ae=Ee(/\s/);function Ee(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function je(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&J(e.charCodeAt(t+1))&&J(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function V(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return H(s)?(e.enter(t),a(s)):n(s)}function a(s){return H(s)&&o++<i?(e.consume(s),a):(e.exit(t),n(s))}}const Rl={tokenize:zl};function zl(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"),V(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return N(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const Nl={tokenize:Ol},Rn={tokenize:Fl};function Ol(e){const n=this,t=[];let r=0,i,o,l;return a;function a(k){if(r<t.length){const D=t[r];return n.containerState=D[1],e.attempt(D[0].continuation,s,u)(k)}return u(k)}function s(k){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&C();const D=n.events.length;let z=D,w;for(;z--;)if(n.events[z][0]==="exit"&&n.events[z][1].type==="chunkFlow"){w=n.events[z][1].end;break}y(r);let _=D;for(;_<n.events.length;)n.events[_][1].end={...w},_++;return le(n.events,z+1,0,n.events.slice(D)),n.events.length=_,u(k)}return a(k)}function u(k){if(r===t.length){if(!i)return p(k);if(i.currentConstruct&&i.currentConstruct.concrete)return g(k);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Rn,f,c)(k)}function f(k){return i&&C(),y(r),p(k)}function c(k){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,g(k)}function p(k){return n.containerState={},e.attempt(Rn,h,g)(k)}function h(k){return r++,t.push([n.currentConstruct,n.containerState]),p(k)}function g(k){if(k===null){i&&C(),y(0),e.consume(k);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(k)}function x(k){if(k===null){E(e.exit("chunkFlow"),!0),y(0),e.consume(k);return}return N(k)?(e.consume(k),E(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(k),x)}function E(k,D){const z=n.sliceStream(k);if(D&&z.push(null),k.previous=o,o&&(o.next=k),o=k,i.defineSkip(k.start),i.write(z),n.parser.lazy[k.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<l&&(!i.events[w][1].end||i.events[w][1].end.offset>l))return;const _=n.events.length;let U=_,j,b;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if(j){b=n.events[U][1].end;break}j=!0}for(y(r),w=_;w<n.events.length;)n.events[w][1].end={...b},w++;le(n.events,U+1,0,n.events.slice(_)),n.events.length=w}}function y(k){let D=t.length;for(;D-- >k;){const z=t[D];n.containerState=z[1],z[0].exit.call(n,e)}t.length=k}function C(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Fl(e,n,t){return V(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fe(e){if(e===null||G(e)||Ae(e))return 1;if(pt(e))return 2}function mt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const qt={name:"attention",resolveAll:Ml,tokenize:jl};function Ml(e,n){let t=-1,r,i,o,l,a,s,u,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;s=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},p={...e[t][1].start};zn(c,-s),zn(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ae(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=ae(u,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),u=ae(u,mt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=ae(u,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,u=ae(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,le(e,r-1,t-r+3,u),t=r+u.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function jl(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Fe(r);let o;return l;function l(s){return o=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===o)return e.consume(s),a;const u=e.exit("attentionSequence"),f=Fe(s),c=!f||f===2&&i||t.includes(s),p=!i||i===2&&f||t.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),n(s)}}function zn(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Bl={name:"autolink",tokenize:Ul};function Ul(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ee(h)?(e.consume(h),l):h===64?t(h):u(h)}function l(h){return h===43||h===45||h===46||J(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,s):(h===43||h===45||h===46||J(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function s(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||ut(h)?t(h):(e.consume(h),s)}function u(h){return h===64?(e.consume(h),f):Dl(h)?(e.consume(h),u):t(h)}function f(h){return J(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||J(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return t(h)}}const Ze={partial:!0,tokenize:Hl};function Hl(e,n,t){return r;function r(o){return H(o)?V(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||N(o)?n(o):t(o)}}const Ir={continuation:{tokenize:Vl},exit:$l,name:"blockQuote",tokenize:ql};function ql(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return H(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function Vl(e,n,t){const r=this;return i;function i(l){return H(l)?V(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Ir,n,t)(l)}}function $l(e){e.exit("blockQuote")}const Ar={name:"characterEscape",tokenize:Gl};function Gl(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return _l(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const Pr={name:"characterReference",tokenize:Wl};function Wl(e,n,t){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),s}function s(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=J,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Ll,f):(e.enter("characterReferenceValue"),o=7,l=Ht,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===J&&!nn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const Nn={partial:!0,tokenize:Yl},On={concrete:!0,name:"codeFenced",tokenize:Kl};function Kl(e,n,t){const r=this,i={partial:!0,tokenize:z};let o=0,l=0,a;return s;function s(w){return u(w)}function u(w){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(w)}function f(w){return w===a?(l++,e.consume(w),f):l<3?t(w):(e.exit("codeFencedFenceSequence"),H(w)?V(e,c,"whitespace")(w):c(w))}function c(w){return w===null||N(w)?(e.exit("codeFencedFence"),r.interrupt?n(w):e.check(Nn,x,D)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||N(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(w)):H(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,h,"whitespace")(w)):w===96&&w===a?t(w):(e.consume(w),p)}function h(w){return w===null||N(w)?c(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||N(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(w)):w===96&&w===a?t(w):(e.consume(w),g)}function x(w){return e.attempt(i,D,E)(w)}function E(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return o>0&&H(w)?V(e,C,"linePrefix",o+1)(w):C(w)}function C(w){return w===null||N(w)?e.check(Nn,x,D)(w):(e.enter("codeFlowValue"),k(w))}function k(w){return w===null||N(w)?(e.exit("codeFlowValue"),C(w)):(e.consume(w),k)}function D(w){return e.exit("codeFenced"),n(w)}function z(w,_,U){let j=0;return b;function b(F){return w.enter("lineEnding"),w.consume(F),w.exit("lineEnding"),P}function P(F){return w.enter("codeFencedFence"),H(F)?V(w,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):A(F)}function A(F){return F===a?(w.enter("codeFencedFenceSequence"),L(F)):U(F)}function L(F){return F===a?(j++,w.consume(F),L):j>=l?(w.exit("codeFencedFenceSequence"),H(F)?V(w,R,"whitespace")(F):R(F)):U(F)}function R(F){return F===null||N(F)?(w.exit("codeFencedFence"),_(F)):U(F)}}}function Yl(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const St={name:"codeIndented",tokenize:Ql},Xl={partial:!0,tokenize:Jl};function Ql(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),V(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):t(u)}function l(u){return u===null?s(u):N(u)?e.attempt(Xl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||N(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function Jl(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):N(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):V(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):N(l)?i(l):t(l)}}const Zl={name:"codeText",previous:to,resolve:eo,tokenize:no};function eo(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 to(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function no(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),s(c))}function s(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),s):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):N(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||N(c)?(e.exit("codeTextData"),s(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",u(c))}}class ro{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$e(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),$e(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),$e(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);$e(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);$e(this.left,t.reverse())}}}function $e(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 Dr(e){const n={};let t=-1,r,i,o,l,a,s,u;const f=new ro(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"&&(s=r[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,io(f,t)),t=n[t],u=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[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 le(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function io(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,s=[],u={};let f,c,p=-1,h=t,g=0,x=0;const E=[x];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(x=p+1,E.push(x),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):E.pop(),p=E.length;p--;){const y=a.slice(E[p],E[p+1]),C=o.pop();s.push([C,C+y.length-1]),e.splice(C,2,y)}for(s.reverse(),p=-1;++p<s.length;)u[g+s[p][0]]=g+s[p][1],g+=s[p][1]-s[p][0]-1;return u}const lo={resolve:ao,tokenize:so},oo={partial:!0,tokenize:uo};function ao(e){return Dr(e),e}function so(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?o(a):N(a)?e.check(oo,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function uo(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),V(e,o,"linePrefix")}function o(l){if(l===null||N(l))return t(l);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(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function Lr(e,n,t,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||ut(y)?t(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||N(y)?t(y):(e.consume(y),y===92?g:h)}function g(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function x(y){return!f&&(y===null||y===41||G(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(y)):f<u&&y===40?(e.consume(y),f++,x):y===41?(e.consume(y),f--,x):y===null||y===32||y===40||ut(y)?t(y):(e.consume(y),y===92?E:x)}function E(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}function _r(e,n,t,r,i,o){const l=this;let a=0,s;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!s||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):N(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||N(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),s||(s=!H(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function Rr(e,n,t,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):t(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?t(p):N(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),V(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||N(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Ke(e,n){let t;return r;function r(i){return N(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):H(i)?V(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const co={name:"definition",tokenize:ho},fo={partial:!0,tokenize:po};function ho(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return _r.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=he(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),s):t(h)}function s(h){return G(h)?Ke(e,u)(h):u(h)}function u(h){return Lr(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(fo,c,c)(h)}function c(h){return H(h)?V(e,p,"whitespace")(h):p(h)}function p(h){return h===null||N(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function po(e,n,t){return r;function r(a){return G(a)?Ke(e,i)(a):t(a)}function i(a){return Rr(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return H(a)?V(e,l,"whitespace")(a):l(a)}function l(a){return a===null||N(a)?n(a):t(a)}}const mo={name:"hardBreakEscape",tokenize:go};function go(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return N(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const yo={name:"headingAtx",resolve:ko,tokenize:xo};function ko(e,n){let t=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},le(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function xo(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||G(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),s(f)):f===null||N(f)?(e.exit("atxHeading"),n(f)):H(f)?V(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function s(f){return f===35?(e.consume(f),s):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||G(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const bo=["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"],Fn=["pre","script","style","textarea"],wo={concrete:!0,name:"htmlFlow",resolveTo:Eo,tokenize:To},So={partial:!0,tokenize:Io},Co={partial:!0,tokenize:vo};function Eo(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 To(e,n,t){const r=this;let i,o,l,a,s;return u;function u(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,x):d===63?(e.consume(d),i=3,r.interrupt?n:m):ee(d)?(e.consume(d),l=String.fromCharCode(d),E):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):ee(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function g(d){const ce="CDATA[";return d===ce.charCodeAt(a++)?(e.consume(d),a===ce.length?r.interrupt?n:A:g):t(d)}function x(d){return ee(d)?(e.consume(d),l=String.fromCharCode(d),E):t(d)}function E(d){if(d===null||d===47||d===62||G(d)){const ce=d===47,Te=l.toLowerCase();return!ce&&!o&&Fn.includes(Te)?(i=1,r.interrupt?n(d):A(d)):bo.includes(l.toLowerCase())?(i=6,ce?(e.consume(d),y):r.interrupt?n(d):A(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?C(d):k(d))}return d===45||J(d)?(e.consume(d),l+=String.fromCharCode(d),E):t(d)}function y(d){return d===62?(e.consume(d),r.interrupt?n:A):t(d)}function C(d){return H(d)?(e.consume(d),C):b(d)}function k(d){return d===47?(e.consume(d),b):d===58||d===95||ee(d)?(e.consume(d),D):H(d)?(e.consume(d),k):b(d)}function D(d){return d===45||d===46||d===58||d===95||J(d)?(e.consume(d),D):z(d)}function z(d){return d===61?(e.consume(d),w):H(d)?(e.consume(d),z):k(d)}function w(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),s=d,_):H(d)?(e.consume(d),w):U(d)}function _(d){return d===s?(e.consume(d),s=null,j):d===null||N(d)?t(d):(e.consume(d),_)}function U(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||G(d)?z(d):(e.consume(d),U)}function j(d){return d===47||d===62||H(d)?k(d):t(d)}function b(d){return d===62?(e.consume(d),P):t(d)}function P(d){return d===null||N(d)?A(d):H(d)?(e.consume(d),P):t(d)}function A(d){return d===45&&i===2?(e.consume(d),Y):d===60&&i===1?(e.consume(d),X):d===62&&i===4?(e.consume(d),ue):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),ge):N(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(So,ye,L)(d)):d===null||N(d)?(e.exit("htmlFlowData"),L(d)):(e.consume(d),A)}function L(d){return e.check(Co,R,ye)(d)}function R(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),F}function F(d){return d===null||N(d)?L(d):(e.enter("htmlFlowData"),A(d))}function Y(d){return d===45?(e.consume(d),m):A(d)}function X(d){return d===47?(e.consume(d),l="",se):A(d)}function se(d){if(d===62){const ce=l.toLowerCase();return Fn.includes(ce)?(e.consume(d),ue):A(d)}return ee(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),se):A(d)}function ge(d){return d===93?(e.consume(d),m):A(d)}function m(d){return d===62?(e.consume(d),ue):d===45&&i===2?(e.consume(d),m):A(d)}function ue(d){return d===null||N(d)?(e.exit("htmlFlowData"),ye(d)):(e.consume(d),ue)}function ye(d){return e.exit("htmlFlow"),n(d)}}function vo(e,n,t){const r=this;return i;function i(l){return N(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function Io(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const Ao={name:"htmlText",tokenize:Po};function Po(e,n,t){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),z):m===63?(e.consume(m),k):ee(m)?(e.consume(m),U):t(m)}function u(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):ee(m)?(e.consume(m),C):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):N(m)?(l=c,X(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?Y(m):m===45?p(m):c(m)}function g(m){const ue="CDATA[";return m===ue.charCodeAt(o++)?(e.consume(m),o===ue.length?x:g):t(m)}function x(m){return m===null?t(m):m===93?(e.consume(m),E):N(m)?(l=x,X(m)):(e.consume(m),x)}function E(m){return m===93?(e.consume(m),y):x(m)}function y(m){return m===62?Y(m):m===93?(e.consume(m),y):x(m)}function C(m){return m===null||m===62?Y(m):N(m)?(l=C,X(m)):(e.consume(m),C)}function k(m){return m===null?t(m):m===63?(e.consume(m),D):N(m)?(l=k,X(m)):(e.consume(m),k)}function D(m){return m===62?Y(m):k(m)}function z(m){return ee(m)?(e.consume(m),w):t(m)}function w(m){return m===45||J(m)?(e.consume(m),w):_(m)}function _(m){return N(m)?(l=_,X(m)):H(m)?(e.consume(m),_):Y(m)}function U(m){return m===45||J(m)?(e.consume(m),U):m===47||m===62||G(m)?j(m):t(m)}function j(m){return m===47?(e.consume(m),Y):m===58||m===95||ee(m)?(e.consume(m),b):N(m)?(l=j,X(m)):H(m)?(e.consume(m),j):Y(m)}function b(m){return m===45||m===46||m===58||m===95||J(m)?(e.consume(m),b):P(m)}function P(m){return m===61?(e.consume(m),A):N(m)?(l=P,X(m)):H(m)?(e.consume(m),P):j(m)}function A(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,L):N(m)?(l=A,X(m)):H(m)?(e.consume(m),A):(e.consume(m),R)}function L(m){return m===i?(e.consume(m),i=void 0,F):m===null?t(m):N(m)?(l=L,X(m)):(e.consume(m),L)}function R(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||G(m)?j(m):(e.consume(m),R)}function F(m){return m===47||m===62||G(m)?j(m):t(m)}function Y(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function X(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),se}function se(m){return H(m)?V(e,ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ge(m)}function ge(m){return e.enter("htmlTextData"),l(m)}}const rn={name:"labelEnd",resolveAll:Ro,resolveTo:zo,tokenize:No},Do={tokenize:Oo},Lo={tokenize:Fo},_o={tokenize:Mo};function Ro(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&&le(e,0,e.length,t),e}function zo(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",s,n],["enter",u,n]],a=ae(a,e.slice(o+1,o+r+3)),a=ae(a,[["enter",f,n]]),a=ae(a,mt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=ae(a,[["exit",f,n],e[l-2],e[l-1],["exit",u,n]]),a=ae(a,e.slice(l+1)),a=ae(a,[["exit",s,n]]),le(e,o,e.length,a),e}function No(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(he(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):t(p)}function s(p){return p===40?e.attempt(Do,f,l?f:c)(p):p===91?e.attempt(Lo,f,l?u:c)(p):l?f(p):c(p)}function u(p){return e.attempt(_o,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function Oo(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 G(c)?Ke(e,o)(c):o(c)}function o(c){return c===41?f(c):Lr(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return G(c)?Ke(e,s)(c):f(c)}function a(c){return t(c)}function s(c){return c===34||c===39||c===40?Rr(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return G(c)?Ke(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 Fo(e,n,t){const r=this;return i;function i(a){return _r.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(he(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function Mo(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const jo={name:"labelStartImage",resolveAll:rn.resolveAll,tokenize:Bo};function Bo(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const Uo={name:"labelStartLink",resolveAll:rn.resolveAll,tokenize:Ho};function Ho(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Ct={name:"lineEnding",tokenize:qo};function qo(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),V(e,n,"linePrefix")}}const st={name:"thematicBreak",tokenize:Vo};function Vo(e,n,t){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||N(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),H(u)?V(e,a,"whitespace")(u):a(u))}}const te={continuation:{tokenize:Ko},exit:Xo,name:"list",tokenize:Wo},$o={partial:!0,tokenize:Qo},Go={partial:!0,tokenize:Yo};function Wo(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ht(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(st,t,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(h)}return t(h)}function s(h){return Ht(h)&&++l<10?(e.consume(h),s):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):t(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ze,r.interrupt?t:f,e.attempt($o,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return H(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function Ko(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,V(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!H(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Go,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,V(e,e.attempt(te,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Yo(e,n,t){const r=this;return V(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function Xo(e){e.exit(this.containerState.type)}function Qo(e,n,t){const r=this;return V(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!H(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const Mn={name:"setextUnderline",resolveTo:Jo,tokenize:Zo};function Jo(e,n){let t=e.length,r,i,o;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),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function Zo(e,n,t){const r=this;let i;return o;function o(u){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=u,l(u)):t(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),H(u)?V(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||N(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const ea={tokenize:ta};function ta(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,V(e,e.attempt(this.parser.constructs.flow,i,e.attempt(lo,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const na={resolveAll:Nr()},ra=zr("string"),ia=zr("text");function zr(e){return{resolveAll:Nr(e==="text"?la:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return u(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),s}function s(f){return u(f)?(t.exit("data"),o(f)):(t.consume(f),s)}function u(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Nr(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function la(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 o=i.length,l=-1,a=0,s;for(;o--;){const u=i[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(u===-2)s=!0,a++;else if(u!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const oa={42:te,43:te,45:te,48:te,49:te,50:te,51:te,52:te,53:te,54:te,55:te,56:te,57:te,62:Ir},aa={91:co},sa={[-2]:St,[-1]:St,32:St},ua={35:yo,42:st,45:[Mn,st],60:wo,61:Mn,95:st,96:On,126:On},ca={38:Pr,92:Ar},fa={[-5]:Ct,[-4]:Ct,[-3]:Ct,33:jo,38:Pr,42:qt,60:[Bl,Ao],91:Uo,92:[mo,Ar],93:rn,95:qt,96:Zl},ha={null:[qt,na]},pa={null:[42,95]},ma={null:[]},da=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pa,contentInitial:aa,disable:ma,document:oa,flow:ua,flowInitial:sa,insideSpan:ha,string:ca,text:fa},Symbol.toStringTag,{value:"Module"}));function ga(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={},o=[];let l=[],a=[];const s={attempt:_(z),check:_(w),consume:C,enter:k,exit:D,interrupt:_(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(u,s);return n.resolveAll&&o.push(n),u;function c(P){return l=ae(l,P),E(),l[l.length-1]!==null?[]:(U(n,0),u.events=mt(o,u.events,u),u.events)}function p(P,A){return ka(h(P),A)}function h(P){return ya(l,P)}function g(){const{_bufferIndex:P,_index:A,line:L,column:R,offset:F}=r;return{_bufferIndex:P,_index:A,line:L,column:R,offset:F}}function x(P){i[P.line]=P.column,b()}function E(){let P;for(;r._index<l.length;){const A=l[r._index];if(typeof A=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<A.length;)y(A.charCodeAt(r._bufferIndex));else y(A)}}function y(P){f=f(P)}function C(P){N(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,b()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=P}function k(P,A){const L=A||{};return L.type=P,L.start=g(),u.events.push(["enter",L,u]),a.push(L),L}function D(P){const A=a.pop();return A.end=g(),u.events.push(["exit",A,u]),A}function z(P,A){U(P,A.from)}function w(P,A){A.restore()}function _(P,A){return L;function L(R,F,Y){let X,se,ge,m;return Array.isArray(R)?ye(R):"tokenize"in R?ye([R]):ue(R);function ue(Q){return Be;function Be(we){const De=we!==null&&Q[we],Le=we!==null&&Q.null,tt=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return ye(tt)(we)}}function ye(Q){return X=Q,se=0,Q.length===0?Y:d(Q[se])}function d(Q){return Be;function Be(we){return m=j(),ge=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?Te():Q.tokenize.call(A?Object.assign(Object.create(u),A):u,s,ce,Te)(we)}}function ce(Q){return P(ge,m),F}function Te(Q){return m.restore(),++se<X.length?d(X[se]):Y}}}function U(P,A){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&le(u.events,A,u.events.length-A,P.resolve(u.events.slice(A),u)),P.resolveTo&&(u.events=P.resolveTo(u.events,u))}function j(){const P=g(),A=u.previous,L=u.currentConstruct,R=u.events.length,F=Array.from(a);return{from:R,restore:Y};function Y(){r=P,u.previous=A,u.currentConstruct=L,u.events.length=R,a=F,b()}}function b(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ya(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function ka(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
3
3
  `;break}case-3:{l=`\r
4
- `;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function xa(e){const r={constructs:Tr([da,...(e||{}).extensions||[]]),content:i(Rl),defined:[],document:i(Nl),flow:i(ea),lazy:{},string:i(ra),text:i(ia)};return r;function i(o){return l;function l(a){return ga(r,o,a)}}}function ba(e){for(;!Dr(e););return e}const jn=/[\0\t\n\r]/g;function wa(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(jn.lastIndex=c,s=jn.exec(o),p=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(p),!s){n=o.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(o.slice(c,p)),e+=p-c),h){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=p+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const Sa=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ca(e){return e.replace(Sa,Ea)}function Ea(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return vr(t.slice(o?2:1),o?16:10)}return nn(t)||e}const Or={}.hasOwnProperty;function Ta(e,n,t){return typeof n!="string"&&(t=n,n=void 0),va(t)(ba(xa(t).document().write(wa()(e,n,!0))))}function va(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(kn),autolinkProtocol:M,autolinkEmail:M,atxHeading:o(dn),blockQuote:o(Le),characterEscape:M,characterReference:M,codeFenced:o(tt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(tt,l),codeText:o(bi,l),codeTextData:M,data:M,codeFlowValue:M,definition:o(wi),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Si),hardBreakEscape:o(gn),hardBreakTrailing:o(gn),htmlFlow:o(yn,l),htmlFlowData:M,htmlText:o(yn,l),htmlTextData:M,image:o(Ci),label:l,link:o(kn),listItem:o(Ei),listItemValue:p,listOrdered:o(xn,c),listUnordered:o(xn),paragraph:o(Ti),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(dn),strong:o(vi),thematicBreak:o(Ai)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:De,autolinkProtocol:we,blockQuote:u(),characterEscapeValue:x,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:X,characterReference:Be,codeFenced:u(C),codeFencedFence:k,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:x,codeIndented:u(y),codeText:u(F),codeTextData:x,data:x,definition:u(),definitionDestinationString:_,definitionLabelString:E,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(A),hardBreakTrailing:u(A),htmlFlow:u(P),htmlFlowData:x,htmlText:u(L),htmlTextData:x,image:u(Q),label:ge,labelText:se,lineEnding:D,link:u(Y),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ce,resourceDestinationString:m,resourceTitleString:ue,resource:ye,setextHeading:u(U),setextHeadingLineSequence:N,setextHeadingText:b,strong:u(),thematicBreak:u()}};Fr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(S){let I={type:"root",children:[]};const j={stack:[I],tokenStack:[],config:n,enter:a,exit:s,buffer:l,resume:f,data:t},q=[];let $=-1;for(;++$<S.length;)if(S[$][1].type==="listOrdered"||S[$][1].type==="listUnordered")if(S[$][0]==="enter")q.push($);else{const fe=q.pop();$=i(S,fe,$)}for($=-1;++$<S.length;){const fe=n[S[$][0]];Or.call(fe,S[$][1].type)&&fe[S[$][1].type].call(Object.assign({sliceSerialize:S[$][2].sliceSerialize},j),S[$][1])}if(j.tokenStack.length>0){const fe=j.tokenStack[j.tokenStack.length-1];(fe[1]||Bn).call(j,void 0,fe[0])}for(I.position={start:Se(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:Se(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},$=-1;++$<n.transforms.length;)I=n.transforms[$](I)||I;return I}function i(S,I,j){let q=I-1,$=-1,fe=!1,ve,ke,Ue,He;for(;++q<=j;){const re=S[q];switch(re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{re[0]==="enter"?$++:$--,He=void 0;break}case"lineEndingBlank":{re[0]==="enter"&&(ve&&!He&&!$&&!Ue&&(Ue=q),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!$&&re[0]==="enter"&&re[1].type==="listItemPrefix"||$===-1&&re[0]==="exit"&&(re[1].type==="listUnordered"||re[1].type==="listOrdered")){if(ve){let _e=q;for(ke=void 0;_e--;){const xe=S[_e];if(xe[1].type==="lineEnding"||xe[1].type==="lineEndingBlank"){if(xe[0]==="exit")continue;ke&&(S[ke][1].type="lineEndingBlank",fe=!0),xe[1].type="lineEnding",ke=_e}else if(!(xe[1].type==="linePrefix"||xe[1].type==="blockQuotePrefix"||xe[1].type==="blockQuotePrefixWhitespace"||xe[1].type==="blockQuoteMarker"||xe[1].type==="listItemIndent"))break}Ue&&(!ke||Ue<ke)&&(ve._spread=!0),ve.end=Object.assign({},ke?S[ke][1].start:re[1].end),S.splice(ke||q,0,["exit",ve,re[2]]),q++,j++}if(re[1].type==="listItemPrefix"){const _e={type:"listItem",_spread:!1,start:Object.assign({},re[1].start),end:void 0};ve=_e,S.splice(q,0,["enter",_e,re[2]]),q++,j++,Ue=void 0,He=!0}}}return S[I][1]._spread=fe,j}function o(S,I){return j;function j(q){a.call(this,S(q),q),I&&I.call(this,q)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(S,I,j){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([I,j||void 0]),S.position={start:Se(I.start),end:void 0}}function u(S){return I;function I(j){S&&S.call(this,j),s.call(this,j)}}function s(S,I){const j=this.stack.pop(),q=this.tokenStack.pop();if(q)q[0].type!==S.type&&(I?I.call(this,S,q[0]):(q[1]||Bn).call(this,S,q[0]));else throw new Error("Cannot close `"+S.type+"` ("+We({start:S.start,end:S.end})+"): it’s not open");j.position.end=Se(S.end)}function f(){return tn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(S){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function h(){const S=this.resume(),I=this.stack[this.stack.length-1];I.lang=S}function g(){const S=this.resume(),I=this.stack[this.stack.length-1];I.meta=S}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S.replace(/(\r?\n|\r)$/g,"")}function E(S){const I=this.resume(),j=this.stack[this.stack.length-1];j.label=I,j.identifier=he(this.sliceSerialize(S)).toLowerCase()}function w(){const S=this.resume(),I=this.stack[this.stack.length-1];I.title=S}function _(){const S=this.resume(),I=this.stack[this.stack.length-1];I.url=S}function R(S){const I=this.stack[this.stack.length-1];if(!I.depth){const j=this.sliceSerialize(S).length;I.depth=j}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function N(S){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function M(S){const j=this.stack[this.stack.length-1].children;let q=j[j.length-1];(!q||q.type!=="text")&&(q=Ii(),q.position={start:Se(S.start),end:void 0},j.push(q)),this.stack.push(q)}function x(S){const I=this.stack.pop();I.value+=this.sliceSerialize(S),I.position.end=Se(S.end)}function D(S){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const j=I.children[I.children.length-1];j.position.end=Se(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(I.type)&&(M.call(this,S),x.call(this,S))}function A(){this.data.atHardBreak=!0}function P(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function L(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function F(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function Y(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=I,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function Q(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=I,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function se(S){const I=this.sliceSerialize(S),j=this.stack[this.stack.length-2];j.label=Ca(I),j.identifier=he(I).toLowerCase()}function ge(){const S=this.stack[this.stack.length-1],I=this.resume(),j=this.stack[this.stack.length-1];if(this.data.inReference=!0,j.type==="link"){const q=S.children;j.children=q}else j.alt=I}function m(){const S=this.resume(),I=this.stack[this.stack.length-1];I.url=S}function ue(){const S=this.resume(),I=this.stack[this.stack.length-1];I.title=S}function ye(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ce(S){const I=this.resume(),j=this.stack[this.stack.length-1];j.label=I,j.identifier=he(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function Te(S){this.data.characterReferenceType=S.type}function X(S){const I=this.sliceSerialize(S),j=this.data.characterReferenceType;let q;j?(q=vr(I,j==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):q=nn(I);const $=this.stack[this.stack.length-1];$.value+=q}function Be(S){const I=this.stack.pop();I.position.end=Se(S.end)}function we(S){x.call(this,S);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(S)}function De(S){x.call(this,S);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(S)}function Le(){return{type:"blockquote",children:[]}}function tt(){return{type:"code",lang:null,meta:null,value:""}}function bi(){return{type:"inlineCode",value:""}}function wi(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Si(){return{type:"emphasis",children:[]}}function dn(){return{type:"heading",depth:0,children:[]}}function gn(){return{type:"break"}}function yn(){return{type:"html",value:""}}function Ci(){return{type:"image",title:null,url:"",alt:null}}function kn(){return{type:"link",title:null,url:"",children:[]}}function xn(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function Ei(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function Ti(){return{type:"paragraph",children:[]}}function vi(){return{type:"strong",children:[]}}function Ii(){return{type:"text",value:""}}function Ai(){return{type:"thematicBreak"}}}function Se(e){return{line:e.line,column:e.column,offset:e.offset}}function Fr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Fr(e,r):Ia(e,r)}}function Ia(e,n){let t;for(t in n)if(Or.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+"` ("+We({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+We({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+We({start:n.start,end:n.end})+") is still open")}function Aa(e){const n=this;n.parser=t;function t(r){return Ta(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Pa(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 Da(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
4
+ `;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function xa(e){const r={constructs:Tr([da,...(e||{}).extensions||[]]),content:i(Rl),defined:[],document:i(Nl),flow:i(ea),lazy:{},string:i(ra),text:i(ia)};return r;function i(o){return l;function l(a){return ga(r,o,a)}}}function ba(e){for(;!Dr(e););return e}const jn=/[\0\t\n\r]/g;function wa(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const s=[];let u,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(jn.lastIndex=c,u=jn.exec(o),p=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(p),!u){n=o.slice(c);break}if(h===10&&c===p&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<p&&(s.push(o.slice(c,p)),e+=p-c),h){case 0:{s.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,s.push(-2);e++<f;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const Sa=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ca(e){return e.replace(Sa,Ea)}function Ea(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return vr(t.slice(o?2:1),o?16:10)}return nn(t)||e}const Or={}.hasOwnProperty;function Ta(e,n,t){return typeof n!="string"&&(t=n,n=void 0),va(t)(ba(xa(t).document().write(wa()(e,n,!0))))}function va(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(kn),autolinkProtocol:j,autolinkEmail:j,atxHeading:o(dn),blockQuote:o(Le),characterEscape:j,characterReference:j,codeFenced:o(tt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(tt,l),codeText:o(bi,l),codeTextData:j,data:j,codeFlowValue:j,definition:o(wi),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Si),hardBreakEscape:o(gn),hardBreakTrailing:o(gn),htmlFlow:o(yn,l),htmlFlowData:j,htmlText:o(yn,l),htmlTextData:j,image:o(Ci),label:l,link:o(kn),listItem:o(Ei),listItemValue:p,listOrdered:o(xn,c),listUnordered:o(xn),paragraph:o(Ti),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(dn),strong:o(vi),thematicBreak:o(Ai)},exit:{atxHeading:s(),atxHeadingSequence:z,autolink:s(),autolinkEmail:De,autolinkProtocol:we,blockQuote:s(),characterEscapeValue:b,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:Q,characterReference:Be,codeFenced:s(E),codeFencedFence:x,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:b,codeIndented:s(y),codeText:s(F),codeTextData:b,data:b,definition:s(),definitionDestinationString:D,definitionLabelString:C,definitionTitleString:k,emphasis:s(),hardBreakEscape:s(A),hardBreakTrailing:s(A),htmlFlow:s(L),htmlFlowData:b,htmlText:s(R),htmlTextData:b,image:s(X),label:ge,labelText:se,lineEnding:P,link:s(Y),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:ce,resourceDestinationString:m,resourceTitleString:ue,resource:ye,setextHeading:s(U),setextHeadingLineSequence:_,setextHeadingText:w,strong:s(),thematicBreak:s()}};Fr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(S){let I={type:"root",children:[]};const M={stack:[I],tokenStack:[],config:n,enter:a,exit:u,buffer:l,resume:f,data:t},q=[];let $=-1;for(;++$<S.length;)if(S[$][1].type==="listOrdered"||S[$][1].type==="listUnordered")if(S[$][0]==="enter")q.push($);else{const fe=q.pop();$=i(S,fe,$)}for($=-1;++$<S.length;){const fe=n[S[$][0]];Or.call(fe,S[$][1].type)&&fe[S[$][1].type].call(Object.assign({sliceSerialize:S[$][2].sliceSerialize},M),S[$][1])}if(M.tokenStack.length>0){const fe=M.tokenStack[M.tokenStack.length-1];(fe[1]||Bn).call(M,void 0,fe[0])}for(I.position={start:Se(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:Se(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},$=-1;++$<n.transforms.length;)I=n.transforms[$](I)||I;return I}function i(S,I,M){let q=I-1,$=-1,fe=!1,ve,ke,Ue,He;for(;++q<=M;){const re=S[q];switch(re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{re[0]==="enter"?$++:$--,He=void 0;break}case"lineEndingBlank":{re[0]==="enter"&&(ve&&!He&&!$&&!Ue&&(Ue=q),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!$&&re[0]==="enter"&&re[1].type==="listItemPrefix"||$===-1&&re[0]==="exit"&&(re[1].type==="listUnordered"||re[1].type==="listOrdered")){if(ve){let _e=q;for(ke=void 0;_e--;){const xe=S[_e];if(xe[1].type==="lineEnding"||xe[1].type==="lineEndingBlank"){if(xe[0]==="exit")continue;ke&&(S[ke][1].type="lineEndingBlank",fe=!0),xe[1].type="lineEnding",ke=_e}else if(!(xe[1].type==="linePrefix"||xe[1].type==="blockQuotePrefix"||xe[1].type==="blockQuotePrefixWhitespace"||xe[1].type==="blockQuoteMarker"||xe[1].type==="listItemIndent"))break}Ue&&(!ke||Ue<ke)&&(ve._spread=!0),ve.end=Object.assign({},ke?S[ke][1].start:re[1].end),S.splice(ke||q,0,["exit",ve,re[2]]),q++,M++}if(re[1].type==="listItemPrefix"){const _e={type:"listItem",_spread:!1,start:Object.assign({},re[1].start),end:void 0};ve=_e,S.splice(q,0,["enter",_e,re[2]]),q++,M++,Ue=void 0,He=!0}}}return S[I][1]._spread=fe,M}function o(S,I){return M;function M(q){a.call(this,S(q),q),I&&I.call(this,q)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(S,I,M){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([I,M||void 0]),S.position={start:Se(I.start),end:void 0}}function s(S){return I;function I(M){S&&S.call(this,M),u.call(this,M)}}function u(S,I){const M=this.stack.pop(),q=this.tokenStack.pop();if(q)q[0].type!==S.type&&(I?I.call(this,S,q[0]):(q[1]||Bn).call(this,S,q[0]));else throw new Error("Cannot close `"+S.type+"` ("+We({start:S.start,end:S.end})+"): it’s not open");M.position.end=Se(S.end)}function f(){return tn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(S){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function h(){const S=this.resume(),I=this.stack[this.stack.length-1];I.lang=S}function g(){const S=this.resume(),I=this.stack[this.stack.length-1];I.meta=S}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S.replace(/(\r?\n|\r)$/g,"")}function C(S){const I=this.resume(),M=this.stack[this.stack.length-1];M.label=I,M.identifier=he(this.sliceSerialize(S)).toLowerCase()}function k(){const S=this.resume(),I=this.stack[this.stack.length-1];I.title=S}function D(){const S=this.resume(),I=this.stack[this.stack.length-1];I.url=S}function z(S){const I=this.stack[this.stack.length-1];if(!I.depth){const M=this.sliceSerialize(S).length;I.depth=M}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function _(S){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function j(S){const M=this.stack[this.stack.length-1].children;let q=M[M.length-1];(!q||q.type!=="text")&&(q=Ii(),q.position={start:Se(S.start),end:void 0},M.push(q)),this.stack.push(q)}function b(S){const I=this.stack.pop();I.value+=this.sliceSerialize(S),I.position.end=Se(S.end)}function P(S){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const M=I.children[I.children.length-1];M.position.end=Se(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(I.type)&&(j.call(this,S),b.call(this,S))}function A(){this.data.atHardBreak=!0}function L(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function R(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function F(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function Y(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=I,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function X(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=I,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function se(S){const I=this.sliceSerialize(S),M=this.stack[this.stack.length-2];M.label=Ca(I),M.identifier=he(I).toLowerCase()}function ge(){const S=this.stack[this.stack.length-1],I=this.resume(),M=this.stack[this.stack.length-1];if(this.data.inReference=!0,M.type==="link"){const q=S.children;M.children=q}else M.alt=I}function m(){const S=this.resume(),I=this.stack[this.stack.length-1];I.url=S}function ue(){const S=this.resume(),I=this.stack[this.stack.length-1];I.title=S}function ye(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ce(S){const I=this.resume(),M=this.stack[this.stack.length-1];M.label=I,M.identifier=he(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function Te(S){this.data.characterReferenceType=S.type}function Q(S){const I=this.sliceSerialize(S),M=this.data.characterReferenceType;let q;M?(q=vr(I,M==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):q=nn(I);const $=this.stack[this.stack.length-1];$.value+=q}function Be(S){const I=this.stack.pop();I.position.end=Se(S.end)}function we(S){b.call(this,S);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(S)}function De(S){b.call(this,S);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(S)}function Le(){return{type:"blockquote",children:[]}}function tt(){return{type:"code",lang:null,meta:null,value:""}}function bi(){return{type:"inlineCode",value:""}}function wi(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Si(){return{type:"emphasis",children:[]}}function dn(){return{type:"heading",depth:0,children:[]}}function gn(){return{type:"break"}}function yn(){return{type:"html",value:""}}function Ci(){return{type:"image",title:null,url:"",alt:null}}function kn(){return{type:"link",title:null,url:"",children:[]}}function xn(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function Ei(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function Ti(){return{type:"paragraph",children:[]}}function vi(){return{type:"strong",children:[]}}function Ii(){return{type:"text",value:""}}function Ai(){return{type:"thematicBreak"}}}function Se(e){return{line:e.line,column:e.column,offset:e.offset}}function Fr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Fr(e,r):Ia(e,r)}}function Ia(e,n){let t;for(t in n)if(Or.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+"` ("+We({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+We({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+We({start:n.start,end:n.end})+") is still open")}function Aa(e){const n=this;n.parser=t;function t(r){return Ta(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Pa(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 Da(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
5
5
  `}]}function La(e,n){const t=n.value?n.value+`
6
- `:"",r={};n.lang&&(r.className=["language-"+n.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function _a(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ra(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function za(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=je(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+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(l)}]};e.patch(n,u);const s={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,s),e.applyData(n,s)}function Na(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 Oa(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Mr(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function Fa(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Mr(e,n);const i={src:je(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function Ma(e,n){const t={src:je(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 ja(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 Ba(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Mr(e,n);const i={href:je(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function Ua(e,n){const t={href:je(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 Ha(e,n,t){const r=e.all(n),i=t?qa(t):jr(n),o={},l=[];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:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
7
- `}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
8
- `});const s={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,s),e.applyData(n,s)}function qa(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=jr(t[r])}return n}function jr(e){const n=e.spread;return n??e.children.length>1}function Va(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 l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function $a(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ga(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function Wa(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ka(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Xt(n.children[1]),u=kr(n.children[n.children.length-1]);a&&u&&(l.position={start:a,end:u}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function Ya(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,a=l?l.length:n.children.length;let u=-1;const s=[];for(;++u<a;){const c=n.children[u],p={},h=l?l[u]:void 0;h&&(p.align=h);let g={type:"element",tagName:o,properties:p,children:[]};c&&(g.children=e.all(c),e.patch(c,g),g=e.applyData(c,g)),s.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(n,f),e.applyData(n,f)}function Qa(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const Un=9,Hn=32;function Xa(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const o=[];for(;r;)o.push(qn(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(qn(n.slice(i),i>0,!1)),o.join("")}function qn(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===Un||o===Hn;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===Un||o===Hn;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ja(e,n){const t={type:"text",value:Xa(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Za(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const es={blockquote:Pa,break:Da,code:La,delete:_a,emphasis:Ra,footnoteReference:za,heading:Na,html:Oa,imageReference:Fa,image:Ma,inlineCode:ja,linkReference:Ba,link:Ua,listItem:Ha,list:Va,paragraph:$a,root:Ga,strong:Wa,table:Ka,tableCell:Qa,tableRow:Ya,text:Ja,thematicBreak:Za,toml:nt,yaml:nt,definition:nt,footnoteDefinition:nt};function nt(){}const Br=-1,dt=0,Ye=1,ct=2,ln=3,on=4,an=5,sn=6,Ur=7,Hr=8,Vn=typeof self=="object"?self:globalThis,ts=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case dt:case Br:return t(l,i);case Ye:{const a=t([],i);for(const u of l)a.push(r(u));return a}case ct:{const a=t({},i);for(const[u,s]of l)a[r(u)]=r(s);return a}case ln:return t(new Date(l),i);case on:{const{source:a,flags:u}=l;return t(new RegExp(a,u),i)}case an:{const a=t(new Map,i);for(const[u,s]of l)a.set(r(u),r(s));return a}case sn:{const a=t(new Set,i);for(const u of l)a.add(r(u));return a}case Ur:{const{name:a,message:u}=l;return t(new Vn[a](u),i)}case Hr:return t(BigInt(l),i);case"BigInt":return t(Object(BigInt(l)),i);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:a}=new Uint8Array(l);return t(new DataView(a),l)}}return t(new Vn[o](l),i)};return r},$n=e=>ts(new Map,e)(0),ze="",{toString:ns}={},{keys:rs}=Object,Ge=e=>{const n=typeof e;if(n!=="object"||!e)return[dt,n];const t=ns.call(e).slice(8,-1);switch(t){case"Array":return[Ye,ze];case"Object":return[ct,ze];case"Date":return[ln,ze];case"RegExp":return[on,ze];case"Map":return[an,ze];case"Set":return[sn,ze];case"DataView":return[Ye,t]}return t.includes("Array")?[Ye,t]:t.includes("Error")?[Ur,t]:[ct,t]},rt=([e,n])=>e===dt&&(n==="function"||n==="symbol"),is=(e,n,t,r)=>{const i=(l,a)=>{const u=r.push(l)-1;return t.set(a,u),u},o=l=>{if(t.has(l))return t.get(l);let[a,u]=Ge(l);switch(a){case dt:{let f=l;switch(u){case"bigint":a=Hr,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([Br],l)}return i([a,f],l)}case Ye:{if(u){let p=l;return u==="DataView"?p=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(l)),i([u,[...p]],l)}const f=[],c=i([a,f],l);for(const p of l)f.push(o(p));return c}case ct:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(n&&"toJSON"in l)return o(l.toJSON());const f=[],c=i([a,f],l);for(const p of rs(l))(e||!rt(Ge(l[p])))&&f.push([o(p),o(l[p])]);return c}case ln:return i([a,l.toISOString()],l);case on:{const{source:f,flags:c}=l;return i([a,{source:f,flags:c}],l)}case an:{const f=[],c=i([a,f],l);for(const[p,h]of l)(e||!(rt(Ge(p))||rt(Ge(h))))&&f.push([o(p),o(h)]);return c}case sn:{const f=[],c=i([a,f],l);for(const p of l)(e||!rt(Ge(p)))&&f.push(o(p));return c}}const{message:s}=l;return i([a,{name:u,message:s}],l)};return o},Gn=(e,{json:n,lossy:t}={})=>{const r=[];return is(!(n||t),!!n,new Map,r)(e),r},ft=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?$n(Gn(e,n)):structuredClone(e):(e,n)=>$n(Gn(e,n));function ls(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 os(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function as(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||ls,r=e.options.footnoteBackLabel||os,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=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(),p=je(c.toLowerCase());let h=0;const g=[],k=e.footnoteCounts.get(c);for(;k!==void 0&&++h<=k;){g.length>0&&g.push({type:"text",value:" "});let E=typeof t=="string"?t:t(u,h);typeof E=="string"&&(E={type:"text",value:E}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,h),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const C=f[f.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const E=C.children[C.children.length-1];E&&E.type==="text"?E.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...g)}else f.push(...g);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(f,!0)};e.patch(s,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ft(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
6
+ `:"",r={};n.lang&&(r.className=["language-"+n.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function _a(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ra(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function za(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=je(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const s={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(l)}]};e.patch(n,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(n,u),e.applyData(n,u)}function Na(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 Oa(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Mr(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function Fa(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Mr(e,n);const i={src:je(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function Ma(e,n){const t={src:je(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 ja(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 Ba(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Mr(e,n);const i={href:je(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function Ua(e,n){const t={href:je(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 Ha(e,n,t){const r=e.all(n),i=t?qa(t):jr(n),o={},l=[];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:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
7
+ `}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const s=r[r.length-1];s&&(i||s.type!=="element"||s.tagName!=="p")&&l.push({type:"text",value:`
8
+ `});const u={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,u),e.applyData(n,u)}function qa(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=jr(t[r])}return n}function jr(e){const n=e.spread;return n??e.children.length>1}function Va(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 l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function $a(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ga(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function Wa(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ka(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Qt(n.children[1]),s=kr(n.children[n.children.length-1]);a&&s&&(l.position={start:a,end:s}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function Ya(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,a=l?l.length:n.children.length;let s=-1;const u=[];for(;++s<a;){const c=n.children[s],p={},h=l?l[s]:void 0;h&&(p.align=h);let g={type:"element",tagName:o,properties:p,children:[]};c&&(g.children=e.all(c),e.patch(c,g),g=e.applyData(c,g)),u.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,f),e.applyData(n,f)}function Xa(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const Un=9,Hn=32;function Qa(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const o=[];for(;r;)o.push(qn(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(qn(n.slice(i),i>0,!1)),o.join("")}function qn(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===Un||o===Hn;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===Un||o===Hn;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ja(e,n){const t={type:"text",value:Qa(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Za(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const es={blockquote:Pa,break:Da,code:La,delete:_a,emphasis:Ra,footnoteReference:za,heading:Na,html:Oa,imageReference:Fa,image:Ma,inlineCode:ja,linkReference:Ba,link:Ua,listItem:Ha,list:Va,paragraph:$a,root:Ga,strong:Wa,table:Ka,tableCell:Xa,tableRow:Ya,text:Ja,thematicBreak:Za,toml:nt,yaml:nt,definition:nt,footnoteDefinition:nt};function nt(){}const Br=-1,dt=0,Ye=1,ct=2,ln=3,on=4,an=5,sn=6,Ur=7,Hr=8,Vn=typeof self=="object"?self:globalThis,ts=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case dt:case Br:return t(l,i);case Ye:{const a=t([],i);for(const s of l)a.push(r(s));return a}case ct:{const a=t({},i);for(const[s,u]of l)a[r(s)]=r(u);return a}case ln:return t(new Date(l),i);case on:{const{source:a,flags:s}=l;return t(new RegExp(a,s),i)}case an:{const a=t(new Map,i);for(const[s,u]of l)a.set(r(s),r(u));return a}case sn:{const a=t(new Set,i);for(const s of l)a.add(r(s));return a}case Ur:{const{name:a,message:s}=l;return t(new Vn[a](s),i)}case Hr:return t(BigInt(l),i);case"BigInt":return t(Object(BigInt(l)),i);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:a}=new Uint8Array(l);return t(new DataView(a),l)}}return t(new Vn[o](l),i)};return r},$n=e=>ts(new Map,e)(0),ze="",{toString:ns}={},{keys:rs}=Object,Ge=e=>{const n=typeof e;if(n!=="object"||!e)return[dt,n];const t=ns.call(e).slice(8,-1);switch(t){case"Array":return[Ye,ze];case"Object":return[ct,ze];case"Date":return[ln,ze];case"RegExp":return[on,ze];case"Map":return[an,ze];case"Set":return[sn,ze];case"DataView":return[Ye,t]}return t.includes("Array")?[Ye,t]:t.includes("Error")?[Ur,t]:[ct,t]},rt=([e,n])=>e===dt&&(n==="function"||n==="symbol"),is=(e,n,t,r)=>{const i=(l,a)=>{const s=r.push(l)-1;return t.set(a,s),s},o=l=>{if(t.has(l))return t.get(l);let[a,s]=Ge(l);switch(a){case dt:{let f=l;switch(s){case"bigint":a=Hr,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);f=null;break;case"undefined":return i([Br],l)}return i([a,f],l)}case Ye:{if(s){let p=l;return s==="DataView"?p=new Uint8Array(l.buffer):s==="ArrayBuffer"&&(p=new Uint8Array(l)),i([s,[...p]],l)}const f=[],c=i([a,f],l);for(const p of l)f.push(o(p));return c}case ct:{if(s)switch(s){case"BigInt":return i([s,l.toString()],l);case"Boolean":case"Number":case"String":return i([s,l.valueOf()],l)}if(n&&"toJSON"in l)return o(l.toJSON());const f=[],c=i([a,f],l);for(const p of rs(l))(e||!rt(Ge(l[p])))&&f.push([o(p),o(l[p])]);return c}case ln:return i([a,l.toISOString()],l);case on:{const{source:f,flags:c}=l;return i([a,{source:f,flags:c}],l)}case an:{const f=[],c=i([a,f],l);for(const[p,h]of l)(e||!(rt(Ge(p))||rt(Ge(h))))&&f.push([o(p),o(h)]);return c}case sn:{const f=[],c=i([a,f],l);for(const p of l)(e||!rt(Ge(p)))&&f.push(o(p));return c}}const{message:u}=l;return i([a,{name:s,message:u}],l)};return o},Gn=(e,{json:n,lossy:t}={})=>{const r=[];return is(!(n||t),!!n,new Map,r)(e),r},ft=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?$n(Gn(e,n)):structuredClone(e):(e,n)=>$n(Gn(e,n));function ls(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 os(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function as(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||ls,r=e.options.footnoteBackLabel||os,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let s=-1;for(;++s<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[s]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),p=je(c.toLowerCase());let h=0;const g=[],x=e.footnoteCounts.get(c);for(;x!==void 0&&++h<=x;){g.length>0&&g.push({type:"text",value:" "});let C=typeof t=="string"?t:t(s,h);typeof C=="string"&&(C={type:"text",value:C}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(s,h),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const E=f[f.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const C=E.children[E.children.length-1];C&&C.type==="text"?C.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...g)}else f.push(...g);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ft(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
9
9
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
10
- `}]}}const gt=(function(e){if(e==null)return fs;if(typeof e=="function")return yt(e);if(typeof e=="object")return Array.isArray(e)?ss(e):us(e);if(typeof e=="string")return cs(e);throw new Error("Expected function, string, or object as test")});function ss(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=gt(e[t]);return yt(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function us(e){const n=e;return yt(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function cs(e){return yt(n);function n(t){return t&&t.type===e}}function yt(e){return n;function n(t,r,i){return!!(hs(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function fs(){return!0}function hs(e){return e!==null&&typeof e=="object"&&"type"in e}const qr=[],ps=!0,Vt=!1,ms="skip";function Vr(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=gt(i),l=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 h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(u.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=qr,g,k,C;if((!n||o(u,s,f[f.length-1]||void 0))&&(h=ds(t(u,f)),h[0]===Vt))return h;if("children"in u&&u.children){const y=u;if(y.children&&h[0]!==ms)for(k=(r?y.children.length:-1)+l,C=f.concat(y);k>-1&&k<y.children.length;){const E=y.children[k];if(g=a(E,k,C)(),g[0]===Vt)return g;k=typeof g[1]=="number"?g[1]:k+l}}return h}}}function ds(e){return Array.isArray(e)?e:typeof e=="number"?[ps,e]:e==null?qr:[e]}function un(e,n,t,r){let i,o,l;typeof n=="function"&&typeof t!="function"?(o=void 0,l=n,i=t):(o=n,l=t,i=r),Vr(e,o,a,i);function a(u,s){const f=s[s.length-1],c=f?f.children.indexOf(u):void 0;return l(u,c,f)}}const $t={}.hasOwnProperty,gs={};function ys(e,n){const t=n||gs,r=new Map,i=new Map,o=new Map,l={...es,...t.handlers},a={all:s,applyData:xs,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:u,options:t,patch:ks,wrap:ws};return un(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),a;function u(f,c){const p=f.type,h=a.handlers[p];if($t.call(a.handlers,p)&&h)return h(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:k,...C}=f,y=ft(C);return y.children=a.all(f),y}return ft(f)}return(a.options.unknownHandler||bs)(a,f,c)}function s(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const g=a.one(p[h],f);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Wn(g.value)),!Array.isArray(g)&&g.type==="element")){const k=g.children[0];k&&k.type==="text"&&(k.value=Wn(k.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function ks(e,n){e.position&&(n.position=ll(e))}function xs(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&o&&Object.assign(t.properties,ft(o)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function bs(e,n){const t=n.data||{},r="value"in n&&!($t.call(t,"hProperties")||$t.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 ws(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
10
+ `}]}}const gt=(function(e){if(e==null)return fs;if(typeof e=="function")return yt(e);if(typeof e=="object")return Array.isArray(e)?ss(e):us(e);if(typeof e=="string")return cs(e);throw new Error("Expected function, string, or object as test")});function ss(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=gt(e[t]);return yt(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function us(e){const n=e;return yt(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function cs(e){return yt(n);function n(t){return t&&t.type===e}}function yt(e){return n;function n(t,r,i){return!!(hs(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function fs(){return!0}function hs(e){return e!==null&&typeof e=="object"&&"type"in e}const qr=[],ps=!0,Vt=!1,ms="skip";function Vr(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=gt(i),l=r?-1:1;a(e,void 0,[])();function a(s,u,f){const c=s&&typeof s=="object"?s:{};if(typeof c.type=="string"){const h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(s.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=qr,g,x,E;if((!n||o(s,u,f[f.length-1]||void 0))&&(h=ds(t(s,f)),h[0]===Vt))return h;if("children"in s&&s.children){const y=s;if(y.children&&h[0]!==ms)for(x=(r?y.children.length:-1)+l,E=f.concat(y);x>-1&&x<y.children.length;){const C=y.children[x];if(g=a(C,x,E)(),g[0]===Vt)return g;x=typeof g[1]=="number"?g[1]:x+l}}return h}}}function ds(e){return Array.isArray(e)?e:typeof e=="number"?[ps,e]:e==null?qr:[e]}function un(e,n,t,r){let i,o,l;typeof n=="function"&&typeof t!="function"?(o=void 0,l=n,i=t):(o=n,l=t,i=r),Vr(e,o,a,i);function a(s,u){const f=u[u.length-1],c=f?f.children.indexOf(s):void 0;return l(s,c,f)}}const $t={}.hasOwnProperty,gs={};function ys(e,n){const t=n||gs,r=new Map,i=new Map,o=new Map,l={...es,...t.handlers},a={all:u,applyData:xs,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:s,options:t,patch:ks,wrap:ws};return un(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),a;function s(f,c){const p=f.type,h=a.handlers[p];if($t.call(a.handlers,p)&&h)return h(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:x,...E}=f,y=ft(E);return y.children=a.all(f),y}return ft(f)}return(a.options.unknownHandler||bs)(a,f,c)}function u(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const g=a.one(p[h],f);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Wn(g.value)),!Array.isArray(g)&&g.type==="element")){const x=g.children[0];x&&x.type==="text"&&(x.value=Wn(x.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function ks(e,n){e.position&&(n.position=ll(e))}function xs(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&o&&Object.assign(t.properties,ft(o)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function bs(e,n){const t=n.data||{},r="value"in n&&!($t.call(t,"hProperties")||$t.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 ws(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
11
11
  `});++r<e.length;)r&&t.push({type:"text",value:`
12
12
  `}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
13
13
  `}),t}function Wn(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Kn(e,n){const t=ys(e,n),r=t.one(e,void 0),i=as(t),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
14
- `},i),o}function Ss(e,n){return e&&"run"in e?async function(t,r){const i=Kn(t,{file:r,...n});await e.run(i,r)}:function(t,r){return Kn(t,{file:r,...e||n})}}function Yn(e){if(e)throw e}var Et,Qn;function Cs(){if(Qn)return Et;Qn=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(s){return typeof Array.isArray=="function"?Array.isArray(s):n.call(s)==="[object Array]"},o=function(s){if(!s||n.call(s)!=="[object Object]")return!1;var f=e.call(s,"constructor"),c=s.constructor&&s.constructor.prototype&&e.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!f&&!c)return!1;var p;for(p in s);return typeof p>"u"||e.call(s,p)},l=function(s,f){t&&f.name==="__proto__"?t(s,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):s[f.name]=f.newValue},a=function(s,f){if(f==="__proto__")if(e.call(s,f)){if(r)return r(s,f).value}else return;return s[f]};return Et=function u(){var s,f,c,p,h,g,k=arguments[0],C=1,y=arguments.length,E=!1;for(typeof k=="boolean"&&(E=k,k=arguments[1]||{},C=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});C<y;++C)if(s=arguments[C],s!=null)for(f in s)c=a(k,f),p=a(s,f),k!==p&&(E&&p&&(o(p)||(h=i(p)))?(h?(h=!1,g=c&&i(c)?c:[]):g=c&&o(c)?c:{},l(k,{name:f,newValue:u(E,g,p)})):typeof p<"u"&&l(k,{name:f,newValue:p}));return k},Et}var Es=Cs();const Tt=yr(Es);function Gt(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 Ts(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(u,...s){const f=e[++o];let c=-1;if(u){l(u);return}for(;++c<i.length;)(s[c]===null||s[c]===void 0)&&(s[c]=i[c]);i=s,f?vs(f,a)(...s):l(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 vs(e,n){let t;return r;function r(...l){const a=e.length>l.length;let u;a&&l.push(i);try{u=e.apply(this,l)}catch(s){const f=s;if(a&&t)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}const pe={basename:Is,dirname:As,extname:Ps,join:Ds,sep:"/"};function Is(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');et(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function As(e){if(et(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 Ps(e){et(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Ds(...e){let n=-1,t;for(;++n<e.length;)et(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Ls(t)}function Ls(e){et(e);const n=e.codePointAt(0)===47;let t=_s(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function _s(e,n){let t="",r=0,i=-1,o=0,l=-1,a,u;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===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=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function et(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Rs={cwd:zs};function zs(){return"/"}function Wt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ns(e){if(typeof e=="string")e=new URL(e);else if(!Wt(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 Os(e)}function Os(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)}const vt=["history","path","basename","stem","extname","dirname"];class $r{constructor(n){let t;n?Wt(n)?t={path:n}:typeof n=="string"||Fs(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Rs.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<vt.length;){const o=vt[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)vt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?pe.basename(this.path):void 0}set basename(n){At(n,"basename"),It(n,"basename"),this.path=pe.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?pe.dirname(this.path):void 0}set dirname(n){Xn(this.basename,"dirname"),this.path=pe.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?pe.extname(this.path):void 0}set extname(n){if(It(n,"extname"),Xn(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pe.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Wt(n)&&(n=Ns(n)),At(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?pe.basename(this.path,this.extname):void 0}set stem(n){At(n,"stem"),It(n,"stem"),this.path=pe.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new Z(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function It(e,n){if(e&&e.includes(pe.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+pe.sep+"`")}function At(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Xn(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function Fs(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ms=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),js={}.hasOwnProperty;class cn extends Ms{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=Ts()}copy(){const n=new cn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(Tt(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(Lt("data",this.frozen),this.namespace[n]=t,this):js.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Lt("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=it(n),r=this.parser||this.Parser;return Pt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Pt("process",this.parser||this.Parser),Dt("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=it(n),u=r.parse(a);r.run(u,a,function(f,c,p){if(f||!c||!p)return s(f);const h=c,g=r.stringify(h,p);Hs(g)?p.value=g:p.result=g,s(f,p)});function s(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),Pt("processSync",this.parser||this.Parser),Dt("processSync",this.compiler||this.Compiler),this.process(n,i),Zn("processSync","process",t),r;function i(o,l){t=!0,Yn(o),r=l}}run(n,t,r){Jn(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const u=it(t);i.run(n,u,s);function s(f,c,p){const h=c||n;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),Zn("runSync","run",r),i;function o(l,a){Yn(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=it(t),i=this.compiler||this.Compiler;return Dt("stringify",i),Jn(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(Lt("use",this.frozen),n!=null)if(typeof n=="function")u(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...c]=s;u(f,c)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(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=Tt(!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];o(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===s){p=c;break}if(p===-1)r.push([s,...f]);else if(f.length>0){let[h,...g]=f;const k=r[p][1];Gt(k)&&Gt(h)&&(h=Tt(!0,k,h)),r[p]=[s,h,...g]}}}}const Bs=new cn().freeze();function Pt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lt(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 Jn(e){if(!Gt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Zn(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function it(e){return Us(e)?e:new $r(e)}function Us(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Hs(e){return typeof e=="string"||qs(e)}function qs(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Vs="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",er=[],tr={allowDangerousHtml:!0},$s=/^(https?|ircs?|mailto|xmpp)$/i,Gs=[{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:"className",id:"remove-classname"},{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 Ws(e){const n=Ks(e),t=Ys(e);return Qs(n.runSync(n.parse(t),t),e)}function Ks(e){const n=e.rehypePlugins||er,t=e.remarkPlugins||er,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tr}:tr;return Bs().use(Aa).use(t).use(Ss,r).use(n)}function Ys(e){const n=e.children||"",t=new $r;return typeof n=="string"&&(t.value=n),t}function Qs(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,a=n.unwrapDisallowed,u=n.urlTransform||Xs;for(const f of Gs)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Vs+f.id,void 0);return un(e,s),cl(e,{Fragment:T.Fragment,components:i,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function s(f,c,p){if(f.type==="raw"&&p&&typeof c=="number")return l?p.children.splice(c,1):p.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let h;for(h in wt)if(Object.hasOwn(wt,h)&&Object.hasOwn(f.properties,h)){const g=f.properties[h],k=wt[h];(k===null||k.includes(f.tagName))&&(f.properties[h]=u(String(g||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return a&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function Xs(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||$s.test(e.slice(0,n))?e:""}function nr(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 Js(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Zs(e,n,t){const i=gt((t||{}).ignore||[]),o=eu(n);let l=-1;for(;++l<o.length;)Vr(e,"text",a);function a(s,f){let c=-1,p;for(;++c<f.length;){const h=f[c],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return u(s,f)}function u(s,f){const c=f[f.length-1],p=o[l][0],h=o[l][1];let g=0;const C=c.children.indexOf(s);let y=!1,E=[];p.lastIndex=0;let w=p.exec(s.value);for(;w;){const _=w.index,R={index:w.index,input:w.input,stack:[...f,s]};let b=h(...w,R);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?p.lastIndex=_+1:(g!==_&&E.push({type:"text",value:s.value.slice(g,_)}),Array.isArray(b)?E.push(...b):b&&E.push(b),g=_+w[0].length,y=!0),!p.global)break;w=p.exec(s.value)}return y?(g<s.value.length&&E.push({type:"text",value:s.value.slice(g)}),c.children.splice(C,1,...E)):E=[s],C+E.length}}function eu(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([tu(i[0]),nu(i[1])])}return n}function tu(e){return typeof e=="string"?new RegExp(Js(e),"g"):e}function nu(e){return typeof e=="function"?e:function(){return e}}const _t="phrasing",Rt=["autolink","link","image","label"];function ru(){return{transforms:[cu],enter:{literalAutolink:lu,literalAutolinkEmail:zt,literalAutolinkHttp:zt,literalAutolinkWww:zt},exit:{literalAutolink:uu,literalAutolinkEmail:su,literalAutolinkHttp:ou,literalAutolinkWww:au}}}function iu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:_t,notInConstruct:Rt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:_t,notInConstruct:Rt},{character:":",before:"[ps]",after:"\\/",inConstruct:_t,notInConstruct:Rt}]}}function lu(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function zt(e){this.config.enter.autolinkProtocol.call(this,e)}function ou(e){this.config.exit.autolinkProtocol.call(this,e)}function au(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 su(e){this.config.exit.autolinkEmail.call(this,e)}function uu(e){this.exit(e)}function cu(e){Zs(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fu],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),hu]],{ignore:["link","linkReference"]})}function fu(e,n,t,r,i){let o="";if(!Gr(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!pu(t)))return!1;const l=mu(t+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function hu(e,n,t,r){return!Gr(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function pu(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 mu(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=nr(e,"(");let o=nr(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function Gr(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Ae(t)||pt(t))&&(!n||t!==47)}Wr.peek=Cu;function du(){this.buffer()}function gu(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function yu(){this.buffer()}function ku(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xu(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=he(this.sliceSerialize(e)).toLowerCase(),t.label=n}function bu(e){this.exit(e)}function wu(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=he(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Su(e){this.exit(e)}function Cu(){return"["}function Wr(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),a=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function Eu(){return{enter:{gfmFootnoteCallString:du,gfmFootnoteCall:gu,gfmFootnoteDefinitionLabelString:yu,gfmFootnoteDefinition:ku},exit:{gfmFootnoteCallString:xu,gfmFootnoteCall:bu,gfmFootnoteDefinitionLabelString:wu,gfmFootnoteDefinition:Su}}}function Tu(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Wr},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const a=o.createTracker(l);let u=a.move("[^");const s=o.enter("footnoteDefinition"),f=o.enter("label");return u+=a.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((n?`
15
- `:" ")+o.indentLines(o.containerFlow(r,a.current()),n?Kr:vu))),s(),u}}function vu(e,n,t){return n===0?e:Kr(e,n,t)}function Kr(e,n,t){return(t?"":" ")+e}const Iu=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Yr.peek=_u;function Au(){return{canContainEols:["delete"],enter:{strikethrough:Du},exit:{strikethrough:Lu}}}function Pu(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Iu}],handlers:{delete:Yr}}}function Du(e){this.enter({type:"delete",children:[]},e)}function Lu(e){this.exit(e)}function Yr(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function _u(){return"~"}function Ru(e){return e.length}function zu(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||Ru,o=[],l=[],a=[],u=[];let s=0,f=-1;for(;++f<e.length;){const k=[],C=[];let y=-1;for(e[f].length>s&&(s=e[f].length);++y<e[f].length;){const E=Nu(e[f][y]);if(t.alignDelimiters!==!1){const w=i(E);C[y]=w,(u[y]===void 0||w>u[y])&&(u[y]=w)}k.push(E)}l[f]=k,a[f]=C}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<s;)o[c]=rr(r[c]);else{const k=rr(r);for(;++c<s;)o[c]=k}c=-1;const p=[],h=[];for(;++c<s;){const k=o[c];let C="",y="";k===99?(C=":",y=":"):k===108?C=":":k===114&&(y=":");let E=t.alignDelimiters===!1?1:Math.max(1,u[c]-C.length-y.length);const w=C+"-".repeat(E)+y;t.alignDelimiters!==!1&&(E=C.length+E+y.length,E>u[c]&&(u[c]=E),h[c]=E),p[c]=w}l.splice(1,0,p),a.splice(1,0,h),f=-1;const g=[];for(;++f<l.length;){const k=l[f],C=a[f];c=-1;const y=[];for(;++c<s;){const E=k[c]||"";let w="",_="";if(t.alignDelimiters!==!1){const R=u[c]-(C[c]||0),b=o[c];b===114?w=" ".repeat(R):b===99?R%2?(w=" ".repeat(R/2+.5),_=" ".repeat(R/2-.5)):(w=" ".repeat(R/2),_=w):_=" ".repeat(R)}t.delimiterStart!==!1&&!c&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&E==="")&&(t.delimiterStart!==!1||c)&&y.push(" "),t.alignDelimiters!==!1&&y.push(w),y.push(E),t.alignDelimiters!==!1&&y.push(_),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||c!==s-1)&&y.push("|")}g.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
14
+ `},i),o}function Ss(e,n){return e&&"run"in e?async function(t,r){const i=Kn(t,{file:r,...n});await e.run(i,r)}:function(t,r){return Kn(t,{file:r,...e||n})}}function Yn(e){if(e)throw e}var Et,Xn;function Cs(){if(Xn)return Et;Xn=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},o=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),c=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!c)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},l=function(u,f){t&&f.name==="__proto__"?t(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},a=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return Et=function s(){var u,f,c,p,h,g,x=arguments[0],E=1,y=arguments.length,C=!1;for(typeof x=="boolean"&&(C=x,x=arguments[1]||{},E=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});E<y;++E)if(u=arguments[E],u!=null)for(f in u)c=a(x,f),p=a(u,f),x!==p&&(C&&p&&(o(p)||(h=i(p)))?(h?(h=!1,g=c&&i(c)?c:[]):g=c&&o(c)?c:{},l(x,{name:f,newValue:s(C,g,p)})):typeof p<"u"&&l(x,{name:f,newValue:p}));return x},Et}var Es=Cs();const Tt=yr(Es);function Gt(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 Ts(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(s,...u){const f=e[++o];let c=-1;if(s){l(s);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?vs(f,a)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function vs(e,n){let t;return r;function r(...l){const a=e.length>l.length;let s;a&&l.push(i);try{s=e.apply(this,l)}catch(u){const f=u;if(a&&t)throw f;return i(f)}a||(s&&s.then&&typeof s.then=="function"?s.then(o,i):s instanceof Error?i(s):o(s))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}const pe={basename:Is,dirname:As,extname:Ps,join:Ds,sep:"/"};function Is(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');et(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function As(e){if(et(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 Ps(e){et(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Ds(...e){let n=-1,t;for(;++n<e.length;)et(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Ls(t)}function Ls(e){et(e);const n=e.codePointAt(0)===47;let t=_s(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function _s(e,n){let t="",r=0,i=-1,o=0,l=-1,a,s;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",r=0):(t=t.slice(0,s),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function et(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Rs={cwd:zs};function zs(){return"/"}function Wt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ns(e){if(typeof e=="string")e=new URL(e);else if(!Wt(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 Os(e)}function Os(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)}const vt=["history","path","basename","stem","extname","dirname"];class $r{constructor(n){let t;n?Wt(n)?t={path:n}:typeof n=="string"||Fs(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Rs.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<vt.length;){const o=vt[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)vt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?pe.basename(this.path):void 0}set basename(n){At(n,"basename"),It(n,"basename"),this.path=pe.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?pe.dirname(this.path):void 0}set dirname(n){Qn(this.basename,"dirname"),this.path=pe.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?pe.extname(this.path):void 0}set extname(n){if(It(n,"extname"),Qn(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pe.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Wt(n)&&(n=Ns(n)),At(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?pe.basename(this.path,this.extname):void 0}set stem(n){At(n,"stem"),It(n,"stem"),this.path=pe.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new Z(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function It(e,n){if(e&&e.includes(pe.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+pe.sep+"`")}function At(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Qn(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function Fs(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ms=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),js={}.hasOwnProperty;class cn extends Ms{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=Ts()}copy(){const n=new cn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(Tt(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(Lt("data",this.frozen),this.namespace[n]=t,this):js.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Lt("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=it(n),r=this.parser||this.Parser;return Pt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Pt("process",this.parser||this.Parser),Dt("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=it(n),s=r.parse(a);r.run(s,a,function(f,c,p){if(f||!c||!p)return u(f);const h=c,g=r.stringify(h,p);Hs(g)?p.value=g:p.result=g,u(f,p)});function u(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),Pt("processSync",this.parser||this.Parser),Dt("processSync",this.compiler||this.Compiler),this.process(n,i),Zn("processSync","process",t),r;function i(o,l){t=!0,Yn(o),r=l}}run(n,t,r){Jn(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const s=it(t);i.run(n,s,u);function u(f,c,p){const h=c||n;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),Zn("runSync","run",r),i;function o(l,a){Yn(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=it(t),i=this.compiler||this.Compiler;return Dt("stringify",i),Jn(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(Lt("use",this.frozen),n!=null)if(typeof n=="function")s(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;s(f,c)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(i.settings=Tt(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===u){p=c;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[h,...g]=f;const x=r[p][1];Gt(x)&&Gt(h)&&(h=Tt(!0,x,h)),r[p]=[u,h,...g]}}}}const Bs=new cn().freeze();function Pt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lt(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 Jn(e){if(!Gt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Zn(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function it(e){return Us(e)?e:new $r(e)}function Us(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Hs(e){return typeof e=="string"||qs(e)}function qs(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Vs="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",er=[],tr={allowDangerousHtml:!0},$s=/^(https?|ircs?|mailto|xmpp)$/i,Gs=[{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:"className",id:"remove-classname"},{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 Ws(e){const n=Ks(e),t=Ys(e);return Xs(n.runSync(n.parse(t),t),e)}function Ks(e){const n=e.rehypePlugins||er,t=e.remarkPlugins||er,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tr}:tr;return Bs().use(Aa).use(t).use(Ss,r).use(n)}function Ys(e){const n=e.children||"",t=new $r;return typeof n=="string"&&(t.value=n),t}function Xs(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,a=n.unwrapDisallowed,s=n.urlTransform||Qs;for(const f of Gs)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Vs+f.id,void 0);return un(e,u),cl(e,{Fragment:T.Fragment,components:i,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function u(f,c,p){if(f.type==="raw"&&p&&typeof c=="number")return l?p.children.splice(c,1):p.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let h;for(h in wt)if(Object.hasOwn(wt,h)&&Object.hasOwn(f.properties,h)){const g=f.properties[h],x=wt[h];(x===null||x.includes(f.tagName))&&(f.properties[h]=s(String(g||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return a&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function Qs(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||$s.test(e.slice(0,n))?e:""}function nr(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 Js(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Zs(e,n,t){const i=gt((t||{}).ignore||[]),o=eu(n);let l=-1;for(;++l<o.length;)Vr(e,"text",a);function a(u,f){let c=-1,p;for(;++c<f.length;){const h=f[c],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return s(u,f)}function s(u,f){const c=f[f.length-1],p=o[l][0],h=o[l][1];let g=0;const E=c.children.indexOf(u);let y=!1,C=[];p.lastIndex=0;let k=p.exec(u.value);for(;k;){const D=k.index,z={index:k.index,input:k.input,stack:[...f,u]};let w=h(...k,z);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?p.lastIndex=D+1:(g!==D&&C.push({type:"text",value:u.value.slice(g,D)}),Array.isArray(w)?C.push(...w):w&&C.push(w),g=D+k[0].length,y=!0),!p.global)break;k=p.exec(u.value)}return y?(g<u.value.length&&C.push({type:"text",value:u.value.slice(g)}),c.children.splice(E,1,...C)):C=[u],E+C.length}}function eu(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([tu(i[0]),nu(i[1])])}return n}function tu(e){return typeof e=="string"?new RegExp(Js(e),"g"):e}function nu(e){return typeof e=="function"?e:function(){return e}}const _t="phrasing",Rt=["autolink","link","image","label"];function ru(){return{transforms:[cu],enter:{literalAutolink:lu,literalAutolinkEmail:zt,literalAutolinkHttp:zt,literalAutolinkWww:zt},exit:{literalAutolink:uu,literalAutolinkEmail:su,literalAutolinkHttp:ou,literalAutolinkWww:au}}}function iu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:_t,notInConstruct:Rt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:_t,notInConstruct:Rt},{character:":",before:"[ps]",after:"\\/",inConstruct:_t,notInConstruct:Rt}]}}function lu(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function zt(e){this.config.enter.autolinkProtocol.call(this,e)}function ou(e){this.config.exit.autolinkProtocol.call(this,e)}function au(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 su(e){this.config.exit.autolinkEmail.call(this,e)}function uu(e){this.exit(e)}function cu(e){Zs(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fu],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),hu]],{ignore:["link","linkReference"]})}function fu(e,n,t,r,i){let o="";if(!Gr(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!pu(t)))return!1;const l=mu(t+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function hu(e,n,t,r){return!Gr(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function pu(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 mu(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=nr(e,"(");let o=nr(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function Gr(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Ae(t)||pt(t))&&(!n||t!==47)}Wr.peek=Cu;function du(){this.buffer()}function gu(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function yu(){this.buffer()}function ku(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xu(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=he(this.sliceSerialize(e)).toLowerCase(),t.label=n}function bu(e){this.exit(e)}function wu(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=he(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Su(e){this.exit(e)}function Cu(){return"["}function Wr(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),a=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function Eu(){return{enter:{gfmFootnoteCallString:du,gfmFootnoteCall:gu,gfmFootnoteDefinitionLabelString:yu,gfmFootnoteDefinition:ku},exit:{gfmFootnoteCallString:xu,gfmFootnoteCall:bu,gfmFootnoteDefinitionLabelString:wu,gfmFootnoteDefinition:Su}}}function Tu(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Wr},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const a=o.createTracker(l);let s=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return s+=a.move(o.safe(o.associationId(r),{before:s,after:"]"})),f(),s+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),s+=a.move((n?`
15
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),n?Kr:vu))),u(),s}}function vu(e,n,t){return n===0?e:Kr(e,n,t)}function Kr(e,n,t){return(t?"":" ")+e}const Iu=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Yr.peek=_u;function Au(){return{canContainEols:["delete"],enter:{strikethrough:Du},exit:{strikethrough:Lu}}}function Pu(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Iu}],handlers:{delete:Yr}}}function Du(e){this.enter({type:"delete",children:[]},e)}function Lu(e){this.exit(e)}function Yr(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function _u(){return"~"}function Ru(e){return e.length}function zu(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||Ru,o=[],l=[],a=[],s=[];let u=0,f=-1;for(;++f<e.length;){const x=[],E=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const C=Nu(e[f][y]);if(t.alignDelimiters!==!1){const k=i(C);E[y]=k,(s[y]===void 0||k>s[y])&&(s[y]=k)}x.push(C)}l[f]=x,a[f]=E}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=rr(r[c]);else{const x=rr(r);for(;++c<u;)o[c]=x}c=-1;const p=[],h=[];for(;++c<u;){const x=o[c];let E="",y="";x===99?(E=":",y=":"):x===108?E=":":x===114&&(y=":");let C=t.alignDelimiters===!1?1:Math.max(1,s[c]-E.length-y.length);const k=E+"-".repeat(C)+y;t.alignDelimiters!==!1&&(C=E.length+C+y.length,C>s[c]&&(s[c]=C),h[c]=C),p[c]=k}l.splice(1,0,p),a.splice(1,0,h),f=-1;const g=[];for(;++f<l.length;){const x=l[f],E=a[f];c=-1;const y=[];for(;++c<u;){const C=x[c]||"";let k="",D="";if(t.alignDelimiters!==!1){const z=s[c]-(E[c]||0),w=o[c];w===114?k=" ".repeat(z):w===99?z%2?(k=" ".repeat(z/2+.5),D=" ".repeat(z/2-.5)):(k=" ".repeat(z/2),D=k):D=" ".repeat(z)}t.delimiterStart!==!1&&!c&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&C==="")&&(t.delimiterStart!==!1||c)&&y.push(" "),t.alignDelimiters!==!1&&y.push(k),y.push(C),t.alignDelimiters!==!1&&y.push(D),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||c!==u-1)&&y.push("|")}g.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
16
16
  `)}function Nu(e){return e==null?"":String(e)}function rr(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 Ou(e,n,t,r){const i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const l=t.indentLines(t.containerFlow(e,o.current()),Fu);return i(),l}function Fu(e,n,t){return">"+(t?"":" ")+e}function Mu(e,n){return ir(e,n.inConstruct,!0)&&!ir(e,n.notInConstruct,!1)}function ir(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 lr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
17
17
  `&&Mu(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
18
- `}function ju(e,n){const t=String(e);let r=t.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=t.indexOf(n,i);return l}function Bu(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 Uu(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 Hu(e,n,t,r){const i=Uu(t),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Bu(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(o,qu);return c(),p}const a=t.createTracker(r),u=i.repeat(Math.max(ju(o,i)+1,3)),s=t.enter("codeFenced");let f=a.move(u);if(e.lang){const c=t.enter(`codeFencedLang${l}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
18
+ `}function ju(e,n){const t=String(e);let r=t.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=t.indexOf(n,i);return l}function Bu(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 Uu(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 Hu(e,n,t,r){const i=Uu(t),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Bu(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(o,qu);return c(),p}const a=t.createTracker(r),s=i.repeat(Math.max(ju(o,i)+1,3)),u=t.enter("codeFenced");let f=a.move(s);if(e.lang){const c=t.enter(`codeFencedLang${l}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
19
19
  `,encode:["`"],...a.current()})),c()}return f+=a.move(`
20
20
  `),o&&(f+=a.move(o+`
21
- `)),f+=a.move(u),s(),f}function qu(e,n,t){return(t?"":" ")+e}function fn(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 Vu(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=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${o}`),s+=u.move(" "+i),s+=u.move(t.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),l(),s}function $u(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 ht(e,n,t){const r=Fe(e),i=Fe(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}}Qr.peek=Gu;function Qr(e,n,t,r){const i=$u(t),o=t.enter("emphasis"),l=t.createTracker(r),a=l.move(i);let u=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=u.charCodeAt(0),f=ht(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=Xe(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=ht(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+Xe(c));const h=l.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function Gu(e,n,t){return t.options.emphasis||"*"}function Wu(e,n){let t=!1;return un(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,Vt}),!!((!e.depth||e.depth<3)&&tn(e)&&(n.options.setext||t))}function Ku(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(Wu(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
21
+ `)),f+=a.move(s),u(),f}function qu(e,n,t){return(t?"":" ")+e}function fn(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 Vu(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let a=t.enter("label");const s=t.createTracker(r);let u=s.move("[");return u+=s.move(t.safe(t.associationId(e),{before:u,after:"]",...s.current()})),u+=s.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":`
22
+ `,...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),l(),u}function $u(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 Qe(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ht(e,n,t){const r=Fe(e),i=Fe(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}}Xr.peek=Gu;function Xr(e,n,t,r){const i=$u(t),o=t.enter("emphasis"),l=t.createTracker(r),a=l.move(i);let s=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=ht(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=Qe(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=ht(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+Qe(c));const h=l.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function Gu(e,n,t){return t.options.emphasis||"*"}function Wu(e,n){let t=!1;return un(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,Vt}),!!((!e.depth||e.depth<3)&&tn(e)&&(n.options.setext||t))}function Ku(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(Wu(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
23
23
  `,after:`
24
24
  `});return c(),f(),p+`
25
25
  `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
26
- `))+1))}const l="#".repeat(i),a=t.enter("headingAtx"),u=t.enter("phrasing");o.move(l+" ");let s=t.containerPhrasing(e,{before:"# ",after:`
27
- `,...o.current()});return/^[\t ]/.test(s)&&(s=Xe(s.charCodeAt(0))+s.slice(1)),s=s?l+" "+s:l,t.options.closeAtx&&(s+=" "+l),u(),a(),s}Xr.peek=Yu;function Xr(e){return e.value||""}function Yu(){return"<"}Jr.peek=Qu;function Jr(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=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${o}`),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(")"),l(),s}function Qu(){return"!"}Zr.peek=Xu;function Zr(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let l=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+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Xu(){return"!"}ei.peek=Ju;function ei(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const l=t.unsafe[o],a=t.compilePattern(l);let u;if(l.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 Ju(){return"`"}function ti(e,n){const t=tn(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))}ni.peek=Zu;function ni(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let a,u;if(ti(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=l.move("<");return c+=l.move(t.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),t.stack=f,c}a=t.enter("link"),u=t.enter("label");let s=l.move("[");return s+=l.move(t.containerPhrasing(e,{before:s,after:"](",...l.current()})),s+=l.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=t.enter("destinationLiteral"),s+=l.move("<"),s+=l.move(t.safe(e.url,{before:s,after:">",...l.current()})),s+=l.move(">")):(u=t.enter("destinationRaw"),s+=l.move(t.safe(e.url,{before:s,after:e.title?" ":")",...l.current()}))),u(),e.title&&(u=t.enter(`title${o}`),s+=l.move(" "+i),s+=l.move(t.safe(e.title,{before:s,after:i,...l.current()})),s+=l.move(i),u()),s+=l.move(")"),a(),s}function Zu(e,n,t){return ti(e,t)?"<":"["}ri.peek=ec;function ri(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let l=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+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function ec(){return"["}function hn(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 tc(e){const n=hn(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 nc(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 ii(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 rc(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let l=e.ordered?nc(t):hn(t);const a=e.ordered?l==="."?")":".":tc(t);let u=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&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),ii(t)===l&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=a),t.bulletCurrent=l;const s=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=o,i(),s}function ic(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 lc(e,n,t,r){const i=ic(t);let o=t.bulletCurrent||hn(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=t.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const u=t.enter("listItem"),s=t.indentLines(t.containerFlow(e,a.current()),f);return u(),s;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function oc(e,n,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),l=t.containerPhrasing(e,r);return o(),i(),l}const ac=gt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sc(e,n,t,r){return(e.children.some(function(l){return ac(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function uc(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}li.peek=cc;function li(e,n,t,r){const i=uc(t),o=t.enter("strong"),l=t.createTracker(r),a=l.move(i+i);let u=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=u.charCodeAt(0),f=ht(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=Xe(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=ht(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+Xe(c));const h=l.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function cc(e,n,t){return t.options.strong||"*"}function fc(e,n,t,r){return t.safe(e.value,r)}function hc(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 pc(e,n,t){const r=(ii(t)+(t.options.ruleSpaces?" ":"")).repeat(hc(t));return t.options.ruleSpaces?r.slice(0,-1):r}const oi={blockquote:Ou,break:lr,code:Hu,definition:Vu,emphasis:Qr,hardBreak:lr,heading:Ku,html:Xr,image:Jr,imageReference:Zr,inlineCode:ei,link:ni,linkReference:ri,list:rc,listItem:lc,paragraph:oc,root:sc,strong:li,text:fc,thematicBreak:pc};function mc(){return{enter:{table:dc,tableData:or,tableHeader:or,tableRow:yc},exit:{codeText:kc,table:gc,tableData:Nt,tableHeader:Nt,tableRow:Nt}}}function dc(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 gc(e){this.exit(e),this.data.inTable=void 0}function yc(e){this.enter({type:"tableRow",children:[]},e)}function Nt(e){this.exit(e)}function or(e){this.enter({type:"tableCell",children:[]},e)}function kc(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,xc));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function xc(e,n){return n==="|"?n:e}function bc(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=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:p,table:l,tableCell:u,tableRow:a}};function l(h,g,k,C){return s(f(h,k,C),h.align)}function a(h,g,k,C){const y=c(h,k,C),E=s([y]);return E.slice(0,E.indexOf(`
29
- `))}function u(h,g,k,C){const y=k.enter("tableCell"),E=k.enter("phrasing"),w=k.containerPhrasing(h,{...C,before:o,after:o});return E(),y(),w}function s(h,g){return zu(h,{align:g,alignDelimiters:r,padding:t,stringLength:i})}function f(h,g,k){const C=h.children;let y=-1;const E=[],w=g.enter("table");for(;++y<C.length;)E[y]=c(C[y],g,k);return w(),E}function c(h,g,k){const C=h.children;let y=-1;const E=[],w=g.enter("tableRow");for(;++y<C.length;)E[y]=u(C[y],h,g,k);return w(),E}function p(h,g,k){let C=oi.inlineCode(h,g,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function wc(){return{exit:{taskListCheckValueChecked:ar,taskListCheckValueUnchecked:ar,paragraph:Cc}}}function Sc(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ec}}}function ar(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Cc(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 o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===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 Ec(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);o&&a.move(l);let u=oi.listItem(e,n,t,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),u;function s(f){return f+l}}function Tc(){return[ru(),Eu(),Au(),mc(),wc()]}function vc(e){return{extensions:[iu(),Tu(e),Pu(),bc(e),Sc()]}}const Ic={tokenize:Rc,partial:!0},ai={tokenize:zc,partial:!0},si={tokenize:Nc,partial:!0},ui={tokenize:Oc,partial:!0},Ac={tokenize:Fc,partial:!0},ci={name:"wwwAutolink",tokenize:Lc,previous:hi},fi={name:"protocolAutolink",tokenize:_c,previous:pi},be={name:"emailAutolink",tokenize:Dc,previous:mi},de={};function Pc(){return{text:de}}let Ie=48;for(;Ie<123;)de[Ie]=be,Ie++,Ie===58?Ie=65:Ie===91&&(Ie=97);de[43]=be;de[45]=be;de[46]=be;de[95]=be;de[72]=[be,fi];de[104]=[be,fi];de[87]=[be,ci];de[119]=[be,ci];function Dc(e,n,t){const r=this;let i,o;return l;function l(c){return!Kt(c)||!mi.call(r,r.previous)||pn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Kt(c)?(e.consume(c),a):c===64?(e.consume(c),u):t(c)}function u(c){return c===46?e.check(Ac,f,s)(c):c===45||c===95||J(c)?(o=!0,e.consume(c),u):f(c)}function s(c){return e.consume(c),i=!0,u}function f(c){return o&&i&&ee(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function Lc(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!hi.call(r,r.previous)||pn(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Ic,e.attempt(ai,e.attempt(si,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function _c(e,n,t){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&pi.call(r,r.previous)&&!pn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(ee(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),u}return t(c)}function u(c){return c===47?(e.consume(c),o?s:(o=!0,u)):t(c)}function s(c){return c===null||ut(c)||G(c)||Ae(c)||pt(c)?t(c):e.attempt(ai,e.attempt(si,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Rc(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function zc(e,n,t){let r,i,o;return l;function l(s){return s===46||s===95?e.check(ui,u,a)(s):s===null||G(s)||Ae(s)||s!==45&&pt(s)?u(s):(o=!0,e.consume(s),l)}function a(s){return s===95?r=!0:(i=r,r=void 0),e.consume(s),l}function u(s){return i||r||!o?t(s):n(s)}}function Nc(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(ui,n,o)(l):l===null||G(l)||Ae(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Oc(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),o):a===93?(e.consume(a),i):a===60||a===null||G(a)||Ae(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||G(a)||Ae(a)?n(a):r(a)}function o(a){return ee(a)?l(a):t(a)}function l(a){return a===59?(e.consume(a),r):ee(a)?(e.consume(a),l):t(a)}}function Fc(e,n,t){return r;function r(o){return e.consume(o),i}function i(o){return J(o)?t(o):n(o)}}function hi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function pi(e){return!ee(e)}function mi(e){return!(e===47||Kt(e))}function Kt(e){return e===43||e===45||e===46||e===95||J(e)}function pn(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}const Mc={tokenize:Gc,partial:!0};function jc(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:qc,continuation:{tokenize:Vc},exit:$c}},text:{91:{name:"gfmFootnoteCall",tokenize:Hc},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Bc,resolveTo:Uc}}}}function Bc(e,n,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=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(!l||!l._balanced)return t(u);const s=he(r.sliceSerialize({start:l.end,end:r.now()}));return s.codePointAt(0)!==94||!o.includes(s.slice(1))?t(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function Uc(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function Hc(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;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(o>999||c===93&&!l||c===null||c===91||G(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(he(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return G(c)||(l=!0),o++,e.consume(c),c===92?f:s}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,s):s(c)}}function qc(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(g)}function f(g){if(l>999||g===93&&!a||g===null||g===91||G(g))return t(g);if(g===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=he(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return G(g)||(a=!0),l++,e.consume(g),g===92?c:f}function c(g){return g===91||g===92||g===93?(e.consume(g),l++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),V(e,h,"gfmFootnoteDefinitionWhitespace")):t(g)}function h(g){return n(g)}}function Vc(e,n,t){return e.check(Ze,n,e.attempt(Mc,n,t))}function $c(e){e.exit("gfmFootnoteDefinition")}function Gc(e,n,t){const r=this;return V(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):t(o)}}function Wc(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let s=u;for(;s--;)if(l[s][0]==="exit"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[s][1].end.offset-l[s][1].start.offset){l[u][1].type="strikethroughSequence",l[s][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[s][1].start),end:Object.assign({},l[u][1].end)},c={type:"strikethroughText",start:Object.assign({},l[s][1].end),end:Object.assign({},l[u][1].start)},p=[["enter",f,a],["enter",l[s][1],a],["exit",l[s][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&le(p,p.length,0,mt(h,l.slice(s+1,u),a)),le(p,p.length,0,[["exit",c,a],["enter",l[u][1],a],["exit",l[u][1],a],["exit",f,a]]),le(l,s-1,u-s+3,p),u=s+p.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function o(l,a,u){const s=this.previous,f=this.events;let c=0;return p;function p(g){return s===126&&f[f.length-1][1].type!=="characterEscape"?u(g):(l.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const k=Fe(s);if(g===126)return c>1?u(g):(l.consume(g),c++,h);if(c<2&&!t)return u(g);const C=l.exit("strikethroughSequenceTemporary"),y=Fe(g);return C._open=!y||y===2&&!!k,C._close=!k||k===2&&!!y,a(g)}}}class Kc{constructor(){this.map=[]}add(n,t,r){Yc(this,n,t,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.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 Qc(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 o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function Xc(){return{flow:{null:{name:"table",tokenize:Jc,resolveAll:Zc}}}}function Jc(e,n,t){const r=this;let i=0,o=0,l;return a;function a(x){let D=r.events.length-1;for(;D>-1;){const L=r.events[D][1].type;if(L==="lineEnding"||L==="linePrefix")D--;else break}const A=D>-1?r.events[D][1].type:null,P=A==="tableHead"||A==="tableRow"?b:u;return P===b&&r.parser.lazy[r.now().line]?t(x):P(x)}function u(x){return e.enter("tableHead"),e.enter("tableRow"),s(x)}function s(x){return x===124||(l=!0,o+=1),f(x)}function f(x){return x===null?t(x):z(x)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):t(x):H(x)?V(e,f,"whitespace")(x):(o+=1,l&&(l=!1,i+=1),x===124?(e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(x)))}function c(x){return x===null||x===124||G(x)?(e.exit("data"),f(x)):(e.consume(x),x===92?p:c)}function p(x){return x===92||x===124?(e.consume(x),c):c(x)}function h(x){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(x):(e.enter("tableDelimiterRow"),l=!1,H(x)?V(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):g(x))}function g(x){return x===45||x===58?C(x):x===124?(l=!0,e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),k):R(x)}function k(x){return H(x)?V(e,C,"whitespace")(x):C(x)}function C(x){return x===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(x),e.exit("tableDelimiterMarker"),y):x===45?(o+=1,y(x)):x===null||z(x)?_(x):R(x)}function y(x){return x===45?(e.enter("tableDelimiterFiller"),E(x)):R(x)}function E(x){return x===45?(e.consume(x),E):x===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(x),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(x))}function w(x){return H(x)?V(e,_,"whitespace")(x):_(x)}function _(x){return x===124?g(x):x===null||z(x)?!l||i!==o?R(x):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(x)):R(x)}function R(x){return t(x)}function b(x){return e.enter("tableRow"),N(x)}function N(x){return x===124?(e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),N):x===null||z(x)?(e.exit("tableRow"),n(x)):H(x)?V(e,N,"whitespace")(x):(e.enter("data"),U(x))}function U(x){return x===null||x===124||G(x)?(e.exit("data"),N(x)):(e.consume(x),x===92?M:U)}function M(x){return x===92||x===124?(e.consume(x),U):U(x)}}function Zc(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,u=0,s,f,c;const p=new Kc;for(;++t<e.length;){const h=e[t],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,u!==0&&(sr(p,n,u,s,f),f=void 0,u=0),s={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",s,n]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",f,n]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=lt(p,n,o,i,void 0,c),o=[0,0,0,0]),l[2]=t)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=lt(p,n,o,i,void 0,c)),o=l,l=[o[1],t,0,0])):g.type==="tableHead"?(a=!0,u=t):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=t,o[1]!==0?(l[0]=l[1],c=lt(p,n,o,i,t,c)):l[1]!==0&&(c=lt(p,n,l,i,t,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(l[3]=t)}for(u!==0&&sr(p,n,u,s,f),p.consume(n.events),t=-1;++t<n.events.length;){const h=n.events[t];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Qc(n.events,t))}return e}function lt(e,n,t,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(o.end=Object.assign({},Ne(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const u=Ne(n.events,t[1]);if(o={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const s=Ne(n.events,t[2]),f=Ne(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 p=n.events[t[2]],h=n.events[t[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",t[3]>t[2]+1){const g=t[2]+1,k=t[3]-t[2]-1;e.add(g,k,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(o.end=Object.assign({},Ne(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function sr(e,n,t,r,i){const o=[],l=Ne(n.events,t);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(t+1,0,o)}function Ne(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const ef={name:"tasklistCheck",tokenize:nf};function tf(){return{text:{91:ef}}}function nf(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"),o)}function o(u){return G(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):t(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(u)}function a(u){return z(u)?n(u):H(u)?e.check({tokenize:rf},n,t)(u):t(u)}}function rf(e,n,t){return V(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function lf(e){return Tr([Pc(),jc(),Wc(e),Xc(),tf()])}const of={};function af(e){const n=this,t=e||of,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(lf(t)),o.push(Tc()),l.push(vc(t))}const di="https://www.tiagpctest.softiabot.com",sf="0x4AAAAAAB-BKyDZcYYqCbid",gi={BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left",TOP_RIGHT:"top-right",TOP_LEFT:"top-left"},yi={LIGHT:"light",DARK:"dark",AUTO:"auto"},ki={SPANISH:"es",ENGLISH:"en",FRANCES:"fr"},uf={MOBILE:640},Ce={theme:yi.AUTO,position:gi.BOTTOM_RIGHT,language:ki.ENGLISH,width:"400px",height:"600px",autoOpen:!1,showBranding:!0,mobileFullscreen:!0},cf={API_REQUEST:3e4},ur={MAX_LENGTH:2e3},ff=()=>window.innerWidth<uf.MOBILE,hf=e=>{try{return new Date(e).toLocaleTimeString("es-ES",{hour:"2-digit",minute:"2-digit"})}catch{return""}},pf=e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`,Ot=()=>crypto.randomUUID(),mf=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",df=e=>e.trim().slice(0,2e3),gf=({size:e="md",className:n=""})=>{const t={sm:"w-4 h-4 border-2",md:"w-6 h-6 border-2",lg:"w-8 h-8 border-3"};return T.jsx("div",{className:`gpc-spinner ${t[e]} ${n}`,role:"status","aria-label":"Cargando",children:T.jsx("span",{className:"sr-only",children:"Cargando..."})})},yf=()=>T.jsxs("div",{className:"gpc-typing-indicator",role:"status","aria-label":"Escribiendo",children:[T.jsx("span",{className:"gpc-typing-dot"}),T.jsx("span",{className:"gpc-typing-dot"}),T.jsx("span",{className:"gpc-typing-dot"})]}),kf=({message:e,showMetadata:n=!1,messageRef:t=null})=>{const{t:r}=oe.useTranslation(),i=e.role==="user",o=!i&&e.isStreaming&&!e.content;return T.jsxs("div",{ref:t,className:`gpc-message ${i?"gpc-message-user":"gpc-message-assistant"}`,role:"article","aria-label":i?"Mensaje del usuario":"Mensaje del asistente",children:[T.jsx("div",{className:"gpc-message-content",children:o?T.jsx(yf,{}):i?e.content.trim():T.jsx(Ws,{remarkPlugins:[af],components:{table:({node:l,...a})=>T.jsx("div",{className:"gpc-table-wrapper",children:T.jsx("table",{className:"gpc-table",...a})}),thead:({node:l,...a})=>T.jsx("thead",{className:"gpc-table-head",...a}),tbody:({node:l,...a})=>T.jsx("tbody",{className:"gpc-table-body",...a}),tr:({node:l,...a})=>T.jsx("tr",{className:"gpc-table-row",...a}),th:({node:l,...a})=>T.jsx("th",{className:"gpc-table-header",...a}),td:({node:l,...a})=>T.jsx("td",{className:"gpc-table-cell",...a})},children:e.content})}),T.jsx("div",{className:`gpc-message-timestamp ${i?"gpc-message-timestamp-user":""}`,children:hf(e.timestamp)}),!i&&n&&e.metadata&&T.jsxs("div",{className:"gpc-message-metadata",children:[e.metadata.tokensUsed&&T.jsxs("div",{className:"gpc-metadata-item",children:[T.jsxs("strong",{children:[r("metadata.tokensUsed"),":"]})," ",e.metadata.tokensUsed]}),e.metadata.responseTimeMs&&T.jsxs("div",{className:"gpc-metadata-item",children:[T.jsxs("strong",{children:[r("metadata.responseTime"),":"]})," ",pf(e.metadata.responseTimeMs)]}),e.metadata.model&&T.jsxs("div",{className:"gpc-metadata-item",children:[T.jsxs("strong",{children:[r("metadata.model"),":"]})," ",e.metadata.model]})]})]})},xf=({messages:e,isLoading:n,showMetadata:t=!1,widgetConfig:r=null})=>{const{t:i}=oe.useTranslation(),o=O.useRef(null),l=O.useRef(null),a=O.useRef(e.length);O.useEffect(()=>{const c=e.length>a.current,p=e[e.length-1];c&&p&&(p.role==="user"?o.current?.scrollIntoView({behavior:"smooth"}):p.role==="assistant"&&p.isStreaming&&setTimeout(()=>{l.current?.scrollIntoView({behavior:"smooth",block:"start"})},100)),a.current=e.length},[e]);const u=r?.company_name||"TIA GPC",s=r?.company_logo_base64,f=s?.startsWith("data:")?s:s?`data:image/png;base64,${s}`:null;return e.length===0&&!n?T.jsx("div",{className:"gpc-messages-container",children:T.jsxs("div",{className:"gpc-empty-state",children:[f?T.jsx("div",{className:"gpc-welcome-logo",children:T.jsx("img",{src:f,alt:u,className:"gpc-welcome-company-logo"})}):T.jsx(me.MessageSquare,{className:"gpc-empty-icon"}),T.jsx("h3",{className:"gpc-empty-title",children:i("chat.welcome",{companyName:u})}),T.jsx("p",{className:"gpc-empty-text",children:i("chat.emptyState")})]})}):T.jsxs("div",{className:"gpc-messages-container gpc-scrollbar gpc-smooth-scroll",children:[e.map((c,p)=>T.jsx(kf,{message:c,showMetadata:t,messageRef:p===e.length-1?l:null},c.id)),T.jsx("div",{ref:o})]})},bf=1.2,wf=2e3,Sf=({onTranscript:e,isLoading:n,disabled:t,onRecordingStateChange:r})=>{const{t:i}=oe.useTranslation(),[o,l]=O.useState(!1),[a,u]=O.useState(!1),s=O.useRef(null),f=O.useRef([]),c=O.useRef(null),p=O.useRef(null),h=O.useRef(null),g=O.useRef(null),k=O.useRef(null);O.useEffect(()=>()=>{s.current?.state==="recording"&&s.current.stop(),c.current&&c.current.state!=="closed"&&c.current.close(),k.current&&clearInterval(k.current)},[]),O.useEffect(()=>{r&&r(o||a)},[o,a,r]);const C=()=>{if(!p.current||!h.current)return;p.current.getByteTimeDomainData(h.current);let b=0;for(let M=0;M<h.current.length;M++){const x=(h.current[M]-128)/128;b+=x*x}if(Math.sqrt(b/h.current.length)*100<bf){if(g.current||(g.current=Date.now()),Date.now()-g.current>wf){E();return}}else g.current=null},y=async()=>{try{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){alert(i("voice.unsupported"));return}const b=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,sampleRate:48e3,channelCount:1}});c.current=new(window.AudioContext||window.webkitAudioContext),p.current=c.current.createAnalyser(),c.current.createMediaStreamSource(b).connect(p.current),p.current.fftSize=1024,p.current.smoothingTimeConstant=.4,p.current.minDecibels=-85,p.current.maxDecibels=-15;const U=p.current.frequencyBinCount;h.current=new Uint8Array(U);const M=new MediaRecorder(b,{mimeType:"audio/webm;codecs=opus"});s.current=M,f.current=[],g.current=null,M.ondataavailable=x=>{x.data.size>0&&f.current.push(x.data)},M.onstop=async()=>{if(k.current&&(clearInterval(k.current),k.current=null),c.current&&c.current.state!=="closed"&&c.current.close(),g.current=null,f.current.length===0){console.warn("No audio data recorded");return}const x=new Blob(f.current,{type:"audio/webm"});u(!0);try{await e(x)}catch(D){console.error("Transcription error:",D),alert(i("voice.error"))}finally{u(!1),f.current=[]}},M.start(100),l(!0),k.current=setInterval(()=>{C()},100)}catch(b){console.error("Error accessing microphone:",b),b.name==="NotAllowedError"||b.name==="PermissionDeniedError"?alert(i("voice.permissionDenied")):alert(i("voice.unsupported"))}},E=()=>{!o&&s.current?.state!=="recording"||(s.current&&s.current.state==="recording"&&s.current.stop(),k.current&&(clearInterval(k.current),k.current=null),g.current=null,l(!1),s.current&&s.current.stream&&s.current.stream.getTracks().forEach(b=>b.stop()))},w=()=>{o?E():y()},_=t||n||a,R=i(a?"voice.processing":o?"voice.stop":"voice.record");return T.jsx("button",{type:"button",onClick:w,disabled:_,className:`gpc-voice-button ${o?"gpc-voice-recording":""}`,"aria-label":R,title:R,children:a?T.jsx("span",{className:"gpc-spinner"}):o?T.jsx(me.MicOff,{className:"gpc-icon gpc-voice-icon-active"}):T.jsx(me.Mic,{className:"gpc-icon"})})},Cf=({onSendMessage:e,isLoading:n,disabled:t,gpcService:r})=>{const{t:i}=oe.useTranslation(),[o,l]=O.useState(""),[a,u]=O.useState(!1),s=O.useRef(null);O.useEffect(()=>{!t&&!n&&!a&&s.current?.focus()},[t,n,a]);const f=async C=>{C.preventDefault();const y=df(o);if(!(!y||n||t||a))try{await e(y),l("")}catch(E){console.error("Error sending message:",E)}},c=C=>{C.key==="Enter"&&!C.shiftKey&&!a&&(C.preventDefault(),f(C))},p=async C=>{if(!r)throw new Error("GPC Service not available");const y=await r.transcribeAudio(C);y.success&&y.text&&(l(y.text),s.current?.focus())},h=C=>{u(C)},g=o.trim().length>0&&!n&&!t&&!a,k=n||t||a;return T.jsxs("form",{onSubmit:f,className:"gpc-input-container",children:[T.jsx("input",{ref:s,type:"text",value:o,onChange:C=>l(C.target.value),onKeyDown:c,placeholder:i("chat.placeholder"),disabled:k,maxLength:ur.MAX_LENGTH,className:"gpc-input","aria-label":i("chat.placeholder"),"aria-describedby":"chat-input-help"}),T.jsx(Sf,{onTranscript:p,isLoading:n,disabled:t,onRecordingStateChange:h}),T.jsx("button",{type:"submit",disabled:!g,className:"gpc-send-button","aria-label":i("chat.send"),title:i("chat.send"),children:n?T.jsx("span",{className:"gpc-spinner"}):T.jsx(me.Send,{className:"gpc-icon"})}),T.jsxs("span",{id:"chat-input-help",className:"gpc-sr-only",children:[i("chat.placeholder"),". Máximo ",ur.MAX_LENGTH," caracteres."]})]})},Ef=({siteKey:e,onSuccess:n,onError:t})=>{const{t:r}=oe.useTranslation(),[i,o]=O.useState(!1),[l,a]=O.useState(null),u=async f=>{o(!0),a(null);try{await n(f)}catch(c){console.error("Turnstile validation error:",c),a(r("turnstile.error")),t?.(c)}finally{o(!1)}},s=f=>{console.error("Turnstile widget error:",f),a(r("turnstile.error")),t?.(new Error(r("turnstile.error")))};return T.jsxs("div",{className:"gpc-validator-container",children:[T.jsxs("div",{className:"gpc-validator-header",children:[T.jsx("h3",{className:"gpc-validator-title",children:r("chat.validation")}),T.jsx("p",{className:"gpc-validator-subtitle",children:r("turnstile.verifying")})]}),!l&&T.jsx("div",{className:"gpc-animate-fade-in",children:T.jsx(Pi.Turnstile,{siteKey:e,onSuccess:u,onError:s,options:{theme:"light",size:"normal"}})}),i&&T.jsxs("div",{className:"gpc-validator-loading",children:[T.jsx(gf,{size:"md"}),T.jsx("p",{className:"gpc-validator-text",children:r("chat.validation")})]}),l&&T.jsxs("div",{className:"gpc-validator-error",children:[T.jsx(me.AlertCircle,{className:"gpc-error-icon"}),T.jsxs("div",{className:"gpc-error-content",children:[T.jsx("p",{className:"gpc-error-title",children:r("errors.validation")}),T.jsx("p",{className:"gpc-error-message",children:l}),T.jsx("button",{onClick:()=>window.location.reload(),className:"gpc-error-button",children:r("chat.retry")})]})]})]})},Tf=(e,n,t)=>{const{t:r}=oe.useTranslation(),[i,o]=O.useState([]),[l,a]=O.useState(!1),[u,s]=O.useState(null),f=O.useCallback(async h=>{if(!h.trim()||l)return;if(!n){Ft.error("Validación anti-bot pendiente");return}const g={id:Ot(),role:"user",content:h.trim(),timestamp:new Date().toISOString()};o(y=>[...y,g]),a(!0),s(null);const k=Ot(),C={id:k,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!0};o(y=>[...y,C]);try{const y=await e.sendMessage(h,n,E=>{o(w=>w.map(_=>_.id===k?{..._,content:_.content+E}:_))});o(E=>E.map(w=>w.id===k?{id:y.data.message_id,role:"assistant",content:y.data.response,timestamp:y.data.created_at,isStreaming:!1,metadata:{costUsd:y.data.cost_usd,creditBalanceUsd:y.data.credit_balance_usd,inputTokens:y.data.input_tokens,outputTokens:y.data.output_tokens,responseTimeMs:y.data.response_time_ms,modelUsed:y.data.model_used}}:w))}catch(y){o(N=>N.filter(U=>U.id!==k));let E;try{E=JSON.parse(y.message)}catch{E={statusCode:500,message:y.message}}let w;const _=E.statusCode||500,R=E.errorCode||"";switch(_===401&&R==="SESSION_EXPIRED"&&(w=r("errors.sessionExpired","Session expired, please verify again"),t&&t()),_){case 401:w||(w=r("errors.unauthorized"));break;case 402:w=r("errors.insufficientCredits");break;case 403:R.includes("DOMAIN")||R.includes("UNAUTHORIZED")?w=r("errors.domainUnauthorized"):w=r("errors.validation");break;case 429:w=r("errors.rateLimit");break;case 503:case 502:case 504:w=r("errors.aiServiceUnavailable");break;case 500:w=r("errors.serverError");break;default:w=r("errors.generic")}s(w),Ft.error(w,{duration:4e3,position:"top-center"});const b={id:Ot(),role:"assistant",content:w,timestamp:new Date().toISOString()};o(N=>[...N,b])}finally{a(!1)}},[e,n,l,r,t]),c=O.useCallback(()=>{o([]),s(null)},[]),p=O.useCallback(()=>{s(null)},[]);return{messages:i,isLoading:l,error:u,sendMessage:f,clearMessages:c,clearError:p}},vf=(e="auto")=>{const[n,t]=O.useState(e),[r,i]=O.useState("light");return O.useEffect(()=>{if(i(n==="auto"?mf():n),n==="auto"){const a=window.matchMedia("(prefers-color-scheme: dark)"),u=s=>{i(s.matches?"dark":"light")};return a.addEventListener("change",u),()=>{a.removeEventListener("change",u)}}},[n]),{theme:r,themeMode:n,setThemeMode:t,toggleTheme:()=>{t(l=>l==="auto"?r==="light"?"dark":"light":l==="light"?"dark":"light")}}},If=({gpcService:e,licenseToken:n,widgetConfig:t,turnstileSiteKey:r,onClose:i,themeMode:o,showBranding:l=!0,showMetadata:a=!1,onError:u})=>{const{t:s}=oe.useTranslation(),[f,c]=O.useState(null),[p,h]=O.useState(!1),{theme:g,toggleTheme:k}=vf(o),C=O.useCallback(()=>{h(!1),c(null),e&&e.renewSessionToken()},[e]),{messages:y,isLoading:E,sendMessage:w}=Tf(e,f,C);O.useEffect(()=>{e&&e.hasValidCachedSession()&&(h(!0),c("CACHED_SESSION"))},[e]);const _=R=>{c(R),h(!0),e&&e.validateSession()};return O.useEffect(()=>()=>{e&&e.releaseSession().catch(R=>{console.error("Failed to release session:",R)})},[e]),T.jsxs("div",{className:`gpc-chat-window gpc-animate-fade-in ${g==="dark"?"gpc-dark":""}`,children:[T.jsx(Ni,{onClose:i,theme:g,onToggleTheme:k,showBranding:l,widgetConfig:t}),p?T.jsxs(T.Fragment,{children:[T.jsx(xf,{messages:y,isLoading:E,showMetadata:a,widgetConfig:t}),T.jsx(Cf,{onSendMessage:w,isLoading:E,disabled:!1,gpcService:e})]}):T.jsx(Ef,{siteKey:r,onSuccess:_,onError:u}),l&&T.jsx("div",{className:"gpc-footer",children:T.jsx("span",{className:"gpc-footer-text",children:s("widget.poweredBy")})}),T.jsx(Ft.Toaster,{position:"top-center"})]})};class mn{constructor(n,t){this.licenseToken=t,this.sessionToken=this._getOrCreateSessionToken(t),this.api=Di.create({baseURL:n||di,timeout:cf.API_REQUEST,headers:{"Content-Type":"application/json"}}),this.api.interceptors.request.use(r=>(this.licenseToken&&(r.headers.Authorization=`Bearer ${this.licenseToken}`),r))}_generateSessionToken(){return"session_"+Array.from(crypto.getRandomValues(new Uint8Array(28))).map(n=>n.toString(16).padStart(2,"0")).join("")}_getStorageKey(n){return`tiagpc_session_${n.substring(0,16)}`}_getOrCreateSessionToken(n){const t=this._getStorageKey(n);try{const i=localStorage.getItem(t);if(i){const{sessionToken:o,timestamp:l,validated:a}=JSON.parse(i),u=Date.now(),s=1440*60*1e3;if(a&&u-l<s)return o;localStorage.removeItem(t)}}catch(i){console.warn("[TIA GPC] Error leyendo sesión de localStorage:",i)}return this._generateSessionToken()}hasValidCachedSession(){const n=this._getStorageKey(this.licenseToken);try{const t=localStorage.getItem(n);if(t){const{sessionToken:r,timestamp:i,validated:o}=JSON.parse(t),l=Date.now(),a=1440*60*1e3;return o&&l-i<a}}catch(t){console.warn("[TIA GPC] Error verificando sesión:",t)}return!1}_saveSessionToken(n,t,r=!1){const i=this._getStorageKey(n);try{const o={sessionToken:t,timestamp:Date.now(),validated:r};localStorage.setItem(i,JSON.stringify(o))}catch(o){console.warn("[TIA GPC] Error guardando sesión en localStorage:",o)}}_clearSessionToken(n){const t=this._getStorageKey(n);try{localStorage.removeItem(t)}catch(r){console.warn("[TIA GPC] Error limpiando sesión:",r)}}async sendMessage(n,t,r){if(!this.licenseToken)throw new Error("License token is required.");const i=this.hasValidCachedSession();if(!t&&!i)throw new Error("Turnstile token is required for anti-bot validation.");const l=`${this.api.defaults.baseURL}/ask`;try{const a=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.licenseToken}`},body:JSON.stringify({message:n,turnstile_token:t||"CACHED_SESSION",session_token:this.sessionToken})});if(!a.ok){const g=await a.json().catch(()=>({}));throw new Error(JSON.stringify({statusCode:a.status,errorCode:g.error_code||"UNKNOWN_ERROR",message:g.message||"Request failed",retryAfter:g.retry_after_seconds||null}))}const u=a.body.getReader(),s=new TextDecoder;let f="",c="",p=null,h=null;for(;;){const{done:g,value:k}=await u.read();if(g)break;f+=s.decode(k,{stream:!0});const C=f.split(`
30
- `);f=C.pop();for(const y of C){if(!y.trim()||!y.startsWith("data: "))continue;const E=y.replace("data: ","").trim();if(E!=="[DONE]")try{const w=JSON.parse(E);if(w.type==="content")c+=w.text,r&&r(w.text);else if(w.type==="metadata")p=w;else if(w.type==="summary")h=w;else if(w.type==="error")throw new Error(JSON.stringify({statusCode:w.status_code||500,errorCode:w.error_code,message:w.message,retryAfter:null}))}catch(w){if(w.message&&w.message.startsWith("{"))throw w;console.error("Error parsing SSE event:",w)}}}if(!h)throw new Error("No summary received from server");return{success:!0,data:{message_id:h.message_id,response:c,cost_usd:h.cost_usd,credit_balance_usd:h.credit_balance_usd,input_tokens:h.input_tokens,output_tokens:h.output_tokens,response_time_ms:h.response_time_ms,model_used:h.model_used,created_at:h.created_at}}}catch(a){throw a.message.startsWith("{")?a:new Error(JSON.stringify({statusCode:500,errorCode:"NETWORK_ERROR",message:a.message,retryAfter:null}))}}async transcribeAudio(n){if(!this.licenseToken)throw new Error("License token is required.");try{const t=new FormData;return t.append("file",n,"audio.webm"),(await this.api.post("/transcribe",t,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(t){this._handleError(t)}}async releaseSession(){if(!this.licenseToken){console.warn("No license token available to release session");return}try{return(await this.api.post("/release-session",{session_token:this.sessionToken})).data}catch(n){console.error("Failed to release session:",n.message)}}async getInitConfig(){if(!this.licenseToken)throw new Error("License token is required.");try{return(await this.api.get("/init")).data}catch(n){this._handleError(n)}}async checkHealth(){try{return(await this.api.get("/health")).data}catch(n){return{status:"unhealthy",error:n.message}}}getSessionToken(){return this.sessionToken}renewSessionToken(){const n=this._generateSessionToken();this.sessionToken=n,this._saveSessionToken(this.licenseToken,n)}validateSession(){this._saveSessionToken(this.licenseToken,this.sessionToken,!0)}_handleError(n){if(n.response){const t=n.response.data,i={statusCode:n.response.status,errorCode:t.error_code||"UNKNOWN_ERROR",message:t.message||"Request failed",retryAfter:t.retry_after_seconds||null};throw new Error(JSON.stringify(i))}else throw n.request?new Error(JSON.stringify({statusCode:503,errorCode:"NETWORK_ERROR",message:"No response from server",retryAfter:null})):new Error(JSON.stringify({statusCode:500,errorCode:"INTERNAL_ERROR",message:n.message,retryAfter:null}))}}let ot=null;const Af=(e,n)=>((!ot||n&&ot.licenseToken!==n)&&(ot=new mn(e,n)),ot),Pf={title:"TIA GPC",poweredBy:"Desarrollado por TIA GPC",questionsTo:"Preguntas a"},Df={title:"Asistente",placeholder:"Escribe tu pregunta...",send:"Enviar",close:"Cerrar",welcome:"¡Hola! Bienvenido a {{companyName}}. ¿En qué puedo ayudarte hoy?",emptyState:"Inicia una conversación escribiendo tu pregunta",validation:"Verificando seguridad...",retry:"Reintentar"},Lf={record:"Grabar audio",recording:"Grabando...",stop:"Detener grabación",processing:"Transcribiendo audio...",error:"Error al transcribir audio",unsupported:"Tu navegador no soporta grabación de audio",permissionDenied:"Permiso de micrófono denegado"},_f={light:"Claro",dark:"Oscuro",toggle:"Cambiar tema"},Rf={unauthorized:"Autenticación fallida. Por favor, verifica tu token de licencia e intenta nuevamente.",validation:"Verificación anti-bot fallida. Por favor, recarga la página e intenta nuevamente.",network:"No se pudo conectar al servidor. Verifica tu conexión a internet.",rateLimit:"Has realizado demasiadas consultas o se alcanzó el límite de usuarios concurrentes. Por favor, espera un momento antes de continuar.",session:"Tu sesión ha expirado por inactividad. Por favor, recarga la página para continuar.",insufficientCredits:"Créditos insuficientes. Por favor, recarga créditos desde tu panel de administración para continuar usando TIA GPC.",generic:"Ha ocurrido un error inesperado. Por favor, intenta nuevamente.",aiServiceUnavailable:"El asistente está temporalmente no disponible. Por favor, intenta de nuevo en unos momentos.",serverError:"El servidor encontró un problema. Por favor, intenta de nuevo más tarde.",domainUnauthorized:"Este dominio no está autorizado para usar este widget. Por favor, contacta a tu administrador."},zf={verifying:"Verificando que eres humano...",error:"No se pudo completar la verificación de seguridad. Por favor, recarga la página e intenta nuevamente."},Nf={tokensUsed:"Tokens usados",responseTime:"Tiempo de respuesta",model:"Modelo"},Of={widget:Pf,chat:Df,voice:Lf,theme:_f,errors:Rf,turnstile:zf,metadata:Nf},Ff={title:"TIA GPC",poweredBy:"Powered by TIA GPC",questionsTo:"Questions to"},Mf={title:"Assistant",placeholder:"Type your question...",send:"Send",close:"Close",welcome:"Hello! Welcome to {{companyName}}. How can I help you today?",emptyState:"Start a conversation by typing your question",validation:"Verifying security...",retry:"Retry"},jf={record:"Record audio",recording:"Recording...",stop:"Stop recording",processing:"Transcribing audio...",error:"Error transcribing audio",unsupported:"Your browser does not support audio recording",permissionDenied:"Microphone permission denied"},Bf={light:"Light",dark:"Dark",toggle:"Toggle theme"},Uf={unauthorized:"Authentication failed. Please check your license token and try again.",validation:"Bot verification failed. Please reload the page and try again.",network:"Unable to connect to the server. Please check your internet connection.",rateLimit:"You've made too many requests or the concurrent user limit has been reached. Please wait a moment before continuing.",session:"Your session has expired due to inactivity. Please reload the page to continue.",insufficientCredits:"Insufficient credits. Please reload credits from your admin panel to continue using TIA GPC.",generic:"An unexpected error has occurred. Please try again.",aiServiceUnavailable:"The assistant is temporarily unavailable. Please try again in a few moments.",serverError:"The server encountered a problem. Please try again later.",domainUnauthorized:"This domain is not authorized to use this widget. Please contact your administrator."},Hf={verifying:"Verifying you're human...",error:"Security verification could not be completed. Please reload the page and try again."},qf={tokensUsed:"Tokens used",responseTime:"Response time",model:"Model"},Vf={widget:Ff,chat:Mf,voice:jf,theme:Bf,errors:Uf,turnstile:Hf,metadata:qf},$f={title:"TIA GPC",poweredBy:"Propulsé par TIA GPC",questionsTo:"Questions à"},Gf={title:"Assistant",placeholder:"Tapez votre question...",send:"Envoyer",close:"Fermer",welcome:"Bonjour ! Bienvenue à {{companyName}}. Comment puis-je vous aider aujourd'hui ?",emptyState:"Commencez une conversation en tapant votre question",validation:"Vérification de sécurité...",retry:"Réessayer"},Wf={record:"Enregistrer audio",recording:"Enregistrement...",stop:"Arrêter l'enregistrement",processing:"Transcription audio...",error:"Erreur de transcription audio",unsupported:"Votre navigateur ne prend pas en charge l'enregistrement audio",permissionDenied:"Permission du microphone refusée"},Kf={light:"Clair",dark:"Sombre",toggle:"Changer de thème"},Yf={unauthorized:"Échec de l'authentification. Veuillez vérifier votre jeton de licence et réessayer.",validation:"La vérification anti-bot a échoué. Veuillez recharger la page et réessayer.",network:"Impossible de se connecter au serveur. Veuillez vérifier votre connexion internet.",rateLimit:"Vous avez fait trop de demandes ou la limite d'utilisateurs concurrents a été atteinte. Veuillez patienter un moment avant de continuer.",session:"Votre session a expiré en raison d'inactivité. Veuillez recharger la page pour continuer.",insufficientCredits:"Crédits insuffisants. Veuillez recharger des crédits depuis votre panneau d'administration pour continuer à utiliser TIA GPC.",generic:"Une erreur inattendue s'est produite. Veuillez réessayer.",aiServiceUnavailable:"L'assistant est temporairement indisponible. Veuillez réessayer dans quelques instants.",serverError:"Le serveur a rencontré un problème. Veuillez réessayer plus tard.",domainUnauthorized:"Ce domaine n'est pas autorisé à utiliser ce widget. Veuillez contacter votre administrateur."},Qf={verifying:"Vérification que vous êtes humain...",error:"La vérification de sécurité n'a pas pu être complétée. Veuillez recharger la page et réessayer."},Xf={tokensUsed:"Tokens utilisés",responseTime:"Temps de réponse",model:"Modèle"},Jf={widget:$f,chat:Gf,voice:Wf,theme:Kf,errors:Yf,turnstile:Qf,metadata:Xf};at.use(Li).use(oe.initReactI18next).init({resources:{en:{translation:Vf},es:{translation:Of},fr:{translation:Jf}},fallbackLng:"en",supportedLngs:["en","es","fr"],interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});const xi=({token:e,turnstileSiteKey:n=sf,theme:t=Ce.theme,position:r=Ce.position,language:i=Ce.language,primaryColor:o,width:l=Ce.width,height:a=Ce.height,apiUrl:u=di,onReady:s,onError:f,onClose:c,autoOpen:p=Ce.autoOpen,showBranding:h=Ce.showBranding,mobileFullscreen:g=Ce.mobileFullscreen,...k})=>{const[C,y]=O.useState(p),[E,w]=O.useState(!1),[_,R]=O.useState(null),[b,N]=O.useState(!0),U=O.useMemo(()=>new mn(u,e),[u,e]);if(O.useEffect(()=>{const A=()=>{w(ff())};return A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]),O.useEffect(()=>{i&&at.changeLanguage&&at.changeLanguage(i)},[i]),O.useEffect(()=>{(async()=>{if(!e){N(!1);return}try{const P=await U.getInitConfig();P.success&&(R(P.data),s&&s(P.data))}catch(P){console.error("[TIA GPC Widget] Error loading config:",P),f&&f(P)}finally{N(!1)}})()},[e,U,s,f]),!e)return console.error('[TIA GPC Widget] Error: "token" prop is required'),null;const M=()=>{y(!1),c?.()},x=()=>E&&g?"gpc-position-bottom-right":`gpc-position-${r}`,D=()=>{const A={};return o&&(A["--gpc-color-primary"]=o),(!E||!g)&&(l&&(A["--gpc-widget-width"]=l),a&&(A["--gpc-widget-height"]=a)),A};return T.jsx(oe.I18nextProvider,{i18n:at,children:T.jsxs("div",{className:`gpc-widget gpc-widget-container ${x()} ${t==="dark"?"gpc-dark":""}`,style:D(),children:[!C&&T.jsx(_i,{onClick:()=>y(!0),widgetConfig:_}),C&&!b&&T.jsx(If,{gpcService:U,licenseToken:e,widgetConfig:_,turnstileSiteKey:n,onClose:M,themeMode:t,showBranding:h,showMetadata:k.showMetadata||!1,onError:f})]})})};xi.defaultProps={theme:"auto",position:"bottom-right",language:"en",width:"400px",height:"600px",autoOpen:!1,showBranding:!0,mobileFullscreen:!0};exports.GPCService=mn;exports.LANGUAGES=ki;exports.THEMES=yi;exports.TiaGPCWidget=xi;exports.WIDGET_POSITIONS=gi;exports.getGPCService=Af;
26
+ `))+1))}const l="#".repeat(i),a=t.enter("headingAtx"),s=t.enter("phrasing");o.move(l+" ");let u=t.containerPhrasing(e,{before:"# ",after:`
27
+ `,...o.current()});return/^[\t ]/.test(u)&&(u=Qe(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,t.options.closeAtx&&(u+=" "+l),s(),a(),u}Qr.peek=Yu;function Qr(e){return e.value||""}function Yu(){return"<"}Jr.peek=Xu;function Jr(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let a=t.enter("label");const s=t.createTracker(r);let u=s.move("![");return u+=s.move(t.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),u+=s.move(")"),l(),u}function Xu(){return"!"}Zr.peek=Qu;function Zr(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let l=t.enter("label");const a=t.createTracker(r);let s=a.move("![");const u=t.safe(e.alt,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function Qu(){return"!"}ei.peek=Ju;function ei(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const l=t.unsafe[o],a=t.compilePattern(l);let s;if(l.atBreak)for(;s=a.exec(r);){let u=s.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(s.index+1)}}return i+r+i}function Ju(){return"`"}function ti(e,n){const t=tn(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))}ni.peek=Zu;function ni(e,n,t,r){const i=fn(t),o=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let a,s;if(ti(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=l.move("<");return c+=l.move(t.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),t.stack=f,c}a=t.enter("link"),s=t.enter("label");let u=l.move("[");return u+=l.move(t.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=t.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(t.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),u+=l.move(")"),a(),u}function Zu(e,n,t){return ti(e,t)?"<":"["}ri.peek=ec;function ri(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let l=t.enter("label");const a=t.createTracker(r);let s=a.move("[");const u=t.containerPhrasing(e,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function ec(){return"["}function hn(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 tc(e){const n=hn(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 nc(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 ii(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 rc(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let l=e.ordered?nc(t):hn(t);const a=e.ordered?l==="."?")":".":tc(t);let s=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&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&&(s=!0),ii(t)===l&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(l=a),t.bulletCurrent=l;const u=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=o,i(),u}function ic(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 lc(e,n,t,r){const i=ic(t);let o=t.bulletCurrent||hn(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=t.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const s=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,a.current()),f);return s(),u;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function oc(e,n,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),l=t.containerPhrasing(e,r);return o(),i(),l}const ac=gt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sc(e,n,t,r){return(e.children.some(function(l){return ac(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function uc(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}li.peek=cc;function li(e,n,t,r){const i=uc(t),o=t.enter("strong"),l=t.createTracker(r),a=l.move(i+i);let s=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=ht(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=Qe(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=ht(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+Qe(c));const h=l.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function cc(e,n,t){return t.options.strong||"*"}function fc(e,n,t,r){return t.safe(e.value,r)}function hc(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 pc(e,n,t){const r=(ii(t)+(t.options.ruleSpaces?" ":"")).repeat(hc(t));return t.options.ruleSpaces?r.slice(0,-1):r}const oi={blockquote:Ou,break:lr,code:Hu,definition:Vu,emphasis:Xr,hardBreak:lr,heading:Ku,html:Qr,image:Jr,imageReference:Zr,inlineCode:ei,link:ni,linkReference:ri,list:rc,listItem:lc,paragraph:oc,root:sc,strong:li,text:fc,thematicBreak:pc};function mc(){return{enter:{table:dc,tableData:or,tableHeader:or,tableRow:yc},exit:{codeText:kc,table:gc,tableData:Nt,tableHeader:Nt,tableRow:Nt}}}function dc(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 gc(e){this.exit(e),this.data.inTable=void 0}function yc(e){this.enter({type:"tableRow",children:[]},e)}function Nt(e){this.exit(e)}function or(e){this.enter({type:"tableCell",children:[]},e)}function kc(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,xc));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function xc(e,n){return n==="|"?n:e}function bc(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=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:p,table:l,tableCell:s,tableRow:a}};function l(h,g,x,E){return u(f(h,x,E),h.align)}function a(h,g,x,E){const y=c(h,x,E),C=u([y]);return C.slice(0,C.indexOf(`
29
+ `))}function s(h,g,x,E){const y=x.enter("tableCell"),C=x.enter("phrasing"),k=x.containerPhrasing(h,{...E,before:o,after:o});return C(),y(),k}function u(h,g){return zu(h,{align:g,alignDelimiters:r,padding:t,stringLength:i})}function f(h,g,x){const E=h.children;let y=-1;const C=[],k=g.enter("table");for(;++y<E.length;)C[y]=c(E[y],g,x);return k(),C}function c(h,g,x){const E=h.children;let y=-1;const C=[],k=g.enter("tableRow");for(;++y<E.length;)C[y]=s(E[y],h,g,x);return k(),C}function p(h,g,x){let E=oi.inlineCode(h,g,x);return x.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function wc(){return{exit:{taskListCheckValueChecked:ar,taskListCheckValueUnchecked:ar,paragraph:Cc}}}function Sc(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ec}}}function ar(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Cc(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 o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===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 Ec(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);o&&a.move(l);let s=oi.listItem(e,n,t,{...r,...a.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(f){return f+l}}function Tc(){return[ru(),Eu(),Au(),mc(),wc()]}function vc(e){return{extensions:[iu(),Tu(e),Pu(),bc(e),Sc()]}}const Ic={tokenize:Rc,partial:!0},ai={tokenize:zc,partial:!0},si={tokenize:Nc,partial:!0},ui={tokenize:Oc,partial:!0},Ac={tokenize:Fc,partial:!0},ci={name:"wwwAutolink",tokenize:Lc,previous:hi},fi={name:"protocolAutolink",tokenize:_c,previous:pi},be={name:"emailAutolink",tokenize:Dc,previous:mi},de={};function Pc(){return{text:de}}let Ie=48;for(;Ie<123;)de[Ie]=be,Ie++,Ie===58?Ie=65:Ie===91&&(Ie=97);de[43]=be;de[45]=be;de[46]=be;de[95]=be;de[72]=[be,fi];de[104]=[be,fi];de[87]=[be,ci];de[119]=[be,ci];function Dc(e,n,t){const r=this;let i,o;return l;function l(c){return!Kt(c)||!mi.call(r,r.previous)||pn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Kt(c)?(e.consume(c),a):c===64?(e.consume(c),s):t(c)}function s(c){return c===46?e.check(Ac,f,u)(c):c===45||c===95||J(c)?(o=!0,e.consume(c),s):f(c)}function u(c){return e.consume(c),i=!0,s}function f(c){return o&&i&&ee(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function Lc(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!hi.call(r,r.previous)||pn(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Ic,e.attempt(ai,e.attempt(si,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function _c(e,n,t){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&pi.call(r,r.previous)&&!pn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(ee(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),s}return t(c)}function s(c){return c===47?(e.consume(c),o?u:(o=!0,s)):t(c)}function u(c){return c===null||ut(c)||G(c)||Ae(c)||pt(c)?t(c):e.attempt(ai,e.attempt(si,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Rc(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function zc(e,n,t){let r,i,o;return l;function l(u){return u===46||u===95?e.check(ui,s,a)(u):u===null||G(u)||Ae(u)||u!==45&&pt(u)?s(u):(o=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function s(u){return i||r||!o?t(u):n(u)}}function Nc(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(ui,n,o)(l):l===null||G(l)||Ae(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Oc(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),o):a===93?(e.consume(a),i):a===60||a===null||G(a)||Ae(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||G(a)||Ae(a)?n(a):r(a)}function o(a){return ee(a)?l(a):t(a)}function l(a){return a===59?(e.consume(a),r):ee(a)?(e.consume(a),l):t(a)}}function Fc(e,n,t){return r;function r(o){return e.consume(o),i}function i(o){return J(o)?t(o):n(o)}}function hi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function pi(e){return!ee(e)}function mi(e){return!(e===47||Kt(e))}function Kt(e){return e===43||e===45||e===46||e===95||J(e)}function pn(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}const Mc={tokenize:Gc,partial:!0};function jc(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:qc,continuation:{tokenize:Vc},exit:$c}},text:{91:{name:"gfmFootnoteCall",tokenize:Hc},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Bc,resolveTo:Uc}}}}function Bc(e,n,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const s=r.events[i][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return a;function a(s){if(!l||!l._balanced)return t(s);const u=he(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?t(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),n(s))}}function Uc(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function Hc(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),s}function s(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!l||c===null||c===91||G(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(he(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return G(c)||(l=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function qc(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return s;function s(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(g)}function f(g){if(l>999||g===93&&!a||g===null||g===91||G(g))return t(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=he(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return G(g)||(a=!0),l++,e.consume(g),g===92?c:f}function c(g){return g===91||g===92||g===93?(e.consume(g),l++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),V(e,h,"gfmFootnoteDefinitionWhitespace")):t(g)}function h(g){return n(g)}}function Vc(e,n,t){return e.check(Ze,n,e.attempt(Mc,n,t))}function $c(e){e.exit("gfmFootnoteDefinition")}function Gc(e,n,t){const r=this;return V(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):t(o)}}function Wc(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let s=-1;for(;++s<l.length;)if(l[s][0]==="enter"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._close){let u=s;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[s][1].end.offset-l[s][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[s][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[s][1].end)},c={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[s][1].start)},p=[["enter",f,a],["enter",l[u][1],a],["exit",l[u][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&le(p,p.length,0,mt(h,l.slice(u+1,s),a)),le(p,p.length,0,[["exit",c,a],["enter",l[s][1],a],["exit",l[s][1],a],["exit",f,a]]),le(l,u-1,s-u+3,p),s=u+p.length-2;break}}for(s=-1;++s<l.length;)l[s][1].type==="strikethroughSequenceTemporary"&&(l[s][1].type="data");return l}function o(l,a,s){const u=this.previous,f=this.events;let c=0;return p;function p(g){return u===126&&f[f.length-1][1].type!=="characterEscape"?s(g):(l.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const x=Fe(u);if(g===126)return c>1?s(g):(l.consume(g),c++,h);if(c<2&&!t)return s(g);const E=l.exit("strikethroughSequenceTemporary"),y=Fe(g);return E._open=!y||y===2&&!!x,E._close=!x||x===2&&!!y,a(g)}}}class Kc{constructor(){this.map=[]}add(n,t,r){Yc(this,n,t,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.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 Xc(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 o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function Qc(){return{flow:{null:{name:"table",tokenize:Jc,resolveAll:Zc}}}}function Jc(e,n,t){const r=this;let i=0,o=0,l;return a;function a(b){let P=r.events.length-1;for(;P>-1;){const R=r.events[P][1].type;if(R==="lineEnding"||R==="linePrefix")P--;else break}const A=P>-1?r.events[P][1].type:null,L=A==="tableHead"||A==="tableRow"?w:s;return L===w&&r.parser.lazy[r.now().line]?t(b):L(b)}function s(b){return e.enter("tableHead"),e.enter("tableRow"),u(b)}function u(b){return b===124||(l=!0,o+=1),f(b)}function f(b){return b===null?t(b):N(b)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),h):t(b):H(b)?V(e,f,"whitespace")(b):(o+=1,l&&(l=!1,i+=1),b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(b)))}function c(b){return b===null||b===124||G(b)?(e.exit("data"),f(b)):(e.consume(b),b===92?p:c)}function p(b){return b===92||b===124?(e.consume(b),c):c(b)}function h(b){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(b):(e.enter("tableDelimiterRow"),l=!1,H(b)?V(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):g(b))}function g(b){return b===45||b===58?E(b):b===124?(l=!0,e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),x):z(b)}function x(b){return H(b)?V(e,E,"whitespace")(b):E(b)}function E(b){return b===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),y):b===45?(o+=1,y(b)):b===null||N(b)?D(b):z(b)}function y(b){return b===45?(e.enter("tableDelimiterFiller"),C(b)):z(b)}function C(b){return b===45?(e.consume(b),C):b===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(b))}function k(b){return H(b)?V(e,D,"whitespace")(b):D(b)}function D(b){return b===124?g(b):b===null||N(b)?!l||i!==o?z(b):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(b)):z(b)}function z(b){return t(b)}function w(b){return e.enter("tableRow"),_(b)}function _(b){return b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),_):b===null||N(b)?(e.exit("tableRow"),n(b)):H(b)?V(e,_,"whitespace")(b):(e.enter("data"),U(b))}function U(b){return b===null||b===124||G(b)?(e.exit("data"),_(b)):(e.consume(b),b===92?j:U)}function j(b){return b===92||b===124?(e.consume(b),U):U(b)}}function Zc(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,s=0,u,f,c;const p=new Kc;for(;++t<e.length;){const h=e[t],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,s!==0&&(sr(p,n,s,u,f),f=void 0,s=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",u,n]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",f,n]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=lt(p,n,o,i,void 0,c),o=[0,0,0,0]),l[2]=t)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=lt(p,n,o,i,void 0,c)),o=l,l=[o[1],t,0,0])):g.type==="tableHead"?(a=!0,s=t):g.type==="tableRow"||g.type==="tableDelimiterRow"?(s=t,o[1]!==0?(l[0]=l[1],c=lt(p,n,o,i,t,c)):l[1]!==0&&(c=lt(p,n,l,i,t,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(l[3]=t)}for(s!==0&&sr(p,n,s,u,f),p.consume(n.events),t=-1;++t<n.events.length;){const h=n.events[t];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Xc(n.events,t))}return e}function lt(e,n,t,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(o.end=Object.assign({},Ne(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const s=Ne(n.events,t[1]);if(o={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const u=Ne(n.events,t[2]),f=Ne(n.events,t[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const p=n.events[t[2]],h=n.events[t[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",t[3]>t[2]+1){const g=t[2]+1,x=t[3]-t[2]-1;e.add(g,x,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(o.end=Object.assign({},Ne(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function sr(e,n,t,r,i){const o=[],l=Ne(n.events,t);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(t+1,0,o)}function Ne(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const ef={name:"tasklistCheck",tokenize:nf};function tf(){return{text:{91:ef}}}function nf(e,n,t){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return G(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):t(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(s)}function a(s){return N(s)?n(s):H(s)?e.check({tokenize:rf},n,t)(s):t(s)}}function rf(e,n,t){return V(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function lf(e){return Tr([Pc(),jc(),Wc(e),Qc(),tf()])}const of={};function af(e){const n=this,t=e||of,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(lf(t)),o.push(Tc()),l.push(vc(t))}const di="https://www.tiagpctest.softiabot.com",sf="0x4AAAAAAB-BKyDZcYYqCbid",gi={BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left",TOP_RIGHT:"top-right",TOP_LEFT:"top-left"},yi={LIGHT:"light",DARK:"dark",AUTO:"auto"},ki={SPANISH:"es",ENGLISH:"en",FRANCES:"fr"},uf={MOBILE:640},Ce={theme:yi.AUTO,position:gi.BOTTOM_RIGHT,language:ki.ENGLISH,width:"400px",height:"600px",autoOpen:!1,showBranding:!0,mobileFullscreen:!0},cf={API_REQUEST:3e4},ur={MAX_LENGTH:2e3},ff=()=>window.innerWidth<uf.MOBILE,hf=e=>{try{return new Date(e).toLocaleTimeString("es-ES",{hour:"2-digit",minute:"2-digit"})}catch{return""}},pf=e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`,Ot=()=>crypto.randomUUID(),mf=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",df=e=>e.trim().slice(0,2e3),gf=({size:e="md",className:n=""})=>{const t={sm:"w-4 h-4 border-2",md:"w-6 h-6 border-2",lg:"w-8 h-8 border-3"};return T.jsx("div",{className:`gpc-spinner ${t[e]} ${n}`,role:"status","aria-label":"Cargando",children:T.jsx("span",{className:"sr-only",children:"Cargando..."})})},yf=()=>T.jsxs("div",{className:"gpc-typing-indicator",role:"status","aria-label":"Escribiendo",children:[T.jsx("span",{className:"gpc-typing-dot"}),T.jsx("span",{className:"gpc-typing-dot"}),T.jsx("span",{className:"gpc-typing-dot"})]}),kf=({message:e,showMetadata:n=!1,messageRef:t=null})=>{const{t:r}=oe.useTranslation(),i=e.role==="user",o=!i&&e.isStreaming&&!e.content;return T.jsxs("div",{ref:t,className:`gpc-message ${i?"gpc-message-user":"gpc-message-assistant"}`,role:"article","aria-label":i?"Mensaje del usuario":"Mensaje del asistente",children:[T.jsx("div",{className:"gpc-message-content",children:o?T.jsx(yf,{}):i?e.content.trim():T.jsx(Ws,{remarkPlugins:[af],components:{table:({node:l,...a})=>T.jsx("div",{className:"gpc-table-wrapper",children:T.jsx("table",{className:"gpc-table",...a})}),thead:({node:l,...a})=>T.jsx("thead",{className:"gpc-table-head",...a}),tbody:({node:l,...a})=>T.jsx("tbody",{className:"gpc-table-body",...a}),tr:({node:l,...a})=>T.jsx("tr",{className:"gpc-table-row",...a}),th:({node:l,...a})=>T.jsx("th",{className:"gpc-table-header",...a}),td:({node:l,...a})=>T.jsx("td",{className:"gpc-table-cell",...a})},children:e.content})}),T.jsx("div",{className:`gpc-message-timestamp ${i?"gpc-message-timestamp-user":""}`,children:hf(e.timestamp)}),!i&&n&&e.metadata&&T.jsxs("div",{className:"gpc-message-metadata",children:[e.metadata.tokensUsed&&T.jsxs("div",{className:"gpc-metadata-item",children:[T.jsxs("strong",{children:[r("metadata.tokensUsed"),":"]})," ",e.metadata.tokensUsed]}),e.metadata.responseTimeMs&&T.jsxs("div",{className:"gpc-metadata-item",children:[T.jsxs("strong",{children:[r("metadata.responseTime"),":"]})," ",pf(e.metadata.responseTimeMs)]}),e.metadata.model&&T.jsxs("div",{className:"gpc-metadata-item",children:[T.jsxs("strong",{children:[r("metadata.model"),":"]})," ",e.metadata.model]})]})]})},xf=({messages:e,isLoading:n,showMetadata:t=!1,widgetConfig:r=null})=>{const{t:i}=oe.useTranslation(),o=O.useRef(null),l=O.useRef(null),a=O.useRef(e.length);O.useEffect(()=>{const c=e.length>a.current,p=e[e.length-1];c&&p&&(p.role==="user"?o.current?.scrollIntoView({behavior:"smooth"}):p.role==="assistant"&&p.isStreaming&&setTimeout(()=>{l.current?.scrollIntoView({behavior:"smooth",block:"start"})},100)),a.current=e.length},[e]);const s=r?.company_name||"TIA GPC",u=r?.company_logo_base64,f=u?.startsWith("data:")?u:u?`data:image/png;base64,${u}`:null;return e.length===0&&!n?T.jsx("div",{className:"gpc-messages-container",children:T.jsxs("div",{className:"gpc-empty-state",children:[f?T.jsx("div",{className:"gpc-welcome-logo",children:T.jsx("img",{src:f,alt:s,className:"gpc-welcome-company-logo"})}):T.jsx(me.MessageSquare,{className:"gpc-empty-icon"}),T.jsx("h3",{className:"gpc-empty-title",children:i("chat.welcome",{companyName:s})}),T.jsx("p",{className:"gpc-empty-text",children:i("chat.emptyState")})]})}):T.jsxs("div",{className:"gpc-messages-container gpc-scrollbar gpc-smooth-scroll",children:[e.map((c,p)=>T.jsx(kf,{message:c,showMetadata:t,messageRef:p===e.length-1?l:null},c.id)),T.jsx("div",{ref:o})]})},bf=1.2,wf=2e3,Sf=({onTranscript:e,isLoading:n,disabled:t,onRecordingStateChange:r,onAnalyserChange:i})=>{const{t:o}=oe.useTranslation(),[l,a]=O.useState(!1),[s,u]=O.useState(!1),f=O.useRef(null),c=O.useRef([]),p=O.useRef(null),h=O.useRef(null),g=O.useRef(null),x=O.useRef(null),E=O.useRef(null);O.useEffect(()=>()=>{f.current?.state==="recording"&&f.current.stop(),p.current&&p.current.state!=="closed"&&p.current.close(),E.current&&clearInterval(E.current)},[]),O.useEffect(()=>{r&&r(l||s)},[l,s,r]),O.useEffect(()=>{i&&i(h.current)},[h.current,i]);const y=()=>{if(!h.current||!g.current)return;h.current.getByteTimeDomainData(g.current);let _=0;for(let b=0;b<g.current.length;b++){const P=(g.current[b]-128)/128;_+=P*P}if(Math.sqrt(_/g.current.length)*100<bf){if(x.current||(x.current=Date.now()),Date.now()-x.current>wf){k();return}}else x.current=null},C=async()=>{try{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){alert(o("voice.unsupported"));return}const _=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,sampleRate:48e3,channelCount:1}});p.current=new(window.AudioContext||window.webkitAudioContext),h.current=p.current.createAnalyser(),p.current.createMediaStreamSource(_).connect(h.current),h.current.fftSize=1024,h.current.smoothingTimeConstant=.4,h.current.minDecibels=-85,h.current.maxDecibels=-15;const j=h.current.frequencyBinCount;g.current=new Uint8Array(j);const b=new MediaRecorder(_,{mimeType:"audio/webm;codecs=opus"});f.current=b,c.current=[],x.current=null,b.ondataavailable=P=>{P.data.size>0&&c.current.push(P.data)},b.onstop=async()=>{if(E.current&&(clearInterval(E.current),E.current=null),p.current&&p.current.state!=="closed"&&p.current.close(),x.current=null,c.current.length===0){console.warn("No audio data recorded");return}const P=new Blob(c.current,{type:"audio/webm"});u(!0);try{await e(P)}catch(A){console.error("Transcription error:",A),alert(o("voice.error"))}finally{u(!1),c.current=[]}},b.start(100),a(!0),E.current=setInterval(()=>{y()},100)}catch(_){console.error("Error accessing microphone:",_),_.name==="NotAllowedError"||_.name==="PermissionDeniedError"?alert(o("voice.permissionDenied")):alert(o("voice.unsupported"))}},k=()=>{!l&&f.current?.state!=="recording"||(f.current&&f.current.state==="recording"&&f.current.stop(),E.current&&(clearInterval(E.current),E.current=null),x.current=null,a(!1),f.current&&f.current.stream&&f.current.stream.getTracks().forEach(_=>_.stop()))},D=()=>{l?k():C()},z=t||n||s,w=o(s?"voice.processing":l?"voice.stop":"voice.record");return T.jsx("button",{type:"button",onClick:D,disabled:z,className:`gpc-voice-button ${l?"gpc-voice-recording":""}`,"aria-label":w,title:w,children:s?T.jsx("span",{className:"gpc-spinner"}):l?T.jsx(me.MicOff,{className:"gpc-icon gpc-voice-icon-active"}):T.jsx(me.Mic,{className:"gpc-icon"})})},Cf=({analyser:e,isRecording:n})=>{const t=O.useRef(null),r=O.useRef(null);return O.useEffect(()=>{if(!n||!e||!t.current)return;const i=t.current,o=i.getContext("2d"),l=e.frequencyBinCount,a=new Uint8Array(l),s=window.devicePixelRatio||1,u=i.getBoundingClientRect();i.width=u.width*s,i.height=u.height*s,o.scale(s,s);const f=u.width,c=u.height,p=40,h=3,g=2,x=()=>{if(!n)return;r.current=requestAnimationFrame(x),e.getByteFrequencyData(a),o.clearRect(0,0,f,c);const E=p*(h+g),y=(f-E)/2;for(let C=0;C<p;C++){const k=Math.floor(C*l/p),z=a[k]/255,w=Math.max(2,z*c*.8),_=y+C*(h+g),U=(c-w)/2,j=o.createLinearGradient(0,U,0,U+w);j.addColorStop(0,"rgba(59, 130, 246, 0.8)"),j.addColorStop(1,"rgba(96, 165, 250, 0.6)"),o.fillStyle=j,o.fillRect(_,U,h,w)}};return x(),()=>{r.current&&cancelAnimationFrame(r.current)}},[e,n]),n?T.jsx("div",{className:"gpc-audio-waveform-container",children:T.jsx("canvas",{ref:t,className:"gpc-audio-waveform-canvas","aria-label":"Audio waveform visualization"})}):null},Ef=({onSendMessage:e,isLoading:n,disabled:t,gpcService:r})=>{const{t:i}=oe.useTranslation(),[o,l]=O.useState(""),[a,s]=O.useState(!1),[u,f]=O.useState(null),c=O.useRef(null);O.useEffect(()=>{!t&&!n&&!a&&c.current?.focus()},[t,n,a]);const p=async k=>{k.preventDefault();const D=df(o);if(!(!D||n||t||a))try{await e(D),l("")}catch(z){console.error("Error sending message:",z)}},h=k=>{k.key==="Enter"&&!k.shiftKey&&!a&&(k.preventDefault(),p(k))},g=async k=>{if(!r)throw new Error("GPC Service not available");const D=await r.transcribeAudio(k);D.success&&D.text&&(l(D.text),c.current?.focus())},x=k=>{s(k)},E=k=>{f(k)},y=o.trim().length>0&&!n&&!t&&!a,C=n||t||a;return T.jsxs("form",{onSubmit:p,className:"gpc-input-container",children:[T.jsxs("div",{className:"gpc-input-wrapper",children:[T.jsx("input",{ref:c,type:"text",value:o,onChange:k=>l(k.target.value),onKeyDown:h,placeholder:a?"":i("chat.placeholder"),disabled:C,maxLength:ur.MAX_LENGTH,className:`gpc-input ${a?"gpc-input-recording":""}`,"aria-label":i("chat.placeholder"),"aria-describedby":"chat-input-help"}),T.jsx(Cf,{analyser:u,isRecording:a})]}),T.jsx(Sf,{onTranscript:g,isLoading:n,disabled:t,onRecordingStateChange:x,onAnalyserChange:E}),T.jsx("button",{type:"submit",disabled:!y,className:"gpc-send-button","aria-label":i("chat.send"),title:i("chat.send"),children:n?T.jsx("span",{className:"gpc-spinner"}):T.jsx(me.Send,{className:"gpc-icon"})}),T.jsxs("span",{id:"chat-input-help",className:"gpc-sr-only",children:[i("chat.placeholder"),". Máximo ",ur.MAX_LENGTH," caracteres."]})]})},Tf=({siteKey:e,onSuccess:n,onError:t})=>{const{t:r}=oe.useTranslation(),[i,o]=O.useState(!1),[l,a]=O.useState(null),s=async f=>{o(!0),a(null);try{await n(f)}catch(c){console.error("Turnstile validation error:",c),a(r("turnstile.error")),t?.(c)}finally{o(!1)}},u=f=>{console.error("Turnstile widget error:",f),a(r("turnstile.error")),t?.(new Error(r("turnstile.error")))};return T.jsxs("div",{className:"gpc-validator-container",children:[T.jsxs("div",{className:"gpc-validator-header",children:[T.jsx("h3",{className:"gpc-validator-title",children:r("chat.validation")}),T.jsx("p",{className:"gpc-validator-subtitle",children:r("turnstile.verifying")})]}),!l&&T.jsx("div",{className:"gpc-animate-fade-in",children:T.jsx(Pi.Turnstile,{siteKey:e,onSuccess:s,onError:u,options:{theme:"light",size:"normal"}})}),i&&T.jsxs("div",{className:"gpc-validator-loading",children:[T.jsx(gf,{size:"md"}),T.jsx("p",{className:"gpc-validator-text",children:r("chat.validation")})]}),l&&T.jsxs("div",{className:"gpc-validator-error",children:[T.jsx(me.AlertCircle,{className:"gpc-error-icon"}),T.jsxs("div",{className:"gpc-error-content",children:[T.jsx("p",{className:"gpc-error-title",children:r("errors.validation")}),T.jsx("p",{className:"gpc-error-message",children:l}),T.jsx("button",{onClick:()=>window.location.reload(),className:"gpc-error-button",children:r("chat.retry")})]})]})]})},vf=(e,n,t)=>{const{t:r}=oe.useTranslation(),[i,o]=O.useState([]),[l,a]=O.useState(!1),[s,u]=O.useState(null),f=O.useCallback(async h=>{if(!h.trim()||l)return;if(!n){Ft.error("Validación anti-bot pendiente");return}const g={id:Ot(),role:"user",content:h.trim(),timestamp:new Date().toISOString()};o(y=>[...y,g]),a(!0),u(null);const x=Ot(),E={id:x,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!0};o(y=>[...y,E]);try{const y=await e.sendMessage(h,n,C=>{o(k=>k.map(D=>D.id===x?{...D,content:D.content+C}:D))});o(C=>C.map(k=>k.id===x?{id:y.data.message_id,role:"assistant",content:y.data.response,timestamp:y.data.created_at,isStreaming:!1,metadata:{costUsd:y.data.cost_usd,creditBalanceUsd:y.data.credit_balance_usd,inputTokens:y.data.input_tokens,outputTokens:y.data.output_tokens,responseTimeMs:y.data.response_time_ms,modelUsed:y.data.model_used}}:k))}catch(y){o(_=>_.filter(U=>U.id!==x));let C;try{C=JSON.parse(y.message)}catch{C={statusCode:500,message:y.message}}let k;const D=C.statusCode||500,z=C.errorCode||"";switch(D===401&&z==="SESSION_EXPIRED"&&(k=r("errors.sessionExpired","Session expired, please verify again"),t&&t()),D){case 401:k||(k=r("errors.unauthorized"));break;case 402:k=r("errors.insufficientCredits");break;case 403:z.includes("DOMAIN")||z.includes("UNAUTHORIZED")?k=r("errors.domainUnauthorized"):k=r("errors.validation");break;case 429:k=r("errors.rateLimit");break;case 503:case 502:case 504:k=r("errors.aiServiceUnavailable");break;case 500:k=r("errors.serverError");break;default:k=r("errors.generic")}u(k),Ft.error(k,{duration:4e3,position:"top-center"});const w={id:Ot(),role:"assistant",content:k,timestamp:new Date().toISOString()};o(_=>[..._,w])}finally{a(!1)}},[e,n,l,r,t]),c=O.useCallback(()=>{o([]),u(null)},[]),p=O.useCallback(()=>{u(null)},[]);return{messages:i,isLoading:l,error:s,sendMessage:f,clearMessages:c,clearError:p}},If=(e="auto")=>{const[n,t]=O.useState(e),[r,i]=O.useState("light");return O.useEffect(()=>{if(i(n==="auto"?mf():n),n==="auto"){const a=window.matchMedia("(prefers-color-scheme: dark)"),s=u=>{i(u.matches?"dark":"light")};return a.addEventListener("change",s),()=>{a.removeEventListener("change",s)}}},[n]),{theme:r,themeMode:n,setThemeMode:t,toggleTheme:()=>{t(l=>l==="auto"?r==="light"?"dark":"light":l==="light"?"dark":"light")}}},Af=({gpcService:e,licenseToken:n,widgetConfig:t,turnstileSiteKey:r,onClose:i,themeMode:o,showBranding:l=!0,showMetadata:a=!1,onError:s})=>{const{t:u}=oe.useTranslation(),[f,c]=O.useState(null),[p,h]=O.useState(!1),{theme:g,toggleTheme:x}=If(o),E=O.useCallback(()=>{h(!1),c(null),e&&e.renewSessionToken()},[e]),{messages:y,isLoading:C,sendMessage:k}=vf(e,f,E);O.useEffect(()=>{e&&e.hasValidCachedSession()&&(h(!0),c("CACHED_SESSION"))},[e]);const D=z=>{c(z),h(!0),e&&e.validateSession()};return O.useEffect(()=>()=>{e&&e.releaseSession().catch(z=>{console.error("Failed to release session:",z)})},[e]),T.jsxs("div",{className:`gpc-chat-window gpc-animate-fade-in ${g==="dark"?"gpc-dark":""}`,children:[T.jsx(Ni,{onClose:i,theme:g,onToggleTheme:x,showBranding:l,widgetConfig:t}),p?T.jsxs(T.Fragment,{children:[T.jsx(xf,{messages:y,isLoading:C,showMetadata:a,widgetConfig:t}),T.jsx(Ef,{onSendMessage:k,isLoading:C,disabled:!1,gpcService:e})]}):T.jsx(Tf,{siteKey:r,onSuccess:D,onError:s}),l&&T.jsx("div",{className:"gpc-footer",children:T.jsx("span",{className:"gpc-footer-text",children:u("widget.poweredBy")})}),T.jsx(Ft.Toaster,{position:"top-center"})]})};class mn{constructor(n,t){this.licenseToken=t,this.sessionToken=this._getOrCreateSessionToken(t),this.api=Di.create({baseURL:n||di,timeout:cf.API_REQUEST,headers:{"Content-Type":"application/json"}}),this.api.interceptors.request.use(r=>(this.licenseToken&&(r.headers.Authorization=`Bearer ${this.licenseToken}`),r))}_generateSessionToken(){return"session_"+Array.from(crypto.getRandomValues(new Uint8Array(28))).map(n=>n.toString(16).padStart(2,"0")).join("")}_getStorageKey(n){return`tiagpc_session_${n.substring(0,16)}`}_getOrCreateSessionToken(n){const t=this._getStorageKey(n);try{const i=localStorage.getItem(t);if(i){const{sessionToken:o,timestamp:l,validated:a}=JSON.parse(i),s=Date.now(),u=1440*60*1e3;if(a&&s-l<u)return o;localStorage.removeItem(t)}}catch(i){console.warn("[TIA GPC] Error leyendo sesión de localStorage:",i)}return this._generateSessionToken()}hasValidCachedSession(){const n=this._getStorageKey(this.licenseToken);try{const t=localStorage.getItem(n);if(t){const{sessionToken:r,timestamp:i,validated:o}=JSON.parse(t),l=Date.now(),a=1440*60*1e3;return o&&l-i<a}}catch(t){console.warn("[TIA GPC] Error verificando sesión:",t)}return!1}_saveSessionToken(n,t,r=!1){const i=this._getStorageKey(n);try{const o={sessionToken:t,timestamp:Date.now(),validated:r};localStorage.setItem(i,JSON.stringify(o))}catch(o){console.warn("[TIA GPC] Error guardando sesión en localStorage:",o)}}_clearSessionToken(n){const t=this._getStorageKey(n);try{localStorage.removeItem(t)}catch(r){console.warn("[TIA GPC] Error limpiando sesión:",r)}}async sendMessage(n,t,r){if(!this.licenseToken)throw new Error("License token is required.");const i=this.hasValidCachedSession();if(!t&&!i)throw new Error("Turnstile token is required for anti-bot validation.");const l=`${this.api.defaults.baseURL}/ask`;try{const a=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.licenseToken}`},body:JSON.stringify({message:n,turnstile_token:t||"CACHED_SESSION",session_token:this.sessionToken})});if(!a.ok){const g=await a.json().catch(()=>({}));throw new Error(JSON.stringify({statusCode:a.status,errorCode:g.error_code||"UNKNOWN_ERROR",message:g.message||"Request failed",retryAfter:g.retry_after_seconds||null}))}const s=a.body.getReader(),u=new TextDecoder;let f="",c="",p=null,h=null;for(;;){const{done:g,value:x}=await s.read();if(g)break;f+=u.decode(x,{stream:!0});const E=f.split(`
30
+ `);f=E.pop();for(const y of E){if(!y.trim()||!y.startsWith("data: "))continue;const C=y.replace("data: ","").trim();if(C!=="[DONE]")try{const k=JSON.parse(C);if(k.type==="content")c+=k.text,r&&r(k.text);else if(k.type==="metadata")p=k;else if(k.type==="summary")h=k;else if(k.type==="error")throw new Error(JSON.stringify({statusCode:k.status_code||500,errorCode:k.error_code,message:k.message,retryAfter:null}))}catch(k){if(k.message&&k.message.startsWith("{"))throw k;console.error("Error parsing SSE event:",k)}}}if(!h)throw new Error("No summary received from server");return{success:!0,data:{message_id:h.message_id,response:c,cost_usd:h.cost_usd,credit_balance_usd:h.credit_balance_usd,input_tokens:h.input_tokens,output_tokens:h.output_tokens,response_time_ms:h.response_time_ms,model_used:h.model_used,created_at:h.created_at}}}catch(a){throw a.message.startsWith("{")?a:new Error(JSON.stringify({statusCode:500,errorCode:"NETWORK_ERROR",message:a.message,retryAfter:null}))}}async transcribeAudio(n){if(!this.licenseToken)throw new Error("License token is required.");try{const t=new FormData;return t.append("file",n,"audio.webm"),(await this.api.post("/transcribe",t,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(t){this._handleError(t)}}async releaseSession(){if(!this.licenseToken){console.warn("No license token available to release session");return}try{return(await this.api.post("/release-session",{session_token:this.sessionToken})).data}catch(n){console.error("Failed to release session:",n.message)}}async getInitConfig(){if(!this.licenseToken)throw new Error("License token is required.");try{return(await this.api.get("/init")).data}catch(n){this._handleError(n)}}async checkHealth(){try{return(await this.api.get("/health")).data}catch(n){return{status:"unhealthy",error:n.message}}}getSessionToken(){return this.sessionToken}renewSessionToken(){const n=this._generateSessionToken();this.sessionToken=n,this._saveSessionToken(this.licenseToken,n)}validateSession(){this._saveSessionToken(this.licenseToken,this.sessionToken,!0)}_handleError(n){if(n.response){const t=n.response.data,i={statusCode:n.response.status,errorCode:t.error_code||"UNKNOWN_ERROR",message:t.message||"Request failed",retryAfter:t.retry_after_seconds||null};throw new Error(JSON.stringify(i))}else throw n.request?new Error(JSON.stringify({statusCode:503,errorCode:"NETWORK_ERROR",message:"No response from server",retryAfter:null})):new Error(JSON.stringify({statusCode:500,errorCode:"INTERNAL_ERROR",message:n.message,retryAfter:null}))}}let ot=null;const Pf=(e,n)=>((!ot||n&&ot.licenseToken!==n)&&(ot=new mn(e,n)),ot),Df={title:"TIA GPC",poweredBy:"Desarrollado por TIA GPC",questionsTo:"Preguntas a"},Lf={title:"Asistente",placeholder:"Escribe tu pregunta...",send:"Enviar",close:"Cerrar",welcome:"¡Hola! Bienvenido a {{companyName}}. ¿En qué puedo ayudarte hoy?",emptyState:"Inicia una conversación escribiendo tu pregunta",validation:"Verificando seguridad...",retry:"Reintentar"},_f={record:"Grabar audio",recording:"Grabando...",stop:"Detener grabación",processing:"Transcribiendo audio...",error:"Error al transcribir audio",unsupported:"Tu navegador no soporta grabación de audio",permissionDenied:"Permiso de micrófono denegado"},Rf={light:"Claro",dark:"Oscuro",toggle:"Cambiar tema"},zf={unauthorized:"Autenticación fallida. Por favor, verifica tu token de licencia e intenta nuevamente.",validation:"Verificación anti-bot fallida. Por favor, recarga la página e intenta nuevamente.",network:"No se pudo conectar al servidor. Verifica tu conexión a internet.",rateLimit:"Has realizado demasiadas consultas o se alcanzó el límite de usuarios concurrentes. Por favor, espera un momento antes de continuar.",session:"Tu sesión ha expirado por inactividad. Por favor, recarga la página para continuar.",insufficientCredits:"Créditos insuficientes. Por favor, recarga créditos desde tu panel de administración para continuar usando TIA GPC.",generic:"Ha ocurrido un error inesperado. Por favor, intenta nuevamente.",aiServiceUnavailable:"El asistente está temporalmente no disponible. Por favor, intenta de nuevo en unos momentos.",serverError:"El servidor encontró un problema. Por favor, intenta de nuevo más tarde.",domainUnauthorized:"Este dominio no está autorizado para usar este widget. Por favor, contacta a tu administrador."},Nf={verifying:"Verificando que eres humano...",error:"No se pudo completar la verificación de seguridad. Por favor, recarga la página e intenta nuevamente."},Of={tokensUsed:"Tokens usados",responseTime:"Tiempo de respuesta",model:"Modelo"},Ff={widget:Df,chat:Lf,voice:_f,theme:Rf,errors:zf,turnstile:Nf,metadata:Of},Mf={title:"TIA GPC",poweredBy:"Powered by TIA GPC",questionsTo:"Questions to"},jf={title:"Assistant",placeholder:"Type your question...",send:"Send",close:"Close",welcome:"Hello! Welcome to {{companyName}}. How can I help you today?",emptyState:"Start a conversation by typing your question",validation:"Verifying security...",retry:"Retry"},Bf={record:"Record audio",recording:"Recording...",stop:"Stop recording",processing:"Transcribing audio...",error:"Error transcribing audio",unsupported:"Your browser does not support audio recording",permissionDenied:"Microphone permission denied"},Uf={light:"Light",dark:"Dark",toggle:"Toggle theme"},Hf={unauthorized:"Authentication failed. Please check your license token and try again.",validation:"Bot verification failed. Please reload the page and try again.",network:"Unable to connect to the server. Please check your internet connection.",rateLimit:"You've made too many requests or the concurrent user limit has been reached. Please wait a moment before continuing.",session:"Your session has expired due to inactivity. Please reload the page to continue.",insufficientCredits:"Insufficient credits. Please reload credits from your admin panel to continue using TIA GPC.",generic:"An unexpected error has occurred. Please try again.",aiServiceUnavailable:"The assistant is temporarily unavailable. Please try again in a few moments.",serverError:"The server encountered a problem. Please try again later.",domainUnauthorized:"This domain is not authorized to use this widget. Please contact your administrator."},qf={verifying:"Verifying you're human...",error:"Security verification could not be completed. Please reload the page and try again."},Vf={tokensUsed:"Tokens used",responseTime:"Response time",model:"Model"},$f={widget:Mf,chat:jf,voice:Bf,theme:Uf,errors:Hf,turnstile:qf,metadata:Vf},Gf={title:"TIA GPC",poweredBy:"Propulsé par TIA GPC",questionsTo:"Questions à"},Wf={title:"Assistant",placeholder:"Tapez votre question...",send:"Envoyer",close:"Fermer",welcome:"Bonjour ! Bienvenue à {{companyName}}. Comment puis-je vous aider aujourd'hui ?",emptyState:"Commencez une conversation en tapant votre question",validation:"Vérification de sécurité...",retry:"Réessayer"},Kf={record:"Enregistrer audio",recording:"Enregistrement...",stop:"Arrêter l'enregistrement",processing:"Transcription audio...",error:"Erreur de transcription audio",unsupported:"Votre navigateur ne prend pas en charge l'enregistrement audio",permissionDenied:"Permission du microphone refusée"},Yf={light:"Clair",dark:"Sombre",toggle:"Changer de thème"},Xf={unauthorized:"Échec de l'authentification. Veuillez vérifier votre jeton de licence et réessayer.",validation:"La vérification anti-bot a échoué. Veuillez recharger la page et réessayer.",network:"Impossible de se connecter au serveur. Veuillez vérifier votre connexion internet.",rateLimit:"Vous avez fait trop de demandes ou la limite d'utilisateurs concurrents a été atteinte. Veuillez patienter un moment avant de continuer.",session:"Votre session a expiré en raison d'inactivité. Veuillez recharger la page pour continuer.",insufficientCredits:"Crédits insuffisants. Veuillez recharger des crédits depuis votre panneau d'administration pour continuer à utiliser TIA GPC.",generic:"Une erreur inattendue s'est produite. Veuillez réessayer.",aiServiceUnavailable:"L'assistant est temporairement indisponible. Veuillez réessayer dans quelques instants.",serverError:"Le serveur a rencontré un problème. Veuillez réessayer plus tard.",domainUnauthorized:"Ce domaine n'est pas autorisé à utiliser ce widget. Veuillez contacter votre administrateur."},Qf={verifying:"Vérification que vous êtes humain...",error:"La vérification de sécurité n'a pas pu être complétée. Veuillez recharger la page et réessayer."},Jf={tokensUsed:"Tokens utilisés",responseTime:"Temps de réponse",model:"Modèle"},Zf={widget:Gf,chat:Wf,voice:Kf,theme:Yf,errors:Xf,turnstile:Qf,metadata:Jf};at.use(Li).use(oe.initReactI18next).init({resources:{en:{translation:$f},es:{translation:Ff},fr:{translation:Zf}},fallbackLng:"en",supportedLngs:["en","es","fr"],interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});const xi=({token:e,turnstileSiteKey:n=sf,theme:t=Ce.theme,position:r=Ce.position,language:i=Ce.language,primaryColor:o,width:l=Ce.width,height:a=Ce.height,apiUrl:s=di,onReady:u,onError:f,onClose:c,autoOpen:p=Ce.autoOpen,showBranding:h=Ce.showBranding,mobileFullscreen:g=Ce.mobileFullscreen,...x})=>{const[E,y]=O.useState(p),[C,k]=O.useState(!1),[D,z]=O.useState(null),[w,_]=O.useState(!0),U=O.useMemo(()=>new mn(s,e),[s,e]);if(O.useEffect(()=>{const A=()=>{k(ff())};return A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]),O.useEffect(()=>{i&&at.changeLanguage&&at.changeLanguage(i)},[i]),O.useEffect(()=>{(async()=>{if(!e){_(!1);return}try{const L=await U.getInitConfig();L.success&&(z(L.data),u&&u(L.data))}catch(L){console.error("[TIA GPC Widget] Error loading config:",L),f&&f(L)}finally{_(!1)}})()},[e,U,u,f]),!e)return console.error('[TIA GPC Widget] Error: "token" prop is required'),null;const j=()=>{y(!1),c?.()},b=()=>C&&g?"gpc-position-bottom-right":`gpc-position-${r}`,P=()=>{const A={};return o&&(A["--gpc-color-primary"]=o),(!C||!g)&&(l&&(A["--gpc-widget-width"]=l),a&&(A["--gpc-widget-height"]=a)),A};return T.jsx(oe.I18nextProvider,{i18n:at,children:T.jsxs("div",{className:`gpc-widget gpc-widget-container ${b()} ${t==="dark"?"gpc-dark":""}`,style:P(),children:[!E&&T.jsx(_i,{onClick:()=>y(!0),widgetConfig:D}),E&&!w&&T.jsx(Af,{gpcService:U,licenseToken:e,widgetConfig:D,turnstileSiteKey:n,onClose:j,themeMode:t,showBranding:h,showMetadata:x.showMetadata||!1,onError:f})]})})};xi.defaultProps={theme:"auto",position:"bottom-right",language:"en",width:"400px",height:"600px",autoOpen:!1,showBranding:!0,mobileFullscreen:!0};exports.GPCService=mn;exports.LANGUAGES=ki;exports.THEMES=yi;exports.TiaGPCWidget=xi;exports.WIDGET_POSITIONS=gi;exports.getGPCService=Pf;
31
31
  //# sourceMappingURL=tia-gpc.cjs.js.map