diff --git "a/assets/index-BMyP1-hr.js" "b/assets/index-BMyP1-hr.js" new file mode 100644--- /dev/null +++ "b/assets/index-BMyP1-hr.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(y){return y===null||typeof y!="object"?null:(y=j&&y[j]||y["@@iterator"],typeof y=="function"?y:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,J={};function ne(y,R,Z){this.props=y,this.context=R,this.refs=J,this.updater=Z||B}ne.prototype.isReactComponent={},ne.prototype.setState=function(y,R){if(typeof y!="object"&&typeof y!="function"&&y!=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,y,R,"setState")},ne.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function Le(){}Le.prototype=ne.prototype;function he(y,R,Z){this.props=y,this.context=R,this.refs=J,this.updater=Z||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,le={current:null},ke={key:!0,ref:!0,__self:!0,__source:!0};function Te(y,R,Z){var oe,W={},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)&&(W[oe]=R[oe]);var ae=arguments.length-2;if(ae===1)W.children=Z;else if(1>>1,R=z[y];if(0>>1;yf(W,F))sef(de,W)?(z[y]=de,z[se]=F,y=se):(z[y]=W,z[oe]=F,y=oe);else if(sef(de,F))z[y]=de,z[se]=F,y=se;else break e}}return G}function f(z,G){var F=z.sortIndex-G.sortIndex;return F!==0?F:z.id-G.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,B=!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 G=s(w);G!==null;){if(G.callback===null)c(w);else if(G.startTime<=z)c(w),G.sortIndex=G.expirationTime,o(_,G);else break;G=s(w)}}function q(z){if(J=!1,ve(z),!D)if(s(_)!==null)D=!0,Ve(me);else{var G=s(w);G!==null&&_e(q,G.startTime-z)}}function me(z,G){D=!1,J&&(J=!1,Le(Te),Te=-1),B=!0;var F=I;try{for(ve(G),j=s(_);j!==null&&(!(j.expirationTime>G)||z&&!Ie());){var y=j.callback;if(typeof y=="function"){j.callback=null,I=j.priorityLevel;var R=y(j.expirationTime<=G);G=u.unstable_now(),typeof R=="function"?j.callback=R:j===s(_)&&c(_),ve(G)}else c(_);j=s(_)}if(j!==null)var Z=!0;else{var oe=s(w);oe!==null&&_e(q,oe.startTime-G),Z=!1}return Z}finally{j=null,I=F,B=!1}}var le=!1,ke=null,Te=-1,Mt=5,lt=-1;function Ie(){return!(u.unstable_now()-ltz||125y?(z.sortIndex=F,o(w,z),s(_)===null&&z===s(w)&&(J?(Le(Te),Te=-1):J=!0,_e(q,F-y))):(z.sortIndex=R,o(_,z),D||B||(D=!0,Ve(me))),z},u.unstable_shouldYield=Ie,u.unstable_wrapCallback=function(z){var G=I;return function(){var F=I;I=G;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 Ct;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 B(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"||B(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{Z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?R(e):""}function W(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 le:return"Portal";case Mt:return"Profiler";case Te: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 lt:return(e._context.displayName||"Context")+".Provider";case Qe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kt: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===Te?"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 ae(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ge(e){var t=pe(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 Ye(e){e._valueTracker||(e._valueTracker=Ge(e))}function Oe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=pe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rt(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 wt(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Zt(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ae(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 mn(e,t){t=t.checked,t!=null&&ve(e,"checked",t,!1)}function ct(e,t){mn(e,t);var n=ae(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")?bt(e,t.type,n):t.hasOwnProperty("defaultValue")&&bt(e,t.type,ae(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 bt(e,t,n){(t!=="number"||Rt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var O=Array.isArray;function K(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=dt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zt={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(zt).forEach(function(e){Er.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zt[t]=zt[e]})});function tr(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zt.hasOwnProperty(e)&&zt[e]?(""+t).trim():t+"px"}function Ot(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 Ln=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(Ln[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 Nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var An=null,In=null,Dt=null;function Gl(e){if(e=yl(e)){if(typeof An!="function")throw Error(s(280));var t=e.stateNode;t&&(t=hi(t),An(e.stateNode,e.type,t))}}function Zl(e){In?Dt?Dt.push(e):Dt=[e]:In=e}function Be(){if(In){var e=In,t=Dt;if(Dt=In=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-Xt(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=Un=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=Rt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(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!==Rt(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 Hn={},ot=Wn(Hn),xt=Wn(!1),cr=Hn;function Dr(e,t){var n=e.type.contextTypes;if(!n)return Hn;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 St(e){return e=e.childContextTypes,e!=null}function mi(){Me(xt),Me(ot)}function ca(e,t,n){if(ot.current!==Hn)throw Error(s(168));Ae(ot,t),Ae(xt,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||Hn,cr=ot.current,Ae(ot,e),Ae(xt,xt.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,Me(xt),Me(ot),Ae(ot,e)):Me(xt),Ae(xt,n)}var vn=null,yi=!1,Ho=!1;function pa(e){vn===null?vn=[e]:vn.push(e)}function Bd(e){yi=!0,pa(e)}function Vn(){if(!Ho&&vn!==null){Ho=!0;var e=0,t=Se;try{var n=vn;for(Se=1;e>=a,l-=a,kn=1<<32-Xt(t)+l|n<re?(et=te,te=null):et=te.sibling;var ye=L(k,te,x[re],M);if(ye===null){te===null&&(te=et);break}e&&te&&ye.alternate===null&&t(k,te),g=i(ye,g,re),ee===null?Q=ye:ee.sibling=ye,ee=ye,te=et}if(re===x.length)return n(k,te),ze&&dr(k,re),Q;if(te===null){for(;rere?(et=te,te=null):et=te.sibling;var qn=L(k,te,ye.value,M);if(qn===null){te===null&&(te=et);break}e&&te&&qn.alternate===null&&t(k,te),g=i(qn,g,re),ee===null?Q=qn:ee.sibling=qn,ee=qn,te=et}if(ye.done)return n(k,te),ze&&dr(k,re),Q;if(te===null){for(;!ye.done;re++,ye=x.next())ye=A(k,ye.value,M),ye!==null&&(g=i(ye,g,re),ee===null?Q=ye:ee.sibling=ye,ee=ye);return ze&&dr(k,re),Q}for(te=r(k,te);!ye.done;re++,ye=x.next())ye=U(te,k,re,ye.value,M),ye!==null&&(e&&ye.alternate!==null&&te.delete(ye.key===null?re:ye.key),g=i(ye,g,re),ee===null?Q=ye:ee.sibling=ye,ee=ye);return e&&te.forEach(function(wp){return t(k,wp)}),ze&&dr(k,re),Q}function $e(k,g,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 Q=x.key,ee=g;ee!==null;){if(ee.key===Q){if(Q=x.type,Q===ke){if(ee.tag===7){n(k,ee.sibling),g=l(ee,x.props.children),g.return=k,k=g;break e}}else if(ee.elementType===Q||typeof Q=="object"&&Q!==null&&Q.$$typeof===Ve&&ka(Q)===ee.type){n(k,ee.sibling),g=l(ee,x.props),g.ref=vl(k,ee,x),g.return=k,k=g;break e}n(k,ee);break}else t(k,ee);ee=ee.sibling}x.type===ke?(g=wr(x.props.children,k.mode,M,x.key),g.return=k,k=g):(M=Gi(x.type,x.key,x.props,null,k.mode,M),M.ref=vl(k,g,x),M.return=k,k=M)}return a(k);case le:e:{for(ee=x.key;g!==null;){if(g.key===ee)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(k,g.sibling),g=l(g,x.children||[]),g.return=k,k=g;break e}else{n(k,g);break}else t(k,g);g=g.sibling}g=Bs(x,k.mode,M),g.return=k,k=g}return a(k);case Ve:return ee=x._init,$e(k,g,ee(x._payload),M)}if(O(x))return H(k,g,x,M);if(G(x))return b(k,g,x,M);xi(k,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(n(k,g.sibling),g=l(g,x),g.return=k,k=g):(n(k,g),g=Us(x,k.mode,M),g.return=k,k=g),a(k)):n(k,g)}return $e}var Br=wa(!0),xa=wa(!1),Si=Wn(null),Ei=null,$r=null,Yo=null;function Xo(){Yo=$r=Ei=null}function Ko(e){var t=Si.current;Me(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&&(Et=!0),e.firstContext=null)}function $t(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,xn(e,r)}function xn(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 Gn=!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 Sn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Zn(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,xn(e,n)}return l=r.interleaved,l===null?(t.next=t,qo(r)):(t.next=l.next,l.next=t),r.interleaved=t,xn(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;Gn=!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,b=d;switch(L=t,U=n,b.tag){case 1:if(H=b.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=b.payload,L=typeof H=="function"?H.call(U,A,L):H,L==null)break e;A=F({},A,L);break e;case 2:Gn=!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 Wt().memoizedState}function Vd(e,t,n){var r=Xn(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=ht();nn(n,e,r,l),ba(n,t,r)}}function Gd(e,t,n){var r=Xn(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,Kt(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=ht(),nn(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:$t,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useInsertionEffect:st,useLayoutEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useMutableSource:st,useSyncExternalStore:st,useId:st,unstable_isNewReconciler:!1},Zd={readContext:$t,useCallback:function(e,t){return dn().memoizedState=[e,t===void 0?null:t],e},useContext:$t,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=dn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=dn();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=dn();return e={current:e},t.memoizedState=e},useState:za,useDebugValue:ds,useDeferredValue:function(e){return dn().memoizedState=e},useTransition:function(){var e=za(!1),t=e[0];return e=Hd.bind(null,e[1]),dn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,l=dn();if(ze){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),qe===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=dn(),t=qe.identifierPrefix;if(ze){var n=wn,r=kn;n=(r&~(1<<32-Xt(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[cn]=t,e[gl]=r,pc(e,t,!1,!1),t.stateNode=e;e:{switch(a=rr(n,r),n){case"dialog":Pe("cancel",e),Pe("close",e),l=r;break;case"iframe":case"object":case"embed":Pe("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&&!ze)return ut(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):(ut(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&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(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 St(t.type)&&mi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hr(),Me(xt),Me(ot),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(Me(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 Me(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,at=!1,tp=typeof WeakSet=="function"?WeakSet:Set,$=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,$=t;$!==null;)if(t=$,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$=e;else for(;$!==null;){t=$;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 b=H.memoizedProps,$e=H.memoizedState,k=t.stateNode,g=k.getSnapshotBeforeUpdate(t.elementType===t.type?b:qt(t.type,b),$e);k.__reactInternalSnapshotBeforeUpdate=g}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,$=e;break}$=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[cn],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 nt=null,en=!1;function bn(e,t,n){for(n=n.child;n!==null;)wc(e,t,n),n=n.sibling}function wc(e,t,n){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(ur,n)}catch{}switch(n.tag){case 5:at||Gr(n,t);case 6:var r=nt,l=en;nt=null,bn(e,t,n),nt=r,en=l,nt!==null&&(en?(e=nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):nt.removeChild(n.stateNode));break;case 18:nt!==null&&(en?(e=nt,n=n.stateNode,e.nodeType===8?Bo(e.parentNode,n):e.nodeType===1&&Bo(e,n),il(e)):Bo(nt,n.stateNode));break;case 4:r=nt,l=en,nt=n.stateNode.containerInfo,en=!0,bn(e,t,n),nt=r,en=l;break;case 0:case 11:case 14:case 15:if(!at&&(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)}bn(e,t,n);break;case 1:if(!at&&(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)}bn(e,t,n);break;case 21:bn(e,t,n);break;case 22:n.mode&1?(at=(r=at)||n.memoizedState!==null,bn(e,t,n),at=r):bn(e,t,n);break;default:bn(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 tn(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,Yn===null)var r=!1;else{if(e=Yn,Yn=null,$i=0,(ge&6)!==0)throw Error(s(331));var l=ge;for(ge|=4,$=e.current;$!==null;){var i=$,a=i.child;if(($.flags&16)!==0){var d=i.deletions;if(d!==null){for(var p=0;pue()-As?vr(e,0):Ns|=n),Tt(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=ht();e=xn(e,t),e!==null&&(el(e,t,n),Tt(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||xt.current)Et=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Et=!1,Jd(e,t,n);Et=(e.flags&131072)!==0}else Et=!1,ze&&(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,ot.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,St(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,ze&&i&&Vo(t),pt(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=qt(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,qt(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:qt(r,l),ys(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:qt(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=$n(t.stateNode.containerInfo.firstChild),At=t,ze=!0,Jt=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=En(e,t,n);break e}pt(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),pt(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):pt(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:qt(r,l),nc(e,t,r,l,n);case 7:return pt(e,t,t.pendingProps,n),t.child;case 8:return pt(e,t,t.pendingProps.children,n),t.child;case 12:return pt(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(Kt(i.value,a)){if(i.children===l.children&&!xt.current){t=En(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=Sn(-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}pt(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Wr(t,n),l=$t(l),r=r(l),t.flags|=1,pt(e,t,r,n),t.child;case 14:return r=t.type,l=qt(r,t.pendingProps),l=qt(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:qt(r,l),zi(e,t),t.tag=1,St(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 Vt(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===Qe)return 11;if(e===kt)return 14}return 2}function Jn(e,t){var n=e.alternate;return n===null?(n=Vt(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 Te:a=8,l|=8;break;case Mt:return e=Vt(12,n,t,l|2),e.elementType=Mt,e.lanes=i,e;case He:return e=Vt(13,n,t,l),e.elementType=He,e.lanes=i,e;case Fe:return e=Vt(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 lt:a=10;break e;case Ie:a=9;break e;case Qe:a=11;break e;case kt:a=14;break e;case Ve:a=16,r=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Vt(a,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function wr(e,t,n,r){return e=Vt(7,e,r,t),e.lanes=n,e}function Zi(e,t,n,r){return e=Vt(22,e,r,t),e.elementType=_e,e.lanes=n,e.stateNode={isHidden:!1},e}function Us(e,t,n){return e=Vt(6,e,null,t),e.lanes=n,e}function Bs(e,t,n){return t=Vt(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=Vt(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 we(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(gt.caret,"$1"),s=s.replace(f,E),c},getRegex:()=>new RegExp(s,o)};return c}var gt={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=we(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=we(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=we(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Bp=we(/^( {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=we("^ {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=we(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=we(/^( {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=we("^ *([^\\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:we(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:we(`^ *(?: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:we(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=we(Rf,"u").replace(/punct/g,ao).getRegex(),qp=we(Rf,"u").replace(/punct/g,Cf).getRegex(),Lf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",eh=we(Lf,"gu").replace(/notPunctSpace/g,Tf).replace(/punctSpace/g,gu).replace(/punct/g,ao).getRegex(),th=we(Lf,"gu").replace(/notPunctSpace/g,Xp).replace(/punctSpace/g,Yp).replace(/punct/g,Cf).getRegex(),nh=we("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)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=we(/\\(punct)/,"gu").replace(/punct/g,ao).getRegex(),lh=we(/^<(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=we(hu).replace("(?:-->|$)","-->").getRegex(),oh=we("^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=we(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",io).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nf=we(/^!?\[(label)\]\[(ref)\]/).replace("label",io).replace("ref",pu).getRegex(),Af=we(/^!?\[(ref)\](?:\[\])?/).replace("ref",pu).getRegex(),uh=we("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:we(/^!?\[(label)\]\((.*?)\)/).replace("label",io).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",io).getRegex()},nu={...yu,emStrongRDelimAst:th,emStrongLDelim:qp,url:we(/^((?: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 hn(u,o){if(o){if(gt.escapeTest.test(u))return u.replace(gt.escapeReplace,Jc)}else if(gt.escapeTestNoEncode.test(u))return u.replace(gt.escapeReplaceNoEncode,Jc);return u}function qc(u){try{u=encodeURI(u).replace(gt.percentDecode,"%")}catch{return null}return u}function ef(u,o){var h;const s=u.replace(gt.findPipe,(E,v,_)=>{let w=!1,C=v;for(;--C>=0&&_[C]==="\\";)w=!w;return w?"|":" |"}),c=s.split(gt.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],B=!j.trim(),D=0;if(this.options.pedantic?(D=2,C=j.trimStart()):B?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),B&&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 le=u.split(` +`,1)[0];let ke;if(I=le,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(B||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ve.test(j)||q.test(j)||he.test(j))break;C+=` +`+I}!B&&!I.trim()&&(B=!0),w+=le+` +`,u=u.substring(le.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 B=I.slice(2,-2);return{type:"strong",raw:I,text:B,tokens:this.lexer.inlineTokens(B)}}}}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}}}},Cn=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:gt,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(gt.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 B=o.slice(1);let D;this.options.extensions.startInline.forEach(J=>{D=J.call({lexer:this},B),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(gt.notSpaceStart))==null?void 0:h[0],f=u.replace(gt.endingNewline,"")+` +`;return c?'
'+(s?f:hn(f,!0))+`
+`:"
"+(s?f:hn(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+" "+hn(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`${hn(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 hn(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 Cn.lex(u,o??this.defaults)}parser(u,o){return Rn.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?Cn.lex:Cn.lexInline,_=h.hooks?h.hooks.provideParser():u?Rn.parse:Rn.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:

    "+hn(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=Rn;Ee.parser=Rn.parse;Ee.Renderer=so;Ee.TextRenderer=vu;Ee.Lexer=Cn;Ee.lexer=Cn.lex;Ee.Tokenizer=oo;Ee.Hooks=ro;Ee.parse=Ee;Ee.options;Ee.setOptions;Ee.use;Ee.walkTokens;Ee.parseInline;Rn.parse;Cn.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:yt,seal:Gt,create:Pf}=Object,{apply:iu,construct:ou}=typeof Reflect<"u"&&Reflect;yt||(yt=function(o){return o});Gt||(Gt=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=vt(Array.prototype.forEach),vh=vt(Array.prototype.lastIndexOf),rf=vt(Array.prototype.pop),Ol=vt(Array.prototype.push),kh=vt(Array.prototype.splice),lo=vt(String.prototype.toLowerCase),Xs=vt(String.prototype.toString),lf=vt(String.prototype.match),Dl=vt(String.prototype.replace),wh=vt(String.prototype.indexOf),xh=vt(String.prototype.trim),rn=vt(Object.prototype.hasOwnProperty),mt=vt(RegExp.prototype.test),jl=Sh(TypeError);function vt(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=Gt(/\$\{[\w\W]*/gm),Nh=Gt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ah=Gt(/^aria-[\-\w]+$/),Mf=Gt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ih=Gt(/^(?:\w+script|data):/i),Ph=Gt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zf=Gt(/^html$/i),Mh=Gt(/^[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:B}=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:le,createNodeIterator:ke,createDocumentFragment:Te,getElementsByTagName:Mt}=s,{importNode:lt}=c;let Ie=ff();o.isSupported=typeof If=="function"&&typeof ve=="function"&&le&&le.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Qe,ERB_EXPR:He,TMPLIT_EXPR:Fe,DATA_ATTR:kt,ARIA_ATTR:Ve,IS_SCRIPT_OR_DATA:_e,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:G}=cf;let{IS_ALLOWED_URI:F}=cf,y=null;const R=fe({},[...of,...Ks,...Js,...qs,...sf]);let Z=null;const oe=fe({},[...uf,...eu,...af,...no]);let W=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,ae=!0,pe=!0,Ge=!1,Ye=!0,Oe=!1,Rt=!0,wt=!1,Zt=!1,mn=!1,ct=!1,ln=!1,bt=!1,O=!0,K=!1;const ie="user-content-";let xe=!0,Ce=!1,tt={},ft=null;const on=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 dt=null;const sn=fe({},["audio","video","img","source","image","track"]);let Qt=null;const zt=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",Ot="http://www.w3.org/1999/xhtml";let Ln=Ot,nr=!1,rr=null;const Yr=fe({},[Er,tr,Ot],Xs);let Nn=fe({},["mi","mo","mn","ms","mtext"]),An=fe({},["annotation-xml"]);const In=fe({},["title","style","font","a","script"]);let Dt=null;const Gl=["application/xhtml+xml","text/html"],Zl="text/html";let Be=null,gn=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(!(gn&&gn===m)){if((!m||typeof m!="object")&&(m={}),m=Tn(m),Dt=Gl.indexOf(m.PARSER_MEDIA_TYPE)===-1?Zl:m.PARSER_MEDIA_TYPE,Be=Dt==="application/xhtml+xml"?Xs:lo,y=rn(m,"ALLOWED_TAGS")?fe({},m.ALLOWED_TAGS,Be):R,Z=rn(m,"ALLOWED_ATTR")?fe({},m.ALLOWED_ATTR,Be):oe,rr=rn(m,"ALLOWED_NAMESPACES")?fe({},m.ALLOWED_NAMESPACES,Xs):Yr,Qt=rn(m,"ADD_URI_SAFE_ATTR")?fe(Tn(zt),m.ADD_URI_SAFE_ATTR,Be):zt,dt=rn(m,"ADD_DATA_URI_TAGS")?fe(Tn(sn),m.ADD_DATA_URI_TAGS,Be):sn,ft=rn(m,"FORBID_CONTENTS")?fe({},m.FORBID_CONTENTS,Be):on,se=rn(m,"FORBID_TAGS")?fe({},m.FORBID_TAGS,Be):Tn({}),de=rn(m,"FORBID_ATTR")?fe({},m.FORBID_ATTR,Be):Tn({}),tt=rn(m,"USE_PROFILES")?m.USE_PROFILES:!1,ae=m.ALLOW_ARIA_ATTR!==!1,pe=m.ALLOW_DATA_ATTR!==!1,Ge=m.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=m.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Oe=m.SAFE_FOR_TEMPLATES||!1,Rt=m.SAFE_FOR_XML!==!1,wt=m.WHOLE_DOCUMENT||!1,ct=m.RETURN_DOM||!1,ln=m.RETURN_DOM_FRAGMENT||!1,bt=m.RETURN_TRUSTED_TYPE||!1,mn=m.FORCE_BODY||!1,O=m.SANITIZE_DOM!==!1,K=m.SANITIZE_NAMED_PROPS||!1,xe=m.KEEP_CONTENT!==!1,Ce=m.IN_PLACE||!1,F=m.ALLOWED_URI_REGEXP||Mf,Ln=m.NAMESPACE||Ot,Nn=m.MATHML_TEXT_INTEGRATION_POINTS||Nn,An=m.HTML_INTEGRATION_POINTS||An,W=m.CUSTOM_ELEMENT_HANDLING||{},m.CUSTOM_ELEMENT_HANDLING&&_r(m.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=m.CUSTOM_ELEMENT_HANDLING.tagNameCheck),m.CUSTOM_ELEMENT_HANDLING&&_r(m.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=m.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),m.CUSTOM_ELEMENT_HANDLING&&typeof m.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=m.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Oe&&(pe=!1),ln&&(ct=!0),tt&&(y=fe({},sf),Z=[],tt.html===!0&&(fe(y,of),fe(Z,uf)),tt.svg===!0&&(fe(y,Ks),fe(Z,eu),fe(Z,no)),tt.svgFilters===!0&&(fe(y,Js),fe(Z,eu),fe(Z,no)),tt.mathMl===!0&&(fe(y,qs),fe(Z,af),fe(Z,no))),m.ADD_TAGS&&(y===R&&(y=Tn(y)),fe(y,m.ADD_TAGS,Be)),m.ADD_ATTR&&(Z===oe&&(Z=Tn(Z)),fe(Z,m.ADD_ATTR,Be)),m.ADD_URI_SAFE_ATTR&&fe(Qt,m.ADD_URI_SAFE_ATTR,Be),m.FORBID_CONTENTS&&(ft===on&&(ft=Tn(ft)),fe(ft,m.FORBID_CONTENTS,Be)),xe&&(y["#text"]=!0),wt&&fe(y,["html","head","body"]),y.table&&(fe(y,["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(B,f)),q!==null&&typeof me=="string"&&(me=q.createHTML(""));yt&&yt(m),gn=m}},Pn=fe({},[...Ks,...Js,..._h]),Cr=fe({},[...qs,...Th]),lr=function(m){let P=ve(m);(!P||!P.tagName)&&(P={namespaceURI:Ln,tagName:"template"});const V=lo(m.tagName),Ne=lo(P.tagName);return rr[m.namespaceURI]?m.namespaceURI===tr?P.namespaceURI===Ot?V==="svg":P.namespaceURI===Er?V==="svg"&&(Ne==="annotation-xml"||Nn[Ne]):!!Pn[V]:m.namespaceURI===Er?P.namespaceURI===Ot?V==="math":P.namespaceURI===tr?V==="math"&&An[Ne]:!!Cr[V]:m.namespaceURI===Ot?P.namespaceURI===tr&&!An[Ne]||P.namespaceURI===Er&&!Nn[Ne]?!1:!Cr[V]&&(In[V]||!Pn[V]):!!(Dt==="application/xhtml+xml"&&rr[m.namespaceURI]):!1},jt=function(m){Ol(o.removed,{element:m});try{ve(m).removeChild(m)}catch{ne(m)}},Ft=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(ct||ln)try{jt(P)}catch{}else try{P.setAttribute(m,"")}catch{}},ir=function(m){let P=null,V=null;if(mn)m=""+m;else{const ue=lf(m,/^[\r\n\t ]+/);V=ue&&ue[0]}Dt==="application/xhtml+xml"&&Ln===Ot&&(m=''+m+"");const Ne=q?q.createHTML(m):m;if(Ln===Ot)try{P=new I().parseFromString(Ne,Dt)}catch{}if(!P||!P.documentElement){P=le.createDocument(Ln,"template",null);try{P.documentElement.innerHTML=nr?me:Ne}catch{}}const Xe=P.body||P.documentElement;return m&&V&&Xe.insertBefore(s.createTextNode(V),Xe.childNodes[0]||null),Ln===Ot?Mt.call(P,wt?"html":"body")[0]:wt?P.documentElement:Xe},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 Yt(Y,m,P){to(Y,V=>{V.call(o,m,P,gn)})}const Yl=function(m){let P=null;if(Yt(Ie.beforeSanitizeElements,m,null),sr(m))return jt(m),!0;const V=Be(m.nodeName);if(Yt(Ie.uponSanitizeElement,m,{tagName:V,allowedTags:y}),Rt&&m.hasChildNodes()&&!Ql(m.firstElementChild)&&mt(/<[/\w!]/g,m.innerHTML)&&mt(/<[/\w!]/g,m.textContent)||m.nodeType===Ul.progressingInstruction||Rt&&m.nodeType===Ul.comment&&mt(/<[/\w]/g,m.data))return jt(m),!0;if(!y[V]||se[V]){if(!se[V]&&Xr(V)&&(W.tagNameCheck instanceof RegExp&&mt(W.tagNameCheck,V)||W.tagNameCheck instanceof Function&&W.tagNameCheck(V)))return!1;if(xe&&!ft[V]){const Ne=ve(m)||m.parentNode,Xe=he(m)||m.childNodes;if(Xe&&Ne){const ue=Xe.length;for(let it=ue-1;it>=0;--it){const Lt=J(Xe[it],!0);Lt.__removalCount=(m.__removalCount||0)+1,Ne.insertBefore(Lt,Le(m))}}}return jt(m),!0}return m instanceof _&&!lr(m)||(V==="noscript"||V==="noembed"||V==="noframes")&&mt(/<\/no(script|embed|frames)/i,m.innerHTML)?(jt(m),!0):(Oe&&m.nodeType===Ul.text&&(P=m.textContent,to([Qe,He,Fe],Ne=>{P=Dl(P,Ne," ")}),m.textContent!==P&&(Ol(o.removed,{element:m.cloneNode()}),m.textContent=P)),Yt(Ie.afterSanitizeElements,m,null),!1)},un=function(m,P,V){if(O&&(P==="id"||P==="name")&&(V in s||V in bl))return!1;if(!(pe&&!de[P]&&mt(kt,P))){if(!(ae&&mt(Ve,P))){if(!Z[P]||de[P]){if(!(Xr(m)&&(W.tagNameCheck instanceof RegExp&&mt(W.tagNameCheck,m)||W.tagNameCheck instanceof Function&&W.tagNameCheck(m))&&(W.attributeNameCheck instanceof RegExp&&mt(W.attributeNameCheck,P)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(P))||P==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&mt(W.tagNameCheck,V)||W.tagNameCheck instanceof Function&&W.tagNameCheck(V))))return!1}else if(!Qt[P]){if(!mt(F,Dl(V,z,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&m!=="script"&&wh(V,"data:")===0&&dt[m])){if(!(Ge&&!mt(_e,Dl(V,z,"")))){if(V)return!1}}}}}}return!0},Xr=function(m){return m!=="annotation-xml"&&lf(m,G)},Kr=function(m){Yt(Ie.beforeSanitizeAttributes,m,null);const{attributes:P}=m;if(!P||sr(m))return;const V={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let Ne=P.length;for(;Ne--;){const Xe=P[Ne],{name:ue,namespaceURI:it,value:Lt}=Xe,Mn=Be(ue),zn=Lt;let Ke=ue==="value"?zn:xh(zn);if(V.attrName=Mn,V.attrValue=Ke,V.keepAttr=!0,V.forceKeepAttr=void 0,Yt(Ie.uponSanitizeAttribute,m,V),Ke=V.attrValue,K&&(Mn==="id"||Mn==="name")&&(Ft(ue,m),Ke=ie+Ke),Rt&&mt(/((--!?|])>)|<\/(style|title)/i,Ke)){Ft(ue,m);continue}if(V.forceKeepAttr)continue;if(!V.keepAttr){Ft(ue,m);continue}if(!Ye&&mt(/\/>/i,Ke)){Ft(ue,m);continue}Oe&&to([Qe,He,Fe],ur=>{Ke=Dl(Ke,ur," ")});const Jr=Be(m.nodeName);if(!un(Jr,Mn,Ke)){Ft(ue,m);continue}if(q&&typeof B=="object"&&typeof B.getAttributeType=="function"&&!it)switch(B.getAttributeType(Jr,Mn)){case"TrustedHTML":{Ke=q.createHTML(Ke);break}case"TrustedScriptURL":{Ke=q.createScriptURL(Ke);break}}if(Ke!==zn)try{it?m.setAttributeNS(it,ue,Ke):m.setAttribute(ue,Ke),sr(m)?jt(m):rf(o.removed)}catch{Ft(ue,m)}}Yt(Ie.afterSanitizeAttributes,m,null)},co=function Y(m){let P=null;const V=or(m);for(Yt(Ie.beforeSanitizeShadowDOM,m,null);P=V.nextNode();)Yt(Ie.uponSanitizeShadowNode,P,null),Yl(P),Kr(P),P.content instanceof h&&Y(P.content);Yt(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,Xe=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(Zt||Tr(m),o.removed=[],typeof Y=="string"&&(Ce=!1),Ce){if(Y.nodeName){const Lt=Be(Y.nodeName);if(!y[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(!ct&&!Oe&&!wt&&Y.indexOf("<")===-1)return q&&bt?q.createHTML(Y):Y;if(P=ir(Y),!P)return ct?null:bt?me:""}P&&mn&&jt(P.firstChild);const ue=or(Ce?Y:P);for(;Ne=ue.nextNode();)Yl(Ne),Kr(Ne),Ne.content instanceof h&&co(Ne.content);if(Ce)return Y;if(ct){if(ln)for(Xe=Te.call(P.ownerDocument);P.firstChild;)Xe.appendChild(P.firstChild);else Xe=P;return(Z.shadowroot||Z.shadowrootmode)&&(Xe=lt.call(c,Xe,!0)),Xe}let it=wt?P.outerHTML:P.innerHTML;return wt&&y["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&mt(zf,P.ownerDocument.doctype.name)&&(it=" +`+it),Oe&&to([Qe,He,Fe],Lt=>{it=Dl(it,Lt," ")}),q&&bt?q.createHTML(it):it},o.setConfig=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tr(Y),Zt=!0},o.clearConfig=function(){gn=null,Zt=!1},o.isValidAttribute=function(Y,m,P){gn||Tr({});const V=Be(Y),Ne=Be(m);return un(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,B]=X.useState([]),[D,J]=X.useState(!1),[ne,Le]=X.useState(!1),[he,ve]=X.useState(""),[q,me]=X.useState([]),[le,ke]=X.useState(null),[Te,Mt]=X.useState(null),[lt,Ie]=X.useState(!1),[Qe,He]=X.useState([]),[Fe,kt]=X.useState(!0),[Ve,_e]=X.useState(!1),z=X.useRef(null),[G,F]=X.useState(!1),[y,R]=X.useState(!1),[Z,oe]=X.useState(null),[W,se]=X.useState([]),[de,ae]=X.useState(!1),[pe,Ge]=X.useState(!1),Ye=X.useRef(null),Oe=X.useRef(null),[Rt,wt]=X.useState(null);X.useEffect(()=>{Qe.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))},[Qe]);function Zt(O){me(K=>[...K,{role:"user",content:O}]),ke(null),J(!0),ve("")}function mn(){o.current&&o.current.postMessage({type:"interrupt",data:{text:""}}),Ye.current&&(Ye.current.pause(),Ye.current.src="",Oe.current&&(URL.revokeObjectURL(Oe.current),Oe.current=null)),se([]),ae(!1)}function ct(O){return u.current.postMessage({type:O}),mn(),!0}X.useEffect(()=>{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`},[he]),X.useEffect(()=>{if(!(Fe||Ve||!u.current)){if(_e(!0),!s.current){s.current=new Worker(new URL("/assets/stt-worker-CLcpnMT7.js",import.meta.url),{type:"module"});const O=ie=>{switch(ie.data.status){case"ready":console.log("STT Worker: Ready.");break;case"from_stt":ie.data.text.toLowerCase().includes("reset.")?(ct("reset"),me([])):ie.data.text.toLowerCase().includes("stop.")?ct("interrupt"):Zt(ie.data.text);break;case"error":w(ie.data.data);break}},K=ie=>{console.error("Worker error:",ie)};s.current.addEventListener("message",O),s.current.addEventListener("error",K),s.current.postMessage({type:"load"})}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,ie,xe=!1;const Ce=Promise.resolve(z.current);return Ce.then(async tt=>{xe||(K=new(window.AudioContext||window.webkitAudioContext)({sampleRate:vf}),ie=K.createMediaStreamSource(tt),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,channelCountMode:"explicit",channelInterpretation:"discrete"}),ie.connect(O),O.port.onmessage=ft=>{var dt;const{buffer:on}=ft.data;ne&&((dt=s.current)==null||dt.postMessage({type:"audio",data:on}))})}).catch(tt=>{console.error(tt)}),()=>{xe=!0,Ce.then(tt=>tt.getTracks().forEach(ft=>ft.stop())),ie==null||ie.disconnect(),O==null||O.disconnect(),K==null||K.close()}}},[ne,Fe]),X.useEffect(()=>{G||mn()},[G]);const ln=X.useCallback(O=>{se(K=>(K.length>=yf&&!pe&&Ge(!0),[...K,O]))},[]),bt=X.useCallback(()=>{if(W.length===0||de)return;console.log("next audio chunk, queue length:",W.length);const O=W[0];pe&&W.length{ae(!1)},Ye.current.onerror=ie=>{var xe;console.error("Audio playback error:",ie),Oe.current===((xe=Ye.current)==null?void 0:xe.src)&&(URL.revokeObjectURL(Oe.current),Oe.current=null),ae(!1)}),se(ie=>ie.slice(1)),Ye.current.src=K,ae(!0),Ye.current.play().then(()=>{}).catch(ie=>{console.error(`Error starting audio playback for ${K}:`,ie),Oe.current===K&&(URL.revokeObjectURL(Oe.current),Oe.current=null),ae(!1)})},[W,pe,de]);return X.useEffect(()=>{!de&&W.length>0&&bt()},[de,W.length,bt]),X.useEffect(()=>{const O=ie=>{const{status:xe,chunk:Ce}=ie.data;switch(xe){case"ready":console.log("TTS Worker is ready"),R(!0);break;case"stream":Ce&&Ce.audio instanceof Blob?ln(Ce.audio):console.warn("Received stream message without valid audio blob:",Ce);break;case"error":w(ie.data.data);break;default:console.warn("Unknown TTS worker message status:",xe);break}},K=ie=>{console.error("TTS Worker error:",ie)};return!o.current&&G&&(o.current=new Worker(new URL("/assets/tts-worker-CN-gjxwV.js",import.meta.url),{type:"module"}),o.current.addEventListener("message",O),o.current.addEventListener("error",K)),G&&o.current.postMessage({type:"load"}),o.current?()=>{}:()=>{}},[ln,G]),X.useEffect(()=>{Rt!==null&&(o.current.postMessage({type:"speak",data:{text:Rt,voice:Kh,speed:Jh}}),wt(null))},[Rt]),X.useEffect(()=>{u.current||(u.current=new Worker(new URL("/assets/llm-worker-CHNvH3o6.js",import.meta.url),{type:"module"}));const O=ie=>{switch(ie.data.status){case"loading":v("loading"),j(ie.data.data);break;case"initiate":B(xe=>[...xe,ie.data]);break;case"progress":B(xe=>xe.map(Ce=>Ce.file===ie.data.file?{...Ce,...ie.data}:Ce));break;case"done":B(xe=>xe.filter(Ce=>Ce.file!==ie.data.file));break;case"ready":v("ready"),Le(!0);break;case"start":me(xe=>[...xe,{role:"assistant",content:""}]);break;case"update":{const{output:xe,tps:Ce,numTokens:tt,state:ft}=ie.data;ke(Ce),Mt(tt),me(on=>{const dt=[...on],sn=dt.at(-1);if(sn){const Qt=sn.content+xe,zt={...sn,content:Qt};zt.answerIndex===void 0&&ft==="answering"&&(zt.answerIndex=sn.content.length),dt[dt.length-1]=zt}return dt})}break;case"complete":J(!1);break;case"error":w(ie.data.data);break}},K=ie=>{console.error("Worker error:",ie)};return u.current.addEventListener("message",O),u.current.addEventListener("error",K),()=>{u.current.removeEventListener("message",O),u.current.removeEventListener("error",K)}},[]),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:lt}})},[q,D,lt]),X.useEffect(()=>{if(!h.current)return;const O=h.current;D&&O.scrollHeight-O.scrollTop-O.clientHeight1&&G){const ie=K.length>Z+30,xe=W.length<3;if(!D&&Z==K.length&&W.length==0&&o.current.postMessage({type:"flush",data:{text:""}}),!D||ie&&xe&&!pe){const Ce=K.slice(Z-1,K.length-1).trim().replace(/\*/g,"");Ce!==""&&(wt(Ce),oe(K.length))}}},[q,D,Z,G,pe,W.length,y]),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",data:c.current[K]}),v("loading"))},children:[T.jsx("option",{value:"",disabled:!0,children:"Select a model"}),Qe.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:ie},xe)=>T.jsx(Qh,{text:O,percentage:K,total:ie},xe))]})}),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:()=>Zt(O),children:O},K))}),T.jsx("p",{className:"text-center text-sm min-h-6 text-gray-500 dark:text-gray-300",children:le&&q.length>0&&T.jsxs(T.Fragment,{children:[!D&&T.jsxs("span",{children:["Generated ",Te," tokens in"," ",(Te/le).toFixed(2)," seconds ("]}),T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"font-medium text-center mr-1 text-black dark:text-white",children:le.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:()=>{ct("reset"),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(),Zt(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:()=>{ct("interrupt")},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:()=>Zt(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 ${lt?"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 ${lt?"":"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 ${G?"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:()=>{G&&R(!1),F(O=>!O)},children:[T.jsx(Xh,{className:`h-4 w-4 ${G?"":"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:()=>kt(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,{})}));