@snf/qa-bot-core 0.2.3-beta.0 → 0.2.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@ import*as e from"react";import t,{forwardRef as n,createContext as r,useContext
5
5
  * Copyright(c) 2015 Andreas Lubbe
6
6
  * Copyright(c) 2015 Tiancheng "Timothy" Gu
7
7
  * MIT Licensed
8
- */var hn,gn;const mn=fn(function(){if(gn)return hn;gn=1;var e=/["'&<>]/;return hn=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,A="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#39;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}a!==i&&(A+=n.substring(a,i)),a=i+1,A+=o}return a!==i?A+n.substring(a,i):A}}());function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bn=/(url|image|image-set)\(/i;class wn extends pn{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(bn)&&delete t[e]}),t}}const yn=/^<(!doctype|(html|head|body)(\s|>))/i,xn=/^(aria-|data-|\w+:)/iu,En=/{{{(\w+)\/?}}}/;function Bn(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let Pn=class{constructor(e,t={},n=[],r=[]){var o;if(vn(this,"allowed",void 0),vn(this,"banned",void 0),vn(this,"blocked",void 0),vn(this,"container",void 0),vn(this,"content",[]),vn(this,"props",void 0),vn(this,"matchers",void 0),vn(this,"filters",void 0),vn(this,"keyIndex",void 0),"production"!==process.env.NODE_ENV&&e&&"string"!=typeof e)throw new TypeError("Interweave parser requires a valid string.");this.props=t,this.matchers=n,this.filters=[...r,new wn],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:ln),this.banned=new Set(an),this.blocked=new Set(t.blockList)}applyAttributeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.attribute?n.attribute(e,t):t,t)}applyNodeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.node?n.node(e,t):t,t)}applyMatchers(e,t){const n={},{props:r}=this;let o=e,A=0,i=null;return this.matchers.forEach(e=>{const a=e.asTag().toLowerCase(),l=this.getTagConfig(a);if(r[e.inverseName]||!this.isTagAllowed(a)||!this.canRenderChild(t,l))return;let s="";for(;o&&(i=e.match(o));){const{index:t,length:a,match:l,valid:c,void:u,...d}=i,p=e.propName+String(A);t>0&&(s+=o.slice(0,t)),c?(s+=u?`{{{${p}/}}}`:`{{{${p}}}}${l}{{{/${p}}}}`,this.keyIndex+=1,A+=1,n[p]={children:l,matcher:e,props:{...r,...d,key:this.keyIndex}}):s+=l,e.greedy?(o=s+o.slice(t+a),s=""):o=o.slice(t+(a||l.length))}e.greedy||(o=s+o)}),0===A?e:this.replaceTokens(o,n)}canRenderChild(e,t){return!(!e.tagName||!t.tagName||e.void)&&(e.children.length>0?e.children.includes(t.tagName):!(e.invalid.length>0&&e.invalid.includes(t.tagName))&&(t.parent.length>0?t.parent.includes(e.tagName):!(!e.self&&e.tagName===t.tagName)&&!!(e&&e.content&t.type)))}convertLineBreaks(e){const{noHtml:t,disableLineBreaks:n}=this.props;if(t||n||e.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return e;let r=e.replace(/\r\n/g,"\n");return r=r.replace(/\n{3,}/g,"\n\n\n"),r=r.replace(/\n/g,"<br/>"),r}createContainer(e){var t;const n=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||Bn)();if(!n)return;const r=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",o="body"===r||"fragment"===r?n.body:n.createElement(r);if(e.match(yn)){if("production"!==process.env.NODE_ENV)throw new Error("HTML documents as Interweave content are not supported.")}else o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?mn(e):e);return o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:A,value:i}=o,a=A.toLowerCase(),l=sn[a]||sn[A];if(!this.isSafe(e)||!a.match(xn)&&(!t&&(!l||2===l)||a.startsWith("on")||i.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let s="style"===a?this.extractStyleAttribute(e):i;4===l?s=!0:3===l?s=Number.parseFloat(String(s)):5!==l&&(s=String(s)),n[cn[a]||a]=this.applyAttributeFilters(a,s),r+=1}),0!==r)?n:null}extractStyleAttribute(e){const t={};return Array.from(e.style).forEach(n=>{const r=e.style[n];("string"==typeof r||"number"==typeof r)&&(t[n.replace(/-([a-z])/g,(e,t)=>String(t).toUpperCase())]=r)}),t}getTagConfig(e){const t={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return An[e]?{...t,...An[e],tagName:e}:t}isSafe(e){if(typeof HTMLAnchorElement<"u"&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(e,n){const{noHtml:r,noHtmlExceptMatchers:o,allowElements:A,transform:i,transformOnlyAllowList:a}=this.props;let l=[],s="";return[...e.childNodes].forEach(e=>{if(1===e.nodeType){const u=e.nodeName.toLowerCase(),d=this.getTagConfig(u);s&&(l.push(s),s="");const p=this.applyNodeFilters(u,e);if(!p)return;let f;if(i&&(!a||this.isTagAllowed(u))){this.keyIndex+=1;const e=this.keyIndex;f=this.parseNode(p,d);const n=i(p,f,d);if(null===n)return;if(typeof n<"u")return void l.push(t.cloneElement(n,{key:e}));this.keyIndex=e-1}if(this.banned.has(u))return;if(r||o&&"br"!==u||!this.isTagAllowed(u)||!A&&!this.canRenderChild(n,d))l=[...l,...this.parseNode(p,d.tagName?d:n)];else{var c;this.keyIndex+=1;const e=this.extractAttributes(p),n={tagName:u};e&&(n.attributes=e),d.void&&(n.selfClose=d.void),l.push(t.createElement(dn,{...n,key:this.keyIndex},null!==(c=f)&&void 0!==c?c:this.parseNode(p,d)))}}else if(3===e.nodeType){const t=r&&!o?e.textContent:this.applyMatchers(e.textContent||"",n);Array.isArray(t)?l=[...l,...t]:s+=t}}),s&&l.push(s),l}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(En);){const[e,A]=o,i=o.index,a=e.includes("/");if("production"!==process.env.NODE_ENV&&!t[A])throw new Error(`Token "${A}" found but no matching element to replace with.`);i>0&&(n.push(r.slice(0,i)),r=r.slice(i));const{children:l,matcher:s,props:c}=t[A];let u;if(a)u=e.length,n.push(s.createElement(l,c));else{const o=r.match(new RegExp(`{{{/${A}}}}`));if("production"!==process.env.NODE_ENV&&!o)throw new Error(`Closing token missing for interpolated element "${A}".`);u=o.index+o[0].length,n.push(s.createElement(this.replaceTokens(r.slice(e.length,o.index),t),c))}r=r.slice(u)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function Dn(e){var n;const{attributes:r,className:o,containerTagName:A,content:i,emptyContent:a,parsedContent:l,tagName:s,noWrap:c}=e,u=null!==(n=A??s)&&void 0!==n?n:"span",d="fragment"===u||c;let p;if(l)p=l;else{const t=new Pn(i??"",e).parse();t.length>0&&(p=t)}return p||(p=a),d?t.createElement(t.Fragment,null,p):t.createElement(dn,{attributes:r,className:o,tagName:u},p)}function kn(e){const{attributes:n,className:r,content:o="",disableFilters:A=!1,disableMatchers:i=!1,emptyContent:a=null,filters:l=[],matchers:s=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:d="span",noWrap:p=!1,...f}=e,h=i?[]:s,g=A?[]:l,m=u?[u]:[],v=c?[c]:[];h.forEach(e=>{e.onBeforeParse&&m.push(e.onBeforeParse.bind(e)),e.onAfterParse&&v.push(e.onAfterParse.bind(e))});const b=m.reduce((t,n)=>{const r=n(t,e);if("production"!==process.env.NODE_ENV&&"string"!=typeof r)throw new TypeError("Interweave `onBeforeParse` must return a valid HTML string.");return r},o??""),w=new Pn(b,f,h,g),y=v.reduce((t,n)=>{const r=n(t,e);if("production"!==process.env.NODE_ENV&&!Array.isArray(r))throw new TypeError("Interweave `onAfterParse` must return an array of strings and React elements.");return r},w.parse());return t.createElement(Dn,{attributes:n,className:r,containerTagName:e.containerTagName,emptyContent:a,noWrap:p,parsedContent:0===y.length?void 0:y,tagName:d})}const Cn=({children:e})=>h("div",{style:{whiteSpace:"normal"},children:h(kn,{content:"string"==typeof e?e:""})}),Sn={autoConfig:!0},Tn=(e,t,n)=>{var r;if(!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderHtml)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)},In=e=>{const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const A=e[o];"<"===A?r?(t.push(n),n=A):(r=!0,n=A):">"===A?(n+=A,t.push(n),n="",r=!1):r?n+=A:t.push(A)}return""!==n&&t.push(n),t},Qn=e=>{const{getFlow:t}=Zt(),{messages:n,replaceMessages:r}=$t(),{settings:o}=tn(),{hasChatHistoryLoaded:A}=nn(),i={...e,...Sn},a=i.htmlComponent?i.htmlComponent:Cn;l(()=>{var e,t;if(A){const A=[...n];for(let n=0;n<A.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=A[n];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=a)}r(A)}},[A]);const s=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();"string"==typeof e.data.message.content&&Tn(e,t(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=In),e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};en(X.PRE_INJECT_MESSAGE,s),en(X.CHUNK_STREAM_MESSAGE,s),en(X.START_STREAM_MESSAGE,s),en(X.START_SIMULATE_STREAM_MESSAGE,s),en(X.START_SPEAK_AUDIO,async e=>{Tn(e,t(),"BOT")&&(e.data.textToRead=(e=>typeof window.DOMParser<"u"?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<\/?[^>]+(>|$)/g,""))(e.data.textToRead))});const c={name:"@rcb-plugins/html-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c};const Mn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,On=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ln={};function Nn(e,t){return(Ln.jsx?On:Mn).test(e)}const Hn=/[ \t\n\f\r]/g;function Rn(e){return""===e.replace(Hn,"")}class zn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Fn(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new zn(n,r,t)}function jn(e){return e.toLowerCase()}zn.prototype.property={},zn.prototype.normal={},zn.prototype.space=null;class Un{constructor(e,t){this.property=e,this.attribute=t}}Un.prototype.space=null,Un.prototype.boolean=!1,Un.prototype.booleanish=!1,Un.prototype.overloadedBoolean=!1,Un.prototype.number=!1,Un.prototype.commaSeparated=!1,Un.prototype.spaceSeparated=!1,Un.prototype.commaOrSpaceSeparated=!1,Un.prototype.mustUseProperty=!1,Un.prototype.defined=!1;let qn=0;const Yn=Jn(),Gn=Jn(),_n=Jn(),Wn=Jn(),Vn=Jn(),Xn=Jn(),Kn=Jn();function Jn(){return 2**++qn}const Zn=Object.freeze(Object.defineProperty({__proto__:null,boolean:Yn,booleanish:Gn,commaOrSpaceSeparated:Kn,commaSeparated:Xn,number:Wn,overloadedBoolean:_n,spaceSeparated:Vn},Symbol.toStringTag,{value:"Module"})),$n=Object.keys(Zn);class er extends Un{constructor(e,t,n,r){let o=-1;if(super(e,t),tr(this,"space",r),"number"==typeof n)for(;++o<$n.length;){const e=$n[o];tr(this,$n[o],(n&Zn[e])===Zn[e])}}}function tr(e,t,n){n&&(e[t]=n)}er.prototype.defined=!0;const nr={}.hasOwnProperty;function rr(e){const t={},n={};let r;for(r in e.properties)if(nr.call(e.properties,r)){const o=e.properties[r],A=new er(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(A.mustUseProperty=!0),t[r]=A,n[jn(r)]=r,n[jn(A.attribute)]=r}return new zn(t,n,e.space)}const or=rr({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Ar=rr({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function ir(e,t){return t in e?e[t]:t}function ar(e,t){return ir(e,t.toLowerCase())}const lr=rr({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ar,properties:{xmlns:null,xmlnsXLink:null}}),sr=rr({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Wn,ariaColIndex:Wn,ariaColSpan:Wn,ariaControls:Vn,ariaCurrent:null,ariaDescribedBy:Vn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:Vn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:Vn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vn,ariaLevel:Wn,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:Vn,ariaPlaceholder:null,ariaPosInSet:Wn,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:Vn,ariaRowCount:Wn,ariaRowIndex:Wn,ariaRowSpan:Wn,ariaSelected:Gn,ariaSetSize:Wn,ariaSort:null,ariaValueMax:Wn,ariaValueMin:Wn,ariaValueNow:Wn,ariaValueText:null,role:null}}),cr=rr({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ar,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xn,acceptCharset:Vn,accessKey:Vn,action:null,allow:null,allowFullScreen:Yn,allowPaymentRequest:Yn,allowUserMedia:Yn,alt:null,as:null,async:Yn,autoCapitalize:null,autoComplete:Vn,autoFocus:Yn,autoPlay:Yn,blocking:Vn,capture:null,charSet:null,checked:Yn,cite:null,className:Vn,cols:Wn,colSpan:null,content:null,contentEditable:Gn,controls:Yn,controlsList:Vn,coords:Wn|Xn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Yn,defer:Yn,dir:null,dirName:null,disabled:Yn,download:_n,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Yn,formTarget:null,headers:Vn,height:Wn,hidden:Yn,high:Wn,href:null,hrefLang:null,htmlFor:Vn,httpEquiv:Vn,id:null,imageSizes:null,imageSrcSet:null,inert:Yn,inputMode:null,integrity:null,is:null,isMap:Yn,itemId:null,itemProp:Vn,itemRef:Vn,itemScope:Yn,itemType:Vn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Yn,low:Wn,manifest:null,max:null,maxLength:Wn,media:null,method:null,min:null,minLength:Wn,multiple:Yn,muted:Yn,name:null,nonce:null,noModule:Yn,noValidate:Yn,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:Yn,optimum:Wn,pattern:null,ping:Vn,placeholder:null,playsInline:Yn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Yn,referrerPolicy:null,rel:Vn,required:Yn,reversed:Yn,rows:Wn,rowSpan:Wn,sandbox:Vn,scope:null,scoped:Yn,seamless:Yn,selected:Yn,shadowRootClonable:Yn,shadowRootDelegatesFocus:Yn,shadowRootMode:null,shape:null,size:Wn,sizes:null,slot:null,span:Wn,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Wn,step:null,style:null,tabIndex:Wn,target:null,title:null,translate:null,type:null,typeMustMatch:Yn,useMap:null,value:Gn,width:Wn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vn,axis:null,background:null,bgColor:null,border:Wn,borderColor:null,bottomMargin:Wn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Yn,declare:Yn,event:null,face:null,frame:null,frameBorder:null,hSpace:Wn,leftMargin:Wn,link:null,longDesc:null,lowSrc:null,marginHeight:Wn,marginWidth:Wn,noResize:Yn,noHref:Yn,noShade:Yn,noWrap:Yn,object:null,profile:null,prompt:null,rev:null,rightMargin:Wn,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Wn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Wn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Yn,disableRemotePlayback:Yn,prefix:null,property:null,results:Wn,security:null,unselectable:null}}),ur=rr({space:"svg",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"},transform:ir,properties:{about:Kn,accentHeight:Wn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Wn,amplitude:Wn,arabicForm:null,ascent:Wn,attributeName:null,attributeType:null,azimuth:Wn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Wn,by:null,calcMode:null,capHeight:Wn,className:Vn,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:Wn,diffuseConstant:Wn,direction:null,display:null,dur:null,divisor:Wn,dominantBaseline:null,download:Yn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Wn,enableBackground:null,end:null,event:null,exponent:Wn,externalResourcesRequired:null,fill:null,fillOpacity:Wn,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:Xn,g2:Xn,glyphName:Xn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Wn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Wn,horizOriginX:Wn,horizOriginY:Wn,id:null,ideographic:Wn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Wn,k:Wn,k1:Wn,k2:Wn,k3:Wn,k4:Wn,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Wn,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:Wn,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:Wn,overlineThickness:Wn,paintOrder:null,panose1:null,path:null,pathLength:Wn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Wn,pointsAtY:Wn,pointsAtZ:Wn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,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:Wn,specularExponent:Wn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Wn,strikethroughThickness:Wn,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Wn,strokeOpacity:Wn,strokeWidth:null,style:null,surfaceScale:Wn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:Wn,tableValues:null,target:null,targetX:Wn,targetY:Wn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Wn,underlineThickness:Wn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Wn,values:null,vAlphabetic:Wn,vMathematical:Wn,vectorEffect:null,vHanging:Wn,vIdeographic:Wn,version:null,vertAdvY:Wn,vertOriginX:Wn,vertOriginY:Wn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Wn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),dr=/^data[-\w.:]+$/i,pr=/-[a-z]/g,fr=/[A-Z]/g;function hr(e){return"-"+e.toLowerCase()}function gr(e){return e.charAt(1).toUpperCase()}const mr={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"},vr=Fn([Ar,or,lr,sr,cr],"html"),br=Fn([Ar,or,lr,sr,ur],"svg");function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yr,xr,Er,Br={};var Pr=function(){if(Er)return Br;Er=1;var e=Br&&Br.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Br,"__esModule",{value:!0}),Br.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),A="function"==typeof n;return o.forEach(function(e){if("declaration"===e.type){var t=e.property,o=e.value;A?n(t,o,e):o&&((r=r||{})[t]=o)}}),r};var t=e(function(){if(xr)return yr;xr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,A=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,a=/^\s+|\s+$/g,l="";function s(e){return e?e.replace(a,l):l}return yr=function(a,c){if("string"!=typeof a)throw new TypeError("First argument must be a string");if(!a)return[];c=c||{};var u=1,d=1;function p(e){var n=e.match(t);n&&(u+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function f(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=c.source}function g(e){var t=new Error(c.source+":"+u+":"+d+": "+e);if(t.reason=e,t.filename=c.source,t.line=u,t.column=d,t.source=a,!c.silent)throw t}function m(e){var t=e.exec(a);if(t){var n=t[0];return p(n),a=a.slice(n.length),t}}function v(){m(n)}function b(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=f();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var t=2;l!=a.charAt(t)&&("*"!=a.charAt(t)||"/"!=a.charAt(t+1));)++t;if(t+=2,l===a.charAt(t-1))return g("End of comment missing");var n=a.slice(2,t-2);return d+=2,p(n),a=a.slice(t),d+=2,e({type:"comment",comment:n})}}function y(){var t=f(),n=m(r);if(n){if(w(),!m(o))return g("property missing ':'");var a=m(A),c=t({type:"declaration",property:s(n[0].replace(e,l)),value:a?s(a[0].replace(e,l)):l});return m(i),c}}return h.prototype.content=a,v(),function(){var e,t=[];for(b(t);e=y();)!1!==e&&(t.push(e),b(t));return t}()},yr}());return Br}();const Dr=wr(Pr),kr=Dr.default||Dr,Cr=Tr("end"),Sr=Tr("start");function Tr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Ir(e){return e&&"object"==typeof e?"position"in e||"type"in e?Mr(e.position):"start"in e||"end"in e?Mr(e):"line"in e||"column"in e?Qr(e):"":""}function Qr(e){return Or(e&&e.line)+":"+Or(e&&e.column)}function Mr(e){return Qr(e&&e.start)+"-"+Qr(e&&e.end)}function Or(e){return e&&"number"==typeof e?e:1}class Lr extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},A=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(A=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const i=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=i?i.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=i?i.line:void 0,this.name=Ir(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=A&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Lr.prototype.file="",Lr.prototype.name="",Lr.prototype.reason="",Lr.prototype.message="",Lr.prototype.stack="",Lr.prototype.column=void 0,Lr.prototype.line=void 0,Lr.prototype.ancestors=void 0,Lr.prototype.cause=void 0,Lr.prototype.fatal=void 0,Lr.prototype.place=void 0,Lr.prototype.ruleId=void 0,Lr.prototype.source=void 0;const Nr={}.hasOwnProperty,Hr=new Map,Rr=/[A-Z]/g,zr=/-([a-z])/g,Fr=new Set(["table","tbody","thead","tfoot","tr"]),jr=new Set(["td","th"]),Ur="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qr(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,A){const i=Array.isArray(o.children),a=Sr(n);return t(r,o,A,i,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,A){const i=Array.isArray(o.children)?n:t;return A?i(r,o,A):i(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?br:vr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},A=Yr(o,e,void 0);return A&&"string"!=typeof A?A:o.create(e,o.Fragment,{children:A||void 0},void 0)}function Yr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=br,e.schema=o),e.ancestors.push(t);const A=Xr(e,t.tagName,!1),i=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Nr.call(t.properties,o)){const A=Vr(e,o,t.properties[o]);if(A){const[o,i]=A;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof i&&jr.has(t.tagName)?r=i:n[o]=i}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let a=Wr(e,t);return Fr.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&Rn(e.value):Rn(e)}(e)})),Gr(e,i,A,t),_r(i,a),e.ancestors.pop(),e.schema=r,e.create(t,A,i,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Kr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=br,e.schema=o),e.ancestors.push(t);const A=null===t.name?e.Fragment:Xr(e,t.name,!0),i=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const o=t.expression;o.type;const A=o.properties[0];A.type,Object.assign(n,e.evaluater.evaluateExpression(A.argument))}else Kr(e,t.position);else{const o=r.name;let A;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,A=e.evaluater.evaluateExpression(t.expression)}else Kr(e,t.position);else A=null===r.value||r.value;n[o]=A}return n}(e,t),a=Wr(e,t);return Gr(e,i,A,t),_r(i,a),e.ancestors.pop(),e.schema=r,e.create(t,A,i,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Kr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return _r(r,Wr(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Gr(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _r(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Wr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Hr;for(;++r<t.children.length;){const A=t.children[r];let i;if(e.passKeys){const e="element"===A.type?A.tagName:"mdxJsxFlowElement"===A.type||"mdxJsxTextElement"===A.type?A.name:void 0;if(e){const t=o.get(e)||0;i=e+"-"+t,o.set(e,t+1)}}const a=Yr(e,A,i);void 0!==a&&n.push(a)}return n}function Vr(e,t,n){const r=function(e,t){const n=jn(t);let r=t,o=Un;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&dr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(pr,gr);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!pr.test(e)){let n=e.replace(fr,hr);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=er}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):function(e){return e.join(" ").trim()}(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{kr(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new Lr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Ur+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(zr,Zr)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Nr.call(e,n)&&(t[Jr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?mr[r.property]||r.property:r.attribute,n]}}function Xr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=Nn(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:!(!o||"Literal"!==t.type),optional:!1}:t}r=n}else r=Nn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Nr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Kr(e)}function Kr(e,t){const n=new Lr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ur+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Jr(e){let t=e.replace(Rr,$r);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Zr(e,t){return t.toUpperCase()}function $r(e){return"-"+e.toLowerCase()}const eo={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"]},to={};function no(e,t,n){if(function(e){return!(!e||"object"!=typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ro(e.children,t,n)}return Array.isArray(e)?ro(e,t,n):""}function ro(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=no(e[o],t,n);return r.join("")}const oo=document.createElement("i");function Ao(e){const t="&"+e+";";oo.innerHTML=t;const n=oo.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function io(e,t,n,r){const o=e.length;let A,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)A=Array.from(r),A.unshift(t,n),e.splice(...A);else for(n&&e.splice(t,n);i<r.length;)A=r.slice(i,i+1e4),A.unshift(t,0),e.splice(...A),i+=1e4,t+=1e4}function ao(e,t){return e.length>0?(io(e,e.length,0,t),e):t}const lo={}.hasOwnProperty;function so(e){const t={};let n=-1;for(;++n<e.length;)co(t,e[n]);return t}function co(e,t){let n;for(n in t){const r=(lo.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let A;if(o)for(A in o){lo.call(r,A)||(r[A]=[]);const e=o[A];uo(r[A],Array.isArray(e)?e:e?[e]:[])}}}function uo(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);io(e,0,0,r)}function po(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function fo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ho=ko(/[A-Za-z]/),go=ko(/[\dA-Za-z]/),mo=ko(/[#-'*+\--9=?A-Z^-~]/);function vo(e){return null!==e&&(e<32||127===e)}const bo=ko(/\d/),wo=ko(/[\dA-Fa-f]/),yo=ko(/[!-/:-@[-`{-~]/);function xo(e){return null!==e&&e<-2}function Eo(e){return null!==e&&(e<0||32===e)}function Bo(e){return-2===e||-1===e||32===e}const Po=ko(new RegExp("\\p{P}|\\p{S}","u")),Do=ko(/\s/);function ko(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function Co(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const A=e.charCodeAt(n);let i="";if(37===A&&go(e.charCodeAt(n+1))&&go(e.charCodeAt(n+2)))o=2;else if(A<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(A))||(i=String.fromCharCode(A));else if(A>55295&&A<57344){const t=e.charCodeAt(n+1);A<56320&&t>56319&&t<57344?(i=String.fromCharCode(A,t),o=1):i="�"}else i=String.fromCharCode(A);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function So(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let A=0;return function(r){return Bo(r)?(e.enter(n),i(r)):t(r)};function i(r){return Bo(r)&&A++<o?(e.consume(r),i):(e.exit(n),t(r))}}const To={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),So(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):xo(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const Io={tokenize:function(e){const t=this,n=[];let r,o,A,i=0;return a;function a(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,l,s)(r)}return s(r)}function l(e){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,A=n;for(;A--;)if("exit"===t.events[A][0]&&"chunkFlow"===t.events[A][1].type){o=t.events[A][1].end;break}m(i);let a=n;for(;a<t.events.length;)t.events[a][1].end={...o},a++;return io(t.events,A+1,0,t.events.slice(n)),t.events.length=a,s(e)}return a(e)}function s(o){if(i===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return f(o);t.interrupt=!(!r.currentConstruct||r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Qo,c,u)(o)}function c(e){return r&&v(),m(i),d(e)}function u(e){return t.parser.lazy[t.now().line]=i!==n.length,A=t.now().offset,f(e)}function d(n){return t.containerState={},e.attempt(Qo,p,f)(n)}function p(e){return i++,n.push([t.currentConstruct,t.containerState]),d(e)}function f(n){return null===n?(r&&v(),m(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),m(0),void e.consume(n)):xo(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(n),h)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<A&&(!r.events[e][1].end||r.events[e][1].end.offset>A))return;const n=t.events.length;let o,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){a=t.events[l][1].end;break}o=!0}for(m(i),e=n;e<t.events.length;)t.events[e][1].end={...a},e++;io(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function m(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Qo={tokenize:function(e,t,n){return So(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Mo(e){return null===e||Eo(e)||Do(e)?1:Po(e)?2:void 0}function Oo(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const A=e[o].resolveAll;A&&!r.includes(A)&&(t=A(t,n),r.push(A))}return t}const Lo={name:"attention",resolveAll:function(e,t){let n,r,o,A,i,a,l,s,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};No(u,-a),No(d,a),A={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...A.start},end:{...i.end}},e[n][1].end={...A.start},e[c][1].start={...i.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=ao(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=ao(l,[["enter",r,t],["enter",A,t],["exit",A,t],["enter",o,t]]),l=ao(l,Oo(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=ao(l,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(s=2,l=ao(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):s=0,io(e,n-1,c-n+3,l),c=n+l.length-s-2;break}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Mo(r);let A;return function(t){return A=t,e.enter("attentionSequence"),i(t)};function i(a){if(a===A)return e.consume(a),i;const l=e.exit("attentionSequence"),s=Mo(a),c=!s||2===s&&o||n.includes(a),u=!o||2===o&&s||n.includes(r);return l._open=!!(42===A?c:c&&(o||!u)),l._close=!!(42===A?u:u&&(s||!c)),t(a)}}};function No(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ho={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return ho(t)?(e.consume(t),A):64===t?n(t):l(t)}function A(e){return 43===e||45===e||46===e||go(e)?(r=1,i(e)):l(e)}function i(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||go(t))&&r++<32?(e.consume(t),i):(r=0,l(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||vo(r)?n(r):(e.consume(r),a)}function l(t){return 64===t?(e.consume(t),s):mo(t)?(e.consume(t),l):n(t)}function s(e){return go(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,s):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||go(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const Ro={partial:!0,tokenize:function(e,t,n){return function(t){return Bo(t)?So(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||xo(e)?t(e):n(e)}}};const zo={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return Bo(t)?So(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(zo,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return Bo(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Fo={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return yo(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const jo={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,A,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,A=go,s(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,A=wo,s):(e.enter("characterReferenceValue"),o=7,A=bo,s(t))}function s(a){if(59===a&&i){const o=e.exit("characterReferenceValue");return A!==go||Ao(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return A(a)&&i++<o?(e.consume(a),s):n(a)}}};const Uo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},qo={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return i;function i(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),Bo(t)?So(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===A?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===A?(o++,e.consume(t),c):o>=a?(e.exit("codeFencedFenceSequence"),Bo(t)?So(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||xo(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let A,i=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,A=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===A?(a++,e.consume(t),l):a<3?n(t):(e.exit("codeFencedFenceSequence"),Bo(t)?So(e,s,"whitespace")(t):s(t))}function s(n){return null===n||xo(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(Uo,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||xo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(t)):Bo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),So(e,u,"whitespace")(t)):96===t&&t===A?n(t):(e.consume(t),c)}function u(t){return null===t||xo(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||xo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(t)):96===t&&t===A?n(t):(e.consume(t),d)}function p(t){return e.attempt(o,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&Bo(t)?So(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||xo(t)?e.check(Uo,p,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||xo(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const Yo={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),So(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?A(e):n(e)}function A(t){return null===t?a(t):xo(t)?e.attempt(Go,A,a)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||xo(t)?(e.exit("codeFlowValue"),A(t)):(e.consume(t),i)}function a(n){return e.exit("codeIndented"),t(n)}}},Go={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):xo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):So(e,A,"linePrefix",5)(t)}function A(e){const A=r.events[r.events.length-1];return A&&"linePrefix"===A[1].type&&A[2].sliceSerialize(A[1],!0).length>=4?t(e):xo(e)?o(e):n(e)}}};const _o={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,A=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),i(t)};function i(t){return 96===t?(e.consume(t),A++,i):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,s(t)):xo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||xo(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function s(n){return 96===n?(e.consume(n),r++,s):r===A?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class Wo{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Vo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Vo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Vo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Vo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Vo(this.left,t.reverse())}}}function Vo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xo(e){const t={};let n,r,o,A,i,a,l,s=-1;const c=new Wo(e);for(;++s<c.length;){for(;s in t;)s=t[s];if(n=c.get(s),s&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(s-1)[1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Ko(c,s)),s=t[s],l=!0);else if(n[1]._container){for(o=s,r=void 0;o--;)if(A=c.get(o),"lineEnding"===A[1].type||"lineEndingBlank"===A[1].type)"enter"===A[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),A[1].type="lineEnding",r=o);else if("linePrefix"!==A[1].type)break;r&&(n[1].end={...c.get(r)[1].start},i=c.slice(r,s),i.unshift(n),c.splice(r,s-r+1,i))}}return io(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Ko(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const A=[],i=n._tokenizer||r.parser[n.contentType](n.start),a=i.events,l=[],s={};let c,u,d=-1,p=n,f=0,h=0;const g=[h];for(;p;){for(;e.get(++o)[1]!==p;);A.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),u&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=n;++d<a.length;)"exit"===a[d][0]&&"enter"===a[d-1][0]&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(h=d+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),d=g.length;d--;){const t=a.slice(g[d],g[d+1]),n=A.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),d=-1;++d<l.length;)s[f+l[d][0]]=f+l[d][1],f+=l[d][1]-l[d][0]-1;return s}const Jo={resolve:function(e){return Xo(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):xo(t)?e.check(Zo,A,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function A(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},Zo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),So(e,o,"linePrefix")};function o(o){if(null===o||xo(o))return n(o);const A=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&A&&"linePrefix"===A[1].type&&A[2].sliceSerialize(A[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function $o(e,t,n,r,o,A,i,a,l){const s=l||Number.POSITIVE_INFINITY;let c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(A),e.consume(t),e.exit(A),u):null===t||32===t||41===t||vo(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(A),e.consume(n),e.exit(A),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(a),u(t)):null===t||60===t||xo(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(o){return c||null!==o&&41!==o&&!Eo(o)?c<s&&40===o?(e.consume(o),c++,f):41===o?(e.consume(o),c--,f):null===o||32===o||40===o||vo(o)?n(o):(e.consume(o),92===o?h:f):(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function eA(e,t,n,r,o,A){const i=this;let a,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(A),s};function s(u){return l>999||null===u||91===u||93===u&&!a||94===u&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):93===u?(e.exit(A),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):xo(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||xo(t)||l++>999?(e.exit("chunkString"),s(t)):(e.consume(t),a||(a=!Bo(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function tA(e,t,n,r,o,A){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,a):n(t)};function a(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(A),l(n))}function l(t){return t===i?(e.exit(A),a(i)):null===t?n(t):xo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),So(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(t))}function s(t){return t===i||null===t||xo(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:s)}function c(t){return t===i||92===t?(e.consume(t),s):s(t)}}function nA(e,t){let n;return function r(o){return xo(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Bo(o)?So(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const rA={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return eA.call(r,e,A,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function A(t){return o=fo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return Eo(t)?nA(e,a)(t):a(t)}function a(t){return $o(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(oA,s,s)(t)}function s(t){return Bo(t)?So(e,c,"whitespace")(t):c(t)}function c(A){return null===A||xo(A)?(e.exit("definition"),r.parser.defined.push(o),t(A)):n(A)}}},oA={partial:!0,tokenize:function(e,t,n){return function(t){return Eo(t)?nA(e,r)(t):n(t)};function r(t){return tA(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return Bo(t)?So(e,A,"whitespace")(t):A(t)}function A(e){return null===e||xo(e)?t(e):n(e)}}};const AA={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return xo(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const iA={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,A=3;return"whitespace"===e[A][1].type&&(A+=2),o-2>A&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(A===o-1||o-4>A&&"whitespace"===e[o-2][1].type)&&(o-=A+1===o?2:4),o>A&&(n={type:"atxHeadingText",start:e[A][1].start,end:e[o][1].end},r={type:"chunkText",start:e[A][1].start,end:e[o][1].end,contentType:"text"},io(e,A,o-A+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||Eo(t)?(e.exit("atxHeadingSequence"),A(t)):n(t)}function A(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||xo(n)?(e.exit("atxHeading"),t(n)):Bo(n)?So(e,A,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),A(t))}function a(t){return null===t||35===t||Eo(t)?(e.exit("atxHeadingText"),A(t)):(e.consume(t),a)}}};const aA=["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"],lA=["pre","script","style","textarea"],sA={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){const r=this;let o,A,i,a,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),s}(t)};function s(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),A=!0,p):63===a?(e.consume(a),o=3,r.interrupt?t:O):ho(a)?(e.consume(a),i=String.fromCharCode(a),f):n(a)}function c(A){return 45===A?(e.consume(A),o=2,u):91===A?(e.consume(A),o=5,a=0,d):ho(A)?(e.consume(A),o=4,r.interrupt?t:O):n(A)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const A="CDATA[";return o===A.charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:D:d):n(o)}function p(t){return ho(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||Eo(a)){const l=47===a,s=i.toLowerCase();return l||A||!lA.includes(s)?aA.includes(i.toLowerCase())?(o=6,l?(e.consume(a),h):r.interrupt?t(a):D(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):A?g(a):m(a)):(o=1,r.interrupt?t(a):D(a))}return 45===a||go(a)?(e.consume(a),i+=String.fromCharCode(a),f):n(a)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:D):n(o)}function g(t){return Bo(t)?(e.consume(t),g):B(t)}function m(t){return 47===t?(e.consume(t),B):58===t||95===t||ho(t)?(e.consume(t),v):Bo(t)?(e.consume(t),m):B(t)}function v(t){return 45===t||46===t||58===t||95===t||go(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),w):Bo(t)?(e.consume(t),b):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,y):Bo(t)?(e.consume(t),w):x(t)}function y(t){return t===l?(e.consume(t),l=null,E):null===t||xo(t)?n(t):(e.consume(t),y)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Eo(t)?b(t):(e.consume(t),x)}function E(e){return 47===e||62===e||Bo(e)?m(e):n(e)}function B(t){return 62===t?(e.consume(t),P):n(t)}function P(t){return null===t||xo(t)?D(t):Bo(t)?(e.consume(t),P):n(t)}function D(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),I):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!xo(t)||6!==o&&7!==o?null===t||xo(t)?(e.exit("htmlFlowData"),k(t)):(e.consume(t),D):(e.exit("htmlFlowData"),e.check(cA,N,k)(t))}function k(t){return e.check(uA,C,N)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||xo(t)?k(t):(e.enter("htmlFlowData"),D(t))}function T(t){return 45===t?(e.consume(t),O):D(t)}function I(t){return 47===t?(e.consume(t),i="",Q):D(t)}function Q(t){if(62===t){const n=i.toLowerCase();return lA.includes(n)?(e.consume(t),L):D(t)}return ho(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),Q):D(t)}function M(t){return 93===t?(e.consume(t),O):D(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):D(t)}function L(t){return null===t||xo(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),L)}function N(n){return e.exit("htmlFlow"),t(n)}}},cA={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Ro,t,n)}}},uA={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return xo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const dA={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,A,i;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),v):ho(t)?(e.consume(t),E):n(t)}function l(t){return 45===t?(e.consume(t),s):91===t?(e.consume(t),A=0,p):ho(t)?(e.consume(t),m):n(t)}function s(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):xo(t)?(i=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?I(e):45===e?u(e):c(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(A++)?(e.consume(t),6===A?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):xo(t)?(i=f,Q(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?I(t):93===t?(e.consume(t),g):f(t)}function m(t){return null===t||62===t?I(t):xo(t)?(i=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):xo(t)?(i=v,Q(t)):(e.consume(t),v)}function b(e){return 62===e?I(e):v(e)}function w(t){return ho(t)?(e.consume(t),y):n(t)}function y(t){return 45===t||go(t)?(e.consume(t),y):x(t)}function x(t){return xo(t)?(i=x,Q(t)):Bo(t)?(e.consume(t),x):I(t)}function E(t){return 45===t||go(t)?(e.consume(t),E):47===t||62===t||Eo(t)?B(t):n(t)}function B(t){return 47===t?(e.consume(t),I):58===t||95===t||ho(t)?(e.consume(t),P):xo(t)?(i=B,Q(t)):Bo(t)?(e.consume(t),B):I(t)}function P(t){return 45===t||46===t||58===t||95===t||go(t)?(e.consume(t),P):D(t)}function D(t){return 61===t?(e.consume(t),k):xo(t)?(i=D,Q(t)):Bo(t)?(e.consume(t),D):B(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,C):xo(t)?(i=k,Q(t)):Bo(t)?(e.consume(t),k):(e.consume(t),S)}function C(t){return t===o?(e.consume(t),o=void 0,T):null===t?n(t):xo(t)?(i=C,Q(t)):(e.consume(t),C)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Eo(t)?B(t):(e.consume(t),S)}function T(e){return 47===e||62===e||Eo(e)?B(e):n(e)}function I(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return Bo(t)?So(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}};const pA={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&io(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,A,i=e.length,a=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(o=i);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[o-2][1].start}};return A=[["enter",l,t],["enter",s,t]],A=ao(A,e.slice(r+1,r+a+3)),A=ao(A,[["enter",c,t]]),A=ao(A,Oo(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),A=ao(A,[["exit",c,t],e[o-2],e[o-1],["exit",s,t]]),A=ao(A,e.slice(o+1)),A=ao(A,[["exit",l,t]]),io(e,r,e.length,A),e},tokenize:function(e,t,n){const r=this;let o,A,i=r.events.length;for(;i--;)if(("labelImage"===r.events[i][1].type||"labelLink"===r.events[i][1].type)&&!r.events[i][1]._balanced){o=r.events[i][1];break}return function(t){return o?o._inactive?c(t):(A=r.parser.defined.includes(fo(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(fA,s,A?s:c)(t):91===t?e.attempt(hA,s,A?l:c)(t):A?s(t):c(t)}function l(t){return e.attempt(gA,s,c)(t)}function s(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},fA={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return Eo(t)?nA(e,o)(t):o(t)}function o(t){return 41===t?s(t):$o(e,A,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function A(t){return Eo(t)?nA(e,a)(t):s(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?tA(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):s(t)}function l(t){return Eo(t)?nA(e,s)(t):s(t)}function s(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},hA={tokenize:function(e,t,n){const r=this;return function(t){return eA.call(r,e,o,A,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(fo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function A(e){return n(e)}}},gA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const mA={name:"labelStartImage",resolveAll:pA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),A):n(t)}function A(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const vA={name:"labelStartLink",resolveAll:pA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const bA={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),So(e,t,"linePrefix")}}};const wA={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,A(e)}(t)};function A(A){return A===r?(e.enter("thematicBreakSequence"),i(A)):o>=3&&(null===A||xo(A))?(e.exit("thematicBreak"),t(A)):n(A)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),Bo(t)?So(e,A,"whitespace")(t):A(t))}}};const yA={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ro,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,So(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!Bo(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(EA,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,So(e,e.attempt(yA,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let A=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:bo(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(wA,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return bo(t)&&++i<10?(e.consume(t),a):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Ro,r.interrupt?n:s,e.attempt(xA,u,c))}function s(e){return r.containerState.initialBlankLine=!0,A++,u(e)}function c(t){return Bo(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=A+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},xA={partial:!0,tokenize:function(e,t,n){const r=this;return So(e,function(e){const o=r.events[r.events.length-1];return!Bo(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},EA={partial:!0,tokenize:function(e,t,n){const r=this;return So(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const BA={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,A=e.length;for(;A--;)if("enter"===e[A][0]){if("content"===e[A][1].type){n=A;break}"paragraph"===e[A][1].type&&(r=A)}else"content"===e[A][1].type&&e.splice(A,1),!o&&"definition"===e[A][1].type&&(o=A);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let i,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){i="paragraph"===r.events[a][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!i?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),A(t)}(t))};function A(t){return t===o?(e.consume(t),A):(e.exit("setextHeadingLineSequence"),Bo(t)?So(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||xo(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const PA={tokenize:function(e){const t=this,n=e.attempt(Ro,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,So(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Jo,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const DA={resolveAll:TA()},kA=SA("string"),CA=SA("text");function SA(e){return{resolveAll:TA("text"===e?IA:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,A,i);return A;function A(e){return l(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function TA(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):(!t[o]||"data"!==t[o][1].type)&&(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function IA(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let A,i=o.length,a=-1,l=0;for(;i--;){const e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)l++,a--;if(a)break;a=-1}else if(-2===e)A=!0,l++;else if(-1!==e){i++;break}}if(l){const o={type:n===e.length||A||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const QA={42:yA,43:yA,45:yA,48:yA,49:yA,50:yA,51:yA,52:yA,53:yA,54:yA,55:yA,56:yA,57:yA,62:zo},MA={91:rA},OA={[-2]:Yo,[-1]:Yo,32:Yo},LA={35:iA,42:wA,45:[BA,wA],60:sA,61:BA,95:wA,96:qo,126:qo},NA={38:jo,92:Fo},HA={[-5]:bA,[-4]:bA,[-3]:bA,33:mA,38:jo,42:Lo,60:[Ho,dA],91:vA,92:[AA,Fo],93:pA,95:Lo,96:_o},RA={null:[Lo,DA]},zA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:MA,disable:{null:[]},document:QA,flow:LA,flowInitial:OA,insideSpan:RA,string:NA,text:HA},Symbol.toStringTag,{value:"Module"}));function FA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},A=[];let i=[],a=[];const l={attempt:h(function(e,t){g(e,t.from)}),check:h(f),consume:function(e){xo(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),s.events.push(["enter",n,s]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=d(),s.events.push(["exit",t,s]),t},interrupt:h(f,{interrupt:!0})},s={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,m()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const A=e[n];let i;if("string"==typeof A)i=A;else switch(A){case-5:i="\r";break;case-4:i="\n";break;case-3:i="\r\n";break;case-2:i=t?" ":"\t";break;case-1:if(!t&&o)continue;i=" ";break;default:i=String.fromCharCode(A)}o=-2===A,r.push(i)}return r.join("")}(u(e),t)},sliceStream:u,write:function(e){return i=ao(i,e),function(){let e;for(;r._index<i.length;){const t=i[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}(),null!==i[i.length-1]?[]:(g(t,0),s.events=Oo(A,s.events,s),s.events)}};let c=t.tokenize.call(s,l);return t.resolveAll&&A.push(t),s;function u(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,A=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,A)];else{if(i=e.slice(n,o),r>-1){const e=i[0];"string"==typeof e?i[0]=e.slice(r):i.shift()}A>0&&i.push(e[o].slice(0,A))}return i}(i,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:A}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:A}}function p(e){c=c(e)}function f(e,t){t.restore()}function h(e,t){return function(n,o,A){let i,c,u,p;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return i=e,c=0,0===e.length?A:h(e[c])}function h(e){return function(n){return p=function(){const e=d(),t=s.previous,n=s.currentConstruct,o=s.events.length,A=Array.from(a);return{from:o,restore:i};function i(){r=e,s.previous=t,s.currentConstruct=n,s.events.length=o,a=A,m()}}(),u=e,e.partial||(s.currentConstruct=e),e.name&&s.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(s),t):s,l,g,v)(n)}}function g(t){return e(u,p),o}function v(e){return p.restore(),++c<i.length?h(i[c]):A}}}function g(e,t){e.resolveAll&&!A.includes(e)&&A.push(e),e.resolve&&io(s.events,t,s.events.length-t,e.resolve(s.events.slice(t),s)),e.resolveTo&&(s.events=e.resolveTo(s.events,s))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const jA=/[\0\t\n\r]/g;const UA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function qA(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return po(n.slice(t?2:1),t?16:10)}return Ao(n)||e}const YA={}.hasOwnProperty;function GA(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:A(te),autolinkProtocol:P,autolinkEmail:P,atxHeading:A(J),blockQuote:A(_),characterEscape:P,characterReference:P,codeFenced:A(W),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:A(W,i),codeText:A(V,i),codeTextData:P,data:P,codeFlowValue:P,definition:A(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:A(K),hardBreakEscape:A(Z),hardBreakTrailing:A(Z),htmlFlow:A($,i),htmlFlowData:P,htmlText:A($,i),htmlTextData:P,image:A(ee),label:i,link:A(te),listItem:A(re),listItemValue:d,listOrdered:A(ne,u),listUnordered:A(ne),paragraph:A(oe),reference:z,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:A(J),strong:A(Ae),thematicBreak:A(ae)},exit:{atxHeading:l(),atxHeadingSequence:y,autolink:l(),autolinkEmail:G,autolinkProtocol:Y,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:j,characterReferenceMarkerNumeric:j,characterReferenceValue:U,characterReference:q,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:D,codeIndented:l(m),codeText:l(I),codeTextData:D,data:D,definition:l(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(C),hardBreakTrailing:l(C),htmlFlow:l(S),htmlFlowData:D,htmlText:l(T),htmlTextData:D,image:l(M),label:L,labelText:O,lineEnding:k,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:F,resourceDestinationString:N,resourceTitleString:H,resource:R,setextHeading:l(B),setextHeadingLineSequence:E,setextHeadingText:x,strong:l(),thematicBreak:l()}};WA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const A={stack:[r],tokenStack:[],config:t,enter:a,exit:s,buffer:i,resume:c,data:n},l=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])l.push(u);else{u=o(e,l.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];YA.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},A),e[u][1])}if(A.tokenStack.length>0){const e=A.tokenStack[A.tokenStack.length-1];(e[1]||XA).call(A,void 0,e[0])}for(r.position={start:_A(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:_A(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,A,i,a=t-1,l=-1,s=!1;for(;++a<=n;){const t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(r&&!i&&!l&&!A&&(A=a),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=a;for(o=void 0;i--;){const t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",s=!0),t[1].type="lineEnding",o=i}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}A&&(!o||A<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||a,0,["exit",r,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(a,0,["enter",o,t[2]]),a++,n++,A=void 0,i=!0}}}return e[t][1]._spread=s,n}function A(e,t){return n;function n(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:_A(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Ir({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||XA).call(this,e,r[0])),n.position.end=_A(e.end)}function c(){return function(e){return no(e,"boolean"!=typeof to.includeImageAlt||to.includeImageAlt,"boolean"!=typeof to.includeHtml||to.includeHtml)}(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=fo(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function y(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];(!n||"text"!==n.type)&&(n=ie(),n.position={start:_A(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=_A(e.end)}function k(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=_A(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(P.call(this,e),D.call(this,e))}function C(){this.data.atHardBreak=!0}function S(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(UA,qA)}(t),n.identifier=fo(t).toLowerCase()}function L(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function N(){const e=this.resume();this.stack[this.stack.length-1].url=e}function H(){const e=this.resume();this.stack[this.stack.length-1].title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function F(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=fo(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function j(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=po(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Ao(t);this.stack[this.stack.length-1].value+=r}function q(e){this.stack.pop().position.end=_A(e.end)}function Y(e){D.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function G(e){D.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function _(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function V(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function Ae(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Xo(e););return e}(function(e){const t={constructs:so([zA,...(e||{}).extensions||[]]),content:n(To),defined:[],document:n(Io),flow:n(PA),lazy:{},string:n(kA),text:n(CA)};return t;function n(e){return function(n){return FA(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,A,i){const a=[];let l,s,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(A||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(jA.lastIndex=c,l=jA.exec(o),u=l&&void 0!==l.index?l.index:o.length,d=o.charCodeAt(u),!l){n=o.slice(c);break}if(10===d&&c===u&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),c<u&&(a.push(o.slice(c,u)),t+=u-c),d){case 0:a.push(65533),t++;break;case 9:for(s=4*Math.ceil(t/4),a.push(-2);t++<s;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return i&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))}function _A(e){return{line:e.line,column:e.column,offset:e.offset}}function WA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?WA(e,r):VA(e,r)}}function VA(e,t){let n;for(n in t)if(YA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function XA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ir({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ir({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ir({start:t.start,end:t.end})+") is still open")}function KA(e){const t=this;t.parser=function(n){return GA(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function JA(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),A=o[0];A&&"text"===A.type?A.value="["+A.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function ZA(e){return e.spread??e.children.length>1}function $A(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const A=[];for(;r;)A.push(ei(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return A.push(ei(t.slice(o),o>0,!1)),A.join("")}function ei(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const ti={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Co(r.toLowerCase()),A=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);void 0===a?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=A+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,l);const s={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,s),e.applyData(t,s)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return JA(e,t);const o={src:Co(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const A={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,A),e.applyData(t,A)},image:function(e,t){const n={src:Co(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return JA(e,t);const o={href:Co(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const A={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,A),e.applyData(t,A)},link:function(e,t){const n={href:Co(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ZA(n[r])}return t}(n):ZA(t),A={},i=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),A.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const e=r[a];(o||0!==a||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?i.push(e):i.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&i.push({type:"text",value:"\n"});const s={type:"element",tagName:"li",properties:A,children:i};return e.patch(t,s),e.applyData(t,s)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const A={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,A),e.applyData(t,A)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},A=Sr(t.children[1]),i=Cr(t.children[t.children.length-1]);A&&i&&(r.position={start:A,end:i}),o.push(r)}const A={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,A),e.applyData(t,A)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",A=n&&"table"===n.type?n.align:void 0,i=A?A.length:t.children.length;let a=-1;const l=[];for(;++a<i;){const n=t.children[a],r={},i=A?A[a]:void 0;i&&(r.align=i);let s={type:"element",tagName:o,properties:r,children:[]};n&&(s.children=e.all(n),e.patch(n,s),s=e.applyData(n,s)),l.push(s)}const s={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,s),e.applyData(t,s)},text:function(e,t){const n={type:"text",value:$A(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:ni,yaml:ni,definition:ni,footnoteDefinition:ni};function ni(){}const ri="object"==typeof self?self:globalThis,oi=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[A,i]=t[o];switch(A){case 0:case-1:return n(i,o);case 1:{const e=n([],o);for(const t of i)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),o);case 4:{const{source:e,flags:t}=i;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of i)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of i)e.add(r(t));return e}case 7:{const{name:e,message:t}=i;return n(new ri[e](t),o)}case 8:return n(BigInt(i),o);case"BigInt":return n(Object(BigInt(i)),o);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{const{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new ri[A](i),o)};return r})(new Map,e)(0),Ai="",{toString:ii}={},{keys:ai}=Object,li=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=ii.call(e).slice(8,-1);switch(n){case"Array":return[1,Ai];case"Object":return[2,Ai];case"Date":return[3,Ai];case"RegExp":return[4,Ai];case"Map":return[5,Ai];case"Set":return[6,Ai];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},si=([e,t])=>0===e&&("function"===t||"symbol"===t),ci=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},A=r=>{if(n.has(r))return n.get(r);let[i,a]=li(r);switch(i){case 0:{let t=r;switch(a){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return o([-1],r)}return o([i,t],r)}case 1:{if(a){let e=r;return"DataView"===a?e=new Uint8Array(r.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(r)),o([a,[...e]],r)}const e=[],t=o([i,e],r);for(const t of r)e.push(A(t));return t}case 2:{if(a)switch(a){case"BigInt":return o([a,r.toString()],r);case"Boolean":case"Number":case"String":return o([a,r.valueOf()],r)}if(t&&"toJSON"in r)return A(r.toJSON());const n=[],l=o([i,n],r);for(const t of ai(r))(e||!si(li(r[t])))&&n.push([A(t),A(r[t])]);return l}case 3:return o([i,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([i,{source:e,flags:t}],r)}case 5:{const t=[],n=o([i,t],r);for(const[n,o]of r)(e||!si(li(n))&&!si(li(o)))&&t.push([A(n),A(o)]);return n}case 6:{const t=[],n=o([i,t],r);for(const n of r)(e||!si(li(n)))&&t.push(A(n));return n}}const{message:l}=r;return o([i,{name:a,message:l}],r)};return A})(!(t||n),!!t,new Map,r)(e),r},ui="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?oi(ci(e,t)):structuredClone(e):(e,t)=>oi(ci(e,t));function di(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function pi(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const fi=function(e){if(null==e)return gi;if("function"==typeof e)return hi(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fi(e[n]);return hi(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return hi(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return hi(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function hi(e){return function(t,n,r){return!(!function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)||!e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function gi(){return!0}const mi=[],vi=!0,bi=!1;function wi(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const A=fi(o),i=r?-1:1;!function e(o,a,l){const s=o&&"object"==typeof o?o:{};if("string"==typeof s.type){const e="string"==typeof s.tagName?s.tagName:"string"==typeof s.name?s.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let s,c,u,d=mi;if((!t||A(o,a,l[l.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[vi,e]:null==e?mi:[e]}(n(o,l)),d[0]===bi))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+i,u=l.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(s=e(n,c,u)(),s[0]===bi)return s;c="number"==typeof s[1]?s[1]:c+i}}return d}}(e,void 0,[])()}function yi(e,t,n,r){let o,A,i;"function"==typeof t?(A=void 0,i=t,o=n):(A=t,i=n,o=r),wi(e,A,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return i(e,r,n)},o)}const xi={}.hasOwnProperty,Ei={};function Bi(e,t){const n=t||Ei,r=new Map,o=new Map,A=new Map,i={...ti,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=a.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=Si(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=Si(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:Di,definitionById:r,footnoteById:o,footnoteCounts:A,footnoteOrder:[],handlers:i,one:function(e,t){const n=e.type,r=a.handlers[n];if(xi.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=ui(n);return r.children=a.all(e),r}return ui(e)}return(a.options.unknownHandler||ki)(a,e,t)},options:n,patch:Pi,wrap:Ci};return yi(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a}function Pi(e,t){e.position&&(t.position=function(e){const t=Sr(e),n=Cr(e);if(t&&n)return{start:t,end:n}}(e))}function Di(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,ui(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function ki(e,t){const n=t.data||{},r=!("value"in t)||xi.call(n,"hProperties")||xi.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function Ci(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function Si(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ti(e,t){const n=Bi(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||di,r=e.options.footnoteBackLabel||pi,o=e.options.footnoteLabel||"Footnotes",A=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const A=e.all(o),i=String(o.identifier).toUpperCase(),s=Co(i.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(i);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=A[A.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else A.push(...u);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+s},children:e.wrap(A,!0)};e.patch(o,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:A,properties:{...ui(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(n),A=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&A.children.push({type:"text",value:"\n"},o),A}function Ii(e,t){return e&&"run"in e?async function(n,r){const o=Ti(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ti(n,{file:r,...e||t})}}function Qi(e){if(e)throw e}var Mi,Oi;var Li=function(){if(Oi)return Mi;Oi=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},A=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),A=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!A)return!1;for(r in n);return typeof r>"u"||e.call(n,r)},i=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Mi=function e(){var t,n,r,l,s,c,u=arguments[0],d=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<p;++d)if(null!=(t=arguments[d]))for(n in t)r=a(u,n),u!==(l=a(t,n))&&(f&&l&&(A(l)||(s=o(l)))?(s?(s=!1,c=r&&o(r)?r:[]):c=r&&A(r)?r:{},i(u,{name:n,newValue:e(f,c,l)})):typeof l<"u"&&i(u,{name:n,newValue:l}));return u},Mi}();const Ni=wr(Li);function Hi(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Ri(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(A,...i){const a=e[++n];let l=-1;if(A)r(A);else{for(;++l<t.length;)(null===i[l]||void 0===i[l])&&(i[l]=t[l]);t=i,a?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let i;r&&t.push(o);try{i=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(i&&i.then&&"function"==typeof i.then?i.then(A,o):i instanceof Error?o(i):A(i))}function o(e,...r){n||(n=!0,t(e,...r))}function A(e){o(null,e)}}(a,o)(...i):r(null,...i)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const zi={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Fi(e);let n,r=0,o=-1,A=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else o<0&&(n=!0,o=A+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,a=t.length-1;for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else i<0&&(n=!0,i=A+1),a>-1&&(e.codePointAt(A)===t.codePointAt(a--)?a<0&&(o=A):(a=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(Fi(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Fi(e);let t,n=e.length,r=-1,o=0,A=-1,i=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?A<0?A=n:1!==i&&(i=1):A>-1&&(i=-1);else if(t){o=n+1;break}}return A<0||r<0||0===i||1===i&&A===r-1&&A===o+1?"":e.slice(A,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Fi(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Fi(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",A=0,i=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(i!==l-1&&1!==a)if(i!==l-1&&2===a){if(o.length<2||2!==A||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",A=0):(o=o.slice(0,r),A=o.length-1-o.lastIndexOf("/")),i=l,a=0;continue}}else if(o.length>0){o="",A=0,i=l,a=0;continue}t&&(o=o.length>0?o+"/..":"..",A=2)}else o.length>0?o+="/"+e.slice(i+1,l):o=e.slice(i+1,l),A=l-i-1;i=l,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0===n.length&&!t&&(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function Fi(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ji={cwd:function(){return"/"}};function Ui(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function qi(e){if("string"==typeof e)e=new URL(e);else if(!Ui(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Yi=["history","path","basename","stem","extname","dirname"];class Gi{constructor(e){let t;var n;t=e?Ui(e)?{path:e}:"string"==typeof e||(n=e)&&"object"==typeof n&&"byteLength"in n&&"byteOffset"in n?{value:e}:e:{},this.cwd="cwd"in t?"":ji.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<Yi.length;){const e=Yi[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)Yi.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?zi.basename(this.path):void 0}set basename(e){Wi(e,"basename"),_i(e,"basename"),this.path=zi.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?zi.dirname(this.path):void 0}set dirname(e){Vi(this.basename,"dirname"),this.path=zi.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?zi.extname(this.path):void 0}set extname(e){if(_i(e,"extname"),Vi(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zi.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ui(e)&&(e=qi(e)),Wi(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?zi.basename(this.path,this.extname):void 0}set stem(e){Wi(e,"stem"),_i(e,"stem"),this.path=zi.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Lr(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function _i(e,t){if(e&&e.includes(zi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zi.sep+"`")}function Wi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vi(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Xi=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Ki={}.hasOwnProperty;class Ji extends Xi{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=Ri()}copy(){const e=new Ji;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Ni(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(ta("data",this.frozen),this.namespace[e]=t,this):Ki.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ta("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=oa(e),n=this.parser||this.Parser;return $i("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),$i("process",this.parser||this.Parser),ea("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const A=oa(e),i=n.parse(A);function a(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(i,A,function(e,t,r){if(e||!t||!r)return a(e);const o=t,A=n.stringify(o,r);var i;"string"==typeof(i=A)||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(i)?r.value=A:r.result=A,a(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),$i("processSync",this.parser||this.Parser),ea("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,Qi(e),t=r}),ra("processSync","process",n),t}run(e,t,n){na(e),this.freeze();const r=this.transformers;return!n&&"function"==typeof t&&(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,A){const i=oa(t);r.run(e,i,function(t,r,i){const a=r||e;t?A(t):o?o(a):n(void 0,a,i)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){Qi(e),n=t,r=!0}),ra("runSync","run",r),n}stringify(e,t){this.freeze();const n=oa(t),r=this.compiler||this.Compiler;return ea("stringify",r),na(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(ta("use",this.frozen),null!=e)if("function"==typeof e)a(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?i(e):A(e)}return this;function o(e){if("function"==typeof e)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(t,n)}else A(e)}}function A(e){if(!("plugins"in e)&&!("settings"in e))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");i(e.plugins),e.settings&&(r.settings=Ni(!0,r.settings,e.settings))}function i(e){let t=-1;if(null!=e){if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function a(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...A]=t;const i=n[o][1];Hi(i)&&Hi(r)&&(r=Ni(!0,i,r)),n[o]=[e,r,...A]}}}}const Zi=(new Ji).freeze();function $i(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function ea(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function ta(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function na(e){if(!Hi(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function ra(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oa(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Gi(e)}const Aa=[],ia={allowDangerousHtml:!0},aa=/^(https?|ircs?|mailto|xmpp)$/i,la=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function sa(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,A=e.components,i=e.disallowedElements,a=e.rehypePlugins||Aa,l=e.remarkPlugins||Aa,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ia}:ia,c=e.skipHtml,u=e.unwrapDisallowed,d=e.urlTransform||ca,p=Zi().use(KA).use(l).use(Ii,s).use(a),f=new Gi;"string"==typeof r&&(f.value=r);for(const t of la)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const v=p.parse(f);let b=p.runSync(v,f);return o&&(b={type:"element",tagName:"div",properties:{className:o},children:"root"===b.type?b.children:[b]}),yi(b,function(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return c?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in eo)if(Object.hasOwn(eo,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=eo[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let A=t?!t.includes(e.tagName):!!i&&i.includes(e.tagName);if(!A&&n&&"number"==typeof r&&(A=!n(e,r,o)),A&&o&&"number"==typeof r)return u&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}}),qr(b,{Fragment:m,components:A,ignoreInvalidStyle:!0,jsx:h,jsxs:g,passKeys:!0,passNode:!0})}function ca(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||aa.test(e.slice(0,t))?e:""}const ua=({children:e})=>h("div",{style:{whiteSpace:"normal"},children:h(sa,{components:{p:({...e})=>h("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>h("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>h("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>h("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?h("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):h("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:h("code",{children:t})}),blockquote:({...e})=>h("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),da={autoConfig:!0},pa=e=>()=>(e=>{const{getFlow:t}=Zt(),{messages:n,replaceMessages:r}=$t(),{settings:o}=tn(),{hasChatHistoryLoaded:A}=nn(),i={...e,...da},a=i.markdownComponent?i.markdownComponent:ua;l(()=>{var e,t;if(A){const A=[...n];for(let n=0;n<A.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=A[n];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=a)}r(A)}},[A]);const s=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();((e,t,n)=>{var r;if("string"!=typeof e.data.message.content||!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderMarkdown)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)})(e,t(),r)&&(e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};en(X.PRE_INJECT_MESSAGE,s),en(X.CHUNK_STREAM_MESSAGE,s),en(X.START_STREAM_MESSAGE,s),en(X.START_SIMULATE_STREAM_MESSAGE,s);const c={name:"@rcb-plugins/markdown-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(e),fa={autoConfig:!0,promptBaseColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"},promptHoveredColors:{info:"#0056b3",warning:"#d39e00",error:"#c82333",success:"#218838"},textAreaHighlightColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"}},ha=(e,t,n="validateTextInput")=>{var r;if(null==(r=e.detail)||!r.currPath)return;const o=t[e.detail.currPath];if(!o)return;const A=o[n];return"function"==typeof A?A:void 0},ga=e=>{const{showToast:t}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=st();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:n}=Zt(),{styles:r,updateStyles:o,replaceStyles:A}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=Ut();return{styles:e,replaceStyles:t,updateStyles:n}})(),s=(e=>({...fa,...e,promptBaseColors:{...fa.promptBaseColors},promptHoveredColors:{...fa.promptHoveredColors},textAreaHighlightColors:{...fa.textAreaHighlightColors}}))(e),[c,u]=a(0),d=i({});en(X.USER_SUBMIT_TEXT,e=>{const A=e,i=ha(A,n(),"validateTextInput");if(!i)return;const a=i(A.data.inputText);if(null!=a&&a.success||e.preventDefault(),!a.promptContent)return;0===c&&(d.current=structuredClone(r));const l=((e,t)=>{const n=e.promptType??"info";let r={};return t.advancedStyles&&(r=t.advancedStyles[n]),t.promptBaseColors&&(r.toastPromptStyle={color:t.promptBaseColors[n],borderColor:t.promptBaseColors[n]}),t.promptHoveredColors&&(r.toastPromptHoveredStyle={color:t.promptHoveredColors[n],borderColor:t.promptHoveredColors[n]}),t.textAreaHighlightColors&&(e.highlightTextArea??!0)&&(r.chatInputAreaStyle={boxShadow:`${t.textAreaHighlightColors[n]} 0px 0px 5px`}),r})(a,s);o(l),t(a.promptContent,a.promptDuration??3e3),u(e=>e+1)}),en(X.USER_UPLOAD_FILE,e=>{var r,o;const A=e,i=null==(o=null==(r=A.data)?void 0:r.files)?void 0:o[0];if(!i)return console.error("No file uploaded."),void e.preventDefault();const a=ha(A,n(),"validateFileInput");if(!a)return void console.error("Validator not found for file input.");const l=a(i);if(!l.success)return console.error("Validation failed:",l),l.promptContent&&t(l.promptContent,l.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",l)}),en(X.DISMISS_TOAST,()=>{u(e=>e-1)}),l(()=>{0===c&&setTimeout(()=>{A(d.current)})},[c,A]);const p={name:"@rcb-plugins/input-validator"};return s.autoConfig&&(p.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),p},ma=n((e,t)=>{let{embedded:n,currentOpen:r,enabled:o,onSetEnabled:A}=e;const a=$t(),s=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=ne();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),c=i(null),u=i(!1);return l(()=>{!n&&s&&s.toggleChatWindow&&(c.current===r||u.current||(setTimeout(()=>{s&&s.toggleChatWindow&&s.toggleChatWindow(r)},0),c.current=r),u.current=!1)},[r,n,s]),l(()=>{const e=()=>{u.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),p(t,()=>({addMessage:e=>{a&&a.injectMessage&&a.injectMessage(e)},openChat:()=>{!n&&s&&s.toggleChatWindow&&s.toggleChatWindow(!0)},closeChat:()=>{!n&&s&&s.toggleChatWindow&&s.toggleChatWindow(!1)},toggleChat:()=>{!n&&s&&s.toggleChatWindow&&s.toggleChatWindow()},setBotEnabled:e=>{A&&A(e)}}),[a,s,n,A]),null});ma.displayName="BotController";const va=e=>{let{loginUrl:n,className:r="",style:o,isHeaderButton:A=!1}=e;const i=A?{display:"inline-block",padding:"6px 12px",backgroundColor:"transparent",border:"1px solid #ccc",color:"white",textDecoration:"none",borderRadius:"4px",fontWeight:"normal",textAlign:"center",margin:"8px",fontSize:"12px",opacity:.8,transition:"all 0.2s ease"}:{display:"inline-block",padding:"10px 20px",backgroundColor:"white",border:"1px solid var(--primaryColor, #107180)",color:"var(--primaryColor, #107180)",textDecoration:"none",borderRadius:"4px",fontWeight:"bold",textAlign:"center",margin:"18px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)"};return t.createElement(t.Fragment,null,A&&t.createElement("style",null,"\n .rcb-chat-header-container .qa-bot-header-login-button:hover {\n background-color: #0000001a !important;\n opacity: 1 !important;\n }\n "),t.createElement("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"qa-bot-login-button ".concat(A?"qa-bot-header-login-button":""," ").concat(r),style:Object.assign(Object.assign({},i),o)},"Log In"))},ba=()=>t.createElement("div",{className:"user-login-icon",style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"5px",display:"flex"},role:"img","aria-label":"User logged in",title:"User logged in"},t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},t.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.createElement("circle",{cx:"12",cy:"7",r:"4"})));function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wa.apply(null,arguments)}const ya=({width:e=24,height:n=24,color:r="currentColor",children:o,...A})=>t.createElement("svg",wa({xmlns:"http://www.w3.org/2000/svg",width:e,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},A),o),xa=e=>t.createElement(ya,e,t.createElement("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})),Ea=r(void 0),Ba=e=>{let{children:n,resetSession:r,clearResettingFlag:o}=e;return t.createElement(Ea.Provider,{value:{resetSession:r,clearResettingFlag:o}},n)},Pa=()=>{const{restartFlow:e}=Zt(),{setTextAreaValue:n}=(()=>{const{textAreaDisabled:e,toggleTextAreaDisabled:t,textAreaSensitiveMode:n,toggleTextAreaSensitiveMode:r,getTextAreaValue:o,setTextAreaValue:A,focusTextArea:i,blurTextArea:a}=At();return{textAreaDisabled:e,toggleTextAreaDisabled:t,textAreaSensitiveMode:n,toggleTextAreaSensitiveMode:r,getTextAreaValue:o,setTextAreaValue:A,focusTextArea:i,blurTextArea:a}})(),{resetSession:r,clearResettingFlag:A}=(()=>{const e=o(Ea);if(!e)throw new Error("useSession must be used within a SessionProvider");return e})();return t.createElement("button",{onClick:async()=>{r(),await n(""),await e(),setTimeout(()=>{A()},100)},tabIndex:0,"aria-label":"New chat conversation",style:{backgroundColor:"var(--primaryColor, #107180)",border:"none",color:"#ffffff",fontSize:"14px",cursor:"pointer",padding:"8px 12px",borderRadius:"4px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",fontWeight:"500"},onMouseEnter:e=>{e.target.style.backgroundColor="var(--secondaryColor, #0d5f6b)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--primaryColor, #107180)"}},t.createElement(xa,{width:16,height:16}),"New Chat")},Da=()=>(l(()=>{const e=e=>{if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(e.key))return;const n=document.activeElement;if(n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"true"===n.contentEditable||n.classList.contains("rcb-chat-input-textarea")))return;const r=document.querySelector(".rcb-chat-window");if(!r)return;const o=Array.from(r.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(o.length>0){const t=o[o.length-1].querySelector(".rcb-checkbox-container");if(t&&null!==t.offsetParent){const n=Array.from(t.querySelectorAll(".rcb-checkbox-row-container")),r=t.querySelector(".rcb-checkbox-next-button");if(n.length>0){const t=[...n];return r&&t.push(r),void((e,t)=>{e.preventDefault();let n=-1;for(let e=0;e<t.length;e++)if(t[e]===document.activeElement||t[e].contains(document.activeElement)){n=e;break}-1===n&&(n=0);let r=n;switch(e.key){case"ArrowDown":case"ArrowRight":r=n<t.length-1?n+1:0;break;case"ArrowUp":case"ArrowLeft":r=n>0?n-1:t.length-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;case"Enter":case" ":{const e=t[n],r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});return void e.dispatchEvent(r)}default:return}t[r].focus(),t[r].setAttribute("tabindex","0"),t[r].classList.add("keyboard-focused"),t.forEach((e,t)=>{t!==r&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))})})(e,t)}}}let A=[];if(o.length>0){const e=o[o.length-1],t=Array.from(e.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);if(t.length>0){const e=t[t.length-1];A=Array.from(e.querySelectorAll(".rcb-options"))}}if(0===A.length)return;const i=A.findIndex(e=>e===document.activeElement);switch(e.key){case"ArrowDown":case"ArrowRight":{let t;e.preventDefault(),t=i<A.length-1?i+1:0,A[t].setAttribute("tabindex","0"),A.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[t].classList.add("keyboard-focused"),A[t].focus();break}case"ArrowUp":case"ArrowLeft":{let t;e.preventDefault(),t=i>0?i-1:A.length-1,A[t].setAttribute("tabindex","0"),A.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[t].classList.add("keyboard-focused"),A[t].focus();break}case"Enter":case" ":if(e.preventDefault(),document.activeElement&&A.includes(document.activeElement)){const e=document.activeElement;if(e.classList.contains("rcb-checkbox-row-container")||e.closest(".rcb-checkbox-row-container")){const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.querySelector(".rcb-checkbox-label"),o=r?r.textContent:e.textContent||"checkbox",A=e.querySelector(".rcb-checkbox-mark"),i=A&&A.style.backgroundColor?"checked":"unchecked";t(`${o} ${i}`)}else{const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.textContent||e.innerText;t(`Selected: ${r}`)}}break;case"Home":e.preventDefault(),A.length>0&&(A[0].setAttribute("tabindex","0"),A.forEach((e,t)=>{0!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[0].classList.add("keyboard-focused"),A[0].focus());break;case"End":if(e.preventDefault(),A.length>0){const e=A.length-1;A[e].setAttribute("tabindex","0"),A.forEach((t,n)=>{n!==e&&(t.setAttribute("tabindex","-1"),t.classList.remove("keyboard-focused"))}),A[e].classList.add("keyboard-focused"),A[e].focus()}}},t=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>{document.body.contains(t)&&document.body.removeChild(t)},1e3)},n=(e=null)=>{let n=e;if(n||(n=document.querySelector(".rcb-chat-window"),n||(n=document.querySelector('[class*="rcb-chat"]')),n||(n=document.querySelector(".qa-bot"))),!n)return;const r=null!==n.closest(".embedded-qa-bot"),o=Array.from(n.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(0===o.length)return;const A=o[o.length-1],i=Array.from(A.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);let a=[];if(i.length>0){const e=i[i.length-1];a=Array.from(e.querySelectorAll(".rcb-options"))}if(0===a.length){let e=A.querySelector(".rcb-checkbox-container");if(!e&&n&&(e=n.querySelector(".rcb-checkbox-container")),e&&null!==e.offsetParent){const t=Array.from(e.querySelectorAll(".rcb-checkbox-row-container")).filter(e=>null!==e.offsetParent&&"none"!==e.style.display);if(t.length>0){const n=e.querySelector(".rcb-checkbox-next-button"),o=[...t];if(n&&null!==n.offsetParent&&o.push(n),o.forEach((e,t)=>{e.setAttribute("tabindex",0===t?"0":"-1"),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),t.length>1){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select/deselect, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}return void setTimeout(()=>{o[0]&&null!==o[0].offsetParent&&!r&&o[0].focus()},150)}}}if(a.length>0){if(a.forEach((e,t)=>{const n=0===t?"0":"-1";e.setAttribute("tabindex",n),e.setAttribute("role","option"),e.setAttribute("aria-posinset",t+1),e.setAttribute("aria-setsize",a.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),a.length>1){const e=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}}else{const e=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove())}}setTimeout(()=>{a[0]&&null!==a[0].offsetParent&&!r&&(a[0].focus(),a.length>1&&t(`${a.length} options available. Use arrow keys to navigate.`))},200)}},r=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type){const t=Array.from(e.addedNodes),r=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-options-container")||e.classList?.contains("rcb-options")||e.querySelector?.(".rcb-options-container")||e.querySelector?.(".rcb-options"))),o=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-checkbox-container")||e.querySelector?.(".rcb-checkbox-container")));if(r||o){let t=e.target;for(;t&&!t.classList?.contains("qa-bot")&&!t.classList?.contains("rcb-chat-window");)t=t.parentElement;(t||document).querySelectorAll(".rcb-options[tabindex], .rcb-checkbox-row-container[tabindex], .rcb-checkbox-next-button[tabindex]").forEach(e=>{e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused")}),setTimeout(()=>n(t),100)}}})});r.observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("keydown",e),n();const o=setInterval(()=>{document.querySelectorAll(".qa-bot").forEach(e=>{const t=e.querySelectorAll(".rcb-options-container .rcb-options").length>0,r=e.querySelectorAll(".rcb-checkbox-row-container").length>0;if(t){const t=e.querySelectorAll(".rcb-options[tabindex]").length;e.querySelectorAll(".rcb-options").length>t&&n(e)}if(r){const t=e.querySelectorAll(".rcb-checkbox-row-container[tabindex]").length;e.querySelectorAll(".rcb-checkbox-row-container").length>t&&n(e)}})},1e3);return()=>{document.removeEventListener("keydown",e),r.disconnect(),clearInterval(o)}},[]),null),ka=[];for(let e=0;e<256;++e)ka.push((e+256).toString(16).slice(1));let Ca;const Sa=new Uint8Array(16);var Ta={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ia(e,t,n){if(Ta.randomUUID&&!e)return Ta.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!Ca){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ca=crypto.getRandomValues.bind(crypto)}return Ca(Sa)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(ka[e[t+0]]+ka[e[t+1]]+ka[e[t+2]]+ka[e[t+3]]+"-"+ka[e[t+4]]+ka[e[t+5]]+"-"+ka[e[t+6]]+ka[e[t+7]]+"-"+ka[e[t+8]]+ka[e[t+9]]+"-"+ka[e[t+10]]+ka[e[t+11]]+ka[e[t+12]]+ka[e[t+13]]+ka[e[t+14]]+ka[e[t+15]]).toLowerCase()}(r)}const Qa=()=>"qa_bot_session_".concat(Ia()),Ma="#1a5b6e",Oa="#107180",La="Arial, sans-serif",Na="Q&A Bot",Ha="/chat-icon.svg",Ra="Type your question here...",za="Chat is currently unavailable",Fa=!1,ja="Ask me a question!",Ua=!0,qa="/login",Ya={general:{showHeader:!0,showFooter:!0},tooltip:{mode:"CLOSE"},chatInput:{disabled:!1,characterLimit:1e3,showCharacterCount:!1,allowNewline:!0,blockSpam:!1},chatWindow:{defaultOpen:!1,showScrollbar:!1},botBubble:{simulateStream:!0,streamSpeed:10,showAvatar:!1},userBubble:{showAvatar:!1}},Ga=n((e,n)=>{var r,o;const{apiKey:A,qaEndpoint:c,ratingEndpoint:u,welcomeMessage:d,enabled:p,open:f,onOpenChange:h,primaryColor:g,secondaryColor:m,botName:v,logo:b,placeholder:y,errorMessage:x,embedded:E,footerText:B,footerLink:P,tooltipText:D,loginUrl:k}=e,C=i("bot_".concat(Math.random().toString(36).substr(2,9))),S=i(Qa()),T=i(!1),I=i({getSessionId:()=>S.current,isResetting:()=>T.current}),[Q,M]=a(void 0!==p?p:Ua);l(()=>{M(void 0!==p?p:Ua)},[p]);const O=s(()=>{const e=Object.assign({},Ya);e.general=Object.assign(Object.assign({},e.general),{primaryColor:g||Ma,secondaryColor:m||Oa,fontFamily:La,embedded:void 0!==E?E:Fa});const n=Q?t.createElement(ba,{key:"user-icon"}):t.createElement(va,{key:"login-button",loginUrl:k||qa,isHeaderButton:!0});return e.header={title:v||Na,showAvatar:!0,avatar:b||Ha,buttons:[n,w.CLOSE_CHAT_BUTTON]},e.chatInput=Object.assign(Object.assign({},e.chatInput),{disabled:!Q,enabledPlaceholderText:y||Ra,disabledPlaceholderText:x||za}),e.tooltip=Object.assign(Object.assign({},e.tooltip),{text:D||ja}),e},[g,m,v,b,y,x,E,D,Q,k]),L=i(null),N=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(()=>{const n=(t,n)=>{if(e.current){const n=getComputedStyle(e.current).getPropertyValue(t);if(n&&""!==n.trim())return n.trim();if(e.current.parentElement){const n=getComputedStyle(e.current.parentElement).getPropertyValue(t);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:n("--primaryColor",t.primaryColor),secondaryColor:n("--secondaryColor",t.secondaryColor),fontFamily:n("--fontFamily",t.fontFamily)}},[e,t])}(L,O.general);((e,t)=>{l(()=>{t.current&&(e?t.current.classList.add("bot-logged-in"):t.current.classList.remove("bot-logged-in"))},[e,t])})(Q,L),(e=>{let{settings:n,themeColors:r,footerText:o,footerLink:A}=e;l(()=>{r&&(Object.entries(r).forEach(e=>{let[t,n]=e;n&&document.documentElement.style.setProperty("--".concat(t),n)}),r.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",r.primaryColor),r.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",r.secondaryColor))},[r]),l(()=>{var e,r,i;(null===(e=n.header)||void 0===e?void 0:e.title)&&"string"==typeof n.header.title&&(n.header.title=t.createElement("div",{key:"header-title"},t.createElement("h1",{className:"sr-only"},n.header.title),t.createElement("span",{"aria-hidden":"true"},n.header.title))),(null===(r=n.general)||void 0===r?void 0:r.embedded)&&n.chatWindow&&(n.chatWindow.defaultOpen=!0),n.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},n.chatHistory={disabled:!1},n.chatButton=Object.assign(Object.assign({},n.chatButton),{icon:null===(i=n.header)||void 0===i?void 0:i.avatar}),n.audio={disabled:!0},n.emoji={disabled:!0},n.fileAttachment={disabled:!0},n.notification={disabled:!0};const a=o?A?t.createElement("a",{href:A,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},o):t.createElement("span",{key:"footer-text"},o):null;n.footer={text:a,buttons:[t.createElement(Pa,{key:"new-chat-button"})]},n.event={rcbToggleChatWindow:!0}},[n,o,A])})({settings:O,themeColors:N,footerText:B,footerLink:P});const H=s(()=>{const e=(e=>{let{endpoint:n,ratingEndpoint:r,apiKey:o,sessionId:A,isResetting:i=()=>!1,enabled:a=!0,loginUrl:l="/login"}=e;if(!a)return{qa_loop:{message:"To ask questions, you need to log in first.",component:t.createElement(va,{loginUrl:l}),chatDisabled:!0,path:"qa_loop"}};let s=null,c=!1;if(!n)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async e=>{const{userInput:t}=e;if(i&&i())return null;if(!t||""===t.trim())return null;if("👍 Helpful"===t||"👎 Not helpful"===t){if(r&&s)try{const e="👍 Helpful"===t,n={"Content-Type":"application/json"};o&&(n["X-API-KEY"]=o);const i=A();i&&(n["X-Session-ID"]=i,n["X-Query-ID"]=s),await fetch(r,{method:"POST",headers:n,body:JSON.stringify({sessionId:i,queryId:s,rating:e?1:0})})}catch(e){console.error("Error sending feedback:",e)}return"Thanks for the feedback! Feel free to ask another question."}try{const r=Ia();s=r;const i={"Content-Type":"application/json"};o&&(i["X-API-KEY"]=o);const a=A();a&&(i["X-Session-ID"]=a,i["X-Query-ID"]=r);const l=await fetch(n,{method:"POST",headers:i,body:JSON.stringify({query:t})});if(!l.ok)throw new Error("API returned ".concat(l.status));const u=await l.json(),d=u.response||u.answer||u.text||u.message;if(!d)throw new Error("Invalid response format from API");const p=(e=>{if(!e||"string"!=typeof e)return e;let t=e.replace(/\[(https?:\/\/[^\s]+?)\]/gi,"[$1]($1)");return t=t.replace(/(?<!\]\(|href=["']|\[)https?:\/\/[^\s[\]()]+/gi,e=>{let t=e,n="";const r=t.match(/([.,;:!?]+)$/);return r&&(n=r[1],t=t.slice(0,-n.length)),"[".concat(t,"](").concat(t,")").concat(n)}),t})(d);return await e.injectMessage(p),c=!0,setTimeout(async()=>{await e.injectMessage("Feel free to ask another question.")},100),null}catch(e){return console.error("Error in Q&A flow:",e),"I apologize, but I'm having trouble processing your question. Please try again later."}},options:e=>i&&i()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput?[]:r&&c?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,path:"qa_loop"}}})({endpoint:c,ratingEndpoint:u,apiKey:A,sessionId:I.current.getSessionId,isResetting:I.current.isResetting,enabled:Q,loginUrl:k||qa}),n={message:d,transition:{duration:0},path:"qa_loop"};return Object.assign({start:n},e)},[A,c,u,d,Q,k]),R=s(()=>{return[()=>Qn(t),pa(),()=>ga(e)];var e,t},[]);return l(()=>{const e=()=>{const e=document.querySelector(".rcb-chat-window");if(!e)return;const t=e.querySelector(".rcb-send-button");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("data-keyboard-enabled")||(t.setAttribute("data-keyboard-enabled","true"),t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const n=t&&Object.keys(t).find(e=>e.startsWith("__reactProps"));if(n){const r=t[n],o=null==r?void 0:r.onMouseDown;if(o&&"function"==typeof o)return void o(e)}const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(r)}})))},t=setInterval(e,1e3);return e(),()=>clearInterval(t)},[]),Da(),l(()=>{if(!E&&h){const e=e=>{const t=e.data.newState;h(t)};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[E,h]),t.createElement("div",{className:"qa-bot ".concat((null===(r=O.general)||void 0===r?void 0:r.embedded)?"embedded-qa-bot":""),ref:L,role:"region","aria-label":v||Na},t.createElement(Ba,{resetSession:()=>{T.current=!0,S.current=Qa()},clearResettingFlag:()=>{T.current=!1}},t.createElement(_t,null,t.createElement("div",null,t.createElement(ma,{ref:n,embedded:(null===(o=O.general)||void 0===o?void 0:o.embedded)||!1,currentOpen:f||!1,enabled:Q,onSetEnabled:M}),t.createElement(Kt,{key:"chatbot-".concat(C.current,"-").concat(Q),settings:O,flow:H,plugins:R}),t.createElement("div",{role:"status","aria-live":"polite","aria-label":"Bot response updates",className:"sr-only",id:"bot-live-region"}),t.createElement("div",{id:"chat-input-help",className:"sr-only"},"Type your message and press Enter to send. Use arrow keys to navigate through response options.")))))});Ga.displayName="QABot";b('.rcb-chat-window{height:800px!important;max-height:80vh!important;max-width:100%;width:550px!important}.rcb-chat-window .rcb-chat-header{align-items:center;display:flex;flex-direction:row;font-weight:700}.rcb-chat-window a{color:#000;font-weight:700;text-decoration:underline}.rcb-chat-window a:hover{color:var(--primaryColor,#107180)}.rcb-chat-window .rcb-bot-message a{color:#fff;text-decoration:none}.rcb-chat-window .rcb-bot-message a:hover{text-decoration:underline}.rcb-chat-window .rcb-chat-input-textarea{overflow-y:auto}.rcb-chat-window .rcb-chat-footer-container{font-size:10px}.qa-bot .user-login-icon{display:none!important}.qa-bot.bot-logged-in .user-login-icon{display:flex!important;transform:scale(1.3) translateY(-2px)}.embedded-qa-bot .rcb-chat-window{max-width:100%;width:100%!important}.qa-bot.hidden{display:none}.embedded-qa-bot .rcb-bot-message,.embedded-qa-bot .rcb-user-message{max-width:90%!important;word-break:break-word}.embedded-qa-bot .rcb-chat-input-textarea{width:100%!important}.qa-bot-container{max-width:100%;width:100%}@keyframes phone-ring{0%{transform:translateX(0) translateY(0) rotate(0deg)}2%{transform:translateX(0) translateY(-8px) rotate(-2deg)}4%{transform:translateX(0) translateY(-6px) rotate(2deg)}6%{transform:translateX(0) translateY(-8px) rotate(-1deg)}8%{transform:translateX(0) translateY(-6px) rotate(1deg)}10%{transform:translateX(0) translateY(-8px) rotate(-2deg)}12%{transform:translateX(0) translateY(-6px) rotate(2deg)}20%{transform:translateX(0) translateY(0) rotate(0deg)}30%{transform:translateX(0) translateY(0) rotate(0deg)}40%{transform:translateX(0) translateY(0) rotate(0deg)}49%{transform:translateX(0) translateY(0) rotate(0deg)}50%{transform:translateX(0) translateY(-8px) rotate(-2deg)}52%{transform:translateX(0) translateY(-6px) rotate(2deg)}54%{transform:translateX(0) translateY(-8px) rotate(-1deg)}56%{transform:translateX(0) translateY(-6px) rotate(1deg)}58%{transform:translateX(0) translateY(-8px) rotate(-2deg)}60%{transform:translateX(0) translateY(-6px) rotate(2deg)}70%{transform:translateX(0) translateY(0) rotate(0deg)}to{transform:translateX(0) translateY(0) rotate(0deg)}}@media (max-width:768px){.rcb-chat-window{max-height:calc(100vh - 100px)!important;max-width:calc(100vw - 40px)!important;width:550px!important}.embedded-chat-container.open{height:400px}.embedded-chat-closed{font-size:14px;height:40px}.embedded-chat-open-btn{font-size:12px;padding:3px 10px}.rcb-bot-message,.rcb-user-message{max-width:85%!important}.rcb-chat-input-textarea{font-size:16px!important;min-height:44px!important}.rcb-chat-header{padding:12px 16px!important}}@media (max-width:480px){.rcb-chat-window{bottom:10px!important;left:10px!important;max-height:calc(100vh - 80px)!important;max-width:calc(100vw - 20px)!important;right:10px!important;width:calc(100vw - 20px)!important}.embedded-chat-container.open{height:350px}.rcb-bot-message,.rcb-user-message{margin-bottom:8px!important;max-width:90%!important}.rcb-chat-header{font-size:14px!important;padding:8px 12px!important}.rcb-chat-button{bottom:20px!important;height:50px!important;right:20px!important;width:50px!important}.rcb-chat-footer-container{font-size:9px!important;padding:8px 12px!important}}@media (max-width:360px){.rcb-chat-window{left:5px!important;max-width:calc(100vw - 10px)!important;right:5px!important;width:calc(100vw - 10px)!important}.rcb-chat-header{font-size:13px!important;padding:6px 8px!important}}.rcb-checkbox-container{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin-left:16px!important;max-width:100%!important;padding-top:12px!important}.rcb-checkbox-row-container{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--primaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-row-container:hover{background-color:#e8f4f8!important;border-color:var(--primaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-row-container[data-checked=true]{background-color:var(--primaryColor,#107180)!important;border-color:var(--primaryColor,#107180)!important;color:#fff!important}.rcb-checkbox-row{margin-left:0!important}.rcb-checkbox-mark{height:14px!important;margin-right:6px!important;width:14px!important}.rcb-checkbox-label{font-size:13px!important;margin:0!important;white-space:nowrap!important}.rcb-checkbox-next-button{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;justify-content:center!important;line-height:24px!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-next-button:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.sr-only{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.rcb-chat-input-send-button:focus,.rcb-chat-input-textarea:focus{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-user-message{word-wrap:break-word!important;overflow:hidden!important;word-break:break-word!important}:focus-visible{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-options-container{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:8px!important;margin:16px!important;padding:0!important}.rcb-options{background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;outline:none!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-options:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-next-button.keyboard-focused,.rcb-checkbox-next-button:focus,.rcb-checkbox-next-button:focus-visible,.rcb-checkbox-row-container.keyboard-focused,.rcb-checkbox-row-container:focus,.rcb-checkbox-row-container:focus-visible,.rcb-options.keyboard-focused,.rcb-options:focus,.rcb-options:focus-visible{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;outline:none!important}.rcb-options:active{background-color:var(--secondaryColor,#107180)!important;border-color:var(--secondaryColor,#107180)!important;color:#fff!important;transform:translateY(0)!important}.keyboard-nav-hint{color:#666!important;font-size:12px!important;font-style:italic!important;margin-bottom:8px!important}@media (prefers-reduced-motion:reduce){.keyboard-nav-hint{display:none!important}}.rcb-options-container [role=button][tabindex="0"],.rcb-options-container button[tabindex="0"]{position:relative!important}.rcb-options-container [role=button][tabindex="0"]:after,.rcb-options-container button[tabindex="0"]:after{color:var(--secondaryColor,#107180)!important;content:"←"!important;font-size:16px!important;opacity:0!important;position:absolute!important;right:12px!important;top:50%!important;transform:translateY(-50%)!important;transition:opacity .2s ease!important}.rcb-options-container [role=button][tabindex="0"]:focus:after,.rcb-options-container button[tabindex="0"]:focus:after{opacity:1!important}.rcb-chat-input-send-button{cursor:pointer!important;opacity:1!important;pointer-events:auto!important;visibility:visible!important}.rcb-chat-input-send-button:not([tabindex]){-webkit-user-select:none;-moz-user-select:none;user-select:none}.rcb-chat-input-container [onclick],.rcb-chat-input-container [role=button],.rcb-chat-input-container div[style*=cursor],.rcb-chat-input-container svg:last-child,.rcb-chat-input-container>div:last-child{tabindex:0!important;cursor:pointer!important}.rcb-chat-footer{margin-top:4px!important;padding-top:0!important}.rcb-chat-footer-container{align-items:center!important;display:flex!important;margin-top:4px!important;padding-top:4px!important}.rcb-chat-footer-container button{order:1!important}.rcb-chat-footer-container a[href*=qa-bot-core]{tab-index:0!important;order:2!important}.rcb-chat-footer-container a[href*=feedback]{tab-index:0!important;order:3!important}@media (prefers-contrast:high){.rcb-chat-window a{background-color:#fff!important;border:1px solid #000!important;color:#000!important}}@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.rcb-chat-input-textarea{user-select:text!important}.rcb-chat-body-container,.rcb-chat-input-textarea,.rcb-chat-window{touch-action:pan-y!important}.embedded-qa-bot,.rcb-chat-window{-webkit-overflow-scrolling:touch!important}.embedded-qa-bot .rcb-chat-input-textarea{touch-action:pan-y!important;user-select:text!important}.embedded-qa-bot .rcb-chat-body-container,.embedded-qa-bot .rcb-chat-window{touch-action:pan-y!important}.rcb-chat-header-container{background:var(--primaryColor,#1a5b6e)!important;background:linear-gradient(135deg,var(--primaryColor,#1a5b6e) 0,var(--secondaryColor,#107180) 100%)!important}.rcb-toggle-button{align-items:center!important;background:var(--primaryColor,#1a5b6e)!important;display:flex!important;justify-content:center!important}.rcb-toggle-button svg{stroke:#fff!important;color:#fff!important}.rcb-toggle-button *,.rcb-toggle-button img,.rcb-toggle-button svg,.rcb-toggle-button>*{box-sizing:border-box!important;height:50px!important;left:0!important;margin:0 auto!important;max-height:50px!important;max-width:50px!important;min-height:50px!important;min-width:50px!important;padding:2px!important;position:relative!important;top:0!important;width:50px!important}.rcb-send-button{background-color:var(--primaryColor,#1a5b6e)!important}',{insertAt:"top"});const _a=()=>{const[e,t]=a(!1),n=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia;return{captureScreenshot:async()=>{if(!n())throw new Error("Screen capture is not available in this environment");try{t(!0);const e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",cursor:"always",width:{ideal:1920},height:{ideal:1080}},audio:!1}),n=document.createElement("video");n.srcObject=e,await new Promise(e=>{n.onloadedmetadata=()=>{n.play(),e()}});const r=document.createElement("canvas");r.width=n.videoWidth,r.height=n.videoHeight;const o=r.getContext("2d");if(!o)throw new Error("Could not get canvas context");o.drawImage(n,0,0,r.width,r.height);const A=await new Promise(e=>r.toBlob(e,"image/png"));if(!A)throw new Error("Could not create image blob");const i=(new Date).toISOString().replace(/[:.]/g,"-"),a=new File([A],"screenshot-".concat(i,".png"),{type:"image/png"});return e.getTracks().forEach(e=>e.stop()),t(!1),a}catch(e){throw console.error("Error capturing screenshot:",e),t(!1),e}},isCapturing:e,isScreenCaptureAvailable:n()}},Wa=e=>t.createElement(ya,e,t.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.createElement("polyline",{points:"17 8 12 3 7 8"}),t.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"})),Va=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if("string"!=typeof r.result)return void n(new Error("Failed to read file ".concat(e.name)));const o=r.result.split(",")[1];t({fileName:e.name,contentType:e.type,size:e.size,fileData:o})},r.onerror=()=>n(new Error("Failed to read file ".concat(e.name))),r.readAsDataURL(e)}),Xa=e=>Promise.all(e.map(Va)),Ka=function(e){const t=1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)*1024;return e.size<=t},Ja=e=>e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB"),Za=e=>{let{onFileUpload:n,maxSizeMB:r=10,acceptedTypes:o="image/*,application/pdf,text/*,.doc,.docx",enableScreenshot:A=!1,className:l}=e;const[s,c]=a(!1),[u,d]=a([]),[p,f]=a(null),h=i(null),{captureScreenshot:g,isCapturing:m,isScreenCaptureAvailable:v}=_a(),b=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>document.body.removeChild(t),1e3)},w=e=>{if(!e||0===e.length)return void console.warn("FileUploadComponent: No valid files provided to handleFiles");let t;try{t=Array.from(e)}catch(e){return console.error("FileUploadComponent: Error converting files to array:",e),void b("Error processing selected files. Please try again.")}const r=[...u,...t];d(r);const o=t.length,A=t.map(e=>e.name).join(", ");b("".concat(o," file").concat(o>1?"s":""," selected: ").concat(A)),setTimeout(()=>{const e=document.querySelector(".rcb-chat-content");e&&(e.scrollTop=e.scrollHeight)},100),n&&n(r)},y=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?c(!0):"dragleave"===e.type&&c(!1)},x=()=>{try{h.current&&h.current.click()}catch(e){console.error("FileUploadComponent: Error in handleButtonClick:",e),b("Error opening file selection dialog. Please try again.")}},E=()=>{f(null)},B=A&&v;return t.createElement("div",{className:"file-upload-container ".concat(l||""),style:{padding:"16px",margin:"8px 0"}},B&&t.createElement("div",{style:{display:"flex",justifyContent:"center",marginBottom:"10px"}},t.createElement("button",{onClick:e=>{e.preventDefault(),(async()=>{try{const e=await g();w([e]),b("Screenshot captured successfully")}catch(e){b("Error capturing screenshot. Please try again.")}})()},disabled:m,"aria-describedby":"screenshot-help","aria-label":m?"Taking screenshot, please wait":"Take a screenshot to attach",style:{display:"flex",alignItems:"center",gap:"8px",backgroundColor:"#107180",color:"white",border:"none",borderRadius:"5px",padding:"8px 12px",cursor:m?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t.createElement("circle",{cx:"12",cy:"13",r:"4"})),m?"Taking screenshot...":"Take screenshot..."),t.createElement("span",{id:"screenshot-help",className:"sr-only"},"Captures the current screen and adds it as an attachment")),t.createElement("div",{className:"file-upload-dropzone ".concat(s?"active":""),onDragEnter:y,onDragLeave:y,onDragOver:y,onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),c(!1);try{(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&e.dataTransfer.files.length>0&&w(e.dataTransfer.files)}catch(e){console.error("FileUploadComponent: Error in handleDrop:",e),b("Error processing dropped files. Please try again.")}},role:"button",tabIndex:0,"aria-label":"File upload area. Click to select files or drag and drop files here.","aria-describedby":"upload-instructions",onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),x())},style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",backgroundColor:s?"#f0f8ff":"#fafafa",transition:"all 0.3s ease"}},t.createElement("input",{ref:h,type:"file",className:"file-input",onChange:e=>{var t;try{(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&w(e.target.files)}catch(e){console.error("FileUploadComponent: Error in handleFileSelect:",e),b("Error processing selected files. Please try again.")}},multiple:!0,style:{display:"none"},"aria-label":"Select files to upload",accept:o}),t.createElement("div",{className:"upload-content",onClick:x,style:{cursor:"pointer",flexDirection:"column",alignItems:"center",display:"flex",textAlign:"center",padding:"12px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}},t.createElement(Wa,null),t.createElement("p",{style:{margin:0,fontWeight:"bold"}},"Upload Files")),t.createElement("p",{id:"upload-instructions",style:{margin:0,fontSize:"14px",color:"#666"}},"Drag and drop files here or click to select. (Max ",r,"MB each)")),u.length>0&&t.createElement("div",{className:"selected-files",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",alignItems:"center"}},t.createElement("span",{style:{fontWeight:400,color:"#888",fontSize:"13px",marginRight:"8px",alignSelf:"center"}},"Selected files:"),u.map((e,r)=>t.createElement("span",{key:r,style:{background:"#fff",color:"#107180",borderRadius:"5px",padding:"4px 12px",fontSize:"14px",marginRight:"4px",marginBottom:"4px",border:"1px solid #ccc",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:t=>{t.stopPropagation(),(e=>{f(e)})(e)}},t.createElement("span",{onClick:e=>{e.stopPropagation(),(e=>{const t=u.filter((t,n)=>n!==e);d(t),n&&n(t)})(r)},style:{cursor:"pointer",color:"#888",fontWeight:"bold",fontSize:"15px",marginRight:"4px",userSelect:"none",lineHeight:1},title:"Remove file","aria-label":"Remove ".concat(e.name)},"×"),e.name," (",Ja(e.size),")"))))),(()=>{if(!p)return null;const e=p.type.startsWith("image/"),n=p.type.startsWith("text/"),r="application/pdf"===p.type;return t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},onClick:E},t.createElement("div",{style:{backgroundColor:"white",padding:"20px",borderRadius:"8px",maxWidth:"90%",maxHeight:"90%",overflow:"auto",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{onClick:E,style:{position:"absolute",top:"10px",right:"10px",background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×"),t.createElement("h3",{style:{marginTop:0,marginBottom:"16px"}},p.name),e&&t.createElement("img",{src:URL.createObjectURL(p),alt:p.name,style:{maxWidth:"100%",maxHeight:"70vh"}}),n&&t.createElement("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"70vh",overflow:"auto",padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"4px"}},URL.createObjectURL(p)),r&&t.createElement("iframe",{src:URL.createObjectURL(p),style:{width:"100%",height:"70vh",border:"none"},title:p.name}),!e&&!n&&!r&&t.createElement("div",{style:{padding:"20px",textAlign:"center"}},"Preview not available for this file type")))})())},$a=t.forwardRef((e,n)=>{const[r,o]=t.useState(e.defaultOpen||!1),A=t.useRef(null);return t.useImperativeHandle(n,()=>({addMessage:e=>{var t;null===(t=A.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=A.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;o(!0),null===(e=A.current)||void 0===e||e.openChat()},closeChat:()=>{var e;o(!1),null===(e=A.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;o(e=>!e),null===(e=A.current)||void 0===e||e.toggleChat()}}),[]),t.createElement(Ga,{ref:A,apiKey:e.apiKey,qaEndpoint:e.qaEndpoint,ratingEndpoint:e.ratingEndpoint,welcomeMessage:e.welcomeMessage,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,botName:e.botName,logo:e.logo,placeholder:e.placeholder,errorMessage:e.errorMessage,embedded:e.embedded,enabled:e.enabled,open:r,onOpenChange:o,footerText:e.footerText,footerLink:e.footerLink,tooltipText:e.tooltipText})});function el(e){if(!(e.target&&e.target instanceof HTMLElement))return void console.error("QA Bot: A valid target DOM element is required");const n=f.createRoot(e.target),r={current:null};return n.render(t.createElement(t.StrictMode,null,t.createElement($a,{ref:e=>{r.current=e},apiKey:e.apiKey,qaEndpoint:e.qaEndpoint,ratingEndpoint:e.ratingEndpoint,defaultOpen:e.defaultOpen,embedded:e.embedded,enabled:e.enabled,welcomeMessage:e.welcomeMessage,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,botName:e.botName,logo:e.logo,placeholder:e.placeholder,errorMessage:e.errorMessage,footerText:e.footerText,footerLink:e.footerLink,tooltipText:e.tooltipText}))),{addMessage:e=>{var t;return null===(t=r.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=r.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{r.current=null,n.unmount()}}}$a.displayName="ProgrammaticQABot";export{Za as FileUploadComponent,Ga as QABot,el as default,Va as fileToBase64,Xa as filesToBase64,Ja as formatFileSize,el as qaBot,_a as useScreenshotCapture,Ka as validateFileSize};
8
+ */var hn,gn;const mn=fn(function(){if(gn)return hn;gn=1;var e=/["'&<>]/;return hn=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,A="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#39;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}a!==i&&(A+=n.substring(a,i)),a=i+1,A+=o}return a!==i?A+n.substring(a,i):A}}());function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bn=/(url|image|image-set)\(/i;class wn extends pn{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(bn)&&delete t[e]}),t}}const yn=/^<(!doctype|(html|head|body)(\s|>))/i,xn=/^(aria-|data-|\w+:)/iu,En=/{{{(\w+)\/?}}}/;function Bn(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let Pn=class{constructor(e,t={},n=[],r=[]){var o;if(vn(this,"allowed",void 0),vn(this,"banned",void 0),vn(this,"blocked",void 0),vn(this,"container",void 0),vn(this,"content",[]),vn(this,"props",void 0),vn(this,"matchers",void 0),vn(this,"filters",void 0),vn(this,"keyIndex",void 0),"production"!==process.env.NODE_ENV&&e&&"string"!=typeof e)throw new TypeError("Interweave parser requires a valid string.");this.props=t,this.matchers=n,this.filters=[...r,new wn],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:ln),this.banned=new Set(an),this.blocked=new Set(t.blockList)}applyAttributeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.attribute?n.attribute(e,t):t,t)}applyNodeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.node?n.node(e,t):t,t)}applyMatchers(e,t){const n={},{props:r}=this;let o=e,A=0,i=null;return this.matchers.forEach(e=>{const a=e.asTag().toLowerCase(),l=this.getTagConfig(a);if(r[e.inverseName]||!this.isTagAllowed(a)||!this.canRenderChild(t,l))return;let s="";for(;o&&(i=e.match(o));){const{index:t,length:a,match:l,valid:c,void:u,...d}=i,p=e.propName+String(A);t>0&&(s+=o.slice(0,t)),c?(s+=u?`{{{${p}/}}}`:`{{{${p}}}}${l}{{{/${p}}}}`,this.keyIndex+=1,A+=1,n[p]={children:l,matcher:e,props:{...r,...d,key:this.keyIndex}}):s+=l,e.greedy?(o=s+o.slice(t+a),s=""):o=o.slice(t+(a||l.length))}e.greedy||(o=s+o)}),0===A?e:this.replaceTokens(o,n)}canRenderChild(e,t){return!(!e.tagName||!t.tagName||e.void)&&(e.children.length>0?e.children.includes(t.tagName):!(e.invalid.length>0&&e.invalid.includes(t.tagName))&&(t.parent.length>0?t.parent.includes(e.tagName):!(!e.self&&e.tagName===t.tagName)&&!!(e&&e.content&t.type)))}convertLineBreaks(e){const{noHtml:t,disableLineBreaks:n}=this.props;if(t||n||e.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return e;let r=e.replace(/\r\n/g,"\n");return r=r.replace(/\n{3,}/g,"\n\n\n"),r=r.replace(/\n/g,"<br/>"),r}createContainer(e){var t;const n=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||Bn)();if(!n)return;const r=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",o="body"===r||"fragment"===r?n.body:n.createElement(r);if(e.match(yn)){if("production"!==process.env.NODE_ENV)throw new Error("HTML documents as Interweave content are not supported.")}else o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?mn(e):e);return o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:A,value:i}=o,a=A.toLowerCase(),l=sn[a]||sn[A];if(!this.isSafe(e)||!a.match(xn)&&(!t&&(!l||2===l)||a.startsWith("on")||i.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let s="style"===a?this.extractStyleAttribute(e):i;4===l?s=!0:3===l?s=Number.parseFloat(String(s)):5!==l&&(s=String(s)),n[cn[a]||a]=this.applyAttributeFilters(a,s),r+=1}),0!==r)?n:null}extractStyleAttribute(e){const t={};return Array.from(e.style).forEach(n=>{const r=e.style[n];("string"==typeof r||"number"==typeof r)&&(t[n.replace(/-([a-z])/g,(e,t)=>String(t).toUpperCase())]=r)}),t}getTagConfig(e){const t={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return An[e]?{...t,...An[e],tagName:e}:t}isSafe(e){if(typeof HTMLAnchorElement<"u"&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(e,n){const{noHtml:r,noHtmlExceptMatchers:o,allowElements:A,transform:i,transformOnlyAllowList:a}=this.props;let l=[],s="";return[...e.childNodes].forEach(e=>{if(1===e.nodeType){const u=e.nodeName.toLowerCase(),d=this.getTagConfig(u);s&&(l.push(s),s="");const p=this.applyNodeFilters(u,e);if(!p)return;let f;if(i&&(!a||this.isTagAllowed(u))){this.keyIndex+=1;const e=this.keyIndex;f=this.parseNode(p,d);const n=i(p,f,d);if(null===n)return;if(typeof n<"u")return void l.push(t.cloneElement(n,{key:e}));this.keyIndex=e-1}if(this.banned.has(u))return;if(r||o&&"br"!==u||!this.isTagAllowed(u)||!A&&!this.canRenderChild(n,d))l=[...l,...this.parseNode(p,d.tagName?d:n)];else{var c;this.keyIndex+=1;const e=this.extractAttributes(p),n={tagName:u};e&&(n.attributes=e),d.void&&(n.selfClose=d.void),l.push(t.createElement(dn,{...n,key:this.keyIndex},null!==(c=f)&&void 0!==c?c:this.parseNode(p,d)))}}else if(3===e.nodeType){const t=r&&!o?e.textContent:this.applyMatchers(e.textContent||"",n);Array.isArray(t)?l=[...l,...t]:s+=t}}),s&&l.push(s),l}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(En);){const[e,A]=o,i=o.index,a=e.includes("/");if("production"!==process.env.NODE_ENV&&!t[A])throw new Error(`Token "${A}" found but no matching element to replace with.`);i>0&&(n.push(r.slice(0,i)),r=r.slice(i));const{children:l,matcher:s,props:c}=t[A];let u;if(a)u=e.length,n.push(s.createElement(l,c));else{const o=r.match(new RegExp(`{{{/${A}}}}`));if("production"!==process.env.NODE_ENV&&!o)throw new Error(`Closing token missing for interpolated element "${A}".`);u=o.index+o[0].length,n.push(s.createElement(this.replaceTokens(r.slice(e.length,o.index),t),c))}r=r.slice(u)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function Dn(e){var n;const{attributes:r,className:o,containerTagName:A,content:i,emptyContent:a,parsedContent:l,tagName:s,noWrap:c}=e,u=null!==(n=A??s)&&void 0!==n?n:"span",d="fragment"===u||c;let p;if(l)p=l;else{const t=new Pn(i??"",e).parse();t.length>0&&(p=t)}return p||(p=a),d?t.createElement(t.Fragment,null,p):t.createElement(dn,{attributes:r,className:o,tagName:u},p)}function kn(e){const{attributes:n,className:r,content:o="",disableFilters:A=!1,disableMatchers:i=!1,emptyContent:a=null,filters:l=[],matchers:s=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:d="span",noWrap:p=!1,...f}=e,h=i?[]:s,g=A?[]:l,m=u?[u]:[],v=c?[c]:[];h.forEach(e=>{e.onBeforeParse&&m.push(e.onBeforeParse.bind(e)),e.onAfterParse&&v.push(e.onAfterParse.bind(e))});const b=m.reduce((t,n)=>{const r=n(t,e);if("production"!==process.env.NODE_ENV&&"string"!=typeof r)throw new TypeError("Interweave `onBeforeParse` must return a valid HTML string.");return r},o??""),w=new Pn(b,f,h,g),y=v.reduce((t,n)=>{const r=n(t,e);if("production"!==process.env.NODE_ENV&&!Array.isArray(r))throw new TypeError("Interweave `onAfterParse` must return an array of strings and React elements.");return r},w.parse());return t.createElement(Dn,{attributes:n,className:r,containerTagName:e.containerTagName,emptyContent:a,noWrap:p,parsedContent:0===y.length?void 0:y,tagName:d})}const Cn=({children:e})=>h("div",{style:{whiteSpace:"normal"},children:h(kn,{content:"string"==typeof e?e:""})}),Sn={autoConfig:!0},Tn=(e,t,n)=>{var r;if(!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderHtml)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)},In=e=>{const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const A=e[o];"<"===A?r?(t.push(n),n=A):(r=!0,n=A):">"===A?(n+=A,t.push(n),n="",r=!1):r?n+=A:t.push(A)}return""!==n&&t.push(n),t},Qn=e=>{const{getFlow:t}=Zt(),{messages:n,replaceMessages:r}=$t(),{settings:o}=tn(),{hasChatHistoryLoaded:A}=nn(),i={...e,...Sn},a=i.htmlComponent?i.htmlComponent:Cn;l(()=>{var e,t;if(A){const A=[...n];for(let n=0;n<A.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=A[n];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=a)}r(A)}},[A]);const s=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();"string"==typeof e.data.message.content&&Tn(e,t(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=In),e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};en(X.PRE_INJECT_MESSAGE,s),en(X.CHUNK_STREAM_MESSAGE,s),en(X.START_STREAM_MESSAGE,s),en(X.START_SIMULATE_STREAM_MESSAGE,s),en(X.START_SPEAK_AUDIO,async e=>{Tn(e,t(),"BOT")&&(e.data.textToRead=(e=>typeof window.DOMParser<"u"?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<\/?[^>]+(>|$)/g,""))(e.data.textToRead))});const c={name:"@rcb-plugins/html-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c};const Mn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,On=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ln={};function Nn(e,t){return(Ln.jsx?On:Mn).test(e)}const Hn=/[ \t\n\f\r]/g;function Rn(e){return""===e.replace(Hn,"")}class zn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Fn(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new zn(n,r,t)}function jn(e){return e.toLowerCase()}zn.prototype.property={},zn.prototype.normal={},zn.prototype.space=null;class Un{constructor(e,t){this.property=e,this.attribute=t}}Un.prototype.space=null,Un.prototype.boolean=!1,Un.prototype.booleanish=!1,Un.prototype.overloadedBoolean=!1,Un.prototype.number=!1,Un.prototype.commaSeparated=!1,Un.prototype.spaceSeparated=!1,Un.prototype.commaOrSpaceSeparated=!1,Un.prototype.mustUseProperty=!1,Un.prototype.defined=!1;let qn=0;const Yn=Jn(),Gn=Jn(),_n=Jn(),Wn=Jn(),Vn=Jn(),Xn=Jn(),Kn=Jn();function Jn(){return 2**++qn}const Zn=Object.freeze(Object.defineProperty({__proto__:null,boolean:Yn,booleanish:Gn,commaOrSpaceSeparated:Kn,commaSeparated:Xn,number:Wn,overloadedBoolean:_n,spaceSeparated:Vn},Symbol.toStringTag,{value:"Module"})),$n=Object.keys(Zn);class er extends Un{constructor(e,t,n,r){let o=-1;if(super(e,t),tr(this,"space",r),"number"==typeof n)for(;++o<$n.length;){const e=$n[o];tr(this,$n[o],(n&Zn[e])===Zn[e])}}}function tr(e,t,n){n&&(e[t]=n)}er.prototype.defined=!0;const nr={}.hasOwnProperty;function rr(e){const t={},n={};let r;for(r in e.properties)if(nr.call(e.properties,r)){const o=e.properties[r],A=new er(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(A.mustUseProperty=!0),t[r]=A,n[jn(r)]=r,n[jn(A.attribute)]=r}return new zn(t,n,e.space)}const or=rr({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Ar=rr({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function ir(e,t){return t in e?e[t]:t}function ar(e,t){return ir(e,t.toLowerCase())}const lr=rr({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ar,properties:{xmlns:null,xmlnsXLink:null}}),sr=rr({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Wn,ariaColIndex:Wn,ariaColSpan:Wn,ariaControls:Vn,ariaCurrent:null,ariaDescribedBy:Vn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:Vn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:Vn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vn,ariaLevel:Wn,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:Vn,ariaPlaceholder:null,ariaPosInSet:Wn,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:Vn,ariaRowCount:Wn,ariaRowIndex:Wn,ariaRowSpan:Wn,ariaSelected:Gn,ariaSetSize:Wn,ariaSort:null,ariaValueMax:Wn,ariaValueMin:Wn,ariaValueNow:Wn,ariaValueText:null,role:null}}),cr=rr({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ar,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xn,acceptCharset:Vn,accessKey:Vn,action:null,allow:null,allowFullScreen:Yn,allowPaymentRequest:Yn,allowUserMedia:Yn,alt:null,as:null,async:Yn,autoCapitalize:null,autoComplete:Vn,autoFocus:Yn,autoPlay:Yn,blocking:Vn,capture:null,charSet:null,checked:Yn,cite:null,className:Vn,cols:Wn,colSpan:null,content:null,contentEditable:Gn,controls:Yn,controlsList:Vn,coords:Wn|Xn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Yn,defer:Yn,dir:null,dirName:null,disabled:Yn,download:_n,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Yn,formTarget:null,headers:Vn,height:Wn,hidden:Yn,high:Wn,href:null,hrefLang:null,htmlFor:Vn,httpEquiv:Vn,id:null,imageSizes:null,imageSrcSet:null,inert:Yn,inputMode:null,integrity:null,is:null,isMap:Yn,itemId:null,itemProp:Vn,itemRef:Vn,itemScope:Yn,itemType:Vn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Yn,low:Wn,manifest:null,max:null,maxLength:Wn,media:null,method:null,min:null,minLength:Wn,multiple:Yn,muted:Yn,name:null,nonce:null,noModule:Yn,noValidate:Yn,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:Yn,optimum:Wn,pattern:null,ping:Vn,placeholder:null,playsInline:Yn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Yn,referrerPolicy:null,rel:Vn,required:Yn,reversed:Yn,rows:Wn,rowSpan:Wn,sandbox:Vn,scope:null,scoped:Yn,seamless:Yn,selected:Yn,shadowRootClonable:Yn,shadowRootDelegatesFocus:Yn,shadowRootMode:null,shape:null,size:Wn,sizes:null,slot:null,span:Wn,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Wn,step:null,style:null,tabIndex:Wn,target:null,title:null,translate:null,type:null,typeMustMatch:Yn,useMap:null,value:Gn,width:Wn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vn,axis:null,background:null,bgColor:null,border:Wn,borderColor:null,bottomMargin:Wn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Yn,declare:Yn,event:null,face:null,frame:null,frameBorder:null,hSpace:Wn,leftMargin:Wn,link:null,longDesc:null,lowSrc:null,marginHeight:Wn,marginWidth:Wn,noResize:Yn,noHref:Yn,noShade:Yn,noWrap:Yn,object:null,profile:null,prompt:null,rev:null,rightMargin:Wn,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Wn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Wn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Yn,disableRemotePlayback:Yn,prefix:null,property:null,results:Wn,security:null,unselectable:null}}),ur=rr({space:"svg",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"},transform:ir,properties:{about:Kn,accentHeight:Wn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Wn,amplitude:Wn,arabicForm:null,ascent:Wn,attributeName:null,attributeType:null,azimuth:Wn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Wn,by:null,calcMode:null,capHeight:Wn,className:Vn,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:Wn,diffuseConstant:Wn,direction:null,display:null,dur:null,divisor:Wn,dominantBaseline:null,download:Yn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Wn,enableBackground:null,end:null,event:null,exponent:Wn,externalResourcesRequired:null,fill:null,fillOpacity:Wn,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:Xn,g2:Xn,glyphName:Xn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Wn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Wn,horizOriginX:Wn,horizOriginY:Wn,id:null,ideographic:Wn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Wn,k:Wn,k1:Wn,k2:Wn,k3:Wn,k4:Wn,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Wn,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:Wn,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:Wn,overlineThickness:Wn,paintOrder:null,panose1:null,path:null,pathLength:Wn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Wn,pointsAtY:Wn,pointsAtZ:Wn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,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:Wn,specularExponent:Wn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Wn,strikethroughThickness:Wn,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Wn,strokeOpacity:Wn,strokeWidth:null,style:null,surfaceScale:Wn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:Wn,tableValues:null,target:null,targetX:Wn,targetY:Wn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Wn,underlineThickness:Wn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Wn,values:null,vAlphabetic:Wn,vMathematical:Wn,vectorEffect:null,vHanging:Wn,vIdeographic:Wn,version:null,vertAdvY:Wn,vertOriginX:Wn,vertOriginY:Wn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Wn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),dr=/^data[-\w.:]+$/i,pr=/-[a-z]/g,fr=/[A-Z]/g;function hr(e){return"-"+e.toLowerCase()}function gr(e){return e.charAt(1).toUpperCase()}const mr={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"},vr=Fn([Ar,or,lr,sr,cr],"html"),br=Fn([Ar,or,lr,sr,ur],"svg");function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yr,xr,Er,Br={};var Pr=function(){if(Er)return Br;Er=1;var e=Br&&Br.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Br,"__esModule",{value:!0}),Br.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),A="function"==typeof n;return o.forEach(function(e){if("declaration"===e.type){var t=e.property,o=e.value;A?n(t,o,e):o&&((r=r||{})[t]=o)}}),r};var t=e(function(){if(xr)return yr;xr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,A=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,a=/^\s+|\s+$/g,l="";function s(e){return e?e.replace(a,l):l}return yr=function(a,c){if("string"!=typeof a)throw new TypeError("First argument must be a string");if(!a)return[];c=c||{};var u=1,d=1;function p(e){var n=e.match(t);n&&(u+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function f(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=c.source}function g(e){var t=new Error(c.source+":"+u+":"+d+": "+e);if(t.reason=e,t.filename=c.source,t.line=u,t.column=d,t.source=a,!c.silent)throw t}function m(e){var t=e.exec(a);if(t){var n=t[0];return p(n),a=a.slice(n.length),t}}function v(){m(n)}function b(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=f();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var t=2;l!=a.charAt(t)&&("*"!=a.charAt(t)||"/"!=a.charAt(t+1));)++t;if(t+=2,l===a.charAt(t-1))return g("End of comment missing");var n=a.slice(2,t-2);return d+=2,p(n),a=a.slice(t),d+=2,e({type:"comment",comment:n})}}function y(){var t=f(),n=m(r);if(n){if(w(),!m(o))return g("property missing ':'");var a=m(A),c=t({type:"declaration",property:s(n[0].replace(e,l)),value:a?s(a[0].replace(e,l)):l});return m(i),c}}return h.prototype.content=a,v(),function(){var e,t=[];for(b(t);e=y();)!1!==e&&(t.push(e),b(t));return t}()},yr}());return Br}();const Dr=wr(Pr),kr=Dr.default||Dr,Cr=Tr("end"),Sr=Tr("start");function Tr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Ir(e){return e&&"object"==typeof e?"position"in e||"type"in e?Mr(e.position):"start"in e||"end"in e?Mr(e):"line"in e||"column"in e?Qr(e):"":""}function Qr(e){return Or(e&&e.line)+":"+Or(e&&e.column)}function Mr(e){return Qr(e&&e.start)+"-"+Qr(e&&e.end)}function Or(e){return e&&"number"==typeof e?e:1}class Lr extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},A=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(A=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const i=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=i?i.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=i?i.line:void 0,this.name=Ir(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=A&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Lr.prototype.file="",Lr.prototype.name="",Lr.prototype.reason="",Lr.prototype.message="",Lr.prototype.stack="",Lr.prototype.column=void 0,Lr.prototype.line=void 0,Lr.prototype.ancestors=void 0,Lr.prototype.cause=void 0,Lr.prototype.fatal=void 0,Lr.prototype.place=void 0,Lr.prototype.ruleId=void 0,Lr.prototype.source=void 0;const Nr={}.hasOwnProperty,Hr=new Map,Rr=/[A-Z]/g,zr=/-([a-z])/g,Fr=new Set(["table","tbody","thead","tfoot","tr"]),jr=new Set(["td","th"]),Ur="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qr(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,A){const i=Array.isArray(o.children),a=Sr(n);return t(r,o,A,i,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,A){const i=Array.isArray(o.children)?n:t;return A?i(r,o,A):i(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?br:vr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},A=Yr(o,e,void 0);return A&&"string"!=typeof A?A:o.create(e,o.Fragment,{children:A||void 0},void 0)}function Yr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=br,e.schema=o),e.ancestors.push(t);const A=Xr(e,t.tagName,!1),i=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Nr.call(t.properties,o)){const A=Vr(e,o,t.properties[o]);if(A){const[o,i]=A;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof i&&jr.has(t.tagName)?r=i:n[o]=i}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let a=Wr(e,t);return Fr.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&Rn(e.value):Rn(e)}(e)})),Gr(e,i,A,t),_r(i,a),e.ancestors.pop(),e.schema=r,e.create(t,A,i,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Kr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=br,e.schema=o),e.ancestors.push(t);const A=null===t.name?e.Fragment:Xr(e,t.name,!0),i=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const o=t.expression;o.type;const A=o.properties[0];A.type,Object.assign(n,e.evaluater.evaluateExpression(A.argument))}else Kr(e,t.position);else{const o=r.name;let A;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,A=e.evaluater.evaluateExpression(t.expression)}else Kr(e,t.position);else A=null===r.value||r.value;n[o]=A}return n}(e,t),a=Wr(e,t);return Gr(e,i,A,t),_r(i,a),e.ancestors.pop(),e.schema=r,e.create(t,A,i,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Kr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return _r(r,Wr(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Gr(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _r(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Wr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Hr;for(;++r<t.children.length;){const A=t.children[r];let i;if(e.passKeys){const e="element"===A.type?A.tagName:"mdxJsxFlowElement"===A.type||"mdxJsxTextElement"===A.type?A.name:void 0;if(e){const t=o.get(e)||0;i=e+"-"+t,o.set(e,t+1)}}const a=Yr(e,A,i);void 0!==a&&n.push(a)}return n}function Vr(e,t,n){const r=function(e,t){const n=jn(t);let r=t,o=Un;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&dr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(pr,gr);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!pr.test(e)){let n=e.replace(fr,hr);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=er}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):function(e){return e.join(" ").trim()}(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{kr(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new Lr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Ur+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(zr,Zr)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Nr.call(e,n)&&(t[Jr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?mr[r.property]||r.property:r.attribute,n]}}function Xr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=Nn(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:!(!o||"Literal"!==t.type),optional:!1}:t}r=n}else r=Nn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Nr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Kr(e)}function Kr(e,t){const n=new Lr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ur+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Jr(e){let t=e.replace(Rr,$r);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Zr(e,t){return t.toUpperCase()}function $r(e){return"-"+e.toLowerCase()}const eo={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"]},to={};function no(e,t,n){if(function(e){return!(!e||"object"!=typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ro(e.children,t,n)}return Array.isArray(e)?ro(e,t,n):""}function ro(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=no(e[o],t,n);return r.join("")}const oo=document.createElement("i");function Ao(e){const t="&"+e+";";oo.innerHTML=t;const n=oo.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function io(e,t,n,r){const o=e.length;let A,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)A=Array.from(r),A.unshift(t,n),e.splice(...A);else for(n&&e.splice(t,n);i<r.length;)A=r.slice(i,i+1e4),A.unshift(t,0),e.splice(...A),i+=1e4,t+=1e4}function ao(e,t){return e.length>0?(io(e,e.length,0,t),e):t}const lo={}.hasOwnProperty;function so(e){const t={};let n=-1;for(;++n<e.length;)co(t,e[n]);return t}function co(e,t){let n;for(n in t){const r=(lo.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let A;if(o)for(A in o){lo.call(r,A)||(r[A]=[]);const e=o[A];uo(r[A],Array.isArray(e)?e:e?[e]:[])}}}function uo(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);io(e,0,0,r)}function po(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function fo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ho=ko(/[A-Za-z]/),go=ko(/[\dA-Za-z]/),mo=ko(/[#-'*+\--9=?A-Z^-~]/);function vo(e){return null!==e&&(e<32||127===e)}const bo=ko(/\d/),wo=ko(/[\dA-Fa-f]/),yo=ko(/[!-/:-@[-`{-~]/);function xo(e){return null!==e&&e<-2}function Eo(e){return null!==e&&(e<0||32===e)}function Bo(e){return-2===e||-1===e||32===e}const Po=ko(new RegExp("\\p{P}|\\p{S}","u")),Do=ko(/\s/);function ko(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function Co(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const A=e.charCodeAt(n);let i="";if(37===A&&go(e.charCodeAt(n+1))&&go(e.charCodeAt(n+2)))o=2;else if(A<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(A))||(i=String.fromCharCode(A));else if(A>55295&&A<57344){const t=e.charCodeAt(n+1);A<56320&&t>56319&&t<57344?(i=String.fromCharCode(A,t),o=1):i="�"}else i=String.fromCharCode(A);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function So(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let A=0;return function(r){return Bo(r)?(e.enter(n),i(r)):t(r)};function i(r){return Bo(r)&&A++<o?(e.consume(r),i):(e.exit(n),t(r))}}const To={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),So(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):xo(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const Io={tokenize:function(e){const t=this,n=[];let r,o,A,i=0;return a;function a(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,l,s)(r)}return s(r)}function l(e){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,A=n;for(;A--;)if("exit"===t.events[A][0]&&"chunkFlow"===t.events[A][1].type){o=t.events[A][1].end;break}m(i);let a=n;for(;a<t.events.length;)t.events[a][1].end={...o},a++;return io(t.events,A+1,0,t.events.slice(n)),t.events.length=a,s(e)}return a(e)}function s(o){if(i===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return f(o);t.interrupt=!(!r.currentConstruct||r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Qo,c,u)(o)}function c(e){return r&&v(),m(i),d(e)}function u(e){return t.parser.lazy[t.now().line]=i!==n.length,A=t.now().offset,f(e)}function d(n){return t.containerState={},e.attempt(Qo,p,f)(n)}function p(e){return i++,n.push([t.currentConstruct,t.containerState]),d(e)}function f(n){return null===n?(r&&v(),m(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),m(0),void e.consume(n)):xo(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(n),h)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<A&&(!r.events[e][1].end||r.events[e][1].end.offset>A))return;const n=t.events.length;let o,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){a=t.events[l][1].end;break}o=!0}for(m(i),e=n;e<t.events.length;)t.events[e][1].end={...a},e++;io(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function m(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Qo={tokenize:function(e,t,n){return So(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Mo(e){return null===e||Eo(e)||Do(e)?1:Po(e)?2:void 0}function Oo(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const A=e[o].resolveAll;A&&!r.includes(A)&&(t=A(t,n),r.push(A))}return t}const Lo={name:"attention",resolveAll:function(e,t){let n,r,o,A,i,a,l,s,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};No(u,-a),No(d,a),A={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...A.start},end:{...i.end}},e[n][1].end={...A.start},e[c][1].start={...i.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=ao(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=ao(l,[["enter",r,t],["enter",A,t],["exit",A,t],["enter",o,t]]),l=ao(l,Oo(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=ao(l,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(s=2,l=ao(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):s=0,io(e,n-1,c-n+3,l),c=n+l.length-s-2;break}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Mo(r);let A;return function(t){return A=t,e.enter("attentionSequence"),i(t)};function i(a){if(a===A)return e.consume(a),i;const l=e.exit("attentionSequence"),s=Mo(a),c=!s||2===s&&o||n.includes(a),u=!o||2===o&&s||n.includes(r);return l._open=!!(42===A?c:c&&(o||!u)),l._close=!!(42===A?u:u&&(s||!c)),t(a)}}};function No(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ho={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return ho(t)?(e.consume(t),A):64===t?n(t):l(t)}function A(e){return 43===e||45===e||46===e||go(e)?(r=1,i(e)):l(e)}function i(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||go(t))&&r++<32?(e.consume(t),i):(r=0,l(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||vo(r)?n(r):(e.consume(r),a)}function l(t){return 64===t?(e.consume(t),s):mo(t)?(e.consume(t),l):n(t)}function s(e){return go(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,s):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||go(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const Ro={partial:!0,tokenize:function(e,t,n){return function(t){return Bo(t)?So(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||xo(e)?t(e):n(e)}}};const zo={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return Bo(t)?So(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(zo,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return Bo(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Fo={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return yo(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const jo={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,A,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,A=go,s(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,A=wo,s):(e.enter("characterReferenceValue"),o=7,A=bo,s(t))}function s(a){if(59===a&&i){const o=e.exit("characterReferenceValue");return A!==go||Ao(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return A(a)&&i++<o?(e.consume(a),s):n(a)}}};const Uo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},qo={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return i;function i(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),Bo(t)?So(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===A?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===A?(o++,e.consume(t),c):o>=a?(e.exit("codeFencedFenceSequence"),Bo(t)?So(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||xo(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let A,i=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,A=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===A?(a++,e.consume(t),l):a<3?n(t):(e.exit("codeFencedFenceSequence"),Bo(t)?So(e,s,"whitespace")(t):s(t))}function s(n){return null===n||xo(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(Uo,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||xo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(t)):Bo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),So(e,u,"whitespace")(t)):96===t&&t===A?n(t):(e.consume(t),c)}function u(t){return null===t||xo(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||xo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(t)):96===t&&t===A?n(t):(e.consume(t),d)}function p(t){return e.attempt(o,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&Bo(t)?So(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||xo(t)?e.check(Uo,p,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||xo(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const Yo={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),So(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?A(e):n(e)}function A(t){return null===t?a(t):xo(t)?e.attempt(Go,A,a)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||xo(t)?(e.exit("codeFlowValue"),A(t)):(e.consume(t),i)}function a(n){return e.exit("codeIndented"),t(n)}}},Go={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):xo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):So(e,A,"linePrefix",5)(t)}function A(e){const A=r.events[r.events.length-1];return A&&"linePrefix"===A[1].type&&A[2].sliceSerialize(A[1],!0).length>=4?t(e):xo(e)?o(e):n(e)}}};const _o={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,A=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),i(t)};function i(t){return 96===t?(e.consume(t),A++,i):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,s(t)):xo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||xo(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function s(n){return 96===n?(e.consume(n),r++,s):r===A?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class Wo{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Vo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Vo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Vo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Vo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Vo(this.left,t.reverse())}}}function Vo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xo(e){const t={};let n,r,o,A,i,a,l,s=-1;const c=new Wo(e);for(;++s<c.length;){for(;s in t;)s=t[s];if(n=c.get(s),s&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(s-1)[1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Ko(c,s)),s=t[s],l=!0);else if(n[1]._container){for(o=s,r=void 0;o--;)if(A=c.get(o),"lineEnding"===A[1].type||"lineEndingBlank"===A[1].type)"enter"===A[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),A[1].type="lineEnding",r=o);else if("linePrefix"!==A[1].type)break;r&&(n[1].end={...c.get(r)[1].start},i=c.slice(r,s),i.unshift(n),c.splice(r,s-r+1,i))}}return io(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Ko(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const A=[],i=n._tokenizer||r.parser[n.contentType](n.start),a=i.events,l=[],s={};let c,u,d=-1,p=n,f=0,h=0;const g=[h];for(;p;){for(;e.get(++o)[1]!==p;);A.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),u&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=n;++d<a.length;)"exit"===a[d][0]&&"enter"===a[d-1][0]&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(h=d+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),d=g.length;d--;){const t=a.slice(g[d],g[d+1]),n=A.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),d=-1;++d<l.length;)s[f+l[d][0]]=f+l[d][1],f+=l[d][1]-l[d][0]-1;return s}const Jo={resolve:function(e){return Xo(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):xo(t)?e.check(Zo,A,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function A(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},Zo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),So(e,o,"linePrefix")};function o(o){if(null===o||xo(o))return n(o);const A=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&A&&"linePrefix"===A[1].type&&A[2].sliceSerialize(A[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function $o(e,t,n,r,o,A,i,a,l){const s=l||Number.POSITIVE_INFINITY;let c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(A),e.consume(t),e.exit(A),u):null===t||32===t||41===t||vo(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(A),e.consume(n),e.exit(A),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(a),u(t)):null===t||60===t||xo(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(o){return c||null!==o&&41!==o&&!Eo(o)?c<s&&40===o?(e.consume(o),c++,f):41===o?(e.consume(o),c--,f):null===o||32===o||40===o||vo(o)?n(o):(e.consume(o),92===o?h:f):(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function eA(e,t,n,r,o,A){const i=this;let a,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(A),s};function s(u){return l>999||null===u||91===u||93===u&&!a||94===u&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):93===u?(e.exit(A),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):xo(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||xo(t)||l++>999?(e.exit("chunkString"),s(t)):(e.consume(t),a||(a=!Bo(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function tA(e,t,n,r,o,A){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,a):n(t)};function a(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(A),l(n))}function l(t){return t===i?(e.exit(A),a(i)):null===t?n(t):xo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),So(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(t))}function s(t){return t===i||null===t||xo(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:s)}function c(t){return t===i||92===t?(e.consume(t),s):s(t)}}function nA(e,t){let n;return function r(o){return xo(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Bo(o)?So(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const rA={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return eA.call(r,e,A,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function A(t){return o=fo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return Eo(t)?nA(e,a)(t):a(t)}function a(t){return $o(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(oA,s,s)(t)}function s(t){return Bo(t)?So(e,c,"whitespace")(t):c(t)}function c(A){return null===A||xo(A)?(e.exit("definition"),r.parser.defined.push(o),t(A)):n(A)}}},oA={partial:!0,tokenize:function(e,t,n){return function(t){return Eo(t)?nA(e,r)(t):n(t)};function r(t){return tA(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return Bo(t)?So(e,A,"whitespace")(t):A(t)}function A(e){return null===e||xo(e)?t(e):n(e)}}};const AA={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return xo(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const iA={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,A=3;return"whitespace"===e[A][1].type&&(A+=2),o-2>A&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(A===o-1||o-4>A&&"whitespace"===e[o-2][1].type)&&(o-=A+1===o?2:4),o>A&&(n={type:"atxHeadingText",start:e[A][1].start,end:e[o][1].end},r={type:"chunkText",start:e[A][1].start,end:e[o][1].end,contentType:"text"},io(e,A,o-A+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||Eo(t)?(e.exit("atxHeadingSequence"),A(t)):n(t)}function A(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||xo(n)?(e.exit("atxHeading"),t(n)):Bo(n)?So(e,A,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),A(t))}function a(t){return null===t||35===t||Eo(t)?(e.exit("atxHeadingText"),A(t)):(e.consume(t),a)}}};const aA=["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"],lA=["pre","script","style","textarea"],sA={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){const r=this;let o,A,i,a,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),s}(t)};function s(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),A=!0,p):63===a?(e.consume(a),o=3,r.interrupt?t:O):ho(a)?(e.consume(a),i=String.fromCharCode(a),f):n(a)}function c(A){return 45===A?(e.consume(A),o=2,u):91===A?(e.consume(A),o=5,a=0,d):ho(A)?(e.consume(A),o=4,r.interrupt?t:O):n(A)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const A="CDATA[";return o===A.charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:D:d):n(o)}function p(t){return ho(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||Eo(a)){const l=47===a,s=i.toLowerCase();return l||A||!lA.includes(s)?aA.includes(i.toLowerCase())?(o=6,l?(e.consume(a),h):r.interrupt?t(a):D(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):A?g(a):m(a)):(o=1,r.interrupt?t(a):D(a))}return 45===a||go(a)?(e.consume(a),i+=String.fromCharCode(a),f):n(a)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:D):n(o)}function g(t){return Bo(t)?(e.consume(t),g):B(t)}function m(t){return 47===t?(e.consume(t),B):58===t||95===t||ho(t)?(e.consume(t),v):Bo(t)?(e.consume(t),m):B(t)}function v(t){return 45===t||46===t||58===t||95===t||go(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),w):Bo(t)?(e.consume(t),b):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,y):Bo(t)?(e.consume(t),w):x(t)}function y(t){return t===l?(e.consume(t),l=null,E):null===t||xo(t)?n(t):(e.consume(t),y)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Eo(t)?b(t):(e.consume(t),x)}function E(e){return 47===e||62===e||Bo(e)?m(e):n(e)}function B(t){return 62===t?(e.consume(t),P):n(t)}function P(t){return null===t||xo(t)?D(t):Bo(t)?(e.consume(t),P):n(t)}function D(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),I):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!xo(t)||6!==o&&7!==o?null===t||xo(t)?(e.exit("htmlFlowData"),k(t)):(e.consume(t),D):(e.exit("htmlFlowData"),e.check(cA,N,k)(t))}function k(t){return e.check(uA,C,N)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||xo(t)?k(t):(e.enter("htmlFlowData"),D(t))}function T(t){return 45===t?(e.consume(t),O):D(t)}function I(t){return 47===t?(e.consume(t),i="",Q):D(t)}function Q(t){if(62===t){const n=i.toLowerCase();return lA.includes(n)?(e.consume(t),L):D(t)}return ho(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),Q):D(t)}function M(t){return 93===t?(e.consume(t),O):D(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):D(t)}function L(t){return null===t||xo(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),L)}function N(n){return e.exit("htmlFlow"),t(n)}}},cA={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Ro,t,n)}}},uA={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return xo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const dA={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,A,i;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),v):ho(t)?(e.consume(t),E):n(t)}function l(t){return 45===t?(e.consume(t),s):91===t?(e.consume(t),A=0,p):ho(t)?(e.consume(t),m):n(t)}function s(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):xo(t)?(i=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?I(e):45===e?u(e):c(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(A++)?(e.consume(t),6===A?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):xo(t)?(i=f,Q(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?I(t):93===t?(e.consume(t),g):f(t)}function m(t){return null===t||62===t?I(t):xo(t)?(i=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):xo(t)?(i=v,Q(t)):(e.consume(t),v)}function b(e){return 62===e?I(e):v(e)}function w(t){return ho(t)?(e.consume(t),y):n(t)}function y(t){return 45===t||go(t)?(e.consume(t),y):x(t)}function x(t){return xo(t)?(i=x,Q(t)):Bo(t)?(e.consume(t),x):I(t)}function E(t){return 45===t||go(t)?(e.consume(t),E):47===t||62===t||Eo(t)?B(t):n(t)}function B(t){return 47===t?(e.consume(t),I):58===t||95===t||ho(t)?(e.consume(t),P):xo(t)?(i=B,Q(t)):Bo(t)?(e.consume(t),B):I(t)}function P(t){return 45===t||46===t||58===t||95===t||go(t)?(e.consume(t),P):D(t)}function D(t){return 61===t?(e.consume(t),k):xo(t)?(i=D,Q(t)):Bo(t)?(e.consume(t),D):B(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,C):xo(t)?(i=k,Q(t)):Bo(t)?(e.consume(t),k):(e.consume(t),S)}function C(t){return t===o?(e.consume(t),o=void 0,T):null===t?n(t):xo(t)?(i=C,Q(t)):(e.consume(t),C)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Eo(t)?B(t):(e.consume(t),S)}function T(e){return 47===e||62===e||Eo(e)?B(e):n(e)}function I(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return Bo(t)?So(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}};const pA={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&io(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,A,i=e.length,a=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(o=i);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[o-2][1].start}};return A=[["enter",l,t],["enter",s,t]],A=ao(A,e.slice(r+1,r+a+3)),A=ao(A,[["enter",c,t]]),A=ao(A,Oo(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),A=ao(A,[["exit",c,t],e[o-2],e[o-1],["exit",s,t]]),A=ao(A,e.slice(o+1)),A=ao(A,[["exit",l,t]]),io(e,r,e.length,A),e},tokenize:function(e,t,n){const r=this;let o,A,i=r.events.length;for(;i--;)if(("labelImage"===r.events[i][1].type||"labelLink"===r.events[i][1].type)&&!r.events[i][1]._balanced){o=r.events[i][1];break}return function(t){return o?o._inactive?c(t):(A=r.parser.defined.includes(fo(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(fA,s,A?s:c)(t):91===t?e.attempt(hA,s,A?l:c)(t):A?s(t):c(t)}function l(t){return e.attempt(gA,s,c)(t)}function s(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},fA={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return Eo(t)?nA(e,o)(t):o(t)}function o(t){return 41===t?s(t):$o(e,A,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function A(t){return Eo(t)?nA(e,a)(t):s(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?tA(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):s(t)}function l(t){return Eo(t)?nA(e,s)(t):s(t)}function s(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},hA={tokenize:function(e,t,n){const r=this;return function(t){return eA.call(r,e,o,A,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(fo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function A(e){return n(e)}}},gA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const mA={name:"labelStartImage",resolveAll:pA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),A):n(t)}function A(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const vA={name:"labelStartLink",resolveAll:pA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const bA={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),So(e,t,"linePrefix")}}};const wA={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,A(e)}(t)};function A(A){return A===r?(e.enter("thematicBreakSequence"),i(A)):o>=3&&(null===A||xo(A))?(e.exit("thematicBreak"),t(A)):n(A)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),Bo(t)?So(e,A,"whitespace")(t):A(t))}}};const yA={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ro,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,So(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!Bo(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(EA,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,So(e,e.attempt(yA,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let A=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:bo(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(wA,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return bo(t)&&++i<10?(e.consume(t),a):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Ro,r.interrupt?n:s,e.attempt(xA,u,c))}function s(e){return r.containerState.initialBlankLine=!0,A++,u(e)}function c(t){return Bo(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=A+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},xA={partial:!0,tokenize:function(e,t,n){const r=this;return So(e,function(e){const o=r.events[r.events.length-1];return!Bo(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},EA={partial:!0,tokenize:function(e,t,n){const r=this;return So(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const BA={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,A=e.length;for(;A--;)if("enter"===e[A][0]){if("content"===e[A][1].type){n=A;break}"paragraph"===e[A][1].type&&(r=A)}else"content"===e[A][1].type&&e.splice(A,1),!o&&"definition"===e[A][1].type&&(o=A);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let i,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){i="paragraph"===r.events[a][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!i?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),A(t)}(t))};function A(t){return t===o?(e.consume(t),A):(e.exit("setextHeadingLineSequence"),Bo(t)?So(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||xo(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const PA={tokenize:function(e){const t=this,n=e.attempt(Ro,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,So(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Jo,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const DA={resolveAll:TA()},kA=SA("string"),CA=SA("text");function SA(e){return{resolveAll:TA("text"===e?IA:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,A,i);return A;function A(e){return l(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function TA(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):(!t[o]||"data"!==t[o][1].type)&&(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function IA(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let A,i=o.length,a=-1,l=0;for(;i--;){const e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)l++,a--;if(a)break;a=-1}else if(-2===e)A=!0,l++;else if(-1!==e){i++;break}}if(l){const o={type:n===e.length||A||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const QA={42:yA,43:yA,45:yA,48:yA,49:yA,50:yA,51:yA,52:yA,53:yA,54:yA,55:yA,56:yA,57:yA,62:zo},MA={91:rA},OA={[-2]:Yo,[-1]:Yo,32:Yo},LA={35:iA,42:wA,45:[BA,wA],60:sA,61:BA,95:wA,96:qo,126:qo},NA={38:jo,92:Fo},HA={[-5]:bA,[-4]:bA,[-3]:bA,33:mA,38:jo,42:Lo,60:[Ho,dA],91:vA,92:[AA,Fo],93:pA,95:Lo,96:_o},RA={null:[Lo,DA]},zA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:MA,disable:{null:[]},document:QA,flow:LA,flowInitial:OA,insideSpan:RA,string:NA,text:HA},Symbol.toStringTag,{value:"Module"}));function FA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},A=[];let i=[],a=[];const l={attempt:h(function(e,t){g(e,t.from)}),check:h(f),consume:function(e){xo(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),s.events.push(["enter",n,s]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=d(),s.events.push(["exit",t,s]),t},interrupt:h(f,{interrupt:!0})},s={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,m()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const A=e[n];let i;if("string"==typeof A)i=A;else switch(A){case-5:i="\r";break;case-4:i="\n";break;case-3:i="\r\n";break;case-2:i=t?" ":"\t";break;case-1:if(!t&&o)continue;i=" ";break;default:i=String.fromCharCode(A)}o=-2===A,r.push(i)}return r.join("")}(u(e),t)},sliceStream:u,write:function(e){return i=ao(i,e),function(){let e;for(;r._index<i.length;){const t=i[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}(),null!==i[i.length-1]?[]:(g(t,0),s.events=Oo(A,s.events,s),s.events)}};let c=t.tokenize.call(s,l);return t.resolveAll&&A.push(t),s;function u(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,A=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,A)];else{if(i=e.slice(n,o),r>-1){const e=i[0];"string"==typeof e?i[0]=e.slice(r):i.shift()}A>0&&i.push(e[o].slice(0,A))}return i}(i,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:A}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:A}}function p(e){c=c(e)}function f(e,t){t.restore()}function h(e,t){return function(n,o,A){let i,c,u,p;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return i=e,c=0,0===e.length?A:h(e[c])}function h(e){return function(n){return p=function(){const e=d(),t=s.previous,n=s.currentConstruct,o=s.events.length,A=Array.from(a);return{from:o,restore:i};function i(){r=e,s.previous=t,s.currentConstruct=n,s.events.length=o,a=A,m()}}(),u=e,e.partial||(s.currentConstruct=e),e.name&&s.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(s),t):s,l,g,v)(n)}}function g(t){return e(u,p),o}function v(e){return p.restore(),++c<i.length?h(i[c]):A}}}function g(e,t){e.resolveAll&&!A.includes(e)&&A.push(e),e.resolve&&io(s.events,t,s.events.length-t,e.resolve(s.events.slice(t),s)),e.resolveTo&&(s.events=e.resolveTo(s.events,s))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const jA=/[\0\t\n\r]/g;const UA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function qA(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return po(n.slice(t?2:1),t?16:10)}return Ao(n)||e}const YA={}.hasOwnProperty;function GA(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:A(te),autolinkProtocol:P,autolinkEmail:P,atxHeading:A(J),blockQuote:A(_),characterEscape:P,characterReference:P,codeFenced:A(W),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:A(W,i),codeText:A(V,i),codeTextData:P,data:P,codeFlowValue:P,definition:A(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:A(K),hardBreakEscape:A(Z),hardBreakTrailing:A(Z),htmlFlow:A($,i),htmlFlowData:P,htmlText:A($,i),htmlTextData:P,image:A(ee),label:i,link:A(te),listItem:A(re),listItemValue:d,listOrdered:A(ne,u),listUnordered:A(ne),paragraph:A(oe),reference:z,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:A(J),strong:A(Ae),thematicBreak:A(ae)},exit:{atxHeading:l(),atxHeadingSequence:y,autolink:l(),autolinkEmail:G,autolinkProtocol:Y,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:j,characterReferenceMarkerNumeric:j,characterReferenceValue:U,characterReference:q,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:D,codeIndented:l(m),codeText:l(I),codeTextData:D,data:D,definition:l(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(C),hardBreakTrailing:l(C),htmlFlow:l(S),htmlFlowData:D,htmlText:l(T),htmlTextData:D,image:l(M),label:L,labelText:O,lineEnding:k,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:F,resourceDestinationString:N,resourceTitleString:H,resource:R,setextHeading:l(B),setextHeadingLineSequence:E,setextHeadingText:x,strong:l(),thematicBreak:l()}};WA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const A={stack:[r],tokenStack:[],config:t,enter:a,exit:s,buffer:i,resume:c,data:n},l=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])l.push(u);else{u=o(e,l.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];YA.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},A),e[u][1])}if(A.tokenStack.length>0){const e=A.tokenStack[A.tokenStack.length-1];(e[1]||XA).call(A,void 0,e[0])}for(r.position={start:_A(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:_A(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,A,i,a=t-1,l=-1,s=!1;for(;++a<=n;){const t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(r&&!i&&!l&&!A&&(A=a),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=a;for(o=void 0;i--;){const t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",s=!0),t[1].type="lineEnding",o=i}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}A&&(!o||A<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||a,0,["exit",r,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(a,0,["enter",o,t[2]]),a++,n++,A=void 0,i=!0}}}return e[t][1]._spread=s,n}function A(e,t){return n;function n(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:_A(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Ir({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||XA).call(this,e,r[0])),n.position.end=_A(e.end)}function c(){return function(e){return no(e,"boolean"!=typeof to.includeImageAlt||to.includeImageAlt,"boolean"!=typeof to.includeHtml||to.includeHtml)}(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=fo(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function y(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];(!n||"text"!==n.type)&&(n=ie(),n.position={start:_A(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=_A(e.end)}function k(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=_A(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(P.call(this,e),D.call(this,e))}function C(){this.data.atHardBreak=!0}function S(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(UA,qA)}(t),n.identifier=fo(t).toLowerCase()}function L(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function N(){const e=this.resume();this.stack[this.stack.length-1].url=e}function H(){const e=this.resume();this.stack[this.stack.length-1].title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function F(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=fo(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function j(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=po(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Ao(t);this.stack[this.stack.length-1].value+=r}function q(e){this.stack.pop().position.end=_A(e.end)}function Y(e){D.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function G(e){D.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function _(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function V(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function Ae(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Xo(e););return e}(function(e){const t={constructs:so([zA,...(e||{}).extensions||[]]),content:n(To),defined:[],document:n(Io),flow:n(PA),lazy:{},string:n(kA),text:n(CA)};return t;function n(e){return function(n){return FA(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,A,i){const a=[];let l,s,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(A||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(jA.lastIndex=c,l=jA.exec(o),u=l&&void 0!==l.index?l.index:o.length,d=o.charCodeAt(u),!l){n=o.slice(c);break}if(10===d&&c===u&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),c<u&&(a.push(o.slice(c,u)),t+=u-c),d){case 0:a.push(65533),t++;break;case 9:for(s=4*Math.ceil(t/4),a.push(-2);t++<s;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return i&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))}function _A(e){return{line:e.line,column:e.column,offset:e.offset}}function WA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?WA(e,r):VA(e,r)}}function VA(e,t){let n;for(n in t)if(YA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function XA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ir({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ir({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ir({start:t.start,end:t.end})+") is still open")}function KA(e){const t=this;t.parser=function(n){return GA(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function JA(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),A=o[0];A&&"text"===A.type?A.value="["+A.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function ZA(e){return e.spread??e.children.length>1}function $A(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const A=[];for(;r;)A.push(ei(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return A.push(ei(t.slice(o),o>0,!1)),A.join("")}function ei(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const ti={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Co(r.toLowerCase()),A=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);void 0===a?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=A+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,l);const s={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,s),e.applyData(t,s)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return JA(e,t);const o={src:Co(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const A={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,A),e.applyData(t,A)},image:function(e,t){const n={src:Co(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return JA(e,t);const o={href:Co(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const A={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,A),e.applyData(t,A)},link:function(e,t){const n={href:Co(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ZA(n[r])}return t}(n):ZA(t),A={},i=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),A.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const e=r[a];(o||0!==a||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?i.push(e):i.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&i.push({type:"text",value:"\n"});const s={type:"element",tagName:"li",properties:A,children:i};return e.patch(t,s),e.applyData(t,s)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const A={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,A),e.applyData(t,A)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},A=Sr(t.children[1]),i=Cr(t.children[t.children.length-1]);A&&i&&(r.position={start:A,end:i}),o.push(r)}const A={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,A),e.applyData(t,A)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",A=n&&"table"===n.type?n.align:void 0,i=A?A.length:t.children.length;let a=-1;const l=[];for(;++a<i;){const n=t.children[a],r={},i=A?A[a]:void 0;i&&(r.align=i);let s={type:"element",tagName:o,properties:r,children:[]};n&&(s.children=e.all(n),e.patch(n,s),s=e.applyData(n,s)),l.push(s)}const s={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,s),e.applyData(t,s)},text:function(e,t){const n={type:"text",value:$A(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:ni,yaml:ni,definition:ni,footnoteDefinition:ni};function ni(){}const ri="object"==typeof self?self:globalThis,oi=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[A,i]=t[o];switch(A){case 0:case-1:return n(i,o);case 1:{const e=n([],o);for(const t of i)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),o);case 4:{const{source:e,flags:t}=i;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of i)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of i)e.add(r(t));return e}case 7:{const{name:e,message:t}=i;return n(new ri[e](t),o)}case 8:return n(BigInt(i),o);case"BigInt":return n(Object(BigInt(i)),o);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{const{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new ri[A](i),o)};return r})(new Map,e)(0),Ai="",{toString:ii}={},{keys:ai}=Object,li=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=ii.call(e).slice(8,-1);switch(n){case"Array":return[1,Ai];case"Object":return[2,Ai];case"Date":return[3,Ai];case"RegExp":return[4,Ai];case"Map":return[5,Ai];case"Set":return[6,Ai];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},si=([e,t])=>0===e&&("function"===t||"symbol"===t),ci=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},A=r=>{if(n.has(r))return n.get(r);let[i,a]=li(r);switch(i){case 0:{let t=r;switch(a){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return o([-1],r)}return o([i,t],r)}case 1:{if(a){let e=r;return"DataView"===a?e=new Uint8Array(r.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(r)),o([a,[...e]],r)}const e=[],t=o([i,e],r);for(const t of r)e.push(A(t));return t}case 2:{if(a)switch(a){case"BigInt":return o([a,r.toString()],r);case"Boolean":case"Number":case"String":return o([a,r.valueOf()],r)}if(t&&"toJSON"in r)return A(r.toJSON());const n=[],l=o([i,n],r);for(const t of ai(r))(e||!si(li(r[t])))&&n.push([A(t),A(r[t])]);return l}case 3:return o([i,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([i,{source:e,flags:t}],r)}case 5:{const t=[],n=o([i,t],r);for(const[n,o]of r)(e||!si(li(n))&&!si(li(o)))&&t.push([A(n),A(o)]);return n}case 6:{const t=[],n=o([i,t],r);for(const n of r)(e||!si(li(n)))&&t.push(A(n));return n}}const{message:l}=r;return o([i,{name:a,message:l}],r)};return A})(!(t||n),!!t,new Map,r)(e),r},ui="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?oi(ci(e,t)):structuredClone(e):(e,t)=>oi(ci(e,t));function di(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function pi(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const fi=function(e){if(null==e)return gi;if("function"==typeof e)return hi(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fi(e[n]);return hi(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return hi(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return hi(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function hi(e){return function(t,n,r){return!(!function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)||!e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function gi(){return!0}const mi=[],vi=!0,bi=!1;function wi(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const A=fi(o),i=r?-1:1;!function e(o,a,l){const s=o&&"object"==typeof o?o:{};if("string"==typeof s.type){const e="string"==typeof s.tagName?s.tagName:"string"==typeof s.name?s.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let s,c,u,d=mi;if((!t||A(o,a,l[l.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[vi,e]:null==e?mi:[e]}(n(o,l)),d[0]===bi))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+i,u=l.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(s=e(n,c,u)(),s[0]===bi)return s;c="number"==typeof s[1]?s[1]:c+i}}return d}}(e,void 0,[])()}function yi(e,t,n,r){let o,A,i;"function"==typeof t?(A=void 0,i=t,o=n):(A=t,i=n,o=r),wi(e,A,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return i(e,r,n)},o)}const xi={}.hasOwnProperty,Ei={};function Bi(e,t){const n=t||Ei,r=new Map,o=new Map,A=new Map,i={...ti,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=a.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=Si(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=Si(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:Di,definitionById:r,footnoteById:o,footnoteCounts:A,footnoteOrder:[],handlers:i,one:function(e,t){const n=e.type,r=a.handlers[n];if(xi.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=ui(n);return r.children=a.all(e),r}return ui(e)}return(a.options.unknownHandler||ki)(a,e,t)},options:n,patch:Pi,wrap:Ci};return yi(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a}function Pi(e,t){e.position&&(t.position=function(e){const t=Sr(e),n=Cr(e);if(t&&n)return{start:t,end:n}}(e))}function Di(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,ui(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function ki(e,t){const n=t.data||{},r=!("value"in t)||xi.call(n,"hProperties")||xi.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function Ci(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function Si(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ti(e,t){const n=Bi(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||di,r=e.options.footnoteBackLabel||pi,o=e.options.footnoteLabel||"Footnotes",A=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const A=e.all(o),i=String(o.identifier).toUpperCase(),s=Co(i.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(i);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=A[A.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else A.push(...u);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+s},children:e.wrap(A,!0)};e.patch(o,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:A,properties:{...ui(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(n),A=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&A.children.push({type:"text",value:"\n"},o),A}function Ii(e,t){return e&&"run"in e?async function(n,r){const o=Ti(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ti(n,{file:r,...e||t})}}function Qi(e){if(e)throw e}var Mi,Oi;var Li=function(){if(Oi)return Mi;Oi=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},A=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),A=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!A)return!1;for(r in n);return typeof r>"u"||e.call(n,r)},i=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Mi=function e(){var t,n,r,l,s,c,u=arguments[0],d=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<p;++d)if(null!=(t=arguments[d]))for(n in t)r=a(u,n),u!==(l=a(t,n))&&(f&&l&&(A(l)||(s=o(l)))?(s?(s=!1,c=r&&o(r)?r:[]):c=r&&A(r)?r:{},i(u,{name:n,newValue:e(f,c,l)})):typeof l<"u"&&i(u,{name:n,newValue:l}));return u},Mi}();const Ni=wr(Li);function Hi(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Ri(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(A,...i){const a=e[++n];let l=-1;if(A)r(A);else{for(;++l<t.length;)(null===i[l]||void 0===i[l])&&(i[l]=t[l]);t=i,a?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let i;r&&t.push(o);try{i=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(i&&i.then&&"function"==typeof i.then?i.then(A,o):i instanceof Error?o(i):A(i))}function o(e,...r){n||(n=!0,t(e,...r))}function A(e){o(null,e)}}(a,o)(...i):r(null,...i)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const zi={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Fi(e);let n,r=0,o=-1,A=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else o<0&&(n=!0,o=A+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,a=t.length-1;for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else i<0&&(n=!0,i=A+1),a>-1&&(e.codePointAt(A)===t.codePointAt(a--)?a<0&&(o=A):(a=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(Fi(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Fi(e);let t,n=e.length,r=-1,o=0,A=-1,i=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?A<0?A=n:1!==i&&(i=1):A>-1&&(i=-1);else if(t){o=n+1;break}}return A<0||r<0||0===i||1===i&&A===r-1&&A===o+1?"":e.slice(A,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Fi(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Fi(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",A=0,i=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(i!==l-1&&1!==a)if(i!==l-1&&2===a){if(o.length<2||2!==A||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",A=0):(o=o.slice(0,r),A=o.length-1-o.lastIndexOf("/")),i=l,a=0;continue}}else if(o.length>0){o="",A=0,i=l,a=0;continue}t&&(o=o.length>0?o+"/..":"..",A=2)}else o.length>0?o+="/"+e.slice(i+1,l):o=e.slice(i+1,l),A=l-i-1;i=l,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0===n.length&&!t&&(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function Fi(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ji={cwd:function(){return"/"}};function Ui(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function qi(e){if("string"==typeof e)e=new URL(e);else if(!Ui(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Yi=["history","path","basename","stem","extname","dirname"];class Gi{constructor(e){let t;var n;t=e?Ui(e)?{path:e}:"string"==typeof e||(n=e)&&"object"==typeof n&&"byteLength"in n&&"byteOffset"in n?{value:e}:e:{},this.cwd="cwd"in t?"":ji.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<Yi.length;){const e=Yi[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)Yi.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?zi.basename(this.path):void 0}set basename(e){Wi(e,"basename"),_i(e,"basename"),this.path=zi.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?zi.dirname(this.path):void 0}set dirname(e){Vi(this.basename,"dirname"),this.path=zi.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?zi.extname(this.path):void 0}set extname(e){if(_i(e,"extname"),Vi(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zi.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ui(e)&&(e=qi(e)),Wi(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?zi.basename(this.path,this.extname):void 0}set stem(e){Wi(e,"stem"),_i(e,"stem"),this.path=zi.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Lr(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function _i(e,t){if(e&&e.includes(zi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zi.sep+"`")}function Wi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vi(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Xi=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Ki={}.hasOwnProperty;class Ji extends Xi{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=Ri()}copy(){const e=new Ji;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Ni(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(ta("data",this.frozen),this.namespace[e]=t,this):Ki.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ta("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=oa(e),n=this.parser||this.Parser;return $i("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),$i("process",this.parser||this.Parser),ea("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const A=oa(e),i=n.parse(A);function a(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(i,A,function(e,t,r){if(e||!t||!r)return a(e);const o=t,A=n.stringify(o,r);var i;"string"==typeof(i=A)||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(i)?r.value=A:r.result=A,a(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),$i("processSync",this.parser||this.Parser),ea("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,Qi(e),t=r}),ra("processSync","process",n),t}run(e,t,n){na(e),this.freeze();const r=this.transformers;return!n&&"function"==typeof t&&(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,A){const i=oa(t);r.run(e,i,function(t,r,i){const a=r||e;t?A(t):o?o(a):n(void 0,a,i)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){Qi(e),n=t,r=!0}),ra("runSync","run",r),n}stringify(e,t){this.freeze();const n=oa(t),r=this.compiler||this.Compiler;return ea("stringify",r),na(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(ta("use",this.frozen),null!=e)if("function"==typeof e)a(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?i(e):A(e)}return this;function o(e){if("function"==typeof e)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(t,n)}else A(e)}}function A(e){if(!("plugins"in e)&&!("settings"in e))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");i(e.plugins),e.settings&&(r.settings=Ni(!0,r.settings,e.settings))}function i(e){let t=-1;if(null!=e){if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function a(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...A]=t;const i=n[o][1];Hi(i)&&Hi(r)&&(r=Ni(!0,i,r)),n[o]=[e,r,...A]}}}}const Zi=(new Ji).freeze();function $i(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function ea(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function ta(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function na(e){if(!Hi(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function ra(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oa(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Gi(e)}const Aa=[],ia={allowDangerousHtml:!0},aa=/^(https?|ircs?|mailto|xmpp)$/i,la=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function sa(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,A=e.components,i=e.disallowedElements,a=e.rehypePlugins||Aa,l=e.remarkPlugins||Aa,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ia}:ia,c=e.skipHtml,u=e.unwrapDisallowed,d=e.urlTransform||ca,p=Zi().use(KA).use(l).use(Ii,s).use(a),f=new Gi;"string"==typeof r&&(f.value=r);for(const t of la)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const v=p.parse(f);let b=p.runSync(v,f);return o&&(b={type:"element",tagName:"div",properties:{className:o},children:"root"===b.type?b.children:[b]}),yi(b,function(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return c?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in eo)if(Object.hasOwn(eo,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=eo[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let A=t?!t.includes(e.tagName):!!i&&i.includes(e.tagName);if(!A&&n&&"number"==typeof r&&(A=!n(e,r,o)),A&&o&&"number"==typeof r)return u&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}}),qr(b,{Fragment:m,components:A,ignoreInvalidStyle:!0,jsx:h,jsxs:g,passKeys:!0,passNode:!0})}function ca(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||aa.test(e.slice(0,t))?e:""}const ua=({children:e})=>h("div",{style:{whiteSpace:"normal"},children:h(sa,{components:{p:({...e})=>h("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>h("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>h("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>h("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?h("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):h("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:h("code",{children:t})}),blockquote:({...e})=>h("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),da={autoConfig:!0},pa=e=>()=>(e=>{const{getFlow:t}=Zt(),{messages:n,replaceMessages:r}=$t(),{settings:o}=tn(),{hasChatHistoryLoaded:A}=nn(),i={...e,...da},a=i.markdownComponent?i.markdownComponent:ua;l(()=>{var e,t;if(A){const A=[...n];for(let n=0;n<A.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=A[n];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=a)}r(A)}},[A]);const s=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();((e,t,n)=>{var r;if("string"!=typeof e.data.message.content||!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderMarkdown)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)})(e,t(),r)&&(e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};en(X.PRE_INJECT_MESSAGE,s),en(X.CHUNK_STREAM_MESSAGE,s),en(X.START_STREAM_MESSAGE,s),en(X.START_SIMULATE_STREAM_MESSAGE,s);const c={name:"@rcb-plugins/markdown-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(e),fa={autoConfig:!0,promptBaseColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"},promptHoveredColors:{info:"#0056b3",warning:"#d39e00",error:"#c82333",success:"#218838"},textAreaHighlightColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"}},ha=(e,t,n="validateTextInput")=>{var r;if(null==(r=e.detail)||!r.currPath)return;const o=t[e.detail.currPath];if(!o)return;const A=o[n];return"function"==typeof A?A:void 0},ga=e=>{const{showToast:t}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=st();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:n}=Zt(),{styles:r,updateStyles:o,replaceStyles:A}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=Ut();return{styles:e,replaceStyles:t,updateStyles:n}})(),s=(e=>({...fa,...e,promptBaseColors:{...fa.promptBaseColors},promptHoveredColors:{...fa.promptHoveredColors},textAreaHighlightColors:{...fa.textAreaHighlightColors}}))(e),[c,u]=a(0),d=i({});en(X.USER_SUBMIT_TEXT,e=>{const A=e,i=ha(A,n(),"validateTextInput");if(!i)return;const a=i(A.data.inputText);if(null!=a&&a.success||e.preventDefault(),!a.promptContent)return;0===c&&(d.current=structuredClone(r));const l=((e,t)=>{const n=e.promptType??"info";let r={};return t.advancedStyles&&(r=t.advancedStyles[n]),t.promptBaseColors&&(r.toastPromptStyle={color:t.promptBaseColors[n],borderColor:t.promptBaseColors[n]}),t.promptHoveredColors&&(r.toastPromptHoveredStyle={color:t.promptHoveredColors[n],borderColor:t.promptHoveredColors[n]}),t.textAreaHighlightColors&&(e.highlightTextArea??!0)&&(r.chatInputAreaStyle={boxShadow:`${t.textAreaHighlightColors[n]} 0px 0px 5px`}),r})(a,s);o(l),t(a.promptContent,a.promptDuration??3e3),u(e=>e+1)}),en(X.USER_UPLOAD_FILE,e=>{var r,o;const A=e,i=null==(o=null==(r=A.data)?void 0:r.files)?void 0:o[0];if(!i)return console.error("No file uploaded."),void e.preventDefault();const a=ha(A,n(),"validateFileInput");if(!a)return void console.error("Validator not found for file input.");const l=a(i);if(!l.success)return console.error("Validation failed:",l),l.promptContent&&t(l.promptContent,l.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",l)}),en(X.DISMISS_TOAST,()=>{u(e=>e-1)}),l(()=>{0===c&&setTimeout(()=>{A(d.current)})},[c,A]);const p={name:"@rcb-plugins/input-validator"};return s.autoConfig&&(p.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),p},ma=n((e,t)=>{let{embedded:n,currentOpen:r,enabled:o,onSetEnabled:A}=e;const a=$t(),s=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=ne();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),c=i(null),u=i(!1);return l(()=>{!n&&s&&s.toggleChatWindow&&(c.current===r||u.current||(setTimeout(()=>{s&&s.toggleChatWindow&&s.toggleChatWindow(r)},0),c.current=r),u.current=!1)},[r,n,s]),l(()=>{const e=()=>{u.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),p(t,()=>({addMessage:e=>{a&&a.injectMessage&&a.injectMessage(e)},openChat:()=>{!n&&s&&s.toggleChatWindow&&s.toggleChatWindow(!0)},closeChat:()=>{!n&&s&&s.toggleChatWindow&&s.toggleChatWindow(!1)},toggleChat:()=>{!n&&s&&s.toggleChatWindow&&s.toggleChatWindow()},setBotEnabled:e=>{A&&A(e)}}),[a,s,n,A]),null});ma.displayName="BotController";const va=e=>{let{loginUrl:n,className:r="",style:o,isHeaderButton:A=!1}=e;const i=A?{display:"inline-block",padding:"6px 12px",backgroundColor:"transparent",border:"1px solid #ccc",color:"white",textDecoration:"none",borderRadius:"4px",fontWeight:"normal",textAlign:"center",margin:"8px",fontSize:"12px",opacity:.8,transition:"all 0.2s ease"}:{display:"inline-block",padding:"10px 20px",backgroundColor:"white",border:"1px solid var(--primaryColor, #107180)",color:"var(--primaryColor, #107180)",textDecoration:"none",borderRadius:"4px",fontWeight:"bold",textAlign:"center",margin:"18px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)"};return t.createElement(t.Fragment,null,A&&t.createElement("style",null,"\n .rcb-chat-header-container .qa-bot-header-login-button:hover {\n background-color: #0000001a !important;\n opacity: 1 !important;\n }\n "),t.createElement("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"qa-bot-login-button ".concat(A?"qa-bot-header-login-button":""," ").concat(r),style:Object.assign(Object.assign({},i),o)},"Log In"))},ba=()=>t.createElement("div",{className:"user-login-icon",style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"5px",display:"flex"},role:"img","aria-label":"User logged in",title:"User logged in"},t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},t.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.createElement("circle",{cx:"12",cy:"7",r:"4"})));function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wa.apply(null,arguments)}const ya=({width:e=24,height:n=24,color:r="currentColor",children:o,...A})=>t.createElement("svg",wa({xmlns:"http://www.w3.org/2000/svg",width:e,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},A),o),xa=e=>t.createElement(ya,e,t.createElement("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})),Ea=r(void 0),Ba=e=>{let{children:n,resetSession:r,clearResettingFlag:o}=e;return t.createElement(Ea.Provider,{value:{resetSession:r,clearResettingFlag:o}},n)},Pa=()=>{const{restartFlow:e}=Zt(),{setTextAreaValue:n}=(()=>{const{textAreaDisabled:e,toggleTextAreaDisabled:t,textAreaSensitiveMode:n,toggleTextAreaSensitiveMode:r,getTextAreaValue:o,setTextAreaValue:A,focusTextArea:i,blurTextArea:a}=At();return{textAreaDisabled:e,toggleTextAreaDisabled:t,textAreaSensitiveMode:n,toggleTextAreaSensitiveMode:r,getTextAreaValue:o,setTextAreaValue:A,focusTextArea:i,blurTextArea:a}})(),{resetSession:r,clearResettingFlag:A}=(()=>{const e=o(Ea);if(!e)throw new Error("useSession must be used within a SessionProvider");return e})();return t.createElement("button",{onClick:async()=>{r(),await n(""),await e(),setTimeout(()=>{A()},100)},tabIndex:0,"aria-label":"New chat conversation",style:{backgroundColor:"var(--primaryColor, #107180)",border:"none",color:"#ffffff",fontSize:"14px",cursor:"pointer",padding:"8px 12px",borderRadius:"4px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",fontWeight:"500"},onMouseEnter:e=>{e.target.style.backgroundColor="var(--secondaryColor, #0d5f6b)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--primaryColor, #107180)"}},t.createElement(xa,{width:16,height:16}),"New Chat")},Da=()=>(l(()=>{const e=e=>{if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(e.key))return;const n=document.activeElement;if(n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"true"===n.contentEditable||n.classList.contains("rcb-chat-input-textarea")))return;const r=document.querySelector(".rcb-chat-window");if(!r)return;const o=Array.from(r.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(o.length>0){const t=o[o.length-1].querySelector(".rcb-checkbox-container");if(t&&null!==t.offsetParent){const n=Array.from(t.querySelectorAll(".rcb-checkbox-row-container")),r=t.querySelector(".rcb-checkbox-next-button");if(n.length>0){const t=[...n];return r&&t.push(r),void((e,t)=>{e.preventDefault();let n=-1;for(let e=0;e<t.length;e++)if(t[e]===document.activeElement||t[e].contains(document.activeElement)){n=e;break}-1===n&&(n=0);let r=n;switch(e.key){case"ArrowDown":case"ArrowRight":r=n<t.length-1?n+1:0;break;case"ArrowUp":case"ArrowLeft":r=n>0?n-1:t.length-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;case"Enter":case" ":{const e=t[n],r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});return void e.dispatchEvent(r)}default:return}t[r].focus(),t[r].setAttribute("tabindex","0"),t[r].classList.add("keyboard-focused"),t.forEach((e,t)=>{t!==r&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))})})(e,t)}}}let A=[];if(o.length>0){const e=o[o.length-1],t=Array.from(e.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);if(t.length>0){const e=t[t.length-1];A=Array.from(e.querySelectorAll(".rcb-options"))}}if(0===A.length)return;const i=A.findIndex(e=>e===document.activeElement);switch(e.key){case"ArrowDown":case"ArrowRight":{let t;e.preventDefault(),t=i<A.length-1?i+1:0,A[t].setAttribute("tabindex","0"),A.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[t].classList.add("keyboard-focused"),A[t].focus();break}case"ArrowUp":case"ArrowLeft":{let t;e.preventDefault(),t=i>0?i-1:A.length-1,A[t].setAttribute("tabindex","0"),A.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[t].classList.add("keyboard-focused"),A[t].focus();break}case"Enter":case" ":if(e.preventDefault(),document.activeElement&&A.includes(document.activeElement)){const e=document.activeElement;if(e.classList.contains("rcb-checkbox-row-container")||e.closest(".rcb-checkbox-row-container")){const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.querySelector(".rcb-checkbox-label"),o=r?r.textContent:e.textContent||"checkbox",A=e.querySelector(".rcb-checkbox-mark"),i=A&&A.style.backgroundColor?"checked":"unchecked";t(`${o} ${i}`)}else{const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.textContent||e.innerText;t(`Selected: ${r}`)}}break;case"Home":e.preventDefault(),A.length>0&&(A[0].setAttribute("tabindex","0"),A.forEach((e,t)=>{0!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[0].classList.add("keyboard-focused"),A[0].focus());break;case"End":if(e.preventDefault(),A.length>0){const e=A.length-1;A[e].setAttribute("tabindex","0"),A.forEach((t,n)=>{n!==e&&(t.setAttribute("tabindex","-1"),t.classList.remove("keyboard-focused"))}),A[e].classList.add("keyboard-focused"),A[e].focus()}}},t=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>{document.body.contains(t)&&document.body.removeChild(t)},1e3)},n=(e=null)=>{let n=e;if(n||(n=document.querySelector(".rcb-chat-window"),n||(n=document.querySelector('[class*="rcb-chat"]')),n||(n=document.querySelector(".qa-bot"))),!n)return;const r=null!==n.closest(".embedded-qa-bot"),o=Array.from(n.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(0===o.length)return;const A=o[o.length-1],i=Array.from(A.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);let a=[];if(i.length>0){const e=i[i.length-1];a=Array.from(e.querySelectorAll(".rcb-options"))}if(0===a.length){let e=A.querySelector(".rcb-checkbox-container");if(!e&&n&&(e=n.querySelector(".rcb-checkbox-container")),e&&null!==e.offsetParent){const t=Array.from(e.querySelectorAll(".rcb-checkbox-row-container")).filter(e=>null!==e.offsetParent&&"none"!==e.style.display);if(t.length>0){const n=e.querySelector(".rcb-checkbox-next-button"),o=[...t];if(n&&null!==n.offsetParent&&o.push(n),o.forEach((e,t)=>{e.setAttribute("tabindex",0===t?"0":"-1"),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),t.length>1){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select/deselect, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}return void setTimeout(()=>{o[0]&&null!==o[0].offsetParent&&!r&&o[0].focus()},150)}}}if(a.length>0){if(a.forEach((e,t)=>{const n=0===t?"0":"-1";e.setAttribute("tabindex",n),e.setAttribute("role","option"),e.setAttribute("aria-posinset",t+1),e.setAttribute("aria-setsize",a.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),a.length>1){const e=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}}else{const e=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove())}}setTimeout(()=>{a[0]&&null!==a[0].offsetParent&&!r&&(a[0].focus(),a.length>1&&t(`${a.length} options available. Use arrow keys to navigate.`))},200)}},r=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type){const t=Array.from(e.addedNodes),r=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-options-container")||e.classList?.contains("rcb-options")||e.querySelector?.(".rcb-options-container")||e.querySelector?.(".rcb-options"))),o=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-checkbox-container")||e.querySelector?.(".rcb-checkbox-container")));if(r||o){let t=e.target;for(;t&&!t.classList?.contains("qa-bot")&&!t.classList?.contains("rcb-chat-window");)t=t.parentElement;(t||document).querySelectorAll(".rcb-options[tabindex], .rcb-checkbox-row-container[tabindex], .rcb-checkbox-next-button[tabindex]").forEach(e=>{e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused")}),setTimeout(()=>n(t),100)}}})});r.observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("keydown",e),n();const o=setInterval(()=>{document.querySelectorAll(".qa-bot").forEach(e=>{const t=e.querySelectorAll(".rcb-options-container .rcb-options").length>0,r=e.querySelectorAll(".rcb-checkbox-row-container").length>0;if(t){const t=e.querySelectorAll(".rcb-options[tabindex]").length;e.querySelectorAll(".rcb-options").length>t&&n(e)}if(r){const t=e.querySelectorAll(".rcb-checkbox-row-container[tabindex]").length;e.querySelectorAll(".rcb-checkbox-row-container").length>t&&n(e)}})},1e3);return()=>{document.removeEventListener("keydown",e),r.disconnect(),clearInterval(o)}},[]),null),ka=[];for(let e=0;e<256;++e)ka.push((e+256).toString(16).slice(1));let Ca;const Sa=new Uint8Array(16);var Ta={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ia(e,t,n){if(Ta.randomUUID&&!e)return Ta.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!Ca){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ca=crypto.getRandomValues.bind(crypto)}return Ca(Sa)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(ka[e[t+0]]+ka[e[t+1]]+ka[e[t+2]]+ka[e[t+3]]+"-"+ka[e[t+4]]+ka[e[t+5]]+"-"+ka[e[t+6]]+ka[e[t+7]]+"-"+ka[e[t+8]]+ka[e[t+9]]+"-"+ka[e[t+10]]+ka[e[t+11]]+ka[e[t+12]]+ka[e[t+13]]+ka[e[t+14]]+ka[e[t+15]]).toLowerCase()}(r)}const Qa=()=>"qa_bot_session_".concat(Ia()),Ma="#1a5b6e",Oa="#107180",La="Arial, sans-serif",Na="Q&A Bot",Ha="/chat-icon.svg",Ra="Type your question here...",za="Chat is currently unavailable",Fa=!1,ja="Ask me a question!",Ua=!0,qa="/login",Ya={general:{showHeader:!0,showFooter:!0},tooltip:{mode:"CLOSE"},chatInput:{disabled:!1,characterLimit:1e3,showCharacterCount:!1,allowNewline:!0,blockSpam:!1},chatWindow:{defaultOpen:!1,showScrollbar:!1},botBubble:{simulateStream:!0,streamSpeed:10,showAvatar:!1},userBubble:{showAvatar:!1}},Ga=n((e,n)=>{var r,o;const{apiKey:A,qaEndpoint:c,ratingEndpoint:u,welcomeMessage:d,enabled:p,open:f,onOpenChange:h,primaryColor:g,secondaryColor:m,botName:v,logo:b,placeholder:y,errorMessage:x,embedded:E,footerText:B,footerLink:P,tooltipText:D,loginUrl:k,customFlow:C}=e,S=i("bot_".concat(Math.random().toString(36).substr(2,9))),T=i(Qa()),I=i(!1),Q=i({getSessionId:()=>T.current,isResetting:()=>I.current}),[M,O]=a(void 0!==p?p:Ua);l(()=>{O(void 0!==p?p:Ua)},[p]);const L=s(()=>{const e=Object.assign({},Ya);e.general=Object.assign(Object.assign({},e.general),{primaryColor:g||Ma,secondaryColor:m||Oa,fontFamily:La,embedded:void 0!==E?E:Fa});const n=M?t.createElement(ba,{key:"user-icon"}):t.createElement(va,{key:"login-button",loginUrl:k||qa,isHeaderButton:!0});return e.header={title:v||Na,showAvatar:!0,avatar:b||Ha,buttons:[n,w.CLOSE_CHAT_BUTTON]},e.chatInput=Object.assign(Object.assign({},e.chatInput),{disabled:!M,enabledPlaceholderText:y||Ra,disabledPlaceholderText:x||za}),e.tooltip=Object.assign(Object.assign({},e.tooltip),{text:D||ja}),e},[g,m,v,b,y,x,E,D,M,k]),N=i(null),H=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(()=>{const n=(t,n)=>{if(e.current){const n=getComputedStyle(e.current).getPropertyValue(t);if(n&&""!==n.trim())return n.trim();if(e.current.parentElement){const n=getComputedStyle(e.current.parentElement).getPropertyValue(t);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:n("--primaryColor",t.primaryColor),secondaryColor:n("--secondaryColor",t.secondaryColor),fontFamily:n("--fontFamily",t.fontFamily)}},[e,t])}(N,L.general);((e,t)=>{l(()=>{t.current&&(e?t.current.classList.add("bot-logged-in"):t.current.classList.remove("bot-logged-in"))},[e,t])})(M,N),(e=>{let{settings:n,themeColors:r,footerText:o,footerLink:A}=e;l(()=>{r&&(Object.entries(r).forEach(e=>{let[t,n]=e;n&&document.documentElement.style.setProperty("--".concat(t),n)}),r.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",r.primaryColor),r.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",r.secondaryColor))},[r]),l(()=>{var e,r,i;(null===(e=n.header)||void 0===e?void 0:e.title)&&"string"==typeof n.header.title&&(n.header.title=t.createElement("div",{key:"header-title"},t.createElement("h1",{className:"sr-only"},n.header.title),t.createElement("span",{"aria-hidden":"true"},n.header.title))),(null===(r=n.general)||void 0===r?void 0:r.embedded)&&n.chatWindow&&(n.chatWindow.defaultOpen=!0),n.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},n.chatHistory={disabled:!1},n.chatButton=Object.assign(Object.assign({},n.chatButton),{icon:null===(i=n.header)||void 0===i?void 0:i.avatar}),n.audio={disabled:!0},n.emoji={disabled:!0},n.fileAttachment={disabled:!0},n.notification={disabled:!0};const a=o?A?t.createElement("a",{href:A,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},o):t.createElement("span",{key:"footer-text"},o):null;n.footer={text:a,buttons:[t.createElement(Pa,{key:"new-chat-button"})]},n.event={rcbToggleChatWindow:!0}},[n,o,A])})({settings:L,themeColors:H,footerText:B,footerLink:P});const R=s(()=>{const e=(e=>{let{endpoint:n,ratingEndpoint:r,apiKey:o,sessionId:A,isResetting:i=()=>!1,enabled:a=!0,loginUrl:l="/login"}=e;if(!a)return{qa_loop:{message:"To ask questions, you need to log in first.",component:t.createElement(va,{loginUrl:l}),chatDisabled:!0,path:"qa_loop"}};let s=null,c=!1;if(!n)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async e=>{const{userInput:t}=e;if(i&&i())return null;if(!t||""===t.trim())return null;if("👍 Helpful"===t||"👎 Not helpful"===t){if(r&&s)try{const e="👍 Helpful"===t,n={"Content-Type":"application/json"};o&&(n["X-API-KEY"]=o);const i=A();i&&(n["X-Session-ID"]=i,n["X-Query-ID"]=s),await fetch(r,{method:"POST",headers:n,body:JSON.stringify({sessionId:i,queryId:s,rating:e?1:0})})}catch(e){console.error("Error sending feedback:",e)}return"Thanks for the feedback! Feel free to ask another question."}try{const r=Ia();s=r;const i={"Content-Type":"application/json"};o&&(i["X-API-KEY"]=o);const a=A();a&&(i["X-Session-ID"]=a,i["X-Query-ID"]=r);const l=await fetch(n,{method:"POST",headers:i,body:JSON.stringify({query:t})});if(!l.ok)throw new Error("API returned ".concat(l.status));const u=await l.json(),d=u.response||u.answer||u.text||u.message;if(!d)throw new Error("Invalid response format from API");const p=(e=>{if(!e||"string"!=typeof e)return e;let t=e.replace(/\[(https?:\/\/[^\s]+?)\]/gi,"[$1]($1)");return t=t.replace(/(?<!\]\(|href=["']|\[)https?:\/\/[^\s[\]()]+/gi,e=>{let t=e,n="";const r=t.match(/([.,;:!?]+)$/);return r&&(n=r[1],t=t.slice(0,-n.length)),"[".concat(t,"](").concat(t,")").concat(n)}),t})(d);return await e.injectMessage(p),c=!0,setTimeout(async()=>{await e.injectMessage("Feel free to ask another question.")},100),null}catch(e){return console.error("Error in Q&A flow:",e),"I apologize, but I'm having trouble processing your question. Please try again later."}},options:e=>i&&i()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput?[]:r&&c?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,path:"qa_loop"}}})({endpoint:c,ratingEndpoint:u,apiKey:A,sessionId:Q.current.getSessionId,isResetting:Q.current.isResetting,enabled:M,loginUrl:k||qa}),n={message:d,transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},e),C||{})},[A,c,u,d,M,k,C]),z=s(()=>{return[()=>Qn(t),pa(),()=>ga(e)];var e,t},[]);return l(()=>{const e=()=>{const e=document.querySelector(".rcb-chat-window");if(!e)return;const t=e.querySelector(".rcb-send-button");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("data-keyboard-enabled")||(t.setAttribute("data-keyboard-enabled","true"),t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const n=t&&Object.keys(t).find(e=>e.startsWith("__reactProps"));if(n){const r=t[n],o=null==r?void 0:r.onMouseDown;if(o&&"function"==typeof o)return void o(e)}const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(r)}})))},t=setInterval(e,1e3);return e(),()=>clearInterval(t)},[]),Da(),l(()=>{if(!E&&h){const e=e=>{const t=e.data.newState;h(t)};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[E,h]),t.createElement("div",{className:"qa-bot ".concat((null===(r=L.general)||void 0===r?void 0:r.embedded)?"embedded-qa-bot":""),ref:N,role:"region","aria-label":v||Na},t.createElement(Ba,{resetSession:()=>{I.current=!0,T.current=Qa()},clearResettingFlag:()=>{I.current=!1}},t.createElement(_t,null,t.createElement("div",null,t.createElement(ma,{ref:n,embedded:(null===(o=L.general)||void 0===o?void 0:o.embedded)||!1,currentOpen:f||!1,enabled:M,onSetEnabled:O}),t.createElement(Kt,{key:"chatbot-".concat(S.current,"-").concat(M),settings:L,flow:R,plugins:z}),t.createElement("div",{role:"status","aria-live":"polite","aria-label":"Bot response updates",className:"sr-only",id:"bot-live-region"}),t.createElement("div",{id:"chat-input-help",className:"sr-only"},"Type your message and press Enter to send. Use arrow keys to navigate through response options.")))))});Ga.displayName="QABot";b('.rcb-chat-window{height:800px!important;max-height:80vh!important;max-width:100%;width:550px!important}.rcb-chat-window .rcb-chat-header{align-items:center;display:flex;flex-direction:row;font-weight:700}.rcb-chat-window a{color:#000;font-weight:700;text-decoration:underline}.rcb-chat-window a:hover{color:var(--primaryColor,#107180)}.rcb-chat-window .rcb-bot-message a{color:#fff;text-decoration:none}.rcb-chat-window .rcb-bot-message a:hover{text-decoration:underline}.rcb-chat-window .rcb-chat-input-textarea{overflow-y:auto}.rcb-chat-window .rcb-chat-footer-container{font-size:10px}.qa-bot .user-login-icon{display:none!important}.qa-bot.bot-logged-in .user-login-icon{display:flex!important;transform:scale(1.3) translateY(-2px)}.embedded-qa-bot .rcb-chat-window{max-width:100%;width:100%!important}.qa-bot.hidden{display:none}.embedded-qa-bot .rcb-bot-message,.embedded-qa-bot .rcb-user-message{max-width:90%!important;word-break:break-word}.embedded-qa-bot .rcb-chat-input-textarea{width:100%!important}.qa-bot-container{max-width:100%;width:100%}@keyframes phone-ring{0%{transform:translateX(0) translateY(0) rotate(0deg)}2%{transform:translateX(0) translateY(-8px) rotate(-2deg)}4%{transform:translateX(0) translateY(-6px) rotate(2deg)}6%{transform:translateX(0) translateY(-8px) rotate(-1deg)}8%{transform:translateX(0) translateY(-6px) rotate(1deg)}10%{transform:translateX(0) translateY(-8px) rotate(-2deg)}12%{transform:translateX(0) translateY(-6px) rotate(2deg)}20%{transform:translateX(0) translateY(0) rotate(0deg)}30%{transform:translateX(0) translateY(0) rotate(0deg)}40%{transform:translateX(0) translateY(0) rotate(0deg)}49%{transform:translateX(0) translateY(0) rotate(0deg)}50%{transform:translateX(0) translateY(-8px) rotate(-2deg)}52%{transform:translateX(0) translateY(-6px) rotate(2deg)}54%{transform:translateX(0) translateY(-8px) rotate(-1deg)}56%{transform:translateX(0) translateY(-6px) rotate(1deg)}58%{transform:translateX(0) translateY(-8px) rotate(-2deg)}60%{transform:translateX(0) translateY(-6px) rotate(2deg)}70%{transform:translateX(0) translateY(0) rotate(0deg)}to{transform:translateX(0) translateY(0) rotate(0deg)}}@media (max-width:768px){.rcb-chat-window{max-height:calc(100vh - 100px)!important;max-width:calc(100vw - 40px)!important;width:550px!important}.embedded-chat-container.open{height:400px}.embedded-chat-closed{font-size:14px;height:40px}.embedded-chat-open-btn{font-size:12px;padding:3px 10px}.rcb-bot-message,.rcb-user-message{max-width:85%!important}.rcb-chat-input-textarea{font-size:16px!important;min-height:44px!important}.rcb-chat-header{padding:12px 16px!important}}@media (max-width:480px){.rcb-chat-window{bottom:10px!important;left:10px!important;max-height:calc(100vh - 80px)!important;max-width:calc(100vw - 20px)!important;right:10px!important;width:calc(100vw - 20px)!important}.embedded-chat-container.open{height:350px}.rcb-bot-message,.rcb-user-message{margin-bottom:8px!important;max-width:90%!important}.rcb-chat-header{font-size:14px!important;padding:8px 12px!important}.rcb-chat-button{bottom:20px!important;height:50px!important;right:20px!important;width:50px!important}.rcb-chat-footer-container{font-size:9px!important;padding:8px 12px!important}}@media (max-width:360px){.rcb-chat-window{left:5px!important;max-width:calc(100vw - 10px)!important;right:5px!important;width:calc(100vw - 10px)!important}.rcb-chat-header{font-size:13px!important;padding:6px 8px!important}}.rcb-checkbox-container{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin-left:16px!important;max-width:100%!important;padding-top:12px!important}.rcb-checkbox-row-container{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--primaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-row-container:hover{background-color:#e8f4f8!important;border-color:var(--primaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-row-container[data-checked=true]{background-color:var(--primaryColor,#107180)!important;border-color:var(--primaryColor,#107180)!important;color:#fff!important}.rcb-checkbox-row{margin-left:0!important}.rcb-checkbox-mark{height:14px!important;margin-right:6px!important;width:14px!important}.rcb-checkbox-label{font-size:13px!important;margin:0!important;white-space:nowrap!important}.rcb-checkbox-next-button{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;justify-content:center!important;line-height:24px!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-next-button:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.sr-only{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.rcb-chat-input-send-button:focus,.rcb-chat-input-textarea:focus{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-user-message{word-wrap:break-word!important;overflow:hidden!important;word-break:break-word!important}:focus-visible{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-options-container{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:8px!important;margin:16px!important;padding:0!important}.rcb-options{background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;outline:none!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-options:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-next-button.keyboard-focused,.rcb-checkbox-next-button:focus,.rcb-checkbox-next-button:focus-visible,.rcb-checkbox-row-container.keyboard-focused,.rcb-checkbox-row-container:focus,.rcb-checkbox-row-container:focus-visible,.rcb-options.keyboard-focused,.rcb-options:focus,.rcb-options:focus-visible{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;outline:none!important}.rcb-options:active{background-color:var(--secondaryColor,#107180)!important;border-color:var(--secondaryColor,#107180)!important;color:#fff!important;transform:translateY(0)!important}.keyboard-nav-hint{color:#666!important;font-size:12px!important;font-style:italic!important;margin-bottom:8px!important}@media (prefers-reduced-motion:reduce){.keyboard-nav-hint{display:none!important}}.rcb-options-container [role=button][tabindex="0"],.rcb-options-container button[tabindex="0"]{position:relative!important}.rcb-options-container [role=button][tabindex="0"]:after,.rcb-options-container button[tabindex="0"]:after{color:var(--secondaryColor,#107180)!important;content:"←"!important;font-size:16px!important;opacity:0!important;position:absolute!important;right:12px!important;top:50%!important;transform:translateY(-50%)!important;transition:opacity .2s ease!important}.rcb-options-container [role=button][tabindex="0"]:focus:after,.rcb-options-container button[tabindex="0"]:focus:after{opacity:1!important}.rcb-chat-input-send-button{cursor:pointer!important;opacity:1!important;pointer-events:auto!important;visibility:visible!important}.rcb-chat-input-send-button:not([tabindex]){-webkit-user-select:none;-moz-user-select:none;user-select:none}.rcb-chat-input-container [onclick],.rcb-chat-input-container [role=button],.rcb-chat-input-container div[style*=cursor],.rcb-chat-input-container svg:last-child,.rcb-chat-input-container>div:last-child{tabindex:0!important;cursor:pointer!important}.rcb-chat-footer{margin-top:4px!important;padding-top:0!important}.rcb-chat-footer-container{align-items:center!important;display:flex!important;margin-top:4px!important;padding-top:4px!important}.rcb-chat-footer-container button{order:1!important}.rcb-chat-footer-container a[href*=qa-bot-core]{tab-index:0!important;order:2!important}.rcb-chat-footer-container a[href*=feedback]{tab-index:0!important;order:3!important}@media (prefers-contrast:high){.rcb-chat-window a{background-color:#fff!important;border:1px solid #000!important;color:#000!important}}@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.rcb-chat-input-textarea{user-select:text!important}.rcb-chat-body-container,.rcb-chat-input-textarea,.rcb-chat-window{touch-action:pan-y!important}.embedded-qa-bot,.rcb-chat-window{-webkit-overflow-scrolling:touch!important}.embedded-qa-bot .rcb-chat-input-textarea{touch-action:pan-y!important;user-select:text!important}.embedded-qa-bot .rcb-chat-body-container,.embedded-qa-bot .rcb-chat-window{touch-action:pan-y!important}.rcb-chat-header-container{background:var(--primaryColor,#1a5b6e)!important;background:linear-gradient(135deg,var(--primaryColor,#1a5b6e) 0,var(--secondaryColor,#107180) 100%)!important}.rcb-toggle-button{align-items:center!important;background:var(--primaryColor,#1a5b6e)!important;display:flex!important;justify-content:center!important}.rcb-toggle-button svg{stroke:#fff!important;color:#fff!important}.rcb-toggle-button *,.rcb-toggle-button img,.rcb-toggle-button svg,.rcb-toggle-button>*{box-sizing:border-box!important;height:50px!important;left:0!important;margin:0 auto!important;max-height:50px!important;max-width:50px!important;min-height:50px!important;min-width:50px!important;padding:2px!important;position:relative!important;top:0!important;width:50px!important}.rcb-send-button{background-color:var(--primaryColor,#1a5b6e)!important}',{insertAt:"top"});const _a=()=>{const[e,t]=a(!1),n=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia;return{captureScreenshot:async()=>{if(!n())throw new Error("Screen capture is not available in this environment");try{t(!0);const e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",cursor:"always",width:{ideal:1920},height:{ideal:1080}},audio:!1}),n=document.createElement("video");n.srcObject=e,await new Promise(e=>{n.onloadedmetadata=()=>{n.play(),e()}});const r=document.createElement("canvas");r.width=n.videoWidth,r.height=n.videoHeight;const o=r.getContext("2d");if(!o)throw new Error("Could not get canvas context");o.drawImage(n,0,0,r.width,r.height);const A=await new Promise(e=>r.toBlob(e,"image/png"));if(!A)throw new Error("Could not create image blob");const i=(new Date).toISOString().replace(/[:.]/g,"-"),a=new File([A],"screenshot-".concat(i,".png"),{type:"image/png"});return e.getTracks().forEach(e=>e.stop()),t(!1),a}catch(e){throw console.error("Error capturing screenshot:",e),t(!1),e}},isCapturing:e,isScreenCaptureAvailable:n()}},Wa=e=>t.createElement(ya,e,t.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.createElement("polyline",{points:"17 8 12 3 7 8"}),t.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"})),Va=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if("string"!=typeof r.result)return void n(new Error("Failed to read file ".concat(e.name)));const o=r.result.split(",")[1];t({fileName:e.name,contentType:e.type,size:e.size,fileData:o})},r.onerror=()=>n(new Error("Failed to read file ".concat(e.name))),r.readAsDataURL(e)}),Xa=e=>Promise.all(e.map(Va)),Ka=function(e){const t=1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)*1024;return e.size<=t},Ja=e=>e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB"),Za=e=>{let{onFileUpload:n,maxSizeMB:r=10,acceptedTypes:o="image/*,application/pdf,text/*,.doc,.docx",enableScreenshot:A=!1,className:l}=e;const[s,c]=a(!1),[u,d]=a([]),[p,f]=a(null),h=i(null),{captureScreenshot:g,isCapturing:m,isScreenCaptureAvailable:v}=_a(),b=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>document.body.removeChild(t),1e3)},w=e=>{if(!e||0===e.length)return void console.warn("FileUploadComponent: No valid files provided to handleFiles");let t;try{t=Array.from(e)}catch(e){return console.error("FileUploadComponent: Error converting files to array:",e),void b("Error processing selected files. Please try again.")}const r=[...u,...t];d(r);const o=t.length,A=t.map(e=>e.name).join(", ");b("".concat(o," file").concat(o>1?"s":""," selected: ").concat(A)),setTimeout(()=>{const e=document.querySelector(".rcb-chat-content");e&&(e.scrollTop=e.scrollHeight)},100),n&&n(r)},y=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?c(!0):"dragleave"===e.type&&c(!1)},x=()=>{try{h.current&&h.current.click()}catch(e){console.error("FileUploadComponent: Error in handleButtonClick:",e),b("Error opening file selection dialog. Please try again.")}},E=()=>{f(null)},B=A&&v;return t.createElement("div",{className:"file-upload-container ".concat(l||""),style:{padding:"16px",margin:"8px 0"}},B&&t.createElement("div",{style:{display:"flex",justifyContent:"center",marginBottom:"10px"}},t.createElement("button",{onClick:e=>{e.preventDefault(),(async()=>{try{const e=await g();w([e]),b("Screenshot captured successfully")}catch(e){b("Error capturing screenshot. Please try again.")}})()},disabled:m,"aria-describedby":"screenshot-help","aria-label":m?"Taking screenshot, please wait":"Take a screenshot to attach",style:{display:"flex",alignItems:"center",gap:"8px",backgroundColor:"#107180",color:"white",border:"none",borderRadius:"5px",padding:"8px 12px",cursor:m?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t.createElement("circle",{cx:"12",cy:"13",r:"4"})),m?"Taking screenshot...":"Take screenshot..."),t.createElement("span",{id:"screenshot-help",className:"sr-only"},"Captures the current screen and adds it as an attachment")),t.createElement("div",{className:"file-upload-dropzone ".concat(s?"active":""),onDragEnter:y,onDragLeave:y,onDragOver:y,onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),c(!1);try{(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&e.dataTransfer.files.length>0&&w(e.dataTransfer.files)}catch(e){console.error("FileUploadComponent: Error in handleDrop:",e),b("Error processing dropped files. Please try again.")}},role:"button",tabIndex:0,"aria-label":"File upload area. Click to select files or drag and drop files here.","aria-describedby":"upload-instructions",onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),x())},style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",backgroundColor:s?"#f0f8ff":"#fafafa",transition:"all 0.3s ease"}},t.createElement("input",{ref:h,type:"file",className:"file-input",onChange:e=>{var t;try{(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&w(e.target.files)}catch(e){console.error("FileUploadComponent: Error in handleFileSelect:",e),b("Error processing selected files. Please try again.")}},multiple:!0,style:{display:"none"},"aria-label":"Select files to upload",accept:o}),t.createElement("div",{className:"upload-content",onClick:x,style:{cursor:"pointer",flexDirection:"column",alignItems:"center",display:"flex",textAlign:"center",padding:"12px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}},t.createElement(Wa,null),t.createElement("p",{style:{margin:0,fontWeight:"bold"}},"Upload Files")),t.createElement("p",{id:"upload-instructions",style:{margin:0,fontSize:"14px",color:"#666"}},"Drag and drop files here or click to select. (Max ",r,"MB each)")),u.length>0&&t.createElement("div",{className:"selected-files",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",alignItems:"center"}},t.createElement("span",{style:{fontWeight:400,color:"#888",fontSize:"13px",marginRight:"8px",alignSelf:"center"}},"Selected files:"),u.map((e,r)=>t.createElement("span",{key:r,style:{background:"#fff",color:"#107180",borderRadius:"5px",padding:"4px 12px",fontSize:"14px",marginRight:"4px",marginBottom:"4px",border:"1px solid #ccc",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:t=>{t.stopPropagation(),(e=>{f(e)})(e)}},t.createElement("span",{onClick:e=>{e.stopPropagation(),(e=>{const t=u.filter((t,n)=>n!==e);d(t),n&&n(t)})(r)},style:{cursor:"pointer",color:"#888",fontWeight:"bold",fontSize:"15px",marginRight:"4px",userSelect:"none",lineHeight:1},title:"Remove file","aria-label":"Remove ".concat(e.name)},"×"),e.name," (",Ja(e.size),")"))))),(()=>{if(!p)return null;const e=p.type.startsWith("image/"),n=p.type.startsWith("text/"),r="application/pdf"===p.type;return t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},onClick:E},t.createElement("div",{style:{backgroundColor:"white",padding:"20px",borderRadius:"8px",maxWidth:"90%",maxHeight:"90%",overflow:"auto",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{onClick:E,style:{position:"absolute",top:"10px",right:"10px",background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×"),t.createElement("h3",{style:{marginTop:0,marginBottom:"16px"}},p.name),e&&t.createElement("img",{src:URL.createObjectURL(p),alt:p.name,style:{maxWidth:"100%",maxHeight:"70vh"}}),n&&t.createElement("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"70vh",overflow:"auto",padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"4px"}},URL.createObjectURL(p)),r&&t.createElement("iframe",{src:URL.createObjectURL(p),style:{width:"100%",height:"70vh",border:"none"},title:p.name}),!e&&!n&&!r&&t.createElement("div",{style:{padding:"20px",textAlign:"center"}},"Preview not available for this file type")))})())},$a=t.forwardRef((e,n)=>{const[r,o]=t.useState(e.defaultOpen||!1),A=t.useRef(null);return t.useImperativeHandle(n,()=>({addMessage:e=>{var t;null===(t=A.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=A.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;o(!0),null===(e=A.current)||void 0===e||e.openChat()},closeChat:()=>{var e;o(!1),null===(e=A.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;o(e=>!e),null===(e=A.current)||void 0===e||e.toggleChat()}}),[]),t.createElement(Ga,{ref:A,apiKey:e.apiKey,qaEndpoint:e.qaEndpoint,ratingEndpoint:e.ratingEndpoint,welcomeMessage:e.welcomeMessage,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,botName:e.botName,logo:e.logo,placeholder:e.placeholder,errorMessage:e.errorMessage,embedded:e.embedded,enabled:e.enabled,open:r,onOpenChange:o,footerText:e.footerText,footerLink:e.footerLink,tooltipText:e.tooltipText})});function el(e){if(!(e.target&&e.target instanceof HTMLElement))return void console.error("QA Bot: A valid target DOM element is required");const n=f.createRoot(e.target),r={current:null};return n.render(t.createElement(t.StrictMode,null,t.createElement($a,{ref:e=>{r.current=e},apiKey:e.apiKey,qaEndpoint:e.qaEndpoint,ratingEndpoint:e.ratingEndpoint,defaultOpen:e.defaultOpen,embedded:e.embedded,enabled:e.enabled,welcomeMessage:e.welcomeMessage,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,botName:e.botName,logo:e.logo,placeholder:e.placeholder,errorMessage:e.errorMessage,footerText:e.footerText,footerLink:e.footerLink,tooltipText:e.tooltipText}))),{addMessage:e=>{var t;return null===(t=r.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=r.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{r.current=null,n.unmount()}}}$a.displayName="ProgrammaticQABot";export{Za as FileUploadComponent,Ga as QABot,el as default,Va as fileToBase64,Xa as filesToBase64,Ja as formatFileSize,el as qaBot,_a as useScreenshotCapture,Ka as validateFileSize};
9
9
  //# sourceMappingURL=qa-bot-core.js.map