@brainbase-labs/chat-widget 0.1.15 → 0.1.16
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.
- package/dist/embed/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),g=require("react/jsx-runtime"),Fn="bb-chat-";function Ut(e){try{const n=sessionStorage.getItem(`${Fn}${e}`);return n?JSON.parse(n):null}catch{return null}}function vn(e,n){try{sessionStorage.setItem(`${Fn}${e}`,JSON.stringify(n))}catch{}}function Tn(e){try{sessionStorage.removeItem(`${Fn}${e}`)}catch{}}function qt(e){const{config:n,apiClient:t,mockMode:r,onSessionStart:i,onSessionEnd:l,onMessage:o,onError:a}=e,[c,s]=F.useState([]),[u,p]=F.useState([]),[m,h]=F.useState(!1),[C,E]=F.useState(null),[I,x]=F.useState(null),A=F.useRef(0),v=F.useRef(!1),R=F.useRef({});F.useEffect(()=>{if(v.current)return;v.current=!0;const S=Ut(n.embedId);S&&S.status==="active"&&(x(S.sessionId),s(S.messages),p(S.toolCalls),A.current=S.startTime)},[n.embedId]),F.useEffect(()=>{I&&c.length>0&&vn(n.embedId,{sessionId:I,deploymentId:n.deploymentId,workerId:n.workerId,flowId:n.flowId,startTime:A.current,messages:c,toolCalls:u,status:"active"})},[I,c,u,n]);const q=F.useCallback(async()=>(A.current=Date.now(),x(null),s([]),p([]),Tn(n.embedId),""),[n.embedId]),k=F.useCallback((S,j)=>{s(L=>{let b=!1;const N=L.map(T=>T.id===S?(b=!0,{...T,content:j,status:"streaming"}):T);return b||N.push({id:S,role:"assistant",content:j,timestamp:Date.now(),status:"streaming"}),N})},[]),B=F.useCallback((S,j,L)=>{switch(S.type){case"session":{const b=S.data;b.session_id&&(L(b.session_id),b.is_new&&(A.current=Date.now(),i==null||i(b.session_id)));break}case"message":{const b=S.data;b.content&&(R.current[j]=b.content,k(j,b.content));break}case"chunk":{const b=S.data;if(b.content){const T=(R.current[j]??"")+b.content;R.current[j]=T,k(j,T)}break}case"tool_call":{const b=S.data;if(p(N=>{const T=N.findIndex(O=>O.name===b.function&&O.status==="pending");return T!==-1&&b.result!==void 0?N.map((O,Q)=>Q===T?{...O,result:b.result,status:"completed"}:O):T===-1?[...N,{id:`tc-${Date.now()}-${Math.random().toString(36).slice(2)}`,name:b.function,arguments:b.args??{},status:"pending",timestamp:Date.now()}]:N}),b.content){const N=b.content;R.current[j]=N,k(j,N)}break}case"waiting":break;case"done":{s(b=>b.map(N=>N.id===j?{...N,status:"sent"}:N)),delete R.current[j];break}case"completed":{s(b=>{const N=b.map(T=>T.id===j?{...T,status:"sent"}:T);return I&&vn(n.embedId,{sessionId:I,deploymentId:n.deploymentId,workerId:n.workerId,flowId:n.flowId,startTime:A.current,messages:N,toolCalls:[],status:"completed"}),N}),delete R.current[j];break}case"error":{const b=S.data;s(N=>N.map(T=>T.id===j?{...T,status:"error",content:b.error??"An error occurred"}:T));break}}},[n,I,i,k]),U=F.useCallback(async(S,j,L)=>{const b=S.getReader(),N=new TextDecoder;let T="";try{for(;;){const{done:O,value:Q}=await b.read();if(O)break;T+=N.decode(Q,{stream:!0});let f;for(;(f=T.indexOf(`
|
|
2
2
|
|
|
3
3
|
`))!==-1;){const le=T.slice(0,f);T=T.slice(f+2);for(const ue of le.split(`
|
|
4
|
-
`))if(ue.startsWith("data: "))try{const d=JSON.parse(ue.slice(6));B(d,j,L)}catch{}}}}finally{b.releaseLock()}},[B]),$=F.useCallback(async S=>{if(!S.trim())return;const j={id:`user-${Date.now()}`,role:"user",content:S,timestamp:Date.now(),status:"sent"};s(T=>[...T,j]),o==null||o(j);const L=`assistant-${Date.now()}`,b={id:L,role:"assistant",content:"",timestamp:Date.now(),status:"streaming"};s(T=>[...T,b]),h(!0),E(null);const N=T=>{x(T)};try{if(r){const T=t.sendMessage(S);for await(const O of T)B(O,L,N)}else{const T=await t.sendMessage({embedId:n.embedId,message:S,sessionId:I??void 0});await U(T,L,N)}s(T=>T.map(O=>O.id===L&&O.status==="streaming"?{...O,status:"sent"}:O))}catch(T){const O=T instanceof Error?T:new Error("Failed to send message");E(O),a==null||a(O),s(Q=>Q.map(f=>f.id===L?{...f,status:"error",content:"Failed to get response"}:f))}finally{h(!1)}},[I,t,r,n.embedId,B,U,o,a]),V=F.useCallback(async()=>{if(!I)return;const S={sessionId:I,deploymentId:n.deploymentId,workerId:n.workerId,flowId:n.flowId,startTime:A.current,messages:c,toolCalls:u,status:"completed"};l==null||l(S),Tn(n.embedId),x(null),s([]),p([])},[I,n,c,u,l]),P=F.useCallback(()=>{s([]),p([])},[]);return{messages:c,toolCalls:u,isLoading:m,error:C,sessionId:I,sendMessage:$,endSession:V,clearMessages:P,startNewSession:q}}const Wt="http://localhost:8003";function Yt(e=Wt){return{async getDeploymentConfig(n){const t=await fetch(`${e}/chat/config/${n}`);if(!t.ok)throw new Error(`Failed to fetch deployment config: ${t.status}`);const r=await t.json();return{embedId:r.embedId,deploymentId:"",workerId:"",flowId:"",welcomeMessage:r.welcomeMessage,agentName:r.agentName,agentLogoUrl:r.agentLogoUrl,primaryColor:r.primaryColor,styling:r.styling}},async sendMessage(n){const t=await fetch(`${e}/chat/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embed_id:n.embedId,message:n.message,session_id:n.sessionId||void 0,metadata:n.metadata})});if(!t.ok){const r=await t.text();throw new Error(`Failed to send message: ${t.status} - ${r}`)}if(!t.body)throw new Error("No response stream available");return t.body}}}const Yr={embedId:"mock-embed-id",deploymentId:"mock-deployment-id",workerId:"mock-worker-id",flowId:"mock-flow-id",agentName:"AI Assistant",agentLogoUrl:void 0,primaryColor:"#1a1a2e",styling:{}},Xr=[{trigger:/hello|hi|hey/i,response:"Hello! I'm a demo AI assistant. How can I help you today?",delay:500},{trigger:/weather/i,response:"I'd check the weather for you, but I'm in mock mode! In production, I could use a weather API.",delay:800,toolCalls:[{name:"get_weather",arguments:{location:"San Francisco"},result:{temperature:72,condition:"sunny"}}]},{trigger:/help|support/i,response:"I'm here to help! You can ask me questions, and I'll do my best to assist you. In production, I'd be connected to your agent with full capabilities.",delay:600},{trigger:/pricing|cost|price/i,response:"For pricing information, I'd typically check our database or connect you with the sales team. This is a mock response demonstrating how I'd handle pricing questions.",delay:700,toolCalls:[{name:"lookup_pricing",arguments:{plan:"all"},result:{plans:[{name:"Starter",price:"$29/mo"},{name:"Pro",price:"$99/mo"}]}}]},{trigger:/.*/,response:"I'm running in mock mode. This is a simulated response to demonstrate the chat UI. In production, I'd be connected to your agent!",delay:1e3}];function $e(e){return new Promise(n=>setTimeout(n,e))}function Xt(e,n){const t={...Yr,...e},r=n??Xr,i=`mock-session-${Date.now()}`;return{async getDeploymentConfig(l){return await $e(300),t},async*sendMessage(l){yield{type:"session",data:{session_id:i,is_new:!0},timestamp:Date.now()};const o=r.find(s=>typeof s.trigger=="string"?l.toLowerCase().includes(s.trigger.toLowerCase()):s.trigger.test(l))??r[r.length-1];if(await $e(o.delay??500),o.toolCalls)for(const s of o.toolCalls)yield{type:"tool_call",data:{function:s.name,args:s.arguments},timestamp:Date.now()},await $e(300),yield{type:"tool_call",data:{function:s.name,result:s.result},timestamp:Date.now()},await $e(200);const a=o.response.split(" ");let c="";for(const s of a)c+=(c?" ":"")+s,yield{type:"message",data:{content:c,role:"assistant"},timestamp:Date.now()},await $e(30+Math.random()*40);yield{type:"done",data:{session_id:i},timestamp:Date.now()}}}}const Qe=({className:e,color:n="currentColor",cutoutColor:t="var(--bb-primary-color)"})=>g.jsxs("svg",{className:e,viewBox:"0 0 800 800",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("path",{d:"M400 412C400 405.373 405.373 400 412 400H788C794.627 400 800 405.373 800 412V740C800 773.137 773.137 800 740 800H412C405.373 800 400 794.627 400 788V412Z",fill:n}),g.jsx("circle",{cx:"400",cy:"400",r:"400",fill:n}),g.jsx("path",{d:"M0 60C0 26.8629 26.8629 0 60 0H397.614C398.932 0 400 1.06811 400 2.38569V2.38569C400 221.982 221.982 400 2.38569 400V400C1.06811 400 0 398.932 0 397.614V60Z",fill:n}),g.jsx("path",{d:"M400 412C400 405.373 405.373 400 412 400H738C744.627 400 750 405.373 750 412V725C750 738.807 738.807 750 725 750H412C405.373 750 400 744.627 400 738V412Z",fill:n}),g.jsx("circle",{cx:"400",cy:"400",r:"350",fill:n}),g.jsx("path",{d:"M50 75C50 61.1929 61.1929 50 75 50H388C394.627 50 400 55.3726 400 62V388C400 394.627 394.627 400 388 400H62C55.3726 400 50 394.627 50 388V75Z",fill:n}),g.jsx("rect",{x:"399.919",y:"209",width:"270",height:"270",rx:"12",transform:"rotate(45 399.919 209)",fill:t})]}),Kr="_header_1p6z5_1",Qr="_compact_1p6z5_9",Zr="_headerBackground_1p6z5_20",Jr="_headerContent_1p6z5_59",Gr="_topRow_1p6z5_64",ei="_agentInfo_1p6z5_79",ni="_agentLogo_1p6z5_85",ti="_agentLogoPlaceholder_1p6z5_102",ri="_brainbaseLogo_1p6z5_123",ii="_agentName_1p6z5_137",li="_actions_1p6z5_144",oi="_actionButton_1p6z5_149",ai="_welcomeText_1p6z5_183",si="_title_1p6z5_202",ui="_subtitle_1p6z5_210",G={header:Kr,compact:Qr,headerBackground:Zr,headerContent:Jr,topRow:Gr,agentInfo:ei,agentLogo:ni,agentLogoPlaceholder:ti,brainbaseLogo:ri,agentName:ii,actions:li,actionButton:oi,welcomeText:ai,title:si,subtitle:ui},Kt=({agentName:e="AI Assistant",agentLogoUrl:n,welcomeTitle:t,welcomeSubtitle:r,onClose:i,onNewChatRequest:l,showNewChatButton:o=!1,compact:a=!1})=>{const c=t||"Hello there.",s=r!==void 0?r:t?void 0:"How can we help?";return g.jsxs("div",{className:`${G.header} ${a?G.compact:""}`,children:[g.jsx("div",{className:G.headerBackground}),g.jsxs("div",{className:G.headerContent,children:[g.jsxs("div",{className:G.topRow,children:[g.jsxs("div",{className:G.agentInfo,children:[n?g.jsx("img",{src:n,alt:e,className:G.agentLogo}):g.jsx("div",{className:G.agentLogoPlaceholder,children:g.jsx(Qe,{className:G.brainbaseLogo,color:"white",cutoutColor:"var(--bb-primary-color)"})}),g.jsx("span",{className:G.agentName,children:e})]}),g.jsxs("div",{className:G.actions,children:[o&&l&&g.jsx("button",{className:G.actionButton,onClick:l,"aria-label":"Start new chat",type:"button",children:g.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:g.jsx("path",{d:"M12 5V19M5 12H19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),i&&g.jsx("button",{className:G.actionButton,onClick:i,"aria-label":"Close chat",type:"button",children:g.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:g.jsx("path",{d:"M6 18L18 6M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),!a&&g.jsxs("div",{className:G.welcomeText,children:[g.jsx("h1",{className:G.title,children:c}),s&&g.jsx("p",{className:G.subtitle,children:s})]})]})]})};function ci(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const pi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fi={};function ot(e,n){return(fi.jsx?hi:pi).test(e)}const di=/[ \t\n\f\r]/g;function mi(e){return typeof e=="object"?e.type==="text"?at(e.value):!1:at(e)}function at(e){return e.replace(di,"")===""}class Je{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Je.prototype.normal={};Je.prototype.property={};Je.prototype.space=void 0;function Qt(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Je(t,r,n)}function Ln(e){return e.toLowerCase()}class ie{constructor(n,t){this.attribute=t,this.property=n}}ie.prototype.attribute="";ie.prototype.booleanish=!1;ie.prototype.boolean=!1;ie.prototype.commaOrSpaceSeparated=!1;ie.prototype.commaSeparated=!1;ie.prototype.defined=!1;ie.prototype.mustUseProperty=!1;ie.prototype.number=!1;ie.prototype.overloadedBoolean=!1;ie.prototype.property="";ie.prototype.spaceSeparated=!1;ie.prototype.space=void 0;let gi=0;const D=ve(),Z=ve(),Pn=ve(),w=ve(),X=ve(),ze=ve(),ae=ve();function ve(){return 2**++gi}const Nn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:Z,commaOrSpaceSeparated:ae,commaSeparated:ze,number:w,overloadedBoolean:Pn,spaceSeparated:X},Symbol.toStringTag,{value:"Module"})),dn=Object.keys(Nn);class $n extends ie{constructor(n,t,r,i){let l=-1;if(super(n,t),st(this,"space",i),typeof r=="number")for(;++l<dn.length;){const o=dn[l];st(this,dn[l],(r&Nn[o])===Nn[o])}}}$n.prototype.defined=!0;function st(e,n,t){t&&(e[n]=t)}function De(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new $n(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[Ln(r)]=r,t[Ln(l.attribute)]=r}return new Je(n,t,e.space)}const Zt=De({properties:{ariaActiveDescendant:null,ariaAtomic:Z,ariaAutoComplete:null,ariaBusy:Z,ariaChecked:Z,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:Z,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:Z,ariaFlowTo:X,ariaGrabbed:Z,ariaHasPopup:null,ariaHidden:Z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:w,ariaLive:null,ariaModal:Z,ariaMultiLine:Z,ariaMultiSelectable:Z,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:Z,ariaReadOnly:Z,ariaRelevant:null,ariaRequired:Z,ariaRoleDescription:X,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:Z,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Jt(e,n){return n in e?e[n]:n}function Gt(e,n){return Jt(e,n.toLowerCase())}const yi=De({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ze,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:D,allowPaymentRequest:D,allowUserMedia:D,alt:null,as:null,async:D,autoCapitalize:null,autoComplete:X,autoFocus:D,autoPlay:D,blocking:X,capture:null,charSet:null,checked:D,cite:null,className:X,cols:w,colSpan:null,content:null,contentEditable:Z,controls:D,controlsList:X,coords:w|ze,crossOrigin:null,data:null,dateTime:null,decoding:null,default:D,defer:D,dir:null,dirName:null,disabled:D,download:Pn,draggable:Z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:D,formTarget:null,headers:X,height:w,hidden:Pn,high:w,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:D,inputMode:null,integrity:null,is:null,isMap:D,itemId:null,itemProp:X,itemRef:X,itemScope:D,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:D,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:D,muted:D,name:null,nonce:null,noModule:D,noValidate:D,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:D,optimum:w,pattern:null,ping:X,placeholder:null,playsInline:D,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:D,referrerPolicy:null,rel:X,required:D,reversed:D,rows:w,rowSpan:w,sandbox:X,scope:null,scoped:D,seamless:D,selected:D,shadowRootClonable:D,shadowRootDelegatesFocus:D,shadowRootMode:null,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:Z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:D,useMap:null,value:Z,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:D,declare:D,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:D,noHref:D,noShade:D,noWrap:D,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:Z,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:D,disableRemotePlayback:D,prefix:null,property:null,results:w,security:null,unselectable:null},space:"html",transform:Gt}),xi=De({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ae,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:X,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:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:D,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,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:ze,g2:ze,glyphName:ze,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:ae,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,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:w,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:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ae,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ae,rev:ae,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ae,requiredFeatures:ae,requiredFonts:ae,requiredFormats:ae,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:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:ae,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ae,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ae,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Jt}),er=De({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),nr=De({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Gt}),tr=De({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),ki={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"},bi=/[A-Z]/g,ut=/-[a-z]/g,wi=/^data[-\w.:]+$/i;function Ci(e,n){const t=Ln(n);let r=n,i=ie;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&wi.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(ut,_i);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!ut.test(l)){let o=l.replace(bi,Si);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=$n}return new i(r,n)}function Si(e){return"-"+e.toLowerCase()}function _i(e){return e.charAt(1).toUpperCase()}const Ii=Qt([Zt,yi,er,nr,tr],"html"),Hn=Qt([Zt,xi,er,nr,tr],"svg");function Ei(e){return e.join(" ").trim()}function rr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ne={},mn,ct;function vi(){if(ct)return mn;ct=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
|
|
4
|
+
`))if(ue.startsWith("data: "))try{const d=JSON.parse(ue.slice(6));B(d,j,L)}catch{}}}}finally{b.releaseLock()}},[B]),$=F.useCallback(async S=>{if(!S.trim())return;const j={id:`user-${Date.now()}`,role:"user",content:S,timestamp:Date.now(),status:"sent"};s(T=>[...T,j]),o==null||o(j);const L=`assistant-${Date.now()}`,b={id:L,role:"assistant",content:"",timestamp:Date.now(),status:"streaming"};s(T=>[...T,b]),h(!0),E(null);const N=T=>{x(T)};try{if(r){const T=t.sendMessage(S);for await(const O of T)B(O,L,N)}else{const T=await t.sendMessage({embedId:n.embedId,message:S,sessionId:I??void 0});await U(T,L,N)}s(T=>T.map(O=>O.id===L&&O.status==="streaming"?{...O,status:"sent"}:O))}catch(T){const O=T instanceof Error?T:new Error("Failed to send message");E(O),a==null||a(O),s(Q=>Q.map(f=>f.id===L?{...f,status:"error",content:"Failed to get response"}:f))}finally{h(!1)}},[I,t,r,n.embedId,B,U,o,a]),V=F.useCallback(async()=>{if(!I)return;const S={sessionId:I,deploymentId:n.deploymentId,workerId:n.workerId,flowId:n.flowId,startTime:A.current,messages:c,toolCalls:u,status:"completed"};l==null||l(S),Tn(n.embedId),x(null),s([]),p([])},[I,n,c,u,l]),P=F.useCallback(()=>{s([]),p([])},[]);return{messages:c,toolCalls:u,isLoading:m,error:C,sessionId:I,sendMessage:$,endSession:V,clearMessages:P,startNewSession:q}}const Wt="https://chat-embed-deployment.onrender.com";function Yt(e=Wt){return{async getDeploymentConfig(n){const t=await fetch(`${e}/chat/config/${n}`);if(!t.ok)throw new Error(`Failed to fetch deployment config: ${t.status}`);const r=await t.json();return{embedId:r.embedId,deploymentId:"",workerId:"",flowId:"",welcomeMessage:r.welcomeMessage,agentName:r.agentName,agentLogoUrl:r.agentLogoUrl,primaryColor:r.primaryColor,styling:r.styling}},async sendMessage(n){const t=await fetch(`${e}/chat/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embed_id:n.embedId,message:n.message,session_id:n.sessionId||void 0,metadata:n.metadata})});if(!t.ok){const r=await t.text();throw new Error(`Failed to send message: ${t.status} - ${r}`)}if(!t.body)throw new Error("No response stream available");return t.body}}}const Yr={embedId:"mock-embed-id",deploymentId:"mock-deployment-id",workerId:"mock-worker-id",flowId:"mock-flow-id",agentName:"AI Assistant",agentLogoUrl:void 0,primaryColor:"#1a1a2e",styling:{}},Xr=[{trigger:/hello|hi|hey/i,response:"Hello! I'm a demo AI assistant. How can I help you today?",delay:500},{trigger:/weather/i,response:"I'd check the weather for you, but I'm in mock mode! In production, I could use a weather API.",delay:800,toolCalls:[{name:"get_weather",arguments:{location:"San Francisco"},result:{temperature:72,condition:"sunny"}}]},{trigger:/help|support/i,response:"I'm here to help! You can ask me questions, and I'll do my best to assist you. In production, I'd be connected to your agent with full capabilities.",delay:600},{trigger:/pricing|cost|price/i,response:"For pricing information, I'd typically check our database or connect you with the sales team. This is a mock response demonstrating how I'd handle pricing questions.",delay:700,toolCalls:[{name:"lookup_pricing",arguments:{plan:"all"},result:{plans:[{name:"Starter",price:"$29/mo"},{name:"Pro",price:"$99/mo"}]}}]},{trigger:/.*/,response:"I'm running in mock mode. This is a simulated response to demonstrate the chat UI. In production, I'd be connected to your agent!",delay:1e3}];function $e(e){return new Promise(n=>setTimeout(n,e))}function Xt(e,n){const t={...Yr,...e},r=n??Xr,i=`mock-session-${Date.now()}`;return{async getDeploymentConfig(l){return await $e(300),t},async*sendMessage(l){yield{type:"session",data:{session_id:i,is_new:!0},timestamp:Date.now()};const o=r.find(s=>typeof s.trigger=="string"?l.toLowerCase().includes(s.trigger.toLowerCase()):s.trigger.test(l))??r[r.length-1];if(await $e(o.delay??500),o.toolCalls)for(const s of o.toolCalls)yield{type:"tool_call",data:{function:s.name,args:s.arguments},timestamp:Date.now()},await $e(300),yield{type:"tool_call",data:{function:s.name,result:s.result},timestamp:Date.now()},await $e(200);const a=o.response.split(" ");let c="";for(const s of a)c+=(c?" ":"")+s,yield{type:"message",data:{content:c,role:"assistant"},timestamp:Date.now()},await $e(30+Math.random()*40);yield{type:"done",data:{session_id:i},timestamp:Date.now()}}}}const Qe=({className:e,color:n="currentColor",cutoutColor:t="var(--bb-primary-color)"})=>g.jsxs("svg",{className:e,viewBox:"0 0 800 800",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("path",{d:"M400 412C400 405.373 405.373 400 412 400H788C794.627 400 800 405.373 800 412V740C800 773.137 773.137 800 740 800H412C405.373 800 400 794.627 400 788V412Z",fill:n}),g.jsx("circle",{cx:"400",cy:"400",r:"400",fill:n}),g.jsx("path",{d:"M0 60C0 26.8629 26.8629 0 60 0H397.614C398.932 0 400 1.06811 400 2.38569V2.38569C400 221.982 221.982 400 2.38569 400V400C1.06811 400 0 398.932 0 397.614V60Z",fill:n}),g.jsx("path",{d:"M400 412C400 405.373 405.373 400 412 400H738C744.627 400 750 405.373 750 412V725C750 738.807 738.807 750 725 750H412C405.373 750 400 744.627 400 738V412Z",fill:n}),g.jsx("circle",{cx:"400",cy:"400",r:"350",fill:n}),g.jsx("path",{d:"M50 75C50 61.1929 61.1929 50 75 50H388C394.627 50 400 55.3726 400 62V388C400 394.627 394.627 400 388 400H62C55.3726 400 50 394.627 50 388V75Z",fill:n}),g.jsx("rect",{x:"399.919",y:"209",width:"270",height:"270",rx:"12",transform:"rotate(45 399.919 209)",fill:t})]}),Kr="_header_1p6z5_1",Qr="_compact_1p6z5_9",Zr="_headerBackground_1p6z5_20",Jr="_headerContent_1p6z5_59",Gr="_topRow_1p6z5_64",ei="_agentInfo_1p6z5_79",ni="_agentLogo_1p6z5_85",ti="_agentLogoPlaceholder_1p6z5_102",ri="_brainbaseLogo_1p6z5_123",ii="_agentName_1p6z5_137",li="_actions_1p6z5_144",oi="_actionButton_1p6z5_149",ai="_welcomeText_1p6z5_183",si="_title_1p6z5_202",ui="_subtitle_1p6z5_210",G={header:Kr,compact:Qr,headerBackground:Zr,headerContent:Jr,topRow:Gr,agentInfo:ei,agentLogo:ni,agentLogoPlaceholder:ti,brainbaseLogo:ri,agentName:ii,actions:li,actionButton:oi,welcomeText:ai,title:si,subtitle:ui},Kt=({agentName:e="AI Assistant",agentLogoUrl:n,welcomeTitle:t,welcomeSubtitle:r,onClose:i,onNewChatRequest:l,showNewChatButton:o=!1,compact:a=!1})=>{const c=t||"Hello there.",s=r!==void 0?r:t?void 0:"How can we help?";return g.jsxs("div",{className:`${G.header} ${a?G.compact:""}`,children:[g.jsx("div",{className:G.headerBackground}),g.jsxs("div",{className:G.headerContent,children:[g.jsxs("div",{className:G.topRow,children:[g.jsxs("div",{className:G.agentInfo,children:[n?g.jsx("img",{src:n,alt:e,className:G.agentLogo}):g.jsx("div",{className:G.agentLogoPlaceholder,children:g.jsx(Qe,{className:G.brainbaseLogo,color:"white",cutoutColor:"var(--bb-primary-color)"})}),g.jsx("span",{className:G.agentName,children:e})]}),g.jsxs("div",{className:G.actions,children:[o&&l&&g.jsx("button",{className:G.actionButton,onClick:l,"aria-label":"Start new chat",type:"button",children:g.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:g.jsx("path",{d:"M12 5V19M5 12H19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),i&&g.jsx("button",{className:G.actionButton,onClick:i,"aria-label":"Close chat",type:"button",children:g.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:g.jsx("path",{d:"M6 18L18 6M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),!a&&g.jsxs("div",{className:G.welcomeText,children:[g.jsx("h1",{className:G.title,children:c}),s&&g.jsx("p",{className:G.subtitle,children:s})]})]})]})};function ci(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const pi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fi={};function ot(e,n){return(fi.jsx?hi:pi).test(e)}const di=/[ \t\n\f\r]/g;function mi(e){return typeof e=="object"?e.type==="text"?at(e.value):!1:at(e)}function at(e){return e.replace(di,"")===""}class Je{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Je.prototype.normal={};Je.prototype.property={};Je.prototype.space=void 0;function Qt(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Je(t,r,n)}function Ln(e){return e.toLowerCase()}class ie{constructor(n,t){this.attribute=t,this.property=n}}ie.prototype.attribute="";ie.prototype.booleanish=!1;ie.prototype.boolean=!1;ie.prototype.commaOrSpaceSeparated=!1;ie.prototype.commaSeparated=!1;ie.prototype.defined=!1;ie.prototype.mustUseProperty=!1;ie.prototype.number=!1;ie.prototype.overloadedBoolean=!1;ie.prototype.property="";ie.prototype.spaceSeparated=!1;ie.prototype.space=void 0;let gi=0;const D=ve(),Z=ve(),Pn=ve(),w=ve(),X=ve(),ze=ve(),ae=ve();function ve(){return 2**++gi}const Nn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:Z,commaOrSpaceSeparated:ae,commaSeparated:ze,number:w,overloadedBoolean:Pn,spaceSeparated:X},Symbol.toStringTag,{value:"Module"})),dn=Object.keys(Nn);class $n extends ie{constructor(n,t,r,i){let l=-1;if(super(n,t),st(this,"space",i),typeof r=="number")for(;++l<dn.length;){const o=dn[l];st(this,dn[l],(r&Nn[o])===Nn[o])}}}$n.prototype.defined=!0;function st(e,n,t){t&&(e[n]=t)}function De(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new $n(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[Ln(r)]=r,t[Ln(l.attribute)]=r}return new Je(n,t,e.space)}const Zt=De({properties:{ariaActiveDescendant:null,ariaAtomic:Z,ariaAutoComplete:null,ariaBusy:Z,ariaChecked:Z,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:Z,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:Z,ariaFlowTo:X,ariaGrabbed:Z,ariaHasPopup:null,ariaHidden:Z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:w,ariaLive:null,ariaModal:Z,ariaMultiLine:Z,ariaMultiSelectable:Z,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:Z,ariaReadOnly:Z,ariaRelevant:null,ariaRequired:Z,ariaRoleDescription:X,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:Z,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Jt(e,n){return n in e?e[n]:n}function Gt(e,n){return Jt(e,n.toLowerCase())}const yi=De({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ze,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:D,allowPaymentRequest:D,allowUserMedia:D,alt:null,as:null,async:D,autoCapitalize:null,autoComplete:X,autoFocus:D,autoPlay:D,blocking:X,capture:null,charSet:null,checked:D,cite:null,className:X,cols:w,colSpan:null,content:null,contentEditable:Z,controls:D,controlsList:X,coords:w|ze,crossOrigin:null,data:null,dateTime:null,decoding:null,default:D,defer:D,dir:null,dirName:null,disabled:D,download:Pn,draggable:Z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:D,formTarget:null,headers:X,height:w,hidden:Pn,high:w,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:D,inputMode:null,integrity:null,is:null,isMap:D,itemId:null,itemProp:X,itemRef:X,itemScope:D,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:D,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:D,muted:D,name:null,nonce:null,noModule:D,noValidate:D,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:D,optimum:w,pattern:null,ping:X,placeholder:null,playsInline:D,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:D,referrerPolicy:null,rel:X,required:D,reversed:D,rows:w,rowSpan:w,sandbox:X,scope:null,scoped:D,seamless:D,selected:D,shadowRootClonable:D,shadowRootDelegatesFocus:D,shadowRootMode:null,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:Z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:D,useMap:null,value:Z,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:D,declare:D,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:D,noHref:D,noShade:D,noWrap:D,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:Z,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:D,disableRemotePlayback:D,prefix:null,property:null,results:w,security:null,unselectable:null},space:"html",transform:Gt}),xi=De({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ae,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:X,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:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:D,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,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:ze,g2:ze,glyphName:ze,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:ae,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,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:w,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:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ae,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ae,rev:ae,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ae,requiredFeatures:ae,requiredFonts:ae,requiredFormats:ae,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:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:ae,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ae,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ae,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Jt}),er=De({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),nr=De({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Gt}),tr=De({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),ki={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"},bi=/[A-Z]/g,ut=/-[a-z]/g,wi=/^data[-\w.:]+$/i;function Ci(e,n){const t=Ln(n);let r=n,i=ie;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&wi.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(ut,_i);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!ut.test(l)){let o=l.replace(bi,Si);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=$n}return new i(r,n)}function Si(e){return"-"+e.toLowerCase()}function _i(e){return e.charAt(1).toUpperCase()}const Ii=Qt([Zt,yi,er,nr,tr],"html"),Hn=Qt([Zt,xi,er,nr,tr],"svg");function Ei(e){return e.join(" ").trim()}function rr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ne={},mn,ct;function vi(){if(ct)return mn;ct=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
|
|
5
5
|
`,s="/",u="*",p="",m="comment",h="declaration";function C(I,x){if(typeof I!="string")throw new TypeError("First argument must be a string");if(!I)return[];x=x||{};var A=1,v=1;function R(L){var b=L.match(n);b&&(A+=b.length);var N=L.lastIndexOf(c);v=~N?L.length-N:v+L.length}function q(){var L={line:A,column:v};return function(b){return b.position=new k(L),$(),b}}function k(L){this.start=L,this.end={line:A,column:v},this.source=x.source}k.prototype.content=I;function B(L){var b=new Error(x.source+":"+A+":"+v+": "+L);if(b.reason=L,b.filename=x.source,b.line=A,b.column=v,b.source=I,!x.silent)throw b}function U(L){var b=L.exec(I);if(b){var N=b[0];return R(N),I=I.slice(N.length),b}}function $(){U(t)}function V(L){var b;for(L=L||[];b=P();)b!==!1&&L.push(b);return L}function P(){var L=q();if(!(s!=I.charAt(0)||u!=I.charAt(1))){for(var b=2;p!=I.charAt(b)&&(u!=I.charAt(b)||s!=I.charAt(b+1));)++b;if(b+=2,p===I.charAt(b-1))return B("End of comment missing");var N=I.slice(2,b-2);return v+=2,R(N),I=I.slice(b),v+=2,L({type:m,comment:N})}}function S(){var L=q(),b=U(r);if(b){if(P(),!U(i))return B("property missing ':'");var N=U(l),T=L({type:h,property:E(b[0].replace(e,p)),value:N?E(N[0].replace(e,p)):p});return U(o),T}}function j(){var L=[];V(L);for(var b;b=S();)b!==!1&&(L.push(b),V(L));return L}return $(),j()}function E(I){return I?I.replace(a,p):p}return mn=C,mn}var pt;function Ti(){if(pt)return Ne;pt=1;var e=Ne&&Ne.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.default=t;const n=e(vi());function t(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,n.default)(r),a=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:s,value:u}=c;a?i(s,u,c):u&&(l=l||{},l[s]=u)}),l}return Ne}var He={},ht;function Li(){if(ht)return He;ht=1,Object.defineProperty(He,"__esModule",{value:!0}),He.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(s){return!s||t.test(s)||e.test(s)},o=function(s,u){return u.toUpperCase()},a=function(s,u){return"".concat(u,"-")},c=function(s,u){return u===void 0&&(u={}),l(s)?s:(s=s.toLowerCase(),u.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(n,o))};return He.camelCase=c,He}var Ve,ft;function Pi(){if(ft)return Ve;ft=1;var e=Ve&&Ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Ti()),t=Li();function r(i,l){var o={};return!i||typeof i!="string"||(0,n.default)(i,function(a,c){a&&c&&(o[(0,t.camelCase)(a,l)]=c)}),o}return r.default=r,Ve=r,Ve}var Ni=Pi();const Ai=rr(Ni),ir=lr("end"),Vn=lr("start");function lr(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const n=Vn(e),t=ir(e);if(n&&t)return{start:n,end:t}}function Ye(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?dt(e.position):"start"in e||"end"in e?dt(e):"line"in e||"column"in e?An(e):""}function An(e){return mt(e&&e.line)+":"+mt(e&&e.column)}function dt(e){return An(e&&e.start)+"-"+An(e&&e.end)}function mt(e){return e&&typeof e=="number"?e:1}class ne extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ye(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ne.prototype.file="";ne.prototype.name="";ne.prototype.reason="";ne.prototype.message="";ne.prototype.stack="";ne.prototype.column=void 0;ne.prototype.line=void 0;ne.prototype.ancestors=void 0;ne.prototype.cause=void 0;ne.prototype.fatal=void 0;ne.prototype.place=void 0;ne.prototype.ruleId=void 0;ne.prototype.source=void 0;const Un={}.hasOwnProperty,zi=new Map,Mi=/[A-Z]/g,Di=new Set(["table","tbody","thead","tfoot","tr"]),Bi=new Set(["td","th"]),or="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Oi(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Wi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=qi(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Hn:Ii,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=ar(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function ar(e,n,t){if(n.type==="element")return Ri(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Fi(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Hi(e,n,t);if(n.type==="mdxjsEsm")return $i(e,n);if(n.type==="root")return Vi(e,n,t);if(n.type==="text")return Ui(e,n)}function Ri(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hn,e.schema=i),e.ancestors.push(n);const l=ur(e,n.tagName,!1),o=Yi(e,n);let a=Wn(e,n);return Di.has(n.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!mi(c):!0})),sr(e,o,l,n),qn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Fi(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ze(e,n.position)}function $i(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Ze(e,n.position)}function Hi(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Hn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:ur(e,n.name,!0),o=Xi(e,n),a=Wn(e,n);return sr(e,o,l,n),qn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Vi(e,n,t){const r={};return qn(r,Wn(e,n)),e.create(n,e.Fragment,r,t)}function Ui(e,n){return n.value}function sr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function qi(e,n,t){return r;function r(i,l,o,a){const s=Array.isArray(o.children)?t:n;return a?s(l,o,a):s(l,o)}}function Wi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),c=Vn(r);return n(i,l,o,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Yi(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Un.call(n.properties,i)){const l=Ki(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Bi.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Xi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Ze(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Ze(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function Wn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:zi;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const s=i.get(c)||0;o=c+"-"+s,i.set(c,s+1)}}const a=ar(e,l,o);a!==void 0&&t.push(a)}return t}function Ki(e,n,t){const r=Ci(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?ci(t):Ei(t)),r.property==="style"){let i=typeof t=="object"?t:Qi(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Zi(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ki[r.property]||r.property:r.attribute,t]}}function Qi(e,n){try{return Ai(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ne("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=or+"#cannot-parse-style-attribute",i}}function ur(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let l=-1,o;for(;++l<i.length;){const a=ot(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=o}else r=ot(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Un.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ze(e)}function Ze(e,n){const t=new ne("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=or+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Zi(e){const n={};let t;for(t in e)Un.call(e,t)&&(n[Ji(t)]=e[t]);return n}function Ji(e){let n=e.replace(Mi,Gi);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Gi(e){return"-"+e.toLowerCase()}const gn={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"]},el={};function nl(e,n){const t=el,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return cr(e,r,i)}function cr(e,n,t){if(tl(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return gt(e.children,n,t)}return Array.isArray(e)?gt(e,n,t):""}function gt(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=cr(e[i],n,t);return r.join("")}function tl(e){return!!(e&&typeof e=="object")}const yt=document.createElement("i");function Yn(e){const n="&"+e+";";yt.innerHTML=n;const t=yt.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ye(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function pe(e,n){return e.length>0?(ye(e,e.length,0,n),e):n}const xt={}.hasOwnProperty;function rl(e){const n={};let t=-1;for(;++t<e.length;)il(n,e[t]);return n}function il(e,n){let t;for(t in n){const i=(xt.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){xt.call(i,o)||(i[o]=[]);const a=l[o];ll(i[o],Array.isArray(a)?a:a?[a]:[])}}}function ll(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ye(e,0,0,r)}function pr(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Me(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ge=_e(/[A-Za-z]/),se=_e(/[\dA-Za-z]/),ol=_e(/[#-'*+\--9=?A-Z^-~]/);function jn(e){return e!==null&&(e<32||e===127)}const zn=_e(/\d/),al=_e(/[\dA-Fa-f]/),sl=_e(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function re(e){return e!==null&&(e<0||e===32)}function W(e){return e===-2||e===-1||e===32}const ul=_e(new RegExp("\\p{P}|\\p{S}","u")),cl=_e(/\s/);function _e(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Be(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&se(e.charCodeAt(t+1))&&se(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function K(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(c){return W(c)?(e.enter(t),a(c)):n(c)}function a(c){return W(c)&&l++<i?(e.consume(c),a):(e.exit(t),n(c))}}const pl={tokenize:hl};function hl(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),K(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const c=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=c),t=c,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const fl={tokenize:dl},kt={tokenize:ml};function dl(e){const n=this,t=[];let r=0,i,l,o;return a;function a(v){if(r<t.length){const R=t[r];return n.containerState=R[1],e.attempt(R[0].continuation,c,s)(v)}return s(v)}function c(v){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&A();const R=n.events.length;let q=R,k;for(;q--;)if(n.events[q][0]==="exit"&&n.events[q][1].type==="chunkFlow"){k=n.events[q][1].end;break}x(r);let B=R;for(;B<n.events.length;)n.events[B][1].end={...k},B++;return ye(n.events,q+1,0,n.events.slice(R)),n.events.length=B,s(v)}return a(v)}function s(v){if(r===t.length){if(!i)return m(v);if(i.currentConstruct&&i.currentConstruct.concrete)return C(v);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(kt,u,p)(v)}function u(v){return i&&A(),x(r),m(v)}function p(v){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,C(v)}function m(v){return n.containerState={},e.attempt(kt,h,C)(v)}function h(v){return r++,t.push([n.currentConstruct,n.containerState]),m(v)}function C(v){if(v===null){i&&A(),x(0),e.consume(v);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),E(v)}function E(v){if(v===null){I(e.exit("chunkFlow"),!0),x(0),e.consume(v);return}return z(v)?(e.consume(v),I(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(v),E)}function I(v,R){const q=n.sliceStream(v);if(R&&q.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(q),n.parser.lazy[v.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const B=n.events.length;let U=B,$,V;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if($){V=n.events[U][1].end;break}$=!0}for(x(r),k=B;k<n.events.length;)n.events[k][1].end={...V},k++;ye(n.events,U+1,0,n.events.slice(B)),n.events.length=k}}function x(v){let R=t.length;for(;R-- >v;){const q=t[R];n.containerState=q[1],q[0].exit.call(n,e)}t.length=v}function A(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function ml(e,n,t){return K(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bt(e){if(e===null||re(e)||cl(e))return 1;if(ul(e))return 2}function Xn(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const Mn={name:"attention",resolveAll:gl,tokenize:yl};function gl(e,n){let t=-1,r,i,l,o,a,c,s,u;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[t][1].start};wt(p,-c),wt(m,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:m},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=pe(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=pe(s,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),s=pe(s,Xn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=pe(s,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(u=2,s=pe(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):u=0,ye(e,r-1,t-r+3,s),t=r+s.length-u-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function yl(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=bt(r);let l;return o;function o(c){return l=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===l)return e.consume(c),a;const s=e.exit("attentionSequence"),u=bt(c),p=!u||u===2&&i||t.includes(c),m=!i||i===2&&u||t.includes(r);return s._open=!!(l===42?p:p&&(i||!m)),s._close=!!(l===42?m:m&&(u||!p)),n(c)}}function wt(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const xl={name:"autolink",tokenize:kl};function kl(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(h){return ge(h)?(e.consume(h),o):h===64?t(h):s(h)}function o(h){return h===43||h===45||h===46||se(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,c):(h===43||h===45||h===46||se(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function c(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||jn(h)?t(h):(e.consume(h),c)}function s(h){return h===64?(e.consume(h),u):ol(h)?(e.consume(h),s):t(h)}function u(h){return se(h)?p(h):t(h)}function p(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):m(h)}function m(h){if((h===45||se(h))&&r++<63){const C=h===45?m:p;return e.consume(h),C}return t(h)}}const pn={partial:!0,tokenize:bl};function bl(e,n,t){return r;function r(l){return W(l)?K(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||z(l)?n(l):t(l)}}const hr={continuation:{tokenize:Cl},exit:Sl,name:"blockQuote",tokenize:wl};function wl(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return W(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function Cl(e,n,t){const r=this;return i;function i(o){return W(o)?K(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(hr,n,t)(o)}}function Sl(e){e.exit("blockQuote")}const fr={name:"characterEscape",tokenize:_l};function _l(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return sl(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const dr={name:"characterReference",tokenize:Il};function Il(e,n,t){const r=this;let i=0,l,o;return a;function a(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),c}function c(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),l=31,o=se,u(p))}function s(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=al,u):(e.enter("characterReferenceValue"),l=7,o=zn,u(p))}function u(p){if(p===59&&i){const m=e.exit("characterReferenceValue");return o===se&&!Yn(r.sliceSerialize(m))?t(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(p)&&i++<l?(e.consume(p),u):t(p)}}const Ct={partial:!0,tokenize:vl},St={concrete:!0,name:"codeFenced",tokenize:El};function El(e,n,t){const r=this,i={partial:!0,tokenize:q};let l=0,o=0,a;return c;function c(k){return s(k)}function s(k){const B=r.events[r.events.length-1];return l=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(o++,e.consume(k),u):o<3?t(k):(e.exit("codeFencedFenceSequence"),W(k)?K(e,p,"whitespace")(k):p(k))}function p(k){return k===null||z(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(Ct,E,R)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(k)):W(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),K(e,h,"whitespace")(k)):k===96&&k===a?t(k):(e.consume(k),m)}function h(k){return k===null||z(k)?p(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(k))}function C(k){return k===null||z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(k)):k===96&&k===a?t(k):(e.consume(k),C)}function E(k){return e.attempt(i,R,I)(k)}function I(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return l>0&&W(k)?K(e,A,"linePrefix",l+1)(k):A(k)}function A(k){return k===null||z(k)?e.check(Ct,E,R)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||z(k)?(e.exit("codeFlowValue"),A(k)):(e.consume(k),v)}function R(k){return e.exit("codeFenced"),n(k)}function q(k,B,U){let $=0;return V;function V(b){return k.enter("lineEnding"),k.consume(b),k.exit("lineEnding"),P}function P(b){return k.enter("codeFencedFence"),W(b)?K(k,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):S(b)}function S(b){return b===a?(k.enter("codeFencedFenceSequence"),j(b)):U(b)}function j(b){return b===a?($++,k.consume(b),j):$>=o?(k.exit("codeFencedFenceSequence"),W(b)?K(k,L,"whitespace")(b):L(b)):U(b)}function L(b){return b===null||z(b)?(k.exit("codeFencedFence"),B(b)):U(b)}}}function vl(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const yn={name:"codeIndented",tokenize:Ll},Tl={partial:!0,tokenize:Pl};function Ll(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),K(e,l,"linePrefix",5)(s)}function l(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(s):t(s)}function o(s){return s===null?c(s):z(s)?e.attempt(Tl,o,c)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||z(s)?(e.exit("codeFlowValue"),o(s)):(e.consume(s),a)}function c(s){return e.exit("codeIndented"),n(s)}}function Pl(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):K(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):z(o)?i(o):t(o)}}const Nl={name:"codeText",previous:jl,resolve:Al,tokenize:zl};function Al(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function jl(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zl(e,n,t){let r=0,i,l;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),a(p)}function a(p){return p===96?(e.consume(p),r++,a):(e.exit("codeTextSequence"),c(p))}function c(p){return p===null?t(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),c):p===96?(l=e.enter("codeTextSequence"),i=0,u(p)):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("codeTextData"),s(p))}function s(p){return p===null||p===32||p===96||z(p)?(e.exit("codeTextData"),c(p)):(e.consume(p),s)}function u(p){return p===96?(e.consume(p),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(p)):(l.type="codeTextData",s(p))}}class Ml{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ue(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Ue(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ue(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);Ue(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Ue(this.left,t.reverse())}}}function Ue(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function mr(e){const n={};let t=-1,r,i,l,o,a,c,s;const u=new Ml(e);for(;++t<u.length;){for(;t in n;)t=n[t];if(r=u.get(t),t&&r[1].type==="chunkFlow"&&u.get(t-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Dl(u,t)),t=n[t],s=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=u.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,t),a.unshift(r),u.splice(i,t-i+1,a))}}return ye(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!s}function Dl(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,c=[],s={};let u,p,m=-1,h=t,C=0,E=0;const I=[E];for(;h;){for(;e.get(++i)[1]!==h;);l.push(i),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),p&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=h,h=h.next}for(h=t;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(E=m+1,I.push(E),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):I.pop(),m=I.length;m--;){const x=a.slice(I[m],I[m+1]),A=l.pop();c.push([A,A+x.length-1]),e.splice(A,2,x)}for(c.reverse(),m=-1;++m<c.length;)s[C+c[m][0]]=C+c[m][1],C+=c[m][1]-c[m][0]-1;return s}const Bl={resolve:Rl,tokenize:Fl},Ol={partial:!0,tokenize:$l};function Rl(e){return mr(e),e}function Fl(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):z(a)?e.check(Ol,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function $l(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),K(e,l,"linePrefix")}function l(o){if(o===null||z(o))return t(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function gr(e,n,t,r,i,l,o,a,c){const s=c||Number.POSITIVE_INFINITY;let u=0;return p;function p(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),m):x===null||x===32||x===41||jn(x)?t(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),E(x))}function m(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),m(x)):x===null||x===60||z(x)?t(x):(e.consume(x),x===92?C:h)}function C(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function E(x){return!u&&(x===null||x===41||re(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(x)):u<s&&x===40?(e.consume(x),u++,E):x===41?(e.consume(x),u--,E):x===null||x===32||x===40||jn(x)?t(x):(e.consume(x),x===92?I:E)}function I(x){return x===40||x===41||x===92?(e.consume(x),E):E(x)}}function yr(e,n,t,r,i,l){const o=this;let a=0,c;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(l),u}function u(h){return a>999||h===null||h===91||h===93&&!c||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(h):h===93?(e.exit(l),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),c||(c=!W(h)),h===92?m:p)}function m(h){return h===91||h===92||h===93?(e.consume(h),a++,p):p(h)}}function xr(e,n,t,r,i,l){let o;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,c):t(m)}function c(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),n):(e.enter(l),s(m))}function s(m){return m===o?(e.exit(l),c(o)):m===null?t(m):z(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),K(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(m))}function u(m){return m===o||m===null||z(m)?(e.exit("chunkString"),s(m)):(e.consume(m),m===92?p:u)}function p(m){return m===o||m===92?(e.consume(m),u):u(m)}}function Xe(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):W(i)?K(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Hl={name:"definition",tokenize:Ul},Vl={partial:!0,tokenize:ql};function Ul(e,n,t){const r=this;let i;return l;function l(h){return e.enter("definition"),o(h)}function o(h){return yr.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Me(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),c):t(h)}function c(h){return re(h)?Xe(e,s)(h):s(h)}function s(h){return gr(e,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(Vl,p,p)(h)}function p(h){return W(h)?K(e,m,"whitespace")(h):m(h)}function m(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function ql(e,n,t){return r;function r(a){return re(a)?Xe(e,i)(a):t(a)}function i(a){return xr(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return W(a)?K(e,o,"whitespace")(a):o(a)}function o(a){return a===null||z(a)?n(a):t(a)}}const Wl={name:"hardBreakEscape",tokenize:Yl};function Yl(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return z(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const Xl={name:"headingAtx",resolve:Kl,tokenize:Ql};function Kl(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ye(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Ql(e,n,t){let r=0;return i;function i(u){return e.enter("atxHeading"),l(u)}function l(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||re(u)?(e.exit("atxHeadingSequence"),a(u)):t(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||z(u)?(e.exit("atxHeading"),n(u)):W(u)?K(e,a,"whitespace")(u):(e.enter("atxHeadingText"),s(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),a(u))}function s(u){return u===null||u===35||re(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),s)}}const Zl=["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"],_t=["pre","script","style","textarea"],Jl={concrete:!0,name:"htmlFlow",resolveTo:no,tokenize:to},Gl={partial:!0,tokenize:io},eo={partial:!0,tokenize:ro};function no(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function to(e,n,t){const r=this;let i,l,o,a,c;return s;function s(d){return u(d)}function u(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),p}function p(d){return d===33?(e.consume(d),m):d===47?(e.consume(d),l=!0,E):d===63?(e.consume(d),i=3,r.interrupt?n:f):ge(d)?(e.consume(d),o=String.fromCharCode(d),I):t(d)}function m(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,C):ge(d)?(e.consume(d),i=4,r.interrupt?n:f):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:f):t(d)}function C(d){const he="CDATA[";return d===he.charCodeAt(a++)?(e.consume(d),a===he.length?r.interrupt?n:S:C):t(d)}function E(d){return ge(d)?(e.consume(d),o=String.fromCharCode(d),I):t(d)}function I(d){if(d===null||d===47||d===62||re(d)){const he=d===47,Ie=o.toLowerCase();return!he&&!l&&_t.includes(Ie)?(i=1,r.interrupt?n(d):S(d)):Zl.includes(o.toLowerCase())?(i=6,he?(e.consume(d),x):r.interrupt?n(d):S(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):l?A(d):v(d))}return d===45||se(d)?(e.consume(d),o+=String.fromCharCode(d),I):t(d)}function x(d){return d===62?(e.consume(d),r.interrupt?n:S):t(d)}function A(d){return W(d)?(e.consume(d),A):V(d)}function v(d){return d===47?(e.consume(d),V):d===58||d===95||ge(d)?(e.consume(d),R):W(d)?(e.consume(d),v):V(d)}function R(d){return d===45||d===46||d===58||d===95||se(d)?(e.consume(d),R):q(d)}function q(d){return d===61?(e.consume(d),k):W(d)?(e.consume(d),q):v(d)}function k(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),c=d,B):W(d)?(e.consume(d),k):U(d)}function B(d){return d===c?(e.consume(d),c=null,$):d===null||z(d)?t(d):(e.consume(d),B)}function U(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||re(d)?q(d):(e.consume(d),U)}function $(d){return d===47||d===62||W(d)?v(d):t(d)}function V(d){return d===62?(e.consume(d),P):t(d)}function P(d){return d===null||z(d)?S(d):W(d)?(e.consume(d),P):t(d)}function S(d){return d===45&&i===2?(e.consume(d),N):d===60&&i===1?(e.consume(d),T):d===62&&i===4?(e.consume(d),le):d===63&&i===3?(e.consume(d),f):d===93&&i===5?(e.consume(d),Q):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Gl,ue,j)(d)):d===null||z(d)?(e.exit("htmlFlowData"),j(d)):(e.consume(d),S)}function j(d){return e.check(eo,L,ue)(d)}function L(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),b}function b(d){return d===null||z(d)?j(d):(e.enter("htmlFlowData"),S(d))}function N(d){return d===45?(e.consume(d),f):S(d)}function T(d){return d===47?(e.consume(d),o="",O):S(d)}function O(d){if(d===62){const he=o.toLowerCase();return _t.includes(he)?(e.consume(d),le):S(d)}return ge(d)&&o.length<8?(e.consume(d),o+=String.fromCharCode(d),O):S(d)}function Q(d){return d===93?(e.consume(d),f):S(d)}function f(d){return d===62?(e.consume(d),le):d===45&&i===2?(e.consume(d),f):S(d)}function le(d){return d===null||z(d)?(e.exit("htmlFlowData"),ue(d)):(e.consume(d),le)}function ue(d){return e.exit("htmlFlow"),n(d)}}function ro(e,n,t){const r=this;return i;function i(o){return z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function io(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(pn,n,t)}}const lo={name:"htmlText",tokenize:oo};function oo(e,n,t){const r=this;let i,l,o;return a;function a(f){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(f),c}function c(f){return f===33?(e.consume(f),s):f===47?(e.consume(f),q):f===63?(e.consume(f),v):ge(f)?(e.consume(f),U):t(f)}function s(f){return f===45?(e.consume(f),u):f===91?(e.consume(f),l=0,C):ge(f)?(e.consume(f),A):t(f)}function u(f){return f===45?(e.consume(f),h):t(f)}function p(f){return f===null?t(f):f===45?(e.consume(f),m):z(f)?(o=p,T(f)):(e.consume(f),p)}function m(f){return f===45?(e.consume(f),h):p(f)}function h(f){return f===62?N(f):f===45?m(f):p(f)}function C(f){const le="CDATA[";return f===le.charCodeAt(l++)?(e.consume(f),l===le.length?E:C):t(f)}function E(f){return f===null?t(f):f===93?(e.consume(f),I):z(f)?(o=E,T(f)):(e.consume(f),E)}function I(f){return f===93?(e.consume(f),x):E(f)}function x(f){return f===62?N(f):f===93?(e.consume(f),x):E(f)}function A(f){return f===null||f===62?N(f):z(f)?(o=A,T(f)):(e.consume(f),A)}function v(f){return f===null?t(f):f===63?(e.consume(f),R):z(f)?(o=v,T(f)):(e.consume(f),v)}function R(f){return f===62?N(f):v(f)}function q(f){return ge(f)?(e.consume(f),k):t(f)}function k(f){return f===45||se(f)?(e.consume(f),k):B(f)}function B(f){return z(f)?(o=B,T(f)):W(f)?(e.consume(f),B):N(f)}function U(f){return f===45||se(f)?(e.consume(f),U):f===47||f===62||re(f)?$(f):t(f)}function $(f){return f===47?(e.consume(f),N):f===58||f===95||ge(f)?(e.consume(f),V):z(f)?(o=$,T(f)):W(f)?(e.consume(f),$):N(f)}function V(f){return f===45||f===46||f===58||f===95||se(f)?(e.consume(f),V):P(f)}function P(f){return f===61?(e.consume(f),S):z(f)?(o=P,T(f)):W(f)?(e.consume(f),P):$(f)}function S(f){return f===null||f===60||f===61||f===62||f===96?t(f):f===34||f===39?(e.consume(f),i=f,j):z(f)?(o=S,T(f)):W(f)?(e.consume(f),S):(e.consume(f),L)}function j(f){return f===i?(e.consume(f),i=void 0,b):f===null?t(f):z(f)?(o=j,T(f)):(e.consume(f),j)}function L(f){return f===null||f===34||f===39||f===60||f===61||f===96?t(f):f===47||f===62||re(f)?$(f):(e.consume(f),L)}function b(f){return f===47||f===62||re(f)?$(f):t(f)}function N(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),n):t(f)}function T(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),O}function O(f){return W(f)?K(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):Q(f)}function Q(f){return e.enter("htmlTextData"),o(f)}}const Kn={name:"labelEnd",resolveAll:co,resolveTo:po,tokenize:ho},ao={tokenize:fo},so={tokenize:mo},uo={tokenize:go};function co(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&ye(e,0,e.length,t),e}function po(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",c,n],["enter",s,n]],a=pe(a,e.slice(l+1,l+r+3)),a=pe(a,[["enter",u,n]]),a=pe(a,Xn(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=pe(a,[["exit",u,n],e[o-2],e[o-1],["exit",s,n]]),a=pe(a,e.slice(o+1)),a=pe(a,[["exit",c,n]]),ye(e,l,e.length,a),e}function ho(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(m){return l?l._inactive?p(m):(o=r.parser.defined.includes(Me(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),c):t(m)}function c(m){return m===40?e.attempt(ao,u,o?u:p)(m):m===91?e.attempt(so,u,o?s:p)(m):o?u(m):p(m)}function s(m){return e.attempt(uo,u,p)(m)}function u(m){return n(m)}function p(m){return l._balanced=!0,t(m)}}function fo(e,n,t){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return re(p)?Xe(e,l)(p):l(p)}function l(p){return p===41?u(p):gr(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return re(p)?Xe(e,c)(p):u(p)}function a(p){return t(p)}function c(p){return p===34||p===39||p===40?xr(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):u(p)}function s(p){return re(p)?Xe(e,u)(p):u(p)}function u(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),n):t(p)}}function mo(e,n,t){const r=this;return i;function i(a){return yr.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Me(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function go(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const yo={name:"labelStartImage",resolveAll:Kn.resolveAll,tokenize:xo};function xo(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const ko={name:"labelStartLink",resolveAll:Kn.resolveAll,tokenize:bo};function bo(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const xn={name:"lineEnding",tokenize:wo};function wo(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),K(e,n,"linePrefix")}}const sn={name:"thematicBreak",tokenize:Co};function Co(e,n,t){let r=0,i;return l;function l(s){return e.enter("thematicBreak"),o(s)}function o(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),c(s)):r>=3&&(s===null||z(s))?(e.exit("thematicBreak"),n(s)):t(s)}function c(s){return s===i?(e.consume(s),r++,c):(e.exit("thematicBreakSequence"),W(s)?K(e,a,"whitespace")(s):a(s))}}const te={continuation:{tokenize:Eo},exit:To,name:"list",tokenize:Io},So={partial:!0,tokenize:Lo},_o={partial:!0,tokenize:vo};function Io(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(h){const C=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:zn(h)){if(r.containerState.type||(r.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(sn,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(h)}return t(h)}function c(h){return zn(h)&&++o<10?(e.consume(h),c):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(pn,r.interrupt?t:u,e.attempt(So,m,p))}function u(h){return r.containerState.initialBlankLine=!0,l++,m(h)}function p(h){return W(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),m):t(h)}function m(h){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function Eo(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(pn,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,K(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!W(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(_o,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,K(e,e.attempt(te,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function vo(e,n,t){const r=this;return K(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function To(e){e.exit(this.containerState.type)}function Lo(e,n,t){const r=this;return K(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!W(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const It={name:"setextUnderline",resolveTo:Po,tokenize:No};function Po(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function No(e,n,t){const r=this;let i;return l;function l(s){let u=r.events.length,p;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){p=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=s,o(s)):t(s)}function o(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),W(s)?K(e,c,"lineSuffix")(s):c(s))}function c(s){return s===null||z(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const Ao={tokenize:jo};function jo(e){const n=this,t=e.attempt(pn,r,e.attempt(this.parser.constructs.flowInitial,i,K(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Bl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const zo={resolveAll:br()},Mo=kr("string"),Do=kr("text");function kr(e){return{resolveAll:br(e==="text"?Bo:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(u){return s(u)?l(u):a(u)}function a(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),c}function c(u){return s(u)?(t.exit("data"),l(u)):(t.consume(u),c)}function s(u){if(u===null)return!0;const p=i[u];let m=-1;if(p)for(;++m<p.length;){const h=p[m];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function br(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function Bo(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,c;for(;l--;){const s=i[l];if(typeof s=="string"){for(o=s.length;s.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(s===-2)c=!0,a++;else if(s!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Oo={42:te,43:te,45:te,48:te,49:te,50:te,51:te,52:te,53:te,54:te,55:te,56:te,57:te,62:hr},Ro={91:Hl},Fo={[-2]:yn,[-1]:yn,32:yn},$o={35:Xl,42:sn,45:[It,sn],60:Jl,61:It,95:sn,96:St,126:St},Ho={38:dr,92:fr},Vo={[-5]:xn,[-4]:xn,[-3]:xn,33:yo,38:dr,42:Mn,60:[xl,lo],91:ko,92:[Wl,fr],93:Kn,95:Mn,96:Nl},Uo={null:[Mn,zo]},qo={null:[42,95]},Wo={null:[]},Yo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qo,contentInitial:Ro,disable:Wo,document:Oo,flow:$o,flowInitial:Fo,insideSpan:Uo,string:Ho,text:Vo},Symbol.toStringTag,{value:"Module"}));function Xo(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const c={attempt:B(q),check:B(k),consume:A,enter:v,exit:R,interrupt:B(k,{interrupt:!0})},s={code:null,containerState:{},defineSkip:E,events:[],now:C,parser:e,previous:null,sliceSerialize:m,sliceStream:h,write:p};let u=n.tokenize.call(s,c);return n.resolveAll&&l.push(n),s;function p(P){return o=pe(o,P),I(),o[o.length-1]!==null?[]:(U(n,0),s.events=Xn(l,s.events,s),s.events)}function m(P,S){return Qo(h(P),S)}function h(P){return Ko(o,P)}function C(){const{_bufferIndex:P,_index:S,line:j,column:L,offset:b}=r;return{_bufferIndex:P,_index:S,line:j,column:L,offset:b}}function E(P){i[P.line]=P.column,V()}function I(){let P;for(;r._index<o.length;){const S=o[r._index];if(typeof S=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<S.length;)x(S.charCodeAt(r._bufferIndex));else x(S)}}function x(P){u=u(P)}function A(P){z(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,V()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=P}function v(P,S){const j=S||{};return j.type=P,j.start=C(),s.events.push(["enter",j,s]),a.push(j),j}function R(P){const S=a.pop();return S.end=C(),s.events.push(["exit",S,s]),S}function q(P,S){U(P,S.from)}function k(P,S){S.restore()}function B(P,S){return j;function j(L,b,N){let T,O,Q,f;return Array.isArray(L)?ue(L):"tokenize"in L?ue([L]):le(L);function le(J){return Oe;function Oe(be){const Te=be!==null&&J[be],Le=be!==null&&J.null,en=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return ue(en)(be)}}function ue(J){return T=J,O=0,J.length===0?N:d(J[O])}function d(J){return Oe;function Oe(be){return f=$(),Q=J,J.partial||(s.currentConstruct=J),J.name&&s.parser.constructs.disable.null.includes(J.name)?Ie():J.tokenize.call(S?Object.assign(Object.create(s),S):s,c,he,Ie)(be)}}function he(J){return P(Q,f),b}function Ie(J){return f.restore(),++O<T.length?d(T[O]):N}}}function U(P,S){P.resolveAll&&!l.includes(P)&&l.push(P),P.resolve&&ye(s.events,S,s.events.length-S,P.resolve(s.events.slice(S),s)),P.resolveTo&&(s.events=P.resolveTo(s.events,s))}function $(){const P=C(),S=s.previous,j=s.currentConstruct,L=s.events.length,b=Array.from(a);return{from:L,restore:N};function N(){r=P,s.previous=S,s.currentConstruct=j,s.events.length=L,a=b,V()}}function V(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ko(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Qo(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
6
6
|
`;break}case-3:{o=`\r
|
|
7
7
|
`;break}case-2:{o=n?" ":" ";break}case-1:{if(!n&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Zo(e){const r={constructs:rl([Yo,...(e||{}).extensions||[]]),content:i(pl),defined:[],document:i(fl),flow:i(Ao),lazy:{},string:i(Mo),text:i(Do)};return r;function i(l){return o;function o(a){return Xo(r,l,a)}}}function Jo(e){for(;!mr(e););return e}const Et=/[\0\t\n\r]/g;function Go(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const c=[];let s,u,p,m,h;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),p=0,n="",t&&(l.charCodeAt(0)===65279&&p++,t=void 0);p<l.length;){if(Et.lastIndex=p,s=Et.exec(l),m=s&&s.index!==void 0?s.index:l.length,h=l.charCodeAt(m),!s){n=l.slice(p);break}if(h===10&&p===m&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),p<m&&(c.push(l.slice(p,m)),e+=m-p),h){case 0:{c.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,c.push(-2);e++<u;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}p=m+1}return a&&(r&&c.push(-5),n&&c.push(n),c.push(null)),c}}const ea=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function na(e){return e.replace(ea,ta)}function ta(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return pr(t.slice(l?2:1),l?16:10)}return Yn(t)||e}const wr={}.hasOwnProperty;function ra(e,n,t){return typeof n!="string"&&(t=n,n=void 0),ia(t)(Jo(Zo(t).document().write(Go()(e,n,!0))))}function ia(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(it),autolinkProtocol:$,autolinkEmail:$,atxHeading:l(nt),blockQuote:l(Le),characterEscape:$,characterReference:$,codeFenced:l(en),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(en,o),codeText:l(Or,o),codeTextData:$,data:$,codeFlowValue:$,definition:l(Rr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Fr),hardBreakEscape:l(tt),hardBreakTrailing:l(tt),htmlFlow:l(rt,o),htmlFlowData:$,htmlText:l(rt,o),htmlTextData:$,image:l($r),label:o,link:l(it),listItem:l(Hr),listItemValue:m,listOrdered:l(lt,p),listUnordered:l(lt),paragraph:l(Vr),reference:d,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(nt),strong:l(Ur),thematicBreak:l(Wr)},exit:{atxHeading:c(),atxHeadingSequence:q,autolink:c(),autolinkEmail:Te,autolinkProtocol:be,blockQuote:c(),characterEscapeValue:V,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:J,characterReference:Oe,codeFenced:c(I),codeFencedFence:E,codeFencedFenceInfo:h,codeFencedFenceMeta:C,codeFlowValue:V,codeIndented:c(x),codeText:c(b),codeTextData:V,data:V,definition:c(),definitionDestinationString:R,definitionLabelString:A,definitionTitleString:v,emphasis:c(),hardBreakEscape:c(S),hardBreakTrailing:c(S),htmlFlow:c(j),htmlFlowData:V,htmlText:c(L),htmlTextData:V,image:c(T),label:Q,labelText:O,lineEnding:P,link:c(N),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:he,resourceDestinationString:f,resourceTitleString:le,resource:ue,setextHeading:c(U),setextHeadingLineSequence:B,setextHeadingText:k,strong:c(),thematicBreak:c()}};Cr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(y){let _={type:"root",children:[]};const M={stack:[_],tokenStack:[],config:n,enter:a,exit:s,buffer:o,resume:u,data:t},H=[];let Y=-1;for(;++Y<y.length;)if(y[Y][1].type==="listOrdered"||y[Y][1].type==="listUnordered")if(y[Y][0]==="enter")H.push(Y);else{const fe=H.pop();Y=i(y,fe,Y)}for(Y=-1;++Y<y.length;){const fe=n[y[Y][0]];wr.call(fe,y[Y][1].type)&&fe[y[Y][1].type].call(Object.assign({sliceSerialize:y[Y][2].sliceSerialize},M),y[Y][1])}if(M.tokenStack.length>0){const fe=M.tokenStack[M.tokenStack.length-1];(fe[1]||vt).call(M,void 0,fe[0])}for(_.position={start:we(y.length>0?y[0][1].start:{line:1,column:1,offset:0}),end:we(y.length>0?y[y.length-2][1].end:{line:1,column:1,offset:0})},Y=-1;++Y<n.transforms.length;)_=n.transforms[Y](_)||_;return _}function i(y,_,M){let H=_-1,Y=-1,fe=!1,Ee,xe,Re,Fe;for(;++H<=M;){const oe=y[H];switch(oe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{oe[0]==="enter"?Y++:Y--,Fe=void 0;break}case"lineEndingBlank":{oe[0]==="enter"&&(Ee&&!Fe&&!Y&&!Re&&(Re=H),Fe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Fe=void 0}if(!Y&&oe[0]==="enter"&&oe[1].type==="listItemPrefix"||Y===-1&&oe[0]==="exit"&&(oe[1].type==="listUnordered"||oe[1].type==="listOrdered")){if(Ee){let Pe=H;for(xe=void 0;Pe--;){const ke=y[Pe];if(ke[1].type==="lineEnding"||ke[1].type==="lineEndingBlank"){if(ke[0]==="exit")continue;xe&&(y[xe][1].type="lineEndingBlank",fe=!0),ke[1].type="lineEnding",xe=Pe}else if(!(ke[1].type==="linePrefix"||ke[1].type==="blockQuotePrefix"||ke[1].type==="blockQuotePrefixWhitespace"||ke[1].type==="blockQuoteMarker"||ke[1].type==="listItemIndent"))break}Re&&(!xe||Re<xe)&&(Ee._spread=!0),Ee.end=Object.assign({},xe?y[xe][1].start:oe[1].end),y.splice(xe||H,0,["exit",Ee,oe[2]]),H++,M++}if(oe[1].type==="listItemPrefix"){const Pe={type:"listItem",_spread:!1,start:Object.assign({},oe[1].start),end:void 0};Ee=Pe,y.splice(H,0,["enter",Pe,oe[2]]),H++,M++,Re=void 0,Fe=!0}}}return y[_][1]._spread=fe,M}function l(y,_){return M;function M(H){a.call(this,y(H),H),_&&_.call(this,H)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(y,_,M){this.stack[this.stack.length-1].children.push(y),this.stack.push(y),this.tokenStack.push([_,M||void 0]),y.position={start:we(_.start),end:void 0}}function c(y){return _;function _(M){y&&y.call(this,M),s.call(this,M)}}function s(y,_){const M=this.stack.pop(),H=this.tokenStack.pop();if(H)H[0].type!==y.type&&(_?_.call(this,y,H[0]):(H[1]||vt).call(this,y,H[0]));else throw new Error("Cannot close `"+y.type+"` ("+Ye({start:y.start,end:y.end})+"): it’s not open");M.position.end=we(y.end)}function u(){return nl(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(y){if(this.data.expectingFirstListItemValue){const _=this.stack[this.stack.length-2];_.start=Number.parseInt(this.sliceSerialize(y),10),this.data.expectingFirstListItemValue=void 0}}function h(){const y=this.resume(),_=this.stack[this.stack.length-1];_.lang=y}function C(){const y=this.resume(),_=this.stack[this.stack.length-1];_.meta=y}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){const y=this.resume(),_=this.stack[this.stack.length-1];_.value=y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const y=this.resume(),_=this.stack[this.stack.length-1];_.value=y.replace(/(\r?\n|\r)$/g,"")}function A(y){const _=this.resume(),M=this.stack[this.stack.length-1];M.label=_,M.identifier=Me(this.sliceSerialize(y)).toLowerCase()}function v(){const y=this.resume(),_=this.stack[this.stack.length-1];_.title=y}function R(){const y=this.resume(),_=this.stack[this.stack.length-1];_.url=y}function q(y){const _=this.stack[this.stack.length-1];if(!_.depth){const M=this.sliceSerialize(y).length;_.depth=M}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function B(y){const _=this.stack[this.stack.length-1];_.depth=this.sliceSerialize(y).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function $(y){const M=this.stack[this.stack.length-1].children;let H=M[M.length-1];(!H||H.type!=="text")&&(H=qr(),H.position={start:we(y.start),end:void 0},M.push(H)),this.stack.push(H)}function V(y){const _=this.stack.pop();_.value+=this.sliceSerialize(y),_.position.end=we(y.end)}function P(y){const _=this.stack[this.stack.length-1];if(this.data.atHardBreak){const M=_.children[_.children.length-1];M.position.end=we(y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(_.type)&&($.call(this,y),V.call(this,y))}function S(){this.data.atHardBreak=!0}function j(){const y=this.resume(),_=this.stack[this.stack.length-1];_.value=y}function L(){const y=this.resume(),_=this.stack[this.stack.length-1];_.value=y}function b(){const y=this.resume(),_=this.stack[this.stack.length-1];_.value=y}function N(){const y=this.stack[this.stack.length-1];if(this.data.inReference){const _=this.data.referenceType||"shortcut";y.type+="Reference",y.referenceType=_,delete y.url,delete y.title}else delete y.identifier,delete y.label;this.data.referenceType=void 0}function T(){const y=this.stack[this.stack.length-1];if(this.data.inReference){const _=this.data.referenceType||"shortcut";y.type+="Reference",y.referenceType=_,delete y.url,delete y.title}else delete y.identifier,delete y.label;this.data.referenceType=void 0}function O(y){const _=this.sliceSerialize(y),M=this.stack[this.stack.length-2];M.label=na(_),M.identifier=Me(_).toLowerCase()}function Q(){const y=this.stack[this.stack.length-1],_=this.resume(),M=this.stack[this.stack.length-1];if(this.data.inReference=!0,M.type==="link"){const H=y.children;M.children=H}else M.alt=_}function f(){const y=this.resume(),_=this.stack[this.stack.length-1];_.url=y}function le(){const y=this.resume(),_=this.stack[this.stack.length-1];_.title=y}function ue(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function he(y){const _=this.resume(),M=this.stack[this.stack.length-1];M.label=_,M.identifier=Me(this.sliceSerialize(y)).toLowerCase(),this.data.referenceType="full"}function Ie(y){this.data.characterReferenceType=y.type}function J(y){const _=this.sliceSerialize(y),M=this.data.characterReferenceType;let H;M?(H=pr(_,M==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):H=Yn(_);const Y=this.stack[this.stack.length-1];Y.value+=H}function Oe(y){const _=this.stack.pop();_.position.end=we(y.end)}function be(y){V.call(this,y);const _=this.stack[this.stack.length-1];_.url=this.sliceSerialize(y)}function Te(y){V.call(this,y);const _=this.stack[this.stack.length-1];_.url="mailto:"+this.sliceSerialize(y)}function Le(){return{type:"blockquote",children:[]}}function en(){return{type:"code",lang:null,meta:null,value:""}}function Or(){return{type:"inlineCode",value:""}}function Rr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Fr(){return{type:"emphasis",children:[]}}function nt(){return{type:"heading",depth:0,children:[]}}function tt(){return{type:"break"}}function rt(){return{type:"html",value:""}}function $r(){return{type:"image",title:null,url:"",alt:null}}function it(){return{type:"link",title:null,url:"",children:[]}}function lt(y){return{type:"list",ordered:y.type==="listOrdered",start:null,spread:y._spread,children:[]}}function Hr(y){return{type:"listItem",spread:y._spread,checked:null,children:[]}}function Vr(){return{type:"paragraph",children:[]}}function Ur(){return{type:"strong",children:[]}}function qr(){return{type:"text",value:""}}function Wr(){return{type:"thematicBreak"}}}function we(e){return{line:e.line,column:e.column,offset:e.offset}}function Cr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Cr(e,r):la(e,r)}}function la(e,n){let t;for(t in n)if(wr.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function vt(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Ye({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Ye({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Ye({start:n.start,end:n.end})+") is still open")}function oa(e){const n=this;n.parser=t;function t(r){return ra(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function aa(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function sa(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
package/dist/index.js
CHANGED
package/package.json
CHANGED