diff --git "a/assets/index-2aWEXBOj.js" "b/assets/index-2aWEXBOj.js" new file mode 100755--- /dev/null +++ "b/assets/index-2aWEXBOj.js" @@ -0,0 +1,96 @@ +var xp=Object.defineProperty;var Sp=(u,o,s)=>o in u?xp(u,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[o]=s;var Re=(u,o,s)=>Sp(u,typeof o!="symbol"?o+"":o,s);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const E of h.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&c(E)}).observe(document,{childList:!0,subtree:!0});function s(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function c(f){if(f.ep)return;f.ep=!0;const h=s(f);fetch(f.href,h)}})();function Ep(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Gs={exports:{}},Pl={},Zs={exports:{}},ce={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Wc;function _p(){if(Wc)return ce;Wc=1;var u=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),E=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),j=Symbol.iterator;function I(g){return g===null||typeof g!="object"?null:(g=j&&g[j]||g["@@iterator"],typeof g=="function"?g:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,J={};function ne(g,R,B){this.props=g,this.context=R,this.refs=J,this.updater=B||$}ne.prototype.isReactComponent={},ne.prototype.setState=function(g,R){if(typeof g!="object"&&typeof g!="function"&&g!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,g,R,"setState")},ne.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function Le(){}Le.prototype=ne.prototype;function he(g,R,B){this.props=g,this.context=R,this.refs=J,this.updater=B||$}var ve=he.prototype=new Le;ve.constructor=he,D(ve,ne.prototype),ve.isPureReactComponent=!0;var q=Array.isArray,me=Object.prototype.hasOwnProperty,ie={current:null},ke={key:!0,ref:!0,__self:!0,__source:!0};function Ce(g,R,B){var oe,b={},se=null,de=null;if(R!=null)for(oe in R.ref!==void 0&&(de=R.ref),R.key!==void 0&&(se=""+R.key),R)me.call(R,oe)&&!ke.hasOwnProperty(oe)&&(b[oe]=R[oe]);var pe=arguments.length-2;if(pe===1)b.children=B;else if(1>>1,R=z[g];if(0>>1;gf(b,F))sef(de,b)?(z[g]=de,z[se]=F,g=se):(z[g]=b,z[oe]=F,g=oe);else if(sef(de,F))z[g]=de,z[se]=F,g=se;else break e}}return Q}function f(z,Q){var F=z.sortIndex-Q.sortIndex;return F!==0?F:z.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;u.unstable_now=function(){return h.now()}}else{var E=Date,v=E.now();u.unstable_now=function(){return E.now()-v}}var _=[],w=[],C=1,j=null,I=3,$=!1,D=!1,J=!1,ne=typeof setTimeout=="function"?setTimeout:null,Le=typeof clearTimeout=="function"?clearTimeout:null,he=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ve(z){for(var Q=s(w);Q!==null;){if(Q.callback===null)c(w);else if(Q.startTime<=z)c(w),Q.sortIndex=Q.expirationTime,o(_,Q);else break;Q=s(w)}}function q(z){if(J=!1,ve(z),!D)if(s(_)!==null)D=!0,Ve(me);else{var Q=s(w);Q!==null&&_e(q,Q.startTime-z)}}function me(z,Q){D=!1,J&&(J=!1,Le(Ce),Ce=-1),$=!0;var F=I;try{for(ve(Q),j=s(_);j!==null&&(!(j.expirationTime>Q)||z&&!Ie());){var g=j.callback;if(typeof g=="function"){j.callback=null,I=j.priorityLevel;var R=g(j.expirationTime<=Q);Q=u.unstable_now(),typeof R=="function"?j.callback=R:j===s(_)&&c(_),ve(Q)}else c(_);j=s(_)}if(j!==null)var B=!0;else{var oe=s(w);oe!==null&&_e(q,oe.startTime-Q),B=!1}return B}finally{j=null,I=F,$=!1}}var ie=!1,ke=null,Ce=-1,Mt=5,tt=-1;function Ie(){return!(u.unstable_now()-ttz||125g?(z.sortIndex=F,o(w,z),s(_)===null&&z===s(w)&&(J?(Le(Ce),Ce=-1):J=!0,_e(q,F-g))):(z.sortIndex=R,o(_,z),D||$||(D=!0,Ve(me))),z},u.unstable_shouldYield=Ie,u.unstable_wrapCallback=function(z){var Q=I;return function(){var F=I;I=Q;try{return z.apply(this,arguments)}finally{I=F}}}}(Ys)),Ys}var bc;function Lp(){return bc||(bc=1,Qs.exports=Rp()),Qs.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Qc;function Np(){if(Qc)return _t;Qc=1;var u=au(),o=Lp();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_=Object.prototype.hasOwnProperty,w=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,C={},j={};function I(e){return _.call(j,e)?!0:_.call(C,e)?!1:w.test(e)?j[e]=!0:(C[e]=!0,!1)}function $(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function D(e,t,n,r){if(t===null||typeof t>"u"||$(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function J(e,t,n,r,l,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var ne={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ne[e]=new J(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ne[t]=new J(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){ne[e]=new J(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ne[e]=new J(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ne[e]=new J(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){ne[e]=new J(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){ne[e]=new J(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){ne[e]=new J(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){ne[e]=new J(e,5,!1,e.toLowerCase(),null,!1,!1)});var Le=/[\-:]([a-z])/g;function he(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Le,he);ne[t]=new J(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Le,he);ne[t]=new J(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Le,he);ne[t]=new J(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){ne[e]=new J(e,1,!1,e.toLowerCase(),null,!1,!1)}),ne.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){ne[e]=new J(e,1,!1,e.toLowerCase(),null,!0,!0)});function ve(e,t,n,r){var l=ne.hasOwnProperty(t)?ne[t]:null;(l!==null?l.type!==0:r||!(2d||l[a]!==i[d]){var p=` +`+l[a].replace(" at new "," at ");return e.displayName&&p.includes("")&&(p=p.replace("",e.displayName)),p}while(1<=a&&0<=d);break}}}finally{B=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?R(e):""}function b(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return e=oe(e.type,!1),e;case 11:return e=oe(e.type.render,!1),e;case 1:return e=oe(e.type,!0),e;default:return""}}function se(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ke:return"Fragment";case ie:return"Portal";case Mt:return"Profiler";case Ce:return"StrictMode";case He:return"Suspense";case Fe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ie:return(e.displayName||"Context")+".Consumer";case tt:return(e._context.displayName||"Context")+".Provider";case be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mt:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case Ve:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}function de(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return se(t);case 8:return t===Ce?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ae(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function we(e){var t=ae(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bt(e){e._valueTracker||(e._valueTracker=we(e))}function zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ae(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yt(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function rn(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=pe(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Tn(e,t){t=t.checked,t!=null&&ve(e,"checked",t,!1)}function Tt(e,t){Tn(e,t);var n=pe(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?O(e,t.type,n):t.hasOwnProperty("defaultValue")&&O(e,t.type,pe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ln(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function O(e,t,n){(t!=="number"||gt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var K=Array.isArray;function re(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Ot.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Rt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Er=["Webkit","ms","Moz","O"];Object.keys(Cn).forEach(function(e){Er.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cn[t]=Cn[e]})});function tr(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cn.hasOwnProperty(e)&&Cn[e]?(""+t).trim():t+"px"}function Dt(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=tr(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Rn=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function nr(e,t){if(t){if(Rn[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function rr(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Yr=null;function Ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nn=null,An=null,jt=null;function Gl(e){if(e=yl(e)){if(typeof Nn!="function")throw Error(s(280));var t=e.stateNode;t&&(t=hi(t),Nn(e.stateNode,e.type,t))}}function Zl(e){An?jt?jt.push(e):jt=[e]:An=e}function Be(){if(An){var e=An,t=jt;if(jt=An=null,Gl(e),t)for(e=0;e>>=0,e===0?32:31-(jf(e)/Ff|0)|0}var Xl=64,Kl=4194304;function qr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Jl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var d=a&~l;d!==0?r=qr(d):(i&=a,i!==0&&(r=qr(i)))}else a=n&~l,a!==0?r=qr(a):i!==0&&(r=qr(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function el(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yt(t),e[t]=n}function Wf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ul),Ou=" ",Du=!1;function ju(e,t){switch(e){case"keyup":return gd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nr=!1;function vd(e,t){switch(e){case"compositionend":return Fu(t);case"keypress":return t.which!==32?null:(Du=!0,Ou);case"textInput":return e=t.data,e===Ou&&Du?null:e;default:return null}}function kd(e,t){if(Nr)return e==="compositionend"||!To&&ju(e,t)?(e=Nu(),ri=ko=Fn=null,Nr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Gu(n)}}function bu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qu(){for(var e=window,t=gt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gt(e.document)}return t}function Lo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Ld(e){var t=Qu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bu(n.ownerDocument.documentElement,n)){if(r!==null&&Lo(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=Zu(n,i);var a=Zu(n,r);l&&a&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ar=null,No=null,dl=null,Ao=!1;function Yu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ao||Ar==null||Ar!==gt(r)||(r=Ar,"selectionStart"in r&&Lo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),dl&&fl(dl,r)||(dl=r,r=fi(No,"onSelect"),0Or||(e.current=Wo[Or],Wo[Or]=null,Or--)}function Ae(e,t){Or++,Wo[Or]=e.current,e.current=t}var Wn={},lt=$n(Wn),kt=$n(!1),cr=Wn;function Dr(e,t){var n=e.type.contextTypes;if(!n)return Wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function wt(e){return e=e.childContextTypes,e!=null}function mi(){ze(kt),ze(lt)}function ca(e,t,n){if(lt.current!==Wn)throw Error(s(168));Ae(lt,t),Ae(kt,n)}function fa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(s(108,de(e)||"Unknown",l));return F({},n,r)}function gi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,cr=lt.current,Ae(lt,e),Ae(kt,kt.current),!0}function da(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=fa(e,t,cr),r.__reactInternalMemoizedMergedChildContext=e,ze(kt),ze(lt),Ae(lt,e)):ze(kt),Ae(kt,n)}var mn=null,yi=!1,Ho=!1;function pa(e){mn===null?mn=[e]:mn.push(e)}function Bd(e){yi=!0,pa(e)}function Hn(){if(!Ho&&mn!==null){Ho=!0;var e=0,t=Se;try{var n=mn;for(Se=1;e>=a,l-=a,gn=1<<32-Yt(t)+l|n<le?(Je=te,te=null):Je=te.sibling;var ye=L(k,te,x[le],M);if(ye===null){te===null&&(te=Je);break}e&&te&&ye.alternate===null&&t(k,te),y=i(ye,y,le),ee===null?Z=ye:ee.sibling=ye,ee=ye,te=Je}if(le===x.length)return n(k,te),Oe&&dr(k,le),Z;if(te===null){for(;lele?(Je=te,te=null):Je=te.sibling;var Jn=L(k,te,ye.value,M);if(Jn===null){te===null&&(te=Je);break}e&&te&&Jn.alternate===null&&t(k,te),y=i(Jn,y,le),ee===null?Z=Jn:ee.sibling=Jn,ee=Jn,te=Je}if(ye.done)return n(k,te),Oe&&dr(k,le),Z;if(te===null){for(;!ye.done;le++,ye=x.next())ye=A(k,ye.value,M),ye!==null&&(y=i(ye,y,le),ee===null?Z=ye:ee.sibling=ye,ee=ye);return Oe&&dr(k,le),Z}for(te=r(k,te);!ye.done;le++,ye=x.next())ye=U(te,k,le,ye.value,M),ye!==null&&(e&&ye.alternate!==null&&te.delete(ye.key===null?le:ye.key),y=i(ye,y,le),ee===null?Z=ye:ee.sibling=ye,ee=ye);return e&&te.forEach(function(wp){return t(k,wp)}),Oe&&dr(k,le),Z}function $e(k,y,x,M){if(typeof x=="object"&&x!==null&&x.type===ke&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case me:e:{for(var Z=x.key,ee=y;ee!==null;){if(ee.key===Z){if(Z=x.type,Z===ke){if(ee.tag===7){n(k,ee.sibling),y=l(ee,x.props.children),y.return=k,k=y;break e}}else if(ee.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===Ve&&ka(Z)===ee.type){n(k,ee.sibling),y=l(ee,x.props),y.ref=vl(k,ee,x),y.return=k,k=y;break e}n(k,ee);break}else t(k,ee);ee=ee.sibling}x.type===ke?(y=wr(x.props.children,k.mode,M,x.key),y.return=k,k=y):(M=Gi(x.type,x.key,x.props,null,k.mode,M),M.ref=vl(k,y,x),M.return=k,k=M)}return a(k);case ie:e:{for(ee=x.key;y!==null;){if(y.key===ee)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(k,y.sibling),y=l(y,x.children||[]),y.return=k,k=y;break e}else{n(k,y);break}else t(k,y);y=y.sibling}y=Bs(x,k.mode,M),y.return=k,k=y}return a(k);case Ve:return ee=x._init,$e(k,y,ee(x._payload),M)}if(K(x))return H(k,y,x,M);if(Q(x))return G(k,y,x,M);xi(k,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(k,y.sibling),y=l(y,x),y.return=k,k=y):(n(k,y),y=Us(x,k.mode,M),y.return=k,k=y),a(k)):n(k,y)}return $e}var Br=wa(!0),xa=wa(!1),Si=$n(null),Ei=null,$r=null,Yo=null;function Xo(){Yo=$r=Ei=null}function Ko(e){var t=Si.current;ze(Si),e._currentValue=t}function Jo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Wr(e,t){Ei=e,Yo=$r=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(xt=!0),e.firstContext=null)}function Wt(e){var t=e._currentValue;if(Yo!==e)if(e={context:e,memoizedValue:t,next:null},$r===null){if(Ei===null)throw Error(s(308));$r=e,Ei.dependencies={lanes:0,firstContext:e}}else $r=$r.next=e;return t}var pr=null;function qo(e){pr===null?pr=[e]:pr.push(e)}function Sa(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,qo(t)):(n.next=l.next,l.next=n),t.interleaved=n,vn(e,r)}function vn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Vn=!1;function es(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ea(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ge&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,vn(e,n)}return l=r.interleaved,l===null?(t.next=t,qo(r)):(t.next=l.next,l.next=t),r.interleaved=t,vn(e,n)}function _i(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ho(e,n)}}function _a(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ti(e,t,n,r){var l=e.updateQueue;Vn=!1;var i=l.firstBaseUpdate,a=l.lastBaseUpdate,d=l.shared.pending;if(d!==null){l.shared.pending=null;var p=d,S=p.next;p.next=null,a===null?i=S:a.next=S,a=p;var N=e.alternate;N!==null&&(N=N.updateQueue,d=N.lastBaseUpdate,d!==a&&(d===null?N.firstBaseUpdate=S:d.next=S,N.lastBaseUpdate=p))}if(i!==null){var A=l.baseState;a=0,N=S=p=null,d=i;do{var L=d.lane,U=d.eventTime;if((r&L)===L){N!==null&&(N=N.next={eventTime:U,lane:0,tag:d.tag,payload:d.payload,callback:d.callback,next:null});e:{var H=e,G=d;switch(L=t,U=n,G.tag){case 1:if(H=G.payload,typeof H=="function"){A=H.call(U,A,L);break e}A=H;break e;case 3:H.flags=H.flags&-65537|128;case 0:if(H=G.payload,L=typeof H=="function"?H.call(U,A,L):H,L==null)break e;A=F({},A,L);break e;case 2:Vn=!0}}d.callback!==null&&d.lane!==0&&(e.flags|=64,L=l.effects,L===null?l.effects=[d]:L.push(d))}else U={eventTime:U,lane:L,tag:d.tag,payload:d.payload,callback:d.callback,next:null},N===null?(S=N=U,p=A):N=N.next=U,a|=L;if(d=d.next,d===null){if(d=l.shared.pending,d===null)break;L=d,d=L.next,L.next=null,l.lastBaseUpdate=L,l.shared.pending=null}}while(!0);if(N===null&&(p=A),l.baseState=p,l.firstBaseUpdate=S,l.lastBaseUpdate=N,t=l.shared.interleaved,t!==null){l=t;do a|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);gr|=a,e.lanes=a,e.memoizedState=A}}function Ta(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=is.transition;is.transition={};try{e(!1),t()}finally{Se=n,is.transition=r}}function Va(){return Ht().memoizedState}function Vd(e,t,n){var r=Yn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ga(e))Za(t,n);else if(n=Sa(e,t,n,r),n!==null){var l=ct();tn(n,e,r,l),ba(n,t,r)}}function Gd(e,t,n){var r=Yn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ga(e))Za(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,d=i(a,n);if(l.hasEagerState=!0,l.eagerState=d,Xt(d,a)){var p=t.interleaved;p===null?(l.next=l,qo(t)):(l.next=p.next,p.next=l),t.interleaved=l;return}}catch{}finally{}n=Sa(e,t,l,r),n!==null&&(l=ct(),tn(n,e,r,l),ba(n,t,r))}}function Ga(e){var t=e.alternate;return e===je||t!==null&&t===je}function Za(e,t){Sl=Li=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ba(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ho(e,n)}}var Ii={readContext:Wt,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},Zd={readContext:Wt,useCallback:function(e,t){return cn().memoizedState=[e,t===void 0?null:t],e},useContext:Wt,useEffect:Da,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ni(4194308,4,Ua.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ni(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ni(4,2,e,t)},useMemo:function(e,t){var n=cn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=cn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Vd.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=cn();return e={current:e},t.memoizedState=e},useState:za,useDebugValue:ds,useDeferredValue:function(e){return cn().memoizedState=e},useTransition:function(){var e=za(!1),t=e[0];return e=Hd.bind(null,e[1]),cn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,l=cn();if(Oe){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Ke===null)throw Error(s(349));(mr&30)!==0||Na(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Da(Ia.bind(null,r,i,e),[e]),r.flags|=2048,Tl(9,Aa.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=cn(),t=Ke.identifierPrefix;if(Oe){var n=yn,r=gn;n=(r&~(1<<32-Yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=El++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[un]=t,e[gl]=r,pc(e,t,!1,!1),t.stateNode=e;e:{switch(a=rr(n,r),n){case"dialog":Me("cancel",e),Me("close",e),l=r;break;case"iframe":case"object":case"embed":Me("load",e),l=r;break;case"video":case"audio":for(l=0;lbr&&(t.flags|=128,r=!0,Cl(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ci(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Cl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Oe)return ot(t),null}else 2*ue()-i.renderingStartTime>br&&n!==1073741824&&(t.flags|=128,r=!0,Cl(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ue(),t.sibling=null,n=De.current,Ae(De,r?n&1|2:n&1),t):(ot(t),null);case 22:case 23:return Ds(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Pt&1073741824)!==0&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function ep(e,t){switch(Go(t),t.tag){case 1:return wt(t.type)&&mi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hr(),ze(kt),ze(lt),ls(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ns(t),null;case 13:if(ze(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(De),null;case 4:return Hr(),null;case 10:return Ko(t.type._context),null;case 22:case 23:return Ds(),null;case 24:return null;default:return null}}var Oi=!1,st=!1,tp=typeof WeakSet=="function"?WeakSet:Set,W=null;function Gr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ue(e,t,r)}else n.current=null}function _s(e,t,n){try{n()}catch(r){Ue(e,t,r)}}var gc=!1;function np(e,t){if(Do=ti,e=Qu(),Lo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,d=-1,p=-1,S=0,N=0,A=e,L=null;t:for(;;){for(var U;A!==n||l!==0&&A.nodeType!==3||(d=a+l),A!==i||r!==0&&A.nodeType!==3||(p=a+r),A.nodeType===3&&(a+=A.nodeValue.length),(U=A.firstChild)!==null;)L=A,A=U;for(;;){if(A===e)break t;if(L===n&&++S===l&&(d=a),L===i&&++N===r&&(p=a),(U=A.nextSibling)!==null)break;A=L,L=A.parentNode}A=U}n=d===-1||p===-1?null:{start:d,end:p}}else n=null}n=n||{start:0,end:0}}else n=null;for(jo={focusedElem:e,selectionRange:n},ti=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var H=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(H!==null){var G=H.memoizedProps,$e=H.memoizedState,k=t.stateNode,y=k.getSnapshotBeforeUpdate(t.elementType===t.type?G:Jt(t.type,G),$e);k.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(M){Ue(t,t.return,M)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return H=gc,gc=!1,H}function Rl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&_s(t,n,i)}l=l.next}while(l!==r)}}function Di(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ts(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[un],delete t[gl],delete t[$o],delete t[Fd],delete t[Ud])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function vc(e){return e.tag===5||e.tag===3||e.tag===4}function kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pi));else if(r!==4&&(e=e.child,e!==null))for(Cs(e,t,n),e=e.sibling;e!==null;)Cs(e,t,n),e=e.sibling}function Rs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Rs(e,t,n),e=e.sibling;e!==null;)Rs(e,t,n),e=e.sibling}var qe=null,qt=!1;function Zn(e,t,n){for(n=n.child;n!==null;)wc(e,t,n),n=n.sibling}function wc(e,t,n){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(ur,n)}catch{}switch(n.tag){case 5:st||Gr(n,t);case 6:var r=qe,l=qt;qe=null,Zn(e,t,n),qe=r,qt=l,qe!==null&&(qt?(e=qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):qe.removeChild(n.stateNode));break;case 18:qe!==null&&(qt?(e=qe,n=n.stateNode,e.nodeType===8?Bo(e.parentNode,n):e.nodeType===1&&Bo(e,n),il(e)):Bo(qe,n.stateNode));break;case 4:r=qe,l=qt,qe=n.stateNode.containerInfo,qt=!0,Zn(e,t,n),qe=r,qt=l;break;case 0:case 11:case 14:case 15:if(!st&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&_s(n,t,a),l=l.next}while(l!==r)}Zn(e,t,n);break;case 1:if(!st&&(Gr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){Ue(n,t,d)}Zn(e,t,n);break;case 21:Zn(e,t,n);break;case 22:n.mode&1?(st=(r=st)||n.memoizedState!==null,Zn(e,t,n),st=r):Zn(e,t,n);break;default:Zn(e,t,n)}}function xc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new tp),t.forEach(function(r){var l=fp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function en(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=a),r&=~i}if(r=l,r=ue()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*lp(r/1960))-r,10e?16:e,Qn===null)var r=!1;else{if(e=Qn,Qn=null,$i=0,(ge&6)!==0)throw Error(s(331));var l=ge;for(ge|=4,W=e.current;W!==null;){var i=W,a=i.child;if((W.flags&16)!==0){var d=i.deletions;if(d!==null){for(var p=0;pue()-As?vr(e,0):Ns|=n),Et(e,t)}function zc(e,t){t===0&&((e.mode&1)===0?t=1:(t=Kl,Kl<<=1,(Kl&130023424)===0&&(Kl=4194304)));var n=ct();e=vn(e,t),e!==null&&(el(e,t,n),Et(e,n))}function cp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zc(e,n)}function fp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}r!==null&&r.delete(t),zc(e,n)}var Oc;Oc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||kt.current)xt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return xt=!1,Jd(e,t,n);xt=(e.flags&131072)!==0}else xt=!1,Oe&&(t.flags&1048576)!==0&&ha(t,ki,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zi(e,t),e=t.pendingProps;var l=Dr(t,lt.current);Wr(t,n),l=ss(null,t,r,e,l,n);var i=us();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,wt(r)?(i=!0,gi(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,es(t),l.updater=Pi,t.stateNode=l,l._reactInternals=t,hs(t,r,e,n),t=vs(null,t,r,!0,i,n)):(t.tag=0,Oe&&i&&Vo(t),at(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zi(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=pp(r),e=Jt(r,e),l){case 0:t=ys(null,t,r,e,n);break e;case 1:t=sc(null,t,r,e,n);break e;case 11:t=nc(null,t,r,e,n);break e;case 14:t=rc(null,t,r,Jt(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Jt(r,l),ys(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Jt(r,l),sc(e,t,r,l,n);case 3:e:{if(uc(t),e===null)throw Error(s(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Ea(e,t),Ti(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Vr(Error(s(423)),t),t=ac(e,t,r,n,l);break e}else if(r!==l){l=Vr(Error(s(424)),t),t=ac(e,t,r,n,l);break e}else for(It=Bn(t.stateNode.containerInfo.firstChild),At=t,Oe=!0,Kt=null,n=xa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ur(),r===l){t=wn(e,t,n);break e}at(e,t,r,n)}t=t.child}return t;case 5:return Ca(t),e===null&&bo(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,a=l.children,Fo(r,l)?a=null:i!==null&&Fo(r,i)&&(t.flags|=32),oc(e,t),at(e,t,a,n),t.child;case 6:return e===null&&bo(t),null;case 13:return cc(e,t,n);case 4:return ts(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Br(t,null,r,n):at(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Jt(r,l),nc(e,t,r,l,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,a=l.value,Ae(Si,r._currentValue),r._currentValue=a,i!==null)if(Xt(i.value,a)){if(i.children===l.children&&!kt.current){t=wn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var d=i.dependencies;if(d!==null){a=i.child;for(var p=d.firstContext;p!==null;){if(p.context===r){if(i.tag===1){p=kn(-1,n&-n),p.tag=2;var S=i.updateQueue;if(S!==null){S=S.shared;var N=S.pending;N===null?p.next=p:(p.next=N.next,N.next=p),S.pending=p}}i.lanes|=n,p=i.alternate,p!==null&&(p.lanes|=n),Jo(i.return,n,t),d.lanes|=n;break}p=p.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(s(341));a.lanes|=n,d=a.alternate,d!==null&&(d.lanes|=n),Jo(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}at(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Wr(t,n),l=Wt(l),r=r(l),t.flags|=1,at(e,t,r,n),t.child;case 14:return r=t.type,l=Jt(r,t.pendingProps),l=Jt(r.type,l),rc(e,t,r,l,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Jt(r,l),zi(e,t),t.tag=1,wt(r)?(e=!0,gi(t)):e=!1,Wr(t,n),Ya(t,r,l),hs(t,r,l,n),vs(null,t,r,!0,e,n);case 19:return dc(e,t,n);case 22:return ic(e,t,n)}throw Error(s(156,t.tag))};function Dc(e,t){return P(e,t)}function dp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,n,r){return new dp(e,t,n,r)}function Fs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pp(e){if(typeof e=="function")return Fs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===be)return 11;if(e===mt)return 14}return 2}function Kn(e,t){var n=e.alternate;return n===null?(n=Gt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Gi(e,t,n,r,l,i){var a=2;if(r=e,typeof e=="function")Fs(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ke:return wr(n.children,l,i,t);case Ce:a=8,l|=8;break;case Mt:return e=Gt(12,n,t,l|2),e.elementType=Mt,e.lanes=i,e;case He:return e=Gt(13,n,t,l),e.elementType=He,e.lanes=i,e;case Fe:return e=Gt(19,n,t,l),e.elementType=Fe,e.lanes=i,e;case _e:return Zi(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tt:a=10;break e;case Ie:a=9;break e;case be:a=11;break e;case mt:a=14;break e;case Ve:a=16,r=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Gt(a,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function wr(e,t,n,r){return e=Gt(7,e,r,t),e.lanes=n,e}function Zi(e,t,n,r){return e=Gt(22,e,r,t),e.elementType=_e,e.lanes=n,e.stateNode={isHidden:!1},e}function Us(e,t,n){return e=Gt(6,e,null,t),e.lanes=n,e}function Bs(e,t,n){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=po(0),this.expirationTimes=po(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=po(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function $s(e,t,n,r,l,i,a,d,p){return e=new hp(e,t,n,d,p),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Gt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},es(i),e}function mp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(o){console.error(o)}}return u(),bs.exports=Np(),bs.exports}var Xc;function Ip(){if(Xc)return qi;Xc=1;var u=Ap();return qi.createRoot=u.createRoot,qi.hydrateRoot=u.hydrateRoot,qi}var Pp=Ip();function cu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sr=cu();function wf(u){Sr=u}var Hl={exec:()=>null};function xe(u,o=""){let s=typeof u=="string"?u:u.source;const c={replace:(f,h)=>{let E=typeof h=="string"?h:h.source;return E=E.replace(dt.caret,"$1"),s=s.replace(f,E),c},getRegex:()=>new RegExp(s,o)};return c}var dt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:u=>new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}#`),htmlBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,"i")},Mp=/^(?:[ \t]*(?:\n|$))+/,zp=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Op=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Vl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fu=/(?:[*+-]|\d{1,9}[.)])/,xf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Sf=xe(xf).replace(/bull/g,fu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),jp=xe(xf).replace(/bull/g,fu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),du=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fp=/^[^\n]+/,pu=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Up=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Bp=xe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fu).getRegex(),uo="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",hu=/|$))/,$p=xe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",hu).replace("tag",uo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ef=xe(du).replace("hr",Vl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",uo).getRegex(),Wp=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ef).getRegex(),mu={blockquote:Wp,code:zp,def:Up,fences:Op,heading:Dp,hr:Vl,html:$p,lheading:Sf,list:Bp,newline:Mp,paragraph:Ef,table:Hl,text:Fp},Kc=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",uo).getRegex(),Hp={...mu,lheading:jp,table:Kc,paragraph:xe(du).replace("hr",Vl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",uo).getRegex()},Vp={...mu,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",hu).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Hl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(du).replace("hr",Vl).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Sf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Gp=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zp=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_f=/^( {2,}|\\)\n(?!\s*$)/,bp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,Rf=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Jp=xe(Rf,"u").replace(/punct/g,ao).getRegex(),qp=xe(Rf,"u").replace(/punct/g,Cf).getRegex(),Lf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",eh=xe(Lf,"gu").replace(/notPunctSpace/g,Tf).replace(/punctSpace/g,gu).replace(/punct/g,ao).getRegex(),th=xe(Lf,"gu").replace(/notPunctSpace/g,Xp).replace(/punctSpace/g,Yp).replace(/punct/g,Cf).getRegex(),nh=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Tf).replace(/punctSpace/g,gu).replace(/punct/g,ao).getRegex(),rh=xe(/\\(punct)/,"gu").replace(/punct/g,ao).getRegex(),lh=xe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ih=xe(hu).replace("(?:-->|$)","-->").getRegex(),oh=xe("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",ih).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),io=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,sh=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",io).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nf=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",io).replace("ref",pu).getRegex(),Af=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",pu).getRegex(),uh=xe("reflink|nolink(?!\\()","g").replace("reflink",Nf).replace("nolink",Af).getRegex(),yu={_backpedal:Hl,anyPunctuation:rh,autolink:lh,blockSkip:Kp,br:_f,code:Zp,del:Hl,emStrongLDelim:Jp,emStrongRDelimAst:eh,emStrongRDelimUnd:nh,escape:Gp,link:sh,nolink:Af,punctuation:Qp,reflink:Nf,reflinkSearch:uh,tag:oh,text:bp,url:Hl},ah={...yu,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",io).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",io).getRegex()},nu={...yu,emStrongRDelimAst:th,emStrongLDelim:qp,url:xe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Jc=u=>fh[u];function dn(u,o){if(o){if(dt.escapeTest.test(u))return u.replace(dt.escapeReplace,Jc)}else if(dt.escapeTestNoEncode.test(u))return u.replace(dt.escapeReplaceNoEncode,Jc);return u}function qc(u){try{u=encodeURI(u).replace(dt.percentDecode,"%")}catch{return null}return u}function ef(u,o){var h;const s=u.replace(dt.findPipe,(E,v,_)=>{let w=!1,C=v;for(;--C>=0&&_[C]==="\\";)w=!w;return w?"|":" |"}),c=s.split(dt.splitPipe);let f=0;if(c[0].trim()||c.shift(),c.length>0&&!((h=c.at(-1))!=null&&h.trim())&&c.pop(),o)if(c.length>o)c.splice(o);else for(;c.length0?-2:-1}function tf(u,o,s,c,f){const h=o.href,E=o.title||null,v=u[1].replace(f.other.outputLinkReplace,"$1");c.state.inLink=!0;const _={type:u[0].charAt(0)==="!"?"image":"link",raw:s,href:h,title:E,text:v,tokens:c.inlineTokens(v)};return c.state.inLink=!1,_}function ph(u,o,s){const c=u.match(s.other.indentCodeCompensation);if(c===null)return o;const f=c[1];return o.split(` +`).map(h=>{const E=h.match(s.other.beginningSpace);if(E===null)return h;const[v]=E;return v.length>=f.length?h.slice(f.length):h}).join(` +`)}var oo=class{constructor(u){Re(this,"options");Re(this,"rules");Re(this,"lexer");this.options=u||Sr}space(u){const o=this.rules.block.newline.exec(u);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(u){const o=this.rules.block.code.exec(u);if(o){const s=o[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:o[0],codeBlockStyle:"indented",text:this.options.pedantic?s:zl(s,` +`)}}}fences(u){const o=this.rules.block.fences.exec(u);if(o){const s=o[0],c=ph(s,o[3]||"",this.rules);return{type:"code",raw:s,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:c}}}heading(u){const o=this.rules.block.heading.exec(u);if(o){let s=o[2].trim();if(this.rules.other.endingHash.test(s)){const c=zl(s,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(s=c.trim())}return{type:"heading",raw:o[0],depth:o[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(u){const o=this.rules.block.hr.exec(u);if(o)return{type:"hr",raw:zl(o[0],` +`)}}blockquote(u){const o=this.rules.block.blockquote.exec(u);if(o){let s=zl(o[0],` +`).split(` +`),c="",f="";const h=[];for(;s.length>0;){let E=!1;const v=[];let _;for(_=0;_1,f={type:"list",raw:"",ordered:c,start:c?+s.slice(0,-1):"",loose:!1,items:[]};s=c?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=c?s:"[*+-]");const h=this.rules.other.listItemRegex(s);let E=!1;for(;u;){let _=!1,w="",C="";if(!(o=h.exec(u))||this.rules.block.hr.test(u))break;w=o[0],u=u.substring(w.length);let j=o[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,Le=>" ".repeat(3*Le.length)),I=u.split(` +`,1)[0],$=!j.trim(),D=0;if(this.options.pedantic?(D=2,C=j.trimStart()):$?D=o[1].length+1:(D=o[2].search(this.rules.other.nonSpaceChar),D=D>4?1:D,C=j.slice(D),D+=o[1].length),$&&this.rules.other.blankLine.test(I)&&(w+=I+` +`,u=u.substring(I.length+1),_=!0),!_){const Le=this.rules.other.nextBulletRegex(D),he=this.rules.other.hrRegex(D),ve=this.rules.other.fencesBeginRegex(D),q=this.rules.other.headingBeginRegex(D),me=this.rules.other.htmlBeginRegex(D);for(;u;){const ie=u.split(` +`,1)[0];let ke;if(I=ie,this.options.pedantic?(I=I.replace(this.rules.other.listReplaceNesting," "),ke=I):ke=I.replace(this.rules.other.tabCharGlobal," "),ve.test(I)||q.test(I)||me.test(I)||Le.test(I)||he.test(I))break;if(ke.search(this.rules.other.nonSpaceChar)>=D||!I.trim())C+=` +`+ke.slice(D);else{if($||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ve.test(j)||q.test(j)||he.test(j))break;C+=` +`+I}!$&&!I.trim()&&($=!0),w+=ie+` +`,u=u.substring(ie.length+1),j=ke.slice(D)}}f.loose||(E?f.loose=!0:this.rules.other.doubleBlankLine.test(w)&&(E=!0));let J=null,ne;this.options.gfm&&(J=this.rules.other.listIsTask.exec(C),J&&(ne=J[0]!=="[ ] ",C=C.replace(this.rules.other.listReplaceTask,""))),f.items.push({type:"list_item",raw:w,task:!!J,checked:ne,loose:!1,text:C,tokens:[]}),f.raw+=w}const v=f.items.at(-1);if(v)v.raw=v.raw.trimEnd(),v.text=v.text.trimEnd();else return;f.raw=f.raw.trimEnd();for(let _=0;_j.type==="space"),C=w.length>0&&w.some(j=>this.rules.other.anyLine.test(j.raw));f.loose=C}if(f.loose)for(let _=0;_({text:_,tokens:this.lexer.inline(_),header:!1,align:h.align[w]})));return h}}lheading(u){const o=this.rules.block.lheading.exec(u);if(o)return{type:"heading",raw:o[0],depth:o[2].charAt(0)==="="?1:2,text:o[1],tokens:this.lexer.inline(o[1])}}paragraph(u){const o=this.rules.block.paragraph.exec(u);if(o){const s=o[1].charAt(o[1].length-1)===` +`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:s,tokens:this.lexer.inline(s)}}}text(u){const o=this.rules.block.text.exec(u);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(u){const o=this.rules.inline.escape.exec(u);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(u){const o=this.rules.inline.tag.exec(u);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(u){const o=this.rules.inline.link.exec(u);if(o){const s=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const h=zl(s.slice(0,-1),"\\");if((s.length-h.length)%2===0)return}else{const h=dh(o[2],"()");if(h===-2)return;if(h>-1){const v=(o[0].indexOf("!")===0?5:4)+o[1].length+h;o[2]=o[2].substring(0,h),o[0]=o[0].substring(0,v).trim(),o[3]=""}}let c=o[2],f="";if(this.options.pedantic){const h=this.rules.other.pedanticHrefTitle.exec(c);h&&(c=h[1],f=h[3])}else f=o[3]?o[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?c=c.slice(1):c=c.slice(1,-1)),tf(o,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:f&&f.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(u,o){let s;if((s=this.rules.inline.reflink.exec(u))||(s=this.rules.inline.nolink.exec(u))){const c=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),f=o[c.toLowerCase()];if(!f){const h=s[0].charAt(0);return{type:"text",raw:h,text:h}}return tf(s,f,s[0],this.lexer,this.rules)}}emStrong(u,o,s=""){let c=this.rules.inline.emStrongLDelim.exec(u);if(!c||c[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(c[1]||c[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const h=[...c[0]].length-1;let E,v,_=h,w=0;const C=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(C.lastIndex=0,o=o.slice(-1*u.length+h);(c=C.exec(o))!=null;){if(E=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!E)continue;if(v=[...E].length,c[3]||c[4]){_+=v;continue}else if((c[5]||c[6])&&h%3&&!((h+v)%3)){w+=v;continue}if(_-=v,_>0)continue;v=Math.min(v,v+_+w);const j=[...c[0]][0].length,I=u.slice(0,h+c.index+j+v);if(Math.min(h,v)%2){const D=I.slice(1,-1);return{type:"em",raw:I,text:D,tokens:this.lexer.inlineTokens(D)}}const $=I.slice(2,-2);return{type:"strong",raw:I,text:$,tokens:this.lexer.inlineTokens($)}}}}codespan(u){const o=this.rules.inline.code.exec(u);if(o){let s=o[2].replace(this.rules.other.newLineCharGlobal," ");const c=this.rules.other.nonSpaceChar.test(s),f=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return c&&f&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:o[0],text:s}}}br(u){const o=this.rules.inline.br.exec(u);if(o)return{type:"br",raw:o[0]}}del(u){const o=this.rules.inline.del.exec(u);if(o)return{type:"del",raw:o[0],text:o[2],tokens:this.lexer.inlineTokens(o[2])}}autolink(u){const o=this.rules.inline.autolink.exec(u);if(o){let s,c;return o[2]==="@"?(s=o[1],c="mailto:"+s):(s=o[1],c=s),{type:"link",raw:o[0],text:s,href:c,tokens:[{type:"text",raw:s,text:s}]}}}url(u){var s;let o;if(o=this.rules.inline.url.exec(u)){let c,f;if(o[2]==="@")c=o[0],f="mailto:"+c;else{let h;do h=o[0],o[0]=((s=this.rules.inline._backpedal.exec(o[0]))==null?void 0:s[0])??"";while(h!==o[0]);c=o[0],o[1]==="www."?f="http://"+o[0]:f=o[0]}return{type:"link",raw:o[0],text:c,href:f,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(u){const o=this.rules.inline.text.exec(u);if(o){const s=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:s}}}},En=class ru{constructor(o){Re(this,"tokens");Re(this,"options");Re(this,"state");Re(this,"tokenizer");Re(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Sr,this.options.tokenizer=this.options.tokenizer||new oo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={other:dt,block:eo.normal,inline:Ml.normal};this.options.pedantic?(s.block=eo.pedantic,s.inline=Ml.pedantic):this.options.gfm&&(s.block=eo.gfm,this.options.breaks?s.inline=Ml.breaks:s.inline=Ml.gfm),this.tokenizer.rules=s}static get rules(){return{block:eo,inline:Ml}}static lex(o,s){return new ru(s).lex(o)}static lexInline(o,s){return new ru(s).inlineTokens(o)}lex(o){o=o.replace(dt.carriageReturn,` +`),this.blockTokens(o,this.tokens);for(let s=0;s(v=w.call({lexer:this},o,s))?(o=o.substring(v.raw.length),s.push(v),!0):!1))continue;if(v=this.tokenizer.space(o)){o=o.substring(v.raw.length);const w=s.at(-1);v.raw.length===1&&w!==void 0?w.raw+=` +`:s.push(v);continue}if(v=this.tokenizer.code(o)){o=o.substring(v.raw.length);const w=s.at(-1);(w==null?void 0:w.type)==="paragraph"||(w==null?void 0:w.type)==="text"?(w.raw+=` +`+v.raw,w.text+=` +`+v.text,this.inlineQueue.at(-1).src=w.text):s.push(v);continue}if(v=this.tokenizer.fences(o)){o=o.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.heading(o)){o=o.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.hr(o)){o=o.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.blockquote(o)){o=o.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.list(o)){o=o.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.html(o)){o=o.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.def(o)){o=o.substring(v.raw.length);const w=s.at(-1);(w==null?void 0:w.type)==="paragraph"||(w==null?void 0:w.type)==="text"?(w.raw+=` +`+v.raw,w.text+=` +`+v.raw,this.inlineQueue.at(-1).src=w.text):this.tokens.links[v.tag]||(this.tokens.links[v.tag]={href:v.href,title:v.title});continue}if(v=this.tokenizer.table(o)){o=o.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.lheading(o)){o=o.substring(v.raw.length),s.push(v);continue}let _=o;if((E=this.options.extensions)!=null&&E.startBlock){let w=1/0;const C=o.slice(1);let j;this.options.extensions.startBlock.forEach(I=>{j=I.call({lexer:this},C),typeof j=="number"&&j>=0&&(w=Math.min(w,j))}),w<1/0&&w>=0&&(_=o.substring(0,w+1))}if(this.state.top&&(v=this.tokenizer.paragraph(_))){const w=s.at(-1);c&&(w==null?void 0:w.type)==="paragraph"?(w.raw+=` +`+v.raw,w.text+=` +`+v.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=w.text):s.push(v),c=_.length!==o.length,o=o.substring(v.raw.length);continue}if(v=this.tokenizer.text(o)){o=o.substring(v.raw.length);const w=s.at(-1);(w==null?void 0:w.type)==="text"?(w.raw+=` +`+v.raw,w.text+=` +`+v.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=w.text):s.push(v);continue}if(o){const w="Infinite loop on byte: "+o.charCodeAt(0);if(this.options.silent){console.error(w);break}else throw new Error(w)}}return this.state.top=!0,s}inline(o,s=[]){return this.inlineQueue.push({src:o,tokens:s}),s}inlineTokens(o,s=[]){var v,_,w;let c=o,f=null;if(this.tokens.links){const C=Object.keys(this.tokens.links);if(C.length>0)for(;(f=this.tokenizer.rules.inline.reflinkSearch.exec(c))!=null;)C.includes(f[0].slice(f[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,f.index)+"["+"a".repeat(f[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(f=this.tokenizer.rules.inline.anyPunctuation.exec(c))!=null;)c=c.slice(0,f.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(f=this.tokenizer.rules.inline.blockSkip.exec(c))!=null;)c=c.slice(0,f.index)+"["+"a".repeat(f[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let h=!1,E="";for(;o;){h||(E=""),h=!1;let C;if((_=(v=this.options.extensions)==null?void 0:v.inline)!=null&&_.some(I=>(C=I.call({lexer:this},o,s))?(o=o.substring(C.raw.length),s.push(C),!0):!1))continue;if(C=this.tokenizer.escape(o)){o=o.substring(C.raw.length),s.push(C);continue}if(C=this.tokenizer.tag(o)){o=o.substring(C.raw.length),s.push(C);continue}if(C=this.tokenizer.link(o)){o=o.substring(C.raw.length),s.push(C);continue}if(C=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(C.raw.length);const I=s.at(-1);C.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=C.raw,I.text+=C.text):s.push(C);continue}if(C=this.tokenizer.emStrong(o,c,E)){o=o.substring(C.raw.length),s.push(C);continue}if(C=this.tokenizer.codespan(o)){o=o.substring(C.raw.length),s.push(C);continue}if(C=this.tokenizer.br(o)){o=o.substring(C.raw.length),s.push(C);continue}if(C=this.tokenizer.del(o)){o=o.substring(C.raw.length),s.push(C);continue}if(C=this.tokenizer.autolink(o)){o=o.substring(C.raw.length),s.push(C);continue}if(!this.state.inLink&&(C=this.tokenizer.url(o))){o=o.substring(C.raw.length),s.push(C);continue}let j=o;if((w=this.options.extensions)!=null&&w.startInline){let I=1/0;const $=o.slice(1);let D;this.options.extensions.startInline.forEach(J=>{D=J.call({lexer:this},$),typeof D=="number"&&D>=0&&(I=Math.min(I,D))}),I<1/0&&I>=0&&(j=o.substring(0,I+1))}if(C=this.tokenizer.inlineText(j)){o=o.substring(C.raw.length),C.raw.slice(-1)!=="_"&&(E=C.raw.slice(-1)),h=!0;const I=s.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=C.raw,I.text+=C.text):s.push(C);continue}if(o){const I="Infinite loop on byte: "+o.charCodeAt(0);if(this.options.silent){console.error(I);break}else throw new Error(I)}}return s}},so=class{constructor(u){Re(this,"options");Re(this,"parser");this.options=u||Sr}space(u){return""}code({text:u,lang:o,escaped:s}){var h;const c=(h=(o||"").match(dt.notSpaceStart))==null?void 0:h[0],f=u.replace(dt.endingNewline,"")+` +`;return c?'
'+(s?f:dn(f,!0))+`
+`:"
"+(s?f:dn(f,!0))+`
+`}blockquote({tokens:u}){return`
+${this.parser.parse(u)}
+`}html({text:u}){return u}heading({tokens:u,depth:o}){return`${this.parser.parseInline(u)} +`}hr(u){return`
+`}list(u){const o=u.ordered,s=u.start;let c="";for(let E=0;E +`+c+" +`}listitem(u){var s;let o="";if(u.task){const c=this.checkbox({checked:!!u.checked});u.loose?((s=u.tokens[0])==null?void 0:s.type)==="paragraph"?(u.tokens[0].text=c+" "+u.tokens[0].text,u.tokens[0].tokens&&u.tokens[0].tokens.length>0&&u.tokens[0].tokens[0].type==="text"&&(u.tokens[0].tokens[0].text=c+" "+dn(u.tokens[0].tokens[0].text),u.tokens[0].tokens[0].escaped=!0)):u.tokens.unshift({type:"text",raw:c+" ",text:c+" ",escaped:!0}):o+=c+" "}return o+=this.parser.parse(u.tokens,!!u.loose),`
  • ${o}
  • +`}checkbox({checked:u}){return"'}paragraph({tokens:u}){return`

    ${this.parser.parseInline(u)}

    +`}table(u){let o="",s="";for(let f=0;f${c}`),` + +`+o+` +`+c+`
    +`}tablerow({text:u}){return` +${u} +`}tablecell(u){const o=this.parser.parseInline(u.tokens),s=u.header?"th":"td";return(u.align?`<${s} align="${u.align}">`:`<${s}>`)+o+` +`}strong({tokens:u}){return`${this.parser.parseInline(u)}`}em({tokens:u}){return`${this.parser.parseInline(u)}`}codespan({text:u}){return`${dn(u,!0)}`}br(u){return"
    "}del({tokens:u}){return`${this.parser.parseInline(u)}`}link({href:u,title:o,tokens:s}){const c=this.parser.parseInline(s),f=qc(u);if(f===null)return c;u=f;let h='
    ",h}image({href:u,title:o,text:s,tokens:c}){c&&(s=this.parser.parseInline(c,this.parser.textRenderer));const f=qc(u);if(f===null)return dn(s);u=f;let h=`${s}{const _=E[v].flat(1/0);s=s.concat(this.walkTokens(_,o))}):E.tokens&&(s=s.concat(this.walkTokens(E.tokens,o)))}}return s}use(...u){const o=this.defaults.extensions||{renderers:{},childTokens:{}};return u.forEach(s=>{const c={...s};if(c.async=this.defaults.async||c.async||!1,s.extensions&&(s.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){const h=o.renderers[f.name];h?o.renderers[f.name]=function(...E){let v=f.renderer.apply(this,E);return v===!1&&(v=h.apply(this,E)),v}:o.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const h=o[f.level];h?h.unshift(f.tokenizer):o[f.level]=[f.tokenizer],f.start&&(f.level==="block"?o.startBlock?o.startBlock.push(f.start):o.startBlock=[f.start]:f.level==="inline"&&(o.startInline?o.startInline.push(f.start):o.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(o.childTokens[f.name]=f.childTokens)}),c.extensions=o),s.renderer){const f=this.defaults.renderer||new so(this.defaults);for(const h in s.renderer){if(!(h in f))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;const E=h,v=s.renderer[E],_=f[E];f[E]=(...w)=>{let C=v.apply(f,w);return C===!1&&(C=_.apply(f,w)),C||""}}c.renderer=f}if(s.tokenizer){const f=this.defaults.tokenizer||new oo(this.defaults);for(const h in s.tokenizer){if(!(h in f))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;const E=h,v=s.tokenizer[E],_=f[E];f[E]=(...w)=>{let C=v.apply(f,w);return C===!1&&(C=_.apply(f,w)),C}}c.tokenizer=f}if(s.hooks){const f=this.defaults.hooks||new ro;for(const h in s.hooks){if(!(h in f))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;const E=h,v=s.hooks[E],_=f[E];ro.passThroughHooks.has(h)?f[E]=w=>{if(this.defaults.async)return Promise.resolve(v.call(f,w)).then(j=>_.call(f,j));const C=v.call(f,w);return _.call(f,C)}:f[E]=(...w)=>{let C=v.apply(f,w);return C===!1&&(C=_.apply(f,w)),C}}c.hooks=f}if(s.walkTokens){const f=this.defaults.walkTokens,h=s.walkTokens;c.walkTokens=function(E){let v=[];return v.push(h.call(this,E)),f&&(v=v.concat(f.call(this,E))),v}}this.defaults={...this.defaults,...c}}),this}setOptions(u){return this.defaults={...this.defaults,...u},this}lexer(u,o){return En.lex(u,o??this.defaults)}parser(u,o){return _n.parse(u,o??this.defaults)}parseMarkdown(u){return(s,c)=>{const f={...c},h={...this.defaults,...f},E=this.onError(!!h.silent,!!h.async);if(this.defaults.async===!0&&f.async===!1)return E(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return E(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return E(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));h.hooks&&(h.hooks.options=h,h.hooks.block=u);const v=h.hooks?h.hooks.provideLexer():u?En.lex:En.lexInline,_=h.hooks?h.hooks.provideParser():u?_n.parse:_n.parseInline;if(h.async)return Promise.resolve(h.hooks?h.hooks.preprocess(s):s).then(w=>v(w,h)).then(w=>h.hooks?h.hooks.processAllTokens(w):w).then(w=>h.walkTokens?Promise.all(this.walkTokens(w,h.walkTokens)).then(()=>w):w).then(w=>_(w,h)).then(w=>h.hooks?h.hooks.postprocess(w):w).catch(E);try{h.hooks&&(s=h.hooks.preprocess(s));let w=v(s,h);h.hooks&&(w=h.hooks.processAllTokens(w)),h.walkTokens&&this.walkTokens(w,h.walkTokens);let C=_(w,h);return h.hooks&&(C=h.hooks.postprocess(C)),C}catch(w){return E(w)}}}onError(u,o){return s=>{if(s.message+=` +Please report this to https://github.com/markedjs/marked.`,u){const c="

    An error occurred:

    "+dn(s.message+"",!0)+"
    ";return o?Promise.resolve(c):c}if(o)return Promise.reject(s);throw s}}},xr=new hh;function Ee(u,o){return xr.parse(u,o)}Ee.options=Ee.setOptions=function(u){return xr.setOptions(u),Ee.defaults=xr.defaults,wf(Ee.defaults),Ee};Ee.getDefaults=cu;Ee.defaults=Sr;Ee.use=function(...u){return xr.use(...u),Ee.defaults=xr.defaults,wf(Ee.defaults),Ee};Ee.walkTokens=function(u,o){return xr.walkTokens(u,o)};Ee.parseInline=xr.parseInline;Ee.Parser=_n;Ee.parser=_n.parse;Ee.Renderer=so;Ee.TextRenderer=vu;Ee.Lexer=En;Ee.lexer=En.lex;Ee.Tokenizer=oo;Ee.Hooks=ro;Ee.parse=Ee;Ee.options;Ee.setOptions;Ee.use;Ee.walkTokens;Ee.parseInline;_n.parse;En.lex;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:If,setPrototypeOf:nf,isFrozen:mh,getPrototypeOf:gh,getOwnPropertyDescriptor:yh}=Object;let{freeze:pt,seal:Zt,create:Pf}=Object,{apply:iu,construct:ou}=typeof Reflect<"u"&&Reflect;pt||(pt=function(o){return o});Zt||(Zt=function(o){return o});iu||(iu=function(o,s,c){return o.apply(s,c)});ou||(ou=function(o,s){return new o(...s)});const to=ht(Array.prototype.forEach),vh=ht(Array.prototype.lastIndexOf),rf=ht(Array.prototype.pop),Ol=ht(Array.prototype.push),kh=ht(Array.prototype.splice),lo=ht(String.prototype.toLowerCase),Xs=ht(String.prototype.toString),lf=ht(String.prototype.match),Dl=ht(String.prototype.replace),wh=ht(String.prototype.indexOf),xh=ht(String.prototype.trim),nn=ht(Object.prototype.hasOwnProperty),ft=ht(RegExp.prototype.test),jl=Sh(TypeError);function ht(u){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var s=arguments.length,c=new Array(s>1?s-1:0),f=1;f2&&arguments[2]!==void 0?arguments[2]:lo;nf&&nf(u,null);let c=o.length;for(;c--;){let f=o[c];if(typeof f=="string"){const h=s(f);h!==f&&(mh(o)||(o[c]=h),f=h)}u[f]=!0}return u}function Eh(u){for(let o=0;o/gm),Lh=Zt(/\$\{[\w\W]*/gm),Nh=Zt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ah=Zt(/^aria-[\-\w]+$/),Mf=Zt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ih=Zt(/^(?:\w+script|data):/i),Ph=Zt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zf=Zt(/^html$/i),Mh=Zt(/^[a-z][.\w]*(-[.\w]+)+$/i);var cf=Object.freeze({__proto__:null,ARIA_ATTR:Ah,ATTR_WHITESPACE:Ph,CUSTOM_ELEMENT:Mh,DATA_ATTR:Nh,DOCTYPE_NAME:zf,ERB_EXPR:Rh,IS_ALLOWED_URI:Mf,IS_SCRIPT_OR_DATA:Ih,MUSTACHE_EXPR:Ch,TMPLIT_EXPR:Lh});const Ul={element:1,text:3,progressingInstruction:7,comment:8,document:9},zh=function(){return typeof window>"u"?null:window},Oh=function(o,s){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let c=null;const f="data-tt-policy-suffix";s&&s.hasAttribute(f)&&(c=s.getAttribute(f));const h="dompurify"+(c?"#"+c:"");try{return o.createPolicy(h,{createHTML(E){return E},createScriptURL(E){return E}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},ff=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Of(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zh();const o=Y=>Of(Y);if(o.version="3.2.6",o.removed=[],!u||!u.document||u.document.nodeType!==Ul.document||!u.Element)return o.isSupported=!1,o;let{document:s}=u;const c=s,f=c.currentScript,{DocumentFragment:h,HTMLTemplateElement:E,Node:v,Element:_,NodeFilter:w,NamedNodeMap:C=u.NamedNodeMap||u.MozNamedAttrMap,HTMLFormElement:j,DOMParser:I,trustedTypes:$}=u,D=_.prototype,J=Fl(D,"cloneNode"),ne=Fl(D,"remove"),Le=Fl(D,"nextSibling"),he=Fl(D,"childNodes"),ve=Fl(D,"parentNode");if(typeof E=="function"){const Y=s.createElement("template");Y.content&&Y.content.ownerDocument&&(s=Y.content.ownerDocument)}let q,me="";const{implementation:ie,createNodeIterator:ke,createDocumentFragment:Ce,getElementsByTagName:Mt}=s,{importNode:tt}=c;let Ie=ff();o.isSupported=typeof If=="function"&&typeof ve=="function"&&ie&&ie.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:be,ERB_EXPR:He,TMPLIT_EXPR:Fe,DATA_ATTR:mt,ARIA_ATTR:Ve,IS_SCRIPT_OR_DATA:_e,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:Q}=cf;let{IS_ALLOWED_URI:F}=cf,g=null;const R=fe({},[...of,...Ks,...Js,...qs,...sf]);let B=null;const oe=fe({},[...uf,...eu,...af,...no]);let b=Object.seal(Pf(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),se=null,de=null,pe=!0,ae=!0,we=!1,bt=!0,zt=!1,gt=!0,yt=!1,rn=!1,Tn=!1,Tt=!1,ln=!1,O=!1,K=!0,re=!1;const Te="user-content-";let Pe=!0,nt=!1,ut={},Ct=null;const vt=fe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ot=null;const er=fe({},["audio","video","img","source","image","track"]);let Rt=null;const Cn=fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Er="http://www.w3.org/1998/Math/MathML",tr="http://www.w3.org/2000/svg",Dt="http://www.w3.org/1999/xhtml";let Rn=Dt,nr=!1,rr=null;const Yr=fe({},[Er,tr,Dt],Xs);let Ln=fe({},["mi","mo","mn","ms","mtext"]),Nn=fe({},["annotation-xml"]);const An=fe({},["title","style","font","a","script"]);let jt=null;const Gl=["application/xhtml+xml","text/html"],Zl="text/html";let Be=null,pn=null;const bl=s.createElement("form"),_r=function(m){return m instanceof RegExp||m instanceof Function},Tr=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pn&&pn===m)){if((!m||typeof m!="object")&&(m={}),m=Sn(m),jt=Gl.indexOf(m.PARSER_MEDIA_TYPE)===-1?Zl:m.PARSER_MEDIA_TYPE,Be=jt==="application/xhtml+xml"?Xs:lo,g=nn(m,"ALLOWED_TAGS")?fe({},m.ALLOWED_TAGS,Be):R,B=nn(m,"ALLOWED_ATTR")?fe({},m.ALLOWED_ATTR,Be):oe,rr=nn(m,"ALLOWED_NAMESPACES")?fe({},m.ALLOWED_NAMESPACES,Xs):Yr,Rt=nn(m,"ADD_URI_SAFE_ATTR")?fe(Sn(Cn),m.ADD_URI_SAFE_ATTR,Be):Cn,Ot=nn(m,"ADD_DATA_URI_TAGS")?fe(Sn(er),m.ADD_DATA_URI_TAGS,Be):er,Ct=nn(m,"FORBID_CONTENTS")?fe({},m.FORBID_CONTENTS,Be):vt,se=nn(m,"FORBID_TAGS")?fe({},m.FORBID_TAGS,Be):Sn({}),de=nn(m,"FORBID_ATTR")?fe({},m.FORBID_ATTR,Be):Sn({}),ut=nn(m,"USE_PROFILES")?m.USE_PROFILES:!1,pe=m.ALLOW_ARIA_ATTR!==!1,ae=m.ALLOW_DATA_ATTR!==!1,we=m.ALLOW_UNKNOWN_PROTOCOLS||!1,bt=m.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zt=m.SAFE_FOR_TEMPLATES||!1,gt=m.SAFE_FOR_XML!==!1,yt=m.WHOLE_DOCUMENT||!1,Tt=m.RETURN_DOM||!1,ln=m.RETURN_DOM_FRAGMENT||!1,O=m.RETURN_TRUSTED_TYPE||!1,Tn=m.FORCE_BODY||!1,K=m.SANITIZE_DOM!==!1,re=m.SANITIZE_NAMED_PROPS||!1,Pe=m.KEEP_CONTENT!==!1,nt=m.IN_PLACE||!1,F=m.ALLOWED_URI_REGEXP||Mf,Rn=m.NAMESPACE||Dt,Ln=m.MATHML_TEXT_INTEGRATION_POINTS||Ln,Nn=m.HTML_INTEGRATION_POINTS||Nn,b=m.CUSTOM_ELEMENT_HANDLING||{},m.CUSTOM_ELEMENT_HANDLING&&_r(m.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(b.tagNameCheck=m.CUSTOM_ELEMENT_HANDLING.tagNameCheck),m.CUSTOM_ELEMENT_HANDLING&&_r(m.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(b.attributeNameCheck=m.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),m.CUSTOM_ELEMENT_HANDLING&&typeof m.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(b.allowCustomizedBuiltInElements=m.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),zt&&(ae=!1),ln&&(Tt=!0),ut&&(g=fe({},sf),B=[],ut.html===!0&&(fe(g,of),fe(B,uf)),ut.svg===!0&&(fe(g,Ks),fe(B,eu),fe(B,no)),ut.svgFilters===!0&&(fe(g,Js),fe(B,eu),fe(B,no)),ut.mathMl===!0&&(fe(g,qs),fe(B,af),fe(B,no))),m.ADD_TAGS&&(g===R&&(g=Sn(g)),fe(g,m.ADD_TAGS,Be)),m.ADD_ATTR&&(B===oe&&(B=Sn(B)),fe(B,m.ADD_ATTR,Be)),m.ADD_URI_SAFE_ATTR&&fe(Rt,m.ADD_URI_SAFE_ATTR,Be),m.FORBID_CONTENTS&&(Ct===vt&&(Ct=Sn(Ct)),fe(Ct,m.FORBID_CONTENTS,Be)),Pe&&(g["#text"]=!0),yt&&fe(g,["html","head","body"]),g.table&&(fe(g,["tbody"]),delete se.tbody),m.TRUSTED_TYPES_POLICY){if(typeof m.TRUSTED_TYPES_POLICY.createHTML!="function")throw jl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof m.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');q=m.TRUSTED_TYPES_POLICY,me=q.createHTML("")}else q===void 0&&(q=Oh($,f)),q!==null&&typeof me=="string"&&(me=q.createHTML(""));pt&&pt(m),pn=m}},In=fe({},[...Ks,...Js,..._h]),Cr=fe({},[...qs,...Th]),lr=function(m){let P=ve(m);(!P||!P.tagName)&&(P={namespaceURI:Rn,tagName:"template"});const V=lo(m.tagName),Ne=lo(P.tagName);return rr[m.namespaceURI]?m.namespaceURI===tr?P.namespaceURI===Dt?V==="svg":P.namespaceURI===Er?V==="svg"&&(Ne==="annotation-xml"||Ln[Ne]):!!In[V]:m.namespaceURI===Er?P.namespaceURI===Dt?V==="math":P.namespaceURI===tr?V==="math"&&Nn[Ne]:!!Cr[V]:m.namespaceURI===Dt?P.namespaceURI===tr&&!Nn[Ne]||P.namespaceURI===Er&&!Ln[Ne]?!1:!Cr[V]&&(An[V]||!In[V]):!!(jt==="application/xhtml+xml"&&rr[m.namespaceURI]):!1},Ft=function(m){Ol(o.removed,{element:m});try{ve(m).removeChild(m)}catch{ne(m)}},Ut=function(m,P){try{Ol(o.removed,{attribute:P.getAttributeNode(m),from:P})}catch{Ol(o.removed,{attribute:null,from:P})}if(P.removeAttribute(m),m==="is")if(Tt||ln)try{Ft(P)}catch{}else try{P.setAttribute(m,"")}catch{}},ir=function(m){let P=null,V=null;if(Tn)m=""+m;else{const ue=lf(m,/^[\r\n\t ]+/);V=ue&&ue[0]}jt==="application/xhtml+xml"&&Rn===Dt&&(m=''+m+"");const Ne=q?q.createHTML(m):m;if(Rn===Dt)try{P=new I().parseFromString(Ne,jt)}catch{}if(!P||!P.documentElement){P=ie.createDocument(Rn,"template",null);try{P.documentElement.innerHTML=nr?me:Ne}catch{}}const Qe=P.body||P.documentElement;return m&&V&&Qe.insertBefore(s.createTextNode(V),Qe.childNodes[0]||null),Rn===Dt?Mt.call(P,yt?"html":"body")[0]:yt?P.documentElement:Qe},or=function(m){return ke.call(m.ownerDocument||m,m,w.SHOW_ELEMENT|w.SHOW_COMMENT|w.SHOW_TEXT|w.SHOW_PROCESSING_INSTRUCTION|w.SHOW_CDATA_SECTION,null)},sr=function(m){return m instanceof j&&(typeof m.nodeName!="string"||typeof m.textContent!="string"||typeof m.removeChild!="function"||!(m.attributes instanceof C)||typeof m.removeAttribute!="function"||typeof m.setAttribute!="function"||typeof m.namespaceURI!="string"||typeof m.insertBefore!="function"||typeof m.hasChildNodes!="function")},Ql=function(m){return typeof v=="function"&&m instanceof v};function Qt(Y,m,P){to(Y,V=>{V.call(o,m,P,pn)})}const Yl=function(m){let P=null;if(Qt(Ie.beforeSanitizeElements,m,null),sr(m))return Ft(m),!0;const V=Be(m.nodeName);if(Qt(Ie.uponSanitizeElement,m,{tagName:V,allowedTags:g}),gt&&m.hasChildNodes()&&!Ql(m.firstElementChild)&&ft(/<[/\w!]/g,m.innerHTML)&&ft(/<[/\w!]/g,m.textContent)||m.nodeType===Ul.progressingInstruction||gt&&m.nodeType===Ul.comment&&ft(/<[/\w]/g,m.data))return Ft(m),!0;if(!g[V]||se[V]){if(!se[V]&&Xr(V)&&(b.tagNameCheck instanceof RegExp&&ft(b.tagNameCheck,V)||b.tagNameCheck instanceof Function&&b.tagNameCheck(V)))return!1;if(Pe&&!Ct[V]){const Ne=ve(m)||m.parentNode,Qe=he(m)||m.childNodes;if(Qe&&Ne){const ue=Qe.length;for(let rt=ue-1;rt>=0;--rt){const Lt=J(Qe[rt],!0);Lt.__removalCount=(m.__removalCount||0)+1,Ne.insertBefore(Lt,Le(m))}}}return Ft(m),!0}return m instanceof _&&!lr(m)||(V==="noscript"||V==="noembed"||V==="noframes")&&ft(/<\/no(script|embed|frames)/i,m.innerHTML)?(Ft(m),!0):(zt&&m.nodeType===Ul.text&&(P=m.textContent,to([be,He,Fe],Ne=>{P=Dl(P,Ne," ")}),m.textContent!==P&&(Ol(o.removed,{element:m.cloneNode()}),m.textContent=P)),Qt(Ie.afterSanitizeElements,m,null),!1)},on=function(m,P,V){if(K&&(P==="id"||P==="name")&&(V in s||V in bl))return!1;if(!(ae&&!de[P]&&ft(mt,P))){if(!(pe&&ft(Ve,P))){if(!B[P]||de[P]){if(!(Xr(m)&&(b.tagNameCheck instanceof RegExp&&ft(b.tagNameCheck,m)||b.tagNameCheck instanceof Function&&b.tagNameCheck(m))&&(b.attributeNameCheck instanceof RegExp&&ft(b.attributeNameCheck,P)||b.attributeNameCheck instanceof Function&&b.attributeNameCheck(P))||P==="is"&&b.allowCustomizedBuiltInElements&&(b.tagNameCheck instanceof RegExp&&ft(b.tagNameCheck,V)||b.tagNameCheck instanceof Function&&b.tagNameCheck(V))))return!1}else if(!Rt[P]){if(!ft(F,Dl(V,z,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&m!=="script"&&wh(V,"data:")===0&&Ot[m])){if(!(we&&!ft(_e,Dl(V,z,"")))){if(V)return!1}}}}}}return!0},Xr=function(m){return m!=="annotation-xml"&&lf(m,Q)},Kr=function(m){Qt(Ie.beforeSanitizeAttributes,m,null);const{attributes:P}=m;if(!P||sr(m))return;const V={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let Ne=P.length;for(;Ne--;){const Qe=P[Ne],{name:ue,namespaceURI:rt,value:Lt}=Qe,Pn=Be(ue),Mn=Lt;let Ye=ue==="value"?Mn:xh(Mn);if(V.attrName=Pn,V.attrValue=Ye,V.keepAttr=!0,V.forceKeepAttr=void 0,Qt(Ie.uponSanitizeAttribute,m,V),Ye=V.attrValue,re&&(Pn==="id"||Pn==="name")&&(Ut(ue,m),Ye=Te+Ye),gt&&ft(/((--!?|])>)|<\/(style|title)/i,Ye)){Ut(ue,m);continue}if(V.forceKeepAttr)continue;if(!V.keepAttr){Ut(ue,m);continue}if(!bt&&ft(/\/>/i,Ye)){Ut(ue,m);continue}zt&&to([be,He,Fe],ur=>{Ye=Dl(Ye,ur," ")});const Jr=Be(m.nodeName);if(!on(Jr,Pn,Ye)){Ut(ue,m);continue}if(q&&typeof $=="object"&&typeof $.getAttributeType=="function"&&!rt)switch($.getAttributeType(Jr,Pn)){case"TrustedHTML":{Ye=q.createHTML(Ye);break}case"TrustedScriptURL":{Ye=q.createScriptURL(Ye);break}}if(Ye!==Mn)try{rt?m.setAttributeNS(rt,ue,Ye):m.setAttribute(ue,Ye),sr(m)?Ft(m):rf(o.removed)}catch{Ut(ue,m)}}Qt(Ie.afterSanitizeAttributes,m,null)},co=function Y(m){let P=null;const V=or(m);for(Qt(Ie.beforeSanitizeShadowDOM,m,null);P=V.nextNode();)Qt(Ie.uponSanitizeShadowNode,P,null),Yl(P),Kr(P),P.content instanceof h&&Y(P.content);Qt(Ie.afterSanitizeShadowDOM,m,null)};return o.sanitize=function(Y){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,V=null,Ne=null,Qe=null;if(nr=!Y,nr&&(Y=""),typeof Y!="string"&&!Ql(Y))if(typeof Y.toString=="function"){if(Y=Y.toString(),typeof Y!="string")throw jl("dirty is not a string, aborting")}else throw jl("toString is not a function");if(!o.isSupported)return Y;if(rn||Tr(m),o.removed=[],typeof Y=="string"&&(nt=!1),nt){if(Y.nodeName){const Lt=Be(Y.nodeName);if(!g[Lt]||se[Lt])throw jl("root node is forbidden and cannot be sanitized in-place")}}else if(Y instanceof v)P=ir(""),V=P.ownerDocument.importNode(Y,!0),V.nodeType===Ul.element&&V.nodeName==="BODY"||V.nodeName==="HTML"?P=V:P.appendChild(V);else{if(!Tt&&!zt&&!yt&&Y.indexOf("<")===-1)return q&&O?q.createHTML(Y):Y;if(P=ir(Y),!P)return Tt?null:O?me:""}P&&Tn&&Ft(P.firstChild);const ue=or(nt?Y:P);for(;Ne=ue.nextNode();)Yl(Ne),Kr(Ne),Ne.content instanceof h&&co(Ne.content);if(nt)return Y;if(Tt){if(ln)for(Qe=Ce.call(P.ownerDocument);P.firstChild;)Qe.appendChild(P.firstChild);else Qe=P;return(B.shadowroot||B.shadowrootmode)&&(Qe=tt.call(c,Qe,!0)),Qe}let rt=yt?P.outerHTML:P.innerHTML;return yt&&g["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&ft(zf,P.ownerDocument.doctype.name)&&(rt=" +`+rt),zt&&to([be,He,Fe],Lt=>{rt=Dl(rt,Lt," ")}),q&&O?q.createHTML(rt):rt},o.setConfig=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tr(Y),rn=!0},o.clearConfig=function(){pn=null,rn=!1},o.isValidAttribute=function(Y,m,P){pn||Tr({});const V=Be(Y),Ne=Be(m);return on(V,Ne,P)},o.addHook=function(Y,m){typeof m=="function"&&Ol(Ie[Y],m)},o.removeHook=function(Y,m){if(m!==void 0){const P=vh(Ie[Y],m);return P===-1?void 0:kh(Ie[Y],P,1)[0]}return rf(Ie[Y])},o.removeHooks=function(Y){Ie[Y]=[]},o.removeAllHooks=function(){Ie=ff()},o}var Dh=Of();function jh(u){return T.jsxs("svg",{...u,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("path",{d:"M12 8V4H8"}),T.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),T.jsx("path",{d:"M2 14h2"}),T.jsx("path",{d:"M20 14h2"}),T.jsx("path",{d:"M15 13v2"}),T.jsx("path",{d:"M9 13v2"})]})}function Fh(u){return T.jsx("svg",{...u,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("path",{className:"stroke-gray-600 dark:stroke-gray-400",d:"M16 6v3.33M16 6c0-2.65 3.25-4.3 5.4-2.62 1.2.95 1.6 2.65.95 4.04a3.63 3.63 0 0 1 4.61.16 3.45 3.45 0 0 1 .46 4.37 5.32 5.32 0 0 1 1.87 4.75c-.22 1.66-1.39 3.6-3.07 4.14M16 6c0-2.65-3.25-4.3-5.4-2.62a3.37 3.37 0 0 0-.95 4.04 3.65 3.65 0 0 0-4.6.16 3.37 3.37 0 0 0-.49 4.27 5.57 5.57 0 0 0-1.85 4.85 5.3 5.3 0 0 0 3.07 4.15M16 9.33v17.34m0-17.34c0 2.18 1.82 4 4 4m6.22 7.5c.67 1.3.56 2.91-.27 4.11a4.05 4.05 0 0 1-4.62 1.5c0 1.53-1.05 2.9-2.66 2.9A2.7 2.7 0 0 1 16 26.66m10.22-5.83a4.05 4.05 0 0 0-3.55-2.17m-16.9 2.18a4.05 4.05 0 0 0 .28 4.1c1 1.44 2.92 2.09 4.59 1.5 0 1.52 1.12 2.88 2.7 2.88A2.7 2.7 0 0 0 16 26.67M5.78 20.85a4.04 4.04 0 0 1 3.55-2.18"})})}function Uh(u){return T.jsxs("svg",{...u,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),T.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}var su=function(){return(su=Object.assign||function(u){for(var o,s=1,c=arguments.length;s0;return T.jsx("div",{className:"flex items-start space-x-4",children:u==="assistant"?T.jsxs(T.Fragment,{children:[T.jsx(jh,{className:"h-6 w-6 min-h-6 min-w-6 my-3 text-gray-500 dark:text-gray-300"}),T.jsx("div",{className:"bg-gray-200 dark:bg-gray-700 rounded-lg p-4",children:T.jsx("div",{className:"min-h-6 text-gray-800 dark:text-gray-200 overflow-wrap-anywhere",children:s===0||c.length>0?T.jsxs(T.Fragment,{children:[c.length>0&&T.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg flex flex-col mb-2",children:[T.jsxs("button",{className:"flex items-center gap-2 cursor-pointer p-4 hover:bg-gray-50 dark:hover:bg-gray-900 rounded-lg ",onClick:()=>E(_=>!_),style:{width:h?"100%":"auto"},children:[T.jsx(Fh,{className:v?"":"animate-pulse"}),T.jsx("span",{children:v?"View reasoning.":"Thinking..."}),T.jsx("span",{className:"ml-auto text-gray-700",children:h?"▲":"▼"})]}),h&&T.jsx(hf,{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-2",dynamic:!0,children:T.jsx("span",{className:"markdown",dangerouslySetInnerHTML:{__html:mf(c)}})})]}),v&&T.jsx(hf,{dynamic:!0,children:T.jsx("span",{className:"markdown",dangerouslySetInnerHTML:{__html:mf(f)}})})]}):T.jsxs("span",{className:"h-6 flex items-center gap-1",children:[T.jsx("span",{className:"w-2.5 h-2.5 bg-gray-600 dark:bg-gray-300 rounded-full animate-pulse"}),T.jsx("span",{className:"w-2.5 h-2.5 bg-gray-600 dark:bg-gray-300 rounded-full animate-pulse animation-delay-200"}),T.jsx("span",{className:"w-2.5 h-2.5 bg-gray-600 dark:bg-gray-300 rounded-full animate-pulse animation-delay-400"})]})})})]}):T.jsxs(T.Fragment,{children:[T.jsx(Uh,{className:"h-6 w-6 min-h-6 min-w-6 my-3 text-gray-500 dark:text-gray-300"}),T.jsx("div",{className:"bg-blue-500 text-white rounded-lg p-4",children:T.jsx("p",{className:"min-h-6 overflow-wrap-anywhere",children:o})})]})})}function Hh({messages:u}){const o=u.length===0;return T.jsx("div",{className:`flex-1 p-6 max-w-[960px] w-full ${o?"flex flex-col items-center justify-end":"space-y-4"}`,children:T.jsx(Bh,{children:o?T.jsx("div",{className:"text-xl",children:"Ready!"}):u.map((s,c)=>T.jsx(Wh,{...s},`message-${c}`))})})}function gf(u){return T.jsxs("svg",{...u,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("path",{d:"M5 12h14"}),T.jsx("path",{d:"m12 5 7 7-7 7"})]})}function Vh(u){return T.jsxs("svg",{...u,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("path",{d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}),T.jsx("path",{fill:"currentColor",d:"M9 9.563C9 9.252 9.252 9 9.563 9h4.874c.311 0 .563.252.563.563v4.874c0 .311-.252.563-.563.563H9.564A.562.562 0 0 1 9 14.437V9.564Z"})]})}const Gh=({className:u,...o})=>T.jsxs("svg",{className:u,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...o,children:[T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 1a3 3 0 00-3 3v7a3 3 0 006 0V4a3 3 0 00-3-3z"}),T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 10v2a7 7 0 01-14 0v-2"}),T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19v4"}),T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 23h8"})]}),Zh=({className:u})=>T.jsxs("svg",{className:u,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[T.jsx("path",{d:"M12 1a4 4 0 00-4 4v4a4 4 0 008 0V5a4 4 0 00-4-4z"}),T.jsx("path",{d:"M5 9v2a7 7 0 0014 0v-2h2v2a9 9 0 01-18 0v-2h2z"}),T.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"red",strokeWidth:"2"})]});function bh(u){const o=u==0?0:Math.floor(Math.log(u)/Math.log(1024));return+(u/Math.pow(1024,o)).toFixed(2)*1+["B","kB","MB","GB","TB"][o]}function Qh({text:u,percentage:o,total:s}){return o??(o=0),T.jsx("div",{className:"w-full bg-gray-100 dark:bg-gray-700 text-left rounded-lg overflow-hidden mb-0.5",children:T.jsxs("div",{className:"bg-blue-400 whitespace-nowrap px-1 text-sm",style:{width:`${o}%`},children:[u," (",o.toFixed(2),"%",isNaN(s)?"":` of ${bh(s)}`,")"]})})}function Yh(u){return T.jsx("svg",{...u,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("path",{d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})})}const Xh=({className:u,onClick:o})=>T.jsxs("svg",{onClick:o,xmlns:"http://www.w3.org/2000/svg",className:u,viewBox:"0 0 24 24",fill:"currentColor",children:[T.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3z"}),T.jsx("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.06c1.48-.74 2.5-2.26 2.5-4.03z"})]}),Kh="af_heart",Jh=1.2,yf=20,vf=16e3,qh=!!navigator.gpu,em=120,tm=["Lily is three times older than her son. In 15 years, she will be twice as old as him. How old is she now?","Tell me about the Lighthouse of Alexandria.","Tell me about Constantinople."],nm={role:"system",content:"You're a helpful and truthfull assistant."};function rm(){const u=X.useRef(null),o=X.useRef(null),s=X.useRef(null),c=X.useRef({}),f=X.useRef(null),h=X.useRef(null),[E,v]=X.useState(null),[_,w]=X.useState(null),[C,j]=X.useState(""),[I,$]=X.useState([]),[D,J]=X.useState(!1),[ne,Le]=X.useState(!1),[he,ve]=X.useState(""),[q,me]=X.useState([]),[ie,ke]=X.useState(null),[Ce,Mt]=X.useState(null),[tt,Ie]=X.useState(!1),[be,He]=X.useState([]),[Fe,mt]=X.useState(!0),[Ve,_e]=X.useState(!1),z=X.useRef(null),[Q,F]=X.useState(!1),[g,R]=X.useState(null),[B,oe]=X.useState([]),[b,se]=X.useState(!1),[de,pe]=X.useState(!1),ae=X.useRef(null),we=X.useRef(null),[bt,zt]=X.useState(null);X.useEffect(()=>{be.length>0||fetch("/public/models.json").then(O=>{if(!O.ok)throw new Error("Failed to load models");return O.json()}).then(O=>{c.current=O,He(Object.keys(O))}).catch(O=>console.error("Error loading models:",O))},[be]);function gt(O){me(K=>[...K,{role:"user",content:O}]),ke(null),J(!0),ve("")}function yt(){o.current&&o.current.postMessage({type:"interrupt",data:{text:""}}),ae.current&&(ae.current.pause(),ae.current.src="",we.current&&(URL.revokeObjectURL(we.current),we.current=null)),oe([]),se(!1)}function rn(){return u.current.postMessage({type:"interrupt"}),yt(),!0}X.useEffect(()=>{Tn()},[he]);function Tn(){if(!f.current)return;const O=f.current;O.style.height="auto";const K=Math.min(Math.max(O.scrollHeight,24),200);O.style.height=`${K}px`}X.useEffect(()=>{if(!(Fe||Ve||!u.current)){if(_e(!0),!s.current){s.current=new Worker(new URL("/assets/stt-worker-DP5PGwR7.js",import.meta.url),{type:"module"});const O=re=>{switch(re.data.status){case"ready":console.log("STT Worker: Ready.");break;case"from_stt":re.data.text.toLowerCase().includes("reset.")?(rn(),me([])):re.data.text.toLowerCase().includes("stop.")?yt():gt(re.data.text);break;case"error":w(re.data.data);break}},K=re=>{console.error("Worker error:",re)};s.current.addEventListener("message",O),s.current.addEventListener("error",K),s.current.postMessage({type:"load_stt"})}try{const O=navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0,sampleRate:vf}});z.current=O}catch(O){console.error("Error accessing microphone:",O),_e(!1);return}}},[Ve,Fe]),X.useEffect(()=>{if(!Fe){_e(!0);let O,K,re,Te=!1;const Pe=Promise.resolve(z.current);return Pe.then(async nt=>{Te||(K=new(window.AudioContext||window.webkitAudioContext)({sampleRate:vf}),re=K.createMediaStreamSource(nt),await K.audioWorklet.addModule(new URL("data:text/javascript;base64,Y29uc3QgTUlOX0NIVU5LX1NJWkUgPSA1MTI7CmxldCBnbG9iYWxQb2ludGVyID0gMDsKbGV0IGdsb2JhbEJ1ZmZlciA9IG5ldyBGbG9hdDMyQXJyYXkoTUlOX0NIVU5LX1NJWkUpOwoKY2xhc3MgVkFEUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBwcm9jZXNzKGlucHV0cywgb3V0cHV0cywgcGFyYW1ldGVycykgewogICAgY29uc3QgYnVmZmVyID0gaW5wdXRzWzBdWzBdOwogICAgaWYgKCFidWZmZXIpIHJldHVybjsgLy8gYnVmZmVyIGlzIG51bGwgd2hlbiB0aGUgc3RyZWFtIGVuZHMKCiAgICBpZiAoYnVmZmVyLmxlbmd0aCA+IE1JTl9DSFVOS19TSVpFKSB7CiAgICAgIC8vIElmIHRoZSBidWZmZXIgaXMgbGFyZ2VyIHRoYW4gdGhlIG1pbmltdW0gY2h1bmsgc2l6ZSwgc2VuZCB0aGUgZW50aXJlIGJ1ZmZlcgogICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyBidWZmZXIgfSk7CiAgICB9IGVsc2UgewogICAgICBjb25zdCByZW1haW5pbmcgPSBNSU5fQ0hVTktfU0laRSAtIGdsb2JhbFBvaW50ZXI7CiAgICAgIGlmIChidWZmZXIubGVuZ3RoID49IHJlbWFpbmluZykgewogICAgICAgIC8vIElmIHRoZSBidWZmZXIgaXMgbGFyZ2VyIHRoYW4gKG9yIGVxdWFsIHRvKSB0aGUgcmVtYWluaW5nIHNwYWNlIGluIHRoZSBnbG9iYWwgYnVmZmVyLCBjb3B5IHRoZSByZW1haW5pbmcgc3BhY2UKICAgICAgICBnbG9iYWxCdWZmZXIuc2V0KGJ1ZmZlci5zdWJhcnJheSgwLCByZW1haW5pbmcpLCBnbG9iYWxQb2ludGVyKTsKCiAgICAgICAgLy8gU2VuZCB0aGUgZ2xvYmFsIGJ1ZmZlcgogICAgICAgIHRoaXMucG9ydC5wb3N0TWVzc2FnZSh7IGJ1ZmZlcjogZ2xvYmFsQnVmZmVyIH0pOwoKICAgICAgICAvLyBSZXNldCB0aGUgZ2xvYmFsIGJ1ZmZlciBhbmQgc2V0IHRoZSByZW1haW5pbmcgYnVmZmVyCiAgICAgICAgZ2xvYmFsQnVmZmVyLmZpbGwoMCk7CiAgICAgICAgZ2xvYmFsQnVmZmVyLnNldChidWZmZXIuc3ViYXJyYXkocmVtYWluaW5nKSwgMCk7CiAgICAgICAgZ2xvYmFsUG9pbnRlciA9IGJ1ZmZlci5sZW5ndGggLSByZW1haW5pbmc7CiAgICAgIH0gZWxzZSB7CiAgICAgICAgLy8gSWYgdGhlIGJ1ZmZlciBpcyBzbWFsbGVyIHRoYW4gdGhlIHJlbWFpbmluZyBzcGFjZSBpbiB0aGUgZ2xvYmFsIGJ1ZmZlciwgY29weSB0aGUgYnVmZmVyIHRvIHRoZSBnbG9iYWwgYnVmZmVyCiAgICAgICAgZ2xvYmFsQnVmZmVyLnNldChidWZmZXIsIGdsb2JhbFBvaW50ZXIpOwogICAgICAgIGdsb2JhbFBvaW50ZXIgKz0gYnVmZmVyLmxlbmd0aDsKICAgICAgfQogICAgfQoKICAgIHJldHVybiB0cnVlOyAvLyBLZWVwIHRoZSBwcm9jZXNzb3IgYWxpdmUKICB9Cn0KCnJlZ2lzdGVyUHJvY2Vzc29yKCJ2YWQtcHJvY2Vzc29yIiwgVkFEUHJvY2Vzc29yKTsK",import.meta.url)),O=new AudioWorkletNode(K,"vad-processor",{numberOfInputs:1,numberOfOutputs:0,channelCount:1}),re.connect(O),O.port.onmessage=ut=>{var vt;const{buffer:Ct}=ut.data;ne&&((vt=s.current)==null||vt.postMessage({type:"audio",data:Ct}))})}).catch(nt=>{console.error(nt)}),()=>{Te=!0,Pe.then(nt=>nt.getTracks().forEach(ut=>ut.stop())),re==null||re.disconnect(),O==null||O.disconnect(),K==null||K.close()}}},[ne,Fe]);const Tt=X.useCallback(O=>{oe(K=>(K.length>=yf&&!de&&pe(!0),[...K,O]))},[]),ln=X.useCallback(()=>{if(B.length===0||b)return;console.log("next audio chunk, queue length:",B.length);const O=B[0];de&&B.length{se(!1)},ae.current.onerror=re=>{var Te;console.error("Audio playback error:",re),we.current===((Te=ae.current)==null?void 0:Te.src)&&(URL.revokeObjectURL(we.current),we.current=null),se(!1)}),oe(re=>re.slice(1)),ae.current.src=K,se(!0),ae.current.play().then(()=>{}).catch(re=>{console.error(`Error starting audio playback for ${K}:`,re),we.current===K&&(URL.revokeObjectURL(we.current),we.current=null),se(!1)})},[B,de,b]);return X.useEffect(()=>{!b&&B.length>0&&ln()},[b,B.length,ln]),X.useEffect(()=>{u.current||(u.current=new Worker(new URL("/assets/llm-worker-CKHJqaHO.js",import.meta.url),{type:"module"}),u.current.postMessage({type:"check"}));const O=re=>{switch(re.data.status){case"loading":v("loading"),j(re.data.data);break;case"initiate":$(Te=>[...Te,re.data]);break;case"progress":$(Te=>Te.map(Pe=>Pe.file===re.data.file?{...Pe,...re.data}:Pe));break;case"done":$(Te=>Te.filter(Pe=>Pe.file!==re.data.file));break;case"ready":v("ready"),Le(!0);break;case"start":me(Te=>[...Te,{role:"assistant",content:""}]);break;case"update":{const{output:Te,tps:Pe,numTokens:nt,state:ut}=re.data;ke(Pe),Mt(nt),me(Ct=>{const vt=[...Ct],Ot=vt.at(-1);if(Ot){const er=Ot.content+Te,Rt={...Ot,content:er};Rt.answerIndex===void 0&&ut==="answering"&&(Rt.answerIndex=Ot.content.length),vt[vt.length-1]=Rt}return vt})}break;case"complete":J(!1);break;case"error":w(re.data.data);break}},K=re=>{console.error("Worker error:",re)};return u.current.addEventListener("message",O),u.current.addEventListener("error",K),()=>{u.current.removeEventListener("message",O),u.current.removeEventListener("error",K)}},[]),X.useEffect(()=>{const O=re=>{const{status:Te,chunk:Pe}=re.data;switch(Te){case"ready":console.log("TTS Worker is ready");break;case"stream":Pe&&Pe.audio instanceof Blob?Tt(Pe.audio):console.warn("Received stream message without valid audio blob:",Pe);break;case"error":w(re.data.data);break;default:console.warn("Unknown TTS worker message status:",Te);break}},K=re=>{console.error("TTS Worker error:",re)};return!o.current&&Q&&(o.current=new Worker(new URL("/assets/tts-worker-g3xHhJq6.js",import.meta.url),{type:"module"}),o.current.addEventListener("message",O),o.current.addEventListener("error",K),o.current.postMessage({type:"load_tts"})),o.current?()=>{o.current.removeEventListener("message",O),o.current.removeEventListener("error",K)}:()=>{}},[Tt,Q]),X.useEffect(()=>{if(q.filter(K=>K.role==="user").length===0||q.at(-1).role==="assistant")return;ke(null);let O=[nm,...q];u.current.postMessage({type:"generate",data:{messages:O,reasonEnabled:tt}})},[q,D,tt]),X.useEffect(()=>{bt!==null&&(o.current.postMessage({type:"speak",data:{text:bt,voice:Kh,speed:Jh}}),zt(null))},[bt]),X.useEffect(()=>{if(!h.current)return;const O=h.current;if(D&&O.scrollHeight-O.scrollTop-O.clientHeight1){const re=K.length>g+30,Te=B.length<3;if(!D&&g==K.length&&B.length==0&&o.current.postMessage({type:"flush",data:{text:""}}),!D||re&&Te&&!de){const Pe=K.slice(g-1,K.length-1).trim().replace(/\*/g,"");Pe!==""&&(zt(Pe),R(K.length))}}}},[q,D,g,Q,de,B.length]),qh?T.jsxs("div",{className:"flex flex-col h-screen mx-auto items justify-end text-gray-800 dark:text-gray-200 bg-white dark:bg-gray-900",children:[E===null&&q.length===0&&T.jsxs("div",{className:"h-full overflow-auto scrollbar-thin flex justify-center items-center flex-col relative",children:[T.jsxs("div",{className:"flex flex-col items-center mb-1 max-w-[360px] text-center",children:[T.jsx("img",{src:"logo.png",width:"80%",height:"auto",className:"block drop-shadow-lg bg-transparent"}),T.jsx("h1",{className:"text-2xl font-bold my-1",children:"WebGPU Chat"}),T.jsx("h2",{className:"font-semibold",children:"local chat using onnxruntime-web and transformers.js"})]}),T.jsx("br",{}),T.jsxs("div",{className:"flex flex-col items-center px-4",children:[T.jsx("div",{className:"mb-4",children:T.jsxs("select",{className:"w-full p-2 border rounded-lg dark:bg-gray-700 dark:text-gray-200",defaultValue:"",onChange:O=>{const K=O.target.value;K&&(u.current.postMessage({type:"load_llm",data:c.current[K]}),v("loading"))},children:[T.jsx("option",{value:"",disabled:!0,children:"Select a model"}),be.map((O,K)=>T.jsx("option",{value:O,children:O},K))]})}),_&&T.jsxs("div",{className:"text-red-500 text-center mb-2",children:[T.jsx("p",{className:"mb-1",children:"Unable to load model due to the following error:"}),T.jsx("p",{className:"text-sm",children:_})]})]})]}),E==="loading"&&T.jsx(T.Fragment,{children:T.jsxs("div",{className:"w-full max-w-[500px] text-left mx-auto p-4 bottom-0 mt-auto",children:[T.jsx("p",{className:"text-center mb-1",children:C}),I.map(({file:O,progress:K,total:re},Te)=>T.jsx(Qh,{text:O,percentage:K,total:re},Te))]})}),E==="ready"&&T.jsxs("div",{ref:h,className:"overflow-y-auto scrollbar-thin w-full flex flex-col items-center h-full",children:[T.jsx(Hh,{messages:q}),q.length===0&&T.jsx("div",{children:tm.map((O,K)=>T.jsx("div",{className:"m-1 border border-gray-300 dark:border-gray-600 rounded-md p-2 bg-gray-100 dark:bg-gray-700 cursor-pointer max-w-[500px]",onClick:()=>gt(O),children:O},K))}),T.jsx("p",{className:"text-center text-sm min-h-6 text-gray-500 dark:text-gray-300",children:ie&&q.length>0&&T.jsxs(T.Fragment,{children:[!D&&T.jsxs("span",{children:["Generated ",Ce," tokens in"," ",(Ce/ie).toFixed(2)," seconds ("]}),T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"font-medium text-center mr-1 text-black dark:text-white",children:ie.toFixed(2)}),T.jsx("span",{className:"text-gray-500 dark:text-gray-300",children:"tokens/second"})]}),!D&&T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"mr-1",children:")."}),T.jsx("span",{className:"underline cursor-pointer",onClick:()=>{rn(),me([])},children:"Reset"})]})]})})]}),T.jsxs("div",{className:"w-[600px] max-w-[80%] mx-auto mt-2 mb-3",children:[T.jsxs("div",{className:"border border-gray-300 dark:border-gray-500 dark:bg-gray-700 rounded-lg max-h-[200px] relative flex",children:[T.jsx("textarea",{ref:f,className:"scrollbar-thin w-[550px] px-3 py-4 rounded-lg bg-transparent border-none outline-hidden text-gray-800 disabled:text-gray-400 dark:text-gray-200 placeholder-gray-500 dark:placeholder-gray-300 disabled:placeholder-gray-200 dark:disabled:placeholder-gray-500 resize-none disabled:cursor-not-allowed",placeholder:"Type your message...",type:"text",rows:1,value:he,disabled:E!=="ready",title:E==="ready"?"Model is ready":"Model not loaded yet",onKeyDown:O=>{he.length>0&&!D&&O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),gt(he))},onInput:O=>ve(O.target.value)}),T.jsx("div",{className:"flex items-center gap-2 absolute right-3 bottom-3",children:D?T.jsx("div",{className:"cursor-pointer",onClick:rn,children:T.jsx(Vh,{className:"h-8 w-8 p-1 rounded-md text-gray-800 dark:text-gray-100"})}):he.length>0?T.jsx("div",{className:"cursor-pointer",onClick:()=>gt(he),children:T.jsx(gf,{className:"h-8 w-8 p-1 bg-gray-800 dark:bg-gray-100 text-white dark:text-black rounded-md"})}):T.jsx("div",{className:"cursor-pointer",children:T.jsx(gf,{className:"h-8 w-8 p-1 bg-gray-200 dark:bg-gray-600 text-gray-50 dark:text-gray-800 rounded-md"})})})]}),T.jsxs("div",{className:"flex justify-end gap-2",children:[T.jsxs("div",{className:`border pointer-curson mt-1 inline-flex items-center p-2 gap-1 rounded-xl text-sm cursor-pointer ${tt?"border-blue-500 bg-blue-100 text-blue-500 dark:bg-blue-600 dark:text-gray-200":"dark:border-gray-700 bg-gray-800 text-gray-200 dark:text-gray-400"}`,onClick:()=>Ie(O=>!O),children:[T.jsx(Yh,{className:`h-4 w-4 ${tt?"":"stroke-gray-600 dark:stroke-gray-400"}`}),"Reason"]}),T.jsxs("div",{className:`border pointer-curson mt-1 inline-flex items-center p-2 gap-1 rounded-xl text-sm cursor-pointer ${Q?"border-blue-500 bg-blue-100 text-blue-500 dark:bg-blue-600 dark:text-gray-200":"dark:border-gray-700 bg-gray-800 text-gray-200 dark:text-gray-400"}`,onClick:()=>F(O=>!O),children:[T.jsx(Xh,{className:`h-4 w-4 ${Q?"":"text-gray-600 dark:text-gray-400"}`}),"TTS"]}),T.jsxs("div",{className:`border pointer-curson mt-1 inline-flex items-center p-2 gap-1 rounded-xl text-sm cursor-pointer ${Fe?"dark:border-gray-700 bg-gray-800 text-gray-200 dark:text-gray-400":"border-blue-500 bg-blue-100 text-blue-500 dark:bg-blue-600 dark:text-gray-200"}`,onClick:()=>mt(O=>!O),children:[Fe?T.jsx(Zh,{className:"h-4 w-4"}):T.jsx(Gh,{className:"h-4 w-4"}),"Mic"]})]})]}),T.jsx("p",{className:"text-xs text-gray-400 text-center mb-3",children:"Disclaimer: Generated content may be inaccurate or false."})]}):T.jsxs("div",{className:"fixed w-screen h-screen bg-black z-10 bg-opacity-[92%] text-white text-2xl font-semibold flex justify-center items-center text-center",children:["WebGPU is not supported",T.jsx("br",{}),"by this browser :("]})}Pp.createRoot(document.getElementById("root")).render(T.jsx(X.StrictMode,{children:T.jsx(rm,{})}));