UNPKG

@meerkat-coding/chat-widget

Version:

Biblioteca modular de widgets de chat para React com arquitetura escalável

1 lines 211 kB
import e,{useState as t,useRef as n,useEffect as r,useCallback as o,useMemo as i}from"react";import{Fragment as l,jsx as a,jsxs as s}from"react/jsx-runtime";function c(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){return new(n||(n=Promise))(function(o,i){function l(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(l,a)}s((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const f=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)});class d{static getOrCreateSessionId(e){const t=this.getSessionId();if(t)return t;const n=e?e():f();return this.setSessionId(n),n}static getSessionId(){try{return localStorage.getItem(this.STORAGE_KEY)}catch(e){return console.warn("localStorage não disponível"),null}}static setSessionId(e){try{localStorage.setItem(this.STORAGE_KEY,e),localStorage.setItem(this.STORAGE_TIMESTAMP_KEY,Date.now().toString())}catch(e){console.warn("Falha ao salvar session ID:",e)}}static clearSession(){try{localStorage.removeItem(this.STORAGE_KEY),localStorage.removeItem(this.STORAGE_TIMESTAMP_KEY)}catch(e){console.warn("Falha ao limpar sessão:",e)}}static isSessionExpired(e=24){try{const t=localStorage.getItem(this.STORAGE_TIMESTAMP_KEY);if(!t)return!0;const n=Date.now()-parseInt(t,10);return n>60*e*60*1e3}catch(e){return!0}}static resetSession(e){return this.clearSession(),this.getOrCreateSessionId(e)}static createNewSessionId(e){return e?e():f()}}d.STORAGE_KEY="chat_widget_session_id",d.STORAGE_TIMESTAMP_KEY="chat_widget_session_timestamp";const p=(e,o,i=!1)=>{const[l,a]=t(""),s=n(o),c=n(e);r(()=>{s.current=o},[o]),r(()=>{c.current=e},[e]),r(()=>{if(c.current)return void a(c.current);if(!i){const e=d.createNewSessionId(s.current);return void a(e)}const e=d.getOrCreateSessionId(s.current);a(e)},[i]);return{sessionId:l,resetSession:()=>{if(c.current)return console.warn("[useSessionId] resetSession não tem efeito quando sessionId fixo é fornecido"),c.current;const e=d.resetSession(s.current);return a(e),e},clearSession:()=>{c.current?console.warn("[useSessionId] clearSession não tem efeito quando sessionId fixo é fornecido"):(d.clearSession(),a(""))}}},h=(e,t)=>{const n={"Content-Type":"application/json","X-Session-ID":e};return t&&(n[t.headerName]=t.headerValue),n},g=(e,t)=>u(void 0,void 0,void 0,function*(){try{const n=yield fetch(e,t);if(!n.ok)throw new Error(`HTTP Error: ${n.status} ${n.statusText}`);return yield n.json()}catch(e){if(e instanceof Error)throw e;throw new Error("Erro desconhecido na requisição")}}),m=(e,t,n)=>u(void 0,void 0,void 0,function*(){var r,o;const i=h(t,n),l=yield g(e,{method:"GET",headers:i});return console.log("[API loadMessages] Resposta da API:",{url:e,sessionId:t,totalMensagens:(null===(r=l.messages)||void 0===r?void 0:r.length)||0,mensagens:(null===(o=l.messages)||void 0===o?void 0:o.map(e=>`${e.sender}: ${e.message.substring(0,20)}...`))||[]}),l}),y=(e,t,n)=>u(void 0,void 0,void 0,function*(){const r=h(t.sessionId,n);return g(e,{method:"POST",headers:r,body:JSON.stringify(t)})});class b{constructor(e,t,n){this.loadMessagesUrl=e,this.sendMessageUrl=t,this.authConfig=n}loadMessages(e){return u(this,void 0,void 0,function*(){return m(this.loadMessagesUrl,e,this.authConfig)})}sendMessage(e){return u(this,void 0,void 0,function*(){return y(this.sendMessageUrl,e,this.authConfig)})}updateAuthConfig(e){this.authConfig=e}}const v=({loadMessagesUrl:e,sessionId:i,authConfig:l,refetchInterval:a=3e3,enablePolling:s=!0,onMessagesLoaded:c,onError:f,onBlockStateChange:d})=>{const[p,h]=t([]),[g,y]=t(!1),[b,v]=t(!1),[x,k]=t(null),[w,S]=t(0),E=n(null),C=n(!0),T=n(c),I=n(f),D=n(d),A=n(l),L=n();r(()=>{T.current=c,I.current=f,D.current=d,A.current=l});const O=o(()=>u(void 0,void 0,void 0,function*(){var t,n;if(i&&e){console.log("[useMessages] Iniciando carregamento..."),y(!0),k(null);try{console.log("[useMessages] Chamando API...");const n=yield m(e,i,A.current);if(console.log("[useMessages] API retornou, isMounted:",C.current),!C.current)return void console.log("[useMessages] Componente desmontado, abortando");console.log("[useMessages] Resposta recebida:",{totalMensagens:n.messages.length,bloqueado:n.blockNewMessages,ultimasMensagens:n.messages.slice(-2).map(e=>`${e.sender}: ${e.message}`)});const r=n.messages;console.log("[useMessages] Setando",r.length,"mensagens no estado"),h(e=>{if(e.length!==r.length)return r;const t=r.some((t,n)=>{var r,o;return t.id!==(null===(r=e[n])||void 0===r?void 0:r.id)||t.message!==(null===(o=e[n])||void 0===o?void 0:o.message)});return t?r:e}),v(e=>{var t;return n.blockNewMessages!==e?(null===(t=D.current)||void 0===t||t.call(D,n.blockNewMessages),n.blockNewMessages):e}),null===(t=T.current)||void 0===t||t.call(T,r)}catch(e){if(console.log("[useMessages] ERRO capturado:",e),!C.current)return void console.log("[useMessages] Componente desmontado no erro, ignorando");const t=e instanceof Error?e:new Error("Erro ao carregar mensagens");console.log("[useMessages] Setando erro:",t.message),k(t),null===(n=I.current)||void 0===n||n.call(I,t)}finally{console.log("[useMessages] Finally - isMounted:",C.current),C.current&&y(!1)}}else console.log("[useMessages] Abortando: sessionId ou URL faltando")}),[e,i]);r(()=>{L.current=O},[O]);const P=o(e=>{h(t=>[...t,e])},[]),M=o(e=>{var t;console.log("[useMessages] setBlockState chamado:",e),v(e),null===(t=D.current)||void 0===t||t.call(D,e)},[]),q=o((e,t)=>{h(n=>n.map(n=>n.id===e?Object.assign(Object.assign({},n),t):n))},[]),R=o(e=>{h(t=>t.filter(t=>t.id!==e))},[]),z=o(e=>{E.current&&clearInterval(E.current);const t=e||a;E.current=setInterval(()=>{var e;null===(e=L.current)||void 0===e||e.call(L)},t)},[a]),F=o(()=>{E.current&&(clearInterval(E.current),E.current=null)},[]),N=o(()=>{console.log("[useMessages] Resetando polling..."),S(e=>e+1)},[]);return r(()=>{i&&O()},[i]),r(()=>{if(s&&i)return console.log(`[useMessages] Iniciando polling: ${a}ms (resetKey: ${w})`),E.current&&clearInterval(E.current),E.current=setInterval(()=>{var e;null===(e=L.current)||void 0===e||e.call(L)},a),()=>{E.current&&(clearInterval(E.current),E.current=null)}},[s,i,a,w]),r(()=>(C.current=!0,console.log("[useMessages] Componente montado, isMountedRef = true"),()=>{console.log("[useMessages] Componente desmontando, isMountedRef = false"),C.current=!1,F()}),[]),{messages:p,isLoading:g,isBlocked:b,error:x,loadMessages:O,addMessage:P,updateMessage:q,removeMessage:R,setBlockState:M,startPolling:z,stopPolling:F,resetPolling:N}},x=({sendMessageUrl:e,sessionId:i,authConfig:l,onMessageSent:a,onError:s,onSuccess:c})=>{const[f,d]=t(!1),[p,h]=t(null),g=n(!0),m=n(a),b=n(s),v=n(c),x=n(l);r(()=>{m.current=a,b.current=s,v.current=c,x.current=l});const k=o((t,n)=>u(void 0,void 0,void 0,function*(){var r,o,l;if(!t.trim()||!i||!e)return null;d(!0),h(null);const a={message:t.trim(),sessionId:i,timestamp:(new Date).toISOString(),metadata:n};try{const t=yield y(e,a,x.current);if(!g.current)return null;if(!t.success)throw new Error(t.error||"Falha ao enviar mensagem");return t.message&&(null===(r=m.current)||void 0===r||r.call(m,t.message)),null===(o=v.current)||void 0===o||o.call(v,t),t}catch(e){if(!g.current)return null;const t=e instanceof Error?e:new Error("Erro ao enviar mensagem");throw h(t),null===(l=b.current)||void 0===l||l.call(b,t),t}finally{g.current&&d(!1)}}),[e,i]);return{sendMessage:k,isSending:f,error:p,clearError:o(()=>{h(null)},[])}},k={general:{title:"Widget Preview",subtitle:"Powered by Meerkat Coding",placeholder:"Type your question...",initialMessage:"How can I assist you today?",fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',widgetIcon:e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})),iconSize:"24px",iconPadding:"0"},colors:{headerBackground:"#111827",headerText:"#f9fafb",messageUserBackground:"#4f46e5",messageUserText:"#ffffff",messageBotBackground:"#ffffff",messageBotText:"#111827",inputBackground:"#ffffff",inputBorder:"#e5e7eb",buttonBackground:"#4f46e5",buttonText:"#ffffff",lightBackground:"#f6f7fb",lightShade50:"#eceff5",lightShade100:"#cfd5e1",typingBackground:"#ffffff",typingIndicator:"#4b5563",disabledText:"#9aa3b2",toggleBackground:"#4f46e5",toggleActiveBackground:"#3730a3",toggleHover:"#4338ca",toggleIconStroke:"#ffffff",toggleIconFill:"none"},layout:{windowWidth:"min(420px, calc(100vw - 40px))",windowHeight:"min(600px, calc(100vh - 100px))",borderRadius:"0.75rem",messageBorderRadius:"0.75rem",toggleBorderRadius:"0.75rem",spacing:"0.875rem",headerPadding:"0.875rem",messagePadding:"0.75rem",headerHeight:"auto",textareaHeight:"52px",toggleSize:"56px",transitionDuration:"0.2s"},typography:{titleFontSize:"1.25em",subtitleFontSize:"0.95em",subtitleLineHeight:"1.6",messageFontSize:"0.98rem",messageLineHeight:"1.6"}};function w(e,t){const n=Object.assign({},e);for(const e in t)t[e]&&"object"==typeof t[e]&&!Array.isArray(t[e])?n[e]=w(n[e]||{},t[e]):void 0!==t[e]&&(n[e]=t[e]);return n}const S=(e,t)=>{const n=i(()=>JSON.stringify(e),[e]),r=i(()=>JSON.stringify(t),[t]);return i(()=>{const n=w(k,e||{}),{colors:r,layout:o,typography:i,general:l}=n;return{theme:n,styles:{container:Object.assign({display:"flex",flexDirection:"column",width:o.windowWidth,height:o.windowHeight,borderRadius:o.borderRadius,overflow:"hidden",backgroundColor:r.lightBackground,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",fontFamily:l.fontFamily,transition:`all ${o.transitionDuration}`},null==t?void 0:t.container),windowContainer:Object.assign({position:"fixed",bottom:"max(90px, env(safe-area-inset-bottom, 90px))",right:"max(20px, env(safe-area-inset-right, 20px))",display:"flex",flexDirection:"column",width:o.windowWidth,height:o.windowHeight,borderRadius:o.borderRadius,overflow:"hidden",backgroundColor:r.lightBackground,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",fontFamily:l.fontFamily,zIndex:9999,transition:`all ${o.transitionDuration}`},null==t?void 0:t.container),toggleButton:{position:"fixed",bottom:"max(20px, env(safe-area-inset-bottom, 20px))",right:"max(20px, env(safe-area-inset-right, 20px))",width:o.toggleSize,height:o.toggleSize,borderRadius:o.toggleBorderRadius,backgroundColor:r.toggleBackground,border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:r.toggleIconStroke,boxShadow:"0 4px 12px rgba(79, 70, 229, 0.4)",transition:`all ${o.transitionDuration}`,zIndex:9998},header:Object.assign({padding:o.headerPadding,height:o.headerHeight,backgroundColor:r.headerBackground,color:r.headerText,display:"flex",alignItems:"center",gap:o.spacing},null==t?void 0:t.header),headerTitle:Object.assign({margin:0,fontSize:i.titleFontSize,fontWeight:600,color:r.headerText},null==t?void 0:t.headerTitle),headerSubtitle:{margin:0,fontSize:i.subtitleFontSize,lineHeight:i.subtitleLineHeight,color:r.headerText,opacity:.9},headerIcon:{display:"flex",alignItems:"center",justifyContent:"center",width:l.iconSize,height:l.iconSize,fontSize:l.iconSize,padding:l.iconPadding},messagesContainer:Object.assign({flex:1,overflowY:"auto",padding:o.spacing,display:"flex",flexDirection:"column",gap:o.spacing,backgroundColor:r.lightBackground},null==t?void 0:t.messagesContainer),messageUser:Object.assign({alignSelf:"flex-end",maxWidth:"min(75%, 280px)",padding:o.messagePadding,borderRadius:o.messageBorderRadius,backgroundColor:r.messageUserBackground,color:r.messageUserText,wordWrap:"break-word"},null==t?void 0:t.messageUser),messageBot:Object.assign({alignSelf:"flex-start",maxWidth:"min(75%, 280px)",padding:o.messagePadding,borderRadius:o.messageBorderRadius,backgroundColor:r.messageBotBackground,color:r.messageBotText,wordWrap:"break-word",border:`1px solid ${r.lightShade100}`},null==t?void 0:t.messageBot),messageContent:Object.assign({margin:0,fontSize:i.messageFontSize,lineHeight:i.messageLineHeight},null==t?void 0:t.messageContent),messageTimestamp:Object.assign({fontSize:"0.75rem",marginTop:"4px",opacity:.7},null==t?void 0:t.messageTimestamp),inputContainer:Object.assign({display:"flex",padding:o.spacing,gap:o.spacing,backgroundColor:r.inputBackground,borderTop:`1px solid ${r.lightShade100}`},null==t?void 0:t.inputContainer),input:Object.assign({flex:1,height:o.textareaHeight,padding:"0 1rem",border:`1px solid ${r.inputBorder}`,borderRadius:o.borderRadius,fontSize:i.messageFontSize,fontFamily:l.fontFamily,outline:"none",backgroundColor:r.inputBackground,transition:`border-color ${o.transitionDuration}`},null==t?void 0:t.input),sendButton:Object.assign({width:o.textareaHeight,height:o.textareaHeight,padding:0,backgroundColor:r.buttonBackground,color:r.buttonText,border:"none",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:`all ${o.transitionDuration}`,flexShrink:0},null==t?void 0:t.sendButton),sendButtonDisabled:Object.assign({backgroundColor:r.disabledText,cursor:"not-allowed",opacity:.6},null==t?void 0:t.sendButtonDisabled),loadingIndicator:Object.assign({textAlign:"center",padding:o.spacing,color:r.typingIndicator,fontSize:"0.875rem",fontStyle:"italic"},null==t?void 0:t.loadingIndicator),errorMessage:Object.assign({padding:o.spacing,color:"#dc3545",backgroundColor:"#f8d7da",border:"1px solid #f5c6cb",borderRadius:o.borderRadius,fontSize:"0.875rem",textAlign:"center",margin:`0 ${o.spacing}`},null==t?void 0:t.errorMessage)}}},[n,r])},E={title:"Chat",subtitle:"How can we help you?",footer:"",getStarted:"Start Chat",inputPlaceholder:"Type your message...",initialMessages:[]},C=(e,t="en")=>{const n=i(()=>JSON.stringify(e),[e]);return i(()=>{const n=e[t]||e.en||E;return Object.assign(Object.assign({},E),n)},[n,t])};function T(){}function I(){}const D=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,A=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,L={};function O(e,t){return((t||L).jsx?A:D).test(e)}const P=/[ \t\n\f\r]/g;function M(e){return""===e.replace(P,"")}class q{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function R(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new q(n,r,t)}function z(e){return e.toLowerCase()}q.prototype.normal={},q.prototype.property={},q.prototype.space=void 0;class F{constructor(e,t){this.attribute=t,this.property=e}}F.prototype.attribute="",F.prototype.booleanish=!1,F.prototype.boolean=!1,F.prototype.commaOrSpaceSeparated=!1,F.prototype.commaSeparated=!1,F.prototype.defined=!1,F.prototype.mustUseProperty=!1,F.prototype.number=!1,F.prototype.overloadedBoolean=!1,F.prototype.property="",F.prototype.spaceSeparated=!1,F.prototype.space=void 0;let N=0;const B=G(),j=G(),_=G(),U=G(),H=G(),V=G(),W=G();function G(){return 2**++N}var $=Object.freeze({__proto__:null,boolean:B,booleanish:j,commaOrSpaceSeparated:W,commaSeparated:V,number:U,overloadedBoolean:_,spaceSeparated:H});const Y=Object.keys($);class K extends F{constructor(e,t,n,r){let o=-1;if(super(e,t),J(this,"space",r),"number"==typeof n)for(;++o<Y.length;){const e=Y[o];J(this,Y[o],(n&$[e])===$[e])}}}function J(e,t,n){n&&(e[t]=n)}function Q(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new K(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[z(r)]=r,n[z(i.attribute)]=r}return new q(t,n,e.space)}K.prototype.defined=!0;const Z=Q({properties:{ariaActiveDescendant:null,ariaAtomic:j,ariaAutoComplete:null,ariaBusy:j,ariaChecked:j,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:H,ariaCurrent:null,ariaDescribedBy:H,ariaDetails:null,ariaDisabled:j,ariaDropEffect:H,ariaErrorMessage:null,ariaExpanded:j,ariaFlowTo:H,ariaGrabbed:j,ariaHasPopup:null,ariaHidden:j,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:H,ariaLevel:U,ariaLive:null,ariaModal:j,ariaMultiLine:j,ariaMultiSelectable:j,ariaOrientation:null,ariaOwns:H,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:j,ariaReadOnly:j,ariaRelevant:null,ariaRequired:j,ariaRoleDescription:H,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:j,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function X(e,t){return t in e?e[t]:t}function ee(e,t){return X(e,t.toLowerCase())}const te=Q({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:V,acceptCharset:H,accessKey:H,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:H,autoFocus:B,autoPlay:B,blocking:H,capture:null,charSet:null,checked:B,cite:null,className:H,cols:U,colSpan:null,content:null,contentEditable:j,controls:B,controlsList:H,coords:U|V,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:_,draggable:j,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:H,height:U,hidden:_,high:U,href:null,hrefLang:null,htmlFor:H,httpEquiv:H,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:H,itemRef:H,itemScope:B,itemType:H,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:U,pattern:null,ping:H,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:H,required:B,reversed:B,rows:U,rowSpan:U,sandbox:H,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:j,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:j,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:H,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:j,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:B,disableRemotePlayback:B,prefix:null,property:null,results:U,security:null,unselectable:null},space:"html",transform:ee}),ne=Q({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:W,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:H,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:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,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:V,g2:V,glyphName:V,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:W,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,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:U,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:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:H,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:W,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:W,rev:W,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:W,requiredFeatures:W,requiredFonts:W,requiredFormats:W,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:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:W,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:W,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:W,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:X}),re=Q({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),oe=Q({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ee}),ie=Q({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),le={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"},ae=/[A-Z]/g,se=/-[a-z]/g,ce=/^data[-\w.:]+$/i;function ue(e){return"-"+e.toLowerCase()}function fe(e){return e.charAt(1).toUpperCase()}const de=R([Z,te,re,oe,ie],"html"),pe=R([Z,ne,re,oe,ie],"svg");var he="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var me={},ye=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,be=/\n/g,ve=/^\s*/,xe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ke=/^:\s*/,we=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Se=/^[;\s]*/,Ee=/^\s+|\s+$/g,Ce="";function Te(e){return e?e.replace(Ee,Ce):Ce}var Ie=he&&he.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(me,"__esModule",{value:!0}),me.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;const r=(0,De.default)(e),o="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;const{property:r,value:i}=e;o?t(r,i,e):i&&(n=n||{},n[r]=i)}),n};const De=Ie(function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(e){var t=e.match(be);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=~o?e.length-o:r+e.length}function i(){var e={line:n,column:r};return function(t){return t.position=new l(e),c(),t}}function l(e){this.start=e,this.end={line:n,column:r},this.source=t.source}function a(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i}function s(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function c(){s(ve)}function u(e){var t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){var t=i();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;Ce!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,Ce===e.charAt(n-1))return a("End of comment missing");var l=e.slice(2,n-2);return r+=2,o(l),e=e.slice(n),r+=2,t({type:"comment",comment:l})}}function d(){var e=i(),t=s(xe);if(t){if(f(),!s(ke))return a("property missing ':'");var n=s(we),r=e({type:"declaration",property:Te(t[0].replace(ye,Ce)),value:n?Te(n[0].replace(ye,Ce)):Ce});return s(Se),r}}return l.prototype.content=e,c(),function(){var e,t=[];for(u(t);e=d();)!1!==e&&(t.push(e),u(t));return t}()});var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.camelCase=void 0;var Le=/^--[a-zA-Z0-9_-]+$/,Oe=/-([a-z])/g,Pe=/^[^-]+$/,Me=/^-(webkit|moz|ms|o|khtml)-/,qe=/^-(ms)-/,Re=function(e,t){return t.toUpperCase()},ze=function(e,t){return"".concat(t,"-")};Ae.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||Pe.test(e)||Le.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(qe,ze):e.replace(Me,ze)).replace(Oe,Re))};var Fe=(he&&he.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(me),Ne=Ae;function Be(e,t){var n={};return e&&"string"==typeof e?((0,Fe.default)(e,function(e,r){e&&r&&(n[(0,Ne.camelCase)(e,t)]=r)}),n):n}Be.default=Be;var je=ge(Be);const _e=He("end"),Ue=He("start");function He(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Ve(e){return e&&"object"==typeof e?"position"in e||"type"in e?Ge(e.position):"start"in e||"end"in e?Ge(e):"line"in e||"column"in e?We(e):"":""}function We(e){return $e(e&&e.line)+":"+$e(e&&e.column)}function Ge(e){return We(e&&e.start)+"-"+We(e&&e.end)}function $e(e){return e&&"number"==typeof e?e:1}class Ye extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Ve(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ye.prototype.file="",Ye.prototype.name="",Ye.prototype.reason="",Ye.prototype.message="",Ye.prototype.stack="",Ye.prototype.column=void 0,Ye.prototype.line=void 0,Ye.prototype.ancestors=void 0,Ye.prototype.cause=void 0,Ye.prototype.fatal=void 0,Ye.prototype.place=void 0,Ye.prototype.ruleId=void 0,Ye.prototype.source=void 0;const Ke={}.hasOwnProperty,Je=new Map,Qe=/[A-Z]/g,Ze=new Set(["table","tbody","thead","tfoot","tr"]),Xe=new Set(["td","th"]),et="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tt(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const l=Array.isArray(o.children),a=Ue(n);return t(r,o,i,l,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const l=Array.isArray(o.children)?n:t;return i?l(r,o,i):l(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?pe:de,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=nt(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function nt(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=pe,e.schema=o);e.ancestors.push(t);const i=at(e,t.tagName,!1),l=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Ke.call(t.properties,o)){const i=lt(e,o,t.properties[o]);if(i){const[o,l]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof l&&Xe.has(t.tagName)?r=l:n[o]=l}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let a=it(e,t);Ze.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&M(t.value):M(t));var t}));return rt(e,l,i,t),ot(l,a),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}st(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=pe,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:at(e,t.name,!0),l=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];T(t.type);const o=t.expression;T(o.type);const i=o.properties[0];T(i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else st(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];T(t.type),i=e.evaluater.evaluateExpression(t.expression)}else st(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),a=it(e,t);return rt(e,l,i,t),ot(l,a),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);st(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return ot(r,it(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function rt(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ot(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function it(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Je;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;l=e+"-"+t,o.set(e,t+1)}}const a=nt(e,i,l);void 0!==a&&n.push(a)}return n}function lt(e,t,n){const r=function(e,t){const n=z(t);let r=t,o=F;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&ce.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(se,fe);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!se.test(e)){let n=e.replace(ae,ue);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=K}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return je(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,r=new Ye("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=et+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Ke.call(e,n)&&(t[ct(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?le[r.property]||r.property:r.attribute,n]}}function at(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=O(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=O(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Ke.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);st(e)}function st(e,t){const n=new Ye("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=et+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ct(e){let t=e.replace(Qe,ut);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function ut(e){return"-"+e.toLowerCase()}const ft={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"]},dt={};function pt(e,t){const n=t||dt;return ht(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function ht(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return gt(e.children,t,n)}return Array.isArray(e)?gt(e,t,n):""}function gt(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ht(e[o],t,n);return r.join("")}const mt={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"'