(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[863],{55379:function(t){"use strict";var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,isArray=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===o.call(t)},isPlainObject=function(t){if(!t||"[object Object]"!==o.call(t))return!1;var a,s=i.call(t,"constructor"),c=t.constructor&&t.constructor.prototype&&i.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!s&&!c)return!1;for(a in t);return void 0===a||i.call(t,a)},setProperty=function(t,i){a&&"__proto__"===i.name?a(t,i.name,{enumerable:!0,configurable:!0,value:i.newValue,writable:!0}):t[i.name]=i.newValue},getProperty=function(t,o){if("__proto__"===o){if(!i.call(t,o))return;if(s)return s(t,o).value}return t[o]};t.exports=function extend(){var t,i,o,a,s,c,k=arguments[0],x=1,w=arguments.length,A=!1;for("boolean"==typeof k&&(A=k,k=arguments[1]||{},x=2),(null==k||"object"!=typeof k&&"function"!=typeof k)&&(k={});x{},k=noop(),x=Object,isUndefined=t=>t===k,isFunction=t=>"function"==typeof t,mergeObjects=(t,i)=>({...t,...i}),isPromiseLike=t=>isFunction(t.then),w=new WeakMap,A=0,stableHash=t=>{let i,o;let a=typeof t,s=t&&t.constructor,c=s==Date;if(x(t)!==t||c||s==RegExp)i=c?t.toJSON():"symbol"==a?t.toString():"string"==a?JSON.stringify(t):""+t;else{if(i=w.get(t))return i;if(i=++A+"~",w.set(t,i),s==Array){for(o=0,i="@";oB&&typeof window.requestAnimationFrame!=D,createCacheHelper=(t,i)=>{let o=P.get(t);return[()=>!isUndefined(i)&&t.get(i)||z,a=>{if(!isUndefined(i)){let s=t.get(i);i in R||(R[i]=s),o[5](i,mergeObjects(s,a),s||z)}},o[6],()=>!isUndefined(i)&&i in R?R[i]:!isUndefined(i)&&t.get(i)||z]},V=!0,[j,W]=B&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[noop,noop],$={initFocus:t=>(U&&document.addEventListener("visibilitychange",t),j("focus",t),()=>{U&&document.removeEventListener("visibilitychange",t),W("focus",t)}),initReconnect:t=>{let onOnline=()=>{V=!0,t()},onOffline=()=>{V=!1};return j("online",onOnline),j("offline",onOffline),()=>{W("online",onOnline),W("offline",onOffline)}}},J=!s.useId,K=!B||"Deno"in window,rAF=t=>hasRequestAnimationFrame()?window.requestAnimationFrame(t):setTimeout(t,1),Y=K?s.useEffect:s.useLayoutEffect,X="undefined"!=typeof navigator&&navigator.connection,Z=!K&&X&&(["slow-2g","2g"].includes(X.effectiveType)||X.saveData),dist_serialize=t=>{if(isFunction(t))try{t=t()}catch(i){t=""}let i=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?stableHash(t):"",i]},G=0,getTimestamp=()=>++G;var ee={ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:2,RECONNECT_EVENT:1};async function internalMutate(...t){let[i,o,a,s]=t,c=mergeObjects({populateCache:!0,throwOnError:!0},"boolean"==typeof s?{revalidate:s}:s||{}),x=c.populateCache,w=c.rollbackOnError,A=c.optimisticData,z=!1!==c.revalidate,rollbackOnError=t=>"function"==typeof w?w(t):!1!==w,R=c.throwOnError;if(isFunction(o)){let t=[],a=i.keys();for(let s of a)!/^\$(inf|sub)\$/.test(s)&&o(i.get(s)._k)&&t.push(s);return Promise.all(t.map(mutateByKey))}return mutateByKey(o);async function mutateByKey(o){let s;let[c]=dist_serialize(o);if(!c)return;let[w,D]=createCacheHelper(i,c),[B,U,V,j]=P.get(i),W=B[c],startRevalidate=()=>z&&(delete V[c],delete j[c],W&&W[0])?W[0](2).then(()=>w().data):w().data;if(t.length<3)return startRevalidate();let $=a,J=getTimestamp();U[c]=[J,0];let K=!isUndefined(A),Y=w(),X=Y.data,Z=Y._c,G=isUndefined(Z)?X:Z;if(K&&D({data:A=isFunction(A)?A(G,X):A,_c:G}),isFunction($))try{$=$(G)}catch(t){s=t}if($&&isPromiseLike($)){if($=await $.catch(t=>{s=t}),J!==U[c][0]){if(s)throw s;return $}s&&K&&rollbackOnError(s)&&(x=!0,D({data:$=G,_c:k}))}x&&!s&&(isFunction(x)&&($=x($,G)),D({data:$,error:k,_c:k})),U[c][1]=getTimestamp();let ee=await startRevalidate();if(D({_c:k}),s){if(R)throw s;return}return x?ee:$}}let revalidateAllKeys=(t,i)=>{for(let o in t)t[o][0]&&t[o][0](i)},initCache=(t,i)=>{if(!P.has(t)){let o=mergeObjects($,i),a={},s=internalMutate.bind(k,t),c=noop,x={},subscribe=(t,i)=>{let o=x[t]||[];return x[t]=o,o.push(i),()=>o.splice(o.indexOf(i),1)},setter=(i,o,a)=>{t.set(i,o);let s=x[i];if(s)for(let t of s)t(o,a)},initProvider=()=>{if(!P.has(t)&&(P.set(t,[a,{},{},{},s,setter,subscribe]),!K)){let i=o.initFocus(setTimeout.bind(k,revalidateAllKeys.bind(k,a,0))),s=o.initReconnect(setTimeout.bind(k,revalidateAllKeys.bind(k,a,1)));c=()=>{i&&i(),s&&s(),P.delete(t)}}};return initProvider(),[t,s,initProvider,c]}return[t,P.get(t)[4]]},[et,en]=initCache(new Map),er=mergeObjects({onLoadingSlow:noop,onSuccess:noop,onError:noop,onErrorRetry:(t,i,o,a,s)=>{let c=o.errorRetryCount,k=s.retryCount,x=~~((Math.random()+.5)*(1<<(k<8?k:8)))*o.errorRetryInterval;(isUndefined(c)||!(k>c))&&setTimeout(a,x,s)},onDiscarded:noop,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Z?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Z?5e3:3e3,compare:(t,i)=>stableHash(t)==stableHash(i),isPaused:()=>!1,cache:et,mutate:en,fallback:{}},{isOnline:()=>V,isVisible:()=>{let t=U&&document.visibilityState;return isUndefined(t)||"hidden"!==t}}),mergeConfigs=(t,i)=>{let o=mergeObjects(t,i);if(i){let{use:a,fallback:s}=t,{use:c,fallback:k}=i;a&&c&&(o.use=a.concat(c)),s&&k&&(o.fallback=mergeObjects(s,k))}return o},ei=(0,s.createContext)({}),eo=B&&window.__SWR_DEVTOOLS_USE__,ea=eo?window.__SWR_DEVTOOLS_USE__:[],normalize=t=>isFunction(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}],useSWRConfig=()=>mergeObjects(er,(0,s.useContext)(ei)),el=ea.concat(t=>(i,o,a)=>{let s=o&&((...t)=>{let[a]=dist_serialize(i),[,,,s]=P.get(et),c=s[a];return isUndefined(c)?o(...t):(delete s[a],c)});return t(i,s,a)}),subscribeCallback=(t,i,o)=>{let a=i[t]||(i[t]=[]);return a.push(o),()=>{let t=a.indexOf(o);t>=0&&(a[t]=a[a.length-1],a.pop())}};eo&&(window.__SWR_DEVTOOLS_REACT__=s);let es=s.use||(t=>{if("pending"===t.status)throw t;if("fulfilled"===t.status)return t.value;if("rejected"===t.status)throw t.reason;throw t.status="pending",t.then(i=>{t.status="fulfilled",t.value=i},i=>{t.status="rejected",t.reason=i}),t}),eu={dedupe:!0};x.defineProperty(t=>{let{value:i}=t,o=(0,s.useContext)(ei),a=isFunction(i),c=(0,s.useMemo)(()=>a?i(o):i,[a,o,i]),x=(0,s.useMemo)(()=>a?c:mergeConfigs(o,c),[a,o,c]),w=c&&c.provider,A=(0,s.useRef)(k);w&&!A.current&&(A.current=initCache(w(x.cache||et),c));let P=A.current;return P&&(x.cache=P[0],x.mutate=P[1]),Y(()=>{if(P)return P[2]&&P[2](),P[3]},[]),(0,s.createElement)(ei.Provider,mergeObjects(t,{value:x}))},"defaultValue",{value:er});let ec=(a=(t,i,o)=>{let{cache:a,compare:x,suspense:w,fallbackData:A,revalidateOnMount:z,revalidateIfStale:R,refreshInterval:D,refreshWhenHidden:B,refreshWhenOffline:U,keepPreviousData:V}=o,[j,W,$,X]=P.get(a),[Z,G]=dist_serialize(t),et=(0,s.useRef)(!1),en=(0,s.useRef)(!1),er=(0,s.useRef)(Z),ei=(0,s.useRef)(i),eo=(0,s.useRef)(o),getConfig=()=>eo.current,isActive=()=>getConfig().isVisible()&&getConfig().isOnline(),[ea,el,ec,ed]=createCacheHelper(a,Z),ef=(0,s.useRef)({}).current,ep=isUndefined(A)?o.fallback[Z]:A,isEqual=(t,i)=>{for(let o in ef)if("data"===o){if(!x(t[o],i[o])&&(!isUndefined(t[o])||!x(ew,i[o])))return!1}else if(i[o]!==t[o])return!1;return!0},eh=(0,s.useMemo)(()=>{let t=!!Z&&!!i&&(isUndefined(z)?!getConfig().isPaused()&&!w&&(!!isUndefined(R)||R):z),getSelectedCache=i=>{let o=mergeObjects(i);return(delete o._k,t)?{isValidating:!0,isLoading:!0,...o}:o},o=ea(),a=ed(),s=getSelectedCache(o),c=o===a?s:getSelectedCache(a),k=s;return[()=>{let t=getSelectedCache(ea()),i=isEqual(t,k);return i?(k.data=t.data,k.isLoading=t.isLoading,k.isValidating=t.isValidating,k.error=t.error,k):(k=t,t)},()=>c]},[a,Z]),em=(0,c.useSyncExternalStore)((0,s.useCallback)(t=>ec(Z,(i,o)=>{isEqual(o,i)||t()}),[a,Z]),eh[0],eh[1]),eg=!et.current,ey=j[Z]&&j[Z].length>0,ek=em.data,ex=isUndefined(ek)?ep:ek,ev=em.error,eb=(0,s.useRef)(ex),ew=V?isUndefined(ek)?eb.current:ek:ex,eS=(!ey||!!isUndefined(ev))&&(eg&&!isUndefined(z)?z:!getConfig().isPaused()&&(w?!isUndefined(ex)&&R:isUndefined(ex)||R)),eC=!!(Z&&i&&eg&&eS),eE=isUndefined(em.isValidating)?eC:em.isValidating,e_=isUndefined(em.isLoading)?eC:em.isLoading,eT=(0,s.useCallback)(async t=>{let i,a;let s=ei.current;if(!Z||!s||en.current||getConfig().isPaused())return!1;let c=!0,w=t||{},A=!$[Z]||!w.dedupe,callbackSafeguard=()=>J?!en.current&&Z===er.current&&et.current:Z===er.current,P={isValidating:!1,isLoading:!1},finishRequestAndUpdateState=()=>{el(P)},cleanupState=()=>{let t=$[Z];t&&t[1]===a&&delete $[Z]},z={isValidating:!0};isUndefined(ea().data)&&(z.isLoading=!0);try{if(A&&(el(z),o.loadingTimeout&&isUndefined(ea().data)&&setTimeout(()=>{c&&callbackSafeguard()&&getConfig().onLoadingSlow(Z,o)},o.loadingTimeout),$[Z]=[s(G),getTimestamp()]),[i,a]=$[Z],i=await i,A&&setTimeout(cleanupState,o.dedupingInterval),!$[Z]||$[Z][1]!==a)return A&&callbackSafeguard()&&getConfig().onDiscarded(Z),!1;P.error=k;let t=W[Z];if(!isUndefined(t)&&(a<=t[0]||a<=t[1]||0===t[1]))return finishRequestAndUpdateState(),A&&callbackSafeguard()&&getConfig().onDiscarded(Z),!1;let w=ea().data;P.data=x(w,i)?w:i,A&&callbackSafeguard()&&getConfig().onSuccess(i,Z,o)}catch(o){cleanupState();let t=getConfig(),{shouldRetryOnError:i}=t;!t.isPaused()&&(P.error=o,A&&callbackSafeguard()&&(t.onError(o,Z,t),(!0===i||isFunction(i)&&i(o))&&isActive()&&t.onErrorRetry(o,Z,t,t=>{let i=j[Z];i&&i[0]&&i[0](ee.ERROR_REVALIDATE_EVENT,t)},{retryCount:(w.retryCount||0)+1,dedupe:!0})))}return c=!1,finishRequestAndUpdateState(),!0},[Z,a]),eI=(0,s.useCallback)((...t)=>internalMutate(a,er.current,...t),[]);if(Y(()=>{ei.current=i,eo.current=o,isUndefined(ek)||(eb.current=ek)}),Y(()=>{if(!Z)return;let t=eT.bind(k,eu),i=0,o=subscribeCallback(Z,j,(o,a={})=>{if(o==ee.FOCUS_EVENT){let o=Date.now();getConfig().revalidateOnFocus&&o>i&&isActive()&&(i=o+getConfig().focusThrottleInterval,t())}else if(o==ee.RECONNECT_EVENT)getConfig().revalidateOnReconnect&&isActive()&&t();else if(o==ee.MUTATE_EVENT)return eT();else if(o==ee.ERROR_REVALIDATE_EVENT)return eT(a)});return en.current=!1,er.current=Z,et.current=!0,el({_k:G}),eS&&(isUndefined(ex)||K?t():rAF(t)),()=>{en.current=!0,o()}},[Z]),Y(()=>{let t;function next(){let i=isFunction(D)?D(ea().data):D;i&&-1!==t&&(t=setTimeout(execute,i))}function execute(){!ea().error&&(B||getConfig().isVisible())&&(U||getConfig().isOnline())?eT(eu).then(next):next()}return next(),()=>{t&&(clearTimeout(t),t=-1)}},[D,B,U,Z]),(0,s.useDebugValue)(ew),w&&isUndefined(ex)&&Z){if(!J&&K)throw Error("Fallback data is required when using suspense in SSR.");ei.current=i,eo.current=o,en.current=!1;let t=X[Z];if(!isUndefined(t)){let i=eI(t);es(i)}if(isUndefined(ev)){let t=eT(eu);isUndefined(ew)||(t.status="fulfilled",t.value=!0),es(t)}else throw ev}return{mutate:eI,get data(){return ef.data=!0,ew},get error(){return ef.error=!0,ev},get isValidating(){return ef.isValidating=!0,eE},get isLoading(){return ef.isLoading=!0,e_}}},function(...t){let i=useSWRConfig(),[o,s,c]=normalize(t),k=mergeConfigs(i,c),x=a,{use:w}=k,A=(w||[]).concat(el);for(let t=A.length;t--;)x=A[t](x);return x(o,s||k.fetcher||null,k)});var ed={code:"0",name:"text",parse:t=>{if("string"!=typeof t)throw Error('"text" parts expect a string value.');return{type:"text",value:t}}},ef={code:"1",name:"function_call",parse:t=>{if(null==t||"object"!=typeof t||!("function_call"in t)||"object"!=typeof t.function_call||null==t.function_call||!("name"in t.function_call)||!("arguments"in t.function_call)||"string"!=typeof t.function_call.name||"string"!=typeof t.function_call.arguments)throw Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:t}}},ep={code:"2",name:"data",parse:t=>{if(!Array.isArray(t))throw Error('"data" parts expect an array value.');return{type:"data",value:t}}},eh={code:"3",name:"error",parse:t=>{if("string"!=typeof t)throw Error('"error" parts expect a string value.');return{type:"error",value:t}}},em={code:"4",name:"assistant_message",parse:t=>{if(null==t||"object"!=typeof t||!("id"in t)||!("role"in t)||!("content"in t)||"string"!=typeof t.id||"string"!=typeof t.role||"assistant"!==t.role||!Array.isArray(t.content)||!t.content.every(t=>null!=t&&"object"==typeof t&&"type"in t&&"text"===t.type&&"text"in t&&null!=t.text&&"object"==typeof t.text&&"value"in t.text&&"string"==typeof t.text.value))throw Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:t}}},eg={code:"5",name:"assistant_control_data",parse:t=>{if(null==t||"object"!=typeof t||!("threadId"in t)||!("messageId"in t)||"string"!=typeof t.threadId||"string"!=typeof t.messageId)throw Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:t.threadId,messageId:t.messageId}}}},ey={code:"6",name:"data_message",parse:t=>{if(null==t||"object"!=typeof t||!("role"in t)||!("data"in t)||"string"!=typeof t.role||"data"!==t.role)throw Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:t}}},ek={code:"7",name:"tool_calls",parse:t=>{if(null==t||"object"!=typeof t||!("tool_calls"in t)||"object"!=typeof t.tool_calls||null==t.tool_calls||!Array.isArray(t.tool_calls)||t.tool_calls.some(t=>{null!=t&&"object"==typeof t&&"id"in t&&"string"==typeof t.id&&"type"in t&&"string"==typeof t.type&&"function"in t&&null!=t.function&&"object"==typeof t.function&&"arguments"in t.function&&"string"==typeof t.function.name&&t.function.arguments}))throw Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:t}}},ex={code:"8",name:"message_annotations",parse:t=>{if(!Array.isArray(t))throw Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:t}}},ev={[ed.code]:ed,[ef.code]:ef,[ep.code]:ep,[eh.code]:eh,[em.code]:em,[eg.code]:eg,[ey.code]:ey,[ek.code]:ek,[ex.code]:ex};ed.name,ed.code,ef.name,ef.code,ep.name,ep.code,eh.name,eh.code,em.name,em.code,eg.name,eg.code,ey.name,ey.code,ek.name,ek.code,ex.name,ex.code;var eb=[ed,ef,ep,eh,em,eg,ey,ek,ex].map(t=>t.code),parseStreamPart=t=>{let i=t.indexOf(":");if(-1===i)throw Error("Failed to parse stream string. No separator found.");let o=t.slice(0,i);if(!eb.includes(o))throw Error(`Failed to parse stream string. Invalid code ${o}.`);let a=t.slice(i+1),s=JSON.parse(a);return ev[o].parse(s)};function concatChunks(t,i){let o=new Uint8Array(i),a=0;for(let i of t)o.set(i,a),a+=i.length;return t.length=0,o}async function*readDataStream(t,{isAborted:i}={}){let o=new TextDecoder,a=[],s=0;for(;;){let{value:c}=await t.read();if(c&&(a.push(c),s+=c.length,10!==c[c.length-1]))continue;if(0===a.length)break;let k=concatChunks(a,s);s=0;let x=o.decode(k,{stream:!0}).split("\n").filter(t=>""!==t).map(parseStreamPart);for(let t of x)yield t;if(null==i?void 0:i()){t.cancel();break}}}var ew=((t,i=21)=>(o=i)=>{let a="",s=o;for(;s--;)a+=t[Math.random()*t.length|0];return a})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function createChunkDecoder(t){let i=new TextDecoder;return t?function(t){let o=i.decode(t,{stream:!0}).split("\n").filter(t=>""!==t);return o.map(parseStreamPart).filter(Boolean)}:function(t){return t?i.decode(t,{stream:!0}):""}}function assignAnnotationsToMessage(t,i){return t&&i&&i.length?{...t,annotations:[...i]}:t}async function parseComplexResponse({reader:t,abortControllerRef:i,update:o,onFinish:a,generateId:s=ew,getCurrentDate:c=()=>new Date}){let k;let x=c(),w={data:[]};for await(let{type:a,value:c}of readDataStream(t,{isAborted:()=>(null==i?void 0:i.current)===null})){"text"===a&&(w.text?w.text={...w.text,content:(w.text.content||"")+c}:w.text={id:s(),role:"assistant",content:c,createdAt:x});let t=null;"function_call"===a&&(w.function_call={id:s(),role:"assistant",content:"",function_call:c.function_call,name:c.function_call.name,createdAt:x},t=w.function_call);let i=null;"tool_calls"===a&&(w.tool_calls={id:s(),role:"assistant",content:"",tool_calls:c.tool_calls,createdAt:x},i=w.tool_calls),"data"===a&&w.data.push(...c);let A=w.text;if("message_annotations"===a&&(k?k.push(...c):k=[...c],t=assignAnnotationsToMessage(w.function_call,k),i=assignAnnotationsToMessage(w.tool_calls,k),A=assignAnnotationsToMessage(w.text,k)),null==k?void 0:k.length){let t=["text","function_call","tool_calls"];t.forEach(t=>{w[t]&&(w[t].annotations=[...k])})}let P=[t,i,A].filter(Boolean).map(t=>({...assignAnnotationsToMessage(t,k)}));o(P,[...w.data])}return null==a||a(w),{messages:[w.text,w.function_call,w.tool_calls].filter(Boolean),data:w.data}}async function callChatApi({api:t,messages:i,body:o,credentials:a,headers:s,abortController:c,appendMessage:k,restoreMessagesOnFailure:x,onResponse:w,onUpdate:A,onFinish:P,generateId:z}){var R;let D=await fetch(t,{method:"POST",body:JSON.stringify({messages:i,...o}),headers:{"Content-Type":"application/json",...s},signal:null==(R=null==c?void 0:c())?void 0:R.signal,credentials:a}).catch(t=>{throw x(),t});if(w)try{await w(D)}catch(t){throw t}if(!D.ok)throw x(),Error(await D.text()||"Failed to fetch the chat response.");if(!D.body)throw Error("The response body is empty.");let B=D.body.getReader(),U="true"===D.headers.get("X-Experimental-Stream-Data");if(U)return await parseComplexResponse({reader:B,abortControllerRef:null!=c?{current:c()}:void 0,update:A,onFinish(t){P&&null!=t.text&&P(t.text)},generateId:z});{let t=new Date,i=createChunkDecoder(!1),o="",a=z(),s={id:a,createdAt:t,content:"",role:"assistant"};for(;;){let{done:t,value:a}=await B.read();if(t)break;if((o+=i(a)).startsWith('{"function_call":')?s.function_call=o:o.startsWith('{"tool_calls":')?s.tool_calls=o:s.content=o,k({...s}),(null==c?void 0:c())===null){B.cancel();break}}if(o.startsWith('{"function_call":')){let t=JSON.parse(o).function_call;s.function_call=t,k({...s})}if(o.startsWith('{"tool_calls":')){let t=JSON.parse(o).tool_calls;s.tool_calls=t,k({...s})}return P&&P(s),s}}async function processChatStream({getStreamedResponse:t,experimental_onFunctionCall:i,experimental_onToolCall:o,updateChatRequest:a,getCurrentMessages:s}){for(;;){let c=await t();if("messages"in c){let t=!1;for(let k of c.messages)if(void 0!==k.function_call&&"string"!=typeof k.function_call||void 0!==k.tool_calls&&"string"!=typeof k.tool_calls){if(t=!0,i){let o=k.function_call;if("object"!=typeof o){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}let c=await i(s(),o);if(void 0===c){t=!1;break}a(c)}if(o){let i=k.tool_calls;if(!Array.isArray(i)||i.some(t=>"object"!=typeof t)){console.warn("experimental_onToolCall should not be defined when using tools");continue}let c=await o(s(),i);if(void 0===c){t=!1;break}a(c)}}if(!t)break}else{let fixFunctionCallArguments2=function(t){for(let i of t.messages){if(void 0!==i.tool_calls)for(let t of i.tool_calls)"object"==typeof t&&t.function.arguments&&"string"!=typeof t.function.arguments&&(t.function.arguments=JSON.stringify(t.function.arguments));void 0!==i.function_call&&"object"==typeof i.function_call&&i.function_call.arguments&&"string"!=typeof i.function_call.arguments&&(i.function_call.arguments=JSON.stringify(i.function_call.arguments))}};if((void 0===c.function_call||"string"==typeof c.function_call)&&(void 0===c.tool_calls||"string"==typeof c.tool_calls))break;if(i){let t=c.function_call;if("object"!=typeof t){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}let o=await i(s(),t);if(void 0===o)break;fixFunctionCallArguments2(o),a(o)}if(o){let t=c.tool_calls;if("object"!=typeof t){console.warn("experimental_onToolCall should not be defined when using functions");continue}let i=await o(s(),t);if(void 0===i)break;fixFunctionCallArguments2(i),a(i)}}}}var getStreamedResponse=async(t,i,o,a,s,c,k,x,w,A,P,z)=>{var R,D;let B=k.current;o(i.messages,!1);let U=z?i.messages:i.messages.map(({role:t,content:i,name:o,function_call:a,tool_calls:s,tool_call_id:c})=>({role:t,content:i,tool_call_id:c,...void 0!==o&&{name:o},...void 0!==a&&{function_call:a},...void 0!==s&&{tool_calls:s}}));if("string"!=typeof t){let a=w(),s=new Date,c={id:a,createdAt:s,content:"",role:"assistant"};async function readRow(t){let{content:a,ui:s,next:k}=await t;c.content=a,c.ui=await s,o([...i.messages,{...c}],!1),k&&await readRow(k)}try{let o=t({messages:U,data:i.data});await readRow(o)}catch(t){throw o(B,!1),t}return A&&A(c),c}return await callChatApi({api:t,messages:U,body:{data:i.data,...c.current.body,...null==(R=i.options)?void 0:R.body,...void 0!==i.functions&&{functions:i.functions},...void 0!==i.function_call&&{function_call:i.function_call},...void 0!==i.tools&&{tools:i.tools},...void 0!==i.tool_choice&&{tool_choice:i.tool_choice}},credentials:c.current.credentials,headers:{...c.current.headers,...null==(D=i.options)?void 0:D.headers},abortController:()=>x.current,appendMessage(t){o([...i.messages,t],!1)},restoreMessagesOnFailure(){o(B,!1)},onResponse:P,onUpdate(t,c){o([...i.messages,...t],!1),a([...s||[],...c||[]],!1)},onFinish:A,generateId:w})};function useChat({api:t="/api/chat",id:i,initialMessages:o,initialInput:a="",sendExtraMessageFields:c,experimental_onFunctionCall:k,experimental_onToolCall:x,onResponse:w,onFinish:A,onError:P,credentials:z,headers:R,body:D,generateId:B=ew}={}){let U=(0,s.useId)(),V=null!=i?i:U,j="string"==typeof t?[t,V]:V,[W]=(0,s.useState)([]),{data:$,mutate:J}=ec([j,"messages"],null,{fallbackData:null!=o?o:W}),{data:K=!1,mutate:Y}=ec([j,"loading"],null),{data:X,mutate:Z}=ec([j,"streamData"],null),{data:G,mutate:ee}=ec([j,"error"],null),et=(0,s.useRef)($||[]);(0,s.useEffect)(()=>{et.current=$||[]},[$]);let en=(0,s.useRef)(null),er=(0,s.useRef)({credentials:z,headers:R,body:D});(0,s.useEffect)(()=>{er.current={credentials:z,headers:R,body:D}},[z,R,D]);let ei=(0,s.useCallback)(async i=>{try{Y(!0),ee(void 0);let o=new AbortController;en.current=o,await processChatStream({getStreamedResponse:()=>getStreamedResponse(t,i,J,Z,X,er,et,en,B,A,w,c),experimental_onFunctionCall:k,experimental_onToolCall:x,updateChatRequest:t=>{i=t},getCurrentMessages:()=>et.current}),en.current=null}catch(t){if("AbortError"===t.name)return en.current=null,null;P&&t instanceof Error&&P(t),ee(t)}finally{Y(!1)}},[J,Y,t,er,w,A,P,ee,Z,X,c,k,x,et,en,B]),eo=(0,s.useCallback)(async(t,{options:i,functions:o,function_call:a,tools:s,tool_choice:c,data:k}={})=>{t.id||(t.id=B());let x={messages:et.current.concat(t),options:i,data:k,...void 0!==o&&{functions:o},...void 0!==a&&{function_call:a},...void 0!==s&&{tools:s},...void 0!==c&&{tool_choice:c}};return ei(x)},[ei,B]),ea=(0,s.useCallback)(async({options:t,functions:i,function_call:o,tools:a,tool_choice:s}={})=>{if(0===et.current.length)return null;let c=et.current[et.current.length-1];if("assistant"===c.role){let c={messages:et.current.slice(0,-1),options:t,...void 0!==i&&{functions:i},...void 0!==o&&{function_call:o},...void 0!==a&&{tools:a},...void 0!==s&&{tool_choice:s}};return ei(c)}let k={messages:et.current,options:t,...void 0!==i&&{functions:i},...void 0!==o&&{function_call:o},...void 0!==a&&{tools:a},...void 0!==s&&{tool_choice:s}};return ei(k)},[ei]),el=(0,s.useCallback)(()=>{en.current&&(en.current.abort(),en.current=null)},[]),es=(0,s.useCallback)(t=>{J(t,!1),et.current=t},[J]),[eu,ed]=(0,s.useState)(a),ef=(0,s.useCallback)((t,i={},o)=>{o&&(er.current={...er.current,...o}),t.preventDefault(),eu&&(eo({content:eu,role:"user",createdAt:new Date},i),ed(""))},[eu,eo]);return{messages:$||[],error:G,append:eo,reload:ea,stop:el,setMessages:es,input:eu,setInput:ed,handleInputChange:t=>{ed(t.target.value)},handleSubmit:ef,isLoading:K,data:X}}},83473:function(t,i,o){"use strict";o.d(i,{U:function(){return Markdown}});var a={};o.r(a),o.d(a,{boolean:function(){return P},booleanish:function(){return z},commaOrSpaceSeparated:function(){return V},commaSeparated:function(){return U},number:function(){return D},overloadedBoolean:function(){return R},spaceSeparated:function(){return B}});var s={};function stringify(t,i){let o=i||{},a=""===t[t.length-1]?[...t,""]:t;return a.join((o.padRight?" ":"")+","+(!1===o.padLeft?"":" ")).trim()}o.r(s),o.d(s,{attentionMarkers:function(){return tl},contentInitial:function(){return tt},disable:function(){return ts},document:function(){return te},flow:function(){return tr},flowInitial:function(){return tn},insideSpan:function(){return ta},string:function(){return ti},text:function(){return to}});let c=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,x={};function lib_name(t,i){let o=(i||x).jsx?k:c;return o.test(t)}let w=/[ \t\n\f\r]/g;function whitespace(t){return"object"==typeof t?"text"===t.type&&empty(t.value):empty(t)}function empty(t){return""===t.replace(w,"")}let Schema=class Schema{constructor(t,i,o){this.property=t,this.normal=i,o&&(this.space=o)}};function merge(t,i){let o={},a={},s=-1;for(;++s"xlink:"+i.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),J=create({space:"xml",transform:(t,i)=>"xml:"+i.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function caseSensitiveTransform(t,i){return i in t?t[i]:i}function caseInsensitiveTransform(t,i){return caseSensitiveTransform(t,i.toLowerCase())}let K=create({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:caseInsensitiveTransform,properties:{xmlns:null,xmlnsXLink:null}}),Y=create({transform:(t,i)=>"role"===i?i:"aria-"+i.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:z,ariaAutoComplete:null,ariaBusy:z,ariaChecked:z,ariaColCount:D,ariaColIndex:D,ariaColSpan:D,ariaControls:B,ariaCurrent:null,ariaDescribedBy:B,ariaDetails:null,ariaDisabled:z,ariaDropEffect:B,ariaErrorMessage:null,ariaExpanded:z,ariaFlowTo:B,ariaGrabbed:z,ariaHasPopup:null,ariaHidden:z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:B,ariaLevel:D,ariaLive:null,ariaModal:z,ariaMultiLine:z,ariaMultiSelectable:z,ariaOrientation:null,ariaOwns:B,ariaPlaceholder:null,ariaPosInSet:D,ariaPressed:z,ariaReadOnly:z,ariaRelevant:null,ariaRequired:z,ariaRoleDescription:B,ariaRowCount:D,ariaRowIndex:D,ariaRowSpan:D,ariaSelected:z,ariaSetSize:D,ariaSort:null,ariaValueMax:D,ariaValueMin:D,ariaValueNow:D,ariaValueText:null,role:null}}),X=create({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:caseInsensitiveTransform,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:U,acceptCharset:B,accessKey:B,action:null,allow:null,allowFullScreen:P,allowPaymentRequest:P,allowUserMedia:P,alt:null,as:null,async:P,autoCapitalize:null,autoComplete:B,autoFocus:P,autoPlay:P,blocking:B,capture:null,charSet:null,checked:P,cite:null,className:B,cols:D,colSpan:null,content:null,contentEditable:z,controls:P,controlsList:B,coords:D|U,crossOrigin:null,data:null,dateTime:null,decoding:null,default:P,defer:P,dir:null,dirName:null,disabled:P,download:R,draggable:z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:P,formTarget:null,headers:B,height:D,hidden:P,high:D,href:null,hrefLang:null,htmlFor:B,httpEquiv:B,id:null,imageSizes:null,imageSrcSet:null,inert:P,inputMode:null,integrity:null,is:null,isMap:P,itemId:null,itemProp:B,itemRef:B,itemScope:P,itemType:B,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:P,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:P,muted:P,name:null,nonce:null,noModule:P,noValidate:P,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:P,optimum:D,pattern:null,ping:B,placeholder:null,playsInline:P,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:P,referrerPolicy:null,rel:B,required:P,reversed:P,rows:D,rowSpan:D,sandbox:B,scope:null,scoped:P,seamless:P,selected:P,shadowRootClonable:P,shadowRootDelegatesFocus:P,shadowRootMode:null,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:P,useMap:null,value:z,width:D,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:B,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:P,declare:P,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:P,noHref:P,noShade:P,noWrap:P,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:z,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:P,disableRemotePlayback:P,prefix:null,property:null,results:D,security:null,unselectable:null}}),Z=create({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:caseSensitiveTransform,properties:{about:V,accentHeight:D,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:D,amplitude:D,arabicForm:null,ascent:D,attributeName:null,attributeType:null,azimuth:D,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:D,by:null,calcMode:null,capHeight:D,className:B,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:D,diffuseConstant:D,direction:null,display:null,dur:null,divisor:D,dominantBaseline:null,download:P,dx:null,dy:null,edgeMode:null,editable:null,elevation:D,enableBackground:null,end:null,event:null,exponent:D,externalResourcesRequired:null,fill:null,fillOpacity:D,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:U,g2:U,glyphName:U,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:D,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:D,horizOriginX:D,horizOriginY:D,id:null,ideographic:D,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:D,k:D,k1:D,k2:D,k3:D,k4:D,kernelMatrix:V,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:D,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:D,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:D,overlineThickness:D,paintOrder:null,panose1:null,path:null,pathLength:D,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:B,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:D,pointsAtY:D,pointsAtZ:D,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:V,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:V,rev:V,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:V,requiredFeatures:V,requiredFonts:V,requiredFormats:V,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:D,specularExponent:D,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:D,strikethroughThickness:D,string:null,stroke:null,strokeDashArray:V,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:D,strokeOpacity:D,strokeWidth:null,style:null,surfaceScale:D,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:V,tabIndex:D,tableValues:null,target:null,targetX:D,targetY:D,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:V,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:D,underlineThickness:D,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:D,values:null,vAlphabetic:D,vMathematical:D,vectorEffect:null,vHanging:D,vIdeographic:D,version:null,vertAdvY:D,vertOriginX:D,vertOriginY:D,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:D,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),G=merge([J,$,K,Y,X],"html"),ee=merge([J,$,K,Y,Z],"svg"),et=/^data[-\w.:]+$/i,en=/-[a-z]/g,er=/[A-Z]/g;function find(t,i){let o=normalize(i),a=i,s=Info;if(o in t.normal)return t.property[t.normal[o]];if(o.length>4&&"data"===o.slice(0,4)&&et.test(i)){if("-"===i.charAt(4)){let t=i.slice(5).replace(en,camelcase);a="data"+t.charAt(0).toUpperCase()+t.slice(1)}else{let t=i.slice(4);if(!en.test(t)){let o=t.replace(er,kebab);"-"!==o.charAt(0)&&(o="-"+o),i="data"+o}}s=DefinedInfo}return new s(a,i)}function kebab(t){return"-"+t.toLowerCase()}function camelcase(t){return t.charAt(1).toUpperCase()}let ei={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"};function space_separated_tokens_stringify(t){return t.join(" ").trim()}var eo=o(75406),ea=eo.default||eo;let el=point("end"),es=point("start");function point(t){return point;function point(i){let o=i&&i.position&&i.position[t]||{};if("number"==typeof o.line&&o.line>0&&"number"==typeof o.column&&o.column>0)return{line:o.line,column:o.column,offset:"number"==typeof o.offset&&o.offset>-1?o.offset:void 0}}}function position(t){let i=es(t),o=el(t);if(i&&o)return{start:i,end:o}}function stringifyPosition(t){return t&&"object"==typeof t?"position"in t||"type"in t?lib_position(t.position):"start"in t||"end"in t?lib_position(t):"line"in t||"column"in t?lib_point(t):"":""}function lib_point(t){return index(t&&t.line)+":"+index(t&&t.column)}function lib_position(t){return lib_point(t&&t.start)+"-"+lib_point(t&&t.end)}function index(t){return t&&"number"==typeof t?t:1}let VFileMessage=class VFileMessage extends Error{constructor(t,i,o){super(),"string"==typeof i&&(o=i,i=void 0);let a="",s={},c=!1;if(i&&(s="line"in i&&"column"in i?{place:i}:"start"in i&&"end"in i?{place:i}:"type"in i?{ancestors:[i],place:i.position}:{...i}),"string"==typeof t?a=t:!s.cause&&t&&(c=!0,a=t.message,s.cause=t),!s.ruleId&&!s.source&&"string"==typeof o){let t=o.indexOf(":");-1===t?s.ruleId=o:(s.source=o.slice(0,t),s.ruleId=o.slice(t+1))}if(!s.place&&s.ancestors&&s.ancestors){let t=s.ancestors[s.ancestors.length-1];t&&(s.place=t.position)}let k=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=k?k.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=k?k.line:void 0,this.name=stringifyPosition(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=c&&s.cause&&"string"==typeof s.cause.stack?s.cause.stack:"",this.actual,this.expected,this.note,this.url}};VFileMessage.prototype.file="",VFileMessage.prototype.name="",VFileMessage.prototype.reason="",VFileMessage.prototype.message="",VFileMessage.prototype.stack="",VFileMessage.prototype.column=void 0,VFileMessage.prototype.line=void 0,VFileMessage.prototype.ancestors=void 0,VFileMessage.prototype.cause=void 0,VFileMessage.prototype.fatal=void 0,VFileMessage.prototype.place=void 0,VFileMessage.prototype.ruleId=void 0,VFileMessage.prototype.source=void 0;let eu={}.hasOwnProperty,ec=new Map,ed=/[A-Z]/g,ef=/-([a-z])/g,ep=new Set(["table","tbody","thead","tfoot","tr"]),eh=new Set(["td","th"]),em="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function toJsxRuntime(t,i){let o;if(!i||void 0===i.Fragment)throw TypeError("Expected `Fragment` in options");let a=i.filePath||void 0;if(i.development){if("function"!=typeof i.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");o=developmentCreate(a,i.jsxDEV)}else{if("function"!=typeof i.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof i.jsxs)throw TypeError("Expected `jsxs` in production options");o=productionCreate(a,i.jsx,i.jsxs)}let s={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:o,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:!1!==i.passKeys,passNode:i.passNode||!1,schema:"svg"===i.space?ee:G,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==i.tableCellAlignToStyle},c=one(s,t,void 0);return c&&"string"!=typeof c?c:s.create(t,s.Fragment,{children:c||void 0},void 0)}function one(t,i,o){return"element"===i.type?lib_element(t,i,o):"mdxFlowExpression"===i.type||"mdxTextExpression"===i.type?mdxExpression(t,i):"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?mdxJsxElement(t,i,o):"mdxjsEsm"===i.type?mdxEsm(t,i):"root"===i.type?root(t,i,o):"text"===i.type?lib_text(t,i):void 0}function lib_element(t,i,o){let a=t.schema,s=a;"svg"===i.tagName.toLowerCase()&&"html"===a.space&&(s=ee,t.schema=s),t.ancestors.push(i);let c=findComponentFromName(t,i.tagName,!1),k=createElementProps(t,i),x=createChildren(t,i);return ep.has(i.tagName)&&(x=x.filter(function(t){return"string"!=typeof t||!whitespace(t)})),addNode(t,k,c,i),addChildren(k,x),t.ancestors.pop(),t.schema=a,t.create(i,c,k,o)}function mdxExpression(t,i){if(i.data&&i.data.estree&&t.evaluater){let o=i.data.estree,a=o.body[0];return a.type,t.evaluater.evaluateExpression(a.expression)}crashEstree(t,i.position)}function mdxEsm(t,i){if(i.data&&i.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(i.data.estree);crashEstree(t,i.position)}function mdxJsxElement(t,i,o){let a=t.schema,s=a;"svg"===i.name&&"html"===a.space&&(s=ee,t.schema=s),t.ancestors.push(i);let c=null===i.name?t.Fragment:findComponentFromName(t,i.name,!0),k=createJsxElementProps(t,i),x=createChildren(t,i);return addNode(t,k,c,i),addChildren(k,x),t.ancestors.pop(),t.schema=a,t.create(i,c,k,o)}function root(t,i,o){let a={};return addChildren(a,createChildren(t,i)),t.create(i,t.Fragment,a,o)}function lib_text(t,i){return i.value}function addNode(t,i,o,a){"string"!=typeof o&&o!==t.Fragment&&t.passNode&&(i.node=a)}function addChildren(t,i){if(i.length>0){let o=i.length>1?i:i[0];o&&(t.children=o)}}function productionCreate(t,i,o){return create;function create(t,a,s,c){let k=Array.isArray(s.children),x=k?o:i;return c?x(a,s,c):x(a,s)}}function developmentCreate(t,i){return create;function create(o,a,s,c){let k=Array.isArray(s.children),x=es(o);return i(a,s,c,k,{columnNumber:x?x.column-1:void 0,fileName:t,lineNumber:x?x.line:void 0},void 0)}}function createElementProps(t,i){let o,a;let s={};for(a in i.properties)if("children"!==a&&eu.call(i.properties,a)){let c=createProperty(t,a,i.properties[a]);if(c){let[a,k]=c;t.tableCellAlignToStyle&&"align"===a&&"string"==typeof k&&eh.has(i.tagName)?o=k:s[a]=k}}if(o){let i=s.style||(s.style={});i["css"===t.stylePropertyNameCase?"text-align":"textAlign"]=o}return s}function createJsxElementProps(t,i){let o={};for(let a of i.attributes)if("mdxJsxExpressionAttribute"===a.type){if(a.data&&a.data.estree&&t.evaluater){let i=a.data.estree,s=i.body[0];s.type;let c=s.expression;c.type;let k=c.properties[0];k.type,Object.assign(o,t.evaluater.evaluateExpression(k.argument))}else crashEstree(t,i.position)}else{let s;let c=a.name;if(a.value&&"object"==typeof a.value){if(a.value.data&&a.value.data.estree&&t.evaluater){let i=a.value.data.estree,o=i.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else crashEstree(t,i.position)}else s=null===a.value||a.value;o[c]=s}return o}function createChildren(t,i){let o=[],a=-1,s=t.passKeys?new Map:ec;for(;++ac?0:c+i:i>c?c:i,o=o>0?o:0,a.length<1e4)(s=Array.from(a)).unshift(i,o),t.splice(...s);else for(o&&t.splice(i,o);k0?(splice(t,t.length,0,i),t):i}let SpliceBuffer=class SpliceBuffer{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(t,i,o){let a=i||0;this.setCursor(Math.trunc(t));let s=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return o&&chunkedPush(this.left,o),s.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),chunkedPush(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),chunkedPush(this.right,t.reverse())}setCursor(t){if(t!==this.left.length&&(!(t>this.left.length)||0!==this.right.length)&&(!(t<0)||0!==this.left.length)){if(t-1&&t.test(String.fromCharCode(i))}}function factorySpace(t,i,o,a){let s=a?a-1:Number.POSITIVE_INFINITY,c=0;return start;function start(a){return markdownSpace(a)?(t.enter(o),prefix(a)):i(a)}function prefix(a){return markdownSpace(a)&&c++a))return;let x=s.events.length,w=x;for(;w--;)if("exit"===s.events[w][0]&&"chunkFlow"===s.events[w][1].type){if(t){o=s.events[w][1].end;break}t=!0}for(exitContainers(k),c=x;ci;){let i=c[o];s.containerState=i[1],i[0].exit.call(s,t)}c.length=i}function closeFlow(){i.write([null]),o=void 0,i=void 0,s.containerState._closeFlow=void 0}}function tokenizeContainer(t,i,o){return factorySpace(t,t.attempt(this.parser.constructs.document,i,o),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}let eO={partial:!0,tokenize:tokenizeBlankLine};function tokenizeBlankLine(t,i,o){return start;function start(i){return markdownSpace(i)?factorySpace(t,after,"linePrefix")(i):after(i)}function after(t){return null===t||markdownLineEnding(t)?i(t):o(t)}}let eP={resolve:resolveContent,tokenize:tokenizeContent},ez={partial:!0,tokenize:tokenizeContinuation};function resolveContent(t){return subtokenize(t),t}function tokenizeContent(t,i){let o;return chunkStart;function chunkStart(i){return t.enter("content"),o=t.enter("chunkContent",{contentType:"content"}),chunkInside(i)}function chunkInside(i){return null===i?contentEnd(i):markdownLineEnding(i)?t.check(ez,contentContinue,contentEnd)(i):(t.consume(i),chunkInside)}function contentEnd(o){return t.exit("chunkContent"),t.exit("content"),i(o)}function contentContinue(i){return t.consume(i),t.exit("chunkContent"),o.next=t.enter("chunkContent",{contentType:"content",previous:o}),o=o.next,chunkInside}}function tokenizeContinuation(t,i,o){let a=this;return startLookahead;function startLookahead(i){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),factorySpace(t,prefixed,"linePrefix")}function prefixed(s){if(null===s||markdownLineEnding(s))return o(s);let c=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&c&&"linePrefix"===c[1].type&&c[2].sliceSerialize(c[1],!0).length>=4?i(s):t.interrupt(a.parser.constructs.flow,o,i)(s)}}let eN={tokenize:initializeFlow};function initializeFlow(t){let i=this,o=t.attempt(eO,atBlankEnding,t.attempt(this.parser.constructs.flowInitial,afterConstruct,factorySpace(t,t.attempt(this.parser.constructs.flow,afterConstruct,t.attempt(eP,afterConstruct)),"linePrefix")));return o;function atBlankEnding(a){if(null===a){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),i.currentConstruct=void 0,o}function afterConstruct(a){if(null===a){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i.currentConstruct=void 0,o}}let eF={resolveAll:createResolver()},eR=initializeFactory("string"),eD=initializeFactory("text");function initializeFactory(t){return{resolveAll:createResolver("text"===t?resolveAllLineSuffixes:void 0),tokenize:initializeText};function initializeText(i){let o=this,a=this.parser.constructs[t],s=i.attempt(a,start,notText);return start;function start(t){return atBreak(t)?s(t):notText(t)}function notText(t){if(null===t){i.consume(t);return}return i.enter("data"),i.consume(t),data}function data(t){return atBreak(t)?(i.exit("data"),s(t)):(i.consume(t),data)}function atBreak(t){if(null===t)return!0;let i=a[t],s=-1;if(i)for(;++s=3&&(null===c||markdownLineEnding(c))?(t.exit("thematicBreak"),i(c)):o(c)}function sequence(i){return i===a?(t.consume(i),s++,sequence):(t.exit("thematicBreakSequence"),markdownSpace(i)?factorySpace(t,atBreak,"whitespace")(i):atBreak(i))}}let eM={continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd,name:"list",tokenize:tokenizeListStart},eU={partial:!0,tokenize:tokenizeListItemPrefixWhitespace},eV={partial:!0,tokenize:tokenizeIndent};function tokenizeListStart(t,i,o){let a=this,s=a.events[a.events.length-1],c=s&&"linePrefix"===s[1].type?s[2].sliceSerialize(s[1],!0).length:0,k=0;return start;function start(i){let s=a.containerState.type||(42===i||43===i||45===i?"listUnordered":"listOrdered");if("listUnordered"===s?!a.containerState.marker||i===a.containerState.marker:eS(i)){if(a.containerState.type||(a.containerState.type=s,t.enter(s,{_container:!0})),"listUnordered"===s)return t.enter("listItemPrefix"),42===i||45===i?t.check(eB,o,atMarker)(i):atMarker(i);if(!a.interrupt||49===i)return t.enter("listItemPrefix"),t.enter("listItemValue"),inside(i)}return o(i)}function inside(i){return eS(i)&&++k<10?(t.consume(i),inside):(!a.interrupt||k<2)&&(a.containerState.marker?i===a.containerState.marker:41===i||46===i)?(t.exit("listItemValue"),atMarker(i)):o(i)}function atMarker(i){return t.enter("listItemMarker"),t.consume(i),t.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||i,t.check(eO,a.interrupt?o:onBlank,t.attempt(eU,endOfPrefix,otherPrefix))}function onBlank(t){return a.containerState.initialBlankLine=!0,c++,endOfPrefix(t)}function otherPrefix(i){return markdownSpace(i)?(t.enter("listItemPrefixWhitespace"),t.consume(i),t.exit("listItemPrefixWhitespace"),endOfPrefix):o(i)}function endOfPrefix(o){return a.containerState.size=c+a.sliceSerialize(t.exit("listItemPrefix"),!0).length,i(o)}}function tokenizeListContinuation(t,i,o){let a=this;return a.containerState._closeFlow=void 0,t.check(eO,onBlank,notBlank);function onBlank(o){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,factorySpace(t,i,"listItemIndent",a.containerState.size+1)(o)}function notBlank(o){return a.containerState.furtherBlankLines||!markdownSpace(o)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,notInCurrentItem(o)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,t.attempt(eV,i,notInCurrentItem)(o))}function notInCurrentItem(s){return a.containerState._closeFlow=!0,a.interrupt=void 0,factorySpace(t,t.attempt(eM,i,o),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function tokenizeIndent(t,i,o){let a=this;return factorySpace(t,afterPrefix,"listItemIndent",a.containerState.size+1);function afterPrefix(t){let s=a.events[a.events.length-1];return s&&"listItemIndent"===s[1].type&&s[2].sliceSerialize(s[1],!0).length===a.containerState.size?i(t):o(t)}}function tokenizeListEnd(t){t.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(t,i,o){let a=this;return factorySpace(t,afterPrefix,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function afterPrefix(t){let s=a.events[a.events.length-1];return!markdownSpace(t)&&s&&"listItemPrefixWhitespace"===s[1].type?i(t):o(t)}}let ej={continuation:{tokenize:tokenizeBlockQuoteContinuation},exit,name:"blockQuote",tokenize:tokenizeBlockQuoteStart};function tokenizeBlockQuoteStart(t,i,o){let a=this;return start;function start(i){if(62===i){let o=a.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(i),t.exit("blockQuoteMarker"),after}return o(i)}function after(o){return markdownSpace(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),i):(t.exit("blockQuotePrefix"),i(o))}}function tokenizeBlockQuoteContinuation(t,i,o){let a=this;return contStart;function contStart(i){return markdownSpace(i)?factorySpace(t,contBefore,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):contBefore(i)}function contBefore(a){return t.attempt(ej,i,o)(a)}}function exit(t){t.exit("blockQuote")}function factoryDestination(t,i,o,a,s,c,k,x,w){let A=w||Number.POSITIVE_INFINITY,P=0;return start;function start(i){return 60===i?(t.enter(a),t.enter(s),t.enter(c),t.consume(i),t.exit(c),enclosedBefore):null===i||32===i||41===i||asciiControl(i)?o(i):(t.enter(a),t.enter(k),t.enter(x),t.enter("chunkString",{contentType:"string"}),raw(i))}function enclosedBefore(o){return 62===o?(t.enter(c),t.consume(o),t.exit(c),t.exit(s),t.exit(a),i):(t.enter(x),t.enter("chunkString",{contentType:"string"}),enclosed(o))}function enclosed(i){return 62===i?(t.exit("chunkString"),t.exit(x),enclosedBefore(i)):null===i||60===i||markdownLineEnding(i)?o(i):(t.consume(i),92===i?enclosedEscape:enclosed)}function enclosedEscape(i){return 60===i||62===i||92===i?(t.consume(i),enclosed):enclosed(i)}function raw(s){return!P&&(null===s||41===s||markdownLineEndingOrSpace(s))?(t.exit("chunkString"),t.exit(x),t.exit(k),t.exit(a),i(s)):P999||null===A||91===A||93===A&&!k||94===A&&!w&&"_hiddenFootnoteSupport"in x.parser.constructs?o(A):93===A?(t.exit(c),t.enter(s),t.consume(A),t.exit(s),t.exit(a),i):markdownLineEnding(A)?(t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),atBreak):(t.enter("chunkString",{contentType:"string"}),labelInside(A))}function labelInside(i){return null===i||91===i||93===i||markdownLineEnding(i)||w++>999?(t.exit("chunkString"),atBreak(i)):(t.consume(i),k||(k=!markdownSpace(i)),92===i?labelEscape:labelInside)}function labelEscape(i){return 91===i||92===i||93===i?(t.consume(i),w++,labelInside):labelInside(i)}}function factoryTitle(t,i,o,a,s,c){let k;return start;function start(i){return 34===i||39===i||40===i?(t.enter(a),t.enter(s),t.consume(i),t.exit(s),k=40===i?41:i,begin):o(i)}function begin(o){return o===k?(t.enter(s),t.consume(o),t.exit(s),t.exit(a),i):(t.enter(c),atBreak(o))}function atBreak(i){return i===k?(t.exit(c),begin(k)):null===i?o(i):markdownLineEnding(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),factorySpace(t,atBreak,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),inside(i))}function inside(i){return i===k||null===i||markdownLineEnding(i)?(t.exit("chunkString"),atBreak(i)):(t.consume(i),92===i?escape:inside)}function escape(i){return i===k||92===i?(t.consume(i),inside):inside(i)}}function factoryWhitespace(t,i){let o;return start;function start(a){return markdownLineEnding(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o=!0,start):markdownSpace(a)?factorySpace(t,start,o?"linePrefix":"lineSuffix")(a):i(a)}}function normalizeIdentifier(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let eH={partial:!0,tokenize:tokenizeTitleBefore};function tokenizeDefinition(t,i,o){let a;let s=this;return start;function start(i){return t.enter("definition"),before(i)}function before(i){return factoryLabel.call(s,t,labelAfter,o,"definitionLabel","definitionLabelMarker","definitionLabelString")(i)}function labelAfter(i){return(a=normalizeIdentifier(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),58===i)?(t.enter("definitionMarker"),t.consume(i),t.exit("definitionMarker"),markerAfter):o(i)}function markerAfter(i){return markdownLineEndingOrSpace(i)?factoryWhitespace(t,destinationBefore)(i):destinationBefore(i)}function destinationBefore(i){return factoryDestination(t,destinationAfter,o,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(i)}function destinationAfter(i){return t.attempt(eH,after,after)(i)}function after(i){return markdownSpace(i)?factorySpace(t,afterWhitespace,"whitespace")(i):afterWhitespace(i)}function afterWhitespace(c){return null===c||markdownLineEnding(c)?(t.exit("definition"),s.parser.defined.push(a),i(c)):o(c)}}function tokenizeTitleBefore(t,i,o){return titleBefore;function titleBefore(i){return markdownLineEndingOrSpace(i)?factoryWhitespace(t,beforeMarker)(i):o(i)}function beforeMarker(i){return factoryTitle(t,titleAfter,o,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function titleAfter(i){return markdownSpace(i)?factorySpace(t,titleAfterOptionalWhitespace,"whitespace")(i):titleAfterOptionalWhitespace(i)}function titleAfterOptionalWhitespace(t){return null===t||markdownLineEnding(t)?i(t):o(t)}}let eq={name:"codeIndented",tokenize:tokenizeCodeIndented},eQ={partial:!0,tokenize:tokenizeFurtherStart};function tokenizeCodeIndented(t,i,o){let a=this;return start;function start(i){return t.enter("codeIndented"),factorySpace(t,afterPrefix,"linePrefix",5)(i)}function afterPrefix(t){let i=a.events[a.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?atBreak(t):o(t)}function atBreak(i){return null===i?after(i):markdownLineEnding(i)?t.attempt(eQ,atBreak,after)(i):(t.enter("codeFlowValue"),inside(i))}function inside(i){return null===i||markdownLineEnding(i)?(t.exit("codeFlowValue"),atBreak(i)):(t.consume(i),inside)}function after(o){return t.exit("codeIndented"),i(o)}}function tokenizeFurtherStart(t,i,o){let a=this;return furtherStart;function furtherStart(i){return a.parser.lazy[a.now().line]?o(i):markdownLineEnding(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),furtherStart):factorySpace(t,afterPrefix,"linePrefix",5)(i)}function afterPrefix(t){let s=a.events[a.events.length-1];return s&&"linePrefix"===s[1].type&&s[2].sliceSerialize(s[1],!0).length>=4?i(t):markdownLineEnding(t)?furtherStart(t):o(t)}}function resolveHeadingAtx(t,i){let o,a,s=t.length-2,c=3;return"whitespace"===t[3][1].type&&(c+=2),s-2>c&&"whitespace"===t[s][1].type&&(s-=2),"atxHeadingSequence"===t[s][1].type&&(c===s-1||s-4>c&&"whitespace"===t[s-2][1].type)&&(s-=c+1===s?2:4),s>c&&(o={type:"atxHeadingText",start:t[c][1].start,end:t[s][1].end},a={type:"chunkText",start:t[c][1].start,end:t[s][1].end,contentType:"text"},splice(t,c,s-c+1,[["enter",o,i],["enter",a,i],["exit",a,i],["exit",o,i]])),t}function tokenizeHeadingAtx(t,i,o){let a=0;return start;function start(i){return t.enter("atxHeading"),before(i)}function before(i){return t.enter("atxHeadingSequence"),sequenceOpen(i)}function sequenceOpen(i){return 35===i&&a++<6?(t.consume(i),sequenceOpen):null===i||markdownLineEndingOrSpace(i)?(t.exit("atxHeadingSequence"),atBreak(i)):o(i)}function atBreak(o){return 35===o?(t.enter("atxHeadingSequence"),sequenceFurther(o)):null===o||markdownLineEnding(o)?(t.exit("atxHeading"),i(o)):markdownSpace(o)?factorySpace(t,atBreak,"whitespace")(o):(t.enter("atxHeadingText"),data(o))}function sequenceFurther(i){return 35===i?(t.consume(i),sequenceFurther):(t.exit("atxHeadingSequence"),atBreak(i))}function data(i){return null===i||35===i||markdownLineEndingOrSpace(i)?(t.exit("atxHeadingText"),atBreak(i)):(t.consume(i),data)}}let eW={name:"setextUnderline",resolveTo:resolveToSetextUnderline,tokenize:tokenizeSetextUnderline};function resolveToSetextUnderline(t,i){let o,a,s,c=t.length;for(;c--;)if("enter"===t[c][0]){if("content"===t[c][1].type){o=c;break}"paragraph"===t[c][1].type&&(a=c)}else"content"===t[c][1].type&&t.splice(c,1),s||"definition"!==t[c][1].type||(s=c);let k={type:"setextHeading",start:{...t[a][1].start},end:{...t[t.length-1][1].end}};return t[a][1].type="setextHeadingText",s?(t.splice(a,0,["enter",k,i]),t.splice(s+1,0,["exit",t[o][1],i]),t[o][1].end={...t[s][1].end}):t[o][1]=k,t.push(["exit",k,i]),t}function tokenizeSetextUnderline(t,i,o){let a;let s=this;return start;function start(i){let c,k=s.events.length;for(;k--;)if("lineEnding"!==s.events[k][1].type&&"linePrefix"!==s.events[k][1].type&&"content"!==s.events[k][1].type){c="paragraph"===s.events[k][1].type;break}return!s.parser.lazy[s.now().line]&&(s.interrupt||c)?(t.enter("setextHeadingLine"),a=i,before(i)):o(i)}function before(i){return t.enter("setextHeadingLineSequence"),inside(i)}function inside(i){return i===a?(t.consume(i),inside):(t.exit("setextHeadingLineSequence"),markdownSpace(i)?factorySpace(t,after,"lineSuffix")(i):after(i))}function after(a){return null===a||markdownLineEnding(a)?(t.exit("setextHeadingLine"),i(a)):o(a)}}let e$=["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"],eJ=["pre","script","style","textarea"],eK={partial:!0,tokenize:tokenizeBlankLineBefore},eY={partial:!0,tokenize:tokenizeNonLazyContinuationStart};function resolveToHtmlFlow(t){let i=t.length;for(;i--&&("enter"!==t[i][0]||"htmlFlow"!==t[i][1].type););return i>1&&"linePrefix"===t[i-2][1].type&&(t[i][1].start=t[i-2][1].start,t[i+1][1].start=t[i-2][1].start,t.splice(i-2,2)),t}function tokenizeHtmlFlow(t,i,o){let a,s,c,k,x;let w=this;return start;function start(t){return before(t)}function before(i){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(i),open}function open(k){return 33===k?(t.consume(k),declarationOpen):47===k?(t.consume(k),s=!0,tagCloseStart):63===k?(t.consume(k),a=3,w.interrupt?i:continuationDeclarationInside):ev(k)?(t.consume(k),c=String.fromCharCode(k),tagName):o(k)}function declarationOpen(s){return 45===s?(t.consume(s),a=2,commentOpenInside):91===s?(t.consume(s),a=5,k=0,cdataOpenInside):ev(s)?(t.consume(s),a=4,w.interrupt?i:continuationDeclarationInside):o(s)}function commentOpenInside(a){return 45===a?(t.consume(a),w.interrupt?i:continuationDeclarationInside):o(a)}function cdataOpenInside(a){let s="CDATA[";return a===s.charCodeAt(k++)?(t.consume(a),k===s.length)?w.interrupt?i:continuation:cdataOpenInside:o(a)}function tagCloseStart(i){return ev(i)?(t.consume(i),c=String.fromCharCode(i),tagName):o(i)}function tagName(k){if(null===k||47===k||62===k||markdownLineEndingOrSpace(k)){let x=47===k,A=c.toLowerCase();return!x&&!s&&eJ.includes(A)?(a=1,w.interrupt?i(k):continuation(k)):e$.includes(c.toLowerCase())?(a=6,x)?(t.consume(k),basicSelfClosing):w.interrupt?i(k):continuation(k):(a=7,w.interrupt&&!w.parser.lazy[w.now().line]?o(k):s?completeClosingTagAfter(k):completeAttributeNameBefore(k))}return 45===k||eb(k)?(t.consume(k),c+=String.fromCharCode(k),tagName):o(k)}function basicSelfClosing(a){return 62===a?(t.consume(a),w.interrupt?i:continuation):o(a)}function completeClosingTagAfter(i){return markdownSpace(i)?(t.consume(i),completeClosingTagAfter):completeEnd(i)}function completeAttributeNameBefore(i){return 47===i?(t.consume(i),completeEnd):58===i||95===i||ev(i)?(t.consume(i),completeAttributeName):markdownSpace(i)?(t.consume(i),completeAttributeNameBefore):completeEnd(i)}function completeAttributeName(i){return 45===i||46===i||58===i||95===i||eb(i)?(t.consume(i),completeAttributeName):completeAttributeNameAfter(i)}function completeAttributeNameAfter(i){return 61===i?(t.consume(i),completeAttributeValueBefore):markdownSpace(i)?(t.consume(i),completeAttributeNameAfter):completeAttributeNameBefore(i)}function completeAttributeValueBefore(i){return null===i||60===i||61===i||62===i||96===i?o(i):34===i||39===i?(t.consume(i),x=i,completeAttributeValueQuoted):markdownSpace(i)?(t.consume(i),completeAttributeValueBefore):completeAttributeValueUnquoted(i)}function completeAttributeValueQuoted(i){return i===x?(t.consume(i),x=null,completeAttributeValueQuotedAfter):null===i||markdownLineEnding(i)?o(i):(t.consume(i),completeAttributeValueQuoted)}function completeAttributeValueUnquoted(i){return null===i||34===i||39===i||47===i||60===i||61===i||62===i||96===i||markdownLineEndingOrSpace(i)?completeAttributeNameAfter(i):(t.consume(i),completeAttributeValueUnquoted)}function completeAttributeValueQuotedAfter(t){return 47===t||62===t||markdownSpace(t)?completeAttributeNameBefore(t):o(t)}function completeEnd(i){return 62===i?(t.consume(i),completeAfter):o(i)}function completeAfter(i){return null===i||markdownLineEnding(i)?continuation(i):markdownSpace(i)?(t.consume(i),completeAfter):o(i)}function continuation(i){return 45===i&&2===a?(t.consume(i),continuationCommentInside):60===i&&1===a?(t.consume(i),continuationRawTagOpen):62===i&&4===a?(t.consume(i),continuationClose):63===i&&3===a?(t.consume(i),continuationDeclarationInside):93===i&&5===a?(t.consume(i),continuationCdataInside):markdownLineEnding(i)&&(6===a||7===a)?(t.exit("htmlFlowData"),t.check(eK,continuationAfter,continuationStart)(i)):null===i||markdownLineEnding(i)?(t.exit("htmlFlowData"),continuationStart(i)):(t.consume(i),continuation)}function continuationStart(i){return t.check(eY,continuationStartNonLazy,continuationAfter)(i)}function continuationStartNonLazy(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),continuationBefore}function continuationBefore(i){return null===i||markdownLineEnding(i)?continuationStart(i):(t.enter("htmlFlowData"),continuation(i))}function continuationCommentInside(i){return 45===i?(t.consume(i),continuationDeclarationInside):continuation(i)}function continuationRawTagOpen(i){return 47===i?(t.consume(i),c="",continuationRawEndTag):continuation(i)}function continuationRawEndTag(i){if(62===i){let o=c.toLowerCase();return eJ.includes(o)?(t.consume(i),continuationClose):continuation(i)}return ev(i)&&c.length<8?(t.consume(i),c+=String.fromCharCode(i),continuationRawEndTag):continuation(i)}function continuationCdataInside(i){return 93===i?(t.consume(i),continuationDeclarationInside):continuation(i)}function continuationDeclarationInside(i){return 62===i?(t.consume(i),continuationClose):45===i&&2===a?(t.consume(i),continuationDeclarationInside):continuation(i)}function continuationClose(i){return null===i||markdownLineEnding(i)?(t.exit("htmlFlowData"),continuationAfter(i)):(t.consume(i),continuationClose)}function continuationAfter(o){return t.exit("htmlFlow"),i(o)}}function tokenizeNonLazyContinuationStart(t,i,o){let a=this;return start;function start(i){return markdownLineEnding(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),after):o(i)}function after(t){return a.parser.lazy[a.now().line]?o(t):i(t)}}function tokenizeBlankLineBefore(t,i,o){return start;function start(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),t.attempt(eO,i,o)}}let eX={partial:!0,tokenize:tokenizeNonLazyContinuation},eZ={concrete:!0,name:"codeFenced",tokenize:tokenizeCodeFenced};function tokenizeCodeFenced(t,i,o){let a;let s=this,c={partial:!0,tokenize:tokenizeCloseStart},k=0,x=0;return start;function start(t){return beforeSequenceOpen(t)}function beforeSequenceOpen(i){let o=s.events[s.events.length-1];return k=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=i,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),sequenceOpen(i)}function sequenceOpen(i){return i===a?(x++,t.consume(i),sequenceOpen):x<3?o(i):(t.exit("codeFencedFenceSequence"),markdownSpace(i)?factorySpace(t,infoBefore,"whitespace")(i):infoBefore(i))}function infoBefore(o){return null===o||markdownLineEnding(o)?(t.exit("codeFencedFence"),s.interrupt?i(o):t.check(eX,atNonLazyBreak,after)(o)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),info(o))}function info(i){return null===i||markdownLineEnding(i)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),infoBefore(i)):markdownSpace(i)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),factorySpace(t,metaBefore,"whitespace")(i)):96===i&&i===a?o(i):(t.consume(i),info)}function metaBefore(i){return null===i||markdownLineEnding(i)?infoBefore(i):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),meta(i))}function meta(i){return null===i||markdownLineEnding(i)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),infoBefore(i)):96===i&&i===a?o(i):(t.consume(i),meta)}function atNonLazyBreak(i){return t.attempt(c,after,contentBefore)(i)}function contentBefore(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),contentStart}function contentStart(i){return k>0&&markdownSpace(i)?factorySpace(t,beforeContentChunk,"linePrefix",k+1)(i):beforeContentChunk(i)}function beforeContentChunk(i){return null===i||markdownLineEnding(i)?t.check(eX,atNonLazyBreak,after)(i):(t.enter("codeFlowValue"),contentChunk(i))}function contentChunk(i){return null===i||markdownLineEnding(i)?(t.exit("codeFlowValue"),beforeContentChunk(i)):(t.consume(i),contentChunk)}function after(o){return t.exit("codeFenced"),i(o)}function tokenizeCloseStart(t,i,o){let c=0;return startBefore;function startBefore(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),start}function start(i){return t.enter("codeFencedFence"),markdownSpace(i)?factorySpace(t,beforeSequenceClose,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):beforeSequenceClose(i)}function beforeSequenceClose(i){return i===a?(t.enter("codeFencedFenceSequence"),sequenceClose(i)):o(i)}function sequenceClose(i){return i===a?(c++,t.consume(i),sequenceClose):c>=x?(t.exit("codeFencedFenceSequence"),markdownSpace(i)?factorySpace(t,sequenceCloseAfter,"whitespace")(i):sequenceCloseAfter(i)):o(i)}function sequenceCloseAfter(a){return null===a||markdownLineEnding(a)?(t.exit("codeFencedFence"),i(a)):o(a)}}}function tokenizeNonLazyContinuation(t,i,o){let a=this;return start;function start(i){return null===i?o(i):(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),lineStart)}function lineStart(t){return a.parser.lazy[a.now().line]?o(t):i(t)}}let eG=document.createElement("i");function decodeNamedCharacterReference(t){let i="&"+t+";";eG.innerHTML=i;let o=eG.textContent;return(59!==o.charCodeAt(o.length-1)||"semi"===t)&&o!==i&&o}let e1={name:"characterReference",tokenize:tokenizeCharacterReference};function tokenizeCharacterReference(t,i,o){let a,s;let c=this,k=0;return start;function start(i){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(i),t.exit("characterReferenceMarker"),open}function open(i){return 35===i?(t.enter("characterReferenceMarkerNumeric"),t.consume(i),t.exit("characterReferenceMarkerNumeric"),numeric):(t.enter("characterReferenceValue"),a=31,s=eb,value(i))}function numeric(i){return 88===i||120===i?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(i),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,s=eC,value):(t.enter("characterReferenceValue"),a=7,s=eS,value(i))}function value(x){if(59===x&&k){let a=t.exit("characterReferenceValue");return s!==eb||decodeNamedCharacterReference(c.sliceSerialize(a))?(t.enter("characterReferenceMarker"),t.consume(x),t.exit("characterReferenceMarker"),t.exit("characterReference"),i):o(x)}return s(x)&&k++1&&t[P][1].end.offset-t[P][1].start.offset>1?2:1;let z={...t[o][1].end},R={...t[P][1].start};movePoint(z,-x),movePoint(R,x),c={type:x>1?"strongSequence":"emphasisSequence",start:z,end:{...t[o][1].end}},k={type:x>1?"strongSequence":"emphasisSequence",start:{...t[P][1].start},end:R},s={type:x>1?"strongText":"emphasisText",start:{...t[o][1].end},end:{...t[P][1].start}},a={type:x>1?"strong":"emphasis",start:{...c.start},end:{...k.end}},t[o][1].end={...c.start},t[P][1].start={...k.end},w=[],t[o][1].end.offset-t[o][1].start.offset&&(w=push(w,[["enter",t[o][1],i],["exit",t[o][1],i]])),w=push(w,[["enter",a,i],["enter",c,i],["exit",c,i],["enter",s,i]]),w=push(w,resolveAll(i.parser.constructs.insideSpan.null,t.slice(o+1,P),i)),w=push(w,[["exit",s,i],["enter",k,i],["exit",k,i],["exit",a,i]]),t[P][1].end.offset-t[P][1].start.offset?(A=2,w=push(w,[["enter",t[P][1],i],["exit",t[P][1],i]])):A=0,splice(t,o-1,P-o+3,w),P=o+w.length-A-2;break}}for(P=-1;++P-1){let t=o[0];"string"==typeof t?o[0]=t.slice(s):o.shift()}k>0&&o.push(t[c].slice(0,k))}return o}function serializeChunks(t,i){let o,a=-1,s=[];for(;++a13&&o<32||o>126&&o<160||o>55295&&o<57344||o>64975&&o<65008||(65535&o)==65535||(65535&o)==65534||o>1114111?"�":String.fromCodePoint(o)}let tc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function decodeString(t){return t.replace(tc,decode)}function decode(t,i,o){if(i)return i;let a=o.charCodeAt(0);if(35===a){let t=o.charCodeAt(1),i=120===t||88===t;return decodeNumericCharacterReference(o.slice(i?2:1),i?16:10)}return decodeNamedCharacterReference(o)||t}let td={}.hasOwnProperty;function fromMarkdown(t,i,o){return"string"!=typeof i&&(o=i,i=void 0),compiler(o)(postprocess(parse_parse(o).document().write(preprocess()(t,i,!0))))}function compiler(t){let i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:opener(link),autolinkProtocol:onenterdata,autolinkEmail:onenterdata,atxHeading:opener(heading),blockQuote:opener(blockQuote),characterEscape:onenterdata,characterReference:onenterdata,codeFenced:opener(codeFlow),codeFencedFenceInfo:buffer,codeFencedFenceMeta:buffer,codeIndented:opener(codeFlow,buffer),codeText:opener(codeText,buffer),codeTextData:onenterdata,data:onenterdata,codeFlowValue:onenterdata,definition:opener(definition),definitionDestinationString:buffer,definitionLabelString:buffer,definitionTitleString:buffer,emphasis:opener(emphasis),hardBreakEscape:opener(hardBreak),hardBreakTrailing:opener(hardBreak),htmlFlow:opener(html,buffer),htmlFlowData:onenterdata,htmlText:opener(html,buffer),htmlTextData:onenterdata,image:opener(image),label:buffer,link:opener(link),listItem:opener(listItem),listItemValue:onenterlistitemvalue,listOrdered:opener(list,onenterlistordered),listUnordered:opener(list),paragraph:opener(paragraph),reference:onenterreference,referenceString:buffer,resourceDestinationString:buffer,resourceTitleString:buffer,setextHeading:opener(heading),strong:opener(strong),thematicBreak:opener(thematicBreak)},exit:{atxHeading:closer(),atxHeadingSequence:onexitatxheadingsequence,autolink:closer(),autolinkEmail:onexitautolinkemail,autolinkProtocol:onexitautolinkprotocol,blockQuote:closer(),characterEscapeValue:onexitdata,characterReferenceMarkerHexadecimal:onexitcharacterreferencemarker,characterReferenceMarkerNumeric:onexitcharacterreferencemarker,characterReferenceValue:onexitcharacterreferencevalue,characterReference:onexitcharacterreference,codeFenced:closer(onexitcodefenced),codeFencedFence:onexitcodefencedfence,codeFencedFenceInfo:onexitcodefencedfenceinfo,codeFencedFenceMeta:onexitcodefencedfencemeta,codeFlowValue:onexitdata,codeIndented:closer(onexitcodeindented),codeText:closer(onexitcodetext),codeTextData:onexitdata,data:onexitdata,definition:closer(),definitionDestinationString:onexitdefinitiondestinationstring,definitionLabelString:onexitdefinitionlabelstring,definitionTitleString:onexitdefinitiontitlestring,emphasis:closer(),hardBreakEscape:closer(onexithardbreak),hardBreakTrailing:closer(onexithardbreak),htmlFlow:closer(onexithtmlflow),htmlFlowData:onexitdata,htmlText:closer(onexithtmltext),htmlTextData:onexitdata,image:closer(onexitimage),label:onexitlabel,labelText:onexitlabeltext,lineEnding:onexitlineending,link:closer(onexitlink),listItem:closer(),listOrdered:closer(),listUnordered:closer(),paragraph:closer(),referenceString:onexitreferencestring,resourceDestinationString:onexitresourcedestinationstring,resourceTitleString:onexitresourcetitlestring,resource:onexitresource,setextHeading:closer(onexitsetextheading),setextHeadingLineSequence:onexitsetextheadinglinesequence,setextHeadingText:onexitsetextheadingtext,strong:closer(),thematicBreak:closer()}};configure(i,(t||{}).mdastExtensions||[]);let o={};return compile;function compile(t){let a={type:"root",children:[]},s={stack:[a],tokenStack:[],config:i,enter,exit,buffer,resume,data:o},c=[],k=-1;for(;++k0){let t=s.tokenStack[s.tokenStack.length-1],i=t[1]||defaultOnError;i.call(s,void 0,t[0])}for(a.position={start:mdast_util_from_markdown_lib_point(t.length>0?t[0][1].start:{line:1,column:1,offset:0}),end:mdast_util_from_markdown_lib_point(t.length>0?t[t.length-2][1].end:{line:1,column:1,offset:0})},k=-1;++k{let as=(i,o)=>(t.set(o,i),i),unpair=o=>{if(t.has(o))return t.get(o);let[a,s]=i[o];switch(a){case 0:case -1:return as(s,o);case 1:{let t=as([],o);for(let i of s)t.push(unpair(i));return t}case 2:{let t=as({},o);for(let[i,o]of s)t[unpair(i)]=unpair(o);return t}case 3:return as(new Date(s),o);case 4:{let{source:t,flags:i}=s;return as(new RegExp(t,i),o)}case 5:{let t=as(new Map,o);for(let[i,o]of s)t.set(unpair(i),unpair(o));return t}case 6:{let t=as(new Set,o);for(let i of s)t.add(unpair(i));return t}case 7:{let{name:t,message:i}=s;return as(new tf[t](i),o)}case 8:return as(BigInt(s),o);case"BigInt":return as(Object(BigInt(s)),o)}return as(new tf[a](s),o)};return unpair},deserialize=t=>deserializer(new Map,t)(0),{toString:tp}={},{keys:th}=Object,typeOf=t=>{let i=typeof t;if("object"!==i||!t)return[0,i];let o=tp.call(t).slice(8,-1);switch(o){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""]}return o.includes("Array")?[1,o]:o.includes("Error")?[7,o]:[2,o]},shouldSkip=([t,i])=>0===t&&("function"===i||"symbol"===i),serializer=(t,i,o,a)=>{let as=(t,i)=>{let s=a.push(t)-1;return o.set(i,s),s},pair=a=>{if(o.has(a))return o.get(a);let[s,c]=typeOf(a);switch(s){case 0:{let i=a;switch(c){case"bigint":s=8,i=a.toString();break;case"function":case"symbol":if(t)throw TypeError("unable to serialize "+c);i=null;break;case"undefined":return as([-1],a)}return as([s,i],a)}case 1:{if(c)return as([c,[...a]],a);let t=[],i=as([s,t],a);for(let i of a)t.push(pair(i));return i}case 2:{if(c)switch(c){case"BigInt":return as([c,a.toString()],a);case"Boolean":case"Number":case"String":return as([c,a.valueOf()],a)}if(i&&"toJSON"in a)return pair(a.toJSON());let o=[],k=as([s,o],a);for(let i of th(a))(t||!shouldSkip(typeOf(a[i])))&&o.push([pair(i),pair(a[i])]);return k}case 3:return as([s,a.toISOString()],a);case 4:{let{source:t,flags:i}=a;return as([s,{source:t,flags:i}],a)}case 5:{let i=[],o=as([s,i],a);for(let[o,s]of a)(t||!(shouldSkip(typeOf(o))||shouldSkip(typeOf(s))))&&i.push([pair(o),pair(s)]);return o}case 6:{let i=[],o=as([s,i],a);for(let o of a)(t||!shouldSkip(typeOf(o)))&&i.push(pair(o));return o}}let{message:k}=a;return as([s,{name:c,message:k}],a)};return pair},serialize=(t,{json:i,lossy:o}={})=>{let a=[];return serializer(!(i||o),!!i,new Map,a)(t),a};var tm="function"==typeof structuredClone?(t,i)=>i&&("json"in i||"lossy"in i)?deserialize(serialize(t,i)):structuredClone(t):(t,i)=>deserialize(serialize(t,i));function normalizeUri(t){let i=[],o=-1,a=0,s=0;for(;++o55295&&c<57344){let i=t.charCodeAt(o+1);c<56320&&i>56319&&i<57344?(k=String.fromCharCode(c,i),s=1):k="�"}else k=String.fromCharCode(c);k&&(i.push(t.slice(a,o),encodeURIComponent(k)),a=o+s+1,k=""),s&&(o+=s,s=0)}return i.join("")+t.slice(a)}function defaultFootnoteBackContent(t,i){let o=[{type:"text",value:"↩"}];return i>1&&o.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),o}function defaultFootnoteBackLabel(t,i){return"Back to reference "+(t+1)+(i>1?"-"+i:"")}function footer(t){let i="string"==typeof t.options.clobberPrefix?t.options.clobberPrefix:"user-content-",o=t.options.footnoteBackContent||defaultFootnoteBackContent,a=t.options.footnoteBackLabel||defaultFootnoteBackLabel,s=t.options.footnoteLabel||"Footnotes",c=t.options.footnoteLabelTagName||"h2",k=t.options.footnoteLabelProperties||{className:["sr-only"]},x=[],w=-1;for(;++w0&&z.push({type:"text",value:" "});let t="string"==typeof o?o:o(w,P);"string"==typeof t&&(t={type:"text",value:t}),z.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+A+(P>1?"-"+P:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof a?a:a(w,P),className:["data-footnote-backref"]},children:Array.isArray(t)?t:[t]})}let D=c[c.length-1];if(D&&"element"===D.type&&"p"===D.tagName){let t=D.children[D.children.length-1];t&&"text"===t.type?t.value+=" ":D.children.push({type:"text",value:" "}),D.children.push(...z)}else c.push(...z);let B={type:"element",tagName:"li",properties:{id:i+"fn-"+A},children:t.wrap(c,!0)};t.patch(s,B),x.push(B)}if(0!==x.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...tm(k),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:t.wrap(x,!0)},{type:"text",value:"\n"}]}}let convert=function(t){if(null==t)return lib_ok;if("function"==typeof t)return castFactory(t);if("object"==typeof t)return Array.isArray(t)?anyFactory(t):propsFactory(t);if("string"==typeof t)return typeFactory(t);throw Error("Expected function, string, or object as test")};function anyFactory(t){let i=[],o=-1;for(;++o":""))+")"})}return visit;function visit(){let w,A,P,z=tg;if((!i||c(t,s,x[x.length-1]||void 0))&&!1===(z=toResult(o(t,x)))[0])return z;if("children"in t&&t.children&&t.children&&"skip"!==z[0])for(A=(a?t.children.length:-1)+k,P=x.concat(t);A>-1&&A1?"-"+x:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(i,w);let A={type:"element",tagName:"sup",properties:{},children:[w]};return t.patch(i,A),t.applyData(i,A)}function heading(t,i){let o={type:"element",tagName:"h"+i.depth,properties:{},children:t.all(i)};return t.patch(i,o),t.applyData(i,o)}function html_html(t,i){if(t.options.allowDangerousHtml){let o={type:"raw",value:i.value};return t.patch(i,o),t.applyData(i,o)}}function revert(t,i){let o=i.referenceType,a="]";if("collapsed"===o?a+="[]":"full"===o&&(a+="["+(i.label||i.identifier)+"]"),"imageReference"===i.type)return[{type:"text",value:"!["+i.alt+a}];let s=t.all(i),c=s[0];c&&"text"===c.type?c.value="["+c.value:s.unshift({type:"text",value:"["});let k=s[s.length-1];return k&&"text"===k.type?k.value+=a:s.push({type:"text",value:a}),s}function imageReference(t,i){let o=String(i.identifier).toUpperCase(),a=t.definitionById.get(o);if(!a)return revert(t,i);let s={src:normalizeUri(a.url||""),alt:i.alt};null!==a.title&&void 0!==a.title&&(s.title=a.title);let c={type:"element",tagName:"img",properties:s,children:[]};return t.patch(i,c),t.applyData(i,c)}function image_image(t,i){let o={src:normalizeUri(i.url)};null!==i.alt&&void 0!==i.alt&&(o.alt=i.alt),null!==i.title&&void 0!==i.title&&(o.title=i.title);let a={type:"element",tagName:"img",properties:o,children:[]};return t.patch(i,a),t.applyData(i,a)}function inlineCode(t,i){let o={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};t.patch(i,o);let a={type:"element",tagName:"code",properties:{},children:[o]};return t.patch(i,a),t.applyData(i,a)}function linkReference(t,i){let o=String(i.identifier).toUpperCase(),a=t.definitionById.get(o);if(!a)return revert(t,i);let s={href:normalizeUri(a.url||"")};null!==a.title&&void 0!==a.title&&(s.title=a.title);let c={type:"element",tagName:"a",properties:s,children:t.all(i)};return t.patch(i,c),t.applyData(i,c)}function link_link(t,i){let o={href:normalizeUri(i.url)};null!==i.title&&void 0!==i.title&&(o.title=i.title);let a={type:"element",tagName:"a",properties:o,children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function listItem(t,i,o){let a=t.all(i),s=o?listLoose(o):listItemLoose(i),c={},k=[];if("boolean"==typeof i.checked){let t;let o=a[0];o&&"element"===o.type&&"p"===o.tagName?t=o:(t={type:"element",tagName:"p",properties:{},children:[]},a.unshift(t)),t.children.length>0&&t.children.unshift({type:"text",value:" "}),t.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let x=-1;for(;++x1:i}function list_list(t,i){let o={},a=t.all(i),s=-1;for("number"==typeof i.start&&1!==i.start&&(o.start=i.start);++s0){let a={type:"element",tagName:"tbody",properties:{},children:t.wrap(o,!0)},c=es(i.children[1]),k=el(i.children[i.children.length-1]);c&&k&&(a.position={start:c,end:k}),s.push(a)}let c={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(i,c),t.applyData(i,c)}function tableRow(t,i,o){let a=o?o.children:void 0,s=a?a.indexOf(i):1,c=0===s?"th":"td",k=o&&"table"===o.type?o.align:void 0,x=k?k.length:i.children.length,w=-1,A=[];for(;++w0,!0),a[0]),s=a.index+a[0].length,a=o.exec(i);return c.push(trimLine(i.slice(s),s>0,!1)),c.join("")}function trimLine(t,i,o){let a=0,s=t.length;if(i){let i=t.codePointAt(a);for(;9===i||32===i;)a++,i=t.codePointAt(a)}if(o){let i=t.codePointAt(s-1);for(;9===i||32===i;)s--,i=t.codePointAt(s-1)}return s>a?t.slice(a,s):""}function handlers_text_text(t,i){let o={type:"text",value:trimLines(String(i.value))};return t.patch(i,o),t.applyData(i,o)}function thematic_break_thematicBreak(t,i){let o={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(i,o),t.applyData(i,o)}let ty={blockquote:blockquote,break:hardBreak,code:code,delete:strikethrough,emphasis:emphasis,footnoteReference:footnoteReference,heading:heading,html:html_html,imageReference:imageReference,image:image_image,inlineCode:inlineCode,linkReference:linkReference,link:link_link,listItem:listItem,list:list_list,paragraph:paragraph,root:root_root,strong:strong,table:table,tableCell:tableCell,tableRow:tableRow,text:handlers_text_text,thematicBreak:thematic_break_thematicBreak,toml:ignore,yaml:ignore,definition:ignore,footnoteDefinition:ignore};function ignore(){}let tk={}.hasOwnProperty,tx={};function createState(t,i){let o=i||tx,a=new Map,s=new Map,c=new Map,k={...ty,...o.handlers},x={all,applyData,definitionById:a,footnoteById:s,footnoteCounts:c,footnoteOrder:[],handlers:k,one,options:o,patch,wrap};return visit(t,function(t){if("definition"===t.type||"footnoteDefinition"===t.type){let i="definition"===t.type?a:s,o=String(t.identifier).toUpperCase();i.has(o)||i.set(o,t)}}),x;function one(t,i){let o=t.type,a=x.handlers[o];if(tk.call(x.handlers,o)&&a)return a(x,t,i);if(x.options.passThrough&&x.options.passThrough.includes(o)){if("children"in t){let{children:i,...o}=t,a=tm(o);return a.children=x.all(t),a}return tm(t)}let s=x.options.unknownHandler||defaultUnknownHandler;return s(x,t,i)}function all(t){let i=[];if("children"in t){let o=t.children,a=-1;for(;++a0&&o.push({type:"text",value:"\n"}),o}function trimMarkdownSpaceStart(t){let i=0,o=t.charCodeAt(i);for(;9===o||32===o;)i++,o=t.charCodeAt(i);return t.slice(i)}function toHast(t,i){let o=createState(t,i),a=o.one(t,void 0),s=footer(o),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&c.children.push({type:"text",value:"\n"},s),c}function remarkRehype(t,i){return t&&"run"in t?async function(o,a){let s=toHast(o,{file:a,...i});await t.run(s,a)}:function(o,a){return toHast(o,{file:a,...t||i})}}function bail(t){if(t)throw t}var tv=o(55379);function isPlainObject(t){if("object"!=typeof t||null===t)return!1;let i=Object.getPrototypeOf(t);return(null===i||i===Object.prototype||null===Object.getPrototypeOf(i))&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function trough(){let t=[],i={run,use};return i;function run(...i){let o=-1,a=i.pop();if("function"!=typeof a)throw TypeError("Expected function as last argument, not "+a);function next(s,...c){let k=t[++o],x=-1;if(s){a(s);return}for(;++xi.length;s&&i.push(done);try{a=t.apply(this,i)}catch(t){if(s&&o)throw t;return done(t)}s||(a&&a.then&&"function"==typeof a.then?a.then(then,done):a instanceof Error?done(a):then(a))}function done(t,...a){o||(o=!0,i(t,...a))}function then(t){done(null,t)}}let tb={basename,dirname,extname,join,sep:"/"};function basename(t,i){let o;if(void 0!==i&&"string"!=typeof i)throw TypeError('"ext" argument must be a string');assertPath(t);let a=0,s=-1,c=t.length;if(void 0===i||0===i.length||i.length>t.length){for(;c--;)if(47===t.codePointAt(c)){if(o){a=c+1;break}}else s<0&&(o=!0,s=c+1);return s<0?"":t.slice(a,s)}if(i===t)return"";let k=-1,x=i.length-1;for(;c--;)if(47===t.codePointAt(c)){if(o){a=c+1;break}}else k<0&&(o=!0,k=c+1),x>-1&&(t.codePointAt(c)===i.codePointAt(x--)?x<0&&(s=c):(x=-1,s=k));return a===s?s=k:s<0&&(s=t.length),t.slice(a,s)}function dirname(t){let i;if(assertPath(t),0===t.length)return".";let o=-1,a=t.length;for(;--a;)if(47===t.codePointAt(a)){if(i){o=a;break}}else i||(i=!0);return o<0?47===t.codePointAt(0)?"/":".":1===o&&47===t.codePointAt(0)?"//":t.slice(0,o)}function extname(t){let i;assertPath(t);let o=t.length,a=-1,s=0,c=-1,k=0;for(;o--;){let x=t.codePointAt(o);if(47===x){if(i){s=o+1;break}continue}a<0&&(i=!0,a=o+1),46===x?c<0?c=o:1!==k&&(k=1):c>-1&&(k=-1)}return c<0||a<0||0===k||1===k&&c===a-1&&c===s+1?"":t.slice(c,a)}function join(...t){let i,o=-1;for(;++o0&&47===t.codePointAt(t.length-1)&&(o+="/"),i?"/"+o:o}function normalizeString(t,i){let o,a,s="",c=0,k=-1,x=0,w=-1;for(;++w<=t.length;){if(w2){if((a=s.lastIndexOf("/"))!==s.length-1){a<0?(s="",c=0):c=(s=s.slice(0,a)).length-1-s.lastIndexOf("/"),k=w,x=0;continue}}else if(s.length>0){s="",c=0,k=w,x=0;continue}}i&&(s=s.length>0?s+"/..":"..",c=2)}else s.length>0?s+="/"+t.slice(k+1,w):s=t.slice(k+1,w),c=w-k-1;k=w,x=0}else 46===o&&x>-1?x++:x=-1}return s}function assertPath(t){if("string"!=typeof t)throw TypeError("Path must be a string. Received "+JSON.stringify(t))}let tw={cwd};function cwd(){return"/"}function isUrl(t){return!!(null!==t&&"object"==typeof t&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&void 0===t.auth)}function urlToPath(t){if("string"==typeof t)t=new URL(t);else if(!isUrl(t)){let i=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if("file:"!==t.protocol){let t=TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return getPathFromURLPosix(t)}function getPathFromURLPosix(t){if(""!==t.hostname){let t=TypeError('File URL host must be "localhost" or empty on darwin');throw t.code="ERR_INVALID_FILE_URL_HOST",t}let i=t.pathname,o=-1;for(;++o0){let[a,...c]=i,k=o[s][1];isPlainObject(k)&&isPlainObject(a)&&(a=tv(!0,k,a)),o[s]=[t,a,...c]}}}};let tE=new Processor().freeze();function assertParser(t,i){if("function"!=typeof i)throw TypeError("Cannot `"+t+"` without `parser`")}function assertCompiler(t,i){if("function"!=typeof i)throw TypeError("Cannot `"+t+"` without `compiler`")}function assertUnfrozen(t,i){if(i)throw Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(t){if(!isPlainObject(t)||"string"!=typeof t.type)throw TypeError("Expected node, got `"+t+"`")}function assertDone(t,i,o){if(!o)throw Error("`"+t+"` finished async. Use `"+i+"` instead")}function vfile(t){return looksLikeAVFile(t)?t:new VFile(t)}function looksLikeAVFile(t){return!!(t&&"object"==typeof t&&"message"in t&&"messages"in t)}function looksLikeAValue(t){return"string"==typeof t||lib_isUint8Array(t)}function lib_isUint8Array(t){return!!(t&&"object"==typeof t&&"byteLength"in t&&"byteOffset"in t)}let t_=[],tT={allowDangerousHtml:!0},tI=/^(https?|ircs?|mailto|xmpp)$/i,tA=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Markdown(t){let i=t.allowedElements,o=t.allowElement,a=t.children||"",s=t.className,c=t.components,k=t.disallowedElements,x=t.rehypePlugins||t_,w=t.remarkPlugins||t_,A=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...tT}:tT,P=t.skipHtml,z=t.unwrapDisallowed,R=t.urlTransform||defaultUrlTransform,D=tE().use(remarkParse).use(w).use(remarkRehype,A).use(x),B=new VFile;for(let i of("string"==typeof a&&(B.value=a),tA))Object.hasOwn(t,i.from)&&(i.from,i.to&&i.to,i.id);let U=D.parse(B),V=D.runSync(U,B);return s&&(V={type:"element",tagName:"div",properties:{className:s},children:"root"===V.type?V.children:[V]}),visit(V,transform),toJsxRuntime(V,{Fragment:ey.Fragment,components:c,ignoreInvalidStyle:!0,jsx:ey.jsx,jsxs:ey.jsxs,passKeys:!0,passNode:!0});function transform(t,a,s){if("raw"===t.type&&s&&"number"==typeof a)return P?s.children.splice(a,1):s.children[a]={type:"text",value:t.value},a;if("element"===t.type){let i;for(i in eg)if(Object.hasOwn(eg,i)&&Object.hasOwn(t.properties,i)){let o=t.properties[i],a=eg[i];(null===a||a.includes(t.tagName))&&(t.properties[i]=R(String(o||""),i,t))}}if("element"===t.type){let c=i?!i.includes(t.tagName):!!k&&k.includes(t.tagName);if(!c&&o&&"number"==typeof a&&(c=!o(t,a,s)),c&&s&&"number"==typeof a)return z&&t.children?s.children.splice(a,1,...t.children):s.children.splice(a,1),a}}}function defaultUrlTransform(t){let i=t.indexOf(":"),o=t.indexOf("?"),a=t.indexOf("#"),s=t.indexOf("/");return i<0||s>-1&&i>s||o>-1&&i>o||a>-1&&i>a||tI.test(t.slice(0,i))?t:""}},63014:function(t,i,o){"use strict";o.d(i,{Ix:function(){return x},Am:function(){return Q}});var a=o(2265);function r(t){var i,o,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t){if(Array.isArray(t))for(i=0;i"number"==typeof t&&!isNaN(t),d=t=>"string"==typeof t,p=t=>"function"==typeof t,m=t=>d(t)||p(t)?t:null,f=t=>(0,a.isValidElement)(t)||d(t)||p(t)||u(t);function g(t,i,o){void 0===o&&(o=300);let{scrollHeight:a,style:s}=t;requestAnimationFrame(()=>{s.minHeight="initial",s.height=a+"px",s.transition=`all ${o}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(i,o)})})}function h(t){let{enter:i,exit:o,appendPosition:s=!1,collapse:c=!0,collapseDuration:k=300}=t;return function(t){let{children:x,position:w,preventExitTransition:A,done:P,nodeRef:z,isIn:R}=t,D=s?`${i}--${w}`:i,B=s?`${o}--${w}`:o,U=(0,a.useRef)(0);return(0,a.useLayoutEffect)(()=>{let t=z.current,i=D.split(" "),n=o=>{o.target===z.current&&(t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",n),t.removeEventListener("animationcancel",n),0===U.current&&"animationcancel"!==o.type&&t.classList.remove(...i))};t.classList.add(...i),t.addEventListener("animationend",n),t.addEventListener("animationcancel",n)},[]),(0,a.useEffect)(()=>{let t=z.current,e=()=>{t.removeEventListener("animationend",e),c?g(t,P,k):P()};R||(A?e():(U.current=1,t.className+=` ${B}`,t.addEventListener("animationend",e)))},[R]),a.createElement(a.Fragment,null,x)}}function y(t,i){return null!=t?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:i}:{}}let s={list:new Map,emitQueue:new Map,on(t,i){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(i),this},off(t,i){if(i){let o=this.list.get(t).filter(t=>t!==i);return this.list.set(t,o),this}return this.list.delete(t),this},cancelEmit(t){let i=this.emitQueue.get(t);return i&&(i.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit(t){this.list.has(t)&&this.list.get(t).forEach(i=>{let o=setTimeout(()=>{i(...[].slice.call(arguments,1))},0);this.emitQueue.has(t)||this.emitQueue.set(t,[]),this.emitQueue.get(t).push(o)})}},T=t=>{let{theme:i,type:o,...s}=t;return a.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===i?"currentColor":`var(--toastify-icon-color-${o})`,...s})},c={info:function(t){return a.createElement(T,{...t},a.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return a.createElement(T,{...t},a.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return a.createElement(T,{...t},a.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return a.createElement(T,{...t},a.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return a.createElement("div",{className:"Toastify__spinner"})}};function C(t){let[,i]=(0,a.useReducer)(t=>t+1,0),[o,k]=(0,a.useState)([]),x=(0,a.useRef)(null),w=(0,a.useRef)(new Map).current,T=t=>-1!==o.indexOf(t),A=(0,a.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:T,getToast:t=>w.get(t)}).current;function b(t){let{containerId:i}=t,{limit:o}=A.props;!o||i&&A.containerId!==i||(A.count-=A.queue.length,A.queue=[])}function I(t){k(i=>null==t?[]:i.filter(i=>i!==t))}function _(){let{toastContent:t,toastProps:i,staleId:o}=A.queue.shift();O(t,i,o)}function L(t,o){var k,P;let{delay:z,staleId:R,...D}=o;if(!f(t)||!x.current||A.props.enableMultiContainer&&D.containerId!==A.props.containerId||w.has(D.toastId)&&null==D.updateId)return;let{toastId:B,updateId:U,data:V}=D,{props:j}=A,L=()=>I(B),W=null==U;W&&A.count++;let $={...j,style:j.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(D).filter(t=>{let[i,o]=t;return null!=o})),toastId:B,updateId:U,data:V,closeToast:L,isIn:!1,className:m(D.className||j.toastClassName),bodyClassName:m(D.bodyClassName||j.bodyClassName),progressClassName:m(D.progressClassName||j.progressClassName),autoClose:!D.isLoading&&(k=D.autoClose,P=j.autoClose,!1===k||u(k)&&k>0?k:P),deleteToast(){let t=y(w.get(B),"removed");w.delete(B),s.emit(4,t);let o=A.queue.length;if(A.count=null==B?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),o>0){let t=null==B?A.props.limit:1;if(1===o||1===t)A.displayedToast++,_();else{let i=t>o?o:t;A.displayedToast=i;for(let t=0;t0&&A.count>j.limit&&W?A.queue.push({toastContent:J,toastProps:$,staleId:R}):u(z)?setTimeout(()=>{O(J,$,R)},z):O(J,$,R)}function O(t,i,o){let{toastId:a}=i;o&&w.delete(o);let c={content:t,props:i};w.set(a,c),k(t=>[...t,a].filter(t=>t!==o)),s.emit(4,y(c,null==c.props.updateId?"added":"updated"))}return(0,a.useEffect)(()=>(A.containerId=t.containerId,s.cancelEmit(3).on(0,L).on(1,t=>x.current&&I(t)).on(5,b).emit(2,A),()=>{w.clear(),s.emit(3,A)}),[]),(0,a.useEffect)(()=>{A.props=t,A.isToastActive=T,A.displayedToast=o.length}),{getToastToRender:function(i){let o=new Map,a=Array.from(w.values());return t.newestOnTop&&a.reverse(),a.forEach(t=>{let{position:i}=t.props;o.has(i)||o.set(i,[]),o.get(i).push(t)}),Array.from(o,t=>i(t[0],t[1]))},containerRef:x,isToastActive:T}}function b(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}function I(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}function _(t){let[i,o]=(0,a.useState)(!1),[s,c]=(0,a.useState)(!1),k=(0,a.useRef)(null),x=(0,a.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,w=(0,a.useRef)(t),{autoClose:A,pauseOnHover:P,closeToast:z,onClick:R,closeOnClick:D}=t;function v(i){if(t.draggable){"touchstart"===i.nativeEvent.type&&i.nativeEvent.preventDefault(),x.didMove=!1,document.addEventListener("mousemove",_),document.addEventListener("mouseup",L),document.addEventListener("touchmove",_),document.addEventListener("touchend",L);let o=k.current;x.canCloseOnClick=!0,x.canDrag=!0,x.boundingRect=o.getBoundingClientRect(),o.style.transition="",x.x=b(i.nativeEvent),x.y=I(i.nativeEvent),"x"===t.draggableDirection?(x.start=x.x,x.removalDistance=o.offsetWidth*(t.draggablePercent/100)):(x.start=x.y,x.removalDistance=o.offsetHeight*(80===t.draggablePercent?1.5*t.draggablePercent:t.draggablePercent/100))}}function T(i){if(x.boundingRect){let{top:o,bottom:a,left:s,right:c}=x.boundingRect;"touchend"!==i.nativeEvent.type&&t.pauseOnHover&&x.x>=s&&x.x<=c&&x.y>=o&&x.y<=a?C():E()}}function E(){o(!0)}function C(){o(!1)}function _(o){let a=k.current;x.canDrag&&a&&(x.didMove=!0,i&&C(),x.x=b(o),x.y=I(o),x.delta="x"===t.draggableDirection?x.x-x.start:x.y-x.start,x.start!==x.x&&(x.canCloseOnClick=!1),a.style.transform=`translate${t.draggableDirection}(${x.delta}px)`,a.style.opacity=""+(1-Math.abs(x.delta/x.removalDistance)))}function L(){document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",L),document.removeEventListener("touchmove",_),document.removeEventListener("touchend",L);let i=k.current;if(x.canDrag&&x.didMove&&i){if(x.canDrag=!1,Math.abs(x.delta)>x.removalDistance)return c(!0),void t.closeToast();i.style.transition="transform 0.2s, opacity 0.2s",i.style.transform=`translate${t.draggableDirection}(0)`,i.style.opacity="1"}}(0,a.useEffect)(()=>{w.current=t}),(0,a.useEffect)(()=>(k.current&&k.current.addEventListener("d",E,{once:!0}),p(t.onOpen)&&t.onOpen((0,a.isValidElement)(t.children)&&t.children.props),()=>{let t=w.current;p(t.onClose)&&t.onClose((0,a.isValidElement)(t.children)&&t.children.props)}),[]),(0,a.useEffect)(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||C(),window.addEventListener("focus",E),window.addEventListener("blur",C)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",E),window.removeEventListener("blur",C))}),[t.pauseOnFocusLoss]);let B={onMouseDown:v,onTouchStart:v,onMouseUp:T,onTouchEnd:T};return A&&P&&(B.onMouseEnter=C,B.onMouseLeave=E),D&&(B.onClick=t=>{R&&R(t),x.canCloseOnClick&&z()}),{playToast:E,pauseToast:C,isRunning:i,preventExitTransition:s,toastRef:k,eventHandlers:B}}function L(t){let{closeToast:i,theme:o,ariaLabel:s="close"}=t;return a.createElement("button",{className:`Toastify__close-button Toastify__close-button--${o}`,type:"button",onClick:t=>{t.stopPropagation(),i(t)},"aria-label":s},a.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function O(t){let{delay:i,isRunning:o,closeToast:s,type:c="default",hide:k,className:x,style:w,controlledProgress:A,progress:P,rtl:z,isIn:R,theme:D}=t,B=k||A&&0===P,U={...w,animationDuration:`${i}ms`,animationPlayState:o?"running":"paused",opacity:B?0:1};A&&(U.transform=`scaleX(${P})`);let V=clsx_m("Toastify__progress-bar",A?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${D}`,`Toastify__progress-bar--${c}`,{"Toastify__progress-bar--rtl":z}),j=p(x)?x({rtl:z,type:c,defaultClassName:V}):clsx_m(V,x);return a.createElement("div",{role:"progressbar","aria-hidden":B?"true":"false","aria-label":"notification timer",className:j,style:U,[A&&P>=1?"onTransitionEnd":"onAnimationEnd"]:A&&P<1?null:()=>{R&&s()}})}let N=t=>{let{isRunning:i,preventExitTransition:o,toastRef:s,eventHandlers:c}=_(t),{closeButton:k,children:x,autoClose:w,onClick:A,type:P,hideProgressBar:z,closeToast:R,transition:D,position:B,className:U,style:V,bodyClassName:j,bodyStyle:W,progressClassName:$,progressStyle:J,updateId:K,role:Y,progress:X,rtl:Z,toastId:G,deleteToast:ee,isIn:et,isLoading:en,iconOut:er,closeOnClick:ei,theme:eo}=t,ea=clsx_m("Toastify__toast",`Toastify__toast-theme--${eo}`,`Toastify__toast--${P}`,{"Toastify__toast--rtl":Z},{"Toastify__toast--close-on-click":ei}),el=p(U)?U({rtl:Z,position:B,type:P,defaultClassName:ea}):clsx_m(ea,U),es=!!X||!w,eu={closeToast:R,type:P,theme:eo},ec=null;return!1===k||(ec=p(k)?k(eu):(0,a.isValidElement)(k)?(0,a.cloneElement)(k,eu):L(eu)),a.createElement(D,{isIn:et,done:ee,position:B,preventExitTransition:o,nodeRef:s},a.createElement("div",{id:G,onClick:A,className:el,...c,style:V,ref:s},a.createElement("div",{...et&&{role:Y},className:p(j)?j({type:P}):clsx_m("Toastify__toast-body",j),style:W},null!=er&&a.createElement("div",{className:clsx_m("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!en})},er),a.createElement("div",null,x)),ec,a.createElement(O,{...K&&!es?{key:`pb-${K}`}:{},rtl:Z,theme:eo,delay:w,isRunning:i,isIn:et,closeToast:R,hide:z,type:P,style:J,className:$,controlledProgress:es,progress:X||0})))},M=function(t,i){return void 0===i&&(i=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:i}},k=h(M("bounce",!0)),x=(h(M("slide",!0)),h(M("zoom")),h(M("flip")),(0,a.forwardRef)((t,i)=>{let{getToastToRender:o,containerRef:s,isToastActive:c}=C(t),{className:k,style:x,rtl:w,containerId:A}=t;function f(t){let i=clsx_m("Toastify__toast-container",`Toastify__toast-container--${t}`,{"Toastify__toast-container--rtl":w});return p(k)?k({position:t,rtl:w,defaultClassName:i}):clsx_m(i,m(k))}return(0,a.useEffect)(()=>{i&&(i.current=s.current)},[]),a.createElement("div",{ref:s,className:"Toastify",id:A},o((t,i)=>{let o=i.length?{...x}:{...x,pointerEvents:"none"};return a.createElement("div",{className:f(t),style:o,key:`container-${t}`},i.map((t,o)=>{let{content:s,props:k}=t;return a.createElement(N,{...k,isIn:c(k.toastId),style:{...k.style,"--nth":o+1,"--len":i.length},key:`toast-${k.key}`},s)}))}))}));x.displayName="ToastContainer",x.defaultProps={position:"top-right",transition:k,autoClose:5e3,closeButton:L,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let w,A=new Map,P=[],z=1;function F(t){return t&&(d(t.toastId)||u(t.toastId))?t.toastId:""+z++}function H(t,i){return A.size>0?s.emit(0,t,i):P.push({content:t,options:i}),i.toastId}function S(t,i){return{...i,type:i&&i.type||t,toastId:F(i)}}function q(t){return(i,o)=>H(i,S(t,o))}function Q(t,i){return H(t,S("default",i))}Q.loading=(t,i)=>H(t,S("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...i})),Q.promise=function(t,i,o){let a,{pending:s,error:c,success:k}=i;s&&(a=d(s)?Q.loading(s,o):Q.loading(s.render,{...o,...s}));let x={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(t,i,s)=>{if(null==i)return void Q.dismiss(a);let c={type:t,...x,...o,data:s},k=d(i)?{render:i}:i;return a?Q.update(a,{...c,...k}):Q(k.render,{...c,...k}),s},w=p(t)?t():t;return w.then(t=>l("success",k,t)).catch(t=>l("error",c,t)),w},Q.success=q("success"),Q.info=q("info"),Q.error=q("error"),Q.warning=q("warning"),Q.warn=Q.warning,Q.dark=(t,i)=>H(t,S("default",{theme:"dark",...i})),Q.dismiss=t=>{A.size>0?s.emit(1,t):P=P.filter(i=>null!=t&&i.options.toastId!==t)},Q.clearWaitingQueue=function(t){return void 0===t&&(t={}),s.emit(5,t)},Q.isActive=t=>{let i=!1;return A.forEach(o=>{o.isToastActive&&o.isToastActive(t)&&(i=!0)}),i},Q.update=function(t,i){void 0===i&&(i={}),setTimeout(()=>{let o=function(t,i){let{containerId:o}=i,a=A.get(o||w);return a&&a.getToast(t)}(t,i);if(o){let{props:a,content:s}=o,c={delay:100,...a,...i,toastId:i.toastId||t,updateId:""+z++};c.toastId!==t&&(c.staleId=t);let k=c.render||s;delete c.render,H(k,c)}},0)},Q.done=t=>{Q.update(t,{progress:1})},Q.onChange=t=>(s.on(4,t),()=>{s.off(4,t)}),Q.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Q.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},s.on(2,t=>{w=t.containerId||t,A.set(w,t),P.forEach(t=>{s.emit(0,t.content,t.options)}),P=[]}).on(3,t=>{A.delete(t.containerId||t),0===A.size&&s.off(0).off(1).off(5)})}}]);