@assistrio/chat-widget 0.1.0
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/README.md +88 -0
- package/dist/api.d.ts +3 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/assistrio-chat.css +2 -0
- package/dist/assistrio-chat.js +37 -0
- package/dist/bootstrap.d.ts +9 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/browser.d.ts +12 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/components/AdminLiveChatAdapter.d.ts +38 -0
- package/dist/components/AdminLiveChatAdapter.d.ts.map +1 -0
- package/dist/components/chat-ui/Chat.d.ts +117 -0
- package/dist/components/chat-ui/Chat.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatBubble.d.ts +36 -0
- package/dist/components/chat-ui/ChatBubble.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatComposer.d.ts +34 -0
- package/dist/components/chat-ui/ChatComposer.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatHeader.d.ts +54 -0
- package/dist/components/chat-ui/ChatHeader.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatLauncherBubble.d.ts +41 -0
- package/dist/components/chat-ui/ChatLauncherBubble.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatMessages.d.ts +45 -0
- package/dist/components/chat-ui/ChatMessages.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatSources.d.ts +12 -0
- package/dist/components/chat-ui/ChatSources.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatWithLauncher.d.ts +22 -0
- package/dist/components/chat-ui/ChatWithLauncher.d.ts.map +1 -0
- package/dist/components/chat-ui/index.d.ts +19 -0
- package/dist/components/chat-ui/index.d.ts.map +1 -0
- package/dist/components/chat-ui/types.d.ts +42 -0
- package/dist/components/chat-ui/types.d.ts.map +1 -0
- package/dist/components/chat-ui/utils.d.ts +4 -0
- package/dist/components/chat-ui/utils.d.ts.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/hooks/usePreferredColorScheme.d.ts +5 -0
- package/dist/hooks/usePreferredColorScheme.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +30 -0
- package/dist/index.mjs.map +7 -0
- package/dist/lib/apiFetch.d.ts +6 -0
- package/dist/lib/apiFetch.d.ts.map +1 -0
- package/dist/lib/preview-display-merge.d.ts +8 -0
- package/dist/lib/preview-display-merge.d.ts.map +1 -0
- package/dist/lib/welcomeMessage.d.ts +9 -0
- package/dist/lib/welcomeMessage.d.ts.map +1 -0
- package/dist/models/botChatUI.d.ts +54 -0
- package/dist/models/botChatUI.d.ts.map +1 -0
- package/dist/normalize.d.ts +3 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/types.d.ts +128 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/widget-root.d.ts +6 -0
- package/dist/widget-root.d.ts.map +1 -0
- package/package.json +60 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var nu=Object.create;var Xa=Object.defineProperty;var lu=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var uu=Object.getPrototypeOf,su=Object.prototype.hasOwnProperty;var Bt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ho=(e,t)=>{for(var a in t)Xa(e,a,{get:t[a],enumerable:!0})},du=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of iu(t))!su.call(e,o)&&o!==a&&Xa(e,o,{get:()=>t[o],enumerable:!(r=lu(t,o))||r.enumerable});return e};var zo=(e,t,a)=>(a=e!=null?nu(uu(e)):{},du(t||!e||!e.__esModule?Xa(a,"default",{value:e,enumerable:!0}):a,e));var pn=Bt((Xh,cn)=>{"use strict";var un=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Qu=/\n/g,Zu=/^\s*/,$u=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ju=/^:\s*/,Yu=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,es=/^[;\s]*/,ts=/^\s+|\s+$/g,as=`
|
|
2
|
+
`,sn="/",dn="*",it="",rs="comment",os="declaration";function ns(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,r=1;function o(h){var x=h.match(Qu);x&&(a+=x.length);var S=h.lastIndexOf(as);r=~S?h.length-S:r+h.length}function n(){var h={line:a,column:r};return function(x){return x.position=new l(h),s(),x}}function l(h){this.start=h,this.end={line:a,column:r},this.source=t.source}l.prototype.content=e;function i(h){var x=new Error(t.source+":"+a+":"+r+": "+h);if(x.reason=h,x.filename=t.source,x.line=a,x.column=r,x.source=e,!t.silent)throw x}function u(h){var x=h.exec(e);if(x){var S=x[0];return o(S),e=e.slice(S.length),x}}function s(){u(Zu)}function d(h){var x;for(h=h||[];x=f();)x!==!1&&h.push(x);return h}function f(){var h=n();if(!(sn!=e.charAt(0)||dn!=e.charAt(1))){for(var x=2;it!=e.charAt(x)&&(dn!=e.charAt(x)||sn!=e.charAt(x+1));)++x;if(x+=2,it===e.charAt(x-1))return i("End of comment missing");var S=e.slice(2,x-2);return r+=2,o(S),e=e.slice(x),r+=2,h({type:rs,comment:S})}}function p(){var h=n(),x=u($u);if(x){if(f(),!u(Ju))return i("property missing ':'");var S=u(Yu),L=h({type:os,property:fn(x[0].replace(un,it)),value:S?fn(S[0].replace(un,it)):it});return u(es),L}}function c(){var h=[];d(h);for(var x;x=p();)x!==!1&&(h.push(x),d(h));return h}return s(),c()}function fn(e){return e?e.replace(ts,it):it}cn.exports=ns});var mn=Bt(Et=>{"use strict";var ls=Et&&Et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0});Et.default=us;var is=ls(pn());function us(e,t){let a=null;if(!e||typeof e!="string")return a;let r=(0,is.default)(e),o=typeof t=="function";return r.forEach(n=>{if(n.type!=="declaration")return;let{property:l,value:i}=n;o?t(l,i,n):i&&(a=a||{},a[l]=i)}),a}});var gn=Bt(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.camelCase=void 0;var ss=/^--[a-zA-Z0-9_-]+$/,ds=/-([a-z])/g,fs=/^[^-]+$/,cs=/^-(webkit|moz|ms|o|khtml)-/,ps=/^-(ms)-/,ms=function(e){return!e||fs.test(e)||ss.test(e)},hs=function(e,t){return t.toUpperCase()},hn=function(e,t){return"".concat(t,"-")},gs=function(e,t){return t===void 0&&(t={}),ms(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(ps,hn):e=e.replace(cs,hn),e.replace(ds,hs))};la.camelCase=gs});var Ln=Bt((ir,xn)=>{"use strict";var xs=ir&&ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ls=xs(mn()),Is=gn();function lr(e,t){var a={};return!e||typeof e!="string"||(0,Ls.default)(e,function(r,o){r&&o&&(a[(0,Is.camelCase)(r,t)]=o)}),a}lr.default=lr;xn.exports=lr});var Wl=Bt((wk,Nl)=>{"use strict";var Ta=Object.prototype.hasOwnProperty,zl=Object.prototype.toString,Rl=Object.defineProperty,El=Object.getOwnPropertyDescriptor,Ol=function(t){return typeof Array.isArray=="function"?Array.isArray(t):zl.call(t)==="[object Array]"},ql=function(t){if(!t||zl.call(t)!=="[object Object]")return!1;var a=Ta.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ta.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!r)return!1;var o;for(o in t);return typeof o>"u"||Ta.call(t,o)},Ul=function(t,a){Rl&&a.name==="__proto__"?Rl(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},Hl=function(t,a){if(a==="__proto__")if(Ta.call(t,a)){if(El)return El(t,a).value}else return;return t[a]};Nl.exports=function e(){var t,a,r,o,n,l,i=arguments[0],u=1,s=arguments.length,d=!1;for(typeof i=="boolean"&&(d=i,i=arguments[1]||{},u=2),(i==null||typeof i!="object"&&typeof i!="function")&&(i={});u<s;++u)if(t=arguments[u],t!=null)for(a in t)r=Hl(i,a),o=Hl(t,a),i!==o&&(d&&o&&(ql(o)||(n=Ol(o)))?(n?(n=!1,l=r&&Ol(r)?r:[]):l=r&&ql(r)?r:{},Ul(i,{name:a,newValue:e(d,l,o)})):typeof o<"u"&&Ul(i,{name:a,newValue:o}));return i}});function ue(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function fu(e){return e.replace(/\/+$/,"")}function Ka(e){if(e==="left"||e==="right")return e}function No(e){if(e==="runtime"||e==="preview")return e}function cu(e){if(!e||typeof e!="object")return{};let t=e,a=ue(t.widgetInitPath),r=ue(t.chatPostPath);return{botId:ue(t.botId),apiBaseUrl:ue(t.apiBaseUrl),mode:No(t.mode),accessKey:ue(t.accessKey),secretKey:ue(t.secretKey),platformVisitorId:ue(t.platformVisitorId),chatVisitorId:ue(t.chatVisitorId),authToken:ue(t.authToken),position:Ka(t.position),previewOverrides:t.previewOverrides&&typeof t.previewOverrides=="object"?t.previewOverrides:void 0,disableRemoteConfig:typeof t.disableRemoteConfig=="boolean"?t.disableRemoteConfig:void 0,...typeof t.sessionPreview=="boolean"?{sessionPreview:t.sessionPreview}:{},...typeof t.persistChatSession=="boolean"?{persistChatSession:t.persistChatSession}:{},...a?{widgetInitPath:a}:{},...r?{chatPostPath:r}:{}}}function Wo(e){let t=ue(e.botId),a=ue(e.apiBaseUrl),r=Ka(e.position);if(!t)throw new Error("Embed config is invalid: botId is required.");if(!a)throw new Error("Embed config is invalid: apiBaseUrl is required.");if(e.position!=null&&!r)throw new Error('Embed config is invalid: position must be "left" or "right".')}function ot(e){return Wo(e),{botId:e.botId.trim(),apiBaseUrl:fu(e.apiBaseUrl.trim()),mode:No(e.mode)??"runtime",accessKey:ue(e.accessKey),secretKey:ue(e.secretKey),widgetInitPath:ue(e.widgetInitPath),chatPostPath:ue(e.chatPostPath),platformVisitorId:ue(e.platformVisitorId),chatVisitorId:ue(e.chatVisitorId),authToken:ue(e.authToken),sessionPreview:e.sessionPreview===!0,persistChatSession:typeof e.persistChatSession=="boolean"?e.persistChatSession:!ue(e.authToken)&&e.sessionPreview!==!0,position:Ka(e.position),previewOverrides:e.previewOverrides,disableRemoteConfig:typeof e.disableRemoteConfig=="boolean"?e.disableRemoteConfig:void 0}}function pu(e){let t=cu(e);return ot(t)}function mu(e,t){return t==="preview"?`${e}/api/widget/preview/init`:`${e}/api/widget/init`}function hu(e,t){if(/^https?:\/\//i.test(t))return t;let a=e.replace(/\/+$/,""),r=t.startsWith("/")?t:`/${t}`;return`${a}${r}`}function gu(e){let t=typeof e.authToken=="string"?e.authToken.trim():"";return t||void 0}function Vo(e){return{botId:e.botId,mode:"preview",...e.previewOverrides?{previewOverrides:e.previewOverrides}:{}}}function xu(e){if((e.mode??"runtime")==="preview"){let t=gu(e);return t?{...Vo(e),authToken:t}:e.sessionPreview===!0?Vo(e):{botId:e.botId,mode:"preview",...e.platformVisitorId?{platformVisitorId:e.platformVisitorId}:{},...e.chatVisitorId?{chatVisitorId:e.chatVisitorId}:{},...e.previewOverrides?{previewOverrides:e.previewOverrides}:{},...e.accessKey?{accessKey:e.accessKey}:{},...e.secretKey?{secretKey:e.secretKey}:{}}}return{botId:e.botId,mode:"runtime",...e.accessKey?{accessKey:e.accessKey}:{},...e.secretKey?{secretKey:e.secretKey}:{},...e.chatVisitorId?{chatVisitorId:e.chatVisitorId}:{}}}function Lu(e,t){let a=new Headers(e);return t==null||new Headers(t).forEach((o,n)=>{a.set(n,o)}),a}async function Qa(e,t){let a=ot(e),r=a.mode??"runtime",o=a.widgetInitPath?hu(a.apiBaseUrl,a.widgetInitPath):mu(a.apiBaseUrl,r),n=xu(a),{headers:l,...i}=t??{},u=Lu({"Content-Type":"application/json"},l),s=await fetch(o,{method:"POST",headers:u,body:JSON.stringify(n),...i,credentials:"include"}),d=null;try{d=await s.json()}catch{d=null}if(!s.ok){let f=typeof d?.errorCode=="string"?d.errorCode:"",p=d?.error||`Widget init failed with status ${s.status}`;throw new Error(f?`${p} (${f})`:p)}if(!d)throw new Error("Widget init failed: empty response.");if(d.status==="error"){let f=typeof d.errorCode=="string"?d.errorCode:"",p=d.error??"Widget init failed.";throw new Error(f?`${p} (${f})`:p)}return d}var Iu="Assistant",Cu="#14B8A6";function ku(e){let t=e.bot?.suggestedQuestions??e.bot?.exampleQuestions??[];return Array.isArray(t)?t.map(a=>typeof a=="string"?a.trim():"").filter(Boolean).slice(0,6):[]}function Su(e){let t=e.settings?.chatUI??{},a=typeof t.primaryColor=="string"&&/^#[0-9a-fA-F]{6}$/.test(t.primaryColor)?t.primaryColor:Cu;return{...t,primaryColor:a}}function wu(e){if(e==="left")return"bottom-left";if(e==="right")return"bottom-right"}function yu(e,t){return e.launcherPosition==="bottom-left"||e.launcherPosition==="bottom-right"?e.launcherPosition:wu(t.position)??"bottom-right"}function Yt(e,t){let a=Su(e),r=yu(a,t),o=(e.bot?.name??"").trim()||Iu;return{botId:t.botId,botName:o,avatarUrl:e.bot?.imageUrl,avatarEmoji:e.bot?.avatarEmoji,tagline:e.bot?.tagline,description:e.bot?.description,welcomeMessage:e.bot?.welcomeMessage,suggestedQuestions:ku(e),chatUI:{...a,launcherPosition:r},launcherPosition:r,brandingMessage:e.settings?.brandingMessage??a.brandingMessage,privacyText:e.settings?.privacyText}}import{createRoot as rm}from"react-dom/client";import ou from"react";import{useEffect as em,useMemo as qo,useState as Uo}from"react";import{useCallback as Wp,useEffect as Vp,useMemo as _p,useRef as Gp,useState as Do}from"react";import{useEffect as bu,useState as Pu}from"react";function _o(){let[e,t]=Pu("dark");return bu(()=>{if(typeof window>"u"||!window.matchMedia){t("dark");return}let a=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>t(a.matches?"dark":"light");return r(),a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),e}import{useCallback as Qi,useState as Fp}from"react";function F(...e){return e.filter(Boolean).join(" ")}import{useRef as Bu,useState as Fu,useEffect as Du}from"react";import{forwardRef as vu,createElement as Mu}from"react";var ea=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var Go=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var jo=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase());var Za=e=>{let t=jo(e);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as Au,createElement as Qo}from"react";var Xo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Ko=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Zo=Au(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:l,...i},u)=>Qo("svg",{ref:u,...Xo,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:ea("lucide",o),...!n&&!Ko(i)&&{"aria-hidden":"true"},...i},[...l.map(([s,d])=>Qo(s,d)),...Array.isArray(n)?n:[n]]));var $o=(e,t)=>{let a=vu(({className:r,...o},n)=>Mu(Zo,{ref:n,iconNode:t,className:ea(`lucide-${Go(Za(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Za(e),a};var Tu=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Ft=$o("bot",Tu);import{jsx as Q,jsxs as je}from"react/jsx-runtime";var Ru=()=>Q("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:Q("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),Eu=()=>Q("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:Q("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),Ou=()=>Q("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:Q("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),qu=()=>Q("svg",{className:"w-4 h-4 flex-shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:Q("path",{d:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"})}),Uu=()=>Q("svg",{className:"w-4 h-4 flex-shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:Q("path",{d:"M18 6L10 14M6 18L14 10"})}),Hu=({dark:e=!0,blinking:t=!0})=>Q("span",{className:F("absolute bottom-0 right-0 h-2 w-2 rounded-full ring-1 bg-emerald-500",t&&"animate-pulse",e?"ring-gray-900":"ring-white"),"aria-hidden":!0});function Jo({dark:e=!0,onBack:t,showBackButton:a=!1,showAvatar:r=!0,avatar:o,title:n,subtitle:l,statusIndicator:i="none",liveIndicatorStyle:u="label",statusDotStyle:s="blinking",onMenu:d,showMenuExpand:f=!1,onMenuExpand:p,expandLabel:c="Expand chat",isExpanded:h=!1,menuQuickLinks:x,onClose:S,backLabel:L="Back",closeLabel:P="Close",menuLabel:w="Menu",liveLabel:D="Live",activeLabel:M="Active",className:C}){let q=i==="live"||i==="active",H=r&&q&&u==="dot-only",E=q&&u==="label",I=i==="active"?M:D,X=s!=="static",U=f||x&&x.length>0,B=U||d,[b,v]=Fu(!1),V=Bu(null);Du(()=>{if(!b)return;let K=m=>{V.current&&!V.current.contains(m.target)&&v(!1)};return document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[b]);let _=()=>{U?v(K=>!K):d?.()},Z=x??[];return je("header",{className:F("flex-shrink-0 flex items-center gap-3 border-b px-4 py-3",e?"border-gray-700 bg-gray-900/50":"border-gray-200 bg-gray-50",C),"aria-label":"Chat header",children:[a&&t?Q("button",{type:"button",onClick:t,className:F("flex-shrink-0 rounded-lg p-2 transition-colors",e?"text-gray-400 hover:bg-gray-800 hover:text-gray-200":"text-gray-500 hover:bg-gray-200 hover:text-gray-800"),"aria-label":L,children:Q(Ru,{})}):null,r?je("div",{className:"flex-shrink-0 relative w-10 h-10",...H&&{role:"status","aria-label":I},children:[Q("div",{className:F("w-10 h-10 rounded-full overflow-hidden flex items-center justify-center text-lg border-[1px]",e?"bg-gray-700/80 border-gray-600/80":"bg-gray-100 border-gray-200"),children:o!=null?typeof o=="string"&&(o.startsWith("http")||o.startsWith("/"))?Q("img",{src:o,alt:"",className:"w-full h-full object-cover"}):o:Q(Ft,{className:F("w-6 h-6 flex-shrink-0",e?"text-gray-400":"text-gray-500"),"aria-hidden":!0})}),H?Q(Hu,{dark:e,blinking:X}):null]}):null,je("div",{className:"min-w-0 flex-1",children:[je("div",{className:"flex items-center gap-2",children:[n?Q("h2",{className:F("text-sm font-semibold truncate",e?"text-gray-100":"text-gray-900"),children:n}):null,E?je("span",{className:"flex items-center gap-1.5 flex-shrink-0",role:"status","aria-label":I,children:[Q("span",{className:F("h-2 w-2 rounded-full ring-1 flex-shrink-0 bg-emerald-500",X&&"animate-pulse",e?"ring-gray-900":"ring-white")}),Q("span",{className:F("text-xs font-medium",e?"text-emerald-400":"text-emerald-600"),children:I})]}):null]}),l?Q("p",{className:F("text-xs truncate mt-0.5",e?"text-gray-400":"text-gray-500"),children:l}):null]}),B?je("div",{className:"flex-shrink-0 relative",ref:V,children:[Q("button",{type:"button",onClick:_,className:F("rounded-lg p-2 transition-colors",e?"text-gray-400 hover:bg-gray-800 hover:text-gray-200":"text-gray-500 hover:bg-gray-200 hover:text-gray-800"),"aria-label":w,"aria-expanded":b,"aria-haspopup":"true",children:Q(Eu,{})}),U&&b?je("div",{className:F("absolute right-0 top-full mt-1 min-w-[160px] max-w-[220px] rounded-lg border py-1 shadow-xl z-50",e?"border-gray-600 bg-gray-800":"border-gray-200 bg-white"),role:"menu",children:[f&&p?je("button",{type:"button",role:"menuitem",onClick:()=>{p(),v(!1)},className:F("flex w-full items-center gap-2 px-4 py-2 text-left text-sm min-w-0",e?"text-gray-200 hover:bg-gray-700":"text-gray-800 hover:bg-gray-100"),children:[h?Q(Uu,{}):Q(qu,{}),Q("span",{className:"truncate",children:c})]}):null,Z.map((K,m)=>Q("a",{href:K.route,role:"menuitem",className:F("flex w-full items-center gap-2 px-4 py-2 text-left text-sm min-w-0",e?"text-gray-200 hover:bg-gray-700":"text-gray-800 hover:bg-gray-100"),onClick:()=>v(!1),children:Q("span",{className:"truncate min-w-0",children:K.text})},m))]}):null]}):null,S?Q("button",{type:"button",onClick:S,className:F("flex-shrink-0 rounded-lg p-2 transition-colors",e?"text-gray-400 hover:bg-gray-800 hover:text-gray-200":"text-gray-500 hover:bg-gray-200 hover:text-gray-800"),"aria-label":P,children:Q(Ou,{})}):null]})}import{useCallback as _i,useEffect as Pp,useRef as Ua,useState as Ap}from"react";import{useCallback as yp,useState as bp}from"react";function Yo(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var zu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wu={};function ta(e,t){return((t||Wu).jsx?Nu:zu).test(e)}var Vu=/[ \t\n\f\r]/g;function $a(e){return typeof e=="object"?e.type==="text"?en(e.value):!1:en(e)}function en(e){return e.replace(Vu,"")===""}var ze=class{constructor(t,a,r){this.normal=a,this.property=t,r&&(this.space=r)}};ze.prototype.normal={};ze.prototype.property={};ze.prototype.space=void 0;function Ja(e,t){let a={},r={};for(let o of e)Object.assign(a,o.property),Object.assign(r,o.normal);return new ze(a,r,t)}function Dt(e){return e.toLowerCase()}var ce=class{constructor(t,a){this.attribute=a,this.property=t}};ce.prototype.attribute="";ce.prototype.booleanish=!1;ce.prototype.boolean=!1;ce.prototype.commaOrSpaceSeparated=!1;ce.prototype.commaSeparated=!1;ce.prototype.defined=!1;ce.prototype.mustUseProperty=!1;ce.prototype.number=!1;ce.prototype.overloadedBoolean=!1;ce.prototype.property="";ce.prototype.spaceSeparated=!1;ce.prototype.space=void 0;var Rt={};Ho(Rt,{boolean:()=>W,booleanish:()=>ae,commaOrSpaceSeparated:()=>Le,commaSeparated:()=>Xe,number:()=>y,overloadedBoolean:()=>aa,spaceSeparated:()=>$});var _u=0,W=nt(),ae=nt(),aa=nt(),y=nt(),$=nt(),Xe=nt(),Le=nt();function nt(){return 2**++_u}var Ya=Object.keys(Rt),lt=class extends ce{constructor(t,a,r,o){let n=-1;if(super(t,a),tn(this,"space",o),typeof r=="number")for(;++n<Ya.length;){let l=Ya[n];tn(this,Ya[n],(r&Rt[l])===Rt[l])}}};lt.prototype.defined=!0;function tn(e,t,a){a&&(e[t]=a)}function Pe(e){let t={},a={};for(let[r,o]of Object.entries(e.properties)){let n=new lt(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(n.mustUseProperty=!0),t[r]=n,a[Dt(r)]=r,a[Dt(n.attribute)]=r}return new ze(t,a,e.space)}var er=Pe({properties:{ariaActiveDescendant:null,ariaAtomic:ae,ariaAutoComplete:null,ariaBusy:ae,ariaChecked:ae,ariaColCount:y,ariaColIndex:y,ariaColSpan:y,ariaControls:$,ariaCurrent:null,ariaDescribedBy:$,ariaDetails:null,ariaDisabled:ae,ariaDropEffect:$,ariaErrorMessage:null,ariaExpanded:ae,ariaFlowTo:$,ariaGrabbed:ae,ariaHasPopup:null,ariaHidden:ae,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$,ariaLevel:y,ariaLive:null,ariaModal:ae,ariaMultiLine:ae,ariaMultiSelectable:ae,ariaOrientation:null,ariaOwns:$,ariaPlaceholder:null,ariaPosInSet:y,ariaPressed:ae,ariaReadOnly:ae,ariaRelevant:null,ariaRequired:ae,ariaRoleDescription:$,ariaRowCount:y,ariaRowIndex:y,ariaRowSpan:y,ariaSelected:ae,ariaSetSize:y,ariaSort:null,ariaValueMax:y,ariaValueMin:y,ariaValueNow:y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ra(e,t){return t in e?e[t]:t}function oa(e,t){return ra(e,t.toLowerCase())}var an=Pe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xe,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:$,autoFocus:W,autoPlay:W,blocking:$,capture:null,charSet:null,checked:W,cite:null,className:$,cols:y,colSpan:null,content:null,contentEditable:ae,controls:W,controlsList:$,coords:y|Xe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:aa,draggable:ae,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:$,height:y,hidden:aa,high:y,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:$,itemRef:$,itemScope:W,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:y,manifest:null,max:null,maxLength:y,media:null,method:null,min:null,minLength:y,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,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:W,optimum:y,pattern:null,ping:$,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:$,required:W,reversed:W,rows:y,rowSpan:y,sandbox:$,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shape:null,size:y,sizes:null,slot:null,span:y,spellCheck:ae,src:null,srcDoc:null,srcLang:null,srcSet:null,start:y,step:null,style:null,tabIndex:y,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:ae,width:y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:y,borderColor:null,bottomMargin:y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:y,leftMargin:y,link:null,longDesc:null,lowSrc:null,marginHeight:y,marginWidth:y,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:y,rules:null,scheme:null,scrolling:ae,standby:null,summary:null,text:null,topMargin:y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:W,disableRemotePlayback:W,prefix:null,property:null,results:y,security:null,unselectable:null},space:"html",transform:oa});var rn=Pe({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Le,accentHeight:y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:y,amplitude:y,arabicForm:null,ascent:y,attributeName:null,attributeType:null,azimuth:y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:y,by:null,calcMode:null,capHeight:y,className:$,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:y,diffuseConstant:y,direction:null,display:null,dur:null,divisor:y,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:y,enableBackground:null,end:null,event:null,exponent:y,externalResourcesRequired:null,fill:null,fillOpacity:y,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:Xe,g2:Xe,glyphName:Xe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:y,horizOriginX:y,horizOriginY:y,id:null,ideographic:y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:y,k:y,k1:y,k2:y,k3:y,k4:y,kernelMatrix:Le,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:y,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:y,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:y,overlineThickness:y,paintOrder:null,panose1:null,path:null,pathLength:y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:y,pointsAtY:y,pointsAtZ:y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Le,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Le,rev:Le,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Le,requiredFeatures:Le,requiredFonts:Le,requiredFormats:Le,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:y,specularExponent:y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:y,strikethroughThickness:y,string:null,stroke:null,strokeDashArray:Le,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:y,strokeOpacity:y,strokeWidth:null,style:null,surfaceScale:y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Le,tabIndex:y,tableValues:null,target:null,targetX:y,targetY:y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Le,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:y,underlineThickness:y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:y,values:null,vAlphabetic:y,vMathematical:y,vectorEffect:null,vHanging:y,vIdeographic:y,version:null,vertAdvY:y,vertOriginX:y,vertOriginY:y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ra});var tr=Pe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var ar=Pe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:oa});var rr=Pe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var or={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"};var Gu=/[A-Z]/g,on=/-[a-z]/g,ju=/^data[-\w.:]+$/i;function nr(e,t){let a=Dt(t),r=t,o=ce;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&ju.test(t)){if(t.charAt(4)==="-"){let n=t.slice(5).replace(on,Ku);r="data"+n.charAt(0).toUpperCase()+n.slice(1)}else{let n=t.slice(4);if(!on.test(n)){let l=n.replace(Gu,Xu);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=lt}return new o(r,t)}function Xu(e){return"-"+e.toLowerCase()}function Ku(e){return e.charAt(1).toUpperCase()}var nn=Ja([er,an,tr,ar,rr],"html"),na=Ja([er,rn,tr,ar,rr],"svg");function ln(e){return e.join(" ").trim()}var Sn=zo(Ln(),1);var ia=In("end"),It=In("start");function In(e){return t;function t(a){let r=a&&a.position&&a.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 ur(e){let t=It(e),a=ia(e);if(t&&a)return{start:t,end:a}}function Ke(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Cn(e.position):"start"in e||"end"in e?Cn(e):"line"in e||"column"in e?sr(e):""}function sr(e){return kn(e&&e.line)+":"+kn(e&&e.column)}function Cn(e){return sr(e&&e.start)+"-"+sr(e&&e.end)}function kn(e){return e&&typeof e=="number"?e:1}var ne=class extends Error{constructor(t,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let o="",n={},l=!1;if(a&&("line"in a&&"column"in a?n={place:a}:"start"in a&&"end"in a?n={place:a}:"type"in a?n={ancestors:[a],place:a.position}:n={...a}),typeof t=="string"?o=t:!n.cause&&t&&(l=!0,o=t.message,n.cause=t),!n.ruleId&&!n.source&&typeof r=="string"){let u=r.indexOf(":");u===-1?n.ruleId=r:(n.source=r.slice(0,u),n.ruleId=r.slice(u+1))}if(!n.place&&n.ancestors&&n.ancestors){let u=n.ancestors[n.ancestors.length-1];u&&(n.place=u.position)}let i=n.place&&"start"in n.place?n.place.start:n.place;this.ancestors=n.ancestors||void 0,this.cause=n.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=i?i.line:void 0,this.name=Ke(n.place)||"1:1",this.place=n.place||void 0,this.reason=this.message,this.ruleId=n.ruleId||void 0,this.source=n.source||void 0,this.stack=l&&n.cause&&typeof n.cause.stack=="string"?n.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;var dr={}.hasOwnProperty,Cs=new Map,ks=/[A-Z]/g,Ss=new Set(["table","tbody","thead","tfoot","tr"]),ws=new Set(["td","th"]),wn="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fr(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Bs(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ts(a,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?na:nn,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},n=yn(o,e,void 0);return n&&typeof n!="string"?n:o.create(e,o.Fragment,{children:n||void 0},void 0)}function yn(e,t,a){if(t.type==="element")return ys(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return bs(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return As(e,t,a);if(t.type==="mdxjsEsm")return Ps(e,t);if(t.type==="root")return vs(e,t,a);if(t.type==="text")return Ms(e,t)}function ys(e,t,a){let r=e.schema,o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=na,e.schema=o),e.ancestors.push(t);let n=Pn(e,t.tagName,!1),l=Fs(e,t),i=pr(e,t);return Ss.has(t.tagName)&&(i=i.filter(function(u){return typeof u=="string"?!$a(u):!0})),bn(e,l,n,t),cr(l,i),e.ancestors.pop(),e.schema=r,e.create(t,n,l,a)}function bs(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ot(e,t.position)}function Ps(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ot(e,t.position)}function As(e,t,a){let r=e.schema,o=r;t.name==="svg"&&r.space==="html"&&(o=na,e.schema=o),e.ancestors.push(t);let n=t.name===null?e.Fragment:Pn(e,t.name,!0),l=Ds(e,t),i=pr(e,t);return bn(e,l,n,t),cr(l,i),e.ancestors.pop(),e.schema=r,e.create(t,n,l,a)}function vs(e,t,a){let r={};return cr(r,pr(e,t)),e.create(t,e.Fragment,r,a)}function Ms(e,t){return t.value}function bn(e,t,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=r)}function cr(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function Ts(e,t,a){return r;function r(o,n,l,i){let s=Array.isArray(l.children)?a:t;return i?s(n,l,i):s(n,l)}}function Bs(e,t){return a;function a(r,o,n,l){let i=Array.isArray(n.children),u=It(r);return t(o,n,l,i,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Fs(e,t){let a={},r,o;for(o in t.properties)if(o!=="children"&&dr.call(t.properties,o)){let n=Rs(e,o,t.properties[o]);if(n){let[l,i]=n;e.tableCellAlignToStyle&&l==="align"&&typeof i=="string"&&ws.has(t.tagName)?r=i:a[l]=i}}if(r){let n=a.style||(a.style={});n[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function Ds(e,t){let a={};for(let r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){let n=r.data.estree.body[0];n.type;let l=n.expression;l.type;let i=l.properties[0];i.type,Object.assign(a,e.evaluater.evaluateExpression(i.argument))}else Ot(e,t.position);else{let o=r.name,n;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){let i=r.value.data.estree.body[0];i.type,n=e.evaluater.evaluateExpression(i.expression)}else Ot(e,t.position);else n=r.value===null?!0:r.value;a[o]=n}return a}function pr(e,t){let a=[],r=-1,o=e.passKeys?new Map:Cs;for(;++r<t.children.length;){let n=t.children[r],l;if(e.passKeys){let u=n.type==="element"?n.tagName:n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement"?n.name:void 0;if(u){let s=o.get(u)||0;l=u+"-"+s,o.set(u,s+1)}}let i=yn(e,n,l);i!==void 0&&a.push(i)}return a}function Rs(e,t,a){let r=nr(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?Yo(a):ln(a)),r.property==="style"){let o=typeof a=="object"?a:Es(e,String(a));return e.stylePropertyNameCase==="css"&&(o=Os(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?or[r.property]||r.property:r.attribute,a]}}function Es(e,t){try{return(0,Sn.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let r=a,o=new ne("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=wn+"#cannot-parse-style-attribute",o}}function Pn(e,t,a){let r;if(!a)r={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),n=-1,l;for(;++n<o.length;){let i=ta(o[n])?{type:"Identifier",name:o[n]}:{type:"Literal",value:o[n]};l=l?{type:"MemberExpression",object:l,property:i,computed:!!(n&&i.type==="Literal"),optional:!1}:i}r=l}else r=ta(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){let o=r.value;return dr.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ot(e)}function Ot(e,t){let a=new ne("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=wn+"#cannot-handle-mdx-estrees-without-createevaluater",a}function Os(e){let t={},a;for(a in e)dr.call(e,a)&&(t[qs(a)]=e[a]);return t}function qs(e){let t=e.replace(ks,Us);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Us(e){return"-"+e.toLowerCase()}var qt={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"]};import{Fragment as Xf,jsx as Kf,jsxs as Qf}from"react/jsx-runtime";import{useEffect as eS,useState as tS}from"react";var Hs={};function ut(e,t){let a=t||Hs,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return vn(e,r,o)}function vn(e,t,a){if(zs(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return An(e.children,t,a)}return Array.isArray(e)?An(e,t,a):""}function An(e,t,a){let r=[],o=-1;for(;++o<e.length;)r[o]=vn(e[o],t,a);return r.join("")}function zs(e){return!!(e&&typeof e=="object")}var Mn=document.createElement("i");function Ct(e){let t="&"+e+";";Mn.innerHTML=t;let a=Mn.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function le(e,t,a,r){let o=e.length,n=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,a=a>0?a:0,r.length<1e4)l=Array.from(r),l.unshift(t,a),e.splice(...l);else for(a&&e.splice(t,a);n<r.length;)l=r.slice(n,n+1e4),l.unshift(t,0),e.splice(...l),n+=1e4,t+=1e4}function ge(e,t){return e.length>0?(le(e,e.length,0,t),e):t}var Tn={}.hasOwnProperty;function ua(e){let t={},a=-1;for(;++a<e.length;)Ns(t,e[a]);return t}function Ns(e,t){let a;for(a in t){let o=(Tn.call(e,a)?e[a]:void 0)||(e[a]={}),n=t[a],l;if(n)for(l in n){Tn.call(o,l)||(o[l]=[]);let i=n[l];Ws(o[l],Array.isArray(i)?i:i?[i]:[])}}}function Ws(e,t){let a=-1,r=[];for(;++a<t.length;)(t[a].add==="after"?e:r).push(t[a]);le(e,0,0,r)}function sa(e,t){let a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"\uFFFD":String.fromCodePoint(a)}function pe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var se=Qe(/[A-Za-z]/),re=Qe(/[\dA-Za-z]/),Bn=Qe(/[#-'*+\--9=?A-Z^-~]/);function st(e){return e!==null&&(e<32||e===127)}var Ut=Qe(/\d/),Fn=Qe(/[\dA-Fa-f]/),Dn=Qe(/[!-/:-@[-`{-~]/);function T(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}var dt=Qe(/\p{P}|\p{S}/u),De=Qe(/\s/);function Qe(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Ae(e){let t=[],a=-1,r=0,o=0;for(;++a<e.length;){let n=e.charCodeAt(a),l="";if(n===37&&re(e.charCodeAt(a+1))&&re(e.charCodeAt(a+2)))o=2;else if(n<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(n))||(l=String.fromCharCode(n));else if(n>55295&&n<57344){let i=e.charCodeAt(a+1);n<56320&&i>56319&&i<57344?(l=String.fromCharCode(n,i),o=1):l="\uFFFD"}else l=String.fromCharCode(n);l&&(t.push(e.slice(r,a),encodeURIComponent(l)),r=a+o+1,l=""),o&&(a+=o,o=0)}return t.join("")+e.slice(r)}function R(e,t,a,r){let o=r?r-1:Number.POSITIVE_INFINITY,n=0;return l;function l(u){return O(u)?(e.enter(a),i(u)):t(u)}function i(u){return O(u)&&n++<o?(e.consume(u),i):(e.exit(a),t(u))}}var Rn={tokenize:Vs};function Vs(e){let t=e.attempt(this.parser.constructs.contentInitial,r,o),a;return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),R(e,t,"linePrefix")}function o(i){return e.enter("paragraph"),n(i)}function n(i){let u=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=u),a=u,l(i)}function l(i){if(i===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(i);return}return T(i)?(e.consume(i),e.exit("chunkText"),n):(e.consume(i),l)}}var On={tokenize:_s},En={tokenize:Gs};function _s(e){let t=this,a=[],r=0,o,n,l;return i;function i(w){if(r<a.length){let D=a[r];return t.containerState=D[1],e.attempt(D[0].continuation,u,s)(w)}return s(w)}function u(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&P();let D=t.events.length,M=D,C;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){C=t.events[M][1].end;break}L(r);let q=D;for(;q<t.events.length;)t.events[q][1].end={...C},q++;return le(t.events,M+1,0,t.events.slice(D)),t.events.length=q,s(w)}return i(w)}function s(w){if(r===a.length){if(!o)return p(w);if(o.currentConstruct&&o.currentConstruct.concrete)return h(w);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(En,d,f)(w)}function d(w){return o&&P(),L(r),p(w)}function f(w){return t.parser.lazy[t.now().line]=r!==a.length,l=t.now().offset,h(w)}function p(w){return t.containerState={},e.attempt(En,c,h)(w)}function c(w){return r++,a.push([t.currentConstruct,t.containerState]),p(w)}function h(w){if(w===null){o&&P(),L(0),e.consume(w);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:n}),x(w)}function x(w){if(w===null){S(e.exit("chunkFlow"),!0),L(0),e.consume(w);return}return T(w)?(e.consume(w),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,i):(e.consume(w),x)}function S(w,D){let M=t.sliceStream(w);if(D&&M.push(null),w.previous=n,n&&(n.next=w),n=w,o.defineSkip(w.start),o.write(M),t.parser.lazy[w.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<l&&(!o.events[C][1].end||o.events[C][1].end.offset>l))return;let q=t.events.length,H=q,E,I;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(E){I=t.events[H][1].end;break}E=!0}for(L(r),C=q;C<t.events.length;)t.events[C][1].end={...I},C++;le(t.events,H+1,0,t.events.slice(q)),t.events.length=C}}function L(w){let D=a.length;for(;D-- >w;){let M=a[D];t.containerState=M[1],M[0].exit.call(t,e)}a.length=w}function P(){o.write([null]),n=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Gs(e,t,a){return R(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ne(e){if(e===null||G(e)||De(e))return 1;if(dt(e))return 2}function Ze(e,t,a){let r=[],o=-1;for(;++o<e.length;){let n=e[o].resolveAll;n&&!r.includes(n)&&(t=n(t,a),r.push(n))}return t}var Ht={name:"attention",resolveAll:js,tokenize:Xs};function js(e,t){let a=-1,r,o,n,l,i,u,s,d;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let f={...e[r][1].end},p={...e[a][1].start};qn(f,-u),qn(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},i={type:u>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:p},n={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},o={type:u>1?"strong":"emphasis",start:{...l.start},end:{...i.end}},e[r][1].end={...l.start},e[a][1].start={...i.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ge(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=ge(s,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",n,t]]),s=ge(s,Ze(t.parser.constructs.insideSpan.null,e.slice(r+1,a),t)),s=ge(s,[["exit",n,t],["enter",i,t],["exit",i,t],["exit",o,t]]),e[a][1].end.offset-e[a][1].start.offset?(d=2,s=ge(s,[["enter",e[a][1],t],["exit",e[a][1],t]])):d=0,le(e,r-1,a-r+3,s),a=r+s.length-d-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function Xs(e,t){let a=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Ne(r),n;return l;function l(u){return n=u,e.enter("attentionSequence"),i(u)}function i(u){if(u===n)return e.consume(u),i;let s=e.exit("attentionSequence"),d=Ne(u),f=!d||d===2&&o||a.includes(u),p=!o||o===2&&d||a.includes(r);return s._open=!!(n===42?f:f&&(o||!p)),s._close=!!(n===42?p:p&&(d||!f)),t(u)}}function qn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var mr={name:"autolink",tokenize:Ks};function Ks(e,t,a){let r=0;return o;function o(c){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(c),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),n}function n(c){return se(c)?(e.consume(c),l):c===64?a(c):s(c)}function l(c){return c===43||c===45||c===46||re(c)?(r=1,i(c)):s(c)}function i(c){return c===58?(e.consume(c),r=0,u):(c===43||c===45||c===46||re(c))&&r++<32?(e.consume(c),i):(r=0,s(c))}function u(c){return c===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(c),e.exit("autolinkMarker"),e.exit("autolink"),t):c===null||c===32||c===60||st(c)?a(c):(e.consume(c),u)}function s(c){return c===64?(e.consume(c),d):Bn(c)?(e.consume(c),s):a(c)}function d(c){return re(c)?f(c):a(c)}function f(c){return c===46?(e.consume(c),r=0,d):c===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(c),e.exit("autolinkMarker"),e.exit("autolink"),t):p(c)}function p(c){if((c===45||re(c))&&r++<63){let h=c===45?p:f;return e.consume(c),h}return a(c)}}var Re={partial:!0,tokenize:Qs};function Qs(e,t,a){return r;function r(n){return O(n)?R(e,o,"linePrefix")(n):o(n)}function o(n){return n===null||T(n)?t(n):a(n)}}var da={continuation:{tokenize:$s},exit:Js,name:"blockQuote",tokenize:Zs};function Zs(e,t,a){let r=this;return o;function o(l){if(l===62){let i=r.containerState;return i.open||(e.enter("blockQuote",{_container:!0}),i.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),n}return a(l)}function n(l){return O(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function $s(e,t,a){let r=this;return o;function o(l){return O(l)?R(e,n,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):n(l)}function n(l){return e.attempt(da,t,a)(l)}}function Js(e){e.exit("blockQuote")}var fa={name:"characterEscape",tokenize:Ys};function Ys(e,t,a){return r;function r(n){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(n),e.exit("escapeMarker"),o}function o(n){return Dn(n)?(e.enter("characterEscapeValue"),e.consume(n),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(n)}}var ca={name:"characterReference",tokenize:ed};function ed(e,t,a){let r=this,o=0,n,l;return i;function i(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),n=31,l=re,d(f))}function s(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,l=Fn,d):(e.enter("characterReferenceValue"),n=7,l=Ut,d(f))}function d(f){if(f===59&&o){let p=e.exit("characterReferenceValue");return l===re&&!Ct(r.sliceSerialize(p))?a(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(f)&&o++<n?(e.consume(f),d):a(f)}}var Un={partial:!0,tokenize:ad},pa={concrete:!0,name:"codeFenced",tokenize:td};function td(e,t,a){let r=this,o={partial:!0,tokenize:M},n=0,l=0,i;return u;function u(C){return s(C)}function s(C){let q=r.events[r.events.length-1];return n=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,i=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===i?(l++,e.consume(C),d):l<3?a(C):(e.exit("codeFencedFenceSequence"),O(C)?R(e,f,"whitespace")(C):f(C))}function f(C){return C===null||T(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Un,x,D)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||T(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(C)):O(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),R(e,c,"whitespace")(C)):C===96&&C===i?a(C):(e.consume(C),p)}function c(C){return C===null||T(C)?f(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||T(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(C)):C===96&&C===i?a(C):(e.consume(C),h)}function x(C){return e.attempt(o,D,S)(C)}function S(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),L}function L(C){return n>0&&O(C)?R(e,P,"linePrefix",n+1)(C):P(C)}function P(C){return C===null||T(C)?e.check(Un,x,D)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||T(C)?(e.exit("codeFlowValue"),P(C)):(e.consume(C),w)}function D(C){return e.exit("codeFenced"),t(C)}function M(C,q,H){let E=0;return I;function I(v){return C.enter("lineEnding"),C.consume(v),C.exit("lineEnding"),X}function X(v){return C.enter("codeFencedFence"),O(v)?R(C,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):U(v)}function U(v){return v===i?(C.enter("codeFencedFenceSequence"),B(v)):H(v)}function B(v){return v===i?(E++,C.consume(v),B):E>=l?(C.exit("codeFencedFenceSequence"),O(v)?R(C,b,"whitespace")(v):b(v)):H(v)}function b(v){return v===null||T(v)?(C.exit("codeFencedFence"),q(v)):H(v)}}}function ad(e,t,a){let r=this;return o;function o(l){return l===null?a(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n)}function n(l){return r.parser.lazy[r.now().line]?a(l):t(l)}}var zt={name:"codeIndented",tokenize:od},rd={partial:!0,tokenize:nd};function od(e,t,a){let r=this;return o;function o(s){return e.enter("codeIndented"),R(e,n,"linePrefix",5)(s)}function n(s){let d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(s):a(s)}function l(s){return s===null?u(s):T(s)?e.attempt(rd,l,u)(s):(e.enter("codeFlowValue"),i(s))}function i(s){return s===null||T(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),i)}function u(s){return e.exit("codeIndented"),t(s)}}function nd(e,t,a){let r=this;return o;function o(l){return r.parser.lazy[r.now().line]?a(l):T(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):R(e,n,"linePrefix",5)(l)}function n(l){let i=r.events[r.events.length-1];return i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(l):T(l)?o(l):a(l)}}var hr={name:"codeText",previous:id,resolve:ld,tokenize:ud};function ld(e){let t=e.length-4,a=3,r,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=a;++r<t;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(r=a-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function id(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ud(e,t,a){let r=this,o=0,n,l;return i;function i(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),o++,u):(e.exit("codeTextSequence"),s(p))}function s(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),s):p===96?(l=e.enter("codeTextSequence"),n=0,f(p)):T(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),s):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||T(p)?(e.exit("codeTextData"),s(p)):(e.consume(p),d)}function f(p){return p===96?(e.consume(p),n++,f):n===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(l.type="codeTextData",d(p))}}var ma=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){let r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,a,r){let o=a||0;this.setCursor(Math.trunc(t));let n=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Nt(this.left,r),n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Nt(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Nt(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let a=this.left.splice(t,Number.POSITIVE_INFINITY);Nt(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Nt(this.left,a.reverse())}}};function Nt(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function ha(e){let t={},a=-1,r,o,n,l,i,u,s,d=new ma(e);for(;++a<d.length;){for(;a in t;)a=t[a];if(r=d.get(a),a&&r[1].type==="chunkFlow"&&d.get(a-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,n=0,n<u.length&&u[n][1].type==="lineEndingBlank"&&(n+=2),n<u.length&&u[n][1].type==="content"))for(;++n<u.length&&u[n][1].type!=="content";)u[n][1].type==="chunkText"&&(u[n][1]._isInFirstContentOfListItem=!0,n++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,sd(d,a)),a=t[a],s=!0);else if(r[1]._container){for(n=a,o=void 0;n--;)if(l=d.get(n),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=n);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(r[1].end={...d.get(o)[1].start},i=d.slice(o,a),i.unshift(r),d.splice(o,a-o+1,i))}}return le(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!s}function sd(e,t){let a=e.get(t)[1],r=e.get(t)[2],o=t-1,n=[],l=a._tokenizer;l||(l=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));let i=l.events,u=[],s={},d,f,p=-1,c=a,h=0,x=0,S=[x];for(;c;){for(;e.get(++o)[1]!==c;);n.push(o),c._tokenizer||(d=r.sliceStream(c),c.next||d.push(null),f&&l.defineSkip(c.start),c._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(d),c._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),f=c,c=c.next}for(c=a;++p<i.length;)i[p][0]==="exit"&&i[p-1][0]==="enter"&&i[p][1].type===i[p-1][1].type&&i[p][1].start.line!==i[p][1].end.line&&(x=p+1,S.push(x),c._tokenizer=void 0,c.previous=void 0,c=c.next);for(l.events=[],c?(c._tokenizer=void 0,c.previous=void 0):S.pop(),p=S.length;p--;){let L=i.slice(S[p],S[p+1]),P=n.pop();u.push([P,P+L.length-1]),e.splice(P,2,L)}for(u.reverse(),p=-1;++p<u.length;)s[h+u[p][0]]=h+u[p][1],h+=u[p][1]-u[p][0]-1;return s}var gr={resolve:fd,tokenize:cd},dd={partial:!0,tokenize:pd};function fd(e){return ha(e),e}function cd(e,t){let a;return r;function r(i){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(i)}function o(i){return i===null?n(i):T(i)?e.check(dd,l,n)(i):(e.consume(i),o)}function n(i){return e.exit("chunkContent"),e.exit("content"),t(i)}function l(i){return e.consume(i),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function pd(e,t,a){let r=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),R(e,n,"linePrefix")}function n(l){if(l===null||T(l))return a(l);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,a,t)(l)}}function ga(e,t,a,r,o,n,l,i,u){let s=u||Number.POSITIVE_INFINITY,d=0;return f;function f(L){return L===60?(e.enter(r),e.enter(o),e.enter(n),e.consume(L),e.exit(n),p):L===null||L===32||L===41||st(L)?a(L):(e.enter(r),e.enter(l),e.enter(i),e.enter("chunkString",{contentType:"string"}),x(L))}function p(L){return L===62?(e.enter(n),e.consume(L),e.exit(n),e.exit(o),e.exit(r),t):(e.enter(i),e.enter("chunkString",{contentType:"string"}),c(L))}function c(L){return L===62?(e.exit("chunkString"),e.exit(i),p(L)):L===null||L===60||T(L)?a(L):(e.consume(L),L===92?h:c)}function h(L){return L===60||L===62||L===92?(e.consume(L),c):c(L)}function x(L){return!d&&(L===null||L===41||G(L))?(e.exit("chunkString"),e.exit(i),e.exit(l),e.exit(r),t(L)):d<s&&L===40?(e.consume(L),d++,x):L===41?(e.consume(L),d--,x):L===null||L===32||L===40||st(L)?a(L):(e.consume(L),L===92?S:x)}function S(L){return L===40||L===41||L===92?(e.consume(L),x):x(L)}}function xa(e,t,a,r,o,n){let l=this,i=0,u;return s;function s(c){return e.enter(r),e.enter(o),e.consume(c),e.exit(o),e.enter(n),d}function d(c){return i>999||c===null||c===91||c===93&&!u||c===94&&!i&&"_hiddenFootnoteSupport"in l.parser.constructs?a(c):c===93?(e.exit(n),e.enter(o),e.consume(c),e.exit(o),e.exit(r),t):T(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(c))}function f(c){return c===null||c===91||c===93||T(c)||i++>999?(e.exit("chunkString"),d(c)):(e.consume(c),u||(u=!O(c)),c===92?p:f)}function p(c){return c===91||c===92||c===93?(e.consume(c),i++,f):f(c)}}function La(e,t,a,r,o,n){let l;return i;function i(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),l=p===40?41:p,u):a(p)}function u(p){return p===l?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(n),s(p))}function s(p){return p===l?(e.exit(n),u(l)):p===null?a(p):T(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),R(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||T(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?f:d)}function f(p){return p===l||p===92?(e.consume(p),d):d(p)}}function ft(e,t){let a;return r;function r(o){return T(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,r):O(o)?R(e,r,a?"linePrefix":"lineSuffix")(o):t(o)}}var xr={name:"definition",tokenize:hd},md={partial:!0,tokenize:gd};function hd(e,t,a){let r=this,o;return n;function n(c){return e.enter("definition"),l(c)}function l(c){return xa.call(r,e,i,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(c)}function i(c){return o=pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),c===58?(e.enter("definitionMarker"),e.consume(c),e.exit("definitionMarker"),u):a(c)}function u(c){return G(c)?ft(e,s)(c):s(c)}function s(c){return ga(e,d,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(c)}function d(c){return e.attempt(md,f,f)(c)}function f(c){return O(c)?R(e,p,"whitespace")(c):p(c)}function p(c){return c===null||T(c)?(e.exit("definition"),r.parser.defined.push(o),t(c)):a(c)}}function gd(e,t,a){return r;function r(i){return G(i)?ft(e,o)(i):a(i)}function o(i){return La(e,n,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function n(i){return O(i)?R(e,l,"whitespace")(i):l(i)}function l(i){return i===null||T(i)?t(i):a(i)}}var Lr={name:"hardBreakEscape",tokenize:xd};function xd(e,t,a){return r;function r(n){return e.enter("hardBreakEscape"),e.consume(n),o}function o(n){return T(n)?(e.exit("hardBreakEscape"),t(n)):a(n)}}var Ir={name:"headingAtx",resolve:Ld,tokenize:Id};function Ld(e,t){let a=e.length-2,r=3,o,n;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},n={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},le(e,r,a-r+1,[["enter",o,t],["enter",n,t],["exit",n,t],["exit",o,t]])),e}function Id(e,t,a){let r=0;return o;function o(d){return e.enter("atxHeading"),n(d)}function n(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||G(d)?(e.exit("atxHeadingSequence"),i(d)):a(d)}function i(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||T(d)?(e.exit("atxHeading"),t(d)):O(d)?R(e,i,"whitespace")(d):(e.enter("atxHeadingText"),s(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),i(d))}function s(d){return d===null||d===35||G(d)?(e.exit("atxHeadingText"),i(d)):(e.consume(d),s)}}var Hn=["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"],Cr=["pre","script","style","textarea"];var kr={concrete:!0,name:"htmlFlow",resolveTo:Sd,tokenize:wd},Cd={partial:!0,tokenize:bd},kd={partial:!0,tokenize:yd};function Sd(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wd(e,t,a){let r=this,o,n,l,i,u;return s;function s(g){return d(g)}function d(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),f}function f(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),n=!0,x):g===63?(e.consume(g),o=3,r.interrupt?t:m):se(g)?(e.consume(g),l=String.fromCharCode(g),S):a(g)}function p(g){return g===45?(e.consume(g),o=2,c):g===91?(e.consume(g),o=5,i=0,h):se(g)?(e.consume(g),o=4,r.interrupt?t:m):a(g)}function c(g){return g===45?(e.consume(g),r.interrupt?t:m):a(g)}function h(g){let ee="CDATA[";return g===ee.charCodeAt(i++)?(e.consume(g),i===ee.length?r.interrupt?t:U:h):a(g)}function x(g){return se(g)?(e.consume(g),l=String.fromCharCode(g),S):a(g)}function S(g){if(g===null||g===47||g===62||G(g)){let ee=g===47,ve=l.toLowerCase();return!ee&&!n&&Cr.includes(ve)?(o=1,r.interrupt?t(g):U(g)):Hn.includes(l.toLowerCase())?(o=6,ee?(e.consume(g),L):r.interrupt?t(g):U(g)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(g):n?P(g):w(g))}return g===45||re(g)?(e.consume(g),l+=String.fromCharCode(g),S):a(g)}function L(g){return g===62?(e.consume(g),r.interrupt?t:U):a(g)}function P(g){return O(g)?(e.consume(g),P):I(g)}function w(g){return g===47?(e.consume(g),I):g===58||g===95||se(g)?(e.consume(g),D):O(g)?(e.consume(g),w):I(g)}function D(g){return g===45||g===46||g===58||g===95||re(g)?(e.consume(g),D):M(g)}function M(g){return g===61?(e.consume(g),C):O(g)?(e.consume(g),M):w(g)}function C(g){return g===null||g===60||g===61||g===62||g===96?a(g):g===34||g===39?(e.consume(g),u=g,q):O(g)?(e.consume(g),C):H(g)}function q(g){return g===u?(e.consume(g),u=null,E):g===null||T(g)?a(g):(e.consume(g),q)}function H(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||G(g)?M(g):(e.consume(g),H)}function E(g){return g===47||g===62||O(g)?w(g):a(g)}function I(g){return g===62?(e.consume(g),X):a(g)}function X(g){return g===null||T(g)?U(g):O(g)?(e.consume(g),X):a(g)}function U(g){return g===45&&o===2?(e.consume(g),V):g===60&&o===1?(e.consume(g),_):g===62&&o===4?(e.consume(g),J):g===63&&o===3?(e.consume(g),m):g===93&&o===5?(e.consume(g),K):T(g)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Cd,Y,B)(g)):g===null||T(g)?(e.exit("htmlFlowData"),B(g)):(e.consume(g),U)}function B(g){return e.check(kd,b,Y)(g)}function b(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),v}function v(g){return g===null||T(g)?B(g):(e.enter("htmlFlowData"),U(g))}function V(g){return g===45?(e.consume(g),m):U(g)}function _(g){return g===47?(e.consume(g),l="",Z):U(g)}function Z(g){if(g===62){let ee=l.toLowerCase();return Cr.includes(ee)?(e.consume(g),J):U(g)}return se(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),Z):U(g)}function K(g){return g===93?(e.consume(g),m):U(g)}function m(g){return g===62?(e.consume(g),J):g===45&&o===2?(e.consume(g),m):U(g)}function J(g){return g===null||T(g)?(e.exit("htmlFlowData"),Y(g)):(e.consume(g),J)}function Y(g){return e.exit("htmlFlow"),t(g)}}function yd(e,t,a){let r=this;return o;function o(l){return T(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n):a(l)}function n(l){return r.parser.lazy[r.now().line]?a(l):t(l)}}function bd(e,t,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Re,t,a)}}var Sr={name:"htmlText",tokenize:Pd};function Pd(e,t,a){let r=this,o,n,l;return i;function i(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),M):m===63?(e.consume(m),w):se(m)?(e.consume(m),H):a(m)}function s(m){return m===45?(e.consume(m),d):m===91?(e.consume(m),n=0,h):se(m)?(e.consume(m),P):a(m)}function d(m){return m===45?(e.consume(m),c):a(m)}function f(m){return m===null?a(m):m===45?(e.consume(m),p):T(m)?(l=f,_(m)):(e.consume(m),f)}function p(m){return m===45?(e.consume(m),c):f(m)}function c(m){return m===62?V(m):m===45?p(m):f(m)}function h(m){let J="CDATA[";return m===J.charCodeAt(n++)?(e.consume(m),n===J.length?x:h):a(m)}function x(m){return m===null?a(m):m===93?(e.consume(m),S):T(m)?(l=x,_(m)):(e.consume(m),x)}function S(m){return m===93?(e.consume(m),L):x(m)}function L(m){return m===62?V(m):m===93?(e.consume(m),L):x(m)}function P(m){return m===null||m===62?V(m):T(m)?(l=P,_(m)):(e.consume(m),P)}function w(m){return m===null?a(m):m===63?(e.consume(m),D):T(m)?(l=w,_(m)):(e.consume(m),w)}function D(m){return m===62?V(m):w(m)}function M(m){return se(m)?(e.consume(m),C):a(m)}function C(m){return m===45||re(m)?(e.consume(m),C):q(m)}function q(m){return T(m)?(l=q,_(m)):O(m)?(e.consume(m),q):V(m)}function H(m){return m===45||re(m)?(e.consume(m),H):m===47||m===62||G(m)?E(m):a(m)}function E(m){return m===47?(e.consume(m),V):m===58||m===95||se(m)?(e.consume(m),I):T(m)?(l=E,_(m)):O(m)?(e.consume(m),E):V(m)}function I(m){return m===45||m===46||m===58||m===95||re(m)?(e.consume(m),I):X(m)}function X(m){return m===61?(e.consume(m),U):T(m)?(l=X,_(m)):O(m)?(e.consume(m),X):E(m)}function U(m){return m===null||m===60||m===61||m===62||m===96?a(m):m===34||m===39?(e.consume(m),o=m,B):T(m)?(l=U,_(m)):O(m)?(e.consume(m),U):(e.consume(m),b)}function B(m){return m===o?(e.consume(m),o=void 0,v):m===null?a(m):T(m)?(l=B,_(m)):(e.consume(m),B)}function b(m){return m===null||m===34||m===39||m===60||m===61||m===96?a(m):m===47||m===62||G(m)?E(m):(e.consume(m),b)}function v(m){return m===47||m===62||G(m)?E(m):a(m)}function V(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):a(m)}function _(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Z}function Z(m){return O(m)?R(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):K(m)}function K(m){return e.enter("htmlTextData"),l(m)}}var ct={name:"labelEnd",resolveAll:Td,resolveTo:Bd,tokenize:Fd},Ad={tokenize:Dd},vd={tokenize:Rd},Md={tokenize:Ed};function Td(e){let t=-1,a=[];for(;++t<e.length;){let r=e[t][1];if(a.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==a.length&&le(e,0,e.length,a),e}function Bd(e,t){let a=e.length,r=0,o,n,l,i;for(;a--;)if(o=e[a][1],n){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(n=a,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(l=a);let u={type:e[n][1].type==="labelLink"?"link":"image",start:{...e[n][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[n][1].start},end:{...e[l][1].end}},d={type:"labelText",start:{...e[n+r+2][1].end},end:{...e[l-2][1].start}};return i=[["enter",u,t],["enter",s,t]],i=ge(i,e.slice(n+1,n+r+3)),i=ge(i,[["enter",d,t]]),i=ge(i,Ze(t.parser.constructs.insideSpan.null,e.slice(n+r+4,l-3),t)),i=ge(i,[["exit",d,t],e[l-2],e[l-1],["exit",s,t]]),i=ge(i,e.slice(l+1)),i=ge(i,[["exit",u,t]]),le(e,n,e.length,i),e}function Fd(e,t,a){let r=this,o=r.events.length,n,l;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){n=r.events[o][1];break}return i;function i(p){return n?n._inactive?f(p):(l=r.parser.defined.includes(pe(r.sliceSerialize({start:n.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):a(p)}function u(p){return p===40?e.attempt(Ad,d,l?d:f)(p):p===91?e.attempt(vd,d,l?s:f)(p):l?d(p):f(p)}function s(p){return e.attempt(Md,d,f)(p)}function d(p){return t(p)}function f(p){return n._balanced=!0,a(p)}}function Dd(e,t,a){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return G(f)?ft(e,n)(f):n(f)}function n(f){return f===41?d(f):ga(e,l,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function l(f){return G(f)?ft(e,u)(f):d(f)}function i(f){return a(f)}function u(f){return f===34||f===39||f===40?La(e,s,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function s(f){return G(f)?ft(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):a(f)}}function Rd(e,t,a){let r=this;return o;function o(i){return xa.call(r,e,n,l,"reference","referenceMarker","referenceString")(i)}function n(i){return r.parser.defined.includes(pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(i):a(i)}function l(i){return a(i)}}function Ed(e,t,a){return r;function r(n){return e.enter("reference"),e.enter("referenceMarker"),e.consume(n),e.exit("referenceMarker"),o}function o(n){return n===93?(e.enter("referenceMarker"),e.consume(n),e.exit("referenceMarker"),e.exit("reference"),t):a(n)}}var wr={name:"labelStartImage",resolveAll:ct.resolveAll,tokenize:Od};function Od(e,t,a){let r=this;return o;function o(i){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(i),e.exit("labelImageMarker"),n}function n(i){return i===91?(e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelImage"),l):a(i)}function l(i){return i===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(i):t(i)}}var yr={name:"labelStartLink",resolveAll:ct.resolveAll,tokenize:qd};function qd(e,t,a){let r=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),n}function n(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(l):t(l)}}var Wt={name:"lineEnding",tokenize:Ud};function Ud(e,t){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),R(e,t,"linePrefix")}}var pt={name:"thematicBreak",tokenize:Hd};function Hd(e,t,a){let r=0,o;return n;function n(s){return e.enter("thematicBreak"),l(s)}function l(s){return o=s,i(s)}function i(s){return s===o?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||T(s))?(e.exit("thematicBreak"),t(s)):a(s)}function u(s){return s===o?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),O(s)?R(e,i,"whitespace")(s):i(s))}}var me={continuation:{tokenize:Vd},exit:Gd,name:"list",tokenize:Wd},zd={partial:!0,tokenize:jd},Nd={partial:!0,tokenize:_d};function Wd(e,t,a){let r=this,o=r.events[r.events.length-1],n=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return i;function i(c){let h=r.containerState.type||(c===42||c===43||c===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||c===r.containerState.marker:Ut(c)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),c===42||c===45?e.check(pt,a,s)(c):s(c);if(!r.interrupt||c===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(c)}return a(c)}function u(c){return Ut(c)&&++l<10?(e.consume(c),u):(!r.interrupt||l<2)&&(r.containerState.marker?c===r.containerState.marker:c===41||c===46)?(e.exit("listItemValue"),s(c)):a(c)}function s(c){return e.enter("listItemMarker"),e.consume(c),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||c,e.check(Re,r.interrupt?a:d,e.attempt(zd,p,f))}function d(c){return r.containerState.initialBlankLine=!0,n++,p(c)}function f(c){return O(c)?(e.enter("listItemPrefixWhitespace"),e.consume(c),e.exit("listItemPrefixWhitespace"),p):a(c)}function p(c){return r.containerState.size=n+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(c)}}function Vd(e,t,a){let r=this;return r.containerState._closeFlow=void 0,e.check(Re,o,n);function o(i){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,R(e,t,"listItemIndent",r.containerState.size+1)(i)}function n(i){return r.containerState.furtherBlankLines||!O(i)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(i)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nd,t,l)(i))}function l(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,R(e,e.attempt(me,t,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}function _d(e,t,a){let r=this;return R(e,o,"listItemIndent",r.containerState.size+1);function o(n){let l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(n):a(n)}}function Gd(e){e.exit(this.containerState.type)}function jd(e,t,a){let r=this;return R(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(n){let l=r.events[r.events.length-1];return!O(n)&&l&&l[1].type==="listItemPrefixWhitespace"?t(n):a(n)}}var Ia={name:"setextUnderline",resolveTo:Xd,tokenize:Kd};function Xd(e,t){let a=e.length,r,o,n;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!n&&e[a][1].type==="definition"&&(n=a);let l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",n?(e.splice(o,0,["enter",l,t]),e.splice(n+1,0,["exit",e[r][1],t]),e[r][1].end={...e[n][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Kd(e,t,a){let r=this,o;return n;function n(s){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=s,l(s)):a(s)}function l(s){return e.enter("setextHeadingLineSequence"),i(s)}function i(s){return s===o?(e.consume(s),i):(e.exit("setextHeadingLineSequence"),O(s)?R(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||T(s)?(e.exit("setextHeadingLine"),t(s)):a(s)}}var zn={tokenize:Qd};function Qd(e){let t=this,a=e.attempt(Re,r,e.attempt(this.parser.constructs.flowInitial,o,R(e,e.attempt(this.parser.constructs.flow,o,e.attempt(gr,o)),"linePrefix")));return a;function r(n){if(n===null){e.consume(n);return}return e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function o(n){if(n===null){e.consume(n);return}return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var Nn={resolveAll:Gn()},Wn=_n("string"),Vn=_n("text");function _n(e){return{resolveAll:Gn(e==="text"?Zd:void 0),tokenize:t};function t(a){let r=this,o=this.parser.constructs[e],n=a.attempt(o,l,i);return l;function l(d){return s(d)?n(d):i(d)}function i(d){if(d===null){a.consume(d);return}return a.enter("data"),a.consume(d),u}function u(d){return s(d)?(a.exit("data"),n(d)):(a.consume(d),u)}function s(d){if(d===null)return!0;let f=o[d],p=-1;if(f)for(;++p<f.length;){let c=f[p];if(!c.previous||c.previous.call(r,r.previous))return!0}return!1}}}function Gn(e){return t;function t(a,r){let o=-1,n;for(;++o<=a.length;)n===void 0?a[o]&&a[o][1].type==="data"&&(n=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==n+2&&(a[n][1].end=a[o-1][1].end,a.splice(n+2,o-n-2),o=n+2),n=void 0);return e?e(a,r):a}}function Zd(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let r=e[a-1][1],o=t.sliceStream(r),n=o.length,l=-1,i=0,u;for(;n--;){let s=o[n];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)i++,l--;if(l)break;l=-1}else if(s===-2)u=!0,i++;else if(s!==-1){n++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(i=0),i){let s={type:a===e.length||u||i<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:n?l:r.start._bufferIndex+l,_index:r.start._index+n,line:r.end.line,column:r.end.column-i,offset:r.end.offset-i},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(a,0,["enter",s,t],["exit",s,t]),a+=2)}a++}return e}var br={};Ho(br,{attentionMarkers:()=>of,contentInitial:()=>Jd,disable:()=>nf,document:()=>$d,flow:()=>ef,flowInitial:()=>Yd,insideSpan:()=>rf,string:()=>tf,text:()=>af});var $d={42:me,43:me,45:me,48:me,49:me,50:me,51:me,52:me,53:me,54:me,55:me,56:me,57:me,62:da},Jd={91:xr},Yd={[-2]:zt,[-1]:zt,32:zt},ef={35:Ir,42:pt,45:[Ia,pt],60:kr,61:Ia,95:pt,96:pa,126:pa},tf={38:ca,92:fa},af={[-5]:Wt,[-4]:Wt,[-3]:Wt,33:wr,38:ca,42:Ht,60:[mr,Sr],91:yr,92:[Lr,fa],93:ct,95:Ht,96:hr},rf={null:[Ht,Nn]},of={null:[42,95]},nf={null:[]};function jn(e,t,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},o={},n=[],l=[],i=[],u=!0,s={attempt:E(q),check:E(H),consume:D,enter:M,exit:C,interrupt:E(H,{interrupt:!0})},d={code:null,containerState:{},defineSkip:L,events:[],now:S,parser:e,previous:null,sliceSerialize:h,sliceStream:x,write:c},f=t.tokenize.call(d,s),p;return t.resolveAll&&n.push(t),d;function c(B){return l=ge(l,B),P(),l[l.length-1]!==null?[]:(I(t,0),d.events=Ze(n,d.events,d),d.events)}function h(B,b){return uf(x(B),b)}function x(B){return lf(l,B)}function S(){let{_bufferIndex:B,_index:b,line:v,column:V,offset:_}=r;return{_bufferIndex:B,_index:b,line:v,column:V,offset:_}}function L(B){o[B.line]=B.column,U()}function P(){let B;for(;r._index<l.length;){let b=l[r._index];if(typeof b=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<b.length;)w(b.charCodeAt(r._bufferIndex));else w(b)}}function w(B){u=void 0,p=B,f=f(B)}function D(B){T(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,U()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=B,u=!0}function M(B,b){let v=b||{};return v.type=B,v.start=S(),d.events.push(["enter",v,d]),i.push(v),v}function C(B){let b=i.pop();return b.end=S(),d.events.push(["exit",b,d]),b}function q(B,b){I(B,b.from)}function H(B,b){b.restore()}function E(B,b){return v;function v(V,_,Z){let K,m,J,Y;return Array.isArray(V)?ee(V):"tokenize"in V?ee([V]):g(V);function g(oe){return qe;function qe(Ie){let Me=Ie!==null&&oe[Ie],we=Ie!==null&&oe.null,te=[...Array.isArray(Me)?Me:Me?[Me]:[],...Array.isArray(we)?we:we?[we]:[]];return ee(te)(Ie)}}function ee(oe){return K=oe,m=0,oe.length===0?Z:ve(oe[m])}function ve(oe){return qe;function qe(Ie){return Y=X(),J=oe,oe.partial||(d.currentConstruct=oe),oe.name&&d.parser.constructs.disable.null.includes(oe.name)?Oe(Ie):oe.tokenize.call(b?Object.assign(Object.create(d),b):d,s,Ge,Oe)(Ie)}}function Ge(oe){return u=!0,B(J,Y),_}function Oe(oe){return u=!0,Y.restore(),++m<K.length?ve(K[m]):Z}}}function I(B,b){B.resolveAll&&!n.includes(B)&&n.push(B),B.resolve&&le(d.events,b,d.events.length-b,B.resolve(d.events.slice(b),d)),B.resolveTo&&(d.events=B.resolveTo(d.events,d))}function X(){let B=S(),b=d.previous,v=d.currentConstruct,V=d.events.length,_=Array.from(i);return{from:V,restore:Z};function Z(){r=B,d.previous=b,d.currentConstruct=v,d.events.length=V,i=_,U()}}function U(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function lf(e,t){let a=t.start._index,r=t.start._bufferIndex,o=t.end._index,n=t.end._bufferIndex,l;if(a===o)l=[e[a].slice(r,n)];else{if(l=e.slice(a,o),r>-1){let i=l[0];typeof i=="string"?l[0]=i.slice(r):l.shift()}n>0&&l.push(e[o].slice(0,n))}return l}function uf(e,t){let a=-1,r=[],o;for(;++a<e.length;){let n=e[a],l;if(typeof n=="string")l=n;else switch(n){case-5:{l="\r";break}case-4:{l=`
|
|
3
|
+
`;break}case-3:{l=`\r
|
|
4
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(n)}o=n===-2,r.push(l)}return r.join("")}function Pr(e){let r={constructs:ua([br,...(e||{}).extensions||[]]),content:o(Rn),defined:[],document:o(On),flow:o(zn),lazy:{},string:o(Wn),text:o(Vn)};return r;function o(n){return l;function l(i){return jn(r,n,i)}}}function Ar(e){for(;!ha(e););return e}var Xn=/[\0\t\n\r]/g;function vr(){let e=1,t="",a=!0,r;return o;function o(n,l,i){let u=[],s,d,f,p,c;for(n=t+(typeof n=="string"?n.toString():new TextDecoder(l||void 0).decode(n)),f=0,t="",a&&(n.charCodeAt(0)===65279&&f++,a=void 0);f<n.length;){if(Xn.lastIndex=f,s=Xn.exec(n),p=s&&s.index!==void 0?s.index:n.length,c=n.charCodeAt(p),!s){t=n.slice(f);break}if(c===10&&f===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<p&&(u.push(n.slice(f,p)),e+=p-f),c){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return i&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}var sf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Kn(e){return e.replace(sf,df)}function df(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let o=a.charCodeAt(1),n=o===120||o===88;return sa(a.slice(n?2:1),n?16:10)}return Ct(a)||e}var Zn={}.hasOwnProperty;function Mr(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),ff(a)(Ar(Pr(a).document().write(vr()(e,t,!0))))}function ff(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(Fe),autolinkProtocol:E,autolinkEmail:E,atxHeading:n(tt),blockQuote:n(Ie),characterEscape:E,characterReference:E,codeFenced:n(Me),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:n(Me,l),codeText:n(we,l),codeTextData:E,data:E,codeFlowValue:E,definition:n(te),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:n(he),hardBreakEscape:n(ye),hardBreakTrailing:n(ye),htmlFlow:n(Be,l),htmlFlowData:E,htmlText:n(Be,l),htmlTextData:E,image:n(Ce),label:l,link:n(Fe),listItem:n(rt),listItemValue:p,listOrdered:n(at,f),listUnordered:n(at),paragraph:n(_a),reference:g,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:n(tt),strong:n(Ga),thematicBreak:n(vt)},exit:{atxHeading:u(),atxHeadingSequence:M,autolink:u(),autolinkEmail:qe,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:Ge,characterReference:Oe,codeFenced:u(S),codeFencedFence:x,codeFencedFenceInfo:c,codeFencedFenceMeta:h,codeFlowValue:I,codeIndented:u(L),codeText:u(v),codeTextData:I,data:I,definition:u(),definitionDestinationString:D,definitionLabelString:P,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(U),hardBreakTrailing:u(U),htmlFlow:u(B),htmlFlowData:I,htmlText:u(b),htmlTextData:I,image:u(_),label:K,labelText:Z,lineEnding:X,link:u(V),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ee,resourceDestinationString:m,resourceTitleString:J,resource:Y,setextHeading:u(H),setextHeadingLineSequence:q,setextHeadingText:C,strong:u(),thematicBreak:u()}};$n(t,(e||{}).mdastExtensions||[]);let a={};return r;function r(k){let A={type:"root",children:[]},z={stack:[A],tokenStack:[],config:t,enter:i,exit:s,buffer:l,resume:d,data:a},j=[],N=-1;for(;++N<k.length;)if(k[N][1].type==="listOrdered"||k[N][1].type==="listUnordered")if(k[N][0]==="enter")j.push(N);else{let be=j.pop();N=o(k,be,N)}for(N=-1;++N<k.length;){let be=t[k[N][0]];Zn.call(be,k[N][1].type)&&be[k[N][1].type].call(Object.assign({sliceSerialize:k[N][2].sliceSerialize},z),k[N][1])}if(z.tokenStack.length>0){let be=z.tokenStack[z.tokenStack.length-1];(be[1]||Qn).call(z,void 0,be[0])}for(A.position={start:$e(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:$e(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},N=-1;++N<t.transforms.length;)A=t.transforms[N](A)||A;return A}function o(k,A,z){let j=A-1,N=-1,be=!1,Ue,fe,Mt,Tt;for(;++j<=z;){let ke=k[j];switch(ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ke[0]==="enter"?N++:N--,Tt=void 0;break}case"lineEndingBlank":{ke[0]==="enter"&&(Ue&&!Tt&&!N&&!Mt&&(Mt=j),Tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Tt=void 0}if(!N&&ke[0]==="enter"&&ke[1].type==="listItemPrefix"||N===-1&&ke[0]==="exit"&&(ke[1].type==="listUnordered"||ke[1].type==="listOrdered")){if(Ue){let Lt=j;for(fe=void 0;Lt--;){let He=k[Lt];if(He[1].type==="lineEnding"||He[1].type==="lineEndingBlank"){if(He[0]==="exit")continue;fe&&(k[fe][1].type="lineEndingBlank",be=!0),He[1].type="lineEnding",fe=Lt}else if(!(He[1].type==="linePrefix"||He[1].type==="blockQuotePrefix"||He[1].type==="blockQuotePrefixWhitespace"||He[1].type==="blockQuoteMarker"||He[1].type==="listItemIndent"))break}Mt&&(!fe||Mt<fe)&&(Ue._spread=!0),Ue.end=Object.assign({},fe?k[fe][1].start:ke[1].end),k.splice(fe||j,0,["exit",Ue,ke[2]]),j++,z++}if(ke[1].type==="listItemPrefix"){let Lt={type:"listItem",_spread:!1,start:Object.assign({},ke[1].start),end:void 0};Ue=Lt,k.splice(j,0,["enter",Lt,ke[2]]),j++,z++,Mt=void 0,Tt=!0}}}return k[A][1]._spread=be,z}function n(k,A){return z;function z(j){i.call(this,k(j),j),A&&A.call(this,j)}}function l(){this.stack.push({type:"fragment",children:[]})}function i(k,A,z){this.stack[this.stack.length-1].children.push(k),this.stack.push(k),this.tokenStack.push([A,z||void 0]),k.position={start:$e(A.start),end:void 0}}function u(k){return A;function A(z){k&&k.call(this,z),s.call(this,z)}}function s(k,A){let z=this.stack.pop(),j=this.tokenStack.pop();if(j)j[0].type!==k.type&&(A?A.call(this,k,j[0]):(j[1]||Qn).call(this,k,j[0]));else throw new Error("Cannot close `"+k.type+"` ("+Ke({start:k.start,end:k.end})+"): it\u2019s not open");z.position.end=$e(k.end)}function d(){return ut(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(k){if(this.data.expectingFirstListItemValue){let A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(k),10),this.data.expectingFirstListItemValue=void 0}}function c(){let k=this.resume(),A=this.stack[this.stack.length-1];A.lang=k}function h(){let k=this.resume(),A=this.stack[this.stack.length-1];A.meta=k}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){let k=this.resume(),A=this.stack[this.stack.length-1];A.value=k.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){let k=this.resume(),A=this.stack[this.stack.length-1];A.value=k.replace(/(\r?\n|\r)$/g,"")}function P(k){let A=this.resume(),z=this.stack[this.stack.length-1];z.label=A,z.identifier=pe(this.sliceSerialize(k)).toLowerCase()}function w(){let k=this.resume(),A=this.stack[this.stack.length-1];A.title=k}function D(){let k=this.resume(),A=this.stack[this.stack.length-1];A.url=k}function M(k){let A=this.stack[this.stack.length-1];if(!A.depth){let z=this.sliceSerialize(k).length;A.depth=z}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function q(k){let A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(k).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function E(k){let z=this.stack[this.stack.length-1].children,j=z[z.length-1];(!j||j.type!=="text")&&(j=ja(),j.position={start:$e(k.start),end:void 0},z.push(j)),this.stack.push(j)}function I(k){let A=this.stack.pop();A.value+=this.sliceSerialize(k),A.position.end=$e(k.end)}function X(k){let A=this.stack[this.stack.length-1];if(this.data.atHardBreak){let z=A.children[A.children.length-1];z.position.end=$e(k.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(A.type)&&(E.call(this,k),I.call(this,k))}function U(){this.data.atHardBreak=!0}function B(){let k=this.resume(),A=this.stack[this.stack.length-1];A.value=k}function b(){let k=this.resume(),A=this.stack[this.stack.length-1];A.value=k}function v(){let k=this.resume(),A=this.stack[this.stack.length-1];A.value=k}function V(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let A=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=A,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function _(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let A=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=A,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function Z(k){let A=this.sliceSerialize(k),z=this.stack[this.stack.length-2];z.label=Kn(A),z.identifier=pe(A).toLowerCase()}function K(){let k=this.stack[this.stack.length-1],A=this.resume(),z=this.stack[this.stack.length-1];if(this.data.inReference=!0,z.type==="link"){let j=k.children;z.children=j}else z.alt=A}function m(){let k=this.resume(),A=this.stack[this.stack.length-1];A.url=k}function J(){let k=this.resume(),A=this.stack[this.stack.length-1];A.title=k}function Y(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function ee(k){let A=this.resume(),z=this.stack[this.stack.length-1];z.label=A,z.identifier=pe(this.sliceSerialize(k)).toLowerCase(),this.data.referenceType="full"}function ve(k){this.data.characterReferenceType=k.type}function Ge(k){let A=this.sliceSerialize(k),z=this.data.characterReferenceType,j;z?(j=sa(A,z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):j=Ct(A);let N=this.stack[this.stack.length-1];N.value+=j}function Oe(k){let A=this.stack.pop();A.position.end=$e(k.end)}function oe(k){I.call(this,k);let A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(k)}function qe(k){I.call(this,k);let A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(k)}function Ie(){return{type:"blockquote",children:[]}}function Me(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function te(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function he(){return{type:"emphasis",children:[]}}function tt(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function Be(){return{type:"html",value:""}}function Ce(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function at(k){return{type:"list",ordered:k.type==="listOrdered",start:null,spread:k._spread,children:[]}}function rt(k){return{type:"listItem",spread:k._spread,checked:null,children:[]}}function _a(){return{type:"paragraph",children:[]}}function Ga(){return{type:"strong",children:[]}}function ja(){return{type:"text",value:""}}function vt(){return{type:"thematicBreak"}}}function $e(e){return{line:e.line,column:e.column,offset:e.offset}}function $n(e,t){let a=-1;for(;++a<t.length;){let r=t[a];Array.isArray(r)?$n(e,r):cf(e,r)}}function cf(e,t){let a;for(a in t)if(Zn.call(t,a))switch(a){case"canContainEols":{let r=t[a];r&&e[a].push(...r);break}case"transforms":{let r=t[a];r&&e[a].push(...r);break}case"enter":case"exit":{let r=t[a];r&&Object.assign(e[a],r);break}}}function Qn(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ke({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ke({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ke({start:t.start,end:t.end})+") is still open")}function Ca(e){let t=this;t.parser=a;function a(r){return Mr(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Jn(e,t){let a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function Yn(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
5
|
+
`}]}function el(e,t){let a=t.value?t.value+`
|
|
6
|
+
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let n={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return t.meta&&(n.data={meta:t.meta}),e.patch(t,n),n=e.applyData(t,n),n={type:"element",tagName:"pre",properties:{},children:[n]},e.patch(t,n),n}function tl(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function al(e,t){let a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function rl(e,t){let a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Ae(r.toLowerCase()),n=e.footnoteOrder.indexOf(r),l,i=e.footnoteCounts.get(r);i===void 0?(i=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=n+1,i+=1,e.footnoteCounts.set(r,i);let u={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);let s={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,s),e.applyData(t,s)}function ol(e,t){let a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function nl(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function ka(e,t){let a=t.referenceType,r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];let o=e.all(t),n=o[0];n&&n.type==="text"?n.value="["+n.value:o.unshift({type:"text",value:"["});let l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function ll(e,t){let a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return ka(e,t);let o={src:Ae(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);let n={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,n),e.applyData(t,n)}function il(e,t){let a={src:Ae(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);let r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,r),e.applyData(t,r)}function ul(e,t){let a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);let r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,r),e.applyData(t,r)}function sl(e,t){let a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return ka(e,t);let o={href:Ae(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);let n={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dl(e,t){let a={href:Ae(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);let r={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fl(e,t,a){let r=e.all(t),o=a?pf(a):cl(t),n={},l=[];if(typeof t.checked=="boolean"){let d=r[0],f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),n.className=["task-list-item"]}let i=-1;for(;++i<r.length;){let d=r[i];(o||i!==0||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
7
|
+
`}),d.type==="element"&&d.tagName==="p"&&!o?l.push(...d.children):l.push(d)}let u=r[r.length-1];u&&(o||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
|
|
8
|
+
`});let s={type:"element",tagName:"li",properties:n,children:l};return e.patch(t,s),e.applyData(t,s)}function pf(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,r=-1;for(;!t&&++r<a.length;)t=cl(a[r])}return t}function cl(e){let t=e.spread;return t??e.children.length>1}function pl(e,t){let a={},r=e.all(t),o=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++o<r.length;){let l=r[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}let n={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(t,n),e.applyData(t,n)}function ml(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function hl(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function gl(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function xl(e,t){let a=e.all(t),r=a.shift(),o=[];if(r){let l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),o.push(l)}if(a.length>0){let l={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},i=It(t.children[1]),u=ia(t.children[t.children.length-1]);i&&u&&(l.position={start:i,end:u}),o.push(l)}let n={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,n),e.applyData(t,n)}function Ll(e,t,a){let r=a?a.children:void 0,n=(r?r.indexOf(t):1)===0?"th":"td",l=a&&a.type==="table"?a.align:void 0,i=l?l.length:t.children.length,u=-1,s=[];for(;++u<i;){let f=t.children[u],p={},c=l?l[u]:void 0;c&&(p.align=c);let h={type:"element",tagName:n,properties:p,children:[]};f&&(h.children=e.all(f),e.patch(f,h),h=e.applyData(f,h)),s.push(h)}let d={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,d),e.applyData(t,d)}function Il(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function kl(e){let t=String(e),a=/\r?\n|\r/g,r=a.exec(t),o=0,n=[];for(;r;)n.push(Cl(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(t);return n.push(Cl(t.slice(o),o>0,!1)),n.join("")}function Cl(e,t,a){let r=0,o=e.length;if(t){let n=e.codePointAt(r);for(;n===9||n===32;)r++,n=e.codePointAt(r)}if(a){let n=e.codePointAt(o-1);for(;n===9||n===32;)o--,n=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function Sl(e,t){let a={type:"text",value:kl(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function wl(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var yl={blockquote:Jn,break:Yn,code:el,delete:tl,emphasis:al,footnoteReference:rl,heading:ol,html:nl,imageReference:ll,image:il,inlineCode:ul,linkReference:sl,link:dl,listItem:fl,list:pl,paragraph:ml,root:hl,strong:gl,table:xl,tableCell:Il,tableRow:Ll,text:Sl,thematicBreak:wl,toml:Sa,yaml:Sa,definition:Sa,footnoteDefinition:Sa};function Sa(){}var bl=typeof self=="object"?self:globalThis,xf=(e,t)=>{let a=(o,n)=>(e.set(n,o),o),r=o=>{if(e.has(o))return e.get(o);let[n,l]=t[o];switch(n){case 0:case-1:return a(l,o);case 1:{let i=a([],o);for(let u of l)i.push(r(u));return i}case 2:{let i=a({},o);for(let[u,s]of l)i[r(u)]=r(s);return i}case 3:return a(new Date(l),o);case 4:{let{source:i,flags:u}=l;return a(new RegExp(i,u),o)}case 5:{let i=a(new Map,o);for(let[u,s]of l)i.set(r(u),r(s));return i}case 6:{let i=a(new Set,o);for(let u of l)i.add(r(u));return i}case 7:{let{name:i,message:u}=l;return a(new bl[i](u),o)}case 8:return a(BigInt(l),o);case"BigInt":return a(Object(BigInt(l)),o);case"ArrayBuffer":return a(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:i}=new Uint8Array(l);return a(new DataView(i),l)}}return a(new bl[n](l),o)};return r},Fr=e=>xf(new Map,e)(0);var kt="",{toString:Lf}={},{keys:If}=Object,Vt=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=Lf.call(e).slice(8,-1);switch(a){case"Array":return[1,kt];case"Object":return[2,kt];case"Date":return[3,kt];case"RegExp":return[4,kt];case"Map":return[5,kt];case"Set":return[6,kt];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},ya=([e,t])=>e===0&&(t==="function"||t==="symbol"),Cf=(e,t,a,r)=>{let o=(l,i)=>{let u=r.push(l)-1;return a.set(i,u),u},n=l=>{if(a.has(l))return a.get(l);let[i,u]=Vt(l);switch(i){case 0:{let d=l;switch(u){case"bigint":i=8,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return o([-1],l)}return o([i,d],l)}case 1:{if(u){let p=l;return u==="DataView"?p=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(l)),o([u,[...p]],l)}let d=[],f=o([i,d],l);for(let p of l)d.push(n(p));return f}case 2:{if(u)switch(u){case"BigInt":return o([u,l.toString()],l);case"Boolean":case"Number":case"String":return o([u,l.valueOf()],l)}if(t&&"toJSON"in l)return n(l.toJSON());let d=[],f=o([i,d],l);for(let p of If(l))(e||!ya(Vt(l[p])))&&d.push([n(p),n(l[p])]);return f}case 3:return o([i,l.toISOString()],l);case 4:{let{source:d,flags:f}=l;return o([i,{source:d,flags:f}],l)}case 5:{let d=[],f=o([i,d],l);for(let[p,c]of l)(e||!(ya(Vt(p))||ya(Vt(c))))&&d.push([n(p),n(c)]);return f}case 6:{let d=[],f=o([i,d],l);for(let p of l)(e||!ya(Vt(p)))&&d.push(n(p));return f}}let{message:s}=l;return o([i,{name:u,message:s}],l)};return n},Dr=(e,{json:t,lossy:a}={})=>{let r=[];return Cf(!(t||a),!!t,new Map,r)(e),r};var St=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Fr(Dr(e,t)):structuredClone(e):(e,t)=>Fr(Dr(e,t));function kf(e,t){let a=[{type:"text",value:"\u21A9"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function Sf(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Tl(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||kf,r=e.options.footnoteBackLabel||Sf,o=e.options.footnoteLabel||"Footnotes",n=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},i=[],u=-1;for(;++u<e.footnoteOrder.length;){let s=e.footnoteById.get(e.footnoteOrder[u]);if(!s)continue;let d=e.all(s),f=String(s.identifier).toUpperCase(),p=Ae(f.toLowerCase()),c=0,h=[],x=e.footnoteCounts.get(f);for(;x!==void 0&&++c<=x;){h.length>0&&h.push({type:"text",value:" "});let P=typeof a=="string"?a:a(u,c);typeof P=="string"&&(P={type:"text",value:P}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,c),className:["data-footnote-backref"]},children:Array.isArray(P)?P:[P]})}let S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){let P=S.children[S.children.length-1];P&&P.type==="text"?P.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...h)}else d.push(...h);let L={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(s,L),i.push(L)}if(i.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:n,properties:{...St(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
9
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:`
|
|
10
|
+
`}]}}var Je=(function(e){if(e==null)return Pf;if(typeof e=="function")return ba(e);if(typeof e=="object")return Array.isArray(e)?wf(e):yf(e);if(typeof e=="string")return bf(e);throw new Error("Expected function, string, or object as test")});function wf(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Je(e[a]);return ba(r);function r(...o){let n=-1;for(;++n<t.length;)if(t[n].apply(this,o))return!0;return!1}}function yf(e){let t=e;return ba(a);function a(r){let o=r,n;for(n in e)if(o[n]!==t[n])return!1;return!0}}function bf(e){return ba(t);function t(a){return a&&a.type===e}}function ba(e){return t;function t(a,r,o){return!!(Af(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function Pf(){return!0}function Af(e){return e!==null&&typeof e=="object"&&"type"in e}var Bl=[],Pa=!0,mt=!1,Aa="skip";function _t(e,t,a,r){let o;typeof t=="function"&&typeof a!="function"?(r=a,a=t):o=t;let n=Je(o),l=r?-1:1;i(e,void 0,[])();function i(u,s,d){let f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){let c=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(u.type+(c?"<"+c+">":""))+")"})}return p;function p(){let c=Bl,h,x,S;if((!t||n(u,s,d[d.length-1]||void 0))&&(c=vf(a(u,d)),c[0]===mt))return c;if("children"in u&&u.children){let L=u;if(L.children&&c[0]!==Aa)for(x=(r?L.children.length:-1)+l,S=d.concat(L);x>-1&&x<L.children.length;){let P=L.children[x];if(h=i(P,x,S)(),h[0]===mt)return h;x=typeof h[1]=="number"?h[1]:x+l}}return c}}}function vf(e){return Array.isArray(e)?e:typeof e=="number"?[Pa,e]:e==null?Bl:[e]}function ht(e,t,a,r){let o,n,l;typeof t=="function"&&typeof a!="function"?(n=void 0,l=t,o=a):(n=t,l=a,o=r),_t(e,n,i,o);function i(u,s){let d=s[s.length-1],f=d?d.children.indexOf(u):void 0;return l(u,f,d)}}var Rr={}.hasOwnProperty,Mf={};function Dl(e,t){let a=t||Mf,r=new Map,o=new Map,n=new Map,l={...yl,...a.handlers},i={all:s,applyData:Bf,definitionById:r,footnoteById:o,footnoteCounts:n,footnoteOrder:[],handlers:l,one:u,options:a,patch:Tf,wrap:Df};return ht(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){let f=d.type==="definition"?r:o,p=String(d.identifier).toUpperCase();f.has(p)||f.set(p,d)}}),i;function u(d,f){let p=d.type,c=i.handlers[p];if(Rr.call(i.handlers,p)&&c)return c(i,d,f);if(i.options.passThrough&&i.options.passThrough.includes(p)){if("children"in d){let{children:x,...S}=d,L=St(S);return L.children=i.all(d),L}return St(d)}return(i.options.unknownHandler||Ff)(i,d,f)}function s(d){let f=[];if("children"in d){let p=d.children,c=-1;for(;++c<p.length;){let h=i.one(p[c],d);if(h){if(c&&p[c-1].type==="break"&&(!Array.isArray(h)&&h.type==="text"&&(h.value=Fl(h.value)),!Array.isArray(h)&&h.type==="element")){let x=h.children[0];x&&x.type==="text"&&(x.value=Fl(x.value))}Array.isArray(h)?f.push(...h):f.push(h)}}}return f}}function Tf(e,t){e.position&&(t.position=ur(e))}function Bf(e,t){let a=t;if(e&&e.data){let r=e.data.hName,o=e.data.hChildren,n=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{let l="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:l}}a.type==="element"&&n&&Object.assign(a.properties,St(n)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function Ff(e,t){let a=t.data||{},r="value"in t&&!(Rr.call(a,"hProperties")||Rr.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Df(e,t){let a=[],r=-1;for(t&&a.push({type:"text",value:`
|
|
11
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
12
|
+
`}),a.push(e[r]);return t&&e.length>0&&a.push({type:"text",value:`
|
|
13
|
+
`}),a}function Fl(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function va(e,t){let a=Dl(e,t),r=a.one(e,void 0),o=Tl(a),n=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&("children"in n,n.children.push({type:"text",value:`
|
|
14
|
+
`},o)),n}function Ma(e,t){return e&&"run"in e?async function(a,r){let o=va(a,{file:r,...t});await e.run(o,r)}:function(a,r){return va(a,{file:r,...e||t})}}function Er(e){if(e)throw e}var Fa=zo(Wl(),1);function Gt(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Or(){let e=[],t={run:a,use:r};return t;function a(...o){let n=-1,l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);i(null,...o);function i(u,...s){let d=e[++n],f=-1;if(u){l(u);return}for(;++f<o.length;)(s[f]===null||s[f]===void 0)&&(s[f]=o[f]);o=s,d?Vl(d,i)(...s):l(null,...s)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function Vl(e,t){let a;return r;function r(...l){let i=e.length>l.length,u;i&&l.push(o);try{u=e.apply(this,l)}catch(s){let d=s;if(i&&a)throw d;return o(d)}i||(u&&u.then&&typeof u.then=="function"?u.then(n,o):u instanceof Error?o(u):n(u))}function o(l,...i){a||(a=!0,t(l,...i))}function n(l){o(null,l)}}var Te={basename:Rf,dirname:Ef,extname:Of,join:qf,sep:"/"};function Rf(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jt(e);let a=0,r=-1,o=e.length,n;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(n){a=o+1;break}}else r<0&&(n=!0,r=o+1);return r<0?"":e.slice(a,r)}if(t===e)return"";let l=-1,i=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(n){a=o+1;break}}else l<0&&(n=!0,l=o+1),i>-1&&(e.codePointAt(o)===t.codePointAt(i--)?i<0&&(r=o):(i=-1,r=l));return a===r?r=l:r<0&&(r=e.length),e.slice(a,r)}function Ef(e){if(jt(e),e.length===0)return".";let t=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){t=a;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Of(e){jt(e);let t=e.length,a=-1,r=0,o=-1,n=0,l;for(;t--;){let i=e.codePointAt(t);if(i===47){if(l){r=t+1;break}continue}a<0&&(l=!0,a=t+1),i===46?o<0?o=t:n!==1&&(n=1):o>-1&&(n=-1)}return o<0||a<0||n===0||n===1&&o===a-1&&o===r+1?"":e.slice(o,a)}function qf(...e){let t=-1,a;for(;++t<e.length;)jt(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":Uf(a)}function Uf(e){jt(e);let t=e.codePointAt(0)===47,a=Hf(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function Hf(e,t){let a="",r=0,o=-1,n=0,l=-1,i,u;for(;++l<=e.length;){if(l<e.length)i=e.codePointAt(l);else{if(i===47)break;i=47}if(i===47){if(!(o===l-1||n===1))if(o!==l-1&&n===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(u=a.lastIndexOf("/"),u!==a.length-1){u<0?(a="",r=0):(a=a.slice(0,u),r=a.length-1-a.lastIndexOf("/")),o=l,n=0;continue}}else if(a.length>0){a="",r=0,o=l,n=0;continue}}t&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(o+1,l):a=e.slice(o+1,l),r=l-o-1;o=l,n=0}else i===46&&n>-1?n++:n=-1}return a}function jt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var _l={cwd:zf};function zf(){return"/"}function wt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Gl(e){if(typeof e=="string")e=new URL(e);else if(!wt(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Nf(e)}function Nf(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){let r=t.codePointAt(a+2);if(r===70||r===102){let o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}var qr=["history","path","basename","stem","extname","dirname"],gt=class{constructor(t){let a;t?wt(t)?a={path:t}:typeof t=="string"||Wf(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":_l.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qr.length;){let n=qr[r];n in a&&a[n]!==void 0&&a[n]!==null&&(this[n]=n==="history"?[...a[n]]:a[n])}let o;for(o in a)qr.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?Te.basename(this.path):void 0}set basename(t){Hr(t,"basename"),Ur(t,"basename"),this.path=Te.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Te.dirname(this.path):void 0}set dirname(t){jl(this.basename,"dirname"),this.path=Te.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Te.extname(this.path):void 0}set extname(t){if(Ur(t,"extname"),jl(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Te.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wt(t)&&(t=Gl(t)),Hr(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Te.basename(this.path,this.extname):void 0}set stem(t){Hr(t,"stem"),Ur(t,"stem"),this.path=Te.join(this.dirname||"",t+(this.extname||""))}fail(t,a,r){let o=this.message(t,a,r);throw o.fatal=!0,o}info(t,a,r){let o=this.message(t,a,r);return o.fatal=void 0,o}message(t,a,r){let o=new ne(t,a,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function Ur(e,t){if(e&&e.includes(Te.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Te.sep+"`")}function Hr(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Wf(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Xl=(function(e){let r=this.constructor.prototype,o=r[e],n=function(){return o.apply(n,arguments)};return Object.setPrototypeOf(n,r),n});var Vf={}.hasOwnProperty,Vr=class e extends Xl{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Or()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let r=this.attachers[a];t.use(...r)}return t.data((0,Fa.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Wr("data",this.frozen),this.namespace[t]=a,this):Vf.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Wr("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let o=a.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let a=Ba(t),r=this.parser||this.Parser;return zr("parse",r),r(String(a),a)}process(t,a){let r=this;return this.freeze(),zr("process",this.parser||this.Parser),Nr("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(n,l){let i=Ba(t),u=r.parse(i);r.run(u,i,function(d,f,p){if(d||!f||!p)return s(d);let c=f,h=r.stringify(c,p);Gf(h)?p.value=h:p.result=h,s(d,p)});function s(d,f){d||!f?l(d):n?n(f):a(void 0,f)}}}processSync(t){let a=!1,r;return this.freeze(),zr("processSync",this.parser||this.Parser),Nr("processSync",this.compiler||this.Compiler),this.process(t,o),Ql("processSync","process",a),r;function o(n,l){a=!0,Er(n),r=l}}run(t,a,r){Kl(t),this.freeze();let o=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?n(void 0,r):new Promise(n);function n(l,i){let u=Ba(a);o.run(t,u,s);function s(d,f,p){let c=f||t;d?i(d):l?l(c):r(void 0,c,p)}}}runSync(t,a){let r=!1,o;return this.run(t,a,n),Ql("runSync","run",r),o;function n(l,i){Er(l),o=i,r=!0}}stringify(t,a){this.freeze();let r=Ba(a),o=this.compiler||this.Compiler;return Nr("stringify",o),Kl(t),o(t,r)}use(t,...a){let r=this.attachers,o=this.namespace;if(Wr("use",this.frozen),t!=null)if(typeof t=="function")u(t,a);else if(typeof t=="object")Array.isArray(t)?i(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function n(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){let[d,...f]=s;u(d,f)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(s.plugins),s.settings&&(o.settings=(0,Fa.default)(!0,o.settings,s.settings))}function i(s){let d=-1;if(s!=null)if(Array.isArray(s))for(;++d<s.length;){let f=s[d];n(f)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===s){p=f;break}if(p===-1)r.push([s,...d]);else if(d.length>0){let[c,...h]=d,x=r[p][1];Gt(x)&&Gt(c)&&(c=(0,Fa.default)(!0,x,c)),r[p]=[s,c,...h]}}}},_r=new Vr().freeze();function zr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Nr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Kl(e){if(!Gt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ql(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ba(e){return _f(e)?e:new gt(e)}function _f(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Gf(e){return typeof e=="string"||jf(e)}function jf(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Zf="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zl=[],$l={allowDangerousHtml:!0},$f=/^(https?|ircs?|mailto|xmpp)$/i,Jf=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Gr(e){let t=Yf(e),a=ec(e);return tc(t.runSync(t.parse(a),a),e)}function Yf(e){let t=e.rehypePlugins||Zl,a=e.remarkPlugins||Zl,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$l}:$l;return _r().use(Ca).use(a).use(Ma,r).use(t)}function ec(e){let t=e.children||"",a=new gt;return typeof t=="string"?a.value=t:(""+t,void 0),a}function tc(e,t){let a=t.allowedElements,r=t.allowElement,o=t.components,n=t.disallowedElements,l=t.skipHtml,i=t.unwrapDisallowed,u=t.urlTransform||Jl;for(let d of Jf)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Zf+d.id,void 0);return a&&n&&void 0,ht(e,s),fr(e,{Fragment:Xf,components:o,ignoreInvalidStyle:!0,jsx:Kf,jsxs:Qf,passKeys:!0,passNode:!0});function s(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return l?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let c;for(c in qt)if(Object.hasOwn(qt,c)&&Object.hasOwn(d.properties,c)){let h=d.properties[c],x=qt[c];(x===null||x.includes(d.tagName))&&(d.properties[c]=u(String(h||""),c,d))}}if(d.type==="element"){let c=a?!a.includes(d.tagName):n?n.includes(d.tagName):!1;if(!c&&r&&typeof f=="number"&&(c=!r(d,f,p)),c&&p&&typeof f=="number")return i&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function Jl(e){let t=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||a!==-1&&t>a||r!==-1&&t>r||$f.test(e.slice(0,t))?e:""}function jr(e,t){let a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=a.indexOf(t);for(;o!==-1;)r++,o=a.indexOf(t,o+t.length);return r}function Xr(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Kr(e,t,a){let o=Je((a||{}).ignore||[]),n=ac(t),l=-1;for(;++l<n.length;)_t(e,"text",i);function i(s,d){let f=-1,p;for(;++f<d.length;){let c=d[f],h=p?p.children:void 0;if(o(c,h?h.indexOf(c):void 0,p))return;p=c}if(p)return u(s,d)}function u(s,d){let f=d[d.length-1],p=n[l][0],c=n[l][1],h=0,S=f.children.indexOf(s),L=!1,P=[];p.lastIndex=0;let w=p.exec(s.value);for(;w;){let D=w.index,M={index:w.index,input:w.input,stack:[...d,s]},C=c(...w,M);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=D+1:(h!==D&&P.push({type:"text",value:s.value.slice(h,D)}),Array.isArray(C)?P.push(...C):C&&P.push(C),h=D+w[0].length,L=!0),!p.global)break;w=p.exec(s.value)}return L?(h<s.value.length&&P.push({type:"text",value:s.value.slice(h)}),f.children.splice(S,1,...P)):P=[s],S+P.length}}function ac(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let a=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<a.length;){let o=a[r];t.push([rc(o[0]),oc(o[1])])}return t}function rc(e){return typeof e=="string"?new RegExp(Xr(e),"g"):e}function oc(e){return typeof e=="function"?e:function(){return e}}var Qr="phrasing",Zr=["autolink","link","image","label"];function Jr(){return{transforms:[dc],enter:{literalAutolink:nc,literalAutolinkEmail:$r,literalAutolinkHttp:$r,literalAutolinkWww:$r},exit:{literalAutolink:sc,literalAutolinkEmail:uc,literalAutolinkHttp:lc,literalAutolinkWww:ic}}}function Yr(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qr,notInConstruct:Zr},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qr,notInConstruct:Zr},{character:":",before:"[ps]",after:"\\/",inConstruct:Qr,notInConstruct:Zr}]}}function nc(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function $r(e){this.config.enter.autolinkProtocol.call(this,e)}function lc(e){this.config.exit.autolinkProtocol.call(this,e)}function ic(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function uc(e){this.config.exit.autolinkEmail.call(this,e)}function sc(e){this.exit(e)}function dc(e){Kr(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fc],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,cc]],{ignore:["link","linkReference"]})}function fc(e,t,a,r,o){let n="";if(!Yl(o)||(/^w/i.test(t)&&(a=t+a,t="",n="http://"),!pc(a)))return!1;let l=mc(a+r);if(!l[0])return!1;let i={type:"link",title:null,url:n+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[i,{type:"text",value:l[1]}]:i}function cc(e,t,a,r){return!Yl(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function pc(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function mc(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],r=a.indexOf(")"),o=jr(e,"("),n=jr(e,")");for(;r!==-1&&o>n;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),n++;return[e,a]}function Yl(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||De(a)||dt(a))&&(!t||a!==47)}ei.peek=wc;function hc(){this.buffer()}function gc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function xc(){this.buffer()}function Lc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ic(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=pe(this.sliceSerialize(e)).toLowerCase(),a.label=t}function Cc(e){this.exit(e)}function kc(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=pe(this.sliceSerialize(e)).toLowerCase(),a.label=t}function Sc(e){this.exit(e)}function wc(){return"["}function ei(e,t,a,r){let o=a.createTracker(r),n=o.move("[^"),l=a.enter("footnoteReference"),i=a.enter("reference");return n+=o.move(a.safe(a.associationId(e),{after:"]",before:n})),i(),l(),n+=o.move("]"),n}function eo(){return{enter:{gfmFootnoteCallString:hc,gfmFootnoteCall:gc,gfmFootnoteDefinitionLabelString:xc,gfmFootnoteDefinition:Lc},exit:{gfmFootnoteCallString:Ic,gfmFootnoteCall:Cc,gfmFootnoteDefinitionLabelString:kc,gfmFootnoteDefinition:Sc}}}function to(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:ei},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,o,n,l){let i=n.createTracker(l),u=i.move("[^"),s=n.enter("footnoteDefinition"),d=n.enter("label");return u+=i.move(n.safe(n.associationId(r),{before:u,after:"]"})),d(),u+=i.move("]:"),r.children&&r.children.length>0&&(i.shift(4),u+=i.move((t?`
|
|
15
|
+
`:" ")+n.indentLines(n.containerFlow(r,i.current()),t?ti:yc))),s(),u}}function yc(e,t,a){return t===0?e:ti(e,t,a)}function ti(e,t,a){return(a?"":" ")+e}var bc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ai.peek=vc;function ao(){return{canContainEols:["delete"],enter:{strikethrough:Pc},exit:{strikethrough:Ac}}}function ro(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:bc}],handlers:{delete:ai}}}function Pc(e){this.enter({type:"delete",children:[]},e)}function Ac(e){this.exit(e)}function ai(e,t,a,r){let o=a.createTracker(r),n=a.enter("strikethrough"),l=o.move("~~");return l+=a.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),n(),l}function vc(){return"~"}function Mc(e){return e.length}function oi(e,t){let a=t||{},r=(a.align||[]).concat(),o=a.stringLength||Mc,n=[],l=[],i=[],u=[],s=0,d=-1;for(;++d<e.length;){let x=[],S=[],L=-1;for(e[d].length>s&&(s=e[d].length);++L<e[d].length;){let P=Tc(e[d][L]);if(a.alignDelimiters!==!1){let w=o(P);S[L]=w,(u[L]===void 0||w>u[L])&&(u[L]=w)}x.push(P)}l[d]=x,i[d]=S}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<s;)n[f]=ri(r[f]);else{let x=ri(r);for(;++f<s;)n[f]=x}f=-1;let p=[],c=[];for(;++f<s;){let x=n[f],S="",L="";x===99?(S=":",L=":"):x===108?S=":":x===114&&(L=":");let P=a.alignDelimiters===!1?1:Math.max(1,u[f]-S.length-L.length),w=S+"-".repeat(P)+L;a.alignDelimiters!==!1&&(P=S.length+P+L.length,P>u[f]&&(u[f]=P),c[f]=P),p[f]=w}l.splice(1,0,p),i.splice(1,0,c),d=-1;let h=[];for(;++d<l.length;){let x=l[d],S=i[d];f=-1;let L=[];for(;++f<s;){let P=x[f]||"",w="",D="";if(a.alignDelimiters!==!1){let M=u[f]-(S[f]||0),C=n[f];C===114?w=" ".repeat(M):C===99?M%2?(w=" ".repeat(M/2+.5),D=" ".repeat(M/2-.5)):(w=" ".repeat(M/2),D=w):D=" ".repeat(M)}a.delimiterStart!==!1&&!f&&L.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&P==="")&&(a.delimiterStart!==!1||f)&&L.push(" "),a.alignDelimiters!==!1&&L.push(w),L.push(P),a.alignDelimiters!==!1&&L.push(D),a.padding!==!1&&L.push(" "),(a.delimiterEnd!==!1||f!==s-1)&&L.push("|")}h.push(a.delimiterEnd===!1?L.join("").replace(/ +$/,""):L.join(""))}return h.join(`
|
|
16
|
+
`)}function Tc(e){return e==null?"":String(e)}function ri(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ni(e,t,a,r){let o=a.enter("blockquote"),n=a.createTracker(r);n.move("> "),n.shift(2);let l=a.indentLines(a.containerFlow(e,n.current()),Bc);return o(),l}function Bc(e,t,a){return">"+(a?"":" ")+e}function ii(e,t){return li(e,t.inConstruct,!0)&&!li(e,t.notInConstruct,!1)}function li(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function oo(e,t,a,r){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
|
|
17
|
+
`&&ii(a.stack,a.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
18
|
+
`}function ui(e,t){let a=String(e),r=a.indexOf(t),o=r,n=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++n>l&&(l=n):n=1,o=r+t.length,r=a.indexOf(t,o);return l}function si(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function di(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function fi(e,t,a,r){let o=di(a),n=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(si(e,a)){let f=a.enter("codeIndented"),p=a.indentLines(n,Fc);return f(),p}let i=a.createTracker(r),u=o.repeat(Math.max(ui(n,o)+1,3)),s=a.enter("codeFenced"),d=i.move(u);if(e.lang){let f=a.enter(`codeFencedLang${l}`);d+=i.move(a.safe(e.lang,{before:d,after:" ",encode:["`"],...i.current()})),f()}if(e.lang&&e.meta){let f=a.enter(`codeFencedMeta${l}`);d+=i.move(" "),d+=i.move(a.safe(e.meta,{before:d,after:`
|
|
19
|
+
`,encode:["`"],...i.current()})),f()}return d+=i.move(`
|
|
20
|
+
`),n&&(d+=i.move(n+`
|
|
21
|
+
`)),d+=i.move(u),s(),d}function Fc(e,t,a){return(a?"":" ")+e}function yt(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ci(e,t,a,r){let o=yt(a),n=o==='"'?"Quote":"Apostrophe",l=a.enter("definition"),i=a.enter("label"),u=a.createTracker(r),s=u.move("[");return s+=u.move(a.safe(a.associationId(e),{before:s,after:"]",...u.current()})),s+=u.move("]: "),i(),!e.url||/[\0- \u007F]/.test(e.url)?(i=a.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(a.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(i=a.enter("destinationRaw"),s+=u.move(a.safe(e.url,{before:s,after:e.title?" ":`
|
|
22
|
+
`,...u.current()}))),i(),e.title&&(i=a.enter(`title${n}`),s+=u.move(" "+o),s+=u.move(a.safe(e.title,{before:s,after:o,...u.current()})),s+=u.move(o),i()),l(),s}function pi(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ye(e){return"&#x"+e.toString(16).toUpperCase()+";"}function bt(e,t,a){let r=Ne(e),o=Ne(t);return r===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}no.peek=Dc;function no(e,t,a,r){let o=pi(a),n=a.enter("emphasis"),l=a.createTracker(r),i=l.move(o),u=l.move(a.containerPhrasing(e,{after:o,before:i,...l.current()})),s=u.charCodeAt(0),d=bt(r.before.charCodeAt(r.before.length-1),s,o);d.inside&&(u=Ye(s)+u.slice(1));let f=u.charCodeAt(u.length-1),p=bt(r.after.charCodeAt(0),f,o);p.inside&&(u=u.slice(0,-1)+Ye(f));let c=l.move(o);return n(),a.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},i+u+c}function Dc(e,t,a){return a.options.emphasis||"*"}function mi(e,t){let a=!1;return ht(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,mt}),!!((!e.depth||e.depth<3)&&ut(e)&&(t.options.setext||a))}function hi(e,t,a,r){let o=Math.max(Math.min(6,e.depth||1),1),n=a.createTracker(r);if(mi(e,a)){let d=a.enter("headingSetext"),f=a.enter("phrasing"),p=a.containerPhrasing(e,{...n.current(),before:`
|
|
23
|
+
`,after:`
|
|
24
|
+
`});return f(),d(),p+`
|
|
25
|
+
`+(o===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
26
|
+
`))+1))}let l="#".repeat(o),i=a.enter("headingAtx"),u=a.enter("phrasing");n.move(l+" ");let s=a.containerPhrasing(e,{before:"# ",after:`
|
|
27
|
+
`,...n.current()});return/^[\t ]/.test(s)&&(s=Ye(s.charCodeAt(0))+s.slice(1)),s=s?l+" "+s:l,a.options.closeAtx&&(s+=" "+l),u(),i(),s}lo.peek=Rc;function lo(e){return e.value||""}function Rc(){return"<"}io.peek=Ec;function io(e,t,a,r){let o=yt(a),n=o==='"'?"Quote":"Apostrophe",l=a.enter("image"),i=a.enter("label"),u=a.createTracker(r),s=u.move("![");return s+=u.move(a.safe(e.alt,{before:s,after:"]",...u.current()})),s+=u.move("]("),i(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(i=a.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(a.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(i=a.enter("destinationRaw"),s+=u.move(a.safe(e.url,{before:s,after:e.title?" ":")",...u.current()}))),i(),e.title&&(i=a.enter(`title${n}`),s+=u.move(" "+o),s+=u.move(a.safe(e.title,{before:s,after:o,...u.current()})),s+=u.move(o),i()),s+=u.move(")"),l(),s}function Ec(){return"!"}uo.peek=Oc;function uo(e,t,a,r){let o=e.referenceType,n=a.enter("imageReference"),l=a.enter("label"),i=a.createTracker(r),u=i.move("!["),s=a.safe(e.alt,{before:u,after:"]",...i.current()});u+=i.move(s+"]["),l();let d=a.stack;a.stack=[],l=a.enter("reference");let f=a.safe(a.associationId(e),{before:u,after:"]",...i.current()});return l(),a.stack=d,n(),o==="full"||!s||s!==f?u+=i.move(f+"]"):o==="shortcut"?u=u.slice(0,-1):u+=i.move("]"),u}function Oc(){return"!"}so.peek=qc;function so(e,t,a){let r=e.value||"",o="`",n=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++n<a.unsafe.length;){let l=a.unsafe[n],i=a.compilePattern(l),u;if(l.atBreak)for(;u=i.exec(r);){let s=u.index;r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13&&s--,r=r.slice(0,s)+" "+r.slice(u.index+1)}}return o+r+o}function qc(){return"`"}function fo(e,t){let a=ut(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}co.peek=Uc;function co(e,t,a,r){let o=yt(a),n=o==='"'?"Quote":"Apostrophe",l=a.createTracker(r),i,u;if(fo(e,a)){let d=a.stack;a.stack=[],i=a.enter("autolink");let f=l.move("<");return f+=l.move(a.containerPhrasing(e,{before:f,after:">",...l.current()})),f+=l.move(">"),i(),a.stack=d,f}i=a.enter("link"),u=a.enter("label");let s=l.move("[");return s+=l.move(a.containerPhrasing(e,{before:s,after:"](",...l.current()})),s+=l.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=a.enter("destinationLiteral"),s+=l.move("<"),s+=l.move(a.safe(e.url,{before:s,after:">",...l.current()})),s+=l.move(">")):(u=a.enter("destinationRaw"),s+=l.move(a.safe(e.url,{before:s,after:e.title?" ":")",...l.current()}))),u(),e.title&&(u=a.enter(`title${n}`),s+=l.move(" "+o),s+=l.move(a.safe(e.title,{before:s,after:o,...l.current()})),s+=l.move(o),u()),s+=l.move(")"),i(),s}function Uc(e,t,a){return fo(e,a)?"<":"["}po.peek=Hc;function po(e,t,a,r){let o=e.referenceType,n=a.enter("linkReference"),l=a.enter("label"),i=a.createTracker(r),u=i.move("["),s=a.containerPhrasing(e,{before:u,after:"]",...i.current()});u+=i.move(s+"]["),l();let d=a.stack;a.stack=[],l=a.enter("reference");let f=a.safe(a.associationId(e),{before:u,after:"]",...i.current()});return l(),a.stack=d,n(),o==="full"||!s||s!==f?u+=i.move(f+"]"):o==="shortcut"?u=u.slice(0,-1):u+=i.move("]"),u}function Hc(){return"["}function Pt(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function gi(e){let t=Pt(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function xi(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Da(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Li(e,t,a,r){let o=a.enter("list"),n=a.bulletCurrent,l=e.ordered?xi(a):Pt(a),i=e.ordered?l==="."?")":".":gi(a),u=t&&a.bulletLastUsed?l===a.bulletLastUsed:!1;if(!e.ordered){let d=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&d&&(!d.children||!d.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(u=!0),Da(a)===l&&d){let f=-1;for(;++f<e.children.length;){let p=e.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=i),a.bulletCurrent=l;let s=a.containerFlow(e,r);return a.bulletLastUsed=l,a.bulletCurrent=n,o(),s}function Ii(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Ci(e,t,a,r){let o=Ii(a),n=a.bulletCurrent||Pt(a);t&&t.type==="list"&&t.ordered&&(n=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+n);let l=n.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);let i=a.createTracker(r);i.move(n+" ".repeat(l-n.length)),i.shift(l);let u=a.enter("listItem"),s=a.indentLines(a.containerFlow(e,i.current()),d);return u(),s;function d(f,p,c){return p?(c?"":" ".repeat(l))+f:(c?n:n+" ".repeat(l-n.length))+f}}function ki(e,t,a,r){let o=a.enter("paragraph"),n=a.enter("phrasing"),l=a.containerPhrasing(e,r);return n(),o(),l}var mo=Je(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Si(e,t,a,r){return(e.children.some(function(l){return mo(l)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function wi(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ho.peek=zc;function ho(e,t,a,r){let o=wi(a),n=a.enter("strong"),l=a.createTracker(r),i=l.move(o+o),u=l.move(a.containerPhrasing(e,{after:o,before:i,...l.current()})),s=u.charCodeAt(0),d=bt(r.before.charCodeAt(r.before.length-1),s,o);d.inside&&(u=Ye(s)+u.slice(1));let f=u.charCodeAt(u.length-1),p=bt(r.after.charCodeAt(0),f,o);p.inside&&(u=u.slice(0,-1)+Ye(f));let c=l.move(o+o);return n(),a.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},i+u+c}function zc(e,t,a){return a.options.strong||"*"}function yi(e,t,a,r){return a.safe(e.value,r)}function bi(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Pi(e,t,a){let r=(Da(a)+(a.options.ruleSpaces?" ":"")).repeat(bi(a));return a.options.ruleSpaces?r.slice(0,-1):r}var Xt={blockquote:ni,break:oo,code:fi,definition:ci,emphasis:no,hardBreak:oo,heading:hi,html:lo,image:io,imageReference:uo,inlineCode:so,link:co,linkReference:po,list:Li,listItem:Ci,paragraph:ki,root:Si,strong:ho,text:yi,thematicBreak:Pi};function xo(){return{enter:{table:Nc,tableData:Ai,tableHeader:Ai,tableRow:Vc},exit:{codeText:_c,table:Wc,tableData:go,tableHeader:go,tableRow:go}}}function Nc(e){let t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function Wc(e){this.exit(e),this.data.inTable=void 0}function Vc(e){this.enter({type:"tableRow",children:[]},e)}function go(e){this.exit(e)}function Ai(e){this.enter({type:"tableCell",children:[]},e)}function _c(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Gc));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function Gc(e,t){return t==="|"?t:e}function Lo(e){let t=e||{},a=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,n=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
28
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:u,tableRow:i}};function l(c,h,x,S){return s(d(c,x,S),c.align)}function i(c,h,x,S){let L=f(c,x,S),P=s([L]);return P.slice(0,P.indexOf(`
|
|
29
|
+
`))}function u(c,h,x,S){let L=x.enter("tableCell"),P=x.enter("phrasing"),w=x.containerPhrasing(c,{...S,before:n,after:n});return P(),L(),w}function s(c,h){return oi(c,{align:h,alignDelimiters:r,padding:a,stringLength:o})}function d(c,h,x){let S=c.children,L=-1,P=[],w=h.enter("table");for(;++L<S.length;)P[L]=f(S[L],h,x);return w(),P}function f(c,h,x){let S=c.children,L=-1,P=[],w=h.enter("tableRow");for(;++L<S.length;)P[L]=u(S[L],c,h,x);return w(),P}function p(c,h,x){let S=Xt.inlineCode(c,h,x);return x.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function Io(){return{exit:{taskListCheckValueChecked:vi,taskListCheckValueUnchecked:vi,paragraph:jc}}}function Co(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Xc}}}function vi(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function jc(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let a=this.stack[this.stack.length-1];a.type;let r=a.children[0];if(r&&r.type==="text"){let o=t.children,n=-1,l;for(;++n<o.length;){let i=o[n];if(i.type==="paragraph"){l=i;break}}l===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Xc(e,t,a,r){let o=e.children[0],n=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",i=a.createTracker(r);n&&i.move(l);let u=Xt.listItem(e,t,a,{...r,...i.current()});return n&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),u;function s(d){return d+l}}function ko(){return[Jr(),eo(),ao(),xo(),Io()]}function So(e){return{extensions:[Yr(),to(e),ro(),Lo(e),Co()]}}var Kc={tokenize:Yc,partial:!0},Mi={tokenize:ep,partial:!0},Ti={tokenize:tp,partial:!0},Bi={tokenize:ap,partial:!0},Qc={tokenize:rp,partial:!0},Fi={name:"wwwAutolink",tokenize:$c,previous:Ri},Di={name:"protocolAutolink",tokenize:Jc,previous:Ei},We={name:"emailAutolink",tokenize:Zc,previous:Oi},Ee={};function yo(){return{text:Ee}}var xt=48;for(;xt<123;)Ee[xt]=We,xt++,xt===58?xt=65:xt===91&&(xt=97);Ee[43]=We;Ee[45]=We;Ee[46]=We;Ee[95]=We;Ee[72]=[We,Di];Ee[104]=[We,Di];Ee[87]=[We,Fi];Ee[119]=[We,Fi];function Zc(e,t,a){let r=this,o,n;return l;function l(f){return!wo(f)||!Oi.call(r,r.previous)||bo(r.events)?a(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),i(f))}function i(f){return wo(f)?(e.consume(f),i):f===64?(e.consume(f),u):a(f)}function u(f){return f===46?e.check(Qc,d,s)(f):f===45||f===95||re(f)?(n=!0,e.consume(f),u):d(f)}function s(f){return e.consume(f),o=!0,u}function d(f){return n&&o&&se(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):a(f)}}function $c(e,t,a){let r=this;return o;function o(l){return l!==87&&l!==119||!Ri.call(r,r.previous)||bo(r.events)?a(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Kc,e.attempt(Mi,e.attempt(Ti,n),a),a)(l))}function n(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Jc(e,t,a){let r=this,o="",n=!1;return l;function l(f){return(f===72||f===104)&&Ei.call(r,r.previous)&&!bo(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),i):a(f)}function i(f){if(se(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),i;if(f===58){let p=o.toLowerCase();if(p==="http"||p==="https")return e.consume(f),u}return a(f)}function u(f){return f===47?(e.consume(f),n?s:(n=!0,u)):a(f)}function s(f){return f===null||st(f)||G(f)||De(f)||dt(f)?a(f):e.attempt(Mi,e.attempt(Ti,d),a)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Yc(e,t,a){let r=0;return o;function o(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),o):l===46&&r===3?(e.consume(l),n):a(l)}function n(l){return l===null?a(l):t(l)}}function ep(e,t,a){let r,o,n;return l;function l(s){return s===46||s===95?e.check(Bi,u,i)(s):s===null||G(s)||De(s)||s!==45&&dt(s)?u(s):(n=!0,e.consume(s),l)}function i(s){return s===95?r=!0:(o=r,r=void 0),e.consume(s),l}function u(s){return o||r||!n?a(s):t(s)}}function tp(e,t){let a=0,r=0;return o;function o(l){return l===40?(a++,e.consume(l),o):l===41&&r<a?n(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Bi,t,n)(l):l===null||G(l)||De(l)?t(l):(e.consume(l),o)}function n(l){return l===41&&r++,e.consume(l),o}}function ap(e,t,a){return r;function r(i){return i===33||i===34||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===63||i===95||i===126?(e.consume(i),r):i===38?(e.consume(i),n):i===93?(e.consume(i),o):i===60||i===null||G(i)||De(i)?t(i):a(i)}function o(i){return i===null||i===40||i===91||G(i)||De(i)?t(i):r(i)}function n(i){return se(i)?l(i):a(i)}function l(i){return i===59?(e.consume(i),r):se(i)?(e.consume(i),l):a(i)}}function rp(e,t,a){return r;function r(n){return e.consume(n),o}function o(n){return re(n)?a(n):t(n)}}function Ri(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function Ei(e){return!se(e)}function Oi(e){return!(e===47||wo(e))}function wo(e){return e===43||e===45||e===46||e===95||re(e)}function bo(e){let t=e.length,a=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}var op={tokenize:fp,partial:!0};function Po(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:up,continuation:{tokenize:sp},exit:dp}},text:{91:{name:"gfmFootnoteCall",tokenize:ip},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:np,resolveTo:lp}}}}function np(e,t,a){let r=this,o=r.events.length,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),l;for(;o--;){let u=r.events[o][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return i;function i(u){if(!l||!l._balanced)return a(u);let s=pe(r.sliceSerialize({start:l.end,end:r.now()}));return s.codePointAt(0)!==94||!n.includes(s.slice(1))?a(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function lp(e,t){let a=e.length,r;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){r=e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";let o={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},n={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};n.end.column++,n.end.offset++,n.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},n.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},u=[e[a+1],e[a+2],["enter",o,t],e[a+3],e[a+4],["enter",n,t],["exit",n,t],["enter",l,t],["enter",i,t],["exit",i,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(a,e.length-a+1,...u),e}function ip(e,t,a){let r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),n=0,l;return i;function i(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?a(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(f){if(n>999||f===93&&!l||f===null||f===91||G(f))return a(f);if(f===93){e.exit("chunkString");let p=e.exit("gfmFootnoteCallString");return o.includes(pe(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(f)}return G(f)||(l=!0),n++,e.consume(f),f===92?d:s}function d(f){return f===91||f===92||f===93?(e.consume(f),n++,s):s(f)}}function up(e,t,a){let r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),n,l=0,i;return u;function u(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):a(h)}function d(h){if(l>999||h===93&&!i||h===null||h===91||G(h))return a(h);if(h===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return n=pe(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return G(h)||(i=!0),l++,e.consume(h),h===92?f:d}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}function p(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),o.includes(n)||o.push(n),R(e,c,"gfmFootnoteDefinitionWhitespace")):a(h)}function c(h){return t(h)}}function sp(e,t,a){return e.check(Re,t,e.attempt(op,t,a))}function dp(e){e.exit("gfmFootnoteDefinition")}function fp(e,t,a){let r=this;return R(e,o,"gfmFootnoteDefinitionIndent",5);function o(n){let l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(n):a(n)}}function Ao(e){let a=(e||{}).singleTilde,r={name:"strikethrough",tokenize:n,resolveAll:o};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(l,i){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let s=u;for(;s--;)if(l[s][0]==="exit"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[s][1].end.offset-l[s][1].start.offset){l[u][1].type="strikethroughSequence",l[s][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},l[s][1].start),end:Object.assign({},l[u][1].end)},f={type:"strikethroughText",start:Object.assign({},l[s][1].end),end:Object.assign({},l[u][1].start)},p=[["enter",d,i],["enter",l[s][1],i],["exit",l[s][1],i],["enter",f,i]],c=i.parser.constructs.insideSpan.null;c&&le(p,p.length,0,Ze(c,l.slice(s+1,u),i)),le(p,p.length,0,[["exit",f,i],["enter",l[u][1],i],["exit",l[u][1],i],["exit",d,i]]),le(l,s-1,u-s+3,p),u=s+p.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function n(l,i,u){let s=this.previous,d=this.events,f=0;return p;function p(h){return s===126&&d[d.length-1][1].type!=="characterEscape"?u(h):(l.enter("strikethroughSequenceTemporary"),c(h))}function c(h){let x=Ne(s);if(h===126)return f>1?u(h):(l.consume(h),f++,c);if(f<2&&!a)return u(h);let S=l.exit("strikethroughSequenceTemporary"),L=Ne(h);return S._open=!L||L===2&&!!x,S._close=!x||x===2&&!!L,i(h)}}}var Ra=class{constructor(){this.map=[]}add(t,a,r){cp(this,t,a,r)}consume(t){if(this.map.sort(function(n,l){return n[0]-l[0]}),this.map.length===0)return;let a=this.map.length,r=[];for(;a>0;)a-=1,r.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(let n of o)t.push(n);o=r.pop()}this.map.length=0}};function cp(e,t,a,r){let o=0;if(!(a===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=a,e.map[o][2].push(...r);return}o+=1}e.map.push([t,a,r])}}function qi(e,t){let a=!1,r=[];for(;t<e.length;){let o=e[t];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let n=r.length-1;r[n]=r[n]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return r}function vo(){return{flow:{null:{name:"table",tokenize:pp,resolveAll:mp}}}}function pp(e,t,a){let r=this,o=0,n=0,l;return i;function i(I){let X=r.events.length-1;for(;X>-1;){let b=r.events[X][1].type;if(b==="lineEnding"||b==="linePrefix")X--;else break}let U=X>-1?r.events[X][1].type:null,B=U==="tableHead"||U==="tableRow"?C:u;return B===C&&r.parser.lazy[r.now().line]?a(I):B(I)}function u(I){return e.enter("tableHead"),e.enter("tableRow"),s(I)}function s(I){return I===124||(l=!0,n+=1),d(I)}function d(I){return I===null?a(I):T(I)?n>1?(n=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),c):a(I):O(I)?R(e,d,"whitespace")(I):(n+=1,l&&(l=!1,o+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),l=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||G(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?p:f)}function p(I){return I===92||I===124?(e.consume(I),f):f(I)}function c(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(I):(e.enter("tableDelimiterRow"),l=!1,O(I)?R(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):h(I))}function h(I){return I===45||I===58?S(I):I===124?(l=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),x):M(I)}function x(I){return O(I)?R(e,S,"whitespace")(I):S(I)}function S(I){return I===58?(n+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),L):I===45?(n+=1,L(I)):I===null||T(I)?D(I):M(I)}function L(I){return I===45?(e.enter("tableDelimiterFiller"),P(I)):M(I)}function P(I){return I===45?(e.consume(I),P):I===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(I))}function w(I){return O(I)?R(e,D,"whitespace")(I):D(I)}function D(I){return I===124?h(I):I===null||T(I)?!l||o!==n?M(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):M(I)}function M(I){return a(I)}function C(I){return e.enter("tableRow"),q(I)}function q(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),q):I===null||T(I)?(e.exit("tableRow"),t(I)):O(I)?R(e,q,"whitespace")(I):(e.enter("data"),H(I))}function H(I){return I===null||I===124||G(I)?(e.exit("data"),q(I)):(e.consume(I),I===92?E:H)}function E(I){return I===92||I===124?(e.consume(I),H):H(I)}}function mp(e,t){let a=-1,r=!0,o=0,n=[0,0,0,0],l=[0,0,0,0],i=!1,u=0,s,d,f,p=new Ra;for(;++a<e.length;){let c=e[a],h=c[1];c[0]==="enter"?h.type==="tableHead"?(i=!1,u!==0&&(Ui(p,t,u,s,d),d=void 0,u=0),s={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(a,0,[["enter",s,t]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(r=!0,f=void 0,n=[0,0,0,0],l=[0,a+1,0,0],i&&(i=!1,d={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(a,0,[["enter",d,t]])),o=h.type==="tableDelimiterRow"?2:d?3:1):o&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(n[1]!==0&&(l[0]=l[1],f=Ea(p,t,n,o,void 0,f),n=[0,0,0,0]),l[2]=a)):h.type==="tableCellDivider"&&(r?r=!1:(n[1]!==0&&(l[0]=l[1],f=Ea(p,t,n,o,void 0,f)),n=l,l=[n[1],a,0,0])):h.type==="tableHead"?(i=!0,u=a):h.type==="tableRow"||h.type==="tableDelimiterRow"?(u=a,n[1]!==0?(l[0]=l[1],f=Ea(p,t,n,o,a,f)):l[1]!==0&&(f=Ea(p,t,l,o,a,f)),o=0):o&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(l[3]=a)}for(u!==0&&Ui(p,t,u,s,d),p.consume(t.events),a=-1;++a<t.events.length;){let c=t.events[a];c[0]==="enter"&&c[1].type==="table"&&(c[1]._align=qi(t.events,a))}return e}function Ea(e,t,a,r,o,n){let l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",i="tableContent";a[0]!==0&&(n.end=Object.assign({},At(t.events,a[0])),e.add(a[0],0,[["exit",n,t]]));let u=At(t.events,a[1]);if(n={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(a[1],0,[["enter",n,t]]),a[2]!==0){let s=At(t.events,a[2]),d=At(t.events,a[3]),f={type:i,start:Object.assign({},s),end:Object.assign({},d)};if(e.add(a[2],0,[["enter",f,t]]),r!==2){let p=t.events[a[2]],c=t.events[a[3]];if(p[1].end=Object.assign({},c[1].end),p[1].type="chunkText",p[1].contentType="text",a[3]>a[2]+1){let h=a[2]+1,x=a[3]-a[2]-1;e.add(h,x,[])}}e.add(a[3]+1,0,[["exit",f,t]])}return o!==void 0&&(n.end=Object.assign({},At(t.events,o)),e.add(o,0,[["exit",n,t]]),n=void 0),n}function Ui(e,t,a,r,o){let n=[],l=At(t.events,a);o&&(o.end=Object.assign({},l),n.push(["exit",o,t])),r.end=Object.assign({},l),n.push(["exit",r,t]),e.add(a+1,0,n)}function At(e,t){let a=e[t],r=a[0]==="enter"?"start":"end";return a[1][r]}var hp={name:"tasklistCheck",tokenize:gp};function Mo(){return{text:{91:hp}}}function gp(e,t,a){let r=this;return o;function o(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),n)}function n(u){return G(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):a(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),i):a(u)}function i(u){return T(u)?t(u):O(u)?e.check({tokenize:xp},t,a)(u):a(u)}}function xp(e,t,a){return R(e,r,"whitespace");function r(o){return o===null?a(o):t(o)}}function Hi(e){return ua([yo(),Po(),Ao(e),vo(),Mo()])}var Lp={};function Oa(e){let t=this,a=e||Lp,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),n=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(Hi(a)),n.push(ko()),l.push(So(a))}import{useMemo as Ip,useState as Cp}from"react";import{jsx as Se,jsxs as zi}from"react/jsx-runtime";function kp({className:e}){return Se("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0,children:Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}function Sp({open:e}){return Se("svg",{className:F("h-3.5 w-3.5 transition-transform",e&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":!0,children:Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}function wp(e){return Array.isArray(e)?e.filter(t=>t!=null&&typeof t=="object").map((t,a)=>({title:typeof t.title=="string"&&t.title.trim()?t.title.trim():`Source ${a+1}`,snippet:typeof t.snippet=="string"?t.snippet.trim():void 0,score:typeof t.score=="number"&&Number.isFinite(t.score)?t.score:void 0,documentId:typeof t.documentId=="string"?t.documentId:void 0,chunkId:typeof t.chunkId=="string"?t.chunkId:void 0,_key:[t.documentId,t.chunkId,a].filter(Boolean).join("_")||`src-${a}`})):[]}function Ni({dark:e=!0,sources:t,messageId:a="sources",label:r="Sources",onSourceClick:o,className:n}){let[l,i]=Cp(!1),u=Ip(()=>wp(t),[t]);return u.length===0?null:zi("div",{className:F("relative inline-flex",n),children:[zi("button",{type:"button",onClick:()=>i(s=>!s),className:F("inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-colors",e?"text-gray-400 hover:bg-gray-700/60 hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),"aria-expanded":l,"aria-controls":`chat-sources-${a}`,children:[Se(kp,{className:"h-3.5 w-3.5 flex-shrink-0 opacity-80"}),Se("span",{children:r}),Se("span",{className:F("rounded-full px-1.5 py-0.5 text-[10px] font-semibold tabular-nums",e?"bg-gray-600 text-gray-300":"bg-gray-200 text-gray-600"),children:u.length}),Se(Sp,{open:l})]}),Se("div",{id:`chat-sources-${a}`,className:F("absolute left-0 top-full mt-2 min-w-[260px] max-w-[min(90vw,340px)] max-h-[55vh] flex flex-col z-50 rounded-xl border shadow-2xl overflow-hidden",l?"flex":"hidden",e?"bg-gray-800/95 border-gray-600/80 shadow-gray-950/30 backdrop-blur-sm":"bg-white border-gray-200 shadow-gray-900/10"),children:Se("ul",{className:"py-1 overflow-y-auto flex-1 min-h-0",role:"list",children:u.map(s=>Se("li",{children:o?Se("button",{type:"button",onClick:()=>{let{_key:d,...f}=s;o(f)},className:F("w-full text-left px-3 py-1.5 text-xs truncate block transition-colors",e?"text-gray-300 hover:bg-gray-700/60 hover:text-gray-100":"text-gray-700 hover:bg-gray-100","cursor-pointer focus:outline-none"),children:s.title}):Se("span",{className:F("block w-full text-left px-3 py-1.5 text-xs truncate",e?"text-gray-300":"text-gray-700"),children:s.title})},s._key))})})]})}import{jsx as ie,jsxs as qa}from"react/jsx-runtime";function Wi(e){try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return e}}function Vi({dark:e=!0,message:t,accentColor:a="#6366f1",showMetadata:r=!0,senderName:o,showSenderName:n=!0,showTime:l=!0,timePosition:i="top",bubbleBorderRadius:u=20,showCopyButton:s=!0,renderCopyInBubble:d=!0,allowMarkdown:f=!1,copyLabel:p="Copy",copiedLabel:c="Copied!",onCopy:h,showSources:x=!0,sourcesLabel:S="Sources",onSourceClick:L,className:P}){let[w,D]=bp(!1),M=t.role==="user",C=t.role==="assistant",q=Math.max(0,Math.min(32,u??20)),H=C&&o?o:M?"User":"Assistant",E=l&&i!=="bottom",I=l&&i==="bottom",X=yp(async()=>{try{await navigator.clipboard.writeText(t.content),D(!0),h?.(t.id,t.content),setTimeout(()=>D(!1),1500)}catch{}},[t.id,t.content,h]),U=C&&f&&t.content,B=F("text-xs flex items-center gap-2",e?"text-gray-400":"text-gray-500",M&&"flex-row-reverse"),b=F("px-3 py-2.5 text-sm leading-relaxed text-left box-border","min-w-0 max-w-full w-full overflow-hidden","break-words",M&&"text-white",C&&(e?"bg-gray-700/80 text-gray-100 border border-gray-600":"bg-gray-100 text-gray-900 border border-gray-200")),v=M&&a?{backgroundColor:a,color:"#fff",borderRadius:`${q}px`}:{borderRadius:`${q}px`},V=F("text-left min-w-0 max-w-full w-full overflow-hidden chat-bubble-content","[&>*]:min-w-0 [&>*]:max-w-full",e?"[&>code]:bg-gray-600 [&>code]:text-gray-200":"[&>code]:bg-gray-300 [&>code]:text-gray-800","[&>code]:rounded [&>code]:px-1 [&>code]:py-0.5 [&>code]:break-all"),_="whitespace-pre-wrap min-w-0 max-w-full w-full overflow-hidden break-words chat-bubble-content",Z=F("flex items-start gap-2 w-full min-w-0 max-w-[85%]",M?"flex-row-reverse self-end":""),K=F("flex flex-col gap-0.5 min-w-0 max-w-full w-full",M?"items-end":"items-start");return qa("article",{className:F("flex flex-col gap-1",M?"items-end":"items-start",P),"data-message-id":t.id,"aria-label":`${H} message`,children:[r&&(n||E)&&qa("div",{className:B,"aria-hidden":!0,children:[n&&ie("span",{children:H}),E&&ie("time",{dateTime:t.createdAt,children:Wi(t.createdAt)})]}),qa("div",{className:Z,children:[ie("div",{className:K,children:ie("div",{className:b,style:v,role:"article",children:U?ie("div",{className:F(V,"prose prose-sm max-w-full dark:prose-invert","[&_a]:text-blue-400 [&_a]:underline [&_a]:break-all","[&_pre]:text-sm [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_pre]:rounded","[&_table]:max-w-full [&_table]:block [&_table]:overflow-x-auto"),children:ie(Gr,{remarkPlugins:[Oa],children:t.content})}):ie("div",{className:_,children:t.content})})}),C&&s&&t.content&&d&&ie("button",{type:"button",onClick:X,className:F("p-1.5 rounded transition-colors flex-shrink-0 mt-1",e?"text-gray-400 hover:text-gray-300 hover:bg-gray-700/50":"text-gray-500 hover:text-gray-700 hover:bg-gray-200"),"aria-label":w?c:p,title:w?c:p,children:w?ie("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":!0,children:ie("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):ie("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":!0,children:ie("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),qa("div",{className:F("flex flex-wrap items-center gap-2 w-full min-w-0 max-w-[85%] mt-1.5",M?"justify-end":"justify-start"),"data-sources-row":!0,children:[C&&x&&t.sources&&t.sources.length>0&&ie(Ni,{dark:e,sources:t.sources,messageId:t.id,label:S,onSourceClick:L,className:"flex-shrink-0"}),C&&s&&t.content&&!d&&ie("button",{type:"button",onClick:X,className:F("p-1.5 rounded transition-colors flex-shrink-0",e?"text-gray-400 hover:text-gray-300 hover:bg-gray-700/50":"text-gray-500 hover:text-gray-700 hover:bg-gray-200"),"aria-label":w?c:p,title:w?c:p,children:w?ie("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":!0,children:ie("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):ie("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":!0,children:ie("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),r&&I&&ie("span",{className:F("text-xs flex-shrink-0",e?"text-gray-400":"text-gray-500"),"aria-hidden":!0,children:ie("time",{dateTime:t.createdAt,children:Wi(t.createdAt)})})]})]})}import{jsx as xe,jsxs as Ha}from"react/jsx-runtime";var vp=80;function Gi({dark:e=!0,messages:t,isSending:a=!1,accentColor:r="#6366f1",showMetadata:o=!0,senderName:n,showSenderName:l=!0,showTime:i=!0,timePosition:u="top",bubbleBorderRadius:s=20,showCopyButton:d=!0,showSources:f=!0,allowMarkdown:p=!1,copyLabel:c,copiedLabel:h,sourcesLabel:x,scrollToBottomLabel:S="Scroll to latest",showScrollToBottom:L=!0,showScrollbar:P=!0,emptyState:w,onSourceClick:D,suggestedQuestions:M,onSuggestedQuestionClick:C,compact:q=!1,className:H}){let E=Ua(null),I=Ua(null),X=Ua(!1),U=Ua(0),[B,b]=Ap(!1),v=t.filter(m=>m.role!=="system"&&!(m.role==="assistant"&&m.status==="sending")),_=!v.some(m=>m.role==="user")&&!a&&M&&M.length>0&&C,Z=_i(()=>{E.current?.scrollIntoView({behavior:"smooth"}),X.current=!1,b(!1)},[]);Pp(()=>{let m=I.current;if(!m)return;let J=U.current,Y=m.scrollHeight,g=m.scrollHeight-m.scrollTop-m.clientHeight<120,ee=Y>J;U.current=Y,ee&&(g||!X.current)&&E.current?.scrollIntoView({behavior:"smooth"})},[t,a]);let K=_i(()=>{let m=I.current;if(!m)return;let Y=m.scrollHeight-m.scrollTop-m.clientHeight<vp;X.current=!Y,b(!Y)},[]);return Ha("div",{className:"flex-1 min-h-0 flex flex-col relative",children:[Ha("div",{ref:I,onScroll:K,className:F("flex-1 overflow-y-auto overscroll-contain min-h-0 flex flex-col",P?"chat-ui-messages-scroll":"scrollbar-hide",q?"p-2 space-y-3":"p-4 space-y-4",H),style:{"--chat-accent":r,scrollbarColor:e?`${r} transparent`:`${r} transparent`},role:"log","aria-live":"polite","aria-label":"Chat messages",children:[v.length===0&&!_?a?null:xe("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:w??xe("p",{className:F("text-sm",e?"text-gray-400":"text-gray-500"),children:"Ask me anything\u2026"})}):null,v.length>0?v.map(m=>{let J=typeof m.id=="string"&&m.id.startsWith("welcome_"),Y=d&&!J,g=f&&m.sources&&m.sources.length>0||m.role==="assistant"&&Y&&!!m.content;return xe("div",{className:F("flex flex-col w-full",m.role==="user"?"items-end":"items-start"),children:xe("div",{className:F("space-y-0.5 w-full"),children:xe(Vi,{dark:e,message:m,accentColor:r,showMetadata:o,senderName:n,showSenderName:l,showTime:i,timePosition:u,bubbleBorderRadius:s,showCopyButton:Y,renderCopyInBubble:!g,allowMarkdown:p,copyLabel:c,copiedLabel:h,showSources:f,sourcesLabel:x,onSourceClick:D})})},m.id)}):null,_?xe("div",{className:F("flex flex-col items-end justify-end pl-4 pr-0 pt-6 pb-0 mt-auto flex-shrink-0"),children:xe("div",{className:"flex flex-wrap justify-end gap-2",children:M.map((m,J)=>xe("button",{type:"button",onClick:()=>C(m),disabled:a,className:"border px-4 py-2.5 text-sm font-medium transition-colors text-left text-white disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90",style:{backgroundColor:r,borderColor:r,borderRadius:`${Math.max(0,Math.min(32,s??20))}px`},children:m},J))})}):null,v.length>0&&a?xe("div",{className:"flex justify-start items-center",role:"status","aria-live":"polite","aria-label":"Someone is typing",children:Ha("div",{className:F("rounded-2xl px-4 py-3 flex items-center gap-1 border",e?"bg-gray-700/80 border-gray-600":"bg-gray-200 border-gray-300"),children:[xe("span",{className:F("w-2 h-2 rounded-full animate-bounce [animation-delay:-0.3s]",e?"bg-gray-400":"bg-gray-500")}),xe("span",{className:F("w-2 h-2 rounded-full animate-bounce [animation-delay:-0.15s]",e?"bg-gray-400":"bg-gray-500")}),xe("span",{className:F("w-2 h-2 rounded-full animate-bounce",e?"bg-gray-400":"bg-gray-500")})]})}):null,v.length>0?xe("div",{ref:E,"aria-hidden":!0}):null]}),L&&B?Ha("button",{type:"button",onClick:Z,className:F("absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1.5 rounded-full px-3 py-2 text-xs font-medium text-white shadow-lg transition-opacity hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2",e?"focus:ring-offset-gray-900":"focus:ring-offset-white"),style:{backgroundColor:r},"aria-label":S,children:[xe("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:xe("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),S]}):null]})}import{useCallback as ji,useRef as za,useEffect as Na,useState as Xi}from"react";import{jsx as de,jsxs as Wa}from"react/jsx-runtime";var Kt=16,Qt=32,Mp=Qt/Kt,Tp=8,Bp="https://cdn.jsdelivr.net/npm/emoji-picker-element@1/index.js";function Ki({dark:e=!0,value:t,onChange:a,onSend:r,disabled:o=!1,placeholder:n="Type a message\u2026",sendLabel:l="Send",accentColor:i="#6366f1",inputMaxLength:u,maxComposerRows:s=Tp,showAttach:d=!0,showEmoji:f=!0,showMic:p=!0,asSeparateBox:c=!0,composerBorderWidth:h=1,composerBorderColor:x="primary",onAttach:S,onEmoji:L,onMic:P,className:w}){let D=za(null),[M,C]=Xi(!1),q=za(null),H=za(null),[E,I]=Xi(!1);Na(()=>{if(typeof customElements>"u")return;if(customElements.get("emoji-picker")){I(!0);return}let b=document.createElement("script");return b.src=Bp,b.type="module",b.async=!0,b.onload=()=>{customElements.whenDefined("emoji-picker").then(()=>I(!0))},document.head.appendChild(b),()=>{b.remove()}},[]);let X=ji(b=>{let v=D.current;if(v){let V=v.selectionStart??t.length,_=v.selectionEnd??t.length,Z=t.slice(0,V)+b+t.slice(_);a(Z),setTimeout(()=>{v.focus();let K=V+b.length;v.setSelectionRange(K,K)},0)}else a(t+b);C(!1),L?.()},[t,a,L]),U=za(X);U.current=X,Na(()=>{if(!M||!E||!H.current)return;let b=H.current,v=document.createElement("emoji-picker");v.setAttribute("class",e?"dark":"light");let V=_=>{_.detail?.unicode&&U.current(_.detail.unicode)};return v.addEventListener("emoji-click",V),b.appendChild(v),()=>{v.removeEventListener("emoji-click",V),v.remove()}},[M,E,e]),Na(()=>{if(!M)return;let b=v=>{q.current&&!q.current.contains(v.target)&&!D.current?.contains(v.target)&&C(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[M]);let B=ji(b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),!o&&t.trim()&&r())},[o,t,r]);return Na(()=>{let b=D.current;if(!b)return;if(!t.trim()){b.style.height=`${Qt}px`;return}b.style.height="auto";let v=Math.min(s,Math.max(Mp,Math.ceil(b.scrollHeight/Kt)));b.style.height=`${Math.max(Qt,v*Kt)}px`},[t,s]),de("div",{className:F("flex-shrink-0 p-3",c&&"border-t",c&&(e?"border-gray-700 bg-gray-900/30":"border-gray-200 bg-gray-50"),w),children:de("form",{onSubmit:b=>{b.preventDefault(),!o&&t.trim()&&r()},className:"flex flex-col gap-2",children:de("div",{className:F("rounded-xl border chat-composer-input-wrapper transition-[border-color,border-width]",h>=.5&&"chat-composer-input-wrapper--custom",e?"bg-gray-800/50":"bg-white"),style:(()=>{let b=x==="primary",v=e?"#4b5563":"#d1d5db",V=e?"#6b7280":"#9ca3af",_=h>=.5?h:1,Z=h>=.5?Math.min(h*1.5,5):1;return{borderWidth:_,borderStyle:"solid",borderColor:h>=.5&&b&&i?`${i}99`:v,"--chat-accent":i||"#6366f1","--composer-border-width":`${_}px`,"--composer-border-width-focus":`${Z}px`,"--composer-border-color-focus":h>=.5&&b?"var(--chat-accent)":V}})(),children:Wa("div",{className:"flex flex-row items-end gap-1 p-2",children:[Wa("div",{className:"flex flex-1 flex-col items-start min-w-0 gap-1",children:[de("textarea",{ref:D,value:t,onChange:b=>a(b.target.value),onKeyDown:B,placeholder:n,rows:1,maxLength:u,disabled:o,className:F("flex-1 min-h-[32px] resize-none bg-transparent px-2 py-2 text-left w-full overflow-y-auto scrollbar-hide chat-composer-textarea","text-sm focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",e?"text-gray-100 placeholder:text-gray-500":"text-gray-900 placeholder:text-gray-400"),"aria-label":n,style:{lineHeight:`${Kt}px`,height:`${Qt}px`,minHeight:`${Qt}px`,maxHeight:`${s*Kt}px`}}),Wa("div",{className:"flex items-center gap-0.5 flex-shrink-0 pb-0.5",children:[d?de("button",{type:"button",onClick:S,className:F("p-2 rounded-lg transition-colors",e?"text-gray-400 hover:text-gray-300 hover:bg-gray-700/50":"text-gray-500 hover:text-gray-700 hover:bg-gray-200"),"aria-label":"Attach file",children:de("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:de("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})})}):null,f?Wa("div",{className:"relative flex-shrink-0",ref:q,children:[de("button",{type:"button",onClick:()=>C(b=>!b),className:F("p-2 rounded-lg transition-colors",e?"text-gray-400 hover:text-gray-300 hover:bg-gray-700/50":"text-gray-500 hover:text-gray-700 hover:bg-gray-200"),"aria-label":"Insert emoji","aria-expanded":M,children:de("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:de("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),M?de("div",{className:F("absolute left-0 bottom-full mb-2 rounded-xl border shadow-lg z-[100] overflow-visible","min-w-[320px] min-h-[320px]",e?"border-gray-600 bg-gray-800":"border-gray-200 bg-white"),"aria-label":"Emoji picker",children:E?de("div",{ref:H,className:"chat-emoji-picker-cdn w-full overflow-hidden rounded-xl [&::part(root)]:border-0"}):de("div",{className:F("flex items-center justify-center p-8 text-sm",e?"text-gray-400":"text-gray-500"),children:"Loading emoji picker\u2026"})}):null]}):null,p?de("button",{type:"button",onClick:P,className:F("p-2 rounded-lg transition-colors",e?"text-gray-400 hover:text-gray-300 hover:bg-gray-700/50":"text-gray-500 hover:text-gray-700 hover:bg-gray-200"),"aria-label":"Voice input",children:de("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:de("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0V8a5 5 0 0110 0v6z"})})}):null]})]}),de("button",{type:"submit",disabled:o||!t.trim(),className:"flex-shrink-0 rounded-lg p-2 text-white transition-opacity disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90",style:{backgroundColor:i},"aria-label":l,children:de("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:de("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})})})]})})})})}import{jsx as Zt,jsxs as Dp}from"react/jsx-runtime";function $t({width:e=400,height:t=700,dark:a=!0,accentColor:r="#6366f1",bubbleBorderRadius:o=20,showChatBorder:n=!0,showHeader:l=!0,showAvatarInHeader:i=!0,onBack:u,showBackButton:s=!1,avatar:d,title:f,subtitle:p,statusIndicator:c,showLive:h=!1,liveIndicatorStyle:x,statusDotStyle:S="blinking",showScrollToBottom:L=!0,showScrollbar:P=!0,composerAsSeparateBox:w=!0,composerBorderWidth:D=1,composerBorderColor:M="primary",onMenu:C,showMenuExpand:q,onMenuExpand:H,isExpanded:E,menuQuickLinks:I,onClose:X,messages:U,isSending:B=!1,showMetadata:b=!0,senderName:v,showSenderName:V=!0,showTime:_=!0,timePosition:Z="top",showCopyButton:K=!0,showSources:m=!0,allowMarkdown:J=!1,emptyState:Y,onSourceClick:g,onSend:ee,composerPlaceholder:ve,inputMaxLength:Ge,maxComposerRows:Oe,showAttach:oe=!0,showEmoji:qe=!0,showMic:Ie=!0,onAttach:Me,onEmoji:we,onMic:te,suggestedQuestions:he,showSuggestedChips:tt=!0,showComposerWithSuggestedQuestions:ye=!1,onSuggestedQuestion:Be,showFooter:Ce=!0,brandingMessage:Fe,privacyText:at,compact:rt=!1,strings:_a={},className:Ga,style:ja}){let[vt,k]=Fp(""),A=c??(h?"live":"none"),z=Qi(()=>{let fe=vt.trim();fe&&(ee(fe),k(""))},[vt,ee]),j=Qi(fe=>{Be?.(fe),k(fe),ee(fe),k("")},[Be,ee]),N={title:"Chat",subtitle:"",placeholder:"Type a message\u2026",send:"Send",copy:"Copy",copied:"Copied!",sourcesLabel:"Sources",scrollToBottomLabel:"Scroll to latest",privacyText:"Your conversations are private and secure.",back:"Back",close:"Close",menu:"Menu",live:"Live",active:"Active",expandLabel:"Expand chat",..._a},Ue=!U.some(fe=>fe.role==="user")&&tt&&he&&he.length>0&&!ye;return Dp("div",{className:F("flex flex-col overflow-hidden shadow-xl rounded-2xl",a?"bg-gray-900 text-gray-100":"bg-white text-gray-900",Ga),style:{width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,...n&&r?{border:`1px solid ${r}99`}:{},...ja},role:"region","aria-label":"Chat",children:[l?Zt(Jo,{dark:a,showAvatar:i,onBack:u,showBackButton:s,avatar:d,title:f??N.title,subtitle:p??N.subtitle,statusIndicator:A,liveIndicatorStyle:x,statusDotStyle:S,onMenu:C,showMenuExpand:q,onMenuExpand:H,expandLabel:N.expandLabel,isExpanded:E,menuQuickLinks:I,onClose:X,backLabel:N.back,closeLabel:N.close,menuLabel:N.menu,liveLabel:N.live,activeLabel:N.active??"Active"}):null,Zt(Gi,{dark:a,messages:U,isSending:B,accentColor:r,showMetadata:b,senderName:v,showSenderName:V,showTime:_,timePosition:Z,showCopyButton:K,showSources:m,bubbleBorderRadius:o,allowMarkdown:J,copyLabel:N.copy,copiedLabel:N.copied,sourcesLabel:N.sourcesLabel,scrollToBottomLabel:N.scrollToBottomLabel,showScrollToBottom:L,showScrollbar:P,emptyState:Y,onSourceClick:g,suggestedQuestions:tt&&he&&he.length>0?he:void 0,onSuggestedQuestionClick:j,compact:rt}),Ue?null:Zt(Ki,{dark:a,value:vt,onChange:k,onSend:z,disabled:B,placeholder:ve??N.placeholder,sendLabel:N.send,accentColor:r,inputMaxLength:Ge,maxComposerRows:Oe,showAttach:oe,showEmoji:qe,showMic:Ie,asSeparateBox:w,composerBorderWidth:D,composerBorderColor:M,onAttach:Me,onEmoji:we,onMic:te,className:rt?"p-2":void 0}),Ce&&(Fe??at??N.privacyText)?Zt("footer",{className:F("flex-shrink-0 text-center border-t rounded-b-2xl",a?"border-gray-700":"border-gray-200",rt?"px-2 py-1":"px-4 py-2"),children:Zt("p",{className:F("text-xs","text-gray-500"),children:Fe??at??N.privacyText})}):null]})}import{jsx as Ve,jsxs as qp}from"react/jsx-runtime";var Zi=()=>Ve("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:Ve("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),Rp=()=>Ve("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:Ve("path",{d:"M18 6L6 18M6 6l12 12"})}),Ep={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},Op={none:"",low:"shadow-[0_2px_12px_rgba(0,0,0,0.15)]",medium:"shadow-[0_10px_35px_rgba(0,0,0,0.28),0_0_0_1px_rgba(0,0,0,0.08)]",high:"shadow-[0_16px_48px_rgba(0,0,0,0.38),0_0_0_1px_rgba(0,0,0,0.1)]"};function $i({isOpen:e,onToggle:t,accentColor:a="#6366f1",dark:r=!0,position:o="bottom-right",unreadCount:n,closedIcon:l,openIcon:i,avatar:u,alwaysShowSameIcon:s=!1,openLabel:d="Open chat",closeLabel:f="Close chat",inline:p=!1,size:c=48,shadowIntensity:h="medium",avatarWithBackground:x=!1,avatarRingWidth:S=18,className:L,style:P}){let w=typeof n=="number"&&n>0&&!e,D=e?f:d,M=s||u!=null,C=h==="none"||h==="low"||h==="high"?h:"medium",q=M?u??l??Ve(Zi,{}):e?i??Ve(Rp,{}):l??Ve(Zi,{}),H=typeof c=="number"&&c>0?Math.round(c):48,E=x&&u!=null&&typeof S=="number"&&S>=0&&S<=30?S:x&&u!=null?18:0;return Ve("button",{type:"button",onClick:t,"aria-label":D,"aria-expanded":e,className:F("flex items-center justify-center rounded-full transition-transform hover:scale-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 overflow-hidden",Op[C],r?"text-white focus-visible:ring-offset-gray-900":"text-white focus-visible:ring-offset-white",!p&&"fixed z-[9999]",!p&&Ep[o],L),style:{width:H,height:H,backgroundColor:a,...P},children:qp("span",{className:F("relative flex items-center justify-center w-full h-full",(E>0,"[&>img]:w-full [&>img]:h-full [&>img]:object-cover [&>img]:rounded-full")),style:E>0?{padding:`${E}%`}:void 0,children:[q,w&&Ve("span",{className:"absolute -top-1.5 -right-1.5 min-w-[18px] h-[18px] px-1 flex items-center justify-center rounded-full text-xs font-semibold bg-white text-gray-900","aria-hidden":!0,children:n>99?"99+":n})]})})}import{useState as Up}from"react";import{Fragment as zp,jsx as To,jsxs as Np}from"react/jsx-runtime";var Hp={"bottom-right":"bottom-20 right-4","bottom-left":"bottom-20 left-4","top-right":"top-20 right-4","top-left":"top-20 left-4"};function Bo({launcherPosition:e="bottom-right",launcherUnreadCount:t,launcherOpenLabel:a,launcherCloseLabel:r,defaultOpen:o=!1,accentColor:n="#6366f1",dark:l=!0,width:i=380,height:u=560,onClose:s,...d}){let[f,p]=Up(o),c=()=>{p(!1),s?.()};return Np(zp,{children:[To($i,{isOpen:f,onToggle:()=>p(h=>!h),accentColor:n,dark:l,position:e,unreadCount:t,openLabel:a,closeLabel:r}),f&&To("div",{className:F("fixed z-[9998] flex flex-col overflow-hidden rounded-2xl shadow-2xl",Hp[e],l?"bg-gray-900 border border-gray-700":"bg-white border border-gray-200"),style:{width:typeof i=="number"?`${i}px`:i,height:typeof u=="number"?`${u}px`:u},role:"dialog","aria-label":"Chat",children:To($t,{...d,width:"100%",height:"100%",dark:l,accentColor:n,onClose:c,style:{border:"none",boxShadow:"none"}})})]})}function Fo(e){return Array.isArray(e)?e.filter(t=>t!=null&&typeof t=="object").map((t,a)=>{let r=typeof t.title=="string"&&t.title.trim()?t.title.trim():typeof t.docTitle=="string"&&t.docTitle.trim()?t.docTitle.trim():`Source ${a+1}`,o=typeof t.snippet=="string"?t.snippet.trim()||void 0:typeof t.text=="string"?t.text.trim()||void 0:typeof t.preview=="string"&&t.preview.trim()||void 0,n=typeof t.documentId=="string"?t.documentId:typeof t.docId=="string"?t.docId:void 0,l=typeof t.chunkId=="string"?t.chunkId:void 0,i=typeof t.score=="number"&&Number.isFinite(t.score)?t.score:void 0;return{title:r,snippet:o,score:i,documentId:n,chunkId:l}}):[]}function Ji(e,t){return fetch(e,{...t,credentials:"include"})}function Yi(e,t){let a=String(t.name??"").trim(),r=String(t.tagline??"").trim(),o=String(t.description??"").trim();return e.replace(/\{\{Name\}\}/g,a).replace(/\{\{Tagline\}\}/g,r).replace(/\{\{description\}\}/g,o)}import{jsx as Jt}from"react/jsx-runtime";function Ro(){return`msg_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function Eo(){return new Date().toISOString()}var jp=80,Xp=" - AI";function Kp(e){if(typeof e.error=="string"&&e.error.trim())return e.error;switch(e.errorCode){case"BOT_NOT_PUBLISHED":return"This bot is not available for embedding right now.";case"INVALID_ACCESS_KEY":return"Chat access is invalid. Please verify your access key.";case"INVALID_SECRET_KEY":return"Chat access is invalid. Please verify your secret key.";case"VISITOR_ID_REQUIRED":return"A visitor session is required for this bot.";case"MESSAGE_LIMIT_REACHED":return"This bot has reached its message limit.";default:return"No response."}}function Qp(e,t){let a=e.trim();return a.length<=t?a:a.slice(0,t).trimEnd().replace(/\s+\S*$/,"")+"\u2026"}var Zp="#14B8A6";function $p(e,t){let a=typeof e?.primaryColor=="string"&&/^#[0-9a-fA-F]{6}$/.test(e.primaryColor)?e.primaryColor:Zp,r=e?.backgroundStyle,o=r==="light"?!1:r==="dark"?!0:t==="dark",n=typeof e?.bubbleBorderRadius=="number"?Math.max(0,Math.min(32,e.bubbleBorderRadius)):e?.bubbleStyle==="squared"?0:20,l=e?.showBranding!==!1;return{primaryColor:a,dark:o,bubbleBorderRadius:n,showBranding:l}}function Jp(e){let t=e?.composerBorderWidth;if(typeof t=="number"&&t>=0&&t<=6){let a=Number(t);return a>0&&a<.5?.5:Math.max(0,Math.min(6,a))}return e?.showComposerBorder===!1?0:1}function eu({botId:e,mode:t="runtime",botName:a,avatarUrl:r,avatarEmoji:o,chatUI:n,tagline:l,description:i,welcomeMessage:u,suggestedQuestions:s,onClose:d,onBack:f,onMenu:p,expandHref:c,apiBaseUrl:h,chatPostPath:x,accessKey:S,secretKey:L,chatVisitorId:P,platformVisitorId:w,authToken:D,previewOverrides:M,debug:C=!0,footerPrivacyText:q,useFloatingLauncher:H=!1,className:E,style:I}){let U=x??(t==="preview"?"/api/widget/preview/chat":"/api/chat/message"),B=h?`${h.replace(/\/+$/,"")}${U}`:U,b=Gp(null),v=_p(()=>{let te=(u??"").trim();if(!te)return null;let he=Yi(te,{name:a,tagline:l,description:i});return{id:`welcome_${e}`,role:"assistant",content:he,createdAt:new Date().toISOString(),status:"sent"}},[e,u,a,l,i]),V=_o(),[_,Z]=Do(()=>v?[v]:[]),[K,m]=Do(!1),[J,Y]=Do(!1),{primaryColor:g,dark:ee,bubbleBorderRadius:ve,showBranding:Ge}=$p(n,V);Vp(()=>{if(!v){Z(te=>te.length===1&&te[0]?.id?.startsWith("welcome_")?[]:te);return}Z(te=>{let he=te.length>0&&te[0]?.id?.startsWith("welcome_")?te.slice(1):te;return[v,...he]})},[v]);let Oe=(l??"").trim()||(i?.trim()?Qp(i,jp):"")||"Live test",oe=Wp(async te=>{let he=te.trim();if(!he||K)return;let tt={id:Ro(),role:"user",content:he,createdAt:Eo()};Z(ye=>[...ye,tt]),m(!0);try{let ye={botId:e,message:he,...b.current&&{conversationId:b.current},...S?{accessKey:S}:{},...t==="runtime"&&L?{secretKey:L}:{},...P?{chatVisitorId:P}:{},...w?{platformVisitorId:w}:{},...t==="preview"&&D?{authToken:D}:{},...t==="preview"&&M?{previewOverrides:M}:{}},Be=h?await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(ye)}):await Ji(B,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(ye)}),Ce=await Be.json().catch(()=>({})),Fe=Ce.assistantMessage??Ce.reply??Ce.content??Kp(Ce);Ce.conversationId&&(b.current=Ce.conversationId);let at={id:Ro(),role:"assistant",content:typeof Fe=="string"?Fe:"No response.",createdAt:Eo(),sources:Fo(Ce.sources),status:Be.ok?"sent":"error"};Z(rt=>[...rt,at])}catch(ye){let Be=ye instanceof Error?ye.message:"Network error.",Ce={id:Ro(),role:"assistant",content:Be,createdAt:Eo(),status:"error"};Z(Fe=>[...Fe,Ce])}finally{m(!1)}},[B,K,h,S,t,e,L,P,w,D,M]),qe=Ge?q??"Your test conversations are not stored.":void 0,Ie=n?.launcherPosition==="bottom-left"?"bottom-left":"bottom-right",Me=n?.showAvatarInHeader!==!1?r?Jt("img",{src:r,alt:"",className:"w-full h-full object-cover"}):o?Jt("span",{className:"text-2xl","aria-hidden":!0,children:o}):void 0:void 0,we={width:"100%",height:"100%",dark:ee,accentColor:g,bubbleBorderRadius:ve,showChatBorder:n?.showChatBorder!==!1,showHeader:!0,showAvatarInHeader:n?.showAvatarInHeader!==!1,showFooter:Ge,brandingMessage:(n?.brandingMessage??"").trim()||void 0,privacyText:qe,statusIndicator:n?.statusIndicator??"live",liveIndicatorStyle:n?.liveIndicatorStyle??"label",statusDotStyle:n?.statusDotStyle??"blinking",showScrollToBottom:n?.showScrollToBottom!==!1,showScrollbar:n?.showScrollbar!==!1,composerAsSeparateBox:n?.composerAsSeparateBox!==!1,composerBorderWidth:Jp(n),composerBorderColor:n?.composerBorderColor==="default"?"default":"primary",showSuggestedChips:!!s?.length,suggestedQuestions:s,showComposerWithSuggestedQuestions:n?.showComposerWithSuggestedQuestions===!0,onBack:f??(()=>{}),onMenu:p,showMenuExpand:H?!1:n?.showMenuExpand!==!1,onMenuExpand:H?void 0:()=>Y(te=>!te),isExpanded:H?void 0:J,menuQuickLinks:n?.menuQuickLinks?.length?n.menuQuickLinks:void 0,onClose:d??(()=>{}),avatar:Me,title:a,subtitle:Oe,messages:_,isSending:K,onSend:oe,showMetadata:!0,senderName:(n?.senderName??"").trim()?(n?.senderName??"").trim():`${a}${Xp}`,showSenderName:n?.showSenderName!==!1,showTime:n?.showTime!==!1,timePosition:n?.timePosition==="bottom"?"bottom":"top",showCopyButton:n?.showCopyButton!==!1,showSources:n?.showSources!==!1,allowMarkdown:!0,strings:{title:a,subtitle:Oe,placeholder:"Type a message\u2026",send:"Send",copy:"Copy",copied:"Copied!",sourcesLabel:"Sources",scrollToBottomLabel:"Scroll to latest",back:"Back",close:"Close",menu:"Menu",live:"Live",active:"Active",expandLabel:J?"Collapse":"Expand chat"},showAttach:n?.allowFileUpload===!0,showEmoji:n?.showEmoji!==!1,showMic:n?.showMic===!0,onAttach:()=>{},onEmoji:()=>{},onMic:()=>{}};return H?Jt(Bo,{...we,launcherPosition:Ie,defaultOpen:!1,width:400,height:700,accentColor:g,dark:ee,onClose:d,className:E,style:I}):Jt("div",{className:F("overflow-hidden",E),style:{width:J?560:400,height:J?"75vh":700,transition:"width 0.3s ease-out, height 0.3s ease-out",...I},children:Jt($t,{...we,showMenuExpand:n?.showMenuExpand!==!1,onMenuExpand:()=>Y(te=>!te),isExpanded:J,strings:{...we.strings,expandLabel:J?"Collapse":"Expand chat"},style:{border:"none",boxShadow:"none"}})})}function Oo(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function tu(e,t){let a={...e};for(let[r,o]of Object.entries(t)){if(o===void 0)continue;let n=a[r];if(Oo(n)&&Oo(o)){a[r]=tu(n,o);continue}a[r]=o}return a}function _e(e){if(typeof e!="string")return;let t=e.trim();return t||void 0}function Yp(e){let t=e.bot?.suggestedQuestions??e.bot?.exampleQuestions??[];return Array.isArray(t)?t.map(a=>typeof a=="string"?a.trim():"").filter(Boolean).slice(0,6):[]}function au(e,t){if(!t)return e;let a=Oo(e.settings?.chatUI)?e.settings.chatUI:{},r=t.chatUI?tu(a,t.chatUI):a;t.launcherPosition&&(r.launcherPosition=t.launcherPosition);let o=Yp(e),n=Array.isArray(t.suggestedQuestions)?t.suggestedQuestions:o,l=_e(t.brandingMessage)??_e(r.brandingMessage),i=_e(t.privacyText),u=e.bot??{};return{...e,bot:{...u,name:_e(t.botName)??(typeof u.name=="string"?u.name:""),imageUrl:_e(t.avatarUrl)??u.imageUrl,avatarEmoji:_e(t.avatarEmoji)??u.avatarEmoji,tagline:_e(t.tagline)??u.tagline,description:_e(t.description)??u.description,welcomeMessage:_e(t.welcomeMessage)??u.welcomeMessage,suggestedQuestions:n,exampleQuestions:n},settings:{...e.settings,chatUI:r,...l?{brandingMessage:l}:{},...i?{privacyText:i}:{}}}}import{jsx as ru}from"react/jsx-runtime";function tm(e,t){return t==="preview"?`assistrio_chat_visitor_preview_id:${e}`:`assistrio_chat_visitor_id:${e}`}function am(e){let t=e??{};if(t.mode==="preview"){let{previewOverrides:a,...r}=t;return JSON.stringify(r)}return JSON.stringify(t)}function Va({rawConfig:e}){let[t,a]=Uo("loading"),[r,o]=Uo(null),[n,l]=Uo(null),i=JSON.stringify(e?.previewOverrides??null),u=qo(()=>ot(e),[e,i]),s=qo(()=>am(e),[e]);em(()=>{let c=!1;return a("loading"),(async()=>{try{let h=ot(e),x=h.mode??"runtime",S=typeof h.authToken=="string"&&h.authToken.trim()!==""||h.sessionPreview===!0,L=tm(h.botId,x),P=h.persistChatSession!==!1,w=!S&&P&&typeof window<"u"?window.localStorage.getItem(L):null,D={...e,...w?{chatVisitorId:w}:{}};S&&delete D.chatVisitorId,x==="preview"&&delete D.previewOverrides;let M=await Qa(D);if(c)return;o(M);let C=typeof M.chatVisitorId=="string"&&M.chatVisitorId.trim()?M.chatVisitorId:w;C&&(P&&window.localStorage.setItem(L,C),l(C)),a("ready")}catch(h){if(c)return;let x=h instanceof Error?h.message:"Chat unavailable.";typeof console<"u"&&console.error&&console.error("[Assistrio embed]",x),a("error")}})(),()=>{c=!0}},[s]);let d=qo(()=>{if(!r)return null;if(u.mode==="runtime")return Yt(r,u);let c=au(r,u.previewOverrides);return Yt(c,u)},[r,u]),f=e?.position==="left"?"bottom-4 left-4":"bottom-4 right-4";if(t==="loading")return ru("div",{"aria-hidden":!0,className:`fixed z-[9999] h-2 w-2 rounded-full bg-gray-400 opacity-50 ${f}`});if(t==="error"||!d||!n)return null;let p={...d.chatUI,...d.brandingMessage?.trim()?{brandingMessage:d.brandingMessage.trim()}:{}};return ru(eu,{botId:d.botId,mode:u.mode??"runtime",botName:d.botName,avatarUrl:d.avatarUrl,avatarEmoji:d.avatarEmoji,chatUI:p,tagline:d.tagline,description:d.description,welcomeMessage:d.welcomeMessage,suggestedQuestions:d.suggestedQuestions,apiBaseUrl:u.apiBaseUrl,chatPostPath:u.chatPostPath,accessKey:u.accessKey,secretKey:u.secretKey,chatVisitorId:n,platformVisitorId:u.platformVisitorId,authToken:u.authToken,previewOverrides:u.mode==="preview"?u.previewOverrides:void 0,debug:!1,footerPrivacyText:d.privacyText,useFloatingLauncher:!0})}var et=null,om="assistrio-embed-widget-root";function nm(e){if(typeof document>"u")return;if(et){et.root.render(ou.createElement(Va,{rawConfig:e}));return}let t=document.createElement("div");t.id=om,document.body.appendChild(t);let a=rm(t);a.render(ou.createElement(Va,{rawConfig:e})),et={root:a,mountEl:t}}function lm(){et&&(et.root.unmount(),et.mountEl.remove(),et=null)}function im(){return et!==null}export{Va as EmbedWidgetRoot,im as getMountedEmbedWidget,nm as mountEmbedWidget,ot as normalizeEmbedConfig,Yt as normalizeWidgetSettings,pu as readEmbedConfig,lm as unmountEmbedWidget,Qa as validateAndInitWidget,Wo as validateEmbedConfig};
|
|
30
|
+
//# sourceMappingURL=index.mjs.map
|